@bigbinary/neeto-github-frontend 2.1.0 → 2.2.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.
@@ -1,560 +1,39 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var classnames = require('classnames');
6
- var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
7
- var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
8
- var reactI18next = require('react-i18next');
9
- var reactQuery = require('@tanstack/react-query');
10
- var ramda = require('ramda');
11
- var axios = require('axios');
12
- var constants = require('@bigbinary/neeto-commons-frontend/constants');
13
- var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
14
- var Github = require('@bigbinary/neeto-icons/misc/Github');
15
- var Typography = require('@bigbinary/neetoui/Typography');
16
- var jsxRuntime = require('react/jsx-runtime');
17
- var Building = require('@bigbinary/neeto-icons/Building');
18
- var Avatar = require('@bigbinary/neetoui/Avatar');
19
- var Button = require('@bigbinary/neetoui/Button');
20
- var Plus = require('@bigbinary/neeto-icons/Plus');
21
- var Settings = require('@bigbinary/neeto-icons/Settings');
22
3
  var react = require('react');
23
4
  var neetoCist = require('@bigbinary/neeto-cist');
24
- var Search = require('@bigbinary/neeto-molecules/Search');
25
- var Lock = require('@bigbinary/neeto-icons/Lock');
26
- var DateFormat = require('@bigbinary/neeto-molecules/DateFormat');
27
5
  var Pane = require('@bigbinary/neetoui/Pane');
6
+ var Typography = require('@bigbinary/neetoui/Typography');
7
+ var reactI18next = require('react-i18next');
8
+ var NeetoGithubNanoContainer = require('../index-0d3578e2.js');
9
+ var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
28
10
  var require$$0 = require('util');
11
+ var jsxRuntime = require('react/jsx-runtime');
12
+ require('classnames');
13
+ require('@bigbinary/neeto-molecules/PageLoader');
14
+ require('@tanstack/react-query');
15
+ require('ramda');
16
+ require('axios');
17
+ require('@bigbinary/neeto-commons-frontend/constants');
18
+ require('@bigbinary/neeto-commons-frontend/react-utils');
19
+ require('@bigbinary/neeto-icons/misc/Github');
20
+ require('@bigbinary/neeto-icons/Building');
21
+ require('@bigbinary/neetoui/Avatar');
22
+ require('@bigbinary/neetoui/Button');
23
+ require('@bigbinary/neeto-icons/Plus');
24
+ require('@bigbinary/neeto-icons/Settings');
25
+ require('@bigbinary/neeto-molecules/Search');
26
+ require('@bigbinary/neeto-icons/Lock');
27
+ require('@bigbinary/neeto-molecules/DateFormat');
29
28
 
30
29
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
31
30
 
32
- var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
33
- var PageLoader__default = /*#__PURE__*/_interopDefaultLegacy(PageLoader);
34
- var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
35
- var Github__default = /*#__PURE__*/_interopDefaultLegacy(Github);
36
- var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
37
- var Building__default = /*#__PURE__*/_interopDefaultLegacy(Building);
38
- var Avatar__default = /*#__PURE__*/_interopDefaultLegacy(Avatar);
39
- var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
40
- var Plus__default = /*#__PURE__*/_interopDefaultLegacy(Plus);
41
- var Settings__default = /*#__PURE__*/_interopDefaultLegacy(Settings);
42
- var Search__default = /*#__PURE__*/_interopDefaultLegacy(Search);
43
- var Lock__default = /*#__PURE__*/_interopDefaultLegacy(Lock);
44
- var DateFormat__default = /*#__PURE__*/_interopDefaultLegacy(DateFormat);
45
31
  var Pane__default = /*#__PURE__*/_interopDefaultLegacy(Pane);
32
+ var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
46
33
  var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
47
34
 
48
- var _globalProps$organiza$1;
49
- var GITHUB_INTEGRATIONS_BASE_API_URL = "/github_integrations";
50
- ({
51
- integrator_id: initializers.globalProps === null || initializers.globalProps === void 0 || (_globalProps$organiza$1 = initializers.globalProps.organization) === null || _globalProps$organiza$1 === void 0 ? void 0 : _globalProps$organiza$1.id,
52
- integrator_type: "Organization"
53
- });
54
- var GITHUB_INTEGRATOR_PARAMS = {
55
- integratorId: initializers.globalProps.organization.id,
56
- integratorType: "Organization"
57
- };
58
-
59
- var baseUrl = "".concat(GITHUB_INTEGRATIONS_BASE_API_URL, "/app_installations");
60
- var githubAppUrl = function githubAppUrl(id) {
61
- return "".concat(baseUrl, "/").concat(id);
62
- };
63
- var repositories = function repositories() {
64
- return axios__default["default"].get("".concat(githubAppUrl(initializers.globalProps.githubAppInstallationId), "/repositories"), {
65
- params: GITHUB_INTEGRATOR_PARAMS
66
- });
67
- };
68
- var githubAccountsApi = {
69
- repositories: repositories
70
- };
71
-
72
- var QUERY_KEYS = {
73
- GITHUB_REPOSITORIES_LIST: "github-repositories-list"
74
- };
75
- var STALE_TIME_CONFIG = {
76
- staleTime: constants.DEFAULT_STALE_TIME
77
- };
78
-
79
- var useFetchGithubRepositories = function useFetchGithubRepositories(_ref) {
80
- var isConnected = _ref.isConnected;
81
- return reactQuery.useQuery({
82
- queryKey: [QUERY_KEYS.GITHUB_REPOSITORIES_LIST],
83
- queryFn: githubAccountsApi.repositories,
84
- staleTime: STALE_TIME_CONFIG.staleTime,
85
- enabled: isConnected && ramda.isNotNil(initializers.globalProps.githubAppInstallationId)
86
- });
87
- };
88
-
89
- var Header = reactUtils.withT(function (_ref) {
90
- var t = _ref.t;
91
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
92
- 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",
93
- children: [/*#__PURE__*/jsxRuntime.jsx(Github__default["default"], {
94
- size: 16
95
- }), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
96
- style: "h4",
97
- children: t("neetoGithub.github")
98
- })]
99
- });
100
- });
101
-
102
- var Configure = reactUtils.withT(function (_ref) {
103
- var t = _ref.t,
104
- isConnected = _ref.isConnected,
105
- installationUrl = _ref.installationUrl;
106
- return /*#__PURE__*/jsxRuntime.jsx("div", {
107
- className: "neeto-ui-text-gray-900 flex-shrink-0 font-sans text-sm font-normal leading-6 antialiased",
108
- children: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
109
- href: installationUrl,
110
- icon: isConnected ? Settings__default["default"] : Plus__default["default"],
111
- iconPosition: "left",
112
- iconSize: 20,
113
- size: "small",
114
- style: "link",
115
- children: isConnected ? t("neetoGithub.configureAccount") : t("neetoGithub.connectAccount")
116
- })
117
- });
118
- });
119
-
120
- var List$1 = reactUtils.withT(function (_ref) {
121
- var t = _ref.t,
122
- accounts = _ref.accounts,
123
- isConnected = _ref.isConnected,
124
- installationUrl = _ref.installationUrl,
125
- isPane = _ref.isPane;
126
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
127
- className: classnames__default["default"]("neeto-ui-border-gray-300 flex justify-between gap-3 border-b pb-4 pt-2", {
128
- "flex-col md:flex-row": isPane,
129
- "flex-col": !isPane
130
- }),
131
- children: [accounts.map(function (_ref2) {
132
- var id = _ref2.id,
133
- name = _ref2.name,
134
- avatarUrl = _ref2.avatarUrl,
135
- type = _ref2.type,
136
- profileUrl = _ref2.profileUrl,
137
- count = _ref2.count;
138
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
139
- className: "flex w-full items-center space-x-2",
140
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
141
- className: "flex items-center gap-1",
142
- children: [type === "Organization" ? /*#__PURE__*/jsxRuntime.jsx(Building__default["default"], {
143
- className: "neeto-ui-text-gray-600",
144
- size: 24
145
- }) : /*#__PURE__*/jsxRuntime.jsx(Avatar__default["default"], {
146
- size: "small",
147
- user: {
148
- imageUrl: avatarUrl
149
- }
150
- }), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
151
- className: "neeto-ui-text-gray-800",
152
- style: "body2",
153
- children: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
154
- className: "neeto-ui-text-gray-800",
155
- label: "@".concat(name),
156
- style: "link",
157
- onClick: function onClick() {
158
- return window.open(profileUrl, "_blank");
159
- }
160
- })
161
- })]
162
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
163
- className: "neeto-ui-bg-gray-800 neeto-ui-rounded-full h-1 w-1"
164
- }), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
165
- className: "neeto-ui-text-black",
166
- style: "body2",
167
- children: t("neetoGithub.countOf.repos", {
168
- count: count
169
- })
170
- })]
171
- }, id);
172
- }), /*#__PURE__*/jsxRuntime.jsx(Configure, {
173
- installationUrl: installationUrl,
174
- isConnected: isConnected
175
- })]
176
- });
177
- });
178
-
179
- var Accounts = function Accounts(_ref) {
180
- var isPane = _ref.isPane,
181
- accounts = _ref.accounts,
182
- isConnected = _ref.isConnected,
183
- onConnect = _ref.onConnect,
184
- installationUrl = _ref.installationUrl;
185
- return /*#__PURE__*/jsxRuntime.jsx("div", {
186
- className: classnames__default["default"]("flex w-full flex-col border border-solid border-transparent px-0 py-2", {
187
- "order-1": isPane,
188
- "md:order-2 md:max-w-72 lg:max-w-sm lg:px-6": !isPane
189
- }),
190
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
191
- className: "mb-2",
192
- children: [/*#__PURE__*/jsxRuntime.jsx(Header, {}), /*#__PURE__*/jsxRuntime.jsx(List$1, {
193
- accounts: accounts,
194
- installationUrl: installationUrl,
195
- isConnected: isConnected,
196
- isPane: isPane,
197
- onConnect: onConnect
198
- })]
199
- })
200
- });
201
- };
202
-
203
- function _arrayWithHoles(arr) {
204
- if (Array.isArray(arr)) return arr;
205
- }
206
-
207
- function _iterableToArrayLimit(r, l) {
208
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
209
- if (null != t) {
210
- var e,
211
- n,
212
- i,
213
- u,
214
- a = [],
215
- f = !0,
216
- o = !1;
217
- try {
218
- if (i = (t = t.call(r)).next, 0 === l) {
219
- if (Object(t) !== t) return;
220
- f = !1;
221
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
222
- } catch (r) {
223
- o = !0, n = r;
224
- } finally {
225
- try {
226
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
227
- } finally {
228
- if (o) throw n;
229
- }
230
- }
231
- return a;
232
- }
233
- }
234
-
235
- function _arrayLikeToArray(arr, len) {
236
- if (len == null || len > arr.length) len = arr.length;
237
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
238
- return arr2;
239
- }
240
-
241
- function _unsupportedIterableToArray(o, minLen) {
242
- if (!o) return;
243
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
244
- var n = Object.prototype.toString.call(o).slice(8, -1);
245
- if (n === "Object" && o.constructor) n = o.constructor.name;
246
- if (n === "Map" || n === "Set") return Array.from(o);
247
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
248
- }
249
-
250
- function _nonIterableRest() {
251
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
252
- }
253
-
254
- function _slicedToArray(arr, i) {
255
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
256
- }
257
-
258
- var NoRepositories = reactUtils.withT(function (_ref) {
259
- var t = _ref.t,
260
- installationUrl = _ref.installationUrl,
261
- troubleshootUrl = _ref.troubleshootUrl;
262
- return /*#__PURE__*/jsxRuntime.jsx("div", {
263
- className: "flex items-center justify-center py-6",
264
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
265
- className: "mx-auto flex w-full max-w-sm flex-col items-center justify-center space-y-4 py-4 text-center",
266
- children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
267
- style: "body2",
268
- children: t("neetoGithub.noReposDescription")
269
- }), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
270
- href: installationUrl,
271
- icon: Github__default["default"],
272
- iconPosition: "left",
273
- label: t("neetoGithub.connectRepository"),
274
- size: "medium",
275
- style: "primary"
276
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
277
- className: "text-xs",
278
- children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
279
- i18nKey: t("neetoGithub.troubleshoot"),
280
- components: {
281
- troubleshootLink: /*#__PURE__*/jsxRuntime.jsx("a", {
282
- className: "text-indigo-600 underline",
283
- href: troubleshootUrl,
284
- rel: "noopener noreferrer",
285
- target: "_blank"
286
- })
287
- }
288
- })
289
- })]
290
- })
291
- });
292
- });
293
-
294
- var RepositoryTile = function RepositoryTile(_ref) {
295
- var isConnecting = _ref.isConnecting,
296
- onConnect = _ref.onConnect,
297
- repository = _ref.repository;
298
- var _useTranslation = reactI18next.useTranslation(),
299
- t = _useTranslation.t;
300
- var _useState = react.useState(false),
301
- _useState2 = _slicedToArray(_useState, 2),
302
- isLoading = _useState2[0],
303
- setIsLoading = _useState2[1];
304
- var id = repository.id,
305
- fullName = repository.fullName,
306
- isPrivate = repository.isPrivate,
307
- updatedAt = repository.updatedAt;
308
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
309
- className: "neeto-ui-border-gray-300 flex flex-col justify-between gap-3 border-b border-solid py-3 pl-3 pr-3 last:border-b-0 md:flex-row md:items-center md:pl-5",
310
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
311
- className: "width-calc flex items-center space-x-2",
312
- children: [/*#__PURE__*/jsxRuntime.jsx(Github__default["default"], {
313
- className: "flex-shrink-0",
314
- size: 16
315
- }), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
316
- style: "body2",
317
- children: fullName
318
- }), isPrivate && /*#__PURE__*/jsxRuntime.jsx(Lock__default["default"], {
319
- className: "flex-shrink-0",
320
- size: 16
321
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
322
- className: "hidden lg:inline-block",
323
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
324
- className: "neeto-ui-bg-gray-800 neeto-ui-rounded-full h-1 w-1"
325
- }), /*#__PURE__*/jsxRuntime.jsx(DateFormat__default["default"].FromNow, {
326
- date: updatedAt
327
- })]
328
- })]
329
- }), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
330
- className: "w-max",
331
- disabled: isConnecting,
332
- loading: isLoading,
333
- style: "primary",
334
- type: "button",
335
- onClick: function onClick() {
336
- return onConnect({
337
- repoType: "private",
338
- repository: repository,
339
- setIsLoading: setIsLoading
340
- });
341
- },
342
- children: t("neetoGithub.connect")
343
- })]
344
- }, id);
345
- };
346
-
347
- var List = reactUtils.withT(function (_ref) {
348
- var t = _ref.t,
349
- filteredRepositories = _ref.filteredRepositories,
350
- repositories = _ref.repositories,
351
- isConnecting = _ref.isConnecting,
352
- onConnect = _ref.onConnect,
353
- installationUrl = _ref.installationUrl,
354
- troubleshootUrl = _ref.troubleshootUrl;
355
- return /*#__PURE__*/jsxRuntime.jsx("div", {
356
- className: "h-full overflow-y-scroll px-4 pb-4 md:px-6 md:pb-6",
357
- children: neetoCist.isPresent(repositories) ? /*#__PURE__*/jsxRuntime.jsx("div", {
358
- className: classnames__default["default"]("neeto-ui-border-gray-300 neeto-ui-rounded-md flex flex-col items-center justify-center border", {
359
- "h-auto": neetoCist.isPresent(filteredRepositories),
360
- "h-full": !neetoCist.isPresent(filteredRepositories)
361
- }),
362
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
363
- className: "m-0 h-full w-full p-0",
364
- children: neetoCist.isPresent(filteredRepositories) ? filteredRepositories.map(function (repository, index) {
365
- return /*#__PURE__*/react.createElement(RepositoryTile, {
366
- isConnecting: isConnecting,
367
- onConnect: onConnect,
368
- repository: repository,
369
- key: index
370
- });
371
- }) : /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
372
- className: "flex h-full w-full items-center justify-center",
373
- style: "body2",
374
- children: t("neetoGithub.noRepos")
375
- })
376
- })
377
- }) : /*#__PURE__*/jsxRuntime.jsx(NoRepositories, {
378
- installationUrl: installationUrl,
379
- troubleshootUrl: troubleshootUrl
380
- })
381
- });
382
- });
383
-
384
- var NotConnected = reactUtils.withT(function (_ref) {
385
- var t = _ref.t,
386
- installationUrl = _ref.installationUrl;
387
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
388
- className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center",
389
- children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
390
- style: "body2",
391
- children: t("neetoGithub.notConnectedDescription", {
392
- appName: initializers.globalProps.appName
393
- })
394
- }), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
395
- href: installationUrl,
396
- icon: Github__default["default"],
397
- iconPosition: "left",
398
- label: t("neetoGithub.connectGithub"),
399
- size: "medium",
400
- style: "primary"
401
- })]
402
- });
403
- });
404
-
405
- var Private = function Private(_ref) {
406
- var isConnected = _ref.isConnected,
407
- isConnecting = _ref.isConnecting,
408
- repositories = _ref.repositories,
409
- onConnect = _ref.onConnect,
410
- installationUrl = _ref.installationUrl,
411
- troubleshootUrl = _ref.troubleshootUrl;
412
- var _useTranslation = reactI18next.useTranslation(),
413
- t = _useTranslation.t;
414
- var _useState = react.useState(repositories),
415
- _useState2 = _slicedToArray(_useState, 2),
416
- filteredRepositories = _useState2[0],
417
- setFilteredRepositories = _useState2[1];
418
- var onSearch = function onSearch(searchTerm) {
419
- if (!neetoCist.isPresent(searchTerm)) {
420
- setFilteredRepositories(repositories);
421
- return;
422
- }
423
- var filteredRepositories = repositories.filter(function (_ref2) {
424
- var fullName = _ref2.fullName;
425
- return fullName.toLowerCase().includes(searchTerm.toLowerCase());
426
- });
427
- setFilteredRepositories(filteredRepositories);
428
- };
429
- return /*#__PURE__*/jsxRuntime.jsx("div", {
430
- className: "connect-repo flex h-full flex-col",
431
- children: isConnected ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
432
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
433
- className: "space-y-3 p-4 md:p-6",
434
- children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
435
- className: "flex-shrink-0 text-lg font-medium",
436
- style: "h2",
437
- children: t("neetoGithub.connectARepo")
438
- }), neetoCist.isPresent(repositories) && /*#__PURE__*/jsxRuntime.jsx(Search__default["default"], {
439
- onSearch: onSearch,
440
- className: "w-full",
441
- unlimitedChars: false,
442
- suffix: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
443
- style: "body2",
444
- children: t("neetoGithub.countOf.repos", {
445
- count: filteredRepositories.length
446
- })
447
- })
448
- })]
449
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
450
- className: "flex min-h-0 w-full flex-grow flex-col space-y-6",
451
- children: /*#__PURE__*/jsxRuntime.jsx(List, {
452
- filteredRepositories: filteredRepositories,
453
- installationUrl: installationUrl,
454
- isConnecting: isConnecting,
455
- onConnect: onConnect,
456
- repositories: repositories,
457
- troubleshootUrl: troubleshootUrl
458
- })
459
- })]
460
- }) : /*#__PURE__*/jsxRuntime.jsx("div", {
461
- className: "neeto-ui-text-gray-900 flex-grow font-sans text-sm font-normal leading-6 antialiased",
462
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
463
- className: "flex h-full flex-col items-center justify-center p-4",
464
- children: /*#__PURE__*/jsxRuntime.jsx(NotConnected, {
465
- installationUrl: installationUrl
466
- })
467
- })
468
- })
469
- });
470
- };
471
-
472
- var Repositories = function Repositories(_ref) {
473
- var isConnected = _ref.isConnected,
474
- isConnecting = _ref.isConnecting,
475
- repositories = _ref.repositories,
476
- onConnect = _ref.onConnect,
477
- installationUrl = _ref.installationUrl,
478
- troubleshootUrl = _ref.troubleshootUrl,
479
- isPane = _ref.isPane;
480
- return /*#__PURE__*/jsxRuntime.jsx("div", {
481
- className: classnames__default["default"]("neeto-ui-rounded-md neeto-ui-border-gray-300 h-full w-full space-y-6 border border-solid", {
482
- "order-2": isPane,
483
- "order-1": !isPane
484
- }),
485
- children: /*#__PURE__*/jsxRuntime.jsx(Private, {
486
- installationUrl: installationUrl,
487
- isConnected: isConnected,
488
- isConnecting: isConnecting,
489
- onConnect: onConnect,
490
- repositories: repositories,
491
- troubleshootUrl: troubleshootUrl
492
- })
493
- });
494
- };
495
-
496
- var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
497
- var _ref$isPaneLoading = _ref.isPaneLoading,
498
- isPaneLoading = _ref$isPaneLoading === void 0 ? false : _ref$isPaneLoading,
499
- _ref$shouldFetchRepos = _ref.shouldFetchRepositories,
500
- shouldFetchRepositories = _ref$shouldFetchRepos === void 0 ? true : _ref$shouldFetchRepos,
501
- _ref$paneAccounts = _ref.paneAccounts,
502
- paneAccounts = _ref$paneAccounts === void 0 ? [] : _ref$paneAccounts,
503
- installationUrl = _ref.installationUrl,
504
- isConnected = _ref.isConnected,
505
- _ref$isConnecting = _ref.isConnecting,
506
- isConnecting = _ref$isConnecting === void 0 ? false : _ref$isConnecting,
507
- onConnect = _ref.onConnect,
508
- _ref$paneRepositories = _ref.paneRepositories,
509
- paneRepositories = _ref$paneRepositories === void 0 ? [] : _ref$paneRepositories,
510
- troubleshootUrl = _ref.troubleshootUrl,
511
- _ref$isPane = _ref.isPane,
512
- isPane = _ref$isPane === void 0 ? false : _ref$isPane;
513
- var _useTranslation = reactI18next.useTranslation(),
514
- t = _useTranslation.t;
515
- var _useFetchGithubReposi = useFetchGithubRepositories({
516
- isConnected: shouldFetchRepositories && initializers.globalProps.isGithubIntegrated
517
- }),
518
- _useFetchGithubReposi2 = _useFetchGithubReposi.data,
519
- _useFetchGithubReposi3 = _useFetchGithubReposi2 === void 0 ? {} : _useFetchGithubReposi2,
520
- _useFetchGithubReposi4 = _useFetchGithubReposi3.repositories,
521
- containerRepositories = _useFetchGithubReposi4 === void 0 ? [] : _useFetchGithubReposi4,
522
- _useFetchGithubReposi5 = _useFetchGithubReposi3.accounts,
523
- containerAccounts = _useFetchGithubReposi5 === void 0 ? [] : _useFetchGithubReposi5,
524
- isContainerLoading = _useFetchGithubReposi.isLoading;
525
- var repositories = shouldFetchRepositories ? containerRepositories : paneRepositories;
526
- var accounts = shouldFetchRepositories ? containerAccounts : paneAccounts;
527
- var isLoading = shouldFetchRepositories ? isContainerLoading : isPaneLoading;
528
- if (isLoading) {
529
- return /*#__PURE__*/jsxRuntime.jsx("div", {
530
- className: "flex h-full w-full flex-col items-center",
531
- children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {
532
- text: t("neetoGithub.fetchingRepos")
533
- })
534
- });
535
- }
536
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
537
- className: classnames__default["default"]("flex min-h-0 w-full flex-grow flex-col", {
538
- "flex-col": isPane,
539
- "gap-3 md:flex-row md:gap-6": !isPane
540
- }),
541
- children: [/*#__PURE__*/jsxRuntime.jsx(Accounts, {
542
- accounts: accounts,
543
- installationUrl: installationUrl,
544
- isConnected: isConnected,
545
- isPane: isPane,
546
- onConnect: onConnect
547
- }), /*#__PURE__*/jsxRuntime.jsx(Repositories, {
548
- installationUrl: installationUrl,
549
- isConnected: isConnected,
550
- isConnecting: isConnecting,
551
- isPane: isPane,
552
- onConnect: onConnect,
553
- repositories: repositories,
554
- troubleshootUrl: troubleshootUrl
555
- })]
556
- });
557
- };
35
+ var css = ".neeto-github-modal-pane-wrapper{width:min(100%,1280px)}@media (min-width:768px){.neeto-github-modal-pane-wrapper{width:min(90%,1280px)}}@media (min-width:1024px){.neeto-github-modal-pane-wrapper{width:min(60%,1280px)}}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvcGFuZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGlDQUNFLHNCQUNGLENBQ0UseUJBSEYsaUNBSUkscUJBRUYsQ0FDRixDQUFFLDBCQVBGLGlDQVFJLHFCQUdGLENBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyIubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gIHdpZHRoOiBtaW4oMTAwJSwgMTI4MHB4KTtcblxuICBAc2NyZWVuIG1kIHtcbiAgICB3aWR0aDogbWluKDkwJSwgMTI4MHB4KTtcbiAgfVxuXG4gIEBzY3JlZW4gbGcge1xuICAgIHdpZHRoOiBtaW4oNjAlLCAxMjgwcHgpO1xuICB9XG59XG4iXX0= */";
36
+ NeetoGithubNanoContainer.n(css,{});
558
37
 
559
38
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
560
39
 
@@ -2829,7 +2308,7 @@ var NeetoGithubNanoPane = function NeetoGithubNanoPane(_ref) {
2829
2308
  var _useTranslation = reactI18next.useTranslation(),
2830
2309
  t = _useTranslation.t;
2831
2310
  var initialFocusRef = react.useRef(null);
2832
- var _useFetchGithubReposi = useFetchGithubRepositories({
2311
+ var _useFetchGithubReposi = NeetoGithubNanoContainer.useFetchGithubRepositories({
2833
2312
  isConnected: isOpen && isConnected
2834
2313
  }),
2835
2314
  _useFetchGithubReposi2 = _useFetchGithubReposi.data,
@@ -2857,7 +2336,7 @@ var NeetoGithubNanoPane = function NeetoGithubNanoPane(_ref) {
2857
2336
  children: neetoCist.isPresent(title) ? title : t("neetoGithub.modal.title")
2858
2337
  })
2859
2338
  }), /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Body, {
2860
- children: /*#__PURE__*/jsxRuntime.jsx(NeetoGithubNanoContainer, {
2339
+ children: /*#__PURE__*/jsxRuntime.jsx(NeetoGithubNanoContainer.NeetoGithubNanoContainer, {
2861
2340
  installationUrl: installationUrl,
2862
2341
  isConnected: isConnected,
2863
2342
  isConnecting: isConnecting,
@@ -2873,11 +2352,5 @@ var NeetoGithubNanoPane = function NeetoGithubNanoPane(_ref) {
2873
2352
  });
2874
2353
  };
2875
2354
 
2876
- 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}}
2877
-
2878
- var css = ".width-calc{width:100%}@media (min-width:768px){.width-calc{width:calc(100% - 82px)}}.neeto-github-modal-pane-wrapper{width:min(100%,1280px)}@media (min-width:768px){.neeto-github-modal-pane-wrapper{width:min(90%,1280px)}}@media (min-width:1024px){.neeto-github-modal-pane-wrapper{width:min(60%,1280px)}}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3JlcG9zaXRvcnktdGlsZS5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyIsImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3BhbmUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUNFLFVDQ0YsQ0RDRSx5QkFIRixZQUlJLHVCQ0VGLENBQ0YsQ0NQQSxpQ0FDRSxzQkRVRixDQ1JFLHlCQUhGLGlDQUlJLHFCRFdGLENBQ0YsQ0NURSwwQkFQRixpQ0FRSSxxQkRZRixDQUNGIiwic291cmNlc0NvbnRlbnQiOlsiLndpZHRoLWNhbGMge1xuICB3aWR0aDogMTAwJTtcblxuICBAc2NyZWVuIG1kIHtcbiAgICB3aWR0aDogY2FsYygxMDAlIC0gODJweCk7XG4gIH1cbn1cbiIsIi53aWR0aC1jYWxjIHtcbiAgd2lkdGg6IDEwMCU7XG59XG5Ac2NyZWVuIG1kIHtcbiAgLndpZHRoLWNhbGMge1xuICAgIHdpZHRoOiBjYWxjKDEwMCUgLSA4MnB4KTtcbiAgfVxufVxuXG4ubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gIHdpZHRoOiBtaW4oMTAwJSwgMTI4MHB4KTtcbn1cbkBzY3JlZW4gbWQge1xuICAubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gICAgd2lkdGg6IG1pbig5MCUsIDEyODBweCk7XG4gIH1cbn1cbkBzY3JlZW4gbGcge1xuICAubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gICAgd2lkdGg6IG1pbig2MCUsIDEyODBweCk7XG4gIH1cbn0iLCIubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gIHdpZHRoOiBtaW4oMTAwJSwgMTI4MHB4KTtcblxuICBAc2NyZWVuIG1kIHtcbiAgICB3aWR0aDogbWluKDkwJSwgMTI4MHB4KTtcbiAgfVxuXG4gIEBzY3JlZW4gbGcge1xuICAgIHdpZHRoOiBtaW4oNjAlLCAxMjgwcHgpO1xuICB9XG59XG4iXX0= */";
2879
- n(css,{});
2880
-
2881
- exports.NeetoGithubNanoContainer = NeetoGithubNanoContainer;
2882
- exports.NeetoGithubNanoPane = NeetoGithubNanoPane;
2883
- //# sourceMappingURL=index.cjs.js.map
2355
+ module.exports = NeetoGithubNanoPane;
2356
+ //# sourceMappingURL=NeetoGithubNanoPane.js.map