@saooti/octopus-sdk 40.2.18 → 41.0.0-SNAPSHOT

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 (204) hide show
  1. package/package.json +38 -39
  2. package/src/App.vue +68 -88
  3. package/src/components/composable/player/usePlayerLive.ts +12 -3
  4. package/src/components/composable/player/usePlayerLogic.ts +6 -6
  5. package/src/components/composable/podcasts/usePodcastView.ts +3 -3
  6. package/src/components/composable/useInit.ts +2 -2
  7. package/src/components/composable/useMetaTitleWatch.ts +2 -2
  8. package/src/components/display/accessibility/AccessibilityModal.vue +56 -68
  9. package/src/components/display/categories/CategoryChooser.vue +142 -145
  10. package/src/components/display/categories/CategoryFilter.vue +172 -198
  11. package/src/components/display/categories/CategoryList.vue +122 -147
  12. package/src/components/display/comments/CommentInput.vue +100 -122
  13. package/src/components/display/comments/CommentList.vue +169 -191
  14. package/src/components/display/comments/CommentName.vue +35 -45
  15. package/src/components/display/comments/CommentParentInfo.vue +28 -34
  16. package/src/components/display/comments/CommentPlayer.vue +38 -50
  17. package/src/components/display/comments/CommentSection.vue +85 -103
  18. package/src/components/display/comments/item/CommentBasicView.vue +48 -61
  19. package/src/components/display/comments/item/CommentItem.vue +101 -116
  20. package/src/components/display/comments/item/CommentMoreActions.vue +174 -189
  21. package/src/components/display/comments/item/CommentMoreActionsAdmin.vue +1 -3
  22. package/src/components/display/comments/like/LikeButton.vue +36 -41
  23. package/src/components/display/comments/like/LikeSection.vue +128 -136
  24. package/src/components/display/comments/modal/CheckIdentityModal.vue +35 -40
  25. package/src/components/display/comments/modal/EditCommentModal.vue +72 -78
  26. package/src/components/display/comments/modal/RecaptchaModal.vue +58 -63
  27. package/src/components/display/comments/modal/ReportAbuseModal.vue +59 -66
  28. package/src/components/display/edit/EditBox.vue +6 -9
  29. package/src/components/display/edit/EditBoxRadio.vue +1 -5
  30. package/src/components/display/emission/EmissionInlineList.vue +82 -97
  31. package/src/components/display/emission/EmissionItem.vue +56 -69
  32. package/src/components/display/emission/EmissionList.vue +192 -218
  33. package/src/components/display/emission/EmissionPlayerItem.vue +48 -65
  34. package/src/components/display/emission/EmissionPresentationItem.vue +44 -54
  35. package/src/components/display/emission/EmissionPresentationList.vue +51 -61
  36. package/src/components/display/filter/AdvancedSearch.vue +154 -176
  37. package/src/components/display/filter/CategorySearchFilter.vue +43 -46
  38. package/src/components/display/filter/DateFilter.vue +76 -91
  39. package/src/components/display/filter/MonetizableFilter.vue +27 -30
  40. package/src/components/display/filter/ProductorSearch.vue +87 -90
  41. package/src/components/display/filter/RubriqueChoice.vue +58 -63
  42. package/src/components/display/filter/RubriqueFilter.vue +154 -169
  43. package/src/components/display/filter/SearchOrder.vue +35 -35
  44. package/src/components/display/list/ListPaginate.vue +80 -93
  45. package/src/components/display/list/PaginateParams.vue +36 -40
  46. package/src/components/display/list/PaginateSection.vue +113 -124
  47. package/src/components/display/list/SwiperList.vue +97 -109
  48. package/src/components/display/live/CountDown.vue +15 -9
  49. package/src/components/display/live/CountdownOctopus.vue +16 -10
  50. package/src/components/display/live/LiveHorizontalList.vue +95 -103
  51. package/src/components/display/live/LiveItem.vue +65 -73
  52. package/src/components/display/live/LiveList.vue +125 -137
  53. package/src/components/display/live/RadioCurrently.vue +66 -73
  54. package/src/components/display/live/RadioImage.vue +40 -51
  55. package/src/components/display/live/RadioItem.vue +9 -14
  56. package/src/components/display/live/RadioList.vue +39 -53
  57. package/src/components/display/live/RadioPlanning.vue +211 -223
  58. package/src/components/display/organisation/OrganisationChooser.vue +117 -123
  59. package/src/components/display/organisation/OrganisationChooserLight.vue +44 -52
  60. package/src/components/display/participant/ParticipantInlineList.vue +42 -58
  61. package/src/components/display/participant/ParticipantItem.vue +66 -74
  62. package/src/components/display/participant/ParticipantList.vue +119 -141
  63. package/src/components/display/playlist/PlaylistItem.vue +33 -46
  64. package/src/components/display/playlist/PlaylistList.vue +118 -144
  65. package/src/components/display/playlist/PodcastList.vue +79 -101
  66. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +58 -70
  67. package/src/components/display/podcastmaker/PodcastmakerHeader.vue +21 -22
  68. package/src/components/display/podcasts/AnimatorsItem.vue +15 -16
  69. package/src/components/display/podcasts/DownloadPodcastButton.vue +21 -29
  70. package/src/components/display/podcasts/ParticipantDescription.vue +22 -24
  71. package/src/components/display/podcasts/PodcastFilterList.vue +48 -53
  72. package/src/components/display/podcasts/PodcastImage.vue +96 -99
  73. package/src/components/display/podcasts/PodcastInlineList.vue +30 -28
  74. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +107 -114
  75. package/src/components/display/podcasts/PodcastIsPlaying.vue +4 -12
  76. package/src/components/display/podcasts/PodcastItem.vue +48 -63
  77. package/src/components/display/podcasts/PodcastItemInfo.vue +19 -35
  78. package/src/components/display/podcasts/PodcastList.vue +183 -206
  79. package/src/components/display/podcasts/PodcastModuleBox.vue +100 -137
  80. package/src/components/display/podcasts/PodcastPlannedSpinner.vue +4 -6
  81. package/src/components/display/podcasts/PodcastPlayBar.vue +50 -61
  82. package/src/components/display/podcasts/PodcastPlayBasicButton.vue +38 -41
  83. package/src/components/display/podcasts/PodcastPlayButton.vue +164 -175
  84. package/src/components/display/podcasts/PodcastRawTranscript.vue +69 -80
  85. package/src/components/display/podcasts/PodcastRubriqueList.vue +35 -38
  86. package/src/components/display/podcasts/PodcastSwiperList.vue +100 -110
  87. package/src/components/display/podcasts/TagList.vue +49 -51
  88. package/src/components/display/podcasts/VideoModuleBox.vue +13 -24
  89. package/src/components/display/rubriques/RubriqueChooser.vue +135 -140
  90. package/src/components/display/rubriques/RubriqueList.vue +140 -160
  91. package/src/components/display/sharing/ChooseEpisodesNumber.vue +34 -33
  92. package/src/components/display/sharing/FormatSwitch.vue +16 -11
  93. package/src/components/display/sharing/PlayerAnonymousModal.vue +24 -27
  94. package/src/components/display/sharing/PlayerCommonParameters.vue +20 -13
  95. package/src/components/display/sharing/PlayerParameters.vue +69 -71
  96. package/src/components/display/sharing/QrCode.vue +55 -67
  97. package/src/components/display/sharing/ShareAnonymous.vue +160 -178
  98. package/src/components/display/sharing/ShareDistribution.vue +103 -117
  99. package/src/components/display/sharing/ShareNewsletter.vue +154 -161
  100. package/src/components/display/sharing/SharePlayer.vue +273 -295
  101. package/src/components/display/sharing/SharePlayerColors.vue +25 -16
  102. package/src/components/display/sharing/SharePlayerRadio.vue +61 -69
  103. package/src/components/display/sharing/SharePlayerTypes.vue +176 -176
  104. package/src/components/display/sharing/ShareSocialsButtons.vue +63 -75
  105. package/src/components/display/sharing/SubscribeButtons.vue +185 -209
  106. package/src/components/display/studio/RecordingItemButton.vue +1 -4
  107. package/src/components/form/ClassicCheckbox.vue +26 -30
  108. package/src/components/form/ClassicContentEditable.vue +37 -33
  109. package/src/components/form/ClassicCopyButton.vue +40 -44
  110. package/src/components/form/ClassicDatePicker.vue +114 -114
  111. package/src/components/form/ClassicEmojiPicker.vue +20 -28
  112. package/src/components/form/ClassicInputText.vue +116 -120
  113. package/src/components/form/ClassicLoading.vue +7 -12
  114. package/src/components/form/ClassicMultiselect.vue +106 -116
  115. package/src/components/form/ClassicRadio.vue +21 -16
  116. package/src/components/form/ClassicRadioLabel.vue +23 -22
  117. package/src/components/form/ClassicSearch.vue +24 -19
  118. package/src/components/form/ClassicSelect.vue +47 -38
  119. package/src/components/form/ClassicWysiwyg.vue +116 -123
  120. package/src/components/icons/AmazonMusicIcon.vue +7 -10
  121. package/src/components/icons/ApplePodcastIcon.vue +7 -11
  122. package/src/components/icons/BlueSkyIcon.vue +8 -11
  123. package/src/components/icons/DeezerIcon.vue +8 -11
  124. package/src/components/icons/EditFtpIcon.vue +8 -11
  125. package/src/components/icons/IHeartIcon.vue +8 -11
  126. package/src/components/icons/PlayVideoIcon.vue +7 -10
  127. package/src/components/icons/PlayerFmIcon.vue +7 -10
  128. package/src/components/icons/PocketCastIcon.vue +8 -11
  129. package/src/components/icons/PodcastAddictIcon.vue +7 -10
  130. package/src/components/icons/RadiolineIcon.vue +8 -11
  131. package/src/components/icons/TuninIcon.vue +8 -11
  132. package/src/components/icons/XIcon.vue +7 -10
  133. package/src/components/misc/AcpmImage.vue +6 -7
  134. package/src/components/misc/ClassicAccordion.vue +27 -32
  135. package/src/components/misc/ClassicLazy.vue +86 -90
  136. package/src/components/misc/ClassicNav.vue +16 -20
  137. package/src/components/misc/ClassicPopover.vue +266 -282
  138. package/src/components/misc/ClassicSpinner.vue +5 -27
  139. package/src/components/misc/ErrorMessage.vue +11 -12
  140. package/src/components/misc/FooterGarSection.vue +33 -41
  141. package/src/components/misc/FooterSection.vue +109 -130
  142. package/src/components/misc/HomeDropdown.vue +85 -108
  143. package/src/components/misc/MobileMenu.vue +102 -113
  144. package/src/components/misc/ProgressBar.vue +53 -62
  145. package/src/components/misc/TopBar.vue +97 -120
  146. package/src/components/misc/TopBarMainContent.vue +116 -135
  147. package/src/components/misc/modal/ClassicModal.vue +40 -33
  148. package/src/components/misc/modal/ClassicModalInBody.vue +34 -28
  149. package/src/components/misc/modal/ClipboardModal.vue +27 -30
  150. package/src/components/misc/modal/ContractPreviewModal.vue +64 -62
  151. package/src/components/misc/modal/MessageModal.vue +50 -47
  152. package/src/components/misc/modal/NewsletterModal.vue +30 -31
  153. package/src/components/misc/modal/QrCodeModal.vue +21 -21
  154. package/src/components/misc/modal/ShareModalPlayer.vue +43 -52
  155. package/src/components/misc/player/PlayerCompact.vue +6 -4
  156. package/src/components/misc/player/PlayerComponent.vue +8 -9
  157. package/src/components/misc/player/PlayerLarge.vue +9 -8
  158. package/src/components/misc/player/ads/AdsProgressBar.vue +8 -11
  159. package/src/components/misc/player/ads/AdsSkipButton.vue +24 -30
  160. package/src/components/misc/player/chaptering/ChapteringModal.vue +44 -54
  161. package/src/components/misc/player/chaptering/PlayerChaptering.vue +50 -62
  162. package/src/components/misc/player/elements/PlayerImage.vue +51 -57
  163. package/src/components/misc/player/elements/PlayerPlayButton.vue +81 -92
  164. package/src/components/misc/player/elements/PlayerSpeedButton.vue +23 -27
  165. package/src/components/misc/player/elements/PlayerTitle.vue +85 -111
  166. package/src/components/misc/player/progressbar/PlayerProgressBar.vue +18 -29
  167. package/src/components/misc/player/progressbar/PodcastProgressBar.vue +45 -56
  168. package/src/components/misc/player/radio/RadioHistory.vue +80 -99
  169. package/src/components/misc/player/radio/RadioProgressBar.vue +43 -54
  170. package/src/components/misc/player/video/PlayerVideo.vue +27 -40
  171. package/src/components/misc/player/video/PlayerVideoDigiteka.vue +32 -37
  172. package/src/components/misc/player/video/PlayerVideoHls.vue +199 -198
  173. package/src/components/misc/player/video/PlayerYoutubeEmbed.vue +10 -12
  174. package/src/components/pages/CategoryPage.vue +28 -33
  175. package/src/components/pages/EmissionPage.vue +98 -131
  176. package/src/components/pages/EmissionsPage.vue +2 -0
  177. package/src/components/pages/Error403Page.vue +22 -21
  178. package/src/components/pages/HomePage.vue +91 -100
  179. package/src/components/pages/LivesPage.vue +35 -37
  180. package/src/components/pages/MapPage.vue +209 -241
  181. package/src/components/pages/PageLogout.vue +8 -11
  182. package/src/components/pages/PageNotFound.vue +9 -5
  183. package/src/components/pages/ParticipantPage.vue +83 -111
  184. package/src/components/pages/ParticipantsPage.vue +3 -0
  185. package/src/components/pages/PlaylistPage.vue +98 -116
  186. package/src/components/pages/PlaylistsPage.vue +9 -2
  187. package/src/components/pages/PodcastPage.vue +223 -238
  188. package/src/components/pages/PodcastsPage.vue +9 -2
  189. package/src/components/pages/RadioPage.vue +56 -70
  190. package/src/components/pages/RubriquePage.vue +7 -3
  191. package/src/components/pages/SearchPage.vue +31 -36
  192. package/src/components/pages/TagPage.vue +11 -9
  193. package/src/components/pages/VideoPage.vue +14 -11
  194. package/src/helper/displayHelper.ts +1 -1
  195. package/src/i18n.ts +2 -2
  196. package/src/main.ts +1 -1
  197. package/src/stores/class/general/player.ts +1 -0
  198. package/public/css/fonts/icomoon.eot +0 -0
  199. package/public/css/fonts/icomoon.svg +0 -113
  200. package/public/css/fonts/icomoon.ttf +0 -0
  201. package/public/css/fonts/icomoon.woff +0 -0
  202. package/public/css/fonts/icomoon.woff2 +0 -0
  203. package/public/css/fonts/style.css +0 -352
  204. package/sonarqube-scanner.js +0 -10
@@ -2,7 +2,7 @@
2
2
  <div class="d-flex">
3
3
  <div class="d-flex flex-column align-items-center flex-shrink-0 me-4">
4
4
  <div class="h4 mb-2">
5
- {{ $t("Choose color") }}
5
+ {{ t("Choose color") }}
6
6
  </div>
7
7
  <VSwatches
8
8
  :model-value="color"
@@ -12,12 +12,12 @@
12
12
  colors="text-advanced"
13
13
  popover-to="right"
14
14
  :data-color="color"
15
- @update:model-value="$emit('update:color', $event)"
15
+ @update:model-value="emitColor($event)"
16
16
  />
17
17
  </div>
18
18
  <div class="d-flex flex-column align-items-center">
19
19
  <div class="h4 mb-2">
20
- {{ $t("Choose theme") }}
20
+ {{ t("Choose theme") }}
21
21
  </div>
22
22
  <VSwatches
23
23
  :model-value="theme"
@@ -27,25 +27,34 @@
27
27
  colors="text-advanced"
28
28
  popover-to="right"
29
29
  :data-color="theme"
30
- @update:model-value="$emit('update:theme', $event)"
30
+ @update:model-value="emitTheme($event)"
31
31
  />
32
32
  </div>
33
33
  </div>
34
34
  </template>
35
35
 
36
- <script lang="ts">
36
+ <script setup lang="ts">
37
37
  import { VSwatches } from "vue3-swatches";
38
38
  import "vue3-swatches/dist/style.css";
39
- import { defineComponent } from "vue";
40
- export default defineComponent({
41
- components: {
42
- VSwatches,
43
- },
39
+ import { useI18n } from "vue-i18n";
44
40
 
45
- props: {
46
- color: { default: "#40a372", type: String },
47
- theme: { default: "#000000", type: String },
48
- },
49
- emits: ["update:color", "update:theme"],
50
- });
41
+ //Props
42
+ defineProps({
43
+ color: { default: "#40a372", type: String },
44
+ theme: { default: "#000000", type: String },
45
+ })
46
+
47
+ //Emits
48
+ const emit = defineEmits(["update:color", "update:theme"]);
49
+
50
+ //Composables
51
+ const { t } = useI18n();
52
+
53
+ //Methods
54
+ function emitColor(color: string){
55
+ emit('update:color', color);
56
+ }
57
+ function emitTheme(theme: string){
58
+ emit('update:theme', theme);
59
+ }
51
60
  </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <section class="module-box overflow-visible">
3
3
  <h2 class="mb-3">
4
- {{ $t("Embed") }}
4
+ {{ t("Embed") }}
5
5
  </h2>
6
6
  <div class="d-flex">
7
7
  <iframe
@@ -16,7 +16,7 @@
16
16
  />
17
17
  <div class="d-flex flex-column">
18
18
  <SharePlayerColors v-model:color="color" v-model:theme="theme" />
19
- <div class="h4 mb-2 mt-3">{{ $t("player parameters") }}</div>
19
+ <div class="h4 mb-2 mt-3">{{ t("player parameters") }}</div>
20
20
  <PlayerCommonParameters
21
21
  v-if="displayInsertCode"
22
22
  v-model:insert-code="insertCode"
@@ -31,20 +31,20 @@
31
31
  class="btn btn-primary w-fit-content mt-3"
32
32
  @click="isShareModal = true"
33
33
  >
34
- {{ $t("Share the player") }}
34
+ {{ t("Share the player") }}
35
35
  </button>
36
36
  </div>
37
37
  </div>
38
38
  </section>
39
39
  </template>
40
40
 
41
- <script lang="ts">
41
+ <script setup lang="ts">
42
42
  import { useSaveFetchStore } from "../../../stores/SaveFetchStore";
43
43
  import { useApiStore } from "../../../stores/ApiStore";
44
44
  import { useAuthStore } from "../../../stores/AuthStore";
45
- import { mapState, mapActions } from "pinia";
46
- import { defineComponent, defineAsyncComponent } from "vue";
45
+ import { defineAsyncComponent, ref, Ref, computed, onBeforeMount } from "vue";
47
46
  import { Canal } from "@/stores/class/radio/canal";
47
+ import { useI18n } from "vue-i18n";
48
48
  const ShareModalPlayer = defineAsyncComponent(
49
49
  () => import("../../misc/modal/ShareModalPlayer.vue"),
50
50
  );
@@ -54,72 +54,64 @@ const SharePlayerColors = defineAsyncComponent(
54
54
  const PlayerCommonParameters = defineAsyncComponent(
55
55
  () => import("./PlayerCommonParameters.vue"),
56
56
  );
57
- export default defineComponent({
58
- components: {
59
- ShareModalPlayer,
60
- SharePlayerColors,
61
- PlayerCommonParameters,
62
- },
63
- props: {
64
- canal: { default: undefined, type: Object as () => Canal },
65
- organisationId: { default: undefined, type: String },
66
- },
67
57
 
68
- data() {
69
- return {
70
- isShareModal: false as boolean,
71
- color: "#40a372" as string,
72
- theme: "#000000" as string,
73
- orgaAttributes: undefined as
74
- | { [key: string]: string | number | boolean | undefined }
75
- | undefined,
76
- insertCode: false as boolean,
77
- };
78
- },
58
+ //Props
59
+ const props = defineProps({
60
+ canal: { default: undefined, type: Object as () => Canal },
61
+ organisationId: { default: undefined, type: String },
62
+ })
79
63
 
80
- computed: {
81
- ...mapState(useAuthStore, ["authOrgaId"]),
82
- ...mapState(useApiStore, ["miniplayerUrl"]),
83
- displayInsertCode(): boolean {
84
- return this.canal?.organisationId === this.authOrgaId;
85
- },
86
- iFrameSrc(): string {
87
- let url = `${this.miniplayerUrl}miniplayer/radio/${
88
- this.canal?.id
89
- }?distributorId=${this.organisationId}&color=${this.color.substring(
90
- 1,
91
- )}&theme=${this.theme.substring(1)}`;
92
- if (this.insertCode) {
93
- url += "&insertCode=true";
94
- }
95
- return url;
96
- },
97
- iFrame(): string {
98
- return `<iframe src="${this.iFrameSrc}" width="100%" height="140px" scrolling="no" allow="clipboard-read; clipboard-write; autoplay" frameborder="0"></iframe>`;
99
- },
100
- },
101
- created() {
102
- this.initSharePlayer();
103
- },
104
- methods: {
105
- ...mapActions(useSaveFetchStore, ["getOrgaAttributes"]),
106
- async initSharePlayer() {
107
- this.orgaAttributes = await this.getOrgaAttributes(this.authOrgaId ?? "");
108
- this.initColor();
109
- },
110
- initColor(): void {
111
- if (!this.orgaAttributes) {
112
- return;
113
- }
114
- this.color = Object.hasOwn(this.orgaAttributes, "COLOR")
115
- ? (this.orgaAttributes.COLOR as string)
116
- : "#40a372";
117
- this.theme = Object.hasOwn(this.orgaAttributes, "THEME")
118
- ? (this.orgaAttributes.THEME as string)
119
- : "#000000";
120
- },
121
- },
64
+ //Data
65
+ const isShareModal = ref(false);
66
+ const color = ref("#40a372");
67
+ const theme = ref("#000000");
68
+ const insertCode = ref(false);
69
+ const orgaAttributes: Ref<{[key: string]: string | number | boolean | undefined }| undefined> = ref(undefined);
70
+
71
+
72
+ //Composables
73
+ const { t } = useI18n();
74
+ const authStore = useAuthStore();
75
+ const apiStore = useApiStore();
76
+ const saveFetchStore = useSaveFetchStore();
77
+
78
+
79
+ //Computed
80
+ const displayInsertCode = computed(() => props.canal?.organisationId === authStore.authOrgaId);
81
+ const iFrameSrc = computed(() => {
82
+ let url = `${apiStore.miniplayerUrl}miniplayer/radio/${
83
+ props.canal?.id
84
+ }?distributorId=${props.organisationId}&color=${color.value.substring(
85
+ 1,
86
+ )}&theme=${theme.value.substring(1)}`;
87
+ if (insertCode.value) {
88
+ url += "&insertCode=true";
89
+ }
90
+ return url;
91
+ });
92
+ const iFrame = computed(() => {
93
+ return `<iframe src="${iFrameSrc.value}" width="100%" height="140px" scrolling="no" allow="clipboard-read; clipboard-write; autoplay"></iframe>`;
122
94
  });
95
+
96
+
97
+ onBeforeMount(()=>initSharePlayer())
98
+
99
+ //Methods
100
+ async function initSharePlayer() {
101
+ orgaAttributes.value = await saveFetchStore.getOrgaAttributes(authStore.authOrgaId ?? "");
102
+ initColor();
103
+ }
104
+ function initColor(): void {
105
+ if (!orgaAttributes.value) {
106
+ return;
107
+ }
108
+ color.value = Object.hasOwn(orgaAttributes.value, "COLOR")
109
+ ? (orgaAttributes.value.COLOR as string)
110
+ : "#40a372";
111
+ theme.value = Object.hasOwn(orgaAttributes.value, "THEME")
112
+ ? (orgaAttributes.value.THEME as string)
113
+ : "#000000";
114
+ }
123
115
  </script>
124
116
 
125
117
  <style lang="scss">
@@ -5,7 +5,7 @@
5
5
  :value="iFrameModel"
6
6
  @change="selectChange($event)"
7
7
  >
8
- <optgroup v-show="isCustomPlayer" id="player-default-opt-group" :label="$t('Default version')"></optgroup>
8
+ <optgroup v-show="isCustomPlayer" id="player-default-opt-group" :label="t('Default version')"></optgroup>
9
9
  <Teleport defer :disabled="!isCustomPlayer" to="#player-default-opt-group">
10
10
  <template v-for="option in optionsSelect" :key="option.value">
11
11
  <option v-if="option.condition" :value="option.value">
@@ -14,206 +14,206 @@
14
14
  </template>
15
15
  </Teleport>
16
16
 
17
- <optgroup v-if="isCustomPlayer" :label="$t('Custom version')">
17
+ <optgroup v-if="isCustomPlayer" :label="t('Custom version')">
18
18
  <option
19
19
  v-for="player in customPlayersDisplay"
20
20
  :key="player.customId"
21
21
  :value="player.customId"
22
22
  >
23
- {{ $t("Custom version") + " «" + player.name + "»" }}
23
+ {{ t("Custom version") + " «" + player.name + "»" }}
24
24
  </option>
25
25
  </optgroup>
26
26
  </select>
27
27
  </label>
28
28
  </template>
29
29
 
30
- <script lang="ts">
30
+ <script setup lang="ts">
31
31
  import classicApi from "../../../api/classicApi";
32
32
  import { useAuthStore } from "../../../stores/AuthStore";
33
33
  import { Podcast } from "@/stores/class/general/podcast";
34
34
  import { CustomPlayer } from "@/stores/class/general/customPlayer";
35
- import { defineComponent } from "vue";
35
+ import { computed, onBeforeMount, onMounted, Ref, ref } from "vue";
36
36
  import { Emission } from "@/stores/class/general/emission";
37
37
  import { Playlist } from "@/stores/class/general/playlist";
38
38
  import { InterfacePageable } from "@/stores/class/general/interfacePageable";
39
- import { mapState } from "pinia";
40
- export default defineComponent({
41
- props: {
42
- podcast: { default: undefined, type: Object as () => Podcast },
43
- emission: { default: undefined, type: Object as () => Emission },
44
- playlist: { default: undefined, type: Object as () => Playlist },
45
- iFrameModel: { default: "default", type: String },
46
- typeCustomPlayer: { default: "", type: String },
47
- organisationId: { default: undefined, type: String },
48
- isLive: { default: false, type: Boolean },
49
- },
50
- emits: ["update:iFrameModel", "update:typeCustomPlayer"],
39
+ import { useI18n } from "vue-i18n";
51
40
 
52
- data() {
53
- return {
54
- customPlayers: [] as Array<CustomPlayer>,
55
- };
56
- },
57
- computed: {
58
- ...mapState(useAuthStore, ["authOrgaId"]),
59
- isCustomPlayer(){
60
- return 1<=this.customPlayersDisplay.length;
41
+ //Props
42
+ const props = defineProps({
43
+ podcast: { default: undefined, type: Object as () => Podcast },
44
+ emission: { default: undefined, type: Object as () => Emission },
45
+ playlist: { default: undefined, type: Object as () => Playlist },
46
+ iFrameModel: { default: "default", type: String },
47
+ typeCustomPlayer: { default: "", type: String },
48
+ organisationId: { default: undefined, type: String },
49
+ isLive: { default: false, type: Boolean },
50
+ })
51
+
52
+ //Emits
53
+ const emit = defineEmits(["update:iFrameModel", "update:typeCustomPlayer"]);
54
+
55
+ //Data
56
+ const customPlayers: Ref<Array<CustomPlayer>> = ref([]);
57
+
58
+ //Composables
59
+ const { t } = useI18n();
60
+ const authStore = useAuthStore();
61
+
62
+ //Computed
63
+ const isCustomPlayer = computed(() => 1<=customPlayersDisplay.value.length);
64
+ const isVideoPodcast = computed(() => undefined !== props.podcast?.video?.videoId);
65
+ const optionsSelectLive = computed(() => {
66
+ return [
67
+ { name: t("Large version"), value: "large", condition: true },
68
+ {
69
+ name: t("High version"),
70
+ value: "videoLive",
71
+ condition: props.podcast?.podcastId,
61
72
  },
62
- isVideoPodcast(): boolean {
63
- return (
64
- undefined !== this.podcast && undefined !== this.podcast.video?.videoId
65
- );
73
+ ];
74
+ });
75
+ const optionsSelect = computed(() => {
76
+ if (props.isLive) {
77
+ return optionsSelectLive.value;
78
+ }
79
+ return [
80
+ {
81
+ name: t("Video Version"),
82
+ value: "video",
83
+ condition: isVideoPodcast.value,
66
84
  },
67
- optionsSelectLive() {
68
- return [
69
- { name: this.$t("Large version"), value: "large", condition: true },
70
- {
71
- name: this.$t("High version"),
72
- value: "videoLive",
73
- condition: this.podcast?.podcastId,
74
- },
75
- ];
85
+ { name: t("Default version"), value: "default", condition: true },
86
+ { name: t("Large version"), value: "largeMore", condition: props.podcast?.podcastId, },
87
+ {
88
+ name: t("Minimalist length version"),
89
+ value: "large",
90
+ condition: props.podcast?.podcastId,
76
91
  },
77
- optionsSelect() {
78
- if (this.isLive) {
79
- return this.optionsSelectLive;
80
- }
81
- return [
82
- {
83
- name: this.$t("Video Version"),
84
- value: "video",
85
- condition: this.isVideoPodcast,
86
- },
87
- { name: this.$t("Default version"), value: "default", condition: true },
88
- { name: this.$t("Large version"), value: "largeMore", condition: this.podcast?.podcastId, },
89
- {
90
- name: this.$t("Minimalist length version"),
91
- value: "large",
92
- condition: this.podcast?.podcastId,
93
- },
94
- {
95
- name: this.$t("Emission version"),
96
- value: "emission",
97
- condition: this.podcast?.podcastId,
98
- },
99
- {
100
- name: this.$t("Large emission version"),
101
- value: "emissionLarge",
102
- condition: this.podcast?.podcastId,
103
- },
104
- ];
92
+ {
93
+ name: t("Emission version"),
94
+ value: "emission",
95
+ condition: props.podcast?.podcastId,
105
96
  },
106
- customPlayersDisplay(): Array<CustomPlayer> {
107
- return this.customPlayers.filter((player: CustomPlayer) => {
108
- return (
109
- (("EPISODE" === player.typePlayer) &&
110
- this.podcast?.podcastId) ||
111
- ("EMISSION" === player.typePlayer &&
112
- this.emission &&
113
- !this.podcast) ||
114
- ("PLAYLIST" === player.typePlayer && this.playlist)
115
- );
116
- }).sort((a,b) => {
117
- if(a.name > b.name){
118
- return 1;
119
- }
120
- return (b.name > a.name) ? -1 : 0;
121
- });
97
+ {
98
+ name: t("Large emission version"),
99
+ value: "emissionLarge",
100
+ condition: props.podcast?.podcastId,
122
101
  },
123
- },
124
- created() {
125
- if (this.isLive) {
126
- return;
102
+ ];
103
+ });
104
+ const customPlayersDisplay = computed(() => {
105
+ return customPlayers.value.filter((player: CustomPlayer) => {
106
+ return (
107
+ (("EPISODE" === player.typePlayer) &&
108
+ props.podcast?.podcastId) ||
109
+ ("EMISSION" === player.typePlayer &&
110
+ props.emission &&
111
+ !props.podcast) ||
112
+ ("PLAYLIST" === player.typePlayer && props.playlist)
113
+ );
114
+ }).sort((a,b) => {
115
+ if(a.name > b.name){
116
+ return 1;
127
117
  }
128
- this.initCustomPlayers();
129
- },
130
- mounted(){
131
- if (this.isVideoPodcast) {
132
- this.$emit("update:iFrameModel", "video");
118
+ return (b.name > a.name) ? -1 : 0;
119
+ });
120
+ });
121
+
122
+
123
+ onBeforeMount(()=>{
124
+ if (props.isLive) {
125
+ return;
126
+ }
127
+ initCustomPlayers();
128
+ })
129
+ onMounted(()=>{
130
+ if (isVideoPodcast.value) {
131
+ emit("update:iFrameModel", "video");
132
+ }
133
+ })
134
+
135
+
136
+ //Methods
137
+ function isNumeric(value: string): boolean {
138
+ return /^-?\d+$/.test(value);
139
+ }
140
+ function selectChange($event: any) {
141
+ const val = $event.target.value;
142
+ if (!val) {
143
+ return;
144
+ }
145
+ if (isNumeric(val)) {
146
+ const customPlayer = customPlayersDisplay.value.find((p) => {
147
+ return p.customId.toString() === val;
148
+ });
149
+ if (customPlayer) {
150
+ selectCustomPlayer(customPlayer);
133
151
  }
134
- },
135
- methods: {
136
- isNumeric(value: string): boolean {
137
- return /^-?\d+$/.test(value);
138
- },
139
- selectChange($event: any) {
140
- const val = $event.target.value;
141
- if (!val) {
142
- return;
143
- }
144
- if (this.isNumeric(val)) {
145
- const customPlayer = this.customPlayersDisplay.find((p) => {
146
- return p.customId.toString() === val;
147
- });
148
- if (customPlayer) {
149
- this.selectCustomPlayer(customPlayer);
150
- }
151
- } else {
152
- this.$emit("update:iFrameModel", val);
153
- }
154
- },
155
- async fetchPlayerPaginate(type: string): Promise<CustomPlayer[]> {
156
- let players = await classicApi.fetchData<InterfacePageable<CustomPlayer>>(
157
- {
158
- api: 6,
159
- path: "customPlayer/type/" + this.organisationId + "/" + type,
160
- isNotAuth: true,
161
- },
162
- );
163
- let playersContent = players.content;
164
- const totalCount = players.totalElements;
165
- let index = 1;
166
- while (totalCount > playersContent.length) {
167
- players = await classicApi.fetchData<InterfacePageable<CustomPlayer>>({
168
- api: 6,
169
- path:
170
- "customPlayer/type/" +
171
- this.organisationId +
172
- "/" +
173
- type +
174
- "?start=" +
175
- index,
176
- isNotAuth: true,
177
- });
178
- playersContent = playersContent.concat(players.content);
179
- ++index;
180
- }
181
- return playersContent;
182
- },
183
- selectCustomPlayer(customPlayer: CustomPlayer) {
184
- this.$emit("update:typeCustomPlayer", customPlayer.typePlayer);
185
- this.$emit("update:iFrameModel", customPlayer.customId.toString());
152
+ } else {
153
+ emit("update:iFrameModel", val);
154
+ }
155
+ }
156
+ async function fetchPlayerPaginate(type: string): Promise<CustomPlayer[]> {
157
+ let players = await classicApi.fetchData<InterfacePageable<CustomPlayer>>(
158
+ {
159
+ api: 6,
160
+ path: "customPlayer/type/" + props.organisationId + "/" + type,
161
+ isNotAuth: true,
186
162
  },
187
- async fetchCustomPlayers(
188
- type: string,
189
- selectIfPossible = true,
190
- ): Promise<boolean> {
191
- const customPlayersForType = await this.fetchPlayerPaginate(type);
192
- this.customPlayers = this.customPlayers.concat(customPlayersForType);
193
- if (
194
- !this.isVideoPodcast &&
195
- selectIfPossible &&
196
- customPlayersForType?.[0]?.selected
197
- ) {
198
- this.selectCustomPlayer(this.customPlayers[0]);
199
- return true;
200
- }
201
- return false;
202
- },
203
- async initCustomPlayers(): Promise<void> {
204
- if (undefined === this.authOrgaId) return;
205
- if (this.playlist) {
206
- this.fetchCustomPlayers("PLAYLIST");
207
- } else if (this.emission && !this.podcast) {
208
- this.fetchCustomPlayers("EMISSION");
209
- } else {
210
- const episodeSelected = await this.fetchCustomPlayers("EPISODE");
211
- await this.fetchCustomPlayers(
212
- "EMISSION",
213
- !episodeSelected,
214
- );
215
- }
216
- },
217
- },
218
- });
163
+ );
164
+ let playersContent = players.content;
165
+ const totalCount = players.totalElements;
166
+ let index = 1;
167
+ while (totalCount > playersContent.length) {
168
+ players = await classicApi.fetchData<InterfacePageable<CustomPlayer>>({
169
+ api: 6,
170
+ path:
171
+ "customPlayer/type/" +
172
+ props.organisationId +
173
+ "/" +
174
+ type +
175
+ "?start=" +
176
+ index,
177
+ isNotAuth: true,
178
+ });
179
+ playersContent = playersContent.concat(players.content);
180
+ ++index;
181
+ }
182
+ return playersContent;
183
+ }
184
+ function selectCustomPlayer(customPlayer: CustomPlayer) {
185
+ emit("update:typeCustomPlayer", customPlayer.typePlayer);
186
+ emit("update:iFrameModel", customPlayer.customId.toString());
187
+ }
188
+
189
+ async function fetchCustomPlayers(
190
+ type: string,
191
+ selectIfPossible = true,
192
+ ): Promise<boolean> {
193
+ const customPlayersForType = await fetchPlayerPaginate(type);
194
+ customPlayers.value = customPlayers.value.concat(customPlayersForType);
195
+ if (
196
+ !isVideoPodcast.value &&
197
+ selectIfPossible &&
198
+ customPlayersForType?.[0]?.selected
199
+ ) {
200
+ selectCustomPlayer(customPlayers.value[0]);
201
+ return true;
202
+ }
203
+ return false;
204
+ }
205
+ async function initCustomPlayers(): Promise<void> {
206
+ if (undefined === authStore.authOrgaId) return;
207
+ if (props.playlist) {
208
+ fetchCustomPlayers("PLAYLIST");
209
+ } else if (props.emission && !props.podcast) {
210
+ fetchCustomPlayers("EMISSION");
211
+ } else {
212
+ const episodeSelected = await fetchCustomPlayers("EPISODE");
213
+ await fetchCustomPlayers(
214
+ "EMISSION",
215
+ !episodeSelected,
216
+ );
217
+ }
218
+ }
219
219
  </script>