@bigbinary/neeto-pdf-frontend 1.0.1

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.
Files changed (82) hide show
  1. package/README.md +413 -0
  2. package/app/javascript/src/translations/ar.json +5 -0
  3. package/app/javascript/src/translations/bg.json +5 -0
  4. package/app/javascript/src/translations/ca.json +5 -0
  5. package/app/javascript/src/translations/cs.json +5 -0
  6. package/app/javascript/src/translations/da.json +5 -0
  7. package/app/javascript/src/translations/de.json +5 -0
  8. package/app/javascript/src/translations/en.json +109 -0
  9. package/app/javascript/src/translations/es-MX.json +5 -0
  10. package/app/javascript/src/translations/es.json +5 -0
  11. package/app/javascript/src/translations/et.json +5 -0
  12. package/app/javascript/src/translations/fi.json +5 -0
  13. package/app/javascript/src/translations/fil.json +5 -0
  14. package/app/javascript/src/translations/fr.json +5 -0
  15. package/app/javascript/src/translations/he.json +5 -0
  16. package/app/javascript/src/translations/hi.json +5 -0
  17. package/app/javascript/src/translations/hr.json +5 -0
  18. package/app/javascript/src/translations/hu.json +5 -0
  19. package/app/javascript/src/translations/id.json +5 -0
  20. package/app/javascript/src/translations/index.js +3 -0
  21. package/app/javascript/src/translations/it.json +5 -0
  22. package/app/javascript/src/translations/ja.json +5 -0
  23. package/app/javascript/src/translations/ko.json +5 -0
  24. package/app/javascript/src/translations/nl.json +5 -0
  25. package/app/javascript/src/translations/pl.json +5 -0
  26. package/app/javascript/src/translations/pt-BR.json +5 -0
  27. package/app/javascript/src/translations/pt.json +5 -0
  28. package/app/javascript/src/translations/ro.json +5 -0
  29. package/app/javascript/src/translations/ru.json +5 -0
  30. package/app/javascript/src/translations/sk.json +5 -0
  31. package/app/javascript/src/translations/sl.json +5 -0
  32. package/app/javascript/src/translations/sv.json +5 -0
  33. package/app/javascript/src/translations/th.json +5 -0
  34. package/app/javascript/src/translations/tr.json +5 -0
  35. package/app/javascript/src/translations/uk.json +5 -0
  36. package/app/javascript/src/translations/vi.json +5 -0
  37. package/app/javascript/src/translations/zh-CN.json +5 -0
  38. package/app/javascript/src/translations/zh-TW.json +5 -0
  39. package/dist/.ready +1 -0
  40. package/dist/AttachmentCard-75GY2Thb.js +64 -0
  41. package/dist/AttachmentCard-75GY2Thb.js.map +1 -0
  42. package/dist/AttachmentCard-D_Gp0f5r.js +67 -0
  43. package/dist/AttachmentCard-D_Gp0f5r.js.map +1 -0
  44. package/dist/FilenameUtilities-Cw9Tvd6k.js +329 -0
  45. package/dist/FilenameUtilities-Cw9Tvd6k.js.map +1 -0
  46. package/dist/FilenameUtilities-De2k_NXh.js +318 -0
  47. package/dist/FilenameUtilities-De2k_NXh.js.map +1 -0
  48. package/dist/IconBlock-BTPLDDiO.js +15 -0
  49. package/dist/IconBlock-BTPLDDiO.js.map +1 -0
  50. package/dist/IconBlock-hZ_gOnb1.js +17 -0
  51. package/dist/IconBlock-hZ_gOnb1.js.map +1 -0
  52. package/dist/PdfAttachmentSelector.js +94 -0
  53. package/dist/PdfAttachmentSelector.js.map +1 -0
  54. package/dist/PdfAttachmentsPreview.js +43 -0
  55. package/dist/PdfAttachmentsPreview.js.map +1 -0
  56. package/dist/PdfDocumentsPage.js +555 -0
  57. package/dist/PdfDocumentsPage.js.map +1 -0
  58. package/dist/PdfEditorPage.js +2051 -0
  59. package/dist/PdfEditorPage.js.map +1 -0
  60. package/dist/cjs/PdfAttachmentSelector.js +96 -0
  61. package/dist/cjs/PdfAttachmentSelector.js.map +1 -0
  62. package/dist/cjs/PdfAttachmentsPreview.js +45 -0
  63. package/dist/cjs/PdfAttachmentsPreview.js.map +1 -0
  64. package/dist/cjs/PdfDocumentsPage.js +557 -0
  65. package/dist/cjs/PdfDocumentsPage.js.map +1 -0
  66. package/dist/cjs/PdfEditorPage.js +2072 -0
  67. package/dist/cjs/PdfEditorPage.js.map +1 -0
  68. package/dist/cjs/index.js +75 -0
  69. package/dist/cjs/index.js.map +1 -0
  70. package/dist/constants-CTDOz942.js +5 -0
  71. package/dist/constants-CTDOz942.js.map +1 -0
  72. package/dist/constants-DvvJYjxW.js +8 -0
  73. package/dist/constants-DvvJYjxW.js.map +1 -0
  74. package/dist/index.js +66 -0
  75. package/dist/index.js.map +1 -0
  76. package/package.json +240 -0
  77. package/types/PdfAttachmentSelector.d.ts +2 -0
  78. package/types/PdfAttachmentsPreview.d.ts +2 -0
  79. package/types/PdfDocumentsPage.d.ts +6 -0
  80. package/types/PdfEditorPage.d.ts +7 -0
  81. package/types/index.d.ts +88 -0
  82. package/types.d.ts +1 -0
package/package.json ADDED
@@ -0,0 +1,240 @@
1
+ {
2
+ "name": "@bigbinary/neeto-pdf-frontend",
3
+ "version": "1.0.1",
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/neetozone/neeto-pdf-nano",
7
+ "bugs": {
8
+ "url": "https://github.com/neetozone/neeto-pdf-nano/issues"
9
+ },
10
+ "repository": "git@github.com:neetozone/neeto-pdf-nano.git",
11
+ "author": "BigBinary",
12
+ "files": [
13
+ "dist",
14
+ "types",
15
+ "types.d.ts",
16
+ "app/javascript/src/translations"
17
+ ],
18
+ "exports": {
19
+ ".": {
20
+ "types": "./types.d.ts",
21
+ "import": "./dist/index.js",
22
+ "require": "./dist/cjs/index.js"
23
+ },
24
+ "./*": {
25
+ "types": "./types/*.d.ts",
26
+ "import": "./dist/*.js",
27
+ "require": "./dist/cjs/*.js"
28
+ }
29
+ },
30
+ "main": "dist/cjs/index.js",
31
+ "module": "dist/index.js",
32
+ "types": "types.d.ts",
33
+ "scripts": {
34
+ "build": "NODE_ENV=production rollup --bundleConfigAsCjs -c --environment production",
35
+ "build-preview": "NODE_ENV=production webpack",
36
+ "prepare": "husky install",
37
+ "release": "yarn build && yalc push --sig",
38
+ "sync:pdf-worker": "mkdir -p public && cp -f node_modules/pdfjs-dist/build/pdf.worker.min.mjs public/pdf.worker.min.js"
39
+ },
40
+ "lint-staged": {
41
+ "./**/*.rb": [
42
+ "bundle exec rubocop -a --force-exclusion"
43
+ ],
44
+ "./**/app/javascript/**/*.{js,jsx,json}": [
45
+ "prettier --write",
46
+ "eslint --fix"
47
+ ],
48
+ "./test/dummy/**/app/javascript/**/*.{js,jsx,json}": [
49
+ "prettier --write",
50
+ "eslint --fix"
51
+ ],
52
+ "{Gemfile,Rakefile,config.ru}": [
53
+ "bundle exec rubocop -a --force-exclusion"
54
+ ]
55
+ },
56
+ "devDependencies": {
57
+ "@babel/core": "7.29.7",
58
+ "@babel/eslint-parser": "7.25.9",
59
+ "@babel/plugin-transform-runtime": "7.25.9",
60
+ "@babel/preset-env": "7.26.0",
61
+ "@babel/preset-react": "7.25.9",
62
+ "@babel/preset-typescript": "7.26.0",
63
+ "@babel/runtime": "7.29.7",
64
+ "@bigbinary/babel-preset-neeto": "^1.0.3",
65
+ "@bigbinary/eslint-plugin-neeto": "1.9.1",
66
+ "@bigbinary/neeto-cist": "1.0.17",
67
+ "@bigbinary/neeto-commons-frontend": "4.13.144",
68
+ "@bigbinary/neeto-filters-frontend": "4.3.42",
69
+ "@bigbinary/neeto-icons": "1.20.89",
70
+ "@bigbinary/neeto-molecules": "5.2.6",
71
+ "@bigbinary/neetoui": "8.8.3",
72
+ "@emotion/is-prop-valid": "1.2.0",
73
+ "@faker-js/faker": "8.2.0",
74
+ "@honeybadger-io/js": "6.10.1",
75
+ "@honeybadger-io/react": "6.1.25",
76
+ "@rollup/plugin-alias": "5.1.1",
77
+ "@rollup/plugin-babel": "6.1.0",
78
+ "@rollup/plugin-commonjs": "25.0.8",
79
+ "@rollup/plugin-json": "6.1.0",
80
+ "@rollup/plugin-node-resolve": "15.3.0",
81
+ "@rollup/plugin-replace": "5.0.4",
82
+ "@svgr/rollup": "8.1.0",
83
+ "@tailwindcss/postcss": "^4.1.17",
84
+ "@tanstack/react-query": "5.59.20",
85
+ "@tanstack/react-query-devtools": "5.59.20",
86
+ "antd": "5.22.1",
87
+ "autoprefixer": "^10.4.5",
88
+ "axios": "1.18.0",
89
+ "babel-loader": "^8.2.5",
90
+ "babel-plugin-istanbul": "^6.1.1",
91
+ "babel-plugin-js-logger": "1.0.17",
92
+ "babel-plugin-macros": "3.1.0",
93
+ "babel-plugin-module-resolver": "5.0.3",
94
+ "babel-plugin-preval": "^5.1.0",
95
+ "babel-plugin-transform-react-remove-prop-types": "0.4.24",
96
+ "babel-preset-react": "6.24.1",
97
+ "babel-preset-typescript": "^7.0.0-alpha.19",
98
+ "browserify-zlib": "0.2.0",
99
+ "buffer": "^6.0.3",
100
+ "classnames": "2.5.1",
101
+ "crypto-browserify": "3.12.1",
102
+ "css-loader": "6.8.1",
103
+ "dompurify": "3.4.11",
104
+ "dotenv-webpack": "^8.0.1",
105
+ "eslint": "^9.25.1",
106
+ "eslint-config-prettier": "^10.1.2",
107
+ "eslint-plugin-cypress": "2.12.1",
108
+ "eslint-plugin-import": "^2.31.0",
109
+ "eslint-plugin-jam3": "^0.2.3",
110
+ "eslint-plugin-json": "^4.0.1",
111
+ "eslint-plugin-prettier": "^5.2.6",
112
+ "eslint-plugin-promise": "^7.2.1",
113
+ "eslint-plugin-react": "^7.37.5",
114
+ "eslint-plugin-react-hooks": "^5.2.0",
115
+ "eslint-plugin-security": "^3.0.1",
116
+ "eslint-plugin-sonarjs": "^4.0.2",
117
+ "eslint-plugin-unused-imports": "^4.1.4",
118
+ "eslint-plugin-xss": "^0.1.12",
119
+ "formik": "2.4.6",
120
+ "globals": "16.0.0",
121
+ "globby": "^14.1.0",
122
+ "html-webpack-plugin": "5.5.3",
123
+ "https-browserify": "1.0.0",
124
+ "husky": "7.0.4",
125
+ "i18next": "22.5.1",
126
+ "i18next-browser-languagedetector": "7.0.1",
127
+ "js-logger": "1.6.1",
128
+ "lint-staged": "12.4.1",
129
+ "mini-css-extract-plugin": "2.7.6",
130
+ "mixpanel-browser": "2.47.0",
131
+ "os-browserify": "0.3.0",
132
+ "path-browserify": "^1.0.1",
133
+ "pdf-lib": "1.17.1",
134
+ "pdfjs-dist": "6.1.200",
135
+ "postcss": "8.5.15",
136
+ "postcss-import": "^15.0.0",
137
+ "postcss-loader": "^7.0.1",
138
+ "postcss-preset-env": "7.8.2",
139
+ "prettier": "3",
140
+ "prettier-plugin-tailwindcss": "^0.7.1",
141
+ "process": "0.11.10",
142
+ "qs": "6.15.2",
143
+ "ramda": "0.29.0",
144
+ "react": "18.3.1",
145
+ "react-dom": "18.3.1",
146
+ "react-helmet": "^6.1.0",
147
+ "react-i18next": "12.3.1",
148
+ "react-router-dom": "5.3.3",
149
+ "react-toastify": "8.0.2",
150
+ "rollup": "4.59.0",
151
+ "rollup-plugin-analyzer": "4.0.0",
152
+ "rollup-plugin-cleaner": "1.0.0",
153
+ "rollup-plugin-copy": "3.5.0",
154
+ "rollup-plugin-peer-deps-external": "2.2.4",
155
+ "rollup-plugin-styles": "4.0.0",
156
+ "sass": "1.98.0",
157
+ "sass-loader": "^13.0.2",
158
+ "source-map-loader": "4.0.1",
159
+ "stream-browserify": "^3.0.0",
160
+ "stream-http": "3.2.0",
161
+ "style-loader": "^3.3.1",
162
+ "tailwindcss": "^4.1.17",
163
+ "tty-browserify": "0.0.1",
164
+ "url": "0.11.4",
165
+ "util": "^0.12.5",
166
+ "vm-browserify": "1.1.2",
167
+ "webpack": "5.104.1",
168
+ "webpack-assets-manifest": "5.1.0",
169
+ "webpack-cli": "5.1.4",
170
+ "webpack-dev-server": "5.2.5",
171
+ "yup": "0.32.11",
172
+ "zustand": "4.4.2"
173
+ },
174
+ "peerDependencies": {
175
+ "@babel/runtime": "7.29.7",
176
+ "@bigbinary/neeto-cist": "1.0.17",
177
+ "@bigbinary/neeto-commons-frontend": "4.13.144",
178
+ "@bigbinary/neeto-filters-frontend": "4.3.42",
179
+ "@bigbinary/neeto-icons": "1.20.89",
180
+ "@bigbinary/neeto-molecules": "5.2.6",
181
+ "@bigbinary/neetoui": "8.8.3",
182
+ "@honeybadger-io/js": "6.10.1",
183
+ "@honeybadger-io/react": "6.1.25",
184
+ "@tanstack/react-query": "5.59.20",
185
+ "@tanstack/react-query-devtools": "5.59.20",
186
+ "antd": "5.22.1",
187
+ "axios": "1.18.0",
188
+ "buffer": "^6.0.3",
189
+ "classnames": "2.5.1",
190
+ "crypto-browserify": "3.12.1",
191
+ "dompurify": "3.4.11",
192
+ "formik": "2.4.6",
193
+ "https-browserify": "1.0.0",
194
+ "i18next": "22.5.1",
195
+ "js-logger": "1.6.1",
196
+ "mixpanel-browser": "2.45.0",
197
+ "os-browserify": "0.3.0",
198
+ "path-browserify": "^1.0.1",
199
+ "pdf-lib": "1.17.1",
200
+ "pdfjs-dist": "6.1.200",
201
+ "qs": "6.15.2",
202
+ "ramda": "0.29.0",
203
+ "react": "18.3.1",
204
+ "react-dom": "18.3.1",
205
+ "react-helmet": "^6.1.0",
206
+ "react-i18next": "12.3.1",
207
+ "react-router-dom": "5.3.3",
208
+ "react-toastify": "8.0.2",
209
+ "source-map-loader": "4.0.1",
210
+ "stream-browserify": "^3.0.0",
211
+ "stream-http": "3.2.0",
212
+ "tailwindcss": "4.1.17",
213
+ "tty-browserify": "0.0.1",
214
+ "url": "0.11.4",
215
+ "util": "^0.12.5",
216
+ "vm-browserify": "1.1.2",
217
+ "yup": "0.32.11",
218
+ "zustand": "4.4.2"
219
+ },
220
+ "resolutions": {
221
+ "postcss": "^8",
222
+ "wrap-ansi": "7.0.0",
223
+ "string-width": "4.1.0",
224
+ "pbkdf2": "^3.1.3",
225
+ "sha.js": "^2.4.12",
226
+ "node-forge": "^1.3.2",
227
+ "qs": "6.14.2"
228
+ },
229
+ "engines": {
230
+ "node": ">=22.13",
231
+ "npm": ">=9",
232
+ "yarn": ">=1.22"
233
+ },
234
+ "dependencies": {
235
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
236
+ "babel-plugin-transform-imports": "^2.0.0",
237
+ "react-router-nav-prompt": "0.4.1"
238
+ },
239
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
240
+ }
@@ -0,0 +1,2 @@
1
+ export { PdfAttachmentSelector as default } from "./index";
2
+ export type { PdfAttachmentsProps, PdfDocument, PdfDocumentId } from "./index";
@@ -0,0 +1,2 @@
1
+ export { PdfAttachmentsPreview as default } from "./index";
2
+ export type { PdfAttachmentsProps, PdfDocument, PdfDocumentId } from "./index";
@@ -0,0 +1,6 @@
1
+ export { PdfDocumentsPage as default } from "./index";
2
+ export type {
3
+ PdfDocument,
4
+ PdfDocumentId,
5
+ PdfDocumentsPageProps,
6
+ } from "./index";
@@ -0,0 +1,7 @@
1
+ export { PdfEditorPage as default } from "./index";
2
+ export type {
3
+ PdfDocumentId,
4
+ PdfEditorField,
5
+ PdfEditorPageProps,
6
+ PdfPreviewRecord,
7
+ } from "./index";
@@ -0,0 +1,88 @@
1
+ import React from "react";
2
+
3
+ export type PdfDocumentId = string | number;
4
+
5
+ export interface PdfDocumentTemplateFile {
6
+ filename?: string;
7
+ byteSize?: number;
8
+ contentType?: string;
9
+ url?: string;
10
+ [key: string]: unknown;
11
+ }
12
+
13
+ export interface PdfDocument {
14
+ id: PdfDocumentId;
15
+ name?: string;
16
+ outputFilename?: string;
17
+ status?: string;
18
+ mappings?: Array<Record<string, unknown>>;
19
+ templateFile?: PdfDocumentTemplateFile | null;
20
+ [key: string]: unknown;
21
+ }
22
+
23
+ export interface PdfDocumentsPageProps {
24
+ apiBaseUrl: string;
25
+ ownerId: PdfDocumentId;
26
+ canManage?: boolean;
27
+ selectedPdfDocumentIds?: PdfDocumentId[];
28
+ emailRoutes?: {
29
+ submitter?: string;
30
+ receiver?: string;
31
+ };
32
+ onOpenEditor?: (document: PdfDocument) => void;
33
+ renderHeader?: (args: {
34
+ actionBlock: React.ReactNode;
35
+ title: string;
36
+ }) => React.ReactNode;
37
+ renderContent?: (content: React.ReactNode) => React.ReactNode;
38
+ }
39
+
40
+ export interface PdfEditorField {
41
+ id?: PdfDocumentId;
42
+ key?: string;
43
+ recordId?: PdfDocumentId | null;
44
+ slug?: string;
45
+ label?: string;
46
+ kind?: string;
47
+ icon?: React.ElementType;
48
+ typeLabel?: string;
49
+ [key: string]: unknown;
50
+ }
51
+
52
+ export interface PdfPreviewRecord {
53
+ id?: PdfDocumentId;
54
+ createdAt?: string;
55
+ responses?: Array<{
56
+ slug?: string;
57
+ value?: unknown;
58
+ [key: string]: unknown;
59
+ }>;
60
+ [key: string]: unknown;
61
+ }
62
+
63
+ export interface PdfEditorPageProps {
64
+ apiBaseUrl: string;
65
+ ownerId: PdfDocumentId;
66
+ documentId: PdfDocumentId;
67
+ canManage?: boolean;
68
+ fields?: PdfEditorField[];
69
+ ownerRecord?: Record<string, unknown>;
70
+ previewRecord?: PdfPreviewRecord;
71
+ previewTotal?: number;
72
+ previewPage?: number;
73
+ isPreviewLoading?: boolean;
74
+ mode?: string;
75
+ homeUrl?: string;
76
+ onBack?: () => void;
77
+ onModeChange?: (mode: string) => void;
78
+ onPreviewPageChange?: (page: number) => void;
79
+ }
80
+
81
+ export interface PdfAttachmentsProps {
82
+ documents?: PdfDocument[];
83
+ }
84
+
85
+ export const PdfAttachmentSelector: React.FC<PdfAttachmentsProps>;
86
+ export const PdfAttachmentsPreview: React.FC<PdfAttachmentsProps>;
87
+ export const PdfDocumentsPage: React.FC<PdfDocumentsPageProps>;
88
+ export const PdfEditorPage: React.FC<PdfEditorPageProps>;
package/types.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./types/index";