@bigbinary/neeto-github-frontend 1.0.5 → 1.0.7
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/dist/index.cjs.js +145 -112
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +144 -111
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,111 +2,16 @@ import React, { useState, useRef } from 'react';
|
|
|
2
2
|
import { isPresent, noop } from '@bigbinary/neeto-cist';
|
|
3
3
|
import { Button, Typography, Input, Pane } from '@bigbinary/neetoui';
|
|
4
4
|
import { Trans, useTranslation } from 'react-i18next';
|
|
5
|
+
import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
6
|
+
import require$$0 from 'util';
|
|
5
7
|
import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
6
8
|
import { Settings, Plus, Building, User, CannedResponses, Lock } from '@bigbinary/neeto-icons';
|
|
7
9
|
import { Github } from '@bigbinary/neeto-icons/misc';
|
|
8
|
-
import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
9
|
-
import require$$0 from 'util';
|
|
10
|
-
import Search from '@bigbinary/neeto-molecules/Search';
|
|
11
10
|
import classNames from 'classnames';
|
|
11
|
+
import Search from '@bigbinary/neeto-molecules/Search';
|
|
12
12
|
import Scrollable from '@bigbinary/neeto-molecules/Scrollable';
|
|
13
13
|
import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
|
|
14
14
|
|
|
15
|
-
var Configure = withT(function (_ref) {
|
|
16
|
-
var t = _ref.t,
|
|
17
|
-
isConnected = _ref.isConnected,
|
|
18
|
-
installationUrl = _ref.installationUrl;
|
|
19
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
20
|
-
className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
|
|
21
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
22
|
-
className: "mt-1 text-indigo-600 2xl:mt-3",
|
|
23
|
-
href: installationUrl,
|
|
24
|
-
icon: isConnected ? Settings : Plus,
|
|
25
|
-
iconPosition: "left",
|
|
26
|
-
iconSize: 20,
|
|
27
|
-
size: "small",
|
|
28
|
-
style: "text"
|
|
29
|
-
}, isConnected ? t("neetoGithub.configureAccount") : t("neetoGithub.connectAccount")));
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
var Header = withT(function (_ref) {
|
|
33
|
-
var t = _ref.t;
|
|
34
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
className: "neeto-ui-text-gray-800 mb-1 flex w-full flex-row items-center space-x-2 font-sans text-lg font-medium leading-6 antialiased"
|
|
36
|
-
}, /*#__PURE__*/React.createElement(Github, {
|
|
37
|
-
size: 16
|
|
38
|
-
}), /*#__PURE__*/React.createElement(Typography, {
|
|
39
|
-
style: "h4"
|
|
40
|
-
}, t("neetoGithub.github")));
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
var List$1 = withT(function (_ref) {
|
|
44
|
-
var t = _ref.t,
|
|
45
|
-
accounts = _ref.accounts;
|
|
46
|
-
return accounts.map(function (_ref2) {
|
|
47
|
-
var id = _ref2.id,
|
|
48
|
-
name = _ref2.name,
|
|
49
|
-
avatarUrl = _ref2.avatarUrl,
|
|
50
|
-
type = _ref2.type,
|
|
51
|
-
profileUrl = _ref2.profileUrl,
|
|
52
|
-
count = _ref2.count;
|
|
53
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className: "neeto-ui-border-gray-300 flex w-full items-center space-x-2 border-b border-l-0 border-r-0 border-t-0 border-solid p-2",
|
|
55
|
-
key: id
|
|
56
|
-
}, type === "Organization" ? /*#__PURE__*/React.createElement(Building, {
|
|
57
|
-
className: "neeto-ui-text-gray-600",
|
|
58
|
-
size: 16
|
|
59
|
-
}) : /*#__PURE__*/React.createElement(User, {
|
|
60
|
-
className: "neeto-ui-text-gray-600",
|
|
61
|
-
size: 16
|
|
62
|
-
}), /*#__PURE__*/React.createElement(Typography, {
|
|
63
|
-
className: "neeto-ui-text-gray-900",
|
|
64
|
-
style: "body2"
|
|
65
|
-
}, "@", name), /*#__PURE__*/React.createElement("img", {
|
|
66
|
-
alt: name,
|
|
67
|
-
className: "neeto-ui-rounded-full h-4 w-4",
|
|
68
|
-
src: avatarUrl
|
|
69
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
70
|
-
className: "text-indigo-600",
|
|
71
|
-
icon: CannedResponses,
|
|
72
|
-
iconPosition: "left",
|
|
73
|
-
iconSize: 16,
|
|
74
|
-
size: "small",
|
|
75
|
-
style: "text",
|
|
76
|
-
onClick: function onClick() {
|
|
77
|
-
return window.open(profileUrl, "_blank");
|
|
78
|
-
}
|
|
79
|
-
}), /*#__PURE__*/React.createElement(Typography, {
|
|
80
|
-
className: "neeto-ui-text-gray-900 mx-2 text-sm",
|
|
81
|
-
component: "span",
|
|
82
|
-
style: "h3"
|
|
83
|
-
}, "\u2022"), /*#__PURE__*/React.createElement(Typography, {
|
|
84
|
-
style: "body2"
|
|
85
|
-
}, t("neetoGithub.countOf.repos", {
|
|
86
|
-
count: count
|
|
87
|
-
})));
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
var Accounts = function Accounts(_ref) {
|
|
92
|
-
var accounts = _ref.accounts,
|
|
93
|
-
isConnected = _ref.isConnected,
|
|
94
|
-
onConnect = _ref.onConnect,
|
|
95
|
-
installationUrl = _ref.installationUrl;
|
|
96
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
97
|
-
className: "flex w-full flex-col border border-solid border-transparent px-0 py-2 2xl:max-w-sm 2xl:px-8"
|
|
98
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
99
|
-
className: "mb-2"
|
|
100
|
-
}, /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement(List$1, {
|
|
101
|
-
accounts: accounts,
|
|
102
|
-
isConnected: isConnected
|
|
103
|
-
}), /*#__PURE__*/React.createElement(Configure, {
|
|
104
|
-
installationUrl: installationUrl,
|
|
105
|
-
isConnected: isConnected,
|
|
106
|
-
onConnect: onConnect
|
|
107
|
-
})));
|
|
108
|
-
};
|
|
109
|
-
|
|
110
15
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
111
16
|
|
|
112
17
|
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
@@ -2365,6 +2270,105 @@ var newInstallationParams = lib.stringify({
|
|
|
2365
2270
|
var NEW_INSTALLATION_URL = "/github_integrations/app_installations/new?".concat(newInstallationParams);
|
|
2366
2271
|
var TROUBLESHOOT_URL = "https://render.com/docs/github#troubleshooting";
|
|
2367
2272
|
|
|
2273
|
+
var Configure = withT(function (_ref) {
|
|
2274
|
+
var t = _ref.t,
|
|
2275
|
+
isConnected = _ref.isConnected,
|
|
2276
|
+
installationUrl = _ref.installationUrl;
|
|
2277
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2278
|
+
className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
|
|
2279
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
2280
|
+
className: "mt-1 text-indigo-600 xl:mt-3",
|
|
2281
|
+
href: installationUrl,
|
|
2282
|
+
icon: isConnected ? Settings : Plus,
|
|
2283
|
+
iconPosition: "left",
|
|
2284
|
+
iconSize: 20,
|
|
2285
|
+
size: "small",
|
|
2286
|
+
style: "text"
|
|
2287
|
+
}, isConnected ? t("neetoGithub.configureAccount") : t("neetoGithub.connectAccount")));
|
|
2288
|
+
});
|
|
2289
|
+
|
|
2290
|
+
var Header = withT(function (_ref) {
|
|
2291
|
+
var t = _ref.t;
|
|
2292
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2293
|
+
className: "neeto-ui-text-gray-800 mb-1 flex w-full flex-row items-center space-x-2 font-sans text-lg font-medium leading-6 antialiased"
|
|
2294
|
+
}, /*#__PURE__*/React.createElement(Github, {
|
|
2295
|
+
size: 16
|
|
2296
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
2297
|
+
style: "h4"
|
|
2298
|
+
}, t("neetoGithub.github")));
|
|
2299
|
+
});
|
|
2300
|
+
|
|
2301
|
+
var List$1 = withT(function (_ref) {
|
|
2302
|
+
var t = _ref.t,
|
|
2303
|
+
accounts = _ref.accounts;
|
|
2304
|
+
return accounts.map(function (_ref2) {
|
|
2305
|
+
var id = _ref2.id,
|
|
2306
|
+
name = _ref2.name,
|
|
2307
|
+
avatarUrl = _ref2.avatarUrl,
|
|
2308
|
+
type = _ref2.type,
|
|
2309
|
+
profileUrl = _ref2.profileUrl,
|
|
2310
|
+
count = _ref2.count;
|
|
2311
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2312
|
+
className: "neeto-ui-border-gray-300 flex w-full items-center space-x-2 border-b border-l-0 border-r-0 border-t-0 border-solid p-2",
|
|
2313
|
+
key: id
|
|
2314
|
+
}, type === "Organization" ? /*#__PURE__*/React.createElement(Building, {
|
|
2315
|
+
className: "neeto-ui-text-gray-600",
|
|
2316
|
+
size: 16
|
|
2317
|
+
}) : /*#__PURE__*/React.createElement(User, {
|
|
2318
|
+
className: "neeto-ui-text-gray-600",
|
|
2319
|
+
size: 16
|
|
2320
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
2321
|
+
className: "neeto-ui-text-gray-900",
|
|
2322
|
+
style: "body2"
|
|
2323
|
+
}, "@", name), /*#__PURE__*/React.createElement("img", {
|
|
2324
|
+
alt: name,
|
|
2325
|
+
className: "neeto-ui-rounded-full h-4 w-4",
|
|
2326
|
+
src: avatarUrl
|
|
2327
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
2328
|
+
className: "text-indigo-600",
|
|
2329
|
+
icon: CannedResponses,
|
|
2330
|
+
iconPosition: "left",
|
|
2331
|
+
iconSize: 16,
|
|
2332
|
+
size: "small",
|
|
2333
|
+
style: "text",
|
|
2334
|
+
onClick: function onClick() {
|
|
2335
|
+
return window.open(profileUrl, "_blank");
|
|
2336
|
+
}
|
|
2337
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
2338
|
+
className: "neeto-ui-text-gray-900 mx-2 text-sm",
|
|
2339
|
+
component: "span",
|
|
2340
|
+
style: "h3"
|
|
2341
|
+
}, "\u2022"), /*#__PURE__*/React.createElement(Typography, {
|
|
2342
|
+
style: "body2"
|
|
2343
|
+
}, t("neetoGithub.countOf.repos", {
|
|
2344
|
+
count: count
|
|
2345
|
+
})));
|
|
2346
|
+
});
|
|
2347
|
+
});
|
|
2348
|
+
|
|
2349
|
+
var Accounts = function Accounts(_ref) {
|
|
2350
|
+
var isPane = _ref.isPane,
|
|
2351
|
+
accounts = _ref.accounts,
|
|
2352
|
+
isConnected = _ref.isConnected,
|
|
2353
|
+
onConnect = _ref.onConnect,
|
|
2354
|
+
installationUrl = _ref.installationUrl;
|
|
2355
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2356
|
+
className: classNames("flex w-full flex-col border border-solid border-transparent px-0 py-2", {
|
|
2357
|
+
"2xl:max-w-sm 2xl:px-8": isPane,
|
|
2358
|
+
"xl:max-w-sm xl:px-8": !isPane
|
|
2359
|
+
})
|
|
2360
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2361
|
+
className: "mb-2"
|
|
2362
|
+
}, /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement(List$1, {
|
|
2363
|
+
accounts: accounts,
|
|
2364
|
+
isConnected: isConnected
|
|
2365
|
+
}), /*#__PURE__*/React.createElement(Configure, {
|
|
2366
|
+
installationUrl: installationUrl,
|
|
2367
|
+
isConnected: isConnected,
|
|
2368
|
+
onConnect: onConnect
|
|
2369
|
+
})));
|
|
2370
|
+
};
|
|
2371
|
+
|
|
2368
2372
|
function _arrayWithHoles(arr) {
|
|
2369
2373
|
if (Array.isArray(arr)) return arr;
|
|
2370
2374
|
}
|
|
@@ -2661,7 +2665,7 @@ var Repositories = function Repositories(_ref) {
|
|
|
2661
2665
|
installationUrl = _ref.installationUrl,
|
|
2662
2666
|
troubleshootUrl = _ref.troubleshootUrl;
|
|
2663
2667
|
return /*#__PURE__*/React.createElement("div", {
|
|
2664
|
-
className: "w-full space-y-6
|
|
2668
|
+
className: "w-full space-y-6"
|
|
2665
2669
|
}, /*#__PURE__*/React.createElement(Private, {
|
|
2666
2670
|
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
2667
2671
|
installationUrl: installationUrl,
|
|
@@ -2674,6 +2678,37 @@ var Repositories = function Repositories(_ref) {
|
|
|
2674
2678
|
}));
|
|
2675
2679
|
};
|
|
2676
2680
|
|
|
2681
|
+
var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
|
|
2682
|
+
var _ref$accounts = _ref.accounts,
|
|
2683
|
+
accounts = _ref$accounts === void 0 ? [] : _ref$accounts,
|
|
2684
|
+
installationUrl = _ref.installationUrl,
|
|
2685
|
+
isConnected = _ref.isConnected,
|
|
2686
|
+
_ref$isPublicRepoAllo = _ref.isPublicRepoAllowed,
|
|
2687
|
+
isPublicRepoAllowed = _ref$isPublicRepoAllo === void 0 ? false : _ref$isPublicRepoAllo,
|
|
2688
|
+
onConnect = _ref.onConnect,
|
|
2689
|
+
_ref$repositories = _ref.repositories,
|
|
2690
|
+
repositories = _ref$repositories === void 0 ? [] : _ref$repositories,
|
|
2691
|
+
troubleshootUrl = _ref.troubleshootUrl,
|
|
2692
|
+
_ref$isPane = _ref.isPane,
|
|
2693
|
+
isPane = _ref$isPane === void 0 ? false : _ref$isPane;
|
|
2694
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2695
|
+
className: "flex w-full flex-col-reverse 2xl:flex-row"
|
|
2696
|
+
}, /*#__PURE__*/React.createElement(Repositories, {
|
|
2697
|
+
installationUrl: installationUrl,
|
|
2698
|
+
isConnected: isConnected,
|
|
2699
|
+
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
2700
|
+
onConnect: onConnect,
|
|
2701
|
+
repositories: repositories,
|
|
2702
|
+
troubleshootUrl: troubleshootUrl
|
|
2703
|
+
}), /*#__PURE__*/React.createElement(Accounts, {
|
|
2704
|
+
accounts: accounts,
|
|
2705
|
+
installationUrl: installationUrl,
|
|
2706
|
+
isConnected: isConnected,
|
|
2707
|
+
onConnect: onConnect,
|
|
2708
|
+
isPane: isPane
|
|
2709
|
+
}));
|
|
2710
|
+
};
|
|
2711
|
+
|
|
2677
2712
|
var NeetoGithubNanoModal = function NeetoGithubNanoModal(_ref) {
|
|
2678
2713
|
var isOpen = _ref.isOpen,
|
|
2679
2714
|
onClose = _ref.onClose,
|
|
@@ -2705,24 +2740,22 @@ var NeetoGithubNanoModal = function NeetoGithubNanoModal(_ref) {
|
|
|
2705
2740
|
}, t("neetoGithub.modal.title")), /*#__PURE__*/React.createElement(Typography, {
|
|
2706
2741
|
className: "mt-4",
|
|
2707
2742
|
style: "body2"
|
|
2708
|
-
}, t("neetoGithub.modal.description"))), /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement(
|
|
2709
|
-
|
|
2710
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
2711
|
-
className: "flex flex-col-reverse 2xl:flex-row"
|
|
2712
|
-
}, /*#__PURE__*/React.createElement(Repositories, {
|
|
2743
|
+
}, t("neetoGithub.modal.description"))), /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement(NeetoGithubNanoContainer, {
|
|
2744
|
+
accounts: accounts,
|
|
2713
2745
|
installationUrl: installationUrl,
|
|
2714
2746
|
isConnected: isConnected,
|
|
2715
2747
|
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
2716
2748
|
onConnect: onConnect,
|
|
2717
2749
|
repositories: repositories,
|
|
2718
|
-
troubleshootUrl: troubleshootUrl
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
installationUrl: installationUrl,
|
|
2722
|
-
isConnected: isConnected,
|
|
2723
|
-
onConnect: onConnect
|
|
2724
|
-
})))));
|
|
2750
|
+
troubleshootUrl: troubleshootUrl,
|
|
2751
|
+
isPane: true
|
|
2752
|
+
})));
|
|
2725
2753
|
};
|
|
2726
2754
|
|
|
2755
|
+
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
2756
|
+
|
|
2757
|
+
var css = ".width-calc{width:calc(100% - 82px)}.neeto-github-modal-pane-wrapper{width:min(75%,1280px)}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3JlcG9zaXRvcnktdGlsZS5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyIsImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3BhbmUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUNFLHVCQ0NGLENDRkEsaUNBQ0UscUJES0YiLCJzb3VyY2VzQ29udGVudCI6WyIud2lkdGgtY2FsYyB7XG4gIHdpZHRoOiBjYWxjKDEwMCUgLSA4MnB4KTtcbn1cbiIsIi53aWR0aC1jYWxjIHtcbiAgd2lkdGg6IGNhbGMoMTAwJSAtIDgycHgpO1xufVxuXG4ubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gIHdpZHRoOiBtaW4oNzUlLCAxMjgwcHgpO1xufSIsIi5uZWV0by1naXRodWItbW9kYWwtcGFuZS13cmFwcGVyIHtcbiAgd2lkdGg6IG1pbig3NSUsIDEyODBweCk7XG59XG4iXX0= */";
|
|
2758
|
+
n(css,{});
|
|
2759
|
+
|
|
2727
2760
|
export { NeetoGithubNanoModal };
|
|
2728
2761
|
//# sourceMappingURL=index.js.map
|