@iebh/tera-fy 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,100 +1,93 @@
1
+ ## Classes
2
+
3
+ <dl>
4
+ <dt><a href="#TeraFy">TeraFy</a></dt>
5
+ <dd></dd>
6
+ </dl>
7
+
8
+ ## Functions
9
+
10
+ <dl>
11
+ <dt><a href="#send">send(message)</a> ⇒ <code>Promise.&lt;*&gt;</code></dt>
12
+ <dd><p>Send a message + wait for a response object</p>
13
+ </dd>
14
+ <dt><a href="#sendRaw">sendRaw(message)</a></dt>
15
+ <dd><p>Send raw message content to the server
16
+ This function does not return or wait for a reply - use <code>send()</code> for that</p>
17
+ </dd>
18
+ <dt><a href="#rpc">rpc(method)</a> ⇒ <code>Promise.&lt;*&gt;</code></dt>
19
+ <dd><p>Call an RPC function in the server instance</p>
20
+ </dd>
21
+ <dt><a href="#acceptMessage">acceptMessage(Raw)</a></dt>
22
+ <dd><p>Accept an incoming message</p>
23
+ </dd>
24
+ <dt><a href="#toggleDevMode">toggleDevMode([devModeEnabled])</a> ⇒ <code><a href="#TeraFy">TeraFy</a></code></dt>
25
+ <dd><p>Set or toggle devMode</p>
26
+ </dd>
27
+ <dt><a href="#init">init()</a></dt>
28
+ <dd><p>Initalize the TERA client singleton</p>
29
+ </dd>
30
+ <dt><a href="#injectMain">injectMain()</a></dt>
31
+ <dd><p>Find an existing active TERA server OR initalize one</p>
32
+ </dd>
33
+ <dt><a href="#injectStylesheet">injectStylesheet()</a></dt>
34
+ <dd><p>Inject a local stylesheet to handle TERA server functionality</p>
35
+ </dd>
36
+ <dt><a href="#injectMethods">injectMethods()</a></dt>
37
+ <dd><p>Inject all server methods defined in <code>methods</code> as local functions wrapped in the <code>rpc</code> function</p>
38
+ </dd>
39
+ <dt><a href="#debug">debug()</a></dt>
40
+ <dd><p>Debugging output function
41
+ This function will only act if <code>settings.devMode</code> is truthy</p>
42
+ </dd>
43
+ <dt><a href="#bindProjectState">bindProjectState([options], Paths)</a> ⇒ <code>Promies.&lt;Reactive.&lt;Object&gt;&gt;</code></dt>
44
+ <dd><p>Return a Vue reactive object that can be read/written which whose changes will transparently be written back to the TERA server instance</p>
45
+ </dd>
46
+ <dt><a href="#toggleFocus">toggleFocus([isFocused])</a></dt>
47
+ <dd><p>Fit the nested TERA server to a full-screen
48
+ This is usually because the server component wants to perform some user activity like calling $prompt</p>
49
+ </dd>
50
+ </dl>
51
+
1
52
  <a name="TeraFy"></a>
2
53
 
3
54
  ## TeraFy
4
55
  **Kind**: global class
5
-
6
- * [TeraFy](#TeraFy)
7
- * [new TeraFy()](#new_TeraFy_new)
8
- * [.settings](#TeraFy+settings) : <code>Object</code>
9
- * [.dom](#TeraFy+dom) : <code>Object</code>
10
- * [.methods](#TeraFy+methods) : <code>Array.&lt;String&gt;</code>
11
- * [.acceptPostboxes](#TeraFy+acceptPostboxes)
12
- * [.send(message)](#TeraFy+send) ⇒ <code>Promise.&lt;\*&gt;</code>
13
- * [.sendRaw(message)](#TeraFy+sendRaw)
14
- * [.rpc(method)](#TeraFy+rpc) ⇒ <code>Promise.&lt;\*&gt;</code>
15
- * [.acceptMessage(Raw)](#TeraFy+acceptMessage)
16
- * [.init()](#TeraFy+init)
17
- * [.injectMain()](#TeraFy+injectMain)
18
- * [.injectStylesheet()](#TeraFy+injectStylesheet)
19
- * [.injectMethods()](#TeraFy+injectMethods)
20
- * [.bindProjectState([options], Paths)](#TeraFy+bindProjectState) ⇒ <code>Promies.&lt;Reactive.&lt;Object&gt;&gt;</code>
21
-
22
56
  <a name="new_TeraFy_new"></a>
23
57
 
24
58
  ### new TeraFy()
25
59
  Main Tera-Fy Client (class singleton) to be used in a frontend browser
26
60
 
27
- <a name="TeraFy+settings"></a>
28
-
29
- ### teraFy.settings : <code>Object</code>
30
- Various settings to configure behaviour
31
-
32
- **Kind**: instance property of [<code>TeraFy</code>](#TeraFy)
33
- **Properties**
34
-
35
- | Name | Type | Description |
36
- | --- | --- | --- |
37
- | devMode | <code>Boolean</code> | Operate in devMode - i.e. force outer refresh when encountering an existing TeraFy instance |
38
- | siteUrl | <code>String</code> | The TERA URL to connect to |
39
- | restrictOrigin | <code>String</code> | URL to restrict communications to |
40
-
41
- <a name="TeraFy+dom"></a>
42
-
43
- ### teraFy.dom : <code>Object</code>
44
- DOMElements for this TeraFy instance
61
+ <a name="send"></a>
45
62
 
46
- **Kind**: instance property of [<code>TeraFy</code>](#TeraFy)
47
- **Properties**
48
-
49
- | Name | Type | Description |
50
- | --- | --- | --- |
51
- | el | <code>DOMElement</code> | The main tera-fy div wrapper |
52
- | iframe | <code>DOMElement</code> | The internal iFrame element |
53
- | stylesheet | <code>DOMElement</code> | The corresponding stylesheet |
54
-
55
- <a name="TeraFy+methods"></a>
56
-
57
- ### teraFy.methods : <code>Array.&lt;String&gt;</code>
58
- List of function stubs mapped here from the server
59
- This array is forms the reference of `TeraFy.METHOD()` objects to provide locally which will be mapped via `TeraFy.rpc(METHOD, ...args)`
60
-
61
- **Kind**: instance property of [<code>TeraFy</code>](#TeraFy)
62
- <a name="TeraFy+acceptPostboxes"></a>
63
-
64
- ### teraFy.acceptPostboxes
65
- Listening postboxes, these correspond to outgoing message IDs that expect a response
66
-
67
- **Kind**: instance property of [<code>TeraFy</code>](#TeraFy)
68
- <a name="TeraFy+send"></a>
69
-
70
- ### teraFy.send(message) ⇒ <code>Promise.&lt;\*&gt;</code>
63
+ ## send(message) <code>Promise.&lt;\*&gt;</code>
71
64
  Send a message + wait for a response object
72
65
 
73
- **Kind**: instance method of [<code>TeraFy</code>](#TeraFy)
66
+ **Kind**: global function
74
67
  **Returns**: <code>Promise.&lt;\*&gt;</code> - A promise which resolves when the operation has completed with the remote reply
75
68
 
76
69
  | Param | Type | Description |
77
70
  | --- | --- | --- |
78
71
  | message | <code>Object</code> | Message object to send |
79
72
 
80
- <a name="TeraFy+sendRaw"></a>
73
+ <a name="sendRaw"></a>
81
74
 
82
- ### teraFy.sendRaw(message)
75
+ ## sendRaw(message)
83
76
  Send raw message content to the server
84
77
  This function does not return or wait for a reply - use `send()` for that
85
78
 
86
- **Kind**: instance method of [<code>TeraFy</code>](#TeraFy)
79
+ **Kind**: global function
87
80
 
88
81
  | Param | Type | Description |
89
82
  | --- | --- | --- |
90
83
  | message | <code>Object</code> | Message object to send |
91
84
 
92
- <a name="TeraFy+rpc"></a>
85
+ <a name="rpc"></a>
93
86
 
94
- ### teraFy.rpc(method) ⇒ <code>Promise.&lt;\*&gt;</code>
87
+ ## rpc(method) ⇒ <code>Promise.&lt;\*&gt;</code>
95
88
  Call an RPC function in the server instance
96
89
 
97
- **Kind**: instance method of [<code>TeraFy</code>](#TeraFy)
90
+ **Kind**: global function
98
91
  **Returns**: <code>Promise.&lt;\*&gt;</code> - The resolved output of the server function
99
92
 
100
93
  | Param | Type | Description |
@@ -102,47 +95,71 @@ Call an RPC function in the server instance
102
95
  | method | <code>String</code> | The method name to call |
103
96
  | [...] | <code>\*</code> | Optional arguments to pass to the function |
104
97
 
105
- <a name="TeraFy+acceptMessage"></a>
98
+ <a name="acceptMessage"></a>
106
99
 
107
- ### teraFy.acceptMessage(Raw)
100
+ ## acceptMessage(Raw)
108
101
  Accept an incoming message
109
102
 
110
- **Kind**: instance method of [<code>TeraFy</code>](#TeraFy)
103
+ **Kind**: global function
111
104
 
112
105
  | Param | Type | Description |
113
106
  | --- | --- | --- |
114
107
  | Raw | <code>MessageEvent</code> | message event to process |
115
108
 
116
- <a name="TeraFy+init"></a>
109
+ <a name="toggleDevMode"></a>
110
+
111
+ ## toggleDevMode([devModeEnabled]) ⇒ [<code>TeraFy</code>](#TeraFy)
112
+ Set or toggle devMode
117
113
 
118
- ### teraFy.init()
114
+ **Kind**: global function
115
+ **Returns**: [<code>TeraFy</code>](#TeraFy) - This chainable terafy instance
116
+
117
+ | Param | Type | Default | Description |
118
+ | --- | --- | --- | --- |
119
+ | [devModeEnabled] | <code>String</code> \| <code>Boolean</code> | <code>&#x27;toggle&#x27;</code> | Optional boolean to force dev mode |
120
+
121
+ <a name="init"></a>
122
+
123
+ ## init()
119
124
  Initalize the TERA client singleton
120
125
 
121
- **Kind**: instance method of [<code>TeraFy</code>](#TeraFy)
122
- <a name="TeraFy+injectMain"></a>
126
+ **Kind**: global function
127
+ <a name="injectMain"></a>
123
128
 
124
- ### teraFy.injectMain()
129
+ ## injectMain()
125
130
  Find an existing active TERA server OR initalize one
126
131
 
127
- **Kind**: instance method of [<code>TeraFy</code>](#TeraFy)
128
- <a name="TeraFy+injectStylesheet"></a>
132
+ **Kind**: global function
133
+ <a name="injectStylesheet"></a>
129
134
 
130
- ### teraFy.injectStylesheet()
135
+ ## injectStylesheet()
131
136
  Inject a local stylesheet to handle TERA server functionality
132
137
 
133
- **Kind**: instance method of [<code>TeraFy</code>](#TeraFy)
134
- <a name="TeraFy+injectMethods"></a>
138
+ **Kind**: global function
139
+ <a name="injectMethods"></a>
135
140
 
136
- ### teraFy.injectMethods()
141
+ ## injectMethods()
137
142
  Inject all server methods defined in `methods` as local functions wrapped in the `rpc` function
138
143
 
139
- **Kind**: instance method of [<code>TeraFy</code>](#TeraFy)
140
- <a name="TeraFy+bindProjectState"></a>
144
+ **Kind**: global function
145
+ <a name="debug"></a>
141
146
 
142
- ### teraFy.bindProjectState([options], Paths) ⇒ <code>Promies.&lt;Reactive.&lt;Object&gt;&gt;</code>
147
+ ## debug()
148
+ Debugging output function
149
+ This function will only act if `settings.devMode` is truthy
150
+
151
+ **Kind**: global function
152
+
153
+ | Param | Type | Description |
154
+ | --- | --- | --- |
155
+ | [msg...] | <code>String</code> | Output to show |
156
+
157
+ <a name="bindProjectState"></a>
158
+
159
+ ## bindProjectState([options], Paths) ⇒ <code>Promies.&lt;Reactive.&lt;Object&gt;&gt;</code>
143
160
  Return a Vue reactive object that can be read/written which whose changes will transparently be written back to the TERA server instance
144
161
 
145
- **Kind**: instance method of [<code>TeraFy</code>](#TeraFy)
162
+ **Kind**: global function
146
163
  **Returns**: <code>Promies.&lt;Reactive.&lt;Object&gt;&gt;</code> - A reactive object representing the project state
147
164
 
148
165
  | Param | Type | Default | Description |
@@ -152,3 +169,15 @@ Return a Vue reactive object that can be read/written which whose changes will t
152
169
  | [options.write] | <code>Boolean</code> | <code>true</code> | Allow local reactivity to writes - send these to the server |
153
170
  | Paths | <code>Array.&lt;String&gt;</code> | | to subscribe to e.g. ['/users/'], |
154
171
 
172
+ <a name="toggleFocus"></a>
173
+
174
+ ## toggleFocus([isFocused])
175
+ Fit the nested TERA server to a full-screen
176
+ This is usually because the server component wants to perform some user activity like calling $prompt
177
+
178
+ **Kind**: global function
179
+
180
+ | Param | Type | Default | Description |
181
+ | --- | --- | --- | --- |
182
+ | [isFocused] | <code>String</code> \| <code>Boolean</code> | <code>&#x27;toggle&#x27;</code> | Whether to fullscreen the embedded component |
183
+