Compare commits
10 Commits
0812131a97
...
2864a5e4b8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2864a5e4b8 | ||
|
|
735bc15011 | ||
|
|
341fedd932 | ||
|
|
d186d31399 | ||
|
|
098684973e | ||
|
|
b107109453 | ||
|
|
a33e8db9a3 | ||
|
|
fb76e3ecb4 | ||
|
|
3d79293167 | ||
|
|
74745edcda |
6
.github/renovate.json
vendored
6
.github/renovate.json
vendored
@@ -13,15 +13,9 @@
|
|||||||
"matchUpdateTypes": ["lockFileMaintenance"]
|
"matchUpdateTypes": ["lockFileMaintenance"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"groupName": "Slatejs",
|
|
||||||
"matchPackageNames": ["slate", "slate-dom", "slate-history", "slate-react"]
|
"matchPackageNames": ["slate", "slate-dom", "slate-history", "slate-react"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"groupName": "Call",
|
|
||||||
"matchPackageNames": ["@element-hq/element-call-embedded", "matrix-widget-api"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"groupName": "Linkify",
|
|
||||||
"matchPackageNames": ["linkifyjs", "linkify-react"]
|
"matchPackageNames": ["linkifyjs", "linkify-react"]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
6
.github/workflows/build-pull-request.yml
vendored
6
.github/workflows/build-pull-request.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".node-version"
|
node-version-file: ".node-version"
|
||||||
package-manager-cache: false
|
package-manager-cache: false
|
||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
NODE_OPTIONS: '--max_old_space_size=4096'
|
NODE_OPTIONS: '--max_old_space_size=4096'
|
||||||
run: npm run build
|
run: npm run build
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
with:
|
with:
|
||||||
name: preview
|
name: preview
|
||||||
path: dist
|
path: dist
|
||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
- name: Save pr number
|
- name: Save pr number
|
||||||
run: echo ${PR_NUMBER} > ./pr.txt
|
run: echo ${PR_NUMBER} > ./pr.txt
|
||||||
- name: Upload pr number
|
- name: Upload pr number
|
||||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
with:
|
with:
|
||||||
name: pr
|
name: pr
|
||||||
path: ./pr.txt
|
path: ./pr.txt
|
||||||
|
|||||||
4
.github/workflows/deploy-pull-request.yml
vendored
4
.github/workflows/deploy-pull-request.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Download pr number
|
- name: Download pr number
|
||||||
uses: dawidd6/action-download-artifact@2536c51d3d126276eb39f74d6bc9c72ac6ef30d3 # v16
|
uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21
|
||||||
with:
|
with:
|
||||||
workflow: ${{ github.event.workflow.id }}
|
workflow: ${{ github.event.workflow.id }}
|
||||||
run_id: ${{ github.event.workflow_run.id }}
|
run_id: ${{ github.event.workflow_run.id }}
|
||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
id: pr
|
id: pr
|
||||||
run: echo "id=$(<pr.txt)" >> $GITHUB_OUTPUT
|
run: echo "id=$(<pr.txt)" >> $GITHUB_OUTPUT
|
||||||
- name: Download artifact
|
- name: Download artifact
|
||||||
uses: dawidd6/action-download-artifact@2536c51d3d126276eb39f74d6bc9c72ac6ef30d3 # v16
|
uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21
|
||||||
with:
|
with:
|
||||||
workflow: ${{ github.event.workflow.id }}
|
workflow: ${{ github.event.workflow.id }}
|
||||||
run_id: ${{ github.event.workflow_run.id }}
|
run_id: ${{ github.event.workflow_run.id }}
|
||||||
|
|||||||
2
.github/workflows/netlify-dev.yml
vendored
2
.github/workflows/netlify-dev.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".node-version"
|
node-version-file: ".node-version"
|
||||||
package-manager-cache: false
|
package-manager-cache: false
|
||||||
|
|||||||
4
.github/workflows/prod-deploy.yml
vendored
4
.github/workflows/prod-deploy.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".node-version"
|
node-version-file: ".node-version"
|
||||||
package-manager-cache: false
|
package-manager-cache: false
|
||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
gpg --export | xxd -p
|
gpg --export | xxd -p
|
||||||
echo '${{ secrets.GNUPG_PASSPHRASE }}' | gpg --batch --yes --pinentry-mode loopback --passphrase-fd 0 --armor --detach-sign cinny-${{ steps.vars.outputs.tag }}.tar.gz
|
echo '${{ secrets.GNUPG_PASSPHRASE }}' | gpg --batch --yes --pinentry-mode loopback --passphrase-fd 0 --armor --detach-sign cinny-${{ steps.vars.outputs.tag }}.tar.gz
|
||||||
- name: Upload tagged release
|
- name: Upload tagged release
|
||||||
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2.3.3
|
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ steps.vars.outputs.tag }}
|
tag_name: ${{ steps.vars.outputs.tag }}
|
||||||
files: |
|
files: |
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ RUN npm run build
|
|||||||
|
|
||||||
|
|
||||||
## App
|
## App
|
||||||
FROM nginx:1.29.5-alpine
|
FROM nginx:1.29.8-alpine
|
||||||
|
|
||||||
COPY --from=builder /src/dist /app
|
COPY --from=builder /src/dist /app
|
||||||
COPY --from=builder /src/docker-nginx.conf /etc/nginx/conf.d/default.conf
|
COPY --from=builder /src/docker-nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React, { ReactNode, useCallback, useRef } from 'react';
|
import React, { ReactNode, useCallback, useRef } from 'react';
|
||||||
import { useAtomValue, useSetAtom } from 'jotai';
|
import { useAtomValue, useSetAtom } from 'jotai';
|
||||||
import { config } from 'folds';
|
|
||||||
import {
|
import {
|
||||||
CallEmbedContextProvider,
|
CallEmbedContextProvider,
|
||||||
CallEmbedRefContextProvider,
|
CallEmbedRefContextProvider,
|
||||||
|
|||||||
@@ -157,10 +157,12 @@ const getInlineElement = (node: ChildNode, processText: ProcessTextCallback): In
|
|||||||
return children;
|
return children;
|
||||||
}
|
}
|
||||||
|
|
||||||
return node.childNodes.flatMap((child) => getInlineElement(child, processText));
|
const children = node.childNodes.flatMap((child) => getInlineElement(child, processText));
|
||||||
|
if (children.length === 0) return [{ text: '' }];
|
||||||
|
return children;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
return [{ text: '' }];
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseBlockquoteNode = (
|
const parseBlockquoteNode = (
|
||||||
@@ -191,7 +193,7 @@ const parseBlockquoteNode = (
|
|||||||
|
|
||||||
if (child.name === 'p') {
|
if (child.name === 'p') {
|
||||||
appendLine();
|
appendLine();
|
||||||
quoteLines.push(child.children.flatMap((c) => getInlineElement(c, processText)));
|
quoteLines.push(getInlineElement(child, processText));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,7 +283,7 @@ const parseListNode = (
|
|||||||
|
|
||||||
if (child.name === 'li') {
|
if (child.name === 'li') {
|
||||||
appendLine();
|
appendLine();
|
||||||
listLines.push(child.children.flatMap((c) => getInlineElement(c, processText)));
|
listLines.push(getInlineElement(child, processText));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,7 +331,7 @@ const parseHeadingNode = (
|
|||||||
node: Element,
|
node: Element,
|
||||||
processText: ProcessTextCallback
|
processText: ProcessTextCallback
|
||||||
): HeadingElement | ParagraphElement => {
|
): HeadingElement | ParagraphElement => {
|
||||||
const children = node.children.flatMap((child) => getInlineElement(child, processText));
|
const children = getInlineElement(node, processText);
|
||||||
|
|
||||||
const headingMatch = node.name.match(/^h([123456])$/);
|
const headingMatch = node.name.match(/^h([123456])$/);
|
||||||
const [, g1AsLevel] = headingMatch ?? ['h3', '3'];
|
const [, g1AsLevel] = headingMatch ?? ['h3', '3'];
|
||||||
@@ -392,7 +394,7 @@ export const domToEditorInput = (
|
|||||||
appendLine();
|
appendLine();
|
||||||
children.push({
|
children.push({
|
||||||
type: BlockType.Paragraph,
|
type: BlockType.Paragraph,
|
||||||
children: node.children.flatMap((child) => getInlineElement(child, processText)),
|
children: getInlineElement(node, processText),
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
} from '../../plugins/markdown';
|
} from '../../plugins/markdown';
|
||||||
import { findAndReplace } from '../../utils/findAndReplace';
|
import { findAndReplace } from '../../utils/findAndReplace';
|
||||||
import { sanitizeForRegex } from '../../utils/regex';
|
import { sanitizeForRegex } from '../../utils/regex';
|
||||||
import { getCanonicalAliasOrRoomId, isUserId } from '../../utils/matrix';
|
import { isUserId } from '../../utils/matrix';
|
||||||
|
|
||||||
export type OutputOptions = {
|
export type OutputOptions = {
|
||||||
allowTextFormatting?: boolean;
|
allowTextFormatting?: boolean;
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ import { useAtom, useAtomValue } from 'jotai';
|
|||||||
import { NavItem, NavItemContent, NavItemOptions, NavLink } from '../../components/nav';
|
import { NavItem, NavItemContent, NavItemOptions, NavLink } from '../../components/nav';
|
||||||
import { UnreadBadge, UnreadBadgeCenter } from '../../components/unread-badge';
|
import { UnreadBadge, UnreadBadgeCenter } from '../../components/unread-badge';
|
||||||
import { RoomAvatar, RoomIcon } from '../../components/room-avatar';
|
import { RoomAvatar, RoomIcon } from '../../components/room-avatar';
|
||||||
import { getDirectRoomAvatarUrl, getRoomAvatarUrl } from '../../utils/room';
|
import { getDirectRoomAvatarUrl, getRoomAvatarUrl, getStateEvent } from '../../utils/room';
|
||||||
import { nameInitials } from '../../utils/common';
|
import { nameInitials } from '../../utils/common';
|
||||||
import { useMatrixClient } from '../../hooks/useMatrixClient';
|
import { useMatrixClient } from '../../hooks/useMatrixClient';
|
||||||
import { useRoomUnread } from '../../state/hooks/unread';
|
import { useRoomUnread } from '../../state/hooks/unread';
|
||||||
import { roomToUnreadAtom } from '../../state/room/roomToUnread';
|
import { roomToUnreadAtom } from '../../state/room/roomToUnread';
|
||||||
import { usePowerLevels } from '../../hooks/usePowerLevels';
|
import { getPowersLevelFromMatrixEvent, usePowerLevels } from '../../hooks/usePowerLevels';
|
||||||
import { copyToClipboard } from '../../utils/dom';
|
import { copyToClipboard } from '../../utils/dom';
|
||||||
import { markAsRead } from '../../utils/notifications';
|
import { markAsRead } from '../../utils/notifications';
|
||||||
import { UseStateProvider } from '../../components/UseStateProvider';
|
import { UseStateProvider } from '../../components/UseStateProvider';
|
||||||
@@ -49,8 +49,8 @@ import {
|
|||||||
RoomNotificationMode,
|
RoomNotificationMode,
|
||||||
} from '../../hooks/useRoomsNotificationPreferences';
|
} from '../../hooks/useRoomsNotificationPreferences';
|
||||||
import { RoomNotificationModeSwitcher } from '../../components/RoomNotificationSwitcher';
|
import { RoomNotificationModeSwitcher } from '../../components/RoomNotificationSwitcher';
|
||||||
import { useRoomCreators } from '../../hooks/useRoomCreators';
|
import { getRoomCreatorsForRoomId, useRoomCreators } from '../../hooks/useRoomCreators';
|
||||||
import { useRoomPermissions } from '../../hooks/useRoomPermissions';
|
import { getRoomPermissionsAPI, useRoomPermissions } from '../../hooks/useRoomPermissions';
|
||||||
import { InviteUserPrompt } from '../../components/invite-user-prompt';
|
import { InviteUserPrompt } from '../../components/invite-user-prompt';
|
||||||
import { useRoomName } from '../../hooks/useRoomMeta';
|
import { useRoomName } from '../../hooks/useRoomMeta';
|
||||||
import { useCallMembers, useCallSession } from '../../hooks/useCall';
|
import { useCallMembers, useCallSession } from '../../hooks/useCall';
|
||||||
@@ -59,6 +59,7 @@ import { callChatAtom } from '../../state/callEmbed';
|
|||||||
import { useCallPreferencesAtom } from '../../state/hooks/callPreferences';
|
import { useCallPreferencesAtom } from '../../state/hooks/callPreferences';
|
||||||
import { useAutoDiscoveryInfo } from '../../hooks/useAutoDiscoveryInfo';
|
import { useAutoDiscoveryInfo } from '../../hooks/useAutoDiscoveryInfo';
|
||||||
import { livekitSupport } from '../../hooks/useLivekitSupport';
|
import { livekitSupport } from '../../hooks/useLivekitSupport';
|
||||||
|
import { StateEvent } from '../../../types/matrix/room';
|
||||||
|
|
||||||
type RoomNavItemMenuProps = {
|
type RoomNavItemMenuProps = {
|
||||||
room: Room;
|
room: Room;
|
||||||
@@ -287,8 +288,18 @@ export function RoomNavItem({
|
|||||||
const autoDiscoveryInfo = useAutoDiscoveryInfo();
|
const autoDiscoveryInfo = useAutoDiscoveryInfo();
|
||||||
|
|
||||||
const handleStartCall: MouseEventHandler<HTMLAnchorElement> = (evt) => {
|
const handleStartCall: MouseEventHandler<HTMLAnchorElement> = (evt) => {
|
||||||
// Do not join if no livekit support or call is not started by others
|
const powerLevelsEvent = getStateEvent(room, StateEvent.RoomPowerLevels);
|
||||||
if (!livekitSupport(autoDiscoveryInfo) && callMembers.length === 0) {
|
const powerLevels = getPowersLevelFromMatrixEvent(powerLevelsEvent);
|
||||||
|
const creators = getRoomCreatorsForRoomId(mx, room.roomId);
|
||||||
|
const permissions = getRoomPermissionsAPI(creators, powerLevels);
|
||||||
|
|
||||||
|
const hasCallPermission = permissions.event(
|
||||||
|
StateEvent.GroupCallMemberPrefix,
|
||||||
|
mx.getSafeUserId()
|
||||||
|
);
|
||||||
|
|
||||||
|
// Do not join if missing permissions or no livekit support and call is not started by others
|
||||||
|
if (!hasCallPermission || (!livekitSupport(autoDiscoveryInfo) && callMembers.length === 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ const fillMissingPowers = (powerLevels: IPowerLevels): IPowerLevels =>
|
|||||||
return draftPl;
|
return draftPl;
|
||||||
});
|
});
|
||||||
|
|
||||||
const getPowersLevelFromMatrixEvent = (mEvent?: MatrixEvent): IPowerLevels => {
|
export const getPowersLevelFromMatrixEvent = (mEvent?: MatrixEvent): IPowerLevels => {
|
||||||
const plContent = mEvent?.getContent<IPowerLevels>();
|
const plContent = mEvent?.getContent<IPowerLevels>();
|
||||||
|
|
||||||
const powerLevels = !plContent ? DEFAULT_POWER_LEVELS : fillMissingPowers(plContent);
|
const powerLevels = !plContent ? DEFAULT_POWER_LEVELS : fillMissingPowers(plContent);
|
||||||
|
|||||||
@@ -129,3 +129,9 @@ textarea {
|
|||||||
audio:not([controls]) {
|
audio:not([controls]) {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Fix Firefox rendering lists that have empty items with those items collapsed in on eachother */
|
||||||
|
li p::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user