Skip to content

Commit b013e91

Browse files
committed
chore: add gamesource to drag list, hide alert on canvas
1 parent 51c5b06 commit b013e91

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@api.stream/studio-kit",
3-
"version": "3.0.21",
3+
"version": "3.0.22",
44
"description": "Client SDK for building studio experiences with API.stream",
55
"license": "MIT",
66
"private": false,

src/core/layouts/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const getPresetStyle = (preset: string) => {
1818
const project = getProject(CoreContext.state.activeProjectId)
1919
const root = project.compositor.getRoot()
2020
const { x: rootWidth, y: rootHeight } = root.props.size
21-
const scaleTo = (rootWidth ?? 1920) / 1280
21+
const scaleTo = 1;
2222
const alertWidthPercentage = ((633 * scaleTo) / rootWidth) * 100
2323
const alertHeightPercentage = ((290 * scaleTo) / rootHeight) * 100
2424

src/core/transforms/Alert.tsx

+3-11
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import React, { useEffect } from 'react'
66
import { createRoot } from 'react-dom/client'
77
import { APIKitAnimationTypes } from '../../animation/core/types'
88
import APIKitAnimation from '../../compositor/html/html-animation'
9-
import CoreContext from '../context'
10-
import { getProject } from '../data'
119
import { Compositor } from '../namespaces'
12-
import { Role } from '../types'
1310
import Iframe from './components/Iframe'
1411
export type AlertOverlayProps = {
1512
src?: string
@@ -35,8 +32,7 @@ export const Alert = {
3532
) {
3633

3734
const root = document.createElement('div')
38-
const role = getProject(CoreContext.state.activeProjectId).role
39-
35+
4036
const Alert = ({ source }: { source: AlertOverlaySource }) => {
4137
const { id } = source || {}
4238
const [startAnimation, setStartAnimation] = React.useState(false)
@@ -48,13 +44,9 @@ export const Alert = {
4844
const queryParams = React.useMemo(() => {
4945
return Object.entries(settings)
5046
.map((e) => e.join('='))
51-
.concat(
52-
role === Role.ROLE_RENDERER
53-
? [`mode=engine`]
54-
: [`mode=lightstream`],
55-
)
47+
.concat( [`mode=engine`])
5648
.join('&')
57-
}, [settings, role])
49+
}, [settings])
5850

5951
const resizeIframe = React.useCallback(() => {
6052
if (iframeRef.current) {

src/helpers/compositor.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -630,13 +630,13 @@ const scenelessProjectDragCheck = (node: SceneNode) => {
630630
node.props.name === 'Participant' ||
631631
node.props.sourceType === 'RoomParticipant' ||
632632
node.props.sourceType === 'RTMP' ||
633-
node.props.sourceType === 'Alert'
633+
node.props.sourceType === 'Game'
634634
)
635635
}
636636

637637
/** This is a default check based on legacy behavior */
638638
const scenelessProjectDropCheck = (node: SceneNode) => {
639-
return node.props.name === 'Content' || node.props.name === 'AlertContainer'
639+
return node.props.name === 'Content'
640640
}
641641

642642
type CompositorContext = {

src/helpers/sceneless-project.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ export const commands = (_project: ScenelessProject) => {
12411241
}
12421242

12431243
const { x: rootWidth } = root.props.size
1244-
const scaleTo = (rootWidth ?? 1920) / 1280
1244+
const scaleTo = (rootWidth ?? 1920) / 1920
12451245

12461246
if (!existingForegroundNode) {
12471247
await CoreContext.Command.createNode({

0 commit comments

Comments
 (0)