@seshuk/payload-media-preview 1.0.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.
Files changed (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +507 -0
  3. package/dist/components/Cell/Cell.client.d.ts +18 -0
  4. package/dist/components/Cell/Cell.client.js +131 -0
  5. package/dist/components/Cell/Cell.scss +43 -0
  6. package/dist/components/Cell/Cell.server.d.ts +11 -0
  7. package/dist/components/Cell/Cell.server.js +33 -0
  8. package/dist/components/ExternalLinkIcon/ExternalLinkIcon.d.ts +5 -0
  9. package/dist/components/ExternalLinkIcon/ExternalLinkIcon.js +17 -0
  10. package/dist/components/ExternalLinkIcon/ExternalLinkIcon.scss +19 -0
  11. package/dist/components/Field/Field.d.ts +18 -0
  12. package/dist/components/Field/Field.js +107 -0
  13. package/dist/components/Field/Field.scss +14 -0
  14. package/dist/components/MediaPreview.constants.d.ts +4 -0
  15. package/dist/components/MediaPreview.constants.js +28 -0
  16. package/dist/components/MediaPreview.d.ts +10 -0
  17. package/dist/components/MediaPreview.js +57 -0
  18. package/dist/components/MediaPreview.types.d.ts +2 -0
  19. package/dist/components/MediaPreview.types.js +1 -0
  20. package/dist/components/MediaPreview.utils.d.ts +6 -0
  21. package/dist/components/MediaPreview.utils.js +38 -0
  22. package/dist/components/Modal/Modal.constants.d.ts +16 -0
  23. package/dist/components/Modal/Modal.constants.js +16 -0
  24. package/dist/components/Modal/Modal.d.ts +19 -0
  25. package/dist/components/Modal/Modal.js +277 -0
  26. package/dist/components/Modal/Modal.scss +173 -0
  27. package/dist/components/Viewer/AudioViewer.d.ts +3 -0
  28. package/dist/components/Viewer/AudioViewer.js +24 -0
  29. package/dist/components/Viewer/IframeViewer.d.ts +3 -0
  30. package/dist/components/Viewer/IframeViewer.js +14 -0
  31. package/dist/components/Viewer/ImageViewer.d.ts +3 -0
  32. package/dist/components/Viewer/ImageViewer.js +10 -0
  33. package/dist/components/Viewer/VideoViewer.d.ts +3 -0
  34. package/dist/components/Viewer/VideoViewer.js +25 -0
  35. package/dist/components/Viewer/Viewer.d.ts +12 -0
  36. package/dist/components/Viewer/Viewer.js +50 -0
  37. package/dist/components/adapterResolver.d.ts +13 -0
  38. package/dist/components/adapterResolver.js +43 -0
  39. package/dist/exports/client.d.ts +5 -0
  40. package/dist/exports/client.js +5 -0
  41. package/dist/exports/rsc.d.ts +2 -0
  42. package/dist/exports/rsc.js +2 -0
  43. package/dist/field.d.ts +18 -0
  44. package/dist/field.js +36 -0
  45. package/dist/index.d.ts +6 -0
  46. package/dist/index.js +90 -0
  47. package/dist/translations/index.d.ts +8 -0
  48. package/dist/translations/index.js +90 -0
  49. package/dist/translations/locales/ar.d.ts +2 -0
  50. package/dist/translations/locales/ar.js +11 -0
  51. package/dist/translations/locales/az.d.ts +2 -0
  52. package/dist/translations/locales/az.js +11 -0
  53. package/dist/translations/locales/bg.d.ts +2 -0
  54. package/dist/translations/locales/bg.js +11 -0
  55. package/dist/translations/locales/bnBd.d.ts +2 -0
  56. package/dist/translations/locales/bnBd.js +11 -0
  57. package/dist/translations/locales/bnIn.d.ts +2 -0
  58. package/dist/translations/locales/bnIn.js +11 -0
  59. package/dist/translations/locales/ca.d.ts +2 -0
  60. package/dist/translations/locales/ca.js +11 -0
  61. package/dist/translations/locales/cs.d.ts +2 -0
  62. package/dist/translations/locales/cs.js +11 -0
  63. package/dist/translations/locales/da.d.ts +2 -0
  64. package/dist/translations/locales/da.js +11 -0
  65. package/dist/translations/locales/de.d.ts +2 -0
  66. package/dist/translations/locales/de.js +11 -0
  67. package/dist/translations/locales/en.d.ts +2 -0
  68. package/dist/translations/locales/en.js +11 -0
  69. package/dist/translations/locales/es.d.ts +2 -0
  70. package/dist/translations/locales/es.js +11 -0
  71. package/dist/translations/locales/et.d.ts +2 -0
  72. package/dist/translations/locales/et.js +11 -0
  73. package/dist/translations/locales/fa.d.ts +2 -0
  74. package/dist/translations/locales/fa.js +11 -0
  75. package/dist/translations/locales/fr.d.ts +2 -0
  76. package/dist/translations/locales/fr.js +11 -0
  77. package/dist/translations/locales/he.d.ts +2 -0
  78. package/dist/translations/locales/he.js +11 -0
  79. package/dist/translations/locales/hr.d.ts +2 -0
  80. package/dist/translations/locales/hr.js +11 -0
  81. package/dist/translations/locales/hu.d.ts +2 -0
  82. package/dist/translations/locales/hu.js +11 -0
  83. package/dist/translations/locales/hy.d.ts +2 -0
  84. package/dist/translations/locales/hy.js +11 -0
  85. package/dist/translations/locales/id.d.ts +2 -0
  86. package/dist/translations/locales/id.js +11 -0
  87. package/dist/translations/locales/is.d.ts +2 -0
  88. package/dist/translations/locales/is.js +11 -0
  89. package/dist/translations/locales/it.d.ts +2 -0
  90. package/dist/translations/locales/it.js +11 -0
  91. package/dist/translations/locales/ja.d.ts +2 -0
  92. package/dist/translations/locales/ja.js +11 -0
  93. package/dist/translations/locales/ko.d.ts +2 -0
  94. package/dist/translations/locales/ko.js +11 -0
  95. package/dist/translations/locales/lt.d.ts +2 -0
  96. package/dist/translations/locales/lt.js +11 -0
  97. package/dist/translations/locales/lv.d.ts +2 -0
  98. package/dist/translations/locales/lv.js +11 -0
  99. package/dist/translations/locales/my.d.ts +2 -0
  100. package/dist/translations/locales/my.js +11 -0
  101. package/dist/translations/locales/nb.d.ts +2 -0
  102. package/dist/translations/locales/nb.js +11 -0
  103. package/dist/translations/locales/nl.d.ts +2 -0
  104. package/dist/translations/locales/nl.js +11 -0
  105. package/dist/translations/locales/pl.d.ts +2 -0
  106. package/dist/translations/locales/pl.js +11 -0
  107. package/dist/translations/locales/pt.d.ts +2 -0
  108. package/dist/translations/locales/pt.js +11 -0
  109. package/dist/translations/locales/ro.d.ts +2 -0
  110. package/dist/translations/locales/ro.js +11 -0
  111. package/dist/translations/locales/rs.d.ts +2 -0
  112. package/dist/translations/locales/rs.js +11 -0
  113. package/dist/translations/locales/rsLatin.d.ts +2 -0
  114. package/dist/translations/locales/rsLatin.js +11 -0
  115. package/dist/translations/locales/ru.d.ts +2 -0
  116. package/dist/translations/locales/ru.js +11 -0
  117. package/dist/translations/locales/sk.d.ts +2 -0
  118. package/dist/translations/locales/sk.js +11 -0
  119. package/dist/translations/locales/sl.d.ts +2 -0
  120. package/dist/translations/locales/sl.js +11 -0
  121. package/dist/translations/locales/sv.d.ts +2 -0
  122. package/dist/translations/locales/sv.js +11 -0
  123. package/dist/translations/locales/ta.d.ts +2 -0
  124. package/dist/translations/locales/ta.js +11 -0
  125. package/dist/translations/locales/th.d.ts +2 -0
  126. package/dist/translations/locales/th.js +11 -0
  127. package/dist/translations/locales/tr.d.ts +2 -0
  128. package/dist/translations/locales/tr.js +11 -0
  129. package/dist/translations/locales/uk.d.ts +2 -0
  130. package/dist/translations/locales/uk.js +11 -0
  131. package/dist/translations/locales/vi.d.ts +2 -0
  132. package/dist/translations/locales/vi.js +11 -0
  133. package/dist/translations/locales/zh.d.ts +2 -0
  134. package/dist/translations/locales/zh.js +11 -0
  135. package/dist/translations/locales/zhTw.d.ts +2 -0
  136. package/dist/translations/locales/zhTw.js +11 -0
  137. package/dist/translations/types.d.ts +11 -0
  138. package/dist/translations/types.js +1 -0
  139. package/dist/types.d.ts +130 -0
  140. package/dist/types.js +2 -0
  141. package/dist/utils/insertField.d.ts +3 -0
  142. package/dist/utils/insertField.js +97 -0
  143. package/package.json +121 -0
package/package.json ADDED
@@ -0,0 +1,121 @@
1
+ {
2
+ "name": "@seshuk/payload-media-preview",
3
+ "version": "1.0.0",
4
+ "description": "Payload plugin for previewing images, videos, audio, and documents in the admin panel",
5
+ "author": "Maxim Seshuk",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "./src/index.ts",
9
+ "types": "./src/index.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./src/index.ts",
13
+ "types": "./src/index.ts",
14
+ "default": "./src/index.ts"
15
+ },
16
+ "./client": {
17
+ "import": "./src/exports/client.ts",
18
+ "types": "./src/exports/client.ts",
19
+ "default": "./src/exports/client.ts"
20
+ },
21
+ "./rsc": {
22
+ "import": "./src/exports/rsc.ts",
23
+ "types": "./src/exports/rsc.ts",
24
+ "default": "./src/exports/rsc.ts"
25
+ },
26
+ "./*": "./*"
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "scripts": {
32
+ "clean": "rimraf {dist,*.tsbuildinfo}",
33
+ "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
34
+ "build:types": "tsc --project tsconfig.build.json",
35
+ "build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
36
+ "build": "pnpm clean && pnpm copyfiles && pnpm build:types && pnpm build:swc",
37
+ "typecheck": "tsc --noEmit",
38
+ "lint": "eslint",
39
+ "lint:fix": "eslint ./src --fix",
40
+ "format": "prettier --write .",
41
+ "format:check": "prettier --check .",
42
+ "dev": "cross-env PAYLOAD_CONFIG_PATH=./tests/payload.config.ts next dev tests --turbo",
43
+ "dev:generate-importmap": "cd tests && cross-env PAYLOAD_CONFIG_PATH=./payload.config.ts payload generate:importmap",
44
+ "test": "vitest run",
45
+ "test:watch": "vitest",
46
+ "test:e2e": "playwright test",
47
+ "test:e2e:ui": "playwright test --ui",
48
+ "prepublishOnly": "pnpm clean && pnpm build"
49
+ },
50
+ "devDependencies": {
51
+ "@next/env": "^16.1.6",
52
+ "@payloadcms/db-mongodb": "^3.79.0",
53
+ "@payloadcms/eslint-config": "^3.28.0",
54
+ "@payloadcms/next": "^3.79.0",
55
+ "@payloadcms/translations": "^3.79.0",
56
+ "@payloadcms/ui": "^3.79.0",
57
+ "@playwright/test": "^1.58.2",
58
+ "@stylistic/eslint-plugin": "^5.10.0",
59
+ "@swc/cli": "^0.8.0",
60
+ "@swc/core": "^1.15.18",
61
+ "@types/node": "^25.4.0",
62
+ "@types/react": "19.2.14",
63
+ "@types/react-dom": "19.2.3",
64
+ "copyfiles": "2.4.1",
65
+ "cross-env": "^10.1.0",
66
+ "eslint": "^10.0.3",
67
+ "mongodb-memory-server": "^11.0.1",
68
+ "next": "16.1.6",
69
+ "payload": "^3.79.0",
70
+ "prettier": "^3.8.1",
71
+ "react": "19.2.4",
72
+ "react-dom": "19.2.4",
73
+ "rimraf": "6.1.3",
74
+ "sharp": "0.34.5",
75
+ "typescript": "5.9.3",
76
+ "typescript-eslint": "^8.57.0",
77
+ "vite-tsconfig-paths": "^6.1.1",
78
+ "vitest": "^4.1.0"
79
+ },
80
+ "peerDependencies": {
81
+ "@payloadcms/translations": "^3.53.0",
82
+ "@payloadcms/ui": "^3.53.0",
83
+ "payload": "^3.53.0"
84
+ },
85
+ "engines": {
86
+ "node": "^18.20.2 || >=20.9.0"
87
+ },
88
+ "publishConfig": {
89
+ "exports": {
90
+ ".": {
91
+ "import": "./dist/index.js",
92
+ "types": "./dist/index.d.ts",
93
+ "default": "./dist/index.js"
94
+ },
95
+ "./client": {
96
+ "import": "./dist/exports/client.js",
97
+ "types": "./dist/exports/client.d.ts",
98
+ "default": "./dist/exports/client.js"
99
+ },
100
+ "./rsc": {
101
+ "import": "./dist/exports/rsc.js",
102
+ "types": "./dist/exports/rsc.d.ts",
103
+ "default": "./dist/exports/rsc.js"
104
+ }
105
+ },
106
+ "main": "./dist/index.js",
107
+ "registry": "https://registry.npmjs.org/",
108
+ "types": "./dist/index.d.ts"
109
+ },
110
+ "packageManager": "pnpm@10.32.1",
111
+ "pnpm": {
112
+ "overrides": {
113
+ "typescript-eslint": "^8.57.0",
114
+ "@typescript-eslint/eslint-plugin": "^8.57.0",
115
+ "@typescript-eslint/parser": "^8.57.0",
116
+ "@typescript-eslint/utils": "^8.57.0",
117
+ "@typescript-eslint/typescript-estree": "^8.57.0",
118
+ "@typescript-eslint/type-utils": "^8.57.0"
119
+ }
120
+ }
121
+ }