Skip to content

Commit fecc4b7

Browse files
devvaannshabose
authored andcommitted
build: phoenix build complete
1 parent ae5a137 commit fecc4b7

File tree

11 files changed

+141
-242
lines changed

11 files changed

+141
-242
lines changed

docs/generatedApiDocs/features/NewFileContentManager-API.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,13 @@ A promise that resolves with the content text or rejects if there is no content
9393

9494
Returns a promise that resolves to the default text content of the given file after querying
9595
all the content providers. If no text is returned by any providers, it will return an empty string "".
96+
To get the default content given a path
97+
NewFileContentManager.getInitialContentForFile("/path/to/file.jsx");
9698

9799
### Parameters
98100

99101
* `fullPath` **[string][1]**
100102

101-
### Examples
102-
103-
To get the default content given a path
104-
105-
```javascript
106-
NewFileContentManager.getInitialContentForFile("/path/to/file.jsx");
107-
```
108-
109103
Returns **[Promise][2]<[string][1]>** The text contents
110104

111105
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

docs/generatedApiDocs/features/QuickViewManager-API.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
QuickViewManager provides support to add interactive preview popups on hover over the main editors.
66
Extensions can register to provide previews with `QuickViewManager.registerQuickViewProvider` API.
7-
![quick-view-image.png][1]
8-
![quick-view-youtube.png][2]
7+
!\[quick-view-image.png]\([https://docs-images.phcode.dev/phcode-sdk/quick-view-image.png][1] alt="quick view image" /)
8+
!\[quick-view-youtube.png]\([https://docs-images.phcode.dev/phcode-sdk/quick-view-youtube.png][2] alt="quick view youtube image" /)
99

1010
### See Related: SelectionViewManager
1111

@@ -15,7 +15,7 @@ QuickViewManager API.
1515
* SelectionViews popup only once user selects a text by mouse or hover over a region with text selection.
1616
* Quickviews popup on mouse hover.
1717

18-
![image][4]
18+
!\[image]\([https://user-images.githubusercontent.com/5336369/186434397-3db55789-6077-4d02-b4e2-78ef3f663399.png][4] alt="user image" /)
1919

2020
## Usage
2121

docs/generatedApiDocs/features/SelectionViewManager-API.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ SelectionViewManager provides support to add interactive preview popups on selec
66
This can be used to provide interactive editor controls on a selected element.
77

88
Extensions can register to provide previews with `SelectionViewManager.registerSelectionViewProvider` API.
9-
![image][1]
10-
![selection view][2]
9+
!\[image]\([https://user-images.githubusercontent.com/5336369/186434397-3db55789-6077-4d02-b4e2-78ef3f663399.png][1] alt="user image" /)
10+
!\[selection view]\([https://user-images.githubusercontent.com/5336369/186434671-c1b263e5-19a9-4a9d-8f90-507df5f881b5.gif][2] alt="user gif" /)
1111

1212
### See Related: QuickViewManager
1313

@@ -17,7 +17,7 @@ SelectionViewManager API.
1717
* SelectionViews popup only once user selects a text by mouse or hover over a region with text selection.
1818
* Quickviews popup on mouse hover.
1919

20-
![quick-view-youtube.png][4]
20+
!\[quick-view-youtube.png]\([https://docs-images.phcode.dev/phcode-sdk/quick-view-youtube.png][4] alt="quick view youtube image" /)
2121

2222
## Usage
2323

docs/generatedApiDocs/utils/EventManager-API.md

Lines changed: 39 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,24 @@ EventManager.triggerEvent("drawImage-Handler", "someEventName", "param1", "param
3434
Registers a named EventHandler. Event handlers are created using the call:
3535
`EventDispatcher.makeEventDispatcher(Command.prototype);`
3636

37-
Type: [function][1]
38-
39-
### Parameters
40-
41-
* `handlerName` **[string][2]** a unique name of the handler.
42-
* `eventDispatcher` **[object][3]** An EventDispatcher that will be used to trigger events.
43-
44-
### Examples
45-
4637
To register a close dialogue event handler in an extension:
47-
48-
```javascript
4938
// in close-dialogue.js module winthin the extension, do the following:
5039
const EventDispatcher = brackets.getModule("utils/EventDispatcher"),
5140
EventDispatcher.makeEventDispatcher(exports);
5241
const EventManager = brackets.getModule("utils/EventManager");
5342

54-
// Note: for event handler names, please change the <extensionName> to your extension name
43+
// Note: for event handler names, please change the `extensionName` to your extension name
5544
// to prevent collisions. EventHandlers starting with `ph-` and `br-` are reserved as system handlers
5645
// and not available for use in extensions.
57-
EventManager.registerEventHandler("<extensionName>-closeDialogueHandler", exports);
46+
EventManager.registerEventHandler("`extensionName`-closeDialogueHandler", exports);
5847
// Once the event handler is registered, see triggerEvent API on how to raise events
59-
```
48+
49+
Type: [function][1]
50+
51+
### Parameters
52+
53+
* `handlerName` **[string][2]** a unique name of the handler.
54+
* `eventDispatcher` **[object][3]** An EventDispatcher that will be used to trigger events.
6055

6156
Returns **[boolean][4]**
6257

@@ -76,6 +71,11 @@ Returns **[boolean][4]**
7671

7772
Triggers an event on the named event handler.
7873

74+
To trigger an event to the `closeDialogue` event handler registered above
75+
// anywhere in code, do the following:
76+
const EventManager = brackets.getModule("utils/EventManager");
77+
EventManager.triggerEvent("closeDialogueHandler", "someEvent", "param1", "param2", ...);
78+
7979
Type: [function][1]
8080

8181
### Parameters
@@ -84,16 +84,6 @@ Type: [function][1]
8484
* `eventName` the event name as recognised by the handler. this is usually a string.
8585
* `eventParams` **...any** Can be a comma seperated list of args or a single argument.
8686

87-
### Examples
88-
89-
To trigger an event to the `closeDialogue` event handler registered above
90-
91-
```javascript
92-
// anywhere in code, do the following:
93-
const EventManager = brackets.getModule("utils/EventManager");
94-
EventManager.triggerEvent("closeDialogueHandler", "someEvent", "param1", "param2", ...);
95-
```
96-
9787
## onmessage
9888

9989
This function acts as a secure event handler for all 'message' events targeted at the window object.
@@ -103,43 +93,33 @@ Instead of directly overriding window.onmessage, extensions or other elements th
10393
listen to these events should register their named eventHandler with `EventManager`.
10494

10595
By default, only origins part of `window.Phoenix.TRUSTED_ORIGINS` are whitelisted. If your extension is
106-
bringing in a cross-origin ifrmame say `http://mydomain.com`, you should add it to the whitelist by setting
107-
`window.Phoenix.TRUSTED_ORIGINS["http://mydomain.com"]=true;`
96+
bringing in a cross-origin ifrmame say \[`http://mydomain.com`], you should add it to the whitelist by setting
97+
`window.Phoenix.TRUSTED_ORIGINS ["http://mydomain.com"] = true;`
10898

10999
### Parameters
110100

111101
* `event` **[MessageEvent][6]** The 'message' event targeted at the window object. The event's
112-
'data' property should have a 'handlerName' and `eventName` property that will be triggered in phcode.
113-
114-
### Examples
115-
116-
```javascript
117-
// We will try to communicate within an embedded iframe and an extension
118-
119-
// In your extension in phoenix, register a handlerName to process a new kind of event.
120-
const EventDispatcher = brackets.getModule("utils/EventDispatcher"),
121-
EventDispatcher.makeEventDispatcher(exports);
122-
const EventManager = brackets.getModule("utils/EventManager");
123-
// Note: for event handler names, please change the <extensionName> to your extension name
124-
// to prevent collisions. EventHandlers starting with `ph-` and `br-` are reserved as system handlers
125-
// and not available for use in extensions.
126-
window.Phoenix.TRUSTED_ORIGINS["http://mydomain.com"]=true;
127-
EventManager.registerEventHandler("<extensionName>-iframeMessageHandler", exports);
128-
exports.on("iframeHelloEvent", function(_ev, event){
129-
console.log(event.data.message);
130-
});
131-
132-
// Now from your iframe, send a message to the above event handler using:
133-
window.parent.postMessage({
134-
handlerName: "<extensionName>-iframeMessageHandler",
102+
'data' property should have a 'handlerName' and `eventName` property that will be triggered in phcode.// We will try to communicate within an embedded iframe and an extension// In your extension in phoenix, register a handlerName to process a new kind of event.
103+
const EventDispatcher = brackets.getModule("utils/EventDispatcher"),
104+
EventDispatcher.makeEventDispatcher(exports);
105+
const EventManager = brackets.getModule("utils/EventManager");
106+
// Note: for event handler names, please change the `extensionName` to your extension name
107+
// to prevent collisions. EventHandlers starting with `ph-` and `br-` are reserved as system handlers
108+
// and not available for use in extensions.
109+
window.Phoenix.TRUSTED_ORIGINS \["[http://mydomain.com][7]"] = true;
110+
EventManager.registerEventHandler("`extensionName`-iframeMessageHandler", exports);
111+
exports.on("iframeHelloEvent", function(\_ev, event){
112+
console.log(event.data.message);
113+
});// Now from your iframe, send a message to the above event handler using:
114+
window.parent.postMessage({
115+
handlerName: "`extensionName`-iframeMessageHandler",
135116
eventName: "iframeHelloEvent",
136117
message: "hello world"
137-
}, '*');
138-
// `you should replace * with the trusted domains list in production for security.` See how this can be
139-
// done securely with this example: https://github.com/phcode-dev/phcode.live/blob/6d64386fbb9d671cdb64622bc48ffe5f71959bff/docs/virtual-server-loader.js#L43
140-
// Abstract is that, pass in the parentOrigin as a query string parameter in iframe, and validate it against
141-
// a trusted domains list in your iframe.
142-
```
118+
}, '\*');
119+
// `you should replace * with the trusted domains list in production for security.` See how this can be
120+
// done securely with this example: [https://github.com/phcode-dev/phcode.live/blob/6d64386fbb9d671cdb64622bc48ffe5f71959bff/docs/virtual-server-loader.js#L43][8]
121+
// Abstract is that, pass in the parentOrigin as a query string parameter in iframe, and validate it against
122+
// a trusted domains list in your iframe.
143123

144124
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
145125

@@ -152,3 +132,7 @@ window.parent.postMessage({
152132
[5]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
153133

154134
[6]: https://developer.mozilla.org/docs/Web/API/MessageEvent
135+
136+
[7]: http://mydomain.com
137+
138+
[8]: https://github.com/phcode-dev/phcode.live/blob/6d64386fbb9d671cdb64622bc48ffe5f71959bff/docs/virtual-server-loader.js#L43

docs/generatedApiDocs/utils/ExtensionInterface-API.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,16 @@ interface made available.
4242

4343
Registers a named extension interface. Will overwrite if an interface of the same name is already present.
4444

45+
To register an interface `angularCli`
46+
ExtensionInterface.registerExtensionInterface("angularCli", exports);
47+
4548
Type: [function][1]
4649

4750
### Parameters
4851

4952
* `extensionInterfaceName` **[string][2]**
5053
* `interfaceObject` **[Object][3]**
5154

52-
### Examples
53-
54-
To register an interface `angularCli`
55-
56-
```javascript
57-
ExtensionInterface.registerExtensionInterface("angularCli", exports);
58-
```
59-
6055
## isExistsExtensionInterface
6156

6257
Returns true is an interface of the given name exists.
@@ -74,25 +69,20 @@ Returns **[boolean][4]**
7469
Returns a promise that gets resolved only when an ExtensionInterface of the given name is registered. Use this
7570
getter to get hold of extensions interface predictably.
7671

77-
Type: [function][1]
78-
79-
### Parameters
80-
81-
* `extensionInterfaceName`
82-
83-
### Examples
84-
8572
To get a registered interface `angularCli`
86-
87-
```javascript
8873
let angularCli;
8974
ExtensionInterface.waitAndGetExtensionInterface("angularCli").then(interfaceObj=> angularCli = interfaceObj);
9075
...
9176
if(angularCli){ // check if angular cli is avilable
9277
angularCli.callSomeFunction();
9378
}
9479
...
95-
```
80+
81+
Type: [function][1]
82+
83+
### Parameters
84+
85+
* `extensionInterfaceName`
9686

9787
Returns **[Promise][5]**
9888

docs/generatedApiDocs/utils/FeatureGate-API.md

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ if(FeatureGate.isFeatureEnabled(FEATURE_NEW_COLORS)){
4141
## registerFeatureGate
4242

4343
Registers a named feature with the default enabled state.
44+
To register a feature gate with name `myExtension.newColors`
45+
const FEATURE_NEW_COLORS = 'myExtension.newColors';
46+
FeatureGate.registerFeatureGate(FEATURE_NEW_COLORS, false); // false is the default value here
4447

4548
Type: [function][1]
4649

@@ -49,15 +52,6 @@ Type: [function][1]
4952
* `featureName` **[string][2]**
5053
* `enabledDefault` **[boolean][3]**
5154

52-
### Examples
53-
54-
To register a feature gate with name `myExtension.newColors`
55-
56-
```javascript
57-
const FEATURE_NEW_COLORS = 'myExtension.newColors';
58-
FeatureGate.registerFeatureGate(FEATURE_NEW_COLORS, false); // false is the default value here
59-
```
60-
6155
## getAllRegisteredFeatures
6256

6357
Returns an array of all named registered feature gates.
@@ -69,24 +63,18 @@ Returns **\[[String][2]]** list of registered features
6963
## isFeatureEnabled
7064

7165
Returns true is an featureGate is enabled either by default or overridden by the user using local storage.
66+
To check if the feature `myExtension.newColors` is enabled
67+
const FEATURE_NEW_COLORS = 'myExtension.newColors';
68+
if(FeatureGate.isFeatureEnabled(FEATURE_NEW_COLORS)){
69+
// do fancy colors here
70+
}
7271

7372
Type: [function][1]
7473

7574
### Parameters
7675

7776
* `featureName` **[string][2]**
7877

79-
### Examples
80-
81-
To check if the feature `myExtension.newColors` is enabled
82-
83-
```javascript
84-
const FEATURE_NEW_COLORS = 'myExtension.newColors';
85-
if(FeatureGate.isFeatureEnabled(FEATURE_NEW_COLORS)){
86-
// do fancy colors here
87-
}
88-
```
89-
9078
Returns **[boolean][3]**
9179

9280
## setFeatureEnabled

docs/generatedApiDocs/utils/Metrics-API.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ Type: [Object][1]
3434
## countEvent
3535

3636
log a numeric count >=0
37+
To log that user clicked searchButton 5 times:
38+
Metrics.countEvent(Metrics.EVENT_TYPE.UI, "searchButton", "click");
39+
Metrics.countEvent(Metrics.EVENT_TYPE.UI, "searchButton", "click", 5);
3740

3841
Type: [function][2]
3942

@@ -47,18 +50,11 @@ Type: [function][2]
4750
needs to be logged- should be a js var compatible string
4851
* `count` **[number][5]** > \=0 , optional, if not set defaults to 1 (optional, default `1`)
4952

50-
### Examples
51-
52-
To log that user clicked searchButton 5 times:
53-
54-
```javascript
55-
Metrics.countEvent(Metrics.EVENT_TYPE.UI, "searchButton", "click");
56-
Metrics.countEvent(Metrics.EVENT_TYPE.UI, "searchButton", "click", 5);
57-
```
58-
5953
## valueEvent
6054

6155
log a numeric value (number).
56+
To log that startup time is 200ms:
57+
Metrics.valueEvent(Metrics.EVENT_TYPE.PERFORMANCE, "startupTime", "ms", 200);
6258

6359
Type: [function][2]
6460

@@ -72,14 +68,6 @@ Type: [function][2]
7268
needs to be logged- should be a js var compatible string
7369
* `value` **[number][5]**
7470

75-
### Examples
76-
77-
To log that startup time is 200ms:
78-
79-
```javascript
80-
Metrics.valueEvent(Metrics.EVENT_TYPE.PERFORMANCE, "startupTime", "ms", 200);
81-
```
82-
8371
## flushMetrics
8472

8573
Send all pending metrics, useful before app quit.

0 commit comments

Comments
 (0)