@june-ai/june-ui 0.2.10 → 0.2.12

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.
@@ -141,7 +141,7 @@ function OpenUIDevtoolsGate() {
141
141
 
142
142
  // src/engine/renderer/june-renderer.tsx
143
143
  import { Renderer } from "@openuidev/react-lang";
144
- import { Fragment, useCallback as useCallback2, useMemo as useMemo3, useRef as useRef2 } from "react";
144
+ import { Fragment, useCallback as useCallback2, useMemo as useMemo4, useRef as useRef2 } from "react";
145
145
 
146
146
  // src/core/context.ts
147
147
  import { createContext as createContext2, useContext as useContext2 } from "react";
@@ -224,9 +224,16 @@ function createActionHandler(options) {
224
224
  };
225
225
  }
226
226
 
227
+ // src/features/document-editor/document-bridge.tsx
228
+ import { useMemo as useMemo2 } from "react";
229
+
227
230
  // src/features/document-editor/document-context.ts
228
231
  import { createContext as createContext3, useContext as useContext3, useSyncExternalStore } from "react";
229
232
  var JuneDocumentContext = createContext3({});
233
+ var DocumentEditorConfigContext = createContext3({});
234
+ function useDocumentEditorConfig() {
235
+ return useContext3(DocumentEditorConfigContext);
236
+ }
230
237
  function useDocumentOptions() {
231
238
  return useContext3(JuneDocumentContext);
232
239
  }
@@ -608,13 +615,20 @@ function useDocumentBridge(options) {
608
615
 
609
616
  // src/features/document-editor/document-bridge.tsx
610
617
  import { jsx as jsx2 } from "react/jsx-runtime";
611
- function DocumentBridge({ children, ...options }) {
618
+ function DocumentBridge({
619
+ children,
620
+ documentEditor,
621
+ ...options
622
+ }) {
612
623
  const value = useDocumentBridge(options);
613
- return /* @__PURE__ */ jsx2(JuneDocumentContext.Provider, { value, children });
624
+ const presentation = documentEditor?.presentation;
625
+ const width = documentEditor?.width;
626
+ const config = useMemo2(() => ({ presentation, width }), [presentation, width]);
627
+ return /* @__PURE__ */ jsx2(JuneDocumentContext.Provider, { value, children: /* @__PURE__ */ jsx2(DocumentEditorConfigContext.Provider, { value: config, children }) });
614
628
  }
615
629
 
616
630
  // src/themes/theme-provider.tsx
617
- import { useMemo as useMemo2, useSyncExternalStore as useSyncExternalStore2 } from "react";
631
+ import { useMemo as useMemo3, useSyncExternalStore as useSyncExternalStore2 } from "react";
618
632
 
619
633
  // src/themes/dark.ts
620
634
  var darkTheme = {
@@ -675,7 +689,7 @@ function useResolvedTheme(mode) {
675
689
  function JuneThemeProvider({ mode, vars, className, style, children }) {
676
690
  const explicit = mode !== void 0;
677
691
  const resolved = useResolvedTheme(mode ?? "system");
678
- const mergedStyle = useMemo2(() => {
692
+ const mergedStyle = useMemo3(() => {
679
693
  const own = resolveThemeVars(vars, resolved);
680
694
  if (!explicit && !own && !style) return void 0;
681
695
  const base = explicit ? resolved === "dark" ? darkTheme : lightTheme : void 0;
@@ -686,7 +700,7 @@ function JuneThemeProvider({ mode, vars, className, style, children }) {
686
700
  ...style
687
701
  };
688
702
  }, [explicit, resolved, vars, style]);
689
- const context = useMemo2(() => ({ mode: mode ?? "system", theme: resolved }), [mode, resolved]);
703
+ const context = useMemo3(() => ({ mode: mode ?? "system", theme: resolved }), [mode, resolved]);
690
704
  return /* @__PURE__ */ jsx3(JuneContext.Provider, { value: context, children: /* @__PURE__ */ jsx3(
691
705
  "div",
692
706
  {
@@ -1320,6 +1334,7 @@ function JuneRenderer(props) {
1320
1334
  onError,
1321
1335
  onJuneError,
1322
1336
  documents,
1337
+ documentEditor,
1323
1338
  onResponseChange,
1324
1339
  responseChangeDelay,
1325
1340
  loadingFallback = null,
@@ -1363,8 +1378,8 @@ function JuneRenderer(props) {
1363
1378
  );
1364
1379
  }, []);
1365
1380
  const handleDocumentError = useCallback2((error) => latest.current.onJuneError?.(error), []);
1366
- const runtime = useMemo3(() => ({ isStreaming }), [isStreaming]);
1367
- const content = useMemo3(
1381
+ const runtime = useMemo4(() => ({ isStreaming }), [isStreaming]);
1382
+ const content = useMemo4(
1368
1383
  () => resolveMixedContent(response, { mixedContent, isStreaming, repair, markdown: textFormat === "markdown" }),
1369
1384
  [response, mixedContent, isStreaming, repair, textFormat]
1370
1385
  );
@@ -1376,6 +1391,7 @@ function JuneRenderer(props) {
1376
1391
  DocumentBridge,
1377
1392
  {
1378
1393
  documents,
1394
+ documentEditor,
1379
1395
  response,
1380
1396
  onResponseChange,
1381
1397
  responseChangeDelay,
@@ -1739,7 +1755,7 @@ function defineJuneAction(definition) {
1739
1755
  }
1740
1756
 
1741
1757
  // src/features/streaming/use-june-stream.ts
1742
- import { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo4, useRef as useRef3, useState } from "react";
1758
+ import { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo5, useRef as useRef3, useState } from "react";
1743
1759
 
1744
1760
  // src/features/streaming/stream-handler.ts
1745
1761
  function isReadableStream(source) {
@@ -2002,7 +2018,7 @@ function useJuneStream(options = {}) {
2002
2018
  },
2003
2019
  [clearTimer]
2004
2020
  );
2005
- return useMemo4(
2021
+ return useMemo5(
2006
2022
  () => ({ ...state, start, startFetch, abort, reset }),
2007
2023
  [state, start, startFetch, abort, reset]
2008
2024
  );
@@ -2031,7 +2047,7 @@ function DocumentDraft({ title, words, state }) {
2031
2047
 
2032
2048
  // src/features/document-editor/document-editor.tsx
2033
2049
  import { useEditor } from "@tiptap/react";
2034
- import { useCallback as useCallback4, useEffect as useEffect7, useId, useMemo as useMemo5, useRef as useRef8, useState as useState6 } from "react";
2050
+ import { useCallback as useCallback4, useEffect as useEffect7, useId, useMemo as useMemo6, useRef as useRef8, useState as useState6 } from "react";
2035
2051
 
2036
2052
  // src/features/document-editor/document-bubble.tsx
2037
2053
  import { useEditorState as useEditorState2 } from "@tiptap/react";
@@ -3703,15 +3719,15 @@ function DocumentEditorImpl(props) {
3703
3719
  className
3704
3720
  } = props;
3705
3721
  const ctxOptions = useDocumentOptions();
3706
- const options = useMemo5(() => ({ ...ctxOptions, ...props.options }), [ctxOptions, props.options]);
3722
+ const options = useMemo6(() => ({ ...ctxOptions, ...props.options }), [ctxOptions, props.options]);
3707
3723
  const optionsRef = useRef8(options);
3708
3724
  optionsRef.current = options;
3709
- const store = useMemo5(() => options.store ?? getDefaultDocumentStore(), [options.store]);
3725
+ const store = useMemo6(() => options.store ?? getDefaultDocumentStore(), [options.store]);
3710
3726
  const instanceId = useId();
3711
3727
  const { theme: contextTheme } = useJuneTheme();
3712
3728
  const resolvedTheme = theme === "auto" ? contextTheme : theme;
3713
3729
  const contentKey = typeof content === "string" ? content : content ? JSON.stringify(content) : "";
3714
- const parsed = useMemo5(() => {
3730
+ const parsed = useMemo6(() => {
3715
3731
  if (!contentKey) return { json: null, error: null };
3716
3732
  try {
3717
3733
  return { json: parseDocumentContent(contentKey), error: null };
@@ -3763,7 +3779,7 @@ function DocumentEditorImpl(props) {
3763
3779
  );
3764
3780
  const saveRef = useRef8(async () => {
3765
3781
  });
3766
- const autosave = useMemo5(() => {
3782
+ const autosave = useMemo6(() => {
3767
3783
  const delay = options.autosaveDelay ?? 1500;
3768
3784
  return delay > 0 ? debounce(() => void saveRef.current(), delay) : null;
3769
3785
  }, [options.autosaveDelay]);
@@ -3815,7 +3831,7 @@ function DocumentEditorImpl(props) {
3815
3831
  return () => clearTimeout(t);
3816
3832
  }, [saveState, options.onSave]);
3817
3833
  const [initialJson] = useState6(() => store.get(documentId)?.json ?? parsed.json ?? emptyDoc());
3818
- const extensions = useMemo5(() => createDocumentExtensions(), []);
3834
+ const extensions = useMemo6(() => createDocumentExtensions(), []);
3819
3835
  const onUpdateRef = useRef8(() => {
3820
3836
  });
3821
3837
  onUpdateRef.current = (json) => {
@@ -4041,52 +4057,152 @@ function DocumentEditorImpl(props) {
4041
4057
  }
4042
4058
 
4043
4059
  // src/features/document-editor/document-preview.tsx
4044
- import { useEffect as useEffect8, useMemo as useMemo6, useState as useState7 } from "react";
4060
+ import { useEffect as useEffect8, useMemo as useMemo7, useState as useState7 } from "react";
4045
4061
  import { createPortal } from "react-dom";
4062
+
4063
+ // src/features/document-editor/document-presentation.ts
4064
+ function resolveDocumentPresentation(documentPresentation, configured) {
4065
+ if (documentPresentation === "inline" || documentPresentation === "side-panel") return documentPresentation;
4066
+ if (configured === "inline" || configured === "side-panel") return configured;
4067
+ return "inline";
4068
+ }
4069
+ function documentPanelWidth(width) {
4070
+ if (typeof width === "number" && Number.isFinite(width)) return `${width}px`;
4071
+ if (typeof width === "string" && width.trim()) return width.trim();
4072
+ return void 0;
4073
+ }
4074
+
4075
+ // src/features/document-editor/document-preview.tsx
4046
4076
  import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
4077
+ var FORMAT_LABEL = {
4078
+ docx: "Word document",
4079
+ pdf: "PDF",
4080
+ html: "Web page",
4081
+ markdown: "Markdown",
4082
+ txt: "Plain text"
4083
+ };
4047
4084
  function DocumentPreview(props) {
4048
- const { documentId, title = "Untitled document", content, editable = true } = props;
4085
+ const { documentId, title = "Untitled document", content, editable = true, exportFormats } = props;
4049
4086
  const { theme: contextTheme } = useJuneTheme();
4050
4087
  const resolvedTheme = props.theme && props.theme !== "auto" ? props.theme : contextTheme;
4051
4088
  const ctxOptions = useDocumentOptions();
4052
- const store = useMemo6(() => props.options?.store ?? ctxOptions.store ?? getDefaultDocumentStore(), [props.options?.store, ctxOptions.store]);
4089
+ const editorConfig = useDocumentEditorConfig();
4090
+ const presentation = resolveDocumentPresentation(props.presentation, editorConfig.presentation);
4091
+ const panelWidth = documentPanelWidth(editorConfig.width);
4092
+ const store = useMemo7(() => props.options?.store ?? ctxOptions.store ?? getDefaultDocumentStore(), [props.options?.store, ctxOptions.store]);
4053
4093
  const storedJson = useDocumentValue(store, documentId, (record) => record?.json);
4054
4094
  const [open, setOpen] = useState7(false);
4055
4095
  const [preferStore, setPreferStore] = useState7(false);
4096
+ const [notice, setNotice] = useState7(null);
4056
4097
  const contentKey = typeof content === "string" ? content : content ? JSON.stringify(content) : "";
4098
+ const options = props.options ?? ctxOptions;
4057
4099
  useEffect8(() => {
4058
4100
  setPreferStore(false);
4059
4101
  }, [contentKey]);
4060
- const html = useMemo6(() => {
4102
+ const doc = useMemo7(() => {
4061
4103
  try {
4062
4104
  const fromContent = contentKey ? parseDocumentContent(contentKey) : null;
4063
- const doc = preferStore && storedJson ? storedJson : fromContent;
4064
- return doc ? docToHtml(doc) : "";
4105
+ return preferStore && storedJson ? storedJson : fromContent;
4065
4106
  } catch {
4066
- return "";
4107
+ return null;
4067
4108
  }
4068
4109
  }, [contentKey, preferStore, storedJson]);
4110
+ const html = useMemo7(() => doc ? docToHtml(doc) : "", [doc]);
4111
+ const formats = (exportFormats ?? [...ALL_EXPORT_FORMATS]).filter((format2) => listDocumentExporters().includes(format2));
4069
4112
  useEffect8(() => {
4070
- if (!open || typeof document === "undefined") return;
4113
+ if (!notice) return;
4114
+ const timer = setTimeout(() => setNotice(null), 2e3);
4115
+ return () => clearTimeout(timer);
4116
+ }, [notice]);
4117
+ useEffect8(() => {
4118
+ if (!open || presentation !== "side-panel" || typeof document === "undefined") return;
4071
4119
  const prev = document.body.style.overflow;
4072
4120
  document.body.style.overflow = "hidden";
4073
4121
  return () => {
4074
4122
  document.body.style.overflow = prev;
4075
4123
  };
4076
- }, [open]);
4124
+ }, [open, presentation]);
4077
4125
  const close = () => {
4078
4126
  setPreferStore(true);
4079
4127
  setOpen(false);
4080
4128
  };
4129
+ const handleExport = async (format2) => {
4130
+ if (!doc) return;
4131
+ try {
4132
+ const result = await exportDocument(format2, { documentId, title, json: doc });
4133
+ if (result.blob) downloadResult(result);
4134
+ options.onExport?.({ documentId, format: format2, ...result });
4135
+ } catch (error) {
4136
+ options.onError?.(toJuneError(error, "EXPORT_ERROR"));
4137
+ setNotice("Export failed");
4138
+ }
4139
+ };
4140
+ const handleCopy = async () => {
4141
+ if (!doc) return;
4142
+ setNotice(await copyDocumentToClipboard({ title, json: doc }) ? "Copied" : "Copy failed");
4143
+ };
4144
+ const editor = /* @__PURE__ */ jsx17(
4145
+ DocumentEditorImpl,
4146
+ {
4147
+ documentId: props.documentId,
4148
+ title: props.title,
4149
+ content: props.content,
4150
+ documentType: props.documentType,
4151
+ status: props.status,
4152
+ editable: props.editable,
4153
+ exportFormats: props.exportFormats,
4154
+ theme: props.theme,
4155
+ generating: props.generating,
4156
+ options: props.options
4157
+ }
4158
+ );
4159
+ const closeBar = /* @__PURE__ */ jsx17("div", { className: "june-doc-editor__bar", children: /* @__PURE__ */ jsxs11("button", { type: "button", className: "june-doc__btn june-doc__btn--ghost", "aria-label": "Close document", onClick: close, children: [
4160
+ /* @__PURE__ */ jsx17(Icon, { name: "close", size: 16 }),
4161
+ /* @__PURE__ */ jsx17("span", { children: "Close" })
4162
+ ] }) });
4081
4163
  return /* @__PURE__ */ jsxs11(Fragment5, { children: [
4082
4164
  !open ? /* @__PURE__ */ jsxs11("section", { className: "june-doc june-doc-card", "data-theme": resolvedTheme, "aria-label": title, children: [
4083
4165
  /* @__PURE__ */ jsxs11("div", { className: "june-doc-card__bar", children: [
4084
4166
  /* @__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
4167
+ /* @__PURE__ */ jsxs11("div", { className: "june-doc-card__actions", children: [
4168
+ notice ? /* @__PURE__ */ jsx17("span", { className: "june-doc-card__notice", children: notice }) : null,
4169
+ /* @__PURE__ */ jsx17("button", { type: "button", className: "june-doc__btn june-doc__btn--icon june-doc__btn--ghost", "aria-label": "Copy document", title: "Copy", onClick: () => void handleCopy(), children: /* @__PURE__ */ jsx17(Icon, { name: "copy", size: 16 }) }),
4170
+ 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,
4171
+ /* @__PURE__ */ jsx17(
4172
+ Dropdown,
4173
+ {
4174
+ align: "end",
4175
+ className: "june-doc__menu",
4176
+ trigger: ({ open: menuOpen, toggle }) => /* @__PURE__ */ jsx17("button", { type: "button", className: "june-doc__btn june-doc__btn--icon june-doc__btn--ghost", "aria-label": "Download", title: "Download", "aria-haspopup": "menu", "aria-expanded": menuOpen, onClick: toggle, children: /* @__PURE__ */ jsx17(Icon, { name: "download", size: 16 }) }),
4177
+ children: (dismiss) => /* @__PURE__ */ jsx17("div", { role: "menu", "aria-label": "Download options", children: formats.map((format2) => /* @__PURE__ */ jsx17(
4178
+ "button",
4179
+ {
4180
+ type: "button",
4181
+ role: "menuitem",
4182
+ className: "june-doc__menu-item",
4183
+ onClick: () => {
4184
+ dismiss();
4185
+ void handleExport(format2);
4186
+ },
4187
+ children: /* @__PURE__ */ jsx17("span", { className: "june-doc__menu-label", children: FORMAT_LABEL[format2] ?? format2.toUpperCase() })
4188
+ },
4189
+ format2
4190
+ )) })
4191
+ }
4192
+ )
4193
+ ] })
4086
4194
  ] }),
4087
4195
  /* @__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
4196
  ] }) : null,
4089
- open && typeof document !== "undefined" ? createPortal(
4197
+ open && presentation === "inline" ? /* @__PURE__ */ jsxs11("section", { className: "june-doc june-doc-inline", "data-theme": resolvedTheme, "aria-label": title, onKeyDown: (event) => {
4198
+ if (event.key !== "Escape" || event.defaultPrevented) return;
4199
+ if (event.currentTarget.querySelector(".june-doc--fullscreen")) return;
4200
+ close();
4201
+ }, children: [
4202
+ closeBar,
4203
+ editor
4204
+ ] }) : null,
4205
+ open && presentation === "side-panel" && typeof document !== "undefined" ? createPortal(
4090
4206
  /* @__PURE__ */ jsx17("div", { className: "june-doc-modal", "data-theme": resolvedTheme, onMouseDown: close, children: /* @__PURE__ */ jsxs11(
4091
4207
  "div",
4092
4208
  {
@@ -4096,6 +4212,7 @@ function DocumentPreview(props) {
4096
4212
  "aria-label": title,
4097
4213
  tabIndex: -1,
4098
4214
  "data-theme": resolvedTheme,
4215
+ style: panelWidth ? { width: panelWidth, maxWidth: "100vw" } : void 0,
4099
4216
  onMouseDown: (event) => event.stopPropagation(),
4100
4217
  onKeyDown: (event) => {
4101
4218
  if (event.key !== "Escape" || event.defaultPrevented) return;
@@ -4103,25 +4220,8 @@ function DocumentPreview(props) {
4103
4220
  close();
4104
4221
  },
4105
4222
  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
- ) })
4223
+ closeBar,
4224
+ /* @__PURE__ */ jsx17("div", { className: "june-doc-modal__body", children: editor })
4125
4225
  ]
4126
4226
  }
4127
4227
  ) }),
@@ -4132,7 +4232,7 @@ function DocumentPreview(props) {
4132
4232
 
4133
4233
  // src/features/document-editor/document-component.tsx
4134
4234
  import { jsx as jsx18 } from "react/jsx-runtime";
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.';
4235
+ var DOCUMENT_COMPONENT_DESCRIPTION = 'Custom component. An editable document. DocumentEditor(documentId, title, content, documentType?, status?, editable?, exportFormats?, presentation?). 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. presentation is "inline" or "side-panel"; omit it to use the app default.';
4136
4236
  var documentProps = z.object({
4137
4237
  documentId: z.string().describe("Stable id. Reuse it when revising the same document."),
4138
4238
  title: z.string().describe("Document title. Do not repeat it as a heading in content."),
@@ -4140,7 +4240,8 @@ var documentProps = z.object({
4140
4240
  documentType: z.string().optional().describe("Kind of document, such as proposal, contract or invoice."),
4141
4241
  status: z.string().optional().describe('Use "draft" for generated documents.'),
4142
4242
  editable: z.boolean().optional().describe("Whether the user can edit. Defaults to true."),
4143
- exportFormats: z.array(z.string()).optional().describe("Export formats to offer, such as html, markdown, docx.")
4243
+ exportFormats: z.array(z.string()).optional().describe("Export formats to offer, such as html, markdown, docx."),
4244
+ presentation: z.enum(["inline", "side-panel"]).optional().describe('Where Edit opens the editor: "inline" in the chat, or "side-panel". Omit to use the app default.')
4144
4245
  });
4145
4246
  function DocumentEditor(props) {
4146
4247
  const { isStreaming } = useJuneRuntime();
@@ -4158,10 +4259,10 @@ function OpenUIDocument({ props }) {
4158
4259
  documentType: props.documentType,
4159
4260
  status: props.status,
4160
4261
  editable: props.editable,
4161
- exportFormats: props.exportFormats
4262
+ exportFormats: props.exportFormats,
4263
+ presentation: props.presentation
4162
4264
  };
4163
4265
  if (isStreaming) return /* @__PURE__ */ jsx18(DocumentDraft, { title: props.title, state: "drafting" });
4164
- if (props.editable === false) return /* @__PURE__ */ jsx18(DocumentEditor, { ...shared });
4165
4266
  return /* @__PURE__ */ jsx18(DocumentPreview, { ...shared });
4166
4267
  }
4167
4268
  var JuneDocumentEditorComponent = defineComponent3({
@@ -4200,7 +4301,7 @@ function getDocumentEditorRules(options = {}) {
4200
4301
  return [
4201
4302
  `WHEN TO USE ${name}: use it only when the user asks you to create, draft, write, prepare, generate or revise an editable document (${types}, or similar). Put the finished document inside ${name}.`,
4202
4303
  `WHEN NOT TO USE ${name}: for explanations ("explain what an NDA is"), factual answers, comparisons, brainstorming and general questions, answer with normal text and the other components. Never open ${name} for those.`,
4203
- `${name}(documentId, title, content, documentType?, status?, editable?, exportFormats?): "content" is the whole document body as Markdown inside ONE double-quoted string. Write line breaks as \\n and escape double quotes as \\". Supported Markdown: headings (#, ##, ###), paragraphs, **bold**, *italic*, lists, > quotes, [links](https://...), and tables.`,
4304
+ `${name}(documentId, title, content, documentType?, status?, editable?, exportFormats?, presentation?): "content" is the whole document body as Markdown inside ONE double-quoted string. Write line breaks as \\n and escape double quotes as \\". Supported Markdown: headings (#, ##, ###), paragraphs, **bold**, *italic*, lists, > quotes, [links](https://...), and tables. presentation is optional: "inline" or "side-panel". Omit it to use the app default.`,
4204
4305
  `Do not repeat the title as a heading inside "content"; the title is shown separately. Structure the document with headings, short paragraphs and tables where useful. Keep a professional tone.`,
4205
4306
  `EDITING: when the user asks to change an existing document (add a section, rewrite a part, change the title), write ${name} again with the SAME documentId and the COMPLETE updated content, starting from the current document text you were given. Copy every unchanged section exactly as it was. Change only what was requested. The app merges your version with the user's own edits.`,
4206
4307
  `If the user asks for a document but leaves out details, write the document anyway and use clear placeholders such as [CLIENT NAME], [DATE], [AMOUNT]. Do not stop to ask unless the request is impossible to interpret.`,
@@ -4365,7 +4466,7 @@ function ToolApprovalList({ approvals, pendingOnly = false, renderItem, labels,
4365
4466
  }
4366
4467
 
4367
4468
  // src/features/tool-approval/use-tool-approval.ts
4368
- import { useCallback as useCallback5, useEffect as useEffect9, useMemo as useMemo7, useRef as useRef9, useState as useState9 } from "react";
4469
+ import { useCallback as useCallback5, useEffect as useEffect9, useMemo as useMemo8, useRef as useRef9, useState as useState9 } from "react";
4369
4470
  var counter = 0;
4370
4471
  var nextId = () => `june-approval-${++counter}`;
4371
4472
  function useToolApproval() {
@@ -4421,8 +4522,8 @@ function useToolApproval() {
4421
4522
  map.clear();
4422
4523
  };
4423
4524
  }, []);
4424
- const pending = useMemo7(() => entries.filter((e) => e.status === "pending"), [entries]);
4425
- return useMemo7(
4525
+ const pending = useMemo8(() => entries.filter((e) => e.status === "pending"), [entries]);
4526
+ return useMemo8(
4426
4527
  () => ({ entries, pending, request, decide, setStatus, dismiss, confirmAction }),
4427
4528
  [entries, pending, request, decide, setStatus, dismiss, confirmAction]
4428
4529
  );
@@ -4526,6 +4627,8 @@ export {
4526
4627
  runAction,
4527
4628
  createActionHandler,
4528
4629
  JuneDocumentContext,
4630
+ DocumentEditorConfigContext,
4631
+ useDocumentEditorConfig,
4529
4632
  useDocumentOptions,
4530
4633
  mergeDocuments,
4531
4634
  createDocumentStore,
@@ -4570,6 +4673,8 @@ export {
4570
4673
  downloadResult,
4571
4674
  copyDocumentToClipboard,
4572
4675
  ALL_EXPORT_FORMATS,
4676
+ resolveDocumentPresentation,
4677
+ documentPanelWidth,
4573
4678
  DOCUMENT_COMPONENT_DESCRIPTION,
4574
4679
  DocumentEditor,
4575
4680
  JuneDocumentEditorComponent,
@@ -67,7 +67,11 @@
67
67
 
68
68
 
69
69
 
70
- var _chunkGS4J6OAFcjs = require('./chunk-GS4J6OAF.cjs');
70
+
71
+
72
+
73
+
74
+ var _chunk6WLZQX6Ocjs = require('./chunk-6WLZQX6O.cjs');
71
75
 
72
76
 
73
77
 
@@ -145,4 +149,8 @@ var _chunkG6YPSE6Jcjs = require('./chunk-G6YPSE6J.cjs');
145
149
 
146
150
 
147
151
 
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;
152
+
153
+
154
+
155
+
156
+ exports.ALL_EXPORT_FORMATS = _chunk6WLZQX6Ocjs.ALL_EXPORT_FORMATS; exports.ComponentRegistry = _chunk6WLZQX6Ocjs.ComponentRegistry; exports.DOCUMENT_COMPONENT_DESCRIPTION = _chunk6WLZQX6Ocjs.DOCUMENT_COMPONENT_DESCRIPTION; exports.DocumentBridge = _chunk6WLZQX6Ocjs.DocumentBridge; exports.DocumentEditor = _chunk6WLZQX6Ocjs.DocumentEditor; exports.DocumentEditorConfigContext = _chunk6WLZQX6Ocjs.DocumentEditorConfigContext; exports.JuneDocumentContext = _chunk6WLZQX6Ocjs.JuneDocumentContext; exports.JuneDocumentEditorComponent = _chunk6WLZQX6Ocjs.JuneDocumentEditorComponent; exports.JuneError = _chunkG6YPSE6Jcjs.JuneError; exports.JuneErrorBoundary = _chunk6WLZQX6Ocjs.JuneErrorBoundary; exports.JuneRenderer = _chunk6WLZQX6Ocjs.JuneRenderer; exports.JuneRuntimeContext = _chunk6WLZQX6Ocjs.JuneRuntimeContext; exports.JuneThemeProvider = _chunk6WLZQX6Ocjs.JuneThemeProvider; exports.MarkdownText = _chunk6WLZQX6Ocjs.MarkdownText; exports.ToolApproval = _chunk6WLZQX6Ocjs.ToolApproval; exports.ToolApprovalList = _chunk6WLZQX6Ocjs.ToolApprovalList; exports.consumeStream = _chunk6WLZQX6Ocjs.consumeStream; exports.copyDocumentToClipboard = _chunk6WLZQX6Ocjs.copyDocumentToClipboard; exports.createActionHandler = _chunk6WLZQX6Ocjs.createActionHandler; exports.createComponentRegistry = _chunk6WLZQX6Ocjs.createComponentRegistry; exports.createDocumentStore = _chunk6WLZQX6Ocjs.createDocumentStore; exports.createJuneLibrary = _chunk6WLZQX6Ocjs.createJuneLibrary; exports.createLangGraphExtractor = _chunk6WLZQX6Ocjs.createLangGraphExtractor; exports.createTheme = _chunk6WLZQX6Ocjs.createTheme; exports.darkTheme = _chunk6WLZQX6Ocjs.darkTheme; exports.defaultParseActionEvent = _chunk6WLZQX6Ocjs.defaultParseActionEvent; exports.defaultToolApprovalLabels = _chunk6WLZQX6Ocjs.defaultToolApprovalLabels; exports.defineComponent = _chunk6WLZQX6Ocjs.defineComponent; exports.defineJuneAction = _chunk6WLZQX6Ocjs.defineJuneAction; exports.defineJuneComponent = _chunk6WLZQX6Ocjs.defineJuneComponent; exports.documentPanelWidth = _chunk6WLZQX6Ocjs.documentPanelWidth; exports.documentPromptOptions = _chunk6WLZQX6Ocjs.documentPromptOptions; exports.downloadResult = _chunk6WLZQX6Ocjs.downloadResult; exports.exportDocument = _chunk6WLZQX6Ocjs.exportDocument; exports.fetchStream = _chunk6WLZQX6Ocjs.fetchStream; exports.getDefaultDocumentStore = _chunk6WLZQX6Ocjs.getDefaultDocumentStore; exports.getDocumentEditorInstructions = _chunk6WLZQX6Ocjs.getDocumentEditorInstructions; exports.getDocumentEditorRules = _chunk6WLZQX6Ocjs.getDocumentEditorRules; exports.interruptToApprovalRequests = _chunk6WLZQX6Ocjs.interruptToApprovalRequests; exports.isDocumentEcho = _chunk6WLZQX6Ocjs.isDocumentEcho; exports.isJuneComponent = _chunk6WLZQX6Ocjs.isJuneComponent; exports.isJuneError = _chunkG6YPSE6Jcjs.isJuneError; exports.isThemeSet = _chunk6WLZQX6Ocjs.isThemeSet; exports.jsonFieldExtractor = _chunk6WLZQX6Ocjs.jsonFieldExtractor; exports.langGraphStreamOptions = _chunk6WLZQX6Ocjs.langGraphStreamOptions; exports.lightTheme = _chunk6WLZQX6Ocjs.lightTheme; exports.listDocumentExporters = _chunk6WLZQX6Ocjs.listDocumentExporters; exports.mergeDocuments = _chunk6WLZQX6Ocjs.mergeDocuments; exports.messageContentToText = _chunk6WLZQX6Ocjs.messageContentToText; exports.normalizeProgram = _chunk6WLZQX6Ocjs.normalizeProgram; exports.readDocumentFromProgram = _chunk6WLZQX6Ocjs.readDocumentFromProgram; exports.readLangGraphInterrupts = _chunk6WLZQX6Ocjs.readLangGraphInterrupts; exports.registerDocumentExporter = _chunk6WLZQX6Ocjs.registerDocumentExporter; exports.rememberDocumentEcho = _chunk6WLZQX6Ocjs.rememberDocumentEcho; exports.resolveDocumentPresentation = _chunk6WLZQX6Ocjs.resolveDocumentPresentation; exports.resolveMixedContent = _chunk6WLZQX6Ocjs.resolveMixedContent; exports.resolveThemeVars = _chunk6WLZQX6Ocjs.resolveThemeVars; exports.runAction = _chunk6WLZQX6Ocjs.runAction; exports.serializeDocumentsForAgent = _chunk6WLZQX6Ocjs.serializeDocumentsForAgent; exports.splitResponse = _chunk6WLZQX6Ocjs.splitResponse; exports.sseToText = _chunk6WLZQX6Ocjs.sseToText; exports.toAsyncIterable = _chunk6WLZQX6Ocjs.toAsyncIterable; exports.toJuneError = _chunkG6YPSE6Jcjs.toJuneError; exports.updateDocumentInProgram = _chunk6WLZQX6Ocjs.updateDocumentInProgram; exports.useDocumentBridge = _chunk6WLZQX6Ocjs.useDocumentBridge; exports.useDocumentEditorConfig = _chunk6WLZQX6Ocjs.useDocumentEditorConfig; exports.useDocumentOptions = _chunk6WLZQX6Ocjs.useDocumentOptions; exports.useJuneRuntime = _chunk6WLZQX6Ocjs.useJuneRuntime; exports.useJuneStream = _chunk6WLZQX6Ocjs.useJuneStream; exports.useJuneTheme = _chunk6WLZQX6Ocjs.useJuneTheme; exports.useRegistryLibrary = _chunk6WLZQX6Ocjs.useRegistryLibrary; exports.useResolvedTheme = _chunk6WLZQX6Ocjs.useResolvedTheme; exports.useToolApproval = _chunk6WLZQX6Ocjs.useToolApproval; exports.validateComponentDefinition = _chunk6WLZQX6Ocjs.validateComponentDefinition; exports.withDocumentEditor = _chunk6WLZQX6Ocjs.withDocumentEditor;
@@ -211,6 +211,23 @@ interface DocumentConflict {
211
211
  /** Number of regions that both the user and the assistant changed. */
212
212
  conflicts: number;
213
213
  }
214
+ /** Where Edit opens the Tiptap editor. */
215
+ type DocumentPresentation = "inline" | "side-panel";
216
+ /**
217
+ * App-wide document editor presentation. Pass it as `<JuneUI documentEditor={...} />`.
218
+ * A document can override `presentation` on its own `DocumentEditor(...)` call.
219
+ * Priority: that per-document value, then this config, then `"inline"`.
220
+ */
221
+ interface DocumentEditorConfig {
222
+ /**
223
+ * `"inline"` renders the editor in the chat after Edit.
224
+ * `"side-panel"` opens it in a panel on the right.
225
+ * Default `"inline"`.
226
+ */
227
+ presentation?: DocumentPresentation;
228
+ /** Side-panel width. A number is pixels. Example: `"65%"` or `720`. */
229
+ width?: string | number;
230
+ }
214
231
  interface JuneDocumentOptions {
215
232
  /** Share one store across editors. Defaults to a global in-memory store, keyed by documentId. */
216
233
  store?: DocumentStore;
@@ -234,6 +251,11 @@ interface DocumentEditorProps {
234
251
  status?: string;
235
252
  editable?: boolean;
236
253
  exportFormats?: string[];
254
+ /**
255
+ * Where Edit opens this document. Overrides `JuneUI`'s `documentEditor.presentation`.
256
+ * Omit it to use the app config, which defaults to `"inline"`.
257
+ */
258
+ presentation?: DocumentPresentation;
237
259
  /** "auto" follows the June theme context. */
238
260
  theme?: "auto" | "light" | "dark";
239
261
  className?: string;
@@ -333,6 +355,12 @@ type JuneRendererProps = Omit<OpenUIRendererProps, "library" | "response" | "isS
333
355
  onJuneError?: (error: JuneError) => void;
334
356
  /** Document editor callbacks and store. Memoize this object. */
335
357
  documents?: JuneDocumentOptions;
358
+ /**
359
+ * Where Edit opens a generated document. Default is `"inline"` (in the chat).
360
+ * `"side-panel"` opens the same editor on the right. A document's own `presentation`
361
+ * argument overrides this.
362
+ */
363
+ documentEditor?: DocumentEditorConfig;
336
364
  /**
337
365
  * Called with an updated OpenUI program when the user edits a document (body or title).
338
366
  * The matching `DocumentEditor(id, title, content)` call is rewritten with the new title and
@@ -725,7 +753,7 @@ declare function sseToText(source: StreamSource, options?: SseOptions & {
725
753
  */
726
754
  declare function jsonFieldExtractor(path: string): (data: string) => string | null;
727
755
 
728
- declare const 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.";
756
+ declare const DOCUMENT_COMPONENT_DESCRIPTION = "Custom component. An editable document. DocumentEditor(documentId, title, content, documentType?, status?, editable?, exportFormats?, presentation?). 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. presentation is \"inline\" or \"side-panel\"; omit it to use the app default.";
729
757
  /** Standalone editor. While a June response is still streaming, shows a placeholder instead of mounting Tiptap. */
730
758
  declare function DocumentEditor(props: DocumentEditorProps): react.JSX.Element;
731
759
  declare const JuneDocumentEditorComponent: _openuidev_react_lang.DefinedComponent<z.ZodObject<{
@@ -736,6 +764,10 @@ declare const JuneDocumentEditorComponent: _openuidev_react_lang.DefinedComponen
736
764
  status: z.ZodOptional<z.ZodString>;
737
765
  editable: z.ZodOptional<z.ZodBoolean>;
738
766
  exportFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
767
+ presentation: z.ZodOptional<z.ZodEnum<{
768
+ inline: "inline";
769
+ "side-panel": "side-panel";
770
+ }>>;
739
771
  }, z.core.$strip>>;
740
772
  type Extendable = Library & {
741
773
  extend: NonNullable<Library["extend"]>;
@@ -749,11 +781,20 @@ type Extendable = Library & {
749
781
  declare function withDocumentEditor(library: Extendable): Required<_openuidev_lang_core.Library<_openuidev_react_lang.ComponentRenderer<any>, _openuidev_lang_core.DefinedAction<any, string>>>;
750
782
 
751
783
  declare const JuneDocumentContext: react.Context<JuneDocumentOptions>;
784
+ /** App-wide `documentEditor` config from JuneUI. Empty when the app did not set one. */
785
+ declare const DocumentEditorConfigContext: react.Context<DocumentEditorConfig>;
786
+ declare function useDocumentEditorConfig(): DocumentEditorConfig;
752
787
  declare function useDocumentOptions(): JuneDocumentOptions;
753
788
 
789
+ /** Per-document value, then the app config, then `"inline"`. */
790
+ declare function resolveDocumentPresentation(documentPresentation?: string | null, configured?: string | null): DocumentPresentation;
791
+ /** CSS width for the side panel. A number is pixels. */
792
+ declare function documentPanelWidth(width?: string | number): string | undefined;
793
+
754
794
  /** Provides document options (and edit write-back) to every DocumentEditor below it. */
755
- declare function DocumentBridge({ children, ...options }: DocumentBridgeOptions & {
795
+ declare function DocumentBridge({ children, documentEditor, ...options }: DocumentBridgeOptions & {
756
796
  children?: ReactNode;
797
+ documentEditor?: DocumentEditorConfig;
757
798
  }): react.JSX.Element;
758
799
 
759
800
  /**
@@ -1002,4 +1043,4 @@ declare function readLangGraphInterrupts(data: string, event?: string): unknown[
1002
1043
  */
1003
1044
  declare function interruptToApprovalRequests(value: unknown, idPrefix?: string): ToolApprovalRequest[];
1004
1045
 
1005
- export { ALL_EXPORT_FORMATS, type ActionEventParser, type ActionOutcome, type AnyComponentDefinition, type ApprovalChoice, type ComponentProps, ComponentRegistry, type ComponentRegistryOptions, type ConfirmAction, type ConsumeStreamOptions, DOCUMENT_COMPONENT_DESCRIPTION, type DefineComponentOptions, type DocJSON, type DocNode, DocumentBridge, type DocumentBridgeOptions, type DocumentChange, type DocumentConflict, DocumentEditor, type DocumentEditorProps, type DocumentExportEvent, type DocumentExportFormat, type DocumentExporter, type DocumentInstructionOptions, type DocumentProgramUpdate, type DocumentRecord, type DocumentSavePayload, type DocumentSnapshot, type DocumentStore, type ExportContext, type ExportResult, type FallbackArgs, type FetchStreamOptions, type IncomingDocument, type JuneAction, type JuneActionContext, type JuneActionDefinition, type JuneActionMap, type JuneComponent, type JuneComponentMeta, type JuneContextValue, JuneDocumentContext, JuneDocumentEditorComponent, type JuneDocumentOptions, JuneError, JuneErrorBoundary, type JuneErrorBoundaryProps, type JuneErrorCode, type JuneErrorOptions, type JuneLibraryOptions, type JuneRenderProps, JuneRenderer, type JuneRendererProps, type JuneResolvedTheme, JuneRuntimeContext, type JuneRuntimeValue, type JuneStreamState, type JuneThemeInput, type JuneThemeMode, JuneThemeProvider, type JuneThemeProviderProps, type JuneThemeSet, type JuneThemeToken, type JuneThemeVars, type LangGraphExtractorOptions, MarkdownText, type MarkdownTextProps, type MixedContent, type MixedContentOptions, type OpenUIActionEvent, type OpenUILibrary, type OpenUIRendererProps, type ParsedActionEvent, type PendingUpdate, type ReceiveOutcome, type RegisterOptions, type ResolveChoice, type ResponseChangeInfo, type RunActionOptions, type SchemaLike, type SplitOptions, type SplitResponse, type SseOptions, type StreamChunk, type StreamSource, type StreamStarter, type StreamStatus, type TextFormat, ToolApproval, type ToolApprovalDecision, type ToolApprovalEntry, type ToolApprovalInput, type ToolApprovalLabels, ToolApprovalList, type ToolApprovalListProps, type ToolApprovalProps, type ToolApprovalRequest, type ToolApprovalStatus, type UseJuneStreamOptions, type UseJuneStreamResult, type UseToolApprovalResult, consumeStream, copyDocumentToClipboard, createActionHandler, createComponentRegistry, createDocumentStore, createJuneLibrary, createLangGraphExtractor, createTheme, darkTheme, defaultParseActionEvent, defaultToolApprovalLabels, defineComponent, defineJuneAction, defineJuneComponent, documentPromptOptions, downloadResult, exportDocument, fetchStream, getDefaultDocumentStore, getDocumentEditorInstructions, getDocumentEditorRules, interruptToApprovalRequests, isDocumentEcho, isJuneComponent, isJuneError, isThemeSet, jsonFieldExtractor, langGraphStreamOptions, lightTheme, listDocumentExporters, mergeDocuments, messageContentToText, normalizeProgram, readDocumentFromProgram, readLangGraphInterrupts, registerDocumentExporter, rememberDocumentEcho, resolveMixedContent, resolveThemeVars, runAction, serializeDocumentsForAgent, splitResponse, sseToText, toAsyncIterable, toJuneError, updateDocumentInProgram, useDocumentBridge, useDocumentOptions, useJuneRuntime, useJuneStream, useJuneTheme, useRegistryLibrary, useResolvedTheme, useToolApproval, validateComponentDefinition, withDocumentEditor };
1046
+ export { ALL_EXPORT_FORMATS, type ActionEventParser, type ActionOutcome, type AnyComponentDefinition, type ApprovalChoice, type ComponentProps, ComponentRegistry, type ComponentRegistryOptions, type ConfirmAction, type ConsumeStreamOptions, DOCUMENT_COMPONENT_DESCRIPTION, type DefineComponentOptions, type DocJSON, type DocNode, DocumentBridge, type DocumentBridgeOptions, type DocumentChange, type DocumentConflict, DocumentEditor, type DocumentEditorConfig, DocumentEditorConfigContext, type DocumentEditorProps, type DocumentExportEvent, type DocumentExportFormat, type DocumentExporter, type DocumentInstructionOptions, type DocumentPresentation, type DocumentProgramUpdate, type DocumentRecord, type DocumentSavePayload, type DocumentSnapshot, type DocumentStore, type ExportContext, type ExportResult, type FallbackArgs, type FetchStreamOptions, type IncomingDocument, type JuneAction, type JuneActionContext, type JuneActionDefinition, type JuneActionMap, type JuneComponent, type JuneComponentMeta, type JuneContextValue, JuneDocumentContext, JuneDocumentEditorComponent, type JuneDocumentOptions, JuneError, JuneErrorBoundary, type JuneErrorBoundaryProps, type JuneErrorCode, type JuneErrorOptions, type JuneLibraryOptions, type JuneRenderProps, JuneRenderer, type JuneRendererProps, type JuneResolvedTheme, JuneRuntimeContext, type JuneRuntimeValue, type JuneStreamState, type JuneThemeInput, type JuneThemeMode, JuneThemeProvider, type JuneThemeProviderProps, type JuneThemeSet, type JuneThemeToken, type JuneThemeVars, type LangGraphExtractorOptions, MarkdownText, type MarkdownTextProps, type MixedContent, type MixedContentOptions, type OpenUIActionEvent, type OpenUILibrary, type OpenUIRendererProps, type ParsedActionEvent, type PendingUpdate, type ReceiveOutcome, type RegisterOptions, type ResolveChoice, type ResponseChangeInfo, type RunActionOptions, type SchemaLike, type SplitOptions, type SplitResponse, type SseOptions, type StreamChunk, type StreamSource, type StreamStarter, type StreamStatus, type TextFormat, ToolApproval, type ToolApprovalDecision, type ToolApprovalEntry, type ToolApprovalInput, type ToolApprovalLabels, ToolApprovalList, type ToolApprovalListProps, type ToolApprovalProps, type ToolApprovalRequest, type ToolApprovalStatus, type UseJuneStreamOptions, type UseJuneStreamResult, type UseToolApprovalResult, consumeStream, copyDocumentToClipboard, createActionHandler, createComponentRegistry, createDocumentStore, createJuneLibrary, createLangGraphExtractor, createTheme, darkTheme, defaultParseActionEvent, defaultToolApprovalLabels, defineComponent, defineJuneAction, defineJuneComponent, documentPanelWidth, documentPromptOptions, downloadResult, exportDocument, fetchStream, getDefaultDocumentStore, getDocumentEditorInstructions, getDocumentEditorRules, interruptToApprovalRequests, isDocumentEcho, isJuneComponent, isJuneError, isThemeSet, jsonFieldExtractor, langGraphStreamOptions, lightTheme, listDocumentExporters, mergeDocuments, messageContentToText, normalizeProgram, readDocumentFromProgram, readLangGraphInterrupts, registerDocumentExporter, rememberDocumentEcho, resolveDocumentPresentation, resolveMixedContent, resolveThemeVars, runAction, serializeDocumentsForAgent, splitResponse, sseToText, toAsyncIterable, toJuneError, updateDocumentInProgram, useDocumentBridge, useDocumentEditorConfig, useDocumentOptions, useJuneRuntime, useJuneStream, useJuneTheme, useRegistryLibrary, useResolvedTheme, useToolApproval, validateComponentDefinition, withDocumentEditor };