odaptos_design_system 2.0.113 → 2.0.115
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/dist/odaptos_design_system.cjs.development.js +22 -20
- package/dist/odaptos_design_system.cjs.development.js.map +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js.map +1 -1
- package/dist/odaptos_design_system.esm.js +22 -20
- package/dist/odaptos_design_system.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Molecules/Interviews/PipModerated.tsx +24 -21
package/package.json
CHANGED
|
@@ -710,18 +710,30 @@ display: flex;
|
|
|
710
710
|
}
|
|
711
711
|
};
|
|
712
712
|
|
|
713
|
-
const openPiP = async (): Promise<void> => {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
renderTasksInPiP(pipWindow);
|
|
722
|
-
} catch (error) {
|
|
723
|
-
console.error("Erreur lors de l'ouverture du PiP :", error);
|
|
713
|
+
const openPiP = async (url: string): Promise<void> => {
|
|
714
|
+
try {
|
|
715
|
+
// Vérifier si PiP est disponible
|
|
716
|
+
if (!document.pictureInPictureEnabled) {
|
|
717
|
+
console.warn("Picture-in-Picture n'est pas disponible");
|
|
718
|
+
// Fallback : ouvrir simplement dans un nouvel onglet
|
|
719
|
+
window.open(url, '_blank');
|
|
720
|
+
return;
|
|
724
721
|
}
|
|
722
|
+
|
|
723
|
+
// Ouvrir d'abord la fenêtre PiP puisque nous avons l'interaction utilisateur
|
|
724
|
+
const pipWindow = await window.documentPictureInPicture.requestWindow({
|
|
725
|
+
width: 400,
|
|
726
|
+
height: 800,
|
|
727
|
+
});
|
|
728
|
+
pipWindowRef.current = pipWindow;
|
|
729
|
+
renderTasksInPiP(pipWindow);
|
|
730
|
+
|
|
731
|
+
// Ensuite ouvrir l'URL dans un nouvel onglet
|
|
732
|
+
window.open(url, '_blank');
|
|
733
|
+
} catch (error) {
|
|
734
|
+
console.error("Erreur lors de l'ouverture du PiP :", error);
|
|
735
|
+
// Fallback en cas d'erreur : ouvrir simplement dans un nouvel onglet
|
|
736
|
+
window.open(url, '_blank');
|
|
725
737
|
}
|
|
726
738
|
};
|
|
727
739
|
|
|
@@ -792,16 +804,7 @@ display: flex;
|
|
|
792
804
|
disabled={disabled}
|
|
793
805
|
onClick={() => {
|
|
794
806
|
if (url) {
|
|
795
|
-
openPiP()
|
|
796
|
-
console.error("Erreur lors de l'ouverture du PiP :", error);
|
|
797
|
-
});
|
|
798
|
-
|
|
799
|
-
// Petit délai pour s'assurer que la nouvelle fenêtre est bien ouverte
|
|
800
|
-
setTimeout(() => {
|
|
801
|
-
// Ouvrir d'abord l'URL dans un nouvel onglet
|
|
802
|
-
const fullUrl = url.includes('https://') ? url : `https://${url}`;
|
|
803
|
-
window.open(fullUrl, '_blank');
|
|
804
|
-
}, 10000);
|
|
807
|
+
openPiP(url);
|
|
805
808
|
}
|
|
806
809
|
}}
|
|
807
810
|
/>
|