@webex/cc-user-state 1.27.6-eft.2 → 1.28.0-ccwidgets.2
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/helper.js +5 -4
- package/dist/helper.js.map +1 -1
- package/dist/types/helper.d.ts +6 -0
- package/dist/types/user-state/use-state.types.d.ts +4 -12
- package/dist/types/user-state/user-state.presentational.d.ts +0 -3
- package/dist/user-state/index.js +2 -5
- package/dist/user-state/index.js.map +1 -1
- package/dist/user-state/user-state.presentational.js +2 -6
- package/dist/user-state/user-state.presentational.js.map +1 -1
- package/package.json +10 -9
- package/.babelrc.js +0 -3
- package/src/helper.ts +0 -7
- package/src/index.ts +0 -3
- package/src/user-state/index.tsx +0 -29
- package/src/user-state/styles-module.scss +0 -0
- package/src/user-state/use-state.types.ts +0 -29
- package/src/user-state/user-state.presentational.tsx +0 -17
- package/tsconfig.json +0 -11
- package/webpack.config.js +0 -12
package/dist/helper.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* UserState helpers
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.useUserState = void 0;
|
|
7
4
|
const useUserState = () => {
|
|
8
|
-
|
|
5
|
+
const handleAgentStatus = (event) => {
|
|
6
|
+
};
|
|
7
|
+
const setAgentStatus = () => {
|
|
8
|
+
};
|
|
9
|
+
return { name: 'UserState', handleAgentStatus, setAgentStatus };
|
|
9
10
|
};
|
|
10
11
|
exports.useUserState = useUserState;
|
|
11
12
|
//# sourceMappingURL=helper.js.map
|
package/dist/helper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":";;;AAAO,MAAM,YAAY,GAAG,GAAG,EAAE;IAG/B,MAAM,iBAAiB,GAAG,CAAC,KAAsC,EAAE,EAAE;IACrE,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,GAAG,EAAE;IAC5B,CAAC,CAAC;IAEF,OAAO,EAAC,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAC,CAAC;AAChE,CAAC,CAAC;AAVW,QAAA,YAAY,gBAUvB"}
|
package/dist/types/helper.d.ts
CHANGED
|
@@ -7,19 +7,11 @@ export interface IUserState {
|
|
|
7
7
|
*/
|
|
8
8
|
name: string;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Handler for agent state changes
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
handleAgentStatus: (event: any) => void;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Setter for agent state
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The SDK instance for the contact center.
|
|
19
|
-
*/
|
|
20
|
-
ccSdk: any;
|
|
21
|
-
/**
|
|
22
|
-
* Indicates whether the user is available.
|
|
23
|
-
*/
|
|
24
|
-
isAvailable: any;
|
|
16
|
+
setAgentStatus: () => void;
|
|
25
17
|
}
|
package/dist/user-state/index.js
CHANGED
|
@@ -11,12 +11,9 @@ const react_to_web_component_1 = __importDefault(require("@r2wc/react-to-web-com
|
|
|
11
11
|
const helper_1 = require("../helper");
|
|
12
12
|
const user_state_presentational_1 = __importDefault(require("./user-state.presentational"));
|
|
13
13
|
const UserState = (0, mobx_react_1.observer)(() => {
|
|
14
|
-
const {
|
|
14
|
+
const {} = cc_store_1.default;
|
|
15
15
|
const result = (0, helper_1.useUserState)();
|
|
16
|
-
const props = Object.assign(
|
|
17
|
-
setLoginState,
|
|
18
|
-
ccSdk,
|
|
19
|
-
isAvailable });
|
|
16
|
+
const props = Object.assign({}, result);
|
|
20
17
|
return react_1.default.createElement(user_state_presentational_1.default, Object.assign({}, props));
|
|
21
18
|
});
|
|
22
19
|
exports.UserState = UserState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/user-state/index.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+DAAoC;AACpC,2CAAoC;AACpC,0FAAgD;AAEhD,sCAAuC;AACvC,4FAAkE;AAElE,MAAM,SAAS,GAA4B,IAAA,qBAAQ,EAAC,GAAG,EAAE;IACvD,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/user-state/index.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+DAAoC;AACpC,2CAAoC;AACpC,0FAAgD;AAEhD,sCAAuC;AACvC,4FAAkE;AAElE,MAAM,SAAS,GAA4B,IAAA,qBAAQ,EAAC,GAAG,EAAE;IACvD,MAAM,EAAE,GAAG,kBAAK,CAAC;IACjB,MAAM,MAAM,GAAG,IAAA,qBAAY,GAAE,CAAC;IAC9B,MAAM,KAAK,qBACN,MAAM,CACV,CAAC;IAEF,OAAO,8BAAC,mCAAuB,oBAAK,KAAK,EAAI,CAAC;AAChD,CAAC,CAAC,CAAC;AAQK,8BAAS;AANjB,MAAM,YAAY,GAAG,IAAA,gCAAI,EAAC,SAAS,CAAC,CAAC;AAMlB,oCAAY;AAJ/B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAAE,CAAC;IAChD,cAAc,CAAC,MAAM,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -4,15 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
|
-
/**
|
|
8
|
-
* Presentational component for the User State.
|
|
9
|
-
*/
|
|
10
7
|
const UserStatePresentational = (props) => {
|
|
8
|
+
const { handleAgentStatus, setAgentStatus } = props;
|
|
11
9
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
12
10
|
react_1.default.createElement("h1", { "data-testid": "user-state-heading" }, props.name),
|
|
13
|
-
react_1.default.createElement("h4", null,
|
|
14
|
-
"User State: ",
|
|
15
|
-
props.loginState)));
|
|
11
|
+
react_1.default.createElement("h4", null, "User State: ")));
|
|
16
12
|
};
|
|
17
13
|
exports.default = UserStatePresentational;
|
|
18
14
|
//# sourceMappingURL=user-state.presentational.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-state.presentational.js","sourceRoot":"","sources":["../../src/user-state/user-state.presentational.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAI1B
|
|
1
|
+
{"version":3,"file":"user-state.presentational.js","sourceRoot":"","sources":["../../src/user-state/user-state.presentational.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAI1B,MAAM,uBAAuB,GAAwC,CAAC,KAAK,EAAE,EAAE;IAC7E,MAAM,EAAC,iBAAiB,EAAE,cAAc,EAAC,GAAG,KAAK,CAAC;IAElD,OAAO,CACL;QACE,qDAAgB,oBAAoB,IAAE,KAAK,CAAC,IAAI,CAAM;QACtD,yDAAuB,CACtB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/cc-user-state",
|
|
3
3
|
"description": "Webex Contact Center Widgets: User State",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.28.0-ccwidgets.2",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/",
|
|
11
|
+
"package.json"
|
|
12
|
+
],
|
|
9
13
|
"scripts": {
|
|
10
14
|
"build": "yarn run -T tsc",
|
|
11
15
|
"build:src": "webpack && yarn run build",
|
|
@@ -14,11 +18,7 @@
|
|
|
14
18
|
},
|
|
15
19
|
"dependencies": {
|
|
16
20
|
"@r2wc/react-to-web-component": "2.0.3",
|
|
17
|
-
"@
|
|
18
|
-
"@semantic-release/exec": "^6.0.3",
|
|
19
|
-
"@semantic-release/git": "^10.0.1",
|
|
20
|
-
"@semantic-release/github": "^11.0.1",
|
|
21
|
-
"@webex/cc-store": "1.27.6-eft.2",
|
|
21
|
+
"@webex/cc-store": "1.28.0-ccwidgets.2",
|
|
22
22
|
"mobx-react": "9.1.1",
|
|
23
23
|
"react": "18.3.1",
|
|
24
24
|
"react-dom": "18.3.1",
|
|
@@ -39,14 +39,15 @@
|
|
|
39
39
|
"file-loader": "6.2.0",
|
|
40
40
|
"jest": "29.7.0",
|
|
41
41
|
"jest-environment-jsdom": "29.7.0",
|
|
42
|
-
"semantic-release": "^24.2.0",
|
|
43
42
|
"ts-loader": "9.5.1",
|
|
44
43
|
"webpack": "5.94.0",
|
|
45
44
|
"webpack-cli": "5.1.4",
|
|
46
45
|
"webpack-merge": "6.0.1"
|
|
47
46
|
},
|
|
48
47
|
"jest": {
|
|
49
|
-
"testEnvironment": "jsdom"
|
|
48
|
+
"testEnvironment": "jsdom",
|
|
49
|
+
"//": "We can remove this when we have tests",
|
|
50
|
+
"passWithNoTests": true
|
|
50
51
|
},
|
|
51
|
-
"stableVersion": "1.
|
|
52
|
+
"stableVersion": "1.28.0-ccwidgets.1"
|
|
52
53
|
}
|
package/.babelrc.js
DELETED
package/src/helper.ts
DELETED
package/src/index.ts
DELETED
package/src/user-state/index.tsx
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import store from '@webex/cc-store';
|
|
3
|
-
import {observer} from 'mobx-react';
|
|
4
|
-
import r2wc from '@r2wc/react-to-web-component';
|
|
5
|
-
|
|
6
|
-
import {useUserState} from '../helper';
|
|
7
|
-
import UserStatePresentational from './user-state.presentational';
|
|
8
|
-
|
|
9
|
-
const UserState: React.FunctionComponent = observer(() => {
|
|
10
|
-
const {loginState, setLoginState, ccSdk, isAvailable} = store;
|
|
11
|
-
const result = useUserState();
|
|
12
|
-
const props = {
|
|
13
|
-
...result,
|
|
14
|
-
loginState,
|
|
15
|
-
setLoginState,
|
|
16
|
-
ccSdk,
|
|
17
|
-
isAvailable,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return <UserStatePresentational {...props} />;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const WebUserState = r2wc(UserState);
|
|
24
|
-
|
|
25
|
-
if (!customElements.get('widget-cc-user-state')) {
|
|
26
|
-
customElements.define('widget-cc-user-state', WebUserState);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export {UserState, WebUserState};
|
|
File without changes
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interface representing the state of a user.
|
|
3
|
-
*/
|
|
4
|
-
export interface IUserState {
|
|
5
|
-
/**
|
|
6
|
-
* The name of the user.
|
|
7
|
-
*/
|
|
8
|
-
name: string;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The current login state of the user.
|
|
12
|
-
*/
|
|
13
|
-
loginState: any;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Function to set the login state of the user.
|
|
17
|
-
*/
|
|
18
|
-
setLoginState: any;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The SDK instance for the contact center.
|
|
22
|
-
*/
|
|
23
|
-
ccSdk: any;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Indicates whether the user is available.
|
|
27
|
-
*/
|
|
28
|
-
isAvailable: any;
|
|
29
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import {IUserState} from './use-state.types';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Presentational component for the User State.
|
|
7
|
-
*/
|
|
8
|
-
const UserStatePresentational: React.FunctionComponent<IUserState> = (props) => {
|
|
9
|
-
return (
|
|
10
|
-
<>
|
|
11
|
-
<h1 data-testid="user-state-heading">{props.name}</h1>
|
|
12
|
-
<h4>User State: {props.loginState}</h4>
|
|
13
|
-
</>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default UserStatePresentational;
|
package/tsconfig.json
DELETED
package/webpack.config.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const {merge} = require('webpack-merge');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const baseConfig = require('../../../webpack.config');
|
|
5
|
-
|
|
6
|
-
module.exports = merge(baseConfig, {
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, 'dist'),
|
|
9
|
-
filename: 'index.js', // Set the output filename to index.js
|
|
10
|
-
libraryTarget: 'commonjs2',
|
|
11
|
-
},
|
|
12
|
-
});
|