react-blockkit 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -8
- package/dist/blocks/AdvancedBlocks.d.ts.map +1 -1
- package/dist/blocks/BasicBlocks.d.ts.map +1 -1
- package/dist/blocks/InteractiveBlocks.d.ts.map +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.js +297 -266
- package/dist/index.js.map +1 -1
- package/dist/styles.css +24 -0
- package/dist/styles.d.ts +1 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/text/Markdown.d.ts.map +1 -1
- package/dist/text/Mrkdwn.d.ts +7 -1
- package/dist/text/Mrkdwn.d.ts.map +1 -1
- package/dist/validation.d.ts.map +1 -1
- package/docs/slack-style-baseline.md +1 -1
- package/package.json +3 -3
- package/docs/coverage-matrix.md +0 -80
- package/docs/parity/chart-bar-3-w580-dark.png +0 -0
- package/docs/parity/chart-bar-3-w580-light.png +0 -0
- package/docs/parity/chart-line-3-w580-light.png +0 -0
- package/docs/parity/chart-pie-12-w400-light.png +0 -0
- package/docs/parity/chart-pie-5-w580-light.png +0 -0
- package/docs/parity/data-table-w580-dark.png +0 -0
- package/docs/parity/data-table-w580-light.png +0 -0
- package/docs/parity/headers-levels-w580-light.png +0 -0
- package/docs/parity/icons-alert-info.png +0 -0
- package/docs/parity/icons-card-slack-icon.png +0 -0
- package/docs/parity/icons-context-actions.png +0 -0
- package/docs/parity/icons-data-table-header.png +0 -0
- package/docs/parity/icons-datepicker.png +0 -0
- package/docs/parity/icons-overflow.png +0 -0
- package/docs/parity/icons-pagination.png +0 -0
- package/docs/parity/icons-select-chevron.png +0 -0
- package/docs/parity/rich-text-full-w580-light.png +0 -0
- package/docs/parity/spacing-rhythm-w580-light.png +0 -0
- package/docs/parity/table-align-wrap-w580-light.png +0 -0
- package/docs/parity/table-basic-w580-light.png +0 -0
package/dist/index.js
CHANGED
|
@@ -673,6 +673,26 @@ var Se = {
|
|
|
673
673
|
kZCmMZ: "x1j7nfk9",
|
|
674
674
|
$$css: !0
|
|
675
675
|
},
|
|
676
|
+
listItemTask: {
|
|
677
|
+
kGNEyG: "x1cy8zhl",
|
|
678
|
+
k1xSpc: "x78zum5",
|
|
679
|
+
kH6xsr: "x3ct3a4",
|
|
680
|
+
keTefX: "x9pbi5e",
|
|
681
|
+
$$css: !0
|
|
682
|
+
},
|
|
683
|
+
listTaskCheckbox: {
|
|
684
|
+
kGNEyG: "x6s0dn4",
|
|
685
|
+
k1xSpc: "x3nfvp2",
|
|
686
|
+
kmuXW: "x2lah0s",
|
|
687
|
+
kZKoxP: "xx3o462",
|
|
688
|
+
kjj79g: "xl56j7k",
|
|
689
|
+
k1K539: "xat24cr",
|
|
690
|
+
keoZOQ: "x7r5mf7",
|
|
691
|
+
k71WvV: "xbelrpt",
|
|
692
|
+
keTefX: "x1xkedpm",
|
|
693
|
+
kzqmXN: "x17z2i9w",
|
|
694
|
+
$$css: !0
|
|
695
|
+
},
|
|
676
696
|
listBullet: {
|
|
677
697
|
k3DiCg: "x14alfy",
|
|
678
698
|
kuPSpR: "xo40evb",
|
|
@@ -2397,9 +2417,9 @@ function ct(e) {
|
|
|
2397
2417
|
case "url_text_input":
|
|
2398
2418
|
case "number_input": return at(e);
|
|
2399
2419
|
case "datepicker": return $e(e.initial_date);
|
|
2400
|
-
case "file_input": return e.filetypes === void 0 ||
|
|
2420
|
+
case "file_input": return e.filetypes === void 0 || nt(e.filetypes);
|
|
2421
|
+
case "timepicker": return $e(e.initial_time);
|
|
2401
2422
|
case "datetimepicker":
|
|
2402
|
-
case "timepicker":
|
|
2403
2423
|
case "rich_text_input": return !0;
|
|
2404
2424
|
default: return !1;
|
|
2405
2425
|
}
|
|
@@ -3075,12 +3095,14 @@ function It({ token: e }) {
|
|
|
3075
3095
|
}
|
|
3076
3096
|
return _(e);
|
|
3077
3097
|
}
|
|
3078
|
-
function I({ className: e,
|
|
3079
|
-
let
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3098
|
+
function I({ className: e, inline: t = !1, text: n }) {
|
|
3099
|
+
let r = g(O.text), i = {
|
|
3100
|
+
...r,
|
|
3101
|
+
className: A(r.className, e)
|
|
3102
|
+
}, a = Ft(n).map((e, t) => /* @__PURE__ */ u(It, { token: e }, `${e.kind}-${String(t)}`));
|
|
3103
|
+
return u(t ? "span" : "div", {
|
|
3104
|
+
...i,
|
|
3105
|
+
children: a
|
|
3084
3106
|
});
|
|
3085
3107
|
}
|
|
3086
3108
|
//#endregion
|
|
@@ -3234,21 +3256,27 @@ function Wt({ token: e }) {
|
|
|
3234
3256
|
children: e.text
|
|
3235
3257
|
});
|
|
3236
3258
|
case "list": {
|
|
3237
|
-
let n = e.
|
|
3238
|
-
...g(n),
|
|
3239
|
-
key: `${
|
|
3240
|
-
},
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3259
|
+
let n = e.items.map((n, r) => /* @__PURE__ */ t("li", {
|
|
3260
|
+
...g(e.ordered ? O.listItemOrdered : n.task ? O.listItemTask : [O.listItemBullet, O.listBullet]),
|
|
3261
|
+
key: `${n.text}-${String(r)}`
|
|
3262
|
+
}, n.task ? /* @__PURE__ */ u("span", {
|
|
3263
|
+
...g(O.listTaskCheckbox),
|
|
3264
|
+
children: /* @__PURE__ */ u("input", {
|
|
3265
|
+
checked: n.checked,
|
|
3266
|
+
disabled: !0,
|
|
3267
|
+
readOnly: !0,
|
|
3268
|
+
type: "checkbox"
|
|
3269
|
+
})
|
|
3270
|
+
}) : null, /* @__PURE__ */ u(I, {
|
|
3271
|
+
inline: !0,
|
|
3272
|
+
text: Ht(n.text)
|
|
3273
|
+
})));
|
|
3246
3274
|
return e.ordered ? /* @__PURE__ */ u("ol", {
|
|
3247
3275
|
...g(O.list, O.listOrdered),
|
|
3248
|
-
children:
|
|
3276
|
+
children: n
|
|
3249
3277
|
}) : /* @__PURE__ */ u("ul", {
|
|
3250
3278
|
...g(O.list),
|
|
3251
|
-
children:
|
|
3279
|
+
children: n
|
|
3252
3280
|
});
|
|
3253
3281
|
}
|
|
3254
3282
|
case "table": return /* @__PURE__ */ u("div", {
|
|
@@ -3280,11 +3308,11 @@ function Kt(e) {
|
|
|
3280
3308
|
return w(e) && e.type === "image";
|
|
3281
3309
|
}
|
|
3282
3310
|
function R({ blockId: e, blockType: t, children: n, className: r }) {
|
|
3283
|
-
let i = g(O.block);
|
|
3311
|
+
let i = g(O.block), a = e;
|
|
3284
3312
|
return /* @__PURE__ */ u("div", {
|
|
3285
3313
|
...i,
|
|
3286
3314
|
className: A(i.className, r),
|
|
3287
|
-
"data-block-id":
|
|
3315
|
+
"data-block-id": typeof a == "string" ? a : void 0,
|
|
3288
3316
|
"data-block-type": t,
|
|
3289
3317
|
children: n
|
|
3290
3318
|
});
|
|
@@ -3414,7 +3442,7 @@ function tn({ block: e, className: t }) {
|
|
|
3414
3442
|
children: /* @__PURE__ */ u(fe, { size: 20 })
|
|
3415
3443
|
}), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("strong", { children: "Remote file" }), /* @__PURE__ */ u("div", {
|
|
3416
3444
|
...g(O.smallText),
|
|
3417
|
-
children: e.external_id
|
|
3445
|
+
children: typeof e.external_id == "string" ? e.external_id : E(e, "remote file")
|
|
3418
3446
|
})] })]
|
|
3419
3447
|
})
|
|
3420
3448
|
});
|
|
@@ -3461,7 +3489,10 @@ function nn({ block: e, className: t }) {
|
|
|
3461
3489
|
}
|
|
3462
3490
|
//#endregion
|
|
3463
3491
|
//#region src/blocks/AdvancedBlocks.tsx
|
|
3464
|
-
function rn(
|
|
3492
|
+
function rn(e) {
|
|
3493
|
+
return typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : void 0;
|
|
3494
|
+
}
|
|
3495
|
+
function an({ align: e = "left", cell: t, className: n, firstColumn: r = !1, header: i = !1, path: a = "cell", scope: o = "col", wrapped: s = !1 }) {
|
|
3465
3496
|
let c = g(O.tableCell, i && O.tableHeader, r && O.tableCellFirstColumn, s && O.tableCellWrapped), l;
|
|
3466
3497
|
if (!w(t)) l = E(t, "table cell");
|
|
3467
3498
|
else switch (t.type) {
|
|
@@ -3472,10 +3503,10 @@ function rn({ align: e = "left", cell: t, className: n, firstColumn: r = !1, hea
|
|
|
3472
3503
|
});
|
|
3473
3504
|
break;
|
|
3474
3505
|
case "raw_number":
|
|
3475
|
-
l = t.text ??
|
|
3506
|
+
l = rn(t.text) ?? rn(t.value) ?? E(t, "table cell");
|
|
3476
3507
|
break;
|
|
3477
3508
|
case "raw_text":
|
|
3478
|
-
l = t.text;
|
|
3509
|
+
l = rn(t.text) ?? E(t, "table cell");
|
|
3479
3510
|
break;
|
|
3480
3511
|
default: l = E(t, "table cell");
|
|
3481
3512
|
}
|
|
@@ -3492,11 +3523,11 @@ function rn({ align: e = "left", cell: t, className: n, firstColumn: r = !1, hea
|
|
|
3492
3523
|
children: l
|
|
3493
3524
|
});
|
|
3494
3525
|
}
|
|
3495
|
-
function
|
|
3526
|
+
function on(e) {
|
|
3496
3527
|
return Array.isArray(e);
|
|
3497
3528
|
}
|
|
3498
|
-
function
|
|
3499
|
-
let r = Array.isArray(e.rows) ? e.rows.filter(
|
|
3529
|
+
function sn({ block: e, className: t, path: n = "block" }) {
|
|
3530
|
+
let r = Array.isArray(e.rows) ? e.rows.filter(on) : [], i = e.column_settings;
|
|
3500
3531
|
return /* @__PURE__ */ u(R, {
|
|
3501
3532
|
blockId: e.block_id,
|
|
3502
3533
|
blockType: e.type,
|
|
@@ -3505,14 +3536,14 @@ function on({ block: e, className: t, path: n = "block" }) {
|
|
|
3505
3536
|
...g(O.tableScroller),
|
|
3506
3537
|
children: /* @__PURE__ */ d("table", {
|
|
3507
3538
|
...g(O.table),
|
|
3508
|
-
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: (r[0] ?? []).map((e, t) => /* @__PURE__ */ u(
|
|
3539
|
+
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: (r[0] ?? []).map((e, t) => /* @__PURE__ */ u(an, {
|
|
3509
3540
|
align: i?.[t]?.align,
|
|
3510
3541
|
cell: e,
|
|
3511
3542
|
firstColumn: t === 0,
|
|
3512
3543
|
header: !0,
|
|
3513
3544
|
path: `${n}.rows[0][${String(t)}]`,
|
|
3514
3545
|
wrapped: i?.[t]?.is_wrapped
|
|
3515
|
-
}, `header-${String(t)}`)) }) }), /* @__PURE__ */ u("tbody", { children: r.slice(1).map((e, t) => /* @__PURE__ */ u("tr", { children: e.map((e, r) => /* @__PURE__ */ u(
|
|
3546
|
+
}, `header-${String(t)}`)) }) }), /* @__PURE__ */ u("tbody", { children: r.slice(1).map((e, t) => /* @__PURE__ */ u("tr", { children: e.map((e, r) => /* @__PURE__ */ u(an, {
|
|
3516
3547
|
align: i?.[r]?.align,
|
|
3517
3548
|
cell: e,
|
|
3518
3549
|
firstColumn: r === 0,
|
|
@@ -3523,19 +3554,19 @@ function on({ block: e, className: t, path: n = "block" }) {
|
|
|
3523
3554
|
})
|
|
3524
3555
|
});
|
|
3525
3556
|
}
|
|
3526
|
-
function
|
|
3557
|
+
function cn({ cell: e, path: t }) {
|
|
3527
3558
|
if (!w(e)) return E(e, "table cell");
|
|
3528
3559
|
switch (e.type) {
|
|
3529
3560
|
case "rich_text": return /* @__PURE__ */ u(N, {
|
|
3530
3561
|
block: e,
|
|
3531
3562
|
path: t
|
|
3532
3563
|
});
|
|
3533
|
-
case "raw_number": return e.text ??
|
|
3534
|
-
case "raw_text": return e.text;
|
|
3564
|
+
case "raw_number": return rn(e.text) ?? rn(e.value) ?? E(e, "table cell");
|
|
3565
|
+
case "raw_text": return rn(e.text) ?? E(e, "table cell");
|
|
3535
3566
|
default: return E(e, "table cell");
|
|
3536
3567
|
}
|
|
3537
3568
|
}
|
|
3538
|
-
function
|
|
3569
|
+
function ln(e) {
|
|
3539
3570
|
let t = e;
|
|
3540
3571
|
if (!w(t)) return "";
|
|
3541
3572
|
if (e.type === "raw_text") {
|
|
@@ -3554,8 +3585,8 @@ function cn(e) {
|
|
|
3554
3585
|
}
|
|
3555
3586
|
return "";
|
|
3556
3587
|
}
|
|
3557
|
-
function
|
|
3558
|
-
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(
|
|
3588
|
+
function un({ block: e, className: n, path: r = "block" }) {
|
|
3589
|
+
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(on) : [], 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) => ln(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;
|
|
3559
3590
|
return /* @__PURE__ */ u(R, {
|
|
3560
3591
|
blockId: e.block_id,
|
|
3561
3592
|
blockType: e.type,
|
|
@@ -3612,14 +3643,14 @@ function ln({ block: e, className: n, path: r = "block" }) {
|
|
|
3612
3643
|
...g(O.dataTableTh),
|
|
3613
3644
|
key: `header-${String(n)}`,
|
|
3614
3645
|
scope: "col"
|
|
3615
|
-
}, /* @__PURE__ */ u(
|
|
3646
|
+
}, /* @__PURE__ */ u(cn, {
|
|
3616
3647
|
cell: e,
|
|
3617
3648
|
path: `${r}.rows[0][${String(n)}]`
|
|
3618
3649
|
}))) }) }),
|
|
3619
3650
|
/* @__PURE__ */ u("tbody", { children: S.map((e, n) => {
|
|
3620
3651
|
let i = x * a + n + 1, o = e.length - 1;
|
|
3621
3652
|
return /* @__PURE__ */ u("tr", { children: e.map((e, a) => {
|
|
3622
|
-
let c = g(O.dataTableTd, n === 0 && a === 0 && O.dataTableRadiusTopStart, n === 0 && a === o && O.dataTableRadiusTopEnd, n === C && a === 0 && O.dataTableRadiusBottomStart, n === C && a === o && O.dataTableRadiusBottomEnd), l = /* @__PURE__ */ u(
|
|
3653
|
+
let c = g(O.dataTableTd, n === 0 && a === 0 && O.dataTableRadiusTopStart, n === 0 && a === o && O.dataTableRadiusTopEnd, n === C && a === 0 && O.dataTableRadiusBottomStart, n === C && a === o && O.dataTableRadiusBottomEnd), l = /* @__PURE__ */ u(cn, {
|
|
3623
3654
|
cell: e,
|
|
3624
3655
|
path: `${r}.rows[${String(i)}][${String(a)}]`
|
|
3625
3656
|
});
|
|
@@ -3672,7 +3703,7 @@ function ln({ block: e, className: n, path: r = "block" }) {
|
|
|
3672
3703
|
})
|
|
3673
3704
|
});
|
|
3674
3705
|
}
|
|
3675
|
-
function
|
|
3706
|
+
function dn({ name: e }) {
|
|
3676
3707
|
let t = typeof e == "string" ? be[e] : void 0;
|
|
3677
3708
|
return /* @__PURE__ */ u("span", {
|
|
3678
3709
|
...g(O.iconSlot),
|
|
@@ -3681,7 +3712,7 @@ function un({ name: e }) {
|
|
|
3681
3712
|
children: u(t === void 0 ? le : t, { size: 24 })
|
|
3682
3713
|
});
|
|
3683
3714
|
}
|
|
3684
|
-
function
|
|
3715
|
+
function fn({ block: e, className: t }) {
|
|
3685
3716
|
let n = Array.isArray(e.actions) ? e.actions : void 0;
|
|
3686
3717
|
return /* @__PURE__ */ u(R, {
|
|
3687
3718
|
blockId: e.block_id,
|
|
@@ -3699,7 +3730,7 @@ function dn({ block: e, className: t }) {
|
|
|
3699
3730
|
children: [
|
|
3700
3731
|
e.icon === void 0 && e.slack_icon === void 0 && e.title === void 0 && e.subtitle === void 0 ? null : /* @__PURE__ */ d("div", {
|
|
3701
3732
|
...g(O.cardHeading),
|
|
3702
|
-
children: [e.icon === void 0 ? e.slack_icon === void 0 ? null : /* @__PURE__ */ u(
|
|
3733
|
+
children: [e.icon === void 0 ? e.slack_icon === void 0 ? null : /* @__PURE__ */ u(dn, { name: w(e.slack_icon) ? e.slack_icon.name : void 0 }) : /* @__PURE__ */ u(F, {
|
|
3703
3734
|
element: e.icon,
|
|
3704
3735
|
variant: "cardIcon"
|
|
3705
3736
|
}), /* @__PURE__ */ d("div", { children: [e.title === void 0 ? null : /* @__PURE__ */ u(L, {
|
|
@@ -3728,10 +3759,10 @@ function dn({ block: e, className: t }) {
|
|
|
3728
3759
|
})
|
|
3729
3760
|
});
|
|
3730
3761
|
}
|
|
3731
|
-
function
|
|
3762
|
+
function pn(e) {
|
|
3732
3763
|
return w(e) && e.type === "card";
|
|
3733
3764
|
}
|
|
3734
|
-
function
|
|
3765
|
+
function mn({ block: e, className: n, path: r = "block" }) {
|
|
3735
3766
|
let i = e.elements;
|
|
3736
3767
|
return /* @__PURE__ */ u(R, {
|
|
3737
3768
|
blockId: e.block_id,
|
|
@@ -3739,7 +3770,7 @@ function pn({ block: e, className: n, path: r = "block" }) {
|
|
|
3739
3770
|
className: n,
|
|
3740
3771
|
children: /* @__PURE__ */ u("div", {
|
|
3741
3772
|
...g(O.carousel),
|
|
3742
|
-
children: Array.isArray(i) ? i.map((e, n) =>
|
|
3773
|
+
children: Array.isArray(i) ? i.map((e, n) => pn(e) ? /* @__PURE__ */ u(fn, {
|
|
3743
3774
|
block: e,
|
|
3744
3775
|
className: g(O.carouselCard).className,
|
|
3745
3776
|
path: `${r}.elements[${String(n)}]`
|
|
@@ -3751,7 +3782,7 @@ function pn({ block: e, className: n, path: r = "block" }) {
|
|
|
3751
3782
|
})
|
|
3752
3783
|
});
|
|
3753
3784
|
}
|
|
3754
|
-
function
|
|
3785
|
+
function hn({ block: e, className: t }) {
|
|
3755
3786
|
let n = e.level ?? "default";
|
|
3756
3787
|
return /* @__PURE__ */ u(R, {
|
|
3757
3788
|
blockId: e.block_id,
|
|
@@ -3767,7 +3798,7 @@ function mn({ block: e, className: t }) {
|
|
|
3767
3798
|
})
|
|
3768
3799
|
});
|
|
3769
3800
|
}
|
|
3770
|
-
function
|
|
3801
|
+
function gn({ block: e, className: n, path: r = "block" }) {
|
|
3771
3802
|
let i = e.sources, a = typeof e.status == "string" ? e.status : "unknown", o = typeof e.title == "string" ? e.title : E(e, "task");
|
|
3772
3803
|
return /* @__PURE__ */ u(R, {
|
|
3773
3804
|
blockId: e.block_id,
|
|
@@ -3819,10 +3850,10 @@ function hn({ block: e, className: n, path: r = "block" }) {
|
|
|
3819
3850
|
})
|
|
3820
3851
|
});
|
|
3821
3852
|
}
|
|
3822
|
-
function
|
|
3853
|
+
function _n(e) {
|
|
3823
3854
|
return w(e) && e.type === "task_card";
|
|
3824
3855
|
}
|
|
3825
|
-
function
|
|
3856
|
+
function vn({ block: e, className: n, path: r = "block" }) {
|
|
3826
3857
|
let i = e.tasks, a = typeof e.title == "string" ? e.title : E(e, "plan");
|
|
3827
3858
|
return /* @__PURE__ */ u(R, {
|
|
3828
3859
|
blockId: e.block_id,
|
|
@@ -3830,7 +3861,7 @@ function _n({ block: e, className: n, path: r = "block" }) {
|
|
|
3830
3861
|
className: n,
|
|
3831
3862
|
children: /* @__PURE__ */ d("div", {
|
|
3832
3863
|
...g(O.plan),
|
|
3833
|
-
children: [/* @__PURE__ */ u("strong", { children: a }), Array.isArray(i) ? i.map((e, n) =>
|
|
3864
|
+
children: [/* @__PURE__ */ u("strong", { children: a }), Array.isArray(i) ? i.map((e, n) => _n(e) ? /* @__PURE__ */ u(gn, {
|
|
3834
3865
|
block: e,
|
|
3835
3866
|
path: `${r}.tasks[${String(n)}]`
|
|
3836
3867
|
}, `${typeof e.task_id == "string" ? e.task_id : "task"}-${String(n)}`) : /* @__PURE__ */ t("div", {
|
|
@@ -3843,7 +3874,7 @@ function _n({ block: e, className: n, path: r = "block" }) {
|
|
|
3843
3874
|
}
|
|
3844
3875
|
//#endregion
|
|
3845
3876
|
//#region src/constants.ts
|
|
3846
|
-
var
|
|
3877
|
+
var yn = 3e3, bn = 3e3, xn = 2e3, Sn = 3e3, Cn = 2e3, wn = 2e3, Tn = 12e3, En = 3e3, Dn = 2e3, On = 1e4, kn = 2e4, An = [
|
|
3847
3878
|
"actions",
|
|
3848
3879
|
"alert",
|
|
3849
3880
|
"card",
|
|
@@ -3865,9 +3896,9 @@ var vn = 3e3, yn = 3e3, bn = 2e3, xn = 3e3, Sn = 2e3, Cn = 2e3, wn = 12e3, Tn =
|
|
|
3865
3896
|
"table",
|
|
3866
3897
|
"task_card",
|
|
3867
3898
|
"video"
|
|
3868
|
-
],
|
|
3869
|
-
function
|
|
3870
|
-
let [e, t] = c(
|
|
3899
|
+
], jn = 554;
|
|
3900
|
+
function Mn() {
|
|
3901
|
+
let [e, t] = c(jn + 26), r = s(void 0), a = n((e) => {
|
|
3871
3902
|
if (r.current?.disconnect(), r.current = void 0, e === null) return;
|
|
3872
3903
|
let n = () => {
|
|
3873
3904
|
let n = e.getBoundingClientRect().width;
|
|
@@ -3882,22 +3913,22 @@ function jn() {
|
|
|
3882
3913
|
width: e
|
|
3883
3914
|
};
|
|
3884
3915
|
}
|
|
3885
|
-
function
|
|
3916
|
+
function Nn(e, t) {
|
|
3886
3917
|
let n = e / Math.max(1, t), r = 10 ** Math.floor(Math.log10(n)), i = n / r;
|
|
3887
3918
|
return i >= Math.sqrt(50) ? r * 10 : i >= Math.sqrt(10) ? r * 5 : i >= Math.SQRT2 ? r * 2 : r;
|
|
3888
3919
|
}
|
|
3889
|
-
function
|
|
3890
|
-
let n = Math.min(0, e), r = t > n ? t : n + 1, i =
|
|
3920
|
+
function Pn(e, t) {
|
|
3921
|
+
let n = Math.min(0, e), r = t > n ? t : n + 1, i = Nn(r - n, 4), a = Math.floor(n / i), o = Math.ceil(r / i), s = [];
|
|
3891
3922
|
for (let e = a; e <= o; e += 1) s.push(e * i);
|
|
3892
3923
|
return s;
|
|
3893
3924
|
}
|
|
3894
|
-
function
|
|
3925
|
+
function Fn(e) {
|
|
3895
3926
|
return Math.ceil(e - .5) + .5;
|
|
3896
3927
|
}
|
|
3897
|
-
function
|
|
3928
|
+
function In(e, t) {
|
|
3898
3929
|
let n = 0, r = 0;
|
|
3899
3930
|
for (let e of t) n = Math.min(n, e), r = Math.max(r, e);
|
|
3900
|
-
let i =
|
|
3931
|
+
let i = Pn(n, r), a = i[0] ?? 0, o = (i[i.length - 1] ?? 1) - a || 1;
|
|
3901
3932
|
return {
|
|
3902
3933
|
plotLeft: 74,
|
|
3903
3934
|
plotRight: e,
|
|
@@ -3906,14 +3937,14 @@ function Fn(e, t) {
|
|
|
3906
3937
|
y: (e) => 334 - (e - a) / o * 325
|
|
3907
3938
|
};
|
|
3908
3939
|
}
|
|
3909
|
-
function
|
|
3940
|
+
function Ln(e) {
|
|
3910
3941
|
return Ee[e % Ee.length] ?? Te;
|
|
3911
3942
|
}
|
|
3912
|
-
function
|
|
3943
|
+
function Rn(e, t) {
|
|
3913
3944
|
let n = new Map(e.data.map((e) => [e.label, e]));
|
|
3914
3945
|
return t.map((e) => n.get(e));
|
|
3915
3946
|
}
|
|
3916
|
-
function
|
|
3947
|
+
function zn(e, t, n, r) {
|
|
3917
3948
|
let i = Math.min(4, t / 2, Math.abs(r - n)), a = e, o = e + t;
|
|
3918
3949
|
return [
|
|
3919
3950
|
`M${String(a + i)} ${String(n)}`,
|
|
@@ -3926,7 +3957,7 @@ function Rn(e, t, n, r) {
|
|
|
3926
3957
|
"Z"
|
|
3927
3958
|
].join("");
|
|
3928
3959
|
}
|
|
3929
|
-
function
|
|
3960
|
+
function Bn(e) {
|
|
3930
3961
|
if (e.length === 0) return "";
|
|
3931
3962
|
let t = e[0];
|
|
3932
3963
|
if (t === void 0) return "";
|
|
@@ -3953,10 +3984,10 @@ function zn(e) {
|
|
|
3953
3984
|
}
|
|
3954
3985
|
return r.join("");
|
|
3955
3986
|
}
|
|
3956
|
-
function
|
|
3987
|
+
function Vn({ geometry: e }) {
|
|
3957
3988
|
let { plotLeft: n, plotRight: r, ticks: i, y: a } = e;
|
|
3958
3989
|
return /* @__PURE__ */ d(l, { children: [i.map((e) => {
|
|
3959
|
-
let i =
|
|
3990
|
+
let i = Fn(a(e));
|
|
3960
3991
|
return /* @__PURE__ */ t("path", {
|
|
3961
3992
|
...g(O.chartGridline),
|
|
3962
3993
|
d: `M${String(n)} ${String(i)}L${String(r)} ${String(i)}`,
|
|
@@ -3972,7 +4003,7 @@ function Bn({ geometry: e }) {
|
|
|
3972
4003
|
y: a(e)
|
|
3973
4004
|
}, e))] });
|
|
3974
4005
|
}
|
|
3975
|
-
function
|
|
4006
|
+
function Hn({ categories: e, tickX: n }) {
|
|
3976
4007
|
return /* @__PURE__ */ u(l, { children: e.map((e, r) => /* @__PURE__ */ t("text", {
|
|
3977
4008
|
...g(O.chartTickText),
|
|
3978
4009
|
key: `${e}-${String(r)}`,
|
|
@@ -3981,26 +4012,26 @@ function Vn({ categories: e, tickX: n }) {
|
|
|
3981
4012
|
y: 351
|
|
3982
4013
|
}, e)) });
|
|
3983
4014
|
}
|
|
3984
|
-
function
|
|
4015
|
+
function Un(e, t) {
|
|
3985
4016
|
let n = e * Math.min(.155, Math.max(.075, .175 - .02 * t));
|
|
3986
4017
|
return {
|
|
3987
4018
|
barWidth: (e - 2 * n) / (1.1 * t - .1),
|
|
3988
4019
|
outer: n
|
|
3989
4020
|
};
|
|
3990
4021
|
}
|
|
3991
|
-
function
|
|
4022
|
+
function Wn({ chart: e, svgWidth: n, title: r }) {
|
|
3992
4023
|
let i = e.axis_config.categories, a = e.series.map((e) => ({
|
|
3993
|
-
points:
|
|
4024
|
+
points: Rn(e, i),
|
|
3994
4025
|
series: e
|
|
3995
|
-
})), o =
|
|
4026
|
+
})), o = In(n, a.flatMap(({ points: e }) => e.flatMap((e) => e === void 0 ? [] : [e.value]))), { plotLeft: s, plotRight: c, y: l } = o, f, p;
|
|
3996
4027
|
if (e.type === "bar") {
|
|
3997
|
-
let n = (c - s) / Math.max(1, i.length), { barWidth: r, outer: o } =
|
|
4028
|
+
let n = (c - s) / Math.max(1, i.length), { barWidth: r, outer: o } = Un(n, Math.max(1, e.series.length));
|
|
3998
4029
|
p = (e) => s + n * (e + .5), f = a.map(({ points: e, series: i }, a) => e.map((e, c) => {
|
|
3999
4030
|
if (e === void 0) return null;
|
|
4000
4031
|
let u = s + c * n + o + 1.1 * r * a;
|
|
4001
4032
|
return /* @__PURE__ */ t("path", {
|
|
4002
|
-
...g(
|
|
4003
|
-
d:
|
|
4033
|
+
...g(Ln(a).fill),
|
|
4034
|
+
d: zn(u, r, l(e.value), 334),
|
|
4004
4035
|
"data-category": e.label,
|
|
4005
4036
|
"data-series": i.name,
|
|
4006
4037
|
key: `${i.name}-${String(a)}-${e.label}-${String(c)}`
|
|
@@ -4012,15 +4043,15 @@ function Un({ chart: e, svgWidth: n, title: r }) {
|
|
|
4012
4043
|
let a = t.flatMap((e, t) => e === void 0 ? [] : [{
|
|
4013
4044
|
x: n(t),
|
|
4014
4045
|
y: l(e.value)
|
|
4015
|
-
}]), o =
|
|
4046
|
+
}]), o = Bn(a);
|
|
4016
4047
|
if (o === "") return null;
|
|
4017
4048
|
let s = a[a.length - 1], c = a[0];
|
|
4018
4049
|
return /* @__PURE__ */ d("g", { children: [e.type === "area" && c !== void 0 && s !== void 0 ? /* @__PURE__ */ u("path", {
|
|
4019
|
-
...g(
|
|
4050
|
+
...g(Ln(i).tint, O.chartAreaFill, i >= 6 && O.chartAreaFallbackFill),
|
|
4020
4051
|
d: `${o}L${String(s.x)} 334L${String(c.x)} 334Z`,
|
|
4021
4052
|
"data-series-area": r.name
|
|
4022
4053
|
}) : null, /* @__PURE__ */ u("path", {
|
|
4023
|
-
...g(
|
|
4054
|
+
...g(Ln(i).stroke, O.chartLinePath),
|
|
4024
4055
|
d: o,
|
|
4025
4056
|
"data-series": r.name,
|
|
4026
4057
|
fill: "none"
|
|
@@ -4034,22 +4065,22 @@ function Un({ chart: e, svgWidth: n, title: r }) {
|
|
|
4034
4065
|
role: "img",
|
|
4035
4066
|
width: n,
|
|
4036
4067
|
children: [
|
|
4037
|
-
/* @__PURE__ */ u(
|
|
4068
|
+
/* @__PURE__ */ u(Vn, { geometry: o }),
|
|
4038
4069
|
f,
|
|
4039
|
-
/* @__PURE__ */ u(
|
|
4070
|
+
/* @__PURE__ */ u(Hn, {
|
|
4040
4071
|
categories: i,
|
|
4041
4072
|
tickX: p
|
|
4042
4073
|
})
|
|
4043
4074
|
]
|
|
4044
4075
|
});
|
|
4045
4076
|
}
|
|
4046
|
-
function
|
|
4077
|
+
function Gn(e, t, n, r) {
|
|
4047
4078
|
return {
|
|
4048
4079
|
x: e + n * Math.sin(r),
|
|
4049
4080
|
y: t - n * Math.cos(r)
|
|
4050
4081
|
};
|
|
4051
4082
|
}
|
|
4052
|
-
function
|
|
4083
|
+
function Kn({ chart: e, svgWidth: n, title: r }) {
|
|
4053
4084
|
let i = e.segments.map((e) => Number.isFinite(e.value) ? Math.max(0, e.value) : 0), a = i.reduce((e, t) => e + t, 0);
|
|
4054
4085
|
if (a <= 0) return /* @__PURE__ */ u("div", {
|
|
4055
4086
|
...g(O.unhandled),
|
|
@@ -4061,9 +4092,9 @@ function Gn({ chart: e, svgWidth: n, title: r }) {
|
|
|
4061
4092
|
let o = n / 2, s = 0, c = e.segments.map((e, n) => {
|
|
4062
4093
|
let r = (i[n] ?? 0) / a, c = s * 2 * Math.PI;
|
|
4063
4094
|
s += r;
|
|
4064
|
-
let l = s * 2 * Math.PI, u =
|
|
4095
|
+
let l = s * 2 * Math.PI, u = Gn(o, 180, 144, c), d = Gn(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`;
|
|
4065
4096
|
return r <= 0 ? null : /* @__PURE__ */ t("path", {
|
|
4066
|
-
...g(
|
|
4097
|
+
...g(Ln(n).fill, O.pieSlice),
|
|
4067
4098
|
d: p,
|
|
4068
4099
|
"data-segment": e.label,
|
|
4069
4100
|
key: `${e.label}-${String(n)}`
|
|
@@ -4078,41 +4109,41 @@ function Gn({ chart: e, svgWidth: n, title: r }) {
|
|
|
4078
4109
|
children: c
|
|
4079
4110
|
});
|
|
4080
4111
|
}
|
|
4081
|
-
var
|
|
4112
|
+
var qn = {
|
|
4082
4113
|
area: !0,
|
|
4083
4114
|
bar: !0,
|
|
4084
4115
|
line: !0
|
|
4085
4116
|
};
|
|
4086
|
-
function qn(e) {
|
|
4087
|
-
return w(e) && typeof e.label == "string" && typeof e.value == "number" && Number.isFinite(e.value);
|
|
4088
|
-
}
|
|
4089
4117
|
function Jn(e) {
|
|
4090
4118
|
return w(e) && typeof e.label == "string" && typeof e.value == "number" && Number.isFinite(e.value);
|
|
4091
4119
|
}
|
|
4092
4120
|
function Yn(e) {
|
|
4093
|
-
return w(e) && typeof e.
|
|
4121
|
+
return w(e) && typeof e.label == "string" && typeof e.value == "number" && Number.isFinite(e.value);
|
|
4094
4122
|
}
|
|
4095
4123
|
function Xn(e) {
|
|
4096
|
-
return w(e) && e.
|
|
4124
|
+
return w(e) && typeof e.name == "string" && Array.isArray(e.data) && e.data.every(Yn);
|
|
4097
4125
|
}
|
|
4098
4126
|
function Zn(e) {
|
|
4127
|
+
return w(e) && e.type === "pie" && Array.isArray(e.segments) && e.segments.every(Jn);
|
|
4128
|
+
}
|
|
4129
|
+
function Qn(e) {
|
|
4099
4130
|
if (!w(e)) return !1;
|
|
4100
4131
|
let t = e.type;
|
|
4101
|
-
if (typeof t != "string" || !(t in
|
|
4132
|
+
if (typeof t != "string" || !(t in qn)) return !1;
|
|
4102
4133
|
let n = e.axis_config;
|
|
4103
|
-
return Array.isArray(e.series) && e.series.every(
|
|
4134
|
+
return Array.isArray(e.series) && e.series.every(Xn) && w(n) && Array.isArray(n.categories) && n.categories.every((e) => typeof e == "string");
|
|
4104
4135
|
}
|
|
4105
|
-
function
|
|
4106
|
-
let r = e.chart, i = typeof e.title == "string" ? e.title : E(e, "chart"), { ref: a, width: o } =
|
|
4136
|
+
function $n({ block: e, className: n }) {
|
|
4137
|
+
let r = e.chart, i = typeof e.title == "string" ? e.title : E(e, "chart"), { ref: a, width: o } = Mn(), s = Math.min(624, Math.max(400, o)) - 26, c = Qn(r) ? r : void 0, l = c === void 0 && Zn(r) ? r : void 0, f, p;
|
|
4107
4138
|
l === void 0 ? c === void 0 ? (f = /* @__PURE__ */ u("div", {
|
|
4108
4139
|
...g(O.unhandled),
|
|
4109
4140
|
"data-unhandled-chart-type": T(r) ?? "unknown",
|
|
4110
4141
|
children: E(r, "chart")
|
|
4111
|
-
}), p = []) : (f = /* @__PURE__ */ u(
|
|
4142
|
+
}), p = []) : (f = /* @__PURE__ */ u(Wn, {
|
|
4112
4143
|
chart: c,
|
|
4113
4144
|
svgWidth: s,
|
|
4114
4145
|
title: i
|
|
4115
|
-
}), p = c.series.map((e) => e.name)) : (f = /* @__PURE__ */ u(
|
|
4146
|
+
}), p = c.series.map((e) => e.name)) : (f = /* @__PURE__ */ u(Kn, {
|
|
4116
4147
|
chart: l,
|
|
4117
4148
|
svgWidth: s,
|
|
4118
4149
|
title: i
|
|
@@ -4155,7 +4186,7 @@ function Qn({ block: e, className: n }) {
|
|
|
4155
4186
|
...g(O.chartLegendItem),
|
|
4156
4187
|
key: `${e}-${String(n)}`
|
|
4157
4188
|
}, /* @__PURE__ */ u("span", {
|
|
4158
|
-
...g(O.chartLegendSwatch,
|
|
4189
|
+
...g(O.chartLegendSwatch, Ln(n).swatch),
|
|
4159
4190
|
"aria-hidden": "true"
|
|
4160
4191
|
}), e))
|
|
4161
4192
|
})
|
|
@@ -4168,21 +4199,21 @@ function Qn({ block: e, className: n }) {
|
|
|
4168
4199
|
}
|
|
4169
4200
|
//#endregion
|
|
4170
4201
|
//#region src/blocks/InteractiveBlocks.tsx
|
|
4171
|
-
function $n(e) {
|
|
4172
|
-
return w(e) && w(e.text) && typeof e.text.text == "string";
|
|
4173
|
-
}
|
|
4174
4202
|
function er(e) {
|
|
4175
|
-
return w(e) && e.
|
|
4203
|
+
return w(e) && w(e.text) && typeof e.text.text == "string";
|
|
4176
4204
|
}
|
|
4177
4205
|
function tr(e) {
|
|
4178
|
-
return w(e) && e.type === "
|
|
4206
|
+
return w(e) && e.type === "feedback_buttons" && er(e.positive_button) && er(e.negative_button);
|
|
4207
|
+
}
|
|
4208
|
+
function nr(e) {
|
|
4209
|
+
return w(e) && e.type === "icon_button" && er(e) && typeof e.icon == "string";
|
|
4179
4210
|
}
|
|
4180
|
-
function
|
|
4211
|
+
function rr({ block: e, className: t, path: n = "block" }) {
|
|
4181
4212
|
let r = g(O.block, O.actions), i = Array.isArray(e.elements) ? e.elements : [];
|
|
4182
4213
|
return /* @__PURE__ */ u("div", {
|
|
4183
4214
|
...r,
|
|
4184
4215
|
className: A(r.className, t),
|
|
4185
|
-
"data-block-id": e
|
|
4216
|
+
"data-block-id": xe(e),
|
|
4186
4217
|
"data-block-type": e.type,
|
|
4187
4218
|
children: i.map((t, r) => /* @__PURE__ */ u(Dt, {
|
|
4188
4219
|
blockId: e.block_id,
|
|
@@ -4191,12 +4222,12 @@ function nr({ block: e, className: t, path: n = "block" }) {
|
|
|
4191
4222
|
}, `${T(t) ?? "unknown"}-${w(t) && typeof t.action_id == "string" ? t.action_id : "action"}-${String(r)}`))
|
|
4192
4223
|
});
|
|
4193
4224
|
}
|
|
4194
|
-
function
|
|
4225
|
+
function ir({ block: e, className: t, path: n = "block" }) {
|
|
4195
4226
|
let r = g(O.block, O.inputBlock), i = e.label;
|
|
4196
4227
|
return /* @__PURE__ */ d("div", {
|
|
4197
4228
|
...r,
|
|
4198
4229
|
className: A(r.className, t),
|
|
4199
|
-
"data-block-id": e
|
|
4230
|
+
"data-block-id": xe(e),
|
|
4200
4231
|
"data-block-type": e.type,
|
|
4201
4232
|
children: [
|
|
4202
4233
|
/* @__PURE__ */ d("div", {
|
|
@@ -4219,18 +4250,18 @@ function rr({ block: e, className: t, path: n = "block" }) {
|
|
|
4219
4250
|
]
|
|
4220
4251
|
});
|
|
4221
4252
|
}
|
|
4222
|
-
function
|
|
4253
|
+
function ar(e, t) {
|
|
4223
4254
|
return t === "positive" ? e.positive_button.text.text : e.negative_button.text.text;
|
|
4224
4255
|
}
|
|
4225
|
-
function
|
|
4256
|
+
function or({ block: e, className: n }) {
|
|
4226
4257
|
let { onAction: r } = x(), i = g(O.block, O.actions), a = e.elements;
|
|
4227
4258
|
return /* @__PURE__ */ u("div", {
|
|
4228
4259
|
...i,
|
|
4229
4260
|
className: A(i.className, n),
|
|
4230
|
-
"data-block-id": e
|
|
4261
|
+
"data-block-id": xe(e),
|
|
4231
4262
|
"data-block-type": e.type,
|
|
4232
4263
|
children: Array.isArray(a) ? a.map((n, i) => {
|
|
4233
|
-
if (
|
|
4264
|
+
if (nr(n)) {
|
|
4234
4265
|
let a = g(O.button, O.iconButton), o = be[n.icon];
|
|
4235
4266
|
return /* @__PURE__ */ t("button", {
|
|
4236
4267
|
...a,
|
|
@@ -4248,12 +4279,12 @@ function ar({ block: e, className: n }) {
|
|
|
4248
4279
|
type: "button"
|
|
4249
4280
|
}, o === void 0 ? n.icon : /* @__PURE__ */ u(o, { size: 16 }));
|
|
4250
4281
|
}
|
|
4251
|
-
return
|
|
4282
|
+
return tr(n) ? /* @__PURE__ */ t("div", {
|
|
4252
4283
|
...g(O.actions),
|
|
4253
4284
|
key: `${n.type}-${n.action_id ?? "feedback"}-${String(i)}`
|
|
4254
4285
|
}, /* @__PURE__ */ u("button", {
|
|
4255
4286
|
...g(O.button, O.iconButton),
|
|
4256
|
-
"aria-label":
|
|
4287
|
+
"aria-label": ar(n, "positive"),
|
|
4257
4288
|
onClick: () => {
|
|
4258
4289
|
n.action_id !== void 0 && r?.({
|
|
4259
4290
|
actionId: n.action_id,
|
|
@@ -4266,7 +4297,7 @@ function ar({ block: e, className: n }) {
|
|
|
4266
4297
|
children: /* @__PURE__ */ u(_e, { size: 16 })
|
|
4267
4298
|
}), /* @__PURE__ */ u("button", {
|
|
4268
4299
|
...g(O.button, O.iconButton),
|
|
4269
|
-
"aria-label":
|
|
4300
|
+
"aria-label": ar(n, "negative"),
|
|
4270
4301
|
onClick: () => {
|
|
4271
4302
|
n.action_id !== void 0 && r?.({
|
|
4272
4303
|
actionId: n.action_id,
|
|
@@ -4291,14 +4322,14 @@ function ar({ block: e, className: n }) {
|
|
|
4291
4322
|
}
|
|
4292
4323
|
//#endregion
|
|
4293
4324
|
//#region src/Block.tsx
|
|
4294
|
-
var
|
|
4295
|
-
function
|
|
4325
|
+
var sr = new Set(An);
|
|
4326
|
+
function cr(e) {
|
|
4296
4327
|
let t = T(e);
|
|
4297
|
-
return t !== void 0 &&
|
|
4328
|
+
return t !== void 0 && sr.has(t);
|
|
4298
4329
|
}
|
|
4299
|
-
function
|
|
4330
|
+
function lr({ block: e, className: t, path: n = "block" }) {
|
|
4300
4331
|
let r = T(e);
|
|
4301
|
-
if (!
|
|
4332
|
+
if (!cr(e)) {
|
|
4302
4333
|
let n = g(O.block, O.unhandled);
|
|
4303
4334
|
return /* @__PURE__ */ u("div", {
|
|
4304
4335
|
...n,
|
|
@@ -4310,27 +4341,27 @@ function cr({ block: e, className: t, path: n = "block" }) {
|
|
|
4310
4341
|
});
|
|
4311
4342
|
}
|
|
4312
4343
|
switch (e.type) {
|
|
4313
|
-
case "actions": return /* @__PURE__ */ u(
|
|
4344
|
+
case "actions": return /* @__PURE__ */ u(rr, {
|
|
4314
4345
|
block: e,
|
|
4315
4346
|
className: t,
|
|
4316
4347
|
path: n
|
|
4317
4348
|
});
|
|
4318
|
-
case "alert": return /* @__PURE__ */ u(
|
|
4349
|
+
case "alert": return /* @__PURE__ */ u(hn, {
|
|
4319
4350
|
block: e,
|
|
4320
4351
|
className: t,
|
|
4321
4352
|
path: n
|
|
4322
4353
|
});
|
|
4323
|
-
case "card": return /* @__PURE__ */ u(
|
|
4354
|
+
case "card": return /* @__PURE__ */ u(fn, {
|
|
4324
4355
|
block: e,
|
|
4325
4356
|
className: t,
|
|
4326
4357
|
path: n
|
|
4327
4358
|
});
|
|
4328
|
-
case "carousel": return /* @__PURE__ */ u(
|
|
4359
|
+
case "carousel": return /* @__PURE__ */ u(mn, {
|
|
4329
4360
|
block: e,
|
|
4330
4361
|
className: t,
|
|
4331
4362
|
path: n
|
|
4332
4363
|
});
|
|
4333
|
-
case "container": return /* @__PURE__ */ u(
|
|
4364
|
+
case "container": return /* @__PURE__ */ u(hr, {
|
|
4334
4365
|
block: e,
|
|
4335
4366
|
className: t,
|
|
4336
4367
|
path: n
|
|
@@ -4340,17 +4371,17 @@ function cr({ block: e, className: t, path: n = "block" }) {
|
|
|
4340
4371
|
className: t,
|
|
4341
4372
|
path: n
|
|
4342
4373
|
});
|
|
4343
|
-
case "context_actions": return /* @__PURE__ */ u(
|
|
4374
|
+
case "context_actions": return /* @__PURE__ */ u(or, {
|
|
4344
4375
|
block: e,
|
|
4345
4376
|
className: t,
|
|
4346
4377
|
path: n
|
|
4347
4378
|
});
|
|
4348
|
-
case "data_table": return /* @__PURE__ */ u(
|
|
4379
|
+
case "data_table": return /* @__PURE__ */ u(un, {
|
|
4349
4380
|
block: e,
|
|
4350
4381
|
className: t,
|
|
4351
4382
|
path: n
|
|
4352
4383
|
});
|
|
4353
|
-
case "data_visualization": return /* @__PURE__ */ u(
|
|
4384
|
+
case "data_visualization": return /* @__PURE__ */ u($n, {
|
|
4354
4385
|
block: e,
|
|
4355
4386
|
className: t,
|
|
4356
4387
|
path: n
|
|
@@ -4375,7 +4406,7 @@ function cr({ block: e, className: t, path: n = "block" }) {
|
|
|
4375
4406
|
className: t,
|
|
4376
4407
|
path: n
|
|
4377
4408
|
});
|
|
4378
|
-
case "input": return /* @__PURE__ */ u(
|
|
4409
|
+
case "input": return /* @__PURE__ */ u(ir, {
|
|
4379
4410
|
block: e,
|
|
4380
4411
|
className: t,
|
|
4381
4412
|
path: n
|
|
@@ -4385,7 +4416,7 @@ function cr({ block: e, className: t, path: n = "block" }) {
|
|
|
4385
4416
|
className: t,
|
|
4386
4417
|
path: n
|
|
4387
4418
|
});
|
|
4388
|
-
case "plan": return /* @__PURE__ */ u(
|
|
4419
|
+
case "plan": return /* @__PURE__ */ u(vn, {
|
|
4389
4420
|
block: e,
|
|
4390
4421
|
className: t,
|
|
4391
4422
|
path: n
|
|
@@ -4400,12 +4431,12 @@ function cr({ block: e, className: t, path: n = "block" }) {
|
|
|
4400
4431
|
className: t,
|
|
4401
4432
|
path: n
|
|
4402
4433
|
});
|
|
4403
|
-
case "table": return /* @__PURE__ */ u(
|
|
4434
|
+
case "table": return /* @__PURE__ */ u(sn, {
|
|
4404
4435
|
block: e,
|
|
4405
4436
|
className: t,
|
|
4406
4437
|
path: n
|
|
4407
4438
|
});
|
|
4408
|
-
case "task_card": return /* @__PURE__ */ u(
|
|
4439
|
+
case "task_card": return /* @__PURE__ */ u(gn, {
|
|
4409
4440
|
block: e,
|
|
4410
4441
|
className: t,
|
|
4411
4442
|
path: n
|
|
@@ -4418,10 +4449,10 @@ function cr({ block: e, className: t, path: n = "block" }) {
|
|
|
4418
4449
|
default: return _(e);
|
|
4419
4450
|
}
|
|
4420
4451
|
}
|
|
4421
|
-
function
|
|
4422
|
-
return /* @__PURE__ */ u(
|
|
4452
|
+
function ur(e) {
|
|
4453
|
+
return /* @__PURE__ */ u(lr, { ...e });
|
|
4423
4454
|
}
|
|
4424
|
-
var
|
|
4455
|
+
var dr = {
|
|
4425
4456
|
actions: !0,
|
|
4426
4457
|
context: !0,
|
|
4427
4458
|
divider: !0,
|
|
@@ -4434,11 +4465,11 @@ var ur = {
|
|
|
4434
4465
|
table: !0,
|
|
4435
4466
|
video: !0
|
|
4436
4467
|
};
|
|
4437
|
-
function
|
|
4468
|
+
function fr(e) {
|
|
4438
4469
|
let t = T(e);
|
|
4439
|
-
return t !== void 0 && t in
|
|
4470
|
+
return t !== void 0 && t in dr;
|
|
4440
4471
|
}
|
|
4441
|
-
function
|
|
4472
|
+
function pr({ block: e, path: t }) {
|
|
4442
4473
|
let n = e.title, r = e.subtitle;
|
|
4443
4474
|
return /* @__PURE__ */ d(l, { children: [e.icon === void 0 ? null : /* @__PURE__ */ u(F, {
|
|
4444
4475
|
element: e.icon,
|
|
@@ -4451,11 +4482,11 @@ function fr({ block: e, path: t }) {
|
|
|
4451
4482
|
children: w(r) && typeof r.text == "string" ? r.text : E(r, "container subtitle")
|
|
4452
4483
|
})] })] });
|
|
4453
4484
|
}
|
|
4454
|
-
function
|
|
4485
|
+
function mr({ block: e, path: n }) {
|
|
4455
4486
|
let r = e.child_blocks;
|
|
4456
4487
|
return /* @__PURE__ */ u("div", {
|
|
4457
4488
|
...g(O.containerBody),
|
|
4458
|
-
children: Array.isArray(r) ? r.map((e, r) =>
|
|
4489
|
+
children: Array.isArray(r) ? r.map((e, r) => fr(e) ? /* @__PURE__ */ u(lr, {
|
|
4459
4490
|
block: e,
|
|
4460
4491
|
path: `${n}.child_blocks[${String(r)}]`
|
|
4461
4492
|
}, `${T(e) ?? "unknown"}-${xe(e) ?? "block"}-${String(r)}`) : /* @__PURE__ */ t("div", {
|
|
@@ -4466,7 +4497,7 @@ function pr({ block: e, path: n }) {
|
|
|
4466
4497
|
}, E(e, "Slack block"))) : null
|
|
4467
4498
|
});
|
|
4468
4499
|
}
|
|
4469
|
-
function
|
|
4500
|
+
function hr({ block: e, className: t, path: n = "block" }) {
|
|
4470
4501
|
return /* @__PURE__ */ u(R, {
|
|
4471
4502
|
blockId: e.block_id,
|
|
4472
4503
|
blockType: e.type,
|
|
@@ -4481,11 +4512,11 @@ function mr({ block: e, className: t, path: n = "block" }) {
|
|
|
4481
4512
|
"aria-hidden": "true",
|
|
4482
4513
|
"data-container-chevron": !0,
|
|
4483
4514
|
children: /* @__PURE__ */ u(ne, { size: 16 })
|
|
4484
|
-
}), /* @__PURE__ */ u(
|
|
4515
|
+
}), /* @__PURE__ */ u(pr, {
|
|
4485
4516
|
block: e,
|
|
4486
4517
|
path: n
|
|
4487
4518
|
})]
|
|
4488
|
-
}), /* @__PURE__ */ u(
|
|
4519
|
+
}), /* @__PURE__ */ u(mr, {
|
|
4489
4520
|
block: e,
|
|
4490
4521
|
path: n
|
|
4491
4522
|
})]
|
|
@@ -4493,11 +4524,11 @@ function mr({ block: e, className: t, path: n = "block" }) {
|
|
|
4493
4524
|
...g(O.container),
|
|
4494
4525
|
children: [/* @__PURE__ */ u("div", {
|
|
4495
4526
|
...g(O.containerHeader, e.has_header_divider === !0 && O.containerHeaderDivider),
|
|
4496
|
-
children: /* @__PURE__ */ u(
|
|
4527
|
+
children: /* @__PURE__ */ u(pr, {
|
|
4497
4528
|
block: e,
|
|
4498
4529
|
path: n
|
|
4499
4530
|
})
|
|
4500
|
-
}), /* @__PURE__ */ u(
|
|
4531
|
+
}), /* @__PURE__ */ u(mr, {
|
|
4501
4532
|
block: e,
|
|
4502
4533
|
path: n
|
|
4503
4534
|
})]
|
|
@@ -4506,7 +4537,7 @@ function mr({ block: e, className: t, path: n = "block" }) {
|
|
|
4506
4537
|
}
|
|
4507
4538
|
//#endregion
|
|
4508
4539
|
//#region src/errors.ts
|
|
4509
|
-
var
|
|
4540
|
+
var gr = class extends Error {
|
|
4510
4541
|
code;
|
|
4511
4542
|
path;
|
|
4512
4543
|
name;
|
|
@@ -4516,12 +4547,12 @@ var hr = class extends Error {
|
|
|
4516
4547
|
};
|
|
4517
4548
|
//#endregion
|
|
4518
4549
|
//#region src/BlockKit.tsx
|
|
4519
|
-
function
|
|
4550
|
+
function _r(e) {
|
|
4520
4551
|
let t = e;
|
|
4521
4552
|
if (typeof e == "string") try {
|
|
4522
4553
|
t = JSON.parse(e);
|
|
4523
4554
|
} catch {
|
|
4524
|
-
throw new
|
|
4555
|
+
throw new gr("data: expected valid JSON", {
|
|
4525
4556
|
code: "invalid_json",
|
|
4526
4557
|
path: "data"
|
|
4527
4558
|
});
|
|
@@ -4537,8 +4568,8 @@ function gr(e) {
|
|
|
4537
4568
|
blocks: [t]
|
|
4538
4569
|
};
|
|
4539
4570
|
}
|
|
4540
|
-
function
|
|
4541
|
-
let c = o(() =>
|
|
4571
|
+
function vr({ "aria-label": e = "Slack Block Kit preview", className: t, data: n, onAction: r, resolvers: i, surface: a = "message", theme: s = "light" }) {
|
|
4572
|
+
let c = o(() => _r(n), [n]), l = g(s === "dark" ? we : Ce, O.root, s === "dark" ? O.rootDark : O.rootLight);
|
|
4542
4573
|
return /* @__PURE__ */ u(b, {
|
|
4543
4574
|
onAction: r,
|
|
4544
4575
|
resolvers: i,
|
|
@@ -4551,7 +4582,7 @@ function _r({ "aria-label": e = "Slack Block Kit preview", className: t, data: n
|
|
|
4551
4582
|
"data-surface": a,
|
|
4552
4583
|
"data-theme": s,
|
|
4553
4584
|
role: "article",
|
|
4554
|
-
children: c.blocks.map((e, t) => /* @__PURE__ */ u(
|
|
4585
|
+
children: c.blocks.map((e, t) => /* @__PURE__ */ u(lr, {
|
|
4555
4586
|
block: e,
|
|
4556
4587
|
path: `${c.blockListPath}[${String(t)}]`
|
|
4557
4588
|
}, `${T(e) ?? "unknown"}-${xe(e) ?? "block"}-${String(t)}`))
|
|
@@ -4560,14 +4591,14 @@ function _r({ "aria-label": e = "Slack Block Kit preview", className: t, data: n
|
|
|
4560
4591
|
}
|
|
4561
4592
|
//#endregion
|
|
4562
4593
|
//#region src/validation.ts
|
|
4563
|
-
function
|
|
4564
|
-
throw new
|
|
4594
|
+
function yr(e, t, n) {
|
|
4595
|
+
throw new gr(n, {
|
|
4565
4596
|
code: e,
|
|
4566
4597
|
path: t
|
|
4567
4598
|
});
|
|
4568
4599
|
}
|
|
4569
4600
|
function z(e, t, n, r) {
|
|
4570
|
-
e ||
|
|
4601
|
+
e || yr(t, n, r);
|
|
4571
4602
|
}
|
|
4572
4603
|
function B(e, t) {
|
|
4573
4604
|
z(w(e), "invalid_type", t, "expected an object");
|
|
@@ -4596,67 +4627,67 @@ function q(e, t, n) {
|
|
|
4596
4627
|
function J(e, t) {
|
|
4597
4628
|
H(e.type, `${t}.type`), U(e.block_id, `${t}.block_id`, { max: 255 });
|
|
4598
4629
|
}
|
|
4599
|
-
function Y(e, t, n =
|
|
4630
|
+
function Y(e, t, n = yn) {
|
|
4600
4631
|
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"));
|
|
4601
4632
|
}
|
|
4602
|
-
function
|
|
4633
|
+
function br(e, t = "text", n = yn) {
|
|
4603
4634
|
Y(e, t, n);
|
|
4604
4635
|
}
|
|
4605
|
-
function X(e, t, n =
|
|
4636
|
+
function X(e, t, n = yn) {
|
|
4606
4637
|
Y(e, t, n), z(w(e) && e.type === "plain_text", "invalid_value", `${t}.type`, "expected \"plain_text\"");
|
|
4607
4638
|
}
|
|
4608
|
-
function
|
|
4639
|
+
function xr(e, t) {
|
|
4609
4640
|
B(e, t);
|
|
4610
4641
|
let n = e.id !== void 0, r = e.url !== void 0;
|
|
4611
|
-
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:
|
|
4642
|
+
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: Sn });
|
|
4612
4643
|
}
|
|
4613
4644
|
function Z(e, t) {
|
|
4614
|
-
B(e, t), K(e, "image", t), H(e.alt_text, `${t}.alt_text`, { max:
|
|
4645
|
+
B(e, t), K(e, "image", t), H(e.alt_text, `${t}.alt_text`, { max: Cn });
|
|
4615
4646
|
let n = e.image_url !== void 0, r = e.slack_file !== void 0;
|
|
4616
|
-
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:
|
|
4647
|
+
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: Sn }), r && xr(e.slack_file, `${t}.slack_file`);
|
|
4617
4648
|
}
|
|
4618
|
-
function
|
|
4649
|
+
function Sr(e, t = "element") {
|
|
4619
4650
|
Z(e, t);
|
|
4620
4651
|
}
|
|
4621
|
-
function
|
|
4622
|
-
B(e, t), Y(e.text, `${t}.text`, 75), U(e.value, `${t}.value`, { max: 75 }), U(e.url, `${t}.url`, { max:
|
|
4652
|
+
function Cr(e, t) {
|
|
4653
|
+
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);
|
|
4623
4654
|
}
|
|
4624
|
-
function
|
|
4655
|
+
function wr(e, t, n) {
|
|
4625
4656
|
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) => {
|
|
4626
|
-
|
|
4657
|
+
Cr(e, `${t}[${String(n)}]`);
|
|
4627
4658
|
});
|
|
4628
4659
|
}
|
|
4629
|
-
function wr(e, t) {
|
|
4630
|
-
U(e.action_id, `${t}.action_id`, { max: 255 });
|
|
4631
|
-
}
|
|
4632
4660
|
function Tr(e, t) {
|
|
4633
|
-
|
|
4661
|
+
U(e.action_id, `${t}.action_id`, { max: 255 });
|
|
4634
4662
|
}
|
|
4635
4663
|
function Er(e, t) {
|
|
4636
|
-
|
|
4664
|
+
e.placeholder !== void 0 && X(e.placeholder, `${t}.placeholder`, 150);
|
|
4637
4665
|
}
|
|
4638
4666
|
function Dr(e, t) {
|
|
4667
|
+
B(e, t), K(e, "button", t), Tr(e, t), X(e.text, `${t}.text`, 75), U(e.url, `${t}.url`, { max: En }), U(e.value, `${t}.value`, { max: Dn }), U(e.accessibility_label, `${t}.accessibility_label`, { max: 75 }), e.style !== void 0 && q(e.style, ["primary", "danger"], `${t}.style`);
|
|
4668
|
+
}
|
|
4669
|
+
function Or(e, t) {
|
|
4639
4670
|
let n = e.options !== void 0, r = e.option_groups !== void 0;
|
|
4640
|
-
z(n !== r, "invalid_value", t, "must contain exactly one of options or option_groups"), n &&
|
|
4671
|
+
z(n !== r, "invalid_value", t, "must contain exactly one of options or option_groups"), n && wr(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) => {
|
|
4641
4672
|
let r = `${t}.option_groups[${String(n)}]`;
|
|
4642
|
-
B(e, r), X(e.label, `${r}.label`, 75),
|
|
4673
|
+
B(e, r), X(e.label, `${r}.label`, 75), wr(e.options, `${r}.options`, 100);
|
|
4643
4674
|
}));
|
|
4644
4675
|
}
|
|
4645
|
-
function
|
|
4646
|
-
switch (B(e, t), H(e.type, `${t}.type`),
|
|
4676
|
+
function kr(e, t) {
|
|
4677
|
+
switch (B(e, t), H(e.type, `${t}.type`), Tr(e, t), Er(e, t), e.type) {
|
|
4647
4678
|
case "button":
|
|
4648
|
-
|
|
4679
|
+
Dr(e, t);
|
|
4649
4680
|
return;
|
|
4650
4681
|
case "checkboxes":
|
|
4651
4682
|
case "radio_buttons":
|
|
4652
|
-
|
|
4683
|
+
wr(e.options, `${t}.options`, 10);
|
|
4653
4684
|
return;
|
|
4654
4685
|
case "overflow":
|
|
4655
|
-
|
|
4686
|
+
wr(e.options, `${t}.options`, 5);
|
|
4656
4687
|
return;
|
|
4657
4688
|
case "static_select":
|
|
4658
4689
|
case "multi_static_select":
|
|
4659
|
-
|
|
4690
|
+
Or(e, t);
|
|
4660
4691
|
return;
|
|
4661
4692
|
case "external_select":
|
|
4662
4693
|
case "multi_external_select":
|
|
@@ -4702,13 +4733,13 @@ function Or(e, t) {
|
|
|
4702
4733
|
case "workflow_button":
|
|
4703
4734
|
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`);
|
|
4704
4735
|
return;
|
|
4705
|
-
default:
|
|
4736
|
+
default: yr("unsupported_element", `${t}.type`, `unsupported element "${e.type}"`);
|
|
4706
4737
|
}
|
|
4707
4738
|
}
|
|
4708
|
-
function
|
|
4709
|
-
|
|
4739
|
+
function Ar(e, t = "element") {
|
|
4740
|
+
kr(e, t);
|
|
4710
4741
|
}
|
|
4711
|
-
function
|
|
4742
|
+
function jr(e, t) {
|
|
4712
4743
|
if (e !== void 0) {
|
|
4713
4744
|
B(e, t);
|
|
4714
4745
|
for (let n of [
|
|
@@ -4720,8 +4751,8 @@ function Ar(e, t) {
|
|
|
4720
4751
|
]) G(e[n], `${t}.${n}`);
|
|
4721
4752
|
}
|
|
4722
4753
|
}
|
|
4723
|
-
function
|
|
4724
|
-
switch (B(e, t), H(e.type, `${t}.type`),
|
|
4754
|
+
function Mr(e, t) {
|
|
4755
|
+
switch (B(e, t), H(e.type, `${t}.type`), jr(e.style, `${t}.style`), e.type) {
|
|
4725
4756
|
case "text":
|
|
4726
4757
|
H(e.text, `${t}.text`, { allowEmpty: !0 });
|
|
4727
4758
|
return;
|
|
@@ -4775,12 +4806,12 @@ function jr(e, t) {
|
|
|
4775
4806
|
case "workflow_mention":
|
|
4776
4807
|
z(Object.keys(e).length > 1, "missing_field", t, `${e.type} must contain its reference fields`);
|
|
4777
4808
|
return;
|
|
4778
|
-
default:
|
|
4809
|
+
default: yr("unsupported_element", `${t}.type`, `unsupported rich text element "${e.type}"`);
|
|
4779
4810
|
}
|
|
4780
4811
|
}
|
|
4781
|
-
function
|
|
4812
|
+
function Nr(e, t) {
|
|
4782
4813
|
V(e, t), e.forEach((e, n) => {
|
|
4783
|
-
|
|
4814
|
+
Mr(e, `${t}[${String(n)}]`);
|
|
4784
4815
|
});
|
|
4785
4816
|
}
|
|
4786
4817
|
function Q(e, t) {
|
|
@@ -4789,7 +4820,7 @@ function Q(e, t) {
|
|
|
4789
4820
|
switch (B(e, r), H(e.type, `${r}.type`), e.type) {
|
|
4790
4821
|
case "rich_text_section":
|
|
4791
4822
|
case "rich_text_quote":
|
|
4792
|
-
|
|
4823
|
+
Nr(e.elements, `${r}.elements`);
|
|
4793
4824
|
return;
|
|
4794
4825
|
case "rich_text_list":
|
|
4795
4826
|
q(e.style, ["bullet", "ordered"], `${r}.style`), e.indent !== void 0 && W(e.indent, `${r}.indent`, {
|
|
@@ -4801,25 +4832,25 @@ function Q(e, t) {
|
|
|
4801
4832
|
min: 0
|
|
4802
4833
|
}), V(e.elements, `${r}.elements`), e.elements.forEach((e, t) => {
|
|
4803
4834
|
let n = `${r}.elements[${String(t)}]`;
|
|
4804
|
-
B(e, n), K(e, "rich_text_section", n),
|
|
4835
|
+
B(e, n), K(e, "rich_text_section", n), Nr(e.elements, `${n}.elements`);
|
|
4805
4836
|
});
|
|
4806
4837
|
return;
|
|
4807
4838
|
case "rich_text_preformatted":
|
|
4808
|
-
|
|
4839
|
+
Nr(e.elements, `${r}.elements`), U(e.language, `${r}.language`);
|
|
4809
4840
|
return;
|
|
4810
|
-
default:
|
|
4841
|
+
default: yr("unsupported_element", `${r}.type`, `unsupported rich text container "${e.type}"`);
|
|
4811
4842
|
}
|
|
4812
4843
|
});
|
|
4813
4844
|
}
|
|
4814
|
-
function
|
|
4845
|
+
function Pr(e, t = "block") {
|
|
4815
4846
|
Q(e, t);
|
|
4816
4847
|
}
|
|
4817
|
-
function
|
|
4848
|
+
function Fr(e, t) {
|
|
4818
4849
|
B(e, t), K(e, "section", t), J(e, t);
|
|
4819
4850
|
let n = e.text !== void 0, r = e.fields !== void 0;
|
|
4820
|
-
z(n || r, "missing_field", t, "requires text or fields"), n && Y(e.text, `${t}.text`,
|
|
4821
|
-
Y(e, `${t}.fields[${String(n)}]`,
|
|
4822
|
-
})), e.accessory !== void 0 && (B(e.accessory, `${t}.accessory`), e.accessory.type === "image" ? Z(e.accessory, `${t}.accessory`) : (
|
|
4851
|
+
z(n || r, "missing_field", t, "requires text or fields"), n && Y(e.text, `${t}.text`, bn), 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) => {
|
|
4852
|
+
Y(e, `${t}.fields[${String(n)}]`, xn);
|
|
4853
|
+
})), e.accessory !== void 0 && (B(e.accessory, `${t}.accessory`), e.accessory.type === "image" ? Z(e.accessory, `${t}.accessory`) : (kr(e.accessory, `${t}.accessory`), z(![
|
|
4823
4854
|
"datetimepicker",
|
|
4824
4855
|
"file_input",
|
|
4825
4856
|
"plain_text_input",
|
|
@@ -4829,26 +4860,26 @@ function Pr(e, t) {
|
|
|
4829
4860
|
"rich_text_input"
|
|
4830
4861
|
].includes(String(e.accessory.type)), "invalid_value", `${t}.accessory.type`, "element is not legal as a section accessory"))), G(e.expand, `${t}.expand`);
|
|
4831
4862
|
}
|
|
4832
|
-
function
|
|
4863
|
+
function Ir(e, t) {
|
|
4833
4864
|
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`, {
|
|
4834
4865
|
integer: !0,
|
|
4835
4866
|
min: 1,
|
|
4836
4867
|
max: 4
|
|
4837
4868
|
});
|
|
4838
4869
|
}
|
|
4839
|
-
function Ir(e, t) {
|
|
4840
|
-
Z(e, t), B(e, t), J(e, t), e.title !== void 0 && X(e.title, `${t}.title`, Cn);
|
|
4841
|
-
}
|
|
4842
4870
|
function Lr(e, t) {
|
|
4871
|
+
Z(e, t), B(e, t), J(e, t), e.title !== void 0 && X(e.title, `${t}.title`, wn);
|
|
4872
|
+
}
|
|
4873
|
+
function Rr(e, t) {
|
|
4843
4874
|
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) => {
|
|
4844
4875
|
let r = `${t}.elements[${String(n)}]`;
|
|
4845
4876
|
B(e, r), e.type === "image" ? Z(e, r) : Y(e, r);
|
|
4846
4877
|
});
|
|
4847
4878
|
}
|
|
4848
|
-
function
|
|
4879
|
+
function zr(e, t) {
|
|
4849
4880
|
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) => {
|
|
4850
4881
|
let r = `${t}.elements[${String(n)}]`;
|
|
4851
|
-
|
|
4882
|
+
kr(e, r), B(e, r), z([
|
|
4852
4883
|
"button",
|
|
4853
4884
|
"checkboxes",
|
|
4854
4885
|
"datepicker",
|
|
@@ -4871,16 +4902,16 @@ function Rr(e, t) {
|
|
|
4871
4902
|
].includes(String(e.type)), "invalid_value", `${r}.type`, "element is not legal inside an actions block");
|
|
4872
4903
|
});
|
|
4873
4904
|
}
|
|
4874
|
-
function
|
|
4875
|
-
B(e,
|
|
4905
|
+
function Br(e, t, n) {
|
|
4906
|
+
B(e, n), K(e, "input", n), J(e, n), z(t !== "message", "surface_mismatch", n, "input blocks are only legal on modal and home surfaces"), X(e.label, `${n}.label`, 2e3), e.hint !== void 0 && X(e.hint, `${n}.hint`, 2e3), G(e.optional, `${n}.optional`), G(e.dispatch_action, `${n}.dispatch_action`), kr(e.element, `${n}.element`), B(e.element, `${n}.element`), z(![
|
|
4876
4907
|
"button",
|
|
4877
4908
|
"overflow",
|
|
4878
4909
|
"workflow_button",
|
|
4879
4910
|
"icon_button",
|
|
4880
4911
|
"feedback_buttons"
|
|
4881
|
-
].includes(String(e.element.type)), "invalid_value", `${
|
|
4912
|
+
].includes(String(e.element.type)), "invalid_value", `${n}.element.type`, "element is not legal inside an input block"), z(!(e.dispatch_action === !0 && e.element.type === "file_input"), "invalid_value", `${n}.dispatch_action`, "dispatch_action is incompatible with file_input");
|
|
4882
4913
|
}
|
|
4883
|
-
function
|
|
4914
|
+
function Vr(e) {
|
|
4884
4915
|
if (!w(e)) return 0;
|
|
4885
4916
|
if (e.type === "raw_text") return typeof e.text == "string" ? e.text.length : 0;
|
|
4886
4917
|
if (e.type === "raw_number") return typeof e.text == "string" ? e.text.length : typeof e.value == "number" ? String(e.value).length : 0;
|
|
@@ -4891,7 +4922,7 @@ function Br(e) {
|
|
|
4891
4922
|
}
|
|
4892
4923
|
return 0;
|
|
4893
4924
|
}
|
|
4894
|
-
function
|
|
4925
|
+
function Hr(e, t, n) {
|
|
4895
4926
|
switch (B(e, t), H(e.type, `${t}.type`), e.type) {
|
|
4896
4927
|
case "raw_text":
|
|
4897
4928
|
H(e.text, `${t}.text`);
|
|
@@ -4902,21 +4933,21 @@ function Vr(e, t, n) {
|
|
|
4902
4933
|
case "rich_text":
|
|
4903
4934
|
z(n, "invalid_value", t, "rich_text is not legal in this row"), Q(e, t);
|
|
4904
4935
|
return;
|
|
4905
|
-
default:
|
|
4936
|
+
default: yr("invalid_value", `${t}.type`, `unsupported table cell "${e.type}"`);
|
|
4906
4937
|
}
|
|
4907
4938
|
}
|
|
4908
|
-
function
|
|
4939
|
+
function Ur(e, t, n, r, i) {
|
|
4909
4940
|
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`);
|
|
4910
4941
|
let a, o = 0;
|
|
4911
4942
|
return e.forEach((e, n) => {
|
|
4912
4943
|
let r = `${t}[${String(n)}]`;
|
|
4913
4944
|
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) => {
|
|
4914
|
-
|
|
4945
|
+
Hr(e, `${r}[${String(t)}]`, i || n !== 0), o += Vr(e);
|
|
4915
4946
|
});
|
|
4916
4947
|
}), z(o <= r, "limit_exceeded", t, `cell content must contain at most ${String(r)} characters`), a ?? 0;
|
|
4917
4948
|
}
|
|
4918
|
-
function
|
|
4919
|
-
B(e, t), K(e, "table", t), J(e, t),
|
|
4949
|
+
function Wr(e, t) {
|
|
4950
|
+
B(e, t), K(e, "table", t), J(e, t), Ur(e.rows, `${t}.rows`, 100, On, !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) => {
|
|
4920
4951
|
if (e === null) return;
|
|
4921
4952
|
let r = `${t}.column_settings[${String(n)}]`;
|
|
4922
4953
|
B(e, r), e.align !== void 0 && q(e.align, [
|
|
@@ -4926,9 +4957,9 @@ function Ur(e, t) {
|
|
|
4926
4957
|
], `${r}.align`), G(e.is_wrapped, `${r}.is_wrapped`);
|
|
4927
4958
|
}));
|
|
4928
4959
|
}
|
|
4929
|
-
function
|
|
4960
|
+
function Gr(e, t) {
|
|
4930
4961
|
B(e, t), K(e, "data_table", t), J(e, t), H(e.caption, `${t}.caption`);
|
|
4931
|
-
let n =
|
|
4962
|
+
let n = Ur(e.rows, `${t}.rows`, 201, kn, !1);
|
|
4932
4963
|
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`, {
|
|
4933
4964
|
integer: !0,
|
|
4934
4965
|
min: 1,
|
|
@@ -4939,7 +4970,7 @@ function Wr(e, t) {
|
|
|
4939
4970
|
max: n - 1
|
|
4940
4971
|
});
|
|
4941
4972
|
}
|
|
4942
|
-
function
|
|
4973
|
+
function Kr(e, t) {
|
|
4943
4974
|
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") {
|
|
4944
4975
|
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) => {
|
|
4945
4976
|
let r = `${t}.chart.segments[${String(n)}]`;
|
|
@@ -4968,20 +4999,20 @@ function Gr(e, t) {
|
|
|
4968
4999
|
});
|
|
4969
5000
|
});
|
|
4970
5001
|
}
|
|
4971
|
-
function
|
|
5002
|
+
function qr(e, t) {
|
|
4972
5003
|
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`));
|
|
4973
5004
|
for (let n of ["title", "subtitle"]) e[n] !== void 0 && Y(e[n], `${t}.${n}`, 150);
|
|
4974
5005
|
for (let n of ["body", "subtext"]) e[n] !== void 0 && Y(e[n], `${t}.${n}`, 200);
|
|
4975
5006
|
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) => {
|
|
4976
|
-
|
|
5007
|
+
Dr(e, `${t}.actions[${String(n)}]`);
|
|
4977
5008
|
}));
|
|
4978
5009
|
}
|
|
4979
|
-
function
|
|
5010
|
+
function Jr(e, t) {
|
|
4980
5011
|
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) => {
|
|
4981
|
-
|
|
5012
|
+
qr(e, `${t}.elements[${String(n)}]`);
|
|
4982
5013
|
});
|
|
4983
5014
|
}
|
|
4984
|
-
function
|
|
5015
|
+
function Yr(e, t, n) {
|
|
4985
5016
|
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, [
|
|
4986
5017
|
"default",
|
|
4987
5018
|
"info",
|
|
@@ -4990,21 +5021,21 @@ function Jr(e, t, n) {
|
|
|
4990
5021
|
"success"
|
|
4991
5022
|
], `${n}.level`);
|
|
4992
5023
|
}
|
|
4993
|
-
function
|
|
5024
|
+
function Xr(e, t) {
|
|
4994
5025
|
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) => {
|
|
4995
5026
|
let r = `${t}.elements[${String(n)}]`;
|
|
4996
|
-
if (B(e, r),
|
|
4997
|
-
q(e.icon, ["trash"], `${r}.icon`), X(e.text, `${r}.text`, 75), U(e.value, `${r}.value`, { max:
|
|
5027
|
+
if (B(e, r), Tr(e, r), e.type === "icon_button") {
|
|
5028
|
+
q(e.icon, ["trash"], `${r}.icon`), X(e.text, `${r}.text`, 75), U(e.value, `${r}.value`, { max: Dn });
|
|
4998
5029
|
return;
|
|
4999
5030
|
}
|
|
5000
5031
|
z(e.type === "feedback_buttons", "unsupported_element", `${r}.type`, "context_actions only accepts icon_button or feedback_buttons");
|
|
5001
5032
|
for (let t of ["positive_button", "negative_button"]) {
|
|
5002
5033
|
let n = `${r}.${t}`;
|
|
5003
|
-
B(e[t], n), X(e[t].text, `${n}.text`, 75), H(e[t].value, `${n}.value`, { max:
|
|
5034
|
+
B(e[t], n), X(e[t].text, `${n}.text`, 75), H(e[t].value, `${n}.value`, { max: Dn });
|
|
5004
5035
|
}
|
|
5005
5036
|
});
|
|
5006
5037
|
}
|
|
5007
|
-
function
|
|
5038
|
+
function Zr(e, t) {
|
|
5008
5039
|
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, [
|
|
5009
5040
|
"pending",
|
|
5010
5041
|
"in_progress",
|
|
@@ -5015,12 +5046,12 @@ function Xr(e, t) {
|
|
|
5015
5046
|
B(e, r), K(e, "url", r), H(e.url, `${r}.url`), H(e.text, `${r}.text`);
|
|
5016
5047
|
}));
|
|
5017
5048
|
}
|
|
5018
|
-
function
|
|
5049
|
+
function Qr(e, t) {
|
|
5019
5050
|
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) => {
|
|
5020
|
-
|
|
5051
|
+
Zr(e, `${t}.tasks[${String(n)}]`);
|
|
5021
5052
|
}));
|
|
5022
5053
|
}
|
|
5023
|
-
function
|
|
5054
|
+
function $r(e, t) {
|
|
5024
5055
|
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, [
|
|
5025
5056
|
"narrow",
|
|
5026
5057
|
"standard",
|
|
@@ -5042,122 +5073,122 @@ function Qr(e, t) {
|
|
|
5042
5073
|
];
|
|
5043
5074
|
e.child_blocks.forEach((e, r) => {
|
|
5044
5075
|
let i = `${t}.child_blocks[${String(r)}]`;
|
|
5045
|
-
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`),
|
|
5076
|
+
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`), ni(e, "message", i);
|
|
5046
5077
|
});
|
|
5047
5078
|
}
|
|
5048
|
-
function
|
|
5079
|
+
function ei(e, t) {
|
|
5049
5080
|
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`);
|
|
5050
5081
|
}
|
|
5051
|
-
function
|
|
5052
|
-
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:
|
|
5082
|
+
function ti(e, t) {
|
|
5083
|
+
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: Cn }), 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 });
|
|
5053
5084
|
}
|
|
5054
5085
|
function $(e, t, n) {
|
|
5055
5086
|
z(e === "message", "surface_mismatch", t, `${n} blocks are only documented for message surfaces`);
|
|
5056
5087
|
}
|
|
5057
|
-
function
|
|
5088
|
+
function ni(e, t = "message", n = "block") {
|
|
5058
5089
|
switch (B(e, n), J(e, n), e.type) {
|
|
5059
5090
|
case "actions":
|
|
5060
|
-
|
|
5091
|
+
zr(e, n);
|
|
5061
5092
|
return;
|
|
5062
5093
|
case "alert":
|
|
5063
|
-
|
|
5094
|
+
Yr(e, t, n);
|
|
5064
5095
|
return;
|
|
5065
5096
|
case "card":
|
|
5066
|
-
$(t, n, e.type),
|
|
5097
|
+
$(t, n, e.type), qr(e, n);
|
|
5067
5098
|
return;
|
|
5068
5099
|
case "carousel":
|
|
5069
|
-
$(t, n, e.type),
|
|
5100
|
+
$(t, n, e.type), Jr(e, n);
|
|
5070
5101
|
return;
|
|
5071
5102
|
case "container":
|
|
5072
|
-
$(t, n, e.type),
|
|
5103
|
+
$(t, n, e.type), $r(e, n);
|
|
5073
5104
|
return;
|
|
5074
5105
|
case "context":
|
|
5075
|
-
|
|
5106
|
+
Rr(e, n);
|
|
5076
5107
|
return;
|
|
5077
5108
|
case "context_actions":
|
|
5078
|
-
$(t, n, e.type),
|
|
5109
|
+
$(t, n, e.type), Xr(e, n);
|
|
5079
5110
|
return;
|
|
5080
5111
|
case "data_table":
|
|
5081
|
-
$(t, n, e.type),
|
|
5112
|
+
$(t, n, e.type), Gr(e, n);
|
|
5082
5113
|
return;
|
|
5083
5114
|
case "data_visualization":
|
|
5084
|
-
$(t, n, e.type),
|
|
5115
|
+
$(t, n, e.type), Kr(e, n);
|
|
5085
5116
|
return;
|
|
5086
5117
|
case "divider":
|
|
5087
5118
|
K(e, "divider", n);
|
|
5088
5119
|
return;
|
|
5089
5120
|
case "file":
|
|
5090
|
-
$(t, n, e.type),
|
|
5121
|
+
$(t, n, e.type), ei(e, n);
|
|
5091
5122
|
return;
|
|
5092
5123
|
case "header":
|
|
5093
|
-
|
|
5124
|
+
Ir(e, n);
|
|
5094
5125
|
return;
|
|
5095
5126
|
case "image":
|
|
5096
|
-
|
|
5127
|
+
Lr(e, n);
|
|
5097
5128
|
return;
|
|
5098
5129
|
case "input":
|
|
5099
|
-
|
|
5130
|
+
Br(e, t, n);
|
|
5100
5131
|
return;
|
|
5101
5132
|
case "markdown":
|
|
5102
|
-
$(t, n, e.type), H(e.text, `${n}.text`, { max:
|
|
5133
|
+
$(t, n, e.type), H(e.text, `${n}.text`, { max: Tn });
|
|
5103
5134
|
return;
|
|
5104
5135
|
case "plan":
|
|
5105
|
-
$(t, n, e.type),
|
|
5136
|
+
$(t, n, e.type), Qr(e, n);
|
|
5106
5137
|
return;
|
|
5107
5138
|
case "rich_text":
|
|
5108
5139
|
Q(e, n);
|
|
5109
5140
|
return;
|
|
5110
5141
|
case "section":
|
|
5111
|
-
|
|
5142
|
+
Fr(e, n);
|
|
5112
5143
|
return;
|
|
5113
5144
|
case "table":
|
|
5114
|
-
$(t, n, e.type),
|
|
5145
|
+
$(t, n, e.type), Wr(e, n);
|
|
5115
5146
|
return;
|
|
5116
5147
|
case "task_card":
|
|
5117
|
-
$(t, n, e.type),
|
|
5148
|
+
$(t, n, e.type), Zr(e, n);
|
|
5118
5149
|
return;
|
|
5119
5150
|
case "video":
|
|
5120
|
-
|
|
5151
|
+
ti(e, n);
|
|
5121
5152
|
return;
|
|
5122
|
-
default:
|
|
5153
|
+
default: yr("unsupported_block", `${n}.type`, `unsupported block "${String(e.type)}"`);
|
|
5123
5154
|
}
|
|
5124
5155
|
}
|
|
5125
|
-
function
|
|
5126
|
-
|
|
5156
|
+
function ri(e, t, n = "message", r = "block") {
|
|
5157
|
+
ni(e, n, r), z(e.type === t, "invalid_value", `${r}.type`, `expected "${t}"`);
|
|
5127
5158
|
}
|
|
5128
|
-
function
|
|
5159
|
+
function ii(e, t) {
|
|
5129
5160
|
return Array.isArray(e) ? e : (B(e, t), V(e.blocks, `${t}.blocks`), e.blocks);
|
|
5130
5161
|
}
|
|
5131
|
-
function
|
|
5132
|
-
let r = Array.isArray(e) ? n : `${n}.blocks`, i =
|
|
5162
|
+
function ai(e, t = "message", n = "data") {
|
|
5163
|
+
let r = Array.isArray(e) ? n : `${n}.blocks`, i = ii(e, n), a = t === "message" ? 50 : 100;
|
|
5133
5164
|
z(i.length <= a, "limit_exceeded", r, `${t} surfaces accept at most ${String(a)} blocks`);
|
|
5134
5165
|
let o = 0, s = 0, c = 0, l = /* @__PURE__ */ new Set();
|
|
5135
5166
|
i.forEach((e, n) => {
|
|
5136
5167
|
let i = `${r}[${String(n)}]`;
|
|
5137
|
-
if (
|
|
5138
|
-
else if (e.type === "table") for (let t of e.rows) for (let e of t) s +=
|
|
5139
|
-
else if (e.type === "data_table") for (let t of e.rows) for (let e of t) c +=
|
|
5140
|
-
}), z(o <=
|
|
5168
|
+
if (ni(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;
|
|
5169
|
+
else if (e.type === "table") for (let t of e.rows) for (let e of t) s += Vr(e);
|
|
5170
|
+
else if (e.type === "data_table") for (let t of e.rows) for (let e of t) c += Vr(e);
|
|
5171
|
+
}), z(o <= Tn, "limit_exceeded", r, `markdown blocks exceed the cumulative ${String(Tn)} character limit`), z(s <= On, "limit_exceeded", r, `table cells exceed the cumulative ${String(On)} character limit`), z(c <= kn, "limit_exceeded", r, `data_table cells exceed the cumulative ${String(kn)} character limit`);
|
|
5141
5172
|
}
|
|
5142
|
-
function
|
|
5173
|
+
function oi(e, t = "message") {
|
|
5143
5174
|
let n = e;
|
|
5144
5175
|
if (typeof e == "string") try {
|
|
5145
5176
|
n = JSON.parse(e);
|
|
5146
5177
|
} catch {
|
|
5147
|
-
throw new
|
|
5178
|
+
throw new gr("expected valid JSON", {
|
|
5148
5179
|
code: "invalid_json",
|
|
5149
5180
|
path: "data"
|
|
5150
5181
|
});
|
|
5151
5182
|
}
|
|
5152
|
-
return
|
|
5153
|
-
}
|
|
5154
|
-
function oi(e) {
|
|
5155
|
-
return si(e) ? e.blocks : e;
|
|
5183
|
+
return ai(n, t), n;
|
|
5156
5184
|
}
|
|
5157
5185
|
function si(e) {
|
|
5186
|
+
return ci(e) ? e.blocks : e;
|
|
5187
|
+
}
|
|
5188
|
+
function ci(e) {
|
|
5158
5189
|
return !Array.isArray(e);
|
|
5159
5190
|
}
|
|
5160
5191
|
//#endregion
|
|
5161
|
-
export {
|
|
5192
|
+
export { rr as ActionsBlock, hn as AlertBlock, ur as Block, vr as BlockKit, gr as BlockKitInvariantError, b as BlockKitProvider, lt as ButtonElement, fn as CardBlock, mn as CarouselBlock, pt as ChoiceGroup, hr as ContainerBlock, or as ContextActionsBlock, Qt as ContextBlock, un as DataTableBlock, $n as DataVisualizationBlock, Yt as DividerBlock, tn as FileBlock, Jt as HeaderBlock, Xt as ImageBlock, F as ImageElement, ir as InputBlock, Et as InputElement, Dt as InteractiveElement, Gt as Markdown, en as MarkdownBlock, I as Mrkdwn, ut as OverflowElement, vn as PlanBlock, N as RichText, $t as RichTextBlock, qt as SectionBlock, xt as SelectElement, sn as TableBlock, an as TableCell, gn as TaskCardBlock, L as Text, nn as VideoBlock, ai as assertBlockKitData, ri as assertBlockType, Sr as assertImageElementData, Ar as assertInteractiveElementData, ni as assertRenderableBlock, Pr as assertRichTextBlockData, br as assertTextObjectData, si as blocksOf, we as darkTheme, Ce as lightTheme, oi as parseBlockKitData, Vt as tokenizeMarkdown, Ft as tokenizeMrkdwn, Se as tokens, x as useBlockKitContext };
|
|
5162
5193
|
|
|
5163
5194
|
//# sourceMappingURL=index.js.map
|