@valiantys/atlassian-app-frontend 1.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.
Files changed (66) hide show
  1. package/README.md +726 -0
  2. package/atlassian-app-forge-CTaVjJLt.js +1 -0
  3. package/atlassian-app-forge-DdtDadi2.mjs +117 -0
  4. package/atlassian-app-frontend.api.json +8829 -0
  5. package/atlassian-app-frontend.api.md +740 -0
  6. package/atlassian-app-standalone-DJOVbfp6.js +1 -0
  7. package/atlassian-app-standalone-DyyH6WPO.mjs +111 -0
  8. package/examples/backend/index.ts +44 -0
  9. package/examples/backend/lib/forge-functions.d.ts +3 -0
  10. package/examples/backend/lib/forge-functions.ts +23 -0
  11. package/examples/backend/lib/handler-functions.d.ts +58 -0
  12. package/examples/backend/lib/handler-functions.ts +72 -0
  13. package/examples/backend/lib/standalone-functions.d.ts +3 -0
  14. package/examples/backend/lib/standalone-functions.ts +17 -0
  15. package/examples/client-sample-.env +5 -0
  16. package/examples/hello-world/app.d.ts +2 -0
  17. package/examples/hello-world/app.tsx +77 -0
  18. package/examples/hello-world/example-box.d.ts +8 -0
  19. package/examples/hello-world/example-box.tsx +22 -0
  20. package/examples/hello-world/example-components/forge-storage-example.d.ts +1 -0
  21. package/examples/hello-world/example-components/forge-storage-example.tsx +66 -0
  22. package/examples/hello-world/example-components/hello-with-loading-spinner.d.ts +1 -0
  23. package/examples/hello-world/example-components/hello-with-loading-spinner.tsx +24 -0
  24. package/examples/hello-world/example-components/hello.d.ts +1 -0
  25. package/examples/hello-world/example-components/hello.spec.tsx +39 -0
  26. package/examples/hello-world/example-components/hello.tsx +13 -0
  27. package/examples/hello-world/example-components/host-router-example.d.ts +1 -0
  28. package/examples/hello-world/example-components/host-router-example.tsx +13 -0
  29. package/examples/hello-world/example-components/issue-types-example-backend.d.ts +4 -0
  30. package/examples/hello-world/example-components/issue-types-example-backend.tsx +37 -0
  31. package/examples/hello-world/example-components/issue-types-example.d.ts +4 -0
  32. package/examples/hello-world/example-components/issue-types-example.tsx +40 -0
  33. package/examples/hello-world/example-components/list-assets.d.ts +1 -0
  34. package/examples/hello-world/example-components/list-assets.tsx +38 -0
  35. package/examples/hello-world/example-components/open-modal-example.d.ts +1 -0
  36. package/examples/hello-world/example-components/open-modal-example.tsx +47 -0
  37. package/examples/hello-world/example-components/view-context-example.d.ts +1 -0
  38. package/examples/hello-world/example-components/view-context-example.tsx +17 -0
  39. package/examples/hello-world/example-components/who-am-i.d.ts +1 -0
  40. package/examples/hello-world/example-components/who-am-i.tsx +13 -0
  41. package/examples/hello-world/main.d.ts +0 -0
  42. package/examples/hello-world/main.tsx +11 -0
  43. package/examples/hello-world/styles.css +1 -0
  44. package/examples/hello-world-modal/app.d.ts +2 -0
  45. package/examples/hello-world-modal/app.tsx +30 -0
  46. package/examples/hello-world-modal/hello.d.ts +1 -0
  47. package/examples/hello-world-modal/hello.tsx +15 -0
  48. package/examples/hello-world-modal/main.d.ts +0 -0
  49. package/examples/hello-world-modal/main.tsx +11 -0
  50. package/examples/hello-world-modal/styles.css +1 -0
  51. package/examples/hello-world-remote/app.d.ts +2 -0
  52. package/examples/hello-world-remote/app.tsx +23 -0
  53. package/examples/hello-world-remote/invoke-remote-example.d.ts +13 -0
  54. package/examples/hello-world-remote/invoke-remote-example.tsx +40 -0
  55. package/examples/hello-world-remote/main.d.ts +0 -0
  56. package/examples/hello-world-remote/main.tsx +11 -0
  57. package/examples/hello-world-remote/styles.css +1 -0
  58. package/examples/manifest.yml.example +49 -0
  59. package/index-CBKhl1FP.mjs +22 -0
  60. package/index-CP8emE0q.js +1 -0
  61. package/index.d.ts +654 -0
  62. package/index.js +2 -0
  63. package/index.mjs +1145 -0
  64. package/package.json +54 -0
  65. package/style.css +1 -0
  66. package/tsdoc-metadata.json +11 -0
@@ -0,0 +1 @@
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;
@@ -0,0 +1,117 @@
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
+ };