@valiantys/atlassian-app-frontend 1.0.0 → 2.0.0
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/atlassian-app-forge-BwFXF-6M.js +3 -0
- package/atlassian-app-forge-DG01gNAI.mjs +139 -0
- package/atlassian-app-frontend.api.json +966 -186
- package/atlassian-app-frontend.api.md +89 -32
- package/index-BePJjrLy.js +1 -0
- package/{index-CBKhl1FP.mjs → index-ZJX0bAUh.mjs} +1 -0
- package/index.d.ts +96 -48
- package/index.js +2 -2
- package/index.mjs +635 -477
- package/package.json +2 -2
- package/style.css +1 -1
- package/valiantys-atlassian-app-frontend-2.0.0.tgz +0 -0
- package/atlassian-app-forge-CTaVjJLt.js +0 -1
- package/atlassian-app-forge-DdtDadi2.mjs +0 -117
- package/atlassian-app-standalone-DJOVbfp6.js +0 -1
- package/atlassian-app-standalone-DyyH6WPO.mjs +0 -111
- package/index-CP8emE0q.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valiantys/atlassian-app-frontend",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "This library provides an Atlassian Forge Custom UI wrapper component that handles all the setup necessary to support an app that can run deployed or in standalone mode",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@atlaskit/select": "^17.19.3",
|
|
26
26
|
"@atlaskit/spinner": "^16.3.2",
|
|
27
27
|
"@atlaskit/tokens": "^2.0.2",
|
|
28
|
-
"@forge/bridge": "^4.
|
|
28
|
+
"@forge/bridge": "^4.5.0",
|
|
29
29
|
"react": "^18.3.1",
|
|
30
30
|
"react-dom": "^18.3.1",
|
|
31
31
|
"react-router-dom": "^6.26.2"
|
package/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._iframe-wrapper_c8hdk_1{display:flex;align-items:flex-start;justify-content:center;width:100%;height:100%}._iframe-wrapper_c8hdk_1 iframe{border:none}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("@forge/bridge"),v=require("react"),i=require("./index.js");require("@atlaskit/flag");require("@atlaskit/icon/glyph/check-circle");require("@atlaskit/icon/glyph/error");require("@atlaskit/icon/glyph/info");require("@atlaskit/icon/glyph/warning");require("@atlaskit/tokens");require("@atlaskit/heading");require("@atlaskit/primitives");require("@atlaskit/button");require("@atlaskit/button/new");require("@atlaskit/form");require("@atlaskit/section-message");require("@atlaskit/select");require("@atlaskit/spinner");require("react-router-dom");function q(e){switch(e){case"jira":return n.requestJira;case"bitbucket":return n.requestBitbucket;case"confluence":return n.requestConfluence}}function p(e){const r=q(e);return{productType:e,fetch:async({url:o,method:u,responseType:a="json",allowExperimental:d=!1},c)=>{const s=await r(o.value,{method:u,headers:{Accept:a==="json"?"application/json":"text/html","Content-Type":a==="json"?"application/json":"text/html","X-ExperimentalApi":d?"opt-in":""},body:JSON.stringify(c)});if(s.ok)return u==="DELETE"?void 0:a==="text"?await s.text():await s.json();{const l=`${u} ${o.value} - ${s.status} ${s.statusText}`;throw console.error(l),new Error(l)}},route:i.route,rawFetch:r}}function f({children:e}){const[r,o]=v.useReducer(j,{});return t.jsx(i.AppFlagsDispatchContext.Provider,{value:o,children:e})}function j(e,r){var o;switch(r.type){case"add":return r.props?{...e,[r.props.id]:n.showFlag(r.props)}:(console.error("invalid flag action: ",JSON.stringify(r)),e);case"remove":return(o=e[r.id])==null||o.close(),{...e,[r.id]:void 0};default:throw Error("Unknown action: "+r.type)}}n.view.theme.enable();const x=p("jira"),m=p("bitbucket"),k=p("confluence"),w={open(e){return new n.Modal(e).open()}};function h({appName:e,doCheckWorkspace:r,invokeRemoteImpl:o,useAtlasKitFlags:u,children:a}){const d=v.useCallback(async(s,l)=>n.invoke(s,{...l}),[]);let c=a;return r&&(c=t.jsx(i.FeatureChosenWorkspaceCheck,{appName:e,children:c})),c=t.jsx(i.RemoteAdapterProvider,{invokeRemoteImplementation:o||n.invokeRemote,children:t.jsx(i.BackendAdapterProvider,{invokeImplementation:d,children:t.jsx(i.HostRouterProvider,{hostRouter:n.router,children:t.jsx(i.RequestBitbucketProvider,{requestBitbucketImplementation:m,children:t.jsx(i.RequestConfluenceProvider,{requestConfluenceImplementation:k,children:t.jsx(i.RequestJiraProvider,{requestJiraImplementation:x,children:t.jsx(i.ViewContextProvider,{viewContext:n.view,children:t.jsx(i.ModalServiceProvider,{modalService:w,children:c})})})})})})})}),u?t.jsx(i.AppFlagsProviderAtlasKit,{children:c}):t.jsx(f,{children:c})}exports.AtlassianAppForge=h;exports.default=h;
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { requestConfluence as d, requestBitbucket as m, requestJira as h, showFlag as v, view as l, invoke as f, invokeRemote as k, router as w, Modal as F } from "@forge/bridge";
|
|
3
|
-
import { useReducer as P, useCallback as b } from "react";
|
|
4
|
-
import { route as x, AppFlagsDispatchContext as C, AppFlagsProviderAtlasKit as j, FeatureChosenWorkspaceCheck as A, RemoteAdapterProvider as R, BackendAdapterProvider as S, HostRouterProvider as g, RequestBitbucketProvider as q, RequestConfluenceProvider as y, RequestJiraProvider as E, ViewContextProvider as I, ModalServiceProvider as J } from "./index.mjs";
|
|
5
|
-
import "@atlaskit/flag";
|
|
6
|
-
import "@atlaskit/icon/glyph/check-circle";
|
|
7
|
-
import "@atlaskit/icon/glyph/error";
|
|
8
|
-
import "@atlaskit/icon/glyph/info";
|
|
9
|
-
import "@atlaskit/icon/glyph/warning";
|
|
10
|
-
import "@atlaskit/tokens";
|
|
11
|
-
import "@atlaskit/heading";
|
|
12
|
-
import "@atlaskit/primitives";
|
|
13
|
-
import "@atlaskit/button";
|
|
14
|
-
import "@atlaskit/button/new";
|
|
15
|
-
import "@atlaskit/form";
|
|
16
|
-
import "@atlaskit/section-message";
|
|
17
|
-
import "@atlaskit/select";
|
|
18
|
-
import "@atlaskit/spinner";
|
|
19
|
-
import "react-router-dom";
|
|
20
|
-
function M(e) {
|
|
21
|
-
switch (e) {
|
|
22
|
-
case "jira":
|
|
23
|
-
return h;
|
|
24
|
-
case "bitbucket":
|
|
25
|
-
return m;
|
|
26
|
-
case "confluence":
|
|
27
|
-
return d;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function u(e) {
|
|
31
|
-
const r = M(e);
|
|
32
|
-
return {
|
|
33
|
-
productType: e,
|
|
34
|
-
fetch: async ({ url: o, method: c, responseType: s = "json", allowExperimental: p = !1 }, i) => {
|
|
35
|
-
const n = await r(o.value, {
|
|
36
|
-
method: c,
|
|
37
|
-
headers: {
|
|
38
|
-
Accept: s === "json" ? "application/json" : "text/html",
|
|
39
|
-
"Content-Type": s === "json" ? "application/json" : "text/html",
|
|
40
|
-
"X-ExperimentalApi": p ? "opt-in" : ""
|
|
41
|
-
},
|
|
42
|
-
body: JSON.stringify(i)
|
|
43
|
-
});
|
|
44
|
-
if (n.ok)
|
|
45
|
-
return c === "DELETE" ? void 0 : s === "text" ? await n.text() : await n.json();
|
|
46
|
-
{
|
|
47
|
-
const a = `${c} ${o.value} - ${n.status} ${n.statusText}`;
|
|
48
|
-
throw console.error(a), new Error(a);
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
route: x,
|
|
52
|
-
// @ts-expect-error slight difference in typing, null vs undefined
|
|
53
|
-
rawFetch: r
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function B({ children: e }) {
|
|
57
|
-
const [r, o] = P($, {});
|
|
58
|
-
return /* @__PURE__ */ t(C.Provider, { value: o, children: e });
|
|
59
|
-
}
|
|
60
|
-
function $(e, r) {
|
|
61
|
-
var o;
|
|
62
|
-
switch (r.type) {
|
|
63
|
-
case "add":
|
|
64
|
-
return r.props ? {
|
|
65
|
-
...e,
|
|
66
|
-
[r.props.id]: v(r.props)
|
|
67
|
-
} : (console.error("invalid flag action: ", JSON.stringify(r)), e);
|
|
68
|
-
case "remove":
|
|
69
|
-
return (o = e[r.id]) == null || o.close(), { ...e, [r.id]: void 0 };
|
|
70
|
-
default:
|
|
71
|
-
throw Error("Unknown action: " + r.type);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
l.theme.enable();
|
|
75
|
-
const D = u("jira"), N = u("bitbucket"), O = u("confluence"), T = {
|
|
76
|
-
open(e) {
|
|
77
|
-
return new F(e).open();
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
function ce({
|
|
81
|
-
appName: e,
|
|
82
|
-
doCheckWorkspace: r,
|
|
83
|
-
invokeRemoteImpl: o,
|
|
84
|
-
useAtlasKitFlags: c,
|
|
85
|
-
children: s
|
|
86
|
-
}) {
|
|
87
|
-
const p = b(
|
|
88
|
-
async (n, a) => f(n, {
|
|
89
|
-
...a
|
|
90
|
-
}),
|
|
91
|
-
[]
|
|
92
|
-
);
|
|
93
|
-
let i = s;
|
|
94
|
-
return r && (i = /* @__PURE__ */ t(A, { appName: e, children: i })), i = /* @__PURE__ */ t(
|
|
95
|
-
R,
|
|
96
|
-
{
|
|
97
|
-
invokeRemoteImplementation: o || k,
|
|
98
|
-
children: /* @__PURE__ */ t(S, { invokeImplementation: p, children: /* @__PURE__ */ t(g, { hostRouter: w, children: /* @__PURE__ */ t(
|
|
99
|
-
q,
|
|
100
|
-
{
|
|
101
|
-
requestBitbucketImplementation: N,
|
|
102
|
-
children: /* @__PURE__ */ t(
|
|
103
|
-
y,
|
|
104
|
-
{
|
|
105
|
-
requestConfluenceImplementation: O,
|
|
106
|
-
children: /* @__PURE__ */ t(E, { requestJiraImplementation: D, children: /* @__PURE__ */ t(I, { viewContext: l, children: /* @__PURE__ */ t(J, { modalService: T, children: i }) }) })
|
|
107
|
-
}
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
|
-
) }) })
|
|
111
|
-
}
|
|
112
|
-
), c ? /* @__PURE__ */ t(j, { children: i }) : /* @__PURE__ */ t(B, { children: i });
|
|
113
|
-
}
|
|
114
|
-
export {
|
|
115
|
-
ce as AtlassianAppForge,
|
|
116
|
-
ce as default
|
|
117
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("@atlaskit/app-provider"),o=require("react"),e=require("./index.js");require("@atlaskit/heading");require("@atlaskit/primitives");require("@atlaskit/button");require("@atlaskit/button/new");require("@atlaskit/form");require("@atlaskit/section-message");require("@atlaskit/select");require("@atlaskit/spinner");require("react-router-dom");require("@atlaskit/flag");require("@atlaskit/icon/glyph/check-circle");require("@atlaskit/icon/glyph/error");require("@atlaskit/icon/glyph/info");require("@atlaskit/icon/glyph/warning");require("@atlaskit/tokens");const w=o.lazy(()=>Promise.resolve().then(()=>require("./index-CP8emE0q.js")));function k({initialMockViewContext:c,backendUrl:i,remoteUrl:p,doCheckWorkspace:m,appName:a,doCheckResource:h,modalOpenerConfig:v,modalContextConfig:I,children:A}){const[u,S]=o.useState(),[n,j]=o.useState(),{getAuthToken:s}=e.useOAuth(),x=o.useCallback(()=>e.atlassianOAuthJiraFetch(s(),u??""),[s,u]),R=o.useCallback(()=>e.atlassianOAuthConfluenceFetch(s(),u??""),[s,u]),C=o.useCallback(()=>e.atlassianOAuthBitbucketFetch(s()),[s]),P=o.useCallback(async l=>{if(i&&h){const q=l??localStorage.getItem(`${a}-user-resource-id`)??"",d=await new e.AtlassianUserResourceService().checkUserChosenResource(s(),q);return d.hasChosen&&(localStorage.setItem(`${a}-user-resource-id`,d.resource.id),S(d.resource.id)),d}else return{hasChosen:!0}},[i,s,a,h]);o.useEffect(()=>{const l=u??(c==null?void 0:c.cloudId)??"";if(!n||n.cloudId!==l){const q={...n||c,cloudId:l};j(q)}},[c,u,n]);const F=o.useCallback(()=>i?e.getOauthFetchInvokeImpl(i,s(),u??""):void 0,[u,s,i]);let r=A;m&&(r=t.jsx(e.FeatureChosenWorkspaceCheck,{appName:a,children:r})),v&&(r=t.jsx(e.ModalServiceProvider,{modalService:new e.WindowModalService(v.defaultUrl,v.resourceMap),children:r})),n&&(r=t.jsx(e.ViewContextProvider,{viewContext:I?new e.ModalViewContext(n,I.openerOrigin):new e.MockViewContext(n),children:r})),r=t.jsx(e.HostRouterProvider,{hostRouter:new e.WindowHostRouter,children:t.jsx(e.RequestBitbucketProvider,{requestBitbucketImplementation:C(),children:t.jsx(e.RequestConfluenceProvider,{requestConfluenceImplementation:R(),children:t.jsx(e.RequestJiraProvider,{requestJiraImplementation:x(),children:r})})})});const f=F();return f&&(r=t.jsx(e.BackendAdapterProvider,{invokeImplementation:f,children:r})),p&&(r=t.jsx(e.RemoteAdapterProvider,{invokeRemoteImplementation:e.oauthFetchInvokeRemote(p),children:r})),h&&(r=t.jsx(w,{checkResource:P,children:r})),t.jsx(g,{children:t.jsx(e.AppFlagsProviderAtlasKit,{children:r})})}exports.AtlassianAppStandalone=k;exports.default=k;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import q from "@atlaskit/app-provider";
|
|
3
|
-
import { lazy as B, useState as I, useCallback as i, useEffect as W } from "react";
|
|
4
|
-
import { useOAuth as J, atlassianOAuthJiraFetch as O, atlassianOAuthConfluenceFetch as x, atlassianOAuthBitbucketFetch as y, AtlassianUserResourceService as E, getOauthFetchInvokeImpl as H, ModalServiceProvider as T, WindowModalService as $, ViewContextProvider as b, ModalViewContext as j, MockViewContext as z, HostRouterProvider as K, WindowHostRouter as M, RequestBitbucketProvider as D, RequestConfluenceProvider as G, RequestJiraProvider as L, BackendAdapterProvider as Q, RemoteAdapterProvider as X, oauthFetchInvokeRemote as Y, AppFlagsProviderAtlasKit as Z, FeatureChosenWorkspaceCheck as _ } from "./index.mjs";
|
|
5
|
-
import "@atlaskit/heading";
|
|
6
|
-
import "@atlaskit/primitives";
|
|
7
|
-
import "@atlaskit/button";
|
|
8
|
-
import "@atlaskit/button/new";
|
|
9
|
-
import "@atlaskit/form";
|
|
10
|
-
import "@atlaskit/section-message";
|
|
11
|
-
import "@atlaskit/select";
|
|
12
|
-
import "@atlaskit/spinner";
|
|
13
|
-
import "react-router-dom";
|
|
14
|
-
import "@atlaskit/flag";
|
|
15
|
-
import "@atlaskit/icon/glyph/check-circle";
|
|
16
|
-
import "@atlaskit/icon/glyph/error";
|
|
17
|
-
import "@atlaskit/icon/glyph/info";
|
|
18
|
-
import "@atlaskit/icon/glyph/warning";
|
|
19
|
-
import "@atlaskit/tokens";
|
|
20
|
-
const U = B(
|
|
21
|
-
() => import("./index-CBKhl1FP.mjs")
|
|
22
|
-
);
|
|
23
|
-
function Ie({
|
|
24
|
-
initialMockViewContext: s,
|
|
25
|
-
backendUrl: c,
|
|
26
|
-
remoteUrl: p,
|
|
27
|
-
doCheckWorkspace: A,
|
|
28
|
-
appName: u,
|
|
29
|
-
doCheckResource: h,
|
|
30
|
-
modalOpenerConfig: l,
|
|
31
|
-
modalContextConfig: v,
|
|
32
|
-
children: R
|
|
33
|
-
}) {
|
|
34
|
-
const [o, k] = I(), [n, F] = I(), { getAuthToken: r } = J(), S = i(() => O(r(), o ?? ""), [r, o]), P = i(() => x(r(), o ?? ""), [r, o]), g = i(() => y(r()), [r]), w = i(
|
|
35
|
-
async (d) => {
|
|
36
|
-
if (c && h) {
|
|
37
|
-
const m = d ?? localStorage.getItem(`${u}-user-resource-id`) ?? "", a = await new E().checkUserChosenResource(
|
|
38
|
-
r(),
|
|
39
|
-
m
|
|
40
|
-
);
|
|
41
|
-
return a.hasChosen && (localStorage.setItem(
|
|
42
|
-
`${u}-user-resource-id`,
|
|
43
|
-
a.resource.id
|
|
44
|
-
), k(a.resource.id)), a;
|
|
45
|
-
} else
|
|
46
|
-
return { hasChosen: !0 };
|
|
47
|
-
},
|
|
48
|
-
[c, r, u, h]
|
|
49
|
-
);
|
|
50
|
-
W(() => {
|
|
51
|
-
const d = o ?? (s == null ? void 0 : s.cloudId) ?? "";
|
|
52
|
-
if (!n || n.cloudId !== d) {
|
|
53
|
-
const m = {
|
|
54
|
-
...n || s,
|
|
55
|
-
cloudId: d
|
|
56
|
-
};
|
|
57
|
-
F(m);
|
|
58
|
-
}
|
|
59
|
-
}, [s, o, n]);
|
|
60
|
-
const C = i(
|
|
61
|
-
() => c ? H(c, r(), o ?? "") : void 0,
|
|
62
|
-
[o, r, c]
|
|
63
|
-
);
|
|
64
|
-
let e = R;
|
|
65
|
-
A && (e = /* @__PURE__ */ t(_, { appName: u, children: e })), l && (e = /* @__PURE__ */ t(
|
|
66
|
-
T,
|
|
67
|
-
{
|
|
68
|
-
modalService: new $(
|
|
69
|
-
l.defaultUrl,
|
|
70
|
-
l.resourceMap
|
|
71
|
-
),
|
|
72
|
-
children: e
|
|
73
|
-
}
|
|
74
|
-
)), n && (e = /* @__PURE__ */ t(
|
|
75
|
-
b,
|
|
76
|
-
{
|
|
77
|
-
viewContext: v ? new j(n, v.openerOrigin) : new z(n),
|
|
78
|
-
children: e
|
|
79
|
-
}
|
|
80
|
-
)), e = /* @__PURE__ */ t(K, { hostRouter: new M(), children: /* @__PURE__ */ t(
|
|
81
|
-
D,
|
|
82
|
-
{
|
|
83
|
-
requestBitbucketImplementation: g(),
|
|
84
|
-
children: /* @__PURE__ */ t(
|
|
85
|
-
G,
|
|
86
|
-
{
|
|
87
|
-
requestConfluenceImplementation: P(),
|
|
88
|
-
children: /* @__PURE__ */ t(
|
|
89
|
-
L,
|
|
90
|
-
{
|
|
91
|
-
requestJiraImplementation: S(),
|
|
92
|
-
children: e
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
}
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
) });
|
|
99
|
-
const f = C();
|
|
100
|
-
return f && (e = /* @__PURE__ */ t(Q, { invokeImplementation: f, children: e })), p && (e = /* @__PURE__ */ t(
|
|
101
|
-
X,
|
|
102
|
-
{
|
|
103
|
-
invokeRemoteImplementation: Y(p),
|
|
104
|
-
children: e
|
|
105
|
-
}
|
|
106
|
-
)), h && (e = /* @__PURE__ */ t(U, { checkResource: w, children: e })), /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(Z, { children: e }) });
|
|
107
|
-
}
|
|
108
|
-
export {
|
|
109
|
-
Ie as AtlassianAppStandalone,
|
|
110
|
-
Ie as default
|
|
111
|
-
};
|
package/index-CP8emE0q.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.js");require("react/jsx-runtime");require("@atlaskit/button");require("@atlaskit/button/new");require("@atlaskit/form");require("@atlaskit/primitives");require("@atlaskit/section-message");require("@atlaskit/select");require("react");require("@atlaskit/heading");require("@atlaskit/spinner");require("react-router-dom");require("@atlaskit/flag");require("@atlaskit/icon/glyph/check-circle");require("@atlaskit/icon/glyph/error");require("@atlaskit/icon/glyph/info");require("@atlaskit/icon/glyph/warning");require("@atlaskit/tokens");exports.FeatureChosenResourceCheck=e.FeatureChosenResourceCheck;exports.default=e.FeatureChosenResourceCheck;
|