Skip to content

Commit 0fee2d9

Browse files
authored
Merge pull request #42 from bigbluebutton/develop
Sync upstream@v5.4.3
2 parents 8aeb2be + 317cae1 commit 0fee2d9

File tree

13 files changed

+195
-109
lines changed

13 files changed

+195
-109
lines changed

.github/workflows/publish-docker-image.yml

Lines changed: 79 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,34 @@ name: Publish Docker image
22

33
on:
44
push:
5+
branches:
6+
- "**"
57
tags:
68
- "v*.*.*"
7-
pull_request:
89

910
jobs:
10-
build_and_publish:
11-
name: Build and push Docker image to container registry
11+
build:
12+
name: Build Docker image for ${{ matrix.platform }}
1213
runs-on: ubuntu-latest
1314
permissions:
1415
packages: write
1516
contents: read
17+
attestations: write
18+
id-token: write
19+
strategy:
20+
matrix:
21+
platform:
22+
- linux/amd64
23+
- linux/arm64
1624
steps:
1725
- name: Check out the repo
1826
uses: actions/checkout@v4
1927

28+
- name: Prepare
29+
run: |
30+
platform=${{ matrix.platform }}
31+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
32+
2033
- name: Log in to the Container registry
2134
uses: docker/login-action@v3
2235
with:
@@ -30,11 +43,11 @@ jobs:
3043
with:
3144
images: ghcr.io/${{ github.repository }}
3245
tags: |
46+
type=ref,event=branch,prefix=dev-
3347
type=ref,event=pr
3448
type=semver,pattern={{version}}
3549
type=semver,pattern={{major}}.{{minor}}
3650
type=semver,pattern={{major}}
37-
type=sha
3851
3952
- name: Set up QEMU
4053
uses: docker/setup-qemu-action@v3
@@ -44,8 +57,70 @@ jobs:
4457

4558
- name: Build and push Docker images
4659
uses: docker/build-push-action@v6
60+
id: push
61+
env:
62+
DOCKER_BUILDKIT: 1
4763
with:
4864
context: .
65+
platforms: ${{ matrix.platform }}
4966
push: ${{ github.event_name != 'pull_request' }}
5067
tags: ${{ steps.meta.outputs.tags }}
5168
labels: ${{ steps.meta.outputs.labels }}
69+
annotations: ${{ steps.meta.outputs.annotations }}
70+
- name: Export digest
71+
run: |
72+
mkdir -p ${{ runner.temp }}/digests
73+
digest="${{ steps.push.outputs.digest }}"
74+
touch "${{ runner.temp }}/digests/${digest#sha256:}"
75+
- name: Upload digest
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: digests-${{ env.PLATFORM_PAIR }}
79+
path: ${{ runner.temp }}/digests/*
80+
if-no-files-found: error
81+
retention-days: 1
82+
83+
merge:
84+
# This job merges the Docker manifests for the different platforms built in the previous job.
85+
name: Merge Docker manifests
86+
runs-on: ubuntu-latest
87+
permissions:
88+
packages: write
89+
contents: read
90+
91+
needs:
92+
- build
93+
steps:
94+
- name: Download digests
95+
uses: actions/download-artifact@v6
96+
with:
97+
path: ${{ runner.temp }}/digests
98+
pattern: digests-*
99+
merge-multiple: true
100+
- name: Log into GitHub Container Registry
101+
uses: docker/login-action@v3
102+
with:
103+
registry: ghcr.io
104+
username: ${{ github.actor }}
105+
password: ${{ secrets.GITHUB_TOKEN }}
106+
- name: Setup Docker Buildx
107+
uses: docker/setup-buildx-action@v3
108+
- name: Extract metadata (tags, labels) for Docker
109+
id: meta
110+
uses: docker/metadata-action@v5
111+
with:
112+
images: ghcr.io/${{ github.repository }}
113+
tags: |
114+
type=ref,event=branch,prefix=dev-
115+
type=ref,event=branch
116+
type=ref,event=pr
117+
type=semver,pattern={{version}}
118+
type=semver,pattern={{major}}.{{minor}}
119+
- name: Create manifest list and push
120+
working-directory: ${{ runner.temp }}/digests
121+
run: |
122+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
123+
$(printf 'ghcr.io/${{ github.repository }}@sha256:%s ' *)
124+
- name: Inspect Image
125+
run: |
126+
docker buildx imagetools inspect ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.version }}

package-lock.json

Lines changed: 15 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "bbb-playback",
3-
"version": "5.4.1",
3+
"version": "5.4.3",
44
"homepage": "/playback/presentation/2.3",
55
"dependencies": {
66
"@bigbluebutton/tldraw": "^2.0.0-alpha.29",
77
"bowser": "^2.11.0",
88
"classnames": "^2.3.1",
99
"darkreader": "^4.9.46",
10+
"dompurify": "^3.3.0",
1011
"linkify-react": "^3.0.4",
1112
"linkifyjs": "^3.0.5",
1213
"prop-types": "^15.8.1",
@@ -15,13 +16,13 @@
1516
"react-intl": "^6.2.5",
1617
"react-router-dom": "^6.4.3",
1718
"react-sizeme": "^3.0.2",
19+
"recharts": "^2.12.7",
1820
"sass": "^1.52.1",
1921
"semver": "^7.5.2",
22+
"styled-components": "^6.1.13",
2023
"tldraw-v1": "npm:@tldraw/tldraw@^1.2.7",
2124
"video.js": "^7.21.1",
22-
"videojs-seek-buttons": "^3.0.1",
23-
"recharts": "^2.12.7",
24-
"styled-components": "^6.1.13"
25+
"videojs-seek-buttons": "^3.0.1"
2526
},
2627
"devDependencies": {
2728
"react-scripts": "^5.0.1"

src/components/bars/top/buttons/theme.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ const css = `
2626
.video-js .vjs-play-progress {
2727
background-color: white;
2828
}
29+
.tl-container {
30+
.tl-image {
31+
background-color: white !important;
32+
}
33+
}
34+
.tl-background {
35+
background-color: #222425 !important;
36+
}
2937
`;
3038

3139
const ignoreInlineStyle = [
@@ -35,6 +43,22 @@ const ignoreInlineStyle = [
3543
'g > polygon',
3644
'g > polyline',
3745
'g > foreignObject',
46+
'path',
47+
'svg',
48+
'g',
49+
'line',
50+
'textarea',
51+
'rect',
52+
'circle',
53+
'.tl-html-container > div.tl-text-shape__wrapper.tl-text-shadow',
54+
'.tl-text',
55+
'.tl-text-input',
56+
'.tl-text-content',
57+
'.tl-text-label__inner',
58+
'.tl-note__container',
59+
'.tl-text.tl-text-content',
60+
'.tl-arrow-label',
61+
'.tl-arrow-label__inner',
3862
];
3963

4064
const fixes = {

src/components/chat/messages/reply/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import cx from 'classnames';
44
import '../index.scss';
5+
import DOMPurify from 'dompurify';
56

67
const propTypes = {
78
active: PropTypes.bool,
@@ -34,9 +35,9 @@ const Reply = ({
3435
return (
3536
<span
3637
onClick={handleClickReply}
37-
className={cx('reply-tag', {inactive: !active})}
38+
className={cx('reply-tag', 'text-vanilla', {inactive: !active})}
39+
dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(text) }}
3840
>
39-
{text}
4041
</span>
4142
);
4243
};

src/components/chat/messages/user/text.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3+
import DOMPurify from 'dompurify';
34

45
const propTypes = {
56
active: PropTypes.bool,
@@ -21,7 +22,7 @@ const Text = ({
2122
return (
2223
<div
2324
className='text-vanilla'
24-
dangerouslySetInnerHTML={{ __html: text }}
25+
dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(text) }}
2526
/>
2627
);
2728
};

src/components/notes/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
import { ID } from 'utils/constants';
77
import storage from 'utils/data/storage';
88
import './index.scss';
9+
import DOMPurify from 'dompurify';
910

1011
const intlMessages = defineMessages({
1112
aria: {
@@ -26,7 +27,7 @@ const Notes = () => {
2627
>
2728
<div className="notes">
2829
<div
29-
dangerouslySetInnerHTML={{ __html: storage.notes }}
30+
dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(storage.notes) }}
3031
style={{ width: '100%' }}
3132
/>
3233
</div>

src/components/thumbnails/index.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const propTypes = {
3434
};
3535

3636
const defaultProps = {
37-
handleSearch: () => {},
37+
handleSearch: () => { },
3838
interactive: false,
3939
search: [],
4040
};
@@ -76,29 +76,34 @@ const Thumbnails = ({
7676
}
7777
});
7878

79-
const items = useMemo(()=> {
79+
const items = useMemo(() => {
8080
const thumbnails = storage.thumbnails;
8181
const layoutSwap = storage.layoutSwap ?? [];
8282
const merged = [...thumbnails, ...layoutSwap];
8383
const sorted = merged.sort((a, b) => a.timestamp - b.timestamp);
84-
84+
8585
const addThumbsForSwap = sorted.map((item, index, arr) => {
8686
const previousItem = arr[index - 1];
8787
const nextItem = arr[index + 1];
8888
if (item.hasOwnProperty('showScreenshare')) {
8989
if (!item.showScreenshare) {
9090
const previousThumbs = arr.slice(0, index)
9191
const Thumbnail = previousThumbs.find((t) => t.src && t.src !== 'screenshare');
92-
return {
93-
...item,
94-
src: Thumbnail?.src ?? '',
95-
alt: Thumbnail?.alt ?? '',
96-
};
92+
// don't add if the src is the same as before
93+
if (Thumbnail?.src === previousItem?.src) {
94+
return null;
95+
} else {
96+
return {
97+
...item,
98+
src: Thumbnail?.src ?? '',
99+
alt: Thumbnail?.alt ?? '',
100+
};
101+
}
97102
} else if (
98-
item.showScreenshare
99-
&& (nextItem && nextItem.src !== 'screenshare')
100-
&& (previousItem && previousItem.src !== 'screenshare')
101-
) {
103+
item.showScreenshare
104+
&& (nextItem && nextItem.src !== 'screenshare')
105+
&& (previousItem && previousItem.src !== 'screenshare')
106+
) {
102107
return {
103108
...item,
104109
src: 'screenshare',
@@ -116,9 +121,9 @@ const Thumbnails = ({
116121
id: index + 1,
117122
}
118123
});
119-
124+
120125
return reworkIds;
121-
}, [storage.thumbnails, storage.layoutSwap]);
126+
}, []);
122127

123128
const currentIndex = useCurrentIndex(items);
124129

src/components/tldraw_v2/index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ const SlideData = (tldrawAPI) => {
6767
assets[`slide-background-asset-${id}`] = createTldrawImageAsset(assetId, buildFileURL(src), scaledWidth, scaledHeight)
6868
shapes["slide-background-shape"] = createTldrawBackgroundShape(assetId, curPageId, scaledWidth, scaledHeight)
6969

70+
const { x, y } = getCursor(currentCursorIndex);
71+
72+
if (!(x === -1 || y === -1)) {
73+
shapes['cursor'] = createTldrawCursorShape(x, y, curPageId);
74+
}
75+
7076
if (index === -1 || isEmpty(interval)) return { assets, shapes, scaleRatio }
7177

7278
for (let i = 0; i < interval.length; i++) {
@@ -84,13 +90,6 @@ const SlideData = (tldrawAPI) => {
8490
}
8591
}
8692

87-
const camera = tldrawAPI?.getCamera();
88-
const { x, y } = getCursor(currentCursorIndex, camera);
89-
90-
if (!(x === -1 || y === -1)) {
91-
shapes['cursor'] = createTldrawCursorShape(x, y, curPageId);
92-
}
93-
9493
return { assets, shapes, scaleRatio }
9594
}
9695

0 commit comments

Comments
 (0)