@pi-outpost/embed 0.60.1 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{conversationExport-C761zW6H.js → conversationExport-BGLSsVDO.js} +217 -205
- package/dist/{conversationExport-DaPkz-Eh.cjs → conversationExport-C-0oWDfL.cjs} +7 -7
- package/dist/{conversationHistory-V6AR3Ga4.cjs → conversationHistory-BgnXSxWk.cjs} +3 -3
- package/dist/{conversationHistory-DhOtJoSk.js → conversationHistory-CRkCClAn.js} +92 -5
- package/dist/{docxExport-Bwi2TlqP.js → docxExport-COweplKv.js} +1 -1
- package/dist/{docxExport-BlPADe6b.cjs → docxExport-DM0_V94R.cjs} +2 -2
- package/dist/download-C9gupL_X.js +45 -0
- package/dist/download-CVl_k6EM.cjs +1 -0
- package/dist/pi-outpost-embed.cjs +44 -44
- package/dist/pi-outpost-embed.js +5049 -4128
- package/package.json +1 -1
- package/dist/download-DVJ5QY85.js +0 -7
- package/dist/download-U7JEZ6c9.cjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as e, n as t, t as n } from "./rolldown-runtime-5HNE8Q1r.js";
|
|
2
2
|
import { a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, n as d, o as f, s as p, t as m, u as h } from "./lib-CSMo4o20.js";
|
|
3
3
|
import { c as g, n as _, o as v, r as y } from "./workspacePath-j4IUi8yY.js";
|
|
4
|
-
import {
|
|
4
|
+
import { n as b } from "./download-C9gupL_X.js";
|
|
5
5
|
import { t as x } from "./katex-BOYcAQ2I.js";
|
|
6
6
|
import { Component as S, Fragment as C, createContext as w, forwardRef as ee, useCallback as T, useContext as te, useEffect as E, useId as ne, useImperativeHandle as re, useLayoutEffect as ie, useMemo as ae, useRef as D, useState as O } from "react";
|
|
7
7
|
import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
@@ -26023,21 +26023,108 @@ function Yk({ item: e, serverUrl: t = "", token: n = null, workspace: r, onOpenF
|
|
|
26023
26023
|
});
|
|
26024
26024
|
}
|
|
26025
26025
|
//#endregion
|
|
26026
|
+
//#region ../ui/src/util/ansi.ts
|
|
26027
|
+
var Xk = {
|
|
26028
|
+
30: "#3f3f46",
|
|
26029
|
+
31: "#dc2626",
|
|
26030
|
+
32: "#16a34a",
|
|
26031
|
+
33: "#ca8a04",
|
|
26032
|
+
34: "#2563eb",
|
|
26033
|
+
35: "#9333ea",
|
|
26034
|
+
36: "#0891b2",
|
|
26035
|
+
37: "#71717a",
|
|
26036
|
+
90: "#a1a1aa",
|
|
26037
|
+
91: "#ef4444",
|
|
26038
|
+
92: "#22c55e",
|
|
26039
|
+
93: "#eab308",
|
|
26040
|
+
94: "#3b82f6",
|
|
26041
|
+
95: "#a855f7",
|
|
26042
|
+
96: "#06b6d4",
|
|
26043
|
+
97: "#d4d4d8"
|
|
26044
|
+
};
|
|
26045
|
+
function Zk(e) {
|
|
26046
|
+
if (!Number.isInteger(e) || e < 0 || e > 255) return;
|
|
26047
|
+
if (e < 16) return Xk[e < 8 ? 30 + e : 90 + e - 8];
|
|
26048
|
+
if (e >= 232) {
|
|
26049
|
+
let t = 8 + (e - 232) * 10;
|
|
26050
|
+
return `rgb(${t} ${t} ${t})`;
|
|
26051
|
+
}
|
|
26052
|
+
let t = e - 16, n = (e) => e === 0 ? 0 : 55 + e * 40;
|
|
26053
|
+
return `rgb(${n(Math.floor(t / 36))} ${n(Math.floor(t / 6) % 6)} ${n(t % 6)})`;
|
|
26054
|
+
}
|
|
26055
|
+
var Qk = /\u001B\[[0-9;:]*[A-Za-z]|\u001B[()][A-Za-z0-9]|\u001B[A-Za-z]/g;
|
|
26056
|
+
function $k(e, t) {
|
|
26057
|
+
let n = { ...e };
|
|
26058
|
+
for (let e = 0; e < t.length; e++) {
|
|
26059
|
+
let r = t[e];
|
|
26060
|
+
if (r === 0) for (let e of Object.keys(n)) delete n[e];
|
|
26061
|
+
else if (r === 1) n.bold = !0;
|
|
26062
|
+
else if (r === 2) n.dim = !0;
|
|
26063
|
+
else if (r === 3) n.italic = !0;
|
|
26064
|
+
else if (r === 4) n.underline = !0;
|
|
26065
|
+
else if (r === 22) delete n.bold, delete n.dim;
|
|
26066
|
+
else if (r === 23) delete n.italic;
|
|
26067
|
+
else if (r === 24) delete n.underline;
|
|
26068
|
+
else if (r === 39) delete n.color;
|
|
26069
|
+
else if (Xk[r] !== void 0) n.color = Xk[r];
|
|
26070
|
+
else if (r === 38) {
|
|
26071
|
+
if (t[e + 1] === 2) {
|
|
26072
|
+
let [r, i, a] = [
|
|
26073
|
+
t[e + 2],
|
|
26074
|
+
t[e + 3],
|
|
26075
|
+
t[e + 4]
|
|
26076
|
+
];
|
|
26077
|
+
[
|
|
26078
|
+
r,
|
|
26079
|
+
i,
|
|
26080
|
+
a
|
|
26081
|
+
].every((e) => Number.isFinite(e)) && (n.color = `rgb(${r} ${i} ${a})`), e += 4;
|
|
26082
|
+
} else if (t[e + 1] === 5) {
|
|
26083
|
+
let r = Zk(t[e + 2]);
|
|
26084
|
+
r !== void 0 && (n.color = r), e += 2;
|
|
26085
|
+
}
|
|
26086
|
+
}
|
|
26087
|
+
}
|
|
26088
|
+
return n;
|
|
26089
|
+
}
|
|
26090
|
+
function eA(e) {
|
|
26091
|
+
let t = [], n = {}, r = 0;
|
|
26092
|
+
Qk.lastIndex = 0;
|
|
26093
|
+
for (let i = Qk.exec(e); i !== null; i = Qk.exec(e)) {
|
|
26094
|
+
i.index > r && t.push({
|
|
26095
|
+
text: e.slice(r, i.index),
|
|
26096
|
+
...n
|
|
26097
|
+
}), r = i.index + i[0].length;
|
|
26098
|
+
let a = i[0];
|
|
26099
|
+
if (a.endsWith("m")) {
|
|
26100
|
+
let e = a.slice(2, -1), t = e === "" ? [0] : e.split(/[;:]/).map((e) => e === "" ? 0 : Number(e));
|
|
26101
|
+
n = $k(n, t);
|
|
26102
|
+
}
|
|
26103
|
+
}
|
|
26104
|
+
return r < e.length && t.push({
|
|
26105
|
+
text: e.slice(r),
|
|
26106
|
+
...n
|
|
26107
|
+
}), t;
|
|
26108
|
+
}
|
|
26109
|
+
function tA(e) {
|
|
26110
|
+
return e.replace(Qk, "");
|
|
26111
|
+
}
|
|
26112
|
+
//#endregion
|
|
26026
26113
|
//#region ../shared/src/protocol.ts
|
|
26027
|
-
var
|
|
26114
|
+
var nA = [
|
|
26028
26115
|
"off",
|
|
26029
26116
|
"minimal",
|
|
26030
26117
|
"low",
|
|
26031
26118
|
"medium",
|
|
26032
26119
|
"high",
|
|
26033
26120
|
"xhigh"
|
|
26034
|
-
],
|
|
26121
|
+
], rA = "worktree", iA = class extends Error {
|
|
26035
26122
|
kind;
|
|
26036
26123
|
constructor(e, t) {
|
|
26037
26124
|
super(e), this.name = "HistoryError", this.kind = t;
|
|
26038
26125
|
}
|
|
26039
26126
|
};
|
|
26040
|
-
async function
|
|
26127
|
+
async function aA(e, t) {
|
|
26041
26128
|
let n = [];
|
|
26042
26129
|
for (;;) {
|
|
26043
26130
|
let r = await e(n.length, 50);
|
|
@@ -26045,4 +26132,4 @@ async function $k(e, t) {
|
|
|
26045
26132
|
}
|
|
26046
26133
|
}
|
|
26047
26134
|
//#endregion
|
|
26048
|
-
export {
|
|
26135
|
+
export { eg as A, se as B, qg as C, ng as D, sg as E, Xl as F, ke as I, Se as L, bm as M, cm as N, tg as O, lm as P, ue as R, Kg as S, pg as T, ce as V, gw as _, eA as a, zv as b, Uk as c, kk as d, Mk as f, Aw as g, tk as h, rA as i, kh as j, Qh as k, Bk as l, bk as m, aA as n, tA as o, xk as p, nA as r, Yk as s, iA as t, jk as u, mw as v, Ug as w, Yg as x, Wv as y, le as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as e } from "./download-C9gupL_X.js";
|
|
2
2
|
import { a as t, c as n, d as r, f as i, h as a, m as o, p as s } from "./mermaidToImage-CViP9wx2.js";
|
|
3
3
|
import { n as c, t as l } from "./loadReferencedImage-VNYxXIzB.js";
|
|
4
4
|
//#region ../ui/src/export/markdownToDocx.ts
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const e=require("./download-
|
|
1
|
+
const e=require("./download-CVl_k6EM.cjs"),t=require("./mermaidToImage-B7I6iJ9s.cjs"),n=require("./loadReferencedImage-D47xCpa7.cjs");async function r(e,r){let i=r?.path??``,a=r?.serverUrl??``,o=r?.token??null,s=r?.workspace;return t.d(e,{imageKey:e=>n.n(i,e,a,o,s),loadImage:e=>n.t(i,e,a,o,s),renderDiagram:t.a})}var i=`Consolas, Courier New, monospace`;function a(e){return e.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\n$/,``).split(`
|
|
3
|
-
`).map(e=>new t.m({children:[new t.h({text:t.f(e===``?` `:e),font:i})],spacing:{before:0,after:0}}))}function o(e){let t=e.split(/[/\\]/).pop()??`document`,n=t.lastIndexOf(`.`);return`${n>0?t.slice(0,n):t}.docx`}function s(e){return/\.(md|markdown)$/i.test(e)}async function c(e,n,r){return t.p.toBlob(t.c(await l(e,n,r)))}async function l(e,t,n){return s(t)?r(e,{...n,path:t}):a(e)}async function u(t,n,r){e.
|
|
3
|
+
`).map(e=>new t.m({children:[new t.h({text:t.f(e===``?` `:e),font:i})],spacing:{before:0,after:0}}))}function o(e){let t=e.split(/[/\\]/).pop()??`document`,n=t.lastIndexOf(`.`);return`${n>0?t.slice(0,n):t}.docx`}function s(e){return/\.(md|markdown)$/i.test(e)}async function c(e,n,r){return t.p.toBlob(t.c(await l(e,n,r)))}async function l(e,t,n){return s(t)?r(e,{...n,path:t}):a(e)}async function u(t,n,r){e.n(await c(t,n,r),o(n))}var d=`application/vnd.openxmlformats-officedocument.wordprocessingml.document`;async function f(e,t,n){let r=await c(e,t,n),i={"Content-Type":d};n?.token&&(i.Authorization=`Bearer ${n.token}`);let a=await fetch(`${n?.serverUrl??``}/files/docx-template`,{method:`POST`,headers:i,body:r});if(!a.ok){let e=await a.json().catch(()=>null);throw Error(e?.message??`the server answered ${a.status}`)}return a.blob()}async function p(t,n,r){e.n(await f(t,n,r),o(n))}exports.downloadDocx=u,exports.downloadDocxInTemplate=p;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region ../ui/src/util/download.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
4
|
+
r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
|
|
5
|
+
}
|
|
6
|
+
function t(e, t) {
|
|
7
|
+
let n = t.map((e) => `path=${encodeURIComponent(e)}`);
|
|
8
|
+
return e.token && n.push(`token=${encodeURIComponent(e.token)}`), e.workspace !== void 0 && n.push(`workspace=${encodeURIComponent(e.workspace)}`), `${e.serverUrl}/files/download?${n.join("&")}`;
|
|
9
|
+
}
|
|
10
|
+
var n = class extends Error {};
|
|
11
|
+
function r(e) {
|
|
12
|
+
if (!e) return null;
|
|
13
|
+
let t = /filename\*=UTF-8''([^;]+)/i.exec(e);
|
|
14
|
+
if (t) try {
|
|
15
|
+
return decodeURIComponent(t[1].trim());
|
|
16
|
+
} catch {}
|
|
17
|
+
let n = /filename="([^"]*)"/i.exec(e);
|
|
18
|
+
return n ? n[1] : null;
|
|
19
|
+
}
|
|
20
|
+
var i = () => ({
|
|
21
|
+
fetch: (...e) => fetch(...e),
|
|
22
|
+
document,
|
|
23
|
+
save: e
|
|
24
|
+
});
|
|
25
|
+
async function a(e, a, o, s = i()) {
|
|
26
|
+
if (a.length === 0) return { skipped: 0 };
|
|
27
|
+
let c = t(e, a);
|
|
28
|
+
if (o.singleFile && a.length === 1) {
|
|
29
|
+
let e = s.document.createElement("a");
|
|
30
|
+
return e.href = c, e.download = a[0].split("/").pop() ?? "", e.rel = "noopener", e.click(), { skipped: 0 };
|
|
31
|
+
}
|
|
32
|
+
let l = await s.fetch(c);
|
|
33
|
+
if (!l.ok) {
|
|
34
|
+
let e = `The download failed (${l.status})`;
|
|
35
|
+
try {
|
|
36
|
+
let t = await l.json();
|
|
37
|
+
typeof t.message == "string" ? e = t.message : typeof t.error == "string" && (e = `The download failed: ${t.error}`);
|
|
38
|
+
} catch {}
|
|
39
|
+
throw new n(e);
|
|
40
|
+
}
|
|
41
|
+
let u = Number(l.headers.get("X-Pi-Outpost-Skipped") ?? "0") || 0, d = r(l.headers.get("Content-Disposition")) ?? "files.zip";
|
|
42
|
+
return s.save(await l.blob(), d), { skipped: u };
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { e as n, a as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),URL.revokeObjectURL(n)}function t(e,t){let n=t.map(e=>`path=${encodeURIComponent(e)}`);return e.token&&n.push(`token=${encodeURIComponent(e.token)}`),e.workspace!==void 0&&n.push(`workspace=${encodeURIComponent(e.workspace)}`),`${e.serverUrl}/files/download?${n.join(`&`)}`}var n=class extends Error{};function r(e){if(!e)return null;let t=/filename\*=UTF-8''([^;]+)/i.exec(e);if(t)try{return decodeURIComponent(t[1].trim())}catch{}let n=/filename="([^"]*)"/i.exec(e);return n?n[1]:null}var i=()=>({fetch:(...e)=>fetch(...e),document,save:e});async function a(e,a,o,s=i()){if(a.length===0)return{skipped:0};let c=t(e,a);if(o.singleFile&&a.length===1){let e=s.document.createElement(`a`);return e.href=c,e.download=a[0].split(`/`).pop()??``,e.rel=`noopener`,e.click(),{skipped:0}}let l=await s.fetch(c);if(!l.ok){let e=`The download failed (${l.status})`;try{let t=await l.json();typeof t.message==`string`?e=t.message:typeof t.error==`string`&&(e=`The download failed: ${t.error}`)}catch{}throw new n(e)}let u=Number(l.headers.get(`X-Pi-Outpost-Skipped`)??`0`)||0,d=r(l.headers.get(`Content-Disposition`))??`files.zip`;return s.save(await l.blob(),d),{skipped:u}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
|