Skip to content

Commit 293b9bb

Browse files
authored
Merge branch 'develop' into add_js_languages_docs
2 parents 2148b87 + 1e168fe commit 293b9bb

23 files changed

Lines changed: 13823 additions & 90 deletions

.github/workflows/CI-build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
node-version: [18.x]
10+
node-version: [24.x]
1111
env:
12-
NODE_OPTIONS: '--max_old_space_size=4096'
12+
NODE_OPTIONS: "--max_old_space_size=4096"
1313
steps:
1414
- name: Checkout code
1515
uses: actions/checkout@v4
@@ -18,8 +18,8 @@ jobs:
1818
uses: actions/setup-node@v4
1919
with:
2020
node-version: ${{ matrix.node-version }}
21-
cache: 'npm'
22-
cache-dependency-path: '**/package-lock.json'
21+
cache: "npm"
22+
cache-dependency-path: "**/package-lock.json"
2323

2424
- name: Install dependencies
2525
run: npm ci

.github/workflows/CI-e2e.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
node-version: [18.x]
11+
node-version: [24.x]
1212
test: [1, 2, 3, 4, 5]
1313
env:
14-
NODE_OPTIONS: '--max_old_space_size=4096'
14+
NODE_OPTIONS: "--max_old_space_size=4096"
1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
@@ -20,8 +20,8 @@ jobs:
2020
uses: actions/setup-node@v4
2121
with:
2222
node-version: ${{ matrix.node-version }}
23-
cache: 'npm'
24-
cache-dependency-path: '**/package-lock.json'
23+
cache: "npm"
24+
cache-dependency-path: "**/package-lock.json"
2525

2626
- name: Install dependencies
2727
run: npm ci

.github/workflows/deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ on:
77
- main
88

99
env:
10-
NODE_VERSION: 18.x
10+
NODE_VERSION: 24.x
1111

1212
jobs:
1313
deploy:
1414
runs-on: ubuntu-latest
1515
env:
16-
NODE_OPTIONS: '--max_old_space_size=4096'
16+
NODE_OPTIONS: "--max_old_space_size=4096"
1717
steps:
1818
- name: Generate Github Token for CI Bot
1919
uses: actions/create-github-app-token@v1
@@ -31,8 +31,8 @@ jobs:
3131
uses: actions/setup-node@v4
3232
with:
3333
node-version: ${{ env.NODE_VERSION }}
34-
cache: 'npm'
35-
cache-dependency-path: '**/package-lock.json'
34+
cache: "npm"
35+
cache-dependency-path: "**/package-lock.json"
3636

3737
- name: Install dependencies
3838
run: npm ci

.github/workflows/i18n-update-pull.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
env:
88
LOKALISE_PROJECT_ID: ${{ vars.LOKALISE_PROJECT_ID }}
99
LOKALISE_API_TOKEN: ${{ secrets.LOKALISE_API_TOKEN }}
10-
NODE_VERSION: 18.x
10+
NODE_VERSION: 24.x
1111
CI: true
1212

1313
jobs:
@@ -91,8 +91,8 @@ jobs:
9191
uses: actions/setup-node@v4
9292
with:
9393
node-version: ${{ env.NODE_VERSION }}
94-
cache: 'npm'
95-
cache-dependency-path: '**/package-lock.json'
94+
cache: "npm"
95+
cache-dependency-path: "**/package-lock.json"
9696

9797
- name: Install dependencies
9898
run: npm ci

.github/workflows/i18n-update-push.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
env:
88
LOKALISE_PROJECT_ID: ${{ vars.LOKALISE_PROJECT_ID }}
99
LOKALISE_API_TOKEN: ${{ secrets.LOKALISE_API_TOKEN }}
10-
NODE_VERSION: 18.x
10+
NODE_VERSION: 24.x
1111
CI: true
1212

1313
jobs:
@@ -91,8 +91,8 @@ jobs:
9191
uses: actions/setup-node@v4
9292
with:
9393
node-version: ${{ env.NODE_VERSION }}
94-
cache: 'npm'
95-
cache-dependency-path: '**/package-lock.json'
94+
cache: "npm"
95+
cache-dependency-path: "**/package-lock.json"
9696

9797
- name: Install dependencies
9898
run: npm ci
@@ -136,7 +136,7 @@ jobs:
136136
| **New Branch for i18n** | [\`${process.env.NEW_BRANCH}\`](${branchURL}) |
137137
| **Last Commit SHA** | ${process.env.LAST_COMMIT_SHA} |
138138
139-
Maintainers can comment \`.i18n-update-pull\` after translation is done to trigger the i18n pull workflow and pull the changes back to Github.
139+
Maintainers can comment \`.i18n-update-pull\` after translation is done to trigger the i18n pull workflow and pull the changes back to Github.
140140
`;
141141
142142
github.rest.issues.createComment({

.github/workflows/i18n-update-scheduled.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: i18n-update-scheduled
55

66
on:
77
schedule:
8-
- cron: '0 0 * * 0'
8+
- cron: "0 0 * * 0"
99
push:
1010
branches:
1111
- develop
@@ -16,7 +16,7 @@ env:
1616
LOKALISE_API_TOKEN: ${{ secrets.LOKALISE_API_TOKEN }}
1717
BRANCH: i18n/develop
1818
LOKALISE_BRANCH: master
19-
NODE_VERSION: 18.x
19+
NODE_VERSION: 24.x
2020
CI: true
2121

2222
jobs:
@@ -55,8 +55,8 @@ jobs:
5555
uses: actions/setup-node@v4
5656
with:
5757
node-version: ${{ env.NODE_VERSION }}
58-
cache: 'npm'
59-
cache-dependency-path: '**/package-lock.json'
58+
cache: "npm"
59+
cache-dependency-path: "**/package-lock.json"
6060

6161
- name: Install dependencies
6262
run: npm ci

.github/workflows/release.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ on:
66
- develop
77
types: [closed]
88

9+
permissions:
10+
id-token: write # Required for OIDC
11+
contents: write
12+
913
env:
10-
NODE_VERSION: 18.x
14+
NODE_VERSION: 24.x
1115

1216
jobs:
1317
release:
1418
runs-on: ubuntu-latest
1519
if: github.event.pull_request.merged && startsWith(github.head_ref, 'releases/')
1620
env:
17-
NODE_OPTIONS: '--max_old_space_size=4096'
21+
NODE_OPTIONS: "--max_old_space_size=4096"
1822
steps:
1923
- name: Generate Github Token for CI Bot
2024
uses: actions/create-github-app-token@v1
@@ -36,8 +40,12 @@ jobs:
3640
uses: actions/setup-node@v4
3741
with:
3842
node-version: ${{ env.NODE_VERSION }}
39-
cache: 'npm'
40-
cache-dependency-path: '**/package-lock.json'
43+
cache: "npm"
44+
cache-dependency-path: "**/package-lock.json"
45+
46+
# Ensure npm 11.5.1 or later is installed (for OIDC)
47+
- name: Update npm
48+
run: npm install -g npm@11.6.4
4149

4250
- name: Install dependencies
4351
run: npm ci
@@ -91,12 +99,8 @@ jobs:
9199

92100
- name: Publish SDK to NPM
93101
if: startsWith(github.head_ref, 'releases/sdk-v')
94-
run: |
95-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
96-
npm publish --access=public
97102
working-directory: ./build/sdk
98-
env:
99-
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
103+
run: npm publish --access=public
100104

101105
- name: Create pull request to main (App)
102106
if: startsWith(github.head_ref, 'releases/v')

src/livecodes/core.ts

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2857,8 +2857,9 @@ const handleCommandMenu = async () => {
28572857
let anotherShortcut = false;
28582858
const onHotkey = async (e: KeyboardEvent) => {
28592859
// Ctrl+K opens the command menu
2860+
// do not open the menu if shortcut is Ctrl+Shift+K
28602861
// wait for 500ms to allow other shortcuts like Ctrl+K Ctrl+0
2861-
if (!ctrl(e)) {
2862+
if (!ctrl(e) || e.shiftKey || e.altKey) {
28622863
anotherShortcut = false;
28632864
return;
28642865
}
@@ -3130,45 +3131,40 @@ const registerMenuButton = (menu: HTMLElement, button: HTMLElement) => {
31303131
};
31313132

31323133
const handleAppMenuProject = () => {
3133-
const menuProjectContainer = UI.getAppMenuProjectScroller();
3134-
const menuProjectButton = UI.getAppMenuProjectButton();
3135-
if (!menuProjectContainer || !menuProjectButton) return;
3136-
3137-
const html = isMac()
3138-
? menuProjectHTML.replace(/<kbd>Ctrl<\/kbd>/g, '<kbd>⌘</kbd>')
3139-
: menuProjectHTML;
3140-
menuProjectContainer.innerHTML = html;
3141-
translateElement(menuProjectContainer);
3142-
// adjustFontSize(menuProjectContainer);
3143-
registerMenuButton(menuProjectContainer, menuProjectButton);
3134+
setupAppMenu(UI.getAppMenuProjectScroller(), UI.getAppMenuProjectButton(), menuProjectHTML);
31443135
};
31453136

31463137
const handleAppMenuSettings = () => {
3147-
const menuSettingsContainer = UI.getAppMenuSettingsScroller();
3148-
const menuSettingsButton = UI.getAppMenuSettingsButton();
3149-
if (!menuSettingsContainer || !menuSettingsButton) return;
3150-
3151-
const html = isMac()
3152-
? menuSettingsHTML.replace(/<kbd>Ctrl<\/kbd>/g, '<kbd>⌘</kbd>')
3153-
: menuSettingsHTML;
3154-
menuSettingsContainer.innerHTML = html;
3155-
3156-
translateElement(menuSettingsContainer);
3157-
adjustFontSize(menuSettingsContainer);
3158-
registerMenuButton(menuSettingsContainer, menuSettingsButton);
3138+
setupAppMenu(
3139+
UI.getAppMenuSettingsScroller(),
3140+
UI.getAppMenuSettingsButton(),
3141+
menuSettingsHTML,
3142+
true,
3143+
);
31593144
};
31603145

31613146
const handleAppMenuHelp = () => {
3162-
const menuHelpContainer = UI.getAppMenuHelpScroller();
3163-
const menuHelpButton = UI.getAppMenuHelpButton();
3164-
if (!menuHelpContainer || !menuHelpButton) return;
3147+
setupAppMenu(UI.getAppMenuHelpScroller(), UI.getAppMenuHelpButton(), menuHelpHTML);
3148+
};
3149+
3150+
const setupAppMenu = (
3151+
container: HTMLElement | null,
3152+
button: HTMLElement | null,
3153+
menuHTML: string,
3154+
shouldAdjustFontSize = false,
3155+
) => {
3156+
if (!container || !button) return;
3157+
3158+
const html = isMac() ? menuHTML.replaceAll('<kbd>Ctrl</kbd>', '<kbd>⌘</kbd>') : menuHTML;
3159+
3160+
container.innerHTML = html;
3161+
translateElement(container);
31653162

3166-
const html = isMac() ? menuHelpHTML.replace(/<kbd>Ctrl<\/kbd>/g, '<kbd>⌘</kbd>') : menuHelpHTML;
3167-
menuHelpContainer.innerHTML = html;
3168-
menuHelpContainer.classList.add('hidden');
3169-
translateElement(menuHelpContainer);
3170-
// adjustFontSize(menuHelpContainer);
3171-
registerMenuButton(menuHelpContainer, menuHelpButton);
3163+
if (shouldAdjustFontSize) {
3164+
adjustFontSize(container);
3165+
}
3166+
3167+
registerMenuButton(container, button);
31723168
};
31733169

31743170
/**
@@ -4807,14 +4803,23 @@ const handleResultLoading = () => {
48074803
eventsManager.addEventListener(window, 'message', showResultModeDrawer);
48084804
};
48094805

4806+
const createToolButton = (id: string, title: string, innerHTML: string) => {
4807+
const btn = document.createElement('div');
4808+
btn.id = id;
4809+
btn.classList.add('tool-buttons');
4810+
btn.title = title;
4811+
btn.style.pointerEvents = 'all'; // override setting to 'none' on toolspane bar
4812+
btn.innerHTML = innerHTML;
4813+
UI.getToolspaneTitles()?.appendChild(btn);
4814+
return btn;
4815+
};
4816+
48104817
const handleResultPopup = () => {
4811-
const popupBtn = document.createElement('div');
4812-
popupBtn.id = 'result-popup-btn';
4813-
popupBtn.classList.add('tool-buttons');
4814-
popupBtn.title = window.deps.translateString('core.result.hint', 'Show result in new window');
4815-
popupBtn.style.pointerEvents = 'all'; // override setting to 'none' on toolspane bar
4816-
const iconCSS = '<i class="icon-window-new"></i>';
4817-
popupBtn.innerHTML = `<button id="show-result">${iconCSS}</button>`;
4818+
const popupBtn = createToolButton(
4819+
'result-popup-btn',
4820+
window.deps.translateString('core.result.hint', 'Show result in new window'),
4821+
`<button id="show-result"><i class="icon-window-new"></i></button>`,
4822+
);
48184823
let url: string | undefined;
48194824
const openWindow = async () => {
48204825
if (resultPopup && !resultPopup.closed) {
@@ -4847,17 +4852,14 @@ const handleResultPopup = () => {
48474852
};
48484853

48494854
const handleResultZoom = () => {
4850-
const zoomBtn = document.createElement('div');
4851-
zoomBtn.id = 'zoom-button';
4852-
zoomBtn.classList.add('tool-buttons');
4853-
zoomBtn.title = window.deps.translateString('core.zoom.hint', 'Zoom') + ' (Ctrl/Cmd + Alt + Z)';
4854-
zoomBtn.style.pointerEvents = 'all'; // override setting to 'none' on toolspane bar
4855-
zoomBtn.innerHTML = `
4856-
<button class="text">
4857-
<span id="zoom-value">${String(Number(getConfig().zoom))}</span>
4858-
&times;
4859-
</button>`;
4860-
4855+
const zoomBtn = createToolButton(
4856+
'zoom-button',
4857+
window.deps.translateString('core.zoom.hint', 'Zoom') + ' (Ctrl/Cmd + Alt + Z)',
4858+
`<button class="text">
4859+
<span id="zoom-value">${String(Number(getConfig().zoom))}</span>
4860+
&times;
4861+
</button>`,
4862+
);
48614863
const toggleZoom = () => {
48624864
const config = getConfig();
48634865
const currentZoom = config.zoom;
@@ -4875,13 +4877,11 @@ const handleResultZoom = () => {
48754877
};
48764878

48774879
const handleBroadcastStatus = () => {
4878-
const broadcastStatusBtn = document.createElement('div');
4879-
broadcastStatusBtn.id = 'broadcast-status-btn';
4880-
broadcastStatusBtn.classList.add('tool-buttons');
4881-
broadcastStatusBtn.title = window.deps.translateString('core.broadcast.heading', 'Broadcast');
4882-
broadcastStatusBtn.style.pointerEvents = 'all'; // override setting to 'none' on toolspane bar
4883-
const iconCSS = '<i class="icon-broadcast"></i>';
4884-
broadcastStatusBtn.innerHTML = `<button id="broadcast-status">${iconCSS}<span class="mark"></span></button>`;
4880+
const broadcastStatusBtn = createToolButton(
4881+
'broadcast-status-btn',
4882+
window.deps.translateString('core.broadcast.heading', 'Broadcast'),
4883+
`<button id="broadcast-status"><i class="icon-broadcast"></i><span class="mark"></span></button>`,
4884+
);
48854885

48864886
const showBroadcast = () => {
48874887
showScreen('broadcast');

src/livecodes/i18n/app-languages.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ import type { AppLanguage } from '../models';
22

33
export const appLanguages: { [key in Exclude<AppLanguage, 'auto'>]: string } = {
44
ar: 'العربية',
5+
bn: 'বাংলা',
56
de: 'Deutsch',
67
en: 'English',
78
es: 'Español',
89
fa: 'فارسی',
910
fr: 'Français',
1011
hi: 'हिंदी',
12+
id: 'Bahasa Indonesia',
1113
it: 'Italiano',
1214
ja: '日本語',
15+
nl: 'Nederlands',
1316
pt: 'Português',
1417
ru: 'Ру́сский',
1518
tr: 'Türkçe',

0 commit comments

Comments
 (0)