Skip to content

Commit 2aacb4c

Browse files
committed
minimal editor support
1 parent ced4f52 commit 2aacb4c

32 files changed

Lines changed: 1025 additions & 85 deletions

package-lock.json

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

src/addons/addons/ai-integration/helpers/helpers.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {postMessageToParent} from "../../../../lib/ct-parent-message";
12
import blockDefinitions from "./blockDefinitions.js";
23

34
export default class helpers {
@@ -178,7 +179,7 @@ export default class helpers {
178179
document.AI_INTEGRATION.popupOpen = false;
179180
});
180181
document.getElementById('addonsPage').addEventListener('click', () => {
181-
window.parent.postMessage({ type: "block-compiler-action", action: "addonsPage"}, "*");
182+
postMessageToParent({ type: "block-compiler-action", action: "addonsPage"});
182183
});
183184
}
184185
static generateExtensionDefinitions(runtime) {

src/addons/addons/collaboration/helpers/collaboration-ui.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {isCursorChatEnabled} from '../../../../lib/ct-url-flags.js';
12
import * as constants from './constants.js';
23
import * as presence from './presence.js';
34
import * as helper from './helper.js';
@@ -244,7 +245,8 @@ export function createOrUpdateRemoteCursor(clientID, state, layer, debugging = f
244245

245246
const user = state.user;
246247
const remoteCursorPos = state.cursor;
247-
const remoteChatMessage = state.chatMessage;
248+
// Chat bubbles from other people are not rendered when chat is turned off.
249+
const remoteChatMessage = isCursorChatEnabled() ? state.chatMessage : null;
248250

249251
let cursorData = cursorElements.get(clientID);
250252

@@ -460,6 +462,7 @@ function resetChatMessageTimeout() {
460462
}
461463

462464
export const handleGlobalKeyDown = (event) => {
465+
if (!isCursorChatEnabled()) return;
463466
if (!constants.mutableRefs.yjsAwarenessInstance || !constants.mutableRefs.BlocklyInstance || !constants.mutableRefs.localChatElementsRef?.group || !constants.mutableRefs.currentWorkspaceSvg) return;
464467

465468
const activeElement = document.activeElement;

0 commit comments

Comments
 (0)