@bigbinary/neeto-commons-frontend 2.0.10 → 2.0.12

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/README.md CHANGED
@@ -7,7 +7,7 @@ The commons frontend library for Neeto Applications.
7
7
  Install from npm:
8
8
 
9
9
  ```bash
10
- yarn add "@bigbinary/neeto-commons-frontend@2.0.10"
10
+ yarn add "@bigbinary/neeto-commons-frontend@2.0.12"
11
11
  ```
12
12
 
13
13
  This package relies on the host project's tailwind configuration. So add
@@ -87,16 +87,16 @@ When you are migrating from version 1 to version 2, do the following:
87
87
  This is how releases are managed in this repo.
88
88
 
89
89
  - We will create a branch with the next release version as its name (`1.0.x`)
90
- from master branch.
90
+ from main branch.
91
91
  - Version in
92
- [README.md](https://github.com/bigbinary/neeto-commons-frontend/blob/master/README.md#L10)
92
+ [README.md](https://github.com/bigbinary/neeto-commons-frontend/blob/main/README.md#L10)
93
93
  and
94
- [package.json](https://github.com/bigbinary/neeto-commons-frontend/blob/master/package.json#L3)
94
+ [package.json](https://github.com/bigbinary/neeto-commons-frontend/blob/main/package.json#L3)
95
95
  will be updated to the current branch name.
96
96
  - From now on, we can install the package to neeto-applications using the
97
97
  version `2.X.Y`.
98
- - We will create a draft PR of this branch targeting master. This keeps the
99
- branch in sync with master branch (bot-bigbinary will auto-merge the changes).
98
+ - We will create a draft PR of this branch targeting main. This keeps the branch
99
+ in sync with main branch (bot-bigbinary will auto-merge the changes).
100
100
  - When all features have been built, we will deploy it to all neeto-applications
101
101
  locally using `yalc` package manager. We won't raise PR until the deployment
102
102
  and verification is successfully done locally for all neeto-applications. The
@@ -113,7 +113,7 @@ This is how releases are managed in this repo.
113
113
  intact even if that branch gets deleted.
114
114
  - Whenever a new release is created with a new version number, the github
115
115
  actions will automatically publish the built package to npm.
116
- - Now we will squash and merge the PR `2.X.Y` to master and delete its source
116
+ - Now we will squash and merge the PR `2.X.Y` to main and delete its source
117
117
  branch. This will delete all commits except the top one (since we have created
118
118
  a tag with it).
119
119
  - Immediately, we will open another branch with the next version (`2.X.Y`) and
@@ -7,12 +7,14 @@ var axios = require('axios');
7
7
  var i18next = require('i18next');
8
8
  var ramda = require('ramda');
9
9
  var reactI18next = require('react-i18next');
10
+ var Logger = require('js-logger');
10
11
  var mixpanel = require('mixpanel-browser');
11
12
 
12
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
14
 
14
15
  var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
15
16
  var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
17
+ var Logger__default = /*#__PURE__*/_interopDefaultLegacy(Logger);
16
18
  var mixpanel__default = /*#__PURE__*/_interopDefaultLegacy(mixpanel);
17
19
 
18
20
  function _typeof(obj) {
@@ -359,7 +361,9 @@ var neetoCommons = {
359
361
  actions: {
360
362
  cancel: "Cancel",
361
363
  save: "Save"
362
- }
364
+ },
365
+ andSentence: "{{first}} {{and}} {{last}}",
366
+ and: "and"
363
367
  },
364
368
  toastr: {
365
369
  success: {
@@ -372,6 +376,38 @@ var neetoCommons = {
372
376
  },
373
377
  notice: {
374
378
  errorOccurred: "Some error occurred."
379
+ },
380
+ widget: {
381
+ installation: {
382
+ snippet: {
383
+ copied: "Copied to clipboard!",
384
+ copy: "Copy",
385
+ sendViaEmail: "Send code via email",
386
+ disabledError: "Please enable atleast 1 widget."
387
+ },
388
+ instructions: {
389
+ placement: "Place the embed code in your HTML file. This will embed <fontBold>{{selectedWidgets}}</fontBold> in your website."
390
+ }
391
+ },
392
+ email: {
393
+ title: "Widget installation script",
394
+ fields: {
395
+ emails: {
396
+ label: "Emails",
397
+ placeholder: "Enter recipient email",
398
+ invalidError: "Please enter valid email addresses."
399
+ },
400
+ subject: {
401
+ label: "Subject",
402
+ "default": "neetoWidget script for installing {{selectedWidgets}}"
403
+ }
404
+ },
405
+ body: "Hey there, We're going to use {{selectedWidgets}} on our website and I was hoping you could help us with the installation steps. Please find the code snippet for widget installation attached below.",
406
+ actions: {
407
+ send: "Send",
408
+ cancel: "Cancel"
409
+ }
410
+ }
375
411
  }
376
412
  };
377
413
  var en = {
@@ -394,6 +430,17 @@ var initializeI18n = function initializeI18n(resources) {
394
430
  });
395
431
  };
396
432
 
433
+ function initializeLogger() {
434
+ /* eslint react-hooks/rules-of-hooks: "off" */
435
+ Logger__default["default"].useDefaults();
436
+
437
+ if (process.env.RAILS_ENV === "production") {
438
+ Logger__default["default"].setLevel(Logger__default["default"].OFF);
439
+ }
440
+
441
+ window.logger = Logger__default["default"];
442
+ }
443
+
397
444
  function initializeMixPanel() {
398
445
  var isProduction = process.env.NODE_ENV === "production";
399
446
  var isTokenPresent = !!process.env.MIXPANEL_TOKEN;
@@ -433,6 +480,7 @@ function initializeApplication(_ref) {
433
480
  }
434
481
 
435
482
  if (!(skip !== null && skip !== void 0 && skip.i18n)) initializeI18n(translationResources);
483
+ if (!(skip !== null && skip !== void 0 && skip.logger)) initializeLogger();
436
484
  }
437
485
 
438
486
  exports["default"] = initializeApplication;
package/initializers.d.ts CHANGED
@@ -6,6 +6,7 @@ type Configurations = {
6
6
  globalProps: boolean;
7
7
  mixpanel: boolean;
8
8
  i18n: boolean;
9
+ logger: boolean;
9
10
  axios: Skippable<{
10
11
  baseURL: boolean;
11
12
  authHeaders: boolean;
package/initializers.js CHANGED
@@ -3,6 +3,7 @@ import axios from 'axios';
3
3
  import i18next from 'i18next';
4
4
  import { values, evolve, omit, modify, mergeDeepLeft, either, isEmpty, isNil } from 'ramda';
5
5
  import { initReactI18next } from 'react-i18next';
6
+ import Logger from 'js-logger';
6
7
  import mixpanel from 'mixpanel-browser';
7
8
 
8
9
  function _typeof(obj) {
@@ -349,7 +350,9 @@ var neetoCommons = {
349
350
  actions: {
350
351
  cancel: "Cancel",
351
352
  save: "Save"
352
- }
353
+ },
354
+ andSentence: "{{first}} {{and}} {{last}}",
355
+ and: "and"
353
356
  },
354
357
  toastr: {
355
358
  success: {
@@ -362,6 +365,38 @@ var neetoCommons = {
362
365
  },
363
366
  notice: {
364
367
  errorOccurred: "Some error occurred."
368
+ },
369
+ widget: {
370
+ installation: {
371
+ snippet: {
372
+ copied: "Copied to clipboard!",
373
+ copy: "Copy",
374
+ sendViaEmail: "Send code via email",
375
+ disabledError: "Please enable atleast 1 widget."
376
+ },
377
+ instructions: {
378
+ placement: "Place the embed code in your HTML file. This will embed <fontBold>{{selectedWidgets}}</fontBold> in your website."
379
+ }
380
+ },
381
+ email: {
382
+ title: "Widget installation script",
383
+ fields: {
384
+ emails: {
385
+ label: "Emails",
386
+ placeholder: "Enter recipient email",
387
+ invalidError: "Please enter valid email addresses."
388
+ },
389
+ subject: {
390
+ label: "Subject",
391
+ "default": "neetoWidget script for installing {{selectedWidgets}}"
392
+ }
393
+ },
394
+ body: "Hey there, We're going to use {{selectedWidgets}} on our website and I was hoping you could help us with the installation steps. Please find the code snippet for widget installation attached below.",
395
+ actions: {
396
+ send: "Send",
397
+ cancel: "Cancel"
398
+ }
399
+ }
365
400
  }
366
401
  };
367
402
  var en = {
@@ -384,6 +419,17 @@ var initializeI18n = function initializeI18n(resources) {
384
419
  });
385
420
  };
386
421
 
422
+ function initializeLogger() {
423
+ /* eslint react-hooks/rules-of-hooks: "off" */
424
+ Logger.useDefaults();
425
+
426
+ if (process.env.RAILS_ENV === "production") {
427
+ Logger.setLevel(Logger.OFF);
428
+ }
429
+
430
+ window.logger = Logger;
431
+ }
432
+
387
433
  function initializeMixPanel() {
388
434
  var isProduction = process.env.NODE_ENV === "production";
389
435
  var isTokenPresent = !!process.env.MIXPANEL_TOKEN;
@@ -423,6 +469,7 @@ function initializeApplication(_ref) {
423
469
  }
424
470
 
425
471
  if (!(skip !== null && skip !== void 0 && skip.i18n)) initializeI18n(translationResources);
472
+ if (!(skip !== null && skip !== void 0 && skip.logger)) initializeLogger();
426
473
  }
427
474
 
428
475
  export { initializeApplication as default, globalProps$1 as globalProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-commons-frontend",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
4
4
  "description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
5
5
  "repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",
@@ -48,8 +48,6 @@
48
48
  "@babel/preset-react": "^7.16.7",
49
49
  "@bigbinary/neeto-icons": "^1.8.35",
50
50
  "@bigbinary/neetoui": "^4.0.0",
51
- "antd": "4.18.7",
52
- "react-toastify": "^9.0.8",
53
51
  "@honeybadger-io/react": "2.0.1",
54
52
  "@rollup/plugin-alias": "^3.1.9",
55
53
  "@rollup/plugin-babel": "^5.3.1",
@@ -61,6 +59,7 @@
61
59
  "@testing-library/react": "12.1.3",
62
60
  "@testing-library/react-hooks": "^8.0.0",
63
61
  "@testing-library/user-event": "13.5.0",
62
+ "antd": "4.18.7",
64
63
  "autoprefixer": "^10.4.7",
65
64
  "axios": "^0.27.2",
66
65
  "babel-jest": "27.0.6",
@@ -80,6 +79,7 @@
80
79
  "husky": "^7.0.4",
81
80
  "i18next": "21.7.0",
82
81
  "jest": "27.5.1",
82
+ "js-logger": "^1.6.1",
83
83
  "lint-staged": "^12.3.7",
84
84
  "mixpanel-browser": "^2.45.0",
85
85
  "prettier": "^2.6.2",
@@ -88,27 +88,35 @@
88
88
  "react": "^17.0.2",
89
89
  "react-dom": "17.0.2",
90
90
  "react-i18next": "11.16.8",
91
+ "react-query": "^3.39.2",
91
92
  "react-router-dom": "^5.2.0",
93
+ "react-syntax-highlighter": "^15.5.0",
94
+ "react-toastify": "^9.0.8",
92
95
  "rollup": "^2.76.0",
93
96
  "rollup-plugin-analyzer": "^4.0.0",
94
97
  "rollup-plugin-cleaner": "^1.0.0",
95
98
  "rollup-plugin-peer-deps-external": "^2.2.4",
96
- "yup": "^0.32.11"
99
+ "yup": "^0.32.11",
100
+ "zustand": "^4.1.2"
97
101
  },
98
102
  "dependencies": {},
99
103
  "peerDependencies": {
100
104
  "@bigbinary/neeto-icons": "^1.8.35",
101
105
  "@bigbinary/neetoui": "^4.0.0",
102
106
  "@honeybadger-io/react": "2.0.1",
107
+ "antd": "4.18.7",
103
108
  "axios": "^0.27.2",
104
109
  "dayjs": "1.11.1",
105
110
  "formik": "^2.2.9",
106
111
  "i18next": "21.7.0",
112
+ "js-logger": "^1.6.1",
107
113
  "mixpanel-browser": "^2.45.0",
108
114
  "ramda": "^0.28.0",
109
115
  "react": "^17.0.2",
110
116
  "react-i18next": "11.16.8",
117
+ "react-query": "^3.39.2",
111
118
  "react-router-dom": "^5.2.0",
119
+ "react-toastify": "^9.0.8",
112
120
  "yup": "^0.32.11"
113
121
  }
114
122
  }