Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
3c39f49
feat: prevent user elements like links and buttons from handling the …
devvaannsh Nov 24, 2025
9e3478b
fix: internal blocker also blocking in preview mode
devvaannsh Nov 24, 2025
e5e24b1
fix: cursor not getting positioned properly on element click in edit …
devvaannsh Nov 24, 2025
15a8768
feat: check and clear any selection if anything exists before selecti…
devvaannsh Nov 24, 2025
0785315
refactor: use better style when image gallery svg is selected
devvaannsh Nov 24, 2025
d80ea2b
feat: show pre-filled folder in image folder dialog
devvaannsh Nov 24, 2025
4abb404
fix: root directories not being displayed when user clears a pre fill…
devvaannsh Nov 25, 2025
8499926
fix: drag drop not working because mouse down is blocked
devvaannsh Nov 25, 2025
208226e
refactor: improve suggestions list colors to match it with tab bar
devvaannsh Nov 25, 2025
3653700
fix: tests failing as boxes not getting dismissed on click on body or…
devvaannsh Nov 25, 2025
79b260a
feat: show a toast message when folder selection dialog is open
devvaannsh Nov 26, 2025
d51696f
refactor: better UI for the toast message
devvaannsh Nov 26, 2025
86c11f2
fix: localize the dialog overlay string
devvaannsh Nov 26, 2025
9b18baf
fix: use higher z-index so that overlay does not get hidden
devvaannsh Nov 26, 2025
79c305a
fix: window focus handlers are never cleared which was causing repeti…
devvaannsh Nov 27, 2025
db16740
feat: add cut copy paste buttons in options box
devvaannsh Nov 27, 2025
c1877c7
refactor: move the edit options inside a dropdown
devvaannsh Nov 27, 2025
fb08a2b
feat: localize the strings used in the dropdown
devvaannsh Nov 27, 2025
dc05338
refactor: make dropdown consistent to existing phoenix colors
devvaannsh Nov 27, 2025
c714d96
fix: dropdown not getting dismissed on other element click
devvaannsh Nov 27, 2025
e7ec0e5
refactor: use font awesome icons for cut copy paste
devvaannsh Nov 27, 2025
e76b50c
fix: improvised positioning of the dropdown
devvaannsh Nov 27, 2025
3537382
feat: add ruler lines feature when element is clicked
devvaannsh Nov 29, 2025
2b9a071
fix: ruler lines not getting updated unless when clicked element changes
devvaannsh Nov 29, 2025
ec2ae2c
feat: ruler lines and outline to be shown in blue for non-editable el…
devvaannsh Nov 29, 2025
37c1261
refactor: use rgba vals with opacity to ruler lines to make it less d…
devvaannsh Nov 29, 2025
42f9552
feat: also add show ruler lines option in the more options dropdown
devvaannsh Nov 29, 2025
403e7bb
refactor: improve checkmark styles in more options dropdown
devvaannsh Nov 29, 2025
c53e196
refactor: change border color of the more options dropdown
devvaannsh Nov 29, 2025
8e349d2
fix: text editing in table, li, option etc not working because of dom…
devvaannsh Nov 29, 2025
b97dfe4
fix: indentation breaks when pasting a copied element
devvaannsh Nov 30, 2025
b34b701
feat: show first time copy cut toast message
devvaannsh Nov 30, 2025
d5cf4fd
feat: add edit link support for anchor tags
devvaannsh Dec 1, 2025
855a254
refactor: make hyperlink styles consistent to other elements
devvaannsh Dec 1, 2025
2ec9f7d
refactor: modify the link icon
devvaannsh Dec 1, 2025
f106577
feat: show a link icon in the hyperlink editor
devvaannsh Dec 1, 2025
dec1502
feat: show href link in info box for anchor elements
devvaannsh Dec 1, 2025
ba916ab
feat: add 35 char max limit for urls in the info box
devvaannsh Dec 1, 2025
bc6972d
fix: flicker issue after hyperlink edit completes
devvaannsh Dec 2, 2025
73f2ac2
fix: prevent more options dropdown from resizing because of checkmark
devvaannsh Dec 2, 2025
b4a6597
fix: slight pixel inconsistencies between ruler and elements outline
devvaannsh Dec 2, 2025
d973d83
fix: element highlighting overlapping the boxes
devvaannsh Dec 2, 2025
5447a95
feat: add support for ruler lines pixel values
devvaannsh Dec 2, 2025
cf18b34
fix: css text appending styles on every update call causing the strin…
devvaannsh Dec 2, 2025
824a12d
fix: round the pixels to ensure integer display
devvaannsh Dec 2, 2025
992f760
refactor: use the standard function syntax instead of the shorthand
devvaannsh Dec 2, 2025
59cfa5d
fix: positioning of the ruler markers
devvaannsh Dec 2, 2025
815e48a
fix: remove redundant code from live development file as they are no …
devvaannsh Dec 3, 2025
3b03b41
refactor: single source of truth for phoenix internal attribute
devvaannsh Dec 3, 2025
da85a5b
refactor: move all the strings used in remote functions to its helper…
devvaannsh Dec 3, 2025
47f8d0b
refactor: move data brackets id and brackets highlight to globals
devvaannsh Dec 3, 2025
9e7a9a4
refactor: move all icons used by remote functions to remote helper
devvaannsh Dec 3, 2025
2389771
refactor: move options box styles to remote helper file
devvaannsh Dec 3, 2025
443a320
refactor: move options box dropdown styles to remote helper
devvaannsh Dec 3, 2025
464abbf
refactor: move info box styles to remote helper file
devvaannsh Dec 3, 2025
3387cd8
refactor: move toast and dialog overlay styles to remote helper file
devvaannsh Dec 3, 2025
11d6a5a
refactor: move image gallery hyperlink editor and ai styles to remote…
devvaannsh Dec 3, 2025
0646743
fix: pass the mode to the remoteFunctions instead of the isProUser bo…
devvaannsh Dec 3, 2025
05887ee
feat: preview button unselected will always toggle to a non-preview mode
devvaannsh Dec 3, 2025
224fea5
fix: show ruler lines checkmark icon is not consistent in safari
devvaannsh Dec 3, 2025
a5e4b5e
fix: image gallery header icon not appearing in linux
devvaannsh Dec 3, 2025
77f33c1
fix: image gallery styles not consistent in linux
devvaannsh Dec 4, 2025
1a1f880
feat: formatting changes like ctrl + b, u, i were adding internal att…
devvaannsh Dec 4, 2025
a64ddd8
fix: show ruler pixel values inside viewport always
devvaannsh Dec 4, 2025
c402c9b
fix: ruler lines appearing even for invisible elements
devvaannsh Dec 4, 2025
0a02487
fix: boxes and ruler markers not getting updated when css is edited
devvaannsh Dec 4, 2025
e03591c
fix: boxes not getting dismissed when element doesn't exist in the do…
devvaannsh Dec 5, 2025
c672a10
fix: ruler lines causing live preview to overflow
devvaannsh Dec 5, 2025
796f29e
fix: element highlighting is very unpredictable
devvaannsh Dec 5, 2025
581e358
fix: smart ruler label markers position detection to always prevent o…
devvaannsh Dec 5, 2025
b88eafa
fix: more predictable positioning for info and options box
devvaannsh Dec 5, 2025
287182c
fix: also take the vertical scrollbar width into account when calcula…
devvaannsh Dec 5, 2025
aef47cb
fix: try placing info box above options box when no place available
devvaannsh Dec 5, 2025
254b1f1
feat: add remote function script support in live preview for extensib…
abose Dec 6, 2025
96970c8
chore: add extension
abose Dec 6, 2025
a006fea
refactor: remove dead code
devvaannsh Dec 6, 2025
443d3a7
refactor: improve code readability
devvaannsh Dec 6, 2025
eedcaec
chore: make LivePreviewEdit.js movable to extension
abose Dec 6, 2025
d1d4226
refactor: pro into integrated extension with kernal mode trust access
abose Dec 6, 2025
a94944e
fix: add priority order for box positions so that they always follow …
devvaannsh Dec 6, 2025
3bca274
fix: prod builkd break as ? is not supported
abose Dec 6, 2025
519cbf4
fix: test framework not loading
abose Dec 6, 2025
dcf234d
feat: add hot corner in the live preview for easy toggle to preview m…
devvaannsh Dec 6, 2025
3cd9cbf
feat: add addRemoteFunctionConstantsScript api
abose Dec 7, 2025
497424e
refactor: remote strings as remote fn constants instead of config
abose Dec 7, 2025
9a8ffe3
refactor: remote icons as remote fn constants instead of config
abose Dec 7, 2025
451539f
refactor: remove unused code
abose Dec 7, 2025
8268bc1
refactor: move css styles for edit boxes to extension
abose Dec 7, 2025
d2fc4b1
refactor: remote fns should work without the extension as well
abose Dec 7, 2025
39d92cc
refactor: image options box styling optimize
abose Dec 7, 2025
ff67c79
refactor: options box styles into its own css file for better code in…
abose Dec 7, 2025
91c9fa8
refactor: infobox and ruler styles in remote functions
abose Dec 7, 2025
1f741a8
refactor: toast message and dialog overlay styles
abose Dec 7, 2025
41c15c2
refactor: ai prompt box css in remote functions
abose Dec 7, 2025
ac96446
refactor: image gallery css in remote functions
abose Dec 7, 2025
d2d332f
refactor: hyperlink editor and hot corner css in remote functions
abose Dec 7, 2025
ffa472b
fix: prod build doesnt inject live preview styles are replace comment…
abose Dec 7, 2025
2c311a2
fix: improved drag drop
devvaannsh Dec 7, 2025
e0b1150
Revert "fix: improved drag drop"
devvaannsh Dec 7, 2025
ece11d0
feat: show drop marker label with tag class id names
devvaannsh Dec 7, 2025
4824d0c
refactor: make label styles consistent to other internal elements
devvaannsh Dec 7, 2025
81a970b
chore: inlining json files as well for require
abose Dec 7, 2025
b3b1b60
build: concantenate js relative files as well
abose Dec 7, 2025
3fdf721
feat: show a outline over the target element
devvaannsh Dec 7, 2025
210c2e6
fix: also add left side check overflow for the label
devvaannsh Dec 7, 2025
242feb7
feat: reliable dragging using a cycle marker for all possible drop po…
devvaannsh Dec 7, 2025
3b3eae1
build: failed if any phoenix pro files are not inlineable
abose Dec 8, 2025
636399d
chore: remove source map generation as it never worked and we dont ob…
abose Dec 8, 2025
866b72a
build: remove pro sources from built artifacts after dist generation
abose Dec 8, 2025
0face1b
chore: event listener attachment decisions taken in live preview with…
abose Dec 8, 2025
972e3f6
fix: replace the cycling logic with the divide total space by number …
devvaannsh Dec 9, 2025
70b7f15
fix: drop markers not getting cleared on auto scroll
devvaannsh Dec 9, 2025
02a1e11
fix: hot corners not working
devvaannsh Dec 9, 2025
f1d0acb
fix: improve hot corner styles
devvaannsh Dec 9, 2025
bdb8476
refactor: remove highlight flag as we use mode now for preview, edit …
abose Dec 9, 2025
a27b650
fix: ruler lines and boxes overlapping hot corners
devvaannsh Dec 9, 2025
98f5e2a
refactor: remove remote styles config passing as it can be passed dir…
abose Dec 9, 2025
bbc9205
fix: test runner showing stray buttons due to hot corners
abose Dec 9, 2025
c5670f3
fix: leaky listeners/event handlers in live document
abose Dec 10, 2025
138313c
refactor: move dismissLivePreviewEditBoxes into pro extension
abose Dec 10, 2025
cfe7e0e
feat: add tooltip in hot corner button
devvaannsh Dec 10, 2025
4ae0a2d
fix: custom server live preview integ tests failing fix
abose Dec 10, 2025
8323ff5
fix: prevent boxes overlapping the element edge cases
devvaannsh Dec 10, 2025
4f2427b
fix: live preview integ test failures
abose Dec 10, 2025
7a972bd
fix: live preview event handler leak causing inconcsitant lp bugs cau…
abose Dec 10, 2025
f243c4c
feat: show no network error in image gallery when device is not conne…
devvaannsh Dec 10, 2025
417509f
fix: remove transform from nav button active state as it was causing …
devvaannsh Dec 10, 2025
322e697
fix: network error retry button ui not consistent
devvaannsh Dec 10, 2025
113b348
chore: not exposing pro user flags outside the kernal trust module
abose Dec 10, 2025
301e755
fix: autoscrolling colliding with drag-drop for elements which falls …
devvaannsh Dec 10, 2025
911658c
refactor: live preview edit tests into seperate suite
abose Dec 11, 2025
a1f449b
build: phoenix pro optional build and test injection
abose Dec 11, 2025
426217f
ci: move to macos 15 runners as github deprecated older runners
abose Dec 11, 2025
9bc8702
fix: for non editable elements drag drop while auto scrolling is caus…
devvaannsh Dec 11, 2025
4750b07
chore: pro extension decides what mode to use from entitlements
abose Dec 11, 2025
a2e69c5
fix: download indicator flashing when image gallery not connected to …
devvaannsh Dec 11, 2025
c5c1a28
feat: when network connection is restored fetch the images
devvaannsh Dec 11, 2025
2ed123d
feat: dont show edit text button for disabled elements as edit text w…
devvaannsh Dec 11, 2025
7e8f524
chore: reload live preview working and reload liev perview menu item …
abose Dec 11, 2025
96669c8
fix: reliable config passing between phcode and live preview
abose Dec 11, 2025
92a6fd5
fix: svg elements not getting rendered properly in live preview when …
devvaannsh Dec 11, 2025
c40d089
feat: svg elements drag drop feature
devvaannsh Dec 11, 2025
7a5d890
test: live preview edit integ tests working
abose Dec 11, 2025
12608cb
fix: dont strip test folders in pro extension in dist-test builds
abose Dec 11, 2025
87f8f77
fix: svg elements drag-drop not ending on escape key press
devvaannsh Dec 11, 2025
1ae6ca3
fix: release dist failing to launch lp edit
abose Dec 12, 2025
fea8b4a
test: verify that in pro phoenix-pro extension is loaded only from mi…
abose Dec 12, 2025
54cbd83
build: remove optional extension after build
abose Dec 12, 2025
a488e81
feat: move svg elements as a single unit
devvaannsh Dec 12, 2025
de2d4e7
fix: hover highlights not getting cleared when dragging an svg
devvaannsh Dec 12, 2025
8156e63
fix: remove the drag drop event listeners before adding it again
devvaannsh Dec 12, 2025
2ae3c55
feat: drag drop was happening even on slightest mouse movements which…
devvaannsh Dec 12, 2025
5faff3d
fix: live preview related css highlightfails due to space in path. de…
abose Dec 12, 2025
47b0dab
fix: playwright not starting up in macos 15, since we r close to rele…
abose Dec 12, 2025
0907f1a
fix: indentation breaking for multiline elements or complex elements …
devvaannsh Dec 12, 2025
454ea3c
fix: overlays appearing for custom servers which is not expected
devvaannsh Dec 12, 2025
ae3266c
refactor: headers and remote fn import fn wrapping to prevent name co…
abose Dec 12, 2025
06efeb7
refactor: remove window object for storing temp state variables in li…
abose Dec 13, 2025
3a7a3cf
refactor: remoteHighlight var to fn scope instead of global
abose Dec 13, 2025
d237f25
refactor: remote functions continued
abose Dec 13, 2025
f91aff4
refactor: remote function LivePreviewView util
abose Dec 13, 2025
1567bfe
refactor: framework for optional lp edit handlers and refactor Hyperl…
abose Dec 13, 2025
a6994ba
refactor: ruler lines code and relavant infra
abose Dec 13, 2025
5310fce
chore: add render ordering to live preview widgets
abose Dec 13, 2025
6a05d38
refactor: drag and drop live preview code placeholder
abose Dec 13, 2025
846cf8a
fix: null exception in remote functions caught by ut suite fail to start
abose Dec 13, 2025
26ffbeb
refactor: move drag drop from remote functions to its specific file
devvaannsh Dec 13, 2025
8f67449
fix: ruler lines not shown when enabled unless a new element is clicked
devvaannsh Dec 13, 2025
80cde74
fix: refresh config once window.load fires otherwise we get stale data
devvaannsh Dec 13, 2025
e31a3c5
refactor: move user facing strings of ruler lines to measurements
devvaannsh Dec 14, 2025
5af8c54
refactor: improve more options dropdown styles to make it consistent
devvaannsh Dec 14, 2025
9830112
fix: decouple drag and drop from remote fucntions with direct api calls
abose Dec 15, 2025
be480c4
chore: better event handler registration in live preview
abose Dec 15, 2025
202f5fb
chore: better generic event handling for escape key press in editor
abose Dec 15, 2025
9941a9c
fix: allow the tool to specify of we should retain the options box
abose Dec 15, 2025
7507a41
chore: add proConstants for declared ordering for live preview tool b…
abose Dec 15, 2025
1b28ec9
refactor: duplicate elemnt as lp plugin
abose Dec 15, 2025
13059ea
refactor: delete elemnt as lp plugin
abose Dec 15, 2025
202d432
refactor: select parent as lp plugin
abose Dec 15, 2025
c8d7382
refactor: cut element into lp plugin
abose Dec 15, 2025
6c0e570
refactor: copy element into lp plugin
abose Dec 15, 2025
53a3f0a
chore: paste should paste to end of current tag and refactor to pro p…
abose Dec 15, 2025
e26ee9e
refactor: move image gallery feature from remote functions to its sep…
devvaannsh Dec 15, 2025
e3d0989
fix: image gallery toolbox ordering as it should come before duplicat…
devvaannsh Dec 15, 2025
cac9ac1
refactor: move ai from remote functions to its respective file
devvaannsh Dec 15, 2025
701ed71
fix: image gallery toggle button should stay in place when toggling g…
abose Dec 15, 2025
f28703c
refactor: rename ai file to be able to see it faster in file list
abose Dec 15, 2025
ee0c1c5
refactor: move edit text functionality from remote functions to its o…
devvaannsh Dec 15, 2025
68b79aa
fix: add interaction blockers in allowed handler functions
devvaannsh Dec 15, 2025
59dcddb
feat: keyboard shortcuts for cut/copy/paste working in live preview e…
abose Dec 15, 2025
3ab5b5c
feat: keyboard shortcuts for cut/copy/paste should work only in edit …
abose Dec 15, 2025
90c043d
refactor: move hot corner to its separate file
devvaannsh Dec 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/desktop-mac-m1-test-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:

jobs:
test-desktop-mac-m1:
runs-on: macos-14
runs-on: macos-15
timeout-minutes: 90
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/desktop-mac-test-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:

jobs:
test-desktop-mac:
runs-on: macos-13
runs-on: macos-15-intel
timeout-minutes: 90
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/playwright-staging-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:

playwrightChromiumMacos:
timeout-minutes: 90
runs-on: macos-14
runs-on: macos-15
steps:
- uses: actions/checkout@v3
- name: setup node
Expand Down Expand Up @@ -434,7 +434,7 @@ jobs:

playwrightFirefoxMacos:
timeout-minutes: 90
runs-on: macos-14
runs-on: macos-15
steps:
- uses: actions/checkout@v3
- name: setup node
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Thumbs.db
/npm-debug.log
/src/cacheManifest.json
/src/appConfig.js
/src/extensionsIntegrated/pro-loader.js
/test/pro-test-suite.js

# ignore node_modules inside src
/src/node_modules
Expand Down
6 changes: 0 additions & 6 deletions docs/API-Reference/command/Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,6 @@ Toggles live preview multi-browser mode
## CMD\_RELOAD\_LIVE\_PREVIEW
Reloads live preview

**Kind**: global variable
<a name="FILE_LIVE_HIGHLIGHT"></a>

## FILE\_LIVE\_HIGHLIGHT
Toggles live highlight

**Kind**: global variable
<a name="FILE_PROJECT_SETTINGS"></a>

Expand Down
12 changes: 12 additions & 0 deletions docs/API-Reference/utils/ExtensionLoader.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,15 @@ Load extensions.
| --- | --- | --- |
| A | <code>Array.&lt;string&gt;</code> | list containing references to extension source location. A source location may be either (a) a folder name inside src/extensions or (b) an absolute path. |

<a name="uninstallExtension"></a>

## uninstallExtension(extensionID) ⇒ <code>Promise</code>
Uninstall a deprecated extension

**Kind**: global function
**Returns**: <code>Promise</code> - A promise that resolves when the extension is uninstalled successfully

| Param | Type | Description |
| --- | --- | --- |
| extensionID | <code>string</code> | The ID of the extension to uninstall |

125 changes: 92 additions & 33 deletions gulpfile.js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const Translate = require("./translateStrings");
const copyThirdPartyLibs = require("./thirdparty-lib-copy");
const minify = require('gulp-minify');
const glob = require("glob");
const sourcemaps = require('gulp-sourcemaps');
const crypto = require("crypto");
const rename = require("gulp-rename");
const execSync = require('child_process').execSync;
Expand All @@ -57,6 +56,8 @@ function cleanAll() {
// Test artifacts
'dist-test',
'test/spec/test_folders.zip',
'src/extensionsIntegrated/pro-loader.js',
'test/pro-test-suite.js',
...RELEASE_BUILD_ARTEFACTS
]);
}
Expand All @@ -71,6 +72,45 @@ function cleanUnwantedFilesInDist() {
]);
}

function _cleanPhoenixProGitFolder() {
return new Promise((resolve) => {
const gitFolders = [
'dist/extensionsIntegrated/phoenix-pro/.git',
'dist-test/src/extensionsIntegrated/phoenix-pro/.git'
];

for (const gitFolder of gitFolders) {
if (fs.existsSync(gitFolder)) {
fs.rmSync(gitFolder, { recursive: true, force: true });
console.log(`Removed git folder: ${gitFolder}`);
}
}
resolve();
});
}

function _deletePhoenixProSourceFolder() {
return new Promise((resolve) => {
const phoenixProFolders = [
// we only delete the source folder from the release build artifact and not the test artifact. why below?
'dist/extensionsIntegrated/phoenix-pro'
// 'dist-test/src/extensionsIntegrated/phoenix-pro' // ideally we should delete this too so that the tests
// test exactly the release build artifact, but the spec runner requires on these files during test start
// and i wasnt able to isolate them. so instead wehat we do now is that we have an additional test in prod
// that checks that the phoenix-pro source folder is not loaded in prod and loaded only from the inlines
// brackets-min file.
];

for (const folder of phoenixProFolders) {
if (fs.existsSync(folder)) {
fs.rmSync(folder, { recursive: true, force: true });
console.log(`Deleted phoenix-pro source folder: ${folder}`);
}
}
resolve();
});
}

/**
* TODO: Release scripts to merge and min src js/css/html resources into dist.
* Links that might help:
Expand All @@ -90,7 +130,6 @@ function makeDistAll() {
function makeJSDist() {
return src(['src/**/*.js', '!src/**/unittest-files/**/*', "!src/thirdparty/prettier/**/*",
"!src/thirdparty/no-minify/**/*"])
.pipe(sourcemaps.init())
.pipe(minify({
ext:{
min:'.js'
Expand All @@ -99,22 +138,25 @@ function makeJSDist() {
mangle: false,
compress: {
unused: false
},
preserveComments: function (node, comment) {
const text = (comment.value || "").trim();

// Preserve ONLY comments starting with "DONT_STRIP_MINIFY:"
return text.includes("DONT_STRIP_MINIFY:");
}
}))
.pipe(sourcemaps.write('./'))
.pipe(dest('dist'));
}

// we had to do this as prettier is non minifiable
function makeJSPrettierDist() {
return src(["src/thirdparty/prettier/**/*"])
.pipe(sourcemaps.init())
.pipe(dest('dist/thirdparty/prettier'));
}

function makeNonMinifyDist() {
return src(["src/thirdparty/no-minify/**/*"])
.pipe(sourcemaps.init())
.pipe(dest('dist/thirdparty/no-minify'));
}

Expand Down Expand Up @@ -537,6 +579,7 @@ function containsRegExpExcludingEmpty(str) {


const textContentMap = {};
const excludeSuffixPathsInlining = ["MessageIds.json"];
function inlineTextRequire(file, content, srcDir) {
if(content.includes(`'text!`) || content.includes("`text!")) {
throw new Error(`in file ${file} require("text!...") should always use a double quote "text! instead of " or \``);
Expand All @@ -545,20 +588,24 @@ function inlineTextRequire(file, content, srcDir) {
const requireFragments = extractRequireTextFragments(content);
for (const {requirePath, requireStatement} of requireFragments) {
let textContent = textContentMap[requirePath];
let filePath = srcDir + requirePath;
if(requirePath.startsWith("./")) {
filePath = path.join(path.dirname(file), requirePath);
}
if(!textContent){
let filePath = srcDir + requirePath;
if(requirePath.startsWith("./")) {
filePath = path.join(path.dirname(file), requirePath);
}
console.log("reading file at path: ", filePath);
const fileContent = fs.readFileSync(filePath, "utf8");
textContentMap[requirePath] = fileContent;
textContent = fileContent;
}
if(textContent.includes("`")) {
console.log("Not inlining file as it contains a backquote(`) :", requirePath);
} else if(requirePath.endsWith(".js") || requirePath.endsWith(".json")) {
console.log("Not inlining JS/JSON file:", requirePath);
if((requirePath.endsWith(".js") && !requirePath.includes("./")) // js files that are relative paths are ok
|| excludeSuffixPathsInlining.some(ext => requirePath.endsWith(ext))) {
console.warn("Not inlining JS/JSON file:", requirePath, filePath);
if(filePath.includes("phoenix-pro")) {
// this is needed as we will delete the extension sources when packaging for release.
// so non inlined content will not be available in the extension. throw early to detect that.
throw new Error(`All Files in phoenix pro extension should be inlineable!: failed for ${filePath}`);
}
} else {
console.log("Inlining", requireStatement);
if((requireStatement.includes(".html") || requireStatement.includes(".js"))
Expand All @@ -568,7 +615,7 @@ function inlineTextRequire(file, content, srcDir) {
throw `Error inlining ${requireStatement} in ${file}: Regex: ${detectedRegEx}`+
"\nRegular expression of the form /*/ is not allowed for minification please use RegEx constructor";
}
content = content.replaceAll(requireStatement, "`"+textContent+"`");
content = content.replaceAll(requireStatement, `${JSON.stringify(textContent)}`);
}
}

Expand Down Expand Up @@ -625,10 +672,8 @@ function _renameBracketsConcatAsBracketsJSInDist() {
return new Promise((resolve)=>{
fs.unlinkSync("dist/brackets.js");
fs.copyFileSync("dist/brackets-min.js", "dist/brackets.js");
fs.copyFileSync("dist/brackets-min.js.map", "dist/brackets.js.map");
// cleanup minifed files
fs.unlinkSync("dist/brackets-min.js");
fs.unlinkSync("dist/brackets-min.js.map");
resolve();
});
}
Expand Down Expand Up @@ -748,9 +793,7 @@ function _renameExtensionConcatAsExtensionJSInDist(extensionName) {
const srcExtensionConcatFile = path.join(srcExtensionDir, 'extension-min.js');
const distExtensionDir = path.join('dist/extensions/default', extensionName);
const extMinFile = path.join(distExtensionDir, 'main.js');
const extMinFileMap = path.join(distExtensionDir, 'main.js.map');
const extSrcFile = path.join(distExtensionDir, 'extension-min.js');
const extSrcFileMap = path.join(distExtensionDir, 'extension-min.js.map');

// Make sure extension-min.js exists in dist.
if (!fs.existsSync(extSrcFile)) {
Expand All @@ -769,17 +812,7 @@ function _renameExtensionConcatAsExtensionJSInDist(extensionName) {
}
fs.copyFileSync(extSrcFile, extMinFile);

if (fs.existsSync(extMinFileMap)) {
fs.unlinkSync(extMinFileMap);
}
if (fs.existsSync(extSrcFileMap)) {
fs.copyFileSync(extSrcFileMap, extMinFileMap);
}

fs.unlinkSync(extSrcFile);
if (fs.existsSync(extSrcFileMap)) {
fs.unlinkSync(extSrcFileMap);
}

resolve();
} catch (err) {
Expand Down Expand Up @@ -877,6 +910,32 @@ function makeLoggerConfig() {
});
}

function generateProLoaderFiles() {
return new Promise((resolve) => {
// AMD module template for generated files
const AMD_MODULE_TEMPLATE = `define(function (require, exports, module) {<CODE>});\n`;

const phoenixProExists = fs.existsSync('src/extensionsIntegrated/phoenix-pro');

// Generate test/pro-test-suite.js content
const testSuiteCode = phoenixProExists ?
'\n require("extensionsIntegrated/phoenix-pro/unittests");\n' : '';
const testSuiteContent = AMD_MODULE_TEMPLATE.replace('<CODE>', testSuiteCode);

// Generate src/extensionsIntegrated/pro-loader.js content
const loaderCode = phoenixProExists ? '\n require("./phoenix-pro/main");\n' : '';
const loaderContent = AMD_MODULE_TEMPLATE.replace('<CODE>', loaderCode);

fs.writeFileSync('test/pro-test-suite.js', testSuiteContent);
fs.writeFileSync('src/extensionsIntegrated/pro-loader.js', loaderContent);

console.log(`Generated pro-loader.js (phoenix-pro ${phoenixProExists ? 'found' : 'not found'})`);
console.log(`Generated pro-test-suite.js (phoenix-pro ${phoenixProExists ? 'found' : 'not found'})`);

resolve();
});
}

function validatePackageVersions() {
return new Promise((resolve, reject)=>{
const mainPackageJson = require("../package.json", "utf8");
Expand Down Expand Up @@ -942,26 +1001,26 @@ function _patchMinifiedCSSInDistIndex() {

const createDistTest = series(copyDistToDistTestFolder, copyTestToDistTestFolder, copyIndexToDistTestFolder);

exports.build = series(copyThirdPartyLibs.copyAll, makeLoggerConfig, zipDefaultProjectFiles, zipSampleProjectFiles,
exports.build = series(copyThirdPartyLibs.copyAll, makeLoggerConfig, generateProLoaderFiles, zipDefaultProjectFiles, zipSampleProjectFiles,
makeBracketsConcatJS, _compileLessSrc, _cleanReleaseBuildArtefactsInSrc, // these are here only as sanity check so as to catch release build minify fails not too late
createSrcCacheManifest, validatePackageVersions);
exports.buildDebug = series(copyThirdPartyLibs.copyAllDebug, makeLoggerConfig, zipDefaultProjectFiles,
exports.buildDebug = series(copyThirdPartyLibs.copyAllDebug, makeLoggerConfig, generateProLoaderFiles, zipDefaultProjectFiles,
makeBracketsConcatJS, _compileLessSrc, _cleanReleaseBuildArtefactsInSrc, // these are here only as sanity check so as to catch release build minify fails not too late
zipSampleProjectFiles, createSrcCacheManifest);
exports.clean = series(cleanDist);
exports.reset = series(cleanAll);

exports.releaseDev = series(cleanDist, exports.buildDebug, makeBracketsConcatJS, makeConcatExtensions, _compileLessSrc,
makeDistAll, cleanUnwantedFilesInDist, releaseDev, _renameConcatExtensionsinDist,
createDistCacheManifest, createDistTest, _cleanReleaseBuildArtefactsInSrc);
createDistCacheManifest, createDistTest, _cleanPhoenixProGitFolder, _cleanReleaseBuildArtefactsInSrc);
exports.releaseStaging = series(cleanDist, exports.build, makeBracketsConcatJS, makeConcatExtensions, _compileLessSrc,
makeDistNonJS, makeJSDist, makeJSPrettierDist, makeNonMinifyDist, cleanUnwantedFilesInDist,
_renameBracketsConcatAsBracketsJSInDist, _renameConcatExtensionsinDist, _patchMinifiedCSSInDistIndex, releaseStaging,
createDistCacheManifest, createDistTest, _cleanReleaseBuildArtefactsInSrc);
createDistCacheManifest, createDistTest, _deletePhoenixProSourceFolder, _cleanReleaseBuildArtefactsInSrc);
exports.releaseProd = series(cleanDist, exports.build, makeBracketsConcatJS, makeConcatExtensions, _compileLessSrc,
makeDistNonJS, makeJSDist, makeJSPrettierDist, makeNonMinifyDist, cleanUnwantedFilesInDist,
_renameBracketsConcatAsBracketsJSInDist, _renameConcatExtensionsinDist, _patchMinifiedCSSInDistIndex, releaseProd,
createDistCacheManifest, createDistTest, _cleanReleaseBuildArtefactsInSrc);
createDistCacheManifest, createDistTest, _deletePhoenixProSourceFolder, _cleanReleaseBuildArtefactsInSrc);
exports.releaseWebCache = series(makeDistWebCache);
exports.serve = series(exports.build, serve);
exports.zipTestFiles = series(zipTestFiles);
Expand Down
11 changes: 8 additions & 3 deletions src/LiveDevelopment/BrowserScripts/LiveDevProtocolRemote.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@
}
}
s.id = msg.params.url;

if (window._LD && window._LD.redrawEverything) {
window._LD.redrawEverything();
}
},

/**
Expand Down Expand Up @@ -363,7 +367,7 @@
ProtocolManager.enable();
});

function _getAllInheritedSelectorsInOrder(element) {
function getAllInheritedSelectorsInOrder(element) {
let selectorsFound= new Map();
const selectorsList = [];
while (element) {
Expand All @@ -383,6 +387,7 @@
return selectorsList;
}

global.getAllInheritedSelectorsInOrder = getAllInheritedSelectorsInOrder;

/**
* Sends the message containing tagID which is being clicked
Expand All @@ -407,7 +412,7 @@
"nodeID": element.id,
"nodeClassList": element.classList,
"nodeName": element.nodeName,
"allSelectors": _getAllInheritedSelectorsInOrder(element),
"allSelectors": getAllInheritedSelectorsInOrder(element),
"contentEditable": element.contentEditable === 'true',
"clicked": true,
"edit": true
Expand All @@ -431,7 +436,7 @@
"nodeID": element.id,
"nodeClassList": element.classList,
"nodeName": element.nodeName,
"allSelectors": _getAllInheritedSelectorsInOrder(element),
"allSelectors": getAllInheritedSelectorsInOrder(element),
"contentEditable": element.contentEditable === 'true',
"clicked": true
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,10 @@
}
};

const ABS_REGEX = new RegExp("^(?:[a-z]+:)?\\/\\/", "i");
function getAbsoluteUrl(url) {
// Check if the URL is already absolute
if (/^(?:[a-z]+:)?\/\//i.test(url)) {
if (ABS_REGEX.test(url)) {
return url; // The URL is already absolute
}

Expand Down
Loading
Loading