@valiantys/atlassian-app-frontend 3.0.0-alpha-19 → 3.0.0-alpha-22

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 (29) hide show
  1. package/atlassian/jira/shared/data-access-issue/src/lib/jira-issue-service/index.cjs.js +1 -1
  2. package/atlassian/jira/shared/data-access-issue/src/lib/jira-issue-service/index.es.js +18 -6
  3. package/atlassian/jira/shared/util-jira-v3-api/src/lib/jira-server-info/index.cjs.js +1 -0
  4. package/atlassian/jira/shared/util-jira-v3-api/src/lib/jira-server-info/index.es.js +9 -0
  5. package/atlassian/shared/frontend-feature-atlassian-app/src/lib/custom-ui/atlassian-app-forge/index.cjs.js +1 -1
  6. package/atlassian/shared/frontend-feature-atlassian-app/src/lib/custom-ui/atlassian-app-forge/index.es.js +4 -3
  7. package/atlassian/shared/frontend-feature-atlassian-app/src/lib/standalone/atlassian-app-standalone/index.cjs.js +1 -1
  8. package/atlassian/shared/frontend-feature-atlassian-app/src/lib/standalone/atlassian-app-standalone/index.es.js +4 -3
  9. package/atlassian/shared/frontend-ui-iframe/src/lib/iframe-wrapper/index.cjs.js +1 -1
  10. package/atlassian/shared/frontend-ui-iframe/src/lib/iframe-wrapper/index.es.js +50 -38
  11. package/data-access-issue/atlassian-app-frontend-data-access-issue.api.json +90 -0
  12. package/data-access-issue/atlassian-app-frontend.api.md +8 -0
  13. package/data-access-issue/index.d.ts +42 -0
  14. package/package.json +1 -1
  15. package/shared/frontend-ui-drop-target/src/lib/drop-target-box/index.cjs.js +1 -1
  16. package/shared/frontend-ui-drop-target/src/lib/drop-target-box/index.es.js +7 -9
  17. package/shared/frontend-ui-load-data-hook/src/lib/load-data-hook/index.cjs.js +1 -1
  18. package/shared/frontend-ui-load-data-hook/src/lib/load-data-hook/index.es.js +10 -10
  19. package/ui-iframe/atlassian-app-frontend-ui-iframe.api.json +189 -34
  20. package/ui-iframe/atlassian-app-frontend.api.md +18 -4
  21. package/ui-iframe/index.d.ts +11 -4
  22. package/util-atlassian-product-fetch/atlassian-app-frontend-util-atlassian-product-fetch.api.json +2 -2
  23. package/util-atlassian-product-fetch/atlassian-app-frontend.api.md +1 -1
  24. package/util-atlassian-product-fetch/index.d.ts +1 -1
  25. package/util-jira-v3-api/atlassian-app-frontend-util-jira-v3-api.api.json +383 -1
  26. package/util-jira-v3-api/atlassian-app-frontend.api.md +45 -1
  27. package/util-jira-v3-api/index.cjs.js +1 -1
  28. package/util-jira-v3-api/index.d.ts +32 -1
  29. package/util-jira-v3-api/index.es.js +6 -4
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=class i{constructor(e){this.fetchSvc=e}async updateProperty(e,t,s){return this.fetchSvc.fetch({method:"PUT",url:this.fetchSvc.route`/rest/api/3/issue/${e}/properties/${t}`},s)}async updateField(e,t,s){await this.updateFields(e,{[t]:s})}async updateFields(e,t){await this.updateIssue(e,{fields:t})}async getIssueField(e,t){var s;return(s=await this.getIssueFields(e,[t]))==null?void 0:s[t]}async getIssueFields(e,t){return(await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}`})).fields}async getIssue(e,t=["*all"],s=!1){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}&expand=${s?"renderedFields":""}`})}async issueSearch(e,t,s=50){let c;const h=[];do{const u=await this.issueSearchByPage(e,t,c,s);h.push(...u.issues),c=u.nextPageToken}while(c!==void 0);return h}async issueSearchByPage(e,t,s,c=50){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/search/jql`},{fields:t,jql:e,maxResults:c,nextPageToken:s})}async addWorklog(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/worklog`},t)}async queryForIssuesInProjects(e){const t=`project IN (${e.join(",")})`;return this.issueSearch(t,["key","project"],5e3)}async createIssue(e){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue`},e)}async updateIssue(e,t){return this.fetchSvc.fetch({method:"PUT",url:this.fetchSvc.route`/rest/api/3/issue/${e}`},t)}async getIssueComments(e,t=0){const s=t?`?startAt=${t}`:"";return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment${s}`})}async getIssueCommentById(e,t){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment/${t}`})}async addIssueComment(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment`},{body:t})}async transitionIssue(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/transitions`},t)}async createIssueLink(e){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issueLink`},e)}};i.issueUrl="/rest/api/3/issue";let r=i;exports.JiraIssueService=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=class h{constructor(e){this.fetchSvc=e}async updateProperty(e,t,s){return this.fetchSvc.fetch({method:"PUT",url:this.fetchSvc.route`/rest/api/3/issue/${e}/properties/${t}`},s)}async updateField(e,t,s){await this.updateFields(e,{[t]:s})}async updateFields(e,t){await this.updateIssue(e,{fields:t})}async getIssueField(e,t){var s;return(s=await this.getIssueFields(e,[t]))==null?void 0:s[t]}async getIssueFields(e,t){return(await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}`})).fields}async getIssue(e,t=["*all"],s=!1){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}&expand=${s?"renderedFields":""}`})}async issueSearch(e,t,s=50){let c;const i=[];do{const u=await this.issueSearchByPage(e,t,c,s);i.push(...u.issues),c=u.nextPageToken}while(c!==void 0);return i}async issueSearchByPage(e,t,s,c=50){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/search/jql`},{fields:t,jql:e,maxResults:c,nextPageToken:s})}async addWorklog(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/worklog`},t)}async queryForIssuesInProjects(e){const t=`project IN (${e.join(",")})`;return this.issueSearch(t,["key","project"],5e3)}async createIssue(e){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue`},e)}async updateIssue(e,t){return this.fetchSvc.fetch({method:"PUT",url:this.fetchSvc.route`/rest/api/3/issue/${e}`},t)}async getIssueComments(e,t=0){const s=t?`?startAt=${t}`:"";return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment${s}`})}async getIssueCommentById(e,t){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment/${t}`})}async addIssueComment(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment`},{body:t})}async transitionIssue(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/transitions`},t)}async createIssueLink(e){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issueLink`},e)}async getIssueTypes(){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issuetype`})}async getIssueTypeSchemes(){return await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issuetypescheme?expand=projects,issuetypes`})}};h.issueUrl="/rest/api/3/issue";let r=h;exports.JiraIssueService=r;
@@ -1,4 +1,4 @@
1
- const r = class r {
1
+ const h = class h {
2
2
  constructor(e) {
3
3
  this.fetchSvc = e;
4
4
  }
@@ -35,12 +35,12 @@ const r = class r {
35
35
  }
36
36
  async issueSearch(e, t, s = 50) {
37
37
  let c;
38
- const h = [];
38
+ const r = [];
39
39
  do {
40
40
  const i = await this.issueSearchByPage(e, t, c, s);
41
- h.push(...i.issues), c = i.nextPageToken;
41
+ r.push(...i.issues), c = i.nextPageToken;
42
42
  } while (c !== void 0);
43
- return h;
43
+ return r;
44
44
  }
45
45
  async issueSearchByPage(e, t, s, c = 50) {
46
46
  return this.fetchSvc.fetch(
@@ -128,9 +128,21 @@ const r = class r {
128
128
  e
129
129
  );
130
130
  }
131
+ async getIssueTypes() {
132
+ return this.fetchSvc.fetch({
133
+ method: "GET",
134
+ url: this.fetchSvc.route`/rest/api/3/issuetype`
135
+ });
136
+ }
137
+ async getIssueTypeSchemes() {
138
+ return await this.fetchSvc.fetch({
139
+ method: "GET",
140
+ url: this.fetchSvc.route`/rest/api/3/issuetypescheme?expand=projects,issuetypes`
141
+ });
142
+ }
131
143
  };
132
- r.issueUrl = "/rest/api/3/issue";
133
- let u = r;
144
+ h.issueUrl = "/rest/api/3/issue";
145
+ let u = h;
134
146
  export {
135
147
  u as JiraIssueService
136
148
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function s(e,t){const i=t.substring(t.indexOf("/rest/api/"));return e+i}exports.switchAtlassianApiUrlToUseSiteUrl=s;
@@ -0,0 +1,9 @@
1
+ function n(e, t) {
2
+ const i = t.substring(
3
+ t.indexOf("/rest/api/")
4
+ );
5
+ return e + i;
6
+ }
7
+ export {
8
+ n as switchAtlassianApiUrlToUseSiteUrl
9
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),i=require("@forge/bridge"),o=require("../../../../../../forge/shared/frontend-data-access-product-fetch-forge-bridge/src/lib/forge-bridge-product-fetch/index.cjs.js"),a=require("../../../../../../forge/shared/frontend-ui-app-flags/src/lib/app-flags-provider-forge/index.cjs.js"),d=require("../../../../../frontend-feature-chosen-workspace-check/src/lib/feature-chosen-workspace-check/index.cjs.js");require("../../../../../frontend-feature-chosen-workspace-check/src/lib/jira-workspace-provider/index.cjs.js");require("../../../../../frontend-ui-app-flags/src/lib/app-flags-dispatch/index.cjs.js");const q=require("../../../../../frontend-ui-app-flags/src/lib/app-flags-provider-atlaskit/index.cjs.js"),p=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-bitbucket/index.cjs.js"),v=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-confluence/index.cjs.js"),h=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-jira/index.cjs.js");require("@atlaskit/button/new");require("react");const F=require("../../../../../frontend-ui-host-router/src/lib/host-router-provider/index.cjs.js");require("../../../../../frontend-ui-modal/src/lib/modal-content/index.cjs.js");require("@atlaskit/heading");require("@atlaskit/primitives");const g=require("../../../../../frontend-ui-modal/src/lib/modal-service-provider/index.cjs.js");require("../../../../../frontend-ui-view-context/src/lib/view-context-provider/index.cjs.js");const m=require("../../../../../frontend-ui-remote-adapter/src/lib/remote-adapter/index.cjs.js"),P=require("../../ui-kit/atlassian-app-forge-ui-kit/index.cjs.js"),S=o.createClientSideForgeProductFetchService("jira"),j=o.createClientSideForgeProductFetchService("bitbucket"),A=o.createClientSideForgeProductFetchService("confluence"),f={open(t){return new i.Modal(t).open()}};function c({appName:t,doCheckWorkspace:n,invokeRemoteImpl:s,useAtlasKitFlags:u,children:l}){let r=l;return n&&(r=e.jsx(d.FeatureChosenWorkspaceCheck,{appName:t,children:r})),r=e.jsx(m.RemoteAdapterProvider,{invokeRemoteImplementation:s||i.invokeRemote,children:e.jsx(P.AtlassianAppForgeUiKit,{children:e.jsx(F.HostRouterProvider,{hostRouter:i.router,children:e.jsx(p.RequestBitbucketProvider,{requestBitbucketImplementation:j,children:e.jsx(v.RequestConfluenceProvider,{requestConfluenceImplementation:A,children:e.jsx(h.RequestJiraProvider,{requestJiraImplementation:S,children:e.jsx(g.ModalServiceProvider,{modalService:f,children:r})})})})})})}),u?e.jsx(q.AppFlagsProviderAtlasKit,{children:r}):e.jsx(a.AppFlagsProviderForge,{children:r})}exports.AtlassianAppForge=c;exports.default=c;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),i=require("@forge/bridge"),o=require("../../../../../../forge/shared/frontend-data-access-product-fetch-forge-bridge/src/lib/forge-bridge-product-fetch/index.cjs.js"),a=require("../../../../../../forge/shared/frontend-ui-app-flags/src/lib/app-flags-provider-forge/index.cjs.js"),d=require("../../../../../frontend-feature-chosen-workspace-check/src/lib/feature-chosen-workspace-check/index.cjs.js");require("../../../../../frontend-feature-chosen-workspace-check/src/lib/jira-workspace-provider/index.cjs.js");require("../../../../../frontend-ui-app-flags/src/lib/app-flags-dispatch/index.cjs.js");const q=require("../../../../../frontend-ui-app-flags/src/lib/app-flags-provider-atlaskit/index.cjs.js"),p=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-bitbucket/index.cjs.js"),v=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-confluence/index.cjs.js"),h=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-jira/index.cjs.js");require("@atlaskit/button/new");require("react");const F=require("../../../../../frontend-ui-host-router/src/lib/host-router-provider/index.cjs.js");require("../../../../../frontend-ui-modal/src/lib/modal-content/index.cjs.js");require("@atlaskit/heading");require("@atlaskit/primitives");require("../../../../../frontend-ui-iframe/src/lib/iframe-wrapper/index.cjs.js");const g=require("../../../../../frontend-ui-modal/src/lib/modal-service-provider/index.cjs.js");require("../../../../../frontend-ui-view-context/src/lib/view-context-provider/index.cjs.js");const m=require("../../../../../frontend-ui-remote-adapter/src/lib/remote-adapter/index.cjs.js"),P=require("../../ui-kit/atlassian-app-forge-ui-kit/index.cjs.js"),S=o.createClientSideForgeProductFetchService("jira"),j=o.createClientSideForgeProductFetchService("bitbucket"),A=o.createClientSideForgeProductFetchService("confluence"),f={open(t){return new i.Modal(t).open()}};function c({appName:t,doCheckWorkspace:n,invokeRemoteImpl:s,useAtlasKitFlags:u,children:l}){let r=l;return n&&(r=e.jsx(d.FeatureChosenWorkspaceCheck,{appName:t,children:r})),r=e.jsx(m.RemoteAdapterProvider,{invokeRemoteImplementation:s||i.invokeRemote,children:e.jsx(P.AtlassianAppForgeUiKit,{children:e.jsx(F.HostRouterProvider,{hostRouter:i.router,children:e.jsx(p.RequestBitbucketProvider,{requestBitbucketImplementation:j,children:e.jsx(v.RequestConfluenceProvider,{requestConfluenceImplementation:A,children:e.jsx(h.RequestJiraProvider,{requestJiraImplementation:S,children:e.jsx(g.ModalServiceProvider,{modalService:f,children:r})})})})})})}),u?e.jsx(q.AppFlagsProviderAtlasKit,{children:r}):e.jsx(a.AppFlagsProviderForge,{children:r})}exports.AtlassianAppForge=c;exports.default=c;
@@ -15,6 +15,7 @@ import { HostRouterProvider as F } from "../../../../../frontend-ui-host-router/
15
15
  import "../../../../../frontend-ui-modal/src/lib/modal-content/index.es.js";
16
16
  import "@atlaskit/heading";
17
17
  import "@atlaskit/primitives";
18
+ import "../../../../../frontend-ui-iframe/src/lib/iframe-wrapper/index.es.js";
18
19
  import { ModalServiceProvider as P } from "../../../../../frontend-ui-modal/src/lib/modal-service-provider/index.es.js";
19
20
  import "../../../../../frontend-ui-view-context/src/lib/view-context-provider/index.es.js";
20
21
  import { RemoteAdapterProvider as k } from "../../../../../frontend-ui-remote-adapter/src/lib/remote-adapter/index.es.js";
@@ -24,7 +25,7 @@ const R = t("jira"), S = t("bitbucket"), g = t("confluence"), b = {
24
25
  return new d(o).open();
25
26
  }
26
27
  };
27
- function Q({
28
+ function T({
28
29
  appName: o,
29
30
  doCheckWorkspace: i,
30
31
  invokeRemoteImpl: m,
@@ -53,6 +54,6 @@ function Q({
53
54
  ), n ? /* @__PURE__ */ e(u, { children: r }) : /* @__PURE__ */ e(a, { children: r });
54
55
  }
55
56
  export {
56
- Q as AtlassianAppForge,
57
- Q as default
57
+ T as AtlassianAppForge,
58
+ T as default
58
59
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),g=require("@atlaskit/app-provider"),o=require("react"),S=require("../../../../../data-access-atlassian-product-fetch-oauth/src/lib/atlassian-oauth-fetch/index.cjs.js"),B=require("../../../../../data-access-resources/src/lib/atlassian-user-resource-service/index.cjs.js"),O=require("../../../../../frontend-feature-chosen-workspace-check/src/lib/feature-chosen-workspace-check/index.cjs.js");require("../../../../../frontend-feature-chosen-workspace-check/src/lib/jira-workspace-provider/index.cjs.js");const P=require("../../../../../frontend-feature-oauth-login/src/lib/feature-oauth/index.cjs.js");require("../../../../../frontend-feature-oauth-login/src/lib/oauth-routes/index.cjs.js");require("@atlaskit/heading");require("@atlaskit/primitives");require("@atlaskit/section-message");require("@atlaskit/spinner");require("../../../../../frontend-ui-app-flags/src/lib/app-flags-dispatch/index.cjs.js");const W=require("../../../../../frontend-ui-app-flags/src/lib/app-flags-provider-atlaskit/index.cjs.js"),J=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-bitbucket/index.cjs.js"),T=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-confluence/index.cjs.js"),E=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-jira/index.cjs.js"),y=require("../../../../../frontend-ui-backend-adapter/src/lib/backend-adapter/index.cjs.js"),M=require("../../../../../frontend-ui-backend-adapter/src/lib/oauth-fetch-invoke/index.cjs.js"),H=require("../../../../../frontend-ui-host-router/src/lib/host-router/index.cjs.js");require("@atlaskit/button/new");const _=require("../../../../../frontend-ui-host-router/src/lib/host-router-provider/index.cjs.js");require("../../../../../frontend-ui-modal/src/lib/modal-content/index.cjs.js");const $=require("../../../../../frontend-ui-modal/src/lib/modal-service/index.cjs.js"),z=require("../../../../../frontend-ui-modal/src/lib/modal-service-provider/index.cjs.js"),K=require("../../../../../frontend-ui-modal/src/lib/modal-view-context/index.cjs.js"),U=require("../../../../../frontend-ui-remote-adapter/src/lib/remote-adapter/index.cjs.js"),D=require("../../../../../frontend-ui-remote-adapter/src/lib/oauth-fetch-invoke-remote/index.cjs.js"),G=require("../../../../../frontend-ui-view-context/src/lib/view-context-provider/index.cjs.js"),L=require("../../../../../frontend-ui-view-context/src/lib/mock-view-context/index.cjs.js"),Q=o.lazy(()=>Promise.resolve().then(()=>require("../../../../../frontend-feature-chosen-resource-check/src/index/index.cjs.js")));function R({initialMockViewContext:c,backendUrl:u,remoteUrl:h,doCheckWorkspace:A,appName:i,doCheckResource:l,modalOpenerConfig:d,modalContextConfig:q,oauthConfig:n,atlassianResourceId:x,children:t}){const v=r.jsx(X,{appName:i,backendUrl:u,remoteUrl:h,initialMockViewContext:c,modalOpenerConfig:d,modalContextConfig:q,doCheckWorkspace:A,doCheckResource:l,oauthConfig:n,atlassianResourceId:x,children:t});return n?r.jsx(P.OAuthProvider,{clientId:n.clientId,codeTokenExchangeUrl:n.codeTokenExchangeUrl,appName:i,oAuthScopes:n.oAuthScopes,appBaseContext:n.appBaseContext,children:v}):v}function X({initialMockViewContext:c,backendUrl:u,remoteUrl:h,doCheckWorkspace:A,appName:i,doCheckResource:l,modalOpenerConfig:d,modalContextConfig:q,atlassianResourceId:n,children:x}){const[t,v]=o.useState(n),[a,j]=o.useState(),{getAuthToken:s}=P.useOAuth(),f=o.useCallback(()=>S.atlassianOAuthJiraFetch(s(),t??""),[s,t]),C=o.useCallback(()=>S.atlassianOAuthConfluenceFetch(s(),t??""),[s,t]),F=o.useCallback(()=>S.atlassianOAuthBitbucketFetch(s()),[s]),w=o.useCallback(async p=>{if(u&&l){const I=p??localStorage.getItem(`${i}-user-resource-id`)??"",k=await new B.AtlassianUserResourceService().checkUserChosenResource(s(),I);return k.hasChosen&&(localStorage.setItem(`${i}-user-resource-id`,k.resource.id),v(k.resource.id)),k}else return{hasChosen:!0}},[u,s,i,l]);o.useEffect(()=>{const p=t??(c==null?void 0:c.cloudId)??"";if(!a||a.cloudId!==p){const I={...a||c,cloudId:p};j(I)}},[c,t,a]);const b=o.useCallback(()=>u?M.getOauthFetchInvokeImpl(u,s(),t??""):void 0,[t,s,u]);let e=x;A&&(e=r.jsx(O.FeatureChosenWorkspaceCheck,{appName:i,children:e})),d&&(e=r.jsx(z.ModalServiceProvider,{modalService:new $.WindowModalService(d.defaultUrl,d.resourceMap),children:e})),a&&(e=r.jsx(G.ViewContextProvider,{viewContext:q?new K.ModalViewContext(a,q.openerOrigin):new L.MockViewContext(a),children:e})),e=r.jsx(_.HostRouterProvider,{hostRouter:new H.WindowHostRouter,children:r.jsx(J.RequestBitbucketProvider,{requestBitbucketImplementation:F(),children:r.jsx(T.RequestConfluenceProvider,{requestConfluenceImplementation:C(),children:r.jsx(E.RequestJiraProvider,{requestJiraImplementation:f(),children:e})})})});const m=b();return m&&(e=r.jsx(y.BackendAdapterProvider,{invokeImplementation:m,children:e})),h&&(e=r.jsx(U.RemoteAdapterProvider,{invokeRemoteImplementation:D.oauthFetchInvokeRemote(h),children:e})),l&&(e=r.jsx(Q,{checkResource:w,children:e})),r.jsx(g,{children:r.jsx(W.AppFlagsProviderAtlasKit,{children:e})})}exports.AtlassianAppStandalone=R;exports.default=R;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),g=require("@atlaskit/app-provider"),o=require("react"),S=require("../../../../../data-access-atlassian-product-fetch-oauth/src/lib/atlassian-oauth-fetch/index.cjs.js"),B=require("../../../../../data-access-resources/src/lib/atlassian-user-resource-service/index.cjs.js"),O=require("../../../../../frontend-feature-chosen-workspace-check/src/lib/feature-chosen-workspace-check/index.cjs.js");require("../../../../../frontend-feature-chosen-workspace-check/src/lib/jira-workspace-provider/index.cjs.js");const P=require("../../../../../frontend-feature-oauth-login/src/lib/feature-oauth/index.cjs.js");require("../../../../../frontend-feature-oauth-login/src/lib/oauth-routes/index.cjs.js");require("@atlaskit/heading");require("@atlaskit/primitives");require("@atlaskit/section-message");require("@atlaskit/spinner");require("../../../../../frontend-ui-app-flags/src/lib/app-flags-dispatch/index.cjs.js");const W=require("../../../../../frontend-ui-app-flags/src/lib/app-flags-provider-atlaskit/index.cjs.js"),J=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-bitbucket/index.cjs.js"),T=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-confluence/index.cjs.js"),E=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-jira/index.cjs.js"),y=require("../../../../../frontend-ui-backend-adapter/src/lib/backend-adapter/index.cjs.js"),M=require("../../../../../frontend-ui-backend-adapter/src/lib/oauth-fetch-invoke/index.cjs.js"),H=require("../../../../../frontend-ui-host-router/src/lib/host-router/index.cjs.js");require("@atlaskit/button/new");const _=require("../../../../../frontend-ui-host-router/src/lib/host-router-provider/index.cjs.js");require("../../../../../frontend-ui-modal/src/lib/modal-content/index.cjs.js");require("../../../../../frontend-ui-iframe/src/lib/iframe-wrapper/index.cjs.js");const $=require("../../../../../frontend-ui-modal/src/lib/modal-service/index.cjs.js"),z=require("../../../../../frontend-ui-modal/src/lib/modal-service-provider/index.cjs.js"),K=require("../../../../../frontend-ui-modal/src/lib/modal-view-context/index.cjs.js"),U=require("../../../../../frontend-ui-remote-adapter/src/lib/remote-adapter/index.cjs.js"),D=require("../../../../../frontend-ui-remote-adapter/src/lib/oauth-fetch-invoke-remote/index.cjs.js"),G=require("../../../../../frontend-ui-view-context/src/lib/view-context-provider/index.cjs.js"),L=require("../../../../../frontend-ui-view-context/src/lib/mock-view-context/index.cjs.js"),Q=o.lazy(()=>Promise.resolve().then(()=>require("../../../../../frontend-feature-chosen-resource-check/src/index/index.cjs.js")));function R({initialMockViewContext:c,backendUrl:u,remoteUrl:h,doCheckWorkspace:A,appName:i,doCheckResource:l,modalOpenerConfig:d,modalContextConfig:q,oauthConfig:n,atlassianResourceId:x,children:t}){const v=r.jsx(X,{appName:i,backendUrl:u,remoteUrl:h,initialMockViewContext:c,modalOpenerConfig:d,modalContextConfig:q,doCheckWorkspace:A,doCheckResource:l,oauthConfig:n,atlassianResourceId:x,children:t});return n?r.jsx(P.OAuthProvider,{clientId:n.clientId,codeTokenExchangeUrl:n.codeTokenExchangeUrl,appName:i,oAuthScopes:n.oAuthScopes,appBaseContext:n.appBaseContext,children:v}):v}function X({initialMockViewContext:c,backendUrl:u,remoteUrl:h,doCheckWorkspace:A,appName:i,doCheckResource:l,modalOpenerConfig:d,modalContextConfig:q,atlassianResourceId:n,children:x}){const[t,v]=o.useState(n),[a,j]=o.useState(),{getAuthToken:s}=P.useOAuth(),f=o.useCallback(()=>S.atlassianOAuthJiraFetch(s(),t??""),[s,t]),C=o.useCallback(()=>S.atlassianOAuthConfluenceFetch(s(),t??""),[s,t]),F=o.useCallback(()=>S.atlassianOAuthBitbucketFetch(s()),[s]),w=o.useCallback(async p=>{if(u&&l){const I=p??localStorage.getItem(`${i}-user-resource-id`)??"",k=await new B.AtlassianUserResourceService().checkUserChosenResource(s(),I);return k.hasChosen&&(localStorage.setItem(`${i}-user-resource-id`,k.resource.id),v(k.resource.id)),k}else return{hasChosen:!0}},[u,s,i,l]);o.useEffect(()=>{const p=t??(c==null?void 0:c.cloudId)??"";if(!a||a.cloudId!==p){const I={...a||c,cloudId:p};j(I)}},[c,t,a]);const b=o.useCallback(()=>u?M.getOauthFetchInvokeImpl(u,s(),t??""):void 0,[t,s,u]);let e=x;A&&(e=r.jsx(O.FeatureChosenWorkspaceCheck,{appName:i,children:e})),d&&(e=r.jsx(z.ModalServiceProvider,{modalService:new $.WindowModalService(d.defaultUrl,d.resourceMap),children:e})),a&&(e=r.jsx(G.ViewContextProvider,{viewContext:q?new K.ModalViewContext(a,q.openerOrigin):new L.MockViewContext(a),children:e})),e=r.jsx(_.HostRouterProvider,{hostRouter:new H.WindowHostRouter,children:r.jsx(J.RequestBitbucketProvider,{requestBitbucketImplementation:F(),children:r.jsx(T.RequestConfluenceProvider,{requestConfluenceImplementation:C(),children:r.jsx(E.RequestJiraProvider,{requestJiraImplementation:f(),children:e})})})});const m=b();return m&&(e=r.jsx(y.BackendAdapterProvider,{invokeImplementation:m,children:e})),h&&(e=r.jsx(U.RemoteAdapterProvider,{invokeRemoteImplementation:D.oauthFetchInvokeRemote(h),children:e})),l&&(e=r.jsx(Q,{checkResource:w,children:e})),r.jsx(g,{children:r.jsx(W.AppFlagsProviderAtlasKit,{children:e})})}exports.AtlassianAppStandalone=R;exports.default=R;
@@ -22,6 +22,7 @@ import { WindowHostRouter as G } from "../../../../../frontend-ui-host-router/sr
22
22
  import "@atlaskit/button/new";
23
23
  import { HostRouterProvider as L } from "../../../../../frontend-ui-host-router/src/lib/host-router-provider/index.es.js";
24
24
  import "../../../../../frontend-ui-modal/src/lib/modal-content/index.es.js";
25
+ import "../../../../../frontend-ui-iframe/src/lib/iframe-wrapper/index.es.js";
25
26
  import { WindowModalService as Q } from "../../../../../frontend-ui-modal/src/lib/modal-service/index.es.js";
26
27
  import { ModalServiceProvider as U } from "../../../../../frontend-ui-modal/src/lib/modal-service-provider/index.es.js";
27
28
  import { ModalViewContext as X } from "../../../../../frontend-ui-modal/src/lib/modal-view-context/index.es.js";
@@ -32,7 +33,7 @@ import { MockViewContext as V } from "../../../../../frontend-ui-view-context/sr
32
33
  const N = O(
33
34
  () => import("../../../../../frontend-feature-chosen-resource-check/src/index/index.es.js")
34
35
  );
35
- function Ee({
36
+ function Je({
36
37
  initialMockViewContext: i,
37
38
  backendUrl: c,
38
39
  remoteUrl: l,
@@ -162,6 +163,6 @@ function ee({
162
163
  )), p && (e = /* @__PURE__ */ r(N, { checkResource: q, children: e })), /* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(b, { children: e }) });
163
164
  }
164
165
  export {
165
- Ee as AtlassianAppStandalone,
166
- Ee as default
166
+ Je as AtlassianAppStandalone,
167
+ Je as default
167
168
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),t=require("react"),w=require("../../../../../../shared/frontend-ui-window-listener-hook/src/lib/window-listener-hook/index.cjs.js"),W=require("../iframe-wrapper.module.scss/index.cjs.js");function R({iframeProps:e,messageCallback:c,onMouseOut:i}){const[o,r]=t.useState(),s=t.useRef(!1),d=t.useRef(!1),u=t.useRef(null),g=t.useCallback(n=>{var h;n.source===((h=u.current)==null?void 0:h.contentWindow)&&c&&c(n.data)},[c]);return w.useWindowListener("message",g),t.useEffect(()=>{(async()=>e!=null&&e.height&&(console.log("IframeWrapper: Setting height to",e.height),r(e.height)))()},[e]),t.useEffect(()=>{(async()=>{var n;!d.current&&((n=u.current)!=null&&n.contentWindow)&&(u.current.contentWindow.focus(),d.current=!0)})()}),l.jsx("div",{className:W["iframe-wrapper"],children:l.jsx("iframe",{title:e==null?void 0:e.title,ref:u,width:e==null?void 0:e.width,height:o,src:e==null?void 0:e.link,onMouseEnter:()=>s.current=!0,onMouseOut:()=>{s.current&&i&&i()}})})}exports.IframeWrapper=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("react"),g=require("../../../../../../shared/frontend-ui-window-listener-hook/src/lib/window-listener-hook/index.cjs.js"),f=require("../iframe-wrapper.module.scss/index.cjs.js"),R=n.forwardRef(({iframeProps:e,messageCallback:o,onMouseOut:i},l)=>{const[h,w]=n.useState(),d=n.useRef(!1),r=n.useRef(!1),u=n.useRef(null);n.useImperativeHandle(l,()=>({reloadContentWindow:()=>{var t,c;return(c=(t=u.current)==null?void 0:t.contentWindow)==null?void 0:c.location.reload()},focusContentWindow:()=>{var t,c;return(c=(t=u.current)==null?void 0:t.contentWindow)==null?void 0:c.focus()}}));const W=n.useCallback(t=>{var c;t.source===((c=u.current)==null?void 0:c.contentWindow)&&o&&o(t.data)},[o]);return g.useWindowListener("message",W),n.useEffect(()=>{(async()=>e!=null&&e.height&&(console.log("IframeWrapper: Setting height to",e.height),w(e.height)))()},[e]),n.useEffect(()=>{(async()=>{var t;!r.current&&((t=u.current)!=null&&t.contentWindow)&&(u.current.contentWindow.focus(),r.current=!0)})()}),s.jsx("div",{className:f["iframe-wrapper"],children:s.jsx("iframe",{title:e==null?void 0:e.title,ref:u,width:e==null?void 0:e.width,height:h,src:e==null?void 0:e.link,onMouseEnter:()=>d.current=!0,onMouseOut:()=>{d.current&&i&&i()}})})});exports.IframeWrapper=R;
@@ -1,41 +1,53 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { useState as y, useRef as u, useCallback as I, useEffect as g } from "react";
3
- import { useWindowListener as R } from "../../../../../../shared/frontend-ui-window-listener-hook/src/lib/window-listener-hook/index.es.js";
4
- import f from "../iframe-wrapper.module.scss/index.es.js";
5
- function j({
6
- iframeProps: t,
7
- messageCallback: c,
8
- onMouseOut: h
9
- }) {
10
- const [s, w] = y(), i = u(!1), d = u(!1), e = u(null), W = I(
11
- (n) => {
12
- var l;
13
- n.source === ((l = e.current) == null ? void 0 : l.contentWindow) && c && c(n.data);
14
- },
15
- [c]
16
- );
17
- return R("message", W), g(() => {
18
- (async () => t != null && t.height && (console.log("IframeWrapper: Setting height to", t.height), w(t.height)))();
19
- }, [t]), g(() => {
20
- (async () => {
21
- var n;
22
- !d.current && ((n = e.current) != null && n.contentWindow) && (e.current.contentWindow.focus(), d.current = !0);
23
- })();
24
- }), /* @__PURE__ */ o("div", { className: f["iframe-wrapper"], children: /* @__PURE__ */ o(
25
- "iframe",
26
- {
27
- title: t == null ? void 0 : t.title,
28
- ref: e,
29
- width: t == null ? void 0 : t.width,
30
- height: s,
31
- src: t == null ? void 0 : t.link,
32
- onMouseEnter: () => i.current = !0,
33
- onMouseOut: () => {
34
- i.current && h && h();
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { forwardRef as f, useState as I, useRef as o, useImperativeHandle as R, useCallback as y, useEffect as w } from "react";
3
+ import { useWindowListener as x } from "../../../../../../shared/frontend-ui-window-listener-hook/src/lib/window-listener-hook/index.es.js";
4
+ import E from "../iframe-wrapper.module.scss/index.es.js";
5
+ const v = f(
6
+ ({ iframeProps: t, messageCallback: u, onMouseOut: d }, s) => {
7
+ const [r, W] = I(), i = o(!1), h = o(!1), c = o(null);
8
+ R(
9
+ s,
10
+ () => ({
11
+ reloadContentWindow: () => {
12
+ var n, e;
13
+ return (e = (n = c.current) == null ? void 0 : n.contentWindow) == null ? void 0 : e.location.reload();
14
+ },
15
+ focusContentWindow: () => {
16
+ var n, e;
17
+ return (e = (n = c.current) == null ? void 0 : n.contentWindow) == null ? void 0 : e.focus();
18
+ }
19
+ })
20
+ );
21
+ const g = y(
22
+ (n) => {
23
+ var e;
24
+ n.source === ((e = c.current) == null ? void 0 : e.contentWindow) && u && u(n.data);
25
+ },
26
+ [u]
27
+ );
28
+ return x("message", g), w(() => {
29
+ (async () => t != null && t.height && (console.log("IframeWrapper: Setting height to", t.height), W(t.height)))();
30
+ }, [t]), w(() => {
31
+ (async () => {
32
+ var n;
33
+ !h.current && ((n = c.current) != null && n.contentWindow) && (c.current.contentWindow.focus(), h.current = !0);
34
+ })();
35
+ }), /* @__PURE__ */ l("div", { className: E["iframe-wrapper"], children: /* @__PURE__ */ l(
36
+ "iframe",
37
+ {
38
+ title: t == null ? void 0 : t.title,
39
+ ref: c,
40
+ width: t == null ? void 0 : t.width,
41
+ height: r,
42
+ src: t == null ? void 0 : t.link,
43
+ onMouseEnter: () => i.current = !0,
44
+ onMouseOut: () => {
45
+ i.current && d && d();
46
+ }
35
47
  }
36
- }
37
- ) });
38
- }
48
+ ) });
49
+ }
50
+ );
39
51
  export {
40
- j as IframeWrapper
52
+ v as IframeWrapper
41
53
  };
@@ -910,6 +910,96 @@
910
910
  "isAbstract": false,
911
911
  "name": "getIssueFields"
912
912
  },
913
+ {
914
+ "kind": "Method",
915
+ "canonicalReference": "@valiantys/atlassian-app-frontend!JiraIssueService#getIssueTypes:member(1)",
916
+ "docComment": "",
917
+ "excerptTokens": [
918
+ {
919
+ "kind": "Content",
920
+ "text": "getIssueTypes(): "
921
+ },
922
+ {
923
+ "kind": "Reference",
924
+ "text": "Promise",
925
+ "canonicalReference": "!Promise:interface"
926
+ },
927
+ {
928
+ "kind": "Content",
929
+ "text": "<"
930
+ },
931
+ {
932
+ "kind": "Reference",
933
+ "text": "IssueTypeDetails",
934
+ "canonicalReference": "@valiantys/atlassian-app-frontend!~IssueTypeDetails:interface"
935
+ },
936
+ {
937
+ "kind": "Content",
938
+ "text": "[]>"
939
+ },
940
+ {
941
+ "kind": "Content",
942
+ "text": ";"
943
+ }
944
+ ],
945
+ "isStatic": false,
946
+ "returnTypeTokenRange": {
947
+ "startIndex": 1,
948
+ "endIndex": 5
949
+ },
950
+ "releaseTag": "Public",
951
+ "isProtected": false,
952
+ "overloadIndex": 1,
953
+ "parameters": [],
954
+ "isOptional": false,
955
+ "isAbstract": false,
956
+ "name": "getIssueTypes"
957
+ },
958
+ {
959
+ "kind": "Method",
960
+ "canonicalReference": "@valiantys/atlassian-app-frontend!JiraIssueService#getIssueTypeSchemes:member(1)",
961
+ "docComment": "",
962
+ "excerptTokens": [
963
+ {
964
+ "kind": "Content",
965
+ "text": "getIssueTypeSchemes(): "
966
+ },
967
+ {
968
+ "kind": "Reference",
969
+ "text": "Promise",
970
+ "canonicalReference": "!Promise:interface"
971
+ },
972
+ {
973
+ "kind": "Content",
974
+ "text": "<"
975
+ },
976
+ {
977
+ "kind": "Reference",
978
+ "text": "IssueTypeScheme",
979
+ "canonicalReference": "@valiantys/atlassian-app-frontend!~IssueTypeScheme:interface"
980
+ },
981
+ {
982
+ "kind": "Content",
983
+ "text": "[]>"
984
+ },
985
+ {
986
+ "kind": "Content",
987
+ "text": ";"
988
+ }
989
+ ],
990
+ "isStatic": false,
991
+ "returnTypeTokenRange": {
992
+ "startIndex": 1,
993
+ "endIndex": 5
994
+ },
995
+ "releaseTag": "Public",
996
+ "isProtected": false,
997
+ "overloadIndex": 1,
998
+ "parameters": [],
999
+ "isOptional": false,
1000
+ "isAbstract": false,
1001
+ "name": "getIssueTypeSchemes"
1002
+ },
913
1003
  {
914
1004
  "kind": "Method",
915
1005
  "canonicalReference": "@valiantys/atlassian-app-frontend!JiraIssueService#issueSearch:member(1)",
@@ -42,6 +42,14 @@ export class JiraIssueService {
42
42
  //
43
43
  // (undocumented)
44
44
  getIssueFields(issueIdOrKey: string, fields: string[]): Promise<IssueFields | undefined>;
45
+ // Warning: (ae-forgotten-export) The symbol "IssueTypeDetails" needs to be exported by the entry point data-access-issue.d.ts
46
+ //
47
+ // (undocumented)
48
+ getIssueTypes(): Promise<IssueTypeDetails[]>;
49
+ // Warning: (ae-forgotten-export) The symbol "IssueTypeScheme" needs to be exported by the entry point data-access-issue.d.ts
50
+ //
51
+ // (undocumented)
52
+ getIssueTypeSchemes(): Promise<IssueTypeScheme[]>;
45
53
  // Warning: (ae-forgotten-export) The symbol "AtlassianDocumentFormat" needs to be exported by the entry point data-access-issue.d.ts
46
54
  //
47
55
  // (undocumented)
@@ -181,6 +181,46 @@ declare interface IssueTransition {
181
181
  looped?: boolean;
182
182
  }
183
183
 
184
+ declare interface IssueTypeDetails {
185
+ avatarId: number;
186
+ description: string;
187
+ hierarchyLevel: number;
188
+ iconUrl: string;
189
+ id: string;
190
+ name: string;
191
+ self: string;
192
+ subtask: boolean;
193
+ }
194
+
195
+ declare interface IssueTypeScheme {
196
+ id: string;
197
+ name: string;
198
+ description: string;
199
+ issueTypes: IssueTypeSchemeIssueTypesPage;
200
+ projects?: {
201
+ isLast: boolean;
202
+ maxResults: number;
203
+ startAt: number;
204
+ total: number;
205
+ values: {
206
+ id: string;
207
+ key: string;
208
+ name: string;
209
+ projectTypeKey: string;
210
+ simplified: boolean;
211
+ avatarUrls: Record<string, string>;
212
+ }[];
213
+ };
214
+ }
215
+
216
+ declare interface IssueTypeSchemeIssueTypesPage {
217
+ isLast: boolean;
218
+ maxResults: number;
219
+ startAt: number;
220
+ total: number;
221
+ values: IssueTypeDetails[];
222
+ }
223
+
184
224
  declare type JiraCommentResponse = {
185
225
  comments: IssueComment[];
186
226
  maxResults: number;
@@ -212,6 +252,8 @@ export declare class JiraIssueService {
212
252
  addIssueComment(issueIdOrKey: string, body: AtlassianDocumentFormat): Promise<IssueComment>;
213
253
  transitionIssue(issueIdOrKey: string, body: TransitionIssueRequest): Promise<void>;
214
254
  createIssueLink(issueLinkRequest: IssueLinkRequest): Promise<void>;
255
+ getIssueTypes(): Promise<IssueTypeDetails[]>;
256
+ getIssueTypeSchemes(): Promise<IssueTypeScheme[]>;
215
257
  }
216
258
 
217
259
  declare type Product = 'jira' | 'bitbucket' | 'confluence' | 'connected-data';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valiantys/atlassian-app-frontend",
3
- "version": "3.0.0-alpha-19",
3
+ "version": "3.0.0-alpha-22",
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
  "exports": {
6
6
  "./atlassian-app": {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),i=require("react-dnd"),a=require("../drop-target-box.module.scss/index.cjs.js");function c({onDrop:e,accept:r,children:t}){const[,o]=i.useDrop(()=>({accept:r,drop(s){e&&e(s)}}),[e]);return u.jsx("div",{ref:o,className:a["drop-target-box"],children:t})}exports.DropTargetBox=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),u=require("react-dnd"),n=require("../drop-target-box.module.scss/index.cjs.js");function a({onDrop:e,accept:r,children:o}){const[,t]=u.useDrop(()=>({accept:r,drop:e}),[e]);return s.jsx("div",{ref:t,className:n["drop-target-box"],children:o})}exports.DropTargetBox=a;
@@ -1,22 +1,20 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
- import { useDrop as s } from "react-dnd";
3
- import f from "../drop-target-box.module.scss/index.es.js";
4
- function x({
2
+ import { useDrop as m } from "react-dnd";
3
+ import s from "../drop-target-box.module.scss/index.es.js";
4
+ function d({
5
5
  onDrop: r,
6
6
  accept: o,
7
7
  children: t
8
8
  }) {
9
- const [, e] = s(
9
+ const [, e] = m(
10
10
  () => ({
11
11
  accept: o,
12
- drop(m) {
13
- r && r(m);
14
- }
12
+ drop: r
15
13
  }),
16
14
  [r]
17
15
  );
18
- return /* @__PURE__ */ p("div", { ref: e, className: f["drop-target-box"], children: t });
16
+ return /* @__PURE__ */ p("div", { ref: e, className: s["drop-target-box"], children: t });
19
17
  }
20
18
  export {
21
- x as DropTargetBox
19
+ d as DropTargetBox
22
20
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");function d(t){return console.error(t),`Error Occurred: ${t.message||t}`}function f(t,n=d){const[u,r]=e.useState(),[i,o]=e.useState(!0),[l,c]=e.useState(),s=e.useCallback(async()=>{o(!0);try{c(void 0);const a=await t();return r(a),a}catch(a){c(n(a)),r(void 0)}finally{o(!1)}},[t,n]);return e.useEffect(()=>{s()},[s]),{data:u,loading:i,error:l,setData:r,setLoading:o,setError:c,manualTrigger:()=>s()}}exports.useLoadDataEffect=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");function d(t){return console.error(t),`Error Occurred: ${t.message||JSON.stringify(t)}`}function f(t,n=d){const[u,r]=e.useState(),[i,o]=e.useState(!0),[l,s]=e.useState(),c=e.useCallback(async()=>{o(!0);try{s(void 0);const a=await t();return r(a),a}catch(a){s(n(a)),r(void 0)}finally{o(!1)}},[t,n]);return e.useEffect(()=>{c()},[c]),{data:u,loading:i,error:l,setData:r,setLoading:o,setError:s,manualTrigger:()=>c()}}exports.useLoadDataEffect=f;
@@ -1,9 +1,9 @@
1
- import { useState as n, useCallback as d, useEffect as f } from "react";
1
+ import { useState as c, useCallback as l, useEffect as d } from "react";
2
2
  function g(r) {
3
- return console.error(r), `Error Occurred: ${r.message || r}`;
3
+ return console.error(r), `Error Occurred: ${r.message || JSON.stringify(r)}`;
4
4
  }
5
5
  function m(r, s = g) {
6
- const [u, a] = n(), [i, o] = n(!0), [l, e] = n(), c = d(async () => {
6
+ const [i, a] = c(), [u, o] = c(!0), [f, e] = c(), n = l(async () => {
7
7
  o(!0);
8
8
  try {
9
9
  e(void 0);
@@ -15,16 +15,16 @@ function m(r, s = g) {
15
15
  o(!1);
16
16
  }
17
17
  }, [r, s]);
18
- return f(() => {
19
- c();
20
- }, [c]), {
21
- data: u,
22
- loading: i,
23
- error: l,
18
+ return d(() => {
19
+ n();
20
+ }, [n]), {
21
+ data: i,
22
+ loading: u,
23
+ error: f,
24
24
  setData: a,
25
25
  setLoading: o,
26
26
  setError: e,
27
- manualTrigger: () => c()
27
+ manualTrigger: () => n()
28
28
  };
29
29
  }
30
30
  export {