@bendyline/docblocks-react 2.6.2 → 2.7.1
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/README.md +3 -10
- package/THIRD_PARTY_NOTICES.txt +4284 -3651
- package/dist/AiDiagrams-LFV4YU6W.js +13 -0
- package/dist/AiEditorAssistant-GN2KXKZD.js +786 -0
- package/dist/AudioExportDialog-F23QXNPB.js +253 -0
- package/dist/DocumentConflictDialog-5LRVIGXS.js +111 -0
- package/dist/ExportDialog-IMBVGRYG.js +9 -0
- package/dist/{ExportToolbarControls-QYLBRWM7.js → ExportToolbarControls-MUM6HM3K.js} +117 -49
- package/dist/{GitToolbarControl-O5AXBC6T.js → GitToolbarControl-B7KG4MFP.js} +6 -6
- package/dist/{GitUI-L5T3XHZG.js → GitUI-RCWUZVS6.js} +6 -6
- package/dist/PresentationMaker-W2JIBHRN.js +9 -0
- package/dist/QuickOpenDialog-2KK4SEBU.js +356 -0
- package/dist/Settings-DuXk6baH.d.ts +144 -0
- package/dist/ShareDialog-XUA2OVGI.js +292 -0
- package/dist/SpeechToolbarControl-OSQS7NVY.js +434 -0
- package/dist/TextFromNarration-XYRAB6O2.js +598 -0
- package/dist/WorkspaceSearchPanel-BKZJRPMY.js +334 -0
- package/dist/chunk-2IYBBFQX.js +201 -0
- package/dist/{chunk-LG6HAWCK.js → chunk-56KO2LYN.js} +35 -4
- package/dist/chunk-6B7G33D5.js +88 -0
- package/dist/chunk-ARATARVJ.js +40 -0
- package/dist/{chunk-ODYNOPC3.js → chunk-BCQZTWE5.js} +57 -17
- package/dist/{chunk-FMDLZ4ZG.js → chunk-BD54Z5XP.js} +12 -3
- package/dist/chunk-EA4BO6E4.js +73 -0
- package/dist/chunk-EPOLZNFD.js +518 -0
- package/dist/chunk-G4MFB3IO.js +208 -0
- package/dist/{chunk-MRUK56JS.js → chunk-GMA4KGGO.js} +7 -3
- package/dist/chunk-I44HKDQX.js +314 -0
- package/dist/chunk-K4I3NJFL.js +49 -0
- package/dist/chunk-KBDZDFPU.js +61 -0
- package/dist/{chunk-FNSRCCBC.js → chunk-KWG6UP5O.js} +0 -10
- package/dist/chunk-NAH52736.js +1884 -0
- package/dist/chunk-RP3DVNTI.js +62 -0
- package/dist/chunk-SPUPWCSI.js +111 -0
- package/dist/chunk-TBLZBNQF.js +25 -0
- package/dist/{chunk-M5Y5WO7Z.js → chunk-UG4G7PJ4.js} +1 -1
- package/dist/chunk-UONFWKJ7.js +22 -0
- package/dist/chunk-VO2JYYQZ.js +40 -0
- package/dist/chunk-W55E6TE2.js +1714 -0
- package/dist/chunk-X3DDTJKR.js +574 -0
- package/dist/{chunk-EBWYGTN7.js → chunk-X437UAF7.js} +6 -0
- package/dist/editor.d.ts +36 -1
- package/dist/editor.js +16 -1
- package/dist/export/index.d.ts +27 -11
- package/dist/export/index.js +11 -7
- package/dist/index.d.ts +100 -13
- package/dist/index.js +3927 -1638
- package/dist/proofing/index.js +11 -1
- package/dist/{run-export-I2XOVGG4.js → run-export-47X5FTYZ.js} +3 -3
- package/dist/settings/index.d.ts +32 -101
- package/dist/settings/index.js +14 -2
- package/package.json +9 -9
- package/src/styles/docblocks.css +2344 -657
- package/dist/ExportDialog-Q4VWI43H.js +0 -9
- package/dist/ShareDialog-4OX3UPJ4.js +0 -359
- package/dist/chunk-JDJVRDOP.js +0 -92
- package/dist/chunk-Q6XNIKDG.js +0 -669
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
// src/Export/ShareDialog.tsx
|
|
2
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
-
import { SHARED_DOCUMENT_LIMITS as SHARED_DOCUMENT_LIMITS2 } from "@bendyline/docblocks/share";
|
|
4
|
-
|
|
5
|
-
// src/Export/shared-document.ts
|
|
6
|
-
import {
|
|
7
|
-
SHARED_DOCUMENT_LIMITS,
|
|
8
|
-
createSharedDocumentUrl
|
|
9
|
-
} from "@bendyline/docblocks/share";
|
|
10
|
-
var PUBLIC_DOCBLOCKS_SHARE_URL = "https://docblocks.com/";
|
|
11
|
-
function resolveSharedDocumentBaseUrl(currentUrl) {
|
|
12
|
-
try {
|
|
13
|
-
const current = new URL(currentUrl);
|
|
14
|
-
if (current.protocol === "http:" || current.protocol === "https:") {
|
|
15
|
-
current.hash = "";
|
|
16
|
-
current.searchParams.delete("action");
|
|
17
|
-
return current.toString();
|
|
18
|
-
}
|
|
19
|
-
} catch {
|
|
20
|
-
}
|
|
21
|
-
return PUBLIC_DOCBLOCKS_SHARE_URL;
|
|
22
|
-
}
|
|
23
|
-
function sharedDocumentFilename(selectedFile) {
|
|
24
|
-
const basename = selectedFile?.replace(/\\/gu, "/").split("/").pop() ?? "shared.md";
|
|
25
|
-
const stem = basename.replace(/\.md$/iu, "").replace(/[^A-Za-z0-9._-]+/gu, "-");
|
|
26
|
-
const bounded = stem.replace(/^-+|-+$/gu, "").slice(0, 80) || "shared";
|
|
27
|
-
return `${bounded}.md`;
|
|
28
|
-
}
|
|
29
|
-
async function createSharedDocumentArchive(markdown, selectedFile) {
|
|
30
|
-
const encoded = new TextEncoder().encode(markdown);
|
|
31
|
-
if (encoded.byteLength > SHARED_DOCUMENT_LIMITS.markdownBytes) {
|
|
32
|
-
throw new Error(
|
|
33
|
-
`This document is too large for a shared URL (maximum ${SHARED_DOCUMENT_LIMITS.markdownBytes.toLocaleString()} UTF-8 bytes).`
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
const [{ MemoryContentContainer }, { containerToZip }] = await Promise.all([
|
|
37
|
-
import("@bendyline/squisq/storage"),
|
|
38
|
-
import("@bendyline/squisq-formats/container")
|
|
39
|
-
]);
|
|
40
|
-
const container = new MemoryContentContainer();
|
|
41
|
-
await container.writeFile(sharedDocumentFilename(selectedFile), encoded, "text/markdown");
|
|
42
|
-
const blob = await containerToZip(container, { compression: "DEFLATE", compressionLevel: 9 });
|
|
43
|
-
return new Uint8Array(await blob.arrayBuffer());
|
|
44
|
-
}
|
|
45
|
-
function buildSharedDocumentUrl(baseUrl, archive, mode) {
|
|
46
|
-
return createSharedDocumentUrl(resolveSharedDocumentBaseUrl(baseUrl), archive, mode);
|
|
47
|
-
}
|
|
48
|
-
function buildSharedDocumentQrUrl(archive, mode) {
|
|
49
|
-
const url = createSharedDocumentUrl(PUBLIC_DOCBLOCKS_SHARE_URL, archive, mode);
|
|
50
|
-
if (url.length > SHARED_DOCUMENT_LIMITS.qrUrlCharacters) {
|
|
51
|
-
throw new Error(
|
|
52
|
-
"This document is too large for a reliable QR code (maximum " + SHARED_DOCUMENT_LIMITS.qrUrlCharacters.toLocaleString() + " URL characters). Copy the share link instead."
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
return url;
|
|
56
|
-
}
|
|
57
|
-
function sharedDocumentQrFilename(selectedFile) {
|
|
58
|
-
return sharedDocumentFilename(selectedFile).replace(/\.md$/iu, "-qr.png");
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// src/Export/share-qr.ts
|
|
62
|
-
import QRCode from "qrcode";
|
|
63
|
-
async function renderSharedDocumentQrPng(url) {
|
|
64
|
-
return QRCode.toDataURL(url, {
|
|
65
|
-
type: "image/png",
|
|
66
|
-
errorCorrectionLevel: "M",
|
|
67
|
-
margin: 4,
|
|
68
|
-
width: 1024,
|
|
69
|
-
color: {
|
|
70
|
-
dark: "#111111ff",
|
|
71
|
-
light: "#ffffffff"
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function qrPngDataUrlToBlob(dataUrl) {
|
|
76
|
-
const prefix = "data:image/png;base64,";
|
|
77
|
-
if (!dataUrl.startsWith(prefix)) {
|
|
78
|
-
throw new Error("The QR code renderer returned an unsupported image format.");
|
|
79
|
-
}
|
|
80
|
-
const binary = atob(dataUrl.slice(prefix.length));
|
|
81
|
-
const bytes = new Uint8Array(binary.length);
|
|
82
|
-
for (let index = 0; index < binary.length; index += 1) {
|
|
83
|
-
bytes[index] = binary.charCodeAt(index);
|
|
84
|
-
}
|
|
85
|
-
return new Blob([bytes], { type: "image/png" });
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// src/Export/ShareDialog.tsx
|
|
89
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
90
|
-
var MODES = [
|
|
91
|
-
{ value: "", label: "Write (no default)" },
|
|
92
|
-
{ value: "slideshow", label: "Slideshow" },
|
|
93
|
-
{ value: "video", label: "Video" },
|
|
94
|
-
{ value: "page", label: "Page" },
|
|
95
|
-
{ value: "document", label: "Document" },
|
|
96
|
-
{ value: "narrate", label: "Narrate" }
|
|
97
|
-
];
|
|
98
|
-
function ShareDialog({
|
|
99
|
-
markdown,
|
|
100
|
-
selectedFile,
|
|
101
|
-
baseUrl,
|
|
102
|
-
onClose
|
|
103
|
-
}) {
|
|
104
|
-
const [mode, setMode] = useState("");
|
|
105
|
-
const [archive, setArchive] = useState(null);
|
|
106
|
-
const [archiveError, setArchiveError] = useState(null);
|
|
107
|
-
const [copyStatus, setCopyStatus] = useState("idle");
|
|
108
|
-
const [qrDataUrl, setQrDataUrl] = useState(null);
|
|
109
|
-
const [qrRenderError, setQrRenderError] = useState(null);
|
|
110
|
-
const [qrCopyStatus, setQrCopyStatus] = useState("idle");
|
|
111
|
-
const linkRef = useRef(null);
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
let cancelled = false;
|
|
114
|
-
setArchive(null);
|
|
115
|
-
setArchiveError(null);
|
|
116
|
-
void createSharedDocumentArchive(markdown, selectedFile).then((nextArchive) => {
|
|
117
|
-
if (!cancelled) setArchive(nextArchive);
|
|
118
|
-
}).catch((error) => {
|
|
119
|
-
if (!cancelled) {
|
|
120
|
-
setArchiveError(
|
|
121
|
-
error instanceof Error ? error.message : "DocBlocks could not create the shared link."
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
return () => {
|
|
126
|
-
cancelled = true;
|
|
127
|
-
};
|
|
128
|
-
}, [markdown, selectedFile]);
|
|
129
|
-
const linkResult = useMemo(() => {
|
|
130
|
-
if (!archive) return { url: "", error: archiveError };
|
|
131
|
-
try {
|
|
132
|
-
return { url: buildSharedDocumentUrl(baseUrl, archive, mode || null), error: null };
|
|
133
|
-
} catch (error) {
|
|
134
|
-
return {
|
|
135
|
-
url: "",
|
|
136
|
-
error: error instanceof Error ? error.message : "DocBlocks could not create the shared link."
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
}, [archive, archiveError, baseUrl, mode]);
|
|
140
|
-
const qrLinkResult = useMemo(() => {
|
|
141
|
-
if (!archive) return { url: "", error: archiveError };
|
|
142
|
-
try {
|
|
143
|
-
return { url: buildSharedDocumentQrUrl(archive, mode || null), error: null };
|
|
144
|
-
} catch (error) {
|
|
145
|
-
return {
|
|
146
|
-
url: "",
|
|
147
|
-
error: error instanceof Error ? error.message : "DocBlocks could not create the QR code."
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
}, [archive, archiveError, mode]);
|
|
151
|
-
useEffect(() => {
|
|
152
|
-
let cancelled = false;
|
|
153
|
-
setQrDataUrl(null);
|
|
154
|
-
setQrRenderError(null);
|
|
155
|
-
setQrCopyStatus("idle");
|
|
156
|
-
if (!qrLinkResult.url) return;
|
|
157
|
-
void renderSharedDocumentQrPng(qrLinkResult.url).then((dataUrl) => {
|
|
158
|
-
if (!cancelled) setQrDataUrl(dataUrl);
|
|
159
|
-
}).catch((error) => {
|
|
160
|
-
if (!cancelled) {
|
|
161
|
-
setQrRenderError(
|
|
162
|
-
error instanceof Error ? error.message : "DocBlocks could not render the QR code."
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
return () => {
|
|
167
|
-
cancelled = true;
|
|
168
|
-
};
|
|
169
|
-
}, [qrLinkResult.url]);
|
|
170
|
-
useEffect(() => setCopyStatus("idle"), [linkResult.url]);
|
|
171
|
-
useEffect(() => {
|
|
172
|
-
const handleKeyDown = (event) => {
|
|
173
|
-
if (event.key === "Escape") onClose();
|
|
174
|
-
};
|
|
175
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
176
|
-
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
177
|
-
}, [onClose]);
|
|
178
|
-
const copyLink = useCallback(async () => {
|
|
179
|
-
if (!linkResult.url) return;
|
|
180
|
-
try {
|
|
181
|
-
if (navigator.clipboard?.writeText) {
|
|
182
|
-
await navigator.clipboard.writeText(linkResult.url);
|
|
183
|
-
} else {
|
|
184
|
-
linkRef.current?.focus();
|
|
185
|
-
linkRef.current?.select();
|
|
186
|
-
if (typeof document.execCommand !== "function" || !document.execCommand("copy")) {
|
|
187
|
-
throw new Error("Clipboard access is unavailable.");
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
setCopyStatus("copied");
|
|
191
|
-
} catch {
|
|
192
|
-
linkRef.current?.focus();
|
|
193
|
-
linkRef.current?.select();
|
|
194
|
-
setCopyStatus("failed");
|
|
195
|
-
}
|
|
196
|
-
}, [linkResult.url]);
|
|
197
|
-
const copyQrImage = useCallback(async () => {
|
|
198
|
-
if (!qrDataUrl) return;
|
|
199
|
-
try {
|
|
200
|
-
if (!navigator.clipboard?.write || typeof ClipboardItem === "undefined") {
|
|
201
|
-
throw new Error("Image clipboard access is unavailable.");
|
|
202
|
-
}
|
|
203
|
-
const png = qrPngDataUrlToBlob(qrDataUrl);
|
|
204
|
-
await navigator.clipboard.write([new ClipboardItem({ "image/png": png })]);
|
|
205
|
-
setQrCopyStatus("copied");
|
|
206
|
-
} catch {
|
|
207
|
-
setQrCopyStatus("failed");
|
|
208
|
-
}
|
|
209
|
-
}, [qrDataUrl]);
|
|
210
|
-
const saveQrImage = useCallback(() => {
|
|
211
|
-
if (!qrDataUrl) return;
|
|
212
|
-
const download = document.createElement("a");
|
|
213
|
-
download.href = qrDataUrl;
|
|
214
|
-
download.download = sharedDocumentQrFilename(selectedFile);
|
|
215
|
-
download.style.display = "none";
|
|
216
|
-
document.body.append(download);
|
|
217
|
-
download.click();
|
|
218
|
-
download.remove();
|
|
219
|
-
}, [qrDataUrl, selectedFile]);
|
|
220
|
-
const isLong = linkResult.url.length > SHARED_DOCUMENT_LIMITS2.portableUrlCharacters;
|
|
221
|
-
const qrError = qrLinkResult.error ?? qrRenderError;
|
|
222
|
-
return /* @__PURE__ */ jsx(
|
|
223
|
-
"div",
|
|
224
|
-
{
|
|
225
|
-
className: "db-dialog-overlay",
|
|
226
|
-
onClick: (event) => {
|
|
227
|
-
if (event.target === event.currentTarget) onClose();
|
|
228
|
-
},
|
|
229
|
-
children: /* @__PURE__ */ jsxs(
|
|
230
|
-
"div",
|
|
231
|
-
{
|
|
232
|
-
className: "db-dialog db-export-dialog db-share-dialog",
|
|
233
|
-
role: "dialog",
|
|
234
|
-
"aria-modal": "true",
|
|
235
|
-
"aria-labelledby": "db-share-dialog-title",
|
|
236
|
-
children: [
|
|
237
|
-
/* @__PURE__ */ jsxs("div", { className: "db-dialog-header", children: [
|
|
238
|
-
/* @__PURE__ */ jsx("h2", { className: "db-dialog-title", id: "db-share-dialog-title", children: "Share document" }),
|
|
239
|
-
/* @__PURE__ */ jsx("button", { className: "db-dialog-close", type: "button", onClick: onClose, "aria-label": "Close", children: "\xD7" })
|
|
240
|
-
] }),
|
|
241
|
-
/* @__PURE__ */ jsxs("div", { className: "db-dialog-body", children: [
|
|
242
|
-
/* @__PURE__ */ jsx("div", { className: "db-share-warning", role: "note", children: "The contents of this document are embedded in the URL. Anyone with the link receives a copy of the document, so do not use it for secrets." }),
|
|
243
|
-
/* @__PURE__ */ jsxs("div", { className: "db-export-field", children: [
|
|
244
|
-
/* @__PURE__ */ jsx("label", { className: "db-export-label", htmlFor: "db-share-mode", children: "Default mode (optional)" }),
|
|
245
|
-
/* @__PURE__ */ jsx(
|
|
246
|
-
"select",
|
|
247
|
-
{
|
|
248
|
-
id: "db-share-mode",
|
|
249
|
-
className: "db-export-select",
|
|
250
|
-
value: mode,
|
|
251
|
-
onChange: (event) => setMode(event.target.value),
|
|
252
|
-
children: MODES.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, children: option.label }, option.value || "write"))
|
|
253
|
-
}
|
|
254
|
-
),
|
|
255
|
-
/* @__PURE__ */ jsx("span", { className: "db-export-hint", children: "Without a default, the copied document opens in Write. Other choices open directly in Use." })
|
|
256
|
-
] }),
|
|
257
|
-
/* @__PURE__ */ jsxs("div", { className: "db-export-field", children: [
|
|
258
|
-
/* @__PURE__ */ jsx("label", { className: "db-export-label", htmlFor: "db-share-link", children: "Share link" }),
|
|
259
|
-
/* @__PURE__ */ jsx(
|
|
260
|
-
"textarea",
|
|
261
|
-
{
|
|
262
|
-
ref: linkRef,
|
|
263
|
-
id: "db-share-link",
|
|
264
|
-
className: "db-share-link",
|
|
265
|
-
value: linkResult.url,
|
|
266
|
-
readOnly: true,
|
|
267
|
-
rows: 3,
|
|
268
|
-
spellCheck: false,
|
|
269
|
-
"aria-describedby": "db-share-link-status",
|
|
270
|
-
placeholder: linkResult.error ? "" : "Creating link..."
|
|
271
|
-
}
|
|
272
|
-
),
|
|
273
|
-
/* @__PURE__ */ jsx(
|
|
274
|
-
"span",
|
|
275
|
-
{
|
|
276
|
-
id: "db-share-link-status",
|
|
277
|
-
className: `db-export-hint${isLong ? " db-share-length-warning" : ""}`,
|
|
278
|
-
children: linkResult.error ? linkResult.error : linkResult.url ? isLong ? `${linkResult.url.length.toLocaleString()} characters. Links longer than 4,096 characters may be truncated by messaging or email tools.` : `${linkResult.url.length.toLocaleString()} characters.` : "Compressing this document into a Markdown-only DBK..."
|
|
279
|
-
}
|
|
280
|
-
)
|
|
281
|
-
] }),
|
|
282
|
-
/* @__PURE__ */ jsxs("section", { className: "db-share-qr", "aria-labelledby": "db-share-qr-title", children: [
|
|
283
|
-
/* @__PURE__ */ jsxs("div", { className: "db-share-qr-heading", children: [
|
|
284
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
285
|
-
/* @__PURE__ */ jsx("h3", { id: "db-share-qr-title", children: "QR code" }),
|
|
286
|
-
/* @__PURE__ */ jsx("span", { className: "db-export-hint", children: "A self-contained docblocks.com link. No document content is uploaded." })
|
|
287
|
-
] }),
|
|
288
|
-
/* @__PURE__ */ jsxs("div", { className: "db-share-qr-actions", children: [
|
|
289
|
-
/* @__PURE__ */ jsx(
|
|
290
|
-
"button",
|
|
291
|
-
{
|
|
292
|
-
className: "db-export-btn db-export-btn--secondary",
|
|
293
|
-
type: "button",
|
|
294
|
-
onClick: () => void copyQrImage(),
|
|
295
|
-
disabled: !qrDataUrl,
|
|
296
|
-
children: qrCopyStatus === "copied" ? "Copied QR" : qrCopyStatus === "failed" ? "Copy unavailable" : "Copy QR image"
|
|
297
|
-
}
|
|
298
|
-
),
|
|
299
|
-
/* @__PURE__ */ jsx(
|
|
300
|
-
"button",
|
|
301
|
-
{
|
|
302
|
-
className: "db-export-btn db-export-btn--secondary",
|
|
303
|
-
type: "button",
|
|
304
|
-
onClick: saveQrImage,
|
|
305
|
-
disabled: !qrDataUrl,
|
|
306
|
-
children: "Save QR PNG"
|
|
307
|
-
}
|
|
308
|
-
)
|
|
309
|
-
] })
|
|
310
|
-
] }),
|
|
311
|
-
qrDataUrl ? /* @__PURE__ */ jsx(
|
|
312
|
-
"img",
|
|
313
|
-
{
|
|
314
|
-
className: "db-share-qr-image",
|
|
315
|
-
src: qrDataUrl,
|
|
316
|
-
alt: "QR code for this shared DocBlocks document"
|
|
317
|
-
}
|
|
318
|
-
) : /* @__PURE__ */ jsx(
|
|
319
|
-
"div",
|
|
320
|
-
{
|
|
321
|
-
className: `db-share-qr-placeholder${qrError ? " db-share-qr-placeholder--error" : ""}`,
|
|
322
|
-
role: qrError ? "note" : "status",
|
|
323
|
-
children: qrError ?? "Rendering QR code..."
|
|
324
|
-
}
|
|
325
|
-
),
|
|
326
|
-
/* @__PURE__ */ jsx("span", { className: "db-export-hint db-share-qr-status", "aria-live": "polite", children: qrCopyStatus === "failed" ? "This browser could not copy the PNG. Save it instead." : qrDataUrl ? `${qrLinkResult.url.length.toLocaleString()} of ${SHARED_DOCUMENT_LIMITS2.qrUrlCharacters.toLocaleString()} supported QR characters.` : "" })
|
|
327
|
-
] }),
|
|
328
|
-
/* @__PURE__ */ jsx("p", { className: "db-share-temporary-note", children: "Opening the link creates a temporary workspace. Changes there do not alter this document or the link." })
|
|
329
|
-
] }),
|
|
330
|
-
/* @__PURE__ */ jsxs("div", { className: "db-export-footer", children: [
|
|
331
|
-
/* @__PURE__ */ jsx(
|
|
332
|
-
"button",
|
|
333
|
-
{
|
|
334
|
-
className: "db-export-btn db-export-btn--secondary",
|
|
335
|
-
type: "button",
|
|
336
|
-
onClick: onClose,
|
|
337
|
-
children: "Close"
|
|
338
|
-
}
|
|
339
|
-
),
|
|
340
|
-
/* @__PURE__ */ jsx(
|
|
341
|
-
"button",
|
|
342
|
-
{
|
|
343
|
-
className: "db-export-btn db-export-btn--primary",
|
|
344
|
-
type: "button",
|
|
345
|
-
onClick: () => void copyLink(),
|
|
346
|
-
disabled: !linkResult.url,
|
|
347
|
-
children: copyStatus === "copied" ? "Copied" : copyStatus === "failed" ? "Select and copy" : "Copy link"
|
|
348
|
-
}
|
|
349
|
-
)
|
|
350
|
-
] })
|
|
351
|
-
]
|
|
352
|
-
}
|
|
353
|
-
)
|
|
354
|
-
}
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
export {
|
|
358
|
-
ShareDialog
|
|
359
|
-
};
|
package/dist/chunk-JDJVRDOP.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// src/editor.ts
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
var PORTRAIT_FORM_FACTOR_QUERY = "(orientation: portrait)";
|
|
4
|
-
function previewViewportPresetForOrientation(isPortrait) {
|
|
5
|
-
return isPortrait ? "portrait" : "landscape";
|
|
6
|
-
}
|
|
7
|
-
function useResponsivePreviewViewportPreset() {
|
|
8
|
-
const [isPortrait, setIsPortrait] = useState(() => {
|
|
9
|
-
if (typeof globalThis.matchMedia !== "function") return false;
|
|
10
|
-
return globalThis.matchMedia(PORTRAIT_FORM_FACTOR_QUERY).matches;
|
|
11
|
-
});
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (typeof globalThis.matchMedia !== "function") return;
|
|
14
|
-
const query = globalThis.matchMedia(PORTRAIT_FORM_FACTOR_QUERY);
|
|
15
|
-
const update = () => setIsPortrait(query.matches);
|
|
16
|
-
update();
|
|
17
|
-
query.addEventListener("change", update);
|
|
18
|
-
return () => query.removeEventListener("change", update);
|
|
19
|
-
}, []);
|
|
20
|
-
return previewViewportPresetForOrientation(isPortrait);
|
|
21
|
-
}
|
|
22
|
-
var EMPTY_DOCUMENT_PROMPTS = [
|
|
23
|
-
"Start typing your content, or drop images on top of me...",
|
|
24
|
-
"Write anything -- paste markdown, drag in images, or just start typing...",
|
|
25
|
-
"Type away. Markdown syntax works too...",
|
|
26
|
-
"Chapter 1 begins here...",
|
|
27
|
-
"Once upon a time...",
|
|
28
|
-
"A blank page. Exciting, isn't it?",
|
|
29
|
-
"The first word is always the hardest...",
|
|
30
|
-
"Plot twist: this is where it all starts...",
|
|
31
|
-
"Write something the future you will thank you for...",
|
|
32
|
-
"Begin at the beginning...",
|
|
33
|
-
"Let's begin.",
|
|
34
|
-
"We can be heroes...",
|
|
35
|
-
"Here comes the sun...",
|
|
36
|
-
"And so it begins...",
|
|
37
|
-
"Let it be, let it be...",
|
|
38
|
-
"Don't stop believing...",
|
|
39
|
-
"Started from the bottom...",
|
|
40
|
-
"This is the start of something new...",
|
|
41
|
-
"Ground control to Major Tom...",
|
|
42
|
-
"Come as you are...",
|
|
43
|
-
"Every new beginning...",
|
|
44
|
-
"Hello, is it me you're looking for?",
|
|
45
|
-
"Imagine all the people...",
|
|
46
|
-
"Anything you want, you got it...",
|
|
47
|
-
"Rise above...",
|
|
48
|
-
"Do you have the time...",
|
|
49
|
-
"Here we are now, entertain us...",
|
|
50
|
-
"All the small things...",
|
|
51
|
-
"Should I stay or should I go?",
|
|
52
|
-
"I am a patient boy -- I wait, I wait, I wait...",
|
|
53
|
-
"Destination unknown...",
|
|
54
|
-
"Easy like Sunday morning...",
|
|
55
|
-
"Dance, dance, dance to the radio...",
|
|
56
|
-
"New day rising...",
|
|
57
|
-
"Visit the world...",
|
|
58
|
-
"Positive mental attitude...",
|
|
59
|
-
"Better I sing than I cry...",
|
|
60
|
-
"Disconnect for a minute...",
|
|
61
|
-
"We need new noise...",
|
|
62
|
-
"Shoot the moon...",
|
|
63
|
-
"I'll surprise you sometime -- I'll come around...",
|
|
64
|
-
"Coming out of my cage, and doing just fine...",
|
|
65
|
-
"Throw me to the wolves -- I'll come back, leading the pack...",
|
|
66
|
-
"There comes a time -- no excuses...",
|
|
67
|
-
"It's up to me now, turn on the bright lights...",
|
|
68
|
-
"Do what you want...",
|
|
69
|
-
"Fingers crossed...",
|
|
70
|
-
"This is the start of how it all ends...",
|
|
71
|
-
"It has to start somewhere, it has to start sometime -- what better place than here? what better time than now?",
|
|
72
|
-
"I know myself, and I'll begin again...",
|
|
73
|
-
"Dig me out, dig me in...",
|
|
74
|
-
"Everybody's full of sugar, honey, ice and tea...",
|
|
75
|
-
"Take time with a wounded hand, 'cause it likes to heal...",
|
|
76
|
-
"Grab a brush and put on a little makeup...",
|
|
77
|
-
"Amber is the color of your energy...",
|
|
78
|
-
"Wait -- they don't love it like I love it...",
|
|
79
|
-
"A world's been buried, where love is the law; a you-topia..."
|
|
80
|
-
];
|
|
81
|
-
function pickEmptyDocumentPrompt(random = Math.random) {
|
|
82
|
-
const index = Math.floor(random() * EMPTY_DOCUMENT_PROMPTS.length);
|
|
83
|
-
return EMPTY_DOCUMENT_PROMPTS[index] ?? EMPTY_DOCUMENT_PROMPTS[0];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export {
|
|
87
|
-
PORTRAIT_FORM_FACTOR_QUERY,
|
|
88
|
-
previewViewportPresetForOrientation,
|
|
89
|
-
useResponsivePreviewViewportPreset,
|
|
90
|
-
EMPTY_DOCUMENT_PROMPTS,
|
|
91
|
-
pickEmptyDocumentPrompt
|
|
92
|
-
};
|