@capybara-hq/plugin-slack 0.1.0-rc.7 → 0.1.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.capybara-plugin/plugin.json +2 -2
- package/dist/index.mjs +18 -4
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "slack",
|
|
4
|
-
"version": "0.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.8",
|
|
5
5
|
"publisher": "Capybara",
|
|
6
6
|
"description": "Slack (channel@1 bot over Socket Mode with Block Kit cards, identity-source@1 Sign in with Slack, directory@1)",
|
|
7
7
|
"displayName": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"entry": "./dist/index.mjs",
|
|
32
32
|
"manifest": {
|
|
33
33
|
"name": "slack",
|
|
34
|
-
"version": "0.1.0-rc.
|
|
34
|
+
"version": "0.1.0-rc.8",
|
|
35
35
|
"sdk": "^0.1.0-rc.0",
|
|
36
36
|
"provides": [
|
|
37
37
|
"channel@1",
|
package/dist/index.mjs
CHANGED
|
@@ -36948,6 +36948,8 @@ function parseBlockActions(payload) {
|
|
|
36948
36948
|
import {
|
|
36949
36949
|
ChannelSendError,
|
|
36950
36950
|
questionRenderableInline,
|
|
36951
|
+
questionStateLabel,
|
|
36952
|
+
questionTextReplyHint,
|
|
36951
36953
|
renderCardAsText
|
|
36952
36954
|
} from "@capybara-hq/plugin-sdk";
|
|
36953
36955
|
|
|
@@ -37298,6 +37300,7 @@ var T = {
|
|
|
37298
37300
|
questionStates: {
|
|
37299
37301
|
pending: "Pending",
|
|
37300
37302
|
answered: "Answered",
|
|
37303
|
+
skipped: "Skipped (replied instead)",
|
|
37301
37304
|
expired: "Expired",
|
|
37302
37305
|
cancelled: "Cancelled"
|
|
37303
37306
|
}
|
|
@@ -37332,6 +37335,7 @@ var T = {
|
|
|
37332
37335
|
questionStates: {
|
|
37333
37336
|
pending: "待回答",
|
|
37334
37337
|
answered: "已回答",
|
|
37338
|
+
skipped: "已跳过(已直接回复)",
|
|
37335
37339
|
expired: "已过期",
|
|
37336
37340
|
cancelled: "已取消"
|
|
37337
37341
|
}
|
|
@@ -37470,7 +37474,8 @@ function questionInputs(c, locale) {
|
|
|
37470
37474
|
const t = T[locale];
|
|
37471
37475
|
const web = link("cap_link_web", t.answerOnWeb, c.webUrl);
|
|
37472
37476
|
const f = c.form.fields[0];
|
|
37473
|
-
|
|
37477
|
+
const inline2 = questionRenderableInline(c.form, { textReply: c.textReply !== void 0 });
|
|
37478
|
+
if (!inline2 || !f || !("enum" in f.schema)) return [actions([web])];
|
|
37474
37479
|
const options = f.schema.enum;
|
|
37475
37480
|
try {
|
|
37476
37481
|
if (!f.multiSelect) {
|
|
@@ -37504,6 +37509,10 @@ function questionInputs(c, locale) {
|
|
|
37504
37509
|
return [actions([web])];
|
|
37505
37510
|
}
|
|
37506
37511
|
}
|
|
37512
|
+
function questionState(state, locale) {
|
|
37513
|
+
const states = T[locale].questionStates;
|
|
37514
|
+
return states[state] ?? esc2(questionStateLabel(state, locale));
|
|
37515
|
+
}
|
|
37507
37516
|
function questionBlocks(c, locale) {
|
|
37508
37517
|
const t = T[locale];
|
|
37509
37518
|
const title = textOf(c.form.title, locale);
|
|
@@ -37515,8 +37524,13 @@ function questionBlocks(c, locale) {
|
|
|
37515
37524
|
if (f.description !== void 0) lines.push(`_${esc2(textOf(f.description, locale))}_`);
|
|
37516
37525
|
}
|
|
37517
37526
|
const blocks = [section(lines.join("\n"))];
|
|
37518
|
-
if (c.state === "pending")
|
|
37519
|
-
|
|
37527
|
+
if (c.state === "pending") {
|
|
37528
|
+
blocks.push(...questionInputs(c, locale));
|
|
37529
|
+
if (c.textReply !== void 0)
|
|
37530
|
+
blocks.push(context(esc2(questionTextReplyHint(c.textReply, locale))));
|
|
37531
|
+
return blocks;
|
|
37532
|
+
}
|
|
37533
|
+
const status = `${t.status}${t.sep}${questionState(c.state, locale)}`;
|
|
37520
37534
|
const answer = c.answerSummary ? `
|
|
37521
37535
|
${t.answer}${t.sep}${esc2(c.answerSummary)}` : "";
|
|
37522
37536
|
blocks.push(context(`${status}${answer}`));
|
|
@@ -39775,7 +39789,7 @@ function appTokenCheck(opts) {
|
|
|
39775
39789
|
// src/index.ts
|
|
39776
39790
|
var index_default = defineExtension({
|
|
39777
39791
|
name: "slack",
|
|
39778
|
-
version: "0.1.0-rc.
|
|
39792
|
+
version: "0.1.0-rc.8",
|
|
39779
39793
|
sdk: "^0.1.0-rc.0",
|
|
39780
39794
|
provides: [CHANNEL_EXTENSION_POINT, IDENTITY_SOURCE_EXTENSION_POINT, DIRECTORY_EXTENSION_POINT],
|
|
39781
39795
|
permissions: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capybara-hq/plugin-slack",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "Slack (channel@1 bot over Socket Mode with Block Kit cards, identity-source@1 Sign in with Slack, directory@1)",
|