@valiantys/atlassian-app 3.2.0-alpha-13 → 3.2.0-alpha-14

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../app-flags-dispatch/index.cjs.js");function p(){const s=d.useAppFlagsDispatch();function i(t){s({type:"add",id:t.id,props:t})}function a(t){s({type:"remove",id:t})}function o(t,c,e,n){i({id:t,isAutoDismiss:!1,type:"error",title:c,description:e instanceof Error?e.message:typeof e=="string"?e:"Uncaught error occurred!",actions:n})}return{addFlag:i,removeFlag:a,addErrorFlag:o}}exports.useAppFlagsDispatchMethods=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),u=require("../app-flags-dispatch/index.cjs.js");function d(){const s=u.useAppFlagsDispatch();return n.useMemo(()=>{function i(e){s({type:"add",id:e.id,props:e})}function a(e){s({type:"remove",id:e})}function o(e,r,t,c){i({id:e,isAutoDismiss:!1,type:"error",title:r,description:t instanceof Error?t.message:typeof t=="string"?t:"Uncaught error occurred!",actions:c})}return{addFlag:i,removeFlag:a,addErrorFlag:o}},[s])}exports.useAppFlagsDispatchMethods=d;
@@ -1,35 +1,38 @@
1
+ import { useMemo as d } from "react";
1
2
  import { useAppFlagsDispatch as c } from "../app-flags-dispatch/index.es.js";
2
- function p() {
3
- const e = c();
4
- function s(t) {
5
- e({
6
- type: "add",
7
- id: t.id,
8
- props: t
9
- });
10
- }
11
- function a(t) {
12
- e({
13
- type: "remove",
14
- id: t
15
- });
16
- }
17
- function o(t, n, i, d) {
18
- s({
19
- id: t,
20
- isAutoDismiss: !1,
21
- type: "error",
22
- title: n,
23
- description: i instanceof Error ? i.message : typeof i == "string" ? i : "Uncaught error occurred!",
24
- actions: d
25
- });
26
- }
27
- return {
28
- addFlag: s,
29
- removeFlag: a,
30
- addErrorFlag: o
31
- };
3
+ function f() {
4
+ const i = c();
5
+ return d(() => {
6
+ function o(t) {
7
+ i({
8
+ type: "add",
9
+ id: t.id,
10
+ props: t
11
+ });
12
+ }
13
+ function s(t) {
14
+ i({
15
+ type: "remove",
16
+ id: t
17
+ });
18
+ }
19
+ function r(t, a, e, n) {
20
+ o({
21
+ id: t,
22
+ isAutoDismiss: !1,
23
+ type: "error",
24
+ title: a,
25
+ description: e instanceof Error ? e.message : typeof e == "string" ? e : "Uncaught error occurred!",
26
+ actions: n
27
+ });
28
+ }
29
+ return {
30
+ addFlag: o,
31
+ removeFlag: s,
32
+ addErrorFlag: r
33
+ };
34
+ }, [i]);
32
35
  }
33
36
  export {
34
- p as useAppFlagsDispatchMethods
37
+ f as useAppFlagsDispatchMethods
35
38
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valiantys/atlassian-app",
3
- "version": "3.2.0-alpha-13",
3
+ "version": "3.2.0-alpha-14",
4
4
  "description": "This library provides Atlassian Forge components, wrappers, and utilities to support writing Forge apps that can run deployed or in standalone mode",
5
5
  "exports": {
6
6
  "./frontend-app": {