Skip to content

Commit aa4ecf1

Browse files
committed
deploy: 84352e3
1 parent b6c8a66 commit aa4ecf1

File tree

615 files changed

+175464
-270268
lines changed

Some content is hidden

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

615 files changed

+175464
-270268
lines changed

LiveDevelopment/BrowserScripts/LivePreviewTransportRemote.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -304,17 +304,19 @@
304304
// an iframe(except for the intel mac bug)
305305
// in normal browsers, we dont need to do this and the borwser will do its thing.
306306
const href = getAbsoluteUrl(targetElement.getAttribute('href'));
307-
window.parent.postMessage({
308-
handlerName: "ph-liveServer",
309-
eventName: 'embeddedIframeHrefClick',
310-
href: href
311-
}, "*");
312-
// in intel mac desktop, tauri seems to open in browser
313-
// causing 2 tabs to open. in m1 macs its not there. so we prevent default behavior.
314-
event.stopImmediatePropagation();
315-
event.preventDefault();
307+
if (!event.defaultPrevented) {
308+
window.parent.postMessage({
309+
handlerName: "ph-liveServer",
310+
eventName: 'embeddedIframeHrefClick',
311+
href: href
312+
}, "*");
313+
// in intel mac desktop, tauri seems to open in browser
314+
// causing 2 tabs to open. in m1 macs its not there. so we prevent default behavior.
315+
event.stopImmediatePropagation();
316+
event.preventDefault();
317+
}
316318
}
317-
}, true);
319+
});
318320
document.addEventListener('contextmenu', function(event) {
319321
(document.activeElement || document.body).focus();
320322
});

LiveDevelopment/LiveDevMultiBrowser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ define(function (require, exports, module) {
588588

589589
// reload the page if the given document is a JS file related
590590
// to the current live document.
591-
if (_liveDocument.isRelated(absolutePath)) {
591+
if (_liveDocument.isRelated && _liveDocument.isRelated(absolutePath)) {
592592
if (doc.getLanguage().getId() === "javascript") {
593593
_setStatus(STATUS_RELOADING);
594594
_protocol.reload();
@@ -610,7 +610,7 @@ define(function (require, exports, module) {
610610

611611
var absolutePath = doc.file.fullPath;
612612

613-
if (_liveDocument.isRelated(absolutePath)) {
613+
if (_liveDocument.isRelated && _liveDocument.isRelated(absolutePath)) {
614614
// Set status to out of sync if dirty. Otherwise, set it to active status.
615615
_setStatus(_docIsOutOfSync(doc) ? STATUS_OUT_OF_SYNC : STATUS_ACTIVE);
616616
}

appConfig.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ window.AppConfig = {
2626
"app_notification_url": "assets/notifications/dev/",
2727
"app_update_url": "https://updates.phcode.io/tauri/update-latest-experimental-build.json",
2828
"linting.enabled_by_default": true,
29-
"build_timestamp": "2024-11-27T05:00:28.165Z",
29+
"build_timestamp": "2025-01-31T11:08:03.427Z",
3030
"googleAnalyticsID": "G-P4HJFPDB76",
3131
"googleAnalyticsIDDesktop": "G-VE5BXWJ0HF",
3232
"mixPanelID": "49c4d164b592be2350fc7af06a259bf3",
@@ -38,8 +38,8 @@ window.AppConfig = {
3838
"bugsnagEnv": "development"
3939
},
4040
"name": "Phoenix Code",
41-
"version": "3.10.1-20683",
42-
"apiVersion": "3.10.1",
41+
"version": "4.0.4-20879",
42+
"apiVersion": "4.0.4",
4343
"homepage": "https://core.ai",
4444
"issues": {
4545
"url": "https://github.com/phcode-dev/phoenix/issues"

assets/default-project/en.zip

421 Bytes
Binary file not shown.

assets/default-project/en/Newly_added_features.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,38 @@ We are continuously adding features every week to improve the life of web develo
77

88
Here's a list of top features recently added to Phoenix:
99

10+
<h2><a target="_blank" href="https://docs.phcode.dev/docs/Features/git">Git for Desktop</a></h2>
11+
12+
`Added on January, 2025`
13+
14+
Git is finally here. Integrated Git source control with a clean, intuitive interface.
15+
Stage changes, commit, and sync with a single click while keeping your focus on the code.
16+
Now available in the Windows, Mac and Linux desktop apps of Phoenix code.
17+
18+
19+
![Image](https://github.com/user-attachments/assets/aeacc7c0-3ee3-4a80-9b05-f2b48140bcdd)
20+
21+
![Image](https://github.com/user-attachments/assets/6e7b9faf-d57b-448b-a5bb-a111c67489b5)
22+
23+
24+
<h2><a target="_blank" href="https://docs.phcode.dev/docs/editing-colors#color-preview">Color Previews</a></h2>
25+
26+
`Added on December, 2024`
27+
28+
Preview the color(s) used in the file in the gutter area. Hovering over a color box highlights the corresponding color
29+
text in the editor to quickly jump to editing that color.
30+
31+
![image](https://github.com/user-attachments/assets/bedecc32-761b-448e-aced-61828ad3fec6)
32+
33+
## Open in Terminal and File Explorer
34+
35+
`Added on December, 2024`
36+
37+
New "Open In" feature lets you instantly open directories and files in the system Terminal or File Explorer across
38+
Windows, macOS, and Linux desktop apps!
39+
40+
![Image](https://github.com/user-attachments/assets/710330ae-8b34-4a51-a1f9-4c02736ed9bd)
41+
1042
<h2><a target="_blank" href="https://docs.phcode.dev/docs/editing-text#line-height">Customizable Editor Line Height</a></h2>
1143

1244
`Added on November, 2024`
@@ -98,7 +130,7 @@ CSS files and inline CSS styles/class names in HTML files. This provides an inst
98130

99131
![classLiveHints](https://github.com/phcode-dev/phoenix/assets/5336369/502c8751-5269-4c34-9178-5ad08f8ad837)
100132

101-
<h2><a target="_blank" href="https://docs.phcode.dev/docs/Features/live-preview-settings/">Custom Live Preview Servers</a></h2>
133+
<h2><a target="_blank" href="https://docs.phcode.dev/docs/Features/Live%20Preview/live-preview-settings">Custom Live Preview Servers</a></h2>
102134

103135
`Added on April, 2024`
104136

assets/default-project/en/index.html

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
4+
<meta charset="utf-8" />
45
<title>Phoenix editor</title>
56
<link rel="stylesheet" href="styles.css" />
67
<script src="script.js"></script>
@@ -16,31 +17,23 @@ <h1>Phoenix Code</h1>
1617
</div>
1718
<div class="video-container">
1819
<a
19-
href="https://www.youtube.com/watch?feature=player_embedded&v=Jkg3nAZ6vF8"
20-
target="_blank"
21-
title="Phoenix YouTube Channel">
20+
href="https://www.youtube.com/watch?feature=player_embedded&v=Jkg3nAZ6vF8"
21+
target="_blank"
22+
title="Phoenix YouTube Channel">
2223
<img
23-
src="images/youtube_video.png"
24-
alt="Phoenix Code on YouTube"
25-
title="Phoenix Code on YouTube"
26-
style="max-width: 320px;" />
24+
src="images/youtube_video.png"
25+
alt="Phoenix Code on YouTube"
26+
title="Phoenix Code on YouTube"
27+
style="max-width: 320px" />
2728
</a>
2829
<svg class="play-button" viewBox="0 0 200 200" alt="Play video">
29-
<circle
30-
cx="100"
31-
cy="100"
32-
r="90"
33-
fill="#333"
34-
fill-opacity="0.6" />
30+
<circle cx="100" cy="100" r="90" fill="#333" fill-opacity="0.6" />
3531
<polygon points="70, 55 70, 145 145, 100" fill="white" />
3632
</svg>
3733
</div>
3834
</div>
3935
<img id="cloudLeftTop" alt="cloud" src="images/vector-top-left.png" />
40-
<img
41-
id="cloudBottomRight"
42-
alt="cloud"
43-
src="images/vector-bottom-right.png" />
36+
<img id="cloudBottomRight" alt="cloud" src="images/vector-bottom-right.png" />
4437
<img id="starsRight" alt="stars" src="images/stars-right.svg" />
4538
<img
4639
class="clouds"

assets/default-project/en/script.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ function onPageLoaded() {
33
console.log("page loaded");
44
}
55

6-
document.addEventListener('DOMContentLoaded', function() {
6+
document.addEventListener("DOMContentLoaded", function () {
77
// Listen for clicks on elements with the class 'play-button'
8-
document.querySelectorAll('.play-button').forEach(function(button) {
9-
button.addEventListener('click', function() {
8+
document.querySelectorAll(".play-button").forEach(function (button) {
9+
button.addEventListener("click", function () {
1010
// When a play button is clicked, simulate a click on the <a> tag within the same .video-container
11-
this.parentNode.querySelector('a').click();
11+
this.parentNode.querySelector("a").click();
1212
});
1313
});
1414
});

assets/new-project/assets/css/style.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,12 @@ img {
909909
margin-bottom: 30px;
910910
}
911911

912+
.project-bottom {
913+
border-top: 3px solid rgba(255, 255, 255, 0.1);
914+
padding-top: 20px;
915+
margin-top: auto;
916+
}
917+
912918
.new-project-content {
913919
overflow-y: auto;
914920
}
@@ -1114,14 +1120,21 @@ img {
11141120
top: 0;
11151121
left: 0;
11161122
background: #fd7e14;
1117-
color: white;
1123+
color: black;
11181124
padding: 5px;
11191125
border-radius: 4px;
11201126
opacity: 0;
11211127
font-size: 13px;
11221128
font-weight: 500;
1129+
max-width: 300px;
11231130
font-style: normal;
11241131
font-stretch: normal;
1132+
a {
1133+
color: #333;
1134+
}
1135+
a:hover {
1136+
color: white;
1137+
}
11251138
}
11261139
.notification-ui-hidden {
11271140
opacity: 0;

assets/new-project/assets/js/code-editor.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function _showFirstTimeExperience() {
121121
createNotificationFromTemplate(Strings.DEFAULT_PROJECT_NOTIFICATION,
122122
"defaultProjectButton", {
123123
allowedPlacements: ["left", "right"],
124-
autoCloseTimeS: 15,
124+
autoCloseTimeS: 600,
125125
dismissOnClick: true
126126
});
127127
PhStore.setItem('notification.defaultProject.Shown', 'true');
@@ -204,10 +204,6 @@ function initCodeEditor() {
204204
_openURLInTauri(document.getElementById(iconID).getAttribute('href'));
205205
};
206206
}
207-
if(window.top.__TAURI__) {
208-
// in desktop, we don't show github project option till we have git extension integrated.
209-
document.getElementById("newGitHubProject").classList.add("forced-hidden");
210-
}
211207
document.getElementById("newGitHubProject").onclick = function() {
212208
Metrics.countEvent(Metrics.EVENT_TYPE.NEW_PROJECT, "main.Click", "github-project");
213209
window.location.href = 'new-project-github.html';
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/*
2+
* GNU AGPL-3.0 License
3+
*
4+
* Copyright (c) 2021 - present core.ai . All rights reserved.
5+
*
6+
* This program is free software: you can redistribute it and/or modify it
7+
* under the terms of the GNU Affero General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
14+
* for more details.
15+
*
16+
* You should have received a copy of the GNU Affero General Public License
17+
* along with this program. If not, see https://opensource.org/licenses/AGPL-3.0.
18+
*
19+
*/
20+
21+
/*global newProjectExtension, Strings, Metrics*/
22+
/*eslint no-console: 0*/
23+
/*eslint strict: ["error", "global"]*/
24+
/* jshint ignore:start */
25+
26+
function desktopInit() {
27+
const LAST_GIT_CLONE_BASE_DIR = "PH_LAST_GIT_CLONE_BASE_DIR";
28+
let createProjectBtn, websiteURLInput, locationInput;
29+
30+
function _validateGitURL(errors) {
31+
let gitURL = websiteURLInput.value;
32+
if(gitURL){
33+
$(websiteURLInput).removeClass("error-border");
34+
return true;
35+
}
36+
$(websiteURLInput).addClass("error-border");
37+
errors.push(`<span><i class="fas fa-exclamation-triangle" style="color: #f89406"></i>&nbsp;&nbsp;${Strings.ERROR_GIT_URL_INVALID}</span>`);
38+
return false;
39+
}
40+
41+
function _validateProjectLocation(errors) {
42+
let location = locationInput.value;
43+
if( location === Strings.PLEASE_SELECT_A_FOLDER){
44+
$(locationInput).addClass("error-border");
45+
return false;
46+
}
47+
if(locationInput.error){
48+
errors.push(`<span><i class="fas fa-exclamation-triangle" style="color: #f89406"></i>&nbsp;&nbsp;${locationInput.error}</span>`);
49+
$(locationInput).addClass("error-border");
50+
return false;
51+
}
52+
$(locationInput).removeClass("error-border");
53+
return true;
54+
}
55+
56+
function _validate() {
57+
const errors = [];
58+
let isValid = _validateGitURL(errors);
59+
isValid = _validateProjectLocation(errors) && isValid;
60+
$(createProjectBtn).prop('disabled', !isValid);
61+
const $messageDisplay = $("#messageDisplay");
62+
$messageDisplay.html("");
63+
if(!isValid) {
64+
$messageDisplay.html(errors.join("<br>"));
65+
}
66+
return isValid;
67+
}
68+
69+
async function _deduceClonePath(newPath) {
70+
if(!newPath){
71+
newPath = locationInput.originalPath;
72+
}
73+
if(!newPath){
74+
return;
75+
}
76+
const {clonePath, error} = await newProjectExtension.getGitCloneDir(newPath, websiteURLInput.value);
77+
locationInput.clonePath = clonePath;
78+
locationInput.value = window.top.Phoenix.fs.getTauriPlatformPath(clonePath);
79+
locationInput.error = error;
80+
locationInput.originalPath = newPath;
81+
}
82+
83+
function _selectFolder() {
84+
newProjectExtension.showFolderSelect(locationInput.originalPath || "")
85+
.then((newPath)=>{
86+
_deduceClonePath(newPath).then(_validate);
87+
}).catch((err)=>{
88+
console.error("user cancelled or error", err);
89+
});
90+
}
91+
92+
function _createProjectClicked() {
93+
localStorage.setItem(LAST_GIT_CLONE_BASE_DIR, locationInput.originalPath);
94+
newProjectExtension.gitClone(websiteURLInput.value, locationInput.clonePath);
95+
Metrics.countEvent(Metrics.EVENT_TYPE.NEW_PROJECT, "git.Click", "create");
96+
newProjectExtension.closeDialogue();
97+
}
98+
99+
function initGitProject() {
100+
$(".label-clone").text(Strings.GIT_CLONE_URL);
101+
createProjectBtn = document.getElementById("createProjectBtn");
102+
websiteURLInput = document.getElementById("websiteURLInput");
103+
locationInput = document.getElementById("locationInput");
104+
createProjectBtn.onclick = _createProjectClicked;
105+
$(websiteURLInput).keyup(()=>{
106+
_deduceClonePath().then(_validate);
107+
});
108+
locationInput.value = Strings.PLEASE_SELECT_A_FOLDER;
109+
locationInput.onclick = _selectFolder;
110+
websiteURLInput.value = "https://github.com/phcode-dev/HTML-Starter-Templates.git";
111+
_deduceClonePath(localStorage.getItem(LAST_GIT_CLONE_BASE_DIR)).then(_validate);
112+
}
113+
window.initGitProject = initGitProject;
114+
}
115+
116+
if(window.top.Phoenix.isNativeApp){
117+
desktopInit();
118+
}

0 commit comments

Comments
 (0)