@june-ai/june-ui 0.2.9 → 0.2.10
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/{chunk-GFCROSGQ.cjs → chunk-GS4J6OAF.cjs} +219 -28
- package/dist/{chunk-JSRO5CRO.js → chunk-JFIMNFNJ.js} +239 -48
- package/dist/entry-core.cjs +2 -2
- package/dist/entry-core.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +1 -1
- package/dist/june.css +41 -0
- package/package.json +1 -1
|
@@ -1056,7 +1056,7 @@ var STATEMENT_START = /^\$?[A-Za-z_]\w*\s*=/;
|
|
|
1056
1056
|
var PENDING_IDENTIFIER = /^\s*\$?[A-Za-z_]\w*\s*$/;
|
|
1057
1057
|
var FENCE = /^(`{3,})\s*([\w-]*)/;
|
|
1058
1058
|
var OPENUI_FENCE_LANGS = /* @__PURE__ */ new Set(["", "openui", "openui-lang", "openuilang"]);
|
|
1059
|
-
function scan(line, state) {
|
|
1059
|
+
function scan(line, state, preserveQuote = false) {
|
|
1060
1060
|
for (let i = 0; i < line.length; i++) {
|
|
1061
1061
|
const ch = line[i];
|
|
1062
1062
|
if (state.quote) {
|
|
@@ -1070,7 +1070,95 @@ function scan(line, state) {
|
|
|
1070
1070
|
state.depth = Math.max(0, state.depth - 1);
|
|
1071
1071
|
}
|
|
1072
1072
|
}
|
|
1073
|
-
state.quote = null;
|
|
1073
|
+
if (!preserveQuote) state.quote = null;
|
|
1074
|
+
}
|
|
1075
|
+
function quoteClosesLater(lines, from, state) {
|
|
1076
|
+
const probe = { depth: state.depth, quote: state.quote };
|
|
1077
|
+
for (let i = from; i < lines.length; i++) {
|
|
1078
|
+
const line = lines[i];
|
|
1079
|
+
if (probe.depth === 0 && STATEMENT_START.test(line.trim())) return false;
|
|
1080
|
+
scan(line, probe, true);
|
|
1081
|
+
if (!probe.quote) return true;
|
|
1082
|
+
}
|
|
1083
|
+
return false;
|
|
1084
|
+
}
|
|
1085
|
+
function decodeLangString(raw) {
|
|
1086
|
+
let out = "";
|
|
1087
|
+
for (let i = 0; i < raw.length; i++) {
|
|
1088
|
+
const ch = raw[i];
|
|
1089
|
+
if (ch === "\\" && i + 1 < raw.length) {
|
|
1090
|
+
const next = raw[i + 1];
|
|
1091
|
+
out += next === "n" ? "\n" : next === "t" ? " " : next === "r" ? "\r" : next === "b" ? "\b" : next === "f" ? "\f" : next;
|
|
1092
|
+
i++;
|
|
1093
|
+
continue;
|
|
1094
|
+
}
|
|
1095
|
+
out += ch;
|
|
1096
|
+
}
|
|
1097
|
+
return out.replace(/\r/g, "");
|
|
1098
|
+
}
|
|
1099
|
+
function foldMultilineStrings(source) {
|
|
1100
|
+
let out = "";
|
|
1101
|
+
let i = 0;
|
|
1102
|
+
while (i < source.length) {
|
|
1103
|
+
if (source.startsWith('"""', i)) {
|
|
1104
|
+
const end = source.indexOf('"""', i + 3);
|
|
1105
|
+
if (end < 0) {
|
|
1106
|
+
const nl = source.indexOf("\n", i);
|
|
1107
|
+
if (nl < 0) {
|
|
1108
|
+
out += source.slice(i);
|
|
1109
|
+
break;
|
|
1110
|
+
}
|
|
1111
|
+
out += source.slice(i, nl + 1);
|
|
1112
|
+
i = nl + 1;
|
|
1113
|
+
continue;
|
|
1114
|
+
}
|
|
1115
|
+
out += JSON.stringify(source.slice(i + 3, end).replace(/\r/g, ""));
|
|
1116
|
+
i = end + 3;
|
|
1117
|
+
continue;
|
|
1118
|
+
}
|
|
1119
|
+
if (source[i] !== '"') {
|
|
1120
|
+
out += source[i];
|
|
1121
|
+
i++;
|
|
1122
|
+
continue;
|
|
1123
|
+
}
|
|
1124
|
+
let j = i + 1;
|
|
1125
|
+
let closed = false;
|
|
1126
|
+
let hasNewline = false;
|
|
1127
|
+
while (j < source.length) {
|
|
1128
|
+
const ch = source[j];
|
|
1129
|
+
if (ch === "\\") {
|
|
1130
|
+
j += 2;
|
|
1131
|
+
continue;
|
|
1132
|
+
}
|
|
1133
|
+
if (ch === "\n") {
|
|
1134
|
+
if (STATEMENT_START.test(source.slice(j + 1))) break;
|
|
1135
|
+
hasNewline = true;
|
|
1136
|
+
}
|
|
1137
|
+
if (ch === '"') {
|
|
1138
|
+
closed = true;
|
|
1139
|
+
break;
|
|
1140
|
+
}
|
|
1141
|
+
j++;
|
|
1142
|
+
}
|
|
1143
|
+
if (!closed) {
|
|
1144
|
+
const nl = source.indexOf("\n", i);
|
|
1145
|
+
if (nl < 0) {
|
|
1146
|
+
out += source.slice(i);
|
|
1147
|
+
break;
|
|
1148
|
+
}
|
|
1149
|
+
out += source.slice(i, nl + 1);
|
|
1150
|
+
i = nl + 1;
|
|
1151
|
+
continue;
|
|
1152
|
+
}
|
|
1153
|
+
if (!hasNewline) {
|
|
1154
|
+
out += source.slice(i, j + 1);
|
|
1155
|
+
i = j + 1;
|
|
1156
|
+
continue;
|
|
1157
|
+
}
|
|
1158
|
+
out += JSON.stringify(decodeLangString(source.slice(i + 1, j)));
|
|
1159
|
+
i = j + 1;
|
|
1160
|
+
}
|
|
1161
|
+
return out;
|
|
1074
1162
|
}
|
|
1075
1163
|
function splitResponse(source, options = {}) {
|
|
1076
1164
|
const markdown = options.markdown === true;
|
|
@@ -1092,8 +1180,15 @@ function splitResponse(source, options = {}) {
|
|
|
1092
1180
|
text = [];
|
|
1093
1181
|
if (joined) (seenUi ? after : before).push(joined);
|
|
1094
1182
|
};
|
|
1095
|
-
|
|
1183
|
+
const lines = input.split(/\r?\n/);
|
|
1184
|
+
for (let index = 0; index < lines.length; index++) {
|
|
1185
|
+
const line = lines[index];
|
|
1096
1186
|
const trimmed = line.trim();
|
|
1187
|
+
if (state.quote) {
|
|
1188
|
+
ui.push(line);
|
|
1189
|
+
scan(line, state, true);
|
|
1190
|
+
continue;
|
|
1191
|
+
}
|
|
1097
1192
|
if (codeFence !== null) {
|
|
1098
1193
|
text.push(line);
|
|
1099
1194
|
if (trimmed.startsWith(codeFence)) {
|
|
@@ -1122,7 +1217,8 @@ function splitResponse(source, options = {}) {
|
|
|
1122
1217
|
flushText();
|
|
1123
1218
|
seenUi = true;
|
|
1124
1219
|
ui.push(line);
|
|
1125
|
-
scan(line, state);
|
|
1220
|
+
scan(line, state, true);
|
|
1221
|
+
if (state.quote && !quoteClosesLater(lines, index + 1, state)) state.quote = null;
|
|
1126
1222
|
continue;
|
|
1127
1223
|
}
|
|
1128
1224
|
if (trimmed === "") {
|
|
@@ -1134,7 +1230,7 @@ function splitResponse(source, options = {}) {
|
|
|
1134
1230
|
flushText();
|
|
1135
1231
|
return {
|
|
1136
1232
|
before,
|
|
1137
|
-
ui: ui.join("\n"),
|
|
1233
|
+
ui: foldMultilineStrings(ui.join("\n")),
|
|
1138
1234
|
after,
|
|
1139
1235
|
pure: !sawFence && before.length === 0 && after.length === 0
|
|
1140
1236
|
};
|
|
@@ -1144,7 +1240,7 @@ function splitResponse(source, options = {}) {
|
|
|
1144
1240
|
function resolveMixedContent(response, options = {}) {
|
|
1145
1241
|
const { mixedContent = true, isStreaming = false, repair = true, markdown = false } = options;
|
|
1146
1242
|
const parts = mixedContent && response ? splitResponse(response, { streaming: isStreaming, markdown }) : null;
|
|
1147
|
-
const raw = parts && !parts.pure ? parts.ui : response;
|
|
1243
|
+
const raw = parts && !parts.pure ? parts.ui : typeof response === "string" ? foldMultilineStrings(response) : response;
|
|
1148
1244
|
const ui = !repair || !mixedContent || isStreaming || typeof raw !== "string" || raw.length === 0 ? raw : normalizeProgram(raw);
|
|
1149
1245
|
const before = _nullishCoalesce(_optionalChain([parts, 'optionalAccess', _44 => _44.before]), () => ( []));
|
|
1150
1246
|
const after = _nullishCoalesce(_optionalChain([parts, 'optionalAccess', _45 => _45.after]), () => ( []));
|
|
@@ -2115,6 +2211,10 @@ var PATHS = {
|
|
|
2115
2211
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M18 6 6 18" }),
|
|
2116
2212
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "m6 6 12 12" })
|
|
2117
2213
|
] }),
|
|
2214
|
+
pencil: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2215
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }),
|
|
2216
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "m15 5 4 4" })
|
|
2217
|
+
] }),
|
|
2118
2218
|
maximize: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2119
2219
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M8 3H5a2 2 0 0 0-2 2v3" }),
|
|
2120
2220
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M21 8V5a2 2 0 0 0-2-2h-3" }),
|
|
@@ -3940,6 +4040,96 @@ function DocumentEditorImpl(props) {
|
|
|
3940
4040
|
);
|
|
3941
4041
|
}
|
|
3942
4042
|
|
|
4043
|
+
// src/features/document-editor/document-preview.tsx
|
|
4044
|
+
|
|
4045
|
+
var _reactdom = require('react-dom');
|
|
4046
|
+
|
|
4047
|
+
function DocumentPreview(props) {
|
|
4048
|
+
const { documentId, title = "Untitled document", content, editable = true } = props;
|
|
4049
|
+
const { theme: contextTheme } = useJuneTheme();
|
|
4050
|
+
const resolvedTheme = props.theme && props.theme !== "auto" ? props.theme : contextTheme;
|
|
4051
|
+
const ctxOptions = useDocumentOptions();
|
|
4052
|
+
const store = _react.useMemo.call(void 0, () => _nullishCoalesce(_nullishCoalesce(_optionalChain([props, 'access', _423 => _423.options, 'optionalAccess', _424 => _424.store]), () => ( ctxOptions.store)), () => ( getDefaultDocumentStore())), [_optionalChain([props, 'access', _425 => _425.options, 'optionalAccess', _426 => _426.store]), ctxOptions.store]);
|
|
4053
|
+
const storedJson = useDocumentValue(store, documentId, (record) => _optionalChain([record, 'optionalAccess', _427 => _427.json]));
|
|
4054
|
+
const [open, setOpen] = _react.useState.call(void 0, false);
|
|
4055
|
+
const [preferStore, setPreferStore] = _react.useState.call(void 0, false);
|
|
4056
|
+
const contentKey = typeof content === "string" ? content : content ? JSON.stringify(content) : "";
|
|
4057
|
+
_react.useEffect.call(void 0, () => {
|
|
4058
|
+
setPreferStore(false);
|
|
4059
|
+
}, [contentKey]);
|
|
4060
|
+
const html = _react.useMemo.call(void 0, () => {
|
|
4061
|
+
try {
|
|
4062
|
+
const fromContent = contentKey ? _chunkG6YPSE6Jcjs.parseDocumentContent.call(void 0, contentKey) : null;
|
|
4063
|
+
const doc = preferStore && storedJson ? storedJson : fromContent;
|
|
4064
|
+
return doc ? _chunkG6YPSE6Jcjs.docToHtml.call(void 0, doc) : "";
|
|
4065
|
+
} catch (e10) {
|
|
4066
|
+
return "";
|
|
4067
|
+
}
|
|
4068
|
+
}, [contentKey, preferStore, storedJson]);
|
|
4069
|
+
_react.useEffect.call(void 0, () => {
|
|
4070
|
+
if (!open || typeof document === "undefined") return;
|
|
4071
|
+
const prev = document.body.style.overflow;
|
|
4072
|
+
document.body.style.overflow = "hidden";
|
|
4073
|
+
return () => {
|
|
4074
|
+
document.body.style.overflow = prev;
|
|
4075
|
+
};
|
|
4076
|
+
}, [open]);
|
|
4077
|
+
const close = () => {
|
|
4078
|
+
setPreferStore(true);
|
|
4079
|
+
setOpen(false);
|
|
4080
|
+
};
|
|
4081
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4082
|
+
!open ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "june-doc june-doc-card", "data-theme": resolvedTheme, "aria-label": title, children: [
|
|
4083
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "june-doc-card__bar", children: [
|
|
4084
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "june-doc-card__title", children: title }),
|
|
4085
|
+
editable ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "june-doc__btn june-doc__btn--icon june-doc__btn--ghost", "aria-label": "Edit document", title: "Edit", onClick: () => setOpen(true), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { name: "pencil", size: 16 }) }) : null
|
|
4086
|
+
] }),
|
|
4087
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "june-doc-card__canvas", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "june-doc-card__sheet", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "june-doc__prose", dangerouslySetInnerHTML: { __html: html } }) }) })
|
|
4088
|
+
] }) : null,
|
|
4089
|
+
open && typeof document !== "undefined" ? _reactdom.createPortal.call(void 0,
|
|
4090
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "june-doc-modal", "data-theme": resolvedTheme, onMouseDown: close, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4091
|
+
"div",
|
|
4092
|
+
{
|
|
4093
|
+
className: "june-doc june-doc-modal__panel",
|
|
4094
|
+
role: "dialog",
|
|
4095
|
+
"aria-modal": "true",
|
|
4096
|
+
"aria-label": title,
|
|
4097
|
+
tabIndex: -1,
|
|
4098
|
+
"data-theme": resolvedTheme,
|
|
4099
|
+
onMouseDown: (event) => event.stopPropagation(),
|
|
4100
|
+
onKeyDown: (event) => {
|
|
4101
|
+
if (event.key !== "Escape" || event.defaultPrevented) return;
|
|
4102
|
+
if (event.currentTarget.querySelector(".june-doc--fullscreen")) return;
|
|
4103
|
+
close();
|
|
4104
|
+
},
|
|
4105
|
+
children: [
|
|
4106
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "june-doc-modal__bar", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { type: "button", className: "june-doc__btn june-doc__btn--ghost", "aria-label": "Close document", onClick: close, children: [
|
|
4107
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { name: "close", size: 16 }),
|
|
4108
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Close" })
|
|
4109
|
+
] }) }),
|
|
4110
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "june-doc-modal__body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4111
|
+
DocumentEditorImpl,
|
|
4112
|
+
{
|
|
4113
|
+
documentId: props.documentId,
|
|
4114
|
+
title: props.title,
|
|
4115
|
+
content: props.content,
|
|
4116
|
+
documentType: props.documentType,
|
|
4117
|
+
status: props.status,
|
|
4118
|
+
editable: props.editable,
|
|
4119
|
+
exportFormats: props.exportFormats,
|
|
4120
|
+
theme: props.theme,
|
|
4121
|
+
generating: props.generating,
|
|
4122
|
+
options: props.options
|
|
4123
|
+
}
|
|
4124
|
+
) })
|
|
4125
|
+
]
|
|
4126
|
+
}
|
|
4127
|
+
) }),
|
|
4128
|
+
document.body
|
|
4129
|
+
) : null
|
|
4130
|
+
] });
|
|
4131
|
+
}
|
|
4132
|
+
|
|
3943
4133
|
// src/features/document-editor/document-component.tsx
|
|
3944
4134
|
|
|
3945
4135
|
var DOCUMENT_COMPONENT_DESCRIPTION = 'Custom component. An editable document. DocumentEditor(documentId, title, content, documentType?, status?, editable?, exportFormats?). Place it in the root container (Card or Stack). "content" is the full document body as one Markdown string. Reuse documentId when revising the same document. Use it only when the user asks to create or revise a document.';
|
|
@@ -3960,18 +4150,19 @@ function DocumentEditor(props) {
|
|
|
3960
4150
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DocumentEditorImpl, { ...props });
|
|
3961
4151
|
}
|
|
3962
4152
|
function OpenUIDocument({ props }) {
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
);
|
|
4153
|
+
const { isStreaming } = useJuneRuntime();
|
|
4154
|
+
const shared = {
|
|
4155
|
+
documentId: props.documentId,
|
|
4156
|
+
title: props.title,
|
|
4157
|
+
content: props.content,
|
|
4158
|
+
documentType: props.documentType,
|
|
4159
|
+
status: props.status,
|
|
4160
|
+
editable: props.editable,
|
|
4161
|
+
exportFormats: props.exportFormats
|
|
4162
|
+
};
|
|
4163
|
+
if (isStreaming) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DocumentDraft, { title: props.title, state: "drafting" });
|
|
4164
|
+
if (props.editable === false) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DocumentEditor, { ...shared });
|
|
4165
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DocumentPreview, { ...shared });
|
|
3975
4166
|
}
|
|
3976
4167
|
var JuneDocumentEditorComponent = _reactlang.defineComponent.call(void 0, {
|
|
3977
4168
|
name: "DocumentEditor",
|
|
@@ -3986,7 +4177,7 @@ function withDocumentEditor(library) {
|
|
|
3986
4177
|
add: [{ component: JuneDocumentEditorComponent, slots: ["Card"] }]
|
|
3987
4178
|
}
|
|
3988
4179
|
});
|
|
3989
|
-
} catch (
|
|
4180
|
+
} catch (e11) {
|
|
3990
4181
|
return library.extend({ components: { add: [JuneDocumentEditorComponent] } });
|
|
3991
4182
|
}
|
|
3992
4183
|
}
|
|
@@ -4066,7 +4257,7 @@ var defaultToolApprovalLabels = {
|
|
|
4066
4257
|
var format = (value) => {
|
|
4067
4258
|
try {
|
|
4068
4259
|
return _nullishCoalesce(JSON.stringify(value, null, 2), () => ( String(value)));
|
|
4069
|
-
} catch (
|
|
4260
|
+
} catch (e12) {
|
|
4070
4261
|
return String(value);
|
|
4071
4262
|
}
|
|
4072
4263
|
};
|
|
@@ -4082,19 +4273,19 @@ function ToolApproval({
|
|
|
4082
4273
|
className
|
|
4083
4274
|
}) {
|
|
4084
4275
|
const labels = { ...defaultToolApprovalLabels, ...labelOverrides };
|
|
4085
|
-
const options = _optionalChain([request, 'access',
|
|
4276
|
+
const options = _optionalChain([request, 'access', _428 => _428.options, 'optionalAccess', _429 => _429.length]) ? request.options : ["approve", "reject"];
|
|
4086
4277
|
const [draft, setDraft] = _react.useState.call(void 0, null);
|
|
4087
4278
|
const [draftError, setDraftError] = _react.useState.call(void 0, null);
|
|
4088
4279
|
const titleId = _react.useId.call(void 0, );
|
|
4089
4280
|
const pending = status === "pending";
|
|
4090
4281
|
const decide = (decision) => {
|
|
4091
|
-
if (!disabled && pending) _optionalChain([onDecide, 'optionalCall',
|
|
4282
|
+
if (!disabled && pending) _optionalChain([onDecide, 'optionalCall', _430 => _430(decision)]);
|
|
4092
4283
|
};
|
|
4093
4284
|
const saveEdit = () => {
|
|
4094
4285
|
let editedArguments;
|
|
4095
4286
|
try {
|
|
4096
4287
|
editedArguments = JSON.parse(_nullishCoalesce(draft, () => ( "null")));
|
|
4097
|
-
} catch (
|
|
4288
|
+
} catch (e13) {
|
|
4098
4289
|
setDraftError(labels.invalidJson);
|
|
4099
4290
|
return;
|
|
4100
4291
|
}
|
|
@@ -4183,7 +4374,7 @@ function useToolApproval() {
|
|
|
4183
4374
|
const settle = _react.useCallback.call(void 0, (id, decision) => {
|
|
4184
4375
|
const resolve = waiters.current.get(id);
|
|
4185
4376
|
waiters.current.delete(id);
|
|
4186
|
-
_optionalChain([resolve, 'optionalCall',
|
|
4377
|
+
_optionalChain([resolve, 'optionalCall', _431 => _431(decision)]);
|
|
4187
4378
|
}, []);
|
|
4188
4379
|
const request = _react.useCallback.call(void 0, (input) => {
|
|
4189
4380
|
const id = _nullishCoalesce(input.id, () => ( nextId()));
|
|
@@ -4258,7 +4449,7 @@ function messageContentToText(content) {
|
|
|
4258
4449
|
function parse(data) {
|
|
4259
4450
|
try {
|
|
4260
4451
|
return JSON.parse(data);
|
|
4261
|
-
} catch (
|
|
4452
|
+
} catch (e14) {
|
|
4262
4453
|
return void 0;
|
|
4263
4454
|
}
|
|
4264
4455
|
}
|
|
@@ -4272,7 +4463,7 @@ function createLangGraphExtractor(options = {}) {
|
|
|
4272
4463
|
if (!Array.isArray(parsed)) return null;
|
|
4273
4464
|
const [chunk, metadata] = parsed;
|
|
4274
4465
|
if (!chunk || typeof chunk !== "object" || !isAiMessage(chunk)) return null;
|
|
4275
|
-
if (nodes && !(typeof _optionalChain([metadata, 'optionalAccess',
|
|
4466
|
+
if (nodes && !(typeof _optionalChain([metadata, 'optionalAccess', _432 => _432.langgraph_node]) === "string" && nodes.has(metadata.langgraph_node))) return null;
|
|
4276
4467
|
return messageContentToText(chunk.content) || null;
|
|
4277
4468
|
}
|
|
4278
4469
|
if (base === "messages/partial" || base === "messages/complete") {
|
|
@@ -4311,8 +4502,8 @@ function interruptToApprovalRequests(value, idPrefix = "interrupt") {
|
|
|
4311
4502
|
const configs = Array.isArray(hitl.review_configs) ? hitl.review_configs : [];
|
|
4312
4503
|
return hitl.action_requests.flatMap((action, index) => {
|
|
4313
4504
|
if (!action || typeof action.name !== "string") return [];
|
|
4314
|
-
const config = configs.find((c) => _optionalChain([c, 'optionalAccess',
|
|
4315
|
-
const allowed = Array.isArray(_optionalChain([config, 'optionalAccess',
|
|
4505
|
+
const config = configs.find((c) => _optionalChain([c, 'optionalAccess', _433 => _433.action_name]) === action.name);
|
|
4506
|
+
const allowed = Array.isArray(_optionalChain([config, 'optionalAccess', _434 => _434.allowed_decisions])) ? config.allowed_decisions.filter(
|
|
4316
4507
|
(d) => d === "approve" || d === "reject" || d === "edit"
|
|
4317
4508
|
) : void 0;
|
|
4318
4509
|
return [
|
|
@@ -1056,7 +1056,7 @@ var STATEMENT_START = /^\$?[A-Za-z_]\w*\s*=/;
|
|
|
1056
1056
|
var PENDING_IDENTIFIER = /^\s*\$?[A-Za-z_]\w*\s*$/;
|
|
1057
1057
|
var FENCE = /^(`{3,})\s*([\w-]*)/;
|
|
1058
1058
|
var OPENUI_FENCE_LANGS = /* @__PURE__ */ new Set(["", "openui", "openui-lang", "openuilang"]);
|
|
1059
|
-
function scan(line, state) {
|
|
1059
|
+
function scan(line, state, preserveQuote = false) {
|
|
1060
1060
|
for (let i = 0; i < line.length; i++) {
|
|
1061
1061
|
const ch = line[i];
|
|
1062
1062
|
if (state.quote) {
|
|
@@ -1070,7 +1070,95 @@ function scan(line, state) {
|
|
|
1070
1070
|
state.depth = Math.max(0, state.depth - 1);
|
|
1071
1071
|
}
|
|
1072
1072
|
}
|
|
1073
|
-
state.quote = null;
|
|
1073
|
+
if (!preserveQuote) state.quote = null;
|
|
1074
|
+
}
|
|
1075
|
+
function quoteClosesLater(lines, from, state) {
|
|
1076
|
+
const probe = { depth: state.depth, quote: state.quote };
|
|
1077
|
+
for (let i = from; i < lines.length; i++) {
|
|
1078
|
+
const line = lines[i];
|
|
1079
|
+
if (probe.depth === 0 && STATEMENT_START.test(line.trim())) return false;
|
|
1080
|
+
scan(line, probe, true);
|
|
1081
|
+
if (!probe.quote) return true;
|
|
1082
|
+
}
|
|
1083
|
+
return false;
|
|
1084
|
+
}
|
|
1085
|
+
function decodeLangString(raw) {
|
|
1086
|
+
let out = "";
|
|
1087
|
+
for (let i = 0; i < raw.length; i++) {
|
|
1088
|
+
const ch = raw[i];
|
|
1089
|
+
if (ch === "\\" && i + 1 < raw.length) {
|
|
1090
|
+
const next = raw[i + 1];
|
|
1091
|
+
out += next === "n" ? "\n" : next === "t" ? " " : next === "r" ? "\r" : next === "b" ? "\b" : next === "f" ? "\f" : next;
|
|
1092
|
+
i++;
|
|
1093
|
+
continue;
|
|
1094
|
+
}
|
|
1095
|
+
out += ch;
|
|
1096
|
+
}
|
|
1097
|
+
return out.replace(/\r/g, "");
|
|
1098
|
+
}
|
|
1099
|
+
function foldMultilineStrings(source) {
|
|
1100
|
+
let out = "";
|
|
1101
|
+
let i = 0;
|
|
1102
|
+
while (i < source.length) {
|
|
1103
|
+
if (source.startsWith('"""', i)) {
|
|
1104
|
+
const end = source.indexOf('"""', i + 3);
|
|
1105
|
+
if (end < 0) {
|
|
1106
|
+
const nl = source.indexOf("\n", i);
|
|
1107
|
+
if (nl < 0) {
|
|
1108
|
+
out += source.slice(i);
|
|
1109
|
+
break;
|
|
1110
|
+
}
|
|
1111
|
+
out += source.slice(i, nl + 1);
|
|
1112
|
+
i = nl + 1;
|
|
1113
|
+
continue;
|
|
1114
|
+
}
|
|
1115
|
+
out += JSON.stringify(source.slice(i + 3, end).replace(/\r/g, ""));
|
|
1116
|
+
i = end + 3;
|
|
1117
|
+
continue;
|
|
1118
|
+
}
|
|
1119
|
+
if (source[i] !== '"') {
|
|
1120
|
+
out += source[i];
|
|
1121
|
+
i++;
|
|
1122
|
+
continue;
|
|
1123
|
+
}
|
|
1124
|
+
let j = i + 1;
|
|
1125
|
+
let closed = false;
|
|
1126
|
+
let hasNewline = false;
|
|
1127
|
+
while (j < source.length) {
|
|
1128
|
+
const ch = source[j];
|
|
1129
|
+
if (ch === "\\") {
|
|
1130
|
+
j += 2;
|
|
1131
|
+
continue;
|
|
1132
|
+
}
|
|
1133
|
+
if (ch === "\n") {
|
|
1134
|
+
if (STATEMENT_START.test(source.slice(j + 1))) break;
|
|
1135
|
+
hasNewline = true;
|
|
1136
|
+
}
|
|
1137
|
+
if (ch === '"') {
|
|
1138
|
+
closed = true;
|
|
1139
|
+
break;
|
|
1140
|
+
}
|
|
1141
|
+
j++;
|
|
1142
|
+
}
|
|
1143
|
+
if (!closed) {
|
|
1144
|
+
const nl = source.indexOf("\n", i);
|
|
1145
|
+
if (nl < 0) {
|
|
1146
|
+
out += source.slice(i);
|
|
1147
|
+
break;
|
|
1148
|
+
}
|
|
1149
|
+
out += source.slice(i, nl + 1);
|
|
1150
|
+
i = nl + 1;
|
|
1151
|
+
continue;
|
|
1152
|
+
}
|
|
1153
|
+
if (!hasNewline) {
|
|
1154
|
+
out += source.slice(i, j + 1);
|
|
1155
|
+
i = j + 1;
|
|
1156
|
+
continue;
|
|
1157
|
+
}
|
|
1158
|
+
out += JSON.stringify(decodeLangString(source.slice(i + 1, j)));
|
|
1159
|
+
i = j + 1;
|
|
1160
|
+
}
|
|
1161
|
+
return out;
|
|
1074
1162
|
}
|
|
1075
1163
|
function splitResponse(source, options = {}) {
|
|
1076
1164
|
const markdown = options.markdown === true;
|
|
@@ -1092,8 +1180,15 @@ function splitResponse(source, options = {}) {
|
|
|
1092
1180
|
text = [];
|
|
1093
1181
|
if (joined) (seenUi ? after : before).push(joined);
|
|
1094
1182
|
};
|
|
1095
|
-
|
|
1183
|
+
const lines = input.split(/\r?\n/);
|
|
1184
|
+
for (let index = 0; index < lines.length; index++) {
|
|
1185
|
+
const line = lines[index];
|
|
1096
1186
|
const trimmed = line.trim();
|
|
1187
|
+
if (state.quote) {
|
|
1188
|
+
ui.push(line);
|
|
1189
|
+
scan(line, state, true);
|
|
1190
|
+
continue;
|
|
1191
|
+
}
|
|
1097
1192
|
if (codeFence !== null) {
|
|
1098
1193
|
text.push(line);
|
|
1099
1194
|
if (trimmed.startsWith(codeFence)) {
|
|
@@ -1122,7 +1217,8 @@ function splitResponse(source, options = {}) {
|
|
|
1122
1217
|
flushText();
|
|
1123
1218
|
seenUi = true;
|
|
1124
1219
|
ui.push(line);
|
|
1125
|
-
scan(line, state);
|
|
1220
|
+
scan(line, state, true);
|
|
1221
|
+
if (state.quote && !quoteClosesLater(lines, index + 1, state)) state.quote = null;
|
|
1126
1222
|
continue;
|
|
1127
1223
|
}
|
|
1128
1224
|
if (trimmed === "") {
|
|
@@ -1134,7 +1230,7 @@ function splitResponse(source, options = {}) {
|
|
|
1134
1230
|
flushText();
|
|
1135
1231
|
return {
|
|
1136
1232
|
before,
|
|
1137
|
-
ui: ui.join("\n"),
|
|
1233
|
+
ui: foldMultilineStrings(ui.join("\n")),
|
|
1138
1234
|
after,
|
|
1139
1235
|
pure: !sawFence && before.length === 0 && after.length === 0
|
|
1140
1236
|
};
|
|
@@ -1144,7 +1240,7 @@ function splitResponse(source, options = {}) {
|
|
|
1144
1240
|
function resolveMixedContent(response, options = {}) {
|
|
1145
1241
|
const { mixedContent = true, isStreaming = false, repair = true, markdown = false } = options;
|
|
1146
1242
|
const parts = mixedContent && response ? splitResponse(response, { streaming: isStreaming, markdown }) : null;
|
|
1147
|
-
const raw = parts && !parts.pure ? parts.ui : response;
|
|
1243
|
+
const raw = parts && !parts.pure ? parts.ui : typeof response === "string" ? foldMultilineStrings(response) : response;
|
|
1148
1244
|
const ui = !repair || !mixedContent || isStreaming || typeof raw !== "string" || raw.length === 0 ? raw : normalizeProgram(raw);
|
|
1149
1245
|
const before = parts?.before ?? [];
|
|
1150
1246
|
const after = parts?.after ?? [];
|
|
@@ -2115,6 +2211,10 @@ var PATHS = {
|
|
|
2115
2211
|
/* @__PURE__ */ jsx8("path", { d: "M18 6 6 18" }),
|
|
2116
2212
|
/* @__PURE__ */ jsx8("path", { d: "m6 6 12 12" })
|
|
2117
2213
|
] }),
|
|
2214
|
+
pencil: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
2215
|
+
/* @__PURE__ */ jsx8("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }),
|
|
2216
|
+
/* @__PURE__ */ jsx8("path", { d: "m15 5 4 4" })
|
|
2217
|
+
] }),
|
|
2118
2218
|
maximize: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
2119
2219
|
/* @__PURE__ */ jsx8("path", { d: "M8 3H5a2 2 0 0 0-2 2v3" }),
|
|
2120
2220
|
/* @__PURE__ */ jsx8("path", { d: "M21 8V5a2 2 0 0 0-2-2h-3" }),
|
|
@@ -3940,8 +4040,98 @@ function DocumentEditorImpl(props) {
|
|
|
3940
4040
|
);
|
|
3941
4041
|
}
|
|
3942
4042
|
|
|
4043
|
+
// src/features/document-editor/document-preview.tsx
|
|
4044
|
+
import { useEffect as useEffect8, useMemo as useMemo6, useState as useState7 } from "react";
|
|
4045
|
+
import { createPortal } from "react-dom";
|
|
4046
|
+
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4047
|
+
function DocumentPreview(props) {
|
|
4048
|
+
const { documentId, title = "Untitled document", content, editable = true } = props;
|
|
4049
|
+
const { theme: contextTheme } = useJuneTheme();
|
|
4050
|
+
const resolvedTheme = props.theme && props.theme !== "auto" ? props.theme : contextTheme;
|
|
4051
|
+
const ctxOptions = useDocumentOptions();
|
|
4052
|
+
const store = useMemo6(() => props.options?.store ?? ctxOptions.store ?? getDefaultDocumentStore(), [props.options?.store, ctxOptions.store]);
|
|
4053
|
+
const storedJson = useDocumentValue(store, documentId, (record) => record?.json);
|
|
4054
|
+
const [open, setOpen] = useState7(false);
|
|
4055
|
+
const [preferStore, setPreferStore] = useState7(false);
|
|
4056
|
+
const contentKey = typeof content === "string" ? content : content ? JSON.stringify(content) : "";
|
|
4057
|
+
useEffect8(() => {
|
|
4058
|
+
setPreferStore(false);
|
|
4059
|
+
}, [contentKey]);
|
|
4060
|
+
const html = useMemo6(() => {
|
|
4061
|
+
try {
|
|
4062
|
+
const fromContent = contentKey ? parseDocumentContent(contentKey) : null;
|
|
4063
|
+
const doc = preferStore && storedJson ? storedJson : fromContent;
|
|
4064
|
+
return doc ? docToHtml(doc) : "";
|
|
4065
|
+
} catch {
|
|
4066
|
+
return "";
|
|
4067
|
+
}
|
|
4068
|
+
}, [contentKey, preferStore, storedJson]);
|
|
4069
|
+
useEffect8(() => {
|
|
4070
|
+
if (!open || typeof document === "undefined") return;
|
|
4071
|
+
const prev = document.body.style.overflow;
|
|
4072
|
+
document.body.style.overflow = "hidden";
|
|
4073
|
+
return () => {
|
|
4074
|
+
document.body.style.overflow = prev;
|
|
4075
|
+
};
|
|
4076
|
+
}, [open]);
|
|
4077
|
+
const close = () => {
|
|
4078
|
+
setPreferStore(true);
|
|
4079
|
+
setOpen(false);
|
|
4080
|
+
};
|
|
4081
|
+
return /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
4082
|
+
!open ? /* @__PURE__ */ jsxs11("section", { className: "june-doc june-doc-card", "data-theme": resolvedTheme, "aria-label": title, children: [
|
|
4083
|
+
/* @__PURE__ */ jsxs11("div", { className: "june-doc-card__bar", children: [
|
|
4084
|
+
/* @__PURE__ */ jsx17("span", { className: "june-doc-card__title", children: title }),
|
|
4085
|
+
editable ? /* @__PURE__ */ jsx17("button", { type: "button", className: "june-doc__btn june-doc__btn--icon june-doc__btn--ghost", "aria-label": "Edit document", title: "Edit", onClick: () => setOpen(true), children: /* @__PURE__ */ jsx17(Icon, { name: "pencil", size: 16 }) }) : null
|
|
4086
|
+
] }),
|
|
4087
|
+
/* @__PURE__ */ jsx17("div", { className: "june-doc-card__canvas", children: /* @__PURE__ */ jsx17("div", { className: "june-doc-card__sheet", children: /* @__PURE__ */ jsx17("div", { className: "june-doc__prose", dangerouslySetInnerHTML: { __html: html } }) }) })
|
|
4088
|
+
] }) : null,
|
|
4089
|
+
open && typeof document !== "undefined" ? createPortal(
|
|
4090
|
+
/* @__PURE__ */ jsx17("div", { className: "june-doc-modal", "data-theme": resolvedTheme, onMouseDown: close, children: /* @__PURE__ */ jsxs11(
|
|
4091
|
+
"div",
|
|
4092
|
+
{
|
|
4093
|
+
className: "june-doc june-doc-modal__panel",
|
|
4094
|
+
role: "dialog",
|
|
4095
|
+
"aria-modal": "true",
|
|
4096
|
+
"aria-label": title,
|
|
4097
|
+
tabIndex: -1,
|
|
4098
|
+
"data-theme": resolvedTheme,
|
|
4099
|
+
onMouseDown: (event) => event.stopPropagation(),
|
|
4100
|
+
onKeyDown: (event) => {
|
|
4101
|
+
if (event.key !== "Escape" || event.defaultPrevented) return;
|
|
4102
|
+
if (event.currentTarget.querySelector(".june-doc--fullscreen")) return;
|
|
4103
|
+
close();
|
|
4104
|
+
},
|
|
4105
|
+
children: [
|
|
4106
|
+
/* @__PURE__ */ jsx17("div", { className: "june-doc-modal__bar", children: /* @__PURE__ */ jsxs11("button", { type: "button", className: "june-doc__btn june-doc__btn--ghost", "aria-label": "Close document", onClick: close, children: [
|
|
4107
|
+
/* @__PURE__ */ jsx17(Icon, { name: "close", size: 16 }),
|
|
4108
|
+
/* @__PURE__ */ jsx17("span", { children: "Close" })
|
|
4109
|
+
] }) }),
|
|
4110
|
+
/* @__PURE__ */ jsx17("div", { className: "june-doc-modal__body", children: /* @__PURE__ */ jsx17(
|
|
4111
|
+
DocumentEditorImpl,
|
|
4112
|
+
{
|
|
4113
|
+
documentId: props.documentId,
|
|
4114
|
+
title: props.title,
|
|
4115
|
+
content: props.content,
|
|
4116
|
+
documentType: props.documentType,
|
|
4117
|
+
status: props.status,
|
|
4118
|
+
editable: props.editable,
|
|
4119
|
+
exportFormats: props.exportFormats,
|
|
4120
|
+
theme: props.theme,
|
|
4121
|
+
generating: props.generating,
|
|
4122
|
+
options: props.options
|
|
4123
|
+
}
|
|
4124
|
+
) })
|
|
4125
|
+
]
|
|
4126
|
+
}
|
|
4127
|
+
) }),
|
|
4128
|
+
document.body
|
|
4129
|
+
) : null
|
|
4130
|
+
] });
|
|
4131
|
+
}
|
|
4132
|
+
|
|
3943
4133
|
// src/features/document-editor/document-component.tsx
|
|
3944
|
-
import { jsx as
|
|
4134
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
3945
4135
|
var DOCUMENT_COMPONENT_DESCRIPTION = 'Custom component. An editable document. DocumentEditor(documentId, title, content, documentType?, status?, editable?, exportFormats?). Place it in the root container (Card or Stack). "content" is the full document body as one Markdown string. Reuse documentId when revising the same document. Use it only when the user asks to create or revise a document.';
|
|
3946
4136
|
var documentProps = z.object({
|
|
3947
4137
|
documentId: z.string().describe("Stable id. Reuse it when revising the same document."),
|
|
@@ -3955,23 +4145,24 @@ var documentProps = z.object({
|
|
|
3955
4145
|
function DocumentEditor(props) {
|
|
3956
4146
|
const { isStreaming } = useJuneRuntime();
|
|
3957
4147
|
if (props.generating || isStreaming) {
|
|
3958
|
-
return /* @__PURE__ */
|
|
4148
|
+
return /* @__PURE__ */ jsx18(DocumentDraft, { title: props.title, state: "drafting" });
|
|
3959
4149
|
}
|
|
3960
|
-
return /* @__PURE__ */
|
|
4150
|
+
return /* @__PURE__ */ jsx18(DocumentEditorImpl, { ...props });
|
|
3961
4151
|
}
|
|
3962
4152
|
function OpenUIDocument({ props }) {
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
);
|
|
4153
|
+
const { isStreaming } = useJuneRuntime();
|
|
4154
|
+
const shared = {
|
|
4155
|
+
documentId: props.documentId,
|
|
4156
|
+
title: props.title,
|
|
4157
|
+
content: props.content,
|
|
4158
|
+
documentType: props.documentType,
|
|
4159
|
+
status: props.status,
|
|
4160
|
+
editable: props.editable,
|
|
4161
|
+
exportFormats: props.exportFormats
|
|
4162
|
+
};
|
|
4163
|
+
if (isStreaming) return /* @__PURE__ */ jsx18(DocumentDraft, { title: props.title, state: "drafting" });
|
|
4164
|
+
if (props.editable === false) return /* @__PURE__ */ jsx18(DocumentEditor, { ...shared });
|
|
4165
|
+
return /* @__PURE__ */ jsx18(DocumentPreview, { ...shared });
|
|
3975
4166
|
}
|
|
3976
4167
|
var JuneDocumentEditorComponent = defineComponent3({
|
|
3977
4168
|
name: "DocumentEditor",
|
|
@@ -4044,8 +4235,8 @@ ${docToMarkdown2(r.json)}
|
|
|
4044
4235
|
}
|
|
4045
4236
|
|
|
4046
4237
|
// src/features/tool-approval/tool-approval.tsx
|
|
4047
|
-
import { useId as useId2, useState as
|
|
4048
|
-
import { Fragment as
|
|
4238
|
+
import { useId as useId2, useState as useState8 } from "react";
|
|
4239
|
+
import { Fragment as Fragment6, jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4049
4240
|
var defaultToolApprovalLabels = {
|
|
4050
4241
|
approve: "Approve",
|
|
4051
4242
|
reject: "Reject",
|
|
@@ -4083,8 +4274,8 @@ function ToolApproval({
|
|
|
4083
4274
|
}) {
|
|
4084
4275
|
const labels = { ...defaultToolApprovalLabels, ...labelOverrides };
|
|
4085
4276
|
const options = request.options?.length ? request.options : ["approve", "reject"];
|
|
4086
|
-
const [draft, setDraft] =
|
|
4087
|
-
const [draftError, setDraftError] =
|
|
4277
|
+
const [draft, setDraft] = useState8(null);
|
|
4278
|
+
const [draftError, setDraftError] = useState8(null);
|
|
4088
4279
|
const titleId = useId2();
|
|
4089
4280
|
const pending = status === "pending";
|
|
4090
4281
|
const decide = (decision) => {
|
|
@@ -4102,7 +4293,7 @@ function ToolApproval({
|
|
|
4102
4293
|
setDraft(null);
|
|
4103
4294
|
decide({ choice: "edit", editedArguments });
|
|
4104
4295
|
};
|
|
4105
|
-
return /* @__PURE__ */
|
|
4296
|
+
return /* @__PURE__ */ jsxs12(
|
|
4106
4297
|
"section",
|
|
4107
4298
|
{
|
|
4108
4299
|
className: className ? `june-approval ${className}` : "june-approval",
|
|
@@ -4110,14 +4301,14 @@ function ToolApproval({
|
|
|
4110
4301
|
"data-status": status,
|
|
4111
4302
|
"data-risk": request.risk,
|
|
4112
4303
|
children: [
|
|
4113
|
-
/* @__PURE__ */
|
|
4114
|
-
/* @__PURE__ */
|
|
4115
|
-
request.risk && /* @__PURE__ */
|
|
4116
|
-
request.sideEffect && /* @__PURE__ */
|
|
4304
|
+
/* @__PURE__ */ jsxs12("header", { className: "june-approval__header", children: [
|
|
4305
|
+
/* @__PURE__ */ jsx19("strong", { id: titleId, className: "june-approval__tool", children: request.tool }),
|
|
4306
|
+
request.risk && /* @__PURE__ */ jsx19("span", { className: "june-approval__badge", "data-risk": request.risk, children: labels.risk(request.risk) }),
|
|
4307
|
+
request.sideEffect && /* @__PURE__ */ jsx19("span", { className: "june-approval__badge", children: labels.sideEffect[request.sideEffect] })
|
|
4117
4308
|
] }),
|
|
4118
|
-
request.description && /* @__PURE__ */
|
|
4119
|
-
draft !== null ? /* @__PURE__ */
|
|
4120
|
-
/* @__PURE__ */
|
|
4309
|
+
request.description && /* @__PURE__ */ jsx19("p", { className: "june-approval__description", children: request.description }),
|
|
4310
|
+
draft !== null ? /* @__PURE__ */ jsxs12("div", { className: "june-approval__edit", children: [
|
|
4311
|
+
/* @__PURE__ */ jsx19(
|
|
4121
4312
|
"textarea",
|
|
4122
4313
|
{
|
|
4123
4314
|
"aria-label": labels.edit,
|
|
@@ -4128,12 +4319,12 @@ function ToolApproval({
|
|
|
4128
4319
|
spellCheck: false
|
|
4129
4320
|
}
|
|
4130
4321
|
),
|
|
4131
|
-
draftError && /* @__PURE__ */
|
|
4132
|
-
] }) : hasArguments(request.arguments) ? renderArguments ? renderArguments(request.arguments) : /* @__PURE__ */
|
|
4133
|
-
pending ? /* @__PURE__ */
|
|
4134
|
-
/* @__PURE__ */
|
|
4135
|
-
/* @__PURE__ */
|
|
4136
|
-
] }) : options.map((choice) => /* @__PURE__ */
|
|
4322
|
+
draftError && /* @__PURE__ */ jsx19("p", { role: "alert", className: "june-approval__error", children: draftError })
|
|
4323
|
+
] }) : hasArguments(request.arguments) ? renderArguments ? renderArguments(request.arguments) : /* @__PURE__ */ jsx19("pre", { className: "june-approval__args", children: format(request.arguments) }) : null,
|
|
4324
|
+
pending ? /* @__PURE__ */ jsx19("div", { className: "june-approval__actions", children: draft !== null ? /* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
4325
|
+
/* @__PURE__ */ jsx19("button", { type: "button", className: "june-approval__button", "data-variant": "primary", onClick: saveEdit, disabled, children: labels.save }),
|
|
4326
|
+
/* @__PURE__ */ jsx19("button", { type: "button", className: "june-approval__button", onClick: () => setDraft(null), disabled, children: labels.cancel })
|
|
4327
|
+
] }) : options.map((choice) => /* @__PURE__ */ jsx19(
|
|
4137
4328
|
"button",
|
|
4138
4329
|
{
|
|
4139
4330
|
type: "button",
|
|
@@ -4144,7 +4335,7 @@ function ToolApproval({
|
|
|
4144
4335
|
children: labels[choice]
|
|
4145
4336
|
},
|
|
4146
4337
|
choice
|
|
4147
|
-
)) }) : /* @__PURE__ */
|
|
4338
|
+
)) }) : /* @__PURE__ */ jsxs12("p", { className: "june-approval__status", role: "status", children: [
|
|
4148
4339
|
labels.status[status],
|
|
4149
4340
|
status === "failed" && error ? `: ${error}` : null
|
|
4150
4341
|
] })
|
|
@@ -4154,12 +4345,12 @@ function ToolApproval({
|
|
|
4154
4345
|
}
|
|
4155
4346
|
|
|
4156
4347
|
// src/features/tool-approval/tool-approval-list.tsx
|
|
4157
|
-
import { jsx as
|
|
4348
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
4158
4349
|
function ToolApprovalList({ approvals, pendingOnly = false, renderItem, labels, className }) {
|
|
4159
4350
|
const entries = pendingOnly ? approvals.entries.filter((e) => e.status === "pending") : approvals.entries;
|
|
4160
4351
|
if (entries.length === 0) return null;
|
|
4161
|
-
return /* @__PURE__ */
|
|
4162
|
-
(entry) => renderItem ? /* @__PURE__ */
|
|
4352
|
+
return /* @__PURE__ */ jsx20("div", { className: className ? `june-approval-list ${className}` : "june-approval-list", children: entries.map(
|
|
4353
|
+
(entry) => renderItem ? /* @__PURE__ */ jsx20("div", { children: renderItem(entry, approvals.decide) }, entry.request.id) : /* @__PURE__ */ jsx20(
|
|
4163
4354
|
ToolApproval,
|
|
4164
4355
|
{
|
|
4165
4356
|
request: entry.request,
|
|
@@ -4174,11 +4365,11 @@ function ToolApprovalList({ approvals, pendingOnly = false, renderItem, labels,
|
|
|
4174
4365
|
}
|
|
4175
4366
|
|
|
4176
4367
|
// src/features/tool-approval/use-tool-approval.ts
|
|
4177
|
-
import { useCallback as useCallback5, useEffect as
|
|
4368
|
+
import { useCallback as useCallback5, useEffect as useEffect9, useMemo as useMemo7, useRef as useRef9, useState as useState9 } from "react";
|
|
4178
4369
|
var counter = 0;
|
|
4179
4370
|
var nextId = () => `june-approval-${++counter}`;
|
|
4180
4371
|
function useToolApproval() {
|
|
4181
|
-
const [entries, setEntries] =
|
|
4372
|
+
const [entries, setEntries] = useState9([]);
|
|
4182
4373
|
const waiters = useRef9(/* @__PURE__ */ new Map());
|
|
4183
4374
|
const settle = useCallback5((id, decision) => {
|
|
4184
4375
|
const resolve = waiters.current.get(id);
|
|
@@ -4223,15 +4414,15 @@ function useToolApproval() {
|
|
|
4223
4414
|
},
|
|
4224
4415
|
[request]
|
|
4225
4416
|
);
|
|
4226
|
-
|
|
4417
|
+
useEffect9(() => {
|
|
4227
4418
|
const map = waiters.current;
|
|
4228
4419
|
return () => {
|
|
4229
4420
|
map.forEach((resolve) => resolve({ choice: "reject" }));
|
|
4230
4421
|
map.clear();
|
|
4231
4422
|
};
|
|
4232
4423
|
}, []);
|
|
4233
|
-
const pending =
|
|
4234
|
-
return
|
|
4424
|
+
const pending = useMemo7(() => entries.filter((e) => e.status === "pending"), [entries]);
|
|
4425
|
+
return useMemo7(
|
|
4235
4426
|
() => ({ entries, pending, request, decide, setStatus, dismiss, confirmAction }),
|
|
4236
4427
|
[entries, pending, request, decide, setStatus, dismiss, confirmAction]
|
|
4237
4428
|
);
|
package/dist/entry-core.cjs
CHANGED
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
var
|
|
70
|
+
var _chunkGS4J6OAFcjs = require('./chunk-GS4J6OAF.cjs');
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
@@ -145,4 +145,4 @@ var _chunkG6YPSE6Jcjs = require('./chunk-G6YPSE6J.cjs');
|
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
|
|
148
|
-
exports.ALL_EXPORT_FORMATS =
|
|
148
|
+
exports.ALL_EXPORT_FORMATS = _chunkGS4J6OAFcjs.ALL_EXPORT_FORMATS; exports.ComponentRegistry = _chunkGS4J6OAFcjs.ComponentRegistry; exports.DOCUMENT_COMPONENT_DESCRIPTION = _chunkGS4J6OAFcjs.DOCUMENT_COMPONENT_DESCRIPTION; exports.DocumentBridge = _chunkGS4J6OAFcjs.DocumentBridge; exports.DocumentEditor = _chunkGS4J6OAFcjs.DocumentEditor; exports.JuneDocumentContext = _chunkGS4J6OAFcjs.JuneDocumentContext; exports.JuneDocumentEditorComponent = _chunkGS4J6OAFcjs.JuneDocumentEditorComponent; exports.JuneError = _chunkG6YPSE6Jcjs.JuneError; exports.JuneErrorBoundary = _chunkGS4J6OAFcjs.JuneErrorBoundary; exports.JuneRenderer = _chunkGS4J6OAFcjs.JuneRenderer; exports.JuneRuntimeContext = _chunkGS4J6OAFcjs.JuneRuntimeContext; exports.JuneThemeProvider = _chunkGS4J6OAFcjs.JuneThemeProvider; exports.MarkdownText = _chunkGS4J6OAFcjs.MarkdownText; exports.ToolApproval = _chunkGS4J6OAFcjs.ToolApproval; exports.ToolApprovalList = _chunkGS4J6OAFcjs.ToolApprovalList; exports.consumeStream = _chunkGS4J6OAFcjs.consumeStream; exports.copyDocumentToClipboard = _chunkGS4J6OAFcjs.copyDocumentToClipboard; exports.createActionHandler = _chunkGS4J6OAFcjs.createActionHandler; exports.createComponentRegistry = _chunkGS4J6OAFcjs.createComponentRegistry; exports.createDocumentStore = _chunkGS4J6OAFcjs.createDocumentStore; exports.createJuneLibrary = _chunkGS4J6OAFcjs.createJuneLibrary; exports.createLangGraphExtractor = _chunkGS4J6OAFcjs.createLangGraphExtractor; exports.createTheme = _chunkGS4J6OAFcjs.createTheme; exports.darkTheme = _chunkGS4J6OAFcjs.darkTheme; exports.defaultParseActionEvent = _chunkGS4J6OAFcjs.defaultParseActionEvent; exports.defaultToolApprovalLabels = _chunkGS4J6OAFcjs.defaultToolApprovalLabels; exports.defineComponent = _chunkGS4J6OAFcjs.defineComponent; exports.defineJuneAction = _chunkGS4J6OAFcjs.defineJuneAction; exports.defineJuneComponent = _chunkGS4J6OAFcjs.defineJuneComponent; exports.documentPromptOptions = _chunkGS4J6OAFcjs.documentPromptOptions; exports.downloadResult = _chunkGS4J6OAFcjs.downloadResult; exports.exportDocument = _chunkGS4J6OAFcjs.exportDocument; exports.fetchStream = _chunkGS4J6OAFcjs.fetchStream; exports.getDefaultDocumentStore = _chunkGS4J6OAFcjs.getDefaultDocumentStore; exports.getDocumentEditorInstructions = _chunkGS4J6OAFcjs.getDocumentEditorInstructions; exports.getDocumentEditorRules = _chunkGS4J6OAFcjs.getDocumentEditorRules; exports.interruptToApprovalRequests = _chunkGS4J6OAFcjs.interruptToApprovalRequests; exports.isDocumentEcho = _chunkGS4J6OAFcjs.isDocumentEcho; exports.isJuneComponent = _chunkGS4J6OAFcjs.isJuneComponent; exports.isJuneError = _chunkG6YPSE6Jcjs.isJuneError; exports.isThemeSet = _chunkGS4J6OAFcjs.isThemeSet; exports.jsonFieldExtractor = _chunkGS4J6OAFcjs.jsonFieldExtractor; exports.langGraphStreamOptions = _chunkGS4J6OAFcjs.langGraphStreamOptions; exports.lightTheme = _chunkGS4J6OAFcjs.lightTheme; exports.listDocumentExporters = _chunkGS4J6OAFcjs.listDocumentExporters; exports.mergeDocuments = _chunkGS4J6OAFcjs.mergeDocuments; exports.messageContentToText = _chunkGS4J6OAFcjs.messageContentToText; exports.normalizeProgram = _chunkGS4J6OAFcjs.normalizeProgram; exports.readDocumentFromProgram = _chunkGS4J6OAFcjs.readDocumentFromProgram; exports.readLangGraphInterrupts = _chunkGS4J6OAFcjs.readLangGraphInterrupts; exports.registerDocumentExporter = _chunkGS4J6OAFcjs.registerDocumentExporter; exports.rememberDocumentEcho = _chunkGS4J6OAFcjs.rememberDocumentEcho; exports.resolveMixedContent = _chunkGS4J6OAFcjs.resolveMixedContent; exports.resolveThemeVars = _chunkGS4J6OAFcjs.resolveThemeVars; exports.runAction = _chunkGS4J6OAFcjs.runAction; exports.serializeDocumentsForAgent = _chunkGS4J6OAFcjs.serializeDocumentsForAgent; exports.splitResponse = _chunkGS4J6OAFcjs.splitResponse; exports.sseToText = _chunkGS4J6OAFcjs.sseToText; exports.toAsyncIterable = _chunkGS4J6OAFcjs.toAsyncIterable; exports.toJuneError = _chunkG6YPSE6Jcjs.toJuneError; exports.updateDocumentInProgram = _chunkGS4J6OAFcjs.updateDocumentInProgram; exports.useDocumentBridge = _chunkGS4J6OAFcjs.useDocumentBridge; exports.useDocumentOptions = _chunkGS4J6OAFcjs.useDocumentOptions; exports.useJuneRuntime = _chunkGS4J6OAFcjs.useJuneRuntime; exports.useJuneStream = _chunkGS4J6OAFcjs.useJuneStream; exports.useJuneTheme = _chunkGS4J6OAFcjs.useJuneTheme; exports.useRegistryLibrary = _chunkGS4J6OAFcjs.useRegistryLibrary; exports.useResolvedTheme = _chunkGS4J6OAFcjs.useResolvedTheme; exports.useToolApproval = _chunkGS4J6OAFcjs.useToolApproval; exports.validateComponentDefinition = _chunkGS4J6OAFcjs.validateComponentDefinition; exports.withDocumentEditor = _chunkGS4J6OAFcjs.withDocumentEditor;
|
package/dist/entry-core.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
var
|
|
70
|
+
var _chunkGS4J6OAFcjs = require('./chunk-GS4J6OAF.cjs');
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
@@ -103,8 +103,8 @@ function withChatLayout(library) {
|
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
var juneLibrary =
|
|
107
|
-
var defaultRegistry =
|
|
106
|
+
var juneLibrary = _chunkGS4J6OAFcjs.withDocumentEditor.call(void 0, withChatLayout(_reactui.openuiChatLibrary));
|
|
107
|
+
var defaultRegistry = _chunkGS4J6OAFcjs.createComponentRegistry.call(void 0, { base: juneLibrary });
|
|
108
108
|
function registerComponent(components, options) {
|
|
109
109
|
return defaultRegistry.register(components, options);
|
|
110
110
|
}
|
|
@@ -129,14 +129,14 @@ function useJuneUIContext() {
|
|
|
129
129
|
function JuneUI({ library, june, ...props }) {
|
|
130
130
|
const context = useJuneUIContext();
|
|
131
131
|
const instance = _nullishCoalesce(june, () => ( _optionalChain([context, 'optionalAccess', _ => _.june])));
|
|
132
|
-
const registryLibrary =
|
|
132
|
+
const registryLibrary = _chunkGS4J6OAFcjs.useRegistryLibrary.call(void 0, _nullishCoalesce(_optionalChain([instance, 'optionalAccess', _2 => _2.registry]), () => ( defaultRegistry)));
|
|
133
133
|
const merged = mergeDefined(_optionalChain([instance, 'optionalAccess', _3 => _3.defaults]), _optionalChain([context, 'optionalAccess', _4 => _4.defaults]), props);
|
|
134
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
134
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGS4J6OAFcjs.JuneRenderer, { ...merged, library: _nullishCoalesce(library, () => ( registryLibrary)) });
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
// src/core/create-june-ui.ts
|
|
138
138
|
function createJuneUI(options = {}) {
|
|
139
|
-
const registry =
|
|
139
|
+
const registry = _chunkGS4J6OAFcjs.createComponentRegistry.call(void 0, {
|
|
140
140
|
base: _nullishCoalesce(options.baseLibrary, () => ( juneLibrary)),
|
|
141
141
|
components: options.components,
|
|
142
142
|
overrides: options.overrides,
|
|
@@ -237,4 +237,4 @@ function createJuneUI(options = {}) {
|
|
|
237
237
|
|
|
238
238
|
|
|
239
239
|
|
|
240
|
-
exports.ALL_EXPORT_FORMATS =
|
|
240
|
+
exports.ALL_EXPORT_FORMATS = _chunkGS4J6OAFcjs.ALL_EXPORT_FORMATS; exports.ComponentRegistry = _chunkGS4J6OAFcjs.ComponentRegistry; exports.DOCUMENT_COMPONENT_DESCRIPTION = _chunkGS4J6OAFcjs.DOCUMENT_COMPONENT_DESCRIPTION; exports.DocumentBridge = _chunkGS4J6OAFcjs.DocumentBridge; exports.DocumentEditor = _chunkGS4J6OAFcjs.DocumentEditor; exports.JuneDocumentContext = _chunkGS4J6OAFcjs.JuneDocumentContext; exports.JuneDocumentEditorComponent = _chunkGS4J6OAFcjs.JuneDocumentEditorComponent; exports.JuneError = _chunkG6YPSE6Jcjs.JuneError; exports.JuneErrorBoundary = _chunkGS4J6OAFcjs.JuneErrorBoundary; exports.JuneRenderer = _chunkGS4J6OAFcjs.JuneRenderer; exports.JuneRuntimeContext = _chunkGS4J6OAFcjs.JuneRuntimeContext; exports.JuneThemeProvider = _chunkGS4J6OAFcjs.JuneThemeProvider; exports.JuneUI = JuneUI; exports.JuneUIProvider = JuneUIProvider; exports.MarkdownText = _chunkGS4J6OAFcjs.MarkdownText; exports.ToolApproval = _chunkGS4J6OAFcjs.ToolApproval; exports.ToolApprovalList = _chunkGS4J6OAFcjs.ToolApprovalList; exports.consumeStream = _chunkGS4J6OAFcjs.consumeStream; exports.copyDocumentToClipboard = _chunkGS4J6OAFcjs.copyDocumentToClipboard; exports.createActionHandler = _chunkGS4J6OAFcjs.createActionHandler; exports.createComponentRegistry = _chunkGS4J6OAFcjs.createComponentRegistry; exports.createDocumentStore = _chunkGS4J6OAFcjs.createDocumentStore; exports.createJuneLibrary = _chunkGS4J6OAFcjs.createJuneLibrary; exports.createJuneUI = createJuneUI; exports.createLangGraphExtractor = _chunkGS4J6OAFcjs.createLangGraphExtractor; exports.createTheme = _chunkGS4J6OAFcjs.createTheme; exports.darkTheme = _chunkGS4J6OAFcjs.darkTheme; exports.defaultParseActionEvent = _chunkGS4J6OAFcjs.defaultParseActionEvent; exports.defaultRegistry = defaultRegistry; exports.defaultToolApprovalLabels = _chunkGS4J6OAFcjs.defaultToolApprovalLabels; exports.defineComponent = _chunkGS4J6OAFcjs.defineComponent; exports.defineJuneAction = _chunkGS4J6OAFcjs.defineJuneAction; exports.defineJuneComponent = _chunkGS4J6OAFcjs.defineJuneComponent; exports.documentPromptOptions = _chunkGS4J6OAFcjs.documentPromptOptions; exports.downloadResult = _chunkGS4J6OAFcjs.downloadResult; exports.exportDocument = _chunkGS4J6OAFcjs.exportDocument; exports.fetchStream = _chunkGS4J6OAFcjs.fetchStream; exports.getDefaultDocumentStore = _chunkGS4J6OAFcjs.getDefaultDocumentStore; exports.getDocumentEditorInstructions = _chunkGS4J6OAFcjs.getDocumentEditorInstructions; exports.getDocumentEditorRules = _chunkGS4J6OAFcjs.getDocumentEditorRules; exports.interruptToApprovalRequests = _chunkGS4J6OAFcjs.interruptToApprovalRequests; exports.isDocumentEcho = _chunkGS4J6OAFcjs.isDocumentEcho; exports.isJuneComponent = _chunkGS4J6OAFcjs.isJuneComponent; exports.isJuneError = _chunkG6YPSE6Jcjs.isJuneError; exports.isThemeSet = _chunkGS4J6OAFcjs.isThemeSet; exports.jsonFieldExtractor = _chunkGS4J6OAFcjs.jsonFieldExtractor; exports.juneLibrary = juneLibrary; exports.langGraphStreamOptions = _chunkGS4J6OAFcjs.langGraphStreamOptions; exports.lightTheme = _chunkGS4J6OAFcjs.lightTheme; exports.listDocumentExporters = _chunkGS4J6OAFcjs.listDocumentExporters; exports.mergeDocuments = _chunkGS4J6OAFcjs.mergeDocuments; exports.messageContentToText = _chunkGS4J6OAFcjs.messageContentToText; exports.normalizeProgram = _chunkGS4J6OAFcjs.normalizeProgram; exports.readDocumentFromProgram = _chunkGS4J6OAFcjs.readDocumentFromProgram; exports.readLangGraphInterrupts = _chunkGS4J6OAFcjs.readLangGraphInterrupts; exports.registerComponent = registerComponent; exports.registerDocumentExporter = _chunkGS4J6OAFcjs.registerDocumentExporter; exports.rememberDocumentEcho = _chunkGS4J6OAFcjs.rememberDocumentEcho; exports.resolveMixedContent = _chunkGS4J6OAFcjs.resolveMixedContent; exports.resolveThemeVars = _chunkGS4J6OAFcjs.resolveThemeVars; exports.runAction = _chunkGS4J6OAFcjs.runAction; exports.serializeDocumentsForAgent = _chunkGS4J6OAFcjs.serializeDocumentsForAgent; exports.splitResponse = _chunkGS4J6OAFcjs.splitResponse; exports.sseToText = _chunkGS4J6OAFcjs.sseToText; exports.toAsyncIterable = _chunkGS4J6OAFcjs.toAsyncIterable; exports.toJuneError = _chunkG6YPSE6Jcjs.toJuneError; exports.unregisterComponent = unregisterComponent; exports.updateDocumentInProgram = _chunkGS4J6OAFcjs.updateDocumentInProgram; exports.useDocumentBridge = _chunkGS4J6OAFcjs.useDocumentBridge; exports.useDocumentOptions = _chunkGS4J6OAFcjs.useDocumentOptions; exports.useJuneRuntime = _chunkGS4J6OAFcjs.useJuneRuntime; exports.useJuneStream = _chunkGS4J6OAFcjs.useJuneStream; exports.useJuneTheme = _chunkGS4J6OAFcjs.useJuneTheme; exports.useJuneUIContext = useJuneUIContext; exports.useRegistryLibrary = _chunkGS4J6OAFcjs.useRegistryLibrary; exports.useResolvedTheme = _chunkGS4J6OAFcjs.useResolvedTheme; exports.useToolApproval = _chunkGS4J6OAFcjs.useToolApproval; exports.validateComponentDefinition = _chunkGS4J6OAFcjs.validateComponentDefinition; exports.withDocumentEditor = _chunkGS4J6OAFcjs.withDocumentEditor;
|
package/dist/index.js
CHANGED
package/dist/june.css
CHANGED
|
@@ -483,6 +483,47 @@
|
|
|
483
483
|
.june-doc__status { display: none; }
|
|
484
484
|
.june-doc__footer { justify-content: space-between; }
|
|
485
485
|
}
|
|
486
|
+
/* ---------- generated preview and edit panel ---------- */
|
|
487
|
+
.june-doc-card { margin: 8px 0; }
|
|
488
|
+
.june-doc-card__bar {
|
|
489
|
+
display: flex; align-items: center; gap: 10px;
|
|
490
|
+
min-height: 48px; padding: 8px 12px 8px 16px;
|
|
491
|
+
border-bottom: 1px solid var(--jd-border);
|
|
492
|
+
}
|
|
493
|
+
.june-doc-card__title {
|
|
494
|
+
flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
495
|
+
font-size: 0.9375rem; font-weight: 600;
|
|
496
|
+
}
|
|
497
|
+
.june-doc-card__canvas {
|
|
498
|
+
max-height: min(68vh, 640px); overflow: auto;
|
|
499
|
+
padding: 20px 16px 28px; background: var(--jd-canvas);
|
|
500
|
+
}
|
|
501
|
+
.june-doc-card__sheet {
|
|
502
|
+
max-width: 794px; margin: 0 auto; padding: 48px 40px;
|
|
503
|
+
color: var(--jd-page-fg); background: var(--jd-page);
|
|
504
|
+
border: 1px solid var(--jd-border); border-radius: 3px; box-shadow: var(--jd-shadow);
|
|
505
|
+
}
|
|
506
|
+
.june-doc-modal {
|
|
507
|
+
position: fixed; inset: 0; z-index: 2147482000;
|
|
508
|
+
display: flex; justify-content: flex-end;
|
|
509
|
+
background: rgba(15, 18, 28, 0.48);
|
|
510
|
+
}
|
|
511
|
+
.june-doc.june-doc-modal__panel {
|
|
512
|
+
position: relative; display: flex; flex-direction: column;
|
|
513
|
+
width: min(960px, 100vw); max-width: 100%; height: 100%; margin: 0;
|
|
514
|
+
border: 0; border-radius: 0;
|
|
515
|
+
box-shadow: -16px 0 40px rgba(0, 0, 0, 0.28);
|
|
516
|
+
}
|
|
517
|
+
.june-doc-modal[data-theme="dark"] .june-doc-modal__panel { background: #0f1420; color: #f3f4f6; }
|
|
518
|
+
.june-doc-modal__bar {
|
|
519
|
+
display: flex; align-items: center; justify-content: flex-end;
|
|
520
|
+
min-height: 44px; padding: 6px 10px;
|
|
521
|
+
border-bottom: 1px solid var(--jd-border, #e5e7eb);
|
|
522
|
+
}
|
|
523
|
+
.june-doc-modal__body { flex: 1 1 auto; min-height: 0; overflow: auto; }
|
|
524
|
+
.june-doc-modal__body .june-doc { height: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
|
|
525
|
+
.june-doc-modal__body .june-doc__canvas { max-height: none; flex: 1 1 auto; }
|
|
526
|
+
|
|
486
527
|
@media print {
|
|
487
528
|
.june-doc__header, .june-doc__ribbon, .june-doc__findbar, .june-doc__footer, .june-doc__banner { display: none; }
|
|
488
529
|
.june-doc__canvas { max-height: none; overflow: visible; padding: 0; background: none; }
|
package/package.json
CHANGED