goblin-desktop 2.0.13 → 2.0.16

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.
package/.editorconfig CHANGED
@@ -1,9 +1,9 @@
1
- root = true
2
-
3
- [*.{js,jsx,json}]
4
- indent_style = space
5
- indent_size = 2
6
- charset = utf-8
7
- trim_trailing_whitespace = true
8
- insert_final_newline = true
9
- max_line_length = 80
1
+ root = true
2
+
3
+ [*.{js,jsx,json}]
4
+ indent_style = space
5
+ indent_size = 2
6
+ charset = utf-8
7
+ trim_trailing_whitespace = true
8
+ insert_final_newline = true
9
+ max_line_length = 80
package/.eslintrc.js CHANGED
@@ -1,28 +1,28 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- root: true,
5
- parserOptions: {
6
- ecmaVersion: 7,
7
- sourceType: 'module',
8
- ecmaFeatures: {
9
- jsx: true,
10
- },
11
- },
12
- env: {
13
- browser: true,
14
- mocha: true,
15
- node: true,
16
- es6: true,
17
- },
18
- parser: 'babel-eslint',
19
- plugins: ['react', 'babel'],
20
- extends: ['prettier', 'eslint:recommended', 'plugin:react/recommended'],
21
- rules: {
22
- // Other rules
23
- 'no-console': 'off',
24
- 'valid-jsdoc': ['error', {requireReturn: false}],
25
- 'eqeqeq': 'error',
26
- 'react/display-name': 'off',
27
- },
28
- };
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ root: true,
5
+ parserOptions: {
6
+ ecmaVersion: 7,
7
+ sourceType: 'module',
8
+ ecmaFeatures: {
9
+ jsx: true,
10
+ },
11
+ },
12
+ env: {
13
+ browser: true,
14
+ mocha: true,
15
+ node: true,
16
+ es6: true,
17
+ },
18
+ parser: 'babel-eslint',
19
+ plugins: ['react', 'babel'],
20
+ extends: ['prettier', 'eslint:recommended', 'plugin:react/recommended'],
21
+ rules: {
22
+ // Other rules
23
+ 'no-console': 'off',
24
+ 'valid-jsdoc': ['error', {requireReturn: false}],
25
+ 'eqeqeq': 'error',
26
+ 'react/display-name': 'off',
27
+ },
28
+ };
package/.zou-flow ADDED
@@ -0,0 +1,3 @@
1
+ [update-version]
2
+ freezed = true
3
+ package-json = package.json
@@ -1,3 +1,3 @@
1
- module.exports = {
2
- buildWizard: require('./wizard.js'),
3
- };
1
+ module.exports = {
2
+ buildWizard: require('./wizard.js'),
3
+ };
@@ -42,6 +42,7 @@ module.exports = (config) => {
42
42
  const wizardSteps = Object.keys(steps);
43
43
  const wizardFlow = ['init'].concat(wizardSteps);
44
44
  const hinterIdsByName = {};
45
+ const hinterWidgetIdsByName = {};
45
46
  // Define logic handlers according rc.json
46
47
  const logicHandlers = {
47
48
  'create': (state, action) => {
@@ -177,7 +178,9 @@ module.exports = (config) => {
177
178
  }
178
179
  if (quest.hasAPI(`${hName}-hinter`)) {
179
180
  const id = `${hName}-hinter@${h}@${quest.goblin.id}`;
181
+ const widgetId = `hinter@${hName}@${quest.goblin.id}`;
180
182
  hinterIdsByName[h] = id;
183
+ hinterWidgetIdsByName[h] = widgetId;
181
184
  quest.create(
182
185
  `${hName}-hinter`,
183
186
  {
@@ -398,8 +401,8 @@ module.exports = (config) => {
398
401
  type,
399
402
  withDetail = true
400
403
  ) {
401
- const hinterId = hinterIdsByName[type];
402
- const hinterAPI = quest.getAPI(hinterId).noThrow();
404
+ const hinterWidgetId = hinterWidgetIdsByName[type];
405
+ const hinterAPI = quest.getAPI(hinterWidgetId).noThrow();
403
406
  yield hinterAPI.show();
404
407
  if (withDetail) {
405
408
  yield hinterAPI.showDetail();
@@ -418,12 +421,12 @@ module.exports = (config) => {
418
421
  type,
419
422
  entityId
420
423
  ) {
421
- const hinterId = hinterIdsByName[type];
424
+ const hinterWidgetId = hinterWidgetIdsByName[type];
422
425
  const deskAPI = quest.getAPI(quest.getDesktop()).noThrow();
423
426
  yield deskAPI.setDetail({
424
- hinterId,
427
+ hinterId: hinterWidgetId,
425
428
  });
426
- const hinterAPI = quest.getAPI(hinterId).noThrow();
429
+ const hinterAPI = quest.getAPI(hinterWidgetId).noThrow();
427
430
  yield hinterAPI.setCurrentDetailEntity({entityId});
428
431
  });
429
432
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goblin-desktop",
3
- "version": "2.0.13",
3
+ "version": "2.0.16",
4
4
  "description": "Goblin Desktop",
5
5
  "main": "./builders/builders.js",
6
6
  "scripts": {
@@ -1,35 +1,35 @@
1
- //T:2019-02-27
2
- import {fromJS} from 'immutable';
3
-
4
- const initialState = fromJS({
5
- showPrompt: false,
6
- widgetsCache: {},
7
- });
8
-
9
- const WIDGETS_CACHE_LIMIT = 128;
10
-
11
- export default (state = initialState, action = {}) => {
12
- switch (action.type) {
13
- case 'TOGGLEPROMPT': {
14
- return state.set('showPrompt', !state.get('showPrompt'));
15
- }
16
-
17
- /* Limited cache in size to store values for some widgets like for example
18
- * the ScrollableContainer. Because this cache is limited, it's possible
19
- * to lose the data at any time.
20
- */
21
- case 'WIDGET_CACHE': {
22
- const id = action.widgetId;
23
- if (state.has(`widgetsCache.${id}`)) {
24
- return state.set(`widgetsCache.${id}`, action.value);
25
- }
26
- let widgetsCache = state.get('widgetsCache');
27
- if (widgetsCache.size >= WIDGETS_CACHE_LIMIT) {
28
- const _id = widgetsCache.keySeq().first();
29
- state = state.del(`widgetsCache.${_id}`);
30
- }
31
- return state.set(`widgetsCache.${id}`, action.value);
32
- }
33
- }
34
- return state;
35
- };
1
+ //T:2019-02-27
2
+ import {fromJS} from 'immutable';
3
+
4
+ const initialState = fromJS({
5
+ showPrompt: false,
6
+ widgetsCache: {},
7
+ });
8
+
9
+ const WIDGETS_CACHE_LIMIT = 128;
10
+
11
+ export default (state = initialState, action = {}) => {
12
+ switch (action.type) {
13
+ case 'TOGGLEPROMPT': {
14
+ return state.set('showPrompt', !state.get('showPrompt'));
15
+ }
16
+
17
+ /* Limited cache in size to store values for some widgets like for example
18
+ * the ScrollableContainer. Because this cache is limited, it's possible
19
+ * to lose the data at any time.
20
+ */
21
+ case 'WIDGET_CACHE': {
22
+ const id = action.widgetId;
23
+ if (state.has(`widgetsCache.${id}`)) {
24
+ return state.set(`widgetsCache.${id}`, action.value);
25
+ }
26
+ let widgetsCache = state.get('widgetsCache');
27
+ if (widgetsCache.size >= WIDGETS_CACHE_LIMIT) {
28
+ const _id = widgetsCache.keySeq().first();
29
+ state = state.del(`widgetsCache.${_id}`);
30
+ }
31
+ return state.set(`widgetsCache.${id}`, action.value);
32
+ }
33
+ }
34
+ return state;
35
+ };
@@ -2,7 +2,6 @@
2
2
 
3
3
  const path = require('path');
4
4
  const Goblin = require('xcraft-core-goblin');
5
- const {v4: uuidV4} = require('uuid');
6
5
  const watt = require('gigawatts');
7
6
  const goblinName = path.basename(module.parent.filename, '.js');
8
7
  const StringBuilder = require('goblin-nabu/lib/string-builder.js');
@@ -530,7 +529,7 @@ Goblin.registerQuest(goblinName, 'add-notification', function (
530
529
  broadcast
531
530
  ) {
532
531
  if (!notificationId) {
533
- notificationId = uuidV4();
532
+ notificationId = quest.uuidV4();
534
533
  }
535
534
 
536
535
  message = StringBuilder.combine(message);
@@ -217,11 +217,9 @@ class DesktopMonitors extends Widget {
217
217
  </RetroPanel>
218
218
  );
219
219
  } else {
220
- let glyph = 'light/square';
221
- let glyphColor = this.context.theme.palette.buttonDisableText;
220
+ let glyphColor = null; // default
222
221
  if (this.props.isActive) {
223
- glyph = 'solid/square';
224
- glyphColor = '#0f0';
222
+ glyphColor = '#0f0'; // green
225
223
  }
226
224
 
227
225
  return (
@@ -230,8 +228,9 @@ class DesktopMonitors extends Widget {
230
228
  kind="button-footer"
231
229
  width="140px"
232
230
  justify="start"
233
- glyph={glyph}
231
+ glyph="light/monitor-heart-rate"
234
232
  glyphColor={glyphColor}
233
+ active={this.showMonitor}
235
234
  text={T('Activité')}
236
235
  onClick={this.onMonitor}
237
236
  />
@@ -218,7 +218,6 @@ class DesktopNotebook extends Widget {
218
218
  );
219
219
  } else {
220
220
  let glyph = 'solid/pen';
221
- let glyphColor = this.context.theme.palette.buttonDisableText;
222
221
 
223
222
  return (
224
223
  <>
@@ -227,8 +226,8 @@ class DesktopNotebook extends Widget {
227
226
  width="140px"
228
227
  justify="start"
229
228
  glyph={glyph}
230
- glyphColor={glyphColor}
231
229
  text={T('Notes')}
230
+ active={this.showMonitor}
232
231
  onClick={this.onMonitor}
233
232
  />
234
233
  </>
@@ -91,7 +91,7 @@ class DesktopStateMonitor extends Widget {
91
91
  kind="button-footer"
92
92
  width="120px"
93
93
  glyph="light/radar"
94
- glyphColor={this.props.showed ? '#0f0' : null}
94
+ active={this.props.showed}
95
95
  text={T('State')}
96
96
  onClick={this.onToggleStateMonitor}
97
97
  />
@@ -1,17 +1,17 @@
1
- //T:2019-02-27
2
-
3
- export default (state, action = {}) => {
4
- //Pre compensate loading
5
- if (action.type === 'set-loading') {
6
- return state.set('loading', true);
7
- }
8
- //Pre compensate loading
9
- if (action.type === 'set-entity') {
10
- if (state.get('entityId') !== action.data.entityId) {
11
- return state.set('loading', true);
12
- } else {
13
- return state.set('loading', false);
14
- }
15
- }
16
- return state;
17
- };
1
+ //T:2019-02-27
2
+
3
+ export default (state, action = {}) => {
4
+ //Pre compensate loading
5
+ if (action.type === 'set-loading') {
6
+ return state.set('loading', true);
7
+ }
8
+ //Pre compensate loading
9
+ if (action.type === 'set-entity') {
10
+ if (state.get('entityId') !== action.data.entityId) {
11
+ return state.set('loading', true);
12
+ } else {
13
+ return state.set('loading', false);
14
+ }
15
+ }
16
+ return state;
17
+ };
@@ -1,66 +1,66 @@
1
- /******************************************************************************/
2
-
3
- export default function styles() {
4
- const full = {
5
- margin: '0px',
6
- padding: '0px',
7
- overflowX: 'hidden',
8
- overflowY: 'hidden',
9
- flexGrow: '1',
10
- display: 'flex',
11
- flexDirection: 'column',
12
- backgroundColor: 'white',
13
- };
14
-
15
- const toolbar = {
16
- margin: '20px',
17
- };
18
-
19
- const list = {
20
- width: '100%',
21
- height: '100%',
22
- overflowX: 'auto',
23
- overflowY: 'hidden',
24
- display: 'flex',
25
- flexDirection: 'column',
26
- flexGrow: '1',
27
- };
28
-
29
- const content = {
30
- height: '100%',
31
- overflowX: 'hidden',
32
- overflowY: 'hidden',
33
- display: 'flex',
34
- flexDirection: 'column',
35
- flexGrow: '1',
36
- };
37
-
38
- const header = {
39
- minHeight: '24px',
40
- padding: '0px 36px 0px 16px',
41
- borderBottom: '1px solid #888',
42
- display: 'flex',
43
- flexDirection: 'row',
44
- flexGrow: '1',
45
- };
46
-
47
- const rows = {
48
- height: '100%',
49
- overflowX: 'hidden',
50
- overflowY: 'auto',
51
- display: 'flex',
52
- flexDirection: 'column',
53
- flexGrow: '1',
54
- };
55
-
56
- return {
57
- full,
58
- toolbar,
59
- list,
60
- content,
61
- header,
62
- rows,
63
- };
64
- }
65
-
66
- /******************************************************************************/
1
+ /******************************************************************************/
2
+
3
+ export default function styles() {
4
+ const full = {
5
+ margin: '0px',
6
+ padding: '0px',
7
+ overflowX: 'hidden',
8
+ overflowY: 'hidden',
9
+ flexGrow: '1',
10
+ display: 'flex',
11
+ flexDirection: 'column',
12
+ backgroundColor: 'white',
13
+ };
14
+
15
+ const toolbar = {
16
+ margin: '20px',
17
+ };
18
+
19
+ const list = {
20
+ width: '100%',
21
+ height: '100%',
22
+ overflowX: 'auto',
23
+ overflowY: 'hidden',
24
+ display: 'flex',
25
+ flexDirection: 'column',
26
+ flexGrow: '1',
27
+ };
28
+
29
+ const content = {
30
+ height: '100%',
31
+ overflowX: 'hidden',
32
+ overflowY: 'hidden',
33
+ display: 'flex',
34
+ flexDirection: 'column',
35
+ flexGrow: '1',
36
+ };
37
+
38
+ const header = {
39
+ minHeight: '24px',
40
+ padding: '0px 36px 0px 16px',
41
+ borderBottom: '1px solid #888',
42
+ display: 'flex',
43
+ flexDirection: 'row',
44
+ flexGrow: '1',
45
+ };
46
+
47
+ const rows = {
48
+ height: '100%',
49
+ overflowX: 'hidden',
50
+ overflowY: 'auto',
51
+ display: 'flex',
52
+ flexDirection: 'column',
53
+ flexGrow: '1',
54
+ };
55
+
56
+ return {
57
+ full,
58
+ toolbar,
59
+ list,
60
+ content,
61
+ header,
62
+ rows,
63
+ };
64
+ }
65
+
66
+ /******************************************************************************/
@@ -1,17 +1,17 @@
1
- /******************************************************************************/
2
-
3
- export default function styles() {
4
- const contentStyle = {
5
- position: 'relative',
6
- display: 'flex',
7
- flexGrow: '1',
8
- flexBasis: '0',
9
- flexShrink: '1',
10
- };
11
-
12
- return {
13
- content: contentStyle,
14
- };
15
- }
16
-
17
- /******************************************************************************/
1
+ /******************************************************************************/
2
+
3
+ export default function styles() {
4
+ const contentStyle = {
5
+ position: 'relative',
6
+ display: 'flex',
7
+ flexGrow: '1',
8
+ flexBasis: '0',
9
+ flexShrink: '1',
10
+ };
11
+
12
+ return {
13
+ content: contentStyle,
14
+ };
15
+ }
16
+
17
+ /******************************************************************************/
@@ -1,15 +1,15 @@
1
- //T:2019-02-27
2
-
3
- import Shredder from 'xcraft-core-shredder';
4
-
5
- const initialState = new Shredder({
6
- enabled: false,
7
- });
8
-
9
- export default (state = initialState, action) => {
10
- switch (action.type) {
11
- case 'TOGGLE': {
12
- return state.set('enabled', !state.get('enabled'));
13
- }
14
- }
15
- };
1
+ //T:2019-02-27
2
+
3
+ import Shredder from 'xcraft-core-shredder';
4
+
5
+ const initialState = new Shredder({
6
+ enabled: false,
7
+ });
8
+
9
+ export default (state = initialState, action) => {
10
+ switch (action.type) {
11
+ case 'TOGGLE': {
12
+ return state.set('enabled', !state.get('enabled'));
13
+ }
14
+ }
15
+ };
@@ -1,19 +1,19 @@
1
- //T:2019-02-27
2
-
3
- import Shredder from 'xcraft-core-shredder';
4
-
5
- const initialState = new Shredder({
6
- extendedId: null,
7
- });
8
-
9
- export default (state = initialState, action) => {
10
- switch (action.type) {
11
- case 'TOGGLE_EXTENDED': {
12
- const current = state.get('extendedId');
13
- if (current === action.entityId) {
14
- return state.set('extendedId', null);
15
- }
16
- return state.set('extendedId', action.entityId);
17
- }
18
- }
19
- };
1
+ //T:2019-02-27
2
+
3
+ import Shredder from 'xcraft-core-shredder';
4
+
5
+ const initialState = new Shredder({
6
+ extendedId: null,
7
+ });
8
+
9
+ export default (state = initialState, action) => {
10
+ switch (action.type) {
11
+ case 'TOGGLE_EXTENDED': {
12
+ const current = state.get('extendedId');
13
+ if (current === action.entityId) {
14
+ return state.set('extendedId', null);
15
+ }
16
+ return state.set('extendedId', action.entityId);
17
+ }
18
+ }
19
+ };
@@ -1,15 +1,15 @@
1
- //T:2019-02-27
2
-
3
- import Shredder from 'xcraft-core-shredder';
4
-
5
- const initialState = new Shredder({
6
- enabled: false,
7
- });
8
-
9
- export default (state = initialState, action) => {
10
- switch (action.type) {
11
- case 'TOGGLE': {
12
- return state.set('enabled', !state.get('enabled'));
13
- }
14
- }
15
- };
1
+ //T:2019-02-27
2
+
3
+ import Shredder from 'xcraft-core-shredder';
4
+
5
+ const initialState = new Shredder({
6
+ enabled: false,
7
+ });
8
+
9
+ export default (state = initialState, action) => {
10
+ switch (action.type) {
11
+ case 'TOGGLE': {
12
+ return state.set('enabled', !state.get('enabled'));
13
+ }
14
+ }
15
+ };
@@ -1,20 +1,20 @@
1
- /******************************************************************************/
2
-
3
- export default function styles(theme) {
4
- const fullScreen = {
5
- position: 'fixed',
6
- left: 0,
7
- right: 0,
8
- bottom: 0,
9
- top: 0,
10
- zIndex: 10,
11
- display: 'flex',
12
- backgroundColor: theme.palette.rootBackground,
13
- };
14
-
15
- return {
16
- fullScreen,
17
- };
18
- }
19
-
20
- /******************************************************************************/
1
+ /******************************************************************************/
2
+
3
+ export default function styles(theme) {
4
+ const fullScreen = {
5
+ position: 'fixed',
6
+ left: 0,
7
+ right: 0,
8
+ bottom: 0,
9
+ top: 0,
10
+ zIndex: 10,
11
+ display: 'flex',
12
+ backgroundColor: theme.palette.rootBackground,
13
+ };
14
+
15
+ return {
16
+ fullScreen,
17
+ };
18
+ }
19
+
20
+ /******************************************************************************/