Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

[pull] master from thecodingmachine:master #22

Open
wants to merge 5,467 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
5467 commits
Select commit Hold shift + click to select a range
14915af
Set passphrase to undefined when it is empty
ydiarra Sep 23, 2024
e99a14f
Set recovery key to undefined when it is empty
ydiarra Oct 1, 2024
40a33e0
Merge remote-tracking branch 'origin/master' into area-chat
ydiarra Oct 2, 2024
cb9891d
fix key creation process
ydiarra Sep 18, 2024
c1783c3
fix key creation process / add chat menu / reset keybackup
ydiarra Sep 18, 2024
9b20d87
add button in AccessSecretStorageDialog to restore backup key
ydiarra Sep 18, 2024
23d0ecc
Update chat documentation
ydiarra Sep 19, 2024
256e73a
add warning in reset backupKey confirmation
ydiarra Sep 19, 2024
ab75a2e
apply msc 4161-crypto-terminology
ydiarra Oct 1, 2024
329bc1b
correct translation
ydiarra Oct 2, 2024
b5fd213
fix userList
ydiarra Oct 2, 2024
3fd2ce5
chore(contrib/docker): Update .env template
Sep 30, 2024
ca97b89
impr(contrib/docker): Add FALLBACK_LOCALE
Sep 30, 2024
b9d045a
impr(contrib/docker): Lower GRPC log level
Sep 30, 2024
e162b3b
fix(GlobalCommunicationModal): Do not display "no access" message to …
Sep 30, 2024
f2291d9
fix(ObjectDetails modal): use i18n string for "close" button
Sep 30, 2024
eaadd46
Update contrib/docker/.env.prod.template
pizkaz Oct 2, 2024
d618bdb
Adding console error logging to setErrorHandler
moufmouf Oct 3, 2024
5bec3d7
Merge pull request #4117 from workadventure/area-chat
moufmouf Oct 3, 2024
3c0cfed
Merge pull request #4132 from workadventure/dependabot/npm_and_yarn/t…
moufmouf Oct 4, 2024
e49cd4a
Fix upload directory in doc
ValdoTR Oct 4, 2024
a72d39d
handle user presence matrix event
ydiarra Sep 19, 2024
7797049
Merge pull request #4252 from workadventure/handle-matrix-status
moufmouf Oct 7, 2024
6660416
fix screen wake locks
ydiarra Oct 7, 2024
1d12b03
fix invite user
ydiarra Oct 7, 2024
1e526c4
Working on Global Chat UI
HugoAverty Oct 7, 2024
4a20082
Working on UI for messages bubbles
HugoAverty Oct 8, 2024
80066f8
Working on UI for messages bubbles
HugoAverty Oct 8, 2024
dd03202
Working on UI for messages bubbles
HugoAverty Oct 8, 2024
5045bd5
Run pretty
HugoAverty Oct 8, 2024
b97006e
During redirection to the Matrix login, we now temporarily store the …
moufmouf Oct 8, 2024
7beaf45
scroll down on send message
ydiarra Oct 7, 2024
048156d
dispatch event when message html in message text is set
ydiarra Oct 8, 2024
de50b03
add floating-ui to handle userActionButton popovers
ydiarra Oct 7, 2024
49ec952
Disable the command when clicking on a message
ydiarra Oct 2, 2024
9ab71e2
fix svelte check
ydiarra Oct 2, 2024
3c6d485
change message id to class
ydiarra Oct 2, 2024
0681c56
fix E2E test locator
ydiarra Oct 7, 2024
5db860f
delete unnecessary console.log and change PUSHER_URL in docker-compose
ydiarra Oct 8, 2024
e6f423f
Update docker-compose.yaml
ydiarra Oct 8, 2024
ba13d6f
added dutch translation files
linjoe2 Aug 9, 2024
c8934ae
Linting NL language files
moufmouf Oct 2, 2024
1a694ca
Removing duplicate copyright content
moufmouf Oct 4, 2024
f1b850a
Switching NL language from BaseTranslation to DeepPartial.
moufmouf Oct 4, 2024
be9cd5b
fix mapStorage getmaps (#4306)
ydiarra Oct 10, 2024
1ae9fcd
Fix user action button (#4304)
ydiarra Oct 10, 2024
2576658
Fix 3249 (#3251)
Waclaw-I Oct 11, 2024
53062bf
Add a variable to bypass the tags filter in admin
ydiarra Oct 11, 2024
4026e67
Removing the iframeAuthentication field in /map
moufmouf Sep 27, 2024
f65636f
Configuring "lang" attribute to unknown
moufmouf Oct 9, 2024
78c341d
Bump @sentry/browser from 7.54.0 to 7.119.1
dependabot[bot] Oct 4, 2024
eb553cf
matrix chat room area documentation
ydiarra Oct 11, 2024
a5751ae
Apply suggestions from code review
ydiarra Oct 11, 2024
93d7fad
Update matrix-chat-zone.md
ydiarra Oct 11, 2024
6f57140
Modifying docker-compose and helm chart to generate MAP_STORAGE_API_T…
moufmouf Oct 9, 2024
b3a0400
add MAP_STORAGE_API token env /commonSecretEnv
ydiarra Oct 9, 2024
9e2e447
fix commonSecretEnv
ydiarra Oct 9, 2024
74ec10c
add if around map storage extraEnvVars
ydiarra Oct 9, 2024
e8cf0c1
Set environment variables directly in docker-compose
ydiarra Oct 11, 2024
d178f1f
add tag for matrixChatArea tests
ydiarra Oct 11, 2024
2e41264
add grep-invert in workflow
ydiarra Oct 11, 2024
2691f7a
add MATRIX_API_URI
ydiarra Oct 11, 2024
0856f9d
update env var for synapse
ydiarra Oct 11, 2024
e8986ca
change tag for matrix tests
ydiarra Oct 11, 2024
5431013
delete useless grep-invert
ydiarra Oct 11, 2024
af2ba33
Removing quote
moufmouf Oct 11, 2024
accf6ba
Rejecting Matrix tests from docker-compose single domain E2E tests
moufmouf Oct 11, 2024
ee7c3db
Working on UI and messages
HugoAverty Oct 14, 2024
84a3da4
Improve UI UX of the map editor (#4307)
gparant Oct 15, 2024
fc9a23f
Improve map editor collection and category (#4324)
gparant Oct 15, 2024
27db35a
Merge branch 'master' into develop
gparant Oct 16, 2024
208bb6e
Adding audio streaming API to the scripting API
moufmouf Oct 16, 2024
6f769e8
Fixing issue when MAP_STORAGE_API_TOKEN is not set
moufmouf Oct 16, 2024
cc17788
Adding E2E tests for scripting audio streams
moufmouf Oct 17, 2024
20fa83a
Fixing embedding of audio worklet in Vite
moufmouf Oct 17, 2024
2bcc262
Removing E2E tests from browsers other than Chrome
moufmouf Oct 17, 2024
4447191
Properly closing pages and browsers in E2E tests
moufmouf Oct 17, 2024
723be4b
Using browser.newContext() to create a new browser, in the hope that …
moufmouf Oct 17, 2024
816c56f
Improve UX map explorer (#4330)
gparant Oct 17, 2024
e52dd77
Remove trailing slash if present at the end of roomUrl (#4322)
ydiarra Oct 18, 2024
66052e5
Do not apply exit map property when arriving on the map (#4321)
ydiarra Oct 18, 2024
17a84c7
Add file format verification for custom entity in map editor (#4320)
ydiarra Oct 18, 2024
bab27d9
Adding 30 seconds timeout error message if failing to load scripts
moufmouf Oct 18, 2024
104d29e
hide matrix room area property when MATRIX_PUBLIC_URI is undefined (#…
ydiarra Oct 18, 2024
1156bc2
clear chat data from local storage (#4316)
ydiarra Oct 18, 2024
eac0704
[map editor] Lock in map editor does not handle errors (#4312)
ydiarra Oct 18, 2024
fe6efda
Fix CEA Chat issues: auto-open for non-connected users and store mism…
ydiarra Oct 18, 2024
f1a26ea
Merge branch 'master' into develop
gparant Oct 18, 2024
ea5a198
disable chat and user list (#4318)
ydiarra Oct 18, 2024
907c07f
Setting the base URL in script iframes
moufmouf Oct 18, 2024
19a453a
Fixing merge conflict between develop and master
gparant Oct 18, 2024
7236c18
Fixing missing HTML Mime type during authentication
moufmouf Oct 21, 2024
98cdf64
chore: Remove licence file from helm chart
klauserber Oct 10, 2024
4deb321
Add a new licence file
klauserber Oct 13, 2024
f0649d8
use flatted instead of CircularJson
ydiarra Oct 14, 2024
7c93c39
upgrade phaser version
ydiarra Sep 6, 2024
42fefbe
map editor : traduction
ydiarra Sep 6, 2024
3cc39f5
Upgrading to Phaser 3.86.0
moufmouf Oct 22, 2024
6a10954
Making Helm chart more robust
moufmouf Oct 22, 2024
cdbcbea
Improving the way we manage disconnects
moufmouf Oct 22, 2024
7e9ce6d
Using rexAwait plugin + axios-retry to load JSON map
moufmouf Oct 22, 2024
32d0598
Putting rexAwait loader inside an easier to use function: superLoad.l…
moufmouf Oct 22, 2024
4c26bcc
Fixing reconnect test and extending it to test WAM maps
moufmouf Oct 22, 2024
162a2eb
Migrating external-module outside.
moufmouf Oct 23, 2024
b3e5b94
Migrating external-module outside project and making the external-mod…
moufmouf Oct 23, 2024
ef5f670
Finishing user list part
HugoAverty Oct 23, 2024
400025f
Merge Refonte Chat with MASTER
HugoAverty Oct 23, 2024
cf5d356
Tracking audio output in scripting API playStream
moufmouf Oct 21, 2024
f09b488
Fixing E2E race condition where "Sign in" button appears just before …
moufmouf Oct 23, 2024
7f06b62
Fixing dump of spaces
moufmouf Oct 23, 2024
d41a448
Adding all external modules to gitignore
moufmouf Oct 23, 2024
187c53c
Adding FR & EN trad
HugoAverty Oct 24, 2024
b22d4d1
Fixing hard-coded "Fermer" text in map editor
moufmouf Oct 24, 2024
cf4a8c7
Using a custom made dump function
moufmouf Oct 23, 2024
7956ae4
Using a custom made dump function
moufmouf Oct 23, 2024
41da168
Debugging "undefined" room name for public rooms
moufmouf Oct 24, 2024
e00dc02
Enabling DEBUG in Helm deploy CD
moufmouf Oct 24, 2024
97558a8
Removing customJsonReplacer
moufmouf Oct 24, 2024
4a375f2
Trying to implement a better cleanup mechanism for spaces.
moufmouf Oct 24, 2024
c41ced5
Refactoring pusher code. Now, the socketData of each player contains
moufmouf Oct 24, 2024
f5254cc
Fixing user class issue causing test to fail when there are several u…
moufmouf Oct 24, 2024
01e83d1
Fix unit tests with Mock not implementing the designed interface
moufmouf Oct 24, 2024
cbc0251
Fixing unit test for spaces
moufmouf Oct 24, 2024
9d2f3f7
Passing manuallyTrigerred parameter to the OIDC provider
moufmouf Oct 24, 2024
b349244
[Scripting API]: Adding a function to get areas from the map-editor
moufmouf Oct 25, 2024
10cb052
Merge remote-tracking branch 'origin/master' into develop
gparant Oct 26, 2024
347ac34
Adding the room URL to the admin BO URL (so that the admin can react …
moufmouf Oct 26, 2024
b8031f7
Update external module for new feature (#4354)
gparant Oct 28, 2024
7ba5c53
Merge remote-tracking branch 'origin/master' into develop
gparant Oct 28, 2024
f0d0e8e
Upgrading the ts-proto lib
moufmouf Oct 28, 2024
a38a08a
Revert "Upgrading the ts-proto lib"
moufmouf Oct 28, 2024
ac170e5
disable local recording based on user tags
ydiarra Oct 25, 2024
1d5089e
use configOverwrite instead of interfaceConfigOverwrite
ydiarra Oct 25, 2024
51d4001
Fixing chat troubles, changing icons
HugoAverty Oct 29, 2024
dc60a46
Fix chat new message indicator (#4360)
gparant Oct 29, 2024
ed11e39
Merge branch 'master' of github.com:thecodingmachine/workadventure in…
HugoAverty Oct 29, 2024
2851bfe
Fixing typo
moufmouf Oct 29, 2024
b595cdd
Fix kick user during proximity meeting by administrator (#4368)
gparant Oct 30, 2024
665799d
disable local recording from v1.22.1 (#4362)
ydiarra Oct 30, 2024
2a6471c
Always display the room action button / join translation (#4363)
ydiarra Oct 30, 2024
c540535
Hide the send message button when the user’s chat ID is their UUID (#…
ydiarra Oct 30, 2024
bfdef09
[Matrix Chat Area] Attempt to kick the user from the room if they fai…
ydiarra Oct 30, 2024
fc3d869
Fixing all Chat Tests end 2 end
HugoAverty Oct 30, 2024
007daf4
Merge branch 'master' of github.com:thecodingmachine/workadventure in…
HugoAverty Oct 30, 2024
0b60287
use space id instead of chatID in ProximityChatRoom (#4369)
ydiarra Oct 30, 2024
95e7218
Merge branch 'master' into develop
gparant Oct 30, 2024
e374e39
Delete unnecessary display of chat ID in user list (#4370)
ydiarra Oct 30, 2024
b1115b3
Merge branch 'master' into develop
gparant Oct 30, 2024
e8aec56
Fixing all Walk to Tests end 2 end
HugoAverty Oct 31, 2024
3400c63
Merge branch 'master' of github.com:thecodingmachine/workadventure in…
HugoAverty Oct 31, 2024
3813bc5
Fixing Svelte Check
HugoAverty Oct 31, 2024
358ec94
Pretty fix
HugoAverty Oct 31, 2024
36a8653
TEtoE fix
HugoAverty Oct 31, 2024
7202c25
Merge branch 'develop' into external-modules
gparant Oct 31, 2024
b33b0a8
Fix UX action bar between calendar, todolist and mapeditor
gparant Oct 31, 2024
f8398fa
Matrix : Verify session with emojis (#4336)
ydiarra Oct 31, 2024
e28eb0b
Fix to deploy external module
gparant Oct 31, 2024
3f063ef
Resolve code review
HugoAverty Nov 1, 2024
ed8694e
Merge branch 'master' of github.com:thecodingmachine/workadventure in…
HugoAverty Nov 1, 2024
6d6c454
paste files in chat (#4361)
ydiarra Nov 4, 2024
c6fa2d7
Fix svelte error
gparant Nov 4, 2024
1e585d6
Fixing bugs and last tests
HugoAverty Nov 4, 2024
44d328f
Merge branch 'master' of github.com:thecodingmachine/workadventure in…
HugoAverty Nov 4, 2024
e3529ed
Fix building error for t3.xlarge
gparant Nov 6, 2024
56d6742
improve build to use --max-old-space-siz option of environment used t…
gparant Nov 6, 2024
91184c0
Fixing missing content-type for the matrix-callback route
moufmouf Nov 6, 2024
7344a49
Fixing HTTP 404 on cursor image file
moufmouf Nov 6, 2024
d34a073
Tagging the master branch with the commit SHA
moufmouf Nov 6, 2024
a9e6cf3
Fixing tag name master@... to master-...
moufmouf Nov 6, 2024
8fd452e
Fix multiple instances of the “Verify Device” modal appearing
ydiarra Nov 5, 2024
32a8ce8
delete Duplicate identifier 'isVerifyingDevice'
ydiarra Nov 8, 2024
696b133
fix E2E tests
ydiarra Nov 8, 2024
47a9d89
use chat traduction
ydiarra Nov 8, 2024
53e8b07
center getCloserPart
ydiarra Nov 8, 2024
020a57a
Hide the send message button for my user
ydiarra Nov 8, 2024
297297c
create chatHeader component
ydiarra Nov 12, 2024
44839cc
Easy image pull secrets configuration
moufmouf Nov 13, 2024
39787b0
Update UI and UX of the entity when the cursor is hovered (#4383)
gparant Nov 13, 2024
ce44455
Merge branch 'master' into develop
gparant Nov 13, 2024
8b07d9b
Easy image pull secrets configuration
moufmouf Nov 13, 2024
c0cc948
Merge branch 'master' into develop
gparant Nov 13, 2024
8aca657
Center emoji translation
ydiarra Nov 14, 2024
a35f2a1
Take map details into account to enable chat (#4388)
ydiarra Nov 15, 2024
0b4aedb
Japanese translation by @Akama1024 (#4390)
ydiarra Nov 15, 2024
b727464
Merge branch 'master' into develop
gparant Nov 15, 2024
4c53df9
Italian translation by @klinshy (#4391)
ydiarra Nov 15, 2024
a580793
Adding a PROMETHEUS_PORT env var to pusher and back
gparant Nov 15, 2024
ddd5dcb
Merge pull request #4342 from workadventure/external-modules
gparant Nov 15, 2024
177e45a
Merge branch 'master' into develop
gparant Nov 15, 2024
4998108
Merge pull request #4395 from workadventure/develop
gparant Nov 15, 2024
63a598d
Adding "allow" option in WA.ui.registerMenuCommand
moufmouf Nov 15, 2024
d92e23d
Save no companion choice
gparant Nov 19, 2024
1b02c91
Merge pull request #4397 from workadventure/fixSelectNoCompagnion
gparant Nov 19, 2024
1782819
Fix focus input chat (#4398)
gparant Nov 19, 2024
678356e
Update external module for calendar and todolist (#4400)
gparant Nov 19, 2024
8641850
Typo fix
moufmouf Nov 20, 2024
d506467
Merge branch 'master' of github.com:thecodingmachine/workadventure in…
moufmouf Nov 20, 2024
78f3052
Fixing button child of button in Room.svelte (unclickable buttons ...)
HugoAverty Nov 20, 2024
a3de71c
Merge pull request #4296 from workadventure/refonte-chat
moufmouf Nov 20, 2024
8b2fb59
Fix refresh token query (#4401)
gparant Nov 21, 2024
312a94f
Improve external module UX (#4403)
gparant Nov 22, 2024
7a163d2
Improve type external module (#4404)
gparant Nov 22, 2024
2a654a7
Information module error (#4405)
gparant Nov 25, 2024
0d12715
Revert "improve build to use --max-old-space-siz option of environmen…
moufmouf Nov 26, 2024
ef331a3
Linting Dockerfile
moufmouf Nov 26, 2024
ecaf11b
Making build time NODE_OPTIONS configurable
moufmouf Nov 26, 2024
a9d55b7
Merge pull request #4406 from workadventure/configurable-node-options
moufmouf Nov 26, 2024
89bd702
NODE_OPTIONS: fixing configurability in play container
moufmouf Nov 26, 2024
678b71e
Trying to fix memory issues on build
moufmouf Nov 26, 2024
4f3df0b
Upgrading Hyper-express version
moufmouf Nov 26, 2024
06b917f
Attempting debugging build
moufmouf Nov 26, 2024
8d944d3
Merge pull request #4407 from workadventure/configurable-node-options
moufmouf Nov 26, 2024
c243604
Adding debug info to Play
moufmouf Nov 26, 2024
e345b81
Upgrading play container to Node 20.18
moufmouf Nov 26, 2024
a886e4a
Merge pull request #4408 from workadventure/upgrade-hyper-express
moufmouf Nov 26, 2024
1fb8a16
Merge pull request #4410 from workadventure/node-20-18
moufmouf Nov 26, 2024
0bac261
Be able to add restriction for Speaker zone and Attendee zone (#4409)
gparant Nov 26, 2024
a433a9f
Merge pull request #4396 from workadventure/registerMenu-allow
moufmouf Nov 27, 2024
7c8c81b
Upgrading Vite to patch release
moufmouf Nov 27, 2024
b59e1bb
Upgrading vite to v4
moufmouf Nov 27, 2024
9c43302
Merge pull request #4433 from workadventure/nodockerx
moufmouf Nov 27, 2024
a71d182
Adding a Helm hook to predownload images
moufmouf Nov 27, 2024
695d723
Merge pull request #4434 from workadventure/prepuller
moufmouf Nov 27, 2024
f763b2d
Migrating to ts-proto version 2.4.2
moufmouf Nov 28, 2024
79aa817
Fix when the GameScene is reload for external module (#4444)
gparant Nov 28, 2024
dbc5940
Revert "Migrating to ts-proto version 2.4.2"
moufmouf Nov 28, 2024
f6caf8f
Reapply "Migrating to ts-proto version 2.4.2"
moufmouf Nov 28, 2024
142850e
Fixing rounding of Areas placed on the map
moufmouf Nov 29, 2024
13331a2
Merge pull request #4445 from workadventure/migrate-ts-proto
moufmouf Nov 29, 2024
e902988
Upgrading play to Typescript 5.7
moufmouf Nov 28, 2024
e841204
Fixing display of "Walk to" on public maps
moufmouf Nov 29, 2024
887cac3
Merge pull request #4443 from workadventure/typescript5
moufmouf Nov 29, 2024
d939f04
Upgrading back to Typescript 5.7.2
moufmouf Nov 29, 2024
0367010
Migrating mapstorage to Typescript 5.7.2
moufmouf Nov 29, 2024
65957d7
Migrating all remaining packages to Typescript 5.7.2
moufmouf Nov 29, 2024
7e02cb1
Merge pull request #4446 from workadventure/typescript5back
moufmouf Nov 29, 2024
3223776
Adding main fixs to chat
HugoAverty Dec 4, 2024
7b71546
Fixing in user list Room height
HugoAverty Dec 4, 2024
70db635
Merge pull request #4448 from workadventure/fix-chat
moufmouf Dec 4, 2024
e2229a2
Fix jitsi moderator tag (#4437)
ydiarra Dec 10, 2024
c8d6bd6
Improve external module for calendar (#4453)
gparant Dec 11, 2024
87916a5
Avoid initializing MatrixChatConnection when the user is not connected
Dec 13, 2024
6a1c24e
Merge pull request #4458 from workadventure/remove-unnecessary-matrix…
moufmouf Dec 15, 2024
8708dd4
Fix the regression regarding the highlight of entities for map explor…
gparant Dec 16, 2024
a7e7203
Handle file drop functionality in chat
Dec 17, 2024
722ff63
fix svelte check
Dec 17, 2024
4f14846
pretty
Dec 17, 2024
33ffc60
Hot fix (#4466)
gparant Dec 17, 2024
f3d9303
Merge pull request #4467 from workadventure/drop-file-in-chat
moufmouf Dec 19, 2024
f765404
disable emotes while typing in chat (#4469)
ydiarra Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adding "allow" option in WA.ui.registerMenuCommand
The `WA.ui.registerMenuCommand` options now accept an additional `allow`
that you can use to pass an optional "allow" attribute to the iframe opened in the submenu.

Useful to allow fullscreen or access to the clipboard from within the custom menu item.
  • Loading branch information
moufmouf committed Nov 15, 2024
commit 63a598da7db0c6a616a6fa99c458db1ebde109b8
1 change: 1 addition & 0 deletions docs/developer/map-scripting/references/api-ui.md
Original file line number Diff line number Diff line change
@@ -74,6 +74,7 @@ Add a custom menu item containing the text `commandDescriptor` in the navbar of
- `iframe: string` : A click on the custom menu will open the `iframe` inside the menu.
- `key?: string` : A unique identifier for your menu item.
- `allowApi?: boolean` : Allow the iframe of the custom menu to use the Scripting API.
- `allow?: string` : The `allow` attribute used by the iframe.

Important : `options` accepts only `callback` or `iframe` not both.

1 change: 1 addition & 0 deletions play/src/front/Api/Events/Ui/MenuEvents.ts
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ export type UnregisterMenuEvent = z.infer<typeof isUnregisterMenuEvent>;

export const isMenuRegisterOptions = z.object({
allowApi: z.boolean(),
allow: z.string().optional(),
});

/**
7 changes: 7 additions & 0 deletions play/src/front/Api/Iframe/ui.ts
Original file line number Diff line number Diff line change
@@ -39,6 +39,10 @@ interface MenuDescriptor {
* A unique technical key identifying this menu
*/
key?: string;
/**
* The "allow" attribute of the iframe tag.
*/
allow?: string;
}

export type MenuOptions = RequireOnlyOne<MenuDescriptor, "callback" | "iframe">;
@@ -202,13 +206,15 @@ export class WorkAdventureUiCommands extends IframeApiContribution<WorkAdventure
if (typeof options === "function") {
options = {
callback: options,
allow: undefined,
};
}

const finalOptions = {
...options,
allowApi: options.allowApi === undefined ? options.iframe !== undefined : options.allowApi,
key: options.key ?? v4(),
allow: options.allow,
};

const menu = new Menu(finalOptions.key);
@@ -222,6 +228,7 @@ export class WorkAdventureUiCommands extends IframeApiContribution<WorkAdventure
key: finalOptions.key,
options: {
allowApi: finalOptions.allowApi,
allow: finalOptions.allow,
},
},
});
4 changes: 3 additions & 1 deletion play/src/front/Components/Menu/CustomSubMenu.svelte
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@
export let url: string;
export let allowApi: boolean;

export let allow: string | undefined;

let HTMLIframe: HTMLIFrameElement;

onMount(() => {
@@ -20,7 +22,7 @@
});
</script>

<iframe title="customSubMenu" src={url} bind:this={HTMLIframe} />
<iframe title="customSubMenu" src={url} bind:this={HTMLIframe} {allow} />

<style lang="scss">
iframe {
4 changes: 2 additions & 2 deletions play/src/front/Components/Menu/Menu.svelte
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@

let activeSubMenu: MenuItem = $subMenusStore[$activeSubMenuStore];
let activeComponent: typeof ProfileSubMenu | typeof CustomSubMenu = ProfileSubMenu;
let props: { url: string; allowApi: boolean };
let props: { url: string; allowApi: boolean; allow: string | undefined };
let unsubscriberSubMenuStore: Unsubscriber;
let unsubscriberActiveSubMenuStore: Unsubscriber;

@@ -100,7 +100,7 @@
const customMenu = customMenuIframe.get(menu.key);
if (customMenu !== undefined) {
activeSubMenu = menu;
props = { url: customMenu.url, allowApi: customMenu.allowApi };
props = { url: customMenu.url, allowApi: customMenu.allowApi, allow: customMenu.allow };
activeComponent = CustomSubMenu;
} else {
sendMenuClickedEvent(menu.key);
6 changes: 3 additions & 3 deletions play/src/front/Stores/MenuStore.ts
Original file line number Diff line number Diff line change
@@ -267,14 +267,14 @@ export function checkSubMenuToShow() {
}
}

export const customMenuIframe = new Map<string, { url: string; allowApi: boolean }>();
export const customMenuIframe = new Map<string, { url: string; allowApi: boolean; allow?: string | undefined }>();

export function handleMenuRegistrationEvent(
menuName: string,
iframeUrl: string | undefined = undefined,
key: string,
source: string | undefined = undefined,
options: { allowApi: boolean }
options: { allowApi: boolean; allow?: string | undefined }
) {
if (get(subMenusStore).find((item) => item.type === "scripting" && item.label === menuName)) {
console.warn("The menu " + menuName + " already exist.");
@@ -285,7 +285,7 @@ export function handleMenuRegistrationEvent(

if (iframeUrl !== undefined) {
const url = new URL(iframeUrl, source);
customMenuIframe.set(key, { url: url.toString(), allowApi: options.allowApi });
customMenuIframe.set(key, { url: url.toString(), allowApi: options.allowApi, allow: options.allow });
}
}