@cloudflare/realtimekit-ui 2.1.0 → 2.2.0-staging.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +1 -1
- package/dist/cjs/{config-HiqPJwIo.js → config-QKPY7hOX.js} +4 -4
- package/dist/cjs/index.cjs.js +4 -3
- package/dist/cjs/rtk-avatar_26.cjs.entry.js +9 -8
- package/dist/cjs/rtk-screenshare-view.cjs.entry.js +45 -39
- package/dist/cjs/rtk-ui-provider.cjs.entry.js +6 -5
- package/dist/cjs/{merge-DSuacPWu.js → ui-kit-metadata-Cjs7_Xqr.js} +40 -0
- package/dist/collection/components/rtk-meeting/rtk-meeting.js +2 -0
- package/dist/collection/components/rtk-screenshare-view/rtk-screenshare-view.js +45 -39
- package/dist/collection/components/rtk-ui-provider/rtk-ui-provider.js +2 -0
- package/dist/collection/exports.js +1 -0
- package/dist/collection/utils/ui-kit-metadata.js +37 -0
- package/dist/components/index.js +1 -1
- package/dist/components/{p-By2mVWfn.js → p-CRh2Y0y5.js} +1 -1
- package/dist/components/p-CqIpJqLB.js +1 -0
- package/dist/components/rtk-meeting.js +1 -1
- package/dist/components/rtk-screenshare-view.js +1 -1
- package/dist/components/rtk-ui-provider.js +1 -1
- package/dist/docs/docs-components.json +1 -1
- package/dist/esm/{config-RftCp4k_.js → config-CvBBWjUo.js} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/loader.js +78 -39
- package/dist/esm/rtk-avatar_26.entry.js +3 -2
- package/dist/esm/rtk-screenshare-view.entry.js +45 -39
- package/dist/esm/rtk-ui-provider.entry.js +2 -1
- package/dist/esm/{merge-9wD3oWzy.js → ui-kit-metadata-BfDGhHU-.js} +39 -1
- package/dist/realtimekit-ui/index.esm.js +1 -1
- package/dist/realtimekit-ui/p-207ce4c5.entry.js +1 -0
- package/dist/realtimekit-ui/{p-BKOrdZVd.js → p-4wo9JvMs.js} +1 -1
- package/dist/realtimekit-ui/p-57b4007f.entry.js +1 -0
- package/dist/realtimekit-ui/p-BPp8I5C6.js +1 -0
- package/dist/realtimekit-ui/p-aeddf24f.entry.js +1 -0
- package/dist/realtimekit-ui/realtimekit-ui.esm.js +1 -1
- package/dist/types/components/rtk-screenshare-view/rtk-screenshare-view.d.ts +3 -2
- package/dist/types/exports.d.ts +1 -0
- package/dist/types/utils/ui-kit-metadata.d.ts +10 -0
- package/package.json +2 -6
- package/dist/components/p-BRxdAqtR.js +0 -1
- package/dist/realtimekit-ui/p-39f0b141.entry.js +0 -1
- package/dist/realtimekit-ui/p-7690e88e.entry.js +0 -1
- package/dist/realtimekit-ui/p-aa40e2af.entry.js +0 -1
- package/dist/realtimekit-ui/p-kO5UeN9F.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var uiStore = require('./ui-store-CrqwtYqt.js');
|
|
4
|
-
var
|
|
4
|
+
var uiKitMetadata = require('./ui-kit-metadata-Cjs7_Xqr.js');
|
|
5
5
|
var livestream = require('./livestream-B1z1fq_f.js');
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -11,7 +11,7 @@ var livestream = require('./livestream-B1z1fq_f.js');
|
|
|
11
11
|
*/
|
|
12
12
|
const extendConfig = (config, baseConfig = uiStore.createDefaultConfig()) => {
|
|
13
13
|
let newConfig = Object.assign({}, baseConfig);
|
|
14
|
-
|
|
14
|
+
uiKitMetadata.merge(newConfig, config);
|
|
15
15
|
return newConfig;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
@@ -160,10 +160,10 @@ const generateConfig = (oldConfig, meeting, toExtend = {}, options = { grid_pagi
|
|
|
160
160
|
logo,
|
|
161
161
|
};
|
|
162
162
|
designTokens = oldConfig.designTokens;
|
|
163
|
-
if (
|
|
163
|
+
if (uiKitMetadata.isValidHexColor((_k = (_j = oldConfig === null || oldConfig === void 0 ? void 0 : oldConfig.designTokens) === null || _j === void 0 ? void 0 : _j.colors) === null || _k === void 0 ? void 0 : _k.textOnBrand)) {
|
|
164
164
|
designTokens.colors['text-on-brand'] = (_m = (_l = oldConfig === null || oldConfig === void 0 ? void 0 : oldConfig.designTokens) === null || _l === void 0 ? void 0 : _l.colors) === null || _m === void 0 ? void 0 : _m.textOnBrand;
|
|
165
165
|
}
|
|
166
|
-
if (
|
|
166
|
+
if (uiKitMetadata.isValidHexColor((_p = (_o = oldConfig === null || oldConfig === void 0 ? void 0 : oldConfig.designTokens) === null || _o === void 0 ? void 0 : _o.colors) === null || _p === void 0 ? void 0 : _p.videoBg)) {
|
|
167
167
|
designTokens.colors['video-bg'] = (_r = (_q = oldConfig === null || oldConfig === void 0 ? void 0 : oldConfig.designTokens) === null || _q === void 0 ? void 0 : _q.colors) === null || _r === void 0 ? void 0 : _r.videoBg;
|
|
168
168
|
}
|
|
169
169
|
let config = {
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var breakoutRoomsManager = require('./breakout-rooms-manager-CIrqMYfb.js');
|
|
4
|
-
var
|
|
5
|
-
var config = require('./config-
|
|
4
|
+
var uiKitMetadata = require('./ui-kit-metadata-Cjs7_Xqr.js');
|
|
5
|
+
var config = require('./config-QKPY7hOX.js');
|
|
6
6
|
var uiStore = require('./ui-store-CrqwtYqt.js');
|
|
7
7
|
var notification = require('./notification-Bny5fHfy.js');
|
|
8
8
|
var chat = require('./chat-D-UECZep.js');
|
|
@@ -249,7 +249,8 @@ function registerAddons(addons, meeting, config$1) {
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
exports.BreakoutRoomsManager = breakoutRoomsManager.BreakoutRoomsManager;
|
|
252
|
-
exports.provideRtkDesignSystem =
|
|
252
|
+
exports.provideRtkDesignSystem = uiKitMetadata.provideRtkDesignSystem;
|
|
253
|
+
exports.setUiKitSdkName = uiKitMetadata.setUiKitSdkName;
|
|
253
254
|
exports.extendConfig = config.extendConfig;
|
|
254
255
|
exports.generateConfig = config.generateConfig;
|
|
255
256
|
exports.createDefaultConfig = uiStore.createDefaultConfig;
|
|
@@ -8,9 +8,9 @@ var chat = require('./chat-D-UECZep.js');
|
|
|
8
8
|
require('./breakout-rooms-manager-CIrqMYfb.js');
|
|
9
9
|
require('./livestream-B1z1fq_f.js');
|
|
10
10
|
var file = require('./file-BfaJmhHW.js');
|
|
11
|
-
var
|
|
11
|
+
var uiKitMetadata = require('./ui-kit-metadata-Cjs7_Xqr.js');
|
|
12
12
|
var index$2 = require('./index-Ck9E7Wf2.js');
|
|
13
|
-
var config = require('./config-
|
|
13
|
+
var config = require('./config-QKPY7hOX.js');
|
|
14
14
|
var ResizeObserver_es = require('./ResizeObserver.es-26EdCpEA.js');
|
|
15
15
|
var initError = require('./init-error-ByISl9tW.js');
|
|
16
16
|
var joinError = require('./join-error-CZSJQxsP.js');
|
|
@@ -1522,7 +1522,7 @@ const RtkMeeting = class {
|
|
|
1522
1522
|
((_a = this.config) === null || _a === void 0 ? void 0 : _a.designTokens) != null &&
|
|
1523
1523
|
typeof document !== 'undefined' &&
|
|
1524
1524
|
(this.peerStore || uiStore.uiStore).state.states.activeDebugger !== true) {
|
|
1525
|
-
|
|
1525
|
+
uiKitMetadata.provideRtkDesignSystem(document.documentElement, this.config.designTokens);
|
|
1526
1526
|
}
|
|
1527
1527
|
}
|
|
1528
1528
|
disconnectedCallback() {
|
|
@@ -1592,6 +1592,7 @@ const RtkMeeting = class {
|
|
|
1592
1592
|
var _a, _b;
|
|
1593
1593
|
if (!meeting)
|
|
1594
1594
|
return;
|
|
1595
|
+
uiKitMetadata.reportUiKitMetadata(meeting);
|
|
1595
1596
|
// Create peer specific store for this meeting peer instance
|
|
1596
1597
|
if (meeting) {
|
|
1597
1598
|
this.peerStore = uiStore.createPeerStore({
|
|
@@ -1600,7 +1601,7 @@ const RtkMeeting = class {
|
|
|
1600
1601
|
iconPack: this.iconPack,
|
|
1601
1602
|
t: this.t,
|
|
1602
1603
|
providerId: this.providerId,
|
|
1603
|
-
overrides:
|
|
1604
|
+
overrides: uiKitMetadata.merge(Object.assign({}, uiStore.defaultOverrides), this.overrides),
|
|
1604
1605
|
});
|
|
1605
1606
|
// Notify components that peer specific store is now available
|
|
1606
1607
|
document.dispatchEvent(new CustomEvent('rtkPeerStoreReady', {
|
|
@@ -1636,7 +1637,7 @@ const RtkMeeting = class {
|
|
|
1636
1637
|
((_b = this.config) === null || _b === void 0 ? void 0 : _b.designTokens) != null &&
|
|
1637
1638
|
typeof document !== 'undefined' &&
|
|
1638
1639
|
targetStore.state.states.activeDebugger !== true) {
|
|
1639
|
-
|
|
1640
|
+
uiKitMetadata.provideRtkDesignSystem(document.documentElement, this.config.designTokens);
|
|
1640
1641
|
}
|
|
1641
1642
|
meeting.self.addListener('roomJoined', this.roomJoinedListener);
|
|
1642
1643
|
meeting.self.addListener('waitlisted', this.waitlistedListener);
|
|
@@ -1682,12 +1683,12 @@ const RtkMeeting = class {
|
|
|
1682
1683
|
if ((config === null || config === void 0 ? void 0 : config.designTokens) &&
|
|
1683
1684
|
typeof document !== 'undefined' &&
|
|
1684
1685
|
(this.peerStore || uiStore.uiStore).state.states.activeDebugger !== true) {
|
|
1685
|
-
|
|
1686
|
+
uiKitMetadata.provideRtkDesignSystem(document.documentElement, config.designTokens);
|
|
1686
1687
|
}
|
|
1687
1688
|
}
|
|
1688
1689
|
overridesChanged(overrides) {
|
|
1689
1690
|
if (this.peerStore) {
|
|
1690
|
-
this.peerStore.state.overrides =
|
|
1691
|
+
this.peerStore.state.overrides = uiKitMetadata.merge(Object.assign({}, uiStore.defaultOverrides), overrides);
|
|
1691
1692
|
}
|
|
1692
1693
|
}
|
|
1693
1694
|
handleResize() {
|
|
@@ -1697,7 +1698,7 @@ const RtkMeeting = class {
|
|
|
1697
1698
|
// Use peer specific store if available, otherwise fall back to global store
|
|
1698
1699
|
const targetStore = this.peerStore || uiStore.uiStore;
|
|
1699
1700
|
const newStates = Object.assign({}, targetStore.state.states);
|
|
1700
|
-
targetStore.state.states =
|
|
1701
|
+
targetStore.state.states = uiKitMetadata.merge(newStates, states);
|
|
1701
1702
|
// Emit unscoped event for backward compatibility
|
|
1702
1703
|
this.statesUpdate.emit(targetStore.state.states);
|
|
1703
1704
|
// Also emit a scoped event that only this meeting's components should listen to
|
|
@@ -22,6 +22,19 @@ const RtkScreenshareView = class {
|
|
|
22
22
|
index$1.registerInstance(this, hostRef);
|
|
23
23
|
this.stateUpdate = index$1.createEvent(this, "rtkStateUpdate", 7);
|
|
24
24
|
this.play = index$1.createEvent(this, "screensharePlay", 7);
|
|
25
|
+
this.screenShareListener = ({ screenShareEnabled, screenShareTracks, }) => {
|
|
26
|
+
const enabled = screenShareEnabled && screenShareTracks.video != null;
|
|
27
|
+
index$1.writeTask(() => {
|
|
28
|
+
this.screenShareEnabled = enabled;
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
this.onVideoRef = (el) => {
|
|
32
|
+
var _a;
|
|
33
|
+
if (el == null || el === this.videoEl)
|
|
34
|
+
return;
|
|
35
|
+
this.videoEl = el;
|
|
36
|
+
(_a = this.participant) === null || _a === void 0 ? void 0 : _a.registerScreenshareVideoElement(el);
|
|
37
|
+
};
|
|
25
38
|
this.fullScreenListener = () => {
|
|
26
39
|
this.isFullScreen = fullScreen.isFullScreenEnabled();
|
|
27
40
|
};
|
|
@@ -73,47 +86,40 @@ const RtkScreenshareView = class {
|
|
|
73
86
|
connectedCallback() {
|
|
74
87
|
window === null || window === void 0 ? void 0 : window.addEventListener('fullscreenchange', this.fullScreenListener);
|
|
75
88
|
window === null || window === void 0 ? void 0 : window.addEventListener('webkitfullscreenchange', this.fullScreenListener);
|
|
76
|
-
}
|
|
77
|
-
componentDidLoad() {
|
|
78
89
|
this.participantChanged(this.participant);
|
|
79
90
|
}
|
|
80
91
|
disconnectedCallback() {
|
|
92
|
+
this.cleanupParticipant(this.participant);
|
|
93
|
+
window === null || window === void 0 ? void 0 : window.removeEventListener('fullscreenchange', this.fullScreenListener);
|
|
94
|
+
window === null || window === void 0 ? void 0 : window.removeEventListener('webkitfullscreenchange', this.fullScreenListener);
|
|
95
|
+
}
|
|
96
|
+
participantChanged(participant, oldParticipant) {
|
|
97
|
+
// The SDK ignores a video element that another participant still manages
|
|
98
|
+
this.cleanupParticipant(oldParticipant);
|
|
99
|
+
if (participant == null)
|
|
100
|
+
return;
|
|
101
|
+
// On first load the video element is registered once it renders, see onVideoRef
|
|
102
|
+
if (this.videoEl)
|
|
103
|
+
participant.registerScreenshareVideoElement(this.videoEl);
|
|
81
104
|
if (!this.meeting)
|
|
82
105
|
return;
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
|
|
106
|
+
this.screenShareListener(participant);
|
|
107
|
+
if (participant.id === this.meeting.self.id)
|
|
108
|
+
participant.addListener('screenShareUpdate', this.screenShareListener);
|
|
86
109
|
else
|
|
87
|
-
this.meeting.participants.joined.
|
|
88
|
-
window === null || window === void 0 ? void 0 : window.removeEventListener('fullscreenchange', this.fullScreenListener);
|
|
89
|
-
window === null || window === void 0 ? void 0 : window.removeEventListener('webkitfullscreenchange', this.fullScreenListener);
|
|
110
|
+
this.meeting.participants.joined.addListener('screenShareUpdate', this.participantScreenshareUpdate);
|
|
90
111
|
}
|
|
91
|
-
|
|
92
|
-
if (participant
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (this.videoEl != null) {
|
|
103
|
-
this.videoEl.srcObject = stream;
|
|
104
|
-
this.videoEl.play();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
else if (this.videoEl != null) {
|
|
108
|
-
this.videoEl.srcObject = undefined;
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
this.screenShareListener(participant);
|
|
112
|
-
if (participant.id === self.id)
|
|
113
|
-
participant.addListener('screenShareUpdate', this.screenShareListener);
|
|
114
|
-
else
|
|
115
|
-
this.meeting.participants.joined.addListener('screenShareUpdate', this.participantScreenshareUpdate);
|
|
116
|
-
}
|
|
112
|
+
cleanupParticipant(participant) {
|
|
113
|
+
if (participant == null)
|
|
114
|
+
return;
|
|
115
|
+
if (this.videoEl)
|
|
116
|
+
participant.deregisterScreenshareVideoElement(this.videoEl);
|
|
117
|
+
if (!this.meeting)
|
|
118
|
+
return;
|
|
119
|
+
if (participant.id === this.meeting.self.id)
|
|
120
|
+
participant.removeListener('screenShareUpdate', this.screenShareListener);
|
|
121
|
+
else
|
|
122
|
+
this.meeting.participants.joined.removeListener('screenShareUpdate', this.participantScreenshareUpdate);
|
|
117
123
|
}
|
|
118
124
|
render() {
|
|
119
125
|
var _a, _b, _c;
|
|
@@ -122,7 +128,7 @@ const RtkScreenshareView = class {
|
|
|
122
128
|
const icon = this.isFullScreen
|
|
123
129
|
? this.iconPack.full_screen_minimize
|
|
124
130
|
: this.iconPack.full_screen_maximize;
|
|
125
|
-
return (index$1.h(index$1.Host, { key: '
|
|
131
|
+
return (index$1.h(index$1.Host, { key: '194efb9fa8783a441c8050ebab07a2d3546446bf', class: { isSelf } }, index$1.h("div", { key: "video-container", id: "video-container", class: { expand: this.videoExpanded } }, index$1.h("video", { key: 'de008c1a856ba19e766c03b71b1be492a9975261', ref: this.onVideoRef, class: {
|
|
126
132
|
visible: this.screenShareEnabled,
|
|
127
133
|
'fit-in-container': this.participant.supportsRemoteControl,
|
|
128
134
|
}, playsInline: true, onPlay: () => {
|
|
@@ -130,15 +136,15 @@ const RtkScreenshareView = class {
|
|
|
130
136
|
screenshareParticipant: this.participant,
|
|
131
137
|
participant: this.meeting.self,
|
|
132
138
|
});
|
|
133
|
-
}, autoPlay: true, muted: true, id: `screen-share-video-${this.participant.id}` })), index$1.h("div", { id: "controls", key: "controls" }, !this.hideFullScreenButton && !isSelf && fullScreen.isFullScreenSupported() && (index$1.h("rtk-tooltip", { key: '
|
|
139
|
+
}, autoPlay: true, muted: true, id: `screen-share-video-${this.participant.id}` })), index$1.h("div", { id: "controls", key: "controls" }, !this.hideFullScreenButton && !isSelf && fullScreen.isFullScreenSupported() && (index$1.h("rtk-tooltip", { key: 'bf9a96bcba99bb9cf13bbcf572e5a9b71d53498b', label: text }, index$1.h("rtk-button", { key: '06a5eb9396056114d9e1a339454e782b9c533a9b', id: "full-screen-btn", kind: "icon", onClick: this.toggleFullScreen, title: text }, index$1.h("rtk-icon", { key: 'fa4e499769a910ceb9b2bffa6668db83adbad135', icon: icon, "aria-hidden": true, tabIndex: -1 }))))), isSelf && (index$1.h("div", { id: "self-message", key: "self-message" }, index$1.h("h3", { key: '1650592e64dd44004a53ccc168ab7138c78ea7f4' }, this.t('screenshare.shared')), index$1.h("div", { key: 'd09216ab62012e1d2d445b8f080ae18786fc197e', class: "actions" }, this.meeting != null && (index$1.h("rtk-button", { key: 'f4e8c65eaaf40190eb566eb473d7932411731793', variant: "danger", onClick: () => {
|
|
134
140
|
this.meeting.self.disableScreenShare();
|
|
135
|
-
} }, index$1.h("rtk-icon", { key: '
|
|
141
|
+
} }, index$1.h("rtk-icon", { key: '215fd1e658442e6f9c70ee5f7cabcd22e0901886', icon: this.iconPack.share_screen_stop, slot: "start" }), this.t('screenshare.stop'))), this.meeting != null && (index$1.h("rtk-button", { key: 'a73b3774901661020ef20e9e48dc81a4277cc471', variant: "secondary", disabled: this.isSwitchingScreen, onClick: this.shareDifferentScreen }, index$1.h("rtk-icon", { key: 'f9a4304e8cb648f5f2ca6ee650f6b512e86f1833', icon: (_c = this.iconPack.share_screen_different) !== null && _c !== void 0 ? _c : this.iconPack.share_screen_start, slot: "start" }), this.t('screenshare.share_different_screen'))), index$1.h("rtk-button", { key: 'b2f93bd50018b9a727860014d0d4c33ab8a23334', variant: "secondary", id: "expand-btn", onClick: () => {
|
|
136
142
|
this.videoExpanded = !this.videoExpanded;
|
|
137
|
-
} }, index$1.h("rtk-icon", { key: '
|
|
143
|
+
} }, index$1.h("rtk-icon", { key: '40d5bb9a3dfc648035b946ced0c584b3a6312100', icon: this.videoExpanded
|
|
138
144
|
? this.iconPack.full_screen_minimize
|
|
139
145
|
: this.iconPack.full_screen_maximize, slot: "start" }), this.videoExpanded
|
|
140
146
|
? this.t('screenshare.min_preview')
|
|
141
|
-
: this.t('screenshare.max_preview'))))), index$1.h("slot", { key: '
|
|
147
|
+
: this.t('screenshare.max_preview'))))), index$1.h("slot", { key: 'a2908fef4320f0bf4408a6a07d2ba4bea0acdc4c' })));
|
|
142
148
|
}
|
|
143
149
|
get host() { return index$1.getElement(this); }
|
|
144
150
|
static get watchers() { return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Bi2L8zQ7.js');
|
|
4
4
|
require('./breakout-rooms-manager-CIrqMYfb.js');
|
|
5
|
-
var
|
|
5
|
+
var uiKitMetadata = require('./ui-kit-metadata-Cjs7_Xqr.js');
|
|
6
6
|
var uiStore = require('./ui-store-CrqwtYqt.js');
|
|
7
7
|
require('./livestream-B1z1fq_f.js');
|
|
8
8
|
var initError = require('./init-error-ByISl9tW.js');
|
|
@@ -108,7 +108,7 @@ const RtkUiProvider = class {
|
|
|
108
108
|
// Use peer specific store if available, otherwise fall back to global store
|
|
109
109
|
const targetStore = this.peerStore || uiStore.uiStore;
|
|
110
110
|
const newStates = Object.assign({}, targetStore.state.states);
|
|
111
|
-
targetStore.state.states =
|
|
111
|
+
targetStore.state.states = uiKitMetadata.merge(newStates, states);
|
|
112
112
|
// Emit unscoped event for backward compatibility
|
|
113
113
|
this.statesUpdate.emit(targetStore.state.states);
|
|
114
114
|
// Also emit a scoped event that only this meeting's components should listen to
|
|
@@ -152,13 +152,14 @@ const RtkUiProvider = class {
|
|
|
152
152
|
}
|
|
153
153
|
meetingChanged(meeting, oldMeeting) {
|
|
154
154
|
if (meeting) {
|
|
155
|
+
uiKitMetadata.reportUiKitMetadata(meeting);
|
|
155
156
|
this.peerStore = uiStore.createPeerStore({
|
|
156
157
|
meeting,
|
|
157
158
|
config: this.config,
|
|
158
159
|
iconPack: this.iconPack,
|
|
159
160
|
t: this.t,
|
|
160
161
|
providerId: this.providerId,
|
|
161
|
-
overrides:
|
|
162
|
+
overrides: uiKitMetadata.merge(Object.assign({}, uiStore.defaultOverrides), this.overrides),
|
|
162
163
|
});
|
|
163
164
|
// Notify components that peer specific store is now available
|
|
164
165
|
document.dispatchEvent(new CustomEvent('rtkPeerStoreReady', {
|
|
@@ -225,12 +226,12 @@ const RtkUiProvider = class {
|
|
|
225
226
|
if ((config === null || config === void 0 ? void 0 : config.designTokens) &&
|
|
226
227
|
typeof document !== 'undefined' &&
|
|
227
228
|
(this.peerStore || uiStore.uiStore).state.states.activeDebugger !== true) {
|
|
228
|
-
|
|
229
|
+
uiKitMetadata.provideRtkDesignSystem(document.documentElement, config.designTokens);
|
|
229
230
|
}
|
|
230
231
|
}
|
|
231
232
|
overridesChanged(overrides) {
|
|
232
233
|
if (this.peerStore) {
|
|
233
|
-
this.peerStore.state.overrides =
|
|
234
|
+
this.peerStore.state.overrides = uiKitMetadata.merge(Object.assign({}, uiStore.defaultOverrides), overrides);
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
237
|
render() {
|
|
@@ -938,6 +938,46 @@ var merge = createAssigner(function(object, source, srcIndex) {
|
|
|
938
938
|
baseMerge(object, source, srcIndex);
|
|
939
939
|
});
|
|
940
940
|
|
|
941
|
+
/**
|
|
942
|
+
* The literal below is replaced with the released package version by `prepublish.js`.
|
|
943
|
+
* Builds that are not published (local, dev) report it as is.
|
|
944
|
+
*/
|
|
945
|
+
const UI_KIT_VERSION = '2.2.0-staging.1';
|
|
946
|
+
/**
|
|
947
|
+
* The wrapper packages load components from the loader bundle, which carries its own copy of
|
|
948
|
+
* this module, separate from the copy behind the main entry. The registered symbol is the one
|
|
949
|
+
* slot both copies can see.
|
|
950
|
+
*/
|
|
951
|
+
const SDK_NAME_KEY = Symbol.for('rtk.uikit.sdkName');
|
|
952
|
+
const sdkNameSlot = globalThis;
|
|
953
|
+
/**
|
|
954
|
+
* Declares which UI Kit package is in use. Called by the React and Angular wrapper packages.
|
|
955
|
+
* @internal
|
|
956
|
+
*/
|
|
957
|
+
function setUiKitSdkName(name) {
|
|
958
|
+
sdkNameSlot[SDK_NAME_KEY] = name;
|
|
959
|
+
}
|
|
960
|
+
function getUiKitSdkName() {
|
|
961
|
+
var _a;
|
|
962
|
+
return (_a = sdkNameSlot[SDK_NAME_KEY]) !== null && _a !== void 0 ? _a : 'html';
|
|
963
|
+
}
|
|
964
|
+
/** Tells the core SDK which UI Kit package and version is driving the meeting. */
|
|
965
|
+
function reportUiKitMetadata(meeting) {
|
|
966
|
+
var _a, _b;
|
|
967
|
+
try {
|
|
968
|
+
// Older core SDK versions do not have this method
|
|
969
|
+
(_b = (_a = meeting === null || meeting === void 0 ? void 0 : meeting.__internals__) === null || _a === void 0 ? void 0 : _a.setUiKitMetadata) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
970
|
+
sdkVersion: UI_KIT_VERSION,
|
|
971
|
+
sdkName: getUiKitSdkName(),
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
catch (_c) {
|
|
975
|
+
// Reporting must never break the meeting
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
|
|
941
979
|
exports.isValidHexColor = isValidHexColor;
|
|
942
980
|
exports.merge = merge;
|
|
943
981
|
exports.provideRtkDesignSystem = provideRtkDesignSystem;
|
|
982
|
+
exports.reportUiKitMetadata = reportUiKitMetadata;
|
|
983
|
+
exports.setUiKitSdkName = setUiKitSdkName;
|
|
@@ -12,6 +12,7 @@ import { createPeerStore, uiStore as legacyGlobalUIStore, } from "../../utils/sy
|
|
|
12
12
|
import { defaultOverrides } from "../../lib/overrides";
|
|
13
13
|
import { getInitErrorInfo } from "../../utils/init-error";
|
|
14
14
|
import { getJoinErrorInfo } from "../../utils/join-error";
|
|
15
|
+
import { reportUiKitMetadata } from "../../utils/ui-kit-metadata";
|
|
15
16
|
/**
|
|
16
17
|
* A single component which renders an entire meeting UI.
|
|
17
18
|
*
|
|
@@ -179,6 +180,7 @@ export class RtkMeeting {
|
|
|
179
180
|
var _a, _b;
|
|
180
181
|
if (!meeting)
|
|
181
182
|
return;
|
|
183
|
+
reportUiKitMetadata(meeting);
|
|
182
184
|
// Create peer specific store for this meeting peer instance
|
|
183
185
|
if (meeting) {
|
|
184
186
|
this.peerStore = createPeerStore({
|
|
@@ -22,6 +22,19 @@ import { SyncWithStore } from "../../utils/sync-with-store";
|
|
|
22
22
|
*/
|
|
23
23
|
export class RtkScreenshareView {
|
|
24
24
|
constructor() {
|
|
25
|
+
this.screenShareListener = ({ screenShareEnabled, screenShareTracks, }) => {
|
|
26
|
+
const enabled = screenShareEnabled && screenShareTracks.video != null;
|
|
27
|
+
writeTask(() => {
|
|
28
|
+
this.screenShareEnabled = enabled;
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
this.onVideoRef = (el) => {
|
|
32
|
+
var _a;
|
|
33
|
+
if (el == null || el === this.videoEl)
|
|
34
|
+
return;
|
|
35
|
+
this.videoEl = el;
|
|
36
|
+
(_a = this.participant) === null || _a === void 0 ? void 0 : _a.registerScreenshareVideoElement(el);
|
|
37
|
+
};
|
|
25
38
|
this.fullScreenListener = () => {
|
|
26
39
|
this.isFullScreen = isFullScreenEnabled();
|
|
27
40
|
};
|
|
@@ -73,47 +86,40 @@ export class RtkScreenshareView {
|
|
|
73
86
|
connectedCallback() {
|
|
74
87
|
window === null || window === void 0 ? void 0 : window.addEventListener('fullscreenchange', this.fullScreenListener);
|
|
75
88
|
window === null || window === void 0 ? void 0 : window.addEventListener('webkitfullscreenchange', this.fullScreenListener);
|
|
76
|
-
}
|
|
77
|
-
componentDidLoad() {
|
|
78
89
|
this.participantChanged(this.participant);
|
|
79
90
|
}
|
|
80
91
|
disconnectedCallback() {
|
|
92
|
+
this.cleanupParticipant(this.participant);
|
|
93
|
+
window === null || window === void 0 ? void 0 : window.removeEventListener('fullscreenchange', this.fullScreenListener);
|
|
94
|
+
window === null || window === void 0 ? void 0 : window.removeEventListener('webkitfullscreenchange', this.fullScreenListener);
|
|
95
|
+
}
|
|
96
|
+
participantChanged(participant, oldParticipant) {
|
|
97
|
+
// The SDK ignores a video element that another participant still manages
|
|
98
|
+
this.cleanupParticipant(oldParticipant);
|
|
99
|
+
if (participant == null)
|
|
100
|
+
return;
|
|
101
|
+
// On first load the video element is registered once it renders, see onVideoRef
|
|
102
|
+
if (this.videoEl)
|
|
103
|
+
participant.registerScreenshareVideoElement(this.videoEl);
|
|
81
104
|
if (!this.meeting)
|
|
82
105
|
return;
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
|
|
106
|
+
this.screenShareListener(participant);
|
|
107
|
+
if (participant.id === this.meeting.self.id)
|
|
108
|
+
participant.addListener('screenShareUpdate', this.screenShareListener);
|
|
86
109
|
else
|
|
87
|
-
this.meeting.participants.joined.
|
|
88
|
-
window === null || window === void 0 ? void 0 : window.removeEventListener('fullscreenchange', this.fullScreenListener);
|
|
89
|
-
window === null || window === void 0 ? void 0 : window.removeEventListener('webkitfullscreenchange', this.fullScreenListener);
|
|
110
|
+
this.meeting.participants.joined.addListener('screenShareUpdate', this.participantScreenshareUpdate);
|
|
90
111
|
}
|
|
91
|
-
|
|
92
|
-
if (participant
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (this.videoEl != null) {
|
|
103
|
-
this.videoEl.srcObject = stream;
|
|
104
|
-
this.videoEl.play();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
else if (this.videoEl != null) {
|
|
108
|
-
this.videoEl.srcObject = undefined;
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
this.screenShareListener(participant);
|
|
112
|
-
if (participant.id === self.id)
|
|
113
|
-
participant.addListener('screenShareUpdate', this.screenShareListener);
|
|
114
|
-
else
|
|
115
|
-
this.meeting.participants.joined.addListener('screenShareUpdate', this.participantScreenshareUpdate);
|
|
116
|
-
}
|
|
112
|
+
cleanupParticipant(participant) {
|
|
113
|
+
if (participant == null)
|
|
114
|
+
return;
|
|
115
|
+
if (this.videoEl)
|
|
116
|
+
participant.deregisterScreenshareVideoElement(this.videoEl);
|
|
117
|
+
if (!this.meeting)
|
|
118
|
+
return;
|
|
119
|
+
if (participant.id === this.meeting.self.id)
|
|
120
|
+
participant.removeListener('screenShareUpdate', this.screenShareListener);
|
|
121
|
+
else
|
|
122
|
+
this.meeting.participants.joined.removeListener('screenShareUpdate', this.participantScreenshareUpdate);
|
|
117
123
|
}
|
|
118
124
|
render() {
|
|
119
125
|
var _a, _b, _c;
|
|
@@ -122,7 +128,7 @@ export class RtkScreenshareView {
|
|
|
122
128
|
const icon = this.isFullScreen
|
|
123
129
|
? this.iconPack.full_screen_minimize
|
|
124
130
|
: this.iconPack.full_screen_maximize;
|
|
125
|
-
return (h(Host, { key: '
|
|
131
|
+
return (h(Host, { key: '194efb9fa8783a441c8050ebab07a2d3546446bf', class: { isSelf } }, h("div", { key: "video-container", id: "video-container", class: { expand: this.videoExpanded } }, h("video", { key: 'de008c1a856ba19e766c03b71b1be492a9975261', ref: this.onVideoRef, class: {
|
|
126
132
|
visible: this.screenShareEnabled,
|
|
127
133
|
'fit-in-container': this.participant.supportsRemoteControl,
|
|
128
134
|
}, playsInline: true, onPlay: () => {
|
|
@@ -130,15 +136,15 @@ export class RtkScreenshareView {
|
|
|
130
136
|
screenshareParticipant: this.participant,
|
|
131
137
|
participant: this.meeting.self,
|
|
132
138
|
});
|
|
133
|
-
}, autoPlay: true, muted: true, id: `screen-share-video-${this.participant.id}` })), h("div", { id: "controls", key: "controls" }, !this.hideFullScreenButton && !isSelf && isFullScreenSupported() && (h("rtk-tooltip", { key: '
|
|
139
|
+
}, autoPlay: true, muted: true, id: `screen-share-video-${this.participant.id}` })), h("div", { id: "controls", key: "controls" }, !this.hideFullScreenButton && !isSelf && isFullScreenSupported() && (h("rtk-tooltip", { key: 'bf9a96bcba99bb9cf13bbcf572e5a9b71d53498b', label: text }, h("rtk-button", { key: '06a5eb9396056114d9e1a339454e782b9c533a9b', id: "full-screen-btn", kind: "icon", onClick: this.toggleFullScreen, title: text }, h("rtk-icon", { key: 'fa4e499769a910ceb9b2bffa6668db83adbad135', icon: icon, "aria-hidden": true, tabIndex: -1 }))))), isSelf && (h("div", { id: "self-message", key: "self-message" }, h("h3", { key: '1650592e64dd44004a53ccc168ab7138c78ea7f4' }, this.t('screenshare.shared')), h("div", { key: 'd09216ab62012e1d2d445b8f080ae18786fc197e', class: "actions" }, this.meeting != null && (h("rtk-button", { key: 'f4e8c65eaaf40190eb566eb473d7932411731793', variant: "danger", onClick: () => {
|
|
134
140
|
this.meeting.self.disableScreenShare();
|
|
135
|
-
} }, h("rtk-icon", { key: '
|
|
141
|
+
} }, h("rtk-icon", { key: '215fd1e658442e6f9c70ee5f7cabcd22e0901886', icon: this.iconPack.share_screen_stop, slot: "start" }), this.t('screenshare.stop'))), this.meeting != null && (h("rtk-button", { key: 'a73b3774901661020ef20e9e48dc81a4277cc471', variant: "secondary", disabled: this.isSwitchingScreen, onClick: this.shareDifferentScreen }, h("rtk-icon", { key: 'f9a4304e8cb648f5f2ca6ee650f6b512e86f1833', icon: (_c = this.iconPack.share_screen_different) !== null && _c !== void 0 ? _c : this.iconPack.share_screen_start, slot: "start" }), this.t('screenshare.share_different_screen'))), h("rtk-button", { key: 'b2f93bd50018b9a727860014d0d4c33ab8a23334', variant: "secondary", id: "expand-btn", onClick: () => {
|
|
136
142
|
this.videoExpanded = !this.videoExpanded;
|
|
137
|
-
} }, h("rtk-icon", { key: '
|
|
143
|
+
} }, h("rtk-icon", { key: '40d5bb9a3dfc648035b946ced0c584b3a6312100', icon: this.videoExpanded
|
|
138
144
|
? this.iconPack.full_screen_minimize
|
|
139
145
|
: this.iconPack.full_screen_maximize, slot: "start" }), this.videoExpanded
|
|
140
146
|
? this.t('screenshare.min_preview')
|
|
141
|
-
: this.t('screenshare.max_preview'))))), h("slot", { key: '
|
|
147
|
+
: this.t('screenshare.max_preview'))))), h("slot", { key: 'a2908fef4320f0bf4408a6a07d2ba4bea0acdc4c' })));
|
|
142
148
|
}
|
|
143
149
|
static get is() { return "rtk-screenshare-view"; }
|
|
144
150
|
static get encapsulation() { return "shadow"; }
|
|
@@ -4,6 +4,7 @@ import { uiStore as legacyGlobalUIStore, createPeerStore, } from "../../utils/sy
|
|
|
4
4
|
import deepMerge from "lodash-es/merge";
|
|
5
5
|
import { getInitErrorInfo } from "../../utils/init-error";
|
|
6
6
|
import { getJoinErrorInfo } from "../../utils/join-error";
|
|
7
|
+
import { reportUiKitMetadata } from "../../utils/ui-kit-metadata";
|
|
7
8
|
const LEAVE_ROOM_TIMER = 10000;
|
|
8
9
|
export class RtkUiProvider {
|
|
9
10
|
constructor() {
|
|
@@ -143,6 +144,7 @@ export class RtkUiProvider {
|
|
|
143
144
|
}
|
|
144
145
|
meetingChanged(meeting, oldMeeting) {
|
|
145
146
|
if (meeting) {
|
|
147
|
+
reportUiKitMetadata(meeting);
|
|
146
148
|
this.peerStore = createPeerStore({
|
|
147
149
|
meeting,
|
|
148
150
|
config: this.config,
|
|
@@ -4,6 +4,7 @@ export { BreakoutRoomsManager };
|
|
|
4
4
|
export { provideRtkDesignSystem } from './utils/provide-design-system';
|
|
5
5
|
export { extendConfig, generateConfig } from './utils/config';
|
|
6
6
|
export { sendNotification } from './utils/notification';
|
|
7
|
+
export { setUiKitSdkName } from './utils/ui-kit-metadata';
|
|
7
8
|
export { RtkUiBuilder } from './lib/builder';
|
|
8
9
|
export { uiStore, uiState, getInitialStates, createPeerStore, } from './utils/sync-with-store/ui-store';
|
|
9
10
|
// addons
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The literal below is replaced with the released package version by `prepublish.js`.
|
|
3
|
+
* Builds that are not published (local, dev) report it as is.
|
|
4
|
+
*/
|
|
5
|
+
const UI_KIT_VERSION = '2.2.0-staging.1';
|
|
6
|
+
/**
|
|
7
|
+
* The wrapper packages load components from the loader bundle, which carries its own copy of
|
|
8
|
+
* this module, separate from the copy behind the main entry. The registered symbol is the one
|
|
9
|
+
* slot both copies can see.
|
|
10
|
+
*/
|
|
11
|
+
const SDK_NAME_KEY = Symbol.for('rtk.uikit.sdkName');
|
|
12
|
+
const sdkNameSlot = globalThis;
|
|
13
|
+
/**
|
|
14
|
+
* Declares which UI Kit package is in use. Called by the React and Angular wrapper packages.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export function setUiKitSdkName(name) {
|
|
18
|
+
sdkNameSlot[SDK_NAME_KEY] = name;
|
|
19
|
+
}
|
|
20
|
+
export function getUiKitSdkName() {
|
|
21
|
+
var _a;
|
|
22
|
+
return (_a = sdkNameSlot[SDK_NAME_KEY]) !== null && _a !== void 0 ? _a : 'html';
|
|
23
|
+
}
|
|
24
|
+
/** Tells the core SDK which UI Kit package and version is driving the meeting. */
|
|
25
|
+
export function reportUiKitMetadata(meeting) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
try {
|
|
28
|
+
// Older core SDK versions do not have this method
|
|
29
|
+
(_b = (_a = meeting === null || meeting === void 0 ? void 0 : meeting.__internals__) === null || _a === void 0 ? void 0 : _a.setUiKitMetadata) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
30
|
+
sdkVersion: UI_KIT_VERSION,
|
|
31
|
+
sdkName: getUiKitSdkName(),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
catch (_c) {
|
|
35
|
+
// Reporting must never break the meeting
|
|
36
|
+
}
|
|
37
|
+
}
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-BBHQOrFK.js";export{B as BreakoutRoomsManager}from"./p-Rq_6y0HI.js";export{p as provideRtkDesignSystem}from"./p-
|
|
1
|
+
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-BBHQOrFK.js";export{B as BreakoutRoomsManager}from"./p-Rq_6y0HI.js";export{p as provideRtkDesignSystem,s as setUiKitSdkName}from"./p-CqIpJqLB.js";import{g as t}from"./p-CRh2Y0y5.js";export{e as extendConfig}from"./p-CRh2Y0y5.js";import{c as o}from"./p-D4GSX-co.js";export{b as createPeerStore,d as defaultConfig,e as defaultIconPack,h as defaultLanguage,f as defaultOverrides,g as getInitialStates,a as uiState,u as uiStore,i as useLanguage}from"./p-D4GSX-co.js";export{R as RtkNotificationsAudio}from"./p-B56IYWsZ.js";export{g as generateChatGroupKey,a as getChatGroups,c as getParticipantUserId,b as getUnreadChatCounts}from"./p-Bj1kNPpe.js";const n=(t,s)=>{if("undefined"==typeof document)return!1;const e=new CustomEvent("rtkNotification",{detail:Object.assign(Object.assign({},t),{playSound:s}),composed:!0});return document.dispatchEvent(e)};function l(t){return s=>Array.isArray(s)?s[0]===t:s===t}function m(t){return s=>Array.isArray(s)?s[0]!==t:s!==t}function y(t){return t.replace(/([a-z])([A-Z])/g,(t=>`${t[0]}-${t[1]}`.toLowerCase()))}class v{constructor(t,s,e){this.elem=t,this.config=s,this.keyString=e}add(t,s={}){var e;let r=t=y(t);return Object.keys(s).length>0&&(r=[t,s]),Array.isArray(this.elem)?this.elem.push(r):"children"in this.elem&&Array.isArray(this.elem.children)?this.elem.children=[...this.elem.children,r]:"remove"in this.elem&&Array.isArray(this.elem.remove)&&this.elem.remove.find(l(t))?this.elem.remove=this.elem.remove.filter(m(t)):("add"in this.elem||(this.elem.add=[]),null===(e=this.elem.add)||void 0===e||e.push(r)),this}remove(t){var s;if(t=y(t),Array.isArray(this.elem)){const s=this.elem.findIndex(l(t));s>-1&&this.elem.splice(s,1)}else"children"in this.elem&&Array.isArray(this.elem.children)?this.elem.children=this.elem.children.filter(m(t)):"add"in this.elem&&Array.isArray(this.elem.add)&&this.elem.add.find((s=>s===t))?this.elem.add=this.elem.add.filter(m(t)):("remove"in this.elem||(this.elem.remove=[]),null===(s=this.elem.remove)||void 0===s||s.push(t));return this}set style(t){console.log(t)}setChildrenProps(t,s){console.log(this.keyString,t,s)}getChildrenProps(t){return console.log(this.keyString,t),{}}replace(t){console.log(this.config,t)}}class j{constructor(t){this.config=t||o()}find(t,s={}){t=y(t);const e=[],r=[];Object.keys(s||{}).forEach((t=>{"boolean"==typeof s[t]?e.push(t):r.push([t,s[t]])})),e.sort();const i=this.config.root;if(void 0===i)return;let o=t,a="";e.length>0&&(a="."+e.join("."),o=`${t}${a}`,Array.isArray(i[t])&&(i[t]={states:[],children:i[t]}),void 0===i[t].states&&(i[t].states=[]),e.forEach((s=>{var e,r;-1===(null===(e=i[t].states)||void 0===e?void 0:e.indexOf(s))&&(null===(r=i[t].states)||void 0===r||r.push(s))}))),r.length>0&&r.forEach((s=>{o=`${t}[${s[0]}=${s[1]}]${a}`,Array.isArray(i[t])&&(i[t]={state:s[0],children:i[t]})}));let n=i[o];return void 0===n&&(i[o]={},n=i[o]),new v(n,this.config,o)}build(){return this.config}}function A(s,e,r){if(!r){const s=t(e.self.config,e);r=s.config}return s.map((t=>{r=t.register(r,e,(t=>new j(t)))})),r}export{j as RtkUiBuilder,o as createDefaultConfig,t as generateConfig,A as registerAddons,n as sendNotification}
|