Commit 6d8ffe5d authored by Muhammadali's avatar Muhammadali

update-

parent b3ef9906
{
"name": "boxdialer",
"version": "4.8.38",
"version": "4.8.51",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "boxdialer",
"version": "4.8.38",
"version": "4.8.51",
"license": "ISC",
"dependencies": {
"@emotion/react": "^11.11.1",
......@@ -23,7 +23,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
"styled-components": "^5.3.5"
"styled-components": "^5.3.5",
"zustand": "^4.4.6"
},
"devDependencies": {
"@babel/core": "^7.22.10",
......@@ -10133,6 +10134,14 @@
"punycode": "^2.1.0"
}
},
"node_modules/use-sync-external-store": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz",
"integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==",
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
},
"node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
......@@ -10600,6 +10609,33 @@
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/zustand": {
"version": "4.4.6",
"resolved": "https://registry.npmjs.org/zustand/-/zustand-4.4.6.tgz",
"integrity": "sha512-Rb16eW55gqL4W2XZpJh0fnrATxYEG3Apl2gfHTyDSE965x/zxslTikpNch0JgNjJA9zK6gEFW8Fl6d1rTZaqgg==",
"dependencies": {
"use-sync-external-store": "1.2.0"
},
"engines": {
"node": ">=12.7.0"
},
"peerDependencies": {
"@types/react": ">=16.8",
"immer": ">=9.0",
"react": ">=16.8"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"immer": {
"optional": true
},
"react": {
"optional": true
}
}
}
}
}
......@@ -26,7 +26,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
"styled-components": "^5.3.5"
"styled-components": "^5.3.5",
"zustand": "^4.4.6"
},
"devDependencies": {
"@babel/core": "^7.22.10",
......
<!-- @format -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>React App</title>
<script defer src="main.js"></script></head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="boxdialerwidjet"></div>
</body>
</html>
This diff is collapsed.
"use strict";
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
(self["webpackChunkboxdialer"] = self["webpackChunkboxdialer"] || []).push([["src_static_locale_ru_json"],{
/***/ "./src/static/locale/ru.json":
/*!***********************************!*\
!*** ./src/static/locale/ru.json ***!
\***********************************/
/***/ ((module) => {
eval("module.exports = JSON.parse('{\"APP_APPNAME\":\"AloVoice Dialer Ru\",\"FREE\":\"Приём входящих\",\"TOTOP\":\"У руководства\",\"OUTCALLS\":\"На исходящих\",\"HOME\":\"DND пауза\",\"TADBIR\":\"Другая причина\",\"CALL\":\"Позвонить\",\"STATUS\":\"Статус\"}');\n\n//# sourceURL=webpack://boxdialer/./src/static/locale/ru.json?");
/***/ })
}]);
\ No newline at end of file
......@@ -4,6 +4,7 @@ import React from 'react';
import BxMiniWidjetUiStyle, { DialPadIcon } from './style';
import TimerUi from '../TimerUi';
import { Text, useTranslator } from '@eo-locale/react';
// import {useConfig} from "../../storage"
const BxMiniWidjetUi = ({
widjetState,
phoneNumber,
......@@ -14,6 +15,7 @@ const BxMiniWidjetUi = ({
position,
}) => {
const translator = useTranslator();
// const {state, setState} = useConfig((state) => state)
const colorTypeFunc = ({ widjetState, reason }) => {
switch (`${widjetState}_${reason}`) {
case ('pending_undefined', 'pending_free'):
......
......@@ -11,13 +11,18 @@ import MicIcon from '@mui/icons-material/Mic';
import MicOffIcon from '@mui/icons-material/MicOff';
import PlayArrowIcon from '@mui/icons-material/PlayArrow';
import PauseIcon from '@mui/icons-material/Pause';
import { contextModalEventProperty } from '../../context/modalEventProperty';
// import { contextModalEventProperty } from '../../context/modalEventProperty';
import { useContext } from 'react';
import {useConfigHoldMute} from "../../storage"
const InnerCaller = ({ hidden, type, from, innerTimer }) => {
const boxDialer = window.BoxDialer;
const configHoldMute = useConfigHoldMute((state) => state)
const translator = useTranslator();
const [callEvents, setCallEvents] = useContext(contextModalEventProperty);
// // context
// const [callEvents, setCallEvents] = useContext(contextModalEventProperty);
const dataFormatter = (secund) => {
let ts = intervalToDuration({
start: 0,
......@@ -27,7 +32,6 @@ const InnerCaller = ({ hidden, type, from, innerTimer }) => {
? `${ts.hours}:${ts.minutes}:${ts.seconds}`
: `${ts.minutes}:${ts.seconds}`;
};
console.log('callEvents_callHold: ', callEvents?.callHold);
const selectModalType = (type) => {
switch (type) {
......@@ -37,14 +41,14 @@ const InnerCaller = ({ hidden, type, from, innerTimer }) => {
<div className='button timer'>
<div>{dataFormatter(innerTimer)}</div>
<div onClick={() => boxDialer.holdButtonClick()}>
{callEvents?.callHold ? (
{configHoldMute?.state?.callHold ? (
<PlayArrowIcon style={{ color: '#fff' }} />
) : (
<PauseIcon style={{ color: '#fff' }} />
)}
</div>
<div onClick={() => boxDialer.muteButtonClick()}>
{callEvents?.callMute ? (
{configHoldMute?.state?.callMute ? (
<MicOffIcon style={{ color: '#fff' }} />
) : (
<MicIcon style={{ color: '#fff' }} />
......
......@@ -12,21 +12,18 @@ import SendToMobileIcon from '@mui/icons-material/SendToMobile';
import DialpadIcon from '@mui/icons-material/Dialpad';
import CallCardDropDown from '../CallCardDropDown';
import ModalNumpad from '../ModalNumpad';
import { useContext } from 'react';
import { contextModalEventProperty } from '../../context/modalEventProperty';
import {useConfigHoldMute} from "../../storage"
// import { contextModalEventProperty } from '../../context/modalEventProperty';
const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => {
const boxDialer = window.BoxDialer;
const configHoldMute = useConfigHoldMute((state) => state)
const [rollUp, setRollUp] = useState(false);
const [modalHidden, setModalHidden] = useState(false);
// const [callEvents, setCallEvents] = useState({});
const [transferModel, setTransferModel] = useState(true);
const [numpadModal, setNumpadModal] = useState(false);
const { callEvents, setCallEvents } = useContext(contextModalEventProperty);
// useEffect(() => {
// boxDialer.setSipStateChangeCallback(setCallEvents, 'setCallEvents');
// }, []);
useEffect(() => {
setModalHidden(hidden);
......@@ -102,14 +99,14 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => {
<ModalContainer.Footer justify={'space-between'} rollUp={rollUp}>
<div className='outcomingEventStyle'>
<div onClick={() => boxDialer.holdButtonClick()}>
{callEvents?.callHold ? (
{configHoldMute?.state?.callHold ? (
<PlayArrowIcon style={{ color: '#fff' }} />
) : (
<PauseIcon style={{ color: '#fff' }} />
)}
</div>
<div onClick={() => boxDialer.muteButtonClick()}>
{callEvents?.callMute ? (
{configHoldMute?.state?.callMute ? (
<MicOffIcon style={{ color: '#fff' }} />
) : (
<MicIcon style={{ color: '#fff' }} />
......
/** @format */
import React from 'react';
import ModalEventProperty from './modalEventProperty';
const CreateContext = ({ children }) => {
return (
<>
<ModalEventProperty>{children}</ModalEventProperty>
</>
);
};
export default CreateContext;
/** @format */
import React, { createContext, useState } from 'react';
export const contextModalEventProperty = createContext(null);
const ModalEventProperty = ({ children }) => {
const [callEvents, setCallEvents] = useState({});
return (
<contextModalEventProperty.Provider value={{ callEvents, setCallEvents }}>
{children}
</contextModalEventProperty.Provider>
);
};
export default ModalEventProperty;
......@@ -4,11 +4,9 @@ import React from 'react';
import { createRoot } from 'react-dom/client';
import { Toaster } from 'react-hot-toast';
import { BoxDialer } from './lib/boxDIaler';
import Root from './root';
import './index.css';
import ControlRenderBX from './lib/controlRenderBX';
import LanguageController from './lib/languageController';
import CreateContext from './context';
window.BoxDialer = new BoxDialer();
const container = document.getElementById('boxdialerwidjet');
......@@ -16,11 +14,9 @@ const root = createRoot(container);
root.render(
<React.StrictMode>
<CreateContext>
<LanguageController>
<Toaster />
<ControlRenderBX />
</LanguageController>
</CreateContext>
<LanguageController>
<Toaster />
<ControlRenderBX />
</LanguageController>
</React.StrictMode>,
);
......@@ -8,12 +8,15 @@ import Modal from '../components/Modal';
import BxMiniWidjetUi from '../components/BxMiniWidjetUi';
import SecondNotifSip from '../components/SecondNotifSip';
import InnerCaller from '../components/InnerCaller';
import { contextModalEventProperty } from '../context/modalEventProperty';
import {useConfigHoldMute} from "../storage"
// import { contextModalEventProperty } from '../context/modalEventProperty';
const Root = ({ wsphonedata, onSetDnd, setWsphonedata, callMethod }) => {
const boxDialer = window.BoxDialer;
const { callEvents, setCallEvents } = useContext(contextModalEventProperty);
// // context
// const { callEvents, setCallEvents } = useContext(contextModalEventProperty);
const configHoldMute = useConfigHoldMute((state) => state)
const [phoneModal, setPhoneModal] = useState(false);
const [dynamicValue, setDynamicValue] = useState('pending');
const [modalState, setModalState] = useState(false);
......@@ -25,12 +28,6 @@ const Root = ({ wsphonedata, onSetDnd, setWsphonedata, callMethod }) => {
from: '',
});
console.log('state_callEvents: ', callEvents);
// const [callEvents, setCallEvents] = useState(null);
// useEffect(() => {
// setCallEventsContext(callEvents);
// }, [callEvents]);
useEffect(() => {
if (secondLine) {
setTimeout(() => {
......@@ -38,36 +35,7 @@ const Root = ({ wsphonedata, onSetDnd, setWsphonedata, callMethod }) => {
}, 5000);
}
}, [secondLine]);
// ======================================================
// var no_active_delay = 60;
// var now_no_active = 0;
// function activeUser() {
// now_no_active = 0;
// }
// function updateChat() {
// location.reload();
// return;
// }
// setInterval(() => {
// if (
// now_no_active >= no_active_delay && modalState.bool === 'undefined'
// ? true
// : (!modalState.bool && !innerCallerModal.bool) ||
// modalState.bool === 'undefined'
// ) {
// now_no_active++;
// updateChat();
// }
// }, 1000);
// document.onmousemove = activeUser;
// console.log(
// 'modalState_bool: ',
// modalState.bool === 'undefined'
// ? true
// : (!modalState.bool && !innerCallerModal.bool) ||
// modalState.bool === 'undefined',
// );
// ======================================================
useEffect(() => {
if (wsphonedata && wsphonedata?.number) {
......@@ -76,7 +44,8 @@ const Root = ({ wsphonedata, onSetDnd, setWsphonedata, callMethod }) => {
boxDialer.setSipStateChangeCallback(setSecondLine, 'secondLine');
boxDialer.setSipStateChangeCallback(setPhoneModal, 'phoneModal');
boxDialer.setSipStateChangeCallback(setInnerTimer, 'innerTimer');
boxDialer.setSipStateChangeCallback(setCallEvents, 'setCallEvents');
// // context
boxDialer.setSipStateChangeCallback(configHoldMute.setState, 'setCallEvents');
boxDialer.setSipStateChangeCallback(
setInnerCallerModal,
'innerCallerModal',
......@@ -147,8 +116,6 @@ const Root = ({ wsphonedata, onSetDnd, setWsphonedata, callMethod }) => {
}
};
console.log('modalState_bool: ', modalState.bool);
console.log(
'wsphonedata_all_data: ',
wsphonedata?.position,
......@@ -217,3 +184,34 @@ const Root = ({ wsphonedata, onSetDnd, setWsphonedata, callMethod }) => {
);
};
export default Root;
// ======================================================
// var no_active_delay = 60;
// var now_no_active = 0;
// function activeUser() {
// now_no_active = 0;
// }
// function updateChat() {
// location.reload();
// return;
// }
// setInterval(() => {
// if (
// now_no_active >= no_active_delay && modalState.bool === 'undefined'
// ? true
// : (!modalState.bool && !innerCallerModal.bool) ||
// modalState.bool === 'undefined'
// ) {
// now_no_active++;
// updateChat();
// }
// }, 1000);
// document.onmousemove = activeUser;
// console.log(
// 'modalState_bool: ',
// modalState.bool === 'undefined'
// ? true
// : (!modalState.bool && !innerCallerModal.bool) ||
// modalState.bool === 'undefined',
// );
// ======================================================
/** @format */
import { create } from 'zustand';
export const useConfigHoldMute = create((set) => ({
state: {},
setState: (x) => set((state) => ({ state: x }))
}));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment