@saooti/octopus-sdk 42.4.0-beta2 → 42.4.0-beta4

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 (334) hide show
  1. package/dist/{AccessibilityModal-CBIb3UQS.mjs → AccessibilityModal-CHUSDO1F.mjs} +39 -36
  2. package/dist/{AdvancedSearch-DVWO6WtG.mjs → AdvancedSearch-S-OMg1XH.mjs} +5 -5
  3. package/dist/{AuthStore-BBZTjLTf.mjs → AuthStore-BdiVUQBK.mjs} +268 -261
  4. package/dist/{CategoryChooser-fAUMJNHu.mjs → CategoryChooser-Cg_gq6L_.mjs} +1 -1
  5. package/dist/{CategoryFilter-CU4D9VlH.mjs → CategoryFilter-CI5PfekR.mjs} +3 -3
  6. package/dist/{CategoryList-CNRdGnw0.mjs → CategoryList-B0hCDa0Q.mjs} +2 -2
  7. package/dist/{CategoryPage-CJ_OohkC.mjs → CategoryPage-j1c3a9Ti.mjs} +2 -2
  8. package/dist/{CategorySearchFilter-Cce5zxZB.mjs → CategorySearchFilter-eRcZcX0o.mjs} +1 -1
  9. package/dist/{CheckIdentityModal-DEXrqR2G.mjs → CheckIdentityModal-DTA9VPdd.mjs} +3 -3
  10. package/dist/{ClassicAlert-DATLZ8J1.mjs → ClassicAlert-fZ4qLB-c.mjs} +1 -1
  11. package/dist/{ClassicBigChip-BK8v_P0z.mjs → ClassicBigChip-D0pRqFwb.mjs} +1 -1
  12. package/dist/ClassicColorPicker-DcjFDaZ8.mjs +79 -0
  13. package/dist/{ClassicDatePicker-CKIkZWmW.mjs → ClassicDatePicker-DlNlvjA0.mjs} +1 -1
  14. package/dist/{ClassicEmojiPicker-C0gm-DA2.mjs → ClassicEmojiPicker-Cc4UZRvZ.mjs} +1 -1
  15. package/dist/{ClassicHelpButton-BnRLmYuh.mjs → ClassicHelpButton-CDz_GcaZ.mjs} +1 -1
  16. package/dist/{ClassicInputText-YsntJkHk.mjs → ClassicInputText-4bPGD_kV.mjs} +1 -1
  17. package/dist/{ClassicLoading-CXfMjpyl.mjs → ClassicLoading-ydEDL7-R.mjs} +1 -1
  18. package/dist/{ClassicMultiselect-C0yzVQ8Y.mjs → ClassicMultiselect-CEJF_Uo5.mjs} +1 -1
  19. package/dist/{ClassicNotifications-Bt7HmFoU.mjs → ClassicNotifications-olXwz4qY.mjs} +2 -2
  20. package/dist/ClassicPopover-BpFChUHf.mjs +203 -0
  21. package/dist/ClassicSelect-Bj9BkTkd.mjs +121 -0
  22. package/dist/{ClassicSpinner-DFRDD51g.mjs → ClassicSpinner-P6q1es8G.mjs} +4 -1
  23. package/dist/{ClipboardModal-cHMlAcg3.mjs → ClipboardModal-D40ImhpB.mjs} +1 -1
  24. package/dist/{CommentInput-BiGn-skv.mjs → CommentInput-BGAQHUZh.mjs} +5 -5
  25. package/dist/CommentItem-CBtedADn.mjs +233 -0
  26. package/dist/CommentList-BqY6dXMt.mjs +203 -0
  27. package/dist/{CommentMoreActions-Cew7m8vJ.mjs → CommentMoreActions-BPDPuoeI.mjs} +6 -5
  28. package/dist/{CommentName-BQR1xl1T.mjs → CommentName-DiN2v6zm.mjs} +3 -3
  29. package/dist/{CommentParentInfo-BuM6sFV4.mjs → CommentParentInfo-DIyzK-2k.mjs} +3 -3
  30. package/dist/CommentSection-BUQsGQcN.mjs +119 -0
  31. package/dist/{CommentStore-BjzpqB_1.mjs → CommentStore-D-2Q49xZ.mjs} +76 -88
  32. package/dist/{ContractPreviewModal-CgEfHeyW.mjs → ContractPreviewModal-Duf8yY-7.mjs} +1 -1
  33. package/dist/{DateFilter-Bzx36_ol.mjs → DateFilter-Drn-Thgy.mjs} +1 -1
  34. package/dist/{DownloadPodcastButton-NStAbAZa.mjs → DownloadPodcastButton-BFZI5jmS.mjs} +2 -2
  35. package/dist/{EditCommentModal-coXmYdY_.mjs → EditCommentModal-CVihXEGS.mjs} +2 -2
  36. package/dist/{EmissionGroupChooser-XK05Hye9.mjs → EmissionGroupChooser-BaorNk90.mjs} +2 -2
  37. package/dist/{EmissionInlineList-CWP6yZLk.mjs → EmissionInlineList-DuzgE8hS.mjs} +36 -26
  38. package/dist/EmissionItem-R8ugPYq7.mjs +123 -0
  39. package/dist/EmissionList-Dk8Xtmm1.mjs +230 -0
  40. package/dist/EmissionPage-DE_T-aNF.mjs +191 -0
  41. package/dist/{EmissionPlayerItem-B-poSf0h.mjs → EmissionPlayerItem-w3F7l_dL.mjs} +9 -9
  42. package/dist/{EmissionPresentationItem-Ic_4QTAV.mjs → EmissionPresentationItem-VwylQjvv.mjs} +7 -4
  43. package/dist/{EmissionPresentationList-CZVjxQUN.mjs → EmissionPresentationList-Xu3G_Ozt.mjs} +8 -6
  44. package/dist/EmissionsPage--rvX0YYh.mjs +117 -0
  45. package/dist/{Error403Page-paQBIk_S.mjs → Error403Page-Cb0LAznd.mjs} +1 -1
  46. package/dist/ExternalLink-Xd1yTR71.mjs +35 -0
  47. package/dist/{FooterGarSection-GKI36V98.mjs → FooterGarSection-CnjLLyXU.mjs} +3 -3
  48. package/dist/{FooterSection-vNIJikKR.mjs → FooterSection-0e6Z_wff.mjs} +13 -13
  49. package/dist/{HomeDropdown-B_5YrOSF.mjs → HomeDropdown-5JO7NDSl.mjs} +3 -3
  50. package/dist/{HomePage-KC-CcJky.mjs → HomePage-Bze7mTbZ.mjs} +3 -3
  51. package/dist/InlineRubriqueList-MYnSX_eZ.mjs +48 -0
  52. package/dist/LikeButton-CnMZOm9N.mjs +46 -0
  53. package/dist/{LikeSection-BZcy0TOS.mjs → LikeSection-BFh6c0_F.mjs} +11 -17
  54. package/dist/ListPaginate-DMir5lKe.mjs +191 -0
  55. package/dist/{LiveHorizontalList-CARJlSBl.mjs → LiveHorizontalList-DpfoJMa8.mjs} +6 -6
  56. package/dist/{LiveList-DtXz2jZd.mjs → LiveList-BXcxoWAn.mjs} +12 -11
  57. package/dist/{LivesPage-DRyMTzoZ.mjs → LivesPage-X_Cuj5RC.mjs} +2 -2
  58. package/dist/{MapPage-CyDwoNuG.mjs → MapPage-DR7057o0.mjs} +1 -1
  59. package/dist/{MessageModal-BcqS77v6.mjs → MessageModal-DyD3HZy0.mjs} +1 -1
  60. package/dist/{MobileMenu-DWAO2ARf.mjs → MobileMenu-CaFQBVFA.mjs} +3 -3
  61. package/dist/{MonetizableFilter-B7NHzXEY.mjs → MonetizableFilter-BeBVeGSW.mjs} +1 -1
  62. package/dist/{NewsletterModal-GkC9RDyD.mjs → NewsletterModal-CaaLFdAc.mjs} +1 -1
  63. package/dist/{OctopusMultiselect-noQPQMZQ.mjs → OctopusMultiselect-B_VBxbac.mjs} +19 -19
  64. package/dist/OrganisationChooser-BSJWSByJ.mjs +134 -0
  65. package/dist/{OrganisationChooserLight-Afgr1M7a.mjs → OrganisationChooserLight-BpqeFaQP.mjs} +2 -2
  66. package/dist/{PageNotFound-B7hdl-yk.mjs → PageNotFound-BB2Der8l.mjs} +2 -2
  67. package/dist/PaginateParams-BKSnsVZH.mjs +54 -0
  68. package/dist/{ParticipantInlineList-BwPZSUqb.mjs → ParticipantInlineList-DBlnlk8x.mjs} +24 -19
  69. package/dist/ParticipantItem-1fs3gVfe.mjs +93 -0
  70. package/dist/ParticipantPage-BaWObZn8.mjs +127 -0
  71. package/dist/{ParticipantsPage-CHWCYVS6.mjs → ParticipantsPage-QsAeLeb5.mjs} +16 -16
  72. package/dist/{PlayerAnonymousModal-BdgjFawf.mjs → PlayerAnonymousModal-B9fZFffi.mjs} +2 -2
  73. package/dist/PlaylistPage-Blu1HnPY.mjs +130 -0
  74. package/dist/{PlaylistsPage-DTL-ovBn.mjs → PlaylistsPage-DLNnZSJT.mjs} +88 -77
  75. package/dist/{PodcastFilterList-2nVutkmB.mjs → PodcastFilterList-DrZA5iQa.mjs} +4 -3
  76. package/dist/PodcastInlineList-C-ICxCWh.mjs +186 -0
  77. package/dist/{PodcastInlineListTemplate-DPBRFNio.mjs → PodcastInlineListTemplate-CDigJ7BJ.mjs} +58 -56
  78. package/dist/PodcastItem-m3k-Kix9.mjs +305 -0
  79. package/dist/{PodcastList-R0TvKt6G.mjs → PodcastList-Cww-0Swl.mjs} +12 -12
  80. package/dist/{PodcastList-RMFwG0hb.mjs → PodcastList-s4gxQjq5.mjs} +26 -24
  81. package/dist/PodcastPage-DE5gGN-2.mjs +595 -0
  82. package/dist/PodcastPlayButton-Df0Z63M0.mjs +127 -0
  83. package/dist/PodcastPlaylistInlineList-D6FMozVy.mjs +69 -0
  84. package/dist/{PodcastPresentationList-BvXr6uwb.mjs → PodcastPresentationList-SouqGyw9.mjs} +9 -7
  85. package/dist/{PodcastmakerHeader-CKbQLcJR.mjs → PodcastmakerHeader-DJXLJTF6.mjs} +1 -1
  86. package/dist/PodcastsPage-BXBARaTK.mjs +133 -0
  87. package/dist/{ProductorSearch-DiKNztPx.mjs → ProductorSearch-hTTU45pI.mjs} +3 -3
  88. package/dist/QrCode-OEI1du8P.mjs +116 -0
  89. package/dist/{QrCodeModal-CWrtwMmo.mjs → QrCodeModal-DmzFi0FH.mjs} +1 -1
  90. package/dist/{RadioCurrently-Dp9E529F.mjs → RadioCurrently-CrRnrOIT.mjs} +20 -20
  91. package/dist/{RadioImage-C9DiBLS9.mjs → RadioImage-DmMQTUjw.mjs} +1 -1
  92. package/dist/RadioList-Bj_bfSqy.mjs +79 -0
  93. package/dist/{RadioPage-BxwU7iT4.mjs → RadioPage-BHAxW4eG.mjs} +5 -5
  94. package/dist/{RadioPlanning-iJ7XDZSH.mjs → RadioPlanning-Cg47XjD9.mjs} +3 -3
  95. package/dist/{RecaptchaModal-Bfq6A8y2.mjs → RecaptchaModal-DLMoPxPf.mjs} +2 -2
  96. package/dist/{ReportAbuseModal-DBoOqnzQ.mjs → ReportAbuseModal-CIiBTSpw.mjs} +4 -4
  97. package/dist/{RightsIndicator-DiA2ldB-.mjs → RightsIndicator-Dr75KTRE.mjs} +4 -4
  98. package/dist/{RightsWrapper-JmJz5r95.mjs → RightsWrapper-C6zNaunR.mjs} +41 -42
  99. package/dist/{RubriqueChoice-C-S-veJJ.mjs → RubriqueChoice-Ci23lZBD.mjs} +2 -2
  100. package/dist/{RubriqueChooser-CNGn8LcP.mjs → RubriqueChooser-C5QLRe-b.mjs} +1 -1
  101. package/dist/{RubriqueFilter-CD_iXdC1.mjs → RubriqueFilter-B_lwmZ8m.mjs} +3 -3
  102. package/dist/{RubriqueList-COReG7_w.mjs → RubriqueList-DNwhze-d.mjs} +4 -4
  103. package/dist/{RubriquePage-C63TsvkH.mjs → RubriquePage-Bh59Y29D.mjs} +6 -5
  104. package/dist/{SearchPage-ChdImq8B.mjs → SearchPage-DfsoWBQU.mjs} +2 -2
  105. package/dist/ShareAnonymous-QT4t2_n7.mjs +210 -0
  106. package/dist/{ShareModalPlayer-Dr0BUSDx.mjs → ShareModalPlayer-D0NzOzX0.mjs} +1 -1
  107. package/dist/{ShareNewsletter-DJbBxYn3.mjs → ShareNewsletter-DT893L87.mjs} +41 -44
  108. package/dist/{SharePlayer-AeYTgJw6.mjs → SharePlayer-Ctivrvmn.mjs} +2 -2
  109. package/dist/SharePlayerColors-CfrkwpdM.mjs +50 -0
  110. package/dist/{SharePlayerRadio-DxcP73-X.mjs → SharePlayerRadio-Gvc5Gc0f.mjs} +2 -2
  111. package/dist/{SharePlayerTypes-CuDLz2mJ.mjs → SharePlayerTypes-B3OKl3HO.mjs} +1 -1
  112. package/dist/ShareSocialsButtons-MbK7ivGa.mjs +103 -0
  113. package/dist/SmartLinkPage-BKihppLi.mjs +143 -0
  114. package/dist/SubscribeButtons-DKylNvPo.mjs +126 -0
  115. package/dist/SwiperList-CqElRAFt.mjs +179 -0
  116. package/dist/{TagList-DPkw1vux.mjs → TagList-CFgCrA_i.mjs} +5 -5
  117. package/dist/{TagPage-uVe7N9oG.mjs → TagPage-CWGLni8k.mjs} +3 -3
  118. package/dist/TopBar-CmZSpIiz.mjs +427 -0
  119. package/dist/UserButtonContent-CvVebdKv.mjs +129 -0
  120. package/dist/{buttons-BkfxHdGj.mjs → buttons-s19oovgO.mjs} +1 -1
  121. package/dist/{downloadHelper-CvnGPosg.mjs → downloadHelper-B7bFMASS.mjs} +1 -1
  122. package/dist/index.css +1 -1
  123. package/dist/index.d.ts +4 -2
  124. package/dist/index.mjs +235 -232
  125. package/dist/{messages-DlxMAMOa.mjs → messages-DJAarMHp.mjs} +108 -6
  126. package/dist/src/components/display/comments/like/LikeButton.vue.d.ts +9 -33
  127. package/dist/src/components/display/comments/like/LikeSection.vue.d.ts +11 -33
  128. package/dist/src/components/display/emission/EmissionInlineList.vue.d.ts +4 -4
  129. package/dist/src/components/display/emission/EmissionItem.vue.d.ts +5 -1
  130. package/dist/src/components/display/emission/EmissionPresentationItem.vue.d.ts +2 -0
  131. package/dist/src/components/display/emission/EmissionPresentationList.vue.d.ts +1 -1
  132. package/dist/src/components/display/list/SwiperList.vue.d.ts +7 -4
  133. package/dist/src/components/display/live/RadioItem.vue.d.ts +11 -0
  134. package/dist/src/components/display/participant/ParticipantInlineList.vue.d.ts +1 -1
  135. package/dist/src/components/display/playlist/PlaylistItem.vue.d.ts +11 -0
  136. package/dist/src/components/display/podcasts/PodcastFilterList.vue.d.ts +3 -3
  137. package/dist/src/components/display/podcasts/PodcastImage.vue.d.ts +29 -9
  138. package/dist/src/components/display/podcasts/PodcastInlineList.vue.d.ts +45 -4
  139. package/dist/src/components/display/podcasts/PodcastInlineListTemplate.vue.d.ts +1 -1
  140. package/dist/src/components/display/podcasts/PodcastItem.vue.d.ts +7 -1
  141. package/dist/src/components/display/podcasts/PodcastItemInfo.vue.d.ts +10 -12
  142. package/dist/src/components/display/podcasts/PodcastList.vue.d.ts +2 -0
  143. package/dist/src/components/display/sharing/FormatSwitch.vue.d.ts +12 -17
  144. package/dist/src/components/form/ClassicColorPicker.vue.d.ts +26 -0
  145. package/dist/src/components/form/ClassicContentEditable.vue.d.ts +1 -1
  146. package/dist/src/components/form/ClassicInputText.vue.d.ts +1 -1
  147. package/dist/src/components/form/ClassicMultiselect.vue.d.ts +4 -4
  148. package/dist/src/components/form/index.d.ts +2 -1
  149. package/dist/src/components/layouts/PresentationItem.vue.d.ts +7 -3
  150. package/dist/src/components/misc/ClassicPopover.vue.d.ts +2 -0
  151. package/dist/src/components/misc/ExternalLink.vue.d.ts +27 -0
  152. package/dist/src/components/misc/LoadingOverlay.vue.d.ts +19 -0
  153. package/dist/src/components/misc/SkipToContent.vue.d.ts +7 -0
  154. package/dist/src/locale/messages.d.ts +102 -0
  155. package/dist/src/stores/AuthStore.d.ts +1 -0
  156. package/dist/src/stores/CommentStore.d.ts +3 -1
  157. package/dist/src/stores/ParamSdkStore.d.ts +30 -32
  158. package/dist/src/websocket/commentWebsocket.d.ts +3 -2
  159. package/dist/src/websocket/wss.d.ts +35 -32
  160. package/dist/tests-mocks.mjs +3 -2
  161. package/dist/tests.mjs +3 -2
  162. package/dist/{useAdvancedParamInit-Bn2nYh9V.mjs → useAdvancedParamInit-CdXta4Fd.mjs} +5 -5
  163. package/dist/{useAppleVideo-MNXcA2S0.mjs → useAppleVideo-C0gGIXRR.mjs} +1 -1
  164. package/dist/{useDayjs-DV3H3JdH.mjs → useDayjs-B6txyR3X.mjs} +1 -1
  165. package/dist/{useErrorHandler-BVeBrWmP.mjs → useErrorHandler-BPwwQKrG.mjs} +1 -1
  166. package/dist/{useImageProxy-aLDjafm4.mjs → useImageProxy-XMMC_IC2.mjs} +1 -1
  167. package/dist/{useOrgaComputed-q48Zu9Fs.mjs → useOrgaComputed-B0wJ-ALx.mjs} +1 -1
  168. package/dist/usePresentationItem-D6mrQ7Zp.mjs +104 -0
  169. package/dist/{useRights-tS_KEToi.mjs → useRights-B-RH3q3n.mjs} +1 -1
  170. package/dist/{useRubriquesFilterComputed-Xl5Dt2Xq.mjs → useRubriquesFilterComputed-Bp6L2o9-.mjs} +1 -1
  171. package/dist/{useRubriquesFilterParam-CIvIwIvX.mjs → useRubriquesFilterParam-B05QATg9.mjs} +1 -1
  172. package/dist/{useSharePlatforms-fUzHb1WM.mjs → useSharePlatforms-CbcKb6yZ.mjs} +26 -26
  173. package/dist/{useSimplePageParam-3Nn8EFc0.mjs → useSimplePageParam-DaoVpYoG.mjs} +1 -1
  174. package/eslint-config.mjs +10 -0
  175. package/package.json +4 -2
  176. package/src/api/rubriquesApi.ts +4 -4
  177. package/src/components/display/RightsIndicator.vue +0 -13
  178. package/src/components/display/RightsWrapper.vue +1 -16
  179. package/src/components/display/accessibility/AccessibilityModal.vue +7 -12
  180. package/src/components/display/comments/CommentInput.vue +2 -1
  181. package/src/components/display/comments/CommentList.vue +189 -176
  182. package/src/components/display/comments/CommentSection.vue +160 -73
  183. package/src/components/display/comments/item/CommentItem.vue +186 -135
  184. package/src/components/display/comments/item/CommentMoreActions.vue +195 -194
  185. package/src/components/display/comments/like/LikeButton.vue +47 -45
  186. package/src/components/display/comments/like/LikeSection.vue +122 -115
  187. package/src/components/display/emission/EmissionInlineList.vue +118 -116
  188. package/src/components/display/emission/EmissionItem.vue +35 -28
  189. package/src/components/display/emission/EmissionList.vue +41 -24
  190. package/src/components/display/emission/EmissionPresentationItem.vue +3 -0
  191. package/src/components/display/emission/EmissionPresentationList.vue +1 -0
  192. package/src/components/display/filter/ProductorSearch.vue +83 -80
  193. package/src/components/display/list/ListPaginate.vue +51 -37
  194. package/src/components/display/list/PaginateParams.vue +28 -32
  195. package/src/components/display/list/PaginateSection.vue +145 -138
  196. package/src/components/display/list/SwiperList.vue +113 -10
  197. package/src/components/display/live/LiveList.vue +111 -106
  198. package/src/components/display/live/RadioItem.vue +17 -12
  199. package/src/components/display/organisation/OrganisationChooser.vue +2 -1
  200. package/src/components/display/participant/ParticipantInlineList.vue +52 -49
  201. package/src/components/display/participant/ParticipantItem.vue +2 -1
  202. package/src/components/display/playlist/PlaylistItem.vue +19 -15
  203. package/src/components/display/playlist/PlaylistList.vue +16 -10
  204. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +68 -61
  205. package/src/components/display/podcasts/AnimatorsItem.vue +2 -0
  206. package/src/components/display/podcasts/PodcastFilterList.vue +107 -106
  207. package/src/components/display/podcasts/PodcastImage.vue +110 -126
  208. package/src/components/display/podcasts/PodcastInlineList.vue +133 -25
  209. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +2 -0
  210. package/src/components/display/podcasts/PodcastItem.vue +111 -64
  211. package/src/components/display/podcasts/PodcastItemInfo.vue +48 -18
  212. package/src/components/display/podcasts/PodcastList.vue +198 -194
  213. package/src/components/display/podcasts/PodcastModuleBox.vue +1 -0
  214. package/src/components/display/podcasts/PodcastPlayButton.vue +23 -6
  215. package/src/components/display/podcasts/PodcastPresentationList.vue +1 -0
  216. package/src/components/display/rubriques/InlineRubriqueList.vue +35 -16
  217. package/src/components/display/sharing/FormatSwitch.vue +90 -101
  218. package/src/components/display/sharing/QrCode.vue +4 -8
  219. package/src/components/display/sharing/ShareAnonymous.vue +207 -205
  220. package/src/components/display/sharing/ShareNewsletter.vue +3 -7
  221. package/src/components/display/sharing/SharePlayerColors.vue +5 -12
  222. package/src/components/display/sharing/ShareSocialsButtons.vue +67 -60
  223. package/src/components/display/sharing/SubscribeButtons.vue +47 -35
  224. package/src/components/form/ClassicColorPicker.vue +110 -0
  225. package/src/components/form/ClassicMultiselect.vue +205 -197
  226. package/src/components/form/ClassicSelect.vue +100 -80
  227. package/src/components/form/index.ts +2 -0
  228. package/src/components/layouts/PresentationItem.vue +18 -12
  229. package/src/components/misc/ClassicDataTable.vue +3 -3
  230. package/src/components/misc/ClassicPopover.vue +95 -1
  231. package/src/components/misc/ClassicSpinner.vue +16 -2
  232. package/src/components/misc/ExternalLink.vue +51 -0
  233. package/src/components/misc/LoadingOverlay.vue +86 -0
  234. package/src/components/misc/RightsScopeMenu.vue +1 -1
  235. package/src/components/misc/SkipToContent.vue +16 -0
  236. package/src/components/misc/TopBarMainContent.vue +6 -9
  237. package/src/components/misc/UserButtonContent.vue +4 -7
  238. package/src/components/pages/EmissionPage.vue +3 -2
  239. package/src/components/pages/EmissionsPage.vue +4 -0
  240. package/src/components/pages/ParticipantPage.vue +2 -1
  241. package/src/components/pages/PlaylistPage.vue +115 -110
  242. package/src/components/pages/PodcastPage.vue +3 -0
  243. package/src/components/pages/PodcastsPage.vue +4 -0
  244. package/src/components/pages/RubriquePage.vue +1 -0
  245. package/src/components/pages/SmartLinkPage.vue +10 -7
  246. package/src/layouts/FullLayout.vue +29 -23
  247. package/src/locale/de.json +18 -1
  248. package/src/locale/en.json +18 -1
  249. package/src/locale/es.json +18 -1
  250. package/src/locale/fr.json +22 -1
  251. package/src/locale/it.json +18 -1
  252. package/src/locale/sl.json +18 -1
  253. package/src/stores/AuthStore.ts +11 -1
  254. package/src/stores/CommentStore.ts +280 -263
  255. package/src/stores/ParamSdkStore.ts +39 -37
  256. package/src/style/_variables.scss +18 -0
  257. package/src/style/bootstrap.scss +40 -1
  258. package/src/style/general.scss +3 -3
  259. package/src/style/share.scss +26 -1
  260. package/src/websocket/commentWebsocket.ts +56 -54
  261. package/src/websocket/wss.ts +136 -163
  262. package/tests/components/display/comments/CommentList.spec.ts +45 -0
  263. package/tests/components/display/emission/EmissionItem.spec.ts +35 -0
  264. package/tests/components/display/emission/EmissionPresentationItem.spec.ts +6 -0
  265. package/tests/components/display/filter/ProductorSearch.spec.ts +20 -0
  266. package/tests/components/display/list/ListPaginate.spec.ts +67 -0
  267. package/tests/components/display/list/SwiperList.spec.ts +101 -2
  268. package/tests/components/display/live/RadioItem.spec.ts +41 -0
  269. package/tests/components/display/playlist/PlaylistItem.spec.ts +53 -0
  270. package/tests/components/display/podcasts/AnimatorsItem.spec.ts +18 -0
  271. package/tests/components/display/podcasts/PodcastInlineList.spec.ts +139 -0
  272. package/tests/components/display/podcasts/PodcastInlineListTemplate.spec.ts +16 -0
  273. package/tests/components/display/podcasts/PodcastItem.spec.ts +77 -0
  274. package/tests/components/display/podcasts/PodcastItemInfo.spec.ts +15 -2
  275. package/tests/components/display/podcasts/PodcastPlayButton.spec.ts +67 -0
  276. package/tests/components/display/sharing/FormatSwitch.spec.ts +26 -0
  277. package/tests/components/display/sharing/ShareAnonymous.spec.ts +61 -0
  278. package/tests/components/display/sharing/SubscribeButtons.spec.ts +73 -0
  279. package/tests/components/form/ClassicColorPicker.spec.ts +71 -0
  280. package/tests/components/form/ClassicSelect.spec.ts +38 -0
  281. package/tests/components/layouts/PresentationItem.spec.ts +34 -0
  282. package/tests/components/misc/ClassicPopover.spec.ts +112 -0
  283. package/tests/components/misc/ExternalLink.spec.ts +49 -0
  284. package/tests/components/misc/LoadingOverlay.spec.ts +27 -0
  285. package/tests/components/misc/SkipToContent.spec.ts +19 -0
  286. package/tests/components/pages/EmissionPage.spec.ts +9 -0
  287. package/tests/components/pages/EmissionsPage.spec.ts +13 -2
  288. package/tests/components/pages/PlaylistPage.spec.ts +11 -0
  289. package/tests/components/pages/PodcastsPage.spec.ts +13 -2
  290. package/tests/components/pages/SmartLinkPage.spec.ts +13 -0
  291. package/tests/helper/language.spec.ts +7 -3
  292. package/tests/mocks/useAdvancedParamInit.ts +2 -1
  293. package/tests/setup.ts +7 -0
  294. package/tests/stores/CommentStore.spec.ts +19 -0
  295. package/tests/utils.ts +5 -2
  296. package/tests/websocket/wss.spec.ts +153 -0
  297. package/dist/ClassicPopover-BUb-1WMB.mjs +0 -172
  298. package/dist/ClassicSelect-BpA0jKN6.mjs +0 -111
  299. package/dist/CommentItem-CY2-D9P3.mjs +0 -226
  300. package/dist/CommentList-CDIYZEq_.mjs +0 -201
  301. package/dist/CommentSection-BJZtgsut.mjs +0 -79
  302. package/dist/EmissionItem-BVsuGOnv.mjs +0 -116
  303. package/dist/EmissionList-E8czEUK3.mjs +0 -229
  304. package/dist/EmissionPage-CaDFKkE8.mjs +0 -192
  305. package/dist/EmissionsPage-C0jLjKTK.mjs +0 -116
  306. package/dist/InlineRubriqueList-BeGu04QD.mjs +0 -48
  307. package/dist/LikeButton-Cu8jAJHx.mjs +0 -40
  308. package/dist/ListPaginate-BYBfYtD5.mjs +0 -153
  309. package/dist/OrganisationChooser-CNNIw66c.mjs +0 -135
  310. package/dist/PaginateParams-Bjz3ZI-5.mjs +0 -75
  311. package/dist/ParticipantItem-CRnquj4R.mjs +0 -91
  312. package/dist/ParticipantPage-D0lJjj0p.mjs +0 -128
  313. package/dist/PlaylistPage-DMnkTMHk.mjs +0 -132
  314. package/dist/PodcastImage-DrIX2U4c.mjs +0 -115
  315. package/dist/PodcastInlineList-BtVDNokV.mjs +0 -123
  316. package/dist/PodcastItem-DYOmggEB.mjs +0 -151
  317. package/dist/PodcastPage-ClhwIq9v.mjs +0 -591
  318. package/dist/PodcastPlayButton-Bv61tl0L.mjs +0 -111
  319. package/dist/PodcastPlaylistInlineList-aZhxjz3p.mjs +0 -63
  320. package/dist/PodcastSwiperList-Cwh53maw.mjs +0 -170
  321. package/dist/PodcastsPage-CiEknka_.mjs +0 -132
  322. package/dist/QrCode-DITqqZq6.mjs +0 -109
  323. package/dist/RadioList-CTlVQuyN.mjs +0 -70
  324. package/dist/ShareAnonymous-kxt4P4zK.mjs +0 -199
  325. package/dist/SharePlayerColors-BpdifsHh.mjs +0 -49
  326. package/dist/ShareSocialsButtons-BhBqmgz7.mjs +0 -102
  327. package/dist/SmartLinkPage-Bupxsq-O.mjs +0 -136
  328. package/dist/SubscribeButtons-P1Jh_rFJ.mjs +0 -121
  329. package/dist/SwiperList-1mHT07oe.mjs +0 -117
  330. package/dist/TopBar-CeVHXg03.mjs +0 -427
  331. package/dist/UserButtonContent-CIq9izAe.mjs +0 -131
  332. package/dist/usePresentationItem-DWIj-6bU.mjs +0 -100
  333. package/src/components/display/podcasts/PodcastSwiperList.vue +0 -160
  334. package/src/helper/featureHelper.ts +0 -24
@@ -0,0 +1,53 @@
1
+ import { mockI18n, mockUseRouter } from '@tests/mocks';
2
+ vi.mock('vue-i18n', () => mockI18n());
3
+ vi.mock('vue-router', () => mockUseRouter());
4
+
5
+ import PlaylistItem from '@/components/display/playlist/PlaylistItem.vue';
6
+ import { emptyPlaylistData } from '@/stores/class/general/playlist';
7
+ import { mount as testMount } from '@tests/utils';
8
+ import { describe, expect, it, vi } from 'vitest';
9
+
10
+ const mount = (props: Record<string, unknown> = {}) => testMount(PlaylistItem, {
11
+ props: {
12
+ playlist: {
13
+ ...emptyPlaylistData(),
14
+ title: 'My playlist',
15
+ description: 'My description',
16
+ organisation: { id: 'orga', name: 'Orga' }
17
+ },
18
+ ...props
19
+ }
20
+ });
21
+
22
+ describe('PlaylistItem', () => {
23
+ describe('accessibility', () => {
24
+ it('renders the name in a h3 by default', async () => {
25
+ const wrapper = await mount();
26
+ expect(wrapper.find('h3').text()).toBe('My playlist');
27
+ });
28
+
29
+ it('renders the name in the given heading', async () => {
30
+ const wrapper = await mount({ titleTag: 'h2' });
31
+ expect(wrapper.find('h2').text()).toBe('My playlist');
32
+ expect(wrapper.find('h3').exists()).toBe(false);
33
+ });
34
+
35
+ it('limits the link to the name', async () => {
36
+ const wrapper = await mount();
37
+ expect(wrapper.find('.element-link').text()).toBe('My playlist');
38
+ });
39
+
40
+ it('does not nest links', async () => {
41
+ const wrapper = await mount();
42
+ expect(wrapper.findAll('a')).toHaveLength(2);
43
+ expect(wrapper.find('a a').exists()).toBe(false);
44
+ });
45
+
46
+ it('has a decorative image without title', async () => {
47
+ const wrapper = await mount();
48
+ const img = wrapper.find('img');
49
+ expect(img.attributes('alt')).toBe('');
50
+ expect(img.attributes('title')).toBeUndefined();
51
+ });
52
+ });
53
+ });
@@ -0,0 +1,18 @@
1
+ import { mockI18n } from '@tests/mocks';
2
+ vi.mock('vue-i18n', () => mockI18n());
3
+
4
+ import AnimatorsItem from '@/components/display/podcasts/AnimatorsItem.vue';
5
+ import type { Participant } from '@/stores/class/general/participant';
6
+ import { mount } from '@tests/utils';
7
+ import { describe, expect, it, vi } from 'vitest';
8
+
9
+ const animator = { participantId: 1, firstName: 'Jean', lastName: 'Dupont' } as Participant;
10
+
11
+ describe('AnimatorsItem', () => {
12
+ it('states the role before the link, keeping the link name to the visible text', async () => {
13
+ const wrapper = await mount(AnimatorsItem, { props: { animator } });
14
+ expect(wrapper.find('.visually-hidden').text()).toBe('Animated by');
15
+ expect(wrapper.find('a').text()).toBe('Jean Dupont');
16
+ expect(wrapper.text()).toMatch(/^Animated by\s*Jean Dupont$/);
17
+ });
18
+ });
@@ -0,0 +1,139 @@
1
+ import { mockI18n, mockUseRouter } from '@tests/mocks';
2
+ vi.mock('vue-i18n', () => mockI18n());
3
+ vi.mock('vue-router', () => mockUseRouter());
4
+ vi.mock('@/api/classicApi', () => ({
5
+ default: { fetchData: vi.fn() }
6
+ }));
7
+
8
+ import classicApi from '@/api/classicApi';
9
+ import PodcastInlineList from '@/components/display/podcasts/PodcastInlineList.vue';
10
+ import SwiperList from '@/components/display/list/SwiperList.vue';
11
+ import { emptyPodcastData } from '@/stores/class/general/podcast';
12
+ import { useFilterStore } from '@/stores/FilterStore';
13
+ import { mount as testMount } from '@tests/utils';
14
+ import { flushPromises } from '@vue/test-utils';
15
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
16
+
17
+ const podcast = (podcastId: number) => ({ ...emptyPodcastData(), podcastId });
18
+
19
+ const mockResult = (result: Array<unknown>) =>
20
+ vi.mocked(classicApi.fetchData).mockResolvedValue({ result });
21
+
22
+ const mount = async (
23
+ props: Record<string, unknown> = {},
24
+ beforeMount?: () => void
25
+ ) => {
26
+ const wrapper = await testMount(PodcastInlineList, {
27
+ props,
28
+ beforeMount,
29
+ stubs: ['SwiperList', 'ClassicLoading']
30
+ });
31
+ await flushPromises();
32
+ return wrapper;
33
+ };
34
+
35
+ /** Search parameters of the nth API call (the last one by default) */
36
+ const searchParams = (call = -1) =>
37
+ vi.mocked(classicApi.fetchData).mock.calls.at(call)?.[0].parameters;
38
+
39
+ describe('PodcastInlineList', () => {
40
+ beforeEach(() => {
41
+ vi.mocked(classicApi.fetchData).mockReset();
42
+ mockResult([podcast(1), podcast(2)]);
43
+ });
44
+
45
+ describe('fetching', () => {
46
+ it('searches the latest podcasts of the given organisation', async () => {
47
+ await mount({ organisationId: ['org-1'], emissionId: 5 });
48
+ expect(searchParams()).toMatchObject({
49
+ organisationId: ['org-1'],
50
+ emissionId: 5,
51
+ sort: 'DATE'
52
+ });
53
+ });
54
+
55
+ it('falls back on the filtered organisation', async () => {
56
+ await mount({}, () => {
57
+ useFilterStore().filterOrgaId = 'org-filter';
58
+ });
59
+ expect(searchParams()).toMatchObject({ organisationId: ['org-filter'] });
60
+ });
61
+
62
+ it('starts sorted by popularity when required', async () => {
63
+ await mount({ requirePopularSort: true });
64
+ expect(classicApi.fetchData).toHaveBeenCalledTimes(1);
65
+ expect(searchParams()).toMatchObject({ sort: 'POPULARITY' });
66
+ });
67
+
68
+ it('limits popular podcasts to the last three months', async () => {
69
+ await mount({ requirePopularSort: true, lastThreeMonths: true });
70
+ expect(searchParams()?.after).toBeDefined();
71
+ });
72
+
73
+ it('fetches again when a filter changes', async () => {
74
+ const wrapper = await mount({ emissionId: 5 });
75
+ await wrapper.setProps({ emissionId: 6 });
76
+ await flushPromises();
77
+ expect(classicApi.fetchData).toHaveBeenCalledTimes(2);
78
+ expect(searchParams()).toMatchObject({ emissionId: 6 });
79
+ });
80
+ });
81
+
82
+ describe('display', () => {
83
+ it('hides the list until podcasts are loaded', async () => {
84
+ vi.mocked(classicApi.fetchData).mockReturnValue(new Promise(() => {}));
85
+ const wrapper = await mount();
86
+ expect(wrapper.findComponent(SwiperList).exists()).toBe(false);
87
+ expect(wrapper.find('.podcast-inline-container').exists()).toBe(true);
88
+ });
89
+
90
+ it('excludes empty podcasts and the current podcast', async () => {
91
+ mockResult([podcast(1), null, podcast(2)]);
92
+ const wrapper = await mount({ podcastId: 2 });
93
+ expect(wrapper.findComponent(SwiperList).props('listObject'))
94
+ .toEqual([podcast(1)]);
95
+ });
96
+
97
+ it('renders nothing when there are no podcasts', async () => {
98
+ mockResult([]);
99
+ const wrapper = await mount({ title: 'Podcasts' });
100
+ expect(wrapper.find('.podcast-inline-container').exists()).toBe(false);
101
+ });
102
+ });
103
+
104
+ describe('sorting', () => {
105
+ const buttons = (wrapper: Awaited<ReturnType<typeof mount>>) => {
106
+ const [chrono, popular] = wrapper.findAll('button.btn-underline');
107
+ return { chrono, popular };
108
+ };
109
+
110
+ it('switches between popular and chronological sorts', async () => {
111
+ const wrapper = await mount();
112
+
113
+ await buttons(wrapper).popular.trigger('click');
114
+ await flushPromises();
115
+ expect(searchParams()).toMatchObject({ sort: 'POPULARITY' });
116
+ expect(buttons(wrapper).popular.classes()).toContain('active');
117
+
118
+ await buttons(wrapper).chrono.trigger('click');
119
+ await flushPromises();
120
+ expect(searchParams()).toMatchObject({ sort: 'DATE' });
121
+ expect(buttons(wrapper).chrono.classes()).toContain('active');
122
+ });
123
+
124
+ it('does not fetch again when choosing the current sort', async () => {
125
+ const wrapper = await mount();
126
+ await buttons(wrapper).chrono.trigger('click');
127
+ await flushPromises();
128
+ expect(classicApi.fetchData).toHaveBeenCalledTimes(1);
129
+ });
130
+ });
131
+
132
+ describe('accessibility', () => {
133
+ it('uses the title as a heading and as the list label', async () => {
134
+ const wrapper = await mount({ title: 'Latest', titleTag: 'h3' });
135
+ expect(wrapper.find('h3').text()).toBe('Latest');
136
+ expect(wrapper.findComponent(SwiperList).props('label')).toBe('Latest');
137
+ });
138
+ });
139
+ });
@@ -21,4 +21,20 @@ describe('PodcastInlineListTemplate', () => {
21
21
  expect(wrapper.find('.btn-underline').exists()).toBe(false);
22
22
  });
23
23
  });
24
+
25
+ describe('accessibility', () => {
26
+ const pressedStates = async (popularSort: boolean) => {
27
+ const wrapper = await mount({ popularSort });
28
+ return wrapper.findAll('.btn-underline')
29
+ .map(button => button.attributes('aria-pressed'));
30
+ };
31
+
32
+ it('exposes the chronological sort as selected', async () => {
33
+ expect(await pressedStates(false)).toEqual(['true', 'false']);
34
+ });
35
+
36
+ it('exposes the popular sort as selected', async () => {
37
+ expect(await pressedStates(true)).toEqual(['false', 'true']);
38
+ });
39
+ });
24
40
  });
@@ -0,0 +1,77 @@
1
+ import { mockI18n, mockUseRouter } from '@tests/mocks';
2
+ vi.mock('vue-i18n', () => mockI18n());
3
+ vi.mock('vue-router', () => mockUseRouter());
4
+
5
+ import PodcastItem from '@/components/display/podcasts/PodcastItem.vue';
6
+ import { emptyPodcastData } from '@/stores/class/general/podcast';
7
+ import { mount as testMount } from '@tests/utils';
8
+ import { describe, expect, it, vi } from 'vitest';
9
+
10
+ const mount = (description = 'Some description', props: Record<string, unknown> = {}) => testMount(PodcastItem, {
11
+ props: { podcast: { ...emptyPodcastData(), description }, ...props },
12
+ stubs: ['PodcastItemInfo', 'PodcastPlayButton']
13
+ });
14
+
15
+ describe('PodcastItem', () => {
16
+ describe('description', () => {
17
+ it('is toggled by a disclosure button', async () => {
18
+ const wrapper = await mount();
19
+ const button = wrapper.find('button[aria-controls]');
20
+ const panel = wrapper.find('.description-podcast-item');
21
+ expect(button.attributes('aria-controls')).toBe(panel.attributes('id'));
22
+ expect(button.attributes('aria-expanded')).toBe('false');
23
+ expect(panel.attributes('style')).toContain('display: none');
24
+
25
+ await button.trigger('click');
26
+ expect(button.attributes('aria-expanded')).toBe('true');
27
+ expect(panel.attributes('style') ?? '').not.toContain('display: none');
28
+ });
29
+
30
+ it('has no button without description', async () => {
31
+ const wrapper = await mount('');
32
+ expect(wrapper.find('button[aria-controls]').exists()).toBe(false);
33
+ });
34
+
35
+ it('is closed with Escape', async () => {
36
+ const wrapper = await mount();
37
+ const button = wrapper.find('button[aria-controls]');
38
+ await button.trigger('click');
39
+
40
+ document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' }));
41
+ await wrapper.vm.$nextTick();
42
+ expect(button.attributes('aria-expanded')).toBe('false');
43
+ });
44
+
45
+ it('opens on hover and closes when leaving the card', async () => {
46
+ vi.useFakeTimers();
47
+ const wrapper = await mount();
48
+ const button = wrapper.find('button[aria-controls]');
49
+
50
+ await wrapper.find('.description-podcast-item + div').trigger('mouseenter');
51
+ await vi.advanceTimersByTimeAsync(100);
52
+ expect(button.attributes('aria-expanded')).toBe('true');
53
+
54
+ await wrapper.find('article').trigger('mouseleave');
55
+ await vi.advanceTimersByTimeAsync(100);
56
+ expect(button.attributes('aria-expanded')).toBe('false');
57
+ vi.useRealTimers();
58
+ });
59
+
60
+ it('stays open when leaving the card after opening with the button', async () => {
61
+ vi.useFakeTimers();
62
+ const wrapper = await mount();
63
+ const button = wrapper.find('button[aria-controls]');
64
+ await button.trigger('click');
65
+
66
+ await wrapper.find('article').trigger('mouseleave');
67
+ await vi.advanceTimersByTimeAsync(100);
68
+ expect(button.attributes('aria-expanded')).toBe('true');
69
+ vi.useRealTimers();
70
+ });
71
+ });
72
+
73
+ it('passes the heading tag of the title to the info', async () => {
74
+ const wrapper = await mount(undefined, { titleTag: 'h4' });
75
+ expect(wrapper.findComponent({ name: 'PodcastItemInfo' }).props('titleTag')).toBe('h4');
76
+ });
77
+ });
@@ -9,10 +9,10 @@ import { emptyPodcastData, Podcast, PodcastType } from '@/stores/class/general/p
9
9
  import { mount as testMount, setupAuthStore } from '@tests/utils';
10
10
  import { describe, expect, it, vi } from 'vitest';
11
11
 
12
- const mount = (podcast: Partial<Podcast> = {}, auth?: { roles: string[], scope?: number[] }) => {
12
+ const mount = (podcast: Partial<Podcast> = {}, auth?: { roles: string[], scope?: number[] }, props: Record<string, unknown> = {}) => {
13
13
  const base = emptyPodcastData();
14
14
  return testMount(PodcastItemInfo, {
15
- props: { podcast: { ...base, ...podcast } },
15
+ props: { podcast: { ...base, ...podcast }, ...props },
16
16
  stubs: ['PodcastPlayBar', 'AnimatorsItem', 'BullhornIcon', 'GiftIcon'],
17
17
  beforeMount: auth ? async () => {
18
18
  await setupAuthStore({ roles: auth.roles, scope: auth.scope })();
@@ -96,4 +96,17 @@ describe('PodcastItemInfo', () => {
96
96
  expect(icon.classes()).toContain('invisible');
97
97
  });
98
98
  });
99
+
100
+ describe('accessibility', () => {
101
+ it('puts the title link in a heading, h3 by default', async () => {
102
+ expect((await mount()).find('h3 > a').exists()).toBe(true);
103
+ expect((await mount({}, undefined, { titleTag: 'h4' })).find('h4 > a').exists()).toBe(true);
104
+ });
105
+
106
+ it('labels the date as the publication date', async () => {
107
+ const label = (await mount()).find('.podcast-item-status .visually-hidden');
108
+ expect(label.text()).toBe('PodcastItem - Published on');
109
+ expect(label.element.nextElementSibling?.tagName).toBe('TIME');
110
+ });
111
+ });
99
112
  });
@@ -0,0 +1,67 @@
1
+ import { mockI18n, mockUseRouter } from '@tests/mocks';
2
+ vi.mock('vue-i18n', () => mockI18n());
3
+ vi.mock('vue-router', () => mockUseRouter());
4
+
5
+ import PodcastPlayButton from '@/components/display/podcasts/PodcastPlayButton.vue';
6
+ import { emptyPodcastData } from '@/stores/class/general/podcast';
7
+ import { mount as testMount } from '@tests/utils';
8
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
9
+
10
+ const saootiPlayer = vi.hoisted(() => ({
11
+ state: {
12
+ podcast: undefined as { podcastId: number } | undefined,
13
+ status: 'STOPPED',
14
+ isVideo: false
15
+ },
16
+ playPodcast: vi.fn(),
17
+ togglePlay: vi.fn()
18
+ }));
19
+ vi.mock('@saooti/saooti-player', () => ({ saootiPlayer }));
20
+
21
+ const podcast = { ...emptyPodcastData(), podcastId: 12, title: 'Mon épisode', duration: 754000 };
22
+
23
+ const mount = (status?: string) => {
24
+ Object.assign(saootiPlayer.state, status ? { podcast, status } : { podcast: undefined, status: 'STOPPED' });
25
+ return testMount(PodcastPlayButton, {
26
+ props: { podcast },
27
+ stubs: ['PodcastIsPlaying']
28
+ });
29
+ };
30
+
31
+ describe('PodcastPlayButton', () => {
32
+ beforeEach(() => {
33
+ vi.clearAllMocks();
34
+ });
35
+
36
+ describe('accessible name', () => {
37
+ it('names the episode and its visible duration', async () => {
38
+ const button = (await mount()).find('button');
39
+ const duration = button.find('time').text();
40
+ expect(button.attributes('aria-label')).toBe(`PodcastPlayButton - Play title:Mon épisode duration:${duration}`);
41
+ });
42
+
43
+ it('switches to pause while the episode is playing', async () => {
44
+ const button = (await mount('PLAYING')).find('button');
45
+ expect(button.attributes('aria-label')).toContain('PodcastPlayButton - Pause');
46
+ });
47
+
48
+ it('stays on play while the episode is paused', async () => {
49
+ const button = (await mount('PAUSED')).find('button');
50
+ expect(button.attributes('aria-label')).toContain('PodcastPlayButton - Play');
51
+ });
52
+ });
53
+
54
+ describe('play', () => {
55
+ it('starts the episode when it is not loaded', async () => {
56
+ await (await mount()).find('button').trigger('click');
57
+ expect(saootiPlayer.playPodcast).toHaveBeenCalledWith(12, false);
58
+ expect(saootiPlayer.togglePlay).not.toHaveBeenCalled();
59
+ });
60
+
61
+ it.each(['PLAYING', 'PAUSED'])('toggles the episode when it is %s', async (status) => {
62
+ await (await mount(status)).find('button').trigger('click');
63
+ expect(saootiPlayer.togglePlay).toHaveBeenCalledOnce();
64
+ expect(saootiPlayer.playPodcast).not.toHaveBeenCalled();
65
+ });
66
+ });
67
+ });
@@ -0,0 +1,26 @@
1
+ import { mockI18n } from '@tests/mocks';
2
+ vi.mock('vue-i18n', () => mockI18n());
3
+
4
+ import FormatSwitch from '@/components/display/sharing/FormatSwitch.vue';
5
+ import { localisation, mount } from '@tests/utils';
6
+ import { describe, expect, it, vi } from 'vitest';
7
+
8
+ describe('FormatSwitch', () => {
9
+ it('is a labelled group of two labelled radios', async () => {
10
+ const wrapper = await mount(FormatSwitch, { props: { isSvg: true } });
11
+
12
+ expect(wrapper.find('fieldset legend').text()).toBe(localisation('FormatSwitch - Format'));
13
+ const radios = wrapper.findAll<HTMLInputElement>('input[type="radio"]');
14
+ const labels = radios.map((radio) => wrapper.find(`label[for="${radio.attributes('id')}"]`).text());
15
+ expect(labels).toEqual(['SVG', 'PNG']);
16
+ expect(radios.map((radio) => radio.element.checked)).toEqual([true, false]);
17
+ });
18
+
19
+ it('emits the selected format', async () => {
20
+ const wrapper = await mount(FormatSwitch, { props: { isSvg: true } });
21
+
22
+ await wrapper.findAll('input[type="radio"]')[1].setValue();
23
+
24
+ expect(wrapper.emitted('update:isSvg')).toEqual([[false]]);
25
+ });
26
+ });
@@ -0,0 +1,61 @@
1
+ import { mockUseRouter, mockI18n } from '@tests/mocks';
2
+ vi.mock('vue-router', () => mockUseRouter());
3
+ vi.mock('vue-i18n', () => mockI18n());
4
+
5
+ import ClassicPopover from '@/components/misc/ClassicPopover.vue';
6
+ import ShareAnonymous from '@/components/display/sharing/ShareAnonymous.vue';
7
+ import { localisation, mount } from '@tests/utils';
8
+ import { flushPromises } from '@vue/test-utils';
9
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
10
+ import { useSaveFetchStore } from '@/stores/SaveFetchStore';
11
+ import { state } from '@/stores/ParamSdkStore';
12
+ import { Emission } from '@/stores/class/general/emission';
13
+
14
+ describe('ShareAnonymous', () => {
15
+ let appElement: HTMLElement;
16
+
17
+ beforeEach(() => {
18
+ // ClassicPopover is teleported to #app
19
+ appElement = document.createElement('div');
20
+ appElement.id = 'app';
21
+ document.body.appendChild(appElement);
22
+ state.generalParameters.podcastmaker = true;
23
+ });
24
+ afterEach(() => {
25
+ appElement.remove();
26
+ state.generalParameters.podcastmaker = false;
27
+ vi.restoreAllMocks();
28
+ });
29
+
30
+ const mountShare = async () => {
31
+ const wrapper = await mount(ShareAnonymous, {
32
+ props: {
33
+ emission: { emissionId: 1, name: 'Emission', annotations: {} } as unknown as Emission,
34
+ organisationId: 'org1'
35
+ },
36
+ beforeMount: () => {
37
+ vi.spyOn(useSaveFetchStore(), 'getOrgaAttributes').mockResolvedValue({});
38
+ }
39
+ });
40
+ await flushPromises();
41
+ return wrapper;
42
+ };
43
+
44
+ it('keeps its menu usable without styles (RGAA 10.3)', async () => {
45
+ const wrapper = await mountShare();
46
+ expect(wrapper.findComponent(ClassicPopover).props('isTopLayer')).toBe(true);
47
+ wrapper.unmount();
48
+ });
49
+
50
+ it('opens the smartlink', async () => {
51
+ const open = vi.spyOn(window, 'open').mockReturnValue({ focus: vi.fn() } as unknown as Window);
52
+ const wrapper = await mountShare();
53
+
54
+ const smartLinkButton = Array.from(appElement.querySelectorAll('button'))
55
+ .find(button => button.textContent?.trim() === localisation('SmartLink - Share link'));
56
+ smartLinkButton?.dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));
57
+
58
+ expect(open).toHaveBeenCalledOnce();
59
+ wrapper.unmount();
60
+ });
61
+ });
@@ -0,0 +1,73 @@
1
+ import { mockI18n, mockUseRouter } from '@tests/mocks';
2
+ vi.mock('vue-i18n', () => mockI18n());
3
+ vi.mock('vue-router', () => mockUseRouter());
4
+
5
+ const platforms = vi.hoisted(() => ({ count: 0 }));
6
+ vi.mock('@/components/composable/share/useSharePlatforms', () => ({
7
+ useSharePlatforms: () => ({
8
+ initPlatforms: vi.fn(),
9
+ getPlatformsWithLinks: () => Array.from({ length: platforms.count }, (_, index) => ({
10
+ name: `platform${index}`,
11
+ icon: 'span',
12
+ title: `Platform ${index}`,
13
+ url: `https://example.com/${index}`
14
+ }))
15
+ })
16
+ }));
17
+
18
+ import SubscribeButtons from '@/components/display/sharing/SubscribeButtons.vue';
19
+ import { mount as testMount } from '@tests/utils';
20
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
21
+
22
+ describe('SubscribeButtons', () => {
23
+ let appElement: HTMLElement;
24
+
25
+ const mount = (count: number, props: Record<string, unknown> = {}) => {
26
+ platforms.count = count;
27
+ return testMount(SubscribeButtons, {
28
+ attachTo: appElement,
29
+ props: {
30
+ content: { emissionId: 1, name: 'Emission', annotations: {}, orga: { id: 'org1' } },
31
+ ...props
32
+ }
33
+ });
34
+ };
35
+
36
+ const moreButton = () => document.getElementById('subscribe-buttons-dropdown');
37
+ const popover = () => document.getElementById('popoversubscribe-buttons-dropdown');
38
+
39
+ beforeEach(() => {
40
+ // ClassicPopover is teleported to #app
41
+ appElement = document.createElement('div');
42
+ appElement.id = 'app';
43
+ document.body.appendChild(appElement);
44
+ });
45
+
46
+ afterEach(() => {
47
+ appElement.remove();
48
+ });
49
+
50
+ describe('more button', () => {
51
+ it('is not rendered without hidden links, so that it stays absent without styles', async () => {
52
+ const wrapper = await mount(2);
53
+ expect(moreButton()).toBeNull();
54
+ expect(popover()).toBeNull();
55
+ wrapper.unmount();
56
+ });
57
+
58
+ it('is not rendered with a limit', async () => {
59
+ const wrapper = await mount(10, { limit: 2 });
60
+ expect(moreButton()).toBeNull();
61
+ expect(popover()).toBeNull();
62
+ wrapper.unmount();
63
+ });
64
+
65
+ it('exposes the menu of hidden links', async () => {
66
+ const wrapper = await mount(10);
67
+ expect(moreButton()?.getAttribute('aria-expanded')).toBe('false');
68
+ expect(moreButton()?.getAttribute('aria-controls')).toBe(popover()?.id);
69
+ expect(popover()?.querySelectorAll('a')).toHaveLength(5);
70
+ wrapper.unmount();
71
+ });
72
+ });
73
+ });
@@ -0,0 +1,71 @@
1
+ import ClassicColorPicker from '@/components/form/ClassicColorPicker.vue';
2
+ import { mount, VueWrapper } from '@tests/utils';
3
+ import { afterEach, describe, expect, it, vi } from 'vitest';
4
+ import { nextTick } from 'vue';
5
+
6
+ describe('ClassicColorPicker', () => {
7
+ let wrapper: VueWrapper | undefined;
8
+ const onUpdate = vi.fn();
9
+
10
+ afterEach(() => {
11
+ wrapper?.unmount();
12
+ onUpdate.mockReset();
13
+ });
14
+
15
+ // Mounts the picker and opens it
16
+ const open = async () => {
17
+ wrapper = await mount(ClassicColorPicker, {
18
+ props: { modelValue: '#2ECC70', label: 'QR Code color', 'onUpdate:modelValue': onUpdate },
19
+ attachTo: document.body
20
+ });
21
+ await wrapper.find('button').trigger('click');
22
+ await nextTick();
23
+ return wrapper.find('button').element;
24
+ };
25
+ const getSwatches = () => wrapper!.findAll<HTMLElement>('.vue-swatches__swatch').map((swatch) => swatch.element as HTMLElement);
26
+ const press = (element: Element, type: 'keydown' | 'keyup', key: string) => {
27
+ const event = new KeyboardEvent(type, { key, bubbles: true, cancelable: true });
28
+ element.dispatchEvent(event);
29
+ return event;
30
+ };
31
+
32
+ it('has a labelled trigger button reflecting its state', async () => {
33
+ const trigger = await open();
34
+
35
+ expect(trigger.getAttribute('aria-label')).toBe('QR Code color');
36
+ expect(trigger.getAttribute('aria-expanded')).toBe('true');
37
+ });
38
+
39
+ it('focuses the selected swatch when opened', async () => {
40
+ await open();
41
+
42
+ expect(document.activeElement).toBe(getSwatches()[2]);
43
+ });
44
+
45
+ it('selects a swatch with Space without scrolling, then focuses the trigger', async () => {
46
+ const trigger = await open();
47
+ const swatch = getSwatches()[1];
48
+ swatch.focus();
49
+
50
+ expect(press(swatch, 'keydown', ' ').defaultPrevented).toBe(true);
51
+ press(swatch, 'keyup', ' ');
52
+ await nextTick();
53
+ await nextTick();
54
+
55
+ expect(onUpdate).toHaveBeenCalledOnce();
56
+ expect(trigger.getAttribute('aria-expanded')).toBe('false');
57
+ expect(document.activeElement).toBe(trigger);
58
+ });
59
+
60
+ it('closes with Escape without closing its container, then focuses the trigger', async () => {
61
+ const trigger = await open();
62
+
63
+ const event = press(getSwatches()[0], 'keydown', 'Escape');
64
+ await nextTick();
65
+ await nextTick();
66
+
67
+ expect(event.defaultPrevented).toBe(true);
68
+ expect(trigger.getAttribute('aria-expanded')).toBe('false');
69
+ expect(document.activeElement).toBe(trigger);
70
+ });
71
+ });