box-content-preview 3.40.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 (339) hide show
  1. package/LICENSE +397 -0
  2. package/README.md +435 -0
  3. package/dist/lib/237.js +34 -0
  4. package/dist/lib/274.js +103 -0
  5. package/dist/lib/2a7d8bfaf2d43f53bd71.mjs +21 -0
  6. package/dist/lib/3683cfffdcbd73685ff2.svg +8 -0
  7. package/dist/lib/42e4e1954f25f8c7b965.svg +6 -0
  8. package/dist/lib/492.js +34 -0
  9. package/dist/lib/59fe962b3e6bd8bfdda7.svg +3 -0
  10. package/dist/lib/5ea0869845becef03a06.svg +4 -0
  11. package/dist/lib/671.js +34 -0
  12. package/dist/lib/76692c54994797ddfb04.svg +3 -0
  13. package/dist/lib/815.js +34 -0
  14. package/dist/lib/8475f8e672ed83e24520.svg +6 -0
  15. package/dist/lib/88.css +23 -0
  16. package/dist/lib/9fb032a1799ca2a1c751.svg +3 -0
  17. package/dist/lib/assets/loading_ghost.gif +0 -0
  18. package/dist/lib/bb72d81b39be40898db2.svg +3 -0
  19. package/dist/lib/cmaps/78-EUC-H.bcmap +0 -0
  20. package/dist/lib/cmaps/78-EUC-V.bcmap +0 -0
  21. package/dist/lib/cmaps/78-H.bcmap +0 -0
  22. package/dist/lib/cmaps/78-RKSJ-H.bcmap +0 -0
  23. package/dist/lib/cmaps/78-RKSJ-V.bcmap +0 -0
  24. package/dist/lib/cmaps/78-V.bcmap +0 -0
  25. package/dist/lib/cmaps/78ms-RKSJ-H.bcmap +0 -0
  26. package/dist/lib/cmaps/78ms-RKSJ-V.bcmap +0 -0
  27. package/dist/lib/cmaps/83pv-RKSJ-H.bcmap +0 -0
  28. package/dist/lib/cmaps/90ms-RKSJ-H.bcmap +0 -0
  29. package/dist/lib/cmaps/90ms-RKSJ-V.bcmap +0 -0
  30. package/dist/lib/cmaps/90msp-RKSJ-H.bcmap +0 -0
  31. package/dist/lib/cmaps/90msp-RKSJ-V.bcmap +0 -0
  32. package/dist/lib/cmaps/90pv-RKSJ-H.bcmap +0 -0
  33. package/dist/lib/cmaps/90pv-RKSJ-V.bcmap +0 -0
  34. package/dist/lib/cmaps/Add-H.bcmap +0 -0
  35. package/dist/lib/cmaps/Add-RKSJ-H.bcmap +0 -0
  36. package/dist/lib/cmaps/Add-RKSJ-V.bcmap +0 -0
  37. package/dist/lib/cmaps/Add-V.bcmap +0 -0
  38. package/dist/lib/cmaps/Adobe-CNS1-0.bcmap +0 -0
  39. package/dist/lib/cmaps/Adobe-CNS1-1.bcmap +0 -0
  40. package/dist/lib/cmaps/Adobe-CNS1-2.bcmap +0 -0
  41. package/dist/lib/cmaps/Adobe-CNS1-3.bcmap +0 -0
  42. package/dist/lib/cmaps/Adobe-CNS1-4.bcmap +0 -0
  43. package/dist/lib/cmaps/Adobe-CNS1-5.bcmap +0 -0
  44. package/dist/lib/cmaps/Adobe-CNS1-6.bcmap +0 -0
  45. package/dist/lib/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  46. package/dist/lib/cmaps/Adobe-GB1-0.bcmap +0 -0
  47. package/dist/lib/cmaps/Adobe-GB1-1.bcmap +0 -0
  48. package/dist/lib/cmaps/Adobe-GB1-2.bcmap +0 -0
  49. package/dist/lib/cmaps/Adobe-GB1-3.bcmap +0 -0
  50. package/dist/lib/cmaps/Adobe-GB1-4.bcmap +0 -0
  51. package/dist/lib/cmaps/Adobe-GB1-5.bcmap +0 -0
  52. package/dist/lib/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  53. package/dist/lib/cmaps/Adobe-Japan1-0.bcmap +0 -0
  54. package/dist/lib/cmaps/Adobe-Japan1-1.bcmap +0 -0
  55. package/dist/lib/cmaps/Adobe-Japan1-2.bcmap +0 -0
  56. package/dist/lib/cmaps/Adobe-Japan1-3.bcmap +0 -0
  57. package/dist/lib/cmaps/Adobe-Japan1-4.bcmap +0 -0
  58. package/dist/lib/cmaps/Adobe-Japan1-5.bcmap +0 -0
  59. package/dist/lib/cmaps/Adobe-Japan1-6.bcmap +0 -0
  60. package/dist/lib/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  61. package/dist/lib/cmaps/Adobe-Korea1-0.bcmap +0 -0
  62. package/dist/lib/cmaps/Adobe-Korea1-1.bcmap +0 -0
  63. package/dist/lib/cmaps/Adobe-Korea1-2.bcmap +0 -0
  64. package/dist/lib/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  65. package/dist/lib/cmaps/B5-H.bcmap +0 -0
  66. package/dist/lib/cmaps/B5-V.bcmap +0 -0
  67. package/dist/lib/cmaps/B5pc-H.bcmap +0 -0
  68. package/dist/lib/cmaps/B5pc-V.bcmap +0 -0
  69. package/dist/lib/cmaps/CNS-EUC-H.bcmap +0 -0
  70. package/dist/lib/cmaps/CNS-EUC-V.bcmap +0 -0
  71. package/dist/lib/cmaps/CNS1-H.bcmap +0 -0
  72. package/dist/lib/cmaps/CNS1-V.bcmap +0 -0
  73. package/dist/lib/cmaps/CNS2-H.bcmap +0 -0
  74. package/dist/lib/cmaps/CNS2-V.bcmap +3 -0
  75. package/dist/lib/cmaps/ETHK-B5-H.bcmap +0 -0
  76. package/dist/lib/cmaps/ETHK-B5-V.bcmap +0 -0
  77. package/dist/lib/cmaps/ETen-B5-H.bcmap +0 -0
  78. package/dist/lib/cmaps/ETen-B5-V.bcmap +0 -0
  79. package/dist/lib/cmaps/ETenms-B5-H.bcmap +3 -0
  80. package/dist/lib/cmaps/ETenms-B5-V.bcmap +0 -0
  81. package/dist/lib/cmaps/EUC-H.bcmap +0 -0
  82. package/dist/lib/cmaps/EUC-V.bcmap +0 -0
  83. package/dist/lib/cmaps/Ext-H.bcmap +0 -0
  84. package/dist/lib/cmaps/Ext-RKSJ-H.bcmap +0 -0
  85. package/dist/lib/cmaps/Ext-RKSJ-V.bcmap +0 -0
  86. package/dist/lib/cmaps/Ext-V.bcmap +0 -0
  87. package/dist/lib/cmaps/GB-EUC-H.bcmap +0 -0
  88. package/dist/lib/cmaps/GB-EUC-V.bcmap +0 -0
  89. package/dist/lib/cmaps/GB-H.bcmap +4 -0
  90. package/dist/lib/cmaps/GB-V.bcmap +0 -0
  91. package/dist/lib/cmaps/GBK-EUC-H.bcmap +0 -0
  92. package/dist/lib/cmaps/GBK-EUC-V.bcmap +0 -0
  93. package/dist/lib/cmaps/GBK2K-H.bcmap +0 -0
  94. package/dist/lib/cmaps/GBK2K-V.bcmap +0 -0
  95. package/dist/lib/cmaps/GBKp-EUC-H.bcmap +0 -0
  96. package/dist/lib/cmaps/GBKp-EUC-V.bcmap +0 -0
  97. package/dist/lib/cmaps/GBT-EUC-H.bcmap +0 -0
  98. package/dist/lib/cmaps/GBT-EUC-V.bcmap +0 -0
  99. package/dist/lib/cmaps/GBT-H.bcmap +0 -0
  100. package/dist/lib/cmaps/GBT-V.bcmap +0 -0
  101. package/dist/lib/cmaps/GBTpc-EUC-H.bcmap +0 -0
  102. package/dist/lib/cmaps/GBTpc-EUC-V.bcmap +0 -0
  103. package/dist/lib/cmaps/GBpc-EUC-H.bcmap +0 -0
  104. package/dist/lib/cmaps/GBpc-EUC-V.bcmap +0 -0
  105. package/dist/lib/cmaps/H.bcmap +0 -0
  106. package/dist/lib/cmaps/HKdla-B5-H.bcmap +0 -0
  107. package/dist/lib/cmaps/HKdla-B5-V.bcmap +0 -0
  108. package/dist/lib/cmaps/HKdlb-B5-H.bcmap +0 -0
  109. package/dist/lib/cmaps/HKdlb-B5-V.bcmap +0 -0
  110. package/dist/lib/cmaps/HKgccs-B5-H.bcmap +0 -0
  111. package/dist/lib/cmaps/HKgccs-B5-V.bcmap +0 -0
  112. package/dist/lib/cmaps/HKm314-B5-H.bcmap +0 -0
  113. package/dist/lib/cmaps/HKm314-B5-V.bcmap +0 -0
  114. package/dist/lib/cmaps/HKm471-B5-H.bcmap +0 -0
  115. package/dist/lib/cmaps/HKm471-B5-V.bcmap +0 -0
  116. package/dist/lib/cmaps/HKscs-B5-H.bcmap +0 -0
  117. package/dist/lib/cmaps/HKscs-B5-V.bcmap +0 -0
  118. package/dist/lib/cmaps/Hankaku.bcmap +0 -0
  119. package/dist/lib/cmaps/Hiragana.bcmap +0 -0
  120. package/dist/lib/cmaps/KSC-EUC-H.bcmap +0 -0
  121. package/dist/lib/cmaps/KSC-EUC-V.bcmap +0 -0
  122. package/dist/lib/cmaps/KSC-H.bcmap +0 -0
  123. package/dist/lib/cmaps/KSC-Johab-H.bcmap +0 -0
  124. package/dist/lib/cmaps/KSC-Johab-V.bcmap +0 -0
  125. package/dist/lib/cmaps/KSC-V.bcmap +0 -0
  126. package/dist/lib/cmaps/KSCms-UHC-H.bcmap +0 -0
  127. package/dist/lib/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  128. package/dist/lib/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  129. package/dist/lib/cmaps/KSCms-UHC-V.bcmap +0 -0
  130. package/dist/lib/cmaps/KSCpc-EUC-H.bcmap +0 -0
  131. package/dist/lib/cmaps/KSCpc-EUC-V.bcmap +0 -0
  132. package/dist/lib/cmaps/Katakana.bcmap +0 -0
  133. package/dist/lib/cmaps/LICENSE +36 -0
  134. package/dist/lib/cmaps/NWP-H.bcmap +0 -0
  135. package/dist/lib/cmaps/NWP-V.bcmap +0 -0
  136. package/dist/lib/cmaps/RKSJ-H.bcmap +0 -0
  137. package/dist/lib/cmaps/RKSJ-V.bcmap +0 -0
  138. package/dist/lib/cmaps/Roman.bcmap +0 -0
  139. package/dist/lib/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  140. package/dist/lib/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  141. package/dist/lib/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  142. package/dist/lib/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  143. package/dist/lib/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  144. package/dist/lib/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  145. package/dist/lib/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  146. package/dist/lib/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  147. package/dist/lib/cmaps/UniGB-UCS2-H.bcmap +0 -0
  148. package/dist/lib/cmaps/UniGB-UCS2-V.bcmap +0 -0
  149. package/dist/lib/cmaps/UniGB-UTF16-H.bcmap +0 -0
  150. package/dist/lib/cmaps/UniGB-UTF16-V.bcmap +0 -0
  151. package/dist/lib/cmaps/UniGB-UTF32-H.bcmap +0 -0
  152. package/dist/lib/cmaps/UniGB-UTF32-V.bcmap +0 -0
  153. package/dist/lib/cmaps/UniGB-UTF8-H.bcmap +0 -0
  154. package/dist/lib/cmaps/UniGB-UTF8-V.bcmap +0 -0
  155. package/dist/lib/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  156. package/dist/lib/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  157. package/dist/lib/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  158. package/dist/lib/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  159. package/dist/lib/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  160. package/dist/lib/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  161. package/dist/lib/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  162. package/dist/lib/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  163. package/dist/lib/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  164. package/dist/lib/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  165. package/dist/lib/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  166. package/dist/lib/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  167. package/dist/lib/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  168. package/dist/lib/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  169. package/dist/lib/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  170. package/dist/lib/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  171. package/dist/lib/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  172. package/dist/lib/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  173. package/dist/lib/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  174. package/dist/lib/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  175. package/dist/lib/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  176. package/dist/lib/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  177. package/dist/lib/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  178. package/dist/lib/cmaps/UniKS-UCS2-H.bcmap +0 -0
  179. package/dist/lib/cmaps/UniKS-UCS2-V.bcmap +0 -0
  180. package/dist/lib/cmaps/UniKS-UTF16-H.bcmap +0 -0
  181. package/dist/lib/cmaps/UniKS-UTF16-V.bcmap +0 -0
  182. package/dist/lib/cmaps/UniKS-UTF32-H.bcmap +0 -0
  183. package/dist/lib/cmaps/UniKS-UTF32-V.bcmap +0 -0
  184. package/dist/lib/cmaps/UniKS-UTF8-H.bcmap +0 -0
  185. package/dist/lib/cmaps/UniKS-UTF8-V.bcmap +0 -0
  186. package/dist/lib/cmaps/V.bcmap +0 -0
  187. package/dist/lib/cmaps/WP-Symbol.bcmap +0 -0
  188. package/dist/lib/exif/exif-reader.min.js +8 -0
  189. package/dist/lib/exif/exif.js +822 -0
  190. package/dist/lib/exif/exif.min.js +21 -0
  191. package/dist/lib/fde82a50e6de20239861.svg +5 -0
  192. package/dist/lib/ff2dfa442d903d9d5e30.gif +0 -0
  193. package/dist/lib/index.css +84 -0
  194. package/dist/lib/index.d.ts +147 -0
  195. package/dist/lib/index.js +41639 -0
  196. package/dist/lib/pdfjs-lib.js +46 -0
  197. package/dist/lib/pdfjs-viewer-css.js +36 -0
  198. package/dist/lib/pdfjs-viewer.js +8118 -0
  199. package/dist/lib/third-party/media/0.127.0/shaka-player.compiled.js +371 -0
  200. package/dist/lib/third-party/media/1.30.0/shaka-player.compiled.js +438 -0
  201. package/dist/lib/third-party/media/1.33.0/shaka-player.compiled.js +438 -0
  202. package/dist/lib/third-party/media/1.8.0/shaka-player.compiled.js +376 -0
  203. package/dist/lib/third-party/media/2.14.0/shaka-player.compiled.js +609 -0
  204. package/dist/lib/third-party/media/2.66.0/manifest.json +8 -0
  205. package/dist/lib/third-party/media/2.66.0/shaka-player.compiled.js +752 -0
  206. package/dist/lib/third-party/media/2.93.0/manifest.json +8 -0
  207. package/dist/lib/third-party/media/2.93.0/shaka-player.compiled.js +975 -0
  208. package/dist/lib/third-party/media/3.25.0/manifest.json +8 -0
  209. package/dist/lib/third-party/media/3.25.0/shaka-player.compiled.js +1780 -0
  210. package/dist/lib/third-party/model3d/1.10.1/WebVR/VRConfig.js +49 -0
  211. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchCommon/1024/1.jpg +0 -0
  212. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchCommon/256/3.jpg +0 -0
  213. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchCommon/512/2.jpg +0 -0
  214. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchCommon/64/1.jpg +0 -0
  215. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchCommon/64/2.jpg +0 -0
  216. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchCommon/entities.json +322 -0
  217. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchLeft/entities.json +755 -0
  218. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchLeft/geometry.bin +0 -0
  219. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchRight/entities.json +746 -0
  220. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchRight/geometry.bin +0 -0
  221. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/entities.json +1811 -0
  222. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/geometry.bin +0 -0
  223. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/1024/1.png +0 -0
  224. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/1024/2.jpg +0 -0
  225. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/1024/3.jpg +0 -0
  226. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/64/1.png +0 -0
  227. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/64/2.jpg +0 -0
  228. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/64/3.jpg +0 -0
  229. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/64/4.png +0 -0
  230. package/dist/lib/third-party/model3d/1.10.1/box3d-player.json +1 -0
  231. package/dist/lib/third-party/model3d/1.10.1/box3d-runtime.min.js +2 -0
  232. package/dist/lib/third-party/model3d/1.10.1/boxsdk.min.js +2 -0
  233. package/dist/lib/third-party/model3d/1.10.1/matcap.png +0 -0
  234. package/dist/lib/third-party/model3d/1.10.1/three.min.js +882 -0
  235. package/dist/lib/third-party/model3d/1.10.1/webvr-polyfill.js +6341 -0
  236. package/dist/lib/third-party/model3d/1.12.0/WebVR/VRConfig.js +49 -0
  237. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchCommon/1024/1.jpg +0 -0
  238. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchCommon/256/3.jpg +0 -0
  239. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchCommon/512/2.jpg +0 -0
  240. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchCommon/64/1.jpg +0 -0
  241. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchCommon/64/2.jpg +0 -0
  242. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchCommon/entities.json +322 -0
  243. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchLeft/entities.json +755 -0
  244. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchLeft/geometry.bin +0 -0
  245. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchRight/entities.json +746 -0
  246. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchRight/geometry.bin +0 -0
  247. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/entities.json +1811 -0
  248. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/geometry.bin +0 -0
  249. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/1024/1.png +0 -0
  250. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/1024/2.jpg +0 -0
  251. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/1024/3.jpg +0 -0
  252. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/64/1.png +0 -0
  253. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/64/2.jpg +0 -0
  254. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/64/3.jpg +0 -0
  255. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/64/4.png +0 -0
  256. package/dist/lib/third-party/model3d/1.12.0/box3d-player.json +1 -0
  257. package/dist/lib/third-party/model3d/1.12.0/box3d-runtime.min.js +2 -0
  258. package/dist/lib/third-party/model3d/1.12.0/boxsdk.min.js +2 -0
  259. package/dist/lib/third-party/model3d/1.12.0/matcap.png +0 -0
  260. package/dist/lib/third-party/model3d/1.12.0/three.min.js +882 -0
  261. package/dist/lib/third-party/model3d/1.12.0/webvr-polyfill.js +6341 -0
  262. package/dist/lib/third-party/model3d/1.6.1/WebVR/VRConfig.js +49 -0
  263. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchCommon/1024/1.jpg +0 -0
  264. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchCommon/256/3.jpg +0 -0
  265. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchCommon/512/2.jpg +0 -0
  266. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchCommon/64/1.jpg +0 -0
  267. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchCommon/64/2.jpg +0 -0
  268. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchCommon/entities.json +439 -0
  269. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchLeft/entities.json +755 -0
  270. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchLeft/geometry.bin +0 -0
  271. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchRight/entities.json +746 -0
  272. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchRight/geometry.bin +0 -0
  273. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/entities.json +1869 -0
  274. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/geometry.bin +0 -0
  275. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/1024/1.png +0 -0
  276. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/1024/2.jpg +0 -0
  277. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/1024/3.jpg +0 -0
  278. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/64/1.png +0 -0
  279. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/64/2.jpg +0 -0
  280. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/64/3.jpg +0 -0
  281. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/64/4.png +0 -0
  282. package/dist/lib/third-party/model3d/1.6.1/box3d-player.json +1 -0
  283. package/dist/lib/third-party/model3d/1.6.1/box3d-runtime.min.js +2 -0
  284. package/dist/lib/third-party/model3d/1.6.1/boxsdk.min.js +2 -0
  285. package/dist/lib/third-party/model3d/1.6.1/matcap.png +0 -0
  286. package/dist/lib/third-party/model3d/1.6.1/three.min.js +43300 -0
  287. package/dist/lib/third-party/model3d/1.6.1/webvr-polyfill.js +6341 -0
  288. package/dist/lib/third-party/model3d/1.9.1/WebVR/VRConfig.js +49 -0
  289. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchCommon/1024/1.jpg +0 -0
  290. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchCommon/256/3.jpg +0 -0
  291. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchCommon/512/2.jpg +0 -0
  292. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchCommon/64/1.jpg +0 -0
  293. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchCommon/64/2.jpg +0 -0
  294. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchCommon/entities.json +439 -0
  295. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchLeft/entities.json +755 -0
  296. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchLeft/geometry.bin +0 -0
  297. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchRight/entities.json +746 -0
  298. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchRight/geometry.bin +0 -0
  299. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/entities.json +1869 -0
  300. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/geometry.bin +0 -0
  301. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/1024/1.png +0 -0
  302. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/1024/2.jpg +0 -0
  303. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/1024/3.jpg +0 -0
  304. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/64/1.png +0 -0
  305. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/64/2.jpg +0 -0
  306. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/64/3.jpg +0 -0
  307. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/64/4.png +0 -0
  308. package/dist/lib/third-party/model3d/1.9.1/box3d-player.json +1 -0
  309. package/dist/lib/third-party/model3d/1.9.1/box3d-runtime.min.js +2 -0
  310. package/dist/lib/third-party/model3d/1.9.1/boxsdk.min.js +2 -0
  311. package/dist/lib/third-party/model3d/1.9.1/matcap.png +0 -0
  312. package/dist/lib/third-party/model3d/1.9.1/three.min.js +882 -0
  313. package/dist/lib/third-party/model3d/1.9.1/webvr-polyfill.js +6341 -0
  314. package/dist/lib/third-party/swf/0.112.0/swfobject.js +6 -0
  315. package/dist/lib/third-party/text/0.112.0/github-markdown.css +681 -0
  316. package/dist/lib/third-party/text/0.112.0/github.css +123 -0
  317. package/dist/lib/third-party/text/0.112.0/highlight.min.js +3 -0
  318. package/dist/lib/third-party/text/0.112.0/papaparse.js +1457 -0
  319. package/dist/lib/third-party/text/0.112.0/papaparse.min.js +34 -0
  320. package/dist/lib/third-party/text/0.112.0/remarkable.min.js +4 -0
  321. package/dist/lib/third-party/text/0.114.0/github-markdown.css +681 -0
  322. package/dist/lib/third-party/text/0.114.0/github-markdown.min.css +1 -0
  323. package/dist/lib/third-party/text/0.114.0/github.css +123 -0
  324. package/dist/lib/third-party/text/0.114.0/github.min.css +1 -0
  325. package/dist/lib/third-party/text/0.114.0/highlight.min.js +3 -0
  326. package/dist/lib/third-party/text/0.114.0/manifest.json +10 -0
  327. package/dist/lib/third-party/text/0.114.0/papaparse.js +1457 -0
  328. package/dist/lib/third-party/text/0.114.0/papaparse.min.js +34 -0
  329. package/dist/lib/third-party/text/0.114.0/remarkable.min.js +4 -0
  330. package/dist/lib/third-party/text/2.65.0/github-markdown.css +681 -0
  331. package/dist/lib/third-party/text/2.65.0/github-markdown.min.css +1 -0
  332. package/dist/lib/third-party/text/2.65.0/github.css +99 -0
  333. package/dist/lib/third-party/text/2.65.0/github.min.css +1 -0
  334. package/dist/lib/third-party/text/2.65.0/highlight.min.js +2 -0
  335. package/dist/lib/third-party/text/2.65.0/manifest.json +10 -0
  336. package/dist/lib/third-party/text/2.65.0/papaparse.js +1897 -0
  337. package/dist/lib/third-party/text/2.65.0/papaparse.min.js +7 -0
  338. package/dist/lib/third-party/text/2.65.0/remarkable.min.js +1 -0
  339. package/package.json +198 -0
package/README.md ADDED
@@ -0,0 +1,435 @@
1
+ [![Project Status](https://img.shields.io/badge/status-active-brightgreen.svg?style=flat-square)](http://opensource.box.com/badges/)
2
+ [![Mergify Status](https://img.shields.io/endpoint.svg?url=https://gh.mergify.io/badges/box/box-content-preview&style=flat)](https://mergify.io)
3
+ [![Styled With Prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
4
+ [![build status](https://img.shields.io/travis/box/box-content-preview/master.svg?style=flat-square)](https://travis-ci.org/box/box-content-preview)
5
+ [![version](https://img.shields.io/badge/version-v3.40.0-blue.svg?style=flat-square)](https://github.com/box/box-content-preview)
6
+ [![npm version](https://img.shields.io/npm/v/box-ui-elements.svg?style=flat-square)](https://www.npmjs.com/package/box-ui-elements)
7
+
8
+ # [Box Content Preview](https://developer.box.com/docs/box-content-preview)
9
+
10
+ The Box Content Preview library allows developers to easily embed high quality and interactive previews of Box files in desktop and mobile web applications. The JavaScript library fetches information about the file and its converted representations through the Box API, chooses the appropriate viewer for the file type, dynamically loads the necessary static assets and file representations, and finally renders the file. Box Content Preview also allows previews of multiple files to be loaded in the same container and exposes arrows to navigate between those files.
11
+
12
+ This library powers Preview in the main Box web application as well as the 'Get Embed Link' Box API endpoint.
13
+
14
+ ## Browser Support
15
+
16
+ - Desktop Chrome, Firefox, Safari, Edge
17
+ - Limited support for mobile web - previews will render but some controls may not work
18
+
19
+ Effective September 1, 2023, Box is discontinuing support for Internet Explorer 11 (IE 11) in Preview SDK. If your application requires IE 11 support, we recommend using the release versions of Preview SDK that were made available before August 15th, 2023. Our team will address any critical blocker and security issues specifically related to IE 11 until October 15, 2023. Following this date, we will no longer provide active support for IE 11 in Preview SDK.
20
+
21
+ We encourage all users to update their applications to utilize modern browsers for optimal performance, security, and compatibility with the latest features in Preview SDK.
22
+
23
+ ## Current Version
24
+
25
+ - Version: v3.40.0
26
+ - Locale: en-US
27
+
28
+ https://cdn01.boxcdn.net/platform/preview/3.40.0/en-US/preview.js
29
+ https://cdn01.boxcdn.net/platform/preview/3.40.0/en-US/preview.css
30
+
31
+ ## Supported Locales
32
+
33
+ To use a different locale, replace `en-US` in the URLs above with any of the following supported locales.
34
+
35
+ `en-AU`, `en-CA`, `en-GB`, `en-US`, `bn-IN`, `da-DK`, `de-DE`, `es-419`, `es-ES`, `fi-FI`, `fr-CA`, `fr-FR`, `hi-IN`,`it-IT`, `ja-JP`, `ko-KR`, `nb-NO`, `nl-NL`, `pl-PL`, `pt-BR`, `ru-RU`, `sv-SE`, `tr-TR`, `zh-CN`, `zh-TW`
36
+
37
+ ## Supported File Types
38
+
39
+ Box Content Preview supports 100+ file types, including most document and image formats, HD video, 3D models, 360-degress images, and 360-degree videos. You can find the full list of supported file types on [Box Support](https://support.box.com/hc/en-us/articles/360043695794-Viewing-Different-File-Types-Supported-in-Box-Content-Preview) .
40
+
41
+ ## Usage
42
+
43
+ ### Including Preview as a library
44
+
45
+ You can self-host the Box Content Preview library or reference the versions available on Box's CDN.
46
+
47
+ ```html
48
+ <!DOCTYPE html>
49
+ <html lang="en-US">
50
+ <head>
51
+ <meta charset="utf-8" />
52
+ <title>Box Content Preview Demo</title>
53
+
54
+ <!-- Latest version of Preview SDK for your locale -->
55
+ <script src="https://cdn01.boxcdn.net/platform/preview/3.40.0/en-US/preview.js"></script>
56
+ <link
57
+ rel="stylesheet"
58
+ href="https://cdn01.boxcdn.net/platform/preview/3.40.0/en-US/preview.css"
59
+ />
60
+ </head>
61
+ <body>
62
+ <div class="preview-container" style="height:400px;width:575px"></div>
63
+ <script>
64
+ var preview = new Box.Preview();
65
+ preview.show('93392244621', 'EqFyi1Yq1tD9mxY8F38sxDfp73pFd7FP', {
66
+ container: '.preview-container',
67
+ });
68
+ </script>
69
+ </body>
70
+ </html>
71
+ ```
72
+
73
+ ### Self-hosting
74
+
75
+ To self-host the Box Content Preview library, follow these steps:
76
+
77
+ 1. Either fork the repo and check out the version you want to host or download the specific version as a zip:
78
+
79
+ - Check out a specific version with `git checkout v3.40.0`
80
+ - Download a specific version as a zip from https://github.com/box/box-content-preview/releases
81
+
82
+ 2. Install dependencies and build the library with `yarn install && yarn build:i18n && yarn build:prod`
83
+ 3. Self-host everything except for the `dev` folder from the `/dist` folder. You must not alter the folder structure and `third-party` needs to be in the same folder as `2.4.0`. For example, if you self-host using a `box-assets` directory, these URLs must be accessible:
84
+
85
+ - https://cdn.YOUR_SITE.com/box-assets/2.4.0/en-US/preview.js
86
+ - https://cdn.YOUR_SITE.com/box-assets/third-party/text/0.114.0/papaparse.min.js
87
+ - https://cdn.YOUR_SITE.com/box-assets/third-party/model3d/1.12.0/three.min.js
88
+
89
+ ### Importing Preview as a React Component
90
+
91
+ Preview can also be used as a React Component with the Box Element framework. The source code for the Content Preview Element wrapper is located at https://github.com/box/box-ui-elements/tree/master/src/components/ContentPreview. Please reference https://github.com/box/box-content-preview-demo for a minimal React application using this wrapper.
92
+
93
+ ## CORS (Cross-Origin Resource Sharing)
94
+
95
+ For security purposes, you must whitelist your application's HTTP origin, omitting any trailing slash, in the configuration section of the Developer Console. For example, CodePen's domain is whitelisted for the demo application below.
96
+
97
+ ![Screenshot of CORS whitelist](images/cors.png)
98
+
99
+ ## Demo
100
+
101
+ View a demo and sample code on CodePen - http://codepen.io/box-platform/pen/rmZdjm.
102
+
103
+ ## Initialization
104
+
105
+ ```javascript
106
+ var preview = new Box.Preview();
107
+ preview.show(fileId, accessToken, { options });
108
+ ```
109
+
110
+ Where `fileId` is a string `Box_File` id and `accessToken` is a Box API access token.
111
+
112
+ ## Parameters & Options
113
+
114
+ ```javascript
115
+ var preview = new Box.Preview();
116
+ preview.show(fileId, accessToken, {
117
+ container: '.preview-container',
118
+ sharedLink: 'https://app.box.com/v/foo',
119
+ sharedLinkPassword: 'bar',
120
+ collection: [FILE_ID, '123', '234', ...],
121
+ header: 'light',
122
+ logoUrl: 'http://i.imgur.com/xh8j3E2.png',
123
+ showAnnotations: true,
124
+ showDownload: true
125
+ });
126
+ ```
127
+
128
+ | Parameter | Description |
129
+ | ----------- | ------------------------------------------------------------------------------- |
130
+ | fileId | Box file ID |
131
+ | accessToken | Either a string auth token or a token generator function, see below for details |
132
+
133
+ | Option | Default | Description |
134
+ | --------------------------------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
135
+ | container | document.body | DOM node or selector where Preview should be placed |
136
+ | sharedLink | | Shared link URL |
137
+ | sharedLinkPassword | | Shared link password |
138
+ | collection | | List of file IDs to iterate over for previewing |
139
+ | header | `light` | String value of `none` or `dark` or `light` that controls header visibility and theme |
140
+ | logoUrl | | URL of logo to show in header |
141
+ | showAnnotations | false | Whether annotations and annotation controls are shown. This option will be overridden by viewer-specific annotation options if they are set. See [Box Annotations](https://github.com/box/box-annotations) for more details |
142
+ | showDownload | false | Whether download button is shown |
143
+ | autoFocus | true | Whether preview should focus itself when a file loads |
144
+ | useHotkeys | true | Whether hotkeys (keyboard shortcuts) are enabled |
145
+ | fixDependencies | false | Temporarily patches AMD to properly load Preview's dependencies. You may need to enable this if your project uses RequireJS |
146
+ | disableEventLog | false | Disables client-side `preview` event log. Previewing with this option enabled will not increment access stats (content access is still logged server-side) |
147
+ | fileOptions | {} | Mapping of file ID to file-level options. See the File Option table below for details |
148
+ | previewWMPref | `any` | String value of `all`, `any`, or `none` that sets how previews of watermarked files behave. See https://community.box.com/t5/Sharing-Content-with-Box/Watermarking-Files/ta-p/30766 for more information about watermarking and https://community.box.com/t5/Collaborate-By-Inviting-Others/Understanding-Collaborator-Permission-Levels/ta-p/144 for more information about permissions and collaboration roles.<br><br>`all` forces watermarked previews. If the file type supports watermarking, users with `can_preview` permissions will see a watermarked preview. If the file type cannot be watermarked, no preview is shown.<br><br>`any` is the default watermarking behavior in the Box Web Application. If the file type supports watermarking, users with `can_preview` permissions will see a watermarked preview. If the file type cannot be watermarked, users that have both `can_preview` and `can_upload` permissions will see a non-watermarked preview and no preview otherwise.<br><br>`none` forces non-watermarked previews. Users that have both `can_preview` and `can_upload` permissions will see a non-watermarked preview and no preview otherwise. |
149
+ | downloadWM | false | Whether the download of a watermarked file should be watermarked. This option does not affect non-watermarked files. If true, users will be able to download watermarked versions of supported file types as long as they have `can_preview` permissions (any collaboration role except for `Uploader`). |
150
+ | viewers | {} | Maps options to a valid viewer type |
151
+ | viewers.Document.disableFontFace viewers.Presentation.disableFontFace | false | By default, fonts are converted to OpenType fonts and loaded via font face rules. If disabled, fonts will be rendered using a built-in font renderer that constructs the glyphs with primitive path commands. **Use this option at your own risk** |
152
+ | responseInterceptor | | Function to intercept responses. For an example see https://codepen.io/box-platform/pen/jLdxEv |
153
+ | requestInterceptor | | Function to intercept requests. For an example see https://codepen.io/box-platform/pen/jLdxEv |
154
+
155
+ | File Option | Default | Description |
156
+ | ------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
157
+ | fileVersionId | (Current) | File version ID to preview. This must be a valid non-current file version ID. Use [Get Versions](https://developer.box.com/reference#view-versions-of-a-file) to fetch a list of file versions |
158
+ | startAt | {} | Options for starting location. See the Start At table below for details |
159
+
160
+ | Start At | Description |
161
+ | -------- | ------------------------------------------------------------ |
162
+ | unit | Supported values: "pages" for documents; "seconds" for media |
163
+ | value | Integer value specifying the start location |
164
+
165
+ **Example**
166
+
167
+ This configuration will attempt to Preview a non-current version of the given file (a document, in this case) at a specific starting page:
168
+
169
+ ```javascript
170
+ var FILE_ID = '12345';
171
+ var TOKEN = 'abcdefg';
172
+ preview.show(FILE_ID, TOKEN, {
173
+ fileOptions: {
174
+ [FILE_ID]: {
175
+ fileVersionId: '54321',
176
+ startAt: {
177
+ unit: 'pages',
178
+ value: 2,
179
+ },
180
+ },
181
+ },
182
+ });
183
+ ```
184
+
185
+ ## Access Token
186
+
187
+ Box Content Preview needs an access token to make Box API calls. You can either get an access token from the token endpoint (https://developer.box.com/reference#token) or generate a developer token on your application management page (https://blog.box.com/blog/introducing-developer-tokens/).
188
+
189
+ If your application requires the end user to only be able to access a subset of the Content Preview functionality, you can use [Token Exchange](https://developer.box.com/reference#token-exchange) to appropriately downscope your App/Managed or Service Account token to a resulting token that has the desired set of permissions, and can thus, be securely passed to the end user client initializing the Content Preview.
190
+
191
+ Below are a set of new Box Element-specific scopes to go alongside Token Exchange. These allow developers to enable/disable UI controls on the Content Preview by configuring the appropriate scopes on the downscoped token. To learn more, see [Special Scopes for Box Elements](https://developer.box.com/docs/special-scopes-for-box-ui-elements).
192
+
193
+ Wish to learn more about when, why and how you can use Token Exchange with the Content Preview? See our [blueprint on Customizing Access for the Box Elements](https://developer.box.com/docs/customizing-access-for-ui-elements).
194
+
195
+ ### Base Scope
196
+
197
+ | Scope Name | What permissions does it grant? |
198
+ | ------------ | ----------------------------------------------------------------------------------------- |
199
+ | base_preview | Allows preview access to a file or files in a folder based on user/file/token permissions |
200
+
201
+ ### Feature Scopes
202
+
203
+ | Scope Name | What permissions does it grant? |
204
+ | -------------------- | ------------------------------------------------------------------------- |
205
+ | item_download | Allows files/folders contents to be downloaded |
206
+ | annotation_view_self | Allows user to view their own annotations |
207
+ | annotation_view_all | Allows user to view all annotations on the file |
208
+ | annotation_edit | Allows user to edit their own annotations (includes annotation_view_self) |
209
+
210
+ ### Sample Scenarios
211
+
212
+ | Scenario | Scope Combinations |
213
+ | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
214
+ | User wants basic preview functionality + download | base_preview + item_download |
215
+ | User wants basic preview functionality + ability to edit own annotations | base_preview + annotation_edit |
216
+ | User wants basic preview functionality + ability to view all annotations + ability to edit own annotations | base_preview + annotation_view_all + annotation_edit |
217
+
218
+ ## Token Generator Function
219
+
220
+ The Preview library optionally takes a token generator function instead of a string token. Using a token generator function allows you to dynamically determine what tokens Preview should use. For example, you can pass in different access tokens for each file or make sure your token is refreshed and valid before showing a preview. The token generator function should return a promise that resolves in either a single string token that applies to all of the files being previewed or a map of typed file IDs to access token for those files.
221
+
222
+ ```javascript
223
+ // Example token generator function that resolves to a single access token
224
+ var singleTokenGenerator = function() {
225
+ return someApi.getToken().then(function(data) {
226
+ return data.token;
227
+ });
228
+ };
229
+
230
+ // Example token generator function that resolves to a map of tokens
231
+ var mapTokenGenerator = function() {
232
+ return Promise.resolve({
233
+ file_1234: 'some_token_abcd',
234
+ file_2345: 'some_token_bcde',
235
+ });
236
+ };
237
+ ```
238
+
239
+ ## Viewers
240
+
241
+ The name of a viewer can be one of the following `Document`, `Presentation`, `MP3`, `MP4`, `Dash`, `Image`, `Text`, `SWF`, `Image360`, `Video360`, `Model3d`, `CSV`, `Markdown`. Call `preview.getViewers()` to get the list of possible viewers.
242
+
243
+ ## Additional Methods
244
+
245
+ `preview.hide()` hides the preview.
246
+
247
+ `preview.updateCollection(/* Array[file ids] */ collection)` updates the collection to navigate through. Assumes the currently visible file is part of this new collection.
248
+
249
+ `preview.getCurrentCollection()` returns the current collection if any.
250
+
251
+ `preview.navigateLeft()` shows previous file in the collection.
252
+
253
+ `preview.navigateRight()` shows next file in the collection.
254
+
255
+ `preview.navigateToIndex(index)` shows the specified index in the current collection.
256
+
257
+ `preview.getCurrentFile()` returns the current file being previewed if any. The file object structure is the same as returned by the [Box API](https://developer.box.com/reference#files).
258
+
259
+ `preview.getCurrentViewer()` returns the current viewer instance. May be undefined if the viewer isn't ready yet and waiting on conversion to happen.
260
+
261
+ `preview.enableViewers(/* String|Array[String] */ viewers)` enables one or more viewers based on VIEWERNAME.
262
+
263
+ `preview.disableViewers(/* String|Array[String] */ viewers)` disables one or more viewers based on VIEWERNAME. Viewers can also be disabled by setting `disabled: true` on the specific viewer option inside options.
264
+
265
+ `preview.enableHotkeys()` enables hotkeys (keyboard shortcuts).
266
+
267
+ `preview.disableHotkeys()` disables hotkeys (keyboard shortcuts).
268
+
269
+ `preview.print()` prints the file if printable.
270
+
271
+ `preview.download()` downloads the file if downloadable.
272
+
273
+ `preview.resize()` resizes the current preview if applicable. This function only needs to be called when preview's viewport has changed while the window object has not. If the window is resizing, then preview will automatically resize itself.
274
+
275
+ `preview.getViewers()` lists all the available viewers.
276
+
277
+ `preview.prefetchViewers(/* Array[String] */)` prefetches static assets for the specified viewers that the browser can cache for performance benefits.
278
+
279
+ ## Events
280
+
281
+ The preview object exposes `addListener` and `removeListener` for binding to events. Event listeners should be bound before `show()` is called, otherwise events can be missed.
282
+
283
+ ```javascript
284
+ var preview = new Box.Preview();
285
+ var listener = (value) => {
286
+ // Do something with value
287
+ };
288
+
289
+ // Attach listener before calling show otherwise events can be missed
290
+ preview.addListener(EVENTNAME, listener);
291
+
292
+ // Show a preview
293
+ preview.show(...);
294
+
295
+ // Remove listener when appropriate
296
+ preview.removeListener(EVENTNAME, listener);
297
+ ```
298
+
299
+ EVENTNAME can be one of the following
300
+
301
+ - `viewer` event will be fired when we have the viewer instance first available. This will be the same object that is also a property included in the `load` event. Preview fires this event before `load` so that clients can attach their listeners before the `load` event is fired.
302
+
303
+ - `load` event will be fired on every preview load when `show()` is called or if inter-preview navigation occurs. The event data will contain:
304
+
305
+ ```javascript
306
+ {
307
+ error: 'message', // Error message if any error occurred while loading
308
+ viewer: {...}, // Instance of the current viewer object if no error occurred
309
+ metrics: {...}, // Performance metrics
310
+ file: {...} // Box file object with properties defined in file.js
311
+ }
312
+ ```
313
+
314
+ - `navigate` event will be fired when navigation happens. The event includes the file ID of the file being navigated to, and this event will fire before `load`.
315
+
316
+ - `notification` event will be fired when either the preview wrapper or one of the viewers wants to notify something like a warning or non-fatal error. The event data will contain:
317
+
318
+ ```javascript
319
+ {
320
+ message: 'message', // Message to show
321
+ type: 'warning' // 'warning', 'notice', or 'error'
322
+ }
323
+ ```
324
+
325
+ - `viewerevent` Each viewer will fire its own sets of events. For example, the Image viewer will fire `rotate` or `resize`, etc. while other viewers may fire another set of events. The preview wrapper will also re-emit events at the preview level, with event data containing:
326
+
327
+ ```javascript
328
+ {
329
+ event: EVENTNAME, // Event name
330
+ data: DATA, // Event data object
331
+ viewerName: VIEWERNAME, // Name of the viewer. See VIEWERNAME above
332
+ fileId: fileId // The file id
333
+ }
334
+ ```
335
+
336
+ ### Example event usage
337
+
338
+ ```javascript
339
+ preview.addListener('viewer', viewer => {
340
+ viewer.addListener('rotate', () => {
341
+ // Do something when a viewer rotates a preview
342
+ });
343
+ });
344
+
345
+ preview.addListener('load', data => {
346
+ var viewer = data.viewer;
347
+ viewer.addListener('rotate', () => {
348
+ // Do something when a viewer rotates a preview
349
+ });
350
+ });
351
+
352
+ preview.addListener('viewerevent', data => {
353
+ if (data.viewerName === 'Image') {
354
+ if (data.event === 'rotate') {
355
+ // Do something when an image preview is rotated
356
+ }
357
+ } else if (data.viewerName === 'Image360') {
358
+ if (data.event === 'rotate') {
359
+ // Do something different when a 360-degree image is rotated
360
+ }
361
+ } else {
362
+ }
363
+ });
364
+
365
+ preview.addListener('rotate', data => {
366
+ if (data.viewerName === 'Image') {
367
+ // Do something when an image preview is rotated
368
+ } else if (data.viewerName === 'Image360') {
369
+ // Do something different when a 360-degree image is rotated
370
+ } else {
371
+ }
372
+ });
373
+ ```
374
+
375
+ ## Development Setup
376
+
377
+ 1. Install latest LTS version of Node `https://nodejs.org/en/download`.
378
+ 2. Install yarn package manager `https://yarnpkg.com/en/docs/install`. Alternatively, you can replace any `yarn` command with `npm`.
379
+ 3. Fork the upstream repo `https://github.com/box/box-content-preview`.
380
+ 4. Clone your fork locally `git clone git@github.com:[YOUR GITHUB USERNAME]/box-content-preview.git`.
381
+ 5. Navigate to the cloned folder `cd box-content-preview`
382
+ 6. Add the upstream repo to your remotes `git remote add upstream git@github.com:box/box-content-preview.git`.
383
+ 7. Verify your remotes are properly set up `git remote -v`. You should pull updates from the Box repo `upstream` and push changes to your fork `origin`.
384
+ 8. Install dependencies `yarn install`
385
+ 9. Test your first build! `yarn build`
386
+ 10. To automatically rsync files after a Webpack build, add a build/rsync.json file with a `location` field. This file should look like:
387
+
388
+ ```
389
+ {
390
+ "location": "YOUR_DESIRED_RSYNC_LOCATION_HERE"
391
+ }
392
+ ```
393
+
394
+ ## While Developing
395
+
396
+ Install the following plugins in your preferred editor
397
+
398
+ - Editor Config (standardizes basic editor configuration)
399
+ - ESLint (Javascript linting)
400
+ - Prettier & Prettier - ESLint (Automatic Javascript formatting following ESLint config)
401
+ - Stylelint (CSS linting)
402
+
403
+ ### Yarn commands
404
+
405
+ - `yarn build` to generate resource bundles and JS webpack bundles.
406
+ - `yarn start` to only generate JS webpack bundles on file changes.
407
+ - `yarn start:dev` to launch a webpack-dev-server instance for local development.
408
+ - `yarn test` to run all unit tests with Jest.
409
+ - `yarn test path/to/filename.js` to run Jest only for that file and/or its related tests.
410
+ - `yarn test:watch` to run all unit tests with Jest for debugging.
411
+ - `yarn test:watch path/to/src/filename.js` to run Jest only for that file and/or its related tests for debugging.
412
+
413
+ For more script commands see `package.json`. Test coverage reports are available under reports/coverage.
414
+
415
+ ## Support
416
+
417
+ If you have any questions, please search our [issues list](https://github.com/box/box-content-preview/issues) to see if they have been previously answered. Report new issues [here](https://github.com/box/box-content-preview/issues/new).
418
+
419
+ For general Box Platform, API, and Box Element questions, please visit our [developer forum](https://community.box.com/t5/Developer-Forum/bd-p/DeveloperForum) or contact us via one of our [available support channels](https://community.box.com/t5/Community/ct-p/English).
420
+
421
+ ## Copyright and License
422
+
423
+ Copyright 2016-present Box, Inc. All Rights Reserved.
424
+
425
+ Licensed under the Box Software License Agreement v.20170516.
426
+ You may not use this file except in compliance with the License.
427
+ You may obtain a copy of the License at
428
+
429
+ https://developer.box.com/docs/box-sdk-license
430
+
431
+ Unless required by applicable law or agreed to in writing, software
432
+ distributed under the License is distributed on an "AS IS" BASIS,
433
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
434
+ See the License for the specific language governing permissions and
435
+ limitations under the License.
@@ -0,0 +1,34 @@
1
+ /*!
2
+ * Box Content Preview
3
+ *
4
+ * Copyright 2023 Box, Inc. All rights reserved.
5
+ *
6
+ * This product includes software developed by Box, Inc. ("Box")
7
+ * (http://www.box.com)
8
+ *
9
+ * ALL BOX SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
10
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
11
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
12
+ * IN NO EVENT SHALL BOX BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
13
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
14
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
15
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
16
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
18
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19
+ *
20
+ * See the Box license for the specific language governing permissions
21
+ * and limitations under the license.
22
+ */
23
+ export const __webpack_esm_id__ = 237;
24
+ export const __webpack_esm_ids__ = [237];
25
+ export const __webpack_esm_modules__ = {
26
+
27
+ /***/ 3237
28
+ () {
29
+
30
+ /* (ignored) */
31
+
32
+ /***/ }
33
+
34
+ };