@bigbinary/neeto-email-notifications-frontend 1.1.0

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/package.json ADDED
@@ -0,0 +1,181 @@
1
+ {
2
+ "name": "@bigbinary/neeto-email-notifications-frontend",
3
+ "version": "1.1.0",
4
+ "description": "A repo acts as the source of truth for the new nano's structure, configs, data etc.",
5
+ "license": "UNLICENSED",
6
+ "homepage": "https://github.com/bigbinary/neeto-email-notifications-nano",
7
+ "bugs": {
8
+ "url": "https://github.com/bigbinary/neeto-email-notifications-nano/issues"
9
+ },
10
+ "repository": "neeto-email-notifications-nano",
11
+ "author": "BigBinary",
12
+ "files": [
13
+ "dist",
14
+ "types.d.ts"
15
+ ],
16
+ "main": "dist/index.cjs.js",
17
+ "module": "dist/index.js",
18
+ "types": "types.d.ts",
19
+ "scripts": {
20
+ "build": "NODE_ENV=production rollup -c --environment production",
21
+ "prepare": "husky install",
22
+ "release": "yarn build && yalc push --sig",
23
+ "build-preview": "NODE_ENV=production webpack"
24
+ },
25
+ "lint-staged": {
26
+ "./**/app/javascript/**/*.{js,jsx,json}": [
27
+ "prettier --write",
28
+ "eslint --fix"
29
+ ],
30
+ "./test/dummy/**/app/javascript/**/*.{js,jsx,json}": [
31
+ "prettier --write",
32
+ "eslint --fix"
33
+ ],
34
+ "./**/*.rb": [
35
+ "bundle exec rubocop -a --force-exclusion"
36
+ ],
37
+ "{Gemfile,Rakefile,config.ru}": [
38
+ "bundle exec rubocop -a --force-exclusion"
39
+ ]
40
+ },
41
+ "devDependencies": {
42
+ "@babel/core": "7.22.6",
43
+ "@babel/eslint-parser": "7.22.6",
44
+ "@babel/plugin-transform-runtime": "7.22.6",
45
+ "@babel/preset-env": "7.22.6",
46
+ "@babel/preset-react": "7.22.5",
47
+ "@babel/preset-typescript": "7.22.5",
48
+ "@babel/runtime": "7.22.6",
49
+ "@bigbinary/babel-preset-neeto": "1.0.3",
50
+ "@bigbinary/eslint-plugin-neeto": "1.0.64",
51
+ "@bigbinary/neeto-commons-frontend": "2.0.127",
52
+ "@bigbinary/neeto-icons": "1.12.3",
53
+ "@bigbinary/neeto-molecules": "1.0.92",
54
+ "@bigbinary/neetoui": "5.0.13",
55
+ "@emotion/is-prop-valid": "1.2.0",
56
+ "@faker-js/faker": "8.0.2",
57
+ "@honeybadger-io/react": "2.0.1",
58
+ "@rollup/plugin-alias": "5.0.0",
59
+ "@rollup/plugin-babel": "6.0.3",
60
+ "@rollup/plugin-commonjs": "25.0.2",
61
+ "@rollup/plugin-json": "6.0.0",
62
+ "@rollup/plugin-node-resolve": "15.1.0",
63
+ "@rollup/plugin-replace": "5.0.2",
64
+ "@svgr/rollup": "8.0.1",
65
+ "antd": "4.24.12",
66
+ "autoprefixer": "10.4.14",
67
+ "axios": "1.4.0",
68
+ "babel-loader": "9.1.2",
69
+ "babel-plugin-istanbul": "6.1.1",
70
+ "babel-plugin-js-logger": "1.0.17",
71
+ "babel-plugin-macros": "3.1.0",
72
+ "babel-plugin-transform-react-remove-prop-types": "0.4.24",
73
+ "babel-preset-react": "6.24.1",
74
+ "babel-preset-typescript": "7.0.0-alpha.19",
75
+ "browserify-zlib": "0.2.0",
76
+ "buffer": "6.0.3",
77
+ "classnames": "2.3.2",
78
+ "crypto-browserify": "3.12.0",
79
+ "css-loader": "6.8.1",
80
+ "dompurify": "3.0.2",
81
+ "dotenv-webpack": "^8.0.1",
82
+ "eslint": "8.44.0",
83
+ "eslint-config-prettier": "8.8.0",
84
+ "eslint-plugin-cypress": "2.13.3",
85
+ "eslint-plugin-import": "2.27.5",
86
+ "eslint-plugin-jam3": "0.2.3",
87
+ "eslint-plugin-json": "3.1.0",
88
+ "eslint-plugin-prettier": "4.2.1",
89
+ "eslint-plugin-promise": "6.1.1",
90
+ "eslint-plugin-react": "7.32.2",
91
+ "eslint-plugin-react-hooks": "4.6.0",
92
+ "eslint-plugin-unused-imports": "2.0.0",
93
+ "formik": "2.4.2",
94
+ "html-webpack-plugin": "5.5.3",
95
+ "https-browserify": "1.0.0",
96
+ "husky": "8.0.3",
97
+ "i18next": "23.2.7",
98
+ "i18next-browser-languagedetector": "7.0.1",
99
+ "js-logger": "1.6.1",
100
+ "lint-staged": "13.2.3",
101
+ "mini-css-extract-plugin": "2.7.6",
102
+ "mixpanel-browser": "2.47.0",
103
+ "os-browserify": "0.3.0",
104
+ "path-browserify": "1.0.1",
105
+ "postcss": "8.4.24",
106
+ "postcss-import": "15.1.0",
107
+ "postcss-loader": "7.3.3",
108
+ "postcss-preset-env": "9.0.0",
109
+ "prettier": "2.8.8",
110
+ "prettier-plugin-tailwindcss": "0.3.0",
111
+ "process": "0.11.10",
112
+ "ramda": "0.29.0",
113
+ "react": "17.0.2",
114
+ "react-dom": "17.0.2",
115
+ "react-helmet": "6.1.0",
116
+ "react-i18next": "13.0.1",
117
+ "react-query": "3.39.3",
118
+ "react-router-dom": "5.2.0",
119
+ "react-toastify": "8.0.2",
120
+ "react_ujs": "2.6.2",
121
+ "rollup": "2.79.1",
122
+ "rollup-plugin-analyzer": "4.0.0",
123
+ "rollup-plugin-cleaner": "1.0.0",
124
+ "rollup-plugin-peer-deps-external": "2.2.4",
125
+ "rollup-plugin-styles": "4.0.0",
126
+ "sass": "1.63.6",
127
+ "sass-loader": "13.3.2",
128
+ "shakapacker": "6.6.0",
129
+ "stream-browserify": "3.0.0",
130
+ "stream-http": "3.2.0",
131
+ "style-loader": "3.3.3",
132
+ "tailwindcss": "npm:@tailwindcss/postcss7-compat",
133
+ "tty-browserify": "0.0.1",
134
+ "url": "0.11.1",
135
+ "util": "0.12.5",
136
+ "vm-browserify": "1.1.2",
137
+ "webpack": "5.88.1",
138
+ "webpack-assets-manifest": "5.1.0",
139
+ "webpack-cli": "5.1.4",
140
+ "webpack-dev-server": "4.15.1",
141
+ "yup": "0.32.11"
142
+ },
143
+ "peerDependencies": {
144
+ "@bigbinary/neeto-commons-frontend": "latest",
145
+ "@bigbinary/neeto-editor": "^1.26.3",
146
+ "@bigbinary/neeto-icons": "^1.9.22",
147
+ "@bigbinary/neeto-molecules": "^1.0.9",
148
+ "@bigbinary/neetoui": "^4.4.10",
149
+ "@honeybadger-io/react": "^2.0.1",
150
+ "axios": "^0.27.2",
151
+ "classnames": "^2.3.2",
152
+ "formik": "^2.2.9",
153
+ "js-logger": "^1.6.1",
154
+ "mixpanel-browser": "^2.45.0",
155
+ "ramda": "^0.29.0",
156
+ "react": "17.0.2",
157
+ "react-dom": "17.0.2",
158
+ "react-helmet": "^6.1.0",
159
+ "react-query": "3.39.2",
160
+ "react-router-dom": "5.3.0",
161
+ "react-toastify": "8.2.0",
162
+ "yup": "^0.32.11",
163
+ "zustand": "4.3.2"
164
+ },
165
+ "resolutions": {
166
+ "postcss": "^8"
167
+ },
168
+ "engines": {
169
+ "node": ">=18.12",
170
+ "npm": ">=9",
171
+ "yarn": ">=1.22"
172
+ },
173
+ "dependencies": {
174
+ "@bigbinary/neeto-editor": "^1.28.9",
175
+ "@rails/actiontext": "^7.0.8",
176
+ "react-router-nav-prompt": "0.4.1",
177
+ "source-map-loader": "^4.0.1",
178
+ "trix": "^2.0.5",
179
+ "zustand": "4.3.2"
180
+ }
181
+ }
package/types.d.ts ADDED
@@ -0,0 +1,71 @@
1
+ import React from "react";
2
+ import { AnySchema } from 'yup';
3
+ import { TooltipProps } from "@bigbinary/neetoui";
4
+
5
+ type ContentVariables = {
6
+ label: string;
7
+ key: string;
8
+ }
9
+
10
+ type FieldOptions = {
11
+ label: string;
12
+ value: string;
13
+ }
14
+
15
+ type ValidationMap = {
16
+ [key: string]: AnySchema;
17
+ };
18
+
19
+ type EmailFormProps = {
20
+ messageVariables?: ContentVariables[];
21
+ subjectVariables?: ContentVariables[];
22
+ handleCancel: () => void;
23
+ isLoading?: boolean;
24
+ replyToOptions?: FieldOptions[],
25
+ isUpdating?: boolean,
26
+ showFields?: boolean,
27
+ className?: string,
28
+ }
29
+
30
+ type EmailFormikProps = {
31
+ showSendToField?: boolean;
32
+ showReplyToField?: boolean;
33
+ onSubmit: FormikConfig<T>['onSubmit'];
34
+ initialValues: T;
35
+ children: ReactNode;
36
+ formikProps: { [key: string]: any };
37
+ validationSchema?: ValidationMap;
38
+ }
39
+
40
+ type EmailPreviewProps = {
41
+ to?: string[];
42
+ subject?: string;
43
+ body?: string;
44
+ from?: string;
45
+ logo?: string;
46
+ productName?: string;
47
+ actionButtonText?: string;
48
+ className?: string;
49
+ }
50
+
51
+ type EmailNotificationParams = {
52
+ notificationHoldableId: string;
53
+ notificationHoldableType: string;
54
+ customFields?: { [key: string]: any };
55
+ }
56
+
57
+ interface EmailNotificationProps {
58
+ emailNotificationParams: EmailNotificationParams;
59
+ emailFormProps?: EmailFormProps;
60
+ emailFormikProps?: EmailFormikProps;
61
+ emailPreviewProps?: EmailPreviewProps;
62
+ tooltipProps?: TooltipProps;
63
+ title?: string;
64
+ subTitle?: string;
65
+ disabled?: boolean;
66
+ children?: React.ReactNode;
67
+ }
68
+
69
+ const NeetoEmailNotification: React.FC<EmailNotificationProps>;
70
+
71
+ export default NeetoEmailNotification