Skip to content

Commit 19edba5

Browse files
committed
deploy: cd657c3
1 parent 27bed78 commit 19edba5

190 files changed

Lines changed: 618 additions & 364 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,16 +1573,75 @@ function RemoteFunctions(config = {}) {
15731573
});
15741574
}
15751575

1576+
// Modifier shortcuts forwarded to the Phoenix KeyBindingManager. Clipboard
1577+
// and undo/redo are excluded so form inputs in the previewed page keep
1578+
// working normally.
1579+
const _KEYS_NOT_FORWARDED = { c:1, v:1, x:1, a:1, z:1, y:1, C:1, V:1, X:1, A:1, Z:1, Y:1 };
1580+
1581+
// Forwarding only makes sense when the page runs as an embedded LP iframe
1582+
// inside Phoenix; if the user popped the preview out into a real browser
1583+
// tab, the synthetic events would go to a window with no Phoenix UI.
1584+
// Default false, flip to true via __PHOENIX_EMBED_INFO (per its contract:
1585+
// guaranteed to fire in embedded iframes, not guaranteed otherwise).
1586+
let _isPhoenixEmbeddedIframe = false;
1587+
if (window.__PHOENIX_EMBED_INFO && window.__PHOENIX_EMBED_INFO.onPhoenixEmbeddedInfoAvailable) {
1588+
window.__PHOENIX_EMBED_INFO.onPhoenixEmbeddedInfoAvailable(function (isEmbedded) {
1589+
_isPhoenixEmbeddedIframe = !!isEmbedded;
1590+
});
1591+
}
1592+
1593+
function _isFunctionKey(event) {
1594+
return event.key.length >= 2 && event.key[0] === 'F' && !isNaN(event.key.slice(1));
1595+
}
1596+
1597+
function _forwardKeyEventToPhoenix(event) {
1598+
event.preventDefault();
1599+
event.stopImmediatePropagation();
1600+
MessageBroker.send({
1601+
keyForward: true,
1602+
key: event.key,
1603+
code: event.code,
1604+
ctrlKey: event.ctrlKey,
1605+
metaKey: event.metaKey,
1606+
shiftKey: event.shiftKey,
1607+
altKey: event.altKey
1608+
});
1609+
}
1610+
15761611
document.addEventListener('keydown', function(event) {
15771612
if (config.mode === 'edit' && (event.key === 'Escape' || event.key === 'Esc')) {
15781613
event.preventDefault();
15791614
_handleEscapeKeyPress();
15801615
}
15811616
});
15821617

1618+
// Forwarder for design mode: runs as late as we can manage in the standard
1619+
// event flow — bubble phase on `window` (latest target after document),
1620+
// and the listener itself is registered on `load` so it goes last among
1621+
// same-target listeners. This gives the previewed page's own handlers the
1622+
// best chance to call preventDefault (which we then honor) before we
1623+
// forward to Phoenix.
1624+
function _designModeKeyForwarder(event) {
1625+
if (!_isPhoenixEmbeddedIframe || !config.designMode) {
1626+
return;
1627+
}
1628+
if (event.defaultPrevented) {
1629+
return;
1630+
}
1631+
if (_isFunctionKey(event)) {
1632+
_forwardKeyEventToPhoenix(event);
1633+
return;
1634+
}
1635+
const isMod = event.metaKey || event.ctrlKey;
1636+
if (isMod && event.key && event.key.length === 1 && !_KEYS_NOT_FORWARDED[event.key]) {
1637+
_forwardKeyEventToPhoenix(event);
1638+
}
1639+
}
1640+
15831641
// we need to refresh the config once the load is completed
15841642
// this is important because messageBroker gets ready for use only when load fires
15851643
window.addEventListener('load', function() {
1644+
window.addEventListener('keydown', _designModeKeyForwarder);
15861645
MessageBroker.send({
15871646
requestConfigRefresh: true
15881647
});

LiveDevelopment/MultiBrowserImpl/protocol/LiveDevProtocol.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LiveDevelopment/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

appConfig.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ window.AppConfig = {
3535
"app_update_url": "https://updates.phcode.io/tauri/update-latest-pre-release.json",
3636
"extensionTakedownURL": "https://updates.phcode.io/extension_takedown.json",
3737
"linting.enabled_by_default": true,
38-
"build_timestamp": "2026-04-29T02:05:57.697Z",
38+
"build_timestamp": "2026-04-29T12:49:04.136Z",
3939
"googleAnalyticsID": "G-FP5S9BKDSJ",
4040
"googleAnalyticsIDDesktop": "G-D5R1Y6PTS8",
4141
"mixPanelID": "a7e08ffd43c37767c29b13df1d2e6c62",
@@ -47,7 +47,7 @@ window.AppConfig = {
4747
"bugsnagEnv": "staging"
4848
},
4949
"name": "Phoenix Code",
50-
"version": "5.1.8-22848",
50+
"version": "5.1.8-22857",
5151
"apiVersion": "5.1.8",
5252
"homepage": "https://core.ai",
5353
"issues": {

assets/default-project/en.zip

0 Bytes
Binary file not shown.

assets/sample-projects/HTML5.zip

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

assets/sample-projects/explore.zip

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)