@saooti/octopus-sdk 40.1.1-SNAPSHOT → 40.1.2

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.ts CHANGED
@@ -53,6 +53,7 @@ export const getEmissionInlineList = () => import("./src/components/display/emis
53
53
  export const getRubriqueChooser = () => import("./src/components/display/rubriques/RubriqueChooser.vue");
54
54
  export const getCommentList = () => import("./src/components/display/comments/CommentList.vue");
55
55
  export const getCommentInput = () => import("./src/components/display/comments/CommentInput.vue");
56
+ export const getCommentSection = () => import("./src/components/display/comments/CommentSection.vue");
56
57
  export const getPodcastPlaylistInlineList = () => import("./src/components/display/playlist/PodcastPlaylistInlineList.vue");
57
58
  export const getLiveList = () => import("./src/components/display/live/LiveList.vue");
58
59
  export const getEmissionPresentationList = () => import("./src/components/display/emission/EmissionPresentationList.vue");
@@ -98,6 +99,7 @@ import {useMetaTitle} from "./src/components/composable/useMetaTitle.ts";
98
99
  import {useMetaTitleWatch} from "./src/components/composable/useMetaTitleWatch.ts";
99
100
  import {useOrganisationFilter} from "./src/components/composable/useOrganisationFilter.ts";
100
101
  import {useInit} from "./src/components/composable/useInit.ts";
102
+ import {useErrorHandler} from "./src/components/composable/useErrorHandler.ts";
101
103
 
102
104
 
103
105
 
@@ -146,6 +148,7 @@ export {
146
148
  useMetaTitleWatch,
147
149
  useOrganisationFilter,
148
150
  useInit,
151
+ useErrorHandler,
149
152
  debounce,
150
153
  useVastStore,
151
154
  useSaveFetchStore,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "40.1.1-SNAPSHOT",
3
+ "version": "40.1.2",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -0,0 +1,136 @@
1
+ <template>
2
+ <ClassicModalInBody
3
+ id-modal="accessibility-modal"
4
+ :title-modal="$t('Transcript Accessibility')"
5
+ @close="closePopup"
6
+ >
7
+ <template #body>
8
+ <div class="d-flex gap-3 flex-wrap mb-3">
9
+ <div class="d-flex flex-nowrap align-items-center flex-grow-1">
10
+ <div class="form-label me-3">{{ $t('Choose background color') }}</div>
11
+ <VSwatches
12
+ v-model:model-value="background"
13
+ class="c-hand"
14
+ show-fallback
15
+ fallback-input-type="color"
16
+ colors="text-advanced"
17
+ popover-x="left"
18
+ :data-color="color"
19
+ />
20
+ </div>
21
+ <div class="d-flex flex-nowrap align-items-center flex-grow-1">
22
+ <div class="form-label me-3">{{ $t('Choose text color') }}</div>
23
+ <VSwatches
24
+ v-model:model-value="color"
25
+ class="c-hand"
26
+ show-fallback
27
+ fallback-input-type="color"
28
+ colors="text-advanced"
29
+ popover-x="left"
30
+ :data-color="color"
31
+ />
32
+ </div>
33
+ </div>
34
+
35
+ <div class="d-flex align-items-center flex-nowrap mb-3">
36
+ <label class="form-label me-3" for="accessibility-font-size">{{ $t('Font size') }}</label>
37
+ <button class="btn me-3" :disabled="isMinSize" @click="decreaseFontSize"><FormatFontSizeDecreaseIcon :size="44"/></button>
38
+ <button class="btn" :disabled="isMaxSize" @click="increaseFontSize"><FormatFontSizeIncreaseIcon :size="44"/></button>
39
+ </div>
40
+
41
+ <div class="form-label mt-3">{{ $t('Preview') }}</div>
42
+ <div class="border p-2 mb-3" :style="stylePreview">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
43
+ </template>
44
+ <template #footer>
45
+ <button class="btn m-1" @click="closePopup">
46
+ {{ $t("No") }}
47
+ </button>
48
+ <button
49
+ class="btn btn-primary m-1"
50
+ @click="saveData"
51
+ >
52
+ {{ $t("Save") }}
53
+ </button>
54
+ </template>
55
+ </ClassicModalInBody>
56
+ </template>
57
+
58
+ <script lang="ts">
59
+ import { VSwatches } from "vue3-swatches";
60
+ import "vue3-swatches/dist/style.css";
61
+ import FormatFontSizeIncreaseIcon from "vue-material-design-icons/FormatFontSizeIncrease.vue";
62
+ import FormatFontSizeDecreaseIcon from "vue-material-design-icons/FormatFontSizeDecrease.vue";
63
+ import { defineAsyncComponent, defineComponent } from "vue";
64
+ const ClassicModalInBody = defineAsyncComponent(
65
+ () => import("../../misc/modal/ClassicModalInBody.vue"),
66
+ );
67
+ export default defineComponent({
68
+ name: "AccessibilityModal",
69
+
70
+ components: {
71
+ ClassicModalInBody,
72
+ FormatFontSizeIncreaseIcon,
73
+ FormatFontSizeDecreaseIcon,
74
+ VSwatches
75
+ },
76
+
77
+ emits: ["close", "save"],
78
+ computed:{
79
+ isMaxSize(){
80
+ return this.fontSize>=30;
81
+ },
82
+ isMinSize(){
83
+ return this.fontSize<=16;
84
+ },
85
+ stylePreview(){
86
+ return 'font-size:'+this.fontSize+'px; background:'+this.background+'; color:'+this.color;
87
+ }
88
+ },
89
+ data() {
90
+ return {
91
+ fontSize :16 as number,
92
+ background: "white" as string,
93
+ color: "black" as string,
94
+ };
95
+ },
96
+ created(){
97
+ this.initAccessibility();
98
+ },
99
+ methods: {
100
+ initAccessibility(){
101
+ const actualFontSize = getComputedStyle(document.documentElement).getPropertyValue('--octopus-accessibility-font-size');
102
+ this.fontSize = isNaN(parseInt(actualFontSize.slice(0, -2), 10)) ? 16 :parseInt(actualFontSize.slice(0, -2), 10);
103
+ this.background = getComputedStyle(document.documentElement).getPropertyValue('--octopus-accessibility-background');
104
+ this.color = getComputedStyle(document.documentElement).getPropertyValue('--octopus-accessibility-color');
105
+ },
106
+ closePopup() {
107
+ this.$emit("close");
108
+ },
109
+ decreaseFontSize(){
110
+ if(!this.isMinSize){
111
+ this.fontSize -=2;
112
+ }
113
+ },
114
+ increaseFontSize(){
115
+ if(!this.isMaxSize){
116
+ this.fontSize +=2;
117
+ }
118
+ },
119
+ saveData(){
120
+ this.$emit('save', {
121
+ fontSize: this.fontSize,
122
+ background: this.background,
123
+ color: this.color,
124
+ });
125
+ }
126
+ },
127
+ });
128
+ </script>
129
+ <style lang="scss">
130
+ .octopus-app #accessibility-modal .octopus-modal-body{
131
+ min-height: 400px;
132
+ .gap-3{
133
+ gap:1rem;
134
+ }
135
+ }
136
+ </style>
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <section v-show="displayCommentSection" class="module-box">
3
3
  <div class="d-flex align-items-center">
4
- <h3 class="mb-0 me-2">{{ $t("Podcast's comments") }}</h3>
4
+ <component
5
+ :is="inStudio? 'div':'h3'"
6
+ :class="inStudio? 'm-1 fw-bold':'mb-0 me-2'">{{ $t("Podcast's comments") }}</component>
5
7
  <button
6
8
  :title="$t('Refresh')"
7
9
  class="btn btn-transparent"
@@ -17,11 +19,12 @@
17
19
  />
18
20
  <CommentList
19
21
  v-model:nb-comments="nbComments"
20
- class="mt-5"
22
+ :class="inStudio? 'mt-2':'mt-5'"
21
23
  :podcast="podcast"
22
24
  :reload="reload"
23
25
  :config="configPodcast"
24
26
  :event-to-handle="eventToHandle"
27
+ :state-filter="stateFilter"
25
28
  />
26
29
  </section>
27
30
  </template>
@@ -49,6 +52,8 @@ export default defineComponent({
49
52
  },
50
53
  props: {
51
54
  podcast: { default: undefined, type: Object as () => Podcast },
55
+ inStudio: { default: false, type: Boolean },
56
+ stateFilter: { default: "", type: String },
52
57
  },
53
58
  data() {
54
59
  return {
@@ -17,6 +17,7 @@
17
17
  <div
18
18
  v-if="allEmissions.length > 1"
19
19
  class="emission-column emission-column-margin d-flex-row flex-nowrap"
20
+ :class="allEmissions.length <= 3 ? 'flex-grow-1' : ''"
20
21
  >
21
22
  <EmissionItemPresentation
22
23
  v-if="allEmissions[1]"
@@ -1,12 +1,22 @@
1
1
  <template>
2
2
  <div>
3
- <button
4
- class="btn btn-transcript"
5
- :class="{ open: isOpen }"
6
- @click="isOpen = !isOpen"
7
- >
8
- {{ buttonText }}
9
- </button>
3
+ <AccessibilityModal
4
+ v-if="isAccessibilityModal"
5
+ @save="saveAccessibility"
6
+ @close="isAccessibilityModal = false"
7
+ />
8
+ <div class="transcription-section-buttons">
9
+ <button v-if="isOpen" class="btn btn-primary m-0" @click="isAccessibilityModal = true">
10
+ <EyeOutlineIcon class="me-1"/> {{ $t('Transcript Accessibility') }}
11
+ </button>
12
+ <button
13
+ class="btn btn-transcript"
14
+ :class="{ open: isOpen }"
15
+ @click="isOpen = !isOpen"
16
+ >
17
+ {{ buttonText }}
18
+ </button>
19
+ </div>
10
20
  <div v-if="isOpen" class="transcription-body">
11
21
  <ClassicLoading
12
22
  :loading-text="!firstLoaded ? $t('Loading content ...') : undefined"
@@ -24,14 +34,21 @@
24
34
  </template>
25
35
 
26
36
  <script lang="ts">
37
+ import cookiesHelper from "../../../helper/cookiesHelper";
38
+ import EyeOutlineIcon from "vue-material-design-icons/EyeOutline.vue";
27
39
  import classicApi from "../../../api/classicApi";
28
40
  import ClassicLoading from "../../form/ClassicLoading.vue";
29
- import { defineComponent } from "vue";
41
+ import { defineAsyncComponent, defineComponent } from "vue";
42
+ const AccessibilityModal = defineAsyncComponent(
43
+ () => import("../accessibility/AccessibilityModal.vue"),
44
+ );
30
45
  export default defineComponent({
31
46
  name: "PodcastRawTranscript",
32
47
 
33
48
  components: {
34
49
  ClassicLoading,
50
+ EyeOutlineIcon,
51
+ AccessibilityModal
35
52
  },
36
53
 
37
54
  props: {
@@ -42,6 +59,7 @@ export default defineComponent({
42
59
  isOpen: false as boolean,
43
60
  firstLoaded: false as boolean,
44
61
  transcript: undefined as string | undefined,
62
+ isAccessibilityModal : false as boolean,
45
63
  };
46
64
  },
47
65
 
@@ -56,10 +74,37 @@ export default defineComponent({
56
74
  async isOpen() {
57
75
  if (this.isOpen && !this.firstLoaded) {
58
76
  this.fetchTranscript();
77
+ this.getAccessibility();
59
78
  }
60
79
  },
61
80
  },
62
81
  methods: {
82
+ getAccessibility(){
83
+ let fontSize = cookiesHelper.getCookie("octopus-font-size");
84
+ if (null !== fontSize) {
85
+ this.setCssProperty('--octopus-accessibility-font-size', fontSize);
86
+ }
87
+ let background = cookiesHelper.getCookie("octopus-background");
88
+ if (null !== background) {
89
+ this.setCssProperty('--octopus-accessibility-background', background);
90
+ }
91
+ let color = cookiesHelper.getCookie("octopus-color");
92
+ if (null !== color) {
93
+ this.setCssProperty('--octopus-accessibility-color', color);
94
+ }
95
+ },
96
+ setCssProperty(name: string, value: string){
97
+ document.documentElement.style.setProperty(name,value);
98
+ },
99
+ saveAccessibility(accessibility: {fontSize: number,background: string,color: string}){
100
+ this.setCssProperty('--octopus-accessibility-font-size', accessibility.fontSize+'px');
101
+ cookiesHelper.setCookie("octopus-font-size", accessibility.fontSize+'px');
102
+ this.setCssProperty('--octopus-accessibility-background', accessibility.background);
103
+ cookiesHelper.setCookie("octopus-background",accessibility.background);
104
+ this.setCssProperty('--octopus-accessibility-color', accessibility.color);
105
+ cookiesHelper.setCookie("octopus-color",accessibility.color);
106
+ this.isAccessibilityModal = false;
107
+ },
63
108
  async fetchTranscript() {
64
109
  if (!this.podcastId) {
65
110
  return;
@@ -78,15 +123,36 @@ export default defineComponent({
78
123
  });
79
124
  </script>
80
125
  <style lang="scss">
81
-
82
-
126
+ :root {
127
+ --octopus-accessibility-font-size: 16px;
128
+ --octopus-accessibility-background: var(--octopus-background);
129
+ --octopus-accessibility-color: var(--octopus-color-text);
130
+ }
83
131
  .octopus-app {
132
+ .transcription-section-buttons{
133
+ display: flex;
134
+ justify-content: space-between;
135
+ flex-wrap: wrap;
136
+ @media (width <= 625px) {
137
+ flex-direction: column;
138
+ }
139
+ }
84
140
  .btn-transcript {
85
141
  position: relative;
86
142
  border-radius: var(--octopus-border-radius);
87
143
  overflow: hidden;
88
144
  background: var(--octopus-secondary);
89
145
  transition: all 0.2s linear 0s;
146
+
147
+ &.open{
148
+ margin-left:auto;
149
+ @media (width <= 625px) {
150
+ margin-top: 0.5rem;
151
+ }
152
+ }
153
+ &:not(.open){
154
+ margin-right: auto;
155
+ }
90
156
 
91
157
  &:not(.open)::before,
92
158
  &.open::after {
@@ -137,12 +203,15 @@ export default defineComponent({
137
203
  }
138
204
 
139
205
  .transcription-body {
206
+ font-size: var(--octopus-accessibility-font-size);
140
207
  position: relative;
141
208
  padding: 1rem;
142
209
  max-height: 250px;
143
210
  display: flex;
144
211
  justify-content: center;
145
212
  white-space: pre-wrap;
213
+ background: var(--octopus-accessibility-background);
214
+ color: var(--octopus-accessibility-color);
146
215
 
147
216
  .transcription-text {
148
217
  overflow: hidden auto;
@@ -203,7 +203,7 @@ export default defineComponent({
203
203
  updateHtml(): void {
204
204
  if (!this.editor) {return}
205
205
  const plainText= this.editor.getText();
206
- const regexHtml = /<(a|b|h3|h4|em|i|li|ol|p|strong|ul|u|br).*?<\/\1>/i
206
+ const regexHtml = /<(a|b|h3|h4|em|i|li|ol|p|strong|ul|u|br|span).*?/i
207
207
  if(regexHtml.test(plainText)){
208
208
  this.editor.commands.setContent(plainText);
209
209
  }
@@ -89,8 +89,8 @@ export default defineComponent({
89
89
  position: fixed;
90
90
  top: 0;
91
91
  left: 0;
92
- width: 100vw;
93
- height: 100dvh;
92
+ width: 100%;
93
+ height: 100%;
94
94
  background-color: black;
95
95
  }
96
96
 
@@ -110,7 +110,6 @@ export default defineComponent({
110
110
 
111
111
  @media (width <= 500px) {
112
112
  width: 95%;
113
- margin: 2.5% !important;
114
113
  }
115
114
  }
116
115
 
@@ -12,4 +12,4 @@ export default {
12
12
  await navigator.clipboard.writeText(link);
13
13
  return callback();
14
14
  },
15
- };
15
+ };
package/src/locale/de.ts CHANGED
@@ -407,4 +407,8 @@ export default {
407
407
  Rubrics: "Rubriken",
408
408
  "New window":"{text} - Neues Fenster",
409
409
  "Mandatory input":"Pflichteingabe",
410
+ "Transcript Accessibility":"Barrierefreiheit von Transkripten",
411
+ "Font size":"Schriftgröße",
412
+ "Preview":"Vorschau",
413
+ "Save":"Speichern",
410
414
  }
package/src/locale/en.ts CHANGED
@@ -410,4 +410,8 @@ export default {
410
410
  Rubrics: "Rubrics",
411
411
  "New window":"{text} - New window",
412
412
  "Mandatory input":"Mandatory input",
413
+ "Transcript Accessibility":"Transcript Accessibility",
414
+ "Font size":"Font size",
415
+ "Preview":"Preview",
416
+ "Save":"Save",
413
417
  };
package/src/locale/es.ts CHANGED
@@ -408,4 +408,8 @@ export default {
408
408
  Rubrics: "Secciones",
409
409
  "New window":"{text} - Nueva ventana",
410
410
  "Mandatory input":"Entrada obligatoria",
411
+ "Transcript Accessibility":"Accesibilidad de transcripción",
412
+ "Font size":"Tamaño de fuente",
413
+ "Preview":"Avance",
414
+ "Save":"Ahorrar",
411
415
  }
package/src/locale/fr.ts CHANGED
@@ -417,4 +417,8 @@ export default {
417
417
  Rubrics: "Rubriques",
418
418
  "New window":"{text} - Nouvelle fenêtre",
419
419
  "Mandatory input":"Saisie obligatoire",
420
+ "Transcript Accessibility":"Accessibilité de la transcription",
421
+ "Font size":"Taille de la police",
422
+ "Preview":"Aperçu",
423
+ "Save":"Sauvegarder",
420
424
  };
package/src/locale/it.ts CHANGED
@@ -404,4 +404,8 @@ export default{
404
404
  Rubrics: "Rubriche",
405
405
  "New window":"{text} - Nuova finestra",
406
406
  "Mandatory input":"Ingresso obbligatorio",
407
+ "Transcript Accessibility":"Accessibilità della trascrizione",
408
+ "Font size":"Dimensione del carattere",
409
+ "Preview":"Anteprima",
410
+ "Save":"Salva",
407
411
  };
package/src/locale/sl.ts CHANGED
@@ -399,4 +399,8 @@ export default {
399
399
  Rubrics: "Rubrike",
400
400
  "New window":"{text} - Novo okno",
401
401
  "Mandatory input":"Obvezen vnos",
402
+ "Transcript Accessibility":"Dostopnost prepisa",
403
+ "Font size":"Velikost pisave",
404
+ "Preview":"Predogled",
405
+ "Save":"Shrani",
402
406
  }
@@ -4,6 +4,11 @@ html{
4
4
  font-size: 20px;
5
5
  height: 100%;
6
6
  scrollbar-gutter: stable;
7
+ /* scroll-snap-type: y proximity;
8
+ scroll-padding-top: 5rem;
9
+ @media (width <= 650px) {
10
+ scroll-padding-top: 3.5rem;
11
+ } */
7
12
  }
8
13
 
9
14
  body{
@@ -13,7 +18,7 @@ body{
13
18
  font-size: 0.8rem;
14
19
  overflow-x: hidden;
15
20
  background: var(--octopus-secondary-lighter);
16
- min-height: 100%;
21
+ min-height: 100vh;
17
22
  overscroll-behavior-y: contain;
18
23
  display: flex;
19
24
  flex-direction: column;
@@ -25,6 +30,15 @@ main, #app{
25
30
  flex-grow: 1;
26
31
  }
27
32
 
33
+ /* header, section:not(.page-box), .podcast-inline-container {
34
+ scroll-snap-align: start;
35
+ }
36
+ .page-element > section:first-child {
37
+ scroll-snap-align: none;
38
+ }
39
+ */
40
+
41
+
28
42
  /** Octopus style */
29
43
 
30
44
  .octopus-app{