@saooti/octopus-sdk 41.10.3 → 41.10.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 41.10.4 (En cours)
4
+
5
+ **Fixes**
6
+
7
+ - **14384** - Correctifs identification des plateformes
8
+ - Envoi de l'organisationId correct quand non connecté
9
+ - Correction taille des `ClassicAvatar`
10
+ - Imports de stores relatifs dans `EmissionList`
11
+ - Limitation de la largeur des messages de `ClassicHelpButton`
12
+
13
+ **Misc**
14
+
15
+ - Ajout de `ClassicButton`, un bouton intégrant des éléments d'accessibilité
16
+ - Ajustement style boutons désactivés avec `aria-disabled`
17
+
3
18
  ## 41.10.3 (04/05/2026)
4
19
 
5
20
  **Fixes**
package/index.ts CHANGED
@@ -52,8 +52,7 @@ export {
52
52
  }
53
53
 
54
54
  // Buttons
55
- import ActionButton from "./src/components/buttons/ActionButton.vue";
56
- export { ActionButton };
55
+ export * from "./src/components/buttons/";
57
56
 
58
57
  // Form
59
58
  import ClassicButtonGroup from "./src/components/form/ClassicButtonGroup.vue";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "41.10.3",
3
+ "version": "41.10.4",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <button
3
+ class="btn"
4
+ :aria-disabled="disabled"
5
+ @click="onClick"
6
+ >
7
+ <slot />
8
+ </button>
9
+ </template>
10
+
11
+ <script setup lang="ts">
12
+ const props = defineProps<{
13
+ /** Disable the button */
14
+ disabled?: boolean;
15
+ }>();
16
+
17
+ const emit = defineEmits<{
18
+ /** Emitted when the user clicks on the button */
19
+ (e: 'click'): void;
20
+ }>();
21
+
22
+ function onClick(): void {
23
+ if (!props.disabled) {
24
+ emit('click');
25
+ }
26
+ }
27
+ </script>
@@ -1,5 +1,7 @@
1
1
  import ActionButton from "./ActionButton.vue";
2
+ import ClassicButton from "./ClassicButton.vue";
2
3
 
3
4
  export {
4
- ActionButton
5
+ ActionButton,
6
+ ClassicButton
5
7
  };
@@ -13,9 +13,8 @@ import PodbeanIcon from "../../icons/PodbeanIcon.vue";
13
13
  import YoutubeIcon from "vue-material-design-icons/Youtube.vue";
14
14
  import SpotifyIcon from "vue-material-design-icons/Spotify.vue";
15
15
  import { Annotations } from "@/stores/class/general";
16
- import { h, markRaw, onMounted, ref, type Component } from "vue";
16
+ import { h, markRaw, ref, type Component, type Ref } from "vue";
17
17
  import { aggregatorsApi } from "../../../api/aggregatorsApi";
18
- import { useAuthStore } from "../../../stores/AuthStore";
19
18
  import { useNotificationStore } from "../../../stores/NotificationStore";
20
19
  import ClassicAvatar from "../../misc/ClassicAvatar.vue";
21
20
 
@@ -130,18 +129,24 @@ export const useSharePlatforms = () => {
130
129
 
131
130
  const platforms = ref<Array<SharePlatform>>([]);
132
131
 
133
- const { authOrgaId } = useAuthStore();
134
132
  const { addNotification } = useNotificationStore();
135
133
 
136
- onMounted(async (): Promise<void> => {
137
- platforms.value.push(...PREDEFINED_PLATFORMS);
134
+ async function initPlatforms(organisationId: string): Promise<void> {
135
+ // (Re)initialize the platforms
136
+ platforms.value = [...PREDEFINED_PLATFORMS];
137
+
138
138
  try {
139
- const customPlatforms = await aggregatorsApi.getAll(authOrgaId);
139
+ const customPlatforms = await aggregatorsApi.getAll(organisationId);
140
140
  customPlatforms.forEach(platform => {
141
141
  platforms.value.push({
142
142
  name: platform.name,
143
143
  title: platform.name,
144
- icon: markRaw(() => h(ClassicAvatar, { name: platform.name, imageUrl: platform.image })),
144
+ icon: markRaw((props, { attrs }) => h(ClassicAvatar, {
145
+ ...attrs,
146
+ ...props,
147
+ name: platform.name,
148
+ imageUrl: platform.image
149
+ })),
145
150
  color: "white",
146
151
  annotation: `ptfaudio_${platform.name}`
147
152
  });
@@ -152,7 +157,7 @@ export const useSharePlatforms = () => {
152
157
  message: error
153
158
  });
154
159
  }
155
- });
160
+ }
156
161
 
157
162
  /**
158
163
  * Helper to retrieve configuration of a specific platform
@@ -198,6 +203,7 @@ export const useSharePlatforms = () => {
198
203
  }
199
204
 
200
205
  return {
206
+ initPlatforms,
201
207
  getPlatformsWithLinks,
202
208
  getPlatformConfiguration,
203
209
  platforms
@@ -62,14 +62,14 @@ import classicApi from "../../../api/classicApi";
62
62
  import ClassicLazy from "../../misc/ClassicLazy.vue";
63
63
  import {useErrorHandler} from "../../composable/useErrorHandler";
64
64
  import { state } from "../../../stores/ParamSdkStore";
65
- import { Emission, emptyEmissionData } from "@/stores/class/general/emission";
66
- import { Rubrique } from "@/stores/class/rubrique/rubrique";
65
+ import { Emission, emptyEmissionData } from "../../../stores/class/general/emission";
66
+ import { Rubrique } from "../../../stores/class/rubrique/rubrique";
67
67
  import { defineAsyncComponent, ref, Ref, computed, watch, onMounted } from "vue";
68
- import { FetchParam } from "@/stores/class/general/fetchParam";
68
+ import { FetchParam } from "../../../stores/class/general/fetchParam";
69
69
  import { AxiosError } from "axios";
70
- import { Rubriquage } from "@/stores/class/rubrique/rubriquage";
70
+ import { Rubriquage } from "../../../stores/class/rubrique/rubriquage";
71
71
  import { useFilterStore } from "../../../stores/FilterStore";
72
- import { ListClassicReturn } from "@/stores/class/general/listReturn";
72
+ import { ListClassicReturn } from "../../../stores/class/general/listReturn";
73
73
  import { useI18n } from "vue-i18n";
74
74
  import { EmissionGroup } from "../../../api/groupsApi";
75
75
  const EmissionItem = defineAsyncComponent(() => import("./EmissionItem.vue"));
@@ -127,7 +127,7 @@ const subscribeButtonsContainerRef = useTemplateRef('subscribeButtonsContainer')
127
127
  //Composables
128
128
  const { t } = useI18n();
129
129
  const apiStore = useApiStore();
130
- const { getPlatformsWithLinks } = useSharePlatforms();
130
+ const { getPlatformsWithLinks, initPlatforms } = useSharePlatforms();
131
131
 
132
132
  //Computed
133
133
  const subscriptionsDisplay = computed(() => {
@@ -152,7 +152,11 @@ const iconSize = computed((): number => {
152
152
  //Watch
153
153
  watch(()=>props.windowWidth, () =>resizeWindow());
154
154
 
155
- onMounted(()=>resizeWindow());
155
+ onMounted(() => {
156
+ resizeWindow();
157
+ const orga = 'orga' in props.content ? props.content.orga : props.content.organisation;
158
+ initPlatforms(orga.id);
159
+ });
156
160
 
157
161
  //Methods
158
162
  function showAllElements() {
@@ -73,5 +73,6 @@ const iconSize = computed(() => {
73
73
 
74
74
  .help-popover {
75
75
  background-color: var(--octopus-secondary-lighter);
76
+ max-width: 60%;
76
77
  }
77
78
  </style>
@@ -108,7 +108,7 @@ import { state } from '../../stores/ParamSdkStore';
108
108
 
109
109
  const { updatePathParams } = useSeoTitleUrl();
110
110
  const { useProxyImageUrl } = useImageProxy();
111
- const { getPlatformsWithLinks } = useSharePlatforms();
111
+ const { getPlatformsWithLinks, initPlatforms } = useSharePlatforms();
112
112
 
113
113
  /** Props used when displaying a playlist */
114
114
  interface PlaylistProps {
@@ -135,8 +135,10 @@ onMounted(async() => {
135
135
  // Retrieve element
136
136
  if (playlistId) {
137
137
  element.value = await playlistApi.get(playlistId);
138
+ initPlatforms(element.value.organisation.id);
138
139
  } else if (emissionId) {
139
140
  element.value = await emissionApi.get(emissionId);
141
+ initPlatforms(element.value.orga.id);
140
142
  } else {
141
143
  console.error('No content defined');
142
144
  }
@@ -14,7 +14,7 @@ input:not([class^="vs__"]), button:not([class^="vs__"]), select:not([class^="vs_
14
14
  button {
15
15
  cursor: pointer;
16
16
 
17
- &:disabled{
17
+ &:disabled, &[aria-disabled="true"]{
18
18
  cursor: default !important;
19
19
  }
20
20
  }
@@ -106,10 +106,12 @@ input:not([class^="vs__"]), button:not([class^="vs__"]), select:not([class^="vs_
106
106
  background: var(--octopus-primary-more-transparent);
107
107
  }
108
108
 
109
- &:not(.btn-underline, .btn-primary, .btn-on-dark, .btn-transparent, .admin-button, .share-btn):disabled{
110
- cursor: default;
111
- background-color: var(--octopus-secondary-lighter) !important;
112
- color: var(--octopus-text-disabled) !important;
109
+ &:not(.btn-underline, .btn-primary, .btn-on-dark, .btn-transparent, .admin-button, .share-btn){
110
+ &:disabled, &[aria-disabled="true"] {
111
+ cursor: default;
112
+ background-color: var(--octopus-secondary-lighter) !important;
113
+ color: var(--octopus-text-disabled) !important;
114
+ }
113
115
  }
114
116
 
115
117
  &.btn-underline{
@@ -167,8 +169,8 @@ input:not([class^="vs__"]), button:not([class^="vs__"]), select:not([class^="vs_
167
169
  border-color: var(--octopus-color-on-primary) !important;
168
170
  }
169
171
 
170
- &:not(.btn-on-dark):disabled,
171
- &.btn-on-dark:disabled{
172
+ &:not(.btn-on-dark):disabled, &:not(.btn-on-dark)[aria-disabled="true"],
173
+ &.btn-on-dark:disabled, &.btn-on-dark[aria-disabled="true"] {
172
174
  background-color: var(--octopus-secondary-darker);
173
175
  border: 1px solid black;
174
176
  cursor: default;
@@ -201,6 +203,17 @@ input:not([class^="vs__"]), button:not([class^="vs__"]), select:not([class^="vs_
201
203
 
202
204
  }
203
205
 
206
+ // Make disabled state visible
207
+ .btn:disabled, .btn:disabled:hover, .btn[aria-disabled="true"], .btn[aria-disabled="true"]:hover {
208
+ filter: grayscale(100%);
209
+ opacity: 60%;
210
+
211
+ &:not(.btn-transparent) {
212
+ background-color: var(--octopus-secondary);
213
+ }
214
+ }
215
+
216
+
204
217
  .btn-transparent{
205
218
  background: transparent;
206
219
  border: 0;