Skip to content

Commit 11d0e2a

Browse files
committed
deploy: cc3f7a7
1 parent 1bece9d commit 11d0e2a

36 files changed

Lines changed: 340 additions & 78 deletions

‎appConfig.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ window.AppConfig = {
2222
"extension_url": "https://extensions.phcode.dev/extensions/",
2323
"extension_store_url": "https://store.core.ai/src/",
2424
"linting.enabled_by_default": true,
25-
"build_timestamp": "2023-03-31T17:06:59.785Z",
25+
"build_timestamp": "2023-04-01T13:37:34.604Z",
2626
"googleAnalyticsID": "G-P4HJFPDB76",
2727
"mixPanelID": "49c4d164b592be2350fc7af06a259bf3",
2828
"coreAnalyticsID": "phoenix",
@@ -32,7 +32,7 @@ window.AppConfig = {
3232
"bugsnagEnv": "development"
3333
},
3434
"name": "Phoenix",
35-
"version": "3.1.19-19242",
35+
"version": "3.1.19-19246",
3636
"apiVersion": "3.1.19",
3737
"homepage": "https://core.ai",
3838
"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.

‎base-config/keyboard.json‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@
219219
"platform": "mac"
220220
}
221221
],
222-
"view.increaseFontSize": [
222+
"view.zoomIn": [
223223
{
224224
"key": "Ctrl-=",
225225
"displayKey": "Ctrl-+"
@@ -228,14 +228,29 @@
228228
"key": "Ctrl-+"
229229
}
230230
],
231-
"view.decreaseFontSize": [
231+
"view.zoomOut": [
232232
{
233233
"key": "Ctrl--",
234234
"displayKey": "Ctrl-−"
235235
}
236236
],
237+
"view.increaseFontSize": [
238+
{
239+
"key": "Ctrl-Shift-=",
240+
"displayKey": "Ctrl-Shift-+"
241+
},
242+
{
243+
"key": "Ctrl-Shift-+"
244+
}
245+
],
246+
"view.decreaseFontSize": [
247+
{
248+
"key": "Ctrl-Shift--",
249+
"displayKey": "Ctrl-Shift-−"
250+
}
251+
],
237252
"view.restoreFontSize": [
238-
"Ctrl-0"
253+
"Ctrl-Shift-9"
239254
],
240255
"view.scrollLineUp": [
241256
{

‎cacheManifest.json‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"appConfig.js": "c2827e06db0c37345135d756adef5c33",
3-
"assets/default-project/en.zip": "bea3ca6d2626ee52a6bfef9cb910acc7",
2+
"appConfig.js": "b9528200ae8a9ad4ba23b84ad244cd07",
3+
"assets/default-project/en.zip": "d650d4b985dca1609863243a8e64207e",
44
"assets/default-project/en/images/cloud1.svg": "aca7bba84a2237f1c1988caea54a67a9",
55
"assets/default-project/en/images/cloud2.svg": "02880216ac461f1578ac8a18f158ce28",
66
"assets/default-project/en/images/cloud3.svg": "7a78bb29bd895ead8c171001244d9b7d",
@@ -115,7 +115,7 @@
115115
"assets/phoenix-splash/index.html": "cb243820de1e966176680bd5849a6183",
116116
"assets/phoenix-splash/no-preview.html": "2c51d14109552b59976145fe9ac33236",
117117
"assets/phoenix-splash/styles.css": "6809a039001526eeec64eeef1f0ad807",
118-
"assets/sample-projects/bootstrap-blog.zip": "d5a5499971113313a74498ac6deeb7e1",
118+
"assets/sample-projects/bootstrap-blog.zip": "445cfd2e33ced15a7bd449353eee2dcf",
119119
"assets/sample-projects/bootstrap-blog/assets/brand/bootstrap-logo-white.svg": "2e642df55357162ad28519305c8fd4fe",
120120
"assets/sample-projects/bootstrap-blog/assets/brand/bootstrap-logo.svg": "88eef7f3c2bcf988457a0e6d123c3f1d",
121121
"assets/sample-projects/bootstrap-blog/assets/dist/css/bootstrap.min.css": "6d9c6fda1e7087224431cc8068bb998f",
@@ -125,7 +125,7 @@
125125
"assets/sample-projects/bootstrap-blog/blog.rtl.css": "c6c275bf0b804d3dec264ec7fb3d7677",
126126
"assets/sample-projects/bootstrap-blog/index-rtl.html": "506e2d3fd1c4bb3651377144a62d5e82",
127127
"assets/sample-projects/bootstrap-blog/index.html": "dd8824ad3c9520dc0a825176d20eb694",
128-
"assets/sample-projects/dashboard.zip": "99799be263058f8b7569f477e67f015d",
128+
"assets/sample-projects/dashboard.zip": "410b387d0770d49cbe0d8e3970b1f3bb",
129129
"assets/sample-projects/dashboard/assets/brand/bootstrap-logo-white.svg": "2e642df55357162ad28519305c8fd4fe",
130130
"assets/sample-projects/dashboard/assets/brand/bootstrap-logo.svg": "88eef7f3c2bcf988457a0e6d123c3f1d",
131131
"assets/sample-projects/dashboard/assets/dist/css/bootstrap.min.css": "6d9c6fda1e7087224431cc8068bb998f",
@@ -137,7 +137,7 @@
137137
"assets/sample-projects/dashboard/index.html": "ddfda6ea9dfc8e12a8dcbbf065c804de",
138138
"assets/sample-projects/dashboard/signin.css": "a71ff2b493f230e0d6585793c2115809",
139139
"assets/sample-projects/dashboard/signin.html": "b108c183dfa7e2da3d88ec79bee79509",
140-
"assets/sample-projects/explore.zip": "db31bd3b277bd7e41c0fb67d918f1286",
140+
"assets/sample-projects/explore.zip": "b7594af1897c98d8efea10e13df1163c",
141141
"assets/sample-projects/explore/A-tribute-page.html": "007699e85177db3d1cd87d0d47440b36",
142142
"assets/sample-projects/explore/adjustable-fireworks.html": "706a0995d00d8ae009b5426cf7ee69be",
143143
"assets/sample-projects/explore/ant_colony.html": "d0885229e57caecc83049b50ee98560c",
@@ -227,7 +227,7 @@
227227
"assets/sample-projects/explore/watermelon-pixel.html": "6f6754e8073436bb823807a10a0446ea",
228228
"assets/sample-projects/explore/webmine.html": "9879458a48c757dc6671d408e940da4d",
229229
"assets/sample-projects/explore/whack-a-mole.html": "827f15c53657350b9c898fa27ecf15ac",
230-
"assets/sample-projects/home-pages.zip": "5cb717a8968448281882110b5358ed68",
230+
"assets/sample-projects/home-pages.zip": "a48ddf3db18e0d87f9b7a5b3e3e6b0ec",
231231
"assets/sample-projects/home-pages/album/index.html": "df20e4a479659463ab9d3f6b4ca4dbd1",
232232
"assets/sample-projects/home-pages/assets/brand/bootstrap-logo-white.svg": "2e642df55357162ad28519305c8fd4fe",
233233
"assets/sample-projects/home-pages/assets/brand/bootstrap-logo.svg": "88eef7f3c2bcf988457a0e6d123c3f1d",
@@ -239,23 +239,23 @@
239239
"assets/sample-projects/home-pages/carousel/index.html": "fc5bf7b2d8640a2c393f465294210e7c",
240240
"assets/sample-projects/home-pages/cover/cover.css": "3738586a82dd90263617020e7f1db82e",
241241
"assets/sample-projects/home-pages/cover/index.html": "a0ae1a11224672532b3466df93ce0821",
242-
"assets/sample-projects/HTML5.zip": "1893232ee1c78784eecd117fcd7b508b",
242+
"assets/sample-projects/HTML5.zip": "186d51f4d9b3bfd0c6da65d497752239",
243243
"assets/sample-projects/HTML5/index.html": "ca318e370d63b3e083d3bd63052b8252",
244244
"assets/sample-projects/HTML5/script.js": "47de56d88cd6d866c4f77027128c0dd7",
245245
"assets/sample-projects/HTML5/styles.css": "8c798c8b3bba7e4d49dfe99b4deccd47",
246246
"assets/sample-projects/new-project-list.json": "52493b6373285d18a51a7e0319d812c2",
247247
"assets/sample-projects/zips/bootstrap.zip": "47b3132b5dbf324d6396188cf68ecae1",
248-
"base-config/keyboard.json": "92843de2ea48c3d5630dc917a52e52dd",
248+
"base-config/keyboard.json": "0ba1393677637d9dd553e1ae87cb7560",
249249
"brackets.config.dist.json": "4f77dd581944e20353b2b23cc824cc4a",
250250
"brackets.config.staging.json": "a1d92e1354fbb3ac701a7c2e7c8007e4",
251251
"brackets.js": "a76ecbfcaf4982edf6e700bb26634818",
252-
"cacheManifest.json": "60d8069f7b0c221f73e0e3ce21ef6bd5",
253-
"command/CommandManager.js": "389cc2d035ad2565772deb2dc78a1133",
254-
"command/Commands.js": "71c425d4b9919ff57fb810e2e1dca1fa",
255-
"command/DefaultMenus.js": "53bda04ddfca404273533e0de28da88d",
256-
"command/KeyBindingManager.js": "9cd78cf7d9cbc9ac0520f15e584a8961",
257-
"command/Menus.js": "1314be70f77ecbfc27a60024864ff638",
258-
"config.json": "6f5173992e6496c98b53959e5168dc64",
252+
"cacheManifest.json": "8ca501fbdd07727729d598deee001a84",
253+
"command/CommandManager.js": "8763fce16883bbef252604330ac3bf49",
254+
"command/Commands.js": "ab49cc2da5dbc3534a09c62b70ee23e0",
255+
"command/DefaultMenus.js": "a1723abdf3202edc49310f05d67a1481",
256+
"command/KeyBindingManager.js": "6a1564f8aa3a6816b87df88e94362829",
257+
"command/Menus.js": "dfde11335c3251c853d7f45ede9435d0",
258+
"config.json": "13570b9692a8455bc0373cfc5287e9ad",
259259
"devEnable.html": "5c494d5e246bdb4260557c03b73eea32",
260260
"document/ChangedDocumentTracker.js": "8763dbbd784b9e8a3614a8ee723d5273",
261261
"document/Document.js": "e54a90c638153d50fe7d23ffeeb0076c",
@@ -870,7 +870,7 @@
870870
"nls/ro/lastTranslatedLocale.json": "34b2a95517ed5a2d371f730e21de3994",
871871
"nls/ro/strings.js": "15b563ab54a78ce5f94c47c72b73e136",
872872
"nls/root/strings-app.js": "9c3baaf01c4d4194c39cf510bdc06bea",
873-
"nls/root/strings.js": "a9c53986b39e969815c42e12a3939346",
873+
"nls/root/strings.js": "bd1ced827c95dd861fed0bb704bfbaf8",
874874
"nls/root/urls.js": "2c5e2a12c3412c1efe22c686aa78bce0",
875875
"nls/ru/expertTranslations.json": "89cf849840b48e07ca9397092df1d15e",
876876
"nls/ru/lastTranslated.json": "a32fde9b5408427b64c18f896eab35a1",
@@ -1930,7 +1930,7 @@
19301930
"view/ThemeManager.js": "751b0cfbf5c62d9756f1e08584ad9da2",
19311931
"view/ThemeSettings.js": "f70e4ab09eb8c3b6636d32ff73c545f5",
19321932
"view/ThemeView.js": "19805a3bbf260979079a7d04eec6455f",
1933-
"view/ViewCommandHandlers.js": "3b91d3fc69b987d3c921ddcc200c85c9",
1933+
"view/ViewCommandHandlers.js": "24ed671f5fb21f30a0bec6d7fc13d4ed",
19341934
"view/ViewStateManager.js": "695f3f492456e78e7ddf143e1c051b08",
19351935
"view/WorkspaceManager.js": "2f9dd80ee6a4528056a49903e009929f",
19361936
"virtual-server-main.js": "50b12cc83aa399e0f3b3e00c6fb59e06",

‎command/CommandManager.js‎

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ define(function (require, exports, module) {
3333
const EventDispatcher = require("utils/EventDispatcher");
3434

3535
const EVENT_BEFORE_EXECUTE_COMMAND = "beforeExecuteCommand";
36+
const SOURCE_KEYBOARD_SHORTCUT = "keyboardShortcut",
37+
SOURCE_UI_MENU_CLICK = "uiMenuClick",
38+
SOURCE_OTHER = "otherExecAction";
3639

3740

3841
/**
@@ -62,13 +65,15 @@ define(function (require, exports, module) {
6265
* @param {function} commandFn - the function that is called when the command is executed.
6366
*
6467
* TODO: where should this be triggered, The Command or Exports?
68+
* @param [options]
6569
*/
66-
function Command(name, id, commandFn) {
70+
function Command(name, id, commandFn, options= {}) {
6771
this._name = name;
6872
this._id = id;
6973
this._commandFn = commandFn;
7074
this._checked = undefined;
7175
this._enabled = true;
76+
this._options = options;
7277
}
7378
EventDispatcher.makeEventDispatcher(Command.prototype);
7479

@@ -89,8 +94,17 @@ define(function (require, exports, module) {
8994
if (!this._enabled) {
9095
return (new $.Deferred()).reject().promise();
9196
}
92-
93-
var result = this._commandFn.apply(this, arguments);
97+
let args = arguments;
98+
if(this._options.eventSource) {
99+
// This command has been registered with the optional source details set we have to ensure the event
100+
// argument is inserted first. The event source may be already injected by the executor,
101+
// if not we have to do it now.
102+
if(!args.length || !(typeof args[0] === 'object' && args[0].eventSource)) {
103+
const event = {eventSource: SOURCE_OTHER}; // default we don't know the source
104+
args = [event].concat(args);
105+
}
106+
}
107+
let result = this._commandFn.apply(this, args);
94108
if (!result) {
95109
// If command does not return a promise, assume that it handled the
96110
// command and return a resolved promise
@@ -184,9 +198,13 @@ define(function (require, exports, module) {
184198
* execute() (after the id) are passed as arguments to the function. If the function is asynchronous,
185199
* it must return a jQuery promise that is resolved when the command completes. Otherwise, the
186200
* CommandManager will assume it is synchronous, and return a promise that is already resolved.
201+
* @param {Object} [options]
202+
* @param {boolean} options.eventSource If set to true, the commandFn will be called with the first argument `event`
203+
* with details about the source(invoker) as event.eventSource(one of the `CommandManager.SOURCE_*`) and
204+
* event.sourceType(Eg. Ctrl-K) parameter.
187205
* @return {?Command}
188206
*/
189-
function register(name, id, commandFn) {
207+
function register(name, id, commandFn, options={}) {
190208
if (_commands[id]) {
191209
console.log("Attempting to register an already-registered command: " + id);
192210
return null;
@@ -196,7 +214,7 @@ define(function (require, exports, module) {
196214
return null;
197215
}
198216

199-
var command = new Command(name, id, commandFn);
217+
var command = new Command(name, id, commandFn, options);
200218
_commands[id] = command;
201219

202220
exports.trigger("commandRegistered", command);
@@ -283,8 +301,18 @@ define(function (require, exports, module) {
283301
} catch (err) {
284302
console.error(err);
285303
}
304+
let args = Array.prototype.slice.call(arguments, 1); // remove id
305+
if(command._options.eventSource) {
306+
// This command has been registered with the optional source details set we have to ensure the event
307+
// argument is inserted first. The event source may be already injected by the executor,
308+
// if not we have to do it now.
309+
if(!args.length || !(typeof args[0] === 'object' && args[0].eventSource)) {
310+
const event = {eventSource: SOURCE_OTHER}; // default we don't know the source
311+
args = [event].concat(args);
312+
}
313+
}
286314

287-
return command.execute.apply(command, Array.prototype.slice.call(arguments, 1));
315+
return command.execute.apply(command, args);
288316
}
289317
return (new $.Deferred()).reject().promise();
290318

@@ -301,4 +329,7 @@ define(function (require, exports, module) {
301329
exports._testReset = _testReset;
302330
exports._testRestore = _testRestore;
303331
exports.EVENT_BEFORE_EXECUTE_COMMAND = EVENT_BEFORE_EXECUTE_COMMAND;
332+
exports.SOURCE_KEYBOARD_SHORTCUT = SOURCE_KEYBOARD_SHORTCUT;
333+
exports.SOURCE_UI_MENU_CLICK = SOURCE_UI_MENU_CLICK;
334+
exports.SOURCE_OTHER = SOURCE_OTHER;
304335
});

0 commit comments

Comments
 (0)