@graphcore/react-kernel 0.2.0 → 0.2.1
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/components/Auth/AuthPage.d.ts +5 -4
- package/dist/components/Invite/InviteRoute.d.ts +7 -6
- package/dist/components/Invite/index.d.ts +1 -1
- package/dist/components/Routes/GraphCoreApp.d.ts +3 -4
- package/dist/graphcore-react-kernel.cjs.js +1 -1
- package/dist/graphcore-react-kernel.es.js +503 -517
- package/dist/hooks/useOffersRegistration.d.ts +2 -0
- package/dist/lib/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -27,16 +27,16 @@ function P() {
|
|
|
27
27
|
if (!T) throw Error("GraphCoreProvider is missing required apiUrl config.");
|
|
28
28
|
return T;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function ne() {
|
|
31
31
|
if (!E) throw Error("GraphCoreProvider is missing required wsUrl config.");
|
|
32
32
|
return E;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function F() {
|
|
35
35
|
return D !== null;
|
|
36
36
|
}
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/state/graphCoreBridge/bridge-context.tsx
|
|
39
|
-
var
|
|
39
|
+
var re = n(null), ie = re.Provider, ae = () => i(re), oe = (e) => {
|
|
40
40
|
let t, n = /* @__PURE__ */ new Set(), r = (e, r) => {
|
|
41
41
|
let i = typeof e == "function" ? e(t) : e;
|
|
42
42
|
if (!Object.is(i, t)) {
|
|
@@ -50,80 +50,80 @@ var ne = n(null), re = ne.Provider, ie = () => i(ne), ae = (e) => {
|
|
|
50
50
|
subscribe: (e) => (n.add(e), () => n.delete(e))
|
|
51
51
|
}, o = t = e(r, i, a);
|
|
52
52
|
return a;
|
|
53
|
-
},
|
|
53
|
+
}, I = ((e) => e ? oe(e) : oe);
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region src/state/entityGraph/store.ts
|
|
56
|
-
function
|
|
56
|
+
function se(e, t, n) {
|
|
57
57
|
let r = s(void 0);
|
|
58
58
|
return l(e.subscribe, () => {
|
|
59
59
|
let i = t(e.getState());
|
|
60
60
|
return n && r.current !== void 0 && n(r.current, i) ? r.current : (r.current = i, i);
|
|
61
61
|
}, () => t(e.getInitialState()));
|
|
62
62
|
}
|
|
63
|
-
var
|
|
63
|
+
var ce = (e) => e ? Array.isArray(e) ? e.reduce((e, t) => (t?.entity_id && (e[t.entity_id] = t), e), {}) : Object.entries(e).reduce((e, [t, n]) => ((n?.entity_id || t) && (e[n.entity_id || t] = n), e), {}) : {}, le = (e, t) => !e?.deleted && !e?.forbidden && !t?.forbidden && typeof e?.version == "number" && typeof t?.version == "number" && e.version < t.version, ue = (e, t = {}) => {
|
|
64
64
|
let n = e?.entity_type_id, r = Array.isArray(t.types) ? t.types.filter(Boolean) : [], i = Array.isArray(t.excludeTypes) ? t.excludeTypes.filter(Boolean) : [];
|
|
65
65
|
return !(r.length > 0 && !r.includes(n) || i.length > 0 && i.includes(n));
|
|
66
|
-
},
|
|
66
|
+
}, de = (e, t) => {
|
|
67
67
|
if (!t) return [];
|
|
68
68
|
let n = e.entitiesById[t];
|
|
69
69
|
return Array.isArray(n?.children_ids) ? n.children_ids.filter(Boolean) : [];
|
|
70
|
-
},
|
|
70
|
+
}, fe = (e, t, n = {}) => {
|
|
71
71
|
if (!t || n.enabled === !1) return null;
|
|
72
72
|
let r = (i, a = /* @__PURE__ */ new Set()) => {
|
|
73
73
|
if (a.has(i)) return null;
|
|
74
74
|
a.add(i);
|
|
75
75
|
let o = e.entitiesById[i];
|
|
76
76
|
if (!o) return null;
|
|
77
|
-
let s =
|
|
77
|
+
let s = de(e, i).reduce((e, t) => {
|
|
78
78
|
let n = r(t, new Set(a));
|
|
79
79
|
return n && (e[t] = n), e;
|
|
80
80
|
}, {});
|
|
81
|
-
return
|
|
81
|
+
return ue(o, n) || Object.keys(s).length > 0 || n.includeRoot && i === t ? {
|
|
82
82
|
entity: o,
|
|
83
83
|
children: s
|
|
84
84
|
} : null;
|
|
85
85
|
};
|
|
86
86
|
return r(t);
|
|
87
|
-
},
|
|
87
|
+
}, L = I(() => ({
|
|
88
88
|
entitiesById: {},
|
|
89
89
|
entityIds: [],
|
|
90
90
|
requestedEntityIds: /* @__PURE__ */ new Set(),
|
|
91
91
|
notFoundEntityIds: /* @__PURE__ */ new Set()
|
|
92
|
-
})),
|
|
92
|
+
})), R = (e, t) => se(L, e, t), z = {
|
|
93
93
|
getEntityIds() {
|
|
94
|
-
return
|
|
94
|
+
return L.getState().entityIds;
|
|
95
95
|
},
|
|
96
96
|
readEntity(e) {
|
|
97
|
-
return e ?
|
|
97
|
+
return e ? L.getState().entitiesById[e] ?? null : null;
|
|
98
98
|
},
|
|
99
99
|
readEntities(e) {
|
|
100
|
-
let t =
|
|
100
|
+
let t = L.getState().entitiesById;
|
|
101
101
|
return (e || []).map((e) => e ? t[e] ?? null : null);
|
|
102
102
|
},
|
|
103
103
|
readChildren(e, t = {}) {
|
|
104
104
|
if (!e || t.enabled === !1) return [];
|
|
105
|
-
let n =
|
|
106
|
-
return
|
|
105
|
+
let n = L.getState();
|
|
106
|
+
return de(n, e).map((e) => n.entitiesById[e] ?? null).filter((e) => !!e && !e.forbidden).filter((e) => ue(e, t));
|
|
107
107
|
},
|
|
108
108
|
readRecursiveChildren(e, t = {}) {
|
|
109
|
-
return
|
|
109
|
+
return fe(L.getState(), e, t);
|
|
110
110
|
},
|
|
111
111
|
mergeEntities(e) {
|
|
112
|
-
let t =
|
|
113
|
-
return
|
|
112
|
+
let t = ce(e), n = new Set(L.getState().entityIds);
|
|
113
|
+
return L.setState((e) => {
|
|
114
114
|
let r = { ...e.entitiesById }, i = new Set(e.requestedEntityIds), a = new Set(e.notFoundEntityIds);
|
|
115
115
|
return Object.entries(t).forEach(([e, t]) => {
|
|
116
|
-
i.delete(e), a.delete(e), !
|
|
116
|
+
i.delete(e), a.delete(e), !le(t, r[e]) && (t?.deleted === !0 ? (delete r[e], n.delete(e)) : (r[e] = t, n.add(e)));
|
|
117
117
|
}), {
|
|
118
118
|
entitiesById: r,
|
|
119
119
|
entityIds: [...n],
|
|
120
120
|
requestedEntityIds: i,
|
|
121
121
|
notFoundEntityIds: a
|
|
122
122
|
};
|
|
123
|
-
}),
|
|
123
|
+
}), L.getState().entityIds;
|
|
124
124
|
},
|
|
125
125
|
removeEntity(e) {
|
|
126
|
-
e &&
|
|
126
|
+
e && L.setState((t) => {
|
|
127
127
|
if (!t.entitiesById[e]) return t;
|
|
128
128
|
let n = { ...t.entitiesById };
|
|
129
129
|
delete n[e];
|
|
@@ -137,7 +137,7 @@ var se = (e) => e ? Array.isArray(e) ? e.reduce((e, t) => (t?.entity_id && (e[t.
|
|
|
137
137
|
});
|
|
138
138
|
},
|
|
139
139
|
clearEntities() {
|
|
140
|
-
|
|
140
|
+
L.setState({
|
|
141
141
|
entitiesById: {},
|
|
142
142
|
entityIds: [],
|
|
143
143
|
requestedEntityIds: /* @__PURE__ */ new Set(),
|
|
@@ -145,7 +145,7 @@ var se = (e) => e ? Array.isArray(e) ? e.reduce((e, t) => (t?.entity_id && (e[t.
|
|
|
145
145
|
});
|
|
146
146
|
},
|
|
147
147
|
markRequested(e) {
|
|
148
|
-
e &&
|
|
148
|
+
e && L.setState((t) => {
|
|
149
149
|
let n = new Set(t.requestedEntityIds), r = new Set(t.notFoundEntityIds);
|
|
150
150
|
return n.add(e), r.delete(e), {
|
|
151
151
|
requestedEntityIds: n,
|
|
@@ -154,20 +154,20 @@ var se = (e) => e ? Array.isArray(e) ? e.reduce((e, t) => (t?.entity_id && (e[t.
|
|
|
154
154
|
});
|
|
155
155
|
},
|
|
156
156
|
clearRequestedEntity(e) {
|
|
157
|
-
e &&
|
|
157
|
+
e && L.setState((t) => {
|
|
158
158
|
if (!t.requestedEntityIds.has(e)) return t;
|
|
159
159
|
let n = new Set(t.requestedEntityIds);
|
|
160
160
|
return n.delete(e), { requestedEntityIds: n };
|
|
161
161
|
});
|
|
162
162
|
},
|
|
163
163
|
clearRequestedEntities() {
|
|
164
|
-
|
|
164
|
+
L.setState({ requestedEntityIds: /* @__PURE__ */ new Set() });
|
|
165
165
|
},
|
|
166
166
|
isRequested(e) {
|
|
167
|
-
return
|
|
167
|
+
return L.getState().requestedEntityIds.has(e);
|
|
168
168
|
},
|
|
169
169
|
markNotFound(e) {
|
|
170
|
-
e &&
|
|
170
|
+
e && L.setState((t) => {
|
|
171
171
|
let n = new Set(t.requestedEntityIds), r = new Set(t.notFoundEntityIds);
|
|
172
172
|
return n.delete(e), r.add(e), {
|
|
173
173
|
requestedEntityIds: n,
|
|
@@ -176,68 +176,68 @@ var se = (e) => e ? Array.isArray(e) ? e.reduce((e, t) => (t?.entity_id && (e[t.
|
|
|
176
176
|
});
|
|
177
177
|
},
|
|
178
178
|
isNotFound(e) {
|
|
179
|
-
return
|
|
179
|
+
return L.getState().notFoundEntityIds.has(e);
|
|
180
180
|
},
|
|
181
181
|
clearEntityFlags(e) {
|
|
182
|
-
e ?
|
|
182
|
+
e ? L.setState((t) => {
|
|
183
183
|
let n = new Set(t.requestedEntityIds), r = new Set(t.notFoundEntityIds);
|
|
184
184
|
return n.delete(e), r.delete(e), {
|
|
185
185
|
requestedEntityIds: n,
|
|
186
186
|
notFoundEntityIds: r
|
|
187
187
|
};
|
|
188
|
-
}) :
|
|
188
|
+
}) : L.setState({
|
|
189
189
|
requestedEntityIds: /* @__PURE__ */ new Set(),
|
|
190
190
|
notFoundEntityIds: /* @__PURE__ */ new Set()
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
-
},
|
|
194
|
-
function
|
|
193
|
+
}, pe = (e) => e;
|
|
194
|
+
function B(t, n = pe) {
|
|
195
195
|
let r = e.useSyncExternalStore(t.subscribe, e.useCallback(() => n(t.getState()), [t, n]), e.useCallback(() => n(t.getInitialState()), [t, n]));
|
|
196
196
|
return e.useDebugValue(r), r;
|
|
197
197
|
}
|
|
198
198
|
//#endregion
|
|
199
199
|
//#region src/state/graphCoreBridge/statusStore.ts
|
|
200
|
-
var
|
|
201
|
-
|
|
202
|
-
},
|
|
200
|
+
var me = I(() => "idle"), he = (e) => {
|
|
201
|
+
me.setState(e);
|
|
202
|
+
}, V = () => B(me, (e) => e), ge = class extends Error {
|
|
203
203
|
constructor(e, t = {}) {
|
|
204
204
|
super(e), this.name = "StrategyError", this.code = t.code ?? void 0, this.details = t.details ?? {}, this.strategyRequestId = t.strategyRequestId ?? void 0;
|
|
205
205
|
}
|
|
206
|
-
},
|
|
207
|
-
function
|
|
208
|
-
return
|
|
209
|
-
|
|
206
|
+
}, _e = /* @__PURE__ */ new Set();
|
|
207
|
+
function ve(e) {
|
|
208
|
+
return _e.add(e), () => {
|
|
209
|
+
_e.delete(e);
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
|
|
212
|
+
function ye(e) {
|
|
213
|
+
_e.forEach((t) => t(e));
|
|
214
214
|
}
|
|
215
215
|
//#endregion
|
|
216
216
|
//#region src/state/resyncEvents.ts
|
|
217
|
-
var
|
|
218
|
-
function
|
|
219
|
-
return
|
|
220
|
-
|
|
217
|
+
var be = /* @__PURE__ */ new Set();
|
|
218
|
+
function xe(e) {
|
|
219
|
+
return be.add(e), () => {
|
|
220
|
+
be.delete(e);
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
|
|
223
|
+
function Se(e) {
|
|
224
|
+
be.forEach((t) => t(e));
|
|
225
225
|
}
|
|
226
226
|
//#endregion
|
|
227
227
|
//#region src/state/authStore.ts
|
|
228
|
-
var
|
|
228
|
+
var H = () => ({
|
|
229
229
|
isAuthenticated: !1,
|
|
230
230
|
token: null,
|
|
231
231
|
principalEntityId: null,
|
|
232
232
|
username: null,
|
|
233
233
|
isLoading: !1,
|
|
234
234
|
error: null
|
|
235
|
-
}), U =
|
|
236
|
-
...
|
|
235
|
+
}), U = I(() => ({
|
|
236
|
+
...H(),
|
|
237
237
|
isLoading: !0
|
|
238
238
|
})), W = (e) => {
|
|
239
239
|
U.setState(e);
|
|
240
|
-
}, Ce = () =>
|
|
240
|
+
}, Ce = () => B(U), we = class extends Error {};
|
|
241
241
|
we.prototype.name = "InvalidTokenError";
|
|
242
242
|
function Te(e) {
|
|
243
243
|
return decodeURIComponent(atob(e).replace(/(.)/g, (e, t) => {
|
|
@@ -2196,7 +2196,7 @@ var q = new class {
|
|
|
2196
2196
|
...n
|
|
2197
2197
|
}
|
|
2198
2198
|
}), r = await n(this._authHeaders());
|
|
2199
|
-
if (r.status !== 401 ||
|
|
2199
|
+
if (r.status !== 401 || F()) return r;
|
|
2200
2200
|
let i = await Qt();
|
|
2201
2201
|
if (!i) throw new Bt();
|
|
2202
2202
|
return n({ Authorization: `Bearer ${i}` });
|
|
@@ -2827,14 +2827,14 @@ function qn(e) {
|
|
|
2827
2827
|
}
|
|
2828
2828
|
//#endregion
|
|
2829
2829
|
//#region src/state/notificationStore.ts
|
|
2830
|
-
var Jn =
|
|
2830
|
+
var Jn = I(() => null), Yn = (e) => {
|
|
2831
2831
|
Jn.setState(e);
|
|
2832
2832
|
}, Xn = (e, t) => {
|
|
2833
2833
|
t instanceof Bt || Yn({
|
|
2834
2834
|
message: `${e}: ${t instanceof Error ? t.message : String(t)}`,
|
|
2835
2835
|
type: "error"
|
|
2836
2836
|
});
|
|
2837
|
-
}, Zn = () =>
|
|
2837
|
+
}, Zn = () => B(Jn, (e) => e), Qn = 100, $n = 100, er = I(() => ({
|
|
2838
2838
|
loaded: {},
|
|
2839
2839
|
views: {}
|
|
2840
2840
|
})), tr = /* @__PURE__ */ new Map(), nr = /* @__PURE__ */ new Set(), rr = !1, ir = (e, t, n) => JSON.stringify([
|
|
@@ -2898,7 +2898,7 @@ async function lr(e) {
|
|
|
2898
2898
|
});
|
|
2899
2899
|
t.push(...r?.entities ?? []), n = r?.next_cursor ?? void 0;
|
|
2900
2900
|
} while (n);
|
|
2901
|
-
|
|
2901
|
+
z.mergeEntities(t), cr(t), er.setState((t) => ({ loaded: {
|
|
2902
2902
|
...t.loaded,
|
|
2903
2903
|
...Object.fromEntries(e.map((e) => [e.key, !0]))
|
|
2904
2904
|
} }));
|
|
@@ -2955,7 +2955,7 @@ function mr(e) {
|
|
|
2955
2955
|
a(() => {
|
|
2956
2956
|
e && t && pr.request(e, t);
|
|
2957
2957
|
}, [n]);
|
|
2958
|
-
let r =
|
|
2958
|
+
let r = B(er, (n) => e && t ? fr(n, e, t) : null), i = R((e) => r ? e.entitiesById[r] ?? null : null);
|
|
2959
2959
|
if (r !== void 0) return r ? i : null;
|
|
2960
2960
|
}
|
|
2961
2961
|
//#endregion
|
|
@@ -2980,7 +2980,7 @@ var hr = 3e4, gr = 1e4, _r = 3e3, vr = 100, yr = /* @__PURE__ */ new Set(["succe
|
|
|
2980
2980
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
2981
2981
|
});
|
|
2982
2982
|
}, Cr = () => {
|
|
2983
|
-
let e =
|
|
2983
|
+
let e = ne();
|
|
2984
2984
|
if (/^wss?:\/\//.test(e)) {
|
|
2985
2985
|
let t = new URL(e);
|
|
2986
2986
|
return t.pathname = `${t.pathname.replace(/\/$/, "")}/ws/entities/`, t.toString();
|
|
@@ -2995,7 +2995,7 @@ var hr = 3e4, gr = 1e4, _r = 3e3, vr = 100, yr = /* @__PURE__ */ new Set(["succe
|
|
|
2995
2995
|
since: 0,
|
|
2996
2996
|
nextId: 0
|
|
2997
2997
|
} }, c = { current: null }, l = { current: null }, u = /* @__PURE__ */ new Map(), d = { current: {} }, f = { current: 0 }, p = { current: null }, m = "idle", h = (e) => {
|
|
2998
|
-
m = e,
|
|
2998
|
+
m = e, he(e);
|
|
2999
2999
|
}, g = () => {
|
|
3000
3000
|
r.current &&= (clearTimeout(r.current), null);
|
|
3001
3001
|
}, _ = () => {
|
|
@@ -3007,15 +3007,15 @@ var hr = 3e4, gr = 1e4, _r = 3e3, vr = 100, yr = /* @__PURE__ */ new Set(["succe
|
|
|
3007
3007
|
}, b = () => {
|
|
3008
3008
|
p.current = null;
|
|
3009
3009
|
let e = d.current;
|
|
3010
|
-
Object.keys(e).length !== 0 && (d.current = {}, f.current = 0,
|
|
3010
|
+
Object.keys(e).length !== 0 && (d.current = {}, f.current = 0, z.mergeEntities(e), pr.noteEntities(Object.values(e)));
|
|
3011
3011
|
}, x = (e) => {
|
|
3012
3012
|
let t = d.current;
|
|
3013
3013
|
Object.entries(xr(e)).forEach(([e, n]) => {
|
|
3014
|
-
|
|
3014
|
+
le(n, t[e]) || (t[e] = n);
|
|
3015
3015
|
}), f.current += 1, p.current === null && (p.current = window.requestAnimationFrame(b));
|
|
3016
3016
|
}, S = (e, t, n, r = {}) => {
|
|
3017
3017
|
let i = u.get(e);
|
|
3018
|
-
i && (clearTimeout(i.timeout), u.delete(e), t ? i.resolve(n) : i.reject(new
|
|
3018
|
+
i && (clearTimeout(i.timeout), u.delete(e), t ? i.resolve(n) : i.reject(new ge(r.error || "Strategy execution failed", {
|
|
3019
3019
|
code: r.error_code,
|
|
3020
3020
|
details: r.error_details,
|
|
3021
3021
|
strategyRequestId: r.requestId ?? i.requestId
|
|
@@ -3035,8 +3035,8 @@ var hr = 3e4, gr = 1e4, _r = 3e3, vr = 100, yr = /* @__PURE__ */ new Set(["succe
|
|
|
3035
3035
|
}, T = (e) => {
|
|
3036
3036
|
b();
|
|
3037
3037
|
let t = {};
|
|
3038
|
-
|
|
3039
|
-
t[e] =
|
|
3038
|
+
z.getEntityIds().forEach((e) => {
|
|
3039
|
+
t[e] = z.readEntity(e)?.etag ?? "";
|
|
3040
3040
|
}), u.forEach((e) => {
|
|
3041
3041
|
e.requestId && (t[e.requestId] = "");
|
|
3042
3042
|
});
|
|
@@ -3051,10 +3051,10 @@ var hr = 3e4, gr = 1e4, _r = 3e3, vr = 100, yr = /* @__PURE__ */ new Set(["succe
|
|
|
3051
3051
|
entities: Object.fromEntries(a.map((e) => [e, t[e]]))
|
|
3052
3052
|
}));
|
|
3053
3053
|
}
|
|
3054
|
-
n.outstanding.size === 0 &&
|
|
3054
|
+
n.outstanding.size === 0 && Se(n.since);
|
|
3055
3055
|
}, E = (e) => {
|
|
3056
3056
|
let t = s.current;
|
|
3057
|
-
!t.outstanding.delete(e) || t.outstanding.size > 0 || (b(),
|
|
3057
|
+
!t.outstanding.delete(e) || t.outstanding.size > 0 || (b(), Se(t.since));
|
|
3058
3058
|
}, D = (t = "Cleaning up connection") => {
|
|
3059
3059
|
_(), v(), y();
|
|
3060
3060
|
let n = e.current;
|
|
@@ -3069,7 +3069,7 @@ var hr = 3e4, gr = 1e4, _r = 3e3, vr = 100, yr = /* @__PURE__ */ new Set(["succe
|
|
|
3069
3069
|
e.current = null;
|
|
3070
3070
|
}, O = (t) => {
|
|
3071
3071
|
let n = e.current;
|
|
3072
|
-
t && n && n.readyState === WebSocket.OPEN && (
|
|
3072
|
+
t && n && n.readyState === WebSocket.OPEN && (z.isRequested(t) || z.isNotFound(t) || (z.markRequested(t), n.send(JSON.stringify({
|
|
3073
3073
|
command: "get_entity",
|
|
3074
3074
|
entity_id: t
|
|
3075
3075
|
}))));
|
|
@@ -3123,18 +3123,18 @@ var hr = 3e4, gr = 1e4, _r = 3e3, vr = 100, yr = /* @__PURE__ */ new Set(["succe
|
|
|
3123
3123
|
return;
|
|
3124
3124
|
}
|
|
3125
3125
|
if (t.type === "entity_not_found") {
|
|
3126
|
-
|
|
3126
|
+
z.markNotFound(t.entity_id);
|
|
3127
3127
|
return;
|
|
3128
3128
|
}
|
|
3129
3129
|
if (t.type === "access_revoked") {
|
|
3130
3130
|
x({ [t.resource_id]: {
|
|
3131
3131
|
entity_id: t.resource_id,
|
|
3132
3132
|
forbidden: !0
|
|
3133
|
-
} }),
|
|
3133
|
+
} }), ye(t.resource_id);
|
|
3134
3134
|
return;
|
|
3135
3135
|
}
|
|
3136
3136
|
if (t.type === "access_granted" || t.type === "access_changed") {
|
|
3137
|
-
|
|
3137
|
+
z.clearEntityFlags(t.resource_id), O(t.resource_id), ye(t.resource_id);
|
|
3138
3138
|
return;
|
|
3139
3139
|
}
|
|
3140
3140
|
if (t.type === "strategy_result") {
|
|
@@ -3156,7 +3156,7 @@ var hr = 3e4, gr = 1e4, _r = 3e3, vr = 100, yr = /* @__PURE__ */ new Set(["succe
|
|
|
3156
3156
|
}, s.onclose = (e) => ee(s, e.code);
|
|
3157
3157
|
}, ee = (i, a, o = !1) => {
|
|
3158
3158
|
if (e.current === i) {
|
|
3159
|
-
if (_(), v(), e.current = null,
|
|
3159
|
+
if (_(), v(), e.current = null, z.clearRequestedEntities(), b(), w(/* @__PURE__ */ Error("Connection lost before the request was queued"), !0), h(t.current.token ? "disconnected" : "idle"), o && t.current.token) k();
|
|
3160
3160
|
else if (a !== 1e3 && t.current.token) {
|
|
3161
3161
|
let e = Math.min(3e4, 2 ** n.current * 500);
|
|
3162
3162
|
r.current = setTimeout(() => {
|
|
@@ -3204,7 +3204,7 @@ var hr = 3e4, gr = 1e4, _r = 3e3, vr = 100, yr = /* @__PURE__ */ new Set(["succe
|
|
|
3204
3204
|
t.current = {
|
|
3205
3205
|
token: null,
|
|
3206
3206
|
principalEntityId: null
|
|
3207
|
-
}, g(),
|
|
3207
|
+
}, g(), z.clearRequestedEntities(), y(), D(e), h("idle"), w(/* @__PURE__ */ Error("Connection closed"));
|
|
3208
3208
|
},
|
|
3209
3209
|
dispose() {
|
|
3210
3210
|
this.disconnect("Disposing bridge"), g(), _(), c.current?.(), c.current = null, br === u && (br = null);
|
|
@@ -3286,7 +3286,7 @@ function Ar(e, t) {
|
|
|
3286
3286
|
var jr = (e, t = {}) => {
|
|
3287
3287
|
let n = e?.entity_type_id, r = Array.isArray(t.types) ? t.types.filter(Boolean) : [], i = Array.isArray(t.excludeTypes) ? t.excludeTypes.filter(Boolean) : [];
|
|
3288
3288
|
return !(r.length > 0 && !r.includes(n) || i.length > 0 && i.includes(n));
|
|
3289
|
-
}, Mr = (e) =>
|
|
3289
|
+
}, Mr = (e) => z.readEntity(e), Nr = (e) => {
|
|
3290
3290
|
let t = Mr(e);
|
|
3291
3291
|
return Array.isArray(t?.children_ids) ? t.children_ids.filter(Boolean) : [];
|
|
3292
3292
|
}, Pr = (e, t = {}) => !e || t.enabled === !1 ? [] : Nr(e).map((e) => Mr(e)).filter((e) => !!e).filter((e) => jr(e, t)), Fr = (e, t = {}) => {
|
|
@@ -3311,7 +3311,7 @@ var jr = (e, t = {}) => {
|
|
|
3311
3311
|
return Mr(e);
|
|
3312
3312
|
},
|
|
3313
3313
|
readEntities(e) {
|
|
3314
|
-
return
|
|
3314
|
+
return z.readEntities(e);
|
|
3315
3315
|
},
|
|
3316
3316
|
readChildren(e, t = {}) {
|
|
3317
3317
|
return Pr(e, t);
|
|
@@ -3320,7 +3320,7 @@ var jr = (e, t = {}) => {
|
|
|
3320
3320
|
return Fr(e, t);
|
|
3321
3321
|
}
|
|
3322
3322
|
}, Lr = () => {
|
|
3323
|
-
let e =
|
|
3323
|
+
let e = ae();
|
|
3324
3324
|
if (!e) throw Error("useGraphCoreBridge must be used within GraphCoreProvider.");
|
|
3325
3325
|
return e;
|
|
3326
3326
|
}, Rr = () => {
|
|
@@ -3328,10 +3328,10 @@ var jr = (e, t = {}) => {
|
|
|
3328
3328
|
return o(() => e.executeStrategy.bind(e), [e]);
|
|
3329
3329
|
}, zr = (e, t) => {
|
|
3330
3330
|
t && e.forEach((e) => {
|
|
3331
|
-
!e ||
|
|
3331
|
+
!e || z.readEntity(e) || z.isNotFound(e) || t(e);
|
|
3332
3332
|
});
|
|
3333
3333
|
}, X = (e) => {
|
|
3334
|
-
let t = Lr(), n =
|
|
3334
|
+
let t = Lr(), n = V(), r = R(o(() => (t) => e ? t.entitiesById[e] ?? null : null, [e]));
|
|
3335
3335
|
return a(() => {
|
|
3336
3336
|
zr([e], t.fetchEntity);
|
|
3337
3337
|
}, [
|
|
@@ -3341,7 +3341,7 @@ var jr = (e, t = {}) => {
|
|
|
3341
3341
|
r
|
|
3342
3342
|
]), r;
|
|
3343
3343
|
}, Br = (e) => {
|
|
3344
|
-
let t = Lr(), n = o(() => e.filter(Boolean), [e]), r =
|
|
3344
|
+
let t = Lr(), n = o(() => e.filter(Boolean), [e]), r = V(), i = R((e) => n.map((t) => e.entitiesById[t] ?? null).filter((e) => !!e), Ar);
|
|
3345
3345
|
return a(() => {
|
|
3346
3346
|
zr(n, t.fetchEntity);
|
|
3347
3347
|
}, [
|
|
@@ -3351,7 +3351,7 @@ var jr = (e, t = {}) => {
|
|
|
3351
3351
|
n
|
|
3352
3352
|
]), i;
|
|
3353
3353
|
}, Vr = (e, t = {}) => {
|
|
3354
|
-
let n = Lr(), r = X(e), i = o(() => Array.isArray(r?.children_ids) ? r.children_ids.filter(Boolean) : [], [r?.children_ids]), s =
|
|
3354
|
+
let n = Lr(), r = X(e), i = o(() => Array.isArray(r?.children_ids) ? r.children_ids.filter(Boolean) : [], [r?.children_ids]), s = V(), c = R(() => Ir.readChildren(e, t), Ar);
|
|
3355
3355
|
return a(() => {
|
|
3356
3356
|
zr(i, n.fetchEntity);
|
|
3357
3357
|
}, [
|
|
@@ -3360,7 +3360,7 @@ var jr = (e, t = {}) => {
|
|
|
3360
3360
|
i
|
|
3361
3361
|
]), c;
|
|
3362
3362
|
}, Hr = (e, t = {}) => {
|
|
3363
|
-
let n = Lr(), r =
|
|
3363
|
+
let n = Lr(), r = V(), i = R((e) => e.entityIds), s = o(() => Ir.readRecursiveChildren(e, t), [
|
|
3364
3364
|
i,
|
|
3365
3365
|
t,
|
|
3366
3366
|
e
|
|
@@ -3388,8 +3388,8 @@ function Z(e) {
|
|
|
3388
3388
|
//#endregion
|
|
3389
3389
|
//#region src/hooks/useEntities.js
|
|
3390
3390
|
var qr = () => {
|
|
3391
|
-
let e =
|
|
3392
|
-
|
|
3391
|
+
let e = R((e) => e.entityIds, Ar), t = r((e) => {
|
|
3392
|
+
z.mergeEntities(e);
|
|
3393
3393
|
}, []);
|
|
3394
3394
|
async function n() {
|
|
3395
3395
|
try {
|
|
@@ -3404,7 +3404,7 @@ var qr = () => {
|
|
|
3404
3404
|
mergeEntities: t,
|
|
3405
3405
|
fetchEntityTypes: n,
|
|
3406
3406
|
clearEntities: r(() => {
|
|
3407
|
-
|
|
3407
|
+
z.clearEntities();
|
|
3408
3408
|
}, [])
|
|
3409
3409
|
};
|
|
3410
3410
|
}, Jr = () => {
|
|
@@ -3433,7 +3433,7 @@ var qr = () => {
|
|
|
3433
3433
|
}
|
|
3434
3434
|
let d = () => u(), f = () => u({ createAccount: !0 });
|
|
3435
3435
|
async function p() {
|
|
3436
|
-
n(), pr.clear(), W(
|
|
3436
|
+
n(), pr.clear(), W(H());
|
|
3437
3437
|
try {
|
|
3438
3438
|
await an();
|
|
3439
3439
|
} catch (e) {
|
|
@@ -3472,9 +3472,9 @@ var qr = () => {
|
|
|
3472
3472
|
validateToken: h,
|
|
3473
3473
|
setAuthError: l
|
|
3474
3474
|
};
|
|
3475
|
-
}, Yr =
|
|
3475
|
+
}, Yr = I(() => null), Xr = (e) => {
|
|
3476
3476
|
Yr.setState(e, !0);
|
|
3477
|
-
}, Zr = () =>
|
|
3477
|
+
}, Zr = () => B(Yr, (e) => e), Qr = {
|
|
3478
3478
|
error: "bg-red-50 border-red-200 text-red-700",
|
|
3479
3479
|
success: "bg-green-50 border-green-200 text-green-700",
|
|
3480
3480
|
info: "bg-blue-50 border-blue-200 text-blue-700"
|
|
@@ -3655,7 +3655,7 @@ var bi = "graphcore.agent_mirror", xi = 2e3, Si = n(!1), Ci = () => {
|
|
|
3655
3655
|
} catch {
|
|
3656
3656
|
return !1;
|
|
3657
3657
|
}
|
|
3658
|
-
}, wi =
|
|
3658
|
+
}, wi = I(() => ({ open: Ci() }));
|
|
3659
3659
|
function Ti(e) {
|
|
3660
3660
|
wi.setState({ open: e });
|
|
3661
3661
|
try {
|
|
@@ -3705,7 +3705,7 @@ function Ei(e) {
|
|
|
3705
3705
|
}
|
|
3706
3706
|
};
|
|
3707
3707
|
c();
|
|
3708
|
-
let l =
|
|
3708
|
+
let l = L.subscribe((e, t) => {
|
|
3709
3709
|
e.entitiesById !== t.entitiesById && (clearTimeout(o), o = setTimeout(c, 250));
|
|
3710
3710
|
});
|
|
3711
3711
|
return () => {
|
|
@@ -3796,7 +3796,7 @@ function ji({ address: e }) {
|
|
|
3796
3796
|
});
|
|
3797
3797
|
}
|
|
3798
3798
|
function Mi({ address: e, children: t }) {
|
|
3799
|
-
let n = i(Si), r =
|
|
3799
|
+
let n = i(Si), r = B(wi, (e) => e.open);
|
|
3800
3800
|
return n ? /* @__PURE__ */ f("div", {
|
|
3801
3801
|
className: "flex h-full min-h-0",
|
|
3802
3802
|
children: [/* @__PURE__ */ f("div", {
|
|
@@ -3834,7 +3834,7 @@ function Pi() {
|
|
|
3834
3834
|
} : t);
|
|
3835
3835
|
}, o = () => {
|
|
3836
3836
|
t(), pr.clear(), W({
|
|
3837
|
-
...
|
|
3837
|
+
...H(),
|
|
3838
3838
|
error: zt
|
|
3839
3839
|
});
|
|
3840
3840
|
}, s = en(o);
|
|
@@ -3882,7 +3882,7 @@ function Pi() {
|
|
|
3882
3882
|
function Fi({ bridge: e }) {
|
|
3883
3883
|
let { isAuthenticated: t, token: n, principalEntityId: r } = Jr();
|
|
3884
3884
|
return a(() => (e.setOnAuthError(async (e) => {
|
|
3885
|
-
(
|
|
3885
|
+
(F() || !await $t()) && Yn({
|
|
3886
3886
|
message: e,
|
|
3887
3887
|
type: "error"
|
|
3888
3888
|
});
|
|
@@ -3916,7 +3916,7 @@ function Li({ apiUrl: e, wsUrl: t, registry: n, getToken: r, principalEntityId:
|
|
|
3916
3916
|
p.dispose();
|
|
3917
3917
|
}, [p]), /* @__PURE__ */ d(ti, {
|
|
3918
3918
|
value: n,
|
|
3919
|
-
children: /* @__PURE__ */ f(
|
|
3919
|
+
children: /* @__PURE__ */ f(ie, {
|
|
3920
3920
|
value: p,
|
|
3921
3921
|
children: [
|
|
3922
3922
|
r ? /* @__PURE__ */ d(Ni, {
|
|
@@ -3935,9 +3935,61 @@ function Li({ apiUrl: e, wsUrl: t, registry: n, getToken: r, principalEntityId:
|
|
|
3935
3935
|
});
|
|
3936
3936
|
}
|
|
3937
3937
|
//#endregion
|
|
3938
|
+
//#region src/hooks/useOffersRegistration.ts
|
|
3939
|
+
function Ri() {
|
|
3940
|
+
let [e, t] = c(!1);
|
|
3941
|
+
return a(() => {
|
|
3942
|
+
let e = !0;
|
|
3943
|
+
return Jt().then((n) => {
|
|
3944
|
+
e && t(n);
|
|
3945
|
+
}), () => {
|
|
3946
|
+
e = !1;
|
|
3947
|
+
};
|
|
3948
|
+
}, []), e;
|
|
3949
|
+
}
|
|
3950
|
+
//#endregion
|
|
3951
|
+
//#region src/components/Invite/InviteRoute.tsx
|
|
3952
|
+
var zi = "/invite";
|
|
3953
|
+
function Bi(e) {
|
|
3954
|
+
return `${window.location.origin}${N(zi)}#${e}`;
|
|
3955
|
+
}
|
|
3956
|
+
var Vi = (e) => e.startsWith("#") ? decodeURIComponent(e.slice(1)) : "";
|
|
3957
|
+
function Hi() {
|
|
3958
|
+
let { pathname: e, hash: t } = x();
|
|
3959
|
+
return e === "/invite" && !!Vi(t);
|
|
3960
|
+
}
|
|
3961
|
+
function Ui({ onRedeemed: e }) {
|
|
3962
|
+
let { hash: t } = x(), n = S(), [r, i] = c(null), o = s(null), l = Vi(t);
|
|
3963
|
+
a(() => {
|
|
3964
|
+
l && o.current !== l && (o.current = l, q.redeemInvite(l).then((t) => {
|
|
3965
|
+
e ? e(t) : n(_i(t.resource_id), { replace: !0 });
|
|
3966
|
+
}).catch((e) => i(e.message || "This invite is invalid or has expired")));
|
|
3967
|
+
}, [
|
|
3968
|
+
l,
|
|
3969
|
+
e,
|
|
3970
|
+
n
|
|
3971
|
+
]);
|
|
3972
|
+
let u = /* @__PURE__ */ d("p", {
|
|
3973
|
+
className: "text-gray-600",
|
|
3974
|
+
role: "status",
|
|
3975
|
+
children: "Accepting invite…"
|
|
3976
|
+
});
|
|
3977
|
+
return l ? r && (u = /* @__PURE__ */ d("p", {
|
|
3978
|
+
role: "alert",
|
|
3979
|
+
className: "text-red-600",
|
|
3980
|
+
children: r
|
|
3981
|
+
})) : u = /* @__PURE__ */ d("p", {
|
|
3982
|
+
className: "text-gray-600",
|
|
3983
|
+
children: "This invite link is incomplete."
|
|
3984
|
+
}), /* @__PURE__ */ d("div", {
|
|
3985
|
+
className: "flex h-full items-center justify-center p-8 text-center",
|
|
3986
|
+
children: u
|
|
3987
|
+
});
|
|
3988
|
+
}
|
|
3989
|
+
//#endregion
|
|
3938
3990
|
//#region src/components/Auth/AuthPage.tsx
|
|
3939
|
-
var
|
|
3940
|
-
let { login: n, register: r, isLoading: i, error: a } = Jr();
|
|
3991
|
+
var Wi = ({ className: e, title: t = "graphcore" }) => {
|
|
3992
|
+
let { login: n, register: r, isLoading: i, error: a } = Jr(), o = Ri(), s = Hi();
|
|
3941
3993
|
return /* @__PURE__ */ d("div", {
|
|
3942
3994
|
className: e ?? "min-h-screen flex items-center justify-center bg-linear-to-br from-blue-50 to-indigo-100 px-4",
|
|
3943
3995
|
children: /* @__PURE__ */ f("div", {
|
|
@@ -3951,7 +4003,7 @@ var Ri = ({ className: e, title: t = "graphcore" }) => {
|
|
|
3951
4003
|
}), /* @__PURE__ */ d("p", {
|
|
3952
4004
|
className: "text-gray-600",
|
|
3953
4005
|
role: i ? "status" : void 0,
|
|
3954
|
-
children: i ? "Please wait..." : "Sign in to continue"
|
|
4006
|
+
children: i ? "Please wait..." : s ? "You've been invited. Sign in to accept." : "Sign in to continue"
|
|
3955
4007
|
})]
|
|
3956
4008
|
}),
|
|
3957
4009
|
a && /* @__PURE__ */ d("div", {
|
|
@@ -3965,7 +4017,7 @@ var Ri = ({ className: e, title: t = "graphcore" }) => {
|
|
|
3965
4017
|
onClick: () => n(),
|
|
3966
4018
|
className: "w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2.5 px-4 rounded-lg transition focus:ring-4 focus:ring-blue-300",
|
|
3967
4019
|
children: "Sign in"
|
|
3968
|
-
}), /* @__PURE__ */ d("button", {
|
|
4020
|
+
}), o && /* @__PURE__ */ d("button", {
|
|
3969
4021
|
type: "button",
|
|
3970
4022
|
onClick: () => r(),
|
|
3971
4023
|
className: "w-full border border-gray-300 text-gray-700 hover:bg-gray-50 font-medium py-2.5 px-4 rounded-lg transition",
|
|
@@ -3975,13 +4027,13 @@ var Ri = ({ className: e, title: t = "graphcore" }) => {
|
|
|
3975
4027
|
]
|
|
3976
4028
|
})
|
|
3977
4029
|
});
|
|
3978
|
-
},
|
|
3979
|
-
function
|
|
4030
|
+
}, Gi = null;
|
|
4031
|
+
function Ki() {
|
|
3980
4032
|
let [e, t] = c(null);
|
|
3981
4033
|
return a(() => {
|
|
3982
4034
|
let e = !1;
|
|
3983
|
-
return
|
|
3984
|
-
|
|
4035
|
+
return Gi ??= q.getRoutes().then((e) => e.routes), Gi.then((n) => !e && t(n)).catch(() => {
|
|
4036
|
+
Gi = null, e || t([]);
|
|
3985
4037
|
}), () => {
|
|
3986
4038
|
e = !0;
|
|
3987
4039
|
};
|
|
@@ -3989,8 +4041,8 @@ function Bi() {
|
|
|
3989
4041
|
}
|
|
3990
4042
|
//#endregion
|
|
3991
4043
|
//#region src/hooks/useWebSocketConsumer.js
|
|
3992
|
-
function
|
|
3993
|
-
let e = Lr(), t =
|
|
4044
|
+
function qi() {
|
|
4045
|
+
let e = Lr(), t = V();
|
|
3994
4046
|
return {
|
|
3995
4047
|
sendStrategyRequest: r((t, n = {}) => {
|
|
3996
4048
|
try {
|
|
@@ -4014,8 +4066,8 @@ function Vi() {
|
|
|
4014
4066
|
}
|
|
4015
4067
|
//#endregion
|
|
4016
4068
|
//#region src/state/useEntityQuery.ts
|
|
4017
|
-
var
|
|
4018
|
-
function
|
|
4069
|
+
var Ji = 50, Yi = 250, Xi = !1;
|
|
4070
|
+
function Zi({ typeIds: e, parentId: t, where: n, grantedToMe: i = !1, limit: o = Ji, enabled: l = !0 }) {
|
|
4019
4071
|
let [u, d] = c([]), [f, p] = c(null), [m, h] = c(!1), g = s(0), _ = s(0), v = s({
|
|
4020
4072
|
ids: /* @__PURE__ */ new Set(),
|
|
4021
4073
|
bound: null
|
|
@@ -4034,11 +4086,11 @@ function Gi({ typeIds: e, parentId: t, where: n, grantedToMe: i = !1, limit: o =
|
|
|
4034
4086
|
});
|
|
4035
4087
|
if (n !== g.current) return;
|
|
4036
4088
|
let a = r?.entities ?? [];
|
|
4037
|
-
|
|
4089
|
+
Xi = !0;
|
|
4038
4090
|
try {
|
|
4039
|
-
|
|
4091
|
+
z.mergeEntities(a);
|
|
4040
4092
|
} finally {
|
|
4041
|
-
|
|
4093
|
+
Xi = !1;
|
|
4042
4094
|
}
|
|
4043
4095
|
let s = a.map((e) => e.entity_id);
|
|
4044
4096
|
d((t) => e ? [...t, ...s] : s), p(r?.next_cursor ?? null);
|
|
@@ -4066,11 +4118,11 @@ function Gi({ typeIds: e, parentId: t, where: n, grantedToMe: i = !1, limit: o =
|
|
|
4066
4118
|
}, [u, f]), a(() => {
|
|
4067
4119
|
if (!l || !y) return;
|
|
4068
4120
|
let e = new Set(y.split(",")), n, r = () => {
|
|
4069
|
-
clearTimeout(n), n = setTimeout(S,
|
|
4070
|
-
}, i =
|
|
4121
|
+
clearTimeout(n), n = setTimeout(S, Yi);
|
|
4122
|
+
}, i = ve(r), a = xe((e) => {
|
|
4071
4123
|
_.current < e && r();
|
|
4072
|
-
}), o =
|
|
4073
|
-
if (
|
|
4124
|
+
}), o = L.subscribe((n, i) => {
|
|
4125
|
+
if (Xi || n.entitiesById === i.entitiesById) return;
|
|
4074
4126
|
let a = (t) => e.has(t?.entity_type_id), o = Object.keys(n.entitiesById).filter((e) => n.entitiesById[e].forbidden && a(i.entitiesById[e])), s = (e) => {
|
|
4075
4127
|
let r = n.entitiesById[e];
|
|
4076
4128
|
if (!a(r)) return !1;
|
|
@@ -4107,33 +4159,33 @@ function Gi({ typeIds: e, parentId: t, where: n, grantedToMe: i = !1, limit: o =
|
|
|
4107
4159
|
refresh: S
|
|
4108
4160
|
};
|
|
4109
4161
|
}
|
|
4110
|
-
|
|
4162
|
+
I(() => ({
|
|
4111
4163
|
contents: {},
|
|
4112
4164
|
state: "loading",
|
|
4113
4165
|
error: null
|
|
4114
4166
|
}));
|
|
4115
|
-
var
|
|
4167
|
+
var Qi = I(() => ({
|
|
4116
4168
|
contents: {},
|
|
4117
4169
|
state: "loading",
|
|
4118
4170
|
error: null
|
|
4119
|
-
})),
|
|
4171
|
+
})), $i = null, ea = async () => Qi.getState().state === "hasValue" ? Qi.getState().contents : $i || (Qi.setState((e) => ({
|
|
4120
4172
|
...e,
|
|
4121
4173
|
state: "loading",
|
|
4122
4174
|
error: null
|
|
4123
|
-
})),
|
|
4175
|
+
})), $i = q.getEntityDirectory().then((e) => {
|
|
4124
4176
|
let t = e?.entities || e || {};
|
|
4125
|
-
return
|
|
4177
|
+
return Qi.setState({
|
|
4126
4178
|
contents: t,
|
|
4127
4179
|
state: "hasValue",
|
|
4128
4180
|
error: null
|
|
4129
4181
|
}), t;
|
|
4130
|
-
}).catch((e) => (console.error("Failed to fetch available entities:", e),
|
|
4182
|
+
}).catch((e) => (console.error("Failed to fetch available entities:", e), Qi.setState({
|
|
4131
4183
|
contents: {},
|
|
4132
4184
|
state: "hasError",
|
|
4133
4185
|
error: e
|
|
4134
4186
|
}), {})).finally(() => {
|
|
4135
|
-
|
|
4136
|
-
}),
|
|
4187
|
+
$i = null;
|
|
4188
|
+
}), $i), ta = () => B(Qi), na = () => ta(), Q = class {
|
|
4137
4189
|
constructor() {
|
|
4138
4190
|
this.reset();
|
|
4139
4191
|
}
|
|
@@ -4234,25 +4286,25 @@ var Ki = L(() => ({
|
|
|
4234
4286
|
return new Q().withStrategyName("ReorderChild").withTargetEntity(e).withParams({ after_child_id: t }).build();
|
|
4235
4287
|
}
|
|
4236
4288
|
};
|
|
4237
|
-
function
|
|
4289
|
+
function ra(e) {
|
|
4238
4290
|
return e.startsWith("/") ? e.split(/[?#]/)[0].replace(/\/+$/, "") || "/" : null;
|
|
4239
4291
|
}
|
|
4240
|
-
function
|
|
4241
|
-
let n =
|
|
4292
|
+
function ia(e, t = "web") {
|
|
4293
|
+
let n = ra(e);
|
|
4242
4294
|
return n ? {
|
|
4243
4295
|
client: t,
|
|
4244
4296
|
address: n,
|
|
4245
4297
|
placement: []
|
|
4246
4298
|
} : null;
|
|
4247
4299
|
}
|
|
4248
|
-
function
|
|
4300
|
+
function aa(e, t = "web") {
|
|
4249
4301
|
return {
|
|
4250
4302
|
client: t,
|
|
4251
4303
|
view: e,
|
|
4252
4304
|
placement: []
|
|
4253
4305
|
};
|
|
4254
4306
|
}
|
|
4255
|
-
function
|
|
4307
|
+
function oa(e, t, n) {
|
|
4256
4308
|
if (!t) throw Error("A view slot must be a non-empty string");
|
|
4257
4309
|
if (e.placement.length >= 64) throw Error("View placement is deeper than 64 steps");
|
|
4258
4310
|
return {
|
|
@@ -4263,7 +4315,7 @@ function ea(e, t, n) {
|
|
|
4263
4315
|
}]
|
|
4264
4316
|
};
|
|
4265
4317
|
}
|
|
4266
|
-
function
|
|
4318
|
+
function sa(e) {
|
|
4267
4319
|
let { client: t, address: n, view: r, placement: i } = e;
|
|
4268
4320
|
return n === void 0 ? {
|
|
4269
4321
|
client: t,
|
|
@@ -4277,62 +4329,62 @@ function ta(e) {
|
|
|
4277
4329
|
}
|
|
4278
4330
|
//#endregion
|
|
4279
4331
|
//#region src/views/ViewContext.ts
|
|
4280
|
-
var
|
|
4281
|
-
function
|
|
4332
|
+
var ca = n(null);
|
|
4333
|
+
function la() {
|
|
4282
4334
|
return b() ? x().pathname : null;
|
|
4283
4335
|
}
|
|
4284
|
-
function
|
|
4285
|
-
let t =
|
|
4336
|
+
function ua(e) {
|
|
4337
|
+
let t = la(), n = o(() => e && t ? ia(t) : null, [e, t]), r = mr(n);
|
|
4286
4338
|
return o(() => n ? {
|
|
4287
4339
|
position: n,
|
|
4288
4340
|
view: r
|
|
4289
4341
|
} : null, [n, r]);
|
|
4290
4342
|
}
|
|
4291
|
-
function
|
|
4292
|
-
let e = i(
|
|
4343
|
+
function da() {
|
|
4344
|
+
let e = i(ca), t = ua(!e);
|
|
4293
4345
|
return e ?? t;
|
|
4294
4346
|
}
|
|
4295
4347
|
//#endregion
|
|
4296
4348
|
//#region src/views/defineView.tsx
|
|
4297
|
-
var
|
|
4349
|
+
var fa = (e) => {
|
|
4298
4350
|
let t = e.slice(e.lastIndexOf(".") + 1).replace(/_/g, " ");
|
|
4299
4351
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
4300
4352
|
};
|
|
4301
|
-
function
|
|
4302
|
-
let n =
|
|
4303
|
-
return o(() => r && !i ?
|
|
4353
|
+
function pa(e, t) {
|
|
4354
|
+
let n = da(), r = n?.position ?? null, i = !!n?.route;
|
|
4355
|
+
return o(() => r && !i ? oa(r, e, t) : r, [
|
|
4304
4356
|
r,
|
|
4305
4357
|
i,
|
|
4306
4358
|
e,
|
|
4307
4359
|
t
|
|
4308
4360
|
]);
|
|
4309
4361
|
}
|
|
4310
|
-
function
|
|
4362
|
+
function ma({ position: e, children: t }) {
|
|
4311
4363
|
let n = mr(e), r = o(() => ({
|
|
4312
4364
|
position: e,
|
|
4313
4365
|
view: n
|
|
4314
4366
|
}), [e, n]);
|
|
4315
|
-
return /* @__PURE__ */ d(
|
|
4367
|
+
return /* @__PURE__ */ d(ca.Provider, {
|
|
4316
4368
|
value: r,
|
|
4317
4369
|
children: t
|
|
4318
4370
|
});
|
|
4319
4371
|
}
|
|
4320
|
-
function
|
|
4321
|
-
let n = o(() =>
|
|
4372
|
+
function ha({ address: e, children: t }) {
|
|
4373
|
+
let n = o(() => ia(e), [e]), r = mr(n), i = o(() => ({
|
|
4322
4374
|
position: n,
|
|
4323
4375
|
view: r,
|
|
4324
4376
|
route: !0
|
|
4325
4377
|
}), [n, r]);
|
|
4326
|
-
return /* @__PURE__ */ d(
|
|
4378
|
+
return /* @__PURE__ */ d(ca.Provider, {
|
|
4327
4379
|
value: i,
|
|
4328
4380
|
children: t
|
|
4329
4381
|
});
|
|
4330
4382
|
}
|
|
4331
|
-
function
|
|
4383
|
+
function ga(e, t, n = {}) {
|
|
4332
4384
|
if (!e) throw Error("A view name must be a non-empty string");
|
|
4333
4385
|
let r = ({ slot: n, ...r }) => {
|
|
4334
|
-
let i =
|
|
4335
|
-
return /* @__PURE__ */ d(
|
|
4386
|
+
let i = pa(n ?? e, r.entityId);
|
|
4387
|
+
return /* @__PURE__ */ d(ma, {
|
|
4336
4388
|
position: i,
|
|
4337
4389
|
children: /* @__PURE__ */ d(t, { ...r })
|
|
4338
4390
|
});
|
|
@@ -4341,20 +4393,20 @@ function ua(e, t, n = {}) {
|
|
|
4341
4393
|
viewName: e,
|
|
4342
4394
|
defaultFor: Object.freeze([...n.defaultFor ?? []]),
|
|
4343
4395
|
entry: !!n.entry,
|
|
4344
|
-
label: n.label ??
|
|
4396
|
+
label: n.label ?? fa(e),
|
|
4345
4397
|
Component: t
|
|
4346
4398
|
});
|
|
4347
4399
|
}
|
|
4348
|
-
function
|
|
4400
|
+
function _a(e) {
|
|
4349
4401
|
return typeof e == "function" && typeof e.viewName == "string" && "Component" in e;
|
|
4350
4402
|
}
|
|
4351
4403
|
//#endregion
|
|
4352
4404
|
//#region src/components/common/EntityPicker.tsx
|
|
4353
|
-
var
|
|
4354
|
-
function
|
|
4355
|
-
let { ids: m, hasMore: h, loading: g, loadMore: _ } =
|
|
4405
|
+
var va = 25;
|
|
4406
|
+
function ya({ typeIds: e, onPick: t, exclude: n = [], labelFor: r = Z, disabled: i = !1, placeholder: s = "Search…", className: l = "", autoFocus: u = !1, listPlacement: p = "above" }) {
|
|
4407
|
+
let { ids: m, hasMore: h, loading: g, loadMore: _ } = Zi({
|
|
4356
4408
|
typeIds: e,
|
|
4357
|
-
limit:
|
|
4409
|
+
limit: va
|
|
4358
4410
|
}), v = Br(m), [y, b] = c(""), [x, S] = c(!1), C = o(() => {
|
|
4359
4411
|
let e = y.trim().toLowerCase();
|
|
4360
4412
|
return v.filter((t) => !n.includes(t.entity_id) && (!e || r(t).toLowerCase().includes(e)));
|
|
@@ -4365,7 +4417,7 @@ function pa({ typeIds: e, onPick: t, exclude: n = [], labelFor: r = Z, disabled:
|
|
|
4365
4417
|
r
|
|
4366
4418
|
]);
|
|
4367
4419
|
return a(() => {
|
|
4368
|
-
y && C.length <
|
|
4420
|
+
y && C.length < va && h && _();
|
|
4369
4421
|
}, [
|
|
4370
4422
|
y,
|
|
4371
4423
|
C.length,
|
|
@@ -4407,13 +4459,13 @@ function pa({ typeIds: e, onPick: t, exclude: n = [], labelFor: r = Z, disabled:
|
|
|
4407
4459
|
}
|
|
4408
4460
|
//#endregion
|
|
4409
4461
|
//#region src/components/Access/GroupView.tsx
|
|
4410
|
-
var
|
|
4411
|
-
function
|
|
4462
|
+
var ba = (e, t, n) => $.builder().withStrategyName(e).withTargetEntity(t).withParams(n).build();
|
|
4463
|
+
function xa({ entityId: e }) {
|
|
4412
4464
|
if (!e) throw Error("This view needs an entity to show.");
|
|
4413
|
-
let { sendStrategyRequest: t } =
|
|
4465
|
+
let { sendStrategyRequest: t } = qi(), n = X(e), r = n?.member_ids ?? [], i = Br(r), [a, o] = c(!1), s = async (n, r) => {
|
|
4414
4466
|
o(!0);
|
|
4415
4467
|
try {
|
|
4416
|
-
await t(
|
|
4468
|
+
await t(ba(n, e, r), { awaitResponse: !0 });
|
|
4417
4469
|
} finally {
|
|
4418
4470
|
o(!1);
|
|
4419
4471
|
}
|
|
@@ -4457,7 +4509,7 @@ function ha({ entityId: e }) {
|
|
|
4457
4509
|
})]
|
|
4458
4510
|
}, e.entity_id))]
|
|
4459
4511
|
}),
|
|
4460
|
-
/* @__PURE__ */ d(
|
|
4512
|
+
/* @__PURE__ */ d(ya, {
|
|
4461
4513
|
typeIds: [Y.USER],
|
|
4462
4514
|
exclude: r,
|
|
4463
4515
|
disabled: a,
|
|
@@ -4470,13 +4522,13 @@ function ha({ entityId: e }) {
|
|
|
4470
4522
|
children: "Loading group…"
|
|
4471
4523
|
});
|
|
4472
4524
|
}
|
|
4473
|
-
var
|
|
4474
|
-
function
|
|
4475
|
-
let n =
|
|
4476
|
-
|
|
4525
|
+
var Sa = ga("group_view", xa, { defaultFor: [Y.GROUP] }), Ca = /* @__PURE__ */ new Map();
|
|
4526
|
+
function wa(e, t) {
|
|
4527
|
+
let n = Ca.get(e), [i, s] = c(n || null), [l, u] = c(!n), [d, f] = c(!1), [p, m] = c(null), h = r(async () => {
|
|
4528
|
+
Ca.has(e) || u(!0), m(null);
|
|
4477
4529
|
try {
|
|
4478
4530
|
let t = await q.getAccess(e);
|
|
4479
|
-
|
|
4531
|
+
Ca.set(e, t), s(t);
|
|
4480
4532
|
} catch (e) {
|
|
4481
4533
|
m(e?.message || "Unable to load access");
|
|
4482
4534
|
} finally {
|
|
@@ -4485,16 +4537,16 @@ function va(e, t) {
|
|
|
4485
4537
|
}, [e]);
|
|
4486
4538
|
a(() => {
|
|
4487
4539
|
h();
|
|
4488
|
-
}, [h]), a(() =>
|
|
4540
|
+
}, [h]), a(() => ve((t) => {
|
|
4489
4541
|
t === e && h();
|
|
4490
|
-
}), [e, h]), a(() =>
|
|
4542
|
+
}), [e, h]), a(() => xe(() => {
|
|
4491
4543
|
h();
|
|
4492
4544
|
}), [h]);
|
|
4493
4545
|
let g = !!i?.can_manage, _ = o(() => g && i?.grants || [], [g, i]);
|
|
4494
4546
|
a(() => {
|
|
4495
|
-
|
|
4547
|
+
ea();
|
|
4496
4548
|
}, []);
|
|
4497
|
-
let v = X(e), y =
|
|
4549
|
+
let v = X(e), y = na().contents, b = v?.entity_type_id ? y[v.entity_type_id] : void 0, x = !!b?.shareable, S = b?.roles || [], C = b?.public_permissions || [], w = o(() => Object.entries(y).filter(([, e]) => e?.principal || e?.group).map(([e]) => e), [y]), T = r((e) => `${Z(e)} (${y[e.entity_type_id]?.group ? "group" : "person"})`, [y]), E = Br(o(() => _.map((e) => e.subject_id).filter((e) => e !== "*"), [_])), D = o(() => {
|
|
4498
4550
|
let e = { "*": "Anyone signed in" };
|
|
4499
4551
|
for (let t of E) e[t.entity_id] = Z(t);
|
|
4500
4552
|
return e;
|
|
@@ -4530,7 +4582,7 @@ function va(e, t) {
|
|
|
4530
4582
|
}
|
|
4531
4583
|
//#endregion
|
|
4532
4584
|
//#region src/components/Admin/AdminPanel.tsx
|
|
4533
|
-
var
|
|
4585
|
+
var Ta = "/admin", Ea = "graphcore.admins", Da = "member", Oa = [
|
|
4534
4586
|
{
|
|
4535
4587
|
id: "members",
|
|
4536
4588
|
label: "Members"
|
|
@@ -4548,8 +4600,8 @@ var ya = "/admin", ba = "graphcore.admins", xa = "member", Sa = [
|
|
|
4548
4600
|
label: "New users"
|
|
4549
4601
|
}
|
|
4550
4602
|
];
|
|
4551
|
-
function
|
|
4552
|
-
let { ids: t, hasMore: n, loading: r, loadMore: i, refresh: o } =
|
|
4603
|
+
function ka(e) {
|
|
4604
|
+
let { ids: t, hasMore: n, loading: r, loadMore: i, refresh: o } = Zi({
|
|
4553
4605
|
typeIds: [e],
|
|
4554
4606
|
limit: 100
|
|
4555
4607
|
});
|
|
@@ -4564,9 +4616,9 @@ function Ca(e) {
|
|
|
4564
4616
|
refresh: o
|
|
4565
4617
|
};
|
|
4566
4618
|
}
|
|
4567
|
-
function
|
|
4568
|
-
let { sendStrategyRequest: n } =
|
|
4569
|
-
return i ? /* @__PURE__ */ d(
|
|
4619
|
+
function Aa({ sendStrategyRequest: e, className: t = "" }) {
|
|
4620
|
+
let { sendStrategyRequest: n } = qi(), r = e ?? n, i = Zr();
|
|
4621
|
+
return i ? /* @__PURE__ */ d(ja, {
|
|
4570
4622
|
deploymentId: i,
|
|
4571
4623
|
send: r,
|
|
4572
4624
|
className: t
|
|
@@ -4575,8 +4627,8 @@ function wa({ sendStrategyRequest: e, className: t = "" }) {
|
|
|
4575
4627
|
children: "Loading deployment…"
|
|
4576
4628
|
});
|
|
4577
4629
|
}
|
|
4578
|
-
function
|
|
4579
|
-
let r =
|
|
4630
|
+
function ja({ deploymentId: e, send: t, className: n }) {
|
|
4631
|
+
let r = wa(e, t), [i, a] = c("members"), [o, s] = c(null), l = ka(Y.USER), u = ka(Y.GROUP), p = na().contents[Y.DEPLOYMENT]?.roles || [];
|
|
4580
4632
|
if (r.loading) return /* @__PURE__ */ d("div", {
|
|
4581
4633
|
className: `p-6 text-sm text-slate-500 ${n}`,
|
|
4582
4634
|
children: "Loading…"
|
|
@@ -4623,7 +4675,7 @@ function Ta({ deploymentId: e, send: t, className: n }) {
|
|
|
4623
4675
|
/* @__PURE__ */ d("nav", {
|
|
4624
4676
|
className: "flex gap-1 border-b border-slate-200",
|
|
4625
4677
|
role: "tablist",
|
|
4626
|
-
children:
|
|
4678
|
+
children: Oa.map(({ id: e, label: t }) => /* @__PURE__ */ d("button", {
|
|
4627
4679
|
type: "button",
|
|
4628
4680
|
role: "tab",
|
|
4629
4681
|
"aria-selected": i === e,
|
|
@@ -4632,13 +4684,13 @@ function Ta({ deploymentId: e, send: t, className: n }) {
|
|
|
4632
4684
|
children: t
|
|
4633
4685
|
}, e))
|
|
4634
4686
|
}),
|
|
4635
|
-
i === "members" && /* @__PURE__ */ d(
|
|
4687
|
+
i === "members" && /* @__PURE__ */ d(Na, {
|
|
4636
4688
|
users: l.entities,
|
|
4637
4689
|
groups: u.entities,
|
|
4638
4690
|
grants: h,
|
|
4639
4691
|
run: m
|
|
4640
4692
|
}),
|
|
4641
|
-
i === "groups" && /* @__PURE__ */ d(
|
|
4693
|
+
i === "groups" && /* @__PURE__ */ d(Pa, {
|
|
4642
4694
|
groups: u.entities,
|
|
4643
4695
|
grants: h,
|
|
4644
4696
|
roles: p,
|
|
@@ -4646,8 +4698,8 @@ function Ta({ deploymentId: e, send: t, className: n }) {
|
|
|
4646
4698
|
run: m,
|
|
4647
4699
|
deploymentId: e
|
|
4648
4700
|
}),
|
|
4649
|
-
i === "roles" && /* @__PURE__ */ d(
|
|
4650
|
-
i === "new-users" && /* @__PURE__ */ d(
|
|
4701
|
+
i === "roles" && /* @__PURE__ */ d(Ra, { roles: p }),
|
|
4702
|
+
i === "new-users" && /* @__PURE__ */ d(za, {
|
|
4651
4703
|
deploymentId: e,
|
|
4652
4704
|
groups: u.entities,
|
|
4653
4705
|
grants: h,
|
|
@@ -4657,10 +4709,10 @@ function Ta({ deploymentId: e, send: t, className: n }) {
|
|
|
4657
4709
|
]
|
|
4658
4710
|
});
|
|
4659
4711
|
}
|
|
4660
|
-
var
|
|
4661
|
-
function
|
|
4662
|
-
let [i, a] = c(!1), o = t.find((e) => e.key ===
|
|
4663
|
-
let r = t.filter((t) => (t.member_ids || []).includes(e.entity_id)), i =
|
|
4712
|
+
var Ma = (e, t) => e.filter((e) => e.subject_id === t && e.provenance === "direct").map((e) => e.role);
|
|
4713
|
+
function Na({ users: e, groups: t, grants: n, run: r }) {
|
|
4714
|
+
let [i, a] = c(!1), o = t.find((e) => e.key === Ea), s = Ma(n, "*").includes(Da), l = new Set(t.filter((e) => Ma(n, e.entity_id).length > 0).map((e) => e.entity_id)), u = e.map((e) => {
|
|
4715
|
+
let r = t.filter((t) => (t.member_ids || []).includes(e.entity_id)), i = Ma(n, e.entity_id);
|
|
4664
4716
|
return {
|
|
4665
4717
|
user: e,
|
|
4666
4718
|
memberOf: r,
|
|
@@ -4720,7 +4772,7 @@ function Da({ users: e, groups: t, grants: n, run: r }) {
|
|
|
4720
4772
|
]
|
|
4721
4773
|
});
|
|
4722
4774
|
}
|
|
4723
|
-
function
|
|
4775
|
+
function Pa({ groups: e, grants: t, roles: n, send: r, run: i, deploymentId: a }) {
|
|
4724
4776
|
let [o, s] = c(""), [l, u] = c(null);
|
|
4725
4777
|
return /* @__PURE__ */ f("div", {
|
|
4726
4778
|
className: "space-y-4",
|
|
@@ -4780,15 +4832,15 @@ function Oa({ groups: e, grants: t, roles: n, send: r, run: i, deploymentId: a }
|
|
|
4780
4832
|
}), o && /* @__PURE__ */ f("div", {
|
|
4781
4833
|
className: "mt-3 space-y-3 rounded-lg bg-slate-50 p-3",
|
|
4782
4834
|
children: [
|
|
4783
|
-
/* @__PURE__ */ d(
|
|
4835
|
+
/* @__PURE__ */ d(Ia, {
|
|
4784
4836
|
group: e,
|
|
4785
4837
|
grant: r,
|
|
4786
4838
|
roles: n,
|
|
4787
4839
|
run: i,
|
|
4788
4840
|
deploymentId: a
|
|
4789
4841
|
}),
|
|
4790
|
-
/* @__PURE__ */ d(
|
|
4791
|
-
!e.key && /* @__PURE__ */ d(
|
|
4842
|
+
/* @__PURE__ */ d(Sa, { entityId: e.entity_id }),
|
|
4843
|
+
!e.key && /* @__PURE__ */ d(La, {
|
|
4792
4844
|
group: e,
|
|
4793
4845
|
run: i
|
|
4794
4846
|
})
|
|
@@ -4800,10 +4852,10 @@ function Oa({ groups: e, grants: t, roles: n, send: r, run: i, deploymentId: a }
|
|
|
4800
4852
|
]
|
|
4801
4853
|
});
|
|
4802
4854
|
}
|
|
4803
|
-
var
|
|
4804
|
-
function
|
|
4805
|
-
let a = t?.role ??
|
|
4806
|
-
o !== null && (o ===
|
|
4855
|
+
var Fa = "";
|
|
4856
|
+
function Ia({ group: e, grant: t, roles: n, run: r, deploymentId: i }) {
|
|
4857
|
+
let a = t?.role ?? Fa, [o, s] = c(null), l = e.name || e.key || "this group", p = (e) => e === Fa ? "no role" : e, m = async () => {
|
|
4858
|
+
o !== null && (o === Fa ? t?.grant_entity_id && await r($.revokeGrant(t.grant_entity_id)) : await r($.createGrant(i, e.entity_id, o)), s(null));
|
|
4807
4859
|
};
|
|
4808
4860
|
return /* @__PURE__ */ f("div", {
|
|
4809
4861
|
className: "space-y-2",
|
|
@@ -4817,7 +4869,7 @@ function Aa({ group: e, grant: t, roles: n, run: r, deploymentId: i }) {
|
|
|
4817
4869
|
onChange: (e) => s(e.target.value === a ? null : e.target.value),
|
|
4818
4870
|
className: "rounded-md border border-slate-300 bg-white px-2 py-1 text-xs",
|
|
4819
4871
|
children: [/* @__PURE__ */ d("option", {
|
|
4820
|
-
value:
|
|
4872
|
+
value: Fa,
|
|
4821
4873
|
children: "No role"
|
|
4822
4874
|
}), n.map((e) => /* @__PURE__ */ d("option", {
|
|
4823
4875
|
value: e.name,
|
|
@@ -4829,7 +4881,7 @@ function Aa({ group: e, grant: t, roles: n, run: r, deploymentId: i }) {
|
|
|
4829
4881
|
"aria-label": "Confirm role change",
|
|
4830
4882
|
className: "space-y-2 rounded-lg border border-amber-300 bg-amber-50 p-3 text-xs text-amber-900",
|
|
4831
4883
|
children: [/* @__PURE__ */ f("p", { children: [
|
|
4832
|
-
a ===
|
|
4884
|
+
a === Fa ? /* @__PURE__ */ f(u, { children: [
|
|
4833
4885
|
"Give ",
|
|
4834
4886
|
/* @__PURE__ */ d("strong", { children: l }),
|
|
4835
4887
|
" the role ",
|
|
@@ -4852,7 +4904,7 @@ function Aa({ group: e, grant: t, roles: n, run: r, deploymentId: i }) {
|
|
|
4852
4904
|
type: "button",
|
|
4853
4905
|
onClick: () => void m(),
|
|
4854
4906
|
className: "rounded-md bg-slate-900 px-2 py-1 font-medium text-white",
|
|
4855
|
-
children: o ===
|
|
4907
|
+
children: o === Fa ? "Remove role" : a === Fa ? "Give role" : "Replace role"
|
|
4856
4908
|
}), /* @__PURE__ */ d("button", {
|
|
4857
4909
|
type: "button",
|
|
4858
4910
|
onClick: () => s(null),
|
|
@@ -4863,7 +4915,7 @@ function Aa({ group: e, grant: t, roles: n, run: r, deploymentId: i }) {
|
|
|
4863
4915
|
})]
|
|
4864
4916
|
});
|
|
4865
4917
|
}
|
|
4866
|
-
function
|
|
4918
|
+
function La({ group: e, run: t }) {
|
|
4867
4919
|
let [n, r] = c(!1), i = e.name || "this group";
|
|
4868
4920
|
return n ? /* @__PURE__ */ f("div", {
|
|
4869
4921
|
role: "alertdialog",
|
|
@@ -4894,7 +4946,7 @@ function ja({ group: e, run: t }) {
|
|
|
4894
4946
|
children: "Delete group"
|
|
4895
4947
|
});
|
|
4896
4948
|
}
|
|
4897
|
-
function
|
|
4949
|
+
function Ra({ roles: e }) {
|
|
4898
4950
|
return /* @__PURE__ */ f("div", {
|
|
4899
4951
|
className: "space-y-4",
|
|
4900
4952
|
children: [/* @__PURE__ */ d("p", {
|
|
@@ -4927,12 +4979,12 @@ function Ma({ roles: e }) {
|
|
|
4927
4979
|
})]
|
|
4928
4980
|
});
|
|
4929
4981
|
}
|
|
4930
|
-
function
|
|
4982
|
+
function za({ deploymentId: e, groups: t, grants: n, roles: r, run: i }) {
|
|
4931
4983
|
let s = X(e), [l, u] = c([]), [p, m] = c([]);
|
|
4932
4984
|
a(() => {
|
|
4933
4985
|
u(s?.new_user_group_ids ?? []), m(s?.new_user_roles ?? []);
|
|
4934
4986
|
}, [s?.new_user_group_ids, s?.new_user_roles]);
|
|
4935
|
-
let h = o(() => n.find((e) => e.subject_id === "*" && e.role ===
|
|
4987
|
+
let h = o(() => n.find((e) => e.subject_id === "*" && e.role === Da && e.provenance === "direct"), [n]), g = (e, t) => e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
|
|
4936
4988
|
return /* @__PURE__ */ f("div", {
|
|
4937
4989
|
className: "space-y-6",
|
|
4938
4990
|
children: [
|
|
@@ -4941,7 +4993,7 @@ function Na({ deploymentId: e, groups: t, grants: n, roles: r, run: i }) {
|
|
|
4941
4993
|
children: [/* @__PURE__ */ d("input", {
|
|
4942
4994
|
type: "checkbox",
|
|
4943
4995
|
checked: !!h,
|
|
4944
|
-
onChange: () => void i(h?.grant_entity_id ? $.revokeGrant(h.grant_entity_id) : $.createGrant(e, "*",
|
|
4996
|
+
onChange: () => void i(h?.grant_entity_id ? $.revokeGrant(h.grant_entity_id) : $.createGrant(e, "*", Da)),
|
|
4945
4997
|
className: "mt-0.5"
|
|
4946
4998
|
}), /* @__PURE__ */ f("span", { children: [/* @__PURE__ */ d("span", {
|
|
4947
4999
|
className: "font-medium text-slate-800",
|
|
@@ -5014,7 +5066,7 @@ function Na({ deploymentId: e, groups: t, grants: n, roles: r, run: i }) {
|
|
|
5014
5066
|
}
|
|
5015
5067
|
//#endregion
|
|
5016
5068
|
//#region src/components/Admin/useIsDeploymentAdmin.ts
|
|
5017
|
-
function
|
|
5069
|
+
function Ba(e = !0) {
|
|
5018
5070
|
let t = Zr(), [n, r] = c(!1);
|
|
5019
5071
|
return a(() => {
|
|
5020
5072
|
if (!e || !t) {
|
|
@@ -5033,7 +5085,7 @@ function Pa(e = !0) {
|
|
|
5033
5085
|
}
|
|
5034
5086
|
//#endregion
|
|
5035
5087
|
//#region src/components/TopBar/TopBar.tsx
|
|
5036
|
-
function
|
|
5088
|
+
function Va(e) {
|
|
5037
5089
|
return [{
|
|
5038
5090
|
to: "/",
|
|
5039
5091
|
label: "home"
|
|
@@ -5042,9 +5094,9 @@ function Fa(e) {
|
|
|
5042
5094
|
label: e.slice(1)
|
|
5043
5095
|
}))];
|
|
5044
5096
|
}
|
|
5045
|
-
var
|
|
5046
|
-
function
|
|
5047
|
-
let { isAuthenticated: t, username: n, principalEntityId: r, logout: i } = Jr(), o =
|
|
5097
|
+
var Ha = ({ isActive: e }) => `rounded-md px-2.5 py-1 text-sm ${e ? "bg-gray-900 text-white" : "text-gray-600 hover:bg-gray-100"}`, Ua = "flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm hover:bg-gray-100";
|
|
5098
|
+
function Wa({ adminHref: e }) {
|
|
5099
|
+
let { isAuthenticated: t, username: n, principalEntityId: r, logout: i } = Jr(), o = Ba(t), l = X(r), [u, p] = c(!1), [h, g] = c(!1), _ = s(null);
|
|
5048
5100
|
a(() => {
|
|
5049
5101
|
if (!u) return;
|
|
5050
5102
|
let e = (e) => {
|
|
@@ -5080,7 +5132,7 @@ function Ra({ adminHref: e }) {
|
|
|
5080
5132
|
}
|
|
5081
5133
|
},
|
|
5082
5134
|
title: "Copy user entity ID",
|
|
5083
|
-
className:
|
|
5135
|
+
className: Ua,
|
|
5084
5136
|
children: [h ? /* @__PURE__ */ d(ui, { className: "h-3 w-3 shrink-0 text-green-600" }) : /* @__PURE__ */ d(ci, { className: "h-3 w-3 shrink-0 text-gray-500" }), /* @__PURE__ */ d("span", {
|
|
5085
5137
|
className: "truncate font-mono text-xs text-gray-600",
|
|
5086
5138
|
children: r
|
|
@@ -5090,24 +5142,24 @@ function Ra({ adminHref: e }) {
|
|
|
5090
5142
|
to: e,
|
|
5091
5143
|
role: "menuitem",
|
|
5092
5144
|
onClick: () => p(!1),
|
|
5093
|
-
className: `${
|
|
5145
|
+
className: `${Ua} text-gray-700`,
|
|
5094
5146
|
children: [/* @__PURE__ */ d(ri, { className: "h-3.5 w-3.5 text-gray-500" }), "Admin"]
|
|
5095
5147
|
}),
|
|
5096
5148
|
/* @__PURE__ */ f("button", {
|
|
5097
5149
|
type: "button",
|
|
5098
5150
|
role: "menuitem",
|
|
5099
5151
|
onClick: i,
|
|
5100
|
-
className: `${
|
|
5152
|
+
className: `${Ua} text-red-600 hover:bg-red-50`,
|
|
5101
5153
|
children: [/* @__PURE__ */ d(ai, { className: "h-3.5 w-3.5" }), "Logout"]
|
|
5102
5154
|
})
|
|
5103
5155
|
]
|
|
5104
5156
|
})]
|
|
5105
5157
|
});
|
|
5106
5158
|
}
|
|
5107
|
-
var
|
|
5108
|
-
let { isAuthenticated: i } = Jr(), a =
|
|
5159
|
+
var Ga = ({ title: e = "graphcore", places: t, className: n = "", adminHref: r = Ta }) => {
|
|
5160
|
+
let { isAuthenticated: i } = Jr(), a = Ki();
|
|
5109
5161
|
if (!i) return null;
|
|
5110
|
-
let o =
|
|
5162
|
+
let o = Va(a ?? []), s = t === !1 ? [] : Array.isArray(t) ? t : t ? t(o) : o;
|
|
5111
5163
|
return /* @__PURE__ */ f("div", {
|
|
5112
5164
|
className: `flex items-center gap-4 border-b border-gray-200 bg-white px-4 py-2 ${n}`,
|
|
5113
5165
|
children: [
|
|
@@ -5121,23 +5173,23 @@ var za = ({ title: e = "graphcore", places: t, className: n = "", adminHref: r =
|
|
|
5121
5173
|
children: s.map((e) => /* @__PURE__ */ d(h, {
|
|
5122
5174
|
to: e.to,
|
|
5123
5175
|
end: e.to === "/",
|
|
5124
|
-
className:
|
|
5176
|
+
className: Ha,
|
|
5125
5177
|
children: e.label
|
|
5126
5178
|
}, e.to))
|
|
5127
5179
|
}),
|
|
5128
5180
|
/* @__PURE__ */ d("div", {
|
|
5129
5181
|
className: "ml-auto",
|
|
5130
|
-
children: /* @__PURE__ */ d(
|
|
5182
|
+
children: /* @__PURE__ */ d(Wa, { adminHref: r })
|
|
5131
5183
|
})
|
|
5132
5184
|
]
|
|
5133
5185
|
});
|
|
5134
|
-
},
|
|
5186
|
+
}, Ka = ({ entityTypeId: t, className: n = "w-4 h-4", size: r }) => {
|
|
5135
5187
|
let i = qn(t);
|
|
5136
5188
|
return e.createElement(i, {
|
|
5137
5189
|
className: n,
|
|
5138
5190
|
size: r
|
|
5139
5191
|
});
|
|
5140
|
-
},
|
|
5192
|
+
}, qa = {
|
|
5141
5193
|
light: {
|
|
5142
5194
|
wrapper: "border border-gray-200 bg-white shadow-xs",
|
|
5143
5195
|
input: "border-gray-200 bg-white text-gray-900 placeholder:text-gray-400 focus:border-blue-400 focus:ring-blue-100",
|
|
@@ -5160,8 +5212,8 @@ var za = ({ title: e = "graphcore", places: t, className: n = "", adminHref: r =
|
|
|
5160
5212
|
optionMetaActive: "text-blue-300",
|
|
5161
5213
|
empty: "text-gray-400"
|
|
5162
5214
|
}
|
|
5163
|
-
},
|
|
5164
|
-
let [s, l] = c(""), u =
|
|
5215
|
+
}, Ja = ({ availableViewTypes: e, selectedValue: t, onSelect: n, theme: r = "light", placeholder: i = "Search view types...", autoFocus: a = !1 }) => {
|
|
5216
|
+
let [s, l] = c(""), u = qa[r] || qa.light, p = o(() => Object.entries(e || {}), [e]), m = o(() => {
|
|
5165
5217
|
let e = s.trim().toLowerCase();
|
|
5166
5218
|
return e ? p.filter(([t, n]) => String(n).toLowerCase().includes(e) || t.toLowerCase().includes(e)) : p;
|
|
5167
5219
|
}, [s, p]);
|
|
@@ -5208,8 +5260,8 @@ var za = ({ title: e = "graphcore", places: t, className: n = "", adminHref: r =
|
|
|
5208
5260
|
};
|
|
5209
5261
|
//#endregion
|
|
5210
5262
|
//#region src/views/useViewState.ts
|
|
5211
|
-
function
|
|
5212
|
-
let t =
|
|
5263
|
+
function Ya(e) {
|
|
5264
|
+
let t = da(), { sendStrategyRequest: n } = qi(), i = s(e);
|
|
5213
5265
|
i.current = e;
|
|
5214
5266
|
let a = t?.view?.state, c = o(() => ({
|
|
5215
5267
|
...i.current,
|
|
@@ -5218,7 +5270,7 @@ function Ua(e) {
|
|
|
5218
5270
|
return [c, r((e, t) => {
|
|
5219
5271
|
if (!l && !u) return Promise.resolve(void 0);
|
|
5220
5272
|
let r = {
|
|
5221
|
-
position: u ?
|
|
5273
|
+
position: u ? sa(u) : void 0,
|
|
5222
5274
|
state: e
|
|
5223
5275
|
};
|
|
5224
5276
|
t !== void 0 && (r.component = t);
|
|
@@ -5230,8 +5282,8 @@ function Ua(e) {
|
|
|
5230
5282
|
l
|
|
5231
5283
|
])];
|
|
5232
5284
|
}
|
|
5233
|
-
function
|
|
5234
|
-
let { sendStrategyRequest: e } =
|
|
5285
|
+
function Xa() {
|
|
5286
|
+
let { sendStrategyRequest: e } = qi();
|
|
5235
5287
|
return r(async (t = {}) => {
|
|
5236
5288
|
try {
|
|
5237
5289
|
return (await e($.createView(null, t), { awaitResponse: !0 }))?.view_entity_id ?? null;
|
|
@@ -5242,33 +5294,33 @@ function Wa() {
|
|
|
5242
5294
|
}
|
|
5243
5295
|
//#endregion
|
|
5244
5296
|
//#region src/views/useEntityTypeIds.ts
|
|
5245
|
-
function
|
|
5297
|
+
function Za() {
|
|
5246
5298
|
a(() => {
|
|
5247
|
-
|
|
5299
|
+
ea();
|
|
5248
5300
|
}, []);
|
|
5249
|
-
let e =
|
|
5301
|
+
let e = na().contents;
|
|
5250
5302
|
return o(() => Object.keys(e).filter((e) => e !== Y.VIEW).sort(), [e]);
|
|
5251
5303
|
}
|
|
5252
5304
|
//#endregion
|
|
5253
5305
|
//#region src/components/ViewEntity/ViewGallery/ViewGallery.tsx
|
|
5254
|
-
var
|
|
5306
|
+
var Qa = [{
|
|
5255
5307
|
key: "entity_ide",
|
|
5256
5308
|
label: "Entity IDE",
|
|
5257
5309
|
icon: Vn,
|
|
5258
5310
|
state: { sidebar_config: { allow_create: !0 } }
|
|
5259
|
-
}],
|
|
5260
|
-
function
|
|
5261
|
-
let n = S(), r = ni(), i = X(e), a =
|
|
5311
|
+
}], $a = "flex min-w-0 flex-col items-center gap-2 rounded-xl border border-gray-200 bg-white p-5 text-center shadow-xs transition-colors";
|
|
5312
|
+
function eo({ viewId: e, onRemove: t }) {
|
|
5313
|
+
let n = S(), r = ni(), i = X(e), a = R((t) => t.notFoundEntityIds.has(e)), o = a || i?.forbidden, s = typeof i?.component == "string" ? i.component : null, c = o ? a ? "View not found" : "No access" : i && Wr(i, "name") || s && r.get(s)?.label || s || "View";
|
|
5262
5314
|
return /* @__PURE__ */ f("div", {
|
|
5263
5315
|
className: "group relative",
|
|
5264
5316
|
children: [/* @__PURE__ */ f("button", {
|
|
5265
5317
|
type: "button",
|
|
5266
5318
|
disabled: !!o,
|
|
5267
5319
|
onClick: () => n(_i(e)),
|
|
5268
|
-
className: `${
|
|
5320
|
+
className: `${$a} w-full hover:border-blue-300 hover:shadow-md disabled:cursor-default disabled:opacity-60`,
|
|
5269
5321
|
children: [/* @__PURE__ */ d("div", {
|
|
5270
5322
|
className: "flex h-10 w-10 items-center justify-center rounded-lg bg-blue-50 text-blue-600",
|
|
5271
|
-
children: /* @__PURE__ */ d(
|
|
5323
|
+
children: /* @__PURE__ */ d(Ka, {
|
|
5272
5324
|
entityTypeId: i?.entity_type_id,
|
|
5273
5325
|
className: "h-5 w-5"
|
|
5274
5326
|
})
|
|
@@ -5285,13 +5337,13 @@ function Ja({ viewId: e, onRemove: t }) {
|
|
|
5285
5337
|
})]
|
|
5286
5338
|
});
|
|
5287
5339
|
}
|
|
5288
|
-
function
|
|
5289
|
-
let e = S(), t = ni(), [{ views: n }, r] =
|
|
5340
|
+
function to() {
|
|
5341
|
+
let e = S(), t = ni(), [{ views: n }, r] = Ya({ views: [] }), i = Xa(), l = Br(n), u = s(n), p = s(n);
|
|
5290
5342
|
a(() => {
|
|
5291
5343
|
u.current = n, p.current = n;
|
|
5292
5344
|
}, [n]);
|
|
5293
|
-
let m =
|
|
5294
|
-
let e = new Set(l.filter((e) =>
|
|
5345
|
+
let m = Za(), [h, g] = c(!1), [_, v] = c(""), [y, b] = c(null), [x, C] = c(null), T = o(() => {
|
|
5346
|
+
let e = new Set(l.filter((e) => Qa.some((t) => t.key === e.component)).map((e) => e.entity_id));
|
|
5295
5347
|
return n.filter((t) => !e.has(t));
|
|
5296
5348
|
}, [n, l]), E = o(() => Object.fromEntries(t.keys().map((e) => [e, t.get(e).label])), [t]), D = async (e) => {
|
|
5297
5349
|
p.current = e;
|
|
@@ -5317,7 +5369,7 @@ function Ya() {
|
|
|
5317
5369
|
e(_i(n.entity_id));
|
|
5318
5370
|
return;
|
|
5319
5371
|
}
|
|
5320
|
-
let r =
|
|
5372
|
+
let r = Qa.find((e) => e.key === t), i = await O(t, {
|
|
5321
5373
|
component: t,
|
|
5322
5374
|
state: r?.state ?? {}
|
|
5323
5375
|
});
|
|
@@ -5341,7 +5393,7 @@ function Ya() {
|
|
|
5341
5393
|
/* @__PURE__ */ f("div", {
|
|
5342
5394
|
className: "grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-4",
|
|
5343
5395
|
children: [
|
|
5344
|
-
|
|
5396
|
+
Qa.map((e) => {
|
|
5345
5397
|
let t = e.icon, n = x === e.key;
|
|
5346
5398
|
return /* @__PURE__ */ f("button", {
|
|
5347
5399
|
type: "button",
|
|
@@ -5364,7 +5416,7 @@ function Ya() {
|
|
|
5364
5416
|
]
|
|
5365
5417
|
}, e.key);
|
|
5366
5418
|
}),
|
|
5367
|
-
T.map((e) => /* @__PURE__ */ d(
|
|
5419
|
+
T.map((e) => /* @__PURE__ */ d(eo, {
|
|
5368
5420
|
viewId: e,
|
|
5369
5421
|
onRemove: () => k(e)
|
|
5370
5422
|
}, e)),
|
|
@@ -5395,7 +5447,7 @@ function Ya() {
|
|
|
5395
5447
|
className: "text-sm font-semibold text-gray-900",
|
|
5396
5448
|
children: "Create a new view"
|
|
5397
5449
|
}),
|
|
5398
|
-
/* @__PURE__ */ d(
|
|
5450
|
+
/* @__PURE__ */ d(Ja, {
|
|
5399
5451
|
availableViewTypes: E,
|
|
5400
5452
|
selectedValue: _,
|
|
5401
5453
|
onSelect: v,
|
|
@@ -5405,7 +5457,7 @@ function Ya() {
|
|
|
5405
5457
|
/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("div", {
|
|
5406
5458
|
className: "mb-1 text-xs font-medium text-gray-500",
|
|
5407
5459
|
children: ["Shows ", y ? Z(y) : "no entity"]
|
|
5408
|
-
}), m.length > 0 && /* @__PURE__ */ d(
|
|
5460
|
+
}), m.length > 0 && /* @__PURE__ */ d(ya, {
|
|
5409
5461
|
typeIds: m,
|
|
5410
5462
|
onPick: b,
|
|
5411
5463
|
placeholder: "Pick an entity (optional)…"
|
|
@@ -5436,82 +5488,9 @@ function Ya() {
|
|
|
5436
5488
|
]
|
|
5437
5489
|
});
|
|
5438
5490
|
}
|
|
5439
|
-
var
|
|
5440
|
-
function Qa(e) {
|
|
5441
|
-
return `${window.location.origin}${N(Za)}#${e}`;
|
|
5442
|
-
}
|
|
5443
|
-
var $a = (e, t) => /* @__PURE__ */ d("div", {
|
|
5444
|
-
className: "min-h-screen flex items-center justify-center bg-linear-to-br from-blue-50 to-indigo-100 px-4",
|
|
5445
|
-
children: /* @__PURE__ */ f("div", {
|
|
5446
|
-
className: "max-w-md w-full bg-white rounded-lg shadow-xl p-8 text-center space-y-6",
|
|
5447
|
-
children: [/* @__PURE__ */ d("h1", {
|
|
5448
|
-
className: "text-3xl font-bold text-gray-900",
|
|
5449
|
-
children: e
|
|
5450
|
-
}), t]
|
|
5451
|
-
})
|
|
5452
|
-
}), eo = "w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2.5 px-4 rounded-lg transition focus:ring-4 focus:ring-blue-300", to = "w-full border border-gray-300 text-gray-700 hover:bg-gray-50 font-medium py-2.5 px-4 rounded-lg transition";
|
|
5453
|
-
function no({ onRedeemed: e, title: t = "graphcore" }) {
|
|
5454
|
-
let { hash: n } = x(), r = S(), { isAuthenticated: i, principalEntityId: o, isLoading: l, login: p, register: m } = Jr(), [h, g] = c(!1), [_, v] = c(null), y = s(null), b = n.startsWith("#") ? decodeURIComponent(n.slice(1)) : "", C = i && !!o;
|
|
5455
|
-
return a(() => {
|
|
5456
|
-
if (C) return;
|
|
5457
|
-
let e = !0;
|
|
5458
|
-
return Jt().then((t) => {
|
|
5459
|
-
e && g(t);
|
|
5460
|
-
}), () => {
|
|
5461
|
-
e = !1;
|
|
5462
|
-
};
|
|
5463
|
-
}, [C]), a(() => {
|
|
5464
|
-
C && b && y.current !== b && (y.current = b, q.redeemInvite(b).then((t) => {
|
|
5465
|
-
e ? e(t) : r(_i(t.resource_id), { replace: !0 });
|
|
5466
|
-
}).catch((e) => v(e.message || "This invite is invalid or has expired")));
|
|
5467
|
-
}, [
|
|
5468
|
-
C,
|
|
5469
|
-
b,
|
|
5470
|
-
e,
|
|
5471
|
-
r
|
|
5472
|
-
]), b ? _ ? $a(t, /* @__PURE__ */ d("p", {
|
|
5473
|
-
role: "alert",
|
|
5474
|
-
className: "text-red-600",
|
|
5475
|
-
children: _
|
|
5476
|
-
})) : C ? $a(t, /* @__PURE__ */ d("p", {
|
|
5477
|
-
className: "text-gray-600",
|
|
5478
|
-
role: "status",
|
|
5479
|
-
children: "Accepting invite…"
|
|
5480
|
-
})) : l ? $a(t, /* @__PURE__ */ d("p", {
|
|
5481
|
-
className: "text-gray-600",
|
|
5482
|
-
role: "status",
|
|
5483
|
-
children: "Please wait..."
|
|
5484
|
-
})) : $a(t, /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("p", {
|
|
5485
|
-
className: "text-gray-600",
|
|
5486
|
-
children: "You've been invited. Sign in to accept."
|
|
5487
|
-
}), /* @__PURE__ */ d("div", {
|
|
5488
|
-
className: "space-y-3",
|
|
5489
|
-
children: h ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("button", {
|
|
5490
|
-
type: "button",
|
|
5491
|
-
className: eo,
|
|
5492
|
-
onClick: () => p(),
|
|
5493
|
-
children: "Sign in"
|
|
5494
|
-
}), /* @__PURE__ */ d("button", {
|
|
5495
|
-
type: "button",
|
|
5496
|
-
className: to,
|
|
5497
|
-
onClick: () => m(),
|
|
5498
|
-
children: "Create account"
|
|
5499
|
-
})] }) : /* @__PURE__ */ d("button", {
|
|
5500
|
-
type: "button",
|
|
5501
|
-
className: eo,
|
|
5502
|
-
onClick: () => p(),
|
|
5503
|
-
children: "Continue"
|
|
5504
|
-
})
|
|
5505
|
-
})] })) : $a(t, /* @__PURE__ */ d("p", {
|
|
5506
|
-
className: "text-gray-600",
|
|
5507
|
-
children: "This invite link is incomplete."
|
|
5508
|
-
}));
|
|
5509
|
-
}
|
|
5510
|
-
//#endregion
|
|
5511
|
-
//#region src/components/Access/AccessPanel.tsx
|
|
5512
|
-
var ro = (e) => e.replace(/(^|-)\w/g, (e) => e.toUpperCase());
|
|
5491
|
+
var no = ga("view_gallery", to, { entry: !0 }), ro = (e) => e.replace(/(^|-)\w/g, (e) => e.toUpperCase());
|
|
5513
5492
|
function io({ entityId: e, sendStrategyRequest: t, className: n = "" }) {
|
|
5514
|
-
let r =
|
|
5493
|
+
let r = wa(e, t), [i, a] = c(""), [o, s] = c({}), { summary: l } = r, p = i || r.roles[0]?.name;
|
|
5515
5494
|
if (r.loading) return /* @__PURE__ */ d("div", {
|
|
5516
5495
|
className: `min-h-[28rem] p-6 text-sm text-slate-500 ${n}`,
|
|
5517
5496
|
children: "Loading access…"
|
|
@@ -5526,7 +5505,7 @@ function io({ entityId: e, sendStrategyRequest: t, className: n = "" }) {
|
|
|
5526
5505
|
s({ busy: !0 });
|
|
5527
5506
|
try {
|
|
5528
5507
|
let { token: t } = await q.createInvite(e, p);
|
|
5529
|
-
s({ url:
|
|
5508
|
+
s({ url: Bi(t) });
|
|
5530
5509
|
} catch (e) {
|
|
5531
5510
|
s({ error: e?.message || "Unable to create invite link" });
|
|
5532
5511
|
}
|
|
@@ -5605,7 +5584,7 @@ function io({ entityId: e, sendStrategyRequest: t, className: n = "" }) {
|
|
|
5605
5584
|
children: ro(e.name)
|
|
5606
5585
|
}, e.name))
|
|
5607
5586
|
}),
|
|
5608
|
-
r.subjectTypeIds.length > 0 && /* @__PURE__ */ d(
|
|
5587
|
+
r.subjectTypeIds.length > 0 && /* @__PURE__ */ d(ya, {
|
|
5609
5588
|
typeIds: r.subjectTypeIds,
|
|
5610
5589
|
exclude: r.grants.map((e) => e.subject_id),
|
|
5611
5590
|
labelFor: r.subjectLabel,
|
|
@@ -5837,7 +5816,7 @@ function So() {
|
|
|
5837
5816
|
return o(() => Object.fromEntries(e.keys().map((t) => [t, e.get(t).label])), [e]);
|
|
5838
5817
|
}
|
|
5839
5818
|
function Co({ current: e }) {
|
|
5840
|
-
let [, t] =
|
|
5819
|
+
let [, t] = Ya({}), n = So(), [r, i] = c(!1);
|
|
5841
5820
|
return /* @__PURE__ */ f("div", {
|
|
5842
5821
|
className: "pointer-events-none absolute bottom-1 right-1 z-10",
|
|
5843
5822
|
children: [/* @__PURE__ */ d("button", {
|
|
@@ -5848,7 +5827,7 @@ function Co({ current: e }) {
|
|
|
5848
5827
|
children: "⋯"
|
|
5849
5828
|
}), r && /* @__PURE__ */ d("div", {
|
|
5850
5829
|
className: "pointer-events-auto absolute bottom-full right-0 mb-1 w-64 nodrag",
|
|
5851
|
-
children: /* @__PURE__ */ d(
|
|
5830
|
+
children: /* @__PURE__ */ d(Ja, {
|
|
5852
5831
|
availableViewTypes: n,
|
|
5853
5832
|
selectedValue: e ?? "",
|
|
5854
5833
|
onSelect: (e) => {
|
|
@@ -5862,13 +5841,13 @@ function Co({ current: e }) {
|
|
|
5862
5841
|
});
|
|
5863
5842
|
}
|
|
5864
5843
|
function wo() {
|
|
5865
|
-
let [, e] =
|
|
5844
|
+
let [, e] = Ya({}), t = So();
|
|
5866
5845
|
return /* @__PURE__ */ f("div", {
|
|
5867
5846
|
className: "space-y-3 p-6",
|
|
5868
5847
|
children: [/* @__PURE__ */ d("h3", {
|
|
5869
5848
|
className: "text-sm font-semibold text-gray-900",
|
|
5870
5849
|
children: "Choose a view"
|
|
5871
|
-
}), /* @__PURE__ */ d(
|
|
5850
|
+
}), /* @__PURE__ */ d(Ja, {
|
|
5872
5851
|
availableViewTypes: t,
|
|
5873
5852
|
selectedValue: "",
|
|
5874
5853
|
onSelect: (t) => void e({}, t),
|
|
@@ -5905,8 +5884,8 @@ function To({ name: e, entityId: t, className: n }) {
|
|
|
5905
5884
|
});
|
|
5906
5885
|
}
|
|
5907
5886
|
function Eo({ entity: e, slot: t, className: n }) {
|
|
5908
|
-
let r =
|
|
5909
|
-
return /* @__PURE__ */ d(
|
|
5887
|
+
let r = pa(t ?? "entity", e.entity_id);
|
|
5888
|
+
return /* @__PURE__ */ d(ma, {
|
|
5910
5889
|
position: r,
|
|
5911
5890
|
children: /* @__PURE__ */ d(Do, {
|
|
5912
5891
|
entity: e,
|
|
@@ -5915,7 +5894,7 @@ function Eo({ entity: e, slot: t, className: n }) {
|
|
|
5915
5894
|
});
|
|
5916
5895
|
}
|
|
5917
5896
|
function Do({ entity: e, className: t }) {
|
|
5918
|
-
let n = ni(), r =
|
|
5897
|
+
let n = ni(), r = da()?.view;
|
|
5919
5898
|
if (r === void 0) return /* @__PURE__ */ d(bo, { label: "Loading view…" });
|
|
5920
5899
|
let i = yo(n, typeof r?.component == "string" ? r.component : null, e.entity_type_id);
|
|
5921
5900
|
return /* @__PURE__ */ d(To, {
|
|
@@ -5925,7 +5904,7 @@ function Do({ entity: e, className: t }) {
|
|
|
5925
5904
|
});
|
|
5926
5905
|
}
|
|
5927
5906
|
function Oo({ view: e, className: t }) {
|
|
5928
|
-
let n = ni(), r = o(() =>
|
|
5907
|
+
let n = ni(), r = o(() => aa(e.entity_id), [e.entity_id]), i = mr(r) ?? e, a = typeof i.renders == "string" ? i.renders : null, s = X(a), c = R((e) => a ? e.notFoundEntityIds.has(a) : !1), l = o(() => ({
|
|
5929
5908
|
position: r,
|
|
5930
5909
|
view: i
|
|
5931
5910
|
}), [r, i]), u;
|
|
@@ -5948,14 +5927,14 @@ function Oo({ view: e, className: t }) {
|
|
|
5948
5927
|
}
|
|
5949
5928
|
return /* @__PURE__ */ d(go, {
|
|
5950
5929
|
token: `view:${i.entity_id}`,
|
|
5951
|
-
children: /* @__PURE__ */ d(
|
|
5930
|
+
children: /* @__PURE__ */ d(ca.Provider, {
|
|
5952
5931
|
value: l,
|
|
5953
5932
|
children: u
|
|
5954
5933
|
})
|
|
5955
5934
|
});
|
|
5956
5935
|
}
|
|
5957
5936
|
function ko({ entityId: e, slot: t, className: n }) {
|
|
5958
|
-
let r = X(e), i =
|
|
5937
|
+
let r = X(e), i = R((t) => e ? t.notFoundEntityIds.has(e) : !1), a = ho();
|
|
5959
5938
|
return e ? r?.forbidden ? /* @__PURE__ */ d(xo, {
|
|
5960
5939
|
cause: "forbidden",
|
|
5961
5940
|
className: n
|
|
@@ -5977,12 +5956,12 @@ function ko({ entityId: e, slot: t, className: n }) {
|
|
|
5977
5956
|
//#endregion
|
|
5978
5957
|
//#region src/components/Entity/EntityRoute.tsx
|
|
5979
5958
|
var Ao = () => {
|
|
5980
|
-
let e = vi(C()), t = S(), { pathname: n } = x(), { isAuthenticated: r } = Jr(), { isConnected: i } =
|
|
5959
|
+
let e = vi(C()), t = S(), { pathname: n } = x(), { isAuthenticated: r } = Jr(), { isConnected: i } = qi();
|
|
5981
5960
|
return r ? i ? /* @__PURE__ */ d("div", {
|
|
5982
5961
|
className: "h-full min-h-0",
|
|
5983
5962
|
children: /* @__PURE__ */ d(Mi, {
|
|
5984
5963
|
address: n,
|
|
5985
|
-
children: /* @__PURE__ */ d(
|
|
5964
|
+
children: /* @__PURE__ */ d(ha, {
|
|
5986
5965
|
address: n,
|
|
5987
5966
|
children: /* @__PURE__ */ d(ko, {
|
|
5988
5967
|
entityId: e,
|
|
@@ -6025,7 +6004,7 @@ var Ao = () => {
|
|
|
6025
6004
|
});
|
|
6026
6005
|
}, Mo = /* @__PURE__ */ new Set(["/", "/e/{entity}"]), No = (e) => e.replace("{entity}", ":entityBackend/:entityLocal");
|
|
6027
6006
|
function Po({ viewName: e }) {
|
|
6028
|
-
let { pathname: t } = x(), { entityBackend: n, entityLocal: r } = C(), i = ni(), a = n && r ? `gc://${n}/${r}` : null, o = i.get(e) ?? (e === "home" ? i.get(
|
|
6007
|
+
let { pathname: t } = x(), { entityBackend: n, entityLocal: r } = C(), i = ni(), a = n && r ? `gc://${n}/${r}` : null, o = i.get(e) ?? (e === "home" ? i.get(no.viewName) : void 0), s;
|
|
6029
6008
|
return s = o ? /* @__PURE__ */ d(o, { entityId: a }) : a ? /* @__PURE__ */ d(ko, {
|
|
6030
6009
|
entityId: a,
|
|
6031
6010
|
className: "h-full"
|
|
@@ -6039,7 +6018,7 @@ function Po({ viewName: e }) {
|
|
|
6039
6018
|
]
|
|
6040
6019
|
}), /* @__PURE__ */ d(Mi, {
|
|
6041
6020
|
address: t,
|
|
6042
|
-
children: /* @__PURE__ */ d(
|
|
6021
|
+
children: /* @__PURE__ */ d(ha, {
|
|
6043
6022
|
address: t,
|
|
6044
6023
|
children: /* @__PURE__ */ d("div", {
|
|
6045
6024
|
className: "h-full min-h-0",
|
|
@@ -6049,7 +6028,7 @@ function Po({ viewName: e }) {
|
|
|
6049
6028
|
});
|
|
6050
6029
|
}
|
|
6051
6030
|
function Fo({ fallback: e = null }) {
|
|
6052
|
-
let t =
|
|
6031
|
+
let t = Ki();
|
|
6053
6032
|
return /* @__PURE__ */ f(y, { children: [
|
|
6054
6033
|
/* @__PURE__ */ d(v, {
|
|
6055
6034
|
index: !0,
|
|
@@ -6067,9 +6046,9 @@ function Fo({ fallback: e = null }) {
|
|
|
6067
6046
|
}
|
|
6068
6047
|
//#endregion
|
|
6069
6048
|
//#region src/components/Routes/GraphCoreApp.tsx
|
|
6070
|
-
function Io({ topBar: e = /* @__PURE__ */ d(
|
|
6071
|
-
let { isAuthenticated: t, principalEntityId: n } = Jr()
|
|
6072
|
-
return
|
|
6049
|
+
function Io({ topBar: e = /* @__PURE__ */ d(Ga, {}) }) {
|
|
6050
|
+
let { isAuthenticated: t, principalEntityId: n } = Jr();
|
|
6051
|
+
return !t || !n ? /* @__PURE__ */ d(Wi, {}) : /* @__PURE__ */ f(y, { children: [/* @__PURE__ */ d(v, {
|
|
6073
6052
|
path: mi,
|
|
6074
6053
|
element: /* @__PURE__ */ d("div", {
|
|
6075
6054
|
className: "h-screen w-screen overflow-hidden bg-gray-50",
|
|
@@ -6084,16 +6063,23 @@ function Io({ topBar: e = /* @__PURE__ */ d(za, {}) }) {
|
|
|
6084
6063
|
children: /* @__PURE__ */ d(_, {})
|
|
6085
6064
|
})]
|
|
6086
6065
|
}),
|
|
6087
|
-
children: [
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6066
|
+
children: [
|
|
6067
|
+
/* @__PURE__ */ d(v, {
|
|
6068
|
+
path: Ta.slice(1),
|
|
6069
|
+
element: /* @__PURE__ */ d("div", {
|
|
6070
|
+
className: "h-full overflow-auto",
|
|
6071
|
+
children: /* @__PURE__ */ d(Aa, {})
|
|
6072
|
+
})
|
|
6073
|
+
}),
|
|
6074
|
+
/* @__PURE__ */ d(v, {
|
|
6075
|
+
path: zi.slice(1),
|
|
6076
|
+
element: /* @__PURE__ */ d(Ui, {})
|
|
6077
|
+
}),
|
|
6078
|
+
/* @__PURE__ */ d(v, {
|
|
6079
|
+
path: "*",
|
|
6080
|
+
element: /* @__PURE__ */ d(Fo, { fallback: /* @__PURE__ */ d(jo, {}) })
|
|
6092
6081
|
})
|
|
6093
|
-
|
|
6094
|
-
path: "*",
|
|
6095
|
-
element: /* @__PURE__ */ d(Fo, { fallback: /* @__PURE__ */ d(jo, {}) })
|
|
6096
|
-
})]
|
|
6082
|
+
]
|
|
6097
6083
|
})] });
|
|
6098
6084
|
}
|
|
6099
6085
|
//#endregion
|
|
@@ -6135,7 +6121,7 @@ function Ho(e, t) {
|
|
|
6135
6121
|
return e === t || e.startsWith(`${t}/`);
|
|
6136
6122
|
}
|
|
6137
6123
|
function Uo({ pages: e, basePath: t }) {
|
|
6138
|
-
let n =
|
|
6124
|
+
let n = Ki();
|
|
6139
6125
|
return a(() => {
|
|
6140
6126
|
if (!n) return;
|
|
6141
6127
|
let r = Bo(e, n.map((e) => e.pattern), t);
|
|
@@ -6271,7 +6257,7 @@ var Ko = ({ attributeName: e, onConfirm: t, onCancel: n }) => /* @__PURE__ */ d(
|
|
|
6271
6257
|
});
|
|
6272
6258
|
};
|
|
6273
6259
|
function Yo({ entityId: e }) {
|
|
6274
|
-
let { sendStrategyRequest: t } =
|
|
6260
|
+
let { sendStrategyRequest: t } = qi();
|
|
6275
6261
|
if (!e) throw Error("This view needs an entity to show.");
|
|
6276
6262
|
let n = e, i = X(n), [l, u] = c(""), [p, m] = c(""), [h, g] = c(null), _ = s(/* @__PURE__ */ new Map());
|
|
6277
6263
|
a(() => () => {
|
|
@@ -6525,7 +6511,7 @@ function Yo({ entityId: e }) {
|
|
|
6525
6511
|
})
|
|
6526
6512
|
});
|
|
6527
6513
|
}
|
|
6528
|
-
var Xo =
|
|
6514
|
+
var Xo = ga("entity_attributes", (e) => /* @__PURE__ */ d(Yo, { ...e }, e.entityId)), Zo = (e) => `${e.slot ?? ""}@${e.entityId}`;
|
|
6529
6515
|
function Qo(e, t) {
|
|
6530
6516
|
let n = new Set(e.filter((e) => e.entityId === t).map((e) => e.slot));
|
|
6531
6517
|
if (!n.has(void 0)) return;
|
|
@@ -6534,7 +6520,7 @@ function Qo(e, t) {
|
|
|
6534
6520
|
return `panel${r}`;
|
|
6535
6521
|
}
|
|
6536
6522
|
function $o(e) {
|
|
6537
|
-
let [t, n] =
|
|
6523
|
+
let [t, n] = Ya(e), i = t.panels;
|
|
6538
6524
|
return {
|
|
6539
6525
|
state: t,
|
|
6540
6526
|
update: n,
|
|
@@ -6557,7 +6543,7 @@ function $o(e) {
|
|
|
6557
6543
|
};
|
|
6558
6544
|
}
|
|
6559
6545
|
function es({ onPick: e }) {
|
|
6560
|
-
let t =
|
|
6546
|
+
let t = Za(), [n, r] = c(!1);
|
|
6561
6547
|
return /* @__PURE__ */ f("div", {
|
|
6562
6548
|
className: "relative shrink-0",
|
|
6563
6549
|
children: [/* @__PURE__ */ d("button", {
|
|
@@ -6568,7 +6554,7 @@ function es({ onPick: e }) {
|
|
|
6568
6554
|
children: /* @__PURE__ */ d(Wn, { className: "h-4 w-4" })
|
|
6569
6555
|
}), n && t.length > 0 && /* @__PURE__ */ d("div", {
|
|
6570
6556
|
className: "absolute right-0 z-20 mt-1 w-72 rounded-lg border border-gray-200 bg-white p-2 shadow-lg nodrag",
|
|
6571
|
-
children: /* @__PURE__ */ d(
|
|
6557
|
+
children: /* @__PURE__ */ d(ya, {
|
|
6572
6558
|
typeIds: t,
|
|
6573
6559
|
onPick: (t) => {
|
|
6574
6560
|
r(!1), e(t.entity_id);
|
|
@@ -6627,7 +6613,7 @@ function rs({ direction: e }) {
|
|
|
6627
6613
|
}
|
|
6628
6614
|
//#endregion
|
|
6629
6615
|
//#region src/components/ViewEntity/CompositeView/CompositeHBox.tsx
|
|
6630
|
-
var is =
|
|
6616
|
+
var is = ga("composite_hbox", () => /* @__PURE__ */ d(rs, { direction: "row" })), as = ga("composite_vbox", () => /* @__PURE__ */ d(rs, { direction: "column" })), os = {
|
|
6631
6617
|
panels: [],
|
|
6632
6618
|
sizes: {},
|
|
6633
6619
|
active: null
|
|
@@ -6669,12 +6655,12 @@ function ss() {
|
|
|
6669
6655
|
})]
|
|
6670
6656
|
});
|
|
6671
6657
|
}
|
|
6672
|
-
var cs =
|
|
6658
|
+
var cs = ga("composite_tabs", ss);
|
|
6673
6659
|
//#endregion
|
|
6674
6660
|
//#region src/components/ViewEntity/ListEntity/ListView.tsx
|
|
6675
6661
|
function ls({ entityId: e }) {
|
|
6676
6662
|
if (!e) throw Error("This view needs an entity to show.");
|
|
6677
|
-
let { sendStrategyRequest: t } =
|
|
6663
|
+
let { sendStrategyRequest: t } = qi(), [n, r] = c(null), [i, s] = c(null), [l, u] = c(null), [p, m] = c(null), [h, g] = c(""), [_, v] = c(!1), y = X(e), b = Vr(e, {}), x = o(() => (b || []).filter((e) => e.entity_type_id !== Y.VIEW), [b]);
|
|
6678
6664
|
a(() => {
|
|
6679
6665
|
if (!n) return;
|
|
6680
6666
|
let e = (e) => {
|
|
@@ -6702,11 +6688,11 @@ function ls({ entityId: e }) {
|
|
|
6702
6688
|
N(n, t, r), A();
|
|
6703
6689
|
}, P = (e) => {
|
|
6704
6690
|
n === e && r(null), t($.detachChild(e));
|
|
6705
|
-
},
|
|
6691
|
+
}, ne = (e) => {
|
|
6706
6692
|
n === e && r(null), s(e);
|
|
6707
|
-
},
|
|
6693
|
+
}, F = () => {
|
|
6708
6694
|
i && (t($.deleteEntity(i)), s(null));
|
|
6709
|
-
},
|
|
6695
|
+
}, re = async () => {
|
|
6710
6696
|
let n = h.trim();
|
|
6711
6697
|
if (n && !_) {
|
|
6712
6698
|
v(!0);
|
|
@@ -6742,7 +6728,7 @@ function ls({ entityId: e }) {
|
|
|
6742
6728
|
value: h,
|
|
6743
6729
|
onChange: (e) => g(e.target.value),
|
|
6744
6730
|
onKeyDown: (e) => {
|
|
6745
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
6731
|
+
e.key === "Enter" && (e.preventDefault(), re());
|
|
6746
6732
|
},
|
|
6747
6733
|
placeholder: "New entity name…",
|
|
6748
6734
|
disabled: _,
|
|
@@ -6750,7 +6736,7 @@ function ls({ entityId: e }) {
|
|
|
6750
6736
|
}),
|
|
6751
6737
|
/* @__PURE__ */ d("button", {
|
|
6752
6738
|
type: "button",
|
|
6753
|
-
onClick:
|
|
6739
|
+
onClick: re,
|
|
6754
6740
|
disabled: !h.trim() || _,
|
|
6755
6741
|
className: "rounded-lg bg-blue-600 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-gray-200 disabled:text-gray-400",
|
|
6756
6742
|
children: _ ? "Creating…" : "+ New Entity"
|
|
@@ -6802,7 +6788,7 @@ function ls({ entityId: e }) {
|
|
|
6802
6788
|
className: "flex min-w-0 flex-1 items-center gap-2 text-left focus:outline-hidden focus:ring-2 focus:ring-inset focus:ring-blue-500",
|
|
6803
6789
|
children: [/* @__PURE__ */ d("div", {
|
|
6804
6790
|
className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-xs bg-gray-100 text-gray-500",
|
|
6805
|
-
children: /* @__PURE__ */ d(
|
|
6791
|
+
children: /* @__PURE__ */ d(Ka, {
|
|
6806
6792
|
entityTypeId: t.entity_type_id,
|
|
6807
6793
|
className: "h-3 w-3"
|
|
6808
6794
|
})
|
|
@@ -6828,7 +6814,7 @@ function ls({ entityId: e }) {
|
|
|
6828
6814
|
}), /* @__PURE__ */ d("button", {
|
|
6829
6815
|
type: "button",
|
|
6830
6816
|
onClick: (e) => {
|
|
6831
|
-
e.stopPropagation(),
|
|
6817
|
+
e.stopPropagation(), ne(n);
|
|
6832
6818
|
},
|
|
6833
6819
|
"aria-label": `Delete ${Z(t)}`,
|
|
6834
6820
|
title: "Delete entity",
|
|
@@ -6888,7 +6874,7 @@ function ls({ entityId: e }) {
|
|
|
6888
6874
|
children: "Cancel"
|
|
6889
6875
|
}), /* @__PURE__ */ d("button", {
|
|
6890
6876
|
type: "button",
|
|
6891
|
-
onClick:
|
|
6877
|
+
onClick: F,
|
|
6892
6878
|
className: "rounded-lg bg-red-600 px-4 py-2 text-sm text-white transition-colors hover:bg-red-700",
|
|
6893
6879
|
children: "Delete Entity"
|
|
6894
6880
|
})]
|
|
@@ -6931,7 +6917,7 @@ function ls({ entityId: e }) {
|
|
|
6931
6917
|
children: "Loading list..."
|
|
6932
6918
|
});
|
|
6933
6919
|
}
|
|
6934
|
-
var us =
|
|
6920
|
+
var us = ga("list_view", ls), ds = {
|
|
6935
6921
|
ENTITY_ID: "application/x-entity-id",
|
|
6936
6922
|
ENTITY_DATA: "application/x-entity-data",
|
|
6937
6923
|
SOURCE_CONTEXT: "application/x-source-context"
|
|
@@ -7052,7 +7038,7 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7052
7038
|
onClick: () => n(e),
|
|
7053
7039
|
className: "w-full text-left px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded-sm transition-colors flex items-center gap-2",
|
|
7054
7040
|
title: e,
|
|
7055
|
-
children: [/* @__PURE__ */ d(
|
|
7041
|
+
children: [/* @__PURE__ */ d(Ka, {
|
|
7056
7042
|
entityTypeId: e,
|
|
7057
7043
|
className: "w-4 h-4 shrink-0"
|
|
7058
7044
|
}), /* @__PURE__ */ d("span", {
|
|
@@ -7074,7 +7060,7 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7074
7060
|
className: "text-xs",
|
|
7075
7061
|
children: r ? "▼" : "▶"
|
|
7076
7062
|
}),
|
|
7077
|
-
/* @__PURE__ */ d(
|
|
7063
|
+
/* @__PURE__ */ d(Ka, {
|
|
7078
7064
|
entityTypeId: e,
|
|
7079
7065
|
className: "w-3.5 h-3.5 shrink-0"
|
|
7080
7066
|
}),
|
|
@@ -7092,79 +7078,79 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7092
7078
|
})
|
|
7093
7079
|
]
|
|
7094
7080
|
}), Ss = ({ entityId: e, parentId: t, selectedEntityId: n = null, onSelect: i, onDoubleClick: l, onPin: u, onDelete: p, onCreateChild: m, expandedEntities: h, onToggleExpanded: g, depth: _ = 0, onEntityMove: v, onEntityAdd: y, onRemoveChild: b, availableEntities: x = {}, allowCreate: S = !0, filterTypeIds: C = [], showDeleteAction: w = !0, showCreateChildAction: T = !0, ancestors: E = /* @__PURE__ */ new Set(), groupByEntityType: D = !0, revealEntityId: O, revealAncestors: k }) => {
|
|
7095
|
-
let ee = E.has(e), A = o(() => /* @__PURE__ */ new Set([...E, e]), [E, e]), j = X(e), [M, te] = c(!1), [P,
|
|
7081
|
+
let ee = E.has(e), A = o(() => /* @__PURE__ */ new Set([...E, e]), [E, e]), j = X(e), [M, te] = c(!1), [P, ne] = c(!1), [F, re] = c(null), [ie, ae] = c(!1), [oe, I] = c(/* @__PURE__ */ new Set()), [se, ce] = c(void 0), le = s(null), ue = s(null), de = s(null), fe = s(null), L = h.has(e), R = Vr(e, {
|
|
7096
7082
|
types: C,
|
|
7097
7083
|
enabled: !!j?.children_ids?.length
|
|
7098
|
-
}),
|
|
7099
|
-
if (O !==
|
|
7100
|
-
|
|
7084
|
+
}), z = R.length > 0, pe = L ? R : [];
|
|
7085
|
+
if (O !== se) {
|
|
7086
|
+
ce(O);
|
|
7101
7087
|
let e = /* @__PURE__ */ new Set();
|
|
7102
|
-
O && D &&
|
|
7088
|
+
O && D && R.forEach((t) => {
|
|
7103
7089
|
(t.entity_id === O || k?.has(t.entity_id)) && e.add(t.entity_type_id || "unknown");
|
|
7104
|
-
}),
|
|
7090
|
+
}), I(e);
|
|
7105
7091
|
}
|
|
7106
|
-
let
|
|
7092
|
+
let B = r(() => {
|
|
7107
7093
|
i?.(e);
|
|
7108
|
-
}, [e, i]),
|
|
7094
|
+
}, [e, i]), me = r(() => {
|
|
7109
7095
|
l(e);
|
|
7110
|
-
}, [e, l]),
|
|
7111
|
-
t.preventDefault(), t.stopPropagation(),
|
|
7096
|
+
}, [e, l]), he = r((t) => {
|
|
7097
|
+
t.preventDefault(), t.stopPropagation(), z && g(e);
|
|
7112
7098
|
}, [
|
|
7113
7099
|
e,
|
|
7114
|
-
|
|
7100
|
+
z,
|
|
7115
7101
|
g
|
|
7116
7102
|
]);
|
|
7117
7103
|
r(() => {
|
|
7118
7104
|
u && u(e);
|
|
7119
7105
|
}, [e, u]);
|
|
7120
|
-
let
|
|
7106
|
+
let V = o(() => {
|
|
7121
7107
|
let e = C.length > 0 ? new Set(C) : null;
|
|
7122
7108
|
return Object.entries(x).filter(([t]) => !e || e.has(t));
|
|
7123
|
-
}, [x, C]),
|
|
7124
|
-
if (t.stopPropagation(),
|
|
7125
|
-
let [t] =
|
|
7126
|
-
m && m(e, t),
|
|
7109
|
+
}, [x, C]), ge = o(() => Object.fromEntries(V), [V]), _e = r((t) => {
|
|
7110
|
+
if (t.stopPropagation(), L || g(e), V.length === 1) {
|
|
7111
|
+
let [t] = V[0];
|
|
7112
|
+
m && m(e, t), ne(!1);
|
|
7127
7113
|
return;
|
|
7128
7114
|
}
|
|
7129
7115
|
let n = !P;
|
|
7130
|
-
if (n &&
|
|
7131
|
-
let e =
|
|
7132
|
-
|
|
7116
|
+
if (n && ue.current) {
|
|
7117
|
+
let e = ue.current.getBoundingClientRect();
|
|
7118
|
+
re({
|
|
7133
7119
|
top: e.bottom + 4,
|
|
7134
7120
|
left: Math.max(8, Math.min(e.right - 256, window.innerWidth - 256 - 8))
|
|
7135
7121
|
});
|
|
7136
7122
|
}
|
|
7137
|
-
|
|
7123
|
+
ne(n);
|
|
7138
7124
|
}, [
|
|
7139
|
-
|
|
7125
|
+
V,
|
|
7140
7126
|
e,
|
|
7141
|
-
|
|
7127
|
+
L,
|
|
7142
7128
|
m,
|
|
7143
7129
|
g,
|
|
7144
7130
|
P
|
|
7145
|
-
]),
|
|
7146
|
-
|
|
7131
|
+
]), ve = r((t) => {
|
|
7132
|
+
L || g(e), m && m(e, t), ne(!1);
|
|
7147
7133
|
}, [
|
|
7148
7134
|
e,
|
|
7149
|
-
|
|
7135
|
+
L,
|
|
7150
7136
|
m,
|
|
7151
7137
|
g
|
|
7152
7138
|
]);
|
|
7153
7139
|
a(() => {
|
|
7154
7140
|
let e = (e) => {
|
|
7155
7141
|
let t = e.target;
|
|
7156
|
-
|
|
7142
|
+
le.current && !le.current.contains(t) && de.current && !de.current.contains(t) && ne(!1);
|
|
7157
7143
|
};
|
|
7158
7144
|
if (P) return document.addEventListener("mousedown", e), () => {
|
|
7159
7145
|
document.removeEventListener("mousedown", e);
|
|
7160
7146
|
};
|
|
7161
7147
|
}, [P]);
|
|
7162
|
-
let
|
|
7163
|
-
t.stopPropagation(), navigator.clipboard?.writeText(e),
|
|
7164
|
-
}, [e]),
|
|
7165
|
-
t.stopPropagation(), window.open(`${window.location.origin}${N(_i(e))}`, "_blank", "noopener,noreferrer"),
|
|
7166
|
-
}, [e]),
|
|
7167
|
-
n.stopPropagation(), t && b && b(e, t),
|
|
7148
|
+
let ye = r((t) => {
|
|
7149
|
+
t.stopPropagation(), navigator.clipboard?.writeText(e), ae(!1);
|
|
7150
|
+
}, [e]), be = r((t) => {
|
|
7151
|
+
t.stopPropagation(), window.open(`${window.location.origin}${N(_i(e))}`, "_blank", "noopener,noreferrer"), ae(!1);
|
|
7152
|
+
}, [e]), xe = r((n) => {
|
|
7153
|
+
n.stopPropagation(), t && b && b(e, t), ae(!1);
|
|
7168
7154
|
}, [
|
|
7169
7155
|
e,
|
|
7170
7156
|
b,
|
|
@@ -7172,13 +7158,13 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7172
7158
|
]);
|
|
7173
7159
|
a(() => {
|
|
7174
7160
|
let e = (e) => {
|
|
7175
|
-
|
|
7161
|
+
fe.current && !fe.current.contains(e.target) && ae(!1);
|
|
7176
7162
|
};
|
|
7177
|
-
if (
|
|
7163
|
+
if (ie) return document.addEventListener("mousedown", e), () => {
|
|
7178
7164
|
document.removeEventListener("mousedown", e);
|
|
7179
7165
|
};
|
|
7180
|
-
}, [
|
|
7181
|
-
let
|
|
7166
|
+
}, [ie]);
|
|
7167
|
+
let Se = r((n) => {
|
|
7182
7168
|
if (!j) return;
|
|
7183
7169
|
let r = j.entity_type_id, i = Z(j);
|
|
7184
7170
|
fs.startDrag(n, {
|
|
@@ -7194,7 +7180,7 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7194
7180
|
j,
|
|
7195
7181
|
e,
|
|
7196
7182
|
t
|
|
7197
|
-
]),
|
|
7183
|
+
]), H = ps({
|
|
7198
7184
|
dropEffect: "move",
|
|
7199
7185
|
onDrop: (t) => {
|
|
7200
7186
|
console.log("Entity dropped on EntityItem:", t, "target:", e), te(!1), t.entityId !== e && (t.sourceContext === "entity-explorer" && t.sourceParentId ? v?.(t.entityId, e, t.sourceParentId) : y?.(t.entityId, e));
|
|
@@ -7257,22 +7243,22 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7257
7243
|
draggable: !0,
|
|
7258
7244
|
className: `flex items-center gap-1.5 py-1 px-2 rounded text-sm transition-all cursor-grab select-none hover:bg-gray-100 text-gray-700 w-full ${W ? "bg-blue-50 border border-blue-200 text-blue-700" : ""} ${M ? "ring-2 ring-blue-500 ring-inset bg-blue-50" : ""}`,
|
|
7259
7245
|
style: Te,
|
|
7260
|
-
onClick:
|
|
7261
|
-
onDoubleClick:
|
|
7262
|
-
onDragStart:
|
|
7263
|
-
...
|
|
7246
|
+
onClick: B,
|
|
7247
|
+
onDoubleClick: me,
|
|
7248
|
+
onDragStart: Se,
|
|
7249
|
+
...H,
|
|
7264
7250
|
title: `${U} • ${we} • Double-click to open • Click pin to dock • Drag to move • Drop entities to add as children • ${e}`,
|
|
7265
7251
|
children: [
|
|
7266
|
-
|
|
7252
|
+
z && /* @__PURE__ */ d("div", {
|
|
7267
7253
|
className: "shrink-0 w-4 h-4 flex items-center justify-center text-xs text-gray-500 hover:text-gray-300 cursor-pointer",
|
|
7268
|
-
onClick:
|
|
7254
|
+
onClick: he,
|
|
7269
7255
|
title: "Click to expand/collapse",
|
|
7270
|
-
children:
|
|
7256
|
+
children: L ? "▼" : "▶"
|
|
7271
7257
|
}),
|
|
7272
|
-
!
|
|
7258
|
+
!z && /* @__PURE__ */ d("div", { className: "w-4 h-4 shrink-0" }),
|
|
7273
7259
|
/* @__PURE__ */ d("div", {
|
|
7274
7260
|
className: "shrink-0",
|
|
7275
|
-
children: /* @__PURE__ */ d(
|
|
7261
|
+
children: /* @__PURE__ */ d(Ka, {
|
|
7276
7262
|
entityTypeId: U,
|
|
7277
7263
|
className: "w-4 h-4"
|
|
7278
7264
|
})
|
|
@@ -7283,18 +7269,18 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7283
7269
|
}),
|
|
7284
7270
|
S && T && /* @__PURE__ */ f("div", {
|
|
7285
7271
|
className: "relative shrink-0",
|
|
7286
|
-
ref:
|
|
7272
|
+
ref: le,
|
|
7287
7273
|
children: [/* @__PURE__ */ d("button", {
|
|
7288
|
-
ref:
|
|
7289
|
-
onClick:
|
|
7274
|
+
ref: ue,
|
|
7275
|
+
onClick: _e,
|
|
7290
7276
|
className: "w-6 h-6 flex items-center justify-center text-xs text-gray-500 hover:text-blue-600 hover:bg-blue-50 rounded-sm transition-all",
|
|
7291
7277
|
title: "Add child entity",
|
|
7292
7278
|
children: "+"
|
|
7293
|
-
}), P &&
|
|
7294
|
-
ref:
|
|
7295
|
-
position:
|
|
7296
|
-
options:
|
|
7297
|
-
onSelect:
|
|
7279
|
+
}), P && F && /* @__PURE__ */ d(bs, {
|
|
7280
|
+
ref: de,
|
|
7281
|
+
position: F,
|
|
7282
|
+
options: ge,
|
|
7283
|
+
onSelect: ve
|
|
7298
7284
|
})]
|
|
7299
7285
|
}),
|
|
7300
7286
|
w && /* @__PURE__ */ d("button", {
|
|
@@ -7308,33 +7294,33 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7308
7294
|
}),
|
|
7309
7295
|
/* @__PURE__ */ f("div", {
|
|
7310
7296
|
className: "relative shrink-0",
|
|
7311
|
-
ref:
|
|
7297
|
+
ref: fe,
|
|
7312
7298
|
children: [/* @__PURE__ */ d("button", {
|
|
7313
7299
|
type: "button",
|
|
7314
7300
|
onClick: (e) => {
|
|
7315
|
-
e.stopPropagation(),
|
|
7301
|
+
e.stopPropagation(), ae((e) => !e);
|
|
7316
7302
|
},
|
|
7317
7303
|
className: "w-6 h-6 flex items-center justify-center text-xs text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-sm transition-all",
|
|
7318
7304
|
title: "More actions",
|
|
7319
7305
|
children: /* @__PURE__ */ d(Ln, { className: "w-3.5 h-3.5" })
|
|
7320
|
-
}),
|
|
7306
|
+
}), ie && /* @__PURE__ */ f("div", {
|
|
7321
7307
|
className: "absolute right-0 top-full mt-1 w-48 bg-white border border-gray-200 rounded-lg shadow-xl z-9999 p-1",
|
|
7322
7308
|
children: [
|
|
7323
7309
|
/* @__PURE__ */ f("button", {
|
|
7324
7310
|
type: "button",
|
|
7325
|
-
onClick:
|
|
7311
|
+
onClick: ye,
|
|
7326
7312
|
className: "w-full px-2 py-1.5 text-xs text-gray-700 hover:bg-gray-50 rounded-sm flex items-center gap-2",
|
|
7327
7313
|
children: [/* @__PURE__ */ d(Bn, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ d("span", { children: "Copy entity ID" })]
|
|
7328
7314
|
}),
|
|
7329
7315
|
/* @__PURE__ */ f("button", {
|
|
7330
7316
|
type: "button",
|
|
7331
|
-
onClick:
|
|
7317
|
+
onClick: be,
|
|
7332
7318
|
className: "w-full px-2 py-1.5 text-xs text-gray-700 hover:bg-gray-50 rounded-sm flex items-center gap-2",
|
|
7333
7319
|
children: [/* @__PURE__ */ d(Nn, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ d("span", { children: "Open in new tab" })]
|
|
7334
7320
|
}),
|
|
7335
7321
|
t && b && /* @__PURE__ */ f("button", {
|
|
7336
7322
|
type: "button",
|
|
7337
|
-
onClick:
|
|
7323
|
+
onClick: xe,
|
|
7338
7324
|
className: "w-full px-2 py-1.5 text-xs text-gray-700 hover:bg-red-50 hover:text-red-600 rounded-sm flex items-center gap-2",
|
|
7339
7325
|
children: [/* @__PURE__ */ d(Hn, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ d("span", { children: "Remove link from parent" })]
|
|
7340
7326
|
})
|
|
@@ -7342,21 +7328,21 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7342
7328
|
})]
|
|
7343
7329
|
})
|
|
7344
7330
|
]
|
|
7345
|
-
}),
|
|
7331
|
+
}), L && pe.length > 0 && /* @__PURE__ */ d("div", {
|
|
7346
7332
|
className: "mt-0.5 space-y-0.5",
|
|
7347
7333
|
children: D ? (() => {
|
|
7348
7334
|
let t = /* @__PURE__ */ new Map();
|
|
7349
|
-
return
|
|
7335
|
+
return pe.forEach((e) => {
|
|
7350
7336
|
let n = e.entity_type_id || "unknown";
|
|
7351
7337
|
t.has(n) || t.set(n, []), t.get(n).push(e);
|
|
7352
7338
|
}), Array.from(t.entries()).map(([t, r]) => {
|
|
7353
|
-
let a =
|
|
7339
|
+
let a = oe.has(t), o = x[t]?.name || t.split(".").pop() || t;
|
|
7354
7340
|
return /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d(xs, {
|
|
7355
7341
|
typeId: t,
|
|
7356
7342
|
typeName: o,
|
|
7357
7343
|
count: r.length,
|
|
7358
7344
|
isExpanded: a,
|
|
7359
|
-
onToggle: () =>
|
|
7345
|
+
onToggle: () => I((e) => {
|
|
7360
7346
|
let n = new Set(e);
|
|
7361
7347
|
return n.has(t) ? n.delete(t) : n.add(t), n;
|
|
7362
7348
|
}),
|
|
@@ -7387,7 +7373,7 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7387
7373
|
revealAncestors: k
|
|
7388
7374
|
}, t.entity_id))] }, t);
|
|
7389
7375
|
});
|
|
7390
|
-
})() :
|
|
7376
|
+
})() : pe.map((t) => /* @__PURE__ */ d(Ss, {
|
|
7391
7377
|
entityId: t.entity_id,
|
|
7392
7378
|
parentId: e,
|
|
7393
7379
|
onDoubleClick: l,
|
|
@@ -7414,21 +7400,21 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7414
7400
|
}, t.entity_id))
|
|
7415
7401
|
})]
|
|
7416
7402
|
});
|
|
7417
|
-
}, Cs =
|
|
7418
|
-
let { sendStrategyRequest: h } =
|
|
7403
|
+
}, Cs = ga("entity_explorer", ({ entityId: e, uiHooks: t, onEntityDelete: n, onEntityOpen: i, onEntitySelect: l, onEntityPin: p, explorerConfig: m }) => {
|
|
7404
|
+
let { sendStrategyRequest: h } = qi(), g = e || "", [_, v] = Ya({}), y = na(), b = y.state === "hasValue" ? y.contents : {};
|
|
7419
7405
|
a(() => {
|
|
7420
|
-
|
|
7406
|
+
ea();
|
|
7421
7407
|
}, []);
|
|
7422
7408
|
let { onEntityOpen: x, onEntityPin: S, onEntitySelect: C } = t || {}, T = i ?? x, E = p ?? S, D = l ?? C, O = m?.allow_create ?? !0, k = m?.title || "Explorer", ee = m?.show_delete_action ?? !0, A = m?.show_create_child_action ?? !0, j = m?.group_by_entity_type ?? !0, M = m?.reveal_entity_id ?? null, N = o(() => {
|
|
7423
7409
|
let e = _s(Array.isArray(m?.filter_entity_types) ? m.filter_entity_types : []);
|
|
7424
7410
|
return e.length > 0 ? e : ys(b);
|
|
7425
|
-
}, [m?.filter_entity_types, b]), te = o(() => _s(Array.isArray(_.explorer_active_filter_entity_types) ? _.explorer_active_filter_entity_types : []), [_.explorer_active_filter_entity_types]), P = Array.isArray(_.explorer_active_filter_entity_types) ? te : N,
|
|
7411
|
+
}, [m?.filter_entity_types, b]), te = o(() => _s(Array.isArray(_.explorer_active_filter_entity_types) ? _.explorer_active_filter_entity_types : []), [_.explorer_active_filter_entity_types]), P = Array.isArray(_.explorer_active_filter_entity_types) ? te : N, ne = !e, F = Zi({
|
|
7426
7412
|
typeIds: o(() => P.length > 0 ? P : Object.keys(b).sort(), [P, b]),
|
|
7427
7413
|
where: hs,
|
|
7428
|
-
enabled:
|
|
7429
|
-
}), [
|
|
7430
|
-
|
|
7431
|
-
let t =
|
|
7414
|
+
enabled: ne
|
|
7415
|
+
}), [re, ie] = c(null), ae = s(null), oe = s(null), I = r(() => {
|
|
7416
|
+
ie((e) => {
|
|
7417
|
+
let t = ae.current?.getBoundingClientRect();
|
|
7432
7418
|
return e || !t ? null : {
|
|
7433
7419
|
top: t.bottom + 4,
|
|
7434
7420
|
left: Math.max(8, Math.min(t.left, window.innerWidth - 256 - 8))
|
|
@@ -7436,76 +7422,76 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7436
7422
|
});
|
|
7437
7423
|
}, []);
|
|
7438
7424
|
a(() => {
|
|
7439
|
-
if (!
|
|
7425
|
+
if (!re) return;
|
|
7440
7426
|
let e = (e) => {
|
|
7441
7427
|
let t = e.target;
|
|
7442
|
-
!
|
|
7428
|
+
!oe.current?.contains(t) && !ae.current?.contains(t) && ie(null);
|
|
7443
7429
|
};
|
|
7444
7430
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
7445
|
-
}, [
|
|
7446
|
-
let
|
|
7431
|
+
}, [re]);
|
|
7432
|
+
let se = o(() => Object.fromEntries(Object.entries(b).filter(([e]) => P.length === 0 || P.includes(e))), [b, P]), [ce, le] = c(!1), [ue, de] = c(""), [fe, L] = c(null), R = s(null);
|
|
7447
7433
|
a(() => {
|
|
7448
|
-
if (!
|
|
7434
|
+
if (!ce) return;
|
|
7449
7435
|
let e = (e) => {
|
|
7450
|
-
|
|
7436
|
+
R.current && !R.current.contains(e.target) && le(!1);
|
|
7451
7437
|
};
|
|
7452
7438
|
return document.addEventListener("mousedown", e), () => {
|
|
7453
7439
|
document.removeEventListener("mousedown", e);
|
|
7454
7440
|
};
|
|
7455
|
-
}, [
|
|
7456
|
-
let
|
|
7457
|
-
let e =
|
|
7441
|
+
}, [ce]);
|
|
7442
|
+
let pe = o(() => {
|
|
7443
|
+
let e = ue.trim().toLowerCase();
|
|
7458
7444
|
return e ? Object.entries(b).filter(([t, n]) => String(n?.name || t).toLowerCase().includes(e) || String(t).toLowerCase().includes(e)) : Object.entries(b);
|
|
7459
|
-
}, [b,
|
|
7445
|
+
}, [b, ue]), B = r((e) => {
|
|
7460
7446
|
v({ explorer_active_filter_entity_types: e });
|
|
7461
|
-
}, [v]),
|
|
7447
|
+
}, [v]), me = r((e) => {
|
|
7462
7448
|
T?.(e, g);
|
|
7463
|
-
}, [T, g]),
|
|
7464
|
-
|
|
7465
|
-
}, [D, g]),
|
|
7449
|
+
}, [T, g]), he = r((e) => {
|
|
7450
|
+
L(e), D?.(e, g);
|
|
7451
|
+
}, [D, g]), V = r((e) => {
|
|
7466
7452
|
E?.(e, g);
|
|
7467
|
-
}, [E, g]),
|
|
7453
|
+
}, [E, g]), ge = r((e) => {
|
|
7468
7454
|
U(e);
|
|
7469
|
-
}, []),
|
|
7455
|
+
}, []), _e = r((e, t, n) => {
|
|
7470
7456
|
if (console.log("Moving entity:", e, "from:", n, "to:", t), e === t || n === t) return;
|
|
7471
7457
|
let r = $.reparentChild(e, t);
|
|
7472
7458
|
h(r);
|
|
7473
|
-
}, [h]),
|
|
7459
|
+
}, [h]), ve = r((e, t) => {
|
|
7474
7460
|
if (console.log("Adding entity:", e, "to:", t), e === t) return;
|
|
7475
7461
|
let n = $.reparentChild(e, t);
|
|
7476
7462
|
h(n);
|
|
7477
|
-
}, [h]),
|
|
7463
|
+
}, [h]), ye = r(async (e, t) => {
|
|
7478
7464
|
try {
|
|
7479
7465
|
let n = (await Promise.resolve(h($.createEntity(e, t), { awaitResponse: !0 })))?.child_entity;
|
|
7480
|
-
n && (e &&
|
|
7466
|
+
n && (e && Se((t) => new Set(t).add(e)), L(n), D?.(n, e ?? ""));
|
|
7481
7467
|
} catch (e) {
|
|
7482
7468
|
console.error("Failed to create entity:", e);
|
|
7483
7469
|
}
|
|
7484
|
-
}, [D, h]),
|
|
7470
|
+
}, [D, h]), be = r((e, t) => {
|
|
7485
7471
|
console.log("Removing child:", e, "from parent:", t);
|
|
7486
7472
|
let n = $.detachChild(e);
|
|
7487
7473
|
h(n);
|
|
7488
|
-
}, [h]), [
|
|
7474
|
+
}, [h]), [xe, Se] = c(/* @__PURE__ */ new Set([g])), [H, U] = c(null), W = X(g), Ce = X(H || g), we = o(() => !H || !Ce ? "this entity" : Z(Ce), [H, Ce]), Te = o(() => {
|
|
7489
7475
|
if (!M) return /* @__PURE__ */ new Set();
|
|
7490
7476
|
let e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(), n = [M];
|
|
7491
7477
|
for (; n.length > 0;) {
|
|
7492
7478
|
let r = n.shift();
|
|
7493
7479
|
if (t.has(r)) continue;
|
|
7494
7480
|
if (t.add(r), r === g) break;
|
|
7495
|
-
let i =
|
|
7481
|
+
let i = z.readEntity(r);
|
|
7496
7482
|
for (let r of i?.parent_ids ?? []) r && !t.has(r) && (e.add(r), n.push(r));
|
|
7497
7483
|
}
|
|
7498
7484
|
return e;
|
|
7499
7485
|
}, [M, g]);
|
|
7500
7486
|
a(() => {
|
|
7501
|
-
M && (
|
|
7487
|
+
M && (Se((e) => /* @__PURE__ */ new Set([...e, ...Te])), L(M));
|
|
7502
7488
|
}, [M, Te]);
|
|
7503
7489
|
let Ee = r((e) => {
|
|
7504
|
-
|
|
7490
|
+
Se((t) => {
|
|
7505
7491
|
let n = new Set(t);
|
|
7506
7492
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
7507
7493
|
});
|
|
7508
|
-
}, []), De = o(() =>
|
|
7494
|
+
}, []), De = o(() => H ? /* @__PURE__ */ f("div", {
|
|
7509
7495
|
className: "fixed inset-0 z-9999 flex items-center justify-center",
|
|
7510
7496
|
children: [/* @__PURE__ */ d("div", {
|
|
7511
7497
|
className: "absolute inset-0 bg-black/50",
|
|
@@ -7552,7 +7538,7 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7552
7538
|
}), /* @__PURE__ */ d("button", {
|
|
7553
7539
|
type: "button",
|
|
7554
7540
|
onClick: async () => {
|
|
7555
|
-
let e =
|
|
7541
|
+
let e = H;
|
|
7556
7542
|
U(null);
|
|
7557
7543
|
try {
|
|
7558
7544
|
await h($.deleteEntity(e), { awaitResponse: !0 }), n?.(e);
|
|
@@ -7565,12 +7551,12 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7565
7551
|
]
|
|
7566
7552
|
})]
|
|
7567
7553
|
}) : null, [
|
|
7568
|
-
|
|
7554
|
+
H,
|
|
7569
7555
|
we,
|
|
7570
7556
|
n,
|
|
7571
7557
|
h
|
|
7572
7558
|
]);
|
|
7573
|
-
return !
|
|
7559
|
+
return !ne && !W ? /* @__PURE__ */ f("div", {
|
|
7574
7560
|
className: "p-4 text-center text-gray-500 text-sm",
|
|
7575
7561
|
children: [
|
|
7576
7562
|
/* @__PURE__ */ d(Un, { className: "w-6 h-6 mb-2 mx-auto text-red-500" }),
|
|
@@ -7591,31 +7577,31 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7591
7577
|
children: [/* @__PURE__ */ d(Fn, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ d("span", { children: k })]
|
|
7592
7578
|
}), /* @__PURE__ */ f("div", {
|
|
7593
7579
|
className: "flex items-center gap-1.5",
|
|
7594
|
-
children: [
|
|
7595
|
-
ref:
|
|
7580
|
+
children: [ne && O && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("button", {
|
|
7581
|
+
ref: ae,
|
|
7596
7582
|
type: "button",
|
|
7597
|
-
onClick:
|
|
7583
|
+
onClick: I,
|
|
7598
7584
|
className: "px-2 py-1 text-xs bg-white hover:bg-gray-50 text-gray-700 border border-gray-200 rounded-lg transition-colors",
|
|
7599
7585
|
title: "Create a top-level entity",
|
|
7600
7586
|
children: "+ New"
|
|
7601
|
-
}),
|
|
7602
|
-
ref:
|
|
7603
|
-
position:
|
|
7604
|
-
options:
|
|
7587
|
+
}), re && /* @__PURE__ */ d(bs, {
|
|
7588
|
+
ref: oe,
|
|
7589
|
+
position: re,
|
|
7590
|
+
options: se,
|
|
7605
7591
|
onSelect: (e) => {
|
|
7606
|
-
|
|
7592
|
+
ie(null), ye(null, e);
|
|
7607
7593
|
}
|
|
7608
7594
|
})] }), /* @__PURE__ */ f("div", {
|
|
7609
7595
|
className: "relative",
|
|
7610
|
-
ref:
|
|
7596
|
+
ref: R,
|
|
7611
7597
|
children: [/* @__PURE__ */ f("button", {
|
|
7612
7598
|
onClick: () => {
|
|
7613
|
-
|
|
7599
|
+
le((e) => !e), de("");
|
|
7614
7600
|
},
|
|
7615
7601
|
className: "px-2 py-1 text-xs bg-white hover:bg-gray-50 text-gray-700 border border-gray-200 rounded-lg transition-colors flex items-center gap-1",
|
|
7616
7602
|
title: "Explorer filter settings",
|
|
7617
7603
|
children: [/* @__PURE__ */ d(kn, { className: "w-3 h-3" }), /* @__PURE__ */ d("span", { children: "Settings" })]
|
|
7618
|
-
}),
|
|
7604
|
+
}), ce && /* @__PURE__ */ f("div", {
|
|
7619
7605
|
className: "absolute right-0 top-full mt-1 w-56 max-w-[calc(100vw-1rem)] bg-white border border-gray-200 rounded-lg shadow-xl z-9999",
|
|
7620
7606
|
children: [
|
|
7621
7607
|
/* @__PURE__ */ d("div", {
|
|
@@ -7626,8 +7612,8 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7626
7612
|
className: "p-2 border-b border-gray-200",
|
|
7627
7613
|
children: /* @__PURE__ */ d("input", {
|
|
7628
7614
|
type: "text",
|
|
7629
|
-
value:
|
|
7630
|
-
onChange: (e) =>
|
|
7615
|
+
value: ue,
|
|
7616
|
+
onChange: (e) => de(e.target.value),
|
|
7631
7617
|
placeholder: "Search types...",
|
|
7632
7618
|
className: "w-full px-2 py-1 text-xs bg-white text-gray-900 border border-gray-300 rounded-sm focus:outline-hidden focus:ring-1 focus:ring-blue-500 placeholder-gray-500"
|
|
7633
7619
|
})
|
|
@@ -7637,18 +7623,18 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7637
7623
|
children: [/* @__PURE__ */ d("button", {
|
|
7638
7624
|
type: "button",
|
|
7639
7625
|
className: "px-2 py-1 text-xs border border-gray-200 rounded-sm hover:bg-gray-50",
|
|
7640
|
-
onClick: () =>
|
|
7626
|
+
onClick: () => B([]),
|
|
7641
7627
|
children: "Show all"
|
|
7642
7628
|
}), /* @__PURE__ */ d("button", {
|
|
7643
7629
|
type: "button",
|
|
7644
7630
|
className: "px-2 py-1 text-xs border border-gray-200 rounded-sm hover:bg-gray-50",
|
|
7645
|
-
onClick: () =>
|
|
7631
|
+
onClick: () => B(N),
|
|
7646
7632
|
children: "Reset default"
|
|
7647
7633
|
})]
|
|
7648
7634
|
}),
|
|
7649
7635
|
/* @__PURE__ */ f("div", {
|
|
7650
7636
|
className: "max-h-64 overflow-auto p-2 space-y-1",
|
|
7651
|
-
children: [
|
|
7637
|
+
children: [pe.map(([e, t]) => {
|
|
7652
7638
|
let n = P.includes(e);
|
|
7653
7639
|
return /* @__PURE__ */ f("label", {
|
|
7654
7640
|
className: "flex items-center gap-2 text-xs text-gray-700 cursor-pointer",
|
|
@@ -7658,10 +7644,10 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7658
7644
|
checked: n,
|
|
7659
7645
|
onChange: () => {
|
|
7660
7646
|
let t = P.includes(e) ? P.filter((t) => t !== e) : [...P, e];
|
|
7661
|
-
|
|
7647
|
+
B(t);
|
|
7662
7648
|
}
|
|
7663
7649
|
}),
|
|
7664
|
-
/* @__PURE__ */ d(
|
|
7650
|
+
/* @__PURE__ */ d(Ka, {
|
|
7665
7651
|
entityTypeId: e,
|
|
7666
7652
|
className: "w-3.5 h-3.5"
|
|
7667
7653
|
}),
|
|
@@ -7671,7 +7657,7 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7671
7657
|
})
|
|
7672
7658
|
]
|
|
7673
7659
|
}, e);
|
|
7674
|
-
}),
|
|
7660
|
+
}), pe.length === 0 && /* @__PURE__ */ d("div", {
|
|
7675
7661
|
className: "text-xs text-gray-500 px-1 py-1",
|
|
7676
7662
|
children: "No matching entity types"
|
|
7677
7663
|
})]
|
|
@@ -7680,21 +7666,21 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7680
7666
|
})]
|
|
7681
7667
|
})]
|
|
7682
7668
|
})]
|
|
7683
|
-
}),
|
|
7684
|
-
|
|
7669
|
+
}), ne ? /* @__PURE__ */ f(u, { children: [
|
|
7670
|
+
F.ids.map((e) => /* @__PURE__ */ d(Ss, {
|
|
7685
7671
|
entityId: e,
|
|
7686
7672
|
parentId: void 0,
|
|
7687
|
-
selectedEntityId:
|
|
7688
|
-
onSelect:
|
|
7689
|
-
onDoubleClick:
|
|
7690
|
-
onPin:
|
|
7691
|
-
onDelete:
|
|
7692
|
-
onCreateChild:
|
|
7693
|
-
expandedEntities:
|
|
7673
|
+
selectedEntityId: fe,
|
|
7674
|
+
onSelect: he,
|
|
7675
|
+
onDoubleClick: me,
|
|
7676
|
+
onPin: V,
|
|
7677
|
+
onDelete: ge,
|
|
7678
|
+
onCreateChild: ye,
|
|
7679
|
+
expandedEntities: xe,
|
|
7694
7680
|
onToggleExpanded: Ee,
|
|
7695
|
-
onEntityMove:
|
|
7696
|
-
onEntityAdd:
|
|
7697
|
-
onRemoveChild:
|
|
7681
|
+
onEntityMove: _e,
|
|
7682
|
+
onEntityAdd: ve,
|
|
7683
|
+
onRemoveChild: be,
|
|
7698
7684
|
availableEntities: b,
|
|
7699
7685
|
allowCreate: O,
|
|
7700
7686
|
filterTypeIds: P,
|
|
@@ -7705,31 +7691,31 @@ var bs = e.forwardRef(({ position: e, options: t, onSelect: n }, r) => {
|
|
|
7705
7691
|
revealAncestors: Te,
|
|
7706
7692
|
depth: 0
|
|
7707
7693
|
}, e)),
|
|
7708
|
-
|
|
7694
|
+
F.ids.length === 0 && !F.loading && /* @__PURE__ */ d("div", {
|
|
7709
7695
|
className: "px-2 py-1 text-xs text-gray-500",
|
|
7710
7696
|
children: "No top-level entities"
|
|
7711
7697
|
}),
|
|
7712
|
-
|
|
7698
|
+
F.hasMore && /* @__PURE__ */ d("button", {
|
|
7713
7699
|
type: "button",
|
|
7714
|
-
onClick:
|
|
7715
|
-
disabled:
|
|
7700
|
+
onClick: F.loadMore,
|
|
7701
|
+
disabled: F.loading,
|
|
7716
7702
|
className: "mt-1 w-full px-2 py-1 text-xs text-gray-500 hover:text-gray-900 hover:bg-gray-50 rounded-sm",
|
|
7717
|
-
children:
|
|
7703
|
+
children: F.loading ? "Loading…" : "Load more"
|
|
7718
7704
|
})
|
|
7719
7705
|
] }) : /* @__PURE__ */ d(Ss, {
|
|
7720
7706
|
entityId: g,
|
|
7721
7707
|
parentId: void 0,
|
|
7722
|
-
selectedEntityId:
|
|
7723
|
-
onSelect:
|
|
7724
|
-
onDoubleClick:
|
|
7725
|
-
onPin:
|
|
7726
|
-
onDelete:
|
|
7727
|
-
onCreateChild:
|
|
7728
|
-
expandedEntities:
|
|
7708
|
+
selectedEntityId: fe,
|
|
7709
|
+
onSelect: he,
|
|
7710
|
+
onDoubleClick: me,
|
|
7711
|
+
onPin: V,
|
|
7712
|
+
onDelete: ge,
|
|
7713
|
+
onCreateChild: ye,
|
|
7714
|
+
expandedEntities: xe,
|
|
7729
7715
|
onToggleExpanded: Ee,
|
|
7730
|
-
onEntityMove:
|
|
7731
|
-
onEntityAdd:
|
|
7732
|
-
onRemoveChild:
|
|
7716
|
+
onEntityMove: _e,
|
|
7717
|
+
onEntityAdd: ve,
|
|
7718
|
+
onRemoveChild: be,
|
|
7733
7719
|
availableEntities: b,
|
|
7734
7720
|
allowCreate: O,
|
|
7735
7721
|
filterTypeIds: P,
|
|
@@ -7780,7 +7766,7 @@ function Os(e) {
|
|
|
7780
7766
|
}), n;
|
|
7781
7767
|
}
|
|
7782
7768
|
function ks({ entityId: e, sidebarConfig: t, rootEntityId: n, explorerTitle: i, uiHooks: a }) {
|
|
7783
|
-
let [s, c] =
|
|
7769
|
+
let [s, c] = Ya(ws), l = {
|
|
7784
7770
|
...s.sidebar_config || {},
|
|
7785
7771
|
...t || {}
|
|
7786
7772
|
}, u = n || s.root_entity_id || e || null, p = !!l.allow_create, m = o(() => Os(Array.isArray(l.filter_entity_types) ? l.filter_entity_types : []), [l.filter_entity_types]), h = o(() => Array.isArray(s.open_tab_entity_ids) ? s.open_tab_entity_ids.filter((e) => typeof e == "string") : [], [s.open_tab_entity_ids]), g = typeof s.active_tab_entity_id == "string" ? s.active_tab_entity_id : null, _ = r((e, t) => {
|
|
@@ -7871,7 +7857,7 @@ var As = ({ entityId: e, isActive: t, onSelect: n, onClose: r }) => {
|
|
|
7871
7857
|
className: `group flex items-center gap-2 px-3 py-2 border-r border-gray-200 text-sm max-w-72 ${t ? "bg-white text-gray-900" : "bg-gray-50 text-gray-600 hover:bg-gray-100"}`,
|
|
7872
7858
|
title: a,
|
|
7873
7859
|
children: [
|
|
7874
|
-
/* @__PURE__ */ d(
|
|
7860
|
+
/* @__PURE__ */ d(Ka, {
|
|
7875
7861
|
entityTypeId: i?.entity_type_id,
|
|
7876
7862
|
className: "w-3.5 h-3.5 shrink-0"
|
|
7877
7863
|
}),
|
|
@@ -7889,13 +7875,13 @@ var As = ({ entityId: e, isActive: t, onSelect: n, onClose: r }) => {
|
|
|
7889
7875
|
})
|
|
7890
7876
|
]
|
|
7891
7877
|
});
|
|
7892
|
-
}, js =
|
|
7878
|
+
}, js = ga("entity_ide", ks);
|
|
7893
7879
|
//#endregion
|
|
7894
7880
|
//#region src/registry/viewRegistry.ts
|
|
7895
7881
|
function Ms() {
|
|
7896
7882
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], r = {
|
|
7897
7883
|
register(n) {
|
|
7898
|
-
if (!
|
|
7884
|
+
if (!_a(n)) throw Error("ViewRegistry.register takes a component declared with defineView");
|
|
7899
7885
|
let r = n.viewName;
|
|
7900
7886
|
if (e.has(r)) throw Error(`ViewRegistry: a view named "${r}" is already registered`);
|
|
7901
7887
|
for (let e of n.defaultFor) {
|
|
@@ -7906,7 +7892,7 @@ function Ms() {
|
|
|
7906
7892
|
for (let e of n.defaultFor) t.set(e, r);
|
|
7907
7893
|
},
|
|
7908
7894
|
use(e) {
|
|
7909
|
-
for (let t of Object.values(e.exports))
|
|
7895
|
+
for (let t of Object.values(e.exports)) _a(t) && (r.register(t), t.entry && n.push({
|
|
7910
7896
|
app: e.app,
|
|
7911
7897
|
viewKey: t.viewName
|
|
7912
7898
|
}));
|
|
@@ -7938,9 +7924,9 @@ var Ns = {
|
|
|
7938
7924
|
ListView: us,
|
|
7939
7925
|
EntityExplorer: Cs,
|
|
7940
7926
|
EntityIDE: js,
|
|
7941
|
-
GroupView:
|
|
7942
|
-
ViewGallery:
|
|
7927
|
+
GroupView: Sa,
|
|
7928
|
+
ViewGallery: no
|
|
7943
7929
|
}
|
|
7944
7930
|
};
|
|
7945
7931
|
//#endregion
|
|
7946
|
-
export {
|
|
7932
|
+
export { Ta as ADMIN_ROUTE, io as AccessPanel, Aa as AdminPanel, Mi as AgentMirror, Fo as AppRoutes, Wi as AuthPage, po as BaseEntity, is as CompositeHBox, cs as CompositeTabs, as as CompositeVBox, mi as ENTITY_ROUTE, Xo as EntityAttributesView, Cs as EntityExplorer, js as EntityIDE, jo as EntityLinkRedirect, ya as EntityPicker, Ao as EntityRoute, ko as EntityView, Io as GraphCoreApp, Li as GraphCoreProvider, Go as GraphCoreRouter, Sa as GroupView, zi as INVITE_ROUTE, Ui as InviteRoute, us as ListView, ge as StrategyError, $ as StrategyRequests, Ga as TopBar, no as ViewGallery, dn as allOf, fn as anyOf, Ns as baseViews, co as collectPages, un as containsAny, ln as containsValue, Ms as createViewRegistry, ao as definePage, ga as defineView, Ir as entityGraph, vi as entityIdFromParams, _i as entityPath, sn as equal, yi as findEntityId, Wr as getAttr, Ur as getAttributes, M as getBasePath, Z as getDisplayName, Gr as getFields, cn as inValues, Bi as inviteUrl, xe as onResync, Bo as pageCollisions, Kr as typeShortName, wa as useAccess, Jr as useAuth, V as useBridgeStatus, Vr as useChildren, Xa as useCreateView, Zr as useDeploymentEntityId, Br as useEntities, X as useEntity, Zi as useEntityQuery, Lr as useGraphCoreBridge, Ba as useIsDeploymentAdmin, Ri as useOffersRegistration, Hi as usePendingInvite, Hr as useRecursiveChildren, Rr as useStrategyRequest, ni as useViewRegistry, Ya as useViewState, qi as useWebSocketConsumer, N as webPath };
|