update remove velxio featur

master
a2nr 2026-04-15 21:07:39 +07:00
parent 65c12bc716
commit 405b6d8a6d
3 changed files with 14 additions and 5 deletions

View File

@ -94,7 +94,7 @@ export class VelxioBridge {
} }
} }
setEmbedMode(options: { hideEditor?: boolean; hideAuth?: boolean; hideComponentPicker?: boolean }) { setEmbedMode(options: { hideEditor?: boolean; hideAuth?: boolean; hideComponentPicker?: boolean; lockComponents?: boolean }) {
this.send('elemes:set_embed_mode', options); this.send('elemes:set_embed_mode', options);
} }

View File

@ -541,7 +541,11 @@
velxioBridge = new VelxioBridge(iframe); velxioBridge = new VelxioBridge(iframe);
velxioReady = true; velxioReady = true;
if (!data) return; if (!data) return;
velxioBridge.setEmbedMode({ hideAuth: true, hideComponentPicker: true }); velxioBridge.setEmbedMode({
hideAuth: true,
hideComponentPicker: true,
lockComponents: true
});
// Priority: Restore from localStorage if available, otherwise use data from backend // Priority: Restore from localStorage if available, otherwise use data from backend
const savedCircuit = localStorage.getItem(arduinoCircuitKey); const savedCircuit = localStorage.getItem(arduinoCircuitKey);
@ -582,7 +586,12 @@
velxioReady = true; velxioReady = true;
if (data) { if (data) {
win.postMessage({ type: 'elemes:set_embed_mode', hideAuth: true, hideComponentPicker: true }, '*'); win.postMessage({
type: 'elemes:set_embed_mode',
hideAuth: true,
hideComponentPicker: true,
lockComponents: true
}, '*');
const savedCircuit = localStorage.getItem(arduinoCircuitKey); const savedCircuit = localStorage.getItem(arduinoCircuitKey);
const savedCode = localStorage.getItem(arduinoCodeKey); const savedCode = localStorage.getItem(arduinoCodeKey);
@ -932,7 +941,7 @@
<!-- svelte-ignore a11y_missing_attribute --> <!-- svelte-ignore a11y_missing_attribute -->
<iframe <iframe
class="velxio-iframe" class="velxio-iframe"
src="/velxio/editor?embed=true{hasArduinoCode ? '' : '&hideEditor=true'}" src="/velxio/editor?embed=true{hasArduinoCode ? '' : '&hideEditor=true'}&lockComponents=true"
onload={(e) => initVelxioBridge(e.currentTarget as HTMLIFrameElement)} onload={(e) => initVelxioBridge(e.currentTarget as HTMLIFrameElement)}
allow="cross-origin-isolated" allow="cross-origin-isolated"
></iframe> ></iframe>

2
velxio

@ -1 +1 @@
Subproject commit eb7f87dfbca01b1cbcd7ee05fdf90c10f10ad0fb Subproject commit 87be2526bab379258593086587dd64bf02965436