diff --git a/deeployer.libsonnet b/deeployer.libsonnet index 0bbda264..4012b186 100644 --- a/deeployer.libsonnet +++ b/deeployer.libsonnet @@ -83,7 +83,8 @@ "SECRET_JITSI_KEY": env.SECRET_JITSI_KEY, "TURN_SERVER": "turn:coturn.workadventu.re:443,turns:coturn.workadventu.re:443", "JITSI_PRIVATE_MODE": if env.SECRET_JITSI_KEY != '' then "true" else "false", - "START_ROOM_URL": "/_/global/maps-"+url+"/starter/map.json" + "START_ROOM_URL": "/_/global/maps-"+url+"/starter/map.json", + "ICON_URL": "//icon-"+url, } }, "uploader": { @@ -109,7 +110,15 @@ "redis": { "image": "redis:6", "ports": [6379] - } + }, + "iconserver": { + "image": "matthiasluedtke/iconserver:v3.13.0", + "host": { + "url": "icon-"+url, + "containerPort": 8080, + }, + "ports": [8080] + }, }, "config": { k8sextension(k8sConf):: @@ -210,6 +219,16 @@ } } }, + iconserver+: { + ingress+: { + spec+: { + tls+: [{ + hosts: ["icon-"+url], + secretName: "certificate-tls" + }] + } + } + }, } } } diff --git a/docs/maps/api-nav.md b/docs/maps/api-nav.md index 47ee416e..2743d1ad 100644 --- a/docs/maps/api-nav.md +++ b/docs/maps/api-nav.md @@ -52,17 +52,17 @@ WA.nav.goToRoom("/_/global/.json#start-layer-2") ### Opening/closing web page in Co-Websites ``` -WA.nav.openCoWebSite(url: string, allowApi: boolean = false, allowPolicy: string = "", position: number = 0): Promise +WA.nav.openCoWebSite(url: string, allowApi: boolean = false, allowPolicy: string = "", position: number, closable: boolean, lazy: boolean): Promise ``` -Opens the webpage at "url" in an iFrame (on the right side of the screen) or close that iFrame. `allowApi` allows the webpage to use the "IFrame API" and execute script (it is equivalent to putting the `openWebsiteAllowApi` property in the map). `allowPolicy` grants additional access rights to the iFrame. The `allowPolicy` parameter is turned into an [`allow` feature policy in the iFrame](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-allow), position in whitch slot the web page will be open. -You can have only 5 co-wbesites open simultaneously. +Opens the webpage at "url" in an iFrame (on the right side of the screen) or close that iFrame. `allowApi` allows the webpage to use the "IFrame API" and execute script (it is equivalent to putting the `openWebsiteAllowApi` property in the map). `allowPolicy` grants additional access rights to the iFrame. The `allowPolicy` parameter is turned into an [`allow` feature policy in the iFrame](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-allow), position in whitch slot the web page will be open, closable allow to close the webpage also you need to close it by the api and lazy +it's to add the cowebsite but don't load it. Example: ```javascript const coWebsite = await WA.nav.openCoWebSite('https://www.wikipedia.org/'); -const coWebsiteWorkAdventure = await WA.nav.openCoWebSite('https://workadventu.re/', true, "", 1); +const coWebsiteWorkAdventure = await WA.nav.openCoWebSite('https://workadventu.re/', true, "", 1, true, true); // ... coWebsite.close(); ``` diff --git a/front/dist/.gitignore b/front/dist/.gitignore index 0561f7a5..bc766e57 100644 --- a/front/dist/.gitignore +++ b/front/dist/.gitignore @@ -1,4 +1,6 @@ index.html /js/ +/fonts/ style.*.css !env-config.template.js +*.png diff --git a/front/dist/index.ejs b/front/dist/index.ejs index 29b8e6cb..07732877 100644 --- a/front/dist/index.ejs +++ b/front/dist/index.ejs @@ -37,65 +37,9 @@
-
-
-
-
- - -
-
-
- -
-
-
-
- -
-
- - -
-
-
- -
-
-
- -
-
- - -
-
-
- -
-
-
- -
-
- - -
-
-
-
-
-
-
-
-
- - -
+
- - -
-
- - diff --git a/front/dist/resources/logos/cowebsite-swipe.svg b/front/dist/resources/logos/cowebsite-swipe.svg new file mode 100644 index 00000000..1d4f9ebc --- /dev/null +++ b/front/dist/resources/logos/cowebsite-swipe.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front/package.json b/front/package.json index 564e1485..9a17f4a0 100644 --- a/front/package.json +++ b/front/package.json @@ -15,6 +15,7 @@ "@typescript-eslint/eslint-plugin": "^5.6.0", "@typescript-eslint/parser": "^5.6.0", "css-loader": "^5.2.4", + "css-minimizer-webpack-plugin": "^3.3.1", "eslint": "^8.4.1", "eslint-plugin-svelte3": "^3.2.1", "fork-ts-checker-webpack-plugin": "^6.5.0", diff --git a/front/src/Api/Events/OpenCoWebsiteEvent.ts b/front/src/Api/Events/OpenCoWebsiteEvent.ts index 514fd110..51a17763 100644 --- a/front/src/Api/Events/OpenCoWebsiteEvent.ts +++ b/front/src/Api/Events/OpenCoWebsiteEvent.ts @@ -6,13 +6,14 @@ export const isOpenCoWebsiteEvent = new tg.IsInterface() allowApi: tg.isOptional(tg.isBoolean), allowPolicy: tg.isOptional(tg.isString), position: tg.isOptional(tg.isNumber), + closable: tg.isOptional(tg.isBoolean), + lazy: tg.isOptional(tg.isBoolean), }) .get(); export const isCoWebsite = new tg.IsInterface() .withProperties({ id: tg.isString, - position: tg.isNumber, }) .get(); diff --git a/front/src/Api/iframe/nav.ts b/front/src/Api/iframe/nav.ts index 206961bf..d5362b4b 100644 --- a/front/src/Api/iframe/nav.ts +++ b/front/src/Api/iframe/nav.ts @@ -1,7 +1,7 @@ import { IframeApiContribution, sendToWorkadventure, queryWorkadventure } from "./IframeApiContribution"; export class CoWebsite { - constructor(private readonly id: string, public readonly position: number) {} + constructor(private readonly id: string) {} close() { return queryWorkadventure({ @@ -41,7 +41,14 @@ export class WorkadventureNavigationCommands extends IframeApiContribution { + async openCoWebSite( + url: string, + allowApi?: boolean, + allowPolicy?: string, + position?: number, + closable?: boolean, + lazy?: boolean + ): Promise { const result = await queryWorkadventure({ type: "openCoWebsite", data: { @@ -49,9 +56,11 @@ export class WorkadventureNavigationCommands extends IframeApiContribution { @@ -59,7 +68,7 @@ export class WorkadventureNavigationCommands extends IframeApiContribution new CoWebsite(cowebsiteEvent.id, cowebsiteEvent.position)); + return result.map((cowebsiteEvent) => new CoWebsite(cowebsiteEvent.id)); } /** diff --git a/front/src/Components/App.svelte b/front/src/Components/App.svelte index a1277ed2..620884cf 100644 --- a/front/src/Components/App.svelte +++ b/front/src/Components/App.svelte @@ -1,166 +1,52 @@ -
- {#if $loginSceneVisibleStore} -
- -
- {/if} - {#if $selectCharacterSceneVisibleStore} -
- -
- {/if} - {#if $customCharacterSceneVisibleStore} -
- -
- {/if} - {#if $selectCompanionSceneVisibleStore} -
- -
- {/if} - {#if $enableCameraSceneVisibilityStore} -
- -
- {/if} - {#if $banMessageStore.length > 0} -
- -
- {:else if $textMessageStore.length > 0} -
- -
- {/if} - {#if $soundPlayingStore} -
- -
- {/if} - {#if $audioManagerVisibilityStore} -
- -
- {/if} - {#if $layoutManagerVisibilityStore} -
- -
- {/if} - {#if $showReportScreenStore !== userReportEmpty} -
- -
- {/if} - {#if $followStateStore !== "off" || $peerStore.size > 0} -
- -
- {/if} - {#if $menuIconVisiblilityStore} -
- -
- {/if} - {#if $menuVisiblilityStore} -
- -
- {/if} - {#if $emoteMenuStore} -
- -
- {/if} - {#if $gameOverlayVisibilityStore} -
- - - -
- {/if} - {#if $helpCameraSettingsVisibleStore} -
- -
- {/if} - {#if $showLimitRoomModalStore} -
- -
- {/if} - {#if $showShareLinkMapModalStore} -
- -
- {/if} - {#if $requestVisitCardsStore} - - {/if} - {#if $errorStore.length > 0} -
- -
- {/if} +{#if $errorStore.length > 0} +
+ +
+{:else if $loginSceneVisibleStore} +
+ +
+{:else if $selectCharacterSceneVisibleStore} +
+ +
+{:else if $customCharacterSceneVisibleStore} +
+ +
+{:else if $selectCompanionSceneVisibleStore} +
+ +
+{:else if $enableCameraSceneVisibilityStore} +
+ +
+{:else} + + {#if $chatVisibilityStore} {/if} - {#if $warningContainerStore} - - {/if} -
+{/if} diff --git a/front/src/Components/AudioManager/AudioManager.svelte b/front/src/Components/AudioManager/AudioManager.svelte index 3385d6da..eec51572 100644 --- a/front/src/Components/AudioManager/AudioManager.svelte +++ b/front/src/Components/AudioManager/AudioManager.svelte @@ -157,13 +157,16 @@ diff --git a/front/src/Components/Chat/Chat.svelte b/front/src/Components/Chat/Chat.svelte index c4756a36..cd9b90b5 100644 --- a/front/src/Components/Chat/Chat.svelte +++ b/front/src/Components/Chat/Chat.svelte @@ -43,7 +43,7 @@
diff --git a/front/src/Components/ReportMenu/ReportMenu.svelte b/front/src/Components/ReportMenu/ReportMenu.svelte index 3934f21b..3f92dad4 100644 --- a/front/src/Components/ReportMenu/ReportMenu.svelte +++ b/front/src/Components/ReportMenu/ReportMenu.svelte @@ -108,12 +108,16 @@ pointer-events: auto; background-color: #333333; color: whitesmoke; - - position: relative; + z-index: 650; + position: absolute; height: 70vh; width: 50vw; - top: 10vh; - margin: auto; + top: 4%; + + left: 0; + right: 0; + margin-left: auto; + margin-right: auto; section.report-menu-title { display: grid; @@ -137,13 +141,4 @@ display: none; } } - - @media only screen and (max-width: 800px) { - div.report-menu-main { - top: 21vh; - height: 60vh; - width: 100vw; - font-size: 0.5em; - } - } diff --git a/front/src/Components/SelectCompanion/SelectCompanionScene.svelte b/front/src/Components/SelectCompanion/SelectCompanionScene.svelte index dd14914b..aadc9ed6 100644 --- a/front/src/Components/SelectCompanion/SelectCompanionScene.svelte +++ b/front/src/Components/SelectCompanion/SelectCompanionScene.svelte @@ -47,6 +47,8 @@ diff --git a/front/src/Components/TypeMessage/TextMessage.svelte b/front/src/Components/TypeMessage/TextMessage.svelte index 7efc3b7c..8ab926b6 100644 --- a/front/src/Components/TypeMessage/TextMessage.svelte +++ b/front/src/Components/TypeMessage/TextMessage.svelte @@ -42,14 +42,17 @@ div.main-text-message { display: flex; flex-direction: column; + position: absolute; - max-height: 25vh; - width: 80vw; + max-height: 25%; + width: 60%; margin-right: auto; margin-left: auto; - margin-bottom: 16px; - margin-top: 0; + top: 6%; + left: 0; + right: 0; padding-bottom: 0; + z-index: 240; pointer-events: auto; background-color: #333333; diff --git a/front/src/Components/TypeMessage/TextMessageContainer.svelte b/front/src/Components/TypeMessage/TextMessageContainer.svelte index 8f9b5329..5cbf9ccb 100644 --- a/front/src/Components/TypeMessage/TextMessageContainer.svelte +++ b/front/src/Components/TypeMessage/TextMessageContainer.svelte @@ -15,7 +15,8 @@ diff --git a/front/src/Components/UI/AudioPlaying.svelte b/front/src/Components/UI/AudioPlaying.svelte index 0b76552c..bdb1cb0f 100644 --- a/front/src/Components/UI/AudioPlaying.svelte +++ b/front/src/Components/UI/AudioPlaying.svelte @@ -37,6 +37,7 @@ background-color: black; border-radius: 30px 0 0 30px; display: inline-flex; + z-index: 750; img { border-radius: 50%; diff --git a/front/src/Components/UI/ErrorDialog.svelte b/front/src/Components/UI/ErrorDialog.svelte index 7f2c6cd9..1b1c973e 100644 --- a/front/src/Components/UI/ErrorDialog.svelte +++ b/front/src/Components/UI/ErrorDialog.svelte @@ -25,11 +25,17 @@ diff --git a/front/src/Components/Video/PresentationLayout.svelte b/front/src/Components/Video/PresentationLayout.svelte deleted file mode 100644 index 82a7c989..00000000 --- a/front/src/Components/Video/PresentationLayout.svelte +++ /dev/null @@ -1,26 +0,0 @@ - - -
- {#if $videoFocusStore} - {#key $videoFocusStore.uniqueId} - - {/key} - {/if} -
- diff --git a/front/src/Components/Video/ScreenSharingMediaBox.svelte b/front/src/Components/Video/ScreenSharingMediaBox.svelte index b6a227ef..022770bb 100644 --- a/front/src/Components/Video/ScreenSharingMediaBox.svelte +++ b/front/src/Components/Video/ScreenSharingMediaBox.svelte @@ -1,12 +1,26 @@
@@ -20,7 +34,12 @@ {name} {:else} -
diff --git a/front/src/Components/Video/VideoMediaBox.svelte b/front/src/Components/Video/VideoMediaBox.svelte index aec1b0ce..2994041f 100644 --- a/front/src/Components/Video/VideoMediaBox.svelte +++ b/front/src/Components/Video/VideoMediaBox.svelte @@ -4,11 +4,17 @@ import microphoneCloseImg from "../images/microphone-close.svg"; import reportImg from "./images/report.svg"; import blockSignImg from "./images/blockSign.svg"; - import { videoFocusStore } from "../../Stores/VideoFocusStore"; import { showReportScreenStore } from "../../Stores/ShowReportScreenStore"; import { getColorByString, srcObject } from "./utils"; + import { highlightedEmbedScreen } from "../../Stores/EmbedScreensStore"; + import type { EmbedScreen } from "../../Stores/EmbedScreensStore"; + import type { Streamable } from "../../Stores/StreamableCollectionStore"; import Woka from "../Woka/Woka.svelte"; + import { onMount } from "svelte"; + import { isMediaBreakpointOnly } from "../../Utils/BreakpointsUtils"; + + export let clickable = false; export let peer: VideoPeer; let streamStore = peer.streamStore; @@ -19,9 +25,32 @@ function openReport(peer: VideoPeer): void { showReportScreenStore.set({ userId: peer.userId, userName: peer.userName }); } + + let embedScreen: EmbedScreen; + let videoContainer: HTMLDivElement; + let minimized = isMediaBreakpointOnly("md"); + + if (peer) { + embedScreen = { + type: "streamable", + embed: peer as unknown as Streamable, + }; + } + + function noDrag() { + return false; + } + + const resizeObserver = new ResizeObserver(() => { + minimized = isMediaBreakpointOnly("md"); + }); + + onMount(() => { + resizeObserver.observe(videoContainer); + }); -
+
{#if $statusStore === "connecting"}
{/if} @@ -30,42 +59,64 @@ {/if} - {peer.userName} + {peer.userName}
{#if $constraintStore && $constraintStore.audio === false} - Muted + Muted {/if} -
- diff --git a/front/src/Components/Video/VideoOverlay.svelte b/front/src/Components/Video/VideoOverlay.svelte index ba316feb..7cf19aa4 100644 --- a/front/src/Components/Video/VideoOverlay.svelte +++ b/front/src/Components/Video/VideoOverlay.svelte @@ -1,16 +1,16 @@
- {#if $layoutModeStore === LayoutMode.Presentation} +