slackblock 0.4.0 → 1.0.0-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/CHANGELOG.md +33 -26
- package/LICENSE +21 -21
- package/README.md +95 -85
- package/dist/block.cjs +341 -0
- package/dist/block.cjs.map +1 -0
- package/dist/block.d.mts +412 -0
- package/dist/block.d.ts +412 -0
- package/dist/block.mjs +268 -0
- package/dist/block.mjs.map +1 -0
- package/dist/index.cjs +1202 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +1170 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types.d-DgQXbJte.d.mts +296 -0
- package/dist/types.d-DgQXbJte.d.ts +296 -0
- package/package.json +85 -135
- package/blocks.js +0 -12
- package/index.js +0 -7
- package/lib/components/block/button.js +0 -27
- package/lib/components/block/confirmation.js +0 -27
- package/lib/components/block/image.js +0 -27
- package/lib/components/block/text.js +0 -27
- package/lib/components/index.js +0 -42
- package/lib/components/input/date-picker.js +0 -27
- package/lib/components/input/option-group.js +0 -27
- package/lib/components/input/option.js +0 -27
- package/lib/components/input/overflow.js +0 -27
- package/lib/components/input/radio-group.js +0 -27
- package/lib/components/input/select.js +0 -34
- package/lib/components/input/text.js +0 -27
- package/lib/components/layout/actions.js +0 -27
- package/lib/components/layout/container.js +0 -27
- package/lib/components/layout/context.js +0 -27
- package/lib/components/layout/divider.js +0 -27
- package/lib/components/layout/file.js +0 -27
- package/lib/components/layout/image.js +0 -27
- package/lib/components/layout/input.js +0 -27
- package/lib/components/layout/section.js +0 -27
- package/lib/components/message.js +0 -27
- package/lib/index.js +0 -7
- package/lib/parser/index.js +0 -32
- package/lib/renderer/index.js +0 -71
- package/lib/transformers/block/button.js +0 -29
- package/lib/transformers/block/confirmation.js +0 -18
- package/lib/transformers/block/image.js +0 -10
- package/lib/transformers/block/text.js +0 -16
- package/lib/transformers/index.js +0 -54
- package/lib/transformers/input/date-picker.js +0 -30
- package/lib/transformers/input/option-group.js +0 -19
- package/lib/transformers/input/option.js +0 -19
- package/lib/transformers/input/overflow.js +0 -19
- package/lib/transformers/input/radio-group.js +0 -22
- package/lib/transformers/input/select.js +0 -84
- package/lib/transformers/input/text.js +0 -31
- package/lib/transformers/layout/actions.js +0 -18
- package/lib/transformers/layout/container.js +0 -11
- package/lib/transformers/layout/context.js +0 -18
- package/lib/transformers/layout/divider.js +0 -10
- package/lib/transformers/layout/file.js +0 -14
- package/lib/transformers/layout/image.js +0 -23
- package/lib/transformers/layout/input.js +0 -26
- package/lib/transformers/layout/section.js +0 -31
- package/lib/utils/get-type.js +0 -16
- package/lib/utils/type-helpers.js +0 -2
- package/src/components/block/button.tsx +0 -20
- package/src/components/block/confirmation.tsx +0 -19
- package/src/components/block/image.tsx +0 -8
- package/src/components/block/text.tsx +0 -10
- package/src/components/index.ts +0 -23
- package/src/components/input/date-picker.tsx +0 -11
- package/src/components/input/option-group.tsx +0 -9
- package/src/components/input/option.tsx +0 -9
- package/src/components/input/overflow.tsx +0 -12
- package/src/components/input/radio-group.tsx +0 -13
- package/src/components/input/select.tsx +0 -36
- package/src/components/input/text.tsx +0 -12
- package/src/components/layout/actions.tsx +0 -9
- package/src/components/layout/container.tsx +0 -9
- package/src/components/layout/context.tsx +0 -12
- package/src/components/layout/divider.tsx +0 -7
- package/src/components/layout/file.tsx +0 -8
- package/src/components/layout/image.tsx +0 -10
- package/src/components/layout/input.tsx +0 -12
- package/src/components/layout/section.tsx +0 -15
- package/src/components/message.tsx +0 -20
- package/src/constants/types.d.ts +0 -93
- package/src/index.ts +0 -3
- package/src/parser/index.ts +0 -32
- package/src/renderer/index.ts +0 -75
- package/src/transformers/block/button.tsx +0 -47
- package/src/transformers/block/confirmation.tsx +0 -26
- package/src/transformers/block/image.ts +0 -18
- package/src/transformers/block/text.ts +0 -34
- package/src/transformers/index.ts +0 -65
- package/src/transformers/input/date-picker.tsx +0 -43
- package/src/transformers/input/option-group.tsx +0 -26
- package/src/transformers/input/option.tsx +0 -27
- package/src/transformers/input/overflow.ts +0 -33
- package/src/transformers/input/radio-group.ts +0 -38
- package/src/transformers/input/select.tsx +0 -136
- package/src/transformers/input/text.tsx +0 -47
- package/src/transformers/layout/actions.ts +0 -29
- package/src/transformers/layout/container.ts +0 -16
- package/src/transformers/layout/context.ts +0 -35
- package/src/transformers/layout/divider.ts +0 -20
- package/src/transformers/layout/file.ts +0 -24
- package/src/transformers/layout/image.tsx +0 -34
- package/src/transformers/layout/input.tsx +0 -39
- package/src/transformers/layout/section.ts +0 -53
- package/src/tsconfig.json +0 -11
- package/src/utils/get-type.ts +0 -20
- package/src/utils/type-helpers.ts +0 -1
- package/test/index.test.tsx +0 -11
- package/test/parser/parser.test.tsx +0 -67
- package/test/renderer/renderer.test.tsx +0 -138
- package/test/transformers/block/button.test.tsx +0 -63
- package/test/transformers/block/confirmation.test.tsx +0 -37
- package/test/transformers/block/image.test.tsx +0 -20
- package/test/transformers/block/text.test.tsx +0 -32
- package/test/transformers/input/date-picker.test.tsx +0 -66
- package/test/transformers/input/option-group.test.tsx +0 -26
- package/test/transformers/input/option.test.tsx +0 -36
- package/test/transformers/input/overflow.test.tsx +0 -57
- package/test/transformers/input/radio-group.test.tsx +0 -81
- package/test/transformers/input/select.test.tsx +0 -249
- package/test/transformers/input/text.test.tsx +0 -42
- package/test/transformers/layout/actions.test.tsx +0 -33
- package/test/transformers/layout/container.test.tsx +0 -34
- package/test/transformers/layout/context.test.tsx +0 -43
- package/test/transformers/layout/divider.test.tsx +0 -20
- package/test/transformers/layout/file.test.tsx +0 -26
- package/test/transformers/layout/image.test.tsx +0 -43
- package/test/transformers/layout/input.test.tsx +0 -59
- package/test/transformers/layout/section.test.tsx +0 -89
- package/test/tsconfig.json +0 -9
- package/test/utils/get-type.test.tsx +0 -21
- package/tsconfig.json +0 -14
package/lib/components/index.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var message_1 = require("./message");
|
|
4
|
-
exports.Message = message_1.default;
|
|
5
|
-
var button_1 = require("./block/button");
|
|
6
|
-
exports.Button = button_1.default;
|
|
7
|
-
var confirmation_1 = require("./block/confirmation");
|
|
8
|
-
exports.Confirmation = confirmation_1.default;
|
|
9
|
-
var image_1 = require("./block/image");
|
|
10
|
-
exports.Image = image_1.default;
|
|
11
|
-
var text_1 = require("./block/text");
|
|
12
|
-
exports.Text = text_1.default;
|
|
13
|
-
var date_picker_1 = require("./input/date-picker");
|
|
14
|
-
exports.DatePicker = date_picker_1.default;
|
|
15
|
-
var option_group_1 = require("./input/option-group");
|
|
16
|
-
exports.OptionGroup = option_group_1.default;
|
|
17
|
-
var option_1 = require("./input/option");
|
|
18
|
-
exports.Option = option_1.default;
|
|
19
|
-
var overflow_1 = require("./input/overflow");
|
|
20
|
-
exports.Overflow = overflow_1.default;
|
|
21
|
-
var radio_group_1 = require("./input/radio-group");
|
|
22
|
-
exports.RadioGroup = radio_group_1.default;
|
|
23
|
-
var select_1 = require("./input/select");
|
|
24
|
-
exports.Select = select_1.default;
|
|
25
|
-
var text_2 = require("./input/text");
|
|
26
|
-
exports.TextInput = text_2.default;
|
|
27
|
-
var actions_1 = require("./layout/actions");
|
|
28
|
-
exports.Actions = actions_1.default;
|
|
29
|
-
var context_1 = require("./layout/context");
|
|
30
|
-
exports.Context = context_1.default;
|
|
31
|
-
var divider_1 = require("./layout/divider");
|
|
32
|
-
exports.Divider = divider_1.default;
|
|
33
|
-
var file_1 = require("./layout/file");
|
|
34
|
-
exports.File = file_1.default;
|
|
35
|
-
var image_2 = require("./layout/image");
|
|
36
|
-
exports.ImageLayout = image_2.default;
|
|
37
|
-
var input_1 = require("./layout/input");
|
|
38
|
-
exports.Input = input_1.default;
|
|
39
|
-
var section_1 = require("./layout/section");
|
|
40
|
-
exports.Section = section_1.default;
|
|
41
|
-
var container_1 = require("./layout/container");
|
|
42
|
-
exports.Container = container_1.default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var DatePicker = (function (_super) {
|
|
21
|
-
__extends(DatePicker, _super);
|
|
22
|
-
function DatePicker() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return DatePicker;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = DatePicker;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var OptionGroup = (function (_super) {
|
|
21
|
-
__extends(OptionGroup, _super);
|
|
22
|
-
function OptionGroup() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return OptionGroup;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = OptionGroup;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Option = (function (_super) {
|
|
21
|
-
__extends(Option, _super);
|
|
22
|
-
function Option() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Option;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Option;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Overflow = (function (_super) {
|
|
21
|
-
__extends(Overflow, _super);
|
|
22
|
-
function Overflow() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Overflow;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Overflow;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var RadioGroup = (function (_super) {
|
|
21
|
-
__extends(RadioGroup, _super);
|
|
22
|
-
function RadioGroup() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return RadioGroup;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = RadioGroup;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
exports.selectTypes = {
|
|
21
|
-
STATIC: 'static',
|
|
22
|
-
EXTERNAL: 'external',
|
|
23
|
-
USER: 'user',
|
|
24
|
-
CONVERSATION: 'conversation',
|
|
25
|
-
CHANNEL: 'channel'
|
|
26
|
-
};
|
|
27
|
-
var Select = (function (_super) {
|
|
28
|
-
__extends(Select, _super);
|
|
29
|
-
function Select() {
|
|
30
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
31
|
-
}
|
|
32
|
-
return Select;
|
|
33
|
-
}(react_1.default.Component));
|
|
34
|
-
exports.default = Select;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var TextInput = (function (_super) {
|
|
21
|
-
__extends(TextInput, _super);
|
|
22
|
-
function TextInput() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return TextInput;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = TextInput;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Actions = (function (_super) {
|
|
21
|
-
__extends(Actions, _super);
|
|
22
|
-
function Actions() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Actions;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Actions;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Container = (function (_super) {
|
|
21
|
-
__extends(Container, _super);
|
|
22
|
-
function Container() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Container;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Container;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Context = (function (_super) {
|
|
21
|
-
__extends(Context, _super);
|
|
22
|
-
function Context() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Context;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Context;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Divider = (function (_super) {
|
|
21
|
-
__extends(Divider, _super);
|
|
22
|
-
function Divider() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Divider;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Divider;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var File = (function (_super) {
|
|
21
|
-
__extends(File, _super);
|
|
22
|
-
function File() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return File;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = File;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Image = (function (_super) {
|
|
21
|
-
__extends(Image, _super);
|
|
22
|
-
function Image() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Image;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Image;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Input = (function (_super) {
|
|
21
|
-
__extends(Input, _super);
|
|
22
|
-
function Input() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Input;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Input;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Section = (function (_super) {
|
|
21
|
-
__extends(Section, _super);
|
|
22
|
-
function Section() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Section;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Section;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Message = (function (_super) {
|
|
21
|
-
__extends(Message, _super);
|
|
22
|
-
function Message() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Message;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Message;
|
package/lib/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var renderer_1 = __importDefault(require("./renderer"));
|
|
7
|
-
exports.default = renderer_1.default;
|
package/lib/parser/index.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var transformers_1 = __importDefault(require("../transformers"));
|
|
7
|
-
var get_type_1 = __importDefault(require("../utils/get-type"));
|
|
8
|
-
exports.default = (function (children) {
|
|
9
|
-
if (typeof children === 'string') {
|
|
10
|
-
return { text: children };
|
|
11
|
-
}
|
|
12
|
-
if (!Array.isArray(children)) {
|
|
13
|
-
children = [children];
|
|
14
|
-
}
|
|
15
|
-
var transformedBlocks = [];
|
|
16
|
-
for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
|
|
17
|
-
var child = children_1[_i];
|
|
18
|
-
var type = get_type_1.default(child);
|
|
19
|
-
var transformer = transformers_1.default[type];
|
|
20
|
-
if (transformer) {
|
|
21
|
-
transformedBlocks.push(transformer(child));
|
|
22
|
-
}
|
|
23
|
-
else if (type !== 'null') {
|
|
24
|
-
console.warn("No transformer for child type '" + type + "' exists and will be ignored.");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
var result = {};
|
|
28
|
-
if (transformedBlocks.length > 0) {
|
|
29
|
-
result.blocks = transformedBlocks.concat.apply([], transformedBlocks);
|
|
30
|
-
}
|
|
31
|
-
return result;
|
|
32
|
-
});
|
package/lib/renderer/index.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
var parser_1 = __importDefault(require("../parser"));
|
|
18
|
-
var get_type_1 = __importDefault(require("../utils/get-type"));
|
|
19
|
-
var render = function (element) {
|
|
20
|
-
var _a = (element || {}).props, props = _a === void 0 ? {} : _a;
|
|
21
|
-
var typeName = get_type_1.default(element);
|
|
22
|
-
if (typeName !== 'Message') {
|
|
23
|
-
throw new TypeError('Provided top-level element must be a Message type.');
|
|
24
|
-
}
|
|
25
|
-
if (!props.children) {
|
|
26
|
-
throw new Error('Cannot render a Message with no children.');
|
|
27
|
-
}
|
|
28
|
-
var json = __assign({}, parser_1.default(props.children));
|
|
29
|
-
if (props.replyTo) {
|
|
30
|
-
json.thread_ts = props.replyTo;
|
|
31
|
-
}
|
|
32
|
-
if (typeof props.markdown !== 'undefined') {
|
|
33
|
-
json.mrkdwn = props.markdown;
|
|
34
|
-
}
|
|
35
|
-
json.text = props.text || '';
|
|
36
|
-
if (props.iconEmoji) {
|
|
37
|
-
json.icon_emoji = props.iconEmoji;
|
|
38
|
-
}
|
|
39
|
-
if (props.iconUrl) {
|
|
40
|
-
json.icon_url = props.iconUrl;
|
|
41
|
-
}
|
|
42
|
-
if (props.parse) {
|
|
43
|
-
json.parse = props.parse;
|
|
44
|
-
}
|
|
45
|
-
if (props.username) {
|
|
46
|
-
json.username = props.username;
|
|
47
|
-
}
|
|
48
|
-
if (props.asUser) {
|
|
49
|
-
json.as_user = props.asUser;
|
|
50
|
-
}
|
|
51
|
-
if (props.replyBroadcast) {
|
|
52
|
-
json.reply_broadcast = props.replyBroadcast;
|
|
53
|
-
}
|
|
54
|
-
if (props.unfurlLinks) {
|
|
55
|
-
json.unfurl_links = props.unfurlLinks;
|
|
56
|
-
}
|
|
57
|
-
if (typeof props.unfurlMedia !== 'undefined') {
|
|
58
|
-
json.unfurl_media = props.unfurlMedia;
|
|
59
|
-
}
|
|
60
|
-
if (props.color && json.blocks) {
|
|
61
|
-
json.attachments = [
|
|
62
|
-
{
|
|
63
|
-
color: props.color,
|
|
64
|
-
blocks: json.blocks
|
|
65
|
-
}
|
|
66
|
-
];
|
|
67
|
-
delete json.blocks;
|
|
68
|
-
}
|
|
69
|
-
return json;
|
|
70
|
-
};
|
|
71
|
-
exports.default = render;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var react_1 = __importDefault(require("react"));
|
|
7
|
-
var __1 = require("..");
|
|
8
|
-
var text_1 = __importDefault(require("../../components/block/text"));
|
|
9
|
-
exports.default = (function (child) {
|
|
10
|
-
var _a = child.props, actionId = _a.actionId, children = _a.children, url = _a.url, value = _a.value, style = _a.style, confirm = _a.confirm;
|
|
11
|
-
var res = {
|
|
12
|
-
type: 'button',
|
|
13
|
-
text: __1.transform(react_1.default.createElement(text_1.default, { plainText: true }, children)),
|
|
14
|
-
action_id: actionId
|
|
15
|
-
};
|
|
16
|
-
if (url) {
|
|
17
|
-
res.url = url;
|
|
18
|
-
}
|
|
19
|
-
if (value) {
|
|
20
|
-
res.value = value;
|
|
21
|
-
}
|
|
22
|
-
if (style) {
|
|
23
|
-
res.style = style;
|
|
24
|
-
}
|
|
25
|
-
if (confirm) {
|
|
26
|
-
res.confirm = __1.transform(confirm);
|
|
27
|
-
}
|
|
28
|
-
return res;
|
|
29
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var react_1 = __importDefault(require("react"));
|
|
7
|
-
var __1 = require("..");
|
|
8
|
-
var text_1 = __importDefault(require("../../components/block/text"));
|
|
9
|
-
exports.default = (function (child) {
|
|
10
|
-
var _a = child.props, title = _a.title, confirm = _a.confirm, deny = _a.deny, children = _a.children;
|
|
11
|
-
var res = {
|
|
12
|
-
title: __1.transform(react_1.default.createElement(text_1.default, { plainText: true }, title)),
|
|
13
|
-
text: __1.transform(children),
|
|
14
|
-
confirm: __1.transform(react_1.default.createElement(text_1.default, { plainText: true }, confirm)),
|
|
15
|
-
deny: __1.transform(react_1.default.createElement(text_1.default, { plainText: true }, deny))
|
|
16
|
-
};
|
|
17
|
-
return res;
|
|
18
|
-
});
|