@twilio/create-flex-plugin 5.0.6-alpha.202203302217 → 5.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/cli.d.ts +0 -1
- package/dist/lib/cli.js +0 -10
- package/dist/lib/cli.js.map +1 -1
- package/dist/lib/commands.d.ts +1 -1
- package/dist/lib/commands.js +10 -24
- package/dist/lib/commands.js.map +1 -1
- package/dist/lib/create-flex-plugin.d.ts +0 -1
- package/dist/lib/create-flex-plugin.js +9 -13
- package/dist/lib/create-flex-plugin.js.map +1 -1
- package/package.json +5 -5
- package/templates/js2/package.json +0 -20
- package/templates/js2/src/DemoPlugin.js +0 -23
- package/templates/js2/src/components/CustomTaskList/CustomTaskList.jsx +0 -24
- package/templates/js2/src/components/__tests__/CustomTaskList.spec.jsx +0 -28
- package/templates/js2/src/index.js +0 -5
- package/templates/ts2/package.json +0 -21
- package/templates/ts2/src/DemoPlugin.tsx +0 -24
- package/templates/ts2/src/components/CustomTaskList/CustomTaskList.tsx +0 -26
- package/templates/ts2/src/components/__tests__/CustomTaskList.spec.tsx +0 -28
- package/templates/ts2/src/index.ts +0 -5
- package/templates/ts2/tsconfig.json +0 -36
package/dist/lib/cli.d.ts
CHANGED
package/dist/lib/cli.js
CHANGED
|
@@ -121,16 +121,6 @@ var CLI = /** @class */ (function () {
|
|
|
121
121
|
version: {
|
|
122
122
|
alias: 'v',
|
|
123
123
|
},
|
|
124
|
-
flexui1: {
|
|
125
|
-
type: 'boolean',
|
|
126
|
-
describe: 'Creates a plugin compatible with Flex UI major version 1.0',
|
|
127
|
-
conflicts: 'flexui2',
|
|
128
|
-
},
|
|
129
|
-
flexui2: {
|
|
130
|
-
type: 'boolean',
|
|
131
|
-
describe: 'Creates a plugin compatible with Flex UI major version 2.0',
|
|
132
|
-
conflicts: 'flexui1',
|
|
133
|
-
},
|
|
134
124
|
};
|
|
135
125
|
return CLI;
|
|
136
126
|
}());
|
package/dist/lib/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/lib/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA6C;AAC7C,yDAAuE;AAEvE,2DAA6E;AAE7E,IAAM,KAAK,GAAG,gCAAe,CAC3B,0CAA0C,EAC1C,EAAE,EACF,YAAY,EACZ,4BAA4B,CAC7B,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/lib/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA6C;AAC7C,yDAAuE;AAEvE,2DAA6E;AAE7E,IAAM,KAAK,GAAG,gCAAe,CAC3B,0CAA0C,EAC1C,EAAE,EACF,YAAY,EACZ,4BAA4B,CAC7B,CAAC;AAkBF;IAmDE,aAAY,GAAY;QAAxB,iBAIC;QAEM,UAAK,GAAG;YAAO,cAAiB;iBAAjB,UAAiB,EAAjB,qBAAiB,EAAjB,IAAiB;gBAAjB,yBAAiB;;;;;;;;4BAC/B,IAAI,GAAiB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;4BAEnD,qBAAM,uBAAM,CAAC;oCAAY,sBAAA,qCAAgB,CAAC,IAA2B,CAAC,EAAA;yCAAA,CAAC,EAAA;;4BAAvE,SAAuE,CAAC;4BACxE,qBAAI,CAAC,CAAC,CAAC,CAAC;;;;;SACT,CAAC;QAEM,SAAI,GAAG;YACb,8DAA8D;YAC9D,KAAI,CAAC,MAAM,CAAC,KAAK,CAAM,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QACxD,CAAC,CAAC;QAfA,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,EAAE,EAAE,GAAG,CAAuB,CAAC;QAEnD,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAtDa,eAAW,GAAG,KAAK,CAAC;IAEpB,SAAK,GAA+B;QAChD,UAAU,EAAE;YACV,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,6BAA6B;YACvC,OAAO,EAAE,KAAK;SACf;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,0CAA0C;YACpD,OAAO,EAAE,EAAE;SACZ;QACD,UAAU,EAAE;YACV,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,uCAAuC;YACjD,OAAO,EAAE,EAAE;SACZ;QACD,UAAU,EAAE;YACV,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,qCAAqC;SAChD;QACD,OAAO,EAAE;YACP,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,2BAA2B;SACtC;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,qCAAqC;SAChD;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,GAAG;YACV,WAAW,EAAE,KAAK;SACnB;QACD,OAAO,EAAE;YACP,KAAK,EAAE,GAAG;SACX;KACF,CAAC;IAqBJ,UAAC;CAAA,AApED,IAoEC;kBApEoB,GAAG"}
|
package/dist/lib/commands.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare const installDependencies: (config: FlexPluginArguments) => Promi
|
|
|
12
12
|
* @param config {FlexPluginArguments} the plugin configuration
|
|
13
13
|
* @return {FlexPluginArguments} the updated configuration
|
|
14
14
|
*/
|
|
15
|
-
export declare const setupConfiguration: (config: FlexPluginArguments) =>
|
|
15
|
+
export declare const setupConfiguration: (config: FlexPluginArguments) => FlexPluginArguments;
|
|
16
16
|
/**
|
|
17
17
|
* Downloads content from GitHub
|
|
18
18
|
*
|
package/dist/lib/commands.js
CHANGED
|
@@ -59,7 +59,6 @@ exports.downloadFromGitHub = exports.setupConfiguration = exports.installDepende
|
|
|
59
59
|
var fs_1 = require("@twilio/flex-dev-utils/dist/fs");
|
|
60
60
|
var spawn_1 = require("@twilio/flex-dev-utils/dist/spawn");
|
|
61
61
|
var lodash_1 = require("@twilio/flex-dev-utils/dist/lodash");
|
|
62
|
-
var flex_dev_utils_1 = require("@twilio/flex-dev-utils");
|
|
63
62
|
var github = __importStar(require("../utils/github"));
|
|
64
63
|
// eslint-disable-next-line @typescript-eslint/no-var-requires, global-require, @typescript-eslint/no-require-imports
|
|
65
64
|
var pkg = require(fs_1.findUp(__filename, 'package.json'));
|
|
@@ -97,29 +96,16 @@ exports.installDependencies = installDependencies;
|
|
|
97
96
|
* @param config {FlexPluginArguments} the plugin configuration
|
|
98
97
|
* @return {FlexPluginArguments} the updated configuration
|
|
99
98
|
*/
|
|
100
|
-
var setupConfiguration = function (config) {
|
|
101
|
-
var name
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
config.flexSdkVersion = pkg.devDependencies['@twilio/flex-ui'];
|
|
111
|
-
config.pluginScriptsVersion = pkg.devDependencies['@twilio/flex-plugin-scripts'];
|
|
112
|
-
config.flexui2 = config.flexui2 || false;
|
|
113
|
-
if (!config.flexui2) return [3 /*break*/, 2];
|
|
114
|
-
_a = config;
|
|
115
|
-
return [4 /*yield*/, flex_dev_utils_1.packages.getLatestFlexUIVersion(2)];
|
|
116
|
-
case 1:
|
|
117
|
-
_a.flexSdkVersion = _b.sent();
|
|
118
|
-
_b.label = 2;
|
|
119
|
-
case 2: return [2 /*return*/, config];
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}); };
|
|
99
|
+
var setupConfiguration = function (config) {
|
|
100
|
+
var name = config.name || '';
|
|
101
|
+
config.pluginClassName = lodash_1.upperFirst(lodash_1.camelCase(name)).replace('Plugin', '') + "Plugin";
|
|
102
|
+
config.pluginNamespace = name.toLowerCase().replace('plugin-', '');
|
|
103
|
+
config.runtimeUrl = config.runtimeUrl || 'http://localhost:3000';
|
|
104
|
+
config.targetDirectory = fs_1.resolveCwd(name);
|
|
105
|
+
config.flexSdkVersion = pkg.devDependencies['@twilio/flex-ui'];
|
|
106
|
+
config.pluginScriptsVersion = pkg.devDependencies['@twilio/flex-plugin-scripts'];
|
|
107
|
+
return config;
|
|
108
|
+
};
|
|
123
109
|
exports.setupConfiguration = setupConfiguration;
|
|
124
110
|
/**
|
|
125
111
|
* Downloads content from GitHub
|
package/dist/lib/commands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/lib/commands.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAoE;AACpE,2DAA0D;AAC1D,6DAA2E;
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/lib/commands.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAoE;AACpE,2DAA0D;AAC1D,6DAA2E;AAE3E,sDAA0C;AAG1C,qHAAqH;AACrH,IAAM,GAAG,GAAG,OAAO,CAAC,WAAM,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;AAExD;;;;;GAKG;AACI,IAAM,mBAAmB,GAAG,UAAO,MAA2B;;;;;gBAC7D,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;gBACxC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;gBACnB,OAAO,GAAG;oBACd,GAAG,EAAE,MA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AvC,IAAI,GAAG,SAAgC;gBAE7C,sBAAO,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,EAAC;;;KACvC,CAAC;AAJW,QAAA,kBAAkB,sBAI7B"}
|
|
@@ -52,8 +52,6 @@ var templatesRootDir = path_1.resolve(__dirname, '../../templates');
|
|
|
52
52
|
var templateCorePath = path_1.resolve(templatesRootDir, 'core');
|
|
53
53
|
var templateJsPath = path_1.resolve(templatesRootDir, 'js');
|
|
54
54
|
var templateTsPath = path_1.resolve(templatesRootDir, 'ts');
|
|
55
|
-
var templateJs2Path = path_1.resolve(templatesRootDir, 'js2');
|
|
56
|
-
var templateTs2Path = path_1.resolve(templatesRootDir, 'ts2');
|
|
57
55
|
/**
|
|
58
56
|
* Runs the NPM Installation
|
|
59
57
|
* @param config {FlexPluginArguments} the configuration
|
|
@@ -93,9 +91,9 @@ var _scaffold = function (config) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
93
91
|
case 1:
|
|
94
92
|
// This copies the core such as public/
|
|
95
93
|
_a.sent();
|
|
96
|
-
srcPath =
|
|
94
|
+
srcPath = templateJsPath;
|
|
97
95
|
if (config.typescript) {
|
|
98
|
-
srcPath =
|
|
96
|
+
srcPath = templateTsPath;
|
|
99
97
|
}
|
|
100
98
|
if (!config.template) return [3 /*break*/, 3];
|
|
101
99
|
dirObject = tmp_1.dirSync();
|
|
@@ -140,31 +138,29 @@ var createFlexPlugin = function (config) { return __awaiter(void 0, void 0, void
|
|
|
140
138
|
case 0: return [4 /*yield*/, validators_1.default(config)];
|
|
141
139
|
case 1:
|
|
142
140
|
config = _b.sent();
|
|
143
|
-
|
|
144
|
-
case 2:
|
|
145
|
-
config = _b.sent();
|
|
141
|
+
config = commands_1.setupConfiguration(config);
|
|
146
142
|
// Check folder does not exist
|
|
147
143
|
if (fs_1.default.existsSync(config.targetDirectory)) {
|
|
148
144
|
throw new flex_dev_utils_1.FlexPluginError(flex_dev_utils_1.singleLineString("Path " + flex_dev_utils_1.logger.coloredStrings.link(config.targetDirectory) + " already exists;", 'please remove it and try again.'));
|
|
149
145
|
}
|
|
150
146
|
return [4 /*yield*/, exports._scaffold(config)];
|
|
151
|
-
case
|
|
147
|
+
case 2:
|
|
152
148
|
// Setup the directories
|
|
153
149
|
if (!(_b.sent())) {
|
|
154
150
|
throw new flex_dev_utils_1.FlexPluginError('Failed to scaffold project');
|
|
155
151
|
}
|
|
156
152
|
// Add new plugin to .twilio-cli/flex/plugins.json
|
|
157
153
|
return [4 /*yield*/, fs_2.checkPluginConfigurationExists(config.name, config.targetDirectory)];
|
|
158
|
-
case
|
|
154
|
+
case 3:
|
|
159
155
|
// Add new plugin to .twilio-cli/flex/plugins.json
|
|
160
156
|
_b.sent();
|
|
161
157
|
_a = config.install;
|
|
162
|
-
if (!_a) return [3 /*break*/,
|
|
158
|
+
if (!_a) return [3 /*break*/, 5];
|
|
163
159
|
return [4 /*yield*/, exports._install(config)];
|
|
164
|
-
case
|
|
160
|
+
case 4:
|
|
165
161
|
_a = !(_b.sent());
|
|
166
|
-
_b.label =
|
|
167
|
-
case
|
|
162
|
+
_b.label = 5;
|
|
163
|
+
case 5:
|
|
168
164
|
// Install NPM dependencies
|
|
169
165
|
if (_a) {
|
|
170
166
|
flex_dev_utils_1.logger.error('Failed to install dependencies. Please run `npm install` manually.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-flex-plugin.js","sourceRoot":"","sources":["../../src/lib/create-flex-plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAoB;AACpB,6BAAqC;AAErC,yDAA6F;AAC7F,qDAAiG;AACjG,2BAAuE;AAEvE,uCAAyF;AAEzF,wEAAkD;AAClD,mEAA2C;AAE3C,IAAM,gBAAgB,GAAG,cAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;AAC/D,IAAM,gBAAgB,GAAG,cAAO,CAAC,gBAAgB,EAAE,MAAM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AAM,CAAC,CAAC;gBAEpC,8BAA8B;gBAC9B,IAAI,YAAE,CAAC,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;oBACzC,MAAM,IAAI,gCAAe,CACvB,iCAAgB,CACd,UAAQ,uBAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,qBAAkB,EAC5E,iCAAiC,CAClC,CACF,CAAC;iBACH;gBAGK,qBAAM,iBAAS,CAAC,MAAM,CAAC,EAAA;;gBAD7B,wBAAwB;gBACxB,IAAI,CAAC,CAAC,SAAuB,CAAC,EAAE;oBAC9B,MAAM,IAAI,gCAAe,CAAC,4BAA4B,CAAC,CAAC;iBACzD;gBAED,kDAAkD;gBAClD,qBAAM,mCAA8B,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,eAAe,CAAC,EAAA;;gBADzE,kDAAkD;gBAClD,SAAyE,CAAC;gBAGtE,KAAA,MAAM,CAAC,OAAO,CAAA;yBAAd,wBAAc;gBAAM,qBAAM,gBAAQ,CAAC,MAAM,CAAC,EAAA;;gBAAxB,KAAA,CAAC,CAAC,SAAsB,CAAC,CAAA;;;gBAD/C,2BAA2B;gBAC3B,QAAiD;oBAC/C,uBAAM,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;oBACnF,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;iBACxB;gBAED,sBAAY,CAAC,MAAM,CAAC,CAAC;;;;KACtB,CAAC;AA7BW,QAAA,gBAAgB,oBA6B3B;AAEF,kBAAe,wBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twilio/create-flex-plugin",
|
|
3
|
-
"version": "5.0.6
|
|
3
|
+
"version": "5.0.6",
|
|
4
4
|
"description": "Toolkit to create a new Twilio Flex plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"flex",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"test:watch": "cd ../.. && jest packages/create-flex-plugin --watch --color"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@twilio/flex-dev-utils": "5.0.6
|
|
45
|
+
"@twilio/flex-dev-utils": "5.0.6",
|
|
46
46
|
"esm": "^3.2.25",
|
|
47
47
|
"tmp": "^0.2.1",
|
|
48
48
|
"yargs": "^16.2.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@twilio/flex-plugin": "5.0.6
|
|
52
|
-
"@twilio/flex-plugin-scripts": "5.0.6
|
|
51
|
+
"@twilio/flex-plugin": "5.0.6",
|
|
52
|
+
"@twilio/flex-plugin-scripts": "5.0.6",
|
|
53
53
|
"@twilio/flex-ui": "^1",
|
|
54
54
|
"@types/tmp": "^0.2.1",
|
|
55
55
|
"@types/yargs": "^16.0.4"
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "0d0e3e0216eb0eaacbac93e47fc57572399d4747"
|
|
61
61
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{name}}",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"postinstall": "flex-plugin pre-script-check"
|
|
7
|
-
},
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"flex-plugin-scripts": "{{pluginScriptsVersion}}",
|
|
10
|
-
"react": "17.0.2",
|
|
11
|
-
"react-dom": "17.0.2",
|
|
12
|
-
"prop-types": "^15.7.2",
|
|
13
|
-
"@twilio-paste/core": "^10.14.0",
|
|
14
|
-
"@twilio-paste/icons": "^5.7.0"
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@twilio/flex-ui": "{{flexSdkVersion}}",
|
|
18
|
-
"react-test-renderer": "17.0.2"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FlexPlugin } from 'flex-plugin';
|
|
3
|
-
|
|
4
|
-
import CustomTaskList from './components/CustomTaskList/CustomTaskList';
|
|
5
|
-
|
|
6
|
-
const PLUGIN_NAME = '{{pluginClassName}}';
|
|
7
|
-
|
|
8
|
-
export default class {{pluginClassName}} extends FlexPlugin {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(PLUGIN_NAME);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* This code is run when your plugin is being started
|
|
15
|
-
* Use this to modify any UI components or attach to the actions framework
|
|
16
|
-
*
|
|
17
|
-
* @param flex { typeof import('@twilio/flex-ui') }
|
|
18
|
-
*/
|
|
19
|
-
async init(flex) {
|
|
20
|
-
const options = { sortOrder: -1 };
|
|
21
|
-
flex.AgentDesktopView.Panel1.Content.add(<CustomTaskList key="{{pluginClassName}}-component" />, options);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { Alert } from '@twilio-paste/core/alert';
|
|
4
|
-
import { Theme } from '@twilio-paste/core/theme';
|
|
5
|
-
import { Text } from '@twilio-paste/core/text';
|
|
6
|
-
|
|
7
|
-
const CustomTaskList = () => {
|
|
8
|
-
const [isOpen, setIsOpen] = useState(true);
|
|
9
|
-
if (!isOpen) {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const dismiss = () => setIsOpen(false);
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<Theme.Provider theme="default">
|
|
17
|
-
<Alert onDismiss={dismiss} variant="neutral">
|
|
18
|
-
<Text>This is a dismissible demo component.</Text>
|
|
19
|
-
</Alert>
|
|
20
|
-
</Theme.Provider>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default CustomTaskList;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { create, act} from 'react-test-renderer';
|
|
3
|
-
import { Text } from '@twilio-paste/core/text';
|
|
4
|
-
import { Alert } from '@twilio-paste/core/alert';
|
|
5
|
-
|
|
6
|
-
import CustomTaskList from '../CustomTaskList/CustomTaskList';
|
|
7
|
-
|
|
8
|
-
describe('CustomTaskList', () => {
|
|
9
|
-
it('should load and display dismissable component', () => {
|
|
10
|
-
const renderer = create(<CustomTaskList />);
|
|
11
|
-
const root = renderer.root;
|
|
12
|
-
|
|
13
|
-
const element = root.findByType(Alert).findByType(Text);
|
|
14
|
-
expect(element.props.children).toEqual('This is a dismissible demo component.');
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('should dismiss component', () => {
|
|
18
|
-
const renderer = create(<CustomTaskList />);
|
|
19
|
-
const root = renderer.root;
|
|
20
|
-
|
|
21
|
-
const element = root.findByType(Alert).findByType(Text);
|
|
22
|
-
expect(element.props.children).toEqual('This is a dismissible demo component.');
|
|
23
|
-
|
|
24
|
-
// dismiss on click
|
|
25
|
-
act(root.findByType(Alert).props.onDismiss);
|
|
26
|
-
expect(root.findAllByType(Alert).length).toEqual(0);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{name}}",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"postinstall": "flex-plugin pre-script-check"
|
|
7
|
-
},
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"flex-plugin-scripts": "{{pluginScriptsVersion}}",
|
|
10
|
-
"react": "17.0.2",
|
|
11
|
-
"react-dom": "17.0.2",
|
|
12
|
-
"prop-types": "^15.7.2",
|
|
13
|
-
"@twilio-paste/core": "^10.14.0",
|
|
14
|
-
"@twilio-paste/icons": "^5.7.0"
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@twilio/flex-ui": "{{flexSdkVersion}}",
|
|
18
|
-
"react-test-renderer": "17.0.2",
|
|
19
|
-
"typescript": "^4"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import * as Flex from '@twilio/flex-ui';
|
|
3
|
-
import { FlexPlugin } from 'flex-plugin';
|
|
4
|
-
|
|
5
|
-
import CustomTaskList from './components/CustomTaskList/CustomTaskList';
|
|
6
|
-
|
|
7
|
-
const PLUGIN_NAME = '{{pluginClassName}}';
|
|
8
|
-
|
|
9
|
-
export default class {{pluginClassName}} extends FlexPlugin {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(PLUGIN_NAME);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* This code is run when your plugin is being started
|
|
16
|
-
* Use this to modify any UI components or attach to the actions framework
|
|
17
|
-
*
|
|
18
|
-
* @param flex { typeof Flex }
|
|
19
|
-
*/
|
|
20
|
-
async init(flex: typeof Flex): Promise<void> {
|
|
21
|
-
const options: Flex.ContentFragmentProps = { sortOrder: -1 };
|
|
22
|
-
flex.AgentDesktopView.Panel1.Content.add(<CustomTaskList key="{{pluginClassName}}-component" />, options);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { Alert } from '@twilio-paste/core/alert';
|
|
4
|
-
import { Theme } from '@twilio-paste/core/theme';
|
|
5
|
-
import { Text } from '@twilio-paste/core/text';
|
|
6
|
-
|
|
7
|
-
const CustomTaskList = (): JSX.Element | null => {
|
|
8
|
-
const [isOpen, setIsOpen] = useState(true);
|
|
9
|
-
if (!isOpen) {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const dismiss = () => setIsOpen(false);
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<Theme.Provider theme="default">
|
|
17
|
-
<Alert onDismiss={dismiss} variant="neutral">
|
|
18
|
-
<Text as="span">This is a dismissible demo component.</Text>
|
|
19
|
-
</Alert>
|
|
20
|
-
</Theme.Provider>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
CustomTaskList.displayName = 'foo';
|
|
25
|
-
|
|
26
|
-
export default CustomTaskList;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { create, act} from 'react-test-renderer';
|
|
3
|
-
import { Text } from '@twilio-paste/core/text';
|
|
4
|
-
import { Alert } from '@twilio-paste/core/alert';
|
|
5
|
-
|
|
6
|
-
import CustomTaskList from '../CustomTaskList/CustomTaskList';
|
|
7
|
-
|
|
8
|
-
describe('CustomTaskList', () => {
|
|
9
|
-
it('should load and display dismissable component', () => {
|
|
10
|
-
const renderer = create(<CustomTaskList />);
|
|
11
|
-
const root = renderer.root;
|
|
12
|
-
|
|
13
|
-
const element = root.findByType(Alert).findByType(Text);
|
|
14
|
-
expect(element.props.children).toEqual('This is a dismissible demo component.');
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('should dismiss component', () => {
|
|
18
|
-
const renderer = create(<CustomTaskList />);
|
|
19
|
-
const root = renderer.root;
|
|
20
|
-
|
|
21
|
-
const element = root.findByType(Alert).findByType(Text);
|
|
22
|
-
expect(element.props.children).toEqual('This is a dismissible demo component.');
|
|
23
|
-
|
|
24
|
-
// dismiss on click
|
|
25
|
-
act(root.findByType(Alert).props.onDismiss);
|
|
26
|
-
expect(root.findAllByType(Alert).length).toEqual(0);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"baseUrl": "src",
|
|
4
|
-
"rootDir": ".",
|
|
5
|
-
"outDir": "build",
|
|
6
|
-
"target": "es5",
|
|
7
|
-
"lib": [
|
|
8
|
-
"dom",
|
|
9
|
-
"dom.iterable",
|
|
10
|
-
"esnext"
|
|
11
|
-
],
|
|
12
|
-
"allowJs": true,
|
|
13
|
-
"skipLibCheck": true,
|
|
14
|
-
"esModuleInterop": true,
|
|
15
|
-
"allowSyntheticDefaultImports": true,
|
|
16
|
-
"strict": true,
|
|
17
|
-
"forceConsistentCasingInFileNames": true,
|
|
18
|
-
"module": "esnext",
|
|
19
|
-
"moduleResolution": "node",
|
|
20
|
-
"resolveJsonModule": true,
|
|
21
|
-
"isolatedModules": true,
|
|
22
|
-
"noEmit": true,
|
|
23
|
-
"jsx": "preserve",
|
|
24
|
-
"noUnusedLocals": false,
|
|
25
|
-
"noUnusedParameters": false
|
|
26
|
-
},
|
|
27
|
-
"include": [
|
|
28
|
-
"./src/**/*"
|
|
29
|
-
],
|
|
30
|
-
"exclude": [
|
|
31
|
-
"./**/*.test.ts",
|
|
32
|
-
"./**/*.test.tsx",
|
|
33
|
-
"./**/__mocks__/*.ts",
|
|
34
|
-
"./**/__mocks__/*.tsx"
|
|
35
|
-
]
|
|
36
|
-
}
|