@strapi/content-manager 0.0.0-experimental.d1602f22dc638a4c3c5084965fd6126fff5e9d4f → 0.0.0-experimental.d2a56e52af31fcf0f0c582a5a2e58e310966e96b

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 (236) hide show
  1. package/dist/admin/chunks/{CardDragPreview-DwuraT0K.js → CardDragPreview-DwuraT0K.mjs} +1 -1
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs.map +1 -0
  3. package/dist/admin/chunks/{ComponentConfigurationPage-DXwOtpq1.js → ComponentConfigurationPage-CGn9IYeg.js} +6 -6
  4. package/dist/admin/chunks/{ComponentConfigurationPage-DXwOtpq1.js.map → ComponentConfigurationPage-CGn9IYeg.js.map} +1 -1
  5. package/dist/admin/chunks/{ComponentConfigurationPage-DhYZp4nN.js → ComponentConfigurationPage-DgYK4xW6.mjs} +9 -9
  6. package/dist/admin/chunks/ComponentConfigurationPage-DgYK4xW6.mjs.map +1 -0
  7. package/dist/admin/chunks/{ComponentIcon-BZcTc4rj.js → ComponentIcon-BZcTc4rj.mjs} +1 -1
  8. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs.map +1 -0
  9. package/dist/admin/chunks/{EditConfigurationPage-D0Ng758X.js → EditConfigurationPage-7w_-4jF4.js} +6 -6
  10. package/dist/admin/chunks/{EditConfigurationPage-D0Ng758X.js.map → EditConfigurationPage-7w_-4jF4.js.map} +1 -1
  11. package/dist/admin/chunks/{EditConfigurationPage-DDuPch5d.js → EditConfigurationPage-C05SwwH-.mjs} +9 -9
  12. package/dist/admin/chunks/EditConfigurationPage-C05SwwH-.mjs.map +1 -0
  13. package/dist/admin/chunks/EditViewPage-CVRJBOEv.mjs +318 -0
  14. package/dist/admin/chunks/EditViewPage-CVRJBOEv.mjs.map +1 -0
  15. package/dist/admin/chunks/EditViewPage-CuQfZJDf.js +341 -0
  16. package/dist/admin/chunks/EditViewPage-CuQfZJDf.js.map +1 -0
  17. package/dist/admin/chunks/{FieldTypeIcon-BY6MrVF4.js → FieldTypeIcon-BY6MrVF4.mjs} +1 -1
  18. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs.map +1 -0
  19. package/dist/admin/chunks/{Form-BEqiuSvQ.js → Form-BqNYRsCb.js} +5 -5
  20. package/dist/admin/chunks/{Form-BEqiuSvQ.js.map → Form-BqNYRsCb.js.map} +1 -1
  21. package/dist/admin/chunks/{Form-CZmB6JIg.js → Form-DaEnqAeV.mjs} +5 -5
  22. package/dist/admin/chunks/Form-DaEnqAeV.mjs.map +1 -0
  23. package/dist/admin/chunks/{History-CPYXgxkS.js → History-B7dGNfmx.mjs} +68 -15
  24. package/dist/admin/chunks/History-B7dGNfmx.mjs.map +1 -0
  25. package/dist/admin/chunks/{History-BlLKDZSw.js → History-CEoOna4w.js} +67 -14
  26. package/dist/admin/chunks/History-CEoOna4w.js.map +1 -0
  27. package/dist/admin/chunks/{Input-CLX3C5DI.js → Input-B3QUS9rv.mjs} +2273 -511
  28. package/dist/admin/chunks/Input-B3QUS9rv.mjs.map +1 -0
  29. package/dist/admin/chunks/{Input-DiR2Xfa7.js → Input-B8I0b9aD.js} +2284 -519
  30. package/dist/admin/chunks/Input-B8I0b9aD.js.map +1 -0
  31. package/dist/admin/chunks/{ListConfigurationPage-DdTp-HxB.js → ListConfigurationPage-BbjJweN-.js} +7 -7
  32. package/dist/admin/chunks/{ListConfigurationPage-DdTp-HxB.js.map → ListConfigurationPage-BbjJweN-.js.map} +1 -1
  33. package/dist/admin/chunks/{ListConfigurationPage-CNvotSqe.js → ListConfigurationPage-VtFQ5mOK.mjs} +8 -8
  34. package/dist/admin/chunks/ListConfigurationPage-VtFQ5mOK.mjs.map +1 -0
  35. package/dist/admin/chunks/{ListViewPage-MJNfQTp-.js → ListViewPage-Cg3zbT7Y.mjs} +5 -5
  36. package/dist/admin/chunks/ListViewPage-Cg3zbT7Y.mjs.map +1 -0
  37. package/dist/admin/chunks/{ListViewPage-BtXYjEYz.js → ListViewPage-CzUm2VJN.js} +8 -8
  38. package/dist/admin/chunks/{ListViewPage-BtXYjEYz.js.map → ListViewPage-CzUm2VJN.js.map} +1 -1
  39. package/dist/admin/chunks/{NoContentTypePage-CVvVpwj4.js → NoContentTypePage-FcLLn2Wt.js} +3 -2
  40. package/dist/admin/chunks/{NoContentTypePage-BJrZvYPY.js.map → NoContentTypePage-FcLLn2Wt.js.map} +1 -1
  41. package/dist/admin/chunks/{NoContentTypePage-BJrZvYPY.js → NoContentTypePage-NOf7Aq_E.mjs} +3 -2
  42. package/dist/admin/chunks/NoContentTypePage-NOf7Aq_E.mjs.map +1 -0
  43. package/dist/admin/chunks/{NoPermissionsPage-C5yWg70d.js → NoPermissionsPage-DmeyXtCk.js} +3 -2
  44. package/dist/admin/chunks/{NoPermissionsPage-BulvG4hB.js.map → NoPermissionsPage-DmeyXtCk.js.map} +1 -1
  45. package/dist/admin/chunks/{NoPermissionsPage-BulvG4hB.js → NoPermissionsPage-OVr9KG6L.mjs} +3 -2
  46. package/dist/admin/chunks/NoPermissionsPage-OVr9KG6L.mjs.map +1 -0
  47. package/dist/admin/chunks/Preview-BH9l1QXk.mjs +593 -0
  48. package/dist/admin/chunks/Preview-BH9l1QXk.mjs.map +1 -0
  49. package/dist/admin/chunks/Preview-BYKkpc11.js +615 -0
  50. package/dist/admin/chunks/Preview-BYKkpc11.js.map +1 -0
  51. package/dist/admin/chunks/{ar-DckYq_WK.js → ar-DckYq_WK.mjs} +1 -1
  52. package/dist/admin/chunks/ar-DckYq_WK.mjs.map +1 -0
  53. package/dist/admin/chunks/{ca-DviY7mRj.js → ca-DviY7mRj.mjs} +1 -1
  54. package/dist/admin/chunks/ca-DviY7mRj.mjs.map +1 -0
  55. package/dist/admin/chunks/{cs-C7OSYFQ7.js → cs-C7OSYFQ7.mjs} +1 -1
  56. package/dist/admin/chunks/cs-C7OSYFQ7.mjs.map +1 -0
  57. package/dist/admin/chunks/{de-5QRlDHyR.js → de-5QRlDHyR.mjs} +1 -1
  58. package/dist/admin/chunks/de-5QRlDHyR.mjs.map +1 -0
  59. package/dist/admin/chunks/{en-LfhocNG2.js → en-C2zEwS3-.mjs} +6 -1
  60. package/dist/admin/chunks/en-C2zEwS3-.mjs.map +1 -0
  61. package/dist/admin/chunks/{en-C1CjdAtC.js → en-G976DLsg.js} +6 -1
  62. package/dist/admin/chunks/{en-LfhocNG2.js.map → en-G976DLsg.js.map} +1 -1
  63. package/dist/admin/chunks/{es-DkoWSExG.js → es-DkoWSExG.mjs} +1 -1
  64. package/dist/admin/chunks/es-DkoWSExG.mjs.map +1 -0
  65. package/dist/admin/chunks/{eu-BG1xX7HK.js → eu-BG1xX7HK.mjs} +1 -1
  66. package/dist/admin/chunks/eu-BG1xX7HK.mjs.map +1 -0
  67. package/dist/admin/chunks/{fr-CFdRaRVj.js → fr-CFdRaRVj.mjs} +1 -1
  68. package/dist/admin/chunks/fr-CFdRaRVj.mjs.map +1 -0
  69. package/dist/admin/chunks/{gu-D5MMMXRs.js → gu-D5MMMXRs.mjs} +1 -1
  70. package/dist/admin/chunks/gu-D5MMMXRs.mjs.map +1 -0
  71. package/dist/admin/chunks/{hi-lp17SCjr.js → hi-lp17SCjr.mjs} +1 -1
  72. package/dist/admin/chunks/hi-lp17SCjr.mjs.map +1 -0
  73. package/dist/admin/chunks/{hooks-DMvik5y_.js → hooks-DMvik5y_.mjs} +1 -1
  74. package/dist/admin/chunks/hooks-DMvik5y_.mjs.map +1 -0
  75. package/dist/admin/chunks/{hu-CLka1U2C.js → hu-CLka1U2C.mjs} +1 -1
  76. package/dist/admin/chunks/hu-CLka1U2C.mjs.map +1 -0
  77. package/dist/admin/chunks/{id-USfY9m1g.js → id-USfY9m1g.mjs} +1 -1
  78. package/dist/admin/chunks/id-USfY9m1g.mjs.map +1 -0
  79. package/dist/admin/chunks/{index-BRlRBRLb.js → index-BE7PI9Wp.mjs} +273 -173
  80. package/dist/admin/chunks/index-BE7PI9Wp.mjs.map +1 -0
  81. package/dist/admin/chunks/{index-ZIwOPk6p.js → index-BwIhYBsG.js} +246 -142
  82. package/dist/admin/chunks/index-BwIhYBsG.js.map +1 -0
  83. package/dist/admin/chunks/{it-BAHrwmYS.js → it-BAHrwmYS.mjs} +1 -1
  84. package/dist/admin/chunks/it-BAHrwmYS.mjs.map +1 -0
  85. package/dist/admin/chunks/{ja-BWKmBJFT.js → ja-BWKmBJFT.mjs} +1 -1
  86. package/dist/admin/chunks/ja-BWKmBJFT.mjs.map +1 -0
  87. package/dist/admin/chunks/{ko-CgADGBNt.js → ko-CgADGBNt.mjs} +1 -1
  88. package/dist/admin/chunks/ko-CgADGBNt.mjs.map +1 -0
  89. package/dist/admin/chunks/{layout-B3-guCPG.js → layout-9zlUM9V3.mjs} +81 -7
  90. package/dist/admin/chunks/layout-9zlUM9V3.mjs.map +1 -0
  91. package/dist/admin/chunks/{layout-ameRNiAM.js → layout-Cr0HaJVS.js} +87 -13
  92. package/dist/admin/chunks/layout-Cr0HaJVS.js.map +1 -0
  93. package/dist/admin/chunks/{ml-CnhCfOn_.js → ml-CnhCfOn_.mjs} +1 -1
  94. package/dist/admin/chunks/ml-CnhCfOn_.mjs.map +1 -0
  95. package/dist/admin/chunks/{ms-Bh09NFff.js → ms-Bh09NFff.mjs} +1 -1
  96. package/dist/admin/chunks/ms-Bh09NFff.mjs.map +1 -0
  97. package/dist/admin/chunks/{nl-C8HYflTc.js → nl-C8HYflTc.mjs} +1 -1
  98. package/dist/admin/chunks/nl-C8HYflTc.mjs.map +1 -0
  99. package/dist/admin/chunks/{useDragAndDrop-gcqEJMnO.js → objects-BJTP843m.js} +73 -1
  100. package/dist/admin/chunks/objects-BJTP843m.js.map +1 -0
  101. package/dist/admin/chunks/{useDragAndDrop-HYwNDExe.js → objects-D2z-IJgu.mjs} +72 -2
  102. package/dist/admin/chunks/objects-D2z-IJgu.mjs.map +1 -0
  103. package/dist/admin/chunks/{pl-MFCZJZuZ.js → pl-MFCZJZuZ.mjs} +1 -1
  104. package/dist/admin/chunks/pl-MFCZJZuZ.mjs.map +1 -0
  105. package/dist/admin/chunks/{pt-BR-CcotyBGJ.js → pt-BR-CcotyBGJ.mjs} +1 -1
  106. package/dist/admin/chunks/pt-BR-CcotyBGJ.mjs.map +1 -0
  107. package/dist/admin/chunks/{pt-HbmgeiYO.js → pt-HbmgeiYO.mjs} +1 -1
  108. package/dist/admin/chunks/pt-HbmgeiYO.mjs.map +1 -0
  109. package/dist/admin/chunks/{ru-CB4BUyQp.js → ru-CB4BUyQp.mjs} +1 -1
  110. package/dist/admin/chunks/{ru-CB4BUyQp.js.map → ru-CB4BUyQp.mjs.map} +1 -1
  111. package/dist/admin/chunks/{sa-n_aPA-pU.js → sa-n_aPA-pU.mjs} +1 -1
  112. package/dist/admin/chunks/sa-n_aPA-pU.mjs.map +1 -0
  113. package/dist/admin/chunks/{sk-tn_BDjE2.js → sk-tn_BDjE2.mjs} +1 -1
  114. package/dist/admin/chunks/sk-tn_BDjE2.mjs.map +1 -0
  115. package/dist/admin/chunks/{sv-cq4ZrQRd.js → sv-cq4ZrQRd.mjs} +1 -1
  116. package/dist/admin/chunks/sv-cq4ZrQRd.mjs.map +1 -0
  117. package/dist/admin/chunks/{th-mUH7hEtc.js → th-mUH7hEtc.mjs} +1 -1
  118. package/dist/admin/chunks/th-mUH7hEtc.mjs.map +1 -0
  119. package/dist/admin/chunks/{tr-Yt38daxh.js → tr-Yt38daxh.mjs} +1 -1
  120. package/dist/admin/chunks/tr-Yt38daxh.mjs.map +1 -0
  121. package/dist/admin/chunks/uk-BtM6WnaE.mjs +313 -0
  122. package/dist/admin/chunks/uk-BtM6WnaE.mjs.map +1 -0
  123. package/dist/admin/chunks/uk-DB6OgySY.js +318 -0
  124. package/dist/admin/chunks/{en-C1CjdAtC.js.map → uk-DB6OgySY.js.map} +1 -1
  125. package/dist/admin/chunks/{relations-CmoFVrKj.js → usePrev-DgZBp9Oo.js} +18 -2
  126. package/dist/admin/chunks/usePrev-DgZBp9Oo.js.map +1 -0
  127. package/dist/admin/chunks/{relations-DYQAaXwZ.js → usePrev-PisKKvhT.mjs} +18 -4
  128. package/dist/admin/chunks/usePrev-PisKKvhT.mjs.map +1 -0
  129. package/dist/admin/chunks/{vi-CvBGlTjr.js → vi-CvBGlTjr.mjs} +1 -1
  130. package/dist/admin/chunks/vi-CvBGlTjr.mjs.map +1 -0
  131. package/dist/admin/chunks/{zh-BmF-sHaT.js → zh-BmF-sHaT.mjs} +1 -1
  132. package/dist/admin/chunks/zh-BmF-sHaT.mjs.map +1 -0
  133. package/dist/admin/chunks/{zh-Hans-CI0HKio3.js → zh-Hans-CI0HKio3.mjs} +1 -1
  134. package/dist/admin/chunks/{zh-Hans-CI0HKio3.js.map → zh-Hans-CI0HKio3.mjs.map} +1 -1
  135. package/dist/admin/index.js +2 -1
  136. package/dist/admin/index.js.map +1 -1
  137. package/dist/admin/index.mjs +2 -1
  138. package/dist/admin/index.mjs.map +1 -1
  139. package/dist/admin/src/components/InjectionZone.d.ts +7 -1
  140. package/dist/admin/src/content-manager.d.ts +4 -0
  141. package/dist/admin/src/features/DocumentContext.d.ts +53 -0
  142. package/dist/admin/src/features/DocumentRBAC.d.ts +3 -2
  143. package/dist/admin/src/hooks/useDocument.d.ts +2 -0
  144. package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -0
  145. package/dist/admin/src/index.d.ts +1 -0
  146. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +2 -1
  147. package/dist/admin/src/pages/EditView/components/EditorToolbarObserver.d.ts +11 -0
  148. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +49 -0
  149. package/dist/admin/src/pages/EditView/components/FormInputs/Relations/RelationModal.d.ts +8 -0
  150. package/dist/admin/src/pages/EditView/components/FormInputs/{Relations.d.ts → Relations/Relations.d.ts} +8 -2
  151. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +1 -2
  152. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +9 -3
  153. package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +7 -4
  154. package/dist/admin/src/preview/components/PreviewHeader.d.ts +1 -2
  155. package/dist/admin/src/preview/pages/Preview.d.ts +2 -0
  156. package/dist/server/index.js +1 -1
  157. package/dist/server/index.js.map +1 -1
  158. package/dist/server/index.mjs +1 -1
  159. package/dist/server/index.mjs.map +1 -1
  160. package/package.json +8 -8
  161. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js.map +0 -1
  162. package/dist/admin/chunks/ComponentConfigurationPage-DhYZp4nN.js.map +0 -1
  163. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js.map +0 -1
  164. package/dist/admin/chunks/EditConfigurationPage-DDuPch5d.js.map +0 -1
  165. package/dist/admin/chunks/EditViewPage-jCZnUuCR.js +0 -265
  166. package/dist/admin/chunks/EditViewPage-jCZnUuCR.js.map +0 -1
  167. package/dist/admin/chunks/EditViewPage-zSnDwLz3.js +0 -288
  168. package/dist/admin/chunks/EditViewPage-zSnDwLz3.js.map +0 -1
  169. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js.map +0 -1
  170. package/dist/admin/chunks/Form-CZmB6JIg.js.map +0 -1
  171. package/dist/admin/chunks/History-BlLKDZSw.js.map +0 -1
  172. package/dist/admin/chunks/History-CPYXgxkS.js.map +0 -1
  173. package/dist/admin/chunks/Input-CLX3C5DI.js.map +0 -1
  174. package/dist/admin/chunks/Input-DiR2Xfa7.js.map +0 -1
  175. package/dist/admin/chunks/ListConfigurationPage-CNvotSqe.js.map +0 -1
  176. package/dist/admin/chunks/ListViewPage-MJNfQTp-.js.map +0 -1
  177. package/dist/admin/chunks/NoContentTypePage-CVvVpwj4.js.map +0 -1
  178. package/dist/admin/chunks/NoPermissionsPage-C5yWg70d.js.map +0 -1
  179. package/dist/admin/chunks/Preview-DEuQgQg2.js +0 -482
  180. package/dist/admin/chunks/Preview-DEuQgQg2.js.map +0 -1
  181. package/dist/admin/chunks/Preview-H74FQ9Cq.js +0 -504
  182. package/dist/admin/chunks/Preview-H74FQ9Cq.js.map +0 -1
  183. package/dist/admin/chunks/Relations-C8jbZPVK.js +0 -827
  184. package/dist/admin/chunks/Relations-C8jbZPVK.js.map +0 -1
  185. package/dist/admin/chunks/Relations-mxOUS7TJ.js +0 -853
  186. package/dist/admin/chunks/Relations-mxOUS7TJ.js.map +0 -1
  187. package/dist/admin/chunks/ar-DckYq_WK.js.map +0 -1
  188. package/dist/admin/chunks/ca-DviY7mRj.js.map +0 -1
  189. package/dist/admin/chunks/cs-C7OSYFQ7.js.map +0 -1
  190. package/dist/admin/chunks/de-5QRlDHyR.js.map +0 -1
  191. package/dist/admin/chunks/es-DkoWSExG.js.map +0 -1
  192. package/dist/admin/chunks/eu-BG1xX7HK.js.map +0 -1
  193. package/dist/admin/chunks/fr-CFdRaRVj.js.map +0 -1
  194. package/dist/admin/chunks/gu-D5MMMXRs.js.map +0 -1
  195. package/dist/admin/chunks/hi-lp17SCjr.js.map +0 -1
  196. package/dist/admin/chunks/hooks-DMvik5y_.js.map +0 -1
  197. package/dist/admin/chunks/hu-CLka1U2C.js.map +0 -1
  198. package/dist/admin/chunks/id-USfY9m1g.js.map +0 -1
  199. package/dist/admin/chunks/index-BRlRBRLb.js.map +0 -1
  200. package/dist/admin/chunks/index-ZIwOPk6p.js.map +0 -1
  201. package/dist/admin/chunks/it-BAHrwmYS.js.map +0 -1
  202. package/dist/admin/chunks/ja-BWKmBJFT.js.map +0 -1
  203. package/dist/admin/chunks/ko-CgADGBNt.js.map +0 -1
  204. package/dist/admin/chunks/layout-B3-guCPG.js.map +0 -1
  205. package/dist/admin/chunks/layout-ameRNiAM.js.map +0 -1
  206. package/dist/admin/chunks/ml-CnhCfOn_.js.map +0 -1
  207. package/dist/admin/chunks/ms-Bh09NFff.js.map +0 -1
  208. package/dist/admin/chunks/nl-C8HYflTc.js.map +0 -1
  209. package/dist/admin/chunks/objects-C3EebVVe.js +0 -76
  210. package/dist/admin/chunks/objects-C3EebVVe.js.map +0 -1
  211. package/dist/admin/chunks/objects-wl73iEma.js +0 -73
  212. package/dist/admin/chunks/objects-wl73iEma.js.map +0 -1
  213. package/dist/admin/chunks/pl-MFCZJZuZ.js.map +0 -1
  214. package/dist/admin/chunks/pt-BR-CcotyBGJ.js.map +0 -1
  215. package/dist/admin/chunks/pt-HbmgeiYO.js.map +0 -1
  216. package/dist/admin/chunks/relations-CmoFVrKj.js.map +0 -1
  217. package/dist/admin/chunks/relations-DYQAaXwZ.js.map +0 -1
  218. package/dist/admin/chunks/sa-n_aPA-pU.js.map +0 -1
  219. package/dist/admin/chunks/sk-tn_BDjE2.js.map +0 -1
  220. package/dist/admin/chunks/sv-cq4ZrQRd.js.map +0 -1
  221. package/dist/admin/chunks/th-mUH7hEtc.js.map +0 -1
  222. package/dist/admin/chunks/tr-Yt38daxh.js.map +0 -1
  223. package/dist/admin/chunks/uk-B24MoTVg.js +0 -145
  224. package/dist/admin/chunks/uk-B24MoTVg.js.map +0 -1
  225. package/dist/admin/chunks/uk-Cpgmm7gE.js +0 -140
  226. package/dist/admin/chunks/uk-Cpgmm7gE.js.map +0 -1
  227. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js.map +0 -1
  228. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +0 -1
  229. package/dist/admin/chunks/usePrev-Bjw2dhmq.js +0 -18
  230. package/dist/admin/chunks/usePrev-Bjw2dhmq.js.map +0 -1
  231. package/dist/admin/chunks/usePrev-DIYl-IAL.js +0 -21
  232. package/dist/admin/chunks/usePrev-DIYl-IAL.js.map +0 -1
  233. package/dist/admin/chunks/vi-CvBGlTjr.js.map +0 -1
  234. package/dist/admin/chunks/zh-BmF-sHaT.js.map +0 -1
  235. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +0 -0
  236. package/dist/admin/src/preview/components/PreviewContent.d.ts +0 -3
@@ -0,0 +1,615 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var strapiAdmin = require('@strapi/admin/strapi-admin');
6
+ var designSystem = require('@strapi/design-system');
7
+ var Icons = require('@strapi/icons');
8
+ var reactIntl = require('react-intl');
9
+ var reactRouterDom = require('react-router-dom');
10
+ var styledComponents = require('styled-components');
11
+ var index = require('./index-BwIhYBsG.js');
12
+ var Input = require('./Input-B8I0b9aD.js');
13
+ var qs = require('qs');
14
+ var EditViewPage = require('./EditViewPage-CuQfZJDf.js');
15
+ require('lodash/fp/mapValues');
16
+ require('yup');
17
+ require('fractional-indexing');
18
+ require('lodash/fp/pipe');
19
+ require('date-fns');
20
+ require('@reduxjs/toolkit');
21
+ require('prismjs');
22
+ require('slate');
23
+ require('slate-history');
24
+ require('slate-react');
25
+ require('prismjs/themes/prism-solarizedlight.css');
26
+ require('prismjs/components/prism-asmatmel');
27
+ require('prismjs/components/prism-bash');
28
+ require('prismjs/components/prism-basic');
29
+ require('prismjs/components/prism-c');
30
+ require('prismjs/components/prism-clojure');
31
+ require('prismjs/components/prism-cobol');
32
+ require('prismjs/components/prism-cpp');
33
+ require('prismjs/components/prism-csharp');
34
+ require('prismjs/components/prism-dart');
35
+ require('prismjs/components/prism-docker');
36
+ require('prismjs/components/prism-elixir');
37
+ require('prismjs/components/prism-erlang');
38
+ require('prismjs/components/prism-fortran');
39
+ require('prismjs/components/prism-fsharp');
40
+ require('prismjs/components/prism-go');
41
+ require('prismjs/components/prism-graphql');
42
+ require('prismjs/components/prism-groovy');
43
+ require('prismjs/components/prism-haskell');
44
+ require('prismjs/components/prism-haxe');
45
+ require('prismjs/components/prism-ini');
46
+ require('prismjs/components/prism-java');
47
+ require('prismjs/components/prism-javascript');
48
+ require('prismjs/components/prism-jsx');
49
+ require('prismjs/components/prism-json');
50
+ require('prismjs/components/prism-julia');
51
+ require('prismjs/components/prism-kotlin');
52
+ require('prismjs/components/prism-latex');
53
+ require('prismjs/components/prism-lua');
54
+ require('prismjs/components/prism-markdown');
55
+ require('prismjs/components/prism-matlab');
56
+ require('prismjs/components/prism-makefile');
57
+ require('prismjs/components/prism-objectivec');
58
+ require('prismjs/components/prism-perl');
59
+ require('prismjs/components/prism-php');
60
+ require('prismjs/components/prism-powershell');
61
+ require('prismjs/components/prism-python');
62
+ require('prismjs/components/prism-r');
63
+ require('prismjs/components/prism-ruby');
64
+ require('prismjs/components/prism-rust');
65
+ require('prismjs/components/prism-sas');
66
+ require('prismjs/components/prism-scala');
67
+ require('prismjs/components/prism-scheme');
68
+ require('prismjs/components/prism-sql');
69
+ require('prismjs/components/prism-stata');
70
+ require('prismjs/components/prism-swift');
71
+ require('prismjs/components/prism-typescript');
72
+ require('prismjs/components/prism-tsx');
73
+ require('prismjs/components/prism-vbnet');
74
+ require('prismjs/components/prism-yaml');
75
+ require('./usePrev-DgZBp9Oo.js');
76
+ require('./objects-BJTP843m.js');
77
+ require('react-dnd');
78
+ require('lodash/clone');
79
+ require('lodash/toPath');
80
+ require('@radix-ui/react-toolbar');
81
+ require('react-dnd-html5-backend');
82
+ require('./ComponentIcon-C-EjOUPA.js');
83
+ require('@strapi/icons/symbols');
84
+ require('react-window');
85
+ require('codemirror5');
86
+ require('sanitize-html');
87
+ require('highlight.js');
88
+ require('markdown-it');
89
+ require('markdown-it-abbr');
90
+ require('markdown-it-container');
91
+ require('markdown-it-deflist');
92
+ require('markdown-it-emoji');
93
+ require('markdown-it-footnote');
94
+ require('markdown-it-ins');
95
+ require('markdown-it-mark');
96
+ require('markdown-it-sub');
97
+ require('markdown-it-sup');
98
+ require('highlight.js/styles/solarized-dark.css');
99
+ require('codemirror5/addon/display/placeholder');
100
+
101
+ function _interopNamespaceDefault(e) {
102
+ var n = Object.create(null);
103
+ if (e) {
104
+ Object.keys(e).forEach(function (k) {
105
+ if (k !== 'default') {
106
+ var d = Object.getOwnPropertyDescriptor(e, k);
107
+ Object.defineProperty(n, k, d.get ? d : {
108
+ enumerable: true,
109
+ get: function () { return e[k]; }
110
+ });
111
+ }
112
+ });
113
+ }
114
+ n.default = e;
115
+ return Object.freeze(n);
116
+ }
117
+
118
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
119
+
120
+ /* -------------------------------------------------------------------------------------------------
121
+ * ClosePreviewButton
122
+ * -----------------------------------------------------------------------------------------------*/ const ClosePreviewButton = ()=>{
123
+ const [{ query }] = strapiAdmin.useQueryParams();
124
+ const { formatMessage } = reactIntl.useIntl();
125
+ const canGoBack = strapiAdmin.useHistory('BackButton', (state)=>state.canGoBack);
126
+ const goBack = strapiAdmin.useHistory('BackButton', (state)=>state.goBack);
127
+ const history = strapiAdmin.useHistory('BackButton', (state)=>state.history);
128
+ const locationIndex = strapiAdmin.useHistory('BackButton', (state)=>state.currentLocationIndex);
129
+ /**
130
+ * Get the link destination from the history.
131
+ * Rely on a fallback (the parent edit view page) if there's no page to go back .
132
+ */ const historyTo = canGoBack ? history.at(locationIndex - 2) : undefined;
133
+ const fallback = {
134
+ pathname: '..',
135
+ search: qs.stringify(query, {
136
+ encode: false
137
+ })
138
+ };
139
+ const toWithFallback = historyTo ?? fallback;
140
+ const handleClick = (e)=>{
141
+ if (canGoBack) {
142
+ // Prevent normal link behavior, go back in the history stack instead
143
+ e.preventDefault();
144
+ goBack();
145
+ return;
146
+ }
147
+ // Otherwise rely on native link behavior to go back to the edit view. We don't use navigate()
148
+ // here in order to get the relative="path" functionality from the Link component.
149
+ };
150
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.IconButton, {
151
+ variant: "ghost",
152
+ tag: reactRouterDom.Link,
153
+ relative: "path",
154
+ to: toWithFallback,
155
+ onClick: handleClick,
156
+ label: formatMessage({
157
+ id: 'content-manager.preview.header.close',
158
+ defaultMessage: 'Close preview'
159
+ }),
160
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.Cross, {})
161
+ });
162
+ };
163
+ /* -------------------------------------------------------------------------------------------------
164
+ * Status
165
+ * -----------------------------------------------------------------------------------------------*/ const Status = ()=>{
166
+ // Get status
167
+ const document = usePreviewContext('PreviewHeader', (state)=>state.document);
168
+ const schema = usePreviewContext('PreviewHeader', (state)=>state.schema);
169
+ const meta = usePreviewContext('PreviewHeader', (state)=>state.meta);
170
+ const hasDraftAndPublished = schema?.options?.draftAndPublish ?? false;
171
+ if (!hasDraftAndPublished) {
172
+ return null;
173
+ }
174
+ const status = EditViewPage.getDocumentStatus(document, meta);
175
+ return /*#__PURE__*/ jsxRuntime.jsx(index.DocumentStatus, {
176
+ status: status,
177
+ size: "XS"
178
+ });
179
+ };
180
+ const PreviewTabs = ()=>{
181
+ const { formatMessage } = reactIntl.useIntl();
182
+ // URL query params
183
+ const [{ query }, setQuery] = strapiAdmin.useQueryParams();
184
+ // Get status
185
+ const document = usePreviewContext('PreviewHeader', (state)=>state.document);
186
+ const schema = usePreviewContext('PreviewHeader', (state)=>state.schema);
187
+ const meta = usePreviewContext('PreviewHeader', (state)=>state.meta);
188
+ const hasDraftAndPublish = schema?.options?.draftAndPublish ?? false;
189
+ const documentStatus = EditViewPage.getDocumentStatus(document, meta);
190
+ const handleTabChange = (status)=>{
191
+ if (status === 'published' || status === 'draft') {
192
+ setQuery({
193
+ status
194
+ }, 'push', true);
195
+ }
196
+ };
197
+ if (!hasDraftAndPublish) {
198
+ return null;
199
+ }
200
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tabs.Root, {
201
+ variant: "simple",
202
+ value: query.status || 'draft',
203
+ onValueChange: handleTabChange,
204
+ children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Tabs.List, {
205
+ "aria-label": formatMessage({
206
+ id: 'preview.tabs.label',
207
+ defaultMessage: 'Document status'
208
+ }),
209
+ children: [
210
+ /*#__PURE__*/ jsxRuntime.jsx(StatusTab, {
211
+ value: "draft",
212
+ children: formatMessage({
213
+ id: 'content-manager.containers.List.draft',
214
+ defaultMessage: 'draft'
215
+ })
216
+ }),
217
+ /*#__PURE__*/ jsxRuntime.jsx(StatusTab, {
218
+ value: "published",
219
+ disabled: documentStatus === 'draft',
220
+ children: formatMessage({
221
+ id: 'content-manager.containers.List.published',
222
+ defaultMessage: 'published'
223
+ })
224
+ })
225
+ ]
226
+ })
227
+ });
228
+ };
229
+ /* -------------------------------------------------------------------------------------------------
230
+ * PreviewHeader
231
+ * -----------------------------------------------------------------------------------------------*/ const PreviewHeader = ()=>{
232
+ const title = usePreviewContext('PreviewHeader', (state)=>state.title);
233
+ const document = usePreviewContext('PreviewHeader', (state)=>state.document);
234
+ const schema = usePreviewContext('PreviewHeader', (state)=>state.schema);
235
+ const meta = usePreviewContext('PreviewHeader', (state)=>state.meta);
236
+ const plugins = strapiAdmin.useStrapiApp('PreviewHeader', (state)=>state.plugins);
237
+ const onPreview = index.useDocumentContext('PreviewHeader', (state)=>state.onPreview);
238
+ const [{ query }] = strapiAdmin.useQueryParams();
239
+ const { formatMessage } = reactIntl.useIntl();
240
+ const { toggleNotification } = strapiAdmin.useNotification();
241
+ const { copy } = strapiAdmin.useClipboard();
242
+ const handleCopyLink = ()=>{
243
+ copy(window.location.href);
244
+ toggleNotification({
245
+ message: formatMessage({
246
+ id: 'content-manager.preview.copy.success',
247
+ defaultMessage: 'Copied preview link'
248
+ }),
249
+ type: 'success'
250
+ });
251
+ };
252
+ const hasDraftAndPublish = schema.options?.draftAndPublish ?? false;
253
+ const documentActionProps = {
254
+ activeTab: query.status ?? null,
255
+ collectionType: schema.kind === 'collectionType' ? 'collection-types' : 'single-types',
256
+ model: schema.uid,
257
+ documentId: document.documentId,
258
+ document,
259
+ meta,
260
+ onPreview
261
+ };
262
+ return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
263
+ height: "48px",
264
+ gap: 4,
265
+ background: "neutral0",
266
+ borderColor: "neutral150",
267
+ tag: "header",
268
+ children: [
269
+ /*#__PURE__*/ jsxRuntime.jsxs(TitleContainer, {
270
+ height: "100%",
271
+ paddingLeft: 2,
272
+ paddingRight: 4,
273
+ children: [
274
+ /*#__PURE__*/ jsxRuntime.jsx(ClosePreviewButton, {}),
275
+ /*#__PURE__*/ jsxRuntime.jsx(PreviewTitle, {
276
+ tag: "h1",
277
+ title: title,
278
+ maxWidth: "200px",
279
+ fontSize: 2,
280
+ paddingLeft: 2,
281
+ paddingRight: 3,
282
+ fontWeight: 600,
283
+ children: title
284
+ }),
285
+ /*#__PURE__*/ jsxRuntime.jsx(Status, {})
286
+ ]
287
+ }),
288
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
289
+ flex: 1,
290
+ paddingRight: 2,
291
+ gap: 2,
292
+ justifyContent: hasDraftAndPublish ? 'space-between' : 'flex-end',
293
+ children: [
294
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
295
+ flex: "1 1 70%",
296
+ children: /*#__PURE__*/ jsxRuntime.jsx(PreviewTabs, {})
297
+ }),
298
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
299
+ gap: 2,
300
+ children: [
301
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.IconButton, {
302
+ type: "button",
303
+ label: formatMessage({
304
+ id: 'preview.copy.label',
305
+ defaultMessage: 'Copy preview link'
306
+ }),
307
+ onClick: handleCopyLink,
308
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.Link, {})
309
+ }),
310
+ /*#__PURE__*/ jsxRuntime.jsx(index.InjectionZone, {
311
+ area: "preview.actions"
312
+ }),
313
+ /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.DescriptionComponentRenderer, {
314
+ props: documentActionProps,
315
+ descriptions: plugins['content-manager'].apis.getDocumentActions('preview'),
316
+ children: (actions)=>{
317
+ const filteredActions = actions.filter((action)=>[
318
+ action.position
319
+ ].flat().includes('preview'));
320
+ const [primaryAction, secondaryAction] = filteredActions;
321
+ if (!primaryAction && !secondaryAction) return null;
322
+ // Both actions are available when draft and publish enabled
323
+ if (primaryAction && secondaryAction) {
324
+ return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
325
+ children: [
326
+ /*#__PURE__*/ jsxRuntime.jsx(index.DocumentActionButton, {
327
+ ...secondaryAction,
328
+ variant: secondaryAction.variant || 'secondary'
329
+ }),
330
+ /*#__PURE__*/ jsxRuntime.jsx(index.DocumentActionButton, {
331
+ ...primaryAction,
332
+ variant: primaryAction.variant || 'default'
333
+ })
334
+ ]
335
+ });
336
+ }
337
+ // Otherwise we just have the save action
338
+ return /*#__PURE__*/ jsxRuntime.jsx(index.DocumentActionButton, {
339
+ ...primaryAction,
340
+ variant: primaryAction.variant || 'secondary'
341
+ });
342
+ }
343
+ })
344
+ ]
345
+ })
346
+ ]
347
+ })
348
+ ]
349
+ });
350
+ };
351
+ const PreviewTitle = styledComponents.styled(designSystem.Typography)`
352
+ overflow: hidden;
353
+ text-overflow: ellipsis;
354
+ white-space: nowrap;
355
+ `;
356
+ const StatusTab = styledComponents.styled(designSystem.Tabs.Trigger)`
357
+ text-transform: uppercase;
358
+ `;
359
+ const TitleContainer = styledComponents.styled(designSystem.Flex)`
360
+ border-right: 1px solid ${({ theme })=>theme.colors.neutral150};
361
+ `;
362
+
363
+ const [PreviewProvider, usePreviewContext] = strapiAdmin.createContext('PreviewPage');
364
+ /* -------------------------------------------------------------------------------------------------
365
+ * PreviewPage
366
+ * -----------------------------------------------------------------------------------------------*/ const AnimatedArrow = styledComponents.styled(Icons.ArrowLineLeft)`
367
+ will-change: transform;
368
+ rotate: ${(props)=>props.isSideEditorOpen ? '0deg' : '180deg'};
369
+ transition: rotate 0.2s ease-in-out;
370
+ `;
371
+ const PreviewPage = ()=>{
372
+ const location = reactRouterDom.useLocation();
373
+ const { formatMessage } = reactIntl.useIntl();
374
+ const iframeRef = React__namespace.useRef(null);
375
+ const [isSideEditorOpen, setIsSideEditorOpen] = React__namespace.useState(true);
376
+ // Read all the necessary data from the URL to find the right preview URL
377
+ const { slug: model, id: documentId, collectionType } = reactRouterDom.useParams();
378
+ const [{ query }] = strapiAdmin.useQueryParams();
379
+ const params = React__namespace.useMemo(()=>index.buildValidParams(query), [
380
+ query
381
+ ]);
382
+ if (!collectionType) {
383
+ throw new Error('Could not find collectionType in url params');
384
+ }
385
+ if (!model) {
386
+ throw new Error('Could not find model in url params');
387
+ }
388
+ // Only collection types must have a documentId
389
+ if (collectionType === index.COLLECTION_TYPES && !documentId) {
390
+ throw new Error('Could not find documentId in url params');
391
+ }
392
+ const previewUrlResponse = index.useGetPreviewUrlQuery({
393
+ params: {
394
+ contentType: model
395
+ },
396
+ query: {
397
+ documentId,
398
+ locale: params.locale,
399
+ status: params.status
400
+ }
401
+ });
402
+ const documentResponse = index.useDocument({
403
+ model,
404
+ collectionType,
405
+ documentId,
406
+ params
407
+ });
408
+ const documentLayoutResponse = index.useDocumentLayout(model);
409
+ const isLoading = previewUrlResponse.isLoading || documentLayoutResponse.isLoading || documentResponse.isLoading;
410
+ if (isLoading && !documentResponse.document?.documentId) {
411
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
412
+ }
413
+ const initialValues = documentResponse.getInitialFormValues();
414
+ if (previewUrlResponse.error || documentLayoutResponse.error || !documentResponse.document || !documentResponse.meta || !documentResponse.schema || !initialValues) {
415
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
416
+ }
417
+ if (!previewUrlResponse.data?.data?.url) {
418
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.NoData, {});
419
+ }
420
+ const documentTitle = documentResponse.getTitle(documentLayoutResponse.edit.settings.mainField);
421
+ const validateSync = (values, options)=>{
422
+ const yupSchema = index.createYupSchema(documentResponse.schema?.attributes, documentResponse.components, {
423
+ status: documentResponse.document?.status,
424
+ ...options
425
+ });
426
+ return yupSchema.validateSync(values, {
427
+ abortEarly: false
428
+ });
429
+ };
430
+ const previewUrl = previewUrlResponse.data.data.url;
431
+ const onPreview = ()=>{
432
+ iframeRef?.current?.contentWindow?.postMessage({
433
+ type: 'strapiUpdate'
434
+ }, // The iframe origin is safe to use since it must be provided through the allowedOrigins config
435
+ new URL(iframeRef.current.src).origin);
436
+ };
437
+ return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
438
+ children: [
439
+ /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Title, {
440
+ children: formatMessage({
441
+ id: 'content-manager.preview.page-title',
442
+ defaultMessage: '{contentType} preview'
443
+ }, {
444
+ contentType: documentTitle
445
+ })
446
+ }),
447
+ /*#__PURE__*/ jsxRuntime.jsx(index.DocumentContextProvider, {
448
+ initialDocument: {
449
+ documentId: documentId || '',
450
+ model,
451
+ collectionType
452
+ },
453
+ onPreview: onPreview,
454
+ children: /*#__PURE__*/ jsxRuntime.jsx(PreviewProvider, {
455
+ url: previewUrl,
456
+ document: documentResponse.document,
457
+ title: documentTitle,
458
+ meta: documentResponse.meta,
459
+ schema: documentResponse.schema,
460
+ layout: documentLayoutResponse.edit,
461
+ children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Form, {
462
+ method: "PUT",
463
+ disabled: query.status === 'published' && documentResponse && documentResponse.document.status === 'published',
464
+ initialValues: documentResponse.getInitialFormValues(),
465
+ initialErrors: location?.state?.forceValidation ? validateSync(initialValues, {}) : {},
466
+ height: "100%",
467
+ validate: (values, options)=>{
468
+ const yupSchema = index.createYupSchema(documentResponse.schema?.attributes, documentResponse.components, {
469
+ status: documentResponse.document?.status,
470
+ ...options
471
+ });
472
+ return yupSchema.validate(values, {
473
+ abortEarly: false
474
+ });
475
+ },
476
+ children: ({ resetForm })=>/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
477
+ direction: "column",
478
+ height: "100%",
479
+ alignItems: "stretch",
480
+ children: [
481
+ /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Blocker, {
482
+ onProceed: resetForm
483
+ }),
484
+ /*#__PURE__*/ jsxRuntime.jsx(PreviewHeader, {}),
485
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
486
+ flex: 1,
487
+ overflow: "auto",
488
+ alignItems: "stretch",
489
+ children: [
490
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
491
+ overflow: "auto",
492
+ width: isSideEditorOpen ? '50%' : 0,
493
+ borderWidth: "0 1px 0 0",
494
+ borderColor: "neutral150",
495
+ paddingTop: 6,
496
+ paddingBottom: 6,
497
+ // Remove horizontal padding when the editor is closed or it won't fully disappear
498
+ paddingLeft: isSideEditorOpen ? 6 : 0,
499
+ paddingRight: isSideEditorOpen ? 6 : 0,
500
+ transition: "all 0.2s ease-in-out",
501
+ children: /*#__PURE__*/ jsxRuntime.jsx(Input.FormLayout, {
502
+ layout: documentLayoutResponse.edit.layout,
503
+ document: documentResponse,
504
+ hasBackground: false
505
+ })
506
+ }),
507
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Box, {
508
+ position: "relative",
509
+ flex: 1,
510
+ height: "100%",
511
+ overflow: "hidden",
512
+ children: [
513
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
514
+ "data-testid": "preview-iframe",
515
+ ref: iframeRef,
516
+ src: previewUrl,
517
+ title: formatMessage({
518
+ id: 'content-manager.preview.panel.title',
519
+ defaultMessage: 'Preview'
520
+ }),
521
+ width: "100%",
522
+ height: "100%",
523
+ borderWidth: 0,
524
+ tag: "iframe"
525
+ }, previewUrl),
526
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.IconButton, {
527
+ variant: "tertiary",
528
+ label: formatMessage(isSideEditorOpen ? {
529
+ id: 'content-manager.preview.content.close-editor',
530
+ defaultMessage: 'Close editor'
531
+ } : {
532
+ id: 'content-manager.preview.content.open-editor',
533
+ defaultMessage: 'Open editor'
534
+ }),
535
+ onClick: ()=>setIsSideEditorOpen((prev)=>!prev),
536
+ position: "absolute",
537
+ top: 2,
538
+ left: 2,
539
+ children: /*#__PURE__*/ jsxRuntime.jsx(AnimatedArrow, {
540
+ isSideEditorOpen: isSideEditorOpen
541
+ })
542
+ })
543
+ ]
544
+ })
545
+ ]
546
+ })
547
+ ]
548
+ })
549
+ })
550
+ })
551
+ })
552
+ ]
553
+ });
554
+ };
555
+ /* -------------------------------------------------------------------------------------------------
556
+ * ProtectedPreviewPage
557
+ * -----------------------------------------------------------------------------------------------*/ const ProtectedPreviewPageImpl = ()=>{
558
+ const { slug: model } = reactRouterDom.useParams();
559
+ const { permissions = [], isLoading, error } = strapiAdmin.useRBAC([
560
+ {
561
+ action: 'plugin::content-manager.explorer.read',
562
+ subject: model
563
+ },
564
+ {
565
+ action: 'plugin::content-manager.explorer.update',
566
+ subject: model
567
+ },
568
+ {
569
+ action: 'plugin::content-manager.explorer.publish',
570
+ subject: model
571
+ }
572
+ ]);
573
+ if (isLoading) {
574
+ return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
575
+ }
576
+ if (error || !model) {
577
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
578
+ height: "100vh",
579
+ width: "100vw",
580
+ position: "fixed",
581
+ top: 0,
582
+ left: 0,
583
+ zIndex: 2,
584
+ background: "neutral0",
585
+ children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Error, {})
586
+ });
587
+ }
588
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
589
+ height: "100vh",
590
+ width: "100vw",
591
+ position: "fixed",
592
+ top: 0,
593
+ left: 0,
594
+ zIndex: 2,
595
+ background: "neutral0",
596
+ children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Protect, {
597
+ permissions: permissions.filter((permission)=>permission.action.includes('explorer.read')),
598
+ children: /*#__PURE__*/ jsxRuntime.jsx(index.DocumentRBAC, {
599
+ permissions: permissions,
600
+ children: /*#__PURE__*/ jsxRuntime.jsx(PreviewPage, {})
601
+ })
602
+ })
603
+ });
604
+ };
605
+ const ProtectedPreviewPage = ()=>{
606
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Portal, {
607
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.FocusTrap, {
608
+ children: /*#__PURE__*/ jsxRuntime.jsx(ProtectedPreviewPageImpl, {})
609
+ })
610
+ });
611
+ };
612
+
613
+ exports.ProtectedPreviewPage = ProtectedPreviewPage;
614
+ exports.usePreviewContext = usePreviewContext;
615
+ //# sourceMappingURL=Preview-BYKkpc11.js.map