@webex/cc-user-state 1.28.0-wxcc.1 → 1.28.0-wxcc.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/index.js +3892 -7
- package/dist/index.js.LICENSE.txt +11 -0
- package/dist/types/helper.d.ts +9 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/user-state/index.d.ts +3 -3
- package/dist/types/user-state.types.d.ts +3 -0
- package/package.json +37 -19
- package/.babelrc.js +0 -3
- package/CHANGELOG.md +0 -0
- package/dist/helper.js +0 -11
- package/dist/helper.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types/user-state/use-state.types.d.ts +0 -25
- package/dist/types/user-state/user-state.presentational.d.ts +0 -7
- package/dist/user-state/index.js +0 -28
- package/dist/user-state/index.js.map +0 -1
- package/dist/user-state/use-state.types.js +0 -3
- package/dist/user-state/use-state.types.js.map +0 -1
- package/dist/user-state/user-state.presentational.js +0 -18
- package/dist/user-state/user-state.presentational.js.map +0 -1
- 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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* use-sync-external-store-shim.production.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
package/dist/types/helper.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { UseUserStateProps } from './user-state.types';
|
|
2
|
+
export declare const useUserState: ({ idleCodes, agentId, cc, currentState, customState, lastStateChangeTimestamp, logger, onStateChange, lastIdleCodeChangeTimestamp, }: UseUserStateProps) => {
|
|
3
|
+
idleCodes: import("@webex/cc-store").IdleCode[];
|
|
4
|
+
setAgentStatus: (selectedCode: any) => void;
|
|
5
|
+
isSettingAgentStatus: boolean;
|
|
6
|
+
elapsedTime: number;
|
|
7
|
+
lastIdleStateChangeElapsedTime: number;
|
|
8
|
+
currentState: string;
|
|
9
|
+
onStateChange: (arg: import("@webex/cc-store").IdleCode | import("@webex/cc-store").ICustomState) => void;
|
|
3
10
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UserState
|
|
2
|
-
export { UserState
|
|
1
|
+
import { UserState } from './user-state/index';
|
|
2
|
+
export { UserState };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
export { UserState
|
|
2
|
+
import { IUserStateProps } from '../user-state.types';
|
|
3
|
+
declare const UserState: React.FunctionComponent<IUserStateProps>;
|
|
4
|
+
export { UserState };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IUserState } from '@webex/cc-components';
|
|
2
|
+
export type IUserStateProps = Pick<IUserState, 'onStateChange'>;
|
|
3
|
+
export type UseUserStateProps = Pick<IUserState, 'idleCodes' | 'agentId' | 'cc' | 'currentState' | 'customState' | 'lastStateChangeTimestamp' | 'logger' | 'onStateChange' | 'lastIdleCodeChangeTimestamp'>;
|
package/package.json
CHANGED
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/cc-user-state",
|
|
3
3
|
"description": "Webex Contact Center Widgets: User State",
|
|
4
|
-
"
|
|
4
|
+
"license": "Cisco's General Terms (https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html)",
|
|
5
|
+
"version": "1.28.0-wxcc.2",
|
|
5
6
|
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist/",
|
|
13
|
+
"package.json"
|
|
14
|
+
],
|
|
6
15
|
"scripts": {
|
|
16
|
+
"clean": "rm -rf dist && rm -rf node_modules",
|
|
17
|
+
"clean:dist": "rm -rf dist",
|
|
7
18
|
"build": "yarn run -T tsc",
|
|
8
|
-
"build:src": "
|
|
19
|
+
"build:src": "yarn run clean:dist && webpack",
|
|
9
20
|
"build:watch": "webpack --watch",
|
|
10
|
-
"test:unit": "jest",
|
|
11
|
-
"
|
|
21
|
+
"test:unit": "tsc --project tsconfig.test.json && jest --coverage",
|
|
22
|
+
"test:styles": "eslint",
|
|
23
|
+
"deploy:npm": "yarn npm publish"
|
|
12
24
|
},
|
|
13
25
|
"dependencies": {
|
|
14
|
-
"@
|
|
15
|
-
"@
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"@semantic-release/github": "^11.0.1",
|
|
19
|
-
"@webex/cc-store": "^1.28.0-wxcc.2",
|
|
20
|
-
"mobx-react": "9.1.1",
|
|
21
|
-
"react": "18.3.1",
|
|
22
|
-
"react-dom": "18.3.1",
|
|
26
|
+
"@webex/cc-components": "1.28.0-ccconnectors.2",
|
|
27
|
+
"@webex/cc-store": "1.0.1-0-next.0",
|
|
28
|
+
"mobx-react-lite": "^4.1.0",
|
|
29
|
+
"react-error-boundary": "^6.0.0",
|
|
23
30
|
"typescript": "5.6.3"
|
|
24
31
|
},
|
|
25
32
|
"devDependencies": {
|
|
@@ -27,25 +34,36 @@
|
|
|
27
34
|
"@babel/preset-env": "7.25.4",
|
|
28
35
|
"@babel/preset-react": "7.24.7",
|
|
29
36
|
"@babel/preset-typescript": "7.25.9",
|
|
37
|
+
"@eslint/js": "^9.20.0",
|
|
30
38
|
"@testing-library/dom": "10.4.0",
|
|
31
39
|
"@testing-library/jest-dom": "6.6.2",
|
|
32
40
|
"@testing-library/react": "16.0.1",
|
|
33
41
|
"@types/jest": "29.5.14",
|
|
34
42
|
"@types/react-test-renderer": "18",
|
|
43
|
+
"@webex/test-fixtures": "0.0.0-next.0",
|
|
35
44
|
"babel-jest": "29.7.0",
|
|
36
45
|
"babel-loader": "9.2.1",
|
|
46
|
+
"eslint": "^9.20.1",
|
|
47
|
+
"eslint-config-prettier": "^10.0.1",
|
|
48
|
+
"eslint-config-standard": "^17.1.0",
|
|
49
|
+
"eslint-plugin-import": "^2.25.2",
|
|
50
|
+
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
|
|
51
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
52
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
53
|
+
"eslint-plugin-react": "^7.37.4",
|
|
37
54
|
"file-loader": "6.2.0",
|
|
55
|
+
"globals": "^16.0.0",
|
|
38
56
|
"jest": "29.7.0",
|
|
39
57
|
"jest-environment-jsdom": "29.7.0",
|
|
40
|
-
"
|
|
41
|
-
"semantic-release-yarn": "^3.0.2",
|
|
58
|
+
"prettier": "^3.5.1",
|
|
42
59
|
"ts-loader": "9.5.1",
|
|
60
|
+
"typescript-eslint": "^8.24.1",
|
|
43
61
|
"webpack": "5.94.0",
|
|
44
62
|
"webpack-cli": "5.1.4",
|
|
45
63
|
"webpack-merge": "6.0.1"
|
|
46
64
|
},
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"react": ">=18.3.1",
|
|
67
|
+
"react-dom": ">=18.3.1"
|
|
68
|
+
}
|
|
51
69
|
}
|
package/.babelrc.js
DELETED
package/CHANGELOG.md
DELETED
|
File without changes
|
package/dist/helper.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* UserState helpers
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useUserState = void 0;
|
|
7
|
-
const useUserState = () => {
|
|
8
|
-
return { name: 'UserState' };
|
|
9
|
-
};
|
|
10
|
-
exports.useUserState = useUserState;
|
|
11
|
-
//# sourceMappingURL=helper.js.map
|
package/dist/helper.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEI,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,OAAO,EAAC,IAAI,EAAE,WAAW,EAAC,CAAC;AAC7B,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,8CAA2D;AAEnD,0FAFA,iBAAS,OAEA;AAAE,6FAFA,oBAAY,OAEA"}
|
|
@@ -1,25 +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
|
-
* The current login state of the user.
|
|
11
|
-
*/
|
|
12
|
-
loginState: any;
|
|
13
|
-
/**
|
|
14
|
-
* Function to set the login state of the user.
|
|
15
|
-
*/
|
|
16
|
-
setLoginState: any;
|
|
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;
|
|
25
|
-
}
|
package/dist/user-state/index.js
DELETED
|
@@ -1,28 +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
|
-
exports.WebUserState = exports.UserState = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const cc_store_1 = __importDefault(require("@webex/cc-store"));
|
|
9
|
-
const mobx_react_1 = require("mobx-react");
|
|
10
|
-
const react_to_web_component_1 = __importDefault(require("@r2wc/react-to-web-component"));
|
|
11
|
-
const helper_1 = require("../helper");
|
|
12
|
-
const user_state_presentational_1 = __importDefault(require("./user-state.presentational"));
|
|
13
|
-
const UserState = (0, mobx_react_1.observer)(() => {
|
|
14
|
-
const { loginState, setLoginState, ccSdk, isAvailable } = cc_store_1.default;
|
|
15
|
-
const result = (0, helper_1.useUserState)();
|
|
16
|
-
const props = Object.assign(Object.assign({}, result), { loginState,
|
|
17
|
-
setLoginState,
|
|
18
|
-
ccSdk,
|
|
19
|
-
isAvailable });
|
|
20
|
-
return react_1.default.createElement(user_state_presentational_1.default, Object.assign({}, props));
|
|
21
|
-
});
|
|
22
|
-
exports.UserState = UserState;
|
|
23
|
-
const WebUserState = (0, react_to_web_component_1.default)(UserState);
|
|
24
|
-
exports.WebUserState = WebUserState;
|
|
25
|
-
if (!customElements.get('widget-cc-user-state')) {
|
|
26
|
-
customElements.define('widget-cc-user-state', WebUserState);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAC,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAC,GAAG,kBAAK,CAAC;IAC9D,MAAM,MAAM,GAAG,IAAA,qBAAY,GAAE,CAAC;IAC9B,MAAM,KAAK,mCACN,MAAM,KACT,UAAU;QACV,aAAa;QACb,KAAK;QACL,WAAW,GACZ,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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-state.types.js","sourceRoot":"","sources":["../../src/user-state/use-state.types.ts"],"names":[],"mappings":""}
|
|
@@ -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
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
/**
|
|
8
|
-
* Presentational component for the User State.
|
|
9
|
-
*/
|
|
10
|
-
const UserStatePresentational = (props) => {
|
|
11
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
12
|
-
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)));
|
|
16
|
-
};
|
|
17
|
-
exports.default = UserStatePresentational;
|
|
18
|
-
//# sourceMappingURL=user-state.presentational.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-state.presentational.js","sourceRoot":"","sources":["../../src/user-state/user-state.presentational.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAI1B;;GAEG;AACH,MAAM,uBAAuB,GAAwC,CAAC,KAAK,EAAE,EAAE;IAC7E,OAAO,CACL;QACE,qDAAgB,oBAAoB,IAAE,KAAK,CAAC,IAAI,CAAM;QACtD;;YAAiB,KAAK,CAAC,UAAU,CAAM,CACtC,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,uBAAuB,CAAC"}
|
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
|
-
});
|