@bigbinary/neeto-fields-frontend 1.0.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/package.json ADDED
@@ -0,0 +1,178 @@
1
+ {
2
+ "name": "@bigbinary/neeto-fields-frontend",
3
+ "version": "1.0.2",
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-fields-nano",
7
+ "bugs": {
8
+ "url": "https://github.com/bigbinary/neeto-fields-nano/issues"
9
+ },
10
+ "repository": "neeto-fields-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.21.5",
43
+ "@babel/eslint-parser": "7.21.3",
44
+ "@babel/plugin-transform-runtime": "7.21.4",
45
+ "@babel/preset-env": "7.21.5",
46
+ "@babel/preset-react": "7.18.6",
47
+ "@babel/preset-typescript": "7.21.5",
48
+ "@babel/runtime": "7.21.5",
49
+ "@bigbinary/babel-preset-neeto": "1.0.3",
50
+ "@bigbinary/eslint-plugin-neeto": "1.0.41",
51
+ "@bigbinary/neeto-commons-frontend": "^2.0.73",
52
+ "@bigbinary/neeto-icons": "^1.11.0",
53
+ "@bigbinary/neeto-molecules": "^1.0.30",
54
+ "@bigbinary/neetoui": "^5.0.14",
55
+ "@emotion/is-prop-valid": "1.2.0",
56
+ "@faker-js/faker": "7.6.0",
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": "24.1.0",
61
+ "@rollup/plugin-json": "6.0.0",
62
+ "@rollup/plugin-node-resolve": "^15.0.2",
63
+ "@rollup/plugin-replace": "5.0.2",
64
+ "@svgr/rollup": "7.0.0",
65
+ "antd": "4.24.3",
66
+ "autoprefixer": "10.4.14",
67
+ "axios": "0.27.2",
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.7.1",
80
+ "dompurify": "3.0.2",
81
+ "dotenv-webpack": "^8.0.1",
82
+ "eslint": "8.39.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.2.9",
94
+ "html-webpack-plugin": "5.5.0",
95
+ "https-browserify": "^1.0.0",
96
+ "husky": "8.0.3",
97
+ "i18next": "22.4.10",
98
+ "i18next-browser-languagedetector": "7.0.1",
99
+ "js-logger": "1.6.1",
100
+ "lint-staged": "13.2.2",
101
+ "mini-css-extract-plugin": "^2.6.1",
102
+ "mixpanel-browser": "2.46.0",
103
+ "os-browserify": "^0.3.0",
104
+ "path-browserify": "^1.0.1",
105
+ "postcss": "8.4.23",
106
+ "postcss-import": "15.1.0",
107
+ "postcss-loader": "7.3.0",
108
+ "postcss-preset-env": "8.3.2",
109
+ "prettier": "2.8.8",
110
+ "prettier-plugin-tailwindcss": "0.2.8",
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": "11.16.8",
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.62.1",
127
+ "sass-loader": "^13.0.2",
128
+ "shakapacker": "^6.6.0",
129
+ "stream-browserify": "^3.0.0",
130
+ "stream-http": "^3.2.0",
131
+ "style-loader": "^3.3.1",
132
+ "tailwindcss": "npm:@tailwindcss/postcss7-compat",
133
+ "tty-browserify": "^0.0.1",
134
+ "url": "^0.11.0",
135
+ "util": "0.12.5",
136
+ "vm-browserify": "^1.1.2",
137
+ "webpack": "5.76.0",
138
+ "webpack-assets-manifest": "^5.1.0",
139
+ "webpack-cli": "4.10.0",
140
+ "webpack-dev-server": "^4.15.0",
141
+ "yup": "0.32.11"
142
+ },
143
+ "peerDependencies": {
144
+ "@bigbinary/neeto-commons-frontend": "^2.0.54",
145
+ "@bigbinary/neeto-editor": "^1.26.3",
146
+ "@bigbinary/neeto-icons": "^1.9.22",
147
+ "@bigbinary/neeto-molecules": "^1.0.9",
148
+ "@bigbinary/neetoui": "latest",
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
+ "react-router-nav-prompt": "0.4.1",
175
+ "source-map-loader": "^4.0.1",
176
+ "zustand": "4.3.2"
177
+ }
178
+ }
package/types.d.ts ADDED
@@ -0,0 +1,87 @@
1
+ import React from "react";
2
+
3
+ import { UseQueryResult, UseQueryOptions } from "react-query";
4
+
5
+ interface KeyValuePair {
6
+ [key: string]: any;
7
+ }
8
+
9
+ interface PaneProps {
10
+ children: React.ReactNode;
11
+ validations?: KeyValuePair;
12
+ }
13
+
14
+ interface FieldsDashboardProps {
15
+ rowData?: any[];
16
+ additionalColumnData?: any[];
17
+ showOwnersInMenu?: boolean;
18
+ resourceType?: string;
19
+ allowedKinds?: string[];
20
+ paneProps?: PaneProps;
21
+ }
22
+
23
+ interface AddFieldProps {
24
+ resourceType: string;
25
+ allowedKinds?: string[];
26
+ additionalValidations?: KeyValuePair;
27
+ children?: React.ReactNode;
28
+ }
29
+
30
+ interface EditProps {
31
+ fieldId: string;
32
+ allowedKinds: string[];
33
+ onClose: (values: any) => void;
34
+ children?: React.ReactNode;
35
+ additionalValidations?: KeyValuePair;
36
+ }
37
+
38
+ interface AddProps {
39
+ resourceType: string;
40
+ allowedKinds: string[];
41
+ onClose: () => void;
42
+ children?: React.ReactNode;
43
+ additionalValidations?: KeyValuePair;
44
+ }
45
+ interface FieldsPaneProps {
46
+ allowedKinds: string[];
47
+ isOpen: boolean;
48
+ resourceType: string;
49
+ onClose: () => void;
50
+ additionalValidations?: KeyValuePair;
51
+ selectedField?: KeyValuePair;
52
+ children?: React.ReactNode;
53
+ }
54
+ interface FieldFormProps {
55
+ chosenKind: string[];
56
+ kindSelectOptions: KeyValuePair[];
57
+ children?: React.ReactNode;
58
+ }
59
+
60
+ interface FieldValuesContainerProps {
61
+ resourceType: string;
62
+ fieldValues: KeyValuePair[];
63
+ resourceId: string;
64
+ ownerId?: string;
65
+ queryKeysToBeInvalidatedOnSuccess?: string[];
66
+ customComponents?: KeyValuePair;
67
+ className?: string;
68
+ }
69
+
70
+ interface FieldInputsProps {
71
+ fields: KeyValuePair[];
72
+ customComponents?: KeyValuePair;
73
+ }
74
+
75
+ export const FieldsDashboard = React.FC<FieldsDashboardProps>;
76
+ export const AddField = React.FC<AddFieldProps>;
77
+ export const FieldValuesContainer = React.FC<FieldValuesContainerProps>;
78
+ export const FieldInputs = React.FC<FieldInputsProps>;
79
+
80
+ export const useFetchFields: (options?: UseQueryOptions) => UseQueryResult;
81
+ export const neetoFieldsUtils: {
82
+ transformValues: (values: KeyValuePair) => void;
83
+ mergeInitialValues: (args: {
84
+ initialValues: KeyValuePair;
85
+ fields: KeyValuePair[];
86
+ }) => KeyValuePair;
87
+ };