@jackuait/blok 0.16.0 → 0.17.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 (537) hide show
  1. package/dist/blok.cjs +1 -1
  2. package/dist/blok.iife.js +4 -4
  3. package/dist/blok.mjs +2 -2
  4. package/dist/blok.umd.js +4 -4
  5. package/dist/chunks/{blok-BTpZKZQ5.cjs → blok-BPd65xOj.cjs} +11 -11
  6. package/dist/chunks/{blok-RLzqfwql.mjs → blok-D4ApwnD7.mjs} +776 -780
  7. package/dist/chunks/constants-C3wBsvmH.cjs +606 -0
  8. package/dist/chunks/{constants-BUNgcIvY.mjs → constants-DObdf8NU.mjs} +274 -274
  9. package/dist/chunks/{i18next-loader-BH_a6G9t.mjs → i18next-loader-BMhspWFn.mjs} +1 -1
  10. package/dist/chunks/{i18next-loader-BID4jAFG.cjs → i18next-loader-CNLosgId.cjs} +1 -1
  11. package/dist/chunks/{lightweight-i18n-Clk37huC.cjs → lightweight-i18n-ByswFbdt.cjs} +1 -1
  12. package/dist/chunks/{lightweight-i18n-B0VO8Rft.mjs → lightweight-i18n-Ck1HlVxq.mjs} +32 -0
  13. package/dist/{messages-MYWse7vx2.mjs → chunks/messages--uPFKcl3.mjs} +41 -9
  14. package/dist/{messages-gmq1abXg.mjs → chunks/messages-0ZOxg81Y.mjs} +43 -11
  15. package/dist/{messages-BSvuvR6i.mjs → chunks/messages-1H2SY5H1.mjs} +54 -22
  16. package/dist/chunks/messages-1bAMgAsO.cjs +1 -0
  17. package/dist/chunks/messages-3B44ZmLZ.cjs +1 -0
  18. package/dist/chunks/messages-3iZ6jJ6e.cjs +1 -0
  19. package/dist/chunks/messages-5Rp1xyL4.cjs +1 -0
  20. package/dist/chunks/messages-5Vbzn-DL2.cjs +1 -0
  21. package/dist/{messages-K1RIXLxa.mjs → chunks/messages-61uWTg1y.mjs} +37 -5
  22. package/dist/chunks/messages-6lqZ4lhc2.cjs +1 -0
  23. package/dist/chunks/messages-795D2ldP2.cjs +1 -0
  24. package/dist/chunks/messages-79WWudxY.cjs +1 -0
  25. package/dist/chunks/messages-8uD5ctYP.cjs +1 -0
  26. package/dist/{messages-DL1HdFqf.mjs → chunks/messages-9gvi5jul.mjs} +38 -6
  27. package/dist/chunks/messages-B0o3rVBB.cjs +1 -0
  28. package/dist/chunks/messages-B1h0nDQW.cjs +1 -0
  29. package/dist/chunks/messages-B37vUkBi.cjs +1 -0
  30. package/dist/{messages-C0RxvQ_B2.mjs → chunks/messages-B4BvJtlu.mjs} +53 -21
  31. package/dist/{messages-m_U7v4rD.mjs → chunks/messages-BChCPw99.mjs} +45 -13
  32. package/dist/chunks/messages-BDs_gdD_.cjs +1 -0
  33. package/dist/chunks/messages-BE6rW2R-.cjs +1 -0
  34. package/dist/{messages-ZAVymtrA2.mjs → chunks/messages-BFGgLdIA2.mjs} +40 -8
  35. package/dist/chunks/{messages-Ci-rkkgx.mjs → messages-BFcq7wsx.mjs} +39 -7
  36. package/dist/{messages-ilnnXk3p.mjs → chunks/messages-BGaAuDRS.mjs} +41 -9
  37. package/dist/chunks/messages-BGoJHXUk2.cjs +1 -0
  38. package/dist/{messages-xSBQ46qE2.mjs → chunks/messages-BIHeeP7X2.mjs} +53 -21
  39. package/dist/chunks/{messages-8FnVkNsk2.mjs → messages-BIQ2VT8X2.mjs} +48 -16
  40. package/dist/{messages-DCwlxqBz.mjs → chunks/messages-BK32XCpH.mjs} +58 -26
  41. package/dist/{messages-BnpaaUnF2.mjs → chunks/messages-BKSDnjOs.mjs} +40 -8
  42. package/dist/chunks/{messages-7nxAnzdE2.mjs → messages-BMNmXaC8.mjs} +43 -11
  43. package/dist/{messages-BlkFLGrN.mjs → chunks/messages-BNuGVAEy.mjs} +40 -8
  44. package/dist/{messages-CI7MWoEP2.mjs → chunks/messages-BQEh67Mi2.mjs} +53 -21
  45. package/dist/chunks/messages-BQOx3XGd.cjs +1 -0
  46. package/dist/chunks/{messages-CIqhI4HT.mjs → messages-BQUzqXIO.mjs} +46 -14
  47. package/dist/{messages-BqjusG9f.mjs → chunks/messages-BTKPcoLu.mjs} +49 -17
  48. package/dist/chunks/messages-BXgTHDIw.cjs +1 -0
  49. package/dist/chunks/messages-BXvKhyQH.cjs +1 -0
  50. package/dist/chunks/messages-BYW-U0iT.cjs +1 -0
  51. package/dist/chunks/messages-B_lkWkPQ.cjs +1 -0
  52. package/dist/{messages-CaJp3hwf2.mjs → chunks/messages-BaWaLwcn2.mjs} +42 -10
  53. package/dist/chunks/messages-BeTQxvmX2.cjs +1 -0
  54. package/dist/chunks/messages-BfWGa4V82.cjs +1 -0
  55. package/dist/chunks/{messages-B19gfehr.mjs → messages-Bgzyr5Lh.mjs} +48 -16
  56. package/dist/chunks/messages-BjFB8sow.cjs +1 -0
  57. package/dist/chunks/messages-Bjmg_8lv2.cjs +1 -0
  58. package/dist/chunks/messages-BlOVJtaj.cjs +1 -0
  59. package/dist/{messages-DQiZK84h.mjs → chunks/messages-BnW_Fwro.mjs} +57 -25
  60. package/dist/chunks/messages-Bpvja9xW2.cjs +1 -0
  61. package/dist/chunks/messages-BtMQ6v_L.cjs +1 -0
  62. package/dist/chunks/messages-BvChjyuU2.cjs +1 -0
  63. package/dist/{messages-Ca6_kMBT2.mjs → chunks/messages-Bvge__AJ2.mjs} +45 -13
  64. package/dist/chunks/{messages-BSHC8Ohs.mjs → messages-BwxzN2q3.mjs} +43 -11
  65. package/dist/chunks/{messages-C81EnNxX.mjs → messages-Byntrl2c.mjs} +41 -9
  66. package/dist/chunks/{messages-CXbHVq05.mjs → messages-C3B8l3Hy.mjs} +49 -17
  67. package/dist/chunks/messages-C3fAHxfE2.cjs +1 -0
  68. package/dist/chunks/{messages-qjFVR3AK.mjs → messages-C56BTPcC.mjs} +38 -6
  69. package/dist/{messages-B3YNVBd1.mjs → chunks/messages-C6vijVZv2.mjs} +37 -5
  70. package/dist/{messages-C-_8o7te.mjs → chunks/messages-C79Ef9MU.mjs} +43 -11
  71. package/dist/{messages-D5u6vlu6.mjs → chunks/messages-C93gDUHr.mjs} +39 -7
  72. package/dist/chunks/messages-CAix8jdZ.cjs +1 -0
  73. package/dist/{messages-BqKW-hlt2.mjs → chunks/messages-CEUDK26P2.mjs} +42 -10
  74. package/dist/chunks/messages-CEZ528TO2.cjs +1 -0
  75. package/dist/chunks/{messages-DRKzAu-g.mjs → messages-CHx6m_Bo.mjs} +45 -13
  76. package/dist/chunks/messages-CKiWXTe1.cjs +1 -0
  77. package/dist/chunks/{messages-bJ7cOoA_.mjs → messages-CMFcaa9C.mjs} +46 -14
  78. package/dist/chunks/messages-CO4J7Nns.cjs +1 -0
  79. package/dist/chunks/messages-COTP4ZJ_2.cjs +1 -0
  80. package/dist/chunks/{messages-QeD4YPxL.mjs → messages-CV3U2Vsm.mjs} +41 -9
  81. package/dist/{messages--RL8UOhV.mjs → chunks/messages-CYOersvL.mjs} +48 -16
  82. package/dist/{messages-DZtr9UPl2.mjs → chunks/messages-C_s-wv1r2.mjs} +41 -9
  83. package/dist/{messages-CFSBN-tg.mjs → chunks/messages-CbdaJSfC2.mjs} +40 -8
  84. package/dist/chunks/{messages-DTKpwQ9o.mjs → messages-Ccng4hJ2.mjs} +44 -12
  85. package/dist/chunks/messages-Cgph4q9d.cjs +1 -0
  86. package/dist/chunks/messages-Cp7wFDrY2.cjs +1 -0
  87. package/dist/chunks/messages-CpZneXUI.cjs +1 -0
  88. package/dist/chunks/messages-CpbireNX.cjs +1 -0
  89. package/dist/{messages-BIUXljax.mjs → chunks/messages-CpcZgGYg.mjs} +41 -9
  90. package/dist/chunks/{messages-Bxz0TVBv2.mjs → messages-CqhQuuRo2.mjs} +93 -61
  91. package/dist/chunks/{messages-BVV2uB2V2.mjs → messages-CrFIbrXr2.mjs} +40 -8
  92. package/dist/chunks/messages-CrwZs1Gq.cjs +1 -0
  93. package/dist/{messages-7EaFUksm.mjs → chunks/messages-D0_Mxuh62.mjs} +40 -8
  94. package/dist/{messages-BrycA2Yd.mjs → chunks/messages-D1q601Wg.mjs} +37 -5
  95. package/dist/{messages-CRuD2YBl2.mjs → chunks/messages-D3kC7iDa2.mjs} +38 -6
  96. package/dist/{messages-CasKwW-A.mjs → chunks/messages-D4UnR6e52.mjs} +38 -6
  97. package/dist/chunks/messages-D5CeQW1e2.cjs +1 -0
  98. package/dist/chunks/messages-D8UH8jc6.cjs +1 -0
  99. package/dist/chunks/messages-DAmOTPVW2.cjs +1 -0
  100. package/dist/chunks/{messages-ZjheBuhT2.mjs → messages-DBPkzBZO2.mjs} +47 -15
  101. package/dist/chunks/messages-DEduQerF.cjs +1 -0
  102. package/dist/chunks/{messages-c1uiUe552.mjs → messages-DFA5OVrs2.mjs} +45 -13
  103. package/dist/chunks/messages-DHah-frn.cjs +1 -0
  104. package/dist/chunks/messages-DI1ZLPxM.cjs +1 -0
  105. package/dist/chunks/{messages-DsWiXnOy2.mjs → messages-DKJ5CX9h2.mjs} +45 -13
  106. package/dist/chunks/messages-DKjhx7Y3.cjs +1 -0
  107. package/dist/chunks/{messages-CO9-5XrF2.mjs → messages-DR5DyRRY2.mjs} +45 -13
  108. package/dist/{messages-BKrK8Axl.mjs → chunks/messages-DWjHAdb3.mjs} +44 -12
  109. package/dist/chunks/{messages-Hsn-3QW0.mjs → messages-DYsO5SIA.mjs} +50 -18
  110. package/dist/{messages-BaYuAoTP2.mjs → chunks/messages-DZwozMZD2.mjs} +66 -34
  111. package/dist/chunks/{messages-BrpXuY-6.mjs → messages-Db_L5RNl.mjs} +43 -11
  112. package/dist/chunks/messages-DeXUZcFn2.cjs +1 -0
  113. package/dist/chunks/messages-Dgp7Wk4H.cjs +1 -0
  114. package/dist/chunks/messages-DhnCZQEY.cjs +1 -0
  115. package/dist/chunks/messages-DjU1jbKf.cjs +1 -0
  116. package/dist/{messages-B9s898dI.mjs → chunks/messages-DkqiXPS7.mjs} +43 -11
  117. package/dist/chunks/messages-Dl6VC9Q9.cjs +1 -0
  118. package/dist/chunks/messages-Dlc1DdZ22.cjs +1 -0
  119. package/dist/chunks/{messages-DOCzIldx.mjs → messages-Dna-8bQq.mjs} +43 -11
  120. package/dist/chunks/{messages-D3exVYZD.mjs → messages-DtTgOx9a.mjs} +57 -25
  121. package/dist/{messages-eNnPQjam2.mjs → chunks/messages-Duj8jpve2.mjs} +61 -29
  122. package/dist/chunks/messages-DvxZjb5g2.cjs +1 -0
  123. package/dist/chunks/messages-Dz8AmvFq.cjs +1 -0
  124. package/dist/chunks/messages-DzarYc1J2.cjs +1 -0
  125. package/dist/{messages-B6p4UUC-.mjs → chunks/messages-FIgYAomz2.mjs} +45 -13
  126. package/dist/chunks/messages-FM0KHIkQ2.cjs +1 -0
  127. package/dist/chunks/messages-JsmKjXPZ.cjs +1 -0
  128. package/dist/chunks/{messages-CO6ZReE7.mjs → messages-LW9Kd-vn.mjs} +40 -8
  129. package/dist/chunks/{messages-CC4xe9xv.mjs → messages-R2RH1RLt.mjs} +52 -20
  130. package/dist/chunks/messages-RWVOHsZu.cjs +1 -0
  131. package/dist/{messages-DJMSsPuS.mjs → chunks/messages-X90YfYzG2.mjs} +37 -5
  132. package/dist/chunks/messages-YhmR1nl02.cjs +1 -0
  133. package/dist/chunks/messages-Ywb6VdfO2.cjs +1 -0
  134. package/dist/{messages-mcif9RnD.mjs → chunks/messages-ZPOc6IQC.mjs} +37 -5
  135. package/dist/chunks/messages-_ECIn1VC2.cjs +1 -0
  136. package/dist/chunks/messages-cYjlWqco.cjs +1 -0
  137. package/dist/chunks/{messages-BRWkudTR.mjs → messages-dp4NwDVM.mjs} +44 -12
  138. package/dist/{messages-BGIle7Xo.mjs → chunks/messages-hhT3Vii-.mjs} +46 -14
  139. package/dist/chunks/messages-iwzDjgrP.cjs +1 -0
  140. package/dist/chunks/{messages-Dly-_TB6.mjs → messages-k4Do3gkF.mjs} +54 -22
  141. package/dist/chunks/messages-l0nKmGOV.cjs +1 -0
  142. package/dist/chunks/messages-l7DqwqOu2.cjs +1 -0
  143. package/dist/{messages-wB8V2U2i2.mjs → chunks/messages-oLqnmqJf2.mjs} +38 -6
  144. package/dist/chunks/messages-sLVwrcar.cjs +1 -0
  145. package/dist/chunks/{messages-BoN_Bitl2.mjs → messages-yGQn67fw2.mjs} +48 -16
  146. package/dist/chunks/messages-zkunMjZf2.cjs +1 -0
  147. package/dist/chunks/{tools-ChneUeSu.mjs → tools-CM6aPuR4.mjs} +3542 -2301
  148. package/dist/chunks/tools-kfoXLTzY.cjs +208 -0
  149. package/dist/chunks/webm-muxer-CC98PYSV.cjs +5 -0
  150. package/dist/chunks/webm-muxer-CUUz719e.mjs +864 -0
  151. package/dist/full.cjs +1 -1
  152. package/dist/full.mjs +13 -13
  153. package/dist/locales.mjs +99 -67
  154. package/dist/{chunks/messages-DPV70Ys22.mjs → messages-1ZSVxDYN2.mjs} +42 -10
  155. package/dist/{messages-BY5WK3mB.mjs → messages-AK_9q2yu.mjs} +46 -14
  156. package/dist/{chunks/messages-BRN9bO60.mjs → messages-B0Gc0lBw.mjs} +37 -5
  157. package/dist/{messages-BTp7xsAK2.mjs → messages-B5THTOwb2.mjs} +45 -13
  158. package/dist/{messages-h1l_y01e.mjs → messages-B5xy5hCa.mjs} +43 -11
  159. package/dist/{messages-CSVzRRdj.mjs → messages-B6J8l1aF.mjs} +38 -6
  160. package/dist/{chunks/messages-R08pGvHm.mjs → messages-B7E1zFAv.mjs} +49 -17
  161. package/dist/{messages-D9CbvVgb.mjs → messages-B87GXoqt.mjs} +41 -9
  162. package/dist/{chunks/messages-D21eomvf.mjs → messages-B95smO_C.mjs} +41 -9
  163. package/dist/{messages-DO99T6qk2.mjs → messages-B9h-mKVO2.mjs} +57 -25
  164. package/dist/{chunks/messages-B9kHL94V.mjs → messages-BBb_hXxm.mjs} +43 -11
  165. package/dist/{messages-8wZYXCg7.mjs → messages-BDJfFuXR.mjs} +43 -11
  166. package/dist/{chunks/messages-DeK_vGCd2.mjs → messages-BH5AKf_i2.mjs} +53 -21
  167. package/dist/{chunks/messages-BrLLU_Dm.mjs → messages-BLslMhf-.mjs} +38 -6
  168. package/dist/{chunks/messages-C3qdarW42.mjs → messages-BPsdJnwT.mjs} +45 -13
  169. package/dist/{messages-CrcHeqGR.mjs → messages-BTrok9K8.mjs} +44 -12
  170. package/dist/{chunks/messages-D9MUpOtw2.mjs → messages-BctWdAZP2.mjs} +45 -13
  171. package/dist/{chunks/messages-DefTqLH32.mjs → messages-BhGHyHKC2.mjs} +53 -21
  172. package/dist/{messages-DA5IipN52.mjs → messages-BlInN8XP2.mjs} +48 -16
  173. package/dist/{chunks/messages-DPX9kFey.mjs → messages-Bn19MGza.mjs} +45 -13
  174. package/dist/{messages-CNzktVoM2.mjs → messages-BqFRlEJE2.mjs} +43 -11
  175. package/dist/{chunks/messages-DN6pprFJ2.mjs → messages-Bt5Sbl952.mjs} +66 -34
  176. package/dist/{chunks/messages-7bt8ujXQ.mjs → messages-Bumbqs6s.mjs} +37 -5
  177. package/dist/{chunks/messages-DcgNt1Bg2.mjs → messages-BvwVDbII.mjs} +40 -8
  178. package/dist/{chunks/messages-M1tLUpjT.mjs → messages-Bwese2OQ.mjs} +43 -11
  179. package/dist/{messages-DPiPd88g.mjs → messages-Bx5KWmyJ.mjs} +39 -7
  180. package/dist/{messages-BIRq0EVo.mjs → messages-ByntluqZ.mjs} +48 -16
  181. package/dist/{chunks/messages-JiQBxj4o2.mjs → messages-C-8BMvSp2.mjs} +42 -10
  182. package/dist/{messages-DGz70LLg2.mjs → messages-C-ytN6Dz2.mjs} +45 -13
  183. package/dist/{messages-Cu5AHbR-2.mjs → messages-C8QB980F2.mjs} +43 -11
  184. package/dist/{chunks/messages-BLtZ2DXE.mjs → messages-CCdDP2DE.mjs} +39 -7
  185. package/dist/{messages-CwavcZov.mjs → messages-CCgDqF-e.mjs} +47 -15
  186. package/dist/{messages-CN5mXtal2.mjs → messages-CLkbvdRh2.mjs} +49 -17
  187. package/dist/{messages-DlC9tgiV.mjs → messages-CQ6A0zI9.mjs} +93 -61
  188. package/dist/{chunks/messages-BakdNtus2.mjs → messages-CQnz6pXD2.mjs} +38 -6
  189. package/dist/{chunks/messages-R3IlcPVE2.mjs → messages-CQotju8u2.mjs} +41 -9
  190. package/dist/{chunks/messages-CHmoIrso.mjs → messages-CRL2ecWR.mjs} +37 -5
  191. package/dist/{chunks/messages-36KiD2Bx2.mjs → messages-CRhhyqEy2.mjs} +40 -8
  192. package/dist/{messages-BGfVV77O.mjs → messages-CSf1g9n_.mjs} +48 -16
  193. package/dist/{chunks/messages-C3ueCeDy.mjs → messages-CYuTyoK6.mjs} +54 -22
  194. package/dist/{messages-BUfHXzRi2.mjs → messages-Co2GV7rA2.mjs} +45 -13
  195. package/dist/{chunks/messages-Dk_PadZz.mjs → messages-CqtZ_gtb.mjs} +40 -8
  196. package/dist/{chunks/messages-CH_Aqn-k.mjs → messages-CxK_Vgra.mjs} +41 -9
  197. package/dist/{chunks/messages-VFdnkrDm2.mjs → messages-D08TSj5Q.mjs} +37 -5
  198. package/dist/{chunks/messages-8Qzw6Xju.mjs → messages-DFDw0nkI.mjs} +57 -25
  199. package/dist/{messages-DJRg4kFv2.mjs → messages-DKoeDmZV2.mjs} +45 -13
  200. package/dist/{chunks/messages-D33lcfdb.mjs → messages-DLKTwtBI.mjs} +43 -11
  201. package/dist/{messages-CMG59Rb62.mjs → messages-DQaDNQat2.mjs} +46 -14
  202. package/dist/{chunks/messages-Bh8al9kl.mjs → messages-DZlYqaxx.mjs} +58 -26
  203. package/dist/{chunks/messages-CnvK1Abd2.mjs → messages-D_ql7LL-2.mjs} +61 -29
  204. package/dist/{chunks/messages-CXzyyhBC.mjs → messages-Da09byG42.mjs} +41 -9
  205. package/dist/{chunks/messages-DN9_Nlre2.mjs → messages-DaKjx7Gh.mjs} +38 -6
  206. package/dist/{messages-Bgf1E-Vj.mjs → messages-Dc1aAz5V.mjs} +50 -18
  207. package/dist/{chunks/messages-t_RiQ_y02.mjs → messages-DlxBkSUv.mjs} +40 -8
  208. package/dist/{messages-CdLOD2b_2.mjs → messages-DoahmNMI2.mjs} +54 -22
  209. package/dist/{chunks/messages-hT-pjCQL.mjs → messages-DpbHfnge.mjs} +46 -14
  210. package/dist/{messages-DCqRZ9Pw.mjs → messages-DrjZz7u9.mjs} +41 -9
  211. package/dist/{chunks/messages-DiUTxAEQ.mjs → messages-DrwEVbKk2.mjs} +53 -21
  212. package/dist/{chunks/messages-3H-mU8nV.mjs → messages-DvIPbDsq.mjs} +44 -12
  213. package/dist/{chunks/messages-vQ8eiHPr2.mjs → messages-Dy3mYP_n.mjs} +37 -5
  214. package/dist/{chunks/messages-B2hS--KC.mjs → messages-STUXoPH72.mjs} +40 -8
  215. package/dist/{messages-BfFFrhbd.mjs → messages-Vfl9lWod.mjs} +44 -12
  216. package/dist/{messages-B-9u3fLG.mjs → messages-YPF71WjJ.mjs} +52 -20
  217. package/dist/{messages-CpqGtSQ9.mjs → messages-aPBlKHzr.mjs} +40 -8
  218. package/dist/{chunks/messages-BoGOF3jH.mjs → messages-bCZW7LiC.mjs} +48 -16
  219. package/dist/{chunks/messages-DqcQoY-I2.mjs → messages-kjO2WeG-2.mjs} +38 -6
  220. package/dist/{messages-DRdzJFUx2.mjs → messages-un7M6YZC2.mjs} +40 -8
  221. package/dist/react.cjs +1 -1
  222. package/dist/react.mjs +1 -1
  223. package/dist/tools.cjs +1 -1
  224. package/dist/tools.mjs +3 -3
  225. package/dist/vendor.LICENSE.txt +35 -0
  226. package/package.json +2 -1
  227. package/src/components/i18n/locales/am/messages.json +48 -17
  228. package/src/components/i18n/locales/ar/messages.json +38 -7
  229. package/src/components/i18n/locales/az/messages.json +47 -16
  230. package/src/components/i18n/locales/bg/messages.json +43 -12
  231. package/src/components/i18n/locales/bn/messages.json +53 -22
  232. package/src/components/i18n/locales/bs/messages.json +42 -11
  233. package/src/components/i18n/locales/cs/messages.json +45 -14
  234. package/src/components/i18n/locales/da/messages.json +42 -11
  235. package/src/components/i18n/locales/de/messages.json +44 -13
  236. package/src/components/i18n/locales/dv/messages.json +51 -20
  237. package/src/components/i18n/locales/el/messages.json +40 -9
  238. package/src/components/i18n/locales/en/messages.json +32 -0
  239. package/src/components/i18n/locales/es/messages.json +42 -11
  240. package/src/components/i18n/locales/et/messages.json +42 -11
  241. package/src/components/i18n/locales/fa/messages.json +40 -9
  242. package/src/components/i18n/locales/fi/messages.json +38 -7
  243. package/src/components/i18n/locales/fil/messages.json +45 -14
  244. package/src/components/i18n/locales/fr/messages.json +37 -6
  245. package/src/components/i18n/locales/gu/messages.json +40 -9
  246. package/src/components/i18n/locales/he/messages.json +43 -12
  247. package/src/components/i18n/locales/hi/messages.json +42 -11
  248. package/src/components/i18n/locales/hr/messages.json +49 -18
  249. package/src/components/i18n/locales/hu/messages.json +56 -25
  250. package/src/components/i18n/locales/hy/messages.json +43 -12
  251. package/src/components/i18n/locales/id/messages.json +47 -16
  252. package/src/components/i18n/locales/it/messages.json +36 -5
  253. package/src/components/i18n/locales/ja/messages.json +36 -5
  254. package/src/components/i18n/locales/ka/messages.json +39 -8
  255. package/src/components/i18n/locales/km/messages.json +46 -15
  256. package/src/components/i18n/locales/kn/messages.json +39 -8
  257. package/src/components/i18n/locales/ko/messages.json +39 -8
  258. package/src/components/i18n/locales/ku/messages.json +93 -62
  259. package/src/components/i18n/locales/lo/messages.json +37 -6
  260. package/src/components/i18n/locales/lt/messages.json +47 -16
  261. package/src/components/i18n/locales/lv/messages.json +36 -5
  262. package/src/components/i18n/locales/mk/messages.json +44 -13
  263. package/src/components/i18n/locales/ml/messages.json +36 -5
  264. package/src/components/i18n/locales/mn/messages.json +60 -29
  265. package/src/components/i18n/locales/mr/messages.json +40 -9
  266. package/src/components/i18n/locales/ms/messages.json +41 -10
  267. package/src/components/i18n/locales/my/messages.json +44 -13
  268. package/src/components/i18n/locales/ne/messages.json +44 -13
  269. package/src/components/i18n/locales/nl/messages.json +39 -8
  270. package/src/components/i18n/locales/no/messages.json +37 -6
  271. package/src/components/i18n/locales/pa/messages.json +65 -34
  272. package/src/components/i18n/locales/pl/messages.json +37 -6
  273. package/src/components/i18n/locales/ps/messages.json +52 -21
  274. package/src/components/i18n/locales/pt/messages.json +44 -13
  275. package/src/components/i18n/locales/ro/messages.json +44 -13
  276. package/src/components/i18n/locales/ru/messages.json +41 -10
  277. package/src/components/i18n/locales/sd/messages.json +52 -21
  278. package/src/components/i18n/locales/si/messages.json +47 -16
  279. package/src/components/i18n/locales/sk/messages.json +42 -11
  280. package/src/components/i18n/locales/sl/messages.json +44 -13
  281. package/src/components/i18n/locales/sq/messages.json +52 -21
  282. package/src/components/i18n/locales/sr/messages.json +56 -25
  283. package/src/components/i18n/locales/sv/messages.json +39 -8
  284. package/src/components/i18n/locales/sw/messages.json +48 -17
  285. package/src/components/i18n/locales/ta/messages.json +42 -11
  286. package/src/components/i18n/locales/te/messages.json +45 -14
  287. package/src/components/i18n/locales/th/messages.json +40 -9
  288. package/src/components/i18n/locales/tr/messages.json +39 -8
  289. package/src/components/i18n/locales/ug/messages.json +53 -22
  290. package/src/components/i18n/locales/uk/messages.json +40 -9
  291. package/src/components/i18n/locales/ur/messages.json +36 -5
  292. package/src/components/i18n/locales/vi/messages.json +37 -6
  293. package/src/components/i18n/locales/yi/messages.json +57 -26
  294. package/src/components/i18n/locales/zh/messages.json +39 -8
  295. package/src/components/icons/index.ts +106 -0
  296. package/src/components/modules/paste/handlers/pattern-handler.ts +4 -7
  297. package/src/components/utils/format-bytes.ts +15 -0
  298. package/src/components/utils/max-size.ts +36 -0
  299. package/src/components/utils/media-empty-state.ts +1 -11
  300. package/src/components/utils/upload-error-message.ts +43 -0
  301. package/src/styles/colors.css +31 -0
  302. package/src/styles/embed.css +4 -48
  303. package/src/styles/keyframes.css +8 -0
  304. package/src/styles/main.css +2 -0
  305. package/src/styles/resize-cue.css +26 -0
  306. package/src/styles/video.css +1221 -0
  307. package/src/tools/file/constants.ts +3 -0
  308. package/src/tools/file/index.ts +75 -4
  309. package/src/tools/file/uploader.ts +5 -2
  310. package/src/tools/image/constants.ts +1 -1
  311. package/src/tools/image/converted-uploader.ts +30 -0
  312. package/src/tools/image/gif-to-webm.ts +170 -0
  313. package/src/tools/image/index.ts +125 -3
  314. package/src/tools/image/resizer.ts +39 -6
  315. package/src/tools/image/uploader.ts +2 -1
  316. package/src/tools/image/uploading-state.ts +2 -1
  317. package/src/tools/index.ts +2 -0
  318. package/src/tools/link/embed/index.ts +61 -11
  319. package/src/tools/link/embed/overlay.ts +12 -95
  320. package/src/tools/table/index.ts +37 -1
  321. package/src/tools/table/table-cell-blocks.ts +65 -0
  322. package/src/tools/table/table-operations.ts +51 -2
  323. package/src/tools/table/table-row-col-action-handler.ts +25 -2
  324. package/src/tools/table/table-subsystems.ts +6 -1
  325. package/src/tools/video/constants.ts +22 -0
  326. package/src/tools/video/controls.ts +1448 -0
  327. package/src/tools/video/empty-state.ts +45 -0
  328. package/src/tools/video/i18n.ts +13 -0
  329. package/src/tools/video/index.ts +521 -0
  330. package/src/tools/video/ui.ts +83 -0
  331. package/src/tools/video/uploader.ts +75 -0
  332. package/types/configs/blok-config.d.ts +2 -9
  333. package/types/tools/file.d.ts +9 -3
  334. package/types/tools/image.d.ts +11 -2
  335. package/types/tools/max-size.d.ts +12 -0
  336. package/types/tools/video.d.ts +72 -0
  337. package/dist/chunks/constants-B1fDH6ZT.cjs +0 -539
  338. package/dist/chunks/messages--XZLcuUK.cjs +0 -1
  339. package/dist/chunks/messages-6adLi-J9.cjs +0 -1
  340. package/dist/chunks/messages-9xZnfk_-.cjs +0 -1
  341. package/dist/chunks/messages-B-7wgQm5.cjs +0 -1
  342. package/dist/chunks/messages-B4-kmmK72.cjs +0 -1
  343. package/dist/chunks/messages-BBh7sF4o.cjs +0 -1
  344. package/dist/chunks/messages-BIhN9JOT.cjs +0 -1
  345. package/dist/chunks/messages-BJU_3KpD.cjs +0 -1
  346. package/dist/chunks/messages-BNfoWRc02.cjs +0 -1
  347. package/dist/chunks/messages-BOrASwT4.cjs +0 -1
  348. package/dist/chunks/messages-BPWs2ZiL.cjs +0 -1
  349. package/dist/chunks/messages-BR6HUjXI.cjs +0 -1
  350. package/dist/chunks/messages-BWZYYHHF.cjs +0 -1
  351. package/dist/chunks/messages-BY3nxQWj.cjs +0 -1
  352. package/dist/chunks/messages-BYpAVGd12.cjs +0 -1
  353. package/dist/chunks/messages-BZzpf1UP.cjs +0 -1
  354. package/dist/chunks/messages-B_12_UjB.cjs +0 -1
  355. package/dist/chunks/messages-BaZ-Dtr92.cjs +0 -1
  356. package/dist/chunks/messages-BeaFn5UT.cjs +0 -1
  357. package/dist/chunks/messages-BgosUxKq2.cjs +0 -1
  358. package/dist/chunks/messages-BgrhLzFS.cjs +0 -1
  359. package/dist/chunks/messages-BmP5kV232.cjs +0 -1
  360. package/dist/chunks/messages-Bnp8vNJz.cjs +0 -1
  361. package/dist/chunks/messages-BpkV__T7.cjs +0 -1
  362. package/dist/chunks/messages-BqYqYBH02.cjs +0 -1
  363. package/dist/chunks/messages-Bv7MXv7R.cjs +0 -1
  364. package/dist/chunks/messages-Byi8D3Hp.cjs +0 -1
  365. package/dist/chunks/messages-C2tGk63O2.cjs +0 -1
  366. package/dist/chunks/messages-C8lWOU7O.cjs +0 -1
  367. package/dist/chunks/messages-C9Usx2VK.cjs +0 -1
  368. package/dist/chunks/messages-C9vxfOaB2.cjs +0 -1
  369. package/dist/chunks/messages-CBqID_rf2.cjs +0 -1
  370. package/dist/chunks/messages-CKaebA4N2.cjs +0 -1
  371. package/dist/chunks/messages-CNuuKnxY.cjs +0 -1
  372. package/dist/chunks/messages-CS1dVWiH2.cjs +0 -1
  373. package/dist/chunks/messages-CSHcjK_N2.cjs +0 -1
  374. package/dist/chunks/messages-CSWjZBVp2.cjs +0 -1
  375. package/dist/chunks/messages-CVi9dbMY2.cjs +0 -1
  376. package/dist/chunks/messages-CXkEnOpM2.cjs +0 -1
  377. package/dist/chunks/messages-Ch4PcGQ42.cjs +0 -1
  378. package/dist/chunks/messages-Cj12Zgsk.cjs +0 -1
  379. package/dist/chunks/messages-CjFn_dGR2.cjs +0 -1
  380. package/dist/chunks/messages-CnFZ_js2.cjs +0 -1
  381. package/dist/chunks/messages-CstdYlPl.cjs +0 -1
  382. package/dist/chunks/messages-CzEXG3wA2.cjs +0 -1
  383. package/dist/chunks/messages-CzW0fnvJ2.cjs +0 -1
  384. package/dist/chunks/messages-D2BWvpXy.cjs +0 -1
  385. package/dist/chunks/messages-D2jPVYje2.cjs +0 -1
  386. package/dist/chunks/messages-D8DMxR-v2.cjs +0 -1
  387. package/dist/chunks/messages-DAF4iFuz.cjs +0 -1
  388. package/dist/chunks/messages-DJpBxc3X.cjs +0 -1
  389. package/dist/chunks/messages-DJqLD3KO.cjs +0 -1
  390. package/dist/chunks/messages-DSFJ_vqv.cjs +0 -1
  391. package/dist/chunks/messages-DW0CLNsD.cjs +0 -1
  392. package/dist/chunks/messages-DZFhIff62.cjs +0 -1
  393. package/dist/chunks/messages-Dd56p0Kf.cjs +0 -1
  394. package/dist/chunks/messages-DigHfTmz.cjs +0 -1
  395. package/dist/chunks/messages-DkuidYgG.cjs +0 -1
  396. package/dist/chunks/messages-DoZqsswJ.cjs +0 -1
  397. package/dist/chunks/messages-DvmpvSeR.cjs +0 -1
  398. package/dist/chunks/messages-Dvurigo8.cjs +0 -1
  399. package/dist/chunks/messages-Dx16KgRk2.cjs +0 -1
  400. package/dist/chunks/messages-EjezcPS22.cjs +0 -1
  401. package/dist/chunks/messages-EsgioDiN.cjs +0 -1
  402. package/dist/chunks/messages-cDH-bKpE.cjs +0 -1
  403. package/dist/chunks/messages-lhqD_WQA.cjs +0 -1
  404. package/dist/chunks/messages-xndoTJ282.cjs +0 -1
  405. package/dist/chunks/tools-I_BZLnbG.cjs +0 -208
  406. /package/dist/chunks/{am-B37aLxvu.cjs → am-BA02TqF9.cjs} +0 -0
  407. /package/dist/chunks/{am-D7yfVqJS.mjs → am-C9_6r8HY.mjs} +0 -0
  408. /package/dist/chunks/{ar-D00SixXA.mjs → ar-BM96nSXF.mjs} +0 -0
  409. /package/dist/chunks/{ar-ySo_KDqd.cjs → ar-CB4IsGCa.cjs} +0 -0
  410. /package/dist/chunks/{az-BmIwKcoq.mjs → az-DnZSY5ok.mjs} +0 -0
  411. /package/dist/chunks/{az-nCoWuGBd.cjs → az-FykE_aDi.cjs} +0 -0
  412. /package/dist/chunks/{bg-BTZaB21W.mjs → bg-BplUvPeX.mjs} +0 -0
  413. /package/dist/chunks/{bg-BKB8_J3v.cjs → bg-D6r90gqH.cjs} +0 -0
  414. /package/dist/chunks/{bn-BQiBKtpR.cjs → bn-B7w2dbK4.cjs} +0 -0
  415. /package/dist/chunks/{bn-BVpf0XL6.mjs → bn-CdP9lnfr.mjs} +0 -0
  416. /package/dist/chunks/{bs-BSz4cPth.mjs → bs-BtX-qLsk.mjs} +0 -0
  417. /package/dist/chunks/{bs-D_lekdEb.cjs → bs-DztHHorM.cjs} +0 -0
  418. /package/dist/chunks/{cs-Dv8Jg_Fa.cjs → cs-CLMsCdIt.cjs} +0 -0
  419. /package/dist/chunks/{cs-p5s4GudH.mjs → cs-NcDYS-aU.mjs} +0 -0
  420. /package/dist/chunks/{da-BqJa8BMd.mjs → da-ANg6gK3-.mjs} +0 -0
  421. /package/dist/chunks/{da-D33rjz-t.cjs → da-sJ7EsHcO.cjs} +0 -0
  422. /package/dist/chunks/{de-BDDktkfI.mjs → de-CTxvRxuE.mjs} +0 -0
  423. /package/dist/chunks/{de-I8YFq0Ej.cjs → de-CxMqLKhy.cjs} +0 -0
  424. /package/dist/chunks/{el-BInM0nQo.cjs → el-Bg6QXLt5.cjs} +0 -0
  425. /package/dist/chunks/{el-R63G08P0.mjs → el-CgOoJaXB.mjs} +0 -0
  426. /package/dist/chunks/{es-Cj_AHhb9.cjs → es-7zUbslPJ.cjs} +0 -0
  427. /package/dist/chunks/{es-BleH_dHg.mjs → es-D5YDFRu-.mjs} +0 -0
  428. /package/dist/chunks/{et-BuISCVFl.mjs → et-57a7ees8.mjs} +0 -0
  429. /package/dist/chunks/{et-BkMzN_qG.cjs → et-D_rhRdDD.cjs} +0 -0
  430. /package/dist/chunks/{fa-CI9f3My0.mjs → fa-Dp_BXnBP.mjs} +0 -0
  431. /package/dist/chunks/{fa-C3VQIfEJ.cjs → fa-JBr2zsfI.cjs} +0 -0
  432. /package/dist/chunks/{fi-p8xxtchQ.cjs → fi-DjbYN6MA.cjs} +0 -0
  433. /package/dist/chunks/{fi-C0_Jyps9.mjs → fi-at45xjOS.mjs} +0 -0
  434. /package/dist/chunks/{fil-BZsJ4YZG.mjs → fil-D_HT2vGt.mjs} +0 -0
  435. /package/dist/chunks/{fil-DC8VTmfd.cjs → fil-dcVBIQoi.cjs} +0 -0
  436. /package/dist/chunks/{fr-BjeioA2N.mjs → fr-ByR9PLTE.mjs} +0 -0
  437. /package/dist/chunks/{fr-Cbstr5ii.cjs → fr-Ch4zj1rM.cjs} +0 -0
  438. /package/dist/chunks/{gu-DpPoUPem.cjs → gu-CoLW5Saq.cjs} +0 -0
  439. /package/dist/chunks/{gu-CNi9WnhQ.mjs → gu-CvfPvH3Y.mjs} +0 -0
  440. /package/dist/chunks/{he-Rlv-PVKK.cjs → he-2wS2DK0D.cjs} +0 -0
  441. /package/dist/chunks/{he-bU_Id5XQ.mjs → he-Bmqypvkq.mjs} +0 -0
  442. /package/dist/chunks/{hi-CYYjJgoQ.mjs → hi-DbcN0x64.mjs} +0 -0
  443. /package/dist/chunks/{hi-CfLaLKZL.cjs → hi-f4gshON3.cjs} +0 -0
  444. /package/dist/chunks/{hr-CerKCstu.mjs → hr-D5mydeyn.mjs} +0 -0
  445. /package/dist/chunks/{hr-B6eFd_4M.cjs → hr-DMExeWwd.cjs} +0 -0
  446. /package/dist/chunks/{hu-DQcisouf.cjs → hu-COmlHkse.cjs} +0 -0
  447. /package/dist/chunks/{hu-DNYoHMic.mjs → hu-DVCPn8un.mjs} +0 -0
  448. /package/dist/chunks/{hy-x9QOWTT6.cjs → hy-BoBSSiJc.cjs} +0 -0
  449. /package/dist/chunks/{hy-N0XBqVv_.mjs → hy-CP6oqcK_.mjs} +0 -0
  450. /package/dist/chunks/{id-dmUIQB07.mjs → id-COwan-Bb.mjs} +0 -0
  451. /package/dist/chunks/{id-G7ASv812.cjs → id-Dk2AQ6-R.cjs} +0 -0
  452. /package/dist/chunks/{it-DXDwm7Aj.cjs → it-BCmU3zOg.cjs} +0 -0
  453. /package/dist/chunks/{it-G9Rg2LaN.mjs → it-DJqN-zLs.mjs} +0 -0
  454. /package/dist/chunks/{ja-C1Nou_k5.mjs → ja-CvoLNAXS.mjs} +0 -0
  455. /package/dist/chunks/{ja-DHMurrnk.cjs → ja-DcMqJvnV.cjs} +0 -0
  456. /package/dist/chunks/{ka-P0_q1_oW.cjs → ka-BdyjQFkv.cjs} +0 -0
  457. /package/dist/chunks/{ka-9rtmTdhq.mjs → ka-BsqbDXqr.mjs} +0 -0
  458. /package/dist/chunks/{km-DedsOdPY.cjs → km-BShH0mB9.cjs} +0 -0
  459. /package/dist/chunks/{km-T8J0lGcC.mjs → km-C9FxSKv0.mjs} +0 -0
  460. /package/dist/chunks/{kn-CMb5Cv2d.mjs → kn-BKTm-E-A.mjs} +0 -0
  461. /package/dist/chunks/{kn-CAGP6H3x.cjs → kn-bNx6e6NK.cjs} +0 -0
  462. /package/dist/chunks/{ko-DulVmkjC.mjs → ko-BLEDr4t_.mjs} +0 -0
  463. /package/dist/chunks/{ko-3D0kPtnu.cjs → ko-LmGjEODJ.cjs} +0 -0
  464. /package/dist/chunks/{ku-BYzD3GnU.cjs → ku-BekLwcHQ.cjs} +0 -0
  465. /package/dist/chunks/{ku-C5mlSVfC.mjs → ku-DGpIv9vX.mjs} +0 -0
  466. /package/dist/chunks/{lo-Cw2hfj84.mjs → lo-C3wsS73b.mjs} +0 -0
  467. /package/dist/chunks/{lo-D9ixPNJD.cjs → lo-YgZPFD63.cjs} +0 -0
  468. /package/dist/chunks/{lt-CzfEJdVd.cjs → lt-CIvBJk2h.cjs} +0 -0
  469. /package/dist/chunks/{lt-Ceg9NAdI.mjs → lt-DWWjfR4Z.mjs} +0 -0
  470. /package/dist/chunks/{lv-DWyBbTHI.cjs → lv-B6Djmvjl.cjs} +0 -0
  471. /package/dist/chunks/{lv-3CXzQoic.mjs → lv-D4nb-9oK.mjs} +0 -0
  472. /package/dist/chunks/{mk-CEbNT0Oe.mjs → mk-BPUvDORf.mjs} +0 -0
  473. /package/dist/chunks/{mk-Anl5AUSU.cjs → mk-Ck56Emvp.cjs} +0 -0
  474. /package/dist/chunks/{ml-B1QmnbTX.cjs → ml-DsibsgSA.cjs} +0 -0
  475. /package/dist/chunks/{ml-DaF_zn1h.mjs → ml-qo0n1JHs.mjs} +0 -0
  476. /package/dist/chunks/{mn-DLpgZmIl.mjs → mn-BAQnLAOv.mjs} +0 -0
  477. /package/dist/chunks/{mn-DM3AWPQI.cjs → mn-Db0fVNYE.cjs} +0 -0
  478. /package/dist/chunks/{mr-CPCMiBsx.cjs → mr-BTz5VL4u.cjs} +0 -0
  479. /package/dist/chunks/{mr-C-d3CWSD.mjs → mr-CFEPrQYy.mjs} +0 -0
  480. /package/dist/chunks/{ms-D3Zil5Dz.mjs → ms-C9p2_6EB.mjs} +0 -0
  481. /package/dist/chunks/{ms-BKg5zJ6g.cjs → ms-ItzWfmiu.cjs} +0 -0
  482. /package/dist/chunks/{my-HzQdQq6H.mjs → my-BQhcHK_d.mjs} +0 -0
  483. /package/dist/chunks/{my-BhrbZPAE.cjs → my-Bq1EPoFX.cjs} +0 -0
  484. /package/dist/chunks/{ne-Dw6kUPkS.mjs → ne-Cf4GpHyI.mjs} +0 -0
  485. /package/dist/chunks/{ne-BsEUv3Vp.cjs → ne-Mog3kAWt.cjs} +0 -0
  486. /package/dist/chunks/{nl-D8QQ6wmJ.mjs → nl-7DE7AKK5.mjs} +0 -0
  487. /package/dist/chunks/{nl-C1jFx32v.cjs → nl-Do9Y1u3F.cjs} +0 -0
  488. /package/dist/chunks/{no-BWEOGeAo.cjs → no-DNuo9wW6.cjs} +0 -0
  489. /package/dist/chunks/{no-Rg2uuKdV.mjs → no-J4jj2fW7.mjs} +0 -0
  490. /package/dist/chunks/{notifier-CEnelp-K.mjs → notifier-BDNwSr07.mjs} +0 -0
  491. /package/dist/chunks/{notifier-BOB8o7IG.cjs → notifier-BW5H3Ctc.cjs} +0 -0
  492. /package/dist/chunks/{pa-BitCteAA.cjs → pa-BVCDv2EV.cjs} +0 -0
  493. /package/dist/chunks/{pa-BSwIZvA0.mjs → pa-DMuUOUxa.mjs} +0 -0
  494. /package/dist/chunks/{pl-CbCrHaA6.cjs → pl-Ct8v4d8V.cjs} +0 -0
  495. /package/dist/chunks/{pl-FhXomIGp.mjs → pl-DIZm5XzV.mjs} +0 -0
  496. /package/dist/chunks/{ps-4sPZuv3g.cjs → ps-DT4DAHOy.cjs} +0 -0
  497. /package/dist/chunks/{ps-BoBtbrB6.mjs → ps-X3--6pS3.mjs} +0 -0
  498. /package/dist/chunks/{pt-BYA5NOw_.mjs → pt-BMT2BIpj.mjs} +0 -0
  499. /package/dist/chunks/{pt-CSzjho-V.cjs → pt-Dwe6Dinw.cjs} +0 -0
  500. /package/dist/chunks/{ro-C9tN3AFF.cjs → ro-CoHEUo3b.cjs} +0 -0
  501. /package/dist/chunks/{ro-mtobtMpD.mjs → ro-Ndh2J4Fv.mjs} +0 -0
  502. /package/dist/chunks/{ru-B791LPq3.mjs → ru-DEoON4H0.mjs} +0 -0
  503. /package/dist/chunks/{ru-BYPO5wNO.cjs → ru-Pmgo28Kt.cjs} +0 -0
  504. /package/dist/chunks/{sd-C8ngG92I.mjs → sd-B46KwBlt.mjs} +0 -0
  505. /package/dist/chunks/{sd-BWuglgs_.cjs → sd-DxSmw84d.cjs} +0 -0
  506. /package/dist/chunks/{si-C_q8DxVt.mjs → si-CEX6-_X4.mjs} +0 -0
  507. /package/dist/chunks/{si-IX2P_DGB.cjs → si-attpuQg-.cjs} +0 -0
  508. /package/dist/chunks/{sk-HJJlM9uq.mjs → sk-Crsvi9aQ.mjs} +0 -0
  509. /package/dist/chunks/{sk-CxtyIOlr.cjs → sk-CvkpO0ti.cjs} +0 -0
  510. /package/dist/chunks/{sl-CPjYG80u.cjs → sl-BT19lhkA.cjs} +0 -0
  511. /package/dist/chunks/{sl-kB1f5rPn.mjs → sl-Cqe1IKhE.mjs} +0 -0
  512. /package/dist/chunks/{sq-CD0W0D6z.mjs → sq-BOQb1hx9.mjs} +0 -0
  513. /package/dist/chunks/{sq-Do6UyHn9.cjs → sq-rY2-arjV.cjs} +0 -0
  514. /package/dist/chunks/{sr-lLJu9TsT.mjs → sr-WVqhi-MV.mjs} +0 -0
  515. /package/dist/chunks/{sr-BcyT-MWS.cjs → sr-jnkxoHkR.cjs} +0 -0
  516. /package/dist/chunks/{sv-Bsz7ersx.cjs → sv-BiWSYdw7.cjs} +0 -0
  517. /package/dist/chunks/{sv-C3GL-a0k.mjs → sv-cjssSK3x.mjs} +0 -0
  518. /package/dist/chunks/{sw-D6-DZ14-.mjs → sw-BNNAgQNn.mjs} +0 -0
  519. /package/dist/chunks/{sw-CUElHZxL.cjs → sw-DFyk62c4.cjs} +0 -0
  520. /package/dist/chunks/{ta-D0DQba-y.cjs → ta-DowDx1bh.cjs} +0 -0
  521. /package/dist/chunks/{ta-BZy78kBk.mjs → ta-jg4mBsL9.mjs} +0 -0
  522. /package/dist/chunks/{te-vigCVKdg.mjs → te-BiLupA2T.mjs} +0 -0
  523. /package/dist/chunks/{te-DPMvJyXg.cjs → te-G0buJU1V.cjs} +0 -0
  524. /package/dist/chunks/{th-DtcrIt9J.cjs → th-DsjA6OWh.cjs} +0 -0
  525. /package/dist/chunks/{th-CGc0RLWB.mjs → th-Dtb_u833.mjs} +0 -0
  526. /package/dist/chunks/{tr-Cgkf5aJo.mjs → tr-01MbT9-l.mjs} +0 -0
  527. /package/dist/chunks/{tr-BrEFaVNA.cjs → tr-DN1xdxQn.cjs} +0 -0
  528. /package/dist/chunks/{ug-BVK7qBs4.mjs → ug-BFlA2VRZ.mjs} +0 -0
  529. /package/dist/chunks/{ug-CqZXfhXi.cjs → ug-DEJ9cNGH.cjs} +0 -0
  530. /package/dist/chunks/{uk-DgReWEge.cjs → uk-Bv6aB1Nd.cjs} +0 -0
  531. /package/dist/chunks/{uk-CSPaCalw.mjs → uk-DY7rBPyo.mjs} +0 -0
  532. /package/dist/chunks/{ur-ByrwJnY1.cjs → ur-C3CFfx9s.cjs} +0 -0
  533. /package/dist/chunks/{ur-VpFFsATs.mjs → ur-DHfULZeF.mjs} +0 -0
  534. /package/dist/chunks/{vi-CWQtvATS.mjs → vi-BFuaq2Tk.mjs} +0 -0
  535. /package/dist/chunks/{vi-lUD3w7gP.cjs → vi-DQrrRkmq.cjs} +0 -0
  536. /package/dist/chunks/{zh-fSp1qOne.cjs → zh-5rdSdLkR.cjs} +0 -0
  537. /package/dist/chunks/{zh-akJj2cdF.mjs → zh-BGpl7x7W.mjs} +0 -0
@@ -0,0 +1,45 @@
1
+ import { DEFAULT_MIME_TYPES } from './constants';
2
+ import { tr } from './i18n';
3
+ import {
4
+ renderMediaEmptyState,
5
+ type MediaEmptyStateElement,
6
+ } from '../../components/utils/media-empty-state';
7
+ import type { I18nInstance } from '../../components/utils/tools';
8
+
9
+ export interface EmptyStateOptions {
10
+ onFile(file: File): void;
11
+ onUrl(url: string): void;
12
+ /** MIME types to accept on file picker + show in the formats hint. */
13
+ acceptTypes?: string[];
14
+ /** Max file size in bytes — surfaced in the formats hint when set. */
15
+ maxSize?: number;
16
+ i18n?: I18nInstance;
17
+ }
18
+
19
+ export type EmptyStateElement = MediaEmptyStateElement;
20
+
21
+ export function renderEmptyState(opts: EmptyStateOptions): EmptyStateElement {
22
+ const i18n = opts.i18n;
23
+ return renderMediaEmptyState({
24
+ acceptTypes: opts.acceptTypes ?? [...DEFAULT_MIME_TYPES],
25
+ maxSize: opts.maxSize,
26
+ onFile: opts.onFile,
27
+ onUrl: opts.onUrl,
28
+ labels: {
29
+ add: tr(i18n, 'tools.video.emptyAddVideo', 'Add a video'),
30
+ upload: tr(i18n, 'tools.video.emptyUpload', 'Upload'),
31
+ embed: tr(i18n, 'tools.video.emptyLink', 'Link'),
32
+ chooseFile: tr(i18n, 'tools.video.emptyChooseFile', 'Choose file'),
33
+ orDropHere: tr(i18n, 'tools.video.emptyOrDropHere', 'or drop a video here'),
34
+ dropToUpload: tr(i18n, 'tools.video.emptyDropToUpload', 'Drop to upload'),
35
+ urlPlaceholder: tr(i18n, 'tools.video.emptyUrlPlaceholder', 'Paste a video URL…'),
36
+ urlAria: tr(i18n, 'tools.video.emptyUrlAria', 'Video URL'),
37
+ submit: tr(i18n, 'tools.video.emptyInsert', 'Insert'),
38
+ sourceAria: tr(i18n, 'tools.video.emptySourceAria', 'Video source'),
39
+ maxSize: (size) =>
40
+ i18n?.has('tools.video.emptyMaxSize')
41
+ ? i18n.t('tools.video.emptyMaxSize', { size })
42
+ : `max ${size}`,
43
+ },
44
+ });
45
+ }
@@ -0,0 +1,13 @@
1
+ import type { I18nInstance } from '../../components/utils/tools';
2
+
3
+ /**
4
+ * Resolve a translation key, falling back to an inline English string when the
5
+ * host editor has not registered the key. Keeps the video tool usable before
6
+ * locale messages are wired and gives the i18n regression scan a single place
7
+ * to find the source copy.
8
+ */
9
+ export function tr(i18n: I18nInstance | undefined, key: string, fallback: string): string {
10
+ if (i18n?.has(key)) return i18n.t(key);
11
+
12
+ return fallback;
13
+ }
@@ -0,0 +1,521 @@
1
+ import type {
2
+ API,
3
+ BlockAPI,
4
+ BlockTool,
5
+ BlockToolConstructorOptions,
6
+ FilePasteEvent,
7
+ PasteConfig,
8
+ PasteEvent,
9
+ PatternPasteEvent,
10
+ ToolboxConfig,
11
+ } from '../../../types';
12
+ import type { MenuConfig } from '../../../types/tools/menu-config';
13
+ import type { VideoAlignment, VideoConfig, VideoData } from '../../../types/tools/video';
14
+ import {
15
+ IconAlignCenter,
16
+ IconAlignLeft,
17
+ IconAlignRight,
18
+ IconCaption,
19
+ IconCopy,
20
+ IconDownload,
21
+ IconPlayerLoop,
22
+ IconPlayerPlay,
23
+ IconPlayerSettings,
24
+ IconReplace,
25
+ IconVideo,
26
+ } from '../../components/icons';
27
+ import { attachResizeHandle, type ResizeEdge } from '../image/resizer';
28
+ import { renderUploadingState, type UploadingStateElement } from '../image/uploading-state';
29
+ import { DEFAULT_CAPTION_PLACEHOLDER, MIN_WIDTH_PX, URL_PATTERN } from './constants';
30
+ import { renderEmptyState, type EmptyStateElement } from './empty-state';
31
+ import { tr } from './i18n';
32
+ import { renderCaptionRow, renderVideo } from './ui';
33
+ import { attachControls, type ControlsHandle } from './controls';
34
+ import { Uploader, VideoUploadError, type UploadResult } from './uploader';
35
+ import { uploadErrorMessage } from '../../components/utils/upload-error-message';
36
+ import { pickDisplayMaxSize } from '../../components/utils/max-size';
37
+
38
+ type ToolState = 'EMPTY' | 'LOADING' | 'RENDERED' | 'ERROR';
39
+
40
+ export class VideoTool implements BlockTool {
41
+ private readonly api: API;
42
+ private readonly block: BlockAPI;
43
+ private readonly config: VideoConfig;
44
+ private readonly uploader: Uploader;
45
+ private data: VideoData;
46
+ private readOnly: boolean;
47
+ private root: HTMLElement | null = null;
48
+ private state: ToolState;
49
+ private uploadingEl: UploadingStateElement | null = null;
50
+ private lastFileName: string | null = null;
51
+ private errorMessage: string | null = null;
52
+ private lastSource: { kind: 'file'; file: File } | { kind: 'url'; url: string } | null = null;
53
+ private resizeDetach: (() => void)[] = [];
54
+ private controlsHandle: ControlsHandle | null = null;
55
+ // Ephemeral theater (cinema-width) state — presentation only, never saved.
56
+ private theater = false;
57
+
58
+ constructor(options: BlockToolConstructorOptions<VideoData, VideoConfig>) {
59
+ this.api = options.api;
60
+ this.block = options.block;
61
+ this.config = options.config ?? {};
62
+ this.readOnly = options.readOnly;
63
+ this.data = { ...options.data, url: options.data?.url ?? '' };
64
+ this.state = this.data.url ? 'RENDERED' : 'EMPTY';
65
+ this.uploader = new Uploader(this.config);
66
+ }
67
+
68
+ public render(): HTMLElement {
69
+ const root = document.createElement('div');
70
+ root.setAttribute('data-blok-tool', 'video');
71
+ this.root = root;
72
+ this.renderState();
73
+ return root;
74
+ }
75
+
76
+ public save(_block?: HTMLElement): VideoData {
77
+ const out: VideoData = { url: this.data.url };
78
+ if (this.data.caption !== undefined) out.caption = this.data.caption;
79
+ if (this.data.captionVisible !== undefined) out.captionVisible = this.data.captionVisible;
80
+ if (this.data.width !== undefined) out.width = this.data.width;
81
+ if (this.data.alignment !== undefined) out.alignment = this.data.alignment;
82
+ if (this.data.autoplay) out.autoplay = true;
83
+ if (this.data.loop) out.loop = true;
84
+ if (this.data.hideControls) out.hideControls = true;
85
+ if (this.data.fileName !== undefined) out.fileName = this.data.fileName;
86
+ if (this.data.mimeType !== undefined) out.mimeType = this.data.mimeType;
87
+ if (this.data.aspectRatio !== undefined) out.aspectRatio = this.data.aspectRatio;
88
+ return out;
89
+ }
90
+
91
+ public validate(data: VideoData): boolean {
92
+ return typeof data.url === 'string' && data.url.length > 0;
93
+ }
94
+
95
+ public static get toolbox(): ToolboxConfig {
96
+ return {
97
+ icon: IconVideo,
98
+ titleKey: 'video',
99
+ searchTerms: ['video', 'movie', 'clip', 'player', 'mp4', 'media'],
100
+ };
101
+ }
102
+
103
+ public static get isReadOnlySupported(): boolean {
104
+ return true;
105
+ }
106
+
107
+ public static get pasteConfig(): PasteConfig {
108
+ return {
109
+ patterns: { video: URL_PATTERN },
110
+ files: { mimeTypes: ['video/*'] },
111
+ };
112
+ }
113
+
114
+ public onPaste(event: PasteEvent): void {
115
+ if (event.type === 'pattern') {
116
+ this.applyResult({ url: (event as PatternPasteEvent).detail.data });
117
+ return;
118
+ }
119
+ if (event.type === 'file') {
120
+ this.startUpload((event as FilePasteEvent).detail.file);
121
+ }
122
+ }
123
+
124
+ public getToolbarAnchorElement(): HTMLElement | undefined {
125
+ return this.root?.querySelector<HTMLElement>('[data-role="video-figure"]') ?? undefined;
126
+ }
127
+
128
+ public getContentOffset(_hoveredElement: Element): { left: number } | undefined {
129
+ const root = this.root;
130
+ const figure = root?.querySelector<HTMLElement>('[data-role="video-figure"]');
131
+ if (!root || !figure) return undefined;
132
+ const delta = figure.getBoundingClientRect().left - root.getBoundingClientRect().left;
133
+ return delta > 0 ? { left: delta } : undefined;
134
+ }
135
+
136
+ public setReadOnly(state: boolean): void {
137
+ this.readOnly = state;
138
+ this.renderState();
139
+ }
140
+
141
+ public renderSettings(): MenuConfig {
142
+ const i18n = this.api.i18n;
143
+ const current: VideoAlignment = this.data.alignment ?? 'center';
144
+ const captionVisible = this.data.captionVisible !== false;
145
+ const alignments: { value: VideoAlignment; title: string; icon: string }[] = [
146
+ { value: 'left', title: tr(i18n, 'tools.video.alignmentLeft', 'Align left'), icon: IconAlignLeft },
147
+ { value: 'center', title: tr(i18n, 'tools.video.alignmentCenter', 'Align center'), icon: IconAlignCenter },
148
+ { value: 'right', title: tr(i18n, 'tools.video.alignmentRight', 'Align right'), icon: IconAlignRight },
149
+ ];
150
+ const alignIcon = alignments.find((a) => a.value === current)?.icon ?? alignments[1].icon;
151
+
152
+ return [
153
+ {
154
+ icon: alignIcon,
155
+ title: tr(i18n, 'tools.video.alignment', 'Alignment'),
156
+ name: 'video-alignment',
157
+ children: {
158
+ items: alignments.map((a) => ({
159
+ icon: a.icon,
160
+ title: a.title,
161
+ name: `video-alignment-${a.value}`,
162
+ isActive: current === a.value,
163
+ closeOnActivate: true,
164
+ onActivate: (): void => this.setAlignment(a.value),
165
+ })),
166
+ },
167
+ },
168
+ {
169
+ icon: IconCaption,
170
+ title: tr(i18n, 'tools.video.caption', 'Caption'),
171
+ name: 'video-caption',
172
+ isActive: captionVisible,
173
+ closeOnActivate: true,
174
+ onActivate: (): void => this.toggleCaption(),
175
+ },
176
+ {
177
+ icon: IconPlayerPlay,
178
+ title: tr(i18n, 'tools.video.autoplay', 'Autoplay'),
179
+ name: 'video-autoplay',
180
+ isActive: this.data.autoplay === true,
181
+ closeOnActivate: true,
182
+ onActivate: (): void => this.toggleAutoplay(),
183
+ },
184
+ {
185
+ icon: IconPlayerLoop,
186
+ title: tr(i18n, 'tools.video.loop', 'Loop'),
187
+ name: 'video-loop',
188
+ isActive: this.data.loop === true,
189
+ closeOnActivate: true,
190
+ onActivate: (): void => this.toggleLoop(),
191
+ },
192
+ {
193
+ icon: IconPlayerSettings,
194
+ title: tr(i18n, 'tools.video.hideControls', 'Hide controls'),
195
+ name: 'video-hide-controls',
196
+ isActive: this.data.hideControls === true,
197
+ closeOnActivate: true,
198
+ onActivate: (): void => this.toggleHideControls(),
199
+ },
200
+ {
201
+ icon: IconReplace,
202
+ title: tr(i18n, 'tools.video.replace', 'Replace video'),
203
+ name: 'video-replace',
204
+ closeOnActivate: true,
205
+ onActivate: (): void => this.transitionToEmpty(),
206
+ },
207
+ {
208
+ icon: IconDownload,
209
+ title: tr(i18n, 'tools.video.download', 'Download'),
210
+ name: 'video-download',
211
+ closeOnActivate: true,
212
+ onActivate: (): void => this.download(),
213
+ },
214
+ {
215
+ icon: IconCopy,
216
+ title: tr(i18n, 'tools.video.copyUrl', 'Copy URL'),
217
+ name: 'video-copy-url',
218
+ closeOnActivate: true,
219
+ onActivate: (): void => this.copyUrl(),
220
+ },
221
+ ];
222
+ }
223
+
224
+ public removed(): void {
225
+ this.detachResize();
226
+ this.controlsHandle?.destroy();
227
+ this.controlsHandle = null;
228
+ if (this.data.url.startsWith('blob:')) {
229
+ URL.revokeObjectURL(this.data.url);
230
+ }
231
+ }
232
+
233
+ private startUpload(file: File): void {
234
+ this.lastFileName = file.name;
235
+ this.lastSource = { kind: 'file', file };
236
+ this.state = 'LOADING';
237
+ this.renderState();
238
+ void this.uploader
239
+ .handleFile(file, { onProgress: (p) => this.uploadingEl?.setProgress(p) })
240
+ .then((result) => this.applyResult(result, file.type))
241
+ .catch((err) => this.applyError(err));
242
+ }
243
+
244
+ private startUrl(url: string): void {
245
+ this.lastFileName = null;
246
+ this.lastSource = { kind: 'url', url };
247
+ this.state = 'LOADING';
248
+ this.renderState();
249
+ void this.uploader
250
+ .handleUrl(url, { onProgress: (p) => this.uploadingEl?.setProgress(p) })
251
+ .then((result) => this.applyResult(result))
252
+ .catch((err) => this.applyError(err));
253
+ }
254
+
255
+ private applyResult(result: UploadResult, mimeType?: string): void {
256
+ this.data = {
257
+ ...this.data,
258
+ url: result.url,
259
+ fileName: result.fileName ?? this.lastFileName ?? this.data.fileName,
260
+ mimeType: mimeType || this.data.mimeType,
261
+ };
262
+ this.errorMessage = null;
263
+ this.state = 'RENDERED';
264
+ this.renderState();
265
+ this.block.dispatchChange();
266
+ }
267
+
268
+ private applyError(err?: unknown): void {
269
+ this.errorMessage = err instanceof VideoUploadError
270
+ ? uploadErrorMessage(err, (key) => this.api.i18n.t(key), {
271
+ tooLarge: 'tools.video.errorFileTooLarge',
272
+ generic: 'tools.video.errorUploadFailed',
273
+ })
274
+ : null;
275
+ this.state = 'ERROR';
276
+ this.renderState();
277
+ }
278
+
279
+ private detachResize(): void {
280
+ while (this.resizeDetach.length > 0) {
281
+ this.resizeDetach.pop()?.();
282
+ }
283
+ }
284
+
285
+ private syncRootAttributes(): void {
286
+ if (!this.root) return;
287
+ const r = this.root;
288
+ r.setAttribute('data-state', this.state.toLowerCase());
289
+ r.setAttribute('data-align', this.data.alignment ?? 'center');
290
+ r.setAttribute('data-caption', this.data.captionVisible === false ? 'off' : 'on');
291
+ r.setAttribute('data-controls', this.data.hideControls === true ? 'off' : 'on');
292
+ }
293
+
294
+ private renderState(): void {
295
+ if (!this.root) return;
296
+ this.detachResize();
297
+ this.controlsHandle?.destroy();
298
+ this.controlsHandle = null;
299
+ this.root.replaceChildren();
300
+ this.uploadingEl = null;
301
+ this.syncRootAttributes();
302
+
303
+ if (this.state === 'EMPTY') {
304
+ this.renderEmpty();
305
+ return;
306
+ }
307
+ if (this.state === 'LOADING') {
308
+ this.renderLoading();
309
+ return;
310
+ }
311
+ if (this.state === 'ERROR') {
312
+ this.renderError();
313
+ return;
314
+ }
315
+ this.renderRendered();
316
+ }
317
+
318
+ private renderEmpty(): void {
319
+ if (!this.root) return;
320
+ const el: EmptyStateElement = renderEmptyState({
321
+ onFile: (file) => this.startUpload(file),
322
+ onUrl: (url) => this.startUrl(url),
323
+ acceptTypes: this.config.types,
324
+ maxSize: pickDisplayMaxSize(this.config.maxSize),
325
+ i18n: this.api.i18n,
326
+ });
327
+ this.root.appendChild(el);
328
+ }
329
+
330
+ private renderLoading(): void {
331
+ if (!this.root) return;
332
+ this.uploadingEl = renderUploadingState({
333
+ fileName: this.lastFileName ?? tr(this.api.i18n, 'tools.video.uploading', 'Uploading…'),
334
+ onCancel: () => this.transitionToEmpty(),
335
+ i18n: this.api.i18n,
336
+ });
337
+ this.root.appendChild(this.uploadingEl);
338
+ }
339
+
340
+ private renderError(): void {
341
+ if (!this.root) return;
342
+ const wrap = document.createElement('div');
343
+ wrap.className = 'blok-video-error-state';
344
+ wrap.setAttribute('data-role', 'video-error');
345
+
346
+ const message = document.createElement('span');
347
+ message.textContent = this.errorMessage ?? tr(this.api.i18n, 'tools.video.errorUploadFailed', 'Upload failed');
348
+
349
+ const retry = document.createElement('button');
350
+ retry.type = 'button';
351
+ retry.className = 'blok-video-retry';
352
+ retry.setAttribute('data-action', 'replace');
353
+ retry.textContent = tr(this.api.i18n, 'tools.video.errorReplace', 'Replace');
354
+ retry.addEventListener('click', () => this.transitionToEmpty());
355
+
356
+ wrap.append(message, retry);
357
+ this.root.appendChild(wrap);
358
+ }
359
+
360
+ private renderRendered(): void {
361
+ if (!this.root) return;
362
+ const figure = renderVideo(this.data);
363
+ const media = figure.querySelector<HTMLElement>('[data-role="video-media"]') ?? figure;
364
+
365
+ // Custom playback controls replace the native chrome — available to
366
+ // viewers too, so they attach regardless of read-only.
367
+ const video = media.querySelector('video');
368
+ if (video) {
369
+ // Loop is content — honour it in both modes. Autoplay is a read-only viewer
370
+ // affordance: muted + autoplay + loop turns the block into a gif. Browsers
371
+ // only honour autoplay when muted, so we mute here; editing never autoplays.
372
+ video.loop = this.data.loop === true;
373
+ if (this.readOnly && this.data.autoplay === true) {
374
+ video.muted = true;
375
+ video.setAttribute('muted', '');
376
+ video.setAttribute('autoplay', '');
377
+ }
378
+ // "Hide controls" tune renders a clean, control-free frame — the custom
379
+ // chrome is skipped entirely (native controls were never attached). Loop
380
+ // and autoplay above still apply: they are content/viewer affordances.
381
+ if (this.data.hideControls !== true) {
382
+ this.controlsHandle = attachControls({
383
+ video,
384
+ figure,
385
+ glow: this.config.glow ?? 'minimal',
386
+ loop: this.data.loop === true,
387
+ });
388
+ media.appendChild(this.controlsHandle.element);
389
+ }
390
+
391
+ // When metadata arrives, update the media wrapper's aspect ratio so it
392
+ // matches the video's intrinsic dimensions. If the ratio differs from
393
+ // the default 16 : 9 (or a previously stored value) we persist it so
394
+ // subsequent renders skip the layout pop.
395
+ video.addEventListener('loadedmetadata', () => {
396
+ if (video.videoWidth > 0 && video.videoHeight > 0) {
397
+ const ratio = `${video.videoWidth} / ${video.videoHeight}`;
398
+ if (ratio !== this.data.aspectRatio) {
399
+ this.data.aspectRatio = ratio;
400
+ media.style.aspectRatio = ratio;
401
+ this.block.dispatchChange();
402
+ }
403
+ }
404
+ }, { once: true });
405
+ }
406
+
407
+ // Theater is an ephemeral view mode: observe the player's toggle to keep our
408
+ // copy, and re-apply it after a re-render so alignment/caption changes don't
409
+ // eject the viewer. Never written to save() — presentation, not content.
410
+ figure.addEventListener('blok-video-theater', (event) => {
411
+ this.theater = (event as CustomEvent<{ on: boolean }>).detail.on;
412
+ });
413
+ if (this.theater) this.controlsHandle?.setTheater(true);
414
+
415
+ const placeholder = this.config.captionPlaceholder ?? DEFAULT_CAPTION_PLACEHOLDER;
416
+ const captionVisible = this.data.captionVisible !== false;
417
+ if (captionVisible || !this.readOnly) {
418
+ figure.appendChild(renderCaptionRow({
419
+ value: this.data.caption ?? '',
420
+ placeholder,
421
+ readOnly: this.readOnly,
422
+ onChange: (next) => {
423
+ if (next !== this.data.caption) {
424
+ this.data.caption = next;
425
+ this.block.dispatchChange();
426
+ }
427
+ },
428
+ }));
429
+ }
430
+
431
+ this.root.appendChild(figure);
432
+
433
+ if (!this.readOnly) {
434
+ this.attachResizeHandles(figure);
435
+ }
436
+ }
437
+
438
+ private attachResizeHandles(figure: HTMLElement): void {
439
+ const edges: ResizeEdge[] = ['left', 'right'];
440
+ for (const edge of edges) {
441
+ const handle = document.createElement('div');
442
+ handle.setAttribute('data-role', 'resize-handle');
443
+ handle.setAttribute('data-edge', edge);
444
+ figure.appendChild(handle);
445
+ const detach = attachResizeHandle({
446
+ handle,
447
+ figure,
448
+ container: figure.parentElement ?? figure,
449
+ edge,
450
+ alignment: this.data.alignment ?? 'center',
451
+ minWidthPx: MIN_WIDTH_PX,
452
+ onPreview: (percent) => {
453
+ figure.style.setProperty('width', `${percent}%`);
454
+ },
455
+ onCommit: (percent) => {
456
+ this.data.width = percent;
457
+ this.block.dispatchChange();
458
+ },
459
+ });
460
+ this.resizeDetach.push(detach);
461
+ }
462
+ }
463
+
464
+ private setAlignment(next: VideoAlignment): void {
465
+ if (this.data.alignment === next) return;
466
+ this.data.alignment = next;
467
+ this.block.dispatchChange();
468
+ this.renderState();
469
+ }
470
+
471
+ private toggleCaption(): void {
472
+ this.data.captionVisible = this.data.captionVisible === false;
473
+ this.block.dispatchChange();
474
+ this.renderState();
475
+ }
476
+
477
+ private toggleAutoplay(): void {
478
+ this.data.autoplay = this.data.autoplay !== true ? true : undefined;
479
+ this.block.dispatchChange();
480
+ this.renderState();
481
+ }
482
+
483
+ private toggleLoop(): void {
484
+ this.data.loop = this.data.loop !== true ? true : undefined;
485
+ this.block.dispatchChange();
486
+ this.renderState();
487
+ }
488
+
489
+ private toggleHideControls(): void {
490
+ this.data.hideControls = this.data.hideControls !== true ? true : undefined;
491
+ this.block.dispatchChange();
492
+ this.renderState();
493
+ }
494
+
495
+ private transitionToEmpty(): void {
496
+ this.data = { ...this.data, url: '' };
497
+ this.state = 'EMPTY';
498
+ this.lastSource = null;
499
+ this.lastFileName = null;
500
+ this.renderState();
501
+ this.block.dispatchChange();
502
+ }
503
+
504
+ private download(): void {
505
+ const a = document.createElement('a');
506
+ a.href = this.data.url;
507
+ a.download = this.data.fileName ?? '';
508
+ a.target = '_blank';
509
+ a.rel = 'noopener';
510
+ document.body.appendChild(a);
511
+ a.click();
512
+ a.remove();
513
+ }
514
+
515
+ private copyUrl(): void {
516
+ const clip = navigator.clipboard;
517
+ if (clip && typeof clip.writeText === 'function') {
518
+ void clip.writeText(this.data.url);
519
+ }
520
+ }
521
+ }
@@ -0,0 +1,83 @@
1
+ import type { VideoAlignment, VideoData } from '../../../types/tools/video';
2
+
3
+ const ALIGN_TO_TEXT_ALIGN: Record<VideoAlignment, string> = {
4
+ left: 'left',
5
+ center: 'center',
6
+ right: 'right',
7
+ };
8
+
9
+ export function renderVideo(data: Partial<VideoData> & { url: string }): HTMLElement {
10
+ const alignment = data.alignment ?? 'center';
11
+ const figure = document.createElement('figure');
12
+ figure.className = 'blok-video-inner';
13
+ figure.setAttribute('data-role', 'video-figure');
14
+ figure.style.margin = '0';
15
+ figure.style.textAlign = ALIGN_TO_TEXT_ALIGN[alignment];
16
+ figure.style.position = 'relative';
17
+ if (data.width !== undefined) {
18
+ figure.style.width = `${data.width}%`;
19
+ }
20
+
21
+ // The media wrapper hugs the player pixels and anchors the overlaid chrome
22
+ // (custom controls, edit toolbar, resize handles) so they sit over the video
23
+ // only — never over the caption row below.
24
+ const media = document.createElement('div');
25
+ media.className = 'blok-video-media';
26
+ media.setAttribute('data-role', 'video-media');
27
+ media.style.position = 'relative';
28
+ // Reserve space before loadedmetadata fires — without this the <video>
29
+ // collapses to zero height then "pops" when the browser learns the
30
+ // intrinsic ratio (the "squeeze" visual glitch on load).
31
+ media.style.aspectRatio = data.aspectRatio ?? '16 / 9';
32
+
33
+ // No native `controls` — a custom Airbnb-style control surface is attached
34
+ // separately (see controls.ts) and fully replaces the browser chrome.
35
+ const video = document.createElement('video');
36
+ video.setAttribute('data-blok-testid', 'video-player');
37
+ video.setAttribute('playsinline', '');
38
+ video.setAttribute('preload', 'metadata');
39
+ // Focusable so the player can field keyboard control (seek, volume, speed,
40
+ // play/pause, mute, fullscreen) à la a native player.
41
+ video.setAttribute('tabindex', '0');
42
+ video.setAttribute(
43
+ 'aria-keyshortcuts',
44
+ 'Space k j l ArrowLeft ArrowRight ArrowUp ArrowDown m f Home End',
45
+ );
46
+ video.setAttribute('src', data.url);
47
+ video.style.width = '100%';
48
+ video.style.display = 'block';
49
+ media.appendChild(video);
50
+ figure.appendChild(media);
51
+
52
+ return figure;
53
+ }
54
+
55
+ export interface CaptionRowOptions {
56
+ value: string;
57
+ placeholder: string;
58
+ readOnly: boolean;
59
+ onChange(next: string): void;
60
+ }
61
+
62
+ export function renderCaptionRow(opts: CaptionRowOptions): HTMLElement {
63
+ const row = document.createElement('div');
64
+ row.className = 'blok-video-caption-row';
65
+ row.setAttribute('data-role', 'video-caption-row');
66
+
67
+ const caption = document.createElement('div');
68
+ caption.className = 'blok-video-caption';
69
+ caption.setAttribute('data-role', 'video-caption');
70
+ caption.setAttribute('role', 'textbox');
71
+ caption.setAttribute('contenteditable', opts.readOnly ? 'false' : 'true');
72
+ caption.setAttribute('data-placeholder', opts.placeholder);
73
+ caption.textContent = opts.value;
74
+ caption.style.outline = 'none';
75
+ caption.style.textAlign = 'left';
76
+
77
+ if (!opts.readOnly) {
78
+ caption.addEventListener('blur', () => opts.onChange(caption.textContent ?? ''));
79
+ }
80
+
81
+ row.appendChild(caption);
82
+ return row;
83
+ }