goblin-desktop 4.0.8 → 4.0.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goblin-desktop",
3
- "version": "4.0.8",
3
+ "version": "4.0.12",
4
4
  "description": "Goblin Desktop",
5
5
  "main": "./builders/builders.js",
6
6
  "scripts": {
@@ -1,13 +1,24 @@
1
1
  'use strict';
2
2
 
3
- /**
4
- * Retrieve the list of available commands.
5
- *
6
- * @returns {Object} The list and definitions of commands.
7
- */
8
- exports.xcraftCommands = function () {
9
- return require(`./widgets/${require('path').basename(
10
- __filename,
11
- '.js'
12
- )}/service.js`);
13
- };
3
+ try {
4
+ require('goblin-workshop');
5
+
6
+ /**
7
+ * Retrieve the list of available commands.
8
+ *
9
+ * @returns {Object} The list and definitions of commands.
10
+ */
11
+ exports.xcraftCommands = function () {
12
+ return require(`./widgets/${require('path').basename(
13
+ __filename,
14
+ '.js'
15
+ )}/service.js`);
16
+ };
17
+ } catch (ex) {
18
+ if (ex.code !== 'MODULE_NOT_FOUND') {
19
+ throw ex;
20
+ }
21
+ console.log(
22
+ `Skip ${__filename} initialization, goblin-workshop not available`
23
+ );
24
+ }
@@ -1,13 +1,24 @@
1
1
  'use strict';
2
2
 
3
- /**
4
- * Retrieve the list of available commands.
5
- *
6
- * @returns {Object} The list and definitions of commands.
7
- */
8
- exports.xcraftCommands = function () {
9
- return require(`./widgets/${require('path').basename(
10
- __filename,
11
- '.js'
12
- )}/service.js`);
13
- };
3
+ try {
4
+ require('goblin-workshop');
5
+
6
+ /**
7
+ * Retrieve the list of available commands.
8
+ *
9
+ * @returns {Object} The list and definitions of commands.
10
+ */
11
+ exports.xcraftCommands = function () {
12
+ return require(`./widgets/${require('path').basename(
13
+ __filename,
14
+ '.js'
15
+ )}/service.js`);
16
+ };
17
+ } catch (ex) {
18
+ if (ex.code !== 'MODULE_NOT_FOUND') {
19
+ throw ex;
20
+ }
21
+ console.log(
22
+ `Skip ${__filename} initialization, goblin-workshop not available`
23
+ );
24
+ }
@@ -66,6 +66,8 @@ module.exports = {
66
66
  total: action.get('total'),
67
67
  externalUrl: action.get('externalUrl'),
68
68
  isDownload: action.get('isDownload'),
69
+ temporary: action.get('temporary'),
70
+ duration: action.get('duration'),
69
71
  };
70
72
  return state.set(`notifications.${notificationId}`, notification);
71
73
  },
@@ -538,7 +538,9 @@ Goblin.registerQuest(goblinName, 'add-notification', function (
538
538
  command,
539
539
  externalUrl,
540
540
  isDownload,
541
- broadcast
541
+ broadcast,
542
+ temporary,
543
+ duration
542
544
  ) {
543
545
  if (!notificationId) {
544
546
  notificationId = quest.uuidV4();
@@ -557,6 +559,8 @@ Goblin.registerQuest(goblinName, 'add-notification', function (
557
559
  command,
558
560
  externalUrl,
559
561
  isDownload,
562
+ temporary,
563
+ duration,
560
564
  }
561
565
  );
562
566
  return;
@@ -570,6 +574,8 @@ Goblin.registerQuest(goblinName, 'add-notification', function (
570
574
  command,
571
575
  externalUrl,
572
576
  isDownload,
577
+ temporary,
578
+ duration,
573
579
  });
574
580
  const dnd = quest.goblin.getState().get('dnd');
575
581
  if (!dnd) {
@@ -127,13 +127,13 @@ class DesktopScale extends Widget {
127
127
  );
128
128
  }
129
129
 
130
- renderButton() {
130
+ renderButton({onClick}) {
131
131
  return (
132
132
  <Button
133
133
  glyph="solid/binoculars"
134
134
  kind="main-tab-right"
135
135
  tooltip={T('Choix du zoom')}
136
- onClick={this.onToggleDialog}
136
+ onClick={onClick}
137
137
  />
138
138
  );
139
139
  }
@@ -142,10 +142,10 @@ class DesktopScale extends Widget {
142
142
  if (!window.zoomable) {
143
143
  return null;
144
144
  }
145
-
145
+ const renderButton = this.props.renderButton || this.renderButton;
146
146
  return (
147
147
  <div className={this.styles.classNames.desktopScale}>
148
- {this.renderButton()}
148
+ {renderButton({onClick: this.onToggleDialog})}
149
149
  {this.renderDialog()}
150
150
  </div>
151
151
  );