@june-ai/june-ui 0.2.6 → 0.2.7
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/block-automount.js +2 -0
- package/dist/index.cjs +455 -405
- package/dist/index.js +364 -313
- package/package.json +6 -3
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "./block-automount.js";
|
|
1
2
|
import {
|
|
2
3
|
JuneError,
|
|
3
4
|
createDocumentExtensions,
|
|
@@ -22,6 +23,53 @@ import {
|
|
|
22
23
|
wordCountOf
|
|
23
24
|
} from "./chunk-VFZI3SEL.js";
|
|
24
25
|
|
|
26
|
+
// src/openui/disable-devtools.tsx
|
|
27
|
+
import { OpenUIDevtools } from "@openuidev/devtools";
|
|
28
|
+
import { jsx } from "react/jsx-runtime";
|
|
29
|
+
var AUTO_MOUNT_FLAG = /* @__PURE__ */ Symbol.for("openui.devtools.autoMount");
|
|
30
|
+
var BLOCKED_BY_JUNE = /* @__PURE__ */ Symbol.for("openui.devtools.blockedByJune");
|
|
31
|
+
var flags = globalThis;
|
|
32
|
+
var scheduledByOpenUI = flags[AUTO_MOUNT_FLAG] === true && flags[BLOCKED_BY_JUNE] !== true;
|
|
33
|
+
flags[AUTO_MOUNT_FLAG] = true;
|
|
34
|
+
flags[BLOCKED_BY_JUNE] = true;
|
|
35
|
+
var DEVTOOLS_BUNDLE = "https://cdn.jsdelivr.net/npm/@openuidev/devtools@0/dist/devtools.browser.js";
|
|
36
|
+
var ALIAS_CACHE_MS = 5 * 60 * 1e3;
|
|
37
|
+
function claimDisabledDevtools() {
|
|
38
|
+
if (typeof document === "undefined") return () => {
|
|
39
|
+
};
|
|
40
|
+
const url = `${DEVTOOLS_BUNDLE}?t=${Math.floor(Date.now() / ALIAS_CACHE_MS)}`;
|
|
41
|
+
let cancelled = false;
|
|
42
|
+
let unmount = () => {
|
|
43
|
+
cancelled = true;
|
|
44
|
+
};
|
|
45
|
+
void Promise.all([
|
|
46
|
+
import(
|
|
47
|
+
/* @vite-ignore */
|
|
48
|
+
url
|
|
49
|
+
),
|
|
50
|
+
import("react"),
|
|
51
|
+
import("react-dom"),
|
|
52
|
+
import("react-dom/client")
|
|
53
|
+
]).then(([devtools, react, reactDom, reactDomClient]) => {
|
|
54
|
+
if (cancelled) return;
|
|
55
|
+
unmount = devtools.mountOpenUIDevtools({
|
|
56
|
+
React: react,
|
|
57
|
+
ReactDOM: reactDom,
|
|
58
|
+
ReactDOMClient: reactDomClient,
|
|
59
|
+
loadReactLang: () => import("@openuidev/react-lang"),
|
|
60
|
+
props: { enabled: false }
|
|
61
|
+
});
|
|
62
|
+
}).catch(() => {
|
|
63
|
+
});
|
|
64
|
+
return () => unmount();
|
|
65
|
+
}
|
|
66
|
+
if (scheduledByOpenUI && process.env.NODE_ENV === "development" && process.env.VITEST !== "true" && typeof document !== "undefined") {
|
|
67
|
+
claimDisabledDevtools();
|
|
68
|
+
}
|
|
69
|
+
function OpenUIDevtoolsGate() {
|
|
70
|
+
return /* @__PURE__ */ jsx(OpenUIDevtools, { enabled: false });
|
|
71
|
+
}
|
|
72
|
+
|
|
25
73
|
// src/renderer/renderer.tsx
|
|
26
74
|
import { Renderer } from "@openuidev/react-lang";
|
|
27
75
|
import {
|
|
@@ -454,7 +502,7 @@ var lightTheme = {
|
|
|
454
502
|
};
|
|
455
503
|
|
|
456
504
|
// src/themes/theme-provider.tsx
|
|
457
|
-
import { jsx } from "react/jsx-runtime";
|
|
505
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
458
506
|
var QUERY = "(prefers-color-scheme: dark)";
|
|
459
507
|
function subscribe(onChange) {
|
|
460
508
|
if (typeof window === "undefined" || !window.matchMedia) return () => {
|
|
@@ -497,7 +545,7 @@ function JuneThemeProvider({
|
|
|
497
545
|
() => ({ mode: mode ?? "system", theme: resolved }),
|
|
498
546
|
[mode, resolved]
|
|
499
547
|
);
|
|
500
|
-
return /* @__PURE__ */
|
|
548
|
+
return /* @__PURE__ */ jsx2(JuneContext.Provider, { value: context, children: /* @__PURE__ */ jsx2(
|
|
501
549
|
"div",
|
|
502
550
|
{
|
|
503
551
|
className: className ? `june-ui-root ${className}` : "june-ui-root",
|
|
@@ -919,7 +967,7 @@ function splitResponse(source, options = {}) {
|
|
|
919
967
|
|
|
920
968
|
// src/renderer/error-boundary.tsx
|
|
921
969
|
import { Component } from "react";
|
|
922
|
-
import { jsx as
|
|
970
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
923
971
|
function keysChanged(a = [], b = []) {
|
|
924
972
|
return a.length !== b.length || a.some((v, i) => !Object.is(v, b[i]));
|
|
925
973
|
}
|
|
@@ -948,12 +996,12 @@ var JuneErrorBoundary = class extends Component {
|
|
|
948
996
|
const { fallback } = this.props;
|
|
949
997
|
if (typeof fallback === "function") return fallback({ error, reset: this.reset });
|
|
950
998
|
if (fallback !== void 0) return fallback;
|
|
951
|
-
return /* @__PURE__ */
|
|
999
|
+
return /* @__PURE__ */ jsx3("div", { role: "alert", "data-june-error": "", children: "Something went wrong while rendering this UI." });
|
|
952
1000
|
}
|
|
953
1001
|
};
|
|
954
1002
|
|
|
955
1003
|
// src/renderer/renderer.tsx
|
|
956
|
-
import { jsx as
|
|
1004
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
957
1005
|
function JuneRenderer(props) {
|
|
958
1006
|
const {
|
|
959
1007
|
library,
|
|
@@ -1083,31 +1131,34 @@ function JuneRenderer(props) {
|
|
|
1083
1131
|
const before = parts?.before ?? [];
|
|
1084
1132
|
const after = parts?.after ?? [];
|
|
1085
1133
|
const hasText = before.length + after.length > 0;
|
|
1086
|
-
const text = (value, index, key) => /* @__PURE__ */
|
|
1087
|
-
return /* @__PURE__ */
|
|
1088
|
-
|
|
1089
|
-
{
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1134
|
+
const text = (value, index, key) => /* @__PURE__ */ jsx4(Fragment, { children: renderText ? renderText(value, index) : /* @__PURE__ */ jsx4("p", { className: "june-text", children: value }) }, key);
|
|
1135
|
+
return /* @__PURE__ */ jsxs(JuneThemeProvider, { mode: theme, vars: themeVars, className, style, children: [
|
|
1136
|
+
/* @__PURE__ */ jsx4(OpenUIDevtoolsGate, {}),
|
|
1137
|
+
/* @__PURE__ */ jsx4(JuneRuntimeContext.Provider, { value: runtime, children: /* @__PURE__ */ jsx4(JuneDocumentContext.Provider, { value: documentOptions, children: /* @__PURE__ */ jsxs(
|
|
1138
|
+
JuneErrorBoundary,
|
|
1139
|
+
{
|
|
1140
|
+
fallback: errorFallback,
|
|
1141
|
+
onError: handleBoundaryError,
|
|
1142
|
+
resetKeys: resetKeys ?? [response],
|
|
1143
|
+
children: [
|
|
1144
|
+
before.map((t, i) => text(t, i, `b${i}`)),
|
|
1145
|
+
hasUi && /* @__PURE__ */ jsx4(
|
|
1146
|
+
Renderer,
|
|
1147
|
+
{
|
|
1148
|
+
...rendererProps,
|
|
1149
|
+
library,
|
|
1150
|
+
response: uiText,
|
|
1151
|
+
isStreaming,
|
|
1152
|
+
onAction: handleAction,
|
|
1153
|
+
onError: handleParserErrors
|
|
1154
|
+
}
|
|
1155
|
+
),
|
|
1156
|
+
after.map((t, i) => text(t, before.length + i, `a${i}`)),
|
|
1157
|
+
!hasUi && !hasText && (isStreaming ? loadingFallback : emptyFallback)
|
|
1158
|
+
]
|
|
1159
|
+
}
|
|
1160
|
+
) }) })
|
|
1161
|
+
] });
|
|
1111
1162
|
}
|
|
1112
1163
|
|
|
1113
1164
|
// src/components/library.ts
|
|
@@ -1435,18 +1486,18 @@ import { defineComponent as defineComponent2 } from "@openuidev/react-lang";
|
|
|
1435
1486
|
import { z } from "zod/v4";
|
|
1436
1487
|
|
|
1437
1488
|
// src/components/document-editor/document-draft.tsx
|
|
1438
|
-
import { jsx as
|
|
1489
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1439
1490
|
function DocumentDraft({ title, words, state }) {
|
|
1440
1491
|
if (state === "empty") {
|
|
1441
|
-
return /* @__PURE__ */
|
|
1492
|
+
return /* @__PURE__ */ jsx5("div", { className: "june-doc june-doc--draft", role: "alert", children: /* @__PURE__ */ jsx5("p", { className: "june-doc__draft-text", children: "No document content was received." }) });
|
|
1442
1493
|
}
|
|
1443
1494
|
return /* @__PURE__ */ jsxs2("div", { className: "june-doc june-doc--draft", role: "status", "aria-live": "polite", children: [
|
|
1444
|
-
title ? /* @__PURE__ */
|
|
1445
|
-
/* @__PURE__ */
|
|
1495
|
+
title ? /* @__PURE__ */ jsx5("p", { className: "june-doc__draft-title", children: title }) : null,
|
|
1496
|
+
/* @__PURE__ */ jsx5("p", { className: "june-doc__draft-text", children: state === "drafting" ? `Drafting document\u2026${words ? ` ${words} words so far` : ""}` : "Loading editor\u2026" }),
|
|
1446
1497
|
/* @__PURE__ */ jsxs2("div", { className: "june-doc__pulse", "aria-hidden": "true", children: [
|
|
1447
|
-
/* @__PURE__ */
|
|
1448
|
-
/* @__PURE__ */
|
|
1449
|
-
/* @__PURE__ */
|
|
1498
|
+
/* @__PURE__ */ jsx5("span", {}),
|
|
1499
|
+
/* @__PURE__ */ jsx5("span", {}),
|
|
1500
|
+
/* @__PURE__ */ jsx5("span", {})
|
|
1450
1501
|
] })
|
|
1451
1502
|
] });
|
|
1452
1503
|
}
|
|
@@ -1464,208 +1515,208 @@ import { useEditorState } from "@tiptap/react";
|
|
|
1464
1515
|
import { useRef as useRef4, useState as useState3 } from "react";
|
|
1465
1516
|
|
|
1466
1517
|
// src/components/document-editor/document-icons.tsx
|
|
1467
|
-
import { Fragment as Fragment2, jsx as
|
|
1518
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1468
1519
|
var PATHS = {
|
|
1469
1520
|
undo: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1470
|
-
/* @__PURE__ */
|
|
1471
|
-
/* @__PURE__ */
|
|
1521
|
+
/* @__PURE__ */ jsx6("path", { d: "M9 14 4 9l5-5" }),
|
|
1522
|
+
/* @__PURE__ */ jsx6("path", { d: "M4 9h10.5a5.5 5.5 0 0 1 0 11H11" })
|
|
1472
1523
|
] }),
|
|
1473
1524
|
redo: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1474
|
-
/* @__PURE__ */
|
|
1475
|
-
/* @__PURE__ */
|
|
1525
|
+
/* @__PURE__ */ jsx6("path", { d: "m15 14 5-5-5-5" }),
|
|
1526
|
+
/* @__PURE__ */ jsx6("path", { d: "M20 9H9.5a5.5 5.5 0 0 0 0 11H13" })
|
|
1476
1527
|
] }),
|
|
1477
|
-
bold: /* @__PURE__ */
|
|
1528
|
+
bold: /* @__PURE__ */ jsx6("path", { d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8" }),
|
|
1478
1529
|
italic: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1530
|
+
/* @__PURE__ */ jsx6("line", { x1: "19", x2: "10", y1: "4", y2: "4" }),
|
|
1531
|
+
/* @__PURE__ */ jsx6("line", { x1: "14", x2: "5", y1: "20", y2: "20" }),
|
|
1532
|
+
/* @__PURE__ */ jsx6("line", { x1: "15", x2: "9", y1: "4", y2: "20" })
|
|
1482
1533
|
] }),
|
|
1483
1534
|
underline: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1484
|
-
/* @__PURE__ */
|
|
1485
|
-
/* @__PURE__ */
|
|
1535
|
+
/* @__PURE__ */ jsx6("path", { d: "M6 4v6a6 6 0 0 0 12 0V4" }),
|
|
1536
|
+
/* @__PURE__ */ jsx6("line", { x1: "4", x2: "20", y1: "20", y2: "20" })
|
|
1486
1537
|
] }),
|
|
1487
1538
|
strike: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1488
|
-
/* @__PURE__ */
|
|
1489
|
-
/* @__PURE__ */
|
|
1490
|
-
/* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ jsx6("path", { d: "M16 4H9a3 3 0 0 0-2.83 4" }),
|
|
1540
|
+
/* @__PURE__ */ jsx6("path", { d: "M14 12a4 4 0 0 1 0 8H6" }),
|
|
1541
|
+
/* @__PURE__ */ jsx6("line", { x1: "4", x2: "20", y1: "12", y2: "12" })
|
|
1491
1542
|
] }),
|
|
1492
1543
|
code: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1493
|
-
/* @__PURE__ */
|
|
1494
|
-
/* @__PURE__ */
|
|
1544
|
+
/* @__PURE__ */ jsx6("path", { d: "m16 18 6-6-6-6" }),
|
|
1545
|
+
/* @__PURE__ */ jsx6("path", { d: "m8 6-6 6 6 6" })
|
|
1495
1546
|
] }),
|
|
1496
1547
|
codeBlock: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1497
|
-
/* @__PURE__ */
|
|
1498
|
-
/* @__PURE__ */
|
|
1499
|
-
/* @__PURE__ */
|
|
1548
|
+
/* @__PURE__ */ jsx6("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
1549
|
+
/* @__PURE__ */ jsx6("path", { d: "m10 9-3 3 3 3" }),
|
|
1550
|
+
/* @__PURE__ */ jsx6("path", { d: "m14 15 3-3-3-3" })
|
|
1500
1551
|
] }),
|
|
1501
1552
|
superscript: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1504
|
-
/* @__PURE__ */
|
|
1553
|
+
/* @__PURE__ */ jsx6("path", { d: "m4 19 8-8" }),
|
|
1554
|
+
/* @__PURE__ */ jsx6("path", { d: "m12 19-8-8" }),
|
|
1555
|
+
/* @__PURE__ */ jsx6("path", { d: "M20 12h-4c0-1.5.44-2 1.5-2.5S20 8.33 20 7c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07" })
|
|
1505
1556
|
] }),
|
|
1506
1557
|
subscript: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1507
|
-
/* @__PURE__ */
|
|
1508
|
-
/* @__PURE__ */
|
|
1509
|
-
/* @__PURE__ */
|
|
1558
|
+
/* @__PURE__ */ jsx6("path", { d: "m4 5 8 8" }),
|
|
1559
|
+
/* @__PURE__ */ jsx6("path", { d: "m12 5-8 8" }),
|
|
1560
|
+
/* @__PURE__ */ jsx6("path", { d: "M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07" })
|
|
1510
1561
|
] }),
|
|
1511
1562
|
alignLeft: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1512
|
-
/* @__PURE__ */
|
|
1513
|
-
/* @__PURE__ */
|
|
1514
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ jsx6("path", { d: "M15 12H3" }),
|
|
1564
|
+
/* @__PURE__ */ jsx6("path", { d: "M17 18H3" }),
|
|
1565
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 6H3" })
|
|
1515
1566
|
] }),
|
|
1516
1567
|
alignCenter: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1517
|
-
/* @__PURE__ */
|
|
1518
|
-
/* @__PURE__ */
|
|
1519
|
-
/* @__PURE__ */
|
|
1568
|
+
/* @__PURE__ */ jsx6("path", { d: "M17 12H7" }),
|
|
1569
|
+
/* @__PURE__ */ jsx6("path", { d: "M19 18H5" }),
|
|
1570
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 6H3" })
|
|
1520
1571
|
] }),
|
|
1521
1572
|
alignRight: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1522
|
-
/* @__PURE__ */
|
|
1523
|
-
/* @__PURE__ */
|
|
1524
|
-
/* @__PURE__ */
|
|
1573
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 12H9" }),
|
|
1574
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 18H7" }),
|
|
1575
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 6H3" })
|
|
1525
1576
|
] }),
|
|
1526
1577
|
alignJustify: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1527
|
-
/* @__PURE__ */
|
|
1528
|
-
/* @__PURE__ */
|
|
1529
|
-
/* @__PURE__ */
|
|
1578
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 12h18" }),
|
|
1579
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 18h18" }),
|
|
1580
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 6h18" })
|
|
1530
1581
|
] }),
|
|
1531
1582
|
list: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1532
|
-
/* @__PURE__ */
|
|
1533
|
-
/* @__PURE__ */
|
|
1534
|
-
/* @__PURE__ */
|
|
1535
|
-
/* @__PURE__ */
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 12h.01" }),
|
|
1584
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 18h.01" }),
|
|
1585
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 6h.01" }),
|
|
1586
|
+
/* @__PURE__ */ jsx6("path", { d: "M8 12h13" }),
|
|
1587
|
+
/* @__PURE__ */ jsx6("path", { d: "M8 18h13" }),
|
|
1588
|
+
/* @__PURE__ */ jsx6("path", { d: "M8 6h13" })
|
|
1538
1589
|
] }),
|
|
1539
1590
|
listOrdered: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1540
|
-
/* @__PURE__ */
|
|
1541
|
-
/* @__PURE__ */
|
|
1542
|
-
/* @__PURE__ */
|
|
1543
|
-
/* @__PURE__ */
|
|
1544
|
-
/* @__PURE__ */
|
|
1545
|
-
/* @__PURE__ */
|
|
1591
|
+
/* @__PURE__ */ jsx6("path", { d: "M10 12h11" }),
|
|
1592
|
+
/* @__PURE__ */ jsx6("path", { d: "M10 18h11" }),
|
|
1593
|
+
/* @__PURE__ */ jsx6("path", { d: "M10 6h11" }),
|
|
1594
|
+
/* @__PURE__ */ jsx6("path", { d: "M4 10h2" }),
|
|
1595
|
+
/* @__PURE__ */ jsx6("path", { d: "M4 6h1v4" }),
|
|
1596
|
+
/* @__PURE__ */ jsx6("path", { d: "M6 18H4c0-1 2-2 2-3s-1-1.5-2-1" })
|
|
1546
1597
|
] }),
|
|
1547
1598
|
outdent: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1548
|
-
/* @__PURE__ */
|
|
1549
|
-
/* @__PURE__ */
|
|
1550
|
-
/* @__PURE__ */
|
|
1551
|
-
/* @__PURE__ */
|
|
1599
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 12H11" }),
|
|
1600
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 18H11" }),
|
|
1601
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 6H11" }),
|
|
1602
|
+
/* @__PURE__ */ jsx6("path", { d: "m7 8-4 4 4 4" })
|
|
1552
1603
|
] }),
|
|
1553
1604
|
indent: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1554
|
-
/* @__PURE__ */
|
|
1555
|
-
/* @__PURE__ */
|
|
1556
|
-
/* @__PURE__ */
|
|
1557
|
-
/* @__PURE__ */
|
|
1605
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 12H11" }),
|
|
1606
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 18H11" }),
|
|
1607
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 6H11" }),
|
|
1608
|
+
/* @__PURE__ */ jsx6("path", { d: "m3 8 4 4-4 4" })
|
|
1558
1609
|
] }),
|
|
1559
1610
|
quote: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
/* @__PURE__ */
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
-
/* @__PURE__ */
|
|
1611
|
+
/* @__PURE__ */ jsx6("path", { d: "M17 6H3" }),
|
|
1612
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 12H8" }),
|
|
1613
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 18H8" }),
|
|
1614
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 12v6" })
|
|
1564
1615
|
] }),
|
|
1565
1616
|
pilcrow: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1566
|
-
/* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1568
|
-
/* @__PURE__ */
|
|
1617
|
+
/* @__PURE__ */ jsx6("path", { d: "M13 4v16" }),
|
|
1618
|
+
/* @__PURE__ */ jsx6("path", { d: "M17 4v16" }),
|
|
1619
|
+
/* @__PURE__ */ jsx6("path", { d: "M19 4H9.5a4.5 4.5 0 0 0 0 9H13" })
|
|
1569
1620
|
] }),
|
|
1570
1621
|
pageBreak: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1571
|
-
/* @__PURE__ */
|
|
1572
|
-
/* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */
|
|
1622
|
+
/* @__PURE__ */ jsx6("line", { x1: "3", x2: "21", y1: "12", y2: "12" }),
|
|
1623
|
+
/* @__PURE__ */ jsx6("polyline", { points: "8 8 12 4 16 8" }),
|
|
1624
|
+
/* @__PURE__ */ jsx6("polyline", { points: "16 16 12 20 8 16" })
|
|
1574
1625
|
] }),
|
|
1575
1626
|
divider: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1576
|
-
/* @__PURE__ */
|
|
1577
|
-
/* @__PURE__ */
|
|
1578
|
-
/* @__PURE__ */
|
|
1627
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 12h18" }),
|
|
1628
|
+
/* @__PURE__ */ jsx6("path", { d: "M8 6h8", opacity: ".45" }),
|
|
1629
|
+
/* @__PURE__ */ jsx6("path", { d: "M8 18h8", opacity: ".45" })
|
|
1579
1630
|
] }),
|
|
1580
1631
|
layout: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1581
|
-
/* @__PURE__ */
|
|
1582
|
-
/* @__PURE__ */
|
|
1583
|
-
/* @__PURE__ */
|
|
1632
|
+
/* @__PURE__ */ jsx6("rect", { width: "18", height: "7", x: "3", y: "3", rx: "1" }),
|
|
1633
|
+
/* @__PURE__ */ jsx6("rect", { width: "9", height: "7", x: "3", y: "14", rx: "1" }),
|
|
1634
|
+
/* @__PURE__ */ jsx6("rect", { width: "5", height: "7", x: "16", y: "14", rx: "1" })
|
|
1584
1635
|
] }),
|
|
1585
1636
|
search: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1586
|
-
/* @__PURE__ */
|
|
1587
|
-
/* @__PURE__ */
|
|
1637
|
+
/* @__PURE__ */ jsx6("circle", { cx: "11", cy: "11", r: "8" }),
|
|
1638
|
+
/* @__PURE__ */ jsx6("path", { d: "m21 21-4.3-4.3" })
|
|
1588
1639
|
] }),
|
|
1589
1640
|
palette: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1590
|
-
/* @__PURE__ */
|
|
1591
|
-
/* @__PURE__ */
|
|
1592
|
-
/* @__PURE__ */
|
|
1593
|
-
/* @__PURE__ */
|
|
1594
|
-
/* @__PURE__ */
|
|
1641
|
+
/* @__PURE__ */ jsx6("circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor" }),
|
|
1642
|
+
/* @__PURE__ */ jsx6("circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor" }),
|
|
1643
|
+
/* @__PURE__ */ jsx6("circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor" }),
|
|
1644
|
+
/* @__PURE__ */ jsx6("circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor" }),
|
|
1645
|
+
/* @__PURE__ */ jsx6("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.93 0 1.65-.75 1.65-1.69 0-.44-.18-.84-.44-1.13-.29-.29-.44-.65-.44-1.13a1.64 1.64 0 0 1 1.67-1.67h2c3.05 0 5.55-2.5 5.55-5.55C21.97 6.01 17.46 2 12 2z" })
|
|
1595
1646
|
] }),
|
|
1596
1647
|
highlighter: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1597
|
-
/* @__PURE__ */
|
|
1598
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ jsx6("path", { d: "m9 11-6 6v3h9l3-3" }),
|
|
1649
|
+
/* @__PURE__ */ jsx6("path", { d: "m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4" })
|
|
1599
1650
|
] }),
|
|
1600
1651
|
link: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1601
|
-
/* @__PURE__ */
|
|
1602
|
-
/* @__PURE__ */
|
|
1652
|
+
/* @__PURE__ */ jsx6("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" }),
|
|
1653
|
+
/* @__PURE__ */ jsx6("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" })
|
|
1603
1654
|
] }),
|
|
1604
1655
|
image: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1605
|
-
/* @__PURE__ */
|
|
1606
|
-
/* @__PURE__ */
|
|
1607
|
-
/* @__PURE__ */
|
|
1656
|
+
/* @__PURE__ */ jsx6("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
1657
|
+
/* @__PURE__ */ jsx6("circle", { cx: "9", cy: "9", r: "2" }),
|
|
1658
|
+
/* @__PURE__ */ jsx6("path", { d: "m21 15-3.09-3.09a2 2 0 0 0-2.82 0L6 21" })
|
|
1608
1659
|
] }),
|
|
1609
1660
|
table: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1610
|
-
/* @__PURE__ */
|
|
1611
|
-
/* @__PURE__ */
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
/* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ jsx6("path", { d: "M12 3v18" }),
|
|
1662
|
+
/* @__PURE__ */ jsx6("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
1663
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 9h18" }),
|
|
1664
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 15h18" })
|
|
1614
1665
|
] }),
|
|
1615
1666
|
eraser: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1616
|
-
/* @__PURE__ */
|
|
1617
|
-
/* @__PURE__ */
|
|
1618
|
-
/* @__PURE__ */
|
|
1667
|
+
/* @__PURE__ */ jsx6("path", { d: "m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21" }),
|
|
1668
|
+
/* @__PURE__ */ jsx6("path", { d: "M22 21H7" }),
|
|
1669
|
+
/* @__PURE__ */ jsx6("path", { d: "m5 11 9 9" })
|
|
1619
1670
|
] }),
|
|
1620
1671
|
save: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1621
|
-
/* @__PURE__ */
|
|
1622
|
-
/* @__PURE__ */
|
|
1623
|
-
/* @__PURE__ */
|
|
1672
|
+
/* @__PURE__ */ jsx6("path", { d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z" }),
|
|
1673
|
+
/* @__PURE__ */ jsx6("path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7" }),
|
|
1674
|
+
/* @__PURE__ */ jsx6("path", { d: "M7 3v4a1 1 0 0 0 1 1h7" })
|
|
1624
1675
|
] }),
|
|
1625
1676
|
download: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1626
|
-
/* @__PURE__ */
|
|
1627
|
-
/* @__PURE__ */
|
|
1628
|
-
/* @__PURE__ */
|
|
1677
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
1678
|
+
/* @__PURE__ */ jsx6("polyline", { points: "7 10 12 15 17 10" }),
|
|
1679
|
+
/* @__PURE__ */ jsx6("line", { x1: "12", x2: "12", y1: "15", y2: "3" })
|
|
1629
1680
|
] }),
|
|
1630
|
-
chevronDown: /* @__PURE__ */
|
|
1631
|
-
chevronUp: /* @__PURE__ */
|
|
1681
|
+
chevronDown: /* @__PURE__ */ jsx6("path", { d: "m6 9 6 6 6-6" }),
|
|
1682
|
+
chevronUp: /* @__PURE__ */ jsx6("path", { d: "m18 15-6-6-6 6" }),
|
|
1632
1683
|
close: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1633
|
-
/* @__PURE__ */
|
|
1634
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ jsx6("path", { d: "M18 6 6 18" }),
|
|
1685
|
+
/* @__PURE__ */ jsx6("path", { d: "m6 6 12 12" })
|
|
1635
1686
|
] }),
|
|
1636
1687
|
maximize: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1637
|
-
/* @__PURE__ */
|
|
1638
|
-
/* @__PURE__ */
|
|
1639
|
-
/* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1688
|
+
/* @__PURE__ */ jsx6("path", { d: "M8 3H5a2 2 0 0 0-2 2v3" }),
|
|
1689
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 8V5a2 2 0 0 0-2-2h-3" }),
|
|
1690
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 16v3a2 2 0 0 0 2 2h3" }),
|
|
1691
|
+
/* @__PURE__ */ jsx6("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
|
|
1641
1692
|
] }),
|
|
1642
1693
|
copy: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1643
|
-
/* @__PURE__ */
|
|
1644
|
-
/* @__PURE__ */
|
|
1694
|
+
/* @__PURE__ */ jsx6("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2" }),
|
|
1695
|
+
/* @__PURE__ */ jsx6("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
|
|
1645
1696
|
] }),
|
|
1646
1697
|
file: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1647
|
-
/* @__PURE__ */
|
|
1648
|
-
/* @__PURE__ */
|
|
1698
|
+
/* @__PURE__ */ jsx6("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
|
|
1699
|
+
/* @__PURE__ */ jsx6("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" })
|
|
1649
1700
|
] }),
|
|
1650
1701
|
plus: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1651
|
-
/* @__PURE__ */
|
|
1652
|
-
/* @__PURE__ */
|
|
1702
|
+
/* @__PURE__ */ jsx6("path", { d: "M5 12h14" }),
|
|
1703
|
+
/* @__PURE__ */ jsx6("path", { d: "M12 5v14" })
|
|
1653
1704
|
] }),
|
|
1654
|
-
minus: /* @__PURE__ */
|
|
1655
|
-
check: /* @__PURE__ */
|
|
1705
|
+
minus: /* @__PURE__ */ jsx6("path", { d: "M5 12h14" }),
|
|
1706
|
+
check: /* @__PURE__ */ jsx6("path", { d: "M20 6 9 17l-5-5" }),
|
|
1656
1707
|
sparkles: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1657
|
-
/* @__PURE__ */
|
|
1658
|
-
/* @__PURE__ */
|
|
1659
|
-
/* @__PURE__ */
|
|
1708
|
+
/* @__PURE__ */ jsx6("path", { d: "M9.94 14.06 8 20l-1.94-5.94L0 12l6.06-1.94L8 4l1.94 6.06L16 12z", transform: "translate(3 -1) scale(.85)" }),
|
|
1709
|
+
/* @__PURE__ */ jsx6("path", { d: "M20 3v4" }),
|
|
1710
|
+
/* @__PURE__ */ jsx6("path", { d: "M22 5h-4" })
|
|
1660
1711
|
] }),
|
|
1661
1712
|
upload: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1662
|
-
/* @__PURE__ */
|
|
1663
|
-
/* @__PURE__ */
|
|
1664
|
-
/* @__PURE__ */
|
|
1713
|
+
/* @__PURE__ */ jsx6("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
1714
|
+
/* @__PURE__ */ jsx6("polyline", { points: "17 8 12 3 7 8" }),
|
|
1715
|
+
/* @__PURE__ */ jsx6("line", { x1: "12", x2: "12", y1: "3", y2: "15" })
|
|
1665
1716
|
] })
|
|
1666
1717
|
};
|
|
1667
1718
|
function Icon({ name, size = 16 }) {
|
|
1668
|
-
return /* @__PURE__ */
|
|
1719
|
+
return /* @__PURE__ */ jsx6(
|
|
1669
1720
|
"svg",
|
|
1670
1721
|
{
|
|
1671
1722
|
className: "june-doc__icon",
|
|
@@ -1686,7 +1737,7 @@ function Icon({ name, size = 16 }) {
|
|
|
1686
1737
|
|
|
1687
1738
|
// src/components/document-editor/document-popover.tsx
|
|
1688
1739
|
import { useEffect as useEffect3, useRef as useRef3, useState as useState2 } from "react";
|
|
1689
|
-
import { jsx as
|
|
1740
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1690
1741
|
function Dropdown({ trigger, children, align = "start", className, onOpen }) {
|
|
1691
1742
|
const [open, setOpen] = useState2(false);
|
|
1692
1743
|
const anchor = useRef3(null);
|
|
@@ -1716,14 +1767,14 @@ function Dropdown({ trigger, children, align = "start", className, onOpen }) {
|
|
|
1716
1767
|
},
|
|
1717
1768
|
children: [
|
|
1718
1769
|
trigger({ open, toggle }),
|
|
1719
|
-
open ? /* @__PURE__ */
|
|
1770
|
+
open ? /* @__PURE__ */ jsx7("div", { className: `june-doc__pop june-doc__pop--${align}${className ? ` ${className}` : ""}`, children: children(close) }) : null
|
|
1720
1771
|
]
|
|
1721
1772
|
}
|
|
1722
1773
|
);
|
|
1723
1774
|
}
|
|
1724
1775
|
|
|
1725
1776
|
// src/components/document-editor/document-toolbar.tsx
|
|
1726
|
-
import { jsx as
|
|
1777
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1727
1778
|
var FONT_FAMILIES = [
|
|
1728
1779
|
{ label: "Default", value: "" },
|
|
1729
1780
|
{ label: "Arial", value: "Arial, Helvetica, sans-serif" },
|
|
@@ -1783,26 +1834,26 @@ function Btn({ label, icon, active, disabled, toggle, onClick, children, classNa
|
|
|
1783
1834
|
onMouseDown: (e) => e.preventDefault(),
|
|
1784
1835
|
onClick,
|
|
1785
1836
|
children: [
|
|
1786
|
-
icon ? /* @__PURE__ */
|
|
1787
|
-
children ?? (text ? /* @__PURE__ */
|
|
1837
|
+
icon ? /* @__PURE__ */ jsx8(Icon, { name: icon }) : null,
|
|
1838
|
+
children ?? (text ? /* @__PURE__ */ jsx8("span", { children: label }) : null)
|
|
1788
1839
|
]
|
|
1789
1840
|
}
|
|
1790
1841
|
);
|
|
1791
1842
|
}
|
|
1792
1843
|
function Group({ label, children }) {
|
|
1793
1844
|
return /* @__PURE__ */ jsxs5("div", { className: "june-doc__group", role: "group", "aria-label": label, children: [
|
|
1794
|
-
label ? /* @__PURE__ */
|
|
1845
|
+
label ? /* @__PURE__ */ jsx8("span", { className: "june-doc__group-label", "aria-hidden": "true", children: label }) : null,
|
|
1795
1846
|
children
|
|
1796
1847
|
] });
|
|
1797
1848
|
}
|
|
1798
1849
|
function Field({ label, children }) {
|
|
1799
1850
|
return /* @__PURE__ */ jsxs5("label", { className: "june-doc__field", children: [
|
|
1800
|
-
/* @__PURE__ */
|
|
1851
|
+
/* @__PURE__ */ jsx8("span", { className: "june-doc__field-label", children: label }),
|
|
1801
1852
|
children
|
|
1802
1853
|
] });
|
|
1803
1854
|
}
|
|
1804
1855
|
function ColorPicker({ label, icon, colors, current, disabled, resetLabel, onPick, onReset }) {
|
|
1805
|
-
return /* @__PURE__ */
|
|
1856
|
+
return /* @__PURE__ */ jsx8(
|
|
1806
1857
|
Dropdown,
|
|
1807
1858
|
{
|
|
1808
1859
|
trigger: ({ open, toggle }) => /* @__PURE__ */ jsxs5(
|
|
@@ -1818,14 +1869,14 @@ function ColorPicker({ label, icon, colors, current, disabled, resetLabel, onPic
|
|
|
1818
1869
|
onMouseDown: (e) => e.preventDefault(),
|
|
1819
1870
|
onClick: toggle,
|
|
1820
1871
|
children: [
|
|
1821
|
-
/* @__PURE__ */
|
|
1822
|
-
/* @__PURE__ */
|
|
1872
|
+
/* @__PURE__ */ jsx8(Icon, { name: icon }),
|
|
1873
|
+
/* @__PURE__ */ jsx8("span", { className: "june-doc__color-bar", style: { background: current ?? "transparent" } })
|
|
1823
1874
|
]
|
|
1824
1875
|
}
|
|
1825
1876
|
),
|
|
1826
1877
|
children: (close) => /* @__PURE__ */ jsxs5("div", { className: "june-doc__swatches-wrap", role: "dialog", "aria-label": label, children: [
|
|
1827
|
-
/* @__PURE__ */
|
|
1828
|
-
/* @__PURE__ */
|
|
1878
|
+
/* @__PURE__ */ jsx8("div", { className: "june-doc__pop-title", children: label }),
|
|
1879
|
+
/* @__PURE__ */ jsx8("div", { className: "june-doc__swatches", children: colors.map((c) => /* @__PURE__ */ jsx8(
|
|
1829
1880
|
"button",
|
|
1830
1881
|
{
|
|
1831
1882
|
type: "button",
|
|
@@ -1843,7 +1894,7 @@ function ColorPicker({ label, icon, colors, current, disabled, resetLabel, onPic
|
|
|
1843
1894
|
c
|
|
1844
1895
|
)) }),
|
|
1845
1896
|
/* @__PURE__ */ jsxs5("div", { className: "june-doc__pop-row", children: [
|
|
1846
|
-
/* @__PURE__ */
|
|
1897
|
+
/* @__PURE__ */ jsx8(
|
|
1847
1898
|
"button",
|
|
1848
1899
|
{
|
|
1849
1900
|
type: "button",
|
|
@@ -1857,8 +1908,8 @@ function ColorPicker({ label, icon, colors, current, disabled, resetLabel, onPic
|
|
|
1857
1908
|
}
|
|
1858
1909
|
),
|
|
1859
1910
|
/* @__PURE__ */ jsxs5("label", { className: "june-doc__custom-color", title: "Custom color", children: [
|
|
1860
|
-
/* @__PURE__ */
|
|
1861
|
-
/* @__PURE__ */
|
|
1911
|
+
/* @__PURE__ */ jsx8("span", { children: "Custom" }),
|
|
1912
|
+
/* @__PURE__ */ jsx8(
|
|
1862
1913
|
"input",
|
|
1863
1914
|
{
|
|
1864
1915
|
type: "color",
|
|
@@ -1890,8 +1941,8 @@ function LinkPanel({
|
|
|
1890
1941
|
close();
|
|
1891
1942
|
};
|
|
1892
1943
|
return /* @__PURE__ */ jsxs5("div", { className: "june-doc__form", role: "dialog", "aria-label": "Edit link", children: [
|
|
1893
|
-
/* @__PURE__ */
|
|
1894
|
-
/* @__PURE__ */
|
|
1944
|
+
/* @__PURE__ */ jsx8("div", { className: "june-doc__pop-title", children: "Link" }),
|
|
1945
|
+
/* @__PURE__ */ jsx8(
|
|
1895
1946
|
"input",
|
|
1896
1947
|
{
|
|
1897
1948
|
"aria-label": "Link address",
|
|
@@ -1909,9 +1960,9 @@ function LinkPanel({
|
|
|
1909
1960
|
}
|
|
1910
1961
|
),
|
|
1911
1962
|
/* @__PURE__ */ jsxs5("div", { className: "june-doc__pop-row june-doc__pop-row--end", children: [
|
|
1912
|
-
isLink ? /* @__PURE__ */
|
|
1913
|
-
/* @__PURE__ */
|
|
1914
|
-
/* @__PURE__ */
|
|
1963
|
+
isLink ? /* @__PURE__ */ jsx8("button", { type: "button", className: "june-doc__btn june-doc__btn--ghost", onClick: remove, children: "Remove" }) : null,
|
|
1964
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "june-doc__btn", onClick: close, children: "Cancel" }),
|
|
1965
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "june-doc__btn june-doc__btn--primary", onClick: apply, children: "Apply" })
|
|
1915
1966
|
] })
|
|
1916
1967
|
] });
|
|
1917
1968
|
}
|
|
@@ -1941,7 +1992,7 @@ function ImagePanel({ editor, close, onNotice }) {
|
|
|
1941
1992
|
reader.readAsDataURL(f);
|
|
1942
1993
|
};
|
|
1943
1994
|
return /* @__PURE__ */ jsxs5("div", { className: "june-doc__form", role: "dialog", "aria-label": "Insert image", children: [
|
|
1944
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ jsx8("div", { className: "june-doc__pop-title", children: "Image" }),
|
|
1945
1996
|
/* @__PURE__ */ jsxs5(
|
|
1946
1997
|
"button",
|
|
1947
1998
|
{
|
|
@@ -1954,12 +2005,12 @@ function ImagePanel({ editor, close, onNotice }) {
|
|
|
1954
2005
|
fromFile(e.dataTransfer.files[0]);
|
|
1955
2006
|
},
|
|
1956
2007
|
children: [
|
|
1957
|
-
/* @__PURE__ */
|
|
1958
|
-
/* @__PURE__ */
|
|
2008
|
+
/* @__PURE__ */ jsx8(Icon, { name: "upload", size: 18 }),
|
|
2009
|
+
/* @__PURE__ */ jsx8("span", { children: "Upload or drop an image" })
|
|
1959
2010
|
]
|
|
1960
2011
|
}
|
|
1961
2012
|
),
|
|
1962
|
-
/* @__PURE__ */
|
|
2013
|
+
/* @__PURE__ */ jsx8(
|
|
1963
2014
|
"input",
|
|
1964
2015
|
{
|
|
1965
2016
|
ref: file,
|
|
@@ -1969,8 +2020,8 @@ function ImagePanel({ editor, close, onNotice }) {
|
|
|
1969
2020
|
onChange: (e) => fromFile(e.target.files?.[0])
|
|
1970
2021
|
}
|
|
1971
2022
|
),
|
|
1972
|
-
/* @__PURE__ */
|
|
1973
|
-
/* @__PURE__ */
|
|
2023
|
+
/* @__PURE__ */ jsx8("div", { className: "june-doc__or", children: "or" }),
|
|
2024
|
+
/* @__PURE__ */ jsx8(
|
|
1974
2025
|
"input",
|
|
1975
2026
|
{
|
|
1976
2027
|
"aria-label": "Image address",
|
|
@@ -1981,7 +2032,7 @@ function ImagePanel({ editor, close, onNotice }) {
|
|
|
1981
2032
|
onKeyDown: (e) => e.key === "Enter" && fromUrl()
|
|
1982
2033
|
}
|
|
1983
2034
|
),
|
|
1984
|
-
/* @__PURE__ */
|
|
2035
|
+
/* @__PURE__ */ jsx8(
|
|
1985
2036
|
"input",
|
|
1986
2037
|
{
|
|
1987
2038
|
"aria-label": "Alternative text",
|
|
@@ -1992,8 +2043,8 @@ function ImagePanel({ editor, close, onNotice }) {
|
|
|
1992
2043
|
}
|
|
1993
2044
|
),
|
|
1994
2045
|
/* @__PURE__ */ jsxs5("div", { className: "june-doc__pop-row june-doc__pop-row--end", children: [
|
|
1995
|
-
/* @__PURE__ */
|
|
1996
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "june-doc__btn", onClick: close, children: "Cancel" }),
|
|
2047
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "june-doc__btn june-doc__btn--primary", disabled: !url.trim(), onClick: fromUrl, children: "Insert" })
|
|
1997
2048
|
] })
|
|
1998
2049
|
] });
|
|
1999
2050
|
}
|
|
@@ -2005,10 +2056,10 @@ function TablePanel({ editor, close }) {
|
|
|
2005
2056
|
"Table ",
|
|
2006
2057
|
hover[0] ? `${hover[0]} \xD7 ${hover[1]}` : ""
|
|
2007
2058
|
] }),
|
|
2008
|
-
/* @__PURE__ */
|
|
2059
|
+
/* @__PURE__ */ jsx8("div", { className: "june-doc__grid", onMouseLeave: () => setHover([0, 0]), children: Array.from({ length: N * N }, (_, i) => {
|
|
2009
2060
|
const r = Math.floor(i / N) + 1;
|
|
2010
2061
|
const c = i % N + 1;
|
|
2011
|
-
return /* @__PURE__ */
|
|
2062
|
+
return /* @__PURE__ */ jsx8(
|
|
2012
2063
|
"button",
|
|
2013
2064
|
{
|
|
2014
2065
|
type: "button",
|
|
@@ -2093,29 +2144,29 @@ function DocumentToolbar(props) {
|
|
|
2093
2144
|
return /* @__PURE__ */ jsxs5("div", { className: "june-doc__ribbon", role: "toolbar", "aria-label": "Document formatting", children: [
|
|
2094
2145
|
/* @__PURE__ */ jsxs5("div", { className: "june-doc__row", children: [
|
|
2095
2146
|
/* @__PURE__ */ jsxs5(Group, { label: "History", children: [
|
|
2096
|
-
/* @__PURE__ */
|
|
2097
|
-
/* @__PURE__ */
|
|
2147
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Undo", icon: "undo", disabled: off || !s?.canUndo, onClick: () => run()?.undo().run() }),
|
|
2148
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Redo", icon: "redo", disabled: off || !s?.canRedo, onClick: () => run()?.redo().run() })
|
|
2098
2149
|
] }),
|
|
2099
2150
|
/* @__PURE__ */ jsxs5(Group, { label: "Format", children: [
|
|
2100
|
-
/* @__PURE__ */
|
|
2101
|
-
/* @__PURE__ */
|
|
2102
|
-
/* @__PURE__ */
|
|
2103
|
-
/* @__PURE__ */
|
|
2104
|
-
/* @__PURE__ */
|
|
2105
|
-
/* @__PURE__ */
|
|
2106
|
-
/* @__PURE__ */
|
|
2151
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Bold", icon: "bold", toggle: true, active: s?.bold, disabled: off, onClick: () => run()?.toggleBold().run() }),
|
|
2152
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Italic", icon: "italic", toggle: true, active: s?.italic, disabled: off, onClick: () => run()?.toggleItalic().run() }),
|
|
2153
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Underline", icon: "underline", toggle: true, active: s?.underline, disabled: off, onClick: () => run()?.toggleUnderline().run() }),
|
|
2154
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Strikethrough", icon: "strike", toggle: true, active: s?.strike, disabled: off, onClick: () => run()?.toggleStrike().run() }),
|
|
2155
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Inline code", icon: "code", toggle: true, active: s?.code, disabled: off, onClick: () => run()?.toggleCode().run() }),
|
|
2156
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Superscript", icon: "superscript", toggle: true, active: s?.sup, disabled: off, onClick: () => run()?.toggleSuperscript().run() }),
|
|
2157
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Subscript", icon: "subscript", toggle: true, active: s?.sub, disabled: off, onClick: () => run()?.toggleSubscript().run() })
|
|
2107
2158
|
] }),
|
|
2108
2159
|
/* @__PURE__ */ jsxs5(Group, { label: "Align", children: [
|
|
2109
|
-
/* @__PURE__ */
|
|
2110
|
-
/* @__PURE__ */
|
|
2111
|
-
/* @__PURE__ */
|
|
2112
|
-
/* @__PURE__ */
|
|
2160
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Align left", icon: "alignLeft", toggle: true, active: s?.left, disabled: off, onClick: () => run()?.setTextAlign("left").run() }),
|
|
2161
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Align center", icon: "alignCenter", toggle: true, active: s?.center, disabled: off, onClick: () => run()?.setTextAlign("center").run() }),
|
|
2162
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Align right", icon: "alignRight", toggle: true, active: s?.right, disabled: off, onClick: () => run()?.setTextAlign("right").run() }),
|
|
2163
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Justify", icon: "alignJustify", toggle: true, active: s?.justify, disabled: off, onClick: () => run()?.setTextAlign("justify").run() })
|
|
2113
2164
|
] }),
|
|
2114
2165
|
/* @__PURE__ */ jsxs5(Group, { label: "Lists", children: [
|
|
2115
|
-
/* @__PURE__ */
|
|
2116
|
-
/* @__PURE__ */
|
|
2117
|
-
/* @__PURE__ */
|
|
2118
|
-
/* @__PURE__ */
|
|
2166
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Bullet list", icon: "list", toggle: true, active: s?.bullet, disabled: off, onClick: () => run()?.toggleBulletList().run() }),
|
|
2167
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Numbered list", icon: "listOrdered", toggle: true, active: s?.ordered, disabled: off, onClick: () => run()?.toggleOrderedList().run() }),
|
|
2168
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Decrease indent", icon: "outdent", disabled: off || !s?.canLift, onClick: () => run()?.liftListItem("listItem").run() }),
|
|
2169
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Increase indent", icon: "indent", disabled: off || !s?.canSink, onClick: () => run()?.sinkListItem("listItem").run() })
|
|
2119
2170
|
] }),
|
|
2120
2171
|
/* @__PURE__ */ jsxs5(
|
|
2121
2172
|
"button",
|
|
@@ -2128,22 +2179,22 @@ function DocumentToolbar(props) {
|
|
|
2128
2179
|
onClick: onToggleExpanded,
|
|
2129
2180
|
children: [
|
|
2130
2181
|
expanded ? "Less" : "More",
|
|
2131
|
-
/* @__PURE__ */
|
|
2182
|
+
/* @__PURE__ */ jsx8(Icon, { name: expanded ? "chevronUp" : "chevronDown", size: 14 })
|
|
2132
2183
|
]
|
|
2133
2184
|
}
|
|
2134
2185
|
)
|
|
2135
2186
|
] }),
|
|
2136
2187
|
expanded ? /* @__PURE__ */ jsxs5("div", { className: "june-doc__row june-doc__row--secondary", children: [
|
|
2137
2188
|
/* @__PURE__ */ jsxs5(Group, { label: "Style", children: [
|
|
2138
|
-
/* @__PURE__ */
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
2141
|
-
/* @__PURE__ */
|
|
2142
|
-
/* @__PURE__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2144
|
-
/* @__PURE__ */
|
|
2189
|
+
/* @__PURE__ */ jsx8(Field, { label: "Style", children: /* @__PURE__ */ jsxs5("select", { className: "june-doc__select", "aria-label": "Text style", disabled: off, value: style, onChange: (e) => setStyle(e.target.value), children: [
|
|
2190
|
+
/* @__PURE__ */ jsx8("option", { value: "p", children: "Paragraph" }),
|
|
2191
|
+
/* @__PURE__ */ jsx8("option", { value: "1", children: "Heading 1" }),
|
|
2192
|
+
/* @__PURE__ */ jsx8("option", { value: "2", children: "Heading 2" }),
|
|
2193
|
+
/* @__PURE__ */ jsx8("option", { value: "3", children: "Heading 3" }),
|
|
2194
|
+
/* @__PURE__ */ jsx8("option", { value: "quote", children: "Quote" }),
|
|
2195
|
+
/* @__PURE__ */ jsx8("option", { value: "code", children: "Code block" })
|
|
2145
2196
|
] }) }),
|
|
2146
|
-
/* @__PURE__ */
|
|
2197
|
+
/* @__PURE__ */ jsx8(Field, { label: "Font", children: /* @__PURE__ */ jsxs5(
|
|
2147
2198
|
"select",
|
|
2148
2199
|
{
|
|
2149
2200
|
className: "june-doc__select june-doc__select--font",
|
|
@@ -2156,12 +2207,12 @@ function DocumentToolbar(props) {
|
|
|
2156
2207
|
else run()?.unsetFontFamily().run();
|
|
2157
2208
|
},
|
|
2158
2209
|
children: [
|
|
2159
|
-
FONT_FAMILIES.map((f) => /* @__PURE__ */
|
|
2160
|
-
!fontKnown && s?.fontFamily ? /* @__PURE__ */
|
|
2210
|
+
FONT_FAMILIES.map((f) => /* @__PURE__ */ jsx8("option", { value: f.value, style: { fontFamily: f.value || void 0 }, children: f.label }, f.label)),
|
|
2211
|
+
!fontKnown && s?.fontFamily ? /* @__PURE__ */ jsx8("option", { value: s.fontFamily, children: s.fontFamily.split(",")[0].replace(/['"]/g, "") }) : null
|
|
2161
2212
|
]
|
|
2162
2213
|
}
|
|
2163
2214
|
) }),
|
|
2164
|
-
/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ jsx8(Field, { label: "Size", children: /* @__PURE__ */ jsxs5(
|
|
2165
2216
|
"select",
|
|
2166
2217
|
{
|
|
2167
2218
|
className: "june-doc__select june-doc__select--size",
|
|
@@ -2174,21 +2225,21 @@ function DocumentToolbar(props) {
|
|
|
2174
2225
|
else run()?.unsetFontSize().run();
|
|
2175
2226
|
},
|
|
2176
2227
|
children: [
|
|
2177
|
-
/* @__PURE__ */
|
|
2178
|
-
sizes.map((n) => /* @__PURE__ */
|
|
2228
|
+
/* @__PURE__ */ jsx8("option", { value: "", children: "Auto" }),
|
|
2229
|
+
sizes.map((n) => /* @__PURE__ */ jsx8("option", { value: String(n), children: n }, n))
|
|
2179
2230
|
]
|
|
2180
2231
|
}
|
|
2181
2232
|
) })
|
|
2182
2233
|
] }),
|
|
2183
|
-
/* @__PURE__ */
|
|
2234
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Show formatting marks", icon: "pilcrow", toggle: true, active: showMarks, onClick: onToggleMarks, text: true, className: "june-doc__btn--marks", children: /* @__PURE__ */ jsx8("span", { children: "Paragraph" }) }),
|
|
2184
2235
|
/* @__PURE__ */ jsxs5(Group, { label: "Document", children: [
|
|
2185
|
-
/* @__PURE__ */
|
|
2186
|
-
/* @__PURE__ */
|
|
2187
|
-
/* @__PURE__ */
|
|
2188
|
-
/* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Insert page break", icon: "pageBreak", disabled: off, onClick: () => run()?.setPageBreak().run() }),
|
|
2237
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Insert divider", icon: "divider", disabled: off, onClick: () => run()?.setHorizontalRule().run() }),
|
|
2238
|
+
/* @__PURE__ */ jsx8(Btn, { label: layout === "page" ? "Switch to full-width layout" : "Switch to page layout", icon: "layout", toggle: true, active: layout === "fluid", onClick: onToggleLayout }),
|
|
2239
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Find and replace", icon: "search", toggle: true, active: findOpen, onClick: onToggleFind })
|
|
2189
2240
|
] }),
|
|
2190
2241
|
/* @__PURE__ */ jsxs5(Group, { label: "Color", children: [
|
|
2191
|
-
/* @__PURE__ */
|
|
2242
|
+
/* @__PURE__ */ jsx8(
|
|
2192
2243
|
ColorPicker,
|
|
2193
2244
|
{
|
|
2194
2245
|
label: "Text color",
|
|
@@ -2201,7 +2252,7 @@ function DocumentToolbar(props) {
|
|
|
2201
2252
|
onReset: () => run()?.unsetColor().run()
|
|
2202
2253
|
}
|
|
2203
2254
|
),
|
|
2204
|
-
/* @__PURE__ */
|
|
2255
|
+
/* @__PURE__ */ jsx8(
|
|
2205
2256
|
ColorPicker,
|
|
2206
2257
|
{
|
|
2207
2258
|
label: "Highlight",
|
|
@@ -2216,33 +2267,33 @@ function DocumentToolbar(props) {
|
|
|
2216
2267
|
)
|
|
2217
2268
|
] }),
|
|
2218
2269
|
/* @__PURE__ */ jsxs5(Group, { label: "Insert", children: [
|
|
2219
|
-
editor ? /* @__PURE__ */
|
|
2270
|
+
editor ? /* @__PURE__ */ jsx8(
|
|
2220
2271
|
Dropdown,
|
|
2221
2272
|
{
|
|
2222
|
-
trigger: ({ open, toggle }) => /* @__PURE__ */
|
|
2223
|
-
children: (close) => /* @__PURE__ */
|
|
2273
|
+
trigger: ({ open, toggle }) => /* @__PURE__ */ jsx8(Btn, { label: "Link", icon: "link", toggle: true, active: s?.link || open, disabled: off, onClick: toggle }),
|
|
2274
|
+
children: (close) => /* @__PURE__ */ jsx8(LinkPanel, { editor, href: s?.linkHref ?? "", isLink: !!s?.link, close })
|
|
2224
2275
|
}
|
|
2225
2276
|
) : null,
|
|
2226
|
-
editor ? /* @__PURE__ */
|
|
2227
|
-
editor ? /* @__PURE__ */
|
|
2277
|
+
editor ? /* @__PURE__ */ jsx8(Dropdown, { trigger: ({ open, toggle }) => /* @__PURE__ */ jsx8(Btn, { label: "Insert image", icon: "image", active: open, disabled: off, onClick: toggle }), children: (close) => /* @__PURE__ */ jsx8(ImagePanel, { editor, close, onNotice }) }) : null,
|
|
2278
|
+
editor ? /* @__PURE__ */ jsx8(Dropdown, { trigger: ({ open, toggle }) => /* @__PURE__ */ jsx8(Btn, { label: "Insert table", icon: "table", active: open, disabled: off, onClick: toggle }), children: (close) => /* @__PURE__ */ jsx8(TablePanel, { editor, close }) }) : null
|
|
2228
2279
|
] }),
|
|
2229
|
-
/* @__PURE__ */
|
|
2280
|
+
/* @__PURE__ */ jsx8(Group, { label: "Actions", children: /* @__PURE__ */ jsx8(Btn, { label: "Clear formatting", icon: "eraser", disabled: off, onClick: () => run()?.unsetAllMarks().clearNodes().run() }) })
|
|
2230
2281
|
] }) : null,
|
|
2231
|
-
s?.inTable ? /* @__PURE__ */
|
|
2232
|
-
/* @__PURE__ */
|
|
2233
|
-
/* @__PURE__ */
|
|
2234
|
-
/* @__PURE__ */
|
|
2235
|
-
/* @__PURE__ */
|
|
2236
|
-
/* @__PURE__ */
|
|
2237
|
-
/* @__PURE__ */
|
|
2238
|
-
/* @__PURE__ */
|
|
2239
|
-
/* @__PURE__ */
|
|
2282
|
+
s?.inTable ? /* @__PURE__ */ jsx8("div", { className: "june-doc__row june-doc__row--context", children: /* @__PURE__ */ jsxs5(Group, { label: "Table", children: [
|
|
2283
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Add row below", disabled: off, onClick: () => run()?.addRowAfter().run(), children: "+ Row" }),
|
|
2284
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Add column right", disabled: off, onClick: () => run()?.addColumnAfter().run(), children: "+ Column" }),
|
|
2285
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Delete row", disabled: off, onClick: () => run()?.deleteRow().run(), children: "\u2212 Row" }),
|
|
2286
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Delete column", disabled: off, onClick: () => run()?.deleteColumn().run(), children: "\u2212 Column" }),
|
|
2287
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Merge cells", disabled: off || !s?.canMerge, onClick: () => run()?.mergeCells().run(), children: "Merge" }),
|
|
2288
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Split cell", disabled: off || !s?.canSplit, onClick: () => run()?.splitCell().run(), children: "Split" }),
|
|
2289
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Toggle header row", disabled: off, onClick: () => run()?.toggleHeaderRow().run(), children: "Header row" }),
|
|
2290
|
+
/* @__PURE__ */ jsx8(Btn, { label: "Delete table", disabled: off, onClick: () => run()?.deleteTable().run(), className: "june-doc__btn--danger", children: "Delete table" })
|
|
2240
2291
|
] }) }) : null
|
|
2241
2292
|
] });
|
|
2242
2293
|
}
|
|
2243
2294
|
|
|
2244
2295
|
// src/components/document-editor/document-bubble.tsx
|
|
2245
|
-
import { jsx as
|
|
2296
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2246
2297
|
function DocumentBubbleMenu({ editor }) {
|
|
2247
2298
|
const s = useEditorState2({
|
|
2248
2299
|
editor,
|
|
@@ -2271,13 +2322,13 @@ function DocumentBubbleMenu({ editor }) {
|
|
|
2271
2322
|
return state.doc.textBetween(state.selection.from, state.selection.to).trim().length > 0;
|
|
2272
2323
|
},
|
|
2273
2324
|
children: [
|
|
2274
|
-
/* @__PURE__ */
|
|
2275
|
-
/* @__PURE__ */
|
|
2276
|
-
/* @__PURE__ */
|
|
2277
|
-
/* @__PURE__ */
|
|
2278
|
-
/* @__PURE__ */
|
|
2279
|
-
/* @__PURE__ */
|
|
2280
|
-
/* @__PURE__ */
|
|
2325
|
+
/* @__PURE__ */ jsx9(Btn, { label: "Bold", icon: "bold", toggle: true, active: s.bold, onClick: () => run().toggleBold().run() }),
|
|
2326
|
+
/* @__PURE__ */ jsx9(Btn, { label: "Italic", icon: "italic", toggle: true, active: s.italic, onClick: () => run().toggleItalic().run() }),
|
|
2327
|
+
/* @__PURE__ */ jsx9(Btn, { label: "Underline", icon: "underline", toggle: true, active: s.underline, onClick: () => run().toggleUnderline().run() }),
|
|
2328
|
+
/* @__PURE__ */ jsx9(Btn, { label: "Strikethrough", icon: "strike", toggle: true, active: s.strike, onClick: () => run().toggleStrike().run() }),
|
|
2329
|
+
/* @__PURE__ */ jsx9("span", { className: "june-doc__bubble-sep", "aria-hidden": "true" }),
|
|
2330
|
+
/* @__PURE__ */ jsx9(Dropdown, { trigger: ({ open, toggle }) => /* @__PURE__ */ jsx9(Btn, { label: "Link", icon: "link", toggle: true, active: s.link || open, onClick: toggle }), children: (close) => /* @__PURE__ */ jsx9(LinkPanel, { editor, href: s.linkHref, isLink: s.link, close }) }),
|
|
2331
|
+
/* @__PURE__ */ jsx9(
|
|
2281
2332
|
ColorPicker,
|
|
2282
2333
|
{
|
|
2283
2334
|
label: "Text color",
|
|
@@ -2289,7 +2340,7 @@ function DocumentBubbleMenu({ editor }) {
|
|
|
2289
2340
|
onReset: () => run().unsetColor().run()
|
|
2290
2341
|
}
|
|
2291
2342
|
),
|
|
2292
|
-
/* @__PURE__ */
|
|
2343
|
+
/* @__PURE__ */ jsx9(
|
|
2293
2344
|
ColorPicker,
|
|
2294
2345
|
{
|
|
2295
2346
|
label: "Highlight",
|
|
@@ -2301,8 +2352,8 @@ function DocumentBubbleMenu({ editor }) {
|
|
|
2301
2352
|
onReset: () => run().unsetHighlight().run()
|
|
2302
2353
|
}
|
|
2303
2354
|
),
|
|
2304
|
-
/* @__PURE__ */
|
|
2305
|
-
/* @__PURE__ */
|
|
2355
|
+
/* @__PURE__ */ jsx9("span", { className: "june-doc__bubble-sep", "aria-hidden": "true" }),
|
|
2356
|
+
/* @__PURE__ */ jsx9(Btn, { label: "Clear formatting", icon: "eraser", onClick: () => run().unsetAllMarks().run() })
|
|
2306
2357
|
]
|
|
2307
2358
|
}
|
|
2308
2359
|
);
|
|
@@ -2311,7 +2362,7 @@ function DocumentBubbleMenu({ editor }) {
|
|
|
2311
2362
|
// src/components/document-editor/document-content.tsx
|
|
2312
2363
|
import { EditorContent } from "@tiptap/react";
|
|
2313
2364
|
import { useEffect as useEffect4, useLayoutEffect, useRef as useRef5, useState as useState4 } from "react";
|
|
2314
|
-
import { jsx as
|
|
2365
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2315
2366
|
var PAGE_WIDTH = 794;
|
|
2316
2367
|
var PAGE_HEIGHT = 1123;
|
|
2317
2368
|
var PAGE_GAP = 28;
|
|
@@ -2406,20 +2457,20 @@ function DocumentContent({ editor, layout = "page", zoom = 1, showMarks = false,
|
|
|
2406
2457
|
width: width * zoom,
|
|
2407
2458
|
height: zoom === 1 ? void 0 : Math.max(sheetH, minHeight ?? 0) * zoom
|
|
2408
2459
|
};
|
|
2409
|
-
return /* @__PURE__ */
|
|
2410
|
-
paged ? /* @__PURE__ */
|
|
2460
|
+
return /* @__PURE__ */ jsx10("div", { ref: canvas, className: "june-doc__content june-doc__canvas", "data-layout": layout, "data-marks": showMarks || void 0, children: /* @__PURE__ */ jsx10("div", { className: "june-doc__zoomer", style: zoomerStyle, children: /* @__PURE__ */ jsxs7("div", { ref: sheet, className: "june-doc__sheet", style: sheetStyle, children: [
|
|
2461
|
+
paged ? /* @__PURE__ */ jsx10("div", { className: "june-doc__pages", "aria-hidden": "true", children: Array.from({ length: pages }, (_, i) => /* @__PURE__ */ jsx10("div", { className: "june-doc__page", style: { top: i * stride, height: g.height }, children: /* @__PURE__ */ jsxs7("span", { className: "june-doc__page-num", children: [
|
|
2411
2462
|
i + 1,
|
|
2412
2463
|
" / ",
|
|
2413
2464
|
pages
|
|
2414
2465
|
] }) }, i)) }) : null,
|
|
2415
|
-
/* @__PURE__ */
|
|
2466
|
+
/* @__PURE__ */ jsx10(EditorContent, { editor })
|
|
2416
2467
|
] }) }) });
|
|
2417
2468
|
}
|
|
2418
2469
|
|
|
2419
2470
|
// src/components/document-editor/document-findbar.tsx
|
|
2420
2471
|
import { useEditorState as useEditorState3 } from "@tiptap/react";
|
|
2421
2472
|
import { useEffect as useEffect5, useRef as useRef6, useState as useState5 } from "react";
|
|
2422
|
-
import { Fragment as Fragment3, jsx as
|
|
2473
|
+
import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2423
2474
|
function DocumentFindBar({ editor, editable, onClose, onNotice }) {
|
|
2424
2475
|
const [term, setTerm] = useState5(() => {
|
|
2425
2476
|
const { from, to, empty } = editor.state.selection;
|
|
@@ -2461,8 +2512,8 @@ function DocumentFindBar({ editor, editable, onClose, onNotice }) {
|
|
|
2461
2512
|
},
|
|
2462
2513
|
children: [
|
|
2463
2514
|
/* @__PURE__ */ jsxs8("div", { className: "june-doc__find-field", children: [
|
|
2464
|
-
/* @__PURE__ */
|
|
2465
|
-
/* @__PURE__ */
|
|
2515
|
+
/* @__PURE__ */ jsx11(Icon, { name: "search", size: 14 }),
|
|
2516
|
+
/* @__PURE__ */ jsx11(
|
|
2466
2517
|
"input",
|
|
2467
2518
|
{
|
|
2468
2519
|
ref: input,
|
|
@@ -2479,11 +2530,11 @@ function DocumentFindBar({ editor, editable, onClose, onNotice }) {
|
|
|
2479
2530
|
}
|
|
2480
2531
|
}
|
|
2481
2532
|
),
|
|
2482
|
-
/* @__PURE__ */
|
|
2533
|
+
/* @__PURE__ */ jsx11("span", { className: "june-doc__find-count", "aria-live": "polite", children: term ? count ? `${current + 1} of ${count}` : "No results" : "" })
|
|
2483
2534
|
] }),
|
|
2484
|
-
/* @__PURE__ */
|
|
2485
|
-
/* @__PURE__ */
|
|
2486
|
-
/* @__PURE__ */
|
|
2535
|
+
/* @__PURE__ */ jsx11("button", { type: "button", className: "june-doc__btn june-doc__btn--icon", "aria-label": "Previous match", title: "Previous (Shift+Enter)", disabled: !count, onClick: () => gotoMatch(editor, -1), children: /* @__PURE__ */ jsx11(Icon, { name: "chevronUp" }) }),
|
|
2536
|
+
/* @__PURE__ */ jsx11("button", { type: "button", className: "june-doc__btn june-doc__btn--icon", "aria-label": "Next match", title: "Next (Enter)", disabled: !count, onClick: () => gotoMatch(editor, 1), children: /* @__PURE__ */ jsx11(Icon, { name: "chevronDown" }) }),
|
|
2537
|
+
/* @__PURE__ */ jsx11(
|
|
2487
2538
|
"button",
|
|
2488
2539
|
{
|
|
2489
2540
|
type: "button",
|
|
@@ -2497,8 +2548,8 @@ function DocumentFindBar({ editor, editable, onClose, onNotice }) {
|
|
|
2497
2548
|
}
|
|
2498
2549
|
),
|
|
2499
2550
|
editable ? /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
2500
|
-
/* @__PURE__ */
|
|
2501
|
-
/* @__PURE__ */
|
|
2551
|
+
/* @__PURE__ */ jsx11("span", { className: "june-doc__find-sep", "aria-hidden": "true" }),
|
|
2552
|
+
/* @__PURE__ */ jsx11(
|
|
2502
2553
|
"input",
|
|
2503
2554
|
{
|
|
2504
2555
|
className: "june-doc__input june-doc__replace-input",
|
|
@@ -2514,8 +2565,8 @@ function DocumentFindBar({ editor, editable, onClose, onNotice }) {
|
|
|
2514
2565
|
}
|
|
2515
2566
|
}
|
|
2516
2567
|
),
|
|
2517
|
-
/* @__PURE__ */
|
|
2518
|
-
/* @__PURE__ */
|
|
2568
|
+
/* @__PURE__ */ jsx11("button", { type: "button", className: "june-doc__btn", disabled: !count, onClick: () => replaceCurrent(editor, replacement), children: "Replace" }),
|
|
2569
|
+
/* @__PURE__ */ jsx11(
|
|
2519
2570
|
"button",
|
|
2520
2571
|
{
|
|
2521
2572
|
type: "button",
|
|
@@ -2529,16 +2580,16 @@ function DocumentFindBar({ editor, editable, onClose, onNotice }) {
|
|
|
2529
2580
|
}
|
|
2530
2581
|
)
|
|
2531
2582
|
] }) : null,
|
|
2532
|
-
/* @__PURE__ */
|
|
2583
|
+
/* @__PURE__ */ jsx11("button", { type: "button", className: "june-doc__btn june-doc__btn--icon june-doc__btn--ghost june-doc__find-close", "aria-label": "Close find", onClick: onClose, children: /* @__PURE__ */ jsx11(Icon, { name: "close" }) })
|
|
2533
2584
|
]
|
|
2534
2585
|
}
|
|
2535
2586
|
);
|
|
2536
2587
|
}
|
|
2537
2588
|
|
|
2538
2589
|
// src/components/document-editor/document-title.tsx
|
|
2539
|
-
import { jsx as
|
|
2590
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2540
2591
|
function DocumentTitle({ value, disabled, onChange }) {
|
|
2541
|
-
return /* @__PURE__ */
|
|
2592
|
+
return /* @__PURE__ */ jsx12(
|
|
2542
2593
|
"input",
|
|
2543
2594
|
{
|
|
2544
2595
|
className: "june-doc__title",
|
|
@@ -2552,7 +2603,7 @@ function DocumentTitle({ value, disabled, onChange }) {
|
|
|
2552
2603
|
}
|
|
2553
2604
|
|
|
2554
2605
|
// src/components/document-editor/document-header.tsx
|
|
2555
|
-
import { jsx as
|
|
2606
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2556
2607
|
var FORMATS = {
|
|
2557
2608
|
docx: { label: "Word document", hint: ".docx", icon: "file" },
|
|
2558
2609
|
pdf: { label: "PDF", hint: "Print / Save as PDF", icon: "file" },
|
|
@@ -2563,10 +2614,10 @@ var FORMATS = {
|
|
|
2563
2614
|
function DocumentHeader(props) {
|
|
2564
2615
|
const { title, editable, isDraft, fullscreen, onToggleFullscreen, onTitle, exportFormats, canSave, showSave = canSave, saveState, onExport, onCopy, onSave } = props;
|
|
2565
2616
|
return /* @__PURE__ */ jsxs9("div", { className: "june-doc__header", children: [
|
|
2566
|
-
fullscreen ? /* @__PURE__ */
|
|
2567
|
-
/* @__PURE__ */
|
|
2617
|
+
fullscreen ? /* @__PURE__ */ jsx13("button", { type: "button", className: "june-doc__btn june-doc__btn--icon june-doc__btn--ghost", "aria-label": "Close full screen", title: "Close (Esc)", onClick: onToggleFullscreen, children: /* @__PURE__ */ jsx13(Icon, { name: "close", size: 18 }) }) : /* @__PURE__ */ jsx13("span", { className: "june-doc__doc-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx13(Icon, { name: "file", size: 16 }) }),
|
|
2618
|
+
/* @__PURE__ */ jsx13(DocumentTitle, { value: title, disabled: !editable, onChange: onTitle }),
|
|
2568
2619
|
isDraft ? /* @__PURE__ */ jsxs9("span", { className: "june-doc__badge", children: [
|
|
2569
|
-
/* @__PURE__ */
|
|
2620
|
+
/* @__PURE__ */ jsx13(Icon, { name: "sparkles", size: 12 }),
|
|
2570
2621
|
"AI draft"
|
|
2571
2622
|
] }) : null,
|
|
2572
2623
|
/* @__PURE__ */ jsxs9("div", { className: "june-doc__header-actions", children: [
|
|
@@ -2581,12 +2632,12 @@ function DocumentHeader(props) {
|
|
|
2581
2632
|
disabled: saveState === "saving" || saveState === "saved" || saveState === "idle",
|
|
2582
2633
|
onClick: onSave,
|
|
2583
2634
|
children: [
|
|
2584
|
-
/* @__PURE__ */
|
|
2585
|
-
/* @__PURE__ */
|
|
2635
|
+
/* @__PURE__ */ jsx13(Icon, { name: saveState === "saved" ? "check" : "save" }),
|
|
2636
|
+
/* @__PURE__ */ jsx13("span", { children: saveState === "saving" ? "Saving\u2026" : saveState === "saved" ? "Saved" : "Save" })
|
|
2586
2637
|
]
|
|
2587
2638
|
}
|
|
2588
2639
|
) : null,
|
|
2589
|
-
/* @__PURE__ */
|
|
2640
|
+
/* @__PURE__ */ jsx13(
|
|
2590
2641
|
Dropdown,
|
|
2591
2642
|
{
|
|
2592
2643
|
align: "end",
|
|
@@ -2601,8 +2652,8 @@ function DocumentHeader(props) {
|
|
|
2601
2652
|
"aria-expanded": open,
|
|
2602
2653
|
onClick: toggle,
|
|
2603
2654
|
children: [
|
|
2604
|
-
/* @__PURE__ */
|
|
2605
|
-
/* @__PURE__ */
|
|
2655
|
+
/* @__PURE__ */ jsx13("span", { children: "Download" }),
|
|
2656
|
+
/* @__PURE__ */ jsx13(Icon, { name: "chevronDown", size: 14 })
|
|
2606
2657
|
]
|
|
2607
2658
|
}
|
|
2608
2659
|
),
|
|
@@ -2620,15 +2671,15 @@ function DocumentHeader(props) {
|
|
|
2620
2671
|
onExport(f);
|
|
2621
2672
|
},
|
|
2622
2673
|
children: [
|
|
2623
|
-
/* @__PURE__ */
|
|
2624
|
-
/* @__PURE__ */
|
|
2625
|
-
/* @__PURE__ */
|
|
2674
|
+
/* @__PURE__ */ jsx13(Icon, { name: meta.icon }),
|
|
2675
|
+
/* @__PURE__ */ jsx13("span", { className: "june-doc__menu-label", children: meta.label }),
|
|
2676
|
+
/* @__PURE__ */ jsx13("span", { className: "june-doc__menu-hint", children: meta.hint })
|
|
2626
2677
|
]
|
|
2627
2678
|
},
|
|
2628
2679
|
f
|
|
2629
2680
|
);
|
|
2630
2681
|
}),
|
|
2631
|
-
exportFormats.length ? /* @__PURE__ */
|
|
2682
|
+
exportFormats.length ? /* @__PURE__ */ jsx13("div", { className: "june-doc__menu-sep", role: "separator" }) : null,
|
|
2632
2683
|
/* @__PURE__ */ jsxs9(
|
|
2633
2684
|
"button",
|
|
2634
2685
|
{
|
|
@@ -2641,15 +2692,15 @@ function DocumentHeader(props) {
|
|
|
2641
2692
|
onCopy();
|
|
2642
2693
|
},
|
|
2643
2694
|
children: [
|
|
2644
|
-
/* @__PURE__ */
|
|
2645
|
-
/* @__PURE__ */
|
|
2695
|
+
/* @__PURE__ */ jsx13(Icon, { name: "copy" }),
|
|
2696
|
+
/* @__PURE__ */ jsx13("span", { className: "june-doc__menu-label", children: "Copy to clipboard" })
|
|
2646
2697
|
]
|
|
2647
2698
|
}
|
|
2648
2699
|
)
|
|
2649
2700
|
] })
|
|
2650
2701
|
}
|
|
2651
2702
|
),
|
|
2652
|
-
/* @__PURE__ */
|
|
2703
|
+
/* @__PURE__ */ jsx13(
|
|
2653
2704
|
"button",
|
|
2654
2705
|
{
|
|
2655
2706
|
type: "button",
|
|
@@ -2658,7 +2709,7 @@ function DocumentHeader(props) {
|
|
|
2658
2709
|
title: fullscreen ? "Exit full screen" : "Open full screen",
|
|
2659
2710
|
"aria-pressed": fullscreen,
|
|
2660
2711
|
onClick: onToggleFullscreen,
|
|
2661
|
-
children: /* @__PURE__ */
|
|
2712
|
+
children: /* @__PURE__ */ jsx13(Icon, { name: "maximize" })
|
|
2662
2713
|
}
|
|
2663
2714
|
)
|
|
2664
2715
|
] })
|
|
@@ -3091,7 +3142,7 @@ var ALL_EXPORT_FORMATS = [
|
|
|
3091
3142
|
];
|
|
3092
3143
|
|
|
3093
3144
|
// src/components/document-editor/document-editor.tsx
|
|
3094
|
-
import { Fragment as Fragment4, jsx as
|
|
3145
|
+
import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3095
3146
|
var snapshotOf = (r) => ({
|
|
3096
3147
|
documentId: r.id,
|
|
3097
3148
|
title: r.title,
|
|
@@ -3344,14 +3395,14 @@ function DocumentEditorImpl(props) {
|
|
|
3344
3395
|
const formats = (exportFormats ?? [...ALL_EXPORT_FORMATS]).filter((f) => listDocumentExporters().includes(f));
|
|
3345
3396
|
if (parsed.error && !store.get(documentId)) {
|
|
3346
3397
|
return /* @__PURE__ */ jsxs10("div", { className: "june-doc june-doc--error", "data-theme": resolvedTheme, role: "alert", children: [
|
|
3347
|
-
/* @__PURE__ */
|
|
3398
|
+
/* @__PURE__ */ jsx14("p", { className: "june-doc__draft-text", children: "This document could not be displayed." }),
|
|
3348
3399
|
/* @__PURE__ */ jsxs10("details", { children: [
|
|
3349
|
-
/* @__PURE__ */
|
|
3350
|
-
/* @__PURE__ */
|
|
3400
|
+
/* @__PURE__ */ jsx14("summary", { children: "Show raw content" }),
|
|
3401
|
+
/* @__PURE__ */ jsx14("pre", { className: "june-doc__raw", children: contentKey })
|
|
3351
3402
|
] })
|
|
3352
3403
|
] });
|
|
3353
3404
|
}
|
|
3354
|
-
if (!editor) return /* @__PURE__ */
|
|
3405
|
+
if (!editor) return /* @__PURE__ */ jsx14(DocumentDraft, { title, state: "loading" });
|
|
3355
3406
|
const isDraft = recordStatus === "draft";
|
|
3356
3407
|
const classes = ["june-doc", fullscreen ? "june-doc--fullscreen" : "", className ?? ""].filter(Boolean).join(" ");
|
|
3357
3408
|
return /* @__PURE__ */ jsxs10(
|
|
@@ -3376,7 +3427,7 @@ function DocumentEditorImpl(props) {
|
|
|
3376
3427
|
}
|
|
3377
3428
|
},
|
|
3378
3429
|
children: [
|
|
3379
|
-
/* @__PURE__ */
|
|
3430
|
+
/* @__PURE__ */ jsx14(
|
|
3380
3431
|
DocumentHeader,
|
|
3381
3432
|
{
|
|
3382
3433
|
title,
|
|
@@ -3403,12 +3454,12 @@ function DocumentEditorImpl(props) {
|
|
|
3403
3454
|
")."
|
|
3404
3455
|
] }),
|
|
3405
3456
|
/* @__PURE__ */ jsxs10("span", { className: "june-doc__banner-actions", children: [
|
|
3406
|
-
/* @__PURE__ */
|
|
3407
|
-
/* @__PURE__ */
|
|
3408
|
-
/* @__PURE__ */
|
|
3457
|
+
/* @__PURE__ */ jsx14("button", { type: "button", className: "june-doc__btn", onClick: () => resolve("merge"), children: "Merge, keep my edits" }),
|
|
3458
|
+
/* @__PURE__ */ jsx14("button", { type: "button", className: "june-doc__btn", onClick: () => resolve("replace"), children: "Use AI version" }),
|
|
3459
|
+
/* @__PURE__ */ jsx14("button", { type: "button", className: "june-doc__btn", onClick: () => resolve("keep"), children: "Keep mine" })
|
|
3409
3460
|
] })
|
|
3410
3461
|
] }) : null,
|
|
3411
|
-
/* @__PURE__ */
|
|
3462
|
+
/* @__PURE__ */ jsx14(
|
|
3412
3463
|
DocumentToolbar,
|
|
3413
3464
|
{
|
|
3414
3465
|
editor,
|
|
@@ -3424,9 +3475,9 @@ function DocumentEditorImpl(props) {
|
|
|
3424
3475
|
onNotice: flash
|
|
3425
3476
|
}
|
|
3426
3477
|
),
|
|
3427
|
-
findOpen ? /* @__PURE__ */
|
|
3428
|
-
editable ? /* @__PURE__ */
|
|
3429
|
-
/* @__PURE__ */
|
|
3478
|
+
findOpen ? /* @__PURE__ */ jsx14(DocumentFindBar, { editor, editable, onClose: () => setFindOpen(false), onNotice: flash }) : null,
|
|
3479
|
+
editable ? /* @__PURE__ */ jsx14(DocumentBubbleMenu, { editor }) : null,
|
|
3480
|
+
/* @__PURE__ */ jsx14(DocumentContent, { editor, layout, zoom, showMarks, onMetrics: setMetrics }),
|
|
3430
3481
|
/* @__PURE__ */ jsxs10("div", { className: "june-doc__footer", children: [
|
|
3431
3482
|
/* @__PURE__ */ jsxs10("div", { className: "june-doc__stats", children: [
|
|
3432
3483
|
layout === "page" ? /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
@@ -3436,21 +3487,21 @@ function DocumentEditorImpl(props) {
|
|
|
3436
3487
|
" of ",
|
|
3437
3488
|
metrics.pages
|
|
3438
3489
|
] }),
|
|
3439
|
-
/* @__PURE__ */
|
|
3490
|
+
/* @__PURE__ */ jsx14("span", { className: "june-doc__stats-sep", "aria-hidden": "true" })
|
|
3440
3491
|
] }) : null,
|
|
3441
3492
|
/* @__PURE__ */ jsxs10("span", { children: [
|
|
3442
3493
|
words,
|
|
3443
3494
|
" words"
|
|
3444
3495
|
] })
|
|
3445
3496
|
] }),
|
|
3446
|
-
/* @__PURE__ */
|
|
3497
|
+
/* @__PURE__ */ jsx14("span", { className: "june-doc__status", "aria-live": "polite", "data-state": notice ? "notice" : saveState, children: notice ?? SAVE_LABEL[saveState] }),
|
|
3447
3498
|
/* @__PURE__ */ jsxs10("div", { className: "june-doc__zoom", role: "group", "aria-label": "Zoom", children: [
|
|
3448
|
-
/* @__PURE__ */
|
|
3499
|
+
/* @__PURE__ */ jsx14("button", { type: "button", className: "june-doc__btn june-doc__btn--icon june-doc__btn--ghost", "aria-label": "Zoom out", disabled: zoom <= ZOOM_STEPS[0], onClick: () => setZoom(stepZoom(zoom, -1)), children: /* @__PURE__ */ jsx14(Icon, { name: "minus", size: 14 }) }),
|
|
3449
3500
|
/* @__PURE__ */ jsxs10("button", { type: "button", className: "june-doc__zoom-value", "aria-label": "Reset zoom", title: "Reset zoom", onClick: () => setZoom(1), children: [
|
|
3450
3501
|
Math.round(zoom * 100),
|
|
3451
3502
|
"%"
|
|
3452
3503
|
] }),
|
|
3453
|
-
/* @__PURE__ */
|
|
3504
|
+
/* @__PURE__ */ jsx14("button", { type: "button", className: "june-doc__btn june-doc__btn--icon june-doc__btn--ghost", "aria-label": "Zoom in", disabled: zoom >= ZOOM_STEPS[ZOOM_STEPS.length - 1], onClick: () => setZoom(stepZoom(zoom, 1)), children: /* @__PURE__ */ jsx14(Icon, { name: "plus", size: 14 }) })
|
|
3454
3505
|
] })
|
|
3455
3506
|
] })
|
|
3456
3507
|
]
|
|
@@ -3459,7 +3510,7 @@ function DocumentEditorImpl(props) {
|
|
|
3459
3510
|
}
|
|
3460
3511
|
|
|
3461
3512
|
// src/components/document-editor/document-component.tsx
|
|
3462
|
-
import { jsx as
|
|
3513
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
3463
3514
|
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.';
|
|
3464
3515
|
var documentProps = z.object({
|
|
3465
3516
|
documentId: z.string().describe("Stable id. Reuse it when revising the same document."),
|
|
@@ -3473,12 +3524,12 @@ var documentProps = z.object({
|
|
|
3473
3524
|
function DocumentEditor(props) {
|
|
3474
3525
|
const { isStreaming } = useJuneRuntime();
|
|
3475
3526
|
if (props.generating || isStreaming) {
|
|
3476
|
-
return /* @__PURE__ */
|
|
3527
|
+
return /* @__PURE__ */ jsx15(DocumentDraft, { title: props.title, state: "drafting" });
|
|
3477
3528
|
}
|
|
3478
|
-
return /* @__PURE__ */
|
|
3529
|
+
return /* @__PURE__ */ jsx15(DocumentEditorImpl, { ...props });
|
|
3479
3530
|
}
|
|
3480
3531
|
function OpenUIDocument({ props }) {
|
|
3481
|
-
return /* @__PURE__ */
|
|
3532
|
+
return /* @__PURE__ */ jsx15(
|
|
3482
3533
|
DocumentEditor,
|
|
3483
3534
|
{
|
|
3484
3535
|
documentId: props.documentId,
|
|
@@ -3566,9 +3617,9 @@ import { openuiLibrary } from "@openuidev/react-ui";
|
|
|
3566
3617
|
var juneLibrary = withDocumentEditor(openuiLibrary);
|
|
3567
3618
|
|
|
3568
3619
|
// src/core/JuneUI.tsx
|
|
3569
|
-
import { jsx as
|
|
3620
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
3570
3621
|
function JuneUI({ library = juneLibrary, ...props }) {
|
|
3571
|
-
return /* @__PURE__ */
|
|
3622
|
+
return /* @__PURE__ */ jsx16(JuneRenderer, { library, ...props });
|
|
3572
3623
|
}
|
|
3573
3624
|
export {
|
|
3574
3625
|
ALL_EXPORT_FORMATS,
|