@saooti/octopus-sdk 38.0.11 → 38.0.13

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "38.0.11",
3
+ "version": "38.0.13",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
Binary file
@@ -1,7 +1,8 @@
1
1
  @font-face {
2
2
  font-family: 'icomoon';
3
3
  src: url('/css/fonts/icomoon.eot?bv0n4g');
4
- src: url('/css/fonts/icomoon.eot?bv0n4g#iefix') format('embedded-opentype'),
4
+ src: url('/css/fonts/icomoon.woff2?bv0n4g') format('woff2'),
5
+ url('/css/fonts/icomoon.eot?bv0n4g#iefix') format('embedded-opentype'),
5
6
  url('/css/fonts/icomoon.ttf?bv0n4g') format('truetype'),
6
7
  url('/css/fonts/icomoon.woff?bv0n4g') format('woff'),
7
8
  url('/css/fonts/icomoon.svg?bv0n4g#icomoon') format('svg');
package/src/App.vue CHANGED
@@ -3,7 +3,7 @@
3
3
  <TopBar :is-education="false" />
4
4
  <CategoryFilter v-if="firstDisplayCategoryFilter" />
5
5
  <router-view />
6
- <ClassicLazy v-if="pageFullyLoad" :min-height="125" :unrender="true">
6
+ <ClassicLazy v-if="pageFullyLoad" :min-height="125">
7
7
  <FooterOctopus />
8
8
  </ClassicLazy>
9
9
  <PlayerComponent />
@@ -5,11 +5,7 @@
5
5
  :style="backgroundDisplay"
6
6
  >
7
7
  <h1>{{ titleDisplay }}</h1>
8
- <div
9
- v-if="!isPhone"
10
- v-show="isDisplay"
11
- class="d-flex flex-column justify-content-end"
12
- >
8
+ <div v-show="isDisplay" class="d-flex flex-column justify-content-end">
13
9
  <ol
14
10
  v-if="filterIab || filterRubrique.length"
15
11
  class="octopus-breadcrumb d-flex align-items-center justify-content-center flex-wrap"
@@ -71,7 +67,6 @@ import { RubriquageFilter } from "@/stores/class/rubrique/rubriquageFilter";
71
67
  import { Rubrique } from "@/stores/class/rubrique/rubrique";
72
68
  import { useFilterStore } from "@/stores/FilterStore";
73
69
  import { state } from "../../../stores/ParamSdkStore";
74
- import resizePhone from "../../mixins/resizePhone";
75
70
  import { mapState, mapActions } from "pinia";
76
71
  import { defineComponent, defineAsyncComponent } from "vue";
77
72
  const CategoryList = defineAsyncComponent(() => import("./CategoryList.vue"));
@@ -89,12 +84,9 @@ export default defineComponent({
89
84
  RubriqueList,
90
85
  RubriqueChooser,
91
86
  },
92
- mixins: [resizePhone],
93
87
  data() {
94
88
  return {
95
89
  isCategories: false as boolean,
96
- isPhone: false as boolean,
97
- windowWidth: 0 as number,
98
90
  };
99
91
  },
100
92
  computed: {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  v-if="categories.length"
4
- class="d-inline-flex w-100 mb-3 ps-3 pe-3 category-list"
4
+ class="d-inline-flex w-100 mb-3 ps-3 pe-3 category-list hide-phone"
5
5
  >
6
6
  <div ref="categoryListContainer" class="category-list-container">
7
7
  <button
@@ -23,7 +23,6 @@
23
23
  v-for="e in displayArray"
24
24
  :key="e.emissionId"
25
25
  :min-height="250"
26
- :unrender="true"
27
26
  >
28
27
  <EmissionItem v-if="0 !== e.emissionId" :emission="e" />
29
28
  <template #preview>
@@ -21,7 +21,6 @@
21
21
  v-for="p in displayArray"
22
22
  :key="p.participantId"
23
23
  :min-height="360"
24
- :unrender="true"
25
24
  >
26
25
  <ParticipantItem v-if="0 !== p.participantId" :participant="p" />
27
26
  <template #preview>
@@ -19,7 +19,6 @@
19
19
  v-for="p in displayArray"
20
20
  :key="p.playlistId"
21
21
  :min-height="250"
22
- :unrender="true"
23
22
  >
24
23
  <PlaylistItem v-if="0 !== p.playlistId" :playlist="p" />
25
24
  <template #preview>
@@ -35,7 +35,6 @@
35
35
  v-for="p in podcastsDisplay"
36
36
  :key="p.podcastId"
37
37
  :min-height="410"
38
- :unrender="true"
39
38
  >
40
39
  <PodcastItem v-if="0 !== p.podcastId" :podcast="p" />
41
40
  <template #preview>
@@ -29,7 +29,10 @@
29
29
  <div ref="descriptionPodcast" v-html="description" />
30
30
  <!-- eslint-enable -->
31
31
  </div>
32
- <div @mouseenter="showDescription" @mouseleave="hideDescription">
32
+ <div
33
+ @mouseenter="debounceShowDescriptionEvent"
34
+ @mouseleave="debounceHideDescriptionEvent"
35
+ >
33
36
  <PodcastItemInfo
34
37
  :podcast-id="podcast.podcastId"
35
38
  :title="podcast.title"
@@ -44,6 +47,7 @@
44
47
  </template>
45
48
 
46
49
  <script lang="ts">
50
+ import { debounce } from "../../mixins/debounce";
47
51
  import PodcastItemInfo from "./PodcastItemInfo.vue";
48
52
  import PodcastImage from "./PodcastImage.vue";
49
53
  import { state } from "../../../stores/ParamSdkStore";
@@ -70,6 +74,8 @@ export default defineComponent({
70
74
  hoverDesc: false as boolean,
71
75
  arrowDirection: "up" as string,
72
76
  isDescriptionBig: false as boolean,
77
+ debounceShowDescriptionEvent: undefined as undefined | (() => void),
78
+ debounceHideDescriptionEvent: undefined as undefined | (() => void),
73
79
  };
74
80
  },
75
81
 
@@ -87,6 +93,10 @@ export default defineComponent({
87
93
  return this.podcast.description ?? "";
88
94
  },
89
95
  },
96
+ created() {
97
+ this.debounceShowDescriptionEvent = debounce(this.showDescription, 100);
98
+ this.debounceHideDescriptionEvent = debounce(this.hideDescription, 100);
99
+ },
90
100
 
91
101
  methods: {
92
102
  initDescription(): void {
@@ -25,7 +25,6 @@
25
25
  v-for="p in displayArray"
26
26
  :key="p.podcastId"
27
27
  :min-height="410"
28
- :unrender="true"
29
28
  >
30
29
  <PodcastItem v-if="0 !== p.podcastId" :podcast="p" />
31
30
  <template #preview>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="d-inline-flex w-100 mb-3 px-3">
2
+ <div class="d-inline-flex w-100 mb-3 px-3 hide-phone">
3
3
  <div ref="rubriqueListContainer" class="rubrique-list-container">
4
4
  <label for="rubrique-list-select" class="hid">{{ $t("By topic") }}</label>
5
5
  <select
@@ -29,30 +29,43 @@ export default {
29
29
  type: Number,
30
30
  default: 0,
31
31
  },
32
+ initRenderDelay: {
33
+ type: Number,
34
+ default: 0,
35
+ },
32
36
  unrenderDelay: {
33
37
  type: Number,
34
38
  default: 10000,
35
39
  },
36
40
  },
37
41
  setup(props) {
42
+ const waitBeforeInit = ref(true);
38
43
  const shouldRender = ref(false);
39
44
  const targetEl = ref();
40
45
  const fixedMinHeight = ref(0);
41
46
  let unrenderTimer: ReturnType<typeof setTimeout> | undefined;
42
47
  let renderTimer: ReturnType<typeof setTimeout> | undefined;
43
-
48
+ setTimeout(() => {
49
+ waitBeforeInit.value = false;
50
+ }, props.initRenderDelay);
44
51
  const { stop } = useIntersectionObserver(
45
52
  targetEl,
46
53
  ([{ isIntersecting }]) => {
54
+ if (waitBeforeInit.value) {
55
+ return;
56
+ }
47
57
  if (isIntersecting) {
48
58
  // perhaps the user re-scrolled to a component that was set to unrender. In that case stop the unrendering timer
49
59
  clearTimeout(unrenderTimer);
50
60
  // if we're dealing underndering lets add a waiting period of 200ms before rendering. If a component enters the viewport and also leaves it within 200ms it will not render at all. This saves work and improves performance when user scrolls very fast
61
+
51
62
  renderTimer = setTimeout(
52
- () => (shouldRender.value = true),
63
+ () => {
64
+ shouldRender.value = true;
65
+ },
53
66
  props.unrender ? 200 : 0,
54
67
  );
55
- shouldRender.value = true;
68
+ //shouldRender.value = true;
56
69
  if (!props.unrender) {
57
70
  stop();
58
71
  }
@@ -0,0 +1,12 @@
1
+ export function debounce<Params extends any[]>(
2
+ func: (...args: Params) => any,
3
+ timeout: number,
4
+ ): (...args: Params) => void {
5
+ let timer: ReturnType<typeof setTimeout>;
6
+ return (...args: Params) => {
7
+ clearTimeout(timer)
8
+ timer = setTimeout(() => {
9
+ func(...args)
10
+ }, timeout)
11
+ }
12
+ }
@@ -1,18 +1,21 @@
1
1
 
2
+ import {debounce} from './debounce';
2
3
  import { defineComponent } from 'vue';
3
4
  export default defineComponent({
4
5
  data() {
5
6
  return {
6
7
  isPhone: false as boolean,
7
- windowWidth: 0 as number
8
+ windowWidth: 0 as number,
9
+ debounceResizeEvent: undefined as undefined|((...args: any[]) => void)
8
10
  };
9
11
  },
10
12
  created() {
11
- window.addEventListener('resize', this.handleResize);
13
+ this.debounceResizeEvent = debounce(this.handleResize, 500);
14
+ window.addEventListener('resize', this.debounceResizeEvent);
12
15
  this.handleResize();
13
16
  },
14
17
  unmounted() {
15
- window.removeEventListener('resize', this.handleResize);
18
+ window.removeEventListener('resize', this.debounceResizeEvent);
16
19
  },
17
20
  methods: {
18
21
  handleResize(): void {
@@ -2,10 +2,10 @@
2
2
  <div class="page-box">
3
3
  <template v-if="0 === rubriquageFilter.length">
4
4
  <ClassicLazy
5
- v-for="c in categories"
5
+ v-for="(c, index) in categories"
6
6
  :key="c.id"
7
7
  :min-height="0"
8
- :unrender="true"
8
+ :init-render-delay="3 < index ? 1000 : 0"
9
9
  >
10
10
  <PodcastInlineList
11
11
  :iab-id="c.id"
@@ -19,10 +19,10 @@
19
19
  </template>
20
20
  <template v-else>
21
21
  <ClassicLazy
22
- v-for="r in rubriqueToShow"
22
+ v-for="(r, index) in rubriqueToShow"
23
23
  :key="r.rubriqueId"
24
24
  :min-height="0"
25
- :unrender="true"
25
+ :init-render-delay="3 < index ? 1000 : 0"
26
26
  >
27
27
  <PodcastInlineList
28
28
  :rubrique-id="rubriqueId.concat(r.rubriqueId)"
@@ -46,7 +46,7 @@
46
46
  :title="$t('More episodes of this emission')"
47
47
  :button-text="$t('All podcast emission button')"
48
48
  />
49
- <ClassicLazy :min-height="550" :unrender="true">
49
+ <ClassicLazy :min-height="550">
50
50
  <PodcastInlineList
51
51
  :podcast-id="podcastId"
52
52
  :title="$t('Suggested listening')"
@@ -56,7 +56,6 @@
56
56
  v-for="c in categories"
57
57
  :key="c.id"
58
58
  :min-height="550"
59
- :unrender="true"
60
59
  >
61
60
  <PodcastInlineList
62
61
  :iab-id="c.id"
@@ -3,16 +3,16 @@ import { Category } from "./class/general/category";
3
3
 
4
4
  const state: ParamStore = {
5
5
  generalParameters: {
6
- organisationId:"ecbd98d9-79bd-4312-ad5e-fc7c1c4a191c",
7
- authenticated: true,
8
- isAdmin: true,
9
- isRoleLive: true,
10
- isCommments: true,
11
- isOrganisation:true,
12
- isPlaylist: true,
13
- isProduction: true,
14
- isContribution: true,
15
- ApiUri: "https://api.staging.saooti.org/",
6
+ organisationId:undefined/* "ecbd98d9-79bd-4312-ad5e-fc7c1c4a191c" */,
7
+ authenticated: false,
8
+ isAdmin: false,
9
+ isRoleLive: false,
10
+ isCommments: false,
11
+ isOrganisation:false,
12
+ isPlaylist: false,
13
+ isProduction: false,
14
+ isContribution: false,
15
+ ApiUri: "https://api.preprod.saooti.org/",
16
16
  podcastmaker: false,
17
17
  buttonPlus: true,
18
18
  allCategories: [],
@@ -26,8 +26,8 @@ const state: ParamStore = {
26
26
  SharePlayer: true,
27
27
  ShareButtons: true,
28
28
  ShareDistribution: true,
29
- MiniplayerUri: "https://playerbeta.staging.saooti.org/",
30
- hlsUri: "https://hls.live.staging.saooti.org/",
29
+ MiniplayerUri: "https://playerbeta.preprod.saooti.org/",
30
+ hlsUri: "https://hls.live.preprod.saooti.org/",
31
31
  mainRubrique: 0,
32
32
  resourceUrl: undefined,
33
33
  podcastItemShowEmission: false,
@@ -79,14 +79,14 @@ const state: ParamStore = {
79
79
  userName: "",
80
80
  },
81
81
  octopusApi: {
82
- url: "https://api.staging.saooti.org/",
83
- commentsUrl: "https://comments.staging.saooti.org/",
84
- imageUrl: "https://imageproxy.staging.saooti.org/",
85
- studioUrl: "https://studio.staging.saooti.org/",
86
- playerUrl: "https://playerbeta.staging.saooti.org/",
87
- speechToTextUrl: "https://speech2text.staging.saooti.org/",
88
- radioUrl:"https://radio.staging.saooti.org/",
89
- recoUrl: "https://reco.staging.saooti.org/",
82
+ url: "https://api.preprod.saooti.org/",
83
+ commentsUrl: "https://comments.preprod.saooti.org/",
84
+ imageUrl: "https://imageproxy.preprod.saooti.org/",
85
+ studioUrl: "https://studio.preprod.saooti.org/",
86
+ playerUrl: "https://playerbeta.preprod.saooti.org/",
87
+ speechToTextUrl: "https://speech2text.preprod.saooti.org/",
88
+ radioUrl:"https://radio.preprod.saooti.org/",
89
+ recoUrl: "https://reco.preprod.saooti.org/",
90
90
  organisationId: undefined,
91
91
  rubriqueIdFilter: undefined,
92
92
  },