Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provided Support of default export, multi export, export as service, export as component #25

Merged
merged 24 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a2d9187
fix(whatsapp web): provided support for whatsapp web
opensrc0 Apr 10, 2024
e5463b8
docs: documention for wakelock
Apr 10, 2024
595b775
docs(readme.md): changed readme.md inside .github
opensrc0 Apr 10, 2024
95437d6
docs(readme.md): updated list of component in readme.md
opensrc0 Apr 10, 2024
7fc901b
docs: updated documetation
Apr 10, 2024
e2e5c5c
changed in setup.js
opensrc0 Apr 10, 2024
54a230b
Merge pull request #23 from Alok30/feature_wakelock
opensrc0 Apr 10, 2024
db77260
docs(boiler plate): automate component count
opensrc0 Apr 10, 2024
0921973
Doc: Added wakeuplock in doc
opensrc0 Apr 11, 2024
4610657
Merge branch 'main' of github.com:opensrc0/fe-pilot
opensrc0 Apr 11, 2024
8975903
docs(readme.md): added count of component in readme.md
opensrc0 Apr 11, 2024
13f603f
fix(share): given support as a service and as a component
opensrc0 Apr 17, 2024
1caf916
refactor(colorpicker): added default export and multiexport in the co…
opensrc0 Apr 29, 2024
88e5b34
fix(colorpicker): fixed: Import export in index.js of ColorPicker
opensrc0 Apr 29, 2024
1238574
Updated boiler plate
opensrc0 Apr 29, 2024
580dc69
refactor(autofillotp): added support of default export and multiexpor…
opensrc0 Apr 29, 2024
6d13195
fix(autofillotp): changed in index.js of autofillOtp
opensrc0 Apr 29, 2024
acf9dd8
refactor(copytoclipboard): added support of default export, multi exp…
opensrc0 Apr 29, 2024
dcfaf47
refactor(whatsappshare): added support of default export, multi expor…
opensrc0 Apr 29, 2024
b138ef8
refactor(wakelock): added support of default export, multiexport and …
opensrc0 Apr 29, 2024
a538d9f
refactor(vibrate): added support of default export, multi export and …
opensrc0 Apr 29, 2024
a0c722c
refactor(phonebook): added support of default export, multi export an…
opensrc0 Apr 29, 2024
13d8189
fix(boiler plate): fixed boiler plate
opensrc0 Apr 29, 2024
c5b8f63
Merge branch 'master' into main
opensrc0 Apr 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"presets": [ ["@babel/preset-env", { "modules": false }] , "@babel/preset-react"],
"comments": false,
"env": {
"minify": {
"presets": ["@babel/preset-env", ["babel-preset-minify"]],
"presets": [["@babel/preset-env", { "modules": false }], ["babel-preset-minify"]],
"plugins": [["transform-react-remove-prop-types", {
"mode": "remove",
"removeImport": true,
Expand All @@ -18,4 +18,4 @@
}]]
}
}
}
}
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
"parserOptions": {
"ecmaVersion":"latest"
}
}
}
26 changes: 14 additions & 12 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,20 @@ import Share from 'fe-pilot/Share';
> <summary>See the list of components</summary>
>
> ###
> 01. :white_check_mark: AutoFillOtp &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/AutoFillOtp/README.md)
> 00. :white_check_mark: ColorPicker&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/ColorPicker/README.md)
> 00. :white_check_mark: CopyToClipboard&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/CopyToClipboard/README.md)
> 00. :white_check_mark: FaceDetector&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/FaceDetector/README.md)
> 00. :white_check_mark: LiveLocation &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/LiveLocationTracking/README.md)
> 00. :white_check_mark: LocateMe &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/LocateMe/README.md)
> 00. :white_check_mark: PhoneBook &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/PhoneBook/README.md)
> 00. :white_check_mark: Scanner &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Scanner/README.md)
> 00. :white_check_mark: Share &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Share/README.md)
> 00. :white_check_mark: TextToSpeech &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/TextToSpeech/README.md)
> 00. :white_check_mark: VoiceRecognition&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/VoiceRecognition/README.md)
> 00. :white_check_mark: Vibrate &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Vibrate/README.md)
> 01. :white_check_mark: &nbsp; [AutoFillOtp](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/AutoFillOtp/README.md)
> 00. :white_check_mark: &nbsp; [ColorPicker](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/ColorPicker/README.md)
> 00. :white_check_mark: &nbsp; [CopyToClipboard](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/CopyToClipboard/README.md)
> 00. :white_check_mark: &nbsp; [FaceDetector](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/FaceDetector/README.md)
> 00. :white_check_mark: &nbsp; [LiveLocation](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/LiveLocationTracking/README.md)
> 00. :white_check_mark: &nbsp; [LocateMe](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/LocateMe/README.md)
> 00. :white_check_mark: &nbsp; [PhoneBook](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/PhoneBook/README.md)
> 00. :white_check_mark: &nbsp; [Scanner](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Scanner/README.md)
> 00. :white_check_mark: &nbsp; [Share](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Share/README.md)
> 00. :white_check_mark: &nbsp; [TextToSpeech](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/TextToSpeech/README.md)
> 00. :white_check_mark: &nbsp; [VoiceRecognition](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/VoiceRecognition/README.md)
> 00. :white_check_mark: &nbsp; [Vibrate](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Vibrate/README.md)
> 00. :white_check_mark: &nbsp; [WakeLock](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/WakeLock/README.md)
> 00. :white_check_mark: &nbsp; [WhatsappShare](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/WhatsappShare/README.md)
> </details>

## Online Editor Templates
Expand Down
37 changes: 23 additions & 14 deletions .github/SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,24 @@ import { TextToSpeechInit, TextToSpeechStart, TextToSpeechStop } from 'fe-pilot/

<PhoneBook />
<Share />
<TextToSpeechInit text="Password field is not contained in a form: (More info: ">
<TextToSpeech text="Password field is not contained in a form: (More info: ">
<TextToSpeechStart>Start Icon</TextToSpeechStart>
<TextToSpeechStop>Stop Icon</TextToSpeechStop>
</TextToSpeechInit>
</TextToSpeech>
```

#### 4. Hurrah...! Now fe-pilot repo is available inside the node_modules of your project, and waching change in fe-pilot.
#### 4. Are you getting Error ? continue to step 4. If no error found go to step 5.

**bug:** ```TypeError: Cannot read properties of null (reading 'useState')```<br/>
**solution** Go to fe-pilot in terminal and run below command

```js
npm link {PATH}/{Your Repo}
```

&nbsp;&nbsp;**Note:** PATH is the location of ```your repo``` folder. ```Your Repo``` is the name of the repo.

#### 5. Hurrah...! Now fe-pilot repo is available inside the node_modules of your project, and waching change in fe-pilot.


## Folder Structure
Expand All @@ -40,8 +51,8 @@ fe-pilot
└── __app
└── component
├──TextToSpeech (component name)
| ├──TextToSpeech.js (top level exports/re-exports)
| ├──TextToSpeechInit.js (parent component)
| ├──index.js (top level exports/re-exports)
| ├──TextToSpeech.js (parent component)
| ├──TextToSpeechStart.js (child component)
| └──TextToSpeechStop.js (child component)
```
Expand All @@ -67,13 +78,13 @@ graph TD;

```mermaid
graph TD;
Scanner--->CameraClick;
Scanner--->CameraClose;
Scanner--->CameraFacing;
Scanner--->CameraFlash;
Scanner--->CameraScanBox;
Scanner--->PhoneGallery;
Scanner--->StartCamera;
Scanner--->ScannerCamera;
Scanner--->ScannerClose;
Scanner--->ScannerFacing;
Scanner--->ScannerFlash;
Scanner--->ScannerGallery;
Scanner--->ScannerScanBox;
Scanner--->ScannerClick;
```
> [!IMPORTANT]
> Camera component Structure
Expand All @@ -82,7 +93,6 @@ graph TD;

```mermaid
graph TD;
TextToSpeech--->TextToSpeechInit;
TextToSpeech--->TextToSpeechStart;
TextToSpeech--->TextToSpeechStop;
```
Expand All @@ -93,7 +103,6 @@ graph TD;

```mermaid
graph TD;
VoiceRecognition--->TextToSpeechInit;
VoiceRecognition--->VoiceRecognitionIcon;
VoiceRecognition--->VoiceRecognitionModal;
```
Expand Down
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,21 @@ import Share from 'fe-pilot/Share';
<summary>See the list of components</summary>

###
1. :white_check_mark: [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/AutoFillOtp/README.md) AutoFillOtp
2. :white_check_mark: [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/ColorPicker/README.md) ColorPicker
3. :white_check_mark: [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/CopyToClipboard/README.md) CopyToClipboard
4. :white_check_mark: [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/FaceDetector/README.md) FaceDetector
5. :white_check_mark: [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/LiveLocationTracking/README.md) LiveLocation
6. :white_check_mark: [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/LocateMe/README.md) LocateMe
7. :white_check_mark: [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/PhoneBook/README.md) PhoneBook
8. :white_check_mark: [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Scanner/README.md) Scanner
9. :white_check_mark: [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Share/README.md) Share
10. :white_check_mark: [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/TextToSpeech/README.md) TextToSpeech
11. :white_check_mark: [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/VoiceRecognition/README.md) VoiceRecognition
12. :white_check_mark: [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Vibrate/README.md) Vibrate
></details>
1. :white_check_mark: &nbsp; [AutoFillOtp](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/AutoFillOtp/README.md)
2. :white_check_mark: &nbsp; [ColorPicker](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/ColorPicker/README.md)
3. :white_check_mark: &nbsp; [CopyToClipboard](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/CopyToClipboard/README.md)
4. :white_check_mark: &nbsp; [FaceDetector](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/FaceDetector/README.md)
5. :white_check_mark: &nbsp; [LiveLocation](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/LiveLocationTracking/README.md)
6. :white_check_mark: &nbsp; [LocateMe](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/LocateMe/README.md)
7. :white_check_mark: &nbsp; [PhoneBook](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/PhoneBook/README.md)
8. :white_check_mark: &nbsp; [Scanner](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Scanner/README.md)
9. :white_check_mark: &nbsp; [Share](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Share/README.md)
10. :white_check_mark: &nbsp; [TextToSpeech](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/TextToSpeech/README.md)
11. :white_check_mark: &nbsp; [VoiceRecognition](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/VoiceRecognition/README.md)
12. :white_check_mark: &nbsp; [Vibrate](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Vibrate/README.md)
13. :white_check_mark: &nbsp; [WakeLock](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/WakeLock/README.md)
14. :white_check_mark: &nbsp; [WhatsappShare](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/WhatsappShare/README.md)
</details>

## Online Editor Templates

Expand Down
101 changes: 71 additions & 30 deletions __app/component/AutoFillOtp/AutoFillOtp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import { handleError, handleSuccess } from '../services/handlerService';
import React from 'react';
import PropTypes from 'prop-types';
import { handleSuccess, handleError, handleLoading } from '../services/handlerService';
import Wrapper from '../Wrapper/Wrapper';

const failureMsgDefault = {
unSupported: 'AutoFillOtp is not supporting in your device',
error: 'Unable to fetch details from AutoFillOtp',
};

const isBrowserSupport = () => globalThis.OTPCredential;

const abortAutoFill = (abort, time) => {
setTimeout(() => {
Expand All @@ -7,36 +17,67 @@ const abortAutoFill = (abort, time) => {
}, time * 60 * 1000);
};

const defaultProps = {
successCb: (() => {}),
failureCb: (() => {}),
successMsg: 'OTP autofilled successfully',
failureMsg: {
UN_SUPPORTED_FEATURE: 'Your device is not supporting AutofillOTP',
ERROR: '',
},
const autoFillOtp = ({
successCb = () => {},
failureCb = () => {},
loadingCb = () => {},
successMsg = 'OTP autofilled successfully',
failureMsg: failureMsgProps = { ...failureMsgDefault },
} = {}) => {
const failureMsg = { ...failureMsgDefault, ...failureMsgProps };

const init = () => {
if (isBrowserSupport()) {
handleLoading({ loadingCb });

const abort = new AbortController();
abortAutoFill(abort, 3);
navigator.credentials.get({
otp: { transport: ['sms'] },
signal: abort.signal,
}).then((otp) => {
const { code } = otp;
handleSuccess({ msgType: 'SUCCESSFUL', msg: successMsg, successCb, data: code });
}).catch((error) => handleError({ msgType: 'ERROR', msg: error, failureCb }));
} else {
return handleError({ msgType: 'UN_SUPPORTED_FEATURE', msg: failureMsg.unSupported, failureCb });
}
return true;
};

init();
};
function AutoFillOtp(props = {}) {
const successCb = props.successCb || defaultProps.successCb;
const failureCb = props.failureCb || defaultProps.failureCb;
const successMsg = props.successMsg || defaultProps.successMsg;
const failureMsg = { ...defaultProps.failureMsg, ...props.failureMsg };

if (AutoFillOtp.isBrowserSupport()) {
const abort = new AbortController();
abortAutoFill(abort, 3);
navigator.credentials.get({
otp: { transport: ['sms'] },
signal: abort.signal,
}).then((otp) => {
const { code } = otp;
handleSuccess({ msgType: 'SUCCESSFUL', msg: successMsg, successCb, data: code });
}).catch((error) => handleError({ msgType: 'ERROR', msg: error, failureCb }));
} else {
return handleError({ msgType: 'UN_SUPPORTED_FEATURE', msg: failureMsg.unSupported, failureCb });
}

function AutoFillOtp({
children,
successCb,
failureCb,
loadingCb,
successMsg,
failureMsg,
}) {
return React.Children.map(children || 'AutoFillOtp', (child) => React.cloneElement(typeof child === 'string' ? <span>{child}</span> : child, {
onClick: () => autoFillOtp({
successCb,
failureCb,
loadingCb,
successMsg,
failureMsg,
}),
}));
}

AutoFillOtp.isBrowserSupport = () => globalThis.OTPCredential;
AutoFillOtp.propTypes = {
showForever: PropTypes.bool,
successCb: PropTypes.func,
failureCb: PropTypes.func,
loadingCb: PropTypes.func,
successMsg: PropTypes.string,
failureMsg: PropTypes.object,
};

const WAutoFillOtp = Wrapper(AutoFillOtp, isBrowserSupport);

export { autoFillOtp, WAutoFillOtp as AutoFillOtp };

export default AutoFillOtp;
export default WAutoFillOtp;
7 changes: 2 additions & 5 deletions __app/component/AutoFillOtp/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
import AutoFillOtp from './AutoFillOtp';

export { AutoFillOtp };

export default AutoFillOtp;
export * from './AutoFillOtp';
export { default } from './AutoFillOtp';
58 changes: 37 additions & 21 deletions __app/component/ColorPicker/ColorPicker.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
import React from 'react';
import PropTypes from 'prop-types';
import { handleSuccess, handleError } from '../services/handlerService';
import { handleSuccess, handleError, handleLoading } from '../services/handlerService';
import Wrapper from '../Wrapper/Wrapper';

const failureMsgDefault = {
unSupported: 'Your browser does not support the Color Picker fetaure',
error: 'Unable to copy color code',
};

function ColorPicker({
successCb,
failureCb,
successMsg,
failureMsg: failureMsgProps,
children,
}) {
const isBrowserSupport = () => globalThis.EyeDropper;

const colorPicker = ({
successCb = () => {},
failureCb = () => {},
loadingCb = () => {},
successMsg = 'Color picked successfully!!',
failureMsg: failureMsgProps = { ...failureMsgDefault },
} = {}) => {
const failureMsg = { ...failureMsgDefault, ...failureMsgProps };

const pickColor = () => {
if (ColorPicker.isBrowserSupport()) {
const init = () => {
if (isBrowserSupport()) {
handleLoading({ loadingCb });
const eyeDropper = new globalThis.EyeDropper();

eyeDropper
Expand All @@ -33,26 +36,39 @@ function ColorPicker({
return true;
};

init();
};

function ColorPicker({
children,
successCb,
failureCb,
loadingCb,
successMsg,
failureMsg,
}) {
return React.Children.map(children || 'Copy Color', (child) => React.cloneElement(typeof child === 'string' ? <span>{child}</span> : child, {
onClick: pickColor,
onKeyDown: pickColor,
onClick: () => colorPicker({
successCb,
failureCb,
loadingCb,
successMsg,
failureMsg,
}),
}));
}

ColorPicker.isBrowserSupport = () => globalThis.EyeDropper;

ColorPicker.propTypes = {
showForever: PropTypes.bool,
successCb: PropTypes.func,
failureCb: PropTypes.func,
loadingCb: PropTypes.func,
successMsg: PropTypes.string,
failureMsg: PropTypes.object,
};

ColorPicker.defaultProps = {
successCb: () => {},
failureCb: () => {},
successMsg: 'Color picked successfully!!',
failureMsg: { ...failureMsgDefault },
};
const WColorPicker = Wrapper(ColorPicker, isBrowserSupport);

export { colorPicker, WColorPicker as ColorPicker };

export default Wrapper(ColorPicker);
export default WColorPicker;
7 changes: 2 additions & 5 deletions __app/component/ColorPicker/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
import ColorPicker from './ColorPicker';

export { ColorPicker };

export default ColorPicker;
export * from './ColorPicker';
export { default } from './ColorPicker';
Loading