@finos/legend-application 15.0.46 → 15.0.48

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/lib/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /** @license @finos/legend-application v15.0.46
1
+ /** @license @finos/legend-application v15.0.48
2
2
  * Copyright (c) 2020-present, Goldman Sachs
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application",
3
- "version": "15.0.46",
3
+ "version": "15.0.48",
4
4
  "description": "Legend application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -17,6 +17,8 @@ import type { GenericLegendApplicationStore } from './ApplicationStore.js';
17
17
  export declare class ClipboardService {
18
18
  readonly applicationStore: GenericLegendApplicationStore;
19
19
  constructor(applicationStore: GenericLegendApplicationStore);
20
- copyTextToClipboard(text: string): Promise<void>;
20
+ copyTextToClipboard(text: string, options?: {
21
+ notifySuccessMessage?: string;
22
+ }): Promise<void>;
21
23
  }
22
24
  //# sourceMappingURL=ClipboardService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClipboardService.d.ts","sourceRoot":"","sources":["../../src/stores/ClipboardService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE3E,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,gBAAgB,EAAE,6BAA6B,CAAC;gBAE7C,gBAAgB,EAAE,6BAA6B;IAIrD,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAOvD"}
1
+ {"version":3,"file":"ClipboardService.d.ts","sourceRoot":"","sources":["../../src/stores/ClipboardService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE3E,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,gBAAgB,EAAE,6BAA6B,CAAC;gBAE7C,gBAAgB,EAAE,6BAA6B;IAIrD,mBAAmB,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QACR,oBAAoB,CAAC,EAAE,MAAM,CAAC;KAC/B,GACA,OAAO,CAAC,IAAI,CAAC;CAgBjB"}
@@ -18,11 +18,18 @@ export class ClipboardService {
18
18
  constructor(applicationStore) {
19
19
  this.applicationStore = applicationStore;
20
20
  }
21
- async copyTextToClipboard(text) {
21
+ async copyTextToClipboard(text, options) {
22
22
  // This is a much cleaner way which requires HTTPS
23
23
  // See https://developers.google.com/web/updates/2018/03/clipboardapi
24
- await navigator.clipboard.writeText(text).catch((error) => {
24
+ await navigator.clipboard
25
+ .writeText(text)
26
+ .catch((error) => {
25
27
  this.applicationStore.notificationService.notifyError(error);
28
+ })
29
+ .finally(() => {
30
+ if (options?.notifySuccessMessage) {
31
+ this.applicationStore.notificationService.notifySuccess(options.notifySuccessMessage);
32
+ }
26
33
  });
27
34
  }
28
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ClipboardService.js","sourceRoot":"","sources":["../../src/stores/ClipboardService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,OAAO,gBAAgB;IAClB,gBAAgB,CAAgC;IAEzD,YAAY,gBAA+C;QACzD,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,IAAY;QACpC,kDAAkD;QAClD,qEAAqE;QACrE,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACxD,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"ClipboardService.js","sourceRoot":"","sources":["../../src/stores/ClipboardService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,OAAO,gBAAgB;IAClB,gBAAgB,CAAgC;IAEzD,YAAY,gBAA+C;QACzD,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,IAAY,EACZ,OAEC;QAED,kDAAkD;QAClD,qEAAqE;QACrE,MAAM,SAAS,CAAC,SAAS;aACtB,SAAS,CAAC,IAAI,CAAC;aACf,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC;aACD,OAAO,CAAC,GAAG,EAAE;YACZ,IAAI,OAAO,EAAE,oBAAoB,EAAE;gBACjC,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,aAAa,CACrD,OAAO,CAAC,oBAAoB,CAC7B,CAAC;aACH;QACH,CAAC,CAAC,CAAC;IACP,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application",
3
- "version": "15.0.46",
3
+ "version": "15.0.48",
4
4
  "description": "Legend application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -45,7 +45,7 @@
45
45
  "test:watch": "jest --watch"
46
46
  },
47
47
  "dependencies": {
48
- "@finos/legend-art": "7.1.0",
48
+ "@finos/legend-art": "7.1.2",
49
49
  "@finos/legend-shared": "10.0.27",
50
50
  "@types/react": "18.2.22",
51
51
  "@types/react-dom": "18.2.7",
@@ -23,11 +23,25 @@ export class ClipboardService {
23
23
  this.applicationStore = applicationStore;
24
24
  }
25
25
 
26
- async copyTextToClipboard(text: string): Promise<void> {
26
+ async copyTextToClipboard(
27
+ text: string,
28
+ options?: {
29
+ notifySuccessMessage?: string;
30
+ },
31
+ ): Promise<void> {
27
32
  // This is a much cleaner way which requires HTTPS
28
33
  // See https://developers.google.com/web/updates/2018/03/clipboardapi
29
- await navigator.clipboard.writeText(text).catch((error) => {
30
- this.applicationStore.notificationService.notifyError(error);
31
- });
34
+ await navigator.clipboard
35
+ .writeText(text)
36
+ .catch((error) => {
37
+ this.applicationStore.notificationService.notifyError(error);
38
+ })
39
+ .finally(() => {
40
+ if (options?.notifySuccessMessage) {
41
+ this.applicationStore.notificationService.notifySuccess(
42
+ options.notifySuccessMessage,
43
+ );
44
+ }
45
+ });
32
46
  }
33
47
  }