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

Commit

Permalink
Int (#10911)
Browse files Browse the repository at this point in the history
* dev to int (#10901)

* Revert "Physics reactivity for collider component updates and order dependenc…" (#10876)

This reverts commit 33afb3b.

* fix collider reactivity (#10877)

* fix collider reactivity

* fix tests

* optimize

* fix duplicate new scene (#10880)

* rigidbody initialization quick fix (#10883)

* Upload drag drop files MT fix (#10881)

* Upload drag drop files MT fix

* Array length check

* LerpTransform from rigid body uses rigid body instead of scene entity (#10882)

* remove old workflows (#10886)

* fix rigidbody crash server (#10891)

* IR-3561: Magic Link template support for mobile and desktop  (#10889)

* feat: refactor magic link email template to support desktop and mobile
chore: layout template to reuse styles in other templates

* Fixed logo link

---------

Co-authored-by: Hanzla Mateen <[email protected]>

* Fixed bugs in instanceserver connections (#10887)

* Fixed bugs in instanceserver connections

There were still some bugs surrounding a client connecting to an
instanceserver if the instance record for that server no longer
existed. updateInstance needed to return false in that situation.

This still led to a situation where the client would be stuck trying
to authenticate forever. Added a step prior to authentication where
the client listens for a message with { instanceReady: true }, which
is sent by setupSocketFunctions. If the server isn't ready within
10 seconds, then it returns { instanceReady: false }, and the client
will do a new instanceserver provision and hopefully connect properly
this time.

* make eslint happy

---------

Co-authored-by: Josh Field <[email protected]>

* ignore hash when checking cache validity (#10900)

---------

Co-authored-by: Josh Field <[email protected]>
Co-authored-by: Michael Estes <[email protected]>
Co-authored-by: Daniel Belmes <[email protected]>
Co-authored-by: lucas3900 <[email protected]>
Co-authored-by: Kyle Baran <[email protected]>
Co-authored-by: José Galván <[email protected]>
Co-authored-by: Hanzla Mateen <[email protected]>

* dev to int: Fix scene loading (#10910)

* Revert "Physics reactivity for collider component updates and order dependenc…" (#10876)

This reverts commit 33afb3b.

* fix collider reactivity (#10877)

* fix collider reactivity

* fix tests

* optimize

* fix duplicate new scene (#10880)

* rigidbody initialization quick fix (#10883)

* Upload drag drop files MT fix (#10881)

* Upload drag drop files MT fix

* Array length check

* LerpTransform from rigid body uses rigid body instead of scene entity (#10882)

* remove old workflows (#10886)

* fix rigidbody crash server (#10891)

* IR-3561: Magic Link template support for mobile and desktop  (#10889)

* feat: refactor magic link email template to support desktop and mobile
chore: layout template to reuse styles in other templates

* Fixed logo link

---------

Co-authored-by: Hanzla Mateen <[email protected]>

* Fixed bugs in instanceserver connections (#10887)

* Fixed bugs in instanceserver connections

There were still some bugs surrounding a client connecting to an
instanceserver if the instance record for that server no longer
existed. updateInstance needed to return false in that situation.

This still led to a situation where the client would be stuck trying
to authenticate forever. Added a step prior to authentication where
the client listens for a message with { instanceReady: true }, which
is sent by setupSocketFunctions. If the server isn't ready within
10 seconds, then it returns { instanceReady: false }, and the client
will do a new instanceserver provision and hopefully connect properly
this time.

* make eslint happy

---------

Co-authored-by: Josh Field <[email protected]>

* ignore hash when checking cache validity (#10900)

* apply proper offsets to select (#10799)

* apply proper offsets to select

* add x offset calculation

* fix offset in select

* match tooltip with figma design (#10690)

* match tooltip with figma design

* fix check-errors

* fix check errors

* match title background with figma

* fix check errors

* fix check errors

---------

Co-authored-by: Appaji <[email protected]>

* center and elipse long text (#10895)

* remove fixed height (#10899)

Co-authored-by: Aditya Mitra <[email protected]>

* replace studio assets pagination with infinite scroll (#10756)

* set up observer api

* add asset infinite scroll with observer api

* clean up

* fix categorie change

* remove table pagination code

* add infinite scroll in assets container

* keep calling api till element is in view

---------

Co-authored-by: aditya-mitra <[email protected]>

* studio: swap lit unlit title (#10818)

* swap lit unlit title

* flip lit and unlit icon

---------

Co-authored-by: Liam Broza <[email protected]>

* studio: update asset tree to new design (#10817)

* update aseet tree bg and padding

* update h on desph

* padding

* some padding change

* assset height cleanup

* fix font size

* fix tolbar

* Restrict file name length to 64 characters (#10752)

* restrct file name to 64 characters

* bake length search into regex , remove unused regex

* remove comments

* ensure all models have loaded in the scene before marking scene as fully loaded (#10903)

Co-authored-by: lonedevr <[email protected]>

---------

Co-authored-by: Josh Field <[email protected]>
Co-authored-by: Michael Estes <[email protected]>
Co-authored-by: Daniel Belmes <[email protected]>
Co-authored-by: lucas3900 <[email protected]>
Co-authored-by: Kyle Baran <[email protected]>
Co-authored-by: José Galván <[email protected]>
Co-authored-by: Hanzla Mateen <[email protected]>
Co-authored-by: Aditya Mitra <[email protected]>
Co-authored-by: Appaji <[email protected]>
Co-authored-by: Andy Chen <[email protected]>
Co-authored-by: Liam Broza <[email protected]>
Co-authored-by: Rahul Ghosh <[email protected]>
Co-authored-by: lonedevr <[email protected]>

---------

Co-authored-by: Josh Field <[email protected]>
Co-authored-by: Michael Estes <[email protected]>
Co-authored-by: Daniel Belmes <[email protected]>
Co-authored-by: lucas3900 <[email protected]>
Co-authored-by: Kyle Baran <[email protected]>
Co-authored-by: José Galván <[email protected]>
Co-authored-by: Hanzla Mateen <[email protected]>
Co-authored-by: Aditya Mitra <[email protected]>
Co-authored-by: Appaji <[email protected]>
Co-authored-by: Andy Chen <[email protected]>
Co-authored-by: Liam Broza <[email protected]>
Co-authored-by: Rahul Ghosh <[email protected]>
Co-authored-by: lonedevr <[email protected]>
  • Loading branch information
14 people authored Aug 7, 2024
1 parent 5a682cb commit 25bca7b
Show file tree
Hide file tree
Showing 35 changed files with 400 additions and 308 deletions.
2 changes: 1 addition & 1 deletion packages/client-core/src/admin/adminRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const AdminTopBar = () => {
<HiMiniSun className="text-theme-primary" size="1.5rem" />
)}
</Button>
<Tooltip title={tooltip}>
<Tooltip content={tooltip}>
<Button className="pointer-events-auto" size="small" onClick={() => AuthService.logoutUser()}>
{t('admin:components.common.logOut')}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ export default function ProjectTable(props: { search: string }) {
{row.name}
</a>
{!!row.needsRebuild && (
<Tooltip title={t('admin:components.project.outdatedBuild')} position="right center">
<Tooltip content={t('admin:components.project.outdatedBuild')} position="right center">
<HiOutlineExclamationCircle className="text-orange-400" size={22} />
</Tooltip>
)}
{!!row.hasLocalChanges && (
<Tooltip title={t('admin:components.project.hasLocalChanges')} position="right center">
<Tooltip content={t('admin:components.project.hasLocalChanges')} position="right center">
<HiOutlineExclamationCircle className="text-yellow-400" size={22} />
</Tooltip>
)}
Expand All @@ -243,7 +243,7 @@ export default function ProjectTable(props: { search: string }) {
visibility: <Toggle value={row.visibility === 'public'} onChange={() => handleVisibilityChange(row)} />,
commitSHA: (
<span className="flex items-center justify-between">
<Tooltip title={row.commitSHA || ''}>
<Tooltip content={row.commitSHA || ''}>
<>{row.commitSHA?.slice(0, 8)}</>
</Tooltip>{' '}
<CopyText text={row.commitSHA || ''} className="ml-1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function ServerStatus({ serverPodInfo }: { serverPodInfo: ServerPodInfoType }) {
)}
<div className="flex gap-1">
{serverPodInfo.containers.map((container) => (
<Tooltip key={container.name} title={`${t('admin:components.server.name')}: ${container.name}`}>
<Tooltip key={container.name} content={`${t('admin:components.server.name')}: ${container.name}`}>
<div className={`${containerColor[container.status]} h-3.5 w-3.5 rounded-full`} />
</Tooltip>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const FeatureItem = ({ feature }: { feature: FeatureFlagSettingType }) => {
/>
{feature.userId && (
<Tooltip
title={t('admin:components.common.lastUpdatedBy', {
content={t('admin:components.common.lastUpdatedBy', {
userId: feature.userId,
updatedAt: toDisplayDateTime(feature.updatedAt)
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ const ProjectTab = forwardRef(({ open }: { open: boolean }, ref: React.MutableRe
endComponent={
setting.userId && (
<Tooltip
title={t('admin:components.common.lastUpdatedBy', {
position="left center"
content={t('admin:components.common.lastUpdatedBy', {
userId: setting.userId,
updatedAt: toDisplayDateTime(setting.updatedAt)
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,47 +53,47 @@ export default function AccountIdentifiers({ user }: { user: UserType }) {
return (
<div className="flex items-center gap-2">
{appleIp ? (
<Tooltip title={appleIp.accountIdentifier!}>
<Tooltip content={appleIp.accountIdentifier!}>
<RiAppleFill className="h-6 w-6" />
</Tooltip>
) : null}
{discordIp ? (
<Tooltip title={discordIp.accountIdentifier!}>
<Tooltip content={discordIp.accountIdentifier!}>
<RiDiscordFill className="h-6 w-6" />
</Tooltip>
) : null}
{googleIp ? (
<Tooltip title={googleIp.accountIdentifier!}>
<Tooltip content={googleIp.accountIdentifier!}>
<RiGoogleFill className="h-6 w-6" />
</Tooltip>
) : null}
{facebookIp ? (
<Tooltip title={facebookIp.accountIdentifier!}>
<Tooltip content={facebookIp.accountIdentifier!}>
<RiMetaFill className="h-6 w-6" />
</Tooltip>
) : null}
{twitterIp ? (
<Tooltip title={twitterIp.accountIdentifier!}>
<Tooltip content={twitterIp.accountIdentifier!}>
<RiTwitterXFill className="h-6 w-6" />
</Tooltip>
) : null}
{linkedinIp ? (
<Tooltip title={linkedinIp.accountIdentifier!}>
<Tooltip content={linkedinIp.accountIdentifier!}>
<RiLinkedinFill className="h-6 w-6" />
</Tooltip>
) : null}
{githubIp ? (
<Tooltip title={githubIp.accountIdentifier!}>
<Tooltip content={githubIp.accountIdentifier!}>
<RiGithubFill className="h-6 w-6" />
</Tooltip>
) : null}
{smsIp ? (
<Tooltip title={smsIp.accountIdentifier!}>
<Tooltip content={smsIp.accountIdentifier!}>
<RiMessage2Line className="h-6 w-6" />
</Tooltip>
) : null}
{emailIp ? (
<Tooltip title={emailIp.accountIdentifier!}>
<Tooltip content={emailIp.accountIdentifier!}>
<MdEmail className="h-6 w-6" />
</Tooltip>
) : null}
Expand Down
5 changes: 2 additions & 3 deletions packages/common/src/regex/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ Ethereal Engine. All Rights Reserved.
// Add unit tests for new patterns in packages/common/tests/regex.test.ts

// eslint-disable-next-line no-control-regex
export const INVALID_FILENAME_REGEX = /[_<>:"/\\|?*\u0000-\u001F]/
export const VALID_FILENAME_REGEX = /^(?!.*[\s_<>:"/\\|?*\u0000-\u001F].*)[^\s_<>:"/\\|?*\u0000-\u001F]{1,64}$/
// eslint-disable-next-line no-control-regex
export const INVALID_FILENAME_WHITESPACE_REGEX = /[\s_<>:"/\\|?*\u0000-\u001F]/
export const WINDOWS_RESERVED_NAME_REGEX = /^(con|prn|aux|nul|com\d|lpt\d)$/i
export const VALID_SCENE_NAME_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9-]{2,62}[a-zA-Z0-9_\-]$/
export const VALID_HEIRACHY_SEARCH_REGEX = /[.*+?^${}()|[\]\\]/g
export const VALID_HEIRARCHY_SEARCH_REGEX = /[.*+?^${}()|[\]\\]/g

/**
* Matches CSS imports & URLS.
Expand Down
33 changes: 18 additions & 15 deletions .../src/components/editor/layout/Tooltip.tsx → packages/common/src/utils/offsets.ts
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,22 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20
Ethereal Engine. All Rights Reserved.
*/

import React from 'react'
import Tooltip, { TooltipProps } from '../../../primitives/tailwind/Tooltip'

export function InfoTooltip({ title, info, ...props }: TooltipProps & { info?: string }) {
const tooltipTitle = info ? (
<p>
{title}
<hr className="my-0.5" />
{info}
</p>
) : (
title
)

return <Tooltip title={tooltipTitle} {...props} />
import { Bounds, getBounds, getViewportBounds } from '@etherealengine/xrui'

export const calculateAndApplyYOffset = (element: HTMLElement | null, additionalOffset = 0) => {
if (!element) {
return
}
const popupBounds = getBounds(element)
const viewportBounds = getViewportBounds(new Bounds())

const overflowBottom =
(popupBounds?.top ?? 0) + (popupBounds?.height ?? 0) - (viewportBounds.top + viewportBounds.height)
let offsetY = 0

if (overflowBottom > 0) {
offsetY = -(popupBounds?.height ?? 0) + additionalOffset
}

element.style.transform = `translateY(${offsetY}px)`
}
8 changes: 2 additions & 6 deletions packages/common/src/utils/validateFileName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20
Ethereal Engine. All Rights Reserved.
*/

import { INVALID_FILENAME_WHITESPACE_REGEX, WINDOWS_RESERVED_NAME_REGEX } from '@etherealengine/common/src/regex'
import { VALID_FILENAME_REGEX, WINDOWS_RESERVED_NAME_REGEX } from '@etherealengine/common/src/regex'

export function isValidFileName(fileName: string) {
return (
!INVALID_FILENAME_WHITESPACE_REGEX.test(fileName) &&
!WINDOWS_RESERVED_NAME_REGEX.test(fileName) &&
fileName.length > 0
)
return VALID_FILENAME_REGEX.test(fileName) && !WINDOWS_RESERVED_NAME_REGEX.test(fileName)
}
63 changes: 17 additions & 46 deletions packages/common/tests/regex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import {
EMAIL_REGEX,
GITHUB_URL_REGEX,
INSTALLATION_SIGNED_REGEX,
INVALID_FILENAME_REGEX,
INVALID_FILENAME_WHITESPACE_REGEX,
INVITE_CODE_REGEX,
MAIN_CHART_REGEX,
PHONE_REGEX,
Expand All @@ -42,15 +40,16 @@ import {
PUBLIC_SIGNED_REGEX,
STATIC_ASSET_REGEX,
USER_ID_REGEX,
VALID_HEIRACHY_SEARCH_REGEX,
VALID_FILENAME_REGEX,
VALID_HEIRARCHY_SEARCH_REGEX,
VALID_PROJECT_NAME,
VALID_SCENE_NAME_REGEX,
WINDOWS_RESERVED_NAME_REGEX
} from '../src/regex'

describe('regex.test', () => {
describe('INVALID_FILENAME_REGEX', () => {
it('should match invalid filenames', () => {
it('should not match invalid filenames', () => {
const invalidFilenames = [
'hello_world',
'file<name',
Expand All @@ -61,14 +60,23 @@ describe('regex.test', () => {
'question?mark',
'asterisk*char',
'control\0char',
'another\ncontrol'
'another\ncontrol',
'file name',
'< tag >',
'key : value',
'quote " example',
'path / to / file',
'C:\\ path \\ to \\ file',
'pipe | character',
'question ? mark',
'star * char'
]
invalidFilenames.forEach((filename) => {
assert.ok(INVALID_FILENAME_REGEX.test(filename), `Expected '${filename}' to be invalid`)
assert.ok(!VALID_FILENAME_REGEX.test(filename), `Expected '${filename}' to be invalid`)
})
})

it('should not match valid filenames', () => {
it('should match valid filenames', () => {
const validFilenames = [
'helloworld',
'filename',
Expand All @@ -82,15 +90,15 @@ describe('regex.test', () => {
'anothercontrol'
]
validFilenames.forEach((filename) => {
assert.ok(!INVALID_FILENAME_REGEX.test(filename), `Expected '${filename}' to be valid`)
assert.ok(VALID_FILENAME_REGEX.test(filename), `Expected '${filename}' to be valid`)
})
})
})

describe('HEIRARCHY_SEARCH_REPLACE_REGEX', () => {
it('should replace special characters in search', () => {
const escapeSpecialChars = (input) => {
return input.replace(VALID_HEIRACHY_SEARCH_REGEX, '\\$&')
return input.replace(VALID_HEIRARCHY_SEARCH_REGEX, '\\$&')
}

const testCases = [
Expand All @@ -117,43 +125,6 @@ describe('regex.test', () => {
})
})

describe('INVALID_FILENAME_WHITESPACE_REGEX', () => {
it('should match invalid filenames', () => {
const invalidFilenames = [
'file name', // (a space and an underscore)
'< tag >', // (spaces and less-than < and greater-than > characters)
'key : value', // (a space and a colon :)
'quote " example', // (a space and a double quote ")
'path / to / file', // (spaces and forward slashes /)
'C:\\ path \\ to \\ file', // (spaces and backslashes \)
'pipe | character', // (a space and a pipe |)
'question ? mark', // (a space and a question mark ?)
'star * char' // (a space and an asterisk *)
]
invalidFilenames.forEach((filename) => {
assert.ok(INVALID_FILENAME_WHITESPACE_REGEX.test(filename), `Expected '${filename}' to be invalid`)
})
})

it('should not match valid filenames', () => {
const validFilenames = [
'helloworld',
'filename',
'emailexample.com',
'pathtofile',
'backslash',
'pipesymbol',
'questionmark',
'asteriskchar',
'controlchar',
'anothercontrol'
]
validFilenames.forEach((filename) => {
assert.ok(!INVALID_FILENAME_WHITESPACE_REGEX.test(filename), `Expected '${filename}' to be valid`)
})
})
})

describe('WINDOWS_RESERVED_NAME_REGEX', () => {
it('should match windows reserved names', () => {
const reservedNames = ['CON', 'PrN', 'auX', 'NUL', 'COM0', 'com1', 'Com9', 'LPT0', 'LpT4', 'lPt9']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const ImageCompressionBox = ({ compressProperties }: { compressProperties: State
onChange={compressProperties.flipY.set}
label={t('editor:properties.model.transform.flipY')}
/>
<Tooltip title={t('editor:properties.model.transform.flipYTooltip')}>
<Tooltip content={t('editor:properties.model.transform.flipYTooltip')}>
<HiOutlineInformationCircle />
</Tooltip>
</div>
Expand All @@ -88,7 +88,7 @@ const ImageCompressionBox = ({ compressProperties }: { compressProperties: State
onChange={compressProperties.srgb.set}
label={t('editor:properties.model.transform.srgb')}
/>
<Tooltip title={t('editor:properties.model.transform.srgbTooltip')}>
<Tooltip content={t('editor:properties.model.transform.srgbTooltip')}>
<HiOutlineInformationCircle />
</Tooltip>
</div>
Expand All @@ -98,7 +98,7 @@ const ImageCompressionBox = ({ compressProperties }: { compressProperties: State
onChange={compressProperties.mipmaps.set}
label={t('editor:properties.model.transform.mipmaps')}
/>
<Tooltip title={t('editor:properties.model.transform.mipmapsTooltip')}>
<Tooltip content={t('editor:properties.model.transform.mipmapsTooltip')}>
<HiOutlineInformationCircle />
</Tooltip>
</div>
Expand All @@ -108,7 +108,7 @@ const ImageCompressionBox = ({ compressProperties }: { compressProperties: State
onChange={compressProperties.normalMap.set}
label={t('editor:properties.model.transform.normalMap')}
/>
<Tooltip title={t('editor:properties.model.transform.normalMapTooltip')}>
<Tooltip content={t('editor:properties.model.transform.normalMapTooltip')}>
<HiOutlineInformationCircle />
</Tooltip>
</div>
Expand Down
19 changes: 17 additions & 2 deletions packages/engine/src/gltf/GLTFComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,21 @@ import { parseStorageProviderURLs } from '@etherealengine/common/src/utils/parse
import {
defineComponent,
Entity,
EntityUUID,
getComponent,
getMutableComponent,
getOptionalComponent,
hasComponent,
useComponent,
useEntityContext,
useQuery
useQuery,
UUIDComponent
} from '@etherealengine/ecs'
import { dispatchAction, getState, useHookstate } from '@etherealengine/hyperflux'

import { FileLoader } from '../assets/loaders/base/FileLoader'
import { BINARY_EXTENSION_HEADER_MAGIC, EXTENSIONS, GLTFBinaryExtension } from '../assets/loaders/gltf/GLTFExtensions'
import { ModelComponent } from '../scene/components/ModelComponent'
import { SourceComponent } from '../scene/components/SourceComponent'
import { SceneJsonType } from '../scene/types/SceneTypes'
import { migrateSceneJSONToGLTF } from './convertJsonToGLTF'
Expand Down Expand Up @@ -83,7 +86,19 @@ const ResourceReactor = (props: { documentID: string; entity: Entity }) => {
useEffect(() => {
if (getComponent(props.entity, GLTFComponent).progress === 100) return
if (!getState(GLTFDocumentState)[props.documentID]) return

const document = getState(GLTFDocumentState)[props.documentID]
const modelNodes = document.nodes?.filter((node) => !!node.extensions?.[ModelComponent.jsonID])
if (modelNodes) {
for (const node of modelNodes) {
//check if an entity exists for this node, and has a model component
const uuid = node.extensions![UUIDComponent.jsonID] as EntityUUID
if (!UUIDComponent.entitiesByUUIDState[uuid]) return
const entity = UUIDComponent.entitiesByUUIDState[uuid].value
const model = getOptionalComponent(entity, ModelComponent)
//ensure that model contents have been loaded into the scene
if (!model?.scene) return
}
}
const entities = resourceQuery.filter((e) => getComponent(e, SourceComponent) === props.documentID)
if (!entities.length) {
getMutableComponent(props.entity, GLTFComponent).progress.set(100)
Expand Down
Loading

0 comments on commit 25bca7b

Please sign in to comment.