@superinterface/react 3.9.1 → 3.9.2
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/cloud.cjs +613 -0
- package/dist/cloud.cjs.map +1 -0
- package/dist/cloud.d.cts +13 -0
- package/dist/cloud.d.ts +13 -0
- package/dist/cloud.js +543 -0
- package/dist/cloud.js.map +1 -0
- package/dist/index-CmzywRJS.d.cts +19 -0
- package/dist/index-CmzywRJS.d.ts +19 -0
- package/dist/index.cjs +34 -399
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -22
- package/dist/index.d.ts +4 -22
- package/dist/index.js +26 -387
- package/dist/index.js.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +1 -1
package/dist/cloud.js
ADDED
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
// src/components/annotations/SourceAnnotation/index.tsx
|
|
2
|
+
function _array_like_to_array(arr, len) {
|
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5
|
+
return arr2;
|
|
6
|
+
}
|
|
7
|
+
function _array_with_holes(arr) {
|
|
8
|
+
if (Array.isArray(arr)) return arr;
|
|
9
|
+
}
|
|
10
|
+
function _iterable_to_array_limit(arr, i) {
|
|
11
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
12
|
+
if (_i == null) return;
|
|
13
|
+
var _arr = [];
|
|
14
|
+
var _n = true;
|
|
15
|
+
var _d = false;
|
|
16
|
+
var _s, _e;
|
|
17
|
+
try {
|
|
18
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
19
|
+
_arr.push(_s.value);
|
|
20
|
+
if (i && _arr.length === i) break;
|
|
21
|
+
}
|
|
22
|
+
} catch (err) {
|
|
23
|
+
_d = true;
|
|
24
|
+
_e = err;
|
|
25
|
+
} finally{
|
|
26
|
+
try {
|
|
27
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
28
|
+
} finally{
|
|
29
|
+
if (_d) throw _e;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return _arr;
|
|
33
|
+
}
|
|
34
|
+
function _non_iterable_rest() {
|
|
35
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
36
|
+
}
|
|
37
|
+
function _sliced_to_array(arr, i) {
|
|
38
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
39
|
+
}
|
|
40
|
+
function _type_of(obj) {
|
|
41
|
+
"@swc/helpers - typeof";
|
|
42
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
43
|
+
}
|
|
44
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
45
|
+
if (!o) return;
|
|
46
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
47
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
48
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
49
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
50
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
51
|
+
}
|
|
52
|
+
import { c as _c4 } from "react-compiler-runtime";
|
|
53
|
+
// src/components/annotations/FilePathAnnotation.tsx
|
|
54
|
+
import { c as _c } from "react-compiler-runtime";
|
|
55
|
+
// src/hooks/core/useSuperinterfaceContext/index.ts
|
|
56
|
+
import { useContext } from "react";
|
|
57
|
+
// src/contexts/core/SuperinterfaceContext/index.tsx
|
|
58
|
+
import { createContext } from "react";
|
|
59
|
+
// src/lib/superinterfaceCloud/baseUrl.ts
|
|
60
|
+
var baseUrl = "https://superinterface.ai/api/cloud";
|
|
61
|
+
// src/lib/threadIdStorage/cookieOptions/get.ts
|
|
62
|
+
import Cookies from "js-cookie";
|
|
63
|
+
// src/lib/threadIdStorage/key.ts
|
|
64
|
+
var key = function(_ref) {
|
|
65
|
+
var assistantId = _ref.assistantId;
|
|
66
|
+
return "superinterface-".concat(assistantId, "-threadId");
|
|
67
|
+
};
|
|
68
|
+
// src/lib/threadIdStorage/cookieOptions/get.ts
|
|
69
|
+
var get = function(_ref) {
|
|
70
|
+
var _Cookies$get;
|
|
71
|
+
var assistantId = _ref.assistantId;
|
|
72
|
+
return (_Cookies$get = Cookies.get(key({
|
|
73
|
+
assistantId: assistantId
|
|
74
|
+
}))) !== null && _Cookies$get !== void 0 ? _Cookies$get : null;
|
|
75
|
+
};
|
|
76
|
+
// src/lib/threadIdStorage/cookieOptions/set.ts
|
|
77
|
+
import Cookies2 from "js-cookie";
|
|
78
|
+
var set = function(_ref) {
|
|
79
|
+
var assistantId = _ref.assistantId, threadId = _ref.threadId;
|
|
80
|
+
return Cookies2.set(key({
|
|
81
|
+
assistantId: assistantId
|
|
82
|
+
}), threadId);
|
|
83
|
+
};
|
|
84
|
+
// src/lib/threadIdStorage/cookieOptions/remove.ts
|
|
85
|
+
import Cookies3 from "js-cookie";
|
|
86
|
+
var remove = function(_ref) {
|
|
87
|
+
var assistantId = _ref.assistantId;
|
|
88
|
+
return Cookies3.remove(key({
|
|
89
|
+
assistantId: assistantId
|
|
90
|
+
}));
|
|
91
|
+
};
|
|
92
|
+
// src/lib/threadIdStorage/cookieOptions/index.ts
|
|
93
|
+
var cookieOptions = {
|
|
94
|
+
get: get,
|
|
95
|
+
set: set,
|
|
96
|
+
remove: remove
|
|
97
|
+
};
|
|
98
|
+
// src/lib/threadIdStorage/localStorageOptions/get.ts
|
|
99
|
+
var get2 = function(_ref) {
|
|
100
|
+
var assistantId = _ref.assistantId;
|
|
101
|
+
return window.localStorage.getItem(key({
|
|
102
|
+
assistantId: assistantId
|
|
103
|
+
}));
|
|
104
|
+
};
|
|
105
|
+
// src/lib/threadIdStorage/localStorageOptions/set.ts
|
|
106
|
+
var set2 = function(_ref) {
|
|
107
|
+
var assistantId = _ref.assistantId, threadId = _ref.threadId;
|
|
108
|
+
return window.localStorage.setItem(key({
|
|
109
|
+
assistantId: assistantId
|
|
110
|
+
}), threadId);
|
|
111
|
+
};
|
|
112
|
+
// src/lib/threadIdStorage/localStorageOptions/remove.ts
|
|
113
|
+
var remove2 = function(_ref) {
|
|
114
|
+
var assistantId = _ref.assistantId;
|
|
115
|
+
return window.localStorage.removeItem(key({
|
|
116
|
+
assistantId: assistantId
|
|
117
|
+
}));
|
|
118
|
+
};
|
|
119
|
+
// src/lib/threadIdStorage/localStorageOptions/index.ts
|
|
120
|
+
var localStorageOptions = {
|
|
121
|
+
get: get2,
|
|
122
|
+
set: set2,
|
|
123
|
+
remove: remove2
|
|
124
|
+
};
|
|
125
|
+
// src/lib/iframes/isIframe.ts
|
|
126
|
+
var isIframe = function() {
|
|
127
|
+
if (typeof window === "undefined") return false;
|
|
128
|
+
return window.self !== window.top;
|
|
129
|
+
};
|
|
130
|
+
// src/contexts/core/SuperinterfaceContext/index.tsx
|
|
131
|
+
var SuperinterfaceContext = /* @__PURE__ */ createContext({
|
|
132
|
+
baseUrl: baseUrl,
|
|
133
|
+
variables: {},
|
|
134
|
+
defaultOptions: {
|
|
135
|
+
queries: {},
|
|
136
|
+
mutations: {}
|
|
137
|
+
},
|
|
138
|
+
threadIdStorageOptions: isIframe() ? localStorageOptions : cookieOptions,
|
|
139
|
+
createMessageAbortControllerRef: {
|
|
140
|
+
current: null
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
// src/hooks/core/useSuperinterfaceContext/index.ts
|
|
144
|
+
var useSuperinterfaceContext = function() {
|
|
145
|
+
return useContext(SuperinterfaceContext);
|
|
146
|
+
};
|
|
147
|
+
// src/contexts/markdown/MarkdownContext/lib/components/Link.tsx
|
|
148
|
+
import { Link as RadixLink } from "@radix-ui/themes";
|
|
149
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
150
|
+
var Link = function(_ref) {
|
|
151
|
+
var children = _ref.children, href = _ref.href, download = _ref.download, _ref_target = _ref.target, target = _ref_target === void 0 ? "_blank" : _ref_target;
|
|
152
|
+
return /* @__PURE__ */ _jsx(RadixLink, {
|
|
153
|
+
href: href,
|
|
154
|
+
target: target,
|
|
155
|
+
download: download,
|
|
156
|
+
children: children
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
// src/components/annotations/FilePathAnnotation.tsx
|
|
160
|
+
import { jsx as _jsx2 } from "react/jsx-runtime";
|
|
161
|
+
var FilePathAnnotation = function(t0) {
|
|
162
|
+
var $ = _c(3);
|
|
163
|
+
var annotation = t0.annotation, children = t0.children;
|
|
164
|
+
var superinterfaceContext = useSuperinterfaceContext();
|
|
165
|
+
var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);
|
|
166
|
+
var t1 = "".concat(superinterfaceContext.baseUrl, "/files/").concat(annotation.file_path.file_id, "/contents?").concat(nextSearchParams);
|
|
167
|
+
var t2;
|
|
168
|
+
if ($[0] !== children || $[1] !== t1) {
|
|
169
|
+
t2 = /* @__PURE__ */ _jsx2(Link, {
|
|
170
|
+
href: t1,
|
|
171
|
+
target: "_self",
|
|
172
|
+
download: true,
|
|
173
|
+
children: children
|
|
174
|
+
});
|
|
175
|
+
$[0] = children;
|
|
176
|
+
$[1] = t1;
|
|
177
|
+
$[2] = t2;
|
|
178
|
+
} else {
|
|
179
|
+
t2 = $[2];
|
|
180
|
+
}
|
|
181
|
+
return t2;
|
|
182
|
+
};
|
|
183
|
+
// src/components/annotations/SourceAnnotation/FileCitation/index.tsx
|
|
184
|
+
import { c as _c3 } from "react-compiler-runtime";
|
|
185
|
+
import { useState } from "react";
|
|
186
|
+
import { QuoteIcon } from "@radix-ui/react-icons";
|
|
187
|
+
import { Dialog, VisuallyHidden, IconButton as IconButton2 } from "@radix-ui/themes";
|
|
188
|
+
// src/components/annotations/SourceAnnotation/FileCitation/Content/index.tsx
|
|
189
|
+
import { c as _c2 } from "react-compiler-runtime";
|
|
190
|
+
import { Flex as Flex2, Card as Card2, Inset } from "@radix-ui/themes";
|
|
191
|
+
import { usePDFSlick } from "@pdfslick/react";
|
|
192
|
+
import "@pdfslick/react/dist/pdf_viewer.css";
|
|
193
|
+
// src/components/annotations/SourceAnnotation/FileCitation/Content/Navigation.tsx
|
|
194
|
+
import { Card, IconButton, Flex } from "@radix-ui/themes";
|
|
195
|
+
import { ZoomInIcon, ZoomOutIcon } from "@radix-ui/react-icons";
|
|
196
|
+
import { jsx as _jsx3, jsxs as _jsxs } from "react/jsx-runtime";
|
|
197
|
+
var Navigation = function(_ref) {
|
|
198
|
+
var usePDFSlickStore = _ref.usePDFSlickStore;
|
|
199
|
+
var pdfSlick = usePDFSlickStore(function(s) {
|
|
200
|
+
return s.pdfSlick;
|
|
201
|
+
});
|
|
202
|
+
return /* @__PURE__ */ _jsx3(Flex, {
|
|
203
|
+
justify: "center",
|
|
204
|
+
position: "absolute",
|
|
205
|
+
bottom: "var(--space-2)",
|
|
206
|
+
left: "0",
|
|
207
|
+
right: "0",
|
|
208
|
+
style: {
|
|
209
|
+
zIndex: 99999
|
|
210
|
+
},
|
|
211
|
+
children: /* @__PURE__ */ _jsx3(Card, {
|
|
212
|
+
children: /* @__PURE__ */ _jsxs(Flex, {
|
|
213
|
+
gap: "2",
|
|
214
|
+
children: [
|
|
215
|
+
/* @__PURE__ */ _jsx3(IconButton, {
|
|
216
|
+
variant: "soft",
|
|
217
|
+
onClick: function() {
|
|
218
|
+
var _pdfSlick$viewer;
|
|
219
|
+
return pdfSlick === null || pdfSlick === void 0 || (_pdfSlick$viewer = pdfSlick.viewer) === null || _pdfSlick$viewer === void 0 ? void 0 : _pdfSlick$viewer.decreaseScale();
|
|
220
|
+
},
|
|
221
|
+
children: /* @__PURE__ */ _jsx3(ZoomOutIcon, {})
|
|
222
|
+
}),
|
|
223
|
+
/* @__PURE__ */ _jsx3(IconButton, {
|
|
224
|
+
variant: "soft",
|
|
225
|
+
onClick: function() {
|
|
226
|
+
var _pdfSlick$viewer2;
|
|
227
|
+
return pdfSlick === null || pdfSlick === void 0 || (_pdfSlick$viewer2 = pdfSlick.viewer) === null || _pdfSlick$viewer2 === void 0 ? void 0 : _pdfSlick$viewer2.increaseScale();
|
|
228
|
+
},
|
|
229
|
+
children: /* @__PURE__ */ _jsx3(ZoomInIcon, {})
|
|
230
|
+
})
|
|
231
|
+
]
|
|
232
|
+
})
|
|
233
|
+
})
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
// src/components/annotations/SourceAnnotation/FileCitation/Content/index.tsx
|
|
237
|
+
import { jsx as _jsx4, jsxs as _jsxs2 } from "react/jsx-runtime";
|
|
238
|
+
function ownKeys(e, r) {
|
|
239
|
+
var t = Object.keys(e);
|
|
240
|
+
if (Object.getOwnPropertySymbols) {
|
|
241
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
242
|
+
r && (o = o.filter(function(r2) {
|
|
243
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
244
|
+
})), t.push.apply(t, o);
|
|
245
|
+
}
|
|
246
|
+
return t;
|
|
247
|
+
}
|
|
248
|
+
function _objectSpread(e) {
|
|
249
|
+
for(var r = 1; r < arguments.length; r++){
|
|
250
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
251
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
252
|
+
_defineProperty(e, r2, t[r2]);
|
|
253
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
254
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
return e;
|
|
258
|
+
}
|
|
259
|
+
function _defineProperty(e, r, t) {
|
|
260
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
261
|
+
value: t,
|
|
262
|
+
enumerable: true,
|
|
263
|
+
configurable: true,
|
|
264
|
+
writable: true
|
|
265
|
+
}) : e[r] = t, e;
|
|
266
|
+
}
|
|
267
|
+
function _toPropertyKey(t) {
|
|
268
|
+
var i = _toPrimitive(t, "string");
|
|
269
|
+
return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
|
|
270
|
+
}
|
|
271
|
+
function _toPrimitive(t, r) {
|
|
272
|
+
if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
|
|
273
|
+
var e = t[Symbol.toPrimitive];
|
|
274
|
+
if (void 0 !== e) {
|
|
275
|
+
var i = e.call(t, r || "default");
|
|
276
|
+
if ("object" != (typeof i === "undefined" ? "undefined" : _type_of(i))) return i;
|
|
277
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
278
|
+
}
|
|
279
|
+
return ("string" === r ? String : Number)(t);
|
|
280
|
+
}
|
|
281
|
+
var Content = function(t0) {
|
|
282
|
+
var $ = _c2(14);
|
|
283
|
+
var fileId = t0.fileId;
|
|
284
|
+
var superinterfaceContext = useSuperinterfaceContext();
|
|
285
|
+
var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);
|
|
286
|
+
var t1;
|
|
287
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
288
|
+
t1 = {
|
|
289
|
+
scaleValue: "page-width",
|
|
290
|
+
removePageBorders: true
|
|
291
|
+
};
|
|
292
|
+
$[0] = t1;
|
|
293
|
+
} else {
|
|
294
|
+
t1 = $[0];
|
|
295
|
+
}
|
|
296
|
+
var _usePDFSlick = usePDFSlick("".concat(superinterfaceContext.baseUrl, "/api/cloud/files/").concat(fileId, "/contents?").concat(nextSearchParams), t1), viewerRef = _usePDFSlick.viewerRef, usePDFSlickStore = _usePDFSlick.usePDFSlickStore, PDFSlickViewer = _usePDFSlick.PDFSlickViewer;
|
|
297
|
+
var t2;
|
|
298
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
299
|
+
t2 = {
|
|
300
|
+
display: "flex",
|
|
301
|
+
flexGrow: "1"
|
|
302
|
+
};
|
|
303
|
+
$[1] = t2;
|
|
304
|
+
} else {
|
|
305
|
+
t2 = $[1];
|
|
306
|
+
}
|
|
307
|
+
var t3;
|
|
308
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
309
|
+
t3 = {
|
|
310
|
+
display: "flex",
|
|
311
|
+
flexGrow: "1"
|
|
312
|
+
};
|
|
313
|
+
$[2] = t3;
|
|
314
|
+
} else {
|
|
315
|
+
t3 = $[2];
|
|
316
|
+
}
|
|
317
|
+
var t4;
|
|
318
|
+
if ($[3] !== usePDFSlickStore || $[4] !== viewerRef) {
|
|
319
|
+
t4 = {
|
|
320
|
+
viewerRef: viewerRef,
|
|
321
|
+
usePDFSlickStore: usePDFSlickStore
|
|
322
|
+
};
|
|
323
|
+
$[3] = usePDFSlickStore;
|
|
324
|
+
$[4] = viewerRef;
|
|
325
|
+
$[5] = t4;
|
|
326
|
+
} else {
|
|
327
|
+
t4 = $[5];
|
|
328
|
+
}
|
|
329
|
+
var t5;
|
|
330
|
+
if ($[6] !== PDFSlickViewer || $[7] !== t4) {
|
|
331
|
+
t5 = /* @__PURE__ */ _jsx4(PDFSlickViewer, _objectSpread({}, t4));
|
|
332
|
+
$[6] = PDFSlickViewer;
|
|
333
|
+
$[7] = t4;
|
|
334
|
+
$[8] = t5;
|
|
335
|
+
} else {
|
|
336
|
+
t5 = $[8];
|
|
337
|
+
}
|
|
338
|
+
var t6;
|
|
339
|
+
if ($[9] !== usePDFSlickStore) {
|
|
340
|
+
t6 = /* @__PURE__ */ _jsx4(Navigation, {
|
|
341
|
+
usePDFSlickStore: usePDFSlickStore
|
|
342
|
+
});
|
|
343
|
+
$[9] = usePDFSlickStore;
|
|
344
|
+
$[10] = t6;
|
|
345
|
+
} else {
|
|
346
|
+
t6 = $[10];
|
|
347
|
+
}
|
|
348
|
+
var t7;
|
|
349
|
+
if ($[11] !== t5 || $[12] !== t6) {
|
|
350
|
+
t7 = /* @__PURE__ */ _jsx4(Flex2, {
|
|
351
|
+
direction: "column",
|
|
352
|
+
flexGrow: "1",
|
|
353
|
+
gap: "3",
|
|
354
|
+
children: /* @__PURE__ */ _jsx4(Card2, {
|
|
355
|
+
style: t2,
|
|
356
|
+
children: /* @__PURE__ */ _jsx4(Inset, {
|
|
357
|
+
clip: "padding-box",
|
|
358
|
+
style: t3,
|
|
359
|
+
children: /* @__PURE__ */ _jsxs2(Flex2, {
|
|
360
|
+
flexGrow: "1",
|
|
361
|
+
position: "relative",
|
|
362
|
+
children: [
|
|
363
|
+
t5,
|
|
364
|
+
t6
|
|
365
|
+
]
|
|
366
|
+
})
|
|
367
|
+
})
|
|
368
|
+
})
|
|
369
|
+
});
|
|
370
|
+
$[11] = t5;
|
|
371
|
+
$[12] = t6;
|
|
372
|
+
$[13] = t7;
|
|
373
|
+
} else {
|
|
374
|
+
t7 = $[13];
|
|
375
|
+
}
|
|
376
|
+
return t7;
|
|
377
|
+
};
|
|
378
|
+
// src/components/annotations/SourceAnnotation/FileCitation/index.tsx
|
|
379
|
+
import { jsx as _jsx5, jsxs as _jsxs3, Fragment as _Fragment } from "react/jsx-runtime";
|
|
380
|
+
var FileCitation = function(t0) {
|
|
381
|
+
var $ = _c3(18);
|
|
382
|
+
var annotation = t0.annotation;
|
|
383
|
+
var _useState = _sliced_to_array(useState(null), 2), activeFileId = _useState[0], setActiveFileId = _useState[1];
|
|
384
|
+
var t1;
|
|
385
|
+
if ($[0] !== annotation.file_citation.file_id) {
|
|
386
|
+
t1 = function() {
|
|
387
|
+
setActiveFileId(annotation.file_citation.file_id);
|
|
388
|
+
};
|
|
389
|
+
$[0] = annotation.file_citation.file_id;
|
|
390
|
+
$[1] = t1;
|
|
391
|
+
} else {
|
|
392
|
+
t1 = $[1];
|
|
393
|
+
}
|
|
394
|
+
var t2;
|
|
395
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
396
|
+
t2 = /* @__PURE__ */ _jsx5(QuoteIcon, {});
|
|
397
|
+
$[2] = t2;
|
|
398
|
+
} else {
|
|
399
|
+
t2 = $[2];
|
|
400
|
+
}
|
|
401
|
+
var t3;
|
|
402
|
+
if ($[3] !== t1) {
|
|
403
|
+
t3 = /* @__PURE__ */ _jsx5(IconButton2, {
|
|
404
|
+
variant: "soft",
|
|
405
|
+
color: "gray",
|
|
406
|
+
size: "1",
|
|
407
|
+
onClick: t1,
|
|
408
|
+
children: t2
|
|
409
|
+
});
|
|
410
|
+
$[3] = t1;
|
|
411
|
+
$[4] = t3;
|
|
412
|
+
} else {
|
|
413
|
+
t3 = $[4];
|
|
414
|
+
}
|
|
415
|
+
var t4 = !!activeFileId;
|
|
416
|
+
var t5;
|
|
417
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
418
|
+
t5 = function(open) {
|
|
419
|
+
if (!open) {
|
|
420
|
+
setActiveFileId(null);
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
$[5] = t5;
|
|
424
|
+
} else {
|
|
425
|
+
t5 = $[5];
|
|
426
|
+
}
|
|
427
|
+
var t6;
|
|
428
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
429
|
+
t6 = {
|
|
430
|
+
display: "flex",
|
|
431
|
+
flexDirection: "column"
|
|
432
|
+
};
|
|
433
|
+
$[6] = t6;
|
|
434
|
+
} else {
|
|
435
|
+
t6 = $[6];
|
|
436
|
+
}
|
|
437
|
+
var t7;
|
|
438
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
439
|
+
t7 = /* @__PURE__ */ _jsx5(VisuallyHidden, {
|
|
440
|
+
asChild: true,
|
|
441
|
+
children: /* @__PURE__ */ _jsx5(Dialog.Title, {
|
|
442
|
+
children: "Source"
|
|
443
|
+
})
|
|
444
|
+
});
|
|
445
|
+
$[7] = t7;
|
|
446
|
+
} else {
|
|
447
|
+
t7 = $[7];
|
|
448
|
+
}
|
|
449
|
+
var t8;
|
|
450
|
+
if ($[8] !== activeFileId) {
|
|
451
|
+
t8 = activeFileId && /* @__PURE__ */ _jsx5(Content, {
|
|
452
|
+
fileId: activeFileId
|
|
453
|
+
});
|
|
454
|
+
$[8] = activeFileId;
|
|
455
|
+
$[9] = t8;
|
|
456
|
+
} else {
|
|
457
|
+
t8 = $[9];
|
|
458
|
+
}
|
|
459
|
+
var t9;
|
|
460
|
+
if ($[10] !== t8) {
|
|
461
|
+
t9 = /* @__PURE__ */ _jsxs3(Dialog.Content, {
|
|
462
|
+
width: "1000px",
|
|
463
|
+
height: "90vh",
|
|
464
|
+
maxWidth: "calc(100vw - 2 * var(--space-4))",
|
|
465
|
+
"aria-describedby": void 0,
|
|
466
|
+
style: t6,
|
|
467
|
+
children: [
|
|
468
|
+
t7,
|
|
469
|
+
t8
|
|
470
|
+
]
|
|
471
|
+
});
|
|
472
|
+
$[10] = t8;
|
|
473
|
+
$[11] = t9;
|
|
474
|
+
} else {
|
|
475
|
+
t9 = $[11];
|
|
476
|
+
}
|
|
477
|
+
var t10;
|
|
478
|
+
if ($[12] !== t4 || $[13] !== t9) {
|
|
479
|
+
t10 = /* @__PURE__ */ _jsx5(Dialog.Root, {
|
|
480
|
+
open: t4,
|
|
481
|
+
onOpenChange: t5,
|
|
482
|
+
children: t9
|
|
483
|
+
});
|
|
484
|
+
$[12] = t4;
|
|
485
|
+
$[13] = t9;
|
|
486
|
+
$[14] = t10;
|
|
487
|
+
} else {
|
|
488
|
+
t10 = $[14];
|
|
489
|
+
}
|
|
490
|
+
var t11;
|
|
491
|
+
if ($[15] !== t10 || $[16] !== t3) {
|
|
492
|
+
t11 = /* @__PURE__ */ _jsxs3(_Fragment, {
|
|
493
|
+
children: [
|
|
494
|
+
t3,
|
|
495
|
+
t10
|
|
496
|
+
]
|
|
497
|
+
});
|
|
498
|
+
$[15] = t10;
|
|
499
|
+
$[16] = t3;
|
|
500
|
+
$[17] = t11;
|
|
501
|
+
} else {
|
|
502
|
+
t11 = $[17];
|
|
503
|
+
}
|
|
504
|
+
return t11;
|
|
505
|
+
};
|
|
506
|
+
// src/components/annotations/SourceAnnotation/index.tsx
|
|
507
|
+
import { jsx as _jsx6 } from "react/jsx-runtime";
|
|
508
|
+
var SourceAnnotation = function(t0) {
|
|
509
|
+
var $ = _c4(5);
|
|
510
|
+
var annotation = t0.annotation, children = t0.children;
|
|
511
|
+
if (annotation.type === "file_citation") {
|
|
512
|
+
var t1;
|
|
513
|
+
if ($[0] !== annotation) {
|
|
514
|
+
t1 = /* @__PURE__ */ _jsx6(FileCitation, {
|
|
515
|
+
annotation: annotation
|
|
516
|
+
});
|
|
517
|
+
$[0] = annotation;
|
|
518
|
+
$[1] = t1;
|
|
519
|
+
} else {
|
|
520
|
+
t1 = $[1];
|
|
521
|
+
}
|
|
522
|
+
return t1;
|
|
523
|
+
} else {
|
|
524
|
+
if (annotation.type === "file_path") {
|
|
525
|
+
var _t;
|
|
526
|
+
if ($[2] !== annotation || $[3] !== children) {
|
|
527
|
+
_t = /* @__PURE__ */ _jsx6(FilePathAnnotation, {
|
|
528
|
+
annotation: annotation,
|
|
529
|
+
children: children
|
|
530
|
+
});
|
|
531
|
+
$[2] = annotation;
|
|
532
|
+
$[3] = children;
|
|
533
|
+
$[4] = _t;
|
|
534
|
+
} else {
|
|
535
|
+
_t = $[4];
|
|
536
|
+
}
|
|
537
|
+
return _t;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return null;
|
|
541
|
+
};
|
|
542
|
+
export { SourceAnnotation };
|
|
543
|
+
//# sourceMappingURL=cloud.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/domas/Developer/supercorp/superinterface/packages/react/dist/cloud.js","../src/components/annotations/SourceAnnotation/index.tsx","../src/components/annotations/FilePathAnnotation.tsx","../src/hooks/core/useSuperinterfaceContext/index.ts","../src/contexts/core/SuperinterfaceContext/index.tsx","../src/lib/superinterfaceCloud/baseUrl.ts","../src/lib/threadIdStorage/cookieOptions/get.ts","../src/lib/threadIdStorage/key.ts","../src/lib/threadIdStorage/cookieOptions/set.ts","../src/lib/threadIdStorage/cookieOptions/remove.ts","../src/lib/threadIdStorage/cookieOptions/index.ts","../src/lib/threadIdStorage/localStorageOptions/get.ts","../src/lib/threadIdStorage/localStorageOptions/set.ts","../src/lib/threadIdStorage/localStorageOptions/remove.ts","../src/lib/threadIdStorage/localStorageOptions/index.ts","../src/lib/iframes/isIframe.ts","../src/contexts/markdown/MarkdownContext/lib/components/Link.tsx","../src/components/annotations/SourceAnnotation/FileCitation/index.tsx","../src/components/annotations/SourceAnnotation/FileCitation/Content/index.tsx","../src/components/annotations/SourceAnnotation/FileCitation/Content/Navigation.tsx"],"names":["c","_c","useContext","createContext","baseUrl","Cookies","key","_ref","assistantId","concat","get","_Cookies$get","set","threadId","remove","cookieOptions","window","localStorage","getItem","setItem","removeItem","localStorageOptions","isIframe","self","top","SuperinterfaceContext","variables","defaultOptions","queries","mutations","threadIdStorageOptions","createMessageAbortControllerRef","current","useSuperinterfaceContext","Link","RadixLink","jsx","_jsx","children","href","download","target","FilePathAnnotation","t0","$","annotation","superinterfaceContext","nextSearchParams","URLSearchParams","t1","file_path","file_id","t2","useState","QuoteIcon","Dialog","VisuallyHidden","IconButton","Flex","Card","Inset","usePDFSlick","ZoomInIcon","ZoomOutIcon","jsxs","_jsxs","Navigation","usePDFSlickStore","pdfSlick","s","justify","position","bottom","left","right","style","zIndex","gap","variant","onClick","_pdfSlick$viewer","viewer","decreaseScale","_pdfSlick$viewer2","increaseScale","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","Content","fileId","for","scaleValue","removePageBorders","viewerRef","PDFSlickViewer","display","flexGrow","t3","t4","t5","t6","t7","direction","clip","Fragment","_Fragment","FileCitation","activeFileId","setActiveFileId","file_citation","color","size","open","flexDirection","asChild","Title","t8","t9","width","height","maxWidth","t10","Root","onOpenChange","t11","SourceAnnotation","type","_t"],"mappings":"AAAA,wDAAwD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAxD,SAASA,KAAKC,GAAAA,QAAU,yBAAA;ADGxB,oDAAoD;AEDpD,SAASD,KAAKC,EAAA,QAAU,yBAAA;AFIxB,mDAAmD;AGJnD,SAASC,UAAA,QAAkB,QAAA;AHO3B,oDAAoD;AIPpD,SAASC,aAAA,QAAqB,QAAA;AJU9B,yCAAyC;AKZlC,IAAIC,UAAU;ALerB,+CAA+C;AMf/C,OAAOC,aAAa,YAAA;ANkBpB,iCAAiC;AOlB1B,IAAIC,MAAM,SAAAC;IACf,IAAI,AACFC,cACED,KADFC;IAEF,OAAO,kBAAkBC,MAAA,CAAOD,aAAa;AAC/C;APqBA,+CAA+C;AMxBxC,IAAIE,MAAM,SAAAH;IACf,IAAII;IACJ,IAAI,AACFH,cACED,KADFC;IAEF,OAAA,AAAQG,CAAAA,eAAeN,QAAQK,GAAA,CAAIJ,IAAI;QACrCE,aAAAA;IACF,GAAE,MAAO,QAAQG,iBAAiB,KAAA,IAASA,eAAe;AAC5D;AN2BA,+CAA+C;AQrC/C,OAAON,cAAa,YAAA;AAEb,IAAIO,MAAM,SAAAL;IACf,IACEC,cAEED,KAFFC,aACAK,WACEN,KADFM;IAEF,OAAOR,SAAQO,GAAA,CAAIN,IAAI;QACrBE,aAAAA;IACF,IAAIK;AACN;ARuCA,kDAAkD;ASjDlD,OAAOR,cAAa,YAAA;AAEb,IAAIS,SAAS,SAAAP;IAClB,IAAI,AACFC,cACED,KADFC;IAEF,OAAOH,SAAQS,MAAA,CAAOR,IAAI;Q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ACRnF,CAAA,CAAE,GAAE,GAAI8G;IACV,OAAO;QACLA,MAAM9G,CAAA,CAAE,GAAE;IACZ;IACA,OAAO8G;AACT;AjB8WA,wDAAwD;AC5exD,SAAStH,OAAOC,KAAAA,QAAY,oBAAA;AACrB,IAAIsH,mBAAmB,SAAAhH;IAC5B,IAAIC,IAAI3C,IAAG;IACX,IACE4C,aAEEF,GAFFE,YACAP,WACEK,GADFL;IAEF,IAAIO,WAAW+G,IAAA,KAAS,iBAAiB;QACvC,IAAI3G;QACJ,IAAIL,CAAA,CAAE,EAAC,KAAMC,YAAY;YACvBI,KAAkB,aAAA,GAAAZ,MAAKmG,cAAc;gBACnC3F,YAAAA;YACF;YACAD,CAAA,CAAE,EAAC,GAAIC;YACPD,CAAA,CAAE,EAAC,GAAIK;QACT,OAAO;YACLA,KAAKL,CAAA,CAAE,EAAC;QACV;QACA,OAAOK;IACT,OAAO;QACL,IAAIJ,WAAW+G,IAAA,KAAS,aAAa;YACnC,IAAIC;YACJ,IAAIjH,CAAA,CAAE,EAAC,KAAMC,cAAcD,CAAA,CAAE,EAAC,KAAMN,UAAU;gBAC5CuH,KAAkB,aAAA,GAAAxH,MAAKK,oBAAoB;oBACzCG,YAAAA;oBACAP,UAAAA;gBACF;gBACAM,CAAA,CAAE,EAAC,GAAIC;gBACPD,CAAA,CAAE,EAAC,GAAIN;gBACPM,CAAA,CAAE,EAAC,GAAIiH;YACT,OAAO;gBACLA,KAAKjH,CAAA,CAAE,EAAC;YACV;YACA,OAAOiH;QACT;IACF;IACA,OAAO;AACT;AD8eA,SACEF,gBAAgB,GAChB","sourcesContent":["// src/components/annotations/SourceAnnotation/index.tsx\nimport { c as _c4 } from \"react-compiler-runtime\";\n\n// src/components/annotations/FilePathAnnotation.tsx\nimport { c as _c } from \"react-compiler-runtime\";\n\n// src/hooks/core/useSuperinterfaceContext/index.ts\nimport { useContext } from \"react\";\n\n// src/contexts/core/SuperinterfaceContext/index.tsx\nimport { createContext } from \"react\";\n\n// src/lib/superinterfaceCloud/baseUrl.ts\nvar baseUrl = \"https://superinterface.ai/api/cloud\";\n\n// src/lib/threadIdStorage/cookieOptions/get.ts\nimport Cookies from \"js-cookie\";\n\n// src/lib/threadIdStorage/key.ts\nvar key = (_ref) => {\n var {\n assistantId\n } = _ref;\n return \"superinterface-\".concat(assistantId, \"-threadId\");\n};\n\n// src/lib/threadIdStorage/cookieOptions/get.ts\nvar get = (_ref) => {\n var _Cookies$get;\n var {\n assistantId\n } = _ref;\n return (_Cookies$get = Cookies.get(key({\n assistantId\n }))) !== null && _Cookies$get !== void 0 ? _Cookies$get : null;\n};\n\n// src/lib/threadIdStorage/cookieOptions/set.ts\nimport Cookies2 from \"js-cookie\";\nvar set = (_ref) => {\n var {\n assistantId,\n threadId\n } = _ref;\n return Cookies2.set(key({\n assistantId\n }), threadId);\n};\n\n// src/lib/threadIdStorage/cookieOptions/remove.ts\nimport Cookies3 from \"js-cookie\";\nvar remove = (_ref) => {\n var {\n assistantId\n } = _ref;\n return Cookies3.remove(key({\n assistantId\n }));\n};\n\n// src/lib/threadIdStorage/cookieOptions/index.ts\nvar cookieOptions = {\n get,\n set,\n remove\n};\n\n// src/lib/threadIdStorage/localStorageOptions/get.ts\nvar get2 = (_ref) => {\n var {\n assistantId\n } = _ref;\n return window.localStorage.getItem(key({\n assistantId\n }));\n};\n\n// src/lib/threadIdStorage/localStorageOptions/set.ts\nvar set2 = (_ref) => {\n var {\n assistantId,\n threadId\n } = _ref;\n return window.localStorage.setItem(key({\n assistantId\n }), threadId);\n};\n\n// src/lib/threadIdStorage/localStorageOptions/remove.ts\nvar remove2 = (_ref) => {\n var {\n assistantId\n } = _ref;\n return window.localStorage.removeItem(key({\n assistantId\n }));\n};\n\n// src/lib/threadIdStorage/localStorageOptions/index.ts\nvar localStorageOptions = {\n get: get2,\n set: set2,\n remove: remove2\n};\n\n// src/lib/iframes/isIframe.ts\nvar isIframe = () => {\n if (typeof window === \"undefined\") return false;\n return window.self !== window.top;\n};\n\n// src/contexts/core/SuperinterfaceContext/index.tsx\nvar SuperinterfaceContext = /* @__PURE__ */ createContext({\n baseUrl,\n variables: {},\n defaultOptions: {\n queries: {},\n mutations: {}\n },\n threadIdStorageOptions: isIframe() ? localStorageOptions : cookieOptions,\n createMessageAbortControllerRef: {\n current: null\n }\n});\n\n// src/hooks/core/useSuperinterfaceContext/index.ts\nvar useSuperinterfaceContext = () => {\n return useContext(SuperinterfaceContext);\n};\n\n// src/contexts/markdown/MarkdownContext/lib/components/Link.tsx\nimport { Link as RadixLink } from \"@radix-ui/themes\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar Link = (_ref) => {\n var {\n children,\n href,\n download,\n target = \"_blank\"\n } = _ref;\n return /* @__PURE__ */ _jsx(RadixLink, {\n href,\n target,\n download,\n children\n });\n};\n\n// src/components/annotations/FilePathAnnotation.tsx\nimport { jsx as _jsx2 } from \"react/jsx-runtime\";\nvar FilePathAnnotation = (t0) => {\n var $ = _c(3);\n var {\n annotation,\n children\n } = t0;\n var superinterfaceContext = useSuperinterfaceContext();\n var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);\n var t1 = \"\".concat(superinterfaceContext.baseUrl, \"/files/\").concat(annotation.file_path.file_id, \"/contents?\").concat(nextSearchParams);\n var t2;\n if ($[0] !== children || $[1] !== t1) {\n t2 = /* @__PURE__ */ _jsx2(Link, {\n href: t1,\n target: \"_self\",\n download: true,\n children\n });\n $[0] = children;\n $[1] = t1;\n $[2] = t2;\n } else {\n t2 = $[2];\n }\n return t2;\n};\n\n// src/components/annotations/SourceAnnotation/FileCitation/index.tsx\nimport { c as _c3 } from \"react-compiler-runtime\";\nimport { useState } from \"react\";\nimport { QuoteIcon } from \"@radix-ui/react-icons\";\nimport { Dialog, VisuallyHidden, IconButton as IconButton2 } from \"@radix-ui/themes\";\n\n// src/components/annotations/SourceAnnotation/FileCitation/Content/index.tsx\nimport { c as _c2 } from \"react-compiler-runtime\";\nimport { Flex as Flex2, Card as Card2, Inset } from \"@radix-ui/themes\";\nimport { usePDFSlick } from \"@pdfslick/react\";\nimport \"@pdfslick/react/dist/pdf_viewer.css\";\n\n// src/components/annotations/SourceAnnotation/FileCitation/Content/Navigation.tsx\nimport { Card, IconButton, Flex } from \"@radix-ui/themes\";\nimport { ZoomInIcon, ZoomOutIcon } from \"@radix-ui/react-icons\";\nimport { jsx as _jsx3, jsxs as _jsxs } from \"react/jsx-runtime\";\nvar Navigation = (_ref) => {\n var {\n usePDFSlickStore\n } = _ref;\n var pdfSlick = usePDFSlickStore((s) => s.pdfSlick);\n return /* @__PURE__ */ _jsx3(Flex, {\n justify: \"center\",\n position: \"absolute\",\n bottom: \"var(--space-2)\",\n left: \"0\",\n right: \"0\",\n style: {\n zIndex: 99999\n },\n children: /* @__PURE__ */ _jsx3(Card, {\n children: /* @__PURE__ */ _jsxs(Flex, {\n gap: \"2\",\n children: [/* @__PURE__ */ _jsx3(IconButton, {\n variant: \"soft\",\n onClick: () => {\n var _pdfSlick$viewer;\n return pdfSlick === null || pdfSlick === void 0 || (_pdfSlick$viewer = pdfSlick.viewer) === null || _pdfSlick$viewer === void 0 ? void 0 : _pdfSlick$viewer.decreaseScale();\n },\n children: /* @__PURE__ */ _jsx3(ZoomOutIcon, {})\n }), /* @__PURE__ */ _jsx3(IconButton, {\n variant: \"soft\",\n onClick: () => {\n var _pdfSlick$viewer2;\n return pdfSlick === null || pdfSlick === void 0 || (_pdfSlick$viewer2 = pdfSlick.viewer) === null || _pdfSlick$viewer2 === void 0 ? void 0 : _pdfSlick$viewer2.increaseScale();\n },\n children: /* @__PURE__ */ _jsx3(ZoomInIcon, {})\n })]\n })\n })\n });\n};\n\n// src/components/annotations/SourceAnnotation/FileCitation/Content/index.tsx\nimport { jsx as _jsx4, jsxs as _jsxs2 } from \"react/jsx-runtime\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function(r2) {\n return Object.getOwnPropertyDescriptor(e, r2).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {\n _defineProperty(e, r2, t[r2]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {\n Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));\n });\n }\n return e;\n}\nfunction _defineProperty(e, r, t) {\n return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nvar Content = (t0) => {\n var $ = _c2(14);\n var {\n fileId\n } = t0;\n var superinterfaceContext = useSuperinterfaceContext();\n var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);\n var t1;\n if ($[0] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t1 = {\n scaleValue: \"page-width\",\n removePageBorders: true\n };\n $[0] = t1;\n } else {\n t1 = $[0];\n }\n var {\n viewerRef,\n usePDFSlickStore,\n PDFSlickViewer\n } = usePDFSlick(\"\".concat(superinterfaceContext.baseUrl, \"/api/cloud/files/\").concat(fileId, \"/contents?\").concat(nextSearchParams), t1);\n var t2;\n if ($[1] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t2 = {\n display: \"flex\",\n flexGrow: \"1\"\n };\n $[1] = t2;\n } else {\n t2 = $[1];\n }\n var t3;\n if ($[2] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t3 = {\n display: \"flex\",\n flexGrow: \"1\"\n };\n $[2] = t3;\n } else {\n t3 = $[2];\n }\n var t4;\n if ($[3] !== usePDFSlickStore || $[4] !== viewerRef) {\n t4 = {\n viewerRef,\n usePDFSlickStore\n };\n $[3] = usePDFSlickStore;\n $[4] = viewerRef;\n $[5] = t4;\n } else {\n t4 = $[5];\n }\n var t5;\n if ($[6] !== PDFSlickViewer || $[7] !== t4) {\n t5 = /* @__PURE__ */ _jsx4(PDFSlickViewer, _objectSpread({}, t4));\n $[6] = PDFSlickViewer;\n $[7] = t4;\n $[8] = t5;\n } else {\n t5 = $[8];\n }\n var t6;\n if ($[9] !== usePDFSlickStore) {\n t6 = /* @__PURE__ */ _jsx4(Navigation, {\n usePDFSlickStore\n });\n $[9] = usePDFSlickStore;\n $[10] = t6;\n } else {\n t6 = $[10];\n }\n var t7;\n if ($[11] !== t5 || $[12] !== t6) {\n t7 = /* @__PURE__ */ _jsx4(Flex2, {\n direction: \"column\",\n flexGrow: \"1\",\n gap: \"3\",\n children: /* @__PURE__ */ _jsx4(Card2, {\n style: t2,\n children: /* @__PURE__ */ _jsx4(Inset, {\n clip: \"padding-box\",\n style: t3,\n children: /* @__PURE__ */ _jsxs2(Flex2, {\n flexGrow: \"1\",\n position: \"relative\",\n children: [t5, t6]\n })\n })\n })\n });\n $[11] = t5;\n $[12] = t6;\n $[13] = t7;\n } else {\n t7 = $[13];\n }\n return t7;\n};\n\n// src/components/annotations/SourceAnnotation/FileCitation/index.tsx\nimport { jsx as _jsx5, jsxs as _jsxs3, Fragment as _Fragment } from \"react/jsx-runtime\";\nvar FileCitation = (t0) => {\n var $ = _c3(18);\n var {\n annotation\n } = t0;\n var [activeFileId, setActiveFileId] = useState(null);\n var t1;\n if ($[0] !== annotation.file_citation.file_id) {\n t1 = () => {\n setActiveFileId(annotation.file_citation.file_id);\n };\n $[0] = annotation.file_citation.file_id;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n var t2;\n if ($[2] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t2 = /* @__PURE__ */ _jsx5(QuoteIcon, {});\n $[2] = t2;\n } else {\n t2 = $[2];\n }\n var t3;\n if ($[3] !== t1) {\n t3 = /* @__PURE__ */ _jsx5(IconButton2, {\n variant: \"soft\",\n color: \"gray\",\n size: \"1\",\n onClick: t1,\n children: t2\n });\n $[3] = t1;\n $[4] = t3;\n } else {\n t3 = $[4];\n }\n var t4 = !!activeFileId;\n var t5;\n if ($[5] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t5 = (open) => {\n if (!open) {\n setActiveFileId(null);\n }\n };\n $[5] = t5;\n } else {\n t5 = $[5];\n }\n var t6;\n if ($[6] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t6 = {\n display: \"flex\",\n flexDirection: \"column\"\n };\n $[6] = t6;\n } else {\n t6 = $[6];\n }\n var t7;\n if ($[7] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t7 = /* @__PURE__ */ _jsx5(VisuallyHidden, {\n asChild: true,\n children: /* @__PURE__ */ _jsx5(Dialog.Title, {\n children: \"Source\"\n })\n });\n $[7] = t7;\n } else {\n t7 = $[7];\n }\n var t8;\n if ($[8] !== activeFileId) {\n t8 = activeFileId && /* @__PURE__ */ _jsx5(Content, {\n fileId: activeFileId\n });\n $[8] = activeFileId;\n $[9] = t8;\n } else {\n t8 = $[9];\n }\n var t9;\n if ($[10] !== t8) {\n t9 = /* @__PURE__ */ _jsxs3(Dialog.Content, {\n width: \"1000px\",\n height: \"90vh\",\n maxWidth: \"calc(100vw - 2 * var(--space-4))\",\n \"aria-describedby\": void 0,\n style: t6,\n children: [t7, t8]\n });\n $[10] = t8;\n $[11] = t9;\n } else {\n t9 = $[11];\n }\n var t10;\n if ($[12] !== t4 || $[13] !== t9) {\n t10 = /* @__PURE__ */ _jsx5(Dialog.Root, {\n open: t4,\n onOpenChange: t5,\n children: t9\n });\n $[12] = t4;\n $[13] = t9;\n $[14] = t10;\n } else {\n t10 = $[14];\n }\n var t11;\n if ($[15] !== t10 || $[16] !== t3) {\n t11 = /* @__PURE__ */ _jsxs3(_Fragment, {\n children: [t3, t10]\n });\n $[15] = t10;\n $[16] = t3;\n $[17] = t11;\n } else {\n t11 = $[17];\n }\n return t11;\n};\n\n// src/components/annotations/SourceAnnotation/index.tsx\nimport { jsx as _jsx6 } from \"react/jsx-runtime\";\nvar SourceAnnotation = (t0) => {\n var $ = _c4(5);\n var {\n annotation,\n children\n } = t0;\n if (annotation.type === \"file_citation\") {\n var t1;\n if ($[0] !== annotation) {\n t1 = /* @__PURE__ */ _jsx6(FileCitation, {\n annotation\n });\n $[0] = annotation;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n return t1;\n } else {\n if (annotation.type === \"file_path\") {\n var _t;\n if ($[2] !== annotation || $[3] !== children) {\n _t = /* @__PURE__ */ _jsx6(FilePathAnnotation, {\n annotation,\n children\n });\n $[2] = annotation;\n $[3] = children;\n $[4] = _t;\n } else {\n _t = $[4];\n }\n return _t;\n }\n }\n return null;\n};\nexport {\n SourceAnnotation\n};\n","import { c as _c } from \"react-compiler-runtime\";\nimport { FilePathAnnotation } from '@/components/annotations/FilePathAnnotation';\nimport { FileCitation } from './FileCitation';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport var SourceAnnotation = t0 => {\n var $ = _c(5);\n var {\n annotation,\n children\n } = t0;\n if (annotation.type === \"file_citation\") {\n var t1;\n if ($[0] !== annotation) {\n t1 = /*#__PURE__*/_jsx(FileCitation, {\n annotation: annotation\n });\n $[0] = annotation;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n return t1;\n } else {\n if (annotation.type === \"file_path\") {\n var _t;\n if ($[2] !== annotation || $[3] !== children) {\n _t = /*#__PURE__*/_jsx(FilePathAnnotation, {\n annotation: annotation,\n children: children\n });\n $[2] = annotation;\n $[3] = children;\n $[4] = _t;\n } else {\n _t = $[4];\n }\n return _t;\n }\n }\n return null;\n};","'use client';\n\nimport { c as _c } from \"react-compiler-runtime\";\nimport { useSuperinterfaceContext } from '@/hooks/core/useSuperinterfaceContext';\nimport { Link } from '@/contexts/markdown/MarkdownContext/lib/components/Link';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport var FilePathAnnotation = t0 => {\n var $ = _c(3);\n var {\n annotation,\n children\n } = t0;\n var superinterfaceContext = useSuperinterfaceContext();\n var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);\n var t1 = \"\".concat(superinterfaceContext.baseUrl, \"/files/\").concat(annotation.file_path.file_id, \"/contents?\").concat(nextSearchParams);\n var t2;\n if ($[0] !== children || $[1] !== t1) {\n t2 = /*#__PURE__*/_jsx(Link, {\n href: t1,\n target: \"_self\",\n download: true,\n children: children\n });\n $[0] = children;\n $[1] = t1;\n $[2] = t2;\n } else {\n t2 = $[2];\n }\n return t2;\n};","'use client';\n\nimport { useContext } from 'react';\nimport { SuperinterfaceContext } from '@/contexts/core/SuperinterfaceContext';\nexport var useSuperinterfaceContext = () => {\n return useContext(SuperinterfaceContext);\n};","'use client';\n\nimport { createContext } from 'react';\nimport { baseUrl } from '@/lib/superinterfaceCloud/baseUrl';\nimport { cookieOptions } from '@/lib/threadIdStorage/cookieOptions';\nimport { localStorageOptions } from '@/lib/threadIdStorage/localStorageOptions';\nimport { isIframe } from '@/lib/iframes/isIframe';\nexport var SuperinterfaceContext = /*#__PURE__*/createContext({\n baseUrl,\n variables: {},\n defaultOptions: {\n queries: {},\n mutations: {}\n },\n threadIdStorageOptions: isIframe() ? localStorageOptions : cookieOptions,\n createMessageAbortControllerRef: {\n current: null\n }\n});","export var baseUrl = 'https://superinterface.ai/api/cloud';","import Cookies from 'js-cookie';\nimport { key } from '@/lib/threadIdStorage/key';\nexport var get = _ref => {\n var _Cookies$get;\n var {\n assistantId\n } = _ref;\n return (_Cookies$get = Cookies.get(key({\n assistantId\n }))) !== null && _Cookies$get !== void 0 ? _Cookies$get : null;\n};","export var key = _ref => {\n var {\n assistantId\n } = _ref;\n return \"superinterface-\".concat(assistantId, \"-threadId\");\n};","import Cookies from 'js-cookie';\nimport { key } from '@/lib/threadIdStorage/key';\nexport var set = _ref => {\n var {\n assistantId,\n threadId\n } = _ref;\n return Cookies.set(key({\n assistantId\n }), threadId);\n};","import Cookies from 'js-cookie';\nimport { key } from '@/lib/threadIdStorage/key';\nexport var remove = _ref => {\n var {\n assistantId\n } = _ref;\n return Cookies.remove(key({\n assistantId\n }));\n};","import { get } from './get';\nimport { set } from './set';\nimport { remove } from './remove';\nexport var cookieOptions = {\n get,\n set,\n remove\n};","import { key } from '@/lib/threadIdStorage/key';\nexport var get = _ref => {\n var {\n assistantId\n } = _ref;\n return window.localStorage.getItem(key({\n assistantId\n }));\n};","import { key } from '@/lib/threadIdStorage/key';\nexport var set = _ref => {\n var {\n assistantId,\n threadId\n } = _ref;\n return window.localStorage.setItem(key({\n assistantId\n }), threadId);\n};","import { key } from '@/lib/threadIdStorage/key';\nexport var remove = _ref => {\n var {\n assistantId\n } = _ref;\n return window.localStorage.removeItem(key({\n assistantId\n }));\n};","import { get } from './get';\nimport { set } from './set';\nimport { remove } from './remove';\nexport var localStorageOptions = {\n get,\n set,\n remove\n};","export var isIframe = () => {\n if (typeof window === 'undefined') return false;\n return window.self !== window.top;\n};","import { Link as RadixLink } from '@radix-ui/themes';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport var Link = _ref => {\n var {\n children,\n href,\n download,\n target = '_blank'\n } = _ref;\n return /*#__PURE__*/_jsx(RadixLink, {\n href: href,\n target: target,\n download: download,\n children: children\n });\n};","'use client';\n\nimport { c as _c } from \"react-compiler-runtime\";\nimport { useState } from 'react';\nimport { QuoteIcon } from '@radix-ui/react-icons';\nimport { Dialog, VisuallyHidden, IconButton } from '@radix-ui/themes';\nimport { Content } from './Content';\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nexport var FileCitation = t0 => {\n var $ = _c(18);\n var {\n annotation\n } = t0;\n var [activeFileId, setActiveFileId] = useState(null);\n var t1;\n if ($[0] !== annotation.file_citation.file_id) {\n t1 = () => {\n setActiveFileId(annotation.file_citation.file_id);\n };\n $[0] = annotation.file_citation.file_id;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n var t2;\n if ($[2] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t2 = /*#__PURE__*/_jsx(QuoteIcon, {});\n $[2] = t2;\n } else {\n t2 = $[2];\n }\n var t3;\n if ($[3] !== t1) {\n t3 = /*#__PURE__*/_jsx(IconButton, {\n variant: \"soft\",\n color: \"gray\",\n size: \"1\",\n onClick: t1,\n children: t2\n });\n $[3] = t1;\n $[4] = t3;\n } else {\n t3 = $[4];\n }\n var t4 = !!activeFileId;\n var t5;\n if ($[5] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t5 = open => {\n if (!open) {\n setActiveFileId(null);\n }\n };\n $[5] = t5;\n } else {\n t5 = $[5];\n }\n var t6;\n if ($[6] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t6 = {\n display: \"flex\",\n flexDirection: \"column\"\n };\n $[6] = t6;\n } else {\n t6 = $[6];\n }\n var t7;\n if ($[7] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t7 = /*#__PURE__*/_jsx(VisuallyHidden, {\n asChild: true,\n children: /*#__PURE__*/_jsx(Dialog.Title, {\n children: \"Source\"\n })\n });\n $[7] = t7;\n } else {\n t7 = $[7];\n }\n var t8;\n if ($[8] !== activeFileId) {\n t8 = activeFileId && /*#__PURE__*/_jsx(Content, {\n fileId: activeFileId\n });\n $[8] = activeFileId;\n $[9] = t8;\n } else {\n t8 = $[9];\n }\n var t9;\n if ($[10] !== t8) {\n t9 = /*#__PURE__*/_jsxs(Dialog.Content, {\n width: \"1000px\",\n height: \"90vh\",\n maxWidth: \"calc(100vw - 2 * var(--space-4))\",\n \"aria-describedby\": undefined,\n style: t6,\n children: [t7, t8]\n });\n $[10] = t8;\n $[11] = t9;\n } else {\n t9 = $[11];\n }\n var t10;\n if ($[12] !== t4 || $[13] !== t9) {\n t10 = /*#__PURE__*/_jsx(Dialog.Root, {\n open: t4,\n onOpenChange: t5,\n children: t9\n });\n $[12] = t4;\n $[13] = t9;\n $[14] = t10;\n } else {\n t10 = $[14];\n }\n var t11;\n if ($[15] !== t10 || $[16] !== t3) {\n t11 = /*#__PURE__*/_jsxs(_Fragment, {\n children: [t3, t10]\n });\n $[15] = t10;\n $[16] = t3;\n $[17] = t11;\n } else {\n t11 = $[17];\n }\n return t11;\n};","function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { c as _c } from \"react-compiler-runtime\";\nimport { Flex, Card, Inset } from '@radix-ui/themes';\nimport { useSuperinterfaceContext } from '@/hooks/core/useSuperinterfaceContext';\nimport { usePDFSlick } from '@pdfslick/react';\nimport '@pdfslick/react/dist/pdf_viewer.css';\nimport { Navigation } from './Navigation';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport var Content = t0 => {\n var $ = _c(14);\n var {\n fileId\n } = t0;\n var superinterfaceContext = useSuperinterfaceContext();\n var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);\n var t1;\n if ($[0] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t1 = {\n scaleValue: \"page-width\",\n removePageBorders: true\n };\n $[0] = t1;\n } else {\n t1 = $[0];\n }\n var {\n viewerRef,\n usePDFSlickStore,\n PDFSlickViewer\n } = usePDFSlick(\"\".concat(superinterfaceContext.baseUrl, \"/api/cloud/files/\").concat(fileId, \"/contents?\").concat(nextSearchParams), t1);\n var t2;\n if ($[1] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t2 = {\n display: \"flex\",\n flexGrow: \"1\"\n };\n $[1] = t2;\n } else {\n t2 = $[1];\n }\n var t3;\n if ($[2] === Symbol.for(\"react.memo_cache_sentinel\")) {\n t3 = {\n display: \"flex\",\n flexGrow: \"1\"\n };\n $[2] = t3;\n } else {\n t3 = $[2];\n }\n var t4;\n if ($[3] !== usePDFSlickStore || $[4] !== viewerRef) {\n t4 = {\n viewerRef,\n usePDFSlickStore\n };\n $[3] = usePDFSlickStore;\n $[4] = viewerRef;\n $[5] = t4;\n } else {\n t4 = $[5];\n }\n var t5;\n if ($[6] !== PDFSlickViewer || $[7] !== t4) {\n t5 = /*#__PURE__*/_jsx(PDFSlickViewer, _objectSpread({}, t4));\n $[6] = PDFSlickViewer;\n $[7] = t4;\n $[8] = t5;\n } else {\n t5 = $[8];\n }\n var t6;\n if ($[9] !== usePDFSlickStore) {\n t6 = /*#__PURE__*/_jsx(Navigation, {\n usePDFSlickStore: usePDFSlickStore\n });\n $[9] = usePDFSlickStore;\n $[10] = t6;\n } else {\n t6 = $[10];\n }\n var t7;\n if ($[11] !== t5 || $[12] !== t6) {\n t7 = /*#__PURE__*/_jsx(Flex, {\n direction: \"column\",\n flexGrow: \"1\",\n gap: \"3\",\n children: /*#__PURE__*/_jsx(Card, {\n style: t2,\n children: /*#__PURE__*/_jsx(Inset, {\n clip: \"padding-box\",\n style: t3,\n children: /*#__PURE__*/_jsxs(Flex, {\n flexGrow: \"1\",\n position: \"relative\",\n children: [t5, t6]\n })\n })\n })\n });\n $[11] = t5;\n $[12] = t6;\n $[13] = t7;\n } else {\n t7 = $[13];\n }\n return t7;\n};","import { Card, IconButton, Flex } from '@radix-ui/themes';\nimport { ZoomInIcon, ZoomOutIcon } from '@radix-ui/react-icons';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport var Navigation = _ref => {\n var {\n usePDFSlickStore\n } = _ref;\n var pdfSlick = usePDFSlickStore(s => s.pdfSlick);\n return /*#__PURE__*/_jsx(Flex, {\n justify: \"center\",\n position: \"absolute\",\n bottom: \"var(--space-2)\",\n left: \"0\",\n right: \"0\",\n style: {\n zIndex: 99999\n },\n children: /*#__PURE__*/_jsx(Card, {\n children: /*#__PURE__*/_jsxs(Flex, {\n gap: \"2\",\n children: [/*#__PURE__*/_jsx(IconButton, {\n variant: \"soft\",\n onClick: () => {\n var _pdfSlick$viewer;\n return pdfSlick === null || pdfSlick === void 0 || (_pdfSlick$viewer = pdfSlick.viewer) === null || _pdfSlick$viewer === void 0 ? void 0 : _pdfSlick$viewer.decreaseScale();\n },\n children: /*#__PURE__*/_jsx(ZoomOutIcon, {})\n }), /*#__PURE__*/_jsx(IconButton, {\n variant: \"soft\",\n onClick: () => {\n var _pdfSlick$viewer2;\n return pdfSlick === null || pdfSlick === void 0 || (_pdfSlick$viewer2 = pdfSlick.viewer) === null || _pdfSlick$viewer2 === void 0 ? void 0 : _pdfSlick$viewer2.increaseScale();\n },\n children: /*#__PURE__*/_jsx(ZoomInIcon, {})\n })]\n })\n })\n });\n};"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import OpenAI from 'openai';
|
|
3
|
+
import remarkGfm from 'remark-gfm';
|
|
4
|
+
|
|
5
|
+
declare const components: Record<string, any>;
|
|
6
|
+
|
|
7
|
+
declare const getRemarkPlugins: ({ content, }: {
|
|
8
|
+
content: OpenAI.Beta.Threads.Messages.TextContentBlock;
|
|
9
|
+
}) => ((() => (tree: any) => void) | typeof remarkGfm)[];
|
|
10
|
+
|
|
11
|
+
type MarkdownContextType = {
|
|
12
|
+
components: typeof components;
|
|
13
|
+
getRemarkPlugins: typeof getRemarkPlugins;
|
|
14
|
+
};
|
|
15
|
+
declare const MarkdownContext: react.Context<MarkdownContextType>;
|
|
16
|
+
|
|
17
|
+
declare const useMarkdownContext: () => MarkdownContextType;
|
|
18
|
+
|
|
19
|
+
export { type MarkdownContextType as M, MarkdownContext as a, useMarkdownContext as u };
|