2 files changed,
+41,
-0
+3,
-0
1@@ -69,6 +69,8 @@ let WifiSync = {};
2
3 let CircleUser = {};
4
5+let Split = {};
6+
7 export {
8 ChevronDown,
9 MapPinned,
10@@ -104,5 +106,6 @@ export {
11 Check,
12 WifiSync,
13 CircleUser,
14+ Split,
15 }
16 /* No side effect */
+38,
-0
1@@ -10,6 +10,7 @@ import * as Core__Option from "@rescript/core/lib/es6/src/Core__Option.res.mjs";
2 import * as LucidePreact from "lucide-preact";
3 import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
4 import * as JsxRuntime from "preact/jsx-runtime";
5+import * as Menu from "@base-ui/react/menu";
6
7 function getLongestDistance(wp) {
8 let d = wp.from;
9@@ -175,6 +176,43 @@ function Summary(props) {
10 ],
11 className: "flex flex-row gap-4 md:gap-8 text-xs items-center justify-start bg-paper px-4 py-2"
12 }),
13+ State.readonly.value ? JsxRuntime.jsx("div", {
14+ children: JsxRuntime.jsxs(Menu.Menu.Root, {
15+ children: [
16+ JsxRuntime.jsxs(Menu.Menu.Trigger, {
17+ children: [
18+ JsxRuntime.jsx(LucidePreact.Split, {
19+ className: "my-auto"
20+ }),
21+ "Edit"
22+ ],
23+ className: "flex flex-row gap-1 rounded-full bg-orange"
24+ }),
25+ JsxRuntime.jsx(Menu.Menu.Portal, {
26+ children: JsxRuntime.jsx(Menu.Menu.Positioner, {
27+ align: "end",
28+ side: "top",
29+ children: JsxRuntime.jsx(Menu.Menu.Popup, {
30+ children: JsxRuntime.jsxs(Menu.Menu.Group, {
31+ children: [
32+ JsxRuntime.jsx(Menu.Menu.GroupLabel, {
33+ children: "This document is read-only. If you want to make changes, you can fork it to create your own editable copy."
34+ }),
35+ JsxRuntime.jsx(Menu.Menu.LinkItem, {
36+ href: `fork/` + doc,
37+ className: "",
38+ children: "Fork a copy of this document"
39+ })
40+ ]
41+ }),
42+ className: "flex flex-col gap-2 w-40"
43+ })
44+ })
45+ })
46+ ]
47+ }),
48+ className: ""
49+ }) : null,
50 JsxRuntime.jsx("div", {
51 children: JsxRuntime.jsxs("div", {
52 children: [