2
0

Add more video supports (#1023)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
	- Introduced a new layout option for the TextInput component.
- Added support for GUMLET and TIKTOK video content types in
VideoBubbleContent.
- Enhanced VideoUploadContent to handle new properties like aspectRatio
and maxWidth.
- Updated VideoBubble to include aspect-ratio and max-width styles based
on content properties.
- **Refactor**
- Changed the extension used for internationalization (i18n) in the VS
Code environment.
	- Modified how environment variables are accessed in tolgee.tsx.
- Updated parseVideoUrl function to include a new property
videoSizeSuggestion.
- **Chores**
- Updated the tolgeeEnv object in env.ts and added a new optional
parameter to the getRuntimeVariable function.
- Expanded video handling capabilities by introducing new video content
types and associated regular expressions.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Closes #978 #936 #926
This commit is contained in:
Baptiste Arnaud
2023-11-10 11:17:14 +01:00
committed by GitHub
parent df578417aa
commit dd4de582a9
20 changed files with 306 additions and 143 deletions

7
packages/env/env.ts vendored
View File

@@ -279,15 +279,16 @@ const tolgeeEnv = {
NEXT_PUBLIC_TOLGEE_API_URL: z
.string()
.url()
.default('https://tolgee.server.baptistearno.com"')
.optional(),
.optional()
.default('https://tolgee.server.baptistearno.com"'),
},
runtimeEnv: {
NEXT_PUBLIC_TOLGEE_API_KEY: getRuntimeVariable(
'NEXT_PUBLIC_TOLGEE_API_KEY'
),
NEXT_PUBLIC_TOLGEE_API_URL: getRuntimeVariable(
'NEXT_PUBLIC_TOLGEE_API_URL'
'NEXT_PUBLIC_TOLGEE_API_URL',
'https://tolgee.server.baptistearno.com'
),
},
}

View File

@@ -2,9 +2,9 @@ declare const window: {
__ENV?: any
}
export const getRuntimeVariable = (key: string) => {
export const getRuntimeVariable = (key: string, defaultValue?: string) => {
if (typeof window !== 'undefined')
return window.__ENV ? window.__ENV[key] : undefined
return window.__ENV ? window.__ENV[key] ?? defaultValue : undefined
if (typeof process === 'undefined') return undefined
return process.env[key]
return process.env[key] ?? defaultValue
}