@saooti/octopus-sdk 37.0.58 → 37.0.59

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/index.html CHANGED
@@ -17,13 +17,13 @@
17
17
  <!-- built files will be auto injected -->
18
18
  </body>
19
19
  <!-- Test digiteka video -->
20
- <script type="text/javascript">
20
+ <!-- <script type="text/javascript">
21
21
  var _ultimedia_host = (window.location.protocol == 'https:' ? 'https' : 'http') + "://www.ultimedia.com";
22
22
  var _ultimedia_script = document.createElement("script");
23
23
 
24
24
  _ultimedia_script.setAttribute("type", "text/javascript");
25
25
  _ultimedia_script.setAttribute("src", _ultimedia_host + '/js/common/visible_player.js');
26
26
  document.getElementsByTagName('head')[0].appendChild(_ultimedia_script);
27
- </script>
27
+ </script> -->
28
28
  <script type="module" src="./src/main.ts"></script>
29
29
  </html>
package/index.ts CHANGED
@@ -30,6 +30,7 @@ export const getMessageModal = () => import("./src/components/misc/modal/Message
30
30
  export const getErrorMessage = () => import("./src/components/misc/ErrorMessage.vue");
31
31
  export const getPopover = () => import("./src/components/misc/ClassicPopover.vue");
32
32
  export const getClassicModal = () => import("./src/components/misc/modal/ClassicModal.vue");
33
+ export const getClassicLazy = () => import("./src/components/misc/ClassicLazy.vue");
33
34
 
34
35
 
35
36
  //Display
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "37.0.58",
3
+ "version": "37.0.59",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -24,6 +24,7 @@
24
24
  "@vue/cli": "^5.0.8",
25
25
  "@vue/compat": "^3.3.4",
26
26
  "@vuepic/vue-datepicker": "^7.0.0",
27
+ "@vueuse/core": "^10.5.0",
27
28
  "autoprefixer": "^10.4.16",
28
29
  "axios": "^1.5.1",
29
30
  "dayjs": "^1.11.10",
package/src/App.vue CHANGED
@@ -8,16 +8,22 @@
8
8
  />
9
9
  <CategoryFilter />
10
10
  <router-view />
11
- <FooterOctopus />
11
+ <ClassicLazy
12
+ v-if="pageFullyLoad"
13
+ :min-height="125"
14
+ :unrender="true"
15
+ >
16
+ <FooterOctopus />
17
+ </ClassicLazy>
12
18
  <PlayerComponent />
13
19
  </div>
14
20
  </template>
15
21
 
16
22
  <script lang="ts">
17
23
  import TopBar from "@/components/misc/TopBar.vue";
18
- import FooterOctopus from "@/components/misc/FooterSection.vue";
19
24
  import PlayerComponent from "@/components/misc/player/PlayerComponent.vue";
20
25
  import CategoryFilter from "@/components/display/categories/CategoryFilter.vue";
26
+ import ClassicLazy from "@/components/misc/ClassicLazy.vue";
21
27
  import { state } from "./stores/ParamSdkStore";
22
28
  import { Rubriquage } from "./stores/class/rubrique/rubriquage";
23
29
  import { RubriquageFilter } from "./stores/class/rubrique/rubriquageFilter";
@@ -31,6 +37,9 @@ import { Category } from "./stores/class/general/category";
31
37
  const LeftMenu = defineAsyncComponent(
32
38
  () => import("@/components/misc/LeftMenu.vue"),
33
39
  );
40
+ const FooterOctopus = defineAsyncComponent(
41
+ () => import("@/components/misc/FooterSection.vue"),
42
+ );
34
43
  export default defineComponent({
35
44
  name: "App",
36
45
 
@@ -40,6 +49,7 @@ export default defineComponent({
40
49
  CategoryFilter,
41
50
  FooterOctopus,
42
51
  PlayerComponent,
52
+ ClassicLazy
43
53
  },
44
54
 
45
55
  mixins: [initSDK],
@@ -49,6 +59,7 @@ export default defineComponent({
49
59
  displayMenu: false as boolean,
50
60
  reload: false as boolean,
51
61
  isInit: false as boolean,
62
+ pageFullyLoad: false as boolean
52
63
  };
53
64
  },
54
65
 
@@ -65,6 +76,9 @@ export default defineComponent({
65
76
  },
66
77
  async created() {
67
78
  await this.initApp();
79
+ setTimeout(()=>{
80
+ this.pageFullyLoad = true;
81
+ }, 2000)
68
82
  },
69
83
  methods: {
70
84
  ...mapActions(useFilterStore, ["filterUpdateIab", "filterUpdateRubrique"]),
@@ -19,9 +19,19 @@
19
19
  class="emission-list"
20
20
  :class="smallItems ? 'three-emissions' : 'two-emissions'"
21
21
  >
22
- <template v-for="e in displayArray" :key="e.emissionId">
22
+ <ClassicLazy v-for="e in displayArray" :key="e.emissionId" :minHeight="250" :unrender="true">
23
23
  <EmissionItem v-if="0 !== e.emissionId" :emission="e" />
24
- </template>
24
+ <template #preview>
25
+ <router-link
26
+ :to="{
27
+ name: 'emission',
28
+ params: { emissionId: e.emissionId }
29
+ }"
30
+ >
31
+ {{ e.name }}
32
+ </router-link>
33
+ </template>
34
+ </ClassicLazy>
25
35
  </div>
26
36
  <div
27
37
  v-else
@@ -46,6 +56,7 @@
46
56
  <script lang="ts">
47
57
  import ListPaginate from "../list/ListPaginate.vue";
48
58
  import octopusApi from "@saooti/octopus-api";
59
+ import ClassicLazy from "../../misc/ClassicLazy.vue";
49
60
  import { handle403 } from "../../mixins/handle403";
50
61
  import { state } from "../../../stores/ParamSdkStore";
51
62
  import { Emission, emptyEmissionData } from "@/stores/class/general/emission";
@@ -67,6 +78,7 @@ export default defineComponent({
67
78
  EmissionItem,
68
79
  EmissionPlayerItem,
69
80
  ListPaginate,
81
+ ClassicLazy
70
82
  },
71
83
 
72
84
  mixins: [handle403],
@@ -17,9 +17,19 @@
17
17
  >
18
18
  <template #list>
19
19
  <div class="podcast-list">
20
- <template v-for="p in displayArray" :key="p.participantId">
20
+ <ClassicLazy v-for="p in displayArray" :key="p.participantId" :minHeight="360" :unrender="true">
21
21
  <ParticipantItem v-if="0 !== p.participantId" :participant="p" />
22
- </template>
22
+ <template #preview>
23
+ <router-link
24
+ :to="{
25
+ name: 'participant',
26
+ params: { participantId: p.participantId },
27
+ }"
28
+ >
29
+ {{ p.lastName }}
30
+ </router-link>
31
+ </template>
32
+ </ClassicLazy>
23
33
  </div>
24
34
  </template>
25
35
  </ListPaginate>
@@ -27,6 +37,7 @@
27
37
 
28
38
  <script lang="ts">
29
39
  import ListPaginate from "../list/ListPaginate.vue";
40
+ import ClassicLazy from "../../misc/ClassicLazy.vue";
30
41
  import { handle403 } from "../../mixins/handle403";
31
42
  import octopusApi from "@saooti/octopus-api";
32
43
  import ParticipantItem from "./ParticipantItem.vue";
@@ -44,6 +55,7 @@ export default defineComponent({
44
55
  components: {
45
56
  ParticipantItem,
46
57
  ListPaginate,
58
+ ClassicLazy
47
59
  },
48
60
 
49
61
  mixins: [handle403],
@@ -15,15 +15,26 @@
15
15
  >
16
16
  <template #list>
17
17
  <div class="emission-list two-emissions">
18
- <template v-for="p in displayArray" :key="p.playlistId">
18
+ <ClassicLazy v-for="p in displayArray" :key="p.playlistId" :minHeight="250" :unrender="true">
19
19
  <PlaylistItem v-if="0 !== p.playlistId" :playlist="p" />
20
- </template>
20
+ <template #preview>
21
+ <router-link
22
+ :to="{
23
+ name: 'playlist',
24
+ params: { playlistId: p.playlistId },
25
+ }"
26
+ >
27
+ {{ p.title }}
28
+ </router-link>
29
+ </template>
30
+ </ClassicLazy>
21
31
  </div>
22
32
  </template>
23
33
  </ListPaginate>
24
34
  </template>
25
35
 
26
36
  <script lang="ts">
37
+ import ClassicLazy from "../../misc/ClassicLazy.vue";
27
38
  import ListPaginate from "../list/ListPaginate.vue";
28
39
  import { handle403 } from "../../mixins/handle403";
29
40
  import octopusApi from "@saooti/octopus-api";
@@ -39,6 +50,7 @@ export default defineComponent({
39
50
  components: {
40
51
  PlaylistItem,
41
52
  ListPaginate,
53
+ ClassicLazy
42
54
  },
43
55
 
44
56
  mixins: [handle403],
@@ -31,9 +31,19 @@
31
31
  >
32
32
  <template #list>
33
33
  <div class="podcast-list">
34
- <template v-for="p in podcastsDisplay" :key="p.podcastId">
34
+ <ClassicLazy v-for="p in podcastsDisplay" :key="p.podcastId" :minHeight="410" :unrender="true">
35
35
  <PodcastItem v-if="0 !== p.podcastId" :podcast="p" />
36
- </template>
36
+ <template #preview>
37
+ <router-link
38
+ :to="{
39
+ name: 'podcast',
40
+ params: { podcastId: p.podcastId }
41
+ }"
42
+ >
43
+ {{ p.title }}
44
+ </router-link>
45
+ </template>
46
+ </ClassicLazy>
37
47
  </div>
38
48
  </template>
39
49
  </ListPaginate>
@@ -48,6 +58,7 @@ import octopusApi from "@saooti/octopus-api";
48
58
  import PodcastItem from "../podcasts/PodcastItem.vue";
49
59
  import { state } from "../../../stores/ParamSdkStore";
50
60
  import ClassicSearch from "../../form/ClassicSearch.vue";
61
+ import ClassicLazy from "../../misc/ClassicLazy.vue";
51
62
  import { Podcast } from "@/stores/class/general/podcast";
52
63
  import { Playlist } from "@/stores/class/general/playlist";
53
64
  import { defineComponent } from "vue";
@@ -59,6 +70,7 @@ export default defineComponent({
59
70
  PodcastItem,
60
71
  ClassicSearch,
61
72
  ListPaginate,
73
+ ClassicLazy
62
74
  },
63
75
 
64
76
  mixins: [handle403, orgaComputed],
@@ -21,9 +21,19 @@
21
21
  >
22
22
  <template #list>
23
23
  <div class="podcast-list">
24
- <template v-for="p in displayArray" :key="p.podcastId">
24
+ <ClassicLazy v-for="p in displayArray" :key="p.podcastId" :minHeight="410" :unrender="true">
25
25
  <PodcastItem v-if="0 !== p.podcastId" :podcast="p" />
26
- </template>
26
+ <template #preview>
27
+ <router-link
28
+ :to="{
29
+ name: 'podcast',
30
+ params: { podcastId: p.podcastId }
31
+ }"
32
+ >
33
+ {{ p.title }}
34
+ </router-link>
35
+ </template>
36
+ </ClassicLazy>
27
37
  </div>
28
38
  </template>
29
39
  </ListPaginate>
@@ -34,6 +44,7 @@ import ListPaginate from "../list/ListPaginate.vue";
34
44
  import { handle403 } from "../../mixins/handle403";
35
45
  import octopusApi from "@saooti/octopus-api";
36
46
  import PodcastItem from "./PodcastItem.vue";
47
+ import ClassicLazy from "../../misc/ClassicLazy.vue";
37
48
  import { state } from "../../../stores/ParamSdkStore";
38
49
  import { useAuthStore } from "@/stores/AuthStore";
39
50
  import { useFilterStore } from "@/stores/FilterStore";
@@ -48,6 +59,7 @@ export default defineComponent({
48
59
  components: {
49
60
  PodcastItem,
50
61
  ListPaginate,
62
+ ClassicLazy
51
63
  },
52
64
 
53
65
  mixins: [handle403],
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <div
3
+ ref="targetEl"
4
+ :style="`min-height:${fixedMinHeight ? fixedMinHeight : minHeight}px`"
5
+ >
6
+ <slot v-if="shouldRender" />
7
+ <slot v-else name="preview" />
8
+ </div>
9
+ </template>
10
+ <script lang="ts">
11
+ import { useIntersectionObserver } from "@vueuse/core";
12
+ import { ref, nextTick } from "vue";
13
+
14
+ function onIdle(cb = () => {}) {
15
+ if ("requestIdleCallback" in window) {
16
+ window.requestIdleCallback(cb);
17
+ } else {
18
+ setTimeout(() => {
19
+ nextTick(cb);
20
+ }, 300);
21
+ }
22
+ }
23
+
24
+ export default {
25
+ props: {
26
+ renderOnIdle: Boolean,
27
+ unrender: Boolean,
28
+ minHeight: Number,
29
+ unrenderDelay: {
30
+ type: Number,
31
+ default: 10000,
32
+ },
33
+ },
34
+ setup(props) {
35
+ const shouldRender = ref(false);
36
+ const targetEl = ref();
37
+ const fixedMinHeight = ref(0);
38
+ let unrenderTimer;
39
+ let renderTimer;
40
+
41
+ const { stop } = useIntersectionObserver(
42
+ targetEl,
43
+ ([{ isIntersecting }]) => {
44
+ if (isIntersecting) {
45
+ // perhaps the user re-scrolled to a component that was set to unrender. In that case stop the unrendering timer
46
+ clearTimeout(unrenderTimer);
47
+ // 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
48
+ renderTimer = setTimeout(
49
+ () => (shouldRender.value = true),
50
+ props.unrender ? 200 : 0
51
+ );
52
+ shouldRender.value = true;
53
+ if (!props.unrender) {
54
+ stop();
55
+ }
56
+ } else if (props.unrender) {
57
+ // if the component was set to render, cancel that
58
+ clearTimeout(renderTimer);
59
+ unrenderTimer = setTimeout(() => {
60
+ fixedMinHeight.value = targetEl.value.clientHeight;
61
+ shouldRender.value = false;
62
+ }, props.unrenderDelay);
63
+ }
64
+ },
65
+ {
66
+ rootMargin: "600px",
67
+ }
68
+ );
69
+
70
+ if (props.renderOnIdle) {
71
+ onIdle(() => {
72
+ shouldRender.value = true;
73
+ if (!props.unrender) {
74
+ stop();
75
+ }
76
+ });
77
+ }
78
+
79
+ return { targetEl, shouldRender, fixedMinHeight };
80
+ },
81
+ };
82
+ </script>
@@ -28,7 +28,7 @@
28
28
  />
29
29
  </router-link>
30
30
  <OrganisationChooserLight
31
- v-if="!isPodcastmaker && organisation"
31
+ v-if="!isPodcastmaker && organisationId"
32
32
  page="topBar"
33
33
  width="auto"
34
34
  :defaultanswer="$t('No organisation filter')"
@@ -116,7 +116,7 @@ export default defineComponent({
116
116
  EditBox,
117
117
  SubscribeButtons,
118
118
  LiveHorizontalList,
119
- ClassicLoading,
119
+ ClassicLoading
120
120
  },
121
121
  mixins: [displayMethods, handle403, orgaComputed, imageProxy],
122
122
  props: {
@@ -1,22 +1,32 @@
1
1
  <template>
2
2
  <div class="page-box">
3
3
  <template v-if="0 === rubriquageFilter.length">
4
- <PodcastInlineList
4
+ <ClassicLazy
5
5
  v-for="c in categories"
6
6
  :key="c.id"
7
- :iab-id="c.id"
8
- :title="c.name"
9
- :button-text="$t('All podcast button', { name: c.name })"
10
- />
7
+ :minHeight="650"
8
+ :unrender="true"
9
+ >
10
+ <PodcastInlineList
11
+ :iab-id="c.id"
12
+ :title="c.name"
13
+ :button-text="$t('All podcast button', { name: c.name })"
14
+ />
15
+ </ClassicLazy>
11
16
  </template>
12
17
  <template v-else>
13
- <PodcastInlineList
18
+ <ClassicLazy
14
19
  v-for="r in rubriqueToShow"
15
20
  :key="r.rubriqueId"
16
- :rubrique-id="rubriqueId.concat(r.rubriqueId)"
17
- :title="r.name"
18
- :button-text="$t('All podcast button', { name: r.name })"
19
- />
21
+ :minHeight="650"
22
+ :unrender="true"
23
+ >
24
+ <PodcastInlineList
25
+ :rubrique-id="rubriqueId.concat(r.rubriqueId)"
26
+ :title="r.name"
27
+ :button-text="$t('All podcast button', { name: r.name })"
28
+ />
29
+ </ClassicLazy>
20
30
  <template v-if="rubriqueDisplay && rubriqueDisplay.length > 0">
21
31
  <PodcastInlineList
22
32
  v-if="rubriqueDisplay.length < rubriqueMaxDisplay"
@@ -48,6 +58,7 @@
48
58
 
49
59
  <script lang="ts">
50
60
  import PodcastInlineList from "../display/podcasts/PodcastInlineList.vue";
61
+ import ClassicLazy from "../misc/ClassicLazy.vue";
51
62
  import { state } from "../../stores/ParamSdkStore";
52
63
  import { RubriquageFilter } from "@/stores/class/rubrique/rubriquageFilter";
53
64
  import { Rubriquage } from "@/stores/class/rubrique/rubriquage";
@@ -61,6 +72,7 @@ export default defineComponent({
61
72
  name: "HomePage",
62
73
  components: {
63
74
  PodcastInlineList,
75
+ ClassicLazy
64
76
  },
65
77
  data() {
66
78
  return {
@@ -46,18 +46,28 @@
46
46
  :title="$t('More episodes of this emission')"
47
47
  :button-text="$t('All podcast emission button')"
48
48
  />
49
- <PodcastInlineList
50
- :podcast-id="podcastId"
51
- :title="$t('Suggested listening')"
52
- />
53
- <PodcastInlineList
49
+ <ClassicLazy
50
+ :min-height="550"
51
+ :unrender="true"
52
+ >
53
+ <PodcastInlineList
54
+ :podcast-id="podcastId"
55
+ :title="$t('Suggested listening')"
56
+ />
57
+ </ClassicLazy>
58
+ <ClassicLazy
54
59
  v-for="c in categories"
55
60
  :key="c.id"
56
- :iab-id="c.id"
57
- :href="'/main/pub/category/' + c.id"
58
- :title="$t('More episodes of this category : ', { name: c.name })"
59
- :button-text="$t('All podcast button', { name: c.name })"
60
- />
61
+ :min-height="550"
62
+ :unrender="true"
63
+ >
64
+ <PodcastInlineList
65
+ :iab-id="c.id"
66
+ :href="'/main/pub/category/' + c.id"
67
+ :title="$t('More episodes of this category : ', { name: c.name })"
68
+ :button-text="$t('All podcast button', { name: c.name })"
69
+ />
70
+ </ClassicLazy>
61
71
  </div>
62
72
  </template>
63
73
  <ClassicLoading
@@ -76,6 +86,7 @@ import imageProxy from "../mixins/imageProxy";
76
86
  import { orgaComputed } from "../mixins/orgaComputed";
77
87
  import PodcastInlineList from "../display/podcasts/PodcastInlineList.vue";
78
88
  import PodcastModuleBox from "../display/podcasts/PodcastModuleBox.vue";
89
+ import ClassicLazy from "../misc/ClassicLazy.vue";
79
90
  import ClassicLoading from "../form/ClassicLoading.vue";
80
91
  import octopusApi from "@saooti/octopus-api";
81
92
  import crudApi from "@/api/classicCrud";
@@ -116,6 +127,7 @@ export default defineComponent({
116
127
  CommentSection,
117
128
  PodcastModuleBox,
118
129
  ClassicLoading,
130
+ ClassicLazy,
119
131
  },
120
132
 
121
133
  mixins: [handle403, orgaComputed, imageProxy],