@bigbinary/neeto-github-frontend 1.0.27 → 1.1.0-beta1
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 +1194 -297
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1174 -298
- package/dist/index.js.map +1 -1
- package/package.json +15 -15
package/dist/index.js
CHANGED
|
@@ -1,60 +1,882 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useState, createElement, useRef } from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
3
4
|
import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
4
5
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
5
6
|
import { Trans, useTranslation } from 'react-i18next';
|
|
6
7
|
import { isNotNil } from 'ramda';
|
|
7
|
-
import {
|
|
8
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
8
9
|
import axios from 'axios';
|
|
9
10
|
import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
|
|
10
11
|
import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
11
|
-
import { Settings, Plus, Building, User, CannedResponses, Lock } from '@bigbinary/neeto-icons';
|
|
12
|
-
import { Button, Typography, Pane } from '@bigbinary/neetoui';
|
|
13
12
|
import { Github } from '@bigbinary/neeto-icons/misc';
|
|
14
|
-
import
|
|
13
|
+
import Typography from '@bigbinary/neetoui/Typography';
|
|
14
|
+
import { Settings, Plus, Building, Lock } from '@bigbinary/neeto-icons';
|
|
15
|
+
import Avatar from '@bigbinary/neetoui/Avatar';
|
|
16
|
+
import Button from '@bigbinary/neetoui/Button';
|
|
17
|
+
import { isPresent, findBy, noop as noop$1 } from '@bigbinary/neeto-cist';
|
|
15
18
|
import Search from '@bigbinary/neeto-molecules/Search';
|
|
16
19
|
import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
|
|
20
|
+
import Pane from '@bigbinary/neetoui/Pane';
|
|
17
21
|
import require$$0 from 'util';
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
// src/subscribable.ts
|
|
24
|
+
var Subscribable = class {
|
|
25
|
+
constructor() {
|
|
26
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
27
|
+
this.subscribe = this.subscribe.bind(this);
|
|
28
|
+
}
|
|
29
|
+
subscribe(listener) {
|
|
30
|
+
this.listeners.add(listener);
|
|
31
|
+
this.onSubscribe();
|
|
32
|
+
return () => {
|
|
33
|
+
this.listeners.delete(listener);
|
|
34
|
+
this.onUnsubscribe();
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
hasListeners() {
|
|
38
|
+
return this.listeners.size > 0;
|
|
39
|
+
}
|
|
40
|
+
onSubscribe() {
|
|
41
|
+
}
|
|
42
|
+
onUnsubscribe() {
|
|
43
|
+
}
|
|
44
|
+
};
|
|
21
45
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
46
|
+
// src/utils.ts
|
|
47
|
+
var isServer = typeof window === "undefined" || "Deno" in globalThis;
|
|
48
|
+
function noop() {
|
|
49
|
+
return void 0;
|
|
50
|
+
}
|
|
51
|
+
function isValidTimeout(value) {
|
|
52
|
+
return typeof value === "number" && value >= 0 && value !== Infinity;
|
|
53
|
+
}
|
|
54
|
+
function timeUntilStale(updatedAt, staleTime) {
|
|
55
|
+
return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);
|
|
56
|
+
}
|
|
57
|
+
function replaceEqualDeep(a, b) {
|
|
58
|
+
if (a === b) {
|
|
59
|
+
return a;
|
|
60
|
+
}
|
|
61
|
+
const array = isPlainArray(a) && isPlainArray(b);
|
|
62
|
+
if (array || isPlainObject(a) && isPlainObject(b)) {
|
|
63
|
+
const aItems = array ? a : Object.keys(a);
|
|
64
|
+
const aSize = aItems.length;
|
|
65
|
+
const bItems = array ? b : Object.keys(b);
|
|
66
|
+
const bSize = bItems.length;
|
|
67
|
+
const copy = array ? [] : {};
|
|
68
|
+
let equalItems = 0;
|
|
69
|
+
for (let i = 0; i < bSize; i++) {
|
|
70
|
+
const key = array ? i : bItems[i];
|
|
71
|
+
if ((!array && aItems.includes(key) || array) && a[key] === void 0 && b[key] === void 0) {
|
|
72
|
+
copy[key] = void 0;
|
|
73
|
+
equalItems++;
|
|
74
|
+
} else {
|
|
75
|
+
copy[key] = replaceEqualDeep(a[key], b[key]);
|
|
76
|
+
if (copy[key] === a[key] && a[key] !== void 0) {
|
|
77
|
+
equalItems++;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return aSize === bSize && equalItems === aSize ? a : copy;
|
|
82
|
+
}
|
|
83
|
+
return b;
|
|
84
|
+
}
|
|
85
|
+
function shallowEqualObjects(a, b) {
|
|
86
|
+
if (!b || Object.keys(a).length !== Object.keys(b).length) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
for (const key in a) {
|
|
90
|
+
if (a[key] !== b[key]) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
function isPlainArray(value) {
|
|
97
|
+
return Array.isArray(value) && value.length === Object.keys(value).length;
|
|
98
|
+
}
|
|
99
|
+
function isPlainObject(o) {
|
|
100
|
+
if (!hasObjectPrototype(o)) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
const ctor = o.constructor;
|
|
104
|
+
if (ctor === void 0) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
const prot = ctor.prototype;
|
|
108
|
+
if (!hasObjectPrototype(prot)) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
if (!prot.hasOwnProperty("isPrototypeOf")) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
if (Object.getPrototypeOf(o) !== Object.prototype) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
function hasObjectPrototype(o) {
|
|
120
|
+
return Object.prototype.toString.call(o) === "[object Object]";
|
|
121
|
+
}
|
|
122
|
+
function replaceData(prevData, data, options) {
|
|
123
|
+
if (typeof options.structuralSharing === "function") {
|
|
124
|
+
return options.structuralSharing(prevData, data);
|
|
125
|
+
} else if (options.structuralSharing !== false) {
|
|
126
|
+
return replaceEqualDeep(prevData, data);
|
|
127
|
+
}
|
|
128
|
+
return data;
|
|
27
129
|
}
|
|
28
130
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
131
|
+
// src/focusManager.ts
|
|
132
|
+
var FocusManager = class extends Subscribable {
|
|
133
|
+
#focused;
|
|
134
|
+
#cleanup;
|
|
135
|
+
#setup;
|
|
136
|
+
constructor() {
|
|
137
|
+
super();
|
|
138
|
+
this.#setup = (onFocus) => {
|
|
139
|
+
if (!isServer && window.addEventListener) {
|
|
140
|
+
const listener = () => onFocus();
|
|
141
|
+
window.addEventListener("visibilitychange", listener, false);
|
|
142
|
+
return () => {
|
|
143
|
+
window.removeEventListener("visibilitychange", listener);
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
return;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
onSubscribe() {
|
|
150
|
+
if (!this.#cleanup) {
|
|
151
|
+
this.setEventListener(this.#setup);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
onUnsubscribe() {
|
|
155
|
+
if (!this.hasListeners()) {
|
|
156
|
+
this.#cleanup?.();
|
|
157
|
+
this.#cleanup = void 0;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
setEventListener(setup) {
|
|
161
|
+
this.#setup = setup;
|
|
162
|
+
this.#cleanup?.();
|
|
163
|
+
this.#cleanup = setup((focused) => {
|
|
164
|
+
if (typeof focused === "boolean") {
|
|
165
|
+
this.setFocused(focused);
|
|
166
|
+
} else {
|
|
167
|
+
this.onFocus();
|
|
168
|
+
}
|
|
169
|
+
});
|
|
36
170
|
}
|
|
37
|
-
|
|
171
|
+
setFocused(focused) {
|
|
172
|
+
const changed = this.#focused !== focused;
|
|
173
|
+
if (changed) {
|
|
174
|
+
this.#focused = focused;
|
|
175
|
+
this.onFocus();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
onFocus() {
|
|
179
|
+
const isFocused = this.isFocused();
|
|
180
|
+
this.listeners.forEach((listener) => {
|
|
181
|
+
listener(isFocused);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
isFocused() {
|
|
185
|
+
if (typeof this.#focused === "boolean") {
|
|
186
|
+
return this.#focused;
|
|
187
|
+
}
|
|
188
|
+
return globalThis.document?.visibilityState !== "hidden";
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
var focusManager = new FocusManager();
|
|
192
|
+
|
|
193
|
+
// src/onlineManager.ts
|
|
194
|
+
var OnlineManager = class extends Subscribable {
|
|
195
|
+
#online = true;
|
|
196
|
+
#cleanup;
|
|
197
|
+
#setup;
|
|
198
|
+
constructor() {
|
|
199
|
+
super();
|
|
200
|
+
this.#setup = (onOnline) => {
|
|
201
|
+
if (!isServer && window.addEventListener) {
|
|
202
|
+
const onlineListener = () => onOnline(true);
|
|
203
|
+
const offlineListener = () => onOnline(false);
|
|
204
|
+
window.addEventListener("online", onlineListener, false);
|
|
205
|
+
window.addEventListener("offline", offlineListener, false);
|
|
206
|
+
return () => {
|
|
207
|
+
window.removeEventListener("online", onlineListener);
|
|
208
|
+
window.removeEventListener("offline", offlineListener);
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
return;
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
onSubscribe() {
|
|
215
|
+
if (!this.#cleanup) {
|
|
216
|
+
this.setEventListener(this.#setup);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
onUnsubscribe() {
|
|
220
|
+
if (!this.hasListeners()) {
|
|
221
|
+
this.#cleanup?.();
|
|
222
|
+
this.#cleanup = void 0;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
setEventListener(setup) {
|
|
226
|
+
this.#setup = setup;
|
|
227
|
+
this.#cleanup?.();
|
|
228
|
+
this.#cleanup = setup(this.setOnline.bind(this));
|
|
229
|
+
}
|
|
230
|
+
setOnline(online) {
|
|
231
|
+
const changed = this.#online !== online;
|
|
232
|
+
if (changed) {
|
|
233
|
+
this.#online = online;
|
|
234
|
+
this.listeners.forEach((listener) => {
|
|
235
|
+
listener(online);
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
isOnline() {
|
|
240
|
+
return this.#online;
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
var onlineManager = new OnlineManager();
|
|
244
|
+
|
|
245
|
+
// src/retryer.ts
|
|
246
|
+
function canFetch(networkMode) {
|
|
247
|
+
return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true;
|
|
38
248
|
}
|
|
39
249
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
250
|
+
// src/notifyManager.ts
|
|
251
|
+
function createNotifyManager() {
|
|
252
|
+
let queue = [];
|
|
253
|
+
let transactions = 0;
|
|
254
|
+
let notifyFn = (callback) => {
|
|
255
|
+
callback();
|
|
256
|
+
};
|
|
257
|
+
let batchNotifyFn = (callback) => {
|
|
258
|
+
callback();
|
|
259
|
+
};
|
|
260
|
+
let scheduleFn = (cb) => setTimeout(cb, 0);
|
|
261
|
+
const setScheduler = (fn) => {
|
|
262
|
+
scheduleFn = fn;
|
|
263
|
+
};
|
|
264
|
+
const batch = (callback) => {
|
|
265
|
+
let result;
|
|
266
|
+
transactions++;
|
|
267
|
+
try {
|
|
268
|
+
result = callback();
|
|
269
|
+
} finally {
|
|
270
|
+
transactions--;
|
|
271
|
+
if (!transactions) {
|
|
272
|
+
flush();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return result;
|
|
276
|
+
};
|
|
277
|
+
const schedule = (callback) => {
|
|
278
|
+
if (transactions) {
|
|
279
|
+
queue.push(callback);
|
|
280
|
+
} else {
|
|
281
|
+
scheduleFn(() => {
|
|
282
|
+
notifyFn(callback);
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
const batchCalls = (callback) => {
|
|
287
|
+
return (...args) => {
|
|
288
|
+
schedule(() => {
|
|
289
|
+
callback(...args);
|
|
290
|
+
});
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
const flush = () => {
|
|
294
|
+
const originalQueue = queue;
|
|
295
|
+
queue = [];
|
|
296
|
+
if (originalQueue.length) {
|
|
297
|
+
scheduleFn(() => {
|
|
298
|
+
batchNotifyFn(() => {
|
|
299
|
+
originalQueue.forEach((callback) => {
|
|
300
|
+
notifyFn(callback);
|
|
301
|
+
});
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
const setNotifyFunction = (fn) => {
|
|
307
|
+
notifyFn = fn;
|
|
308
|
+
};
|
|
309
|
+
const setBatchNotifyFunction = (fn) => {
|
|
310
|
+
batchNotifyFn = fn;
|
|
311
|
+
};
|
|
312
|
+
return {
|
|
313
|
+
batch,
|
|
314
|
+
batchCalls,
|
|
315
|
+
schedule,
|
|
316
|
+
setNotifyFunction,
|
|
317
|
+
setBatchNotifyFunction,
|
|
318
|
+
setScheduler
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
var notifyManager = createNotifyManager();
|
|
322
|
+
|
|
323
|
+
// src/query.ts
|
|
324
|
+
function fetchState(data, options) {
|
|
325
|
+
return {
|
|
326
|
+
fetchFailureCount: 0,
|
|
327
|
+
fetchFailureReason: null,
|
|
328
|
+
fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused",
|
|
329
|
+
...data === void 0 && {
|
|
330
|
+
error: null,
|
|
331
|
+
status: "pending"
|
|
332
|
+
}
|
|
333
|
+
};
|
|
43
334
|
}
|
|
44
335
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
336
|
+
// src/queryObserver.ts
|
|
337
|
+
var QueryObserver = class extends Subscribable {
|
|
338
|
+
constructor(client, options) {
|
|
339
|
+
super();
|
|
340
|
+
this.options = options;
|
|
341
|
+
this.#client = client;
|
|
342
|
+
this.#selectError = null;
|
|
343
|
+
this.bindMethods();
|
|
344
|
+
this.setOptions(options);
|
|
345
|
+
}
|
|
346
|
+
#client;
|
|
347
|
+
#currentQuery = void 0;
|
|
348
|
+
#currentQueryInitialState = void 0;
|
|
349
|
+
#currentResult = void 0;
|
|
350
|
+
#currentResultState;
|
|
351
|
+
#currentResultOptions;
|
|
352
|
+
#selectError;
|
|
353
|
+
#selectFn;
|
|
354
|
+
#selectResult;
|
|
355
|
+
// This property keeps track of the last query with defined data.
|
|
356
|
+
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
357
|
+
#lastQueryWithDefinedData;
|
|
358
|
+
#staleTimeoutId;
|
|
359
|
+
#refetchIntervalId;
|
|
360
|
+
#currentRefetchInterval;
|
|
361
|
+
#trackedProps = /* @__PURE__ */ new Set();
|
|
362
|
+
bindMethods() {
|
|
363
|
+
this.refetch = this.refetch.bind(this);
|
|
364
|
+
}
|
|
365
|
+
onSubscribe() {
|
|
366
|
+
if (this.listeners.size === 1) {
|
|
367
|
+
this.#currentQuery.addObserver(this);
|
|
368
|
+
if (shouldFetchOnMount(this.#currentQuery, this.options)) {
|
|
369
|
+
this.#executeFetch();
|
|
370
|
+
} else {
|
|
371
|
+
this.updateResult();
|
|
372
|
+
}
|
|
373
|
+
this.#updateTimers();
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
onUnsubscribe() {
|
|
377
|
+
if (!this.hasListeners()) {
|
|
378
|
+
this.destroy();
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
shouldFetchOnReconnect() {
|
|
382
|
+
return shouldFetchOn(
|
|
383
|
+
this.#currentQuery,
|
|
384
|
+
this.options,
|
|
385
|
+
this.options.refetchOnReconnect
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
shouldFetchOnWindowFocus() {
|
|
389
|
+
return shouldFetchOn(
|
|
390
|
+
this.#currentQuery,
|
|
391
|
+
this.options,
|
|
392
|
+
this.options.refetchOnWindowFocus
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
destroy() {
|
|
396
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
397
|
+
this.#clearStaleTimeout();
|
|
398
|
+
this.#clearRefetchInterval();
|
|
399
|
+
this.#currentQuery.removeObserver(this);
|
|
400
|
+
}
|
|
401
|
+
setOptions(options, notifyOptions) {
|
|
402
|
+
const prevOptions = this.options;
|
|
403
|
+
const prevQuery = this.#currentQuery;
|
|
404
|
+
this.options = this.#client.defaultQueryOptions(options);
|
|
405
|
+
if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean") {
|
|
406
|
+
throw new Error("Expected enabled to be a boolean");
|
|
407
|
+
}
|
|
408
|
+
this.#updateQuery();
|
|
409
|
+
this.#currentQuery.setOptions(this.options);
|
|
410
|
+
if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {
|
|
411
|
+
this.#client.getQueryCache().notify({
|
|
412
|
+
type: "observerOptionsUpdated",
|
|
413
|
+
query: this.#currentQuery,
|
|
414
|
+
observer: this
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
const mounted = this.hasListeners();
|
|
418
|
+
if (mounted && shouldFetchOptionally(
|
|
419
|
+
this.#currentQuery,
|
|
420
|
+
prevQuery,
|
|
421
|
+
this.options,
|
|
422
|
+
prevOptions
|
|
423
|
+
)) {
|
|
424
|
+
this.#executeFetch();
|
|
425
|
+
}
|
|
426
|
+
this.updateResult(notifyOptions);
|
|
427
|
+
if (mounted && (this.#currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) {
|
|
428
|
+
this.#updateStaleTimeout();
|
|
429
|
+
}
|
|
430
|
+
const nextRefetchInterval = this.#computeRefetchInterval();
|
|
431
|
+
if (mounted && (this.#currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.#currentRefetchInterval)) {
|
|
432
|
+
this.#updateRefetchInterval(nextRefetchInterval);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
getOptimisticResult(options) {
|
|
436
|
+
const query = this.#client.getQueryCache().build(this.#client, options);
|
|
437
|
+
const result = this.createResult(query, options);
|
|
438
|
+
if (shouldAssignObserverCurrentProperties(this, result)) {
|
|
439
|
+
this.#currentResult = result;
|
|
440
|
+
this.#currentResultOptions = this.options;
|
|
441
|
+
this.#currentResultState = this.#currentQuery.state;
|
|
442
|
+
}
|
|
443
|
+
return result;
|
|
444
|
+
}
|
|
445
|
+
getCurrentResult() {
|
|
446
|
+
return this.#currentResult;
|
|
447
|
+
}
|
|
448
|
+
trackResult(result, onPropTracked) {
|
|
449
|
+
const trackedResult = {};
|
|
450
|
+
Object.keys(result).forEach((key) => {
|
|
451
|
+
Object.defineProperty(trackedResult, key, {
|
|
452
|
+
configurable: false,
|
|
453
|
+
enumerable: true,
|
|
454
|
+
get: () => {
|
|
455
|
+
this.trackProp(key);
|
|
456
|
+
onPropTracked?.(key);
|
|
457
|
+
return result[key];
|
|
458
|
+
}
|
|
459
|
+
});
|
|
53
460
|
});
|
|
54
|
-
|
|
55
|
-
|
|
461
|
+
return trackedResult;
|
|
462
|
+
}
|
|
463
|
+
trackProp(key) {
|
|
464
|
+
this.#trackedProps.add(key);
|
|
465
|
+
}
|
|
466
|
+
getCurrentQuery() {
|
|
467
|
+
return this.#currentQuery;
|
|
468
|
+
}
|
|
469
|
+
refetch({ ...options } = {}) {
|
|
470
|
+
return this.fetch({
|
|
471
|
+
...options
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
fetchOptimistic(options) {
|
|
475
|
+
const defaultedOptions = this.#client.defaultQueryOptions(options);
|
|
476
|
+
const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);
|
|
477
|
+
query.isFetchingOptimistic = true;
|
|
478
|
+
return query.fetch().then(() => this.createResult(query, defaultedOptions));
|
|
479
|
+
}
|
|
480
|
+
fetch(fetchOptions) {
|
|
481
|
+
return this.#executeFetch({
|
|
482
|
+
...fetchOptions,
|
|
483
|
+
cancelRefetch: fetchOptions.cancelRefetch ?? true
|
|
484
|
+
}).then(() => {
|
|
485
|
+
this.updateResult();
|
|
486
|
+
return this.#currentResult;
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
#executeFetch(fetchOptions) {
|
|
490
|
+
this.#updateQuery();
|
|
491
|
+
let promise = this.#currentQuery.fetch(
|
|
492
|
+
this.options,
|
|
493
|
+
fetchOptions
|
|
494
|
+
);
|
|
495
|
+
if (!fetchOptions?.throwOnError) {
|
|
496
|
+
promise = promise.catch(noop);
|
|
497
|
+
}
|
|
498
|
+
return promise;
|
|
499
|
+
}
|
|
500
|
+
#updateStaleTimeout() {
|
|
501
|
+
this.#clearStaleTimeout();
|
|
502
|
+
if (isServer || this.#currentResult.isStale || !isValidTimeout(this.options.staleTime)) {
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
const time = timeUntilStale(
|
|
506
|
+
this.#currentResult.dataUpdatedAt,
|
|
507
|
+
this.options.staleTime
|
|
508
|
+
);
|
|
509
|
+
const timeout = time + 1;
|
|
510
|
+
this.#staleTimeoutId = setTimeout(() => {
|
|
511
|
+
if (!this.#currentResult.isStale) {
|
|
512
|
+
this.updateResult();
|
|
513
|
+
}
|
|
514
|
+
}, timeout);
|
|
515
|
+
}
|
|
516
|
+
#computeRefetchInterval() {
|
|
517
|
+
return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;
|
|
518
|
+
}
|
|
519
|
+
#updateRefetchInterval(nextInterval) {
|
|
520
|
+
this.#clearRefetchInterval();
|
|
521
|
+
this.#currentRefetchInterval = nextInterval;
|
|
522
|
+
if (isServer || this.options.enabled === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) {
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
this.#refetchIntervalId = setInterval(() => {
|
|
526
|
+
if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {
|
|
527
|
+
this.#executeFetch();
|
|
528
|
+
}
|
|
529
|
+
}, this.#currentRefetchInterval);
|
|
530
|
+
}
|
|
531
|
+
#updateTimers() {
|
|
532
|
+
this.#updateStaleTimeout();
|
|
533
|
+
this.#updateRefetchInterval(this.#computeRefetchInterval());
|
|
56
534
|
}
|
|
57
|
-
|
|
535
|
+
#clearStaleTimeout() {
|
|
536
|
+
if (this.#staleTimeoutId) {
|
|
537
|
+
clearTimeout(this.#staleTimeoutId);
|
|
538
|
+
this.#staleTimeoutId = void 0;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
#clearRefetchInterval() {
|
|
542
|
+
if (this.#refetchIntervalId) {
|
|
543
|
+
clearInterval(this.#refetchIntervalId);
|
|
544
|
+
this.#refetchIntervalId = void 0;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
createResult(query, options) {
|
|
548
|
+
const prevQuery = this.#currentQuery;
|
|
549
|
+
const prevOptions = this.options;
|
|
550
|
+
const prevResult = this.#currentResult;
|
|
551
|
+
const prevResultState = this.#currentResultState;
|
|
552
|
+
const prevResultOptions = this.#currentResultOptions;
|
|
553
|
+
const queryChange = query !== prevQuery;
|
|
554
|
+
const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState;
|
|
555
|
+
const { state } = query;
|
|
556
|
+
let newState = { ...state };
|
|
557
|
+
let isPlaceholderData = false;
|
|
558
|
+
let data;
|
|
559
|
+
if (options._optimisticResults) {
|
|
560
|
+
const mounted = this.hasListeners();
|
|
561
|
+
const fetchOnMount = !mounted && shouldFetchOnMount(query, options);
|
|
562
|
+
const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);
|
|
563
|
+
if (fetchOnMount || fetchOptionally) {
|
|
564
|
+
newState = {
|
|
565
|
+
...newState,
|
|
566
|
+
...fetchState(state.data, query.options)
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
if (options._optimisticResults === "isRestoring") {
|
|
570
|
+
newState.fetchStatus = "idle";
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
let { error, errorUpdatedAt, status } = newState;
|
|
574
|
+
if (options.select && newState.data !== void 0) {
|
|
575
|
+
if (prevResult && newState.data === prevResultState?.data && options.select === this.#selectFn) {
|
|
576
|
+
data = this.#selectResult;
|
|
577
|
+
} else {
|
|
578
|
+
try {
|
|
579
|
+
this.#selectFn = options.select;
|
|
580
|
+
data = options.select(newState.data);
|
|
581
|
+
data = replaceData(prevResult?.data, data, options);
|
|
582
|
+
this.#selectResult = data;
|
|
583
|
+
this.#selectError = null;
|
|
584
|
+
} catch (selectError) {
|
|
585
|
+
this.#selectError = selectError;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
} else {
|
|
589
|
+
data = newState.data;
|
|
590
|
+
}
|
|
591
|
+
if (options.placeholderData !== void 0 && data === void 0 && status === "pending") {
|
|
592
|
+
let placeholderData;
|
|
593
|
+
if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {
|
|
594
|
+
placeholderData = prevResult.data;
|
|
595
|
+
} else {
|
|
596
|
+
placeholderData = typeof options.placeholderData === "function" ? options.placeholderData(
|
|
597
|
+
this.#lastQueryWithDefinedData?.state.data,
|
|
598
|
+
this.#lastQueryWithDefinedData
|
|
599
|
+
) : options.placeholderData;
|
|
600
|
+
if (options.select && placeholderData !== void 0) {
|
|
601
|
+
try {
|
|
602
|
+
placeholderData = options.select(placeholderData);
|
|
603
|
+
this.#selectError = null;
|
|
604
|
+
} catch (selectError) {
|
|
605
|
+
this.#selectError = selectError;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
if (placeholderData !== void 0) {
|
|
610
|
+
status = "success";
|
|
611
|
+
data = replaceData(
|
|
612
|
+
prevResult?.data,
|
|
613
|
+
placeholderData,
|
|
614
|
+
options
|
|
615
|
+
);
|
|
616
|
+
isPlaceholderData = true;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
if (this.#selectError) {
|
|
620
|
+
error = this.#selectError;
|
|
621
|
+
data = this.#selectResult;
|
|
622
|
+
errorUpdatedAt = Date.now();
|
|
623
|
+
status = "error";
|
|
624
|
+
}
|
|
625
|
+
const isFetching = newState.fetchStatus === "fetching";
|
|
626
|
+
const isPending = status === "pending";
|
|
627
|
+
const isError = status === "error";
|
|
628
|
+
const isLoading = isPending && isFetching;
|
|
629
|
+
const hasData = data !== void 0;
|
|
630
|
+
const result = {
|
|
631
|
+
status,
|
|
632
|
+
fetchStatus: newState.fetchStatus,
|
|
633
|
+
isPending,
|
|
634
|
+
isSuccess: status === "success",
|
|
635
|
+
isError,
|
|
636
|
+
isInitialLoading: isLoading,
|
|
637
|
+
isLoading,
|
|
638
|
+
data,
|
|
639
|
+
dataUpdatedAt: newState.dataUpdatedAt,
|
|
640
|
+
error,
|
|
641
|
+
errorUpdatedAt,
|
|
642
|
+
failureCount: newState.fetchFailureCount,
|
|
643
|
+
failureReason: newState.fetchFailureReason,
|
|
644
|
+
errorUpdateCount: newState.errorUpdateCount,
|
|
645
|
+
isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,
|
|
646
|
+
isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,
|
|
647
|
+
isFetching,
|
|
648
|
+
isRefetching: isFetching && !isPending,
|
|
649
|
+
isLoadingError: isError && !hasData,
|
|
650
|
+
isPaused: newState.fetchStatus === "paused",
|
|
651
|
+
isPlaceholderData,
|
|
652
|
+
isRefetchError: isError && hasData,
|
|
653
|
+
isStale: isStale(query, options),
|
|
654
|
+
refetch: this.refetch
|
|
655
|
+
};
|
|
656
|
+
return result;
|
|
657
|
+
}
|
|
658
|
+
updateResult(notifyOptions) {
|
|
659
|
+
const prevResult = this.#currentResult;
|
|
660
|
+
const nextResult = this.createResult(this.#currentQuery, this.options);
|
|
661
|
+
this.#currentResultState = this.#currentQuery.state;
|
|
662
|
+
this.#currentResultOptions = this.options;
|
|
663
|
+
if (this.#currentResultState.data !== void 0) {
|
|
664
|
+
this.#lastQueryWithDefinedData = this.#currentQuery;
|
|
665
|
+
}
|
|
666
|
+
if (shallowEqualObjects(nextResult, prevResult)) {
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
this.#currentResult = nextResult;
|
|
670
|
+
const defaultNotifyOptions = {};
|
|
671
|
+
const shouldNotifyListeners = () => {
|
|
672
|
+
if (!prevResult) {
|
|
673
|
+
return true;
|
|
674
|
+
}
|
|
675
|
+
const { notifyOnChangeProps } = this.options;
|
|
676
|
+
const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps;
|
|
677
|
+
if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) {
|
|
678
|
+
return true;
|
|
679
|
+
}
|
|
680
|
+
const includedProps = new Set(
|
|
681
|
+
notifyOnChangePropsValue ?? this.#trackedProps
|
|
682
|
+
);
|
|
683
|
+
if (this.options.throwOnError) {
|
|
684
|
+
includedProps.add("error");
|
|
685
|
+
}
|
|
686
|
+
return Object.keys(this.#currentResult).some((key) => {
|
|
687
|
+
const typedKey = key;
|
|
688
|
+
const changed = this.#currentResult[typedKey] !== prevResult[typedKey];
|
|
689
|
+
return changed && includedProps.has(typedKey);
|
|
690
|
+
});
|
|
691
|
+
};
|
|
692
|
+
if (notifyOptions?.listeners !== false && shouldNotifyListeners()) {
|
|
693
|
+
defaultNotifyOptions.listeners = true;
|
|
694
|
+
}
|
|
695
|
+
this.#notify({ ...defaultNotifyOptions, ...notifyOptions });
|
|
696
|
+
}
|
|
697
|
+
#updateQuery() {
|
|
698
|
+
const query = this.#client.getQueryCache().build(this.#client, this.options);
|
|
699
|
+
if (query === this.#currentQuery) {
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
const prevQuery = this.#currentQuery;
|
|
703
|
+
this.#currentQuery = query;
|
|
704
|
+
this.#currentQueryInitialState = query.state;
|
|
705
|
+
if (this.hasListeners()) {
|
|
706
|
+
prevQuery?.removeObserver(this);
|
|
707
|
+
query.addObserver(this);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
onQueryUpdate() {
|
|
711
|
+
this.updateResult();
|
|
712
|
+
if (this.hasListeners()) {
|
|
713
|
+
this.#updateTimers();
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
#notify(notifyOptions) {
|
|
717
|
+
notifyManager.batch(() => {
|
|
718
|
+
if (notifyOptions.listeners) {
|
|
719
|
+
this.listeners.forEach((listener) => {
|
|
720
|
+
listener(this.#currentResult);
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
this.#client.getQueryCache().notify({
|
|
724
|
+
query: this.#currentQuery,
|
|
725
|
+
type: "observerResultsUpdated"
|
|
726
|
+
});
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
function shouldLoadOnMount(query, options) {
|
|
731
|
+
return options.enabled !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false);
|
|
732
|
+
}
|
|
733
|
+
function shouldFetchOnMount(query, options) {
|
|
734
|
+
return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);
|
|
735
|
+
}
|
|
736
|
+
function shouldFetchOn(query, options, field) {
|
|
737
|
+
if (options.enabled !== false) {
|
|
738
|
+
const value = typeof field === "function" ? field(query) : field;
|
|
739
|
+
return value === "always" || value !== false && isStale(query, options);
|
|
740
|
+
}
|
|
741
|
+
return false;
|
|
742
|
+
}
|
|
743
|
+
function shouldFetchOptionally(query, prevQuery, options, prevOptions) {
|
|
744
|
+
return (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options);
|
|
745
|
+
}
|
|
746
|
+
function isStale(query, options) {
|
|
747
|
+
return options.enabled !== false && query.isStaleByTime(options.staleTime);
|
|
748
|
+
}
|
|
749
|
+
function shouldAssignObserverCurrentProperties(observer, optimisticResult) {
|
|
750
|
+
if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {
|
|
751
|
+
return true;
|
|
752
|
+
}
|
|
753
|
+
return false;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
var QueryClientContext = React.createContext(
|
|
757
|
+
void 0
|
|
758
|
+
);
|
|
759
|
+
var useQueryClient = (queryClient) => {
|
|
760
|
+
const client = React.useContext(QueryClientContext);
|
|
761
|
+
if (queryClient) {
|
|
762
|
+
return queryClient;
|
|
763
|
+
}
|
|
764
|
+
if (!client) {
|
|
765
|
+
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
766
|
+
}
|
|
767
|
+
return client;
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
var IsRestoringContext = React.createContext(false);
|
|
771
|
+
var useIsRestoring = () => React.useContext(IsRestoringContext);
|
|
772
|
+
IsRestoringContext.Provider;
|
|
773
|
+
|
|
774
|
+
function createValue() {
|
|
775
|
+
let isReset = false;
|
|
776
|
+
return {
|
|
777
|
+
clearReset: () => {
|
|
778
|
+
isReset = false;
|
|
779
|
+
},
|
|
780
|
+
reset: () => {
|
|
781
|
+
isReset = true;
|
|
782
|
+
},
|
|
783
|
+
isReset: () => {
|
|
784
|
+
return isReset;
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
var QueryErrorResetBoundaryContext = React.createContext(createValue());
|
|
789
|
+
var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);
|
|
790
|
+
|
|
791
|
+
// src/utils.ts
|
|
792
|
+
function shouldThrowError(throwError, params) {
|
|
793
|
+
if (typeof throwError === "function") {
|
|
794
|
+
return throwError(...params);
|
|
795
|
+
}
|
|
796
|
+
return !!throwError;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {
|
|
800
|
+
if (options.suspense || options.throwOnError) {
|
|
801
|
+
if (!errorResetBoundary.isReset()) {
|
|
802
|
+
options.retryOnMount = false;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
};
|
|
806
|
+
var useClearResetErrorBoundary = (errorResetBoundary) => {
|
|
807
|
+
React.useEffect(() => {
|
|
808
|
+
errorResetBoundary.clearReset();
|
|
809
|
+
}, [errorResetBoundary]);
|
|
810
|
+
};
|
|
811
|
+
var getHasError = ({
|
|
812
|
+
result,
|
|
813
|
+
errorResetBoundary,
|
|
814
|
+
throwOnError,
|
|
815
|
+
query
|
|
816
|
+
}) => {
|
|
817
|
+
return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && shouldThrowError(throwOnError, [result.error, query]);
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
// src/suspense.ts
|
|
821
|
+
var ensureStaleTime = (defaultedOptions) => {
|
|
822
|
+
if (defaultedOptions.suspense) {
|
|
823
|
+
if (typeof defaultedOptions.staleTime !== "number") {
|
|
824
|
+
defaultedOptions.staleTime = 1e3;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;
|
|
829
|
+
var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {
|
|
830
|
+
errorResetBoundary.clearReset();
|
|
831
|
+
});
|
|
832
|
+
|
|
833
|
+
function useBaseQuery(options, Observer, queryClient) {
|
|
834
|
+
const client = useQueryClient(queryClient);
|
|
835
|
+
const isRestoring = useIsRestoring();
|
|
836
|
+
const errorResetBoundary = useQueryErrorResetBoundary();
|
|
837
|
+
const defaultedOptions = client.defaultQueryOptions(options);
|
|
838
|
+
defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic";
|
|
839
|
+
ensureStaleTime(defaultedOptions);
|
|
840
|
+
ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);
|
|
841
|
+
useClearResetErrorBoundary(errorResetBoundary);
|
|
842
|
+
const [observer] = React.useState(
|
|
843
|
+
() => new Observer(
|
|
844
|
+
client,
|
|
845
|
+
defaultedOptions
|
|
846
|
+
)
|
|
847
|
+
);
|
|
848
|
+
const result = observer.getOptimisticResult(defaultedOptions);
|
|
849
|
+
React.useSyncExternalStore(
|
|
850
|
+
React.useCallback(
|
|
851
|
+
(onStoreChange) => {
|
|
852
|
+
const unsubscribe = isRestoring ? () => void 0 : observer.subscribe(notifyManager.batchCalls(onStoreChange));
|
|
853
|
+
observer.updateResult();
|
|
854
|
+
return unsubscribe;
|
|
855
|
+
},
|
|
856
|
+
[observer, isRestoring]
|
|
857
|
+
),
|
|
858
|
+
() => observer.getCurrentResult(),
|
|
859
|
+
() => observer.getCurrentResult()
|
|
860
|
+
);
|
|
861
|
+
React.useEffect(() => {
|
|
862
|
+
observer.setOptions(defaultedOptions, { listeners: false });
|
|
863
|
+
}, [defaultedOptions, observer]);
|
|
864
|
+
if (shouldSuspend(defaultedOptions, result)) {
|
|
865
|
+
throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);
|
|
866
|
+
}
|
|
867
|
+
if (getHasError({
|
|
868
|
+
result,
|
|
869
|
+
errorResetBoundary,
|
|
870
|
+
throwOnError: defaultedOptions.throwOnError,
|
|
871
|
+
query: client.getQueryCache().get(defaultedOptions.queryHash)
|
|
872
|
+
})) {
|
|
873
|
+
throw result.error;
|
|
874
|
+
}
|
|
875
|
+
return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
function useQuery(options, queryClient) {
|
|
879
|
+
return useBaseQuery(options, QueryObserver, queryClient);
|
|
58
880
|
}
|
|
59
881
|
|
|
60
882
|
var _globalProps$organiza$1;
|
|
@@ -88,88 +910,103 @@ var STALE_TIME_CONFIG = {
|
|
|
88
910
|
staleTime: DEFAULT_STALE_TIME
|
|
89
911
|
};
|
|
90
912
|
|
|
91
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
92
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
93
913
|
var useFetchGithubRepositories = function useFetchGithubRepositories(_ref) {
|
|
94
914
|
var isConnected = _ref.isConnected;
|
|
95
|
-
return useQuery(
|
|
915
|
+
return useQuery({
|
|
916
|
+
queryKey: [QUERY_KEYS.GITHUB_REPOSITORIES_LIST],
|
|
917
|
+
queryFn: githubAccountsApi.repositories,
|
|
918
|
+
staleTime: STALE_TIME_CONFIG.staleTime,
|
|
96
919
|
enabled: isConnected && isNotNil(globalProps.githubAppInstallationId)
|
|
97
|
-
})
|
|
920
|
+
});
|
|
98
921
|
};
|
|
99
922
|
|
|
923
|
+
var Header = withT(function (_ref) {
|
|
924
|
+
var t = _ref.t;
|
|
925
|
+
return /*#__PURE__*/jsxs("div", {
|
|
926
|
+
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",
|
|
927
|
+
children: [/*#__PURE__*/jsx(Github, {
|
|
928
|
+
size: 16
|
|
929
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
930
|
+
style: "h4",
|
|
931
|
+
children: t("neetoGithub.github")
|
|
932
|
+
})]
|
|
933
|
+
});
|
|
934
|
+
});
|
|
935
|
+
|
|
100
936
|
var Configure = withT(function (_ref) {
|
|
101
937
|
var t = _ref.t,
|
|
102
938
|
isConnected = _ref.isConnected,
|
|
103
939
|
installationUrl = _ref.installationUrl;
|
|
104
|
-
return /*#__PURE__*/
|
|
105
|
-
className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
var Header = withT(function (_ref) {
|
|
118
|
-
var t = _ref.t;
|
|
119
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
120
|
-
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"
|
|
121
|
-
}, /*#__PURE__*/React.createElement(Github, {
|
|
122
|
-
size: 16
|
|
123
|
-
}), /*#__PURE__*/React.createElement(Typography, {
|
|
124
|
-
style: "h4"
|
|
125
|
-
}, t("neetoGithub.github")));
|
|
940
|
+
return /*#__PURE__*/jsx("div", {
|
|
941
|
+
className: "neeto-ui-text-gray-900 flex-shrink-0 font-sans text-sm font-normal leading-6 antialiased",
|
|
942
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
943
|
+
href: installationUrl,
|
|
944
|
+
icon: isConnected ? Settings : Plus,
|
|
945
|
+
iconPosition: "left",
|
|
946
|
+
iconSize: 20,
|
|
947
|
+
size: "small",
|
|
948
|
+
style: "link",
|
|
949
|
+
children: isConnected ? t("neetoGithub.configureAccount") : t("neetoGithub.connectAccount")
|
|
950
|
+
})
|
|
951
|
+
});
|
|
126
952
|
});
|
|
127
953
|
|
|
128
954
|
var List$1 = withT(function (_ref) {
|
|
129
955
|
var t = _ref.t,
|
|
130
|
-
accounts = _ref.accounts
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
956
|
+
accounts = _ref.accounts,
|
|
957
|
+
isConnected = _ref.isConnected,
|
|
958
|
+
installationUrl = _ref.installationUrl,
|
|
959
|
+
isPane = _ref.isPane;
|
|
960
|
+
return /*#__PURE__*/jsxs("div", {
|
|
961
|
+
className: classnames("neeto-ui-border-gray-300 flex justify-between gap-3 border-b pb-4 pt-2", {
|
|
962
|
+
"flex-col md:flex-row": isPane,
|
|
963
|
+
"flex-col": !isPane
|
|
964
|
+
}),
|
|
965
|
+
children: [accounts.map(function (_ref2) {
|
|
966
|
+
var id = _ref2.id,
|
|
967
|
+
name = _ref2.name,
|
|
968
|
+
avatarUrl = _ref2.avatarUrl,
|
|
969
|
+
type = _ref2.type,
|
|
970
|
+
profileUrl = _ref2.profileUrl,
|
|
971
|
+
count = _ref2.count;
|
|
972
|
+
return /*#__PURE__*/jsxs("div", {
|
|
973
|
+
className: "flex w-full items-center space-x-2",
|
|
974
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
975
|
+
className: "flex items-center gap-1",
|
|
976
|
+
children: [type === "Organization" ? /*#__PURE__*/jsx(Building, {
|
|
977
|
+
className: "neeto-ui-text-gray-600",
|
|
978
|
+
size: 24
|
|
979
|
+
}) : /*#__PURE__*/jsx(Avatar, {
|
|
980
|
+
size: "small",
|
|
981
|
+
user: {
|
|
982
|
+
imageUrl: avatarUrl
|
|
983
|
+
}
|
|
984
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
985
|
+
className: "neeto-ui-text-gray-800",
|
|
986
|
+
style: "body2",
|
|
987
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
988
|
+
className: "neeto-ui-text-gray-800",
|
|
989
|
+
label: "@".concat(name),
|
|
990
|
+
style: "link",
|
|
991
|
+
onClick: function onClick() {
|
|
992
|
+
return window.open(profileUrl, "_blank");
|
|
993
|
+
}
|
|
994
|
+
})
|
|
995
|
+
})]
|
|
996
|
+
}), /*#__PURE__*/jsx("span", {
|
|
997
|
+
className: "neeto-ui-bg-gray-800 neeto-ui-rounded-full h-1 w-1"
|
|
998
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
999
|
+
className: "neeto-ui-text-black",
|
|
1000
|
+
style: "body2",
|
|
1001
|
+
children: t("neetoGithub.countOf.repos", {
|
|
1002
|
+
count: count
|
|
1003
|
+
})
|
|
1004
|
+
})]
|
|
1005
|
+
}, id);
|
|
1006
|
+
}), /*#__PURE__*/jsx(Configure, {
|
|
1007
|
+
installationUrl: installationUrl,
|
|
1008
|
+
isConnected: isConnected
|
|
1009
|
+
})]
|
|
173
1010
|
});
|
|
174
1011
|
});
|
|
175
1012
|
|
|
@@ -179,21 +1016,22 @@ var Accounts = function Accounts(_ref) {
|
|
|
179
1016
|
isConnected = _ref.isConnected,
|
|
180
1017
|
onConnect = _ref.onConnect,
|
|
181
1018
|
installationUrl = _ref.installationUrl;
|
|
182
|
-
return /*#__PURE__*/
|
|
183
|
-
className:
|
|
184
|
-
"
|
|
185
|
-
"
|
|
1019
|
+
return /*#__PURE__*/jsx("div", {
|
|
1020
|
+
className: classnames("flex w-full flex-col border border-solid border-transparent px-0 py-2", {
|
|
1021
|
+
"order-1": isPane,
|
|
1022
|
+
"md:order-2 md:max-w-72 lg:max-w-sm lg:px-6": !isPane
|
|
1023
|
+
}),
|
|
1024
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
1025
|
+
className: "mb-2",
|
|
1026
|
+
children: [/*#__PURE__*/jsx(Header, {}), /*#__PURE__*/jsx(List$1, {
|
|
1027
|
+
accounts: accounts,
|
|
1028
|
+
installationUrl: installationUrl,
|
|
1029
|
+
isConnected: isConnected,
|
|
1030
|
+
isPane: isPane,
|
|
1031
|
+
onConnect: onConnect
|
|
1032
|
+
})]
|
|
186
1033
|
})
|
|
187
|
-
}
|
|
188
|
-
className: "mb-2"
|
|
189
|
-
}, /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement(List$1, {
|
|
190
|
-
accounts: accounts,
|
|
191
|
-
isConnected: isConnected
|
|
192
|
-
}), /*#__PURE__*/React.createElement(Configure, {
|
|
193
|
-
installationUrl: installationUrl,
|
|
194
|
-
isConnected: isConnected,
|
|
195
|
-
onConnect: onConnect
|
|
196
|
-
})));
|
|
1034
|
+
});
|
|
197
1035
|
};
|
|
198
1036
|
|
|
199
1037
|
function _arrayWithHoles(arr) {
|
|
@@ -255,32 +1093,36 @@ var NoRepositories = withT(function (_ref) {
|
|
|
255
1093
|
var t = _ref.t,
|
|
256
1094
|
installationUrl = _ref.installationUrl,
|
|
257
1095
|
troubleshootUrl = _ref.troubleshootUrl;
|
|
258
|
-
return /*#__PURE__*/
|
|
259
|
-
className: "flex items-center justify-center py-6"
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
1096
|
+
return /*#__PURE__*/jsx("div", {
|
|
1097
|
+
className: "flex items-center justify-center py-6",
|
|
1098
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
1099
|
+
className: "mx-auto flex w-full max-w-sm flex-col items-center justify-center space-y-4 py-4 text-center",
|
|
1100
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1101
|
+
style: "body2",
|
|
1102
|
+
children: t("neetoGithub.noReposDescription")
|
|
1103
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
1104
|
+
href: installationUrl,
|
|
1105
|
+
icon: Github,
|
|
1106
|
+
iconPosition: "left",
|
|
1107
|
+
label: t("neetoGithub.connectRepository"),
|
|
1108
|
+
size: "medium",
|
|
1109
|
+
style: "primary"
|
|
1110
|
+
}), /*#__PURE__*/jsx("div", {
|
|
1111
|
+
className: "text-xs",
|
|
1112
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
1113
|
+
i18nKey: t("neetoGithub.troubleshoot"),
|
|
1114
|
+
components: {
|
|
1115
|
+
troubleshootLink: /*#__PURE__*/jsx("a", {
|
|
1116
|
+
className: "text-indigo-600 underline",
|
|
1117
|
+
href: troubleshootUrl,
|
|
1118
|
+
rel: "noopener noreferrer",
|
|
1119
|
+
target: "_blank"
|
|
1120
|
+
})
|
|
1121
|
+
}
|
|
1122
|
+
})
|
|
1123
|
+
})]
|
|
1124
|
+
})
|
|
1125
|
+
});
|
|
284
1126
|
});
|
|
285
1127
|
|
|
286
1128
|
var RepositoryTile = function RepositoryTile(_ref) {
|
|
@@ -297,38 +1139,43 @@ var RepositoryTile = function RepositoryTile(_ref) {
|
|
|
297
1139
|
fullName = repository.fullName,
|
|
298
1140
|
isPrivate = repository.isPrivate,
|
|
299
1141
|
updatedAt = repository.updatedAt;
|
|
300
|
-
return /*#__PURE__*/
|
|
301
|
-
className: "neeto-ui-border-gray-300 flex
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
1142
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1143
|
+
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",
|
|
1144
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
1145
|
+
className: "width-calc flex items-center space-x-2",
|
|
1146
|
+
children: [/*#__PURE__*/jsx(Github, {
|
|
1147
|
+
className: "flex-shrink-0",
|
|
1148
|
+
size: 16
|
|
1149
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
1150
|
+
style: "body2",
|
|
1151
|
+
children: fullName
|
|
1152
|
+
}), isPrivate && /*#__PURE__*/jsx(Lock, {
|
|
1153
|
+
className: "flex-shrink-0",
|
|
1154
|
+
size: 16
|
|
1155
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
1156
|
+
className: "hidden lg:inline-block",
|
|
1157
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
1158
|
+
className: "neeto-ui-bg-gray-800 neeto-ui-rounded-full h-1 w-1"
|
|
1159
|
+
}), /*#__PURE__*/jsx(DateFormat.FromNow, {
|
|
1160
|
+
date: updatedAt
|
|
1161
|
+
})]
|
|
1162
|
+
})]
|
|
1163
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
1164
|
+
className: "w-max",
|
|
1165
|
+
disabled: isConnecting,
|
|
1166
|
+
loading: isLoading,
|
|
1167
|
+
style: "primary",
|
|
1168
|
+
type: "button",
|
|
1169
|
+
onClick: function onClick() {
|
|
1170
|
+
return onConnect({
|
|
1171
|
+
repoType: "private",
|
|
1172
|
+
repository: repository,
|
|
1173
|
+
setIsLoading: setIsLoading
|
|
1174
|
+
});
|
|
1175
|
+
},
|
|
1176
|
+
children: t("neetoGithub.connect")
|
|
1177
|
+
})]
|
|
1178
|
+
}, id);
|
|
332
1179
|
};
|
|
333
1180
|
|
|
334
1181
|
var List = withT(function (_ref) {
|
|
@@ -339,48 +1186,54 @@ var List = withT(function (_ref) {
|
|
|
339
1186
|
onConnect = _ref.onConnect,
|
|
340
1187
|
installationUrl = _ref.installationUrl,
|
|
341
1188
|
troubleshootUrl = _ref.troubleshootUrl;
|
|
342
|
-
return /*#__PURE__*/
|
|
343
|
-
className: "h-full overflow-y-scroll px-6 pb-6"
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
1189
|
+
return /*#__PURE__*/jsx("div", {
|
|
1190
|
+
className: "h-full overflow-y-scroll px-4 pb-4 md:px-6 md:pb-6",
|
|
1191
|
+
children: isPresent(repositories) ? /*#__PURE__*/jsx("div", {
|
|
1192
|
+
className: classnames("neeto-ui-border-gray-300 neeto-ui-rounded-md flex flex-col items-center justify-center border", {
|
|
1193
|
+
"h-auto": isPresent(filteredRepositories),
|
|
1194
|
+
"h-full": !isPresent(filteredRepositories)
|
|
1195
|
+
}),
|
|
1196
|
+
children: /*#__PURE__*/jsx("div", {
|
|
1197
|
+
className: "m-0 h-full w-full p-0",
|
|
1198
|
+
children: isPresent(filteredRepositories) ? filteredRepositories.map(function (repository, index) {
|
|
1199
|
+
return /*#__PURE__*/createElement(RepositoryTile, {
|
|
1200
|
+
isConnecting: isConnecting,
|
|
1201
|
+
onConnect: onConnect,
|
|
1202
|
+
repository: repository,
|
|
1203
|
+
key: index
|
|
1204
|
+
});
|
|
1205
|
+
}) : /*#__PURE__*/jsx(Typography, {
|
|
1206
|
+
className: "flex h-full w-full items-center justify-center",
|
|
1207
|
+
style: "body2",
|
|
1208
|
+
children: t("neetoGithub.noRepos")
|
|
1209
|
+
})
|
|
1210
|
+
})
|
|
1211
|
+
}) : /*#__PURE__*/jsx(NoRepositories, {
|
|
1212
|
+
installationUrl: installationUrl,
|
|
1213
|
+
troubleshootUrl: troubleshootUrl
|
|
348
1214
|
})
|
|
349
|
-
}
|
|
350
|
-
className: "m-0 h-full w-full p-0"
|
|
351
|
-
}, isPresent(filteredRepositories) ? filteredRepositories.map(function (repository, index) {
|
|
352
|
-
return /*#__PURE__*/React.createElement(RepositoryTile, {
|
|
353
|
-
isConnecting: isConnecting,
|
|
354
|
-
onConnect: onConnect,
|
|
355
|
-
repository: repository,
|
|
356
|
-
key: index
|
|
357
|
-
});
|
|
358
|
-
}) : /*#__PURE__*/React.createElement(Typography, {
|
|
359
|
-
className: "flex h-full w-full items-center justify-center",
|
|
360
|
-
style: "body2"
|
|
361
|
-
}, t("neetoGithub.noRepos")))) : /*#__PURE__*/React.createElement(NoRepositories, {
|
|
362
|
-
installationUrl: installationUrl,
|
|
363
|
-
troubleshootUrl: troubleshootUrl
|
|
364
|
-
}));
|
|
1215
|
+
});
|
|
365
1216
|
});
|
|
366
1217
|
|
|
367
1218
|
var NotConnected = withT(function (_ref) {
|
|
368
1219
|
var t = _ref.t,
|
|
369
1220
|
installationUrl = _ref.installationUrl;
|
|
370
|
-
return /*#__PURE__*/
|
|
371
|
-
className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center"
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
1221
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1222
|
+
className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center",
|
|
1223
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1224
|
+
style: "body2",
|
|
1225
|
+
children: t("neetoGithub.notConnectedDescription", {
|
|
1226
|
+
appName: globalProps.appName
|
|
1227
|
+
})
|
|
1228
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
1229
|
+
href: installationUrl,
|
|
1230
|
+
icon: Github,
|
|
1231
|
+
iconPosition: "left",
|
|
1232
|
+
label: t("neetoGithub.connectGithub"),
|
|
1233
|
+
size: "medium",
|
|
1234
|
+
style: "primary"
|
|
1235
|
+
})]
|
|
1236
|
+
});
|
|
384
1237
|
});
|
|
385
1238
|
|
|
386
1239
|
var Private = function Private(_ref) {
|
|
@@ -407,38 +1260,47 @@ var Private = function Private(_ref) {
|
|
|
407
1260
|
});
|
|
408
1261
|
setFilteredRepositories(filteredRepositories);
|
|
409
1262
|
};
|
|
410
|
-
return /*#__PURE__*/
|
|
411
|
-
className: "connect-repo flex h-full flex-col"
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
1263
|
+
return /*#__PURE__*/jsx("div", {
|
|
1264
|
+
className: "connect-repo flex h-full flex-col",
|
|
1265
|
+
children: isConnected ? /*#__PURE__*/jsxs(Fragment, {
|
|
1266
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
1267
|
+
className: "space-y-3 p-4 md:p-6",
|
|
1268
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1269
|
+
className: "flex-shrink-0 text-lg font-medium",
|
|
1270
|
+
style: "h2",
|
|
1271
|
+
children: t("neetoGithub.connectARepo")
|
|
1272
|
+
}), isPresent(repositories) && /*#__PURE__*/jsx(Search, {
|
|
1273
|
+
onSearch: onSearch,
|
|
1274
|
+
className: "w-full",
|
|
1275
|
+
unlimitedChars: false,
|
|
1276
|
+
suffix: /*#__PURE__*/jsx(Typography, {
|
|
1277
|
+
style: "body2",
|
|
1278
|
+
children: t("neetoGithub.countOf.repos", {
|
|
1279
|
+
count: filteredRepositories.length
|
|
1280
|
+
})
|
|
1281
|
+
})
|
|
1282
|
+
})]
|
|
1283
|
+
}), /*#__PURE__*/jsx("div", {
|
|
1284
|
+
className: "flex min-h-0 w-full flex-grow flex-col space-y-6",
|
|
1285
|
+
children: /*#__PURE__*/jsx(List, {
|
|
1286
|
+
filteredRepositories: filteredRepositories,
|
|
1287
|
+
installationUrl: installationUrl,
|
|
1288
|
+
isConnecting: isConnecting,
|
|
1289
|
+
onConnect: onConnect,
|
|
1290
|
+
repositories: repositories,
|
|
1291
|
+
troubleshootUrl: troubleshootUrl
|
|
1292
|
+
})
|
|
1293
|
+
})]
|
|
1294
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
1295
|
+
className: "neeto-ui-text-gray-900 flex-grow font-sans text-sm font-normal leading-6 antialiased",
|
|
1296
|
+
children: /*#__PURE__*/jsx("div", {
|
|
1297
|
+
className: "flex h-full flex-col items-center justify-center p-4",
|
|
1298
|
+
children: /*#__PURE__*/jsx(NotConnected, {
|
|
1299
|
+
installationUrl: installationUrl
|
|
1300
|
+
})
|
|
1301
|
+
})
|
|
1302
|
+
})
|
|
1303
|
+
});
|
|
442
1304
|
};
|
|
443
1305
|
|
|
444
1306
|
var Repositories = function Repositories(_ref) {
|
|
@@ -447,17 +1309,22 @@ var Repositories = function Repositories(_ref) {
|
|
|
447
1309
|
repositories = _ref.repositories,
|
|
448
1310
|
onConnect = _ref.onConnect,
|
|
449
1311
|
installationUrl = _ref.installationUrl,
|
|
450
|
-
troubleshootUrl = _ref.troubleshootUrl
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
1312
|
+
troubleshootUrl = _ref.troubleshootUrl,
|
|
1313
|
+
isPane = _ref.isPane;
|
|
1314
|
+
return /*#__PURE__*/jsx("div", {
|
|
1315
|
+
className: classnames("neeto-ui-rounded-md neeto-ui-border-gray-300 h-full w-full space-y-6 border border-solid", {
|
|
1316
|
+
"order-2": isPane,
|
|
1317
|
+
"order-1": !isPane
|
|
1318
|
+
}),
|
|
1319
|
+
children: /*#__PURE__*/jsx(Private, {
|
|
1320
|
+
installationUrl: installationUrl,
|
|
1321
|
+
isConnected: isConnected,
|
|
1322
|
+
isConnecting: isConnecting,
|
|
1323
|
+
onConnect: onConnect,
|
|
1324
|
+
repositories: repositories,
|
|
1325
|
+
troubleshootUrl: troubleshootUrl
|
|
1326
|
+
})
|
|
1327
|
+
});
|
|
461
1328
|
};
|
|
462
1329
|
|
|
463
1330
|
var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
|
|
@@ -493,31 +1360,34 @@ var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
|
|
|
493
1360
|
var accounts = shouldFetchRepositories ? containerAccounts : paneAccounts;
|
|
494
1361
|
var isLoading = shouldFetchRepositories ? isContainerLoading : isPaneLoading;
|
|
495
1362
|
if (isLoading) {
|
|
496
|
-
return /*#__PURE__*/
|
|
497
|
-
className: "flex h-full w-full flex-col items-center"
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
"
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
1363
|
+
return /*#__PURE__*/jsx("div", {
|
|
1364
|
+
className: "flex h-full w-full flex-col items-center",
|
|
1365
|
+
children: /*#__PURE__*/jsx(PageLoader, {
|
|
1366
|
+
text: t("neetoGithub.fetchingRepos")
|
|
1367
|
+
})
|
|
1368
|
+
});
|
|
1369
|
+
}
|
|
1370
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1371
|
+
className: classnames("flex min-h-0 w-full flex-grow flex-col", {
|
|
1372
|
+
"flex-col": isPane,
|
|
1373
|
+
"gap-3 md:flex-row md:gap-6": !isPane
|
|
1374
|
+
}),
|
|
1375
|
+
children: [/*#__PURE__*/jsx(Accounts, {
|
|
1376
|
+
accounts: accounts,
|
|
1377
|
+
installationUrl: installationUrl,
|
|
1378
|
+
isConnected: isConnected,
|
|
1379
|
+
isPane: isPane,
|
|
1380
|
+
onConnect: onConnect
|
|
1381
|
+
}), /*#__PURE__*/jsx(Repositories, {
|
|
1382
|
+
installationUrl: installationUrl,
|
|
1383
|
+
isConnected: isConnected,
|
|
1384
|
+
isConnecting: isConnecting,
|
|
1385
|
+
isPane: isPane,
|
|
1386
|
+
onConnect: onConnect,
|
|
1387
|
+
repositories: repositories,
|
|
1388
|
+
troubleshootUrl: troubleshootUrl
|
|
1389
|
+
})]
|
|
1390
|
+
});
|
|
521
1391
|
};
|
|
522
1392
|
|
|
523
1393
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -2785,7 +3655,7 @@ var NeetoGithubNanoPane = function NeetoGithubNanoPane(_ref) {
|
|
|
2785
3655
|
_ref$troubleshootUrl = _ref.troubleshootUrl,
|
|
2786
3656
|
troubleshootUrl = _ref$troubleshootUrl === void 0 ? TROUBLESHOOT_URL : _ref$troubleshootUrl,
|
|
2787
3657
|
_ref$onConnect = _ref.onConnect,
|
|
2788
|
-
onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
|
|
3658
|
+
onConnect = _ref$onConnect === void 0 ? noop$1 : _ref$onConnect,
|
|
2789
3659
|
_ref$projects = _ref.projects,
|
|
2790
3660
|
projects = _ref$projects === void 0 ? [] : _ref$projects,
|
|
2791
3661
|
_ref$title = _ref.title,
|
|
@@ -2809,31 +3679,37 @@ var NeetoGithubNanoPane = function NeetoGithubNanoPane(_ref) {
|
|
|
2809
3679
|
}, projects);
|
|
2810
3680
|
});
|
|
2811
3681
|
var paneAccounts = isConnected ? accounts : [];
|
|
2812
|
-
return /*#__PURE__*/
|
|
3682
|
+
return /*#__PURE__*/jsxs(Pane, {
|
|
2813
3683
|
initialFocusRef: initialFocusRef,
|
|
2814
3684
|
isOpen: isOpen,
|
|
2815
3685
|
onClose: onClose,
|
|
2816
3686
|
className: "neeto-github-modal-pane-wrapper",
|
|
2817
|
-
size: "large"
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
3687
|
+
size: "large",
|
|
3688
|
+
children: [/*#__PURE__*/jsx(Pane.Header, {
|
|
3689
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
3690
|
+
style: "h2",
|
|
3691
|
+
children: isPresent(title) ? title : t("neetoGithub.modal.title")
|
|
3692
|
+
})
|
|
3693
|
+
}), /*#__PURE__*/jsx(Pane.Body, {
|
|
3694
|
+
children: /*#__PURE__*/jsx(NeetoGithubNanoContainer, {
|
|
3695
|
+
installationUrl: installationUrl,
|
|
3696
|
+
isConnected: isConnected,
|
|
3697
|
+
isConnecting: isConnecting,
|
|
3698
|
+
isPaneLoading: isPaneLoading,
|
|
3699
|
+
onConnect: onConnect,
|
|
3700
|
+
paneAccounts: paneAccounts,
|
|
3701
|
+
paneRepositories: paneRepositories,
|
|
3702
|
+
troubleshootUrl: troubleshootUrl,
|
|
3703
|
+
isPane: true,
|
|
3704
|
+
shouldFetchRepositories: false
|
|
3705
|
+
})
|
|
3706
|
+
})]
|
|
3707
|
+
});
|
|
2832
3708
|
};
|
|
2833
3709
|
|
|
2834
3710
|
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}}
|
|
2835
3711
|
|
|
2836
|
-
var css = ".width-calc{width:calc(100% - 82px)}.neeto-github-modal-pane-wrapper{width:min(
|
|
3712
|
+
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= */";
|
|
2837
3713
|
n(css,{});
|
|
2838
3714
|
|
|
2839
3715
|
export { NeetoGithubNanoContainer, NeetoGithubNanoPane };
|