@bendyline/docblocks-react 2.7.0 → 2.7.2
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 +1 -1
- package/THIRD_PARTY_NOTICES.txt +98 -48
- package/dist/{AiDiagrams-XWOM3YZX.js → AiDiagrams-LFV4YU6W.js} +2 -2
- package/dist/{AiEditorAssistant-M4LI2CRY.js → AiEditorAssistant-GN2KXKZD.js} +21 -6
- package/dist/{ExportDialog-L6FG6W3H.js → ExportDialog-JRVZCG3J.js} +2 -2
- package/dist/{ExportToolbarControls-BRCPZ7H3.js → ExportToolbarControls-2FEIHNMW.js} +28 -18
- package/dist/{GitToolbarControl-J4UYZDV6.js → GitToolbarControl-B7KG4MFP.js} +4 -4
- package/dist/{GitUI-LZW3IUXO.js → GitUI-RCWUZVS6.js} +2 -2
- package/dist/KeyboardShortcutsDialog-NOD4P25G.js +145 -0
- package/dist/{PresentationMaker-622NHMIN.js → PresentationMaker-ITNP5SDO.js} +2 -2
- package/dist/{Settings-DuXk6baH.d.ts → Settings-RDYvDDI0.d.ts} +13 -11
- package/dist/ShareDialog-XUA2OVGI.js +292 -0
- package/dist/{SpeechToolbarControl-UZQKGQWD.js → SpeechToolbarControl-CLU7RB2G.js} +2 -2
- package/dist/{TextFromNarration-XYRAB6O2.js → TextFromNarration-NITJQ4IB.js} +1 -1
- package/dist/{WorkspaceSearchPanel-OUQQ5DOM.js → WorkspaceSearchPanel-J6BKEZQJ.js} +8 -2
- package/dist/{chunk-UG4G7PJ4.js → chunk-5O5YTOXG.js} +1 -1
- package/dist/{chunk-VO2JYYQZ.js → chunk-6JJOGV6M.js} +5 -13
- package/dist/{chunk-X437UAF7.js → chunk-6MSHXQNB.js} +7 -2
- package/dist/{chunk-Q5ZVP5LV.js → chunk-BLUEZG7T.js} +40 -32
- package/dist/chunk-DICE7VBJ.js +77 -0
- package/dist/{chunk-MRUK56JS.js → chunk-GMA4KGGO.js} +7 -3
- package/dist/{chunk-BCQZTWE5.js → chunk-HRWEGPTY.js} +18 -4
- package/dist/chunk-K7XJDJUJ.js +126 -0
- package/dist/{chunk-5OZBGIIT.js → chunk-NAH52736.js} +86 -28
- package/dist/{chunk-YS4HVWIO.js → chunk-SPUPWCSI.js} +49 -1
- package/dist/{chunk-MMOTEQK6.js → chunk-SSB43524.js} +165 -70
- package/dist/{chunk-G4MFB3IO.js → chunk-VG434562.js} +2 -70
- package/dist/{chunk-OINKNX26.js → chunk-X3DDTJKR.js} +1 -1
- package/dist/{chunk-SGQKTKDX.js → chunk-Y5OE3HJC.js} +14 -4
- package/dist/editor.js +7 -5
- package/dist/export/index.d.ts +17 -6
- package/dist/export/index.js +4 -4
- package/dist/index.d.ts +24 -6
- package/dist/index.js +452 -247
- package/dist/proofing/index.js +11 -1
- package/dist/run-export-CS3HRNAZ.js +13 -0
- package/dist/settings/index.d.ts +1 -1
- package/dist/settings/index.js +1 -1
- package/package.json +9 -8
- package/src/styles/docblocks.css +481 -271
- package/dist/ShareDialog-N7GPM4SB.js +0 -310
- package/dist/chunk-EA4BO6E4.js +0 -73
- package/dist/run-export-47X5FTYZ.js +0 -11
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BackupIcon,
|
|
2
3
|
FolderIcon,
|
|
3
4
|
MoreIcon,
|
|
4
5
|
NewFileIcon,
|
|
@@ -10,7 +11,7 @@ import {
|
|
|
10
11
|
SortByNameIcon,
|
|
11
12
|
SplitViewIcon,
|
|
12
13
|
WorkspaceIcon
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-DICE7VBJ.js";
|
|
14
15
|
import {
|
|
15
16
|
useConfirmDialog
|
|
16
17
|
} from "./chunk-6B7G33D5.js";
|
|
@@ -22,7 +23,7 @@ import {
|
|
|
22
23
|
} from "./chunk-2IYBBFQX.js";
|
|
23
24
|
import {
|
|
24
25
|
sharedDocumentFilename
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-SPUPWCSI.js";
|
|
26
27
|
import {
|
|
27
28
|
createBrowserSaveAsAdapter
|
|
28
29
|
} from "./chunk-UMEDHMT7.js";
|
|
@@ -39,7 +40,7 @@ import {
|
|
|
39
40
|
} from "./chunk-6E635KCJ.js";
|
|
40
41
|
import {
|
|
41
42
|
useMenuKeyboard
|
|
42
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-GMA4KGGO.js";
|
|
43
44
|
import {
|
|
44
45
|
displayFileName,
|
|
45
46
|
renameDraft,
|
|
@@ -50,13 +51,13 @@ import {
|
|
|
50
51
|
} from "./chunk-KWG6UP5O.js";
|
|
51
52
|
import {
|
|
52
53
|
runExport
|
|
53
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-HRWEGPTY.js";
|
|
54
55
|
import {
|
|
55
56
|
createImageSaveOutput
|
|
56
57
|
} from "./chunk-UONFWKJ7.js";
|
|
57
58
|
import {
|
|
58
59
|
buildExportFilename
|
|
59
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-5O5YTOXG.js";
|
|
60
61
|
import {
|
|
61
62
|
createLocalProofingIgnoreStore
|
|
62
63
|
} from "./chunk-DUKTAKB4.js";
|
|
@@ -86,28 +87,30 @@ import {
|
|
|
86
87
|
saveProofingPreferences,
|
|
87
88
|
saveThemePreference,
|
|
88
89
|
saveWriteCanvasPreferences
|
|
89
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-BLUEZG7T.js";
|
|
90
91
|
import {
|
|
91
92
|
FindButton,
|
|
92
|
-
findShortcutLabel,
|
|
93
93
|
focusFindInput,
|
|
94
|
-
isApplePlatform,
|
|
95
|
-
matchShortcut,
|
|
96
94
|
pickEmptyDocumentPrompt,
|
|
97
|
-
shortcutLabel,
|
|
98
95
|
useResponsivePreviewViewportPreset
|
|
99
|
-
} from "./chunk-
|
|
100
|
-
import
|
|
101
|
-
|
|
96
|
+
} from "./chunk-VG434562.js";
|
|
97
|
+
import {
|
|
98
|
+
findShortcutLabel,
|
|
99
|
+
isApplePlatform,
|
|
100
|
+
matchShortcut,
|
|
101
|
+
shortcutLabel
|
|
102
|
+
} from "./chunk-K7XJDJUJ.js";
|
|
103
|
+
import "./chunk-SSB43524.js";
|
|
104
|
+
import "./chunk-NAH52736.js";
|
|
102
105
|
import "./chunk-K4I3NJFL.js";
|
|
103
106
|
import {
|
|
104
107
|
ExportDialog
|
|
105
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-Y5OE3HJC.js";
|
|
106
109
|
import "./chunk-YBEYTVU2.js";
|
|
107
110
|
import {
|
|
108
111
|
DEFAULT_OPTIONS,
|
|
109
112
|
loadLastExportOptions
|
|
110
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-6MSHXQNB.js";
|
|
111
114
|
import {
|
|
112
115
|
Dialog,
|
|
113
116
|
dismissTopmostDialog
|
|
@@ -1765,8 +1768,19 @@ import {
|
|
|
1765
1768
|
} from "@bendyline/docblocks/workspace-settings";
|
|
1766
1769
|
var UPDATE_FROM_MARKDOWN_KEY = "squisq-updatefrommarkdown";
|
|
1767
1770
|
var HTML_OUTPUT_KEY = "squisq-html-output";
|
|
1771
|
+
var pdfWorkerSrc = null;
|
|
1772
|
+
var configuredPdfWorkerSrc = null;
|
|
1773
|
+
function setOutsideInPdfWorker(src) {
|
|
1774
|
+
pdfWorkerSrc = src ?? null;
|
|
1775
|
+
}
|
|
1768
1776
|
async function loadOutsideInModule() {
|
|
1769
|
-
|
|
1777
|
+
const outsideIn = await import("@bendyline/squisq-formats/outside-in");
|
|
1778
|
+
if (pdfWorkerSrc && pdfWorkerSrc !== configuredPdfWorkerSrc) {
|
|
1779
|
+
const { configurePdfWorker } = await import("@bendyline/squisq-formats/pdf");
|
|
1780
|
+
configurePdfWorker(pdfWorkerSrc);
|
|
1781
|
+
configuredPdfWorkerSrc = pdfWorkerSrc;
|
|
1782
|
+
}
|
|
1783
|
+
return outsideIn;
|
|
1770
1784
|
}
|
|
1771
1785
|
async function readOutsideInMetadata(source) {
|
|
1772
1786
|
const { readOutsideInMetadata: readMetadata } = await loadOutsideInModule();
|
|
@@ -2357,6 +2371,17 @@ function newFileName(name, format) {
|
|
|
2357
2371
|
const stem = name.trim().replace(SELECTABLE_FILE_EXTENSION, "");
|
|
2358
2372
|
return stem ? `${stem}${NEW_FILE_EXTENSIONS[format]}` : null;
|
|
2359
2373
|
}
|
|
2374
|
+
var SAVED_AS = {
|
|
2375
|
+
docx: "Word document",
|
|
2376
|
+
xlsx: "Excel workbook",
|
|
2377
|
+
pdf: "PDF",
|
|
2378
|
+
"web-interactive": "web page",
|
|
2379
|
+
"web-static": "web page"
|
|
2380
|
+
};
|
|
2381
|
+
function newFileFormatHint(format) {
|
|
2382
|
+
if (format === "markdown") return null;
|
|
2383
|
+
return `You write in Markdown; each save updates the ${SAVED_AS[format]}.`;
|
|
2384
|
+
}
|
|
2360
2385
|
function newFileHtmlOutput(format) {
|
|
2361
2386
|
if (format === "web-static") return "static";
|
|
2362
2387
|
if (format === "web-interactive") return "interactive";
|
|
@@ -2367,13 +2392,11 @@ function newFileHtmlOutput(format) {
|
|
|
2367
2392
|
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2368
2393
|
function NewFileFormatOptions() {
|
|
2369
2394
|
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
2370
|
-
/* @__PURE__ */
|
|
2371
|
-
|
|
2395
|
+
/* @__PURE__ */ jsx4("option", { value: "markdown", children: "Markdown (.md)" }),
|
|
2396
|
+
/* @__PURE__ */ jsxs3("optgroup", { label: "Written in Markdown, saved as", children: [
|
|
2372
2397
|
/* @__PURE__ */ jsx4("option", { value: "docx", children: "Word document (.docx)" }),
|
|
2373
2398
|
/* @__PURE__ */ jsx4("option", { value: "xlsx", children: "Excel workbook (.xlsx)" }),
|
|
2374
|
-
/* @__PURE__ */ jsx4("option", { value: "pdf", children: "PDF
|
|
2375
|
-
] }),
|
|
2376
|
-
/* @__PURE__ */ jsxs3("optgroup", { label: "Web page", children: [
|
|
2399
|
+
/* @__PURE__ */ jsx4("option", { value: "pdf", children: "PDF (.pdf)" }),
|
|
2377
2400
|
/* @__PURE__ */ jsx4("option", { value: "web-interactive", children: "Web page \u2014 Interactive (.html)" }),
|
|
2378
2401
|
/* @__PURE__ */ jsx4("option", { value: "web-static", children: "Web page \u2014 Static (.html)" })
|
|
2379
2402
|
] })
|
|
@@ -2384,6 +2407,7 @@ function NewFileFormatOptions() {
|
|
|
2384
2407
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2385
2408
|
var INTERNAL_DRAG_TYPE = "application/x-docblocks-entry";
|
|
2386
2409
|
var NEW_ITEM_ERROR_ID = "db-new-item-error";
|
|
2410
|
+
var NEW_ITEM_HINT_ID = "db-new-item-hint";
|
|
2387
2411
|
function normalisePath2(path) {
|
|
2388
2412
|
return parseWorkspacePath4(path);
|
|
2389
2413
|
}
|
|
@@ -3105,6 +3129,7 @@ function FileExplorer({
|
|
|
3105
3129
|
{
|
|
3106
3130
|
className: "db-new-item-format",
|
|
3107
3131
|
"aria-label": "New file type",
|
|
3132
|
+
"aria-describedby": newFileFormatHint(newFileFormat) ? NEW_ITEM_HINT_ID : void 0,
|
|
3108
3133
|
value: newFileFormat,
|
|
3109
3134
|
disabled: newItemCreationPending,
|
|
3110
3135
|
onChange: (event) => {
|
|
@@ -3119,6 +3144,7 @@ function FileExplorer({
|
|
|
3119
3144
|
]
|
|
3120
3145
|
}
|
|
3121
3146
|
),
|
|
3147
|
+
newItemType === "file" && newFileFormatHint(newFileFormat) && /* @__PURE__ */ jsx5("p", { id: NEW_ITEM_HINT_ID, className: "db-new-item-hint", children: newFileFormatHint(newFileFormat) }),
|
|
3122
3148
|
newItemError && /* @__PURE__ */ jsx5("div", { id: NEW_ITEM_ERROR_ID, className: "db-tree-error", role: "alert", children: newItemError })
|
|
3123
3149
|
] }),
|
|
3124
3150
|
moveError && /* @__PURE__ */ jsx5("div", { className: "db-tree-error", role: "alert", children: moveError }),
|
|
@@ -3636,7 +3662,16 @@ async function prepareHostLifecycle(session, request) {
|
|
|
3636
3662
|
}
|
|
3637
3663
|
|
|
3638
3664
|
// src/DocBlocksShell/DocBlocksShell.tsx
|
|
3639
|
-
import {
|
|
3665
|
+
import {
|
|
3666
|
+
useState as useState23,
|
|
3667
|
+
useCallback as useCallback18,
|
|
3668
|
+
useEffect as useEffect29,
|
|
3669
|
+
useLayoutEffect as useLayoutEffect4,
|
|
3670
|
+
useRef as useRef19,
|
|
3671
|
+
useMemo as useMemo6,
|
|
3672
|
+
lazy as lazy2,
|
|
3673
|
+
Suspense as Suspense2
|
|
3674
|
+
} from "react";
|
|
3640
3675
|
import {
|
|
3641
3676
|
DocumentVersionManager
|
|
3642
3677
|
} from "@bendyline/squisq/versions";
|
|
@@ -3703,6 +3738,14 @@ function readinessSentence(readiness, ready) {
|
|
|
3703
3738
|
return readiness.state === "ready" ? ready : readiness.reason ?? "";
|
|
3704
3739
|
}
|
|
3705
3740
|
var PREVIEW_TEXT = "This is how I sound when I read your documents aloud.";
|
|
3741
|
+
function unreachable(cause) {
|
|
3742
|
+
const detail = cause instanceof Error ? cause.message : void 0;
|
|
3743
|
+
return {
|
|
3744
|
+
code: "unknown",
|
|
3745
|
+
message: "DocBlocks could not check speech on this computer.",
|
|
3746
|
+
...detail ? { detail } : {}
|
|
3747
|
+
};
|
|
3748
|
+
}
|
|
3706
3749
|
function SpeechSettingsControls({ speech }) {
|
|
3707
3750
|
const [status, setStatus] = useState6(null);
|
|
3708
3751
|
const [catalog, setCatalog] = useState6(null);
|
|
@@ -3717,11 +3760,15 @@ function SpeechSettingsControls({ speech }) {
|
|
|
3717
3760
|
const voiceId = useId2();
|
|
3718
3761
|
const speedId = useId2();
|
|
3719
3762
|
const refresh = useCallback7(async () => {
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3763
|
+
try {
|
|
3764
|
+
const [nextStatus, nextCatalog] = await Promise.all([speech.status(), speech.catalog()]);
|
|
3765
|
+
if (!mounted.current) return;
|
|
3766
|
+
setStatus(nextStatus);
|
|
3767
|
+
if (nextCatalog.ok) setCatalog(nextCatalog.value);
|
|
3768
|
+
else setFailure(nextCatalog.error);
|
|
3769
|
+
} catch (cause) {
|
|
3770
|
+
if (mounted.current) setFailure(unreachable(cause));
|
|
3771
|
+
}
|
|
3725
3772
|
}, [speech]);
|
|
3726
3773
|
const stopPreview = useCallback7(() => {
|
|
3727
3774
|
preview.current?.handle.cancel();
|
|
@@ -3739,9 +3786,14 @@ function SpeechSettingsControls({ speech }) {
|
|
|
3739
3786
|
});
|
|
3740
3787
|
});
|
|
3741
3788
|
void refresh();
|
|
3742
|
-
void speech.getPreferences().then(
|
|
3743
|
-
|
|
3744
|
-
|
|
3789
|
+
void speech.getPreferences().then(
|
|
3790
|
+
(initial) => {
|
|
3791
|
+
if (mounted.current) setPreferences(initial);
|
|
3792
|
+
},
|
|
3793
|
+
(cause) => {
|
|
3794
|
+
if (mounted.current) setFailure(unreachable(cause));
|
|
3795
|
+
}
|
|
3796
|
+
);
|
|
3745
3797
|
return () => {
|
|
3746
3798
|
mounted.current = false;
|
|
3747
3799
|
installHandle.current?.cancel();
|
|
@@ -3813,7 +3865,13 @@ function SpeechSettingsControls({ speech }) {
|
|
|
3813
3865
|
setPreviewing(false);
|
|
3814
3866
|
});
|
|
3815
3867
|
}, [speech, stopPreview]);
|
|
3816
|
-
if (!status || !catalog || !preferences)
|
|
3868
|
+
if (!status || !catalog || !preferences) {
|
|
3869
|
+
if (!failure) return null;
|
|
3870
|
+
return /* @__PURE__ */ jsxs6("fieldset", { className: "db-settings-fieldset", children: [
|
|
3871
|
+
/* @__PURE__ */ jsx7("legend", { className: "db-settings-legend", children: "Speech" }),
|
|
3872
|
+
/* @__PURE__ */ jsx7("p", { className: "db-settings-hint db-settings-ai-error", role: "alert", children: failure.message })
|
|
3873
|
+
] });
|
|
3874
|
+
}
|
|
3817
3875
|
const sttModels = catalog.models.filter((model) => model.kind === "stt");
|
|
3818
3876
|
const ttsModel = catalog.models.find((model) => model.kind === "tts") ?? null;
|
|
3819
3877
|
const installedStt = sttModels.filter((model) => model.installed);
|
|
@@ -3976,6 +4034,17 @@ function SpeechSettingsControls({ speech }) {
|
|
|
3976
4034
|
] });
|
|
3977
4035
|
}
|
|
3978
4036
|
|
|
4037
|
+
// src/local-date.ts
|
|
4038
|
+
function localDateStamp(date) {
|
|
4039
|
+
const pad = (value) => String(value).padStart(2, "0");
|
|
4040
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
4041
|
+
}
|
|
4042
|
+
function displayBuildDate(value) {
|
|
4043
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(value)) return value;
|
|
4044
|
+
const instant = new Date(value);
|
|
4045
|
+
return Number.isNaN(instant.getTime()) ? value : localDateStamp(instant);
|
|
4046
|
+
}
|
|
4047
|
+
|
|
3979
4048
|
// src/AppMenu/AppMenu.tsx
|
|
3980
4049
|
import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3981
4050
|
function formatBytes(bytes) {
|
|
@@ -3989,6 +4058,7 @@ function formatBytes(bytes) {
|
|
|
3989
4058
|
}
|
|
3990
4059
|
return `${value >= 100 || unit === "B" ? Math.round(value) : value.toFixed(1)} ${unit}`;
|
|
3991
4060
|
}
|
|
4061
|
+
var DOCUMENTATION_URL = "https://docblocks.com/docs/";
|
|
3992
4062
|
var MORE_INFORMATION_URLS = Object.freeze({
|
|
3993
4063
|
electron: "https://docblocks.com/desktop/",
|
|
3994
4064
|
capacitor: "https://docblocks.com/web/",
|
|
@@ -3996,9 +4066,10 @@ var MORE_INFORMATION_URLS = Object.freeze({
|
|
|
3996
4066
|
});
|
|
3997
4067
|
function AppMenu({
|
|
3998
4068
|
logoUrl,
|
|
4069
|
+
logoDarkUrl,
|
|
3999
4070
|
themePreference = "auto",
|
|
4000
4071
|
onThemeChange,
|
|
4001
|
-
accentColor = "
|
|
4072
|
+
accentColor = "rust",
|
|
4002
4073
|
onAccentColorChange,
|
|
4003
4074
|
interfaceFont = "system",
|
|
4004
4075
|
onInterfaceFontChange,
|
|
@@ -4010,6 +4081,7 @@ function AppMenu({
|
|
|
4010
4081
|
onVersioningPreferenceChange,
|
|
4011
4082
|
onOpenWorkspaceSettings,
|
|
4012
4083
|
onDownloadAllWorkspaces,
|
|
4084
|
+
onShowKeyboardShortcuts,
|
|
4013
4085
|
onKeepBrowserData,
|
|
4014
4086
|
onInstallApp,
|
|
4015
4087
|
getStorageEstimate,
|
|
@@ -4055,7 +4127,7 @@ function AppMenu({
|
|
|
4055
4127
|
}, [closeMenu, isOpen]);
|
|
4056
4128
|
const handleAction = useCallback8(
|
|
4057
4129
|
(action) => {
|
|
4058
|
-
closeMenu(
|
|
4130
|
+
closeMenu(true);
|
|
4059
4131
|
action();
|
|
4060
4132
|
},
|
|
4061
4133
|
[closeMenu]
|
|
@@ -4082,16 +4154,28 @@ function AppMenu({
|
|
|
4082
4154
|
"aria-expanded": isOpen,
|
|
4083
4155
|
"aria-haspopup": "menu",
|
|
4084
4156
|
children: [
|
|
4085
|
-
logoUrl ? /* @__PURE__ */
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4157
|
+
logoUrl ? /* @__PURE__ */ jsxs7(Fragment5, { children: [
|
|
4158
|
+
/* @__PURE__ */ jsx8(
|
|
4159
|
+
"img",
|
|
4160
|
+
{
|
|
4161
|
+
src: logoUrl,
|
|
4162
|
+
alt: "DocBlocks",
|
|
4163
|
+
className: `db-app-menu-logo ${logoDarkUrl ? "db-app-menu-logo--light" : "db-app-menu-logo--invert"}`,
|
|
4164
|
+
width: 557,
|
|
4165
|
+
height: 242
|
|
4166
|
+
}
|
|
4167
|
+
),
|
|
4168
|
+
logoDarkUrl && /* @__PURE__ */ jsx8(
|
|
4169
|
+
"img",
|
|
4170
|
+
{
|
|
4171
|
+
src: logoDarkUrl,
|
|
4172
|
+
alt: "DocBlocks",
|
|
4173
|
+
className: "db-app-menu-logo db-app-menu-logo--dark",
|
|
4174
|
+
width: 557,
|
|
4175
|
+
height: 242
|
|
4176
|
+
}
|
|
4177
|
+
)
|
|
4178
|
+
] }) : /* @__PURE__ */ jsx8("span", { className: "db-app-menu-label", children: "docblocks" }),
|
|
4095
4179
|
/* @__PURE__ */ jsx8(
|
|
4096
4180
|
"span",
|
|
4097
4181
|
{
|
|
@@ -4130,6 +4214,17 @@ function AppMenu({
|
|
|
4130
4214
|
children: "Install DocBlocks\u2026"
|
|
4131
4215
|
}
|
|
4132
4216
|
),
|
|
4217
|
+
(onDownloadAllWorkspaces || onKeepBrowserData) && /* @__PURE__ */ jsx8("div", { className: "db-app-menu-divider" }),
|
|
4218
|
+
onDownloadAllWorkspaces && /* @__PURE__ */ jsx8(
|
|
4219
|
+
"button",
|
|
4220
|
+
{
|
|
4221
|
+
className: "db-app-menu-item",
|
|
4222
|
+
role: "menuitem",
|
|
4223
|
+
tabIndex: -1,
|
|
4224
|
+
onClick: () => handleAction(() => void onDownloadAllWorkspaces()),
|
|
4225
|
+
children: "Back up all workspaces"
|
|
4226
|
+
}
|
|
4227
|
+
),
|
|
4133
4228
|
onKeepBrowserData && /* @__PURE__ */ jsx8(
|
|
4134
4229
|
"button",
|
|
4135
4230
|
{
|
|
@@ -4140,17 +4235,34 @@ function AppMenu({
|
|
|
4140
4235
|
children: "Protect data from browser cleanup"
|
|
4141
4236
|
}
|
|
4142
4237
|
),
|
|
4143
|
-
|
|
4238
|
+
/* @__PURE__ */ jsx8("div", { className: "db-app-menu-divider" }),
|
|
4239
|
+
onShowKeyboardShortcuts && /* @__PURE__ */ jsxs7(
|
|
4144
4240
|
"button",
|
|
4241
|
+
{
|
|
4242
|
+
className: "db-app-menu-item db-app-menu-item--with-shortcut",
|
|
4243
|
+
role: "menuitem",
|
|
4244
|
+
tabIndex: -1,
|
|
4245
|
+
"aria-keyshortcuts": "F1",
|
|
4246
|
+
onClick: () => handleAction(onShowKeyboardShortcuts),
|
|
4247
|
+
children: [
|
|
4248
|
+
"Keyboard shortcuts",
|
|
4249
|
+
/* @__PURE__ */ jsx8("span", { className: "db-app-menu-shortcut", "aria-hidden": "true", children: "F1" })
|
|
4250
|
+
]
|
|
4251
|
+
}
|
|
4252
|
+
),
|
|
4253
|
+
/* @__PURE__ */ jsx8(
|
|
4254
|
+
"a",
|
|
4145
4255
|
{
|
|
4146
4256
|
className: "db-app-menu-item",
|
|
4147
4257
|
role: "menuitem",
|
|
4148
4258
|
tabIndex: -1,
|
|
4149
|
-
|
|
4150
|
-
|
|
4259
|
+
href: DOCUMENTATION_URL,
|
|
4260
|
+
target: "_blank",
|
|
4261
|
+
rel: "noopener noreferrer",
|
|
4262
|
+
onClick: () => closeMenu(false),
|
|
4263
|
+
children: "Documentation"
|
|
4151
4264
|
}
|
|
4152
4265
|
),
|
|
4153
|
-
/* @__PURE__ */ jsx8("div", { className: "db-app-menu-divider" }),
|
|
4154
4266
|
/* @__PURE__ */ jsx8(
|
|
4155
4267
|
"button",
|
|
4156
4268
|
{
|
|
@@ -4310,7 +4422,7 @@ function AppMenu({
|
|
|
4310
4422
|
] }),
|
|
4311
4423
|
appBuildDate && /* @__PURE__ */ jsxs7("p", { className: "db-about-version", children: [
|
|
4312
4424
|
/* @__PURE__ */ jsx8("span", { children: "Build" }),
|
|
4313
|
-
/* @__PURE__ */ jsx8("time", { dateTime: appBuildDate, children: appBuildDate })
|
|
4425
|
+
/* @__PURE__ */ jsx8("time", { dateTime: appBuildDate, children: displayBuildDate(appBuildDate) })
|
|
4314
4426
|
] }),
|
|
4315
4427
|
/* @__PURE__ */ jsxs7("p", { children: [
|
|
4316
4428
|
"Built with",
|
|
@@ -4398,7 +4510,7 @@ function WorkspaceSettingsButton({
|
|
|
4398
4510
|
}, [closeMenu, isOpen]);
|
|
4399
4511
|
const handleAction = useCallback9(
|
|
4400
4512
|
(action) => {
|
|
4401
|
-
closeMenu(
|
|
4513
|
+
closeMenu(true);
|
|
4402
4514
|
action();
|
|
4403
4515
|
},
|
|
4404
4516
|
[closeMenu]
|
|
@@ -4453,7 +4565,7 @@ function WorkspaceSettingsButton({
|
|
|
4453
4565
|
role: "menuitem",
|
|
4454
4566
|
tabIndex: -1,
|
|
4455
4567
|
onClick: () => handleAction(onDownload),
|
|
4456
|
-
children: "
|
|
4568
|
+
children: "Back up this workspace"
|
|
4457
4569
|
}
|
|
4458
4570
|
),
|
|
4459
4571
|
/* @__PURE__ */ jsx9("div", { className: "db-ws-settings-divider" }),
|
|
@@ -4896,7 +5008,7 @@ function useDocumentSession(autoSaveDelayMs = 500) {
|
|
|
4896
5008
|
import { lazy, Suspense } from "react";
|
|
4897
5009
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
4898
5010
|
var ExportToolbarControlsImplementation = lazy(
|
|
4899
|
-
() => import("./ExportToolbarControls-
|
|
5011
|
+
() => import("./ExportToolbarControls-2FEIHNMW.js").then((module) => ({
|
|
4900
5012
|
default: module.ExportToolbarControls
|
|
4901
5013
|
}))
|
|
4902
5014
|
);
|
|
@@ -5547,14 +5659,34 @@ async function claimOutsideInTarget(provider, desiredPath) {
|
|
|
5547
5659
|
}
|
|
5548
5660
|
throw new Error(`Too many documents are already named like \u201C${desiredPath}\u201D.`);
|
|
5549
5661
|
}
|
|
5662
|
+
function directoriesUnder(files, root) {
|
|
5663
|
+
const directories = /* @__PURE__ */ new Set();
|
|
5664
|
+
for (const file of files) {
|
|
5665
|
+
if (!file.startsWith(`${root}/`)) continue;
|
|
5666
|
+
for (let dir = file.slice(0, file.lastIndexOf("/")); dir.length >= root.length; ) {
|
|
5667
|
+
directories.add(dir);
|
|
5668
|
+
const slash = dir.lastIndexOf("/");
|
|
5669
|
+
if (slash < 0) break;
|
|
5670
|
+
dir = dir.slice(0, slash);
|
|
5671
|
+
}
|
|
5672
|
+
}
|
|
5673
|
+
return [...directories].sort((a, b) => b.split("/").length - a.split("/").length);
|
|
5674
|
+
}
|
|
5675
|
+
async function removeIfEmptyDirectory(provider, path) {
|
|
5676
|
+
const providerV2 = getFileSystemProviderV27(provider);
|
|
5677
|
+
if (!providerV2) return;
|
|
5678
|
+
await providerV2.remove(parseWorkspacePath6(path), { recursive: false, missing: "ignore" }).catch(() => void 0);
|
|
5679
|
+
}
|
|
5550
5680
|
async function importOutsideInFile(file, provider) {
|
|
5551
5681
|
const claim = await claimOutsideInTarget(provider, file.name);
|
|
5552
5682
|
const created = [claim.path];
|
|
5683
|
+
const companionDirectory = resolveOutsideInLayout2(claim.path)?.companionDirectory ?? null;
|
|
5553
5684
|
try {
|
|
5554
5685
|
const sourceBytes = await file.arrayBuffer();
|
|
5555
5686
|
const layout = resolveOutsideInLayout2(claim.path);
|
|
5556
5687
|
if (!layout) throw new Error(`Outside-in editing does not support \u201C${claim.path}\u201D.`);
|
|
5557
|
-
const
|
|
5688
|
+
const conversionBytes = sourceBytes.slice(0);
|
|
5689
|
+
const imported = await (isOutsideInDataFormat(layout.format) ? importOutsideInDataSidecar({ data: conversionBytes, targetPath: claim.path }) : importOutsideInDocument({ data: conversionBytes, targetPath: claim.path }));
|
|
5558
5690
|
for (const entry of await imported.container.listFiles()) {
|
|
5559
5691
|
if (/\.md$/i.test(entry.path)) continue;
|
|
5560
5692
|
const data = await imported.container.readFile(entry.path);
|
|
@@ -5568,9 +5700,14 @@ async function importOutsideInFile(file, provider) {
|
|
|
5568
5700
|
await writeProviderBytes(provider, claim.path, sourceBytes, "upsert");
|
|
5569
5701
|
return claim;
|
|
5570
5702
|
} catch (error) {
|
|
5571
|
-
for (const path of created.reverse()) {
|
|
5703
|
+
for (const path of [...created].reverse()) {
|
|
5572
5704
|
await removeProviderEntry(provider, path).catch(() => void 0);
|
|
5573
5705
|
}
|
|
5706
|
+
if (companionDirectory) {
|
|
5707
|
+
for (const directory of directoriesUnder(created, companionDirectory)) {
|
|
5708
|
+
await removeIfEmptyDirectory(provider, directory);
|
|
5709
|
+
}
|
|
5710
|
+
}
|
|
5574
5711
|
throw error;
|
|
5575
5712
|
}
|
|
5576
5713
|
}
|
|
@@ -5762,6 +5899,8 @@ function NewDocumentDialog({
|
|
|
5762
5899
|
const inputRef = useRef15(null);
|
|
5763
5900
|
const nameId = useId4();
|
|
5764
5901
|
const formatId = useId4();
|
|
5902
|
+
const hintId = useId4();
|
|
5903
|
+
const hint = newFileFormatHint(format);
|
|
5765
5904
|
const filename = newFileName(name, format);
|
|
5766
5905
|
const cancel = useCallback15(() => onSettle(null), [onSettle]);
|
|
5767
5906
|
const submit = useCallback15(() => {
|
|
@@ -5814,16 +5953,44 @@ function NewDocumentDialog({
|
|
|
5814
5953
|
{
|
|
5815
5954
|
id: formatId,
|
|
5816
5955
|
className: "db-git-form-input",
|
|
5956
|
+
"aria-describedby": hint ? hintId : void 0,
|
|
5817
5957
|
value: format,
|
|
5818
5958
|
onChange: (e) => setFormat(e.target.value),
|
|
5819
5959
|
children: /* @__PURE__ */ jsx14(NewFileFormatOptions, {})
|
|
5820
5960
|
}
|
|
5821
|
-
)
|
|
5961
|
+
),
|
|
5962
|
+
hint && /* @__PURE__ */ jsx14("p", { id: hintId, className: "db-new-document-hint", children: hint })
|
|
5822
5963
|
] })
|
|
5823
5964
|
}
|
|
5824
5965
|
);
|
|
5825
5966
|
}
|
|
5826
5967
|
|
|
5968
|
+
// src/DocBlocksShell/EditorErrorBoundary.tsx
|
|
5969
|
+
import { Component } from "react";
|
|
5970
|
+
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
5971
|
+
var EditorErrorBoundary = class extends Component {
|
|
5972
|
+
constructor() {
|
|
5973
|
+
super(...arguments);
|
|
5974
|
+
this.state = { error: null, resetKey: this.props.resetKey };
|
|
5975
|
+
}
|
|
5976
|
+
static getDerivedStateFromError(error) {
|
|
5977
|
+
return { error };
|
|
5978
|
+
}
|
|
5979
|
+
static getDerivedStateFromProps(props, state) {
|
|
5980
|
+
return props.resetKey === state.resetKey ? null : { error: null, resetKey: props.resetKey };
|
|
5981
|
+
}
|
|
5982
|
+
render() {
|
|
5983
|
+
const { error } = this.state;
|
|
5984
|
+
if (!error) return this.props.children;
|
|
5985
|
+
return /* @__PURE__ */ jsx15("div", { className: "db-shell-empty db-shell-empty--workspace", role: "alert", children: /* @__PURE__ */ jsxs13("div", { className: "db-workspace-empty-content", children: [
|
|
5986
|
+
/* @__PURE__ */ jsx15("h1", { children: "This document couldn\u2019t be displayed" }),
|
|
5987
|
+
/* @__PURE__ */ jsx15("p", { children: "The editor ran into a problem drawing it. The document itself is unaffected." }),
|
|
5988
|
+
/* @__PURE__ */ jsx15("div", { className: "db-workspace-empty-actions", children: /* @__PURE__ */ jsx15("button", { type: "button", onClick: () => this.setState({ error: null }), children: "Try again" }) }),
|
|
5989
|
+
/* @__PURE__ */ jsx15("p", { className: "db-workspace-empty-hint", children: error.message })
|
|
5990
|
+
] }) });
|
|
5991
|
+
}
|
|
5992
|
+
};
|
|
5993
|
+
|
|
5827
5994
|
// src/preferences/new-file-format.ts
|
|
5828
5995
|
var STORAGE_KEY2 = "docblocks:lastNewFileFormat";
|
|
5829
5996
|
var MAX_REMEMBERED_WORKSPACES = 200;
|
|
@@ -5899,7 +6066,7 @@ function buildIssueReportUrl(environment) {
|
|
|
5899
6066
|
"",
|
|
5900
6067
|
"## Environment",
|
|
5901
6068
|
"",
|
|
5902
|
-
`- Date: ${environment.reportedAt
|
|
6069
|
+
`- Date: ${localDateStamp(environment.reportedAt)}`,
|
|
5903
6070
|
`- DocBlocks: ${normalizeEnvironmentValue(environment.version, "unknown", VERSION_VALUE_LIMIT)}`,
|
|
5904
6071
|
`- User agent: ${normalizeEnvironmentValue(
|
|
5905
6072
|
environment.userAgent,
|
|
@@ -6273,8 +6440,18 @@ function useKeyboardInset(enabled) {
|
|
|
6273
6440
|
}
|
|
6274
6441
|
|
|
6275
6442
|
// src/layout/useFormFactorAttributes.ts
|
|
6276
|
-
import { useEffect as useEffect23 } from "react";
|
|
6443
|
+
import { useEffect as useEffect23, useRef as useRef16 } from "react";
|
|
6277
6444
|
function useFormFactorAttributes(rootRef, formFactor, layoutMode, drawerOpen) {
|
|
6445
|
+
const published = useRef16(/* @__PURE__ */ new Map());
|
|
6446
|
+
useEffect23(() => {
|
|
6447
|
+
const owned = published.current;
|
|
6448
|
+
return () => {
|
|
6449
|
+
for (const [target, names] of owned) {
|
|
6450
|
+
for (const name of names) target.removeAttribute(name);
|
|
6451
|
+
}
|
|
6452
|
+
owned.clear();
|
|
6453
|
+
};
|
|
6454
|
+
}, []);
|
|
6278
6455
|
useEffect23(() => {
|
|
6279
6456
|
if (typeof document === "undefined") return;
|
|
6280
6457
|
const attributes = {
|
|
@@ -6286,21 +6463,17 @@ function useFormFactorAttributes(rootRef, formFactor, layoutMode, drawerOpen) {
|
|
|
6286
6463
|
const targets = [document.documentElement, rootRef.current].filter(
|
|
6287
6464
|
(node) => node !== null
|
|
6288
6465
|
);
|
|
6289
|
-
const names = Object.keys(attributes);
|
|
6290
6466
|
for (const target of targets) {
|
|
6467
|
+
const names = published.current.get(target) ?? /* @__PURE__ */ new Set();
|
|
6468
|
+
published.current.set(target, names);
|
|
6291
6469
|
for (const [name, value] of Object.entries(attributes)) {
|
|
6470
|
+
names.add(name);
|
|
6292
6471
|
if (target.getAttribute(name) !== value) target.setAttribute(name, value);
|
|
6293
6472
|
}
|
|
6294
6473
|
if (layoutMode !== "single-pane" && target.hasAttribute("data-db-drawer")) {
|
|
6295
6474
|
target.removeAttribute("data-db-drawer");
|
|
6296
6475
|
}
|
|
6297
6476
|
}
|
|
6298
|
-
return () => {
|
|
6299
|
-
for (const target of targets) {
|
|
6300
|
-
for (const name of names) target.removeAttribute(name);
|
|
6301
|
-
target.removeAttribute("data-db-drawer");
|
|
6302
|
-
}
|
|
6303
|
-
};
|
|
6304
6477
|
}, [rootRef, formFactor, layoutMode, drawerOpen]);
|
|
6305
6478
|
}
|
|
6306
6479
|
|
|
@@ -6311,11 +6484,11 @@ function useInterfaceFontAttribute(preference) {
|
|
|
6311
6484
|
useEffect24(() => {
|
|
6312
6485
|
if (typeof document === "undefined") return;
|
|
6313
6486
|
const root = document.documentElement;
|
|
6314
|
-
if (preference !== "
|
|
6487
|
+
if (preference !== "system") {
|
|
6315
6488
|
root.removeAttribute(INTERFACE_FONT_ATTRIBUTE);
|
|
6316
6489
|
return;
|
|
6317
6490
|
}
|
|
6318
|
-
root.setAttribute(INTERFACE_FONT_ATTRIBUTE, "
|
|
6491
|
+
root.setAttribute(INTERFACE_FONT_ATTRIBUTE, "system");
|
|
6319
6492
|
return () => root.removeAttribute(INTERFACE_FONT_ATTRIBUTE);
|
|
6320
6493
|
}, [preference]);
|
|
6321
6494
|
}
|
|
@@ -6482,9 +6655,9 @@ function useEditorFileDrop(targetRef, enabled, onFiles) {
|
|
|
6482
6655
|
}
|
|
6483
6656
|
|
|
6484
6657
|
// src/DocBlocksShell/useShellShortcuts.ts
|
|
6485
|
-
import { useEffect as useEffect27, useRef as
|
|
6658
|
+
import { useEffect as useEffect27, useRef as useRef17 } from "react";
|
|
6486
6659
|
function useShellShortcuts(handlers, layoutMode) {
|
|
6487
|
-
const handlersRef =
|
|
6660
|
+
const handlersRef = useRef17(handlers);
|
|
6488
6661
|
handlersRef.current = handlers;
|
|
6489
6662
|
useEffect27(() => {
|
|
6490
6663
|
if (typeof window === "undefined") return;
|
|
@@ -6504,7 +6677,7 @@ function useShellShortcuts(handlers, layoutMode) {
|
|
|
6504
6677
|
|
|
6505
6678
|
// src/DocBlocksShell/UpdateAvailableNotice.tsx
|
|
6506
6679
|
import { useState as useState21 } from "react";
|
|
6507
|
-
import { Fragment as Fragment10, jsx as
|
|
6680
|
+
import { Fragment as Fragment10, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6508
6681
|
var UPDATE_PROMPT_ID = "db-update-available-prompt";
|
|
6509
6682
|
function UpdateAvailableNotice({
|
|
6510
6683
|
available,
|
|
@@ -6516,8 +6689,8 @@ function UpdateAvailableNotice({
|
|
|
6516
6689
|
const [applying, setApplying] = useState21(false);
|
|
6517
6690
|
if (!available || !onApplyUpdate) return null;
|
|
6518
6691
|
const promptVisible = promptOpen && !blocked;
|
|
6519
|
-
return /* @__PURE__ */
|
|
6520
|
-
/* @__PURE__ */
|
|
6692
|
+
return /* @__PURE__ */ jsxs14(Fragment10, { children: [
|
|
6693
|
+
/* @__PURE__ */ jsx16(
|
|
6521
6694
|
"button",
|
|
6522
6695
|
{
|
|
6523
6696
|
type: "button",
|
|
@@ -6531,16 +6704,16 @@ function UpdateAvailableNotice({
|
|
|
6531
6704
|
children: "Update available"
|
|
6532
6705
|
}
|
|
6533
6706
|
),
|
|
6534
|
-
promptVisible && /* @__PURE__ */
|
|
6707
|
+
promptVisible && /* @__PURE__ */ jsxs14(
|
|
6535
6708
|
"div",
|
|
6536
6709
|
{
|
|
6537
6710
|
id: UPDATE_PROMPT_ID,
|
|
6538
6711
|
className: `db-update-banner${statusBarVisible ? "" : " db-update-banner--floating"}`,
|
|
6539
6712
|
role: "alert",
|
|
6540
6713
|
children: [
|
|
6541
|
-
/* @__PURE__ */
|
|
6542
|
-
/* @__PURE__ */
|
|
6543
|
-
/* @__PURE__ */
|
|
6714
|
+
/* @__PURE__ */ jsx16("span", { children: "A new version of DocBlocks is available. Reload to update the editor and site pages." }),
|
|
6715
|
+
/* @__PURE__ */ jsxs14("div", { className: "db-update-banner-actions", children: [
|
|
6716
|
+
/* @__PURE__ */ jsx16(
|
|
6544
6717
|
"button",
|
|
6545
6718
|
{
|
|
6546
6719
|
type: "button",
|
|
@@ -6552,7 +6725,7 @@ function UpdateAvailableNotice({
|
|
|
6552
6725
|
children: applying ? "Updating\u2026" : "Reload"
|
|
6553
6726
|
}
|
|
6554
6727
|
),
|
|
6555
|
-
/* @__PURE__ */
|
|
6728
|
+
/* @__PURE__ */ jsx16("button", { type: "button", onClick: () => setPromptOpen(false), disabled: applying, children: "Later" })
|
|
6556
6729
|
] })
|
|
6557
6730
|
]
|
|
6558
6731
|
}
|
|
@@ -6623,7 +6796,7 @@ function useDocumentLinkProvider(index, selectedFile, ensureIndex) {
|
|
|
6623
6796
|
}
|
|
6624
6797
|
|
|
6625
6798
|
// src/WorkspaceIndex/useWorkspaceIndex.ts
|
|
6626
|
-
import { useCallback as useCallback17, useEffect as useEffect28, useMemo as useMemo5, useRef as
|
|
6799
|
+
import { useCallback as useCallback17, useEffect as useEffect28, useMemo as useMemo5, useRef as useRef18, useState as useState22, useSyncExternalStore as useSyncExternalStore4 } from "react";
|
|
6627
6800
|
import { getFileSystemProviderV2 as getFileSystemProviderV28 } from "@bendyline/docblocks/filesystem";
|
|
6628
6801
|
import { maybeGetDocBlocksHost as maybeGetDocBlocksHost3 } from "@bendyline/docblocks/host";
|
|
6629
6802
|
var IDLE_WORKSPACE_INDEX_STATUS = Object.freeze({
|
|
@@ -6656,7 +6829,7 @@ function whenIdle(callback) {
|
|
|
6656
6829
|
function useWorkspaceIndex(provider, workspaceId, mode = "eager") {
|
|
6657
6830
|
const providerV2 = provider && mode !== "off" ? getFileSystemProviderV28(provider) : null;
|
|
6658
6831
|
const [index, setIndex] = useState22(null);
|
|
6659
|
-
const startRequestedRef =
|
|
6832
|
+
const startRequestedRef = useRef18(false);
|
|
6660
6833
|
useEffect28(() => {
|
|
6661
6834
|
setIndex(null);
|
|
6662
6835
|
startRequestedRef.current = false;
|
|
@@ -6960,7 +7133,7 @@ var WELCOME_DOCUMENT_CONTENT = [
|
|
|
6960
7133
|
"",
|
|
6961
7134
|
'## Choose your DocBlocks app {[twoColumn header="The same Markdown, wherever you work" left="Web|Start in a browser, with no account. Install the web app when your browser offers it." right="Desktop|Download for macOS (Apple silicon), Windows, or Linux. Work directly in your folders."]}',
|
|
6962
7135
|
"",
|
|
6963
|
-
"Choose the **Web app**
|
|
7136
|
+
"Choose the **Web app** to start writing in your browser, or **Desktop** for everyday work in local folders on macOS (Apple silicon), Windows, and Linux. Use **VS Code** for documents beside your code, and the **CLI and MCP server** for automation. The links at the end of this guide lead to downloads and setup instructions.",
|
|
6964
7137
|
"",
|
|
6965
7138
|
"## Get started on desktop {[list]}",
|
|
6966
7139
|
"",
|
|
@@ -6974,11 +7147,11 @@ var WELCOME_DOCUMENT_CONTENT = [
|
|
|
6974
7147
|
"- Open DocBlocks in your browser and start in a browser workspace. In supported browsers, you can also open a local folder.",
|
|
6975
7148
|
"- Choose **Install DocBlocks\u2026** in the app menu when offered. The installed web app keeps using the same browser storage.",
|
|
6976
7149
|
"- Once the app has finished downloading for offline use, you can keep editing without a connection.",
|
|
6977
|
-
"- Use **
|
|
7150
|
+
"- Use **Back up all workspaces** in the app menu to keep a backup before clearing browser data or moving to a new device.",
|
|
6978
7151
|
"",
|
|
6979
7152
|
"## Work inside VS Code {[content]}",
|
|
6980
7153
|
"",
|
|
6981
|
-
"Install the DocBlocks extension, then open a `.md` file in your project. If it opens as plain text, right-click it and choose **Open in DocBlocks**. VS Code supplies the file explorer, tabs, saving, and source control; DocBlocks supplies the visual editor, Markdown source, previews, and export.
|
|
7154
|
+
"Install the DocBlocks extension, then open a `.md` file in your project. If it opens as plain text, right-click it and choose **Open in DocBlocks**. VS Code supplies the file explorer, tabs, saving, and source control; DocBlocks supplies the visual editor, Markdown source, previews, and export. Follow the extension guide below to get started.",
|
|
6982
7155
|
"",
|
|
6983
7156
|
"## On a phone or tablet {[content]}",
|
|
6984
7157
|
"",
|
|
@@ -6986,7 +7159,7 @@ var WELCOME_DOCUMENT_CONTENT = [
|
|
|
6986
7159
|
"",
|
|
6987
7160
|
'## Automate with the CLI and MCP {[twoColumn header="For repeatable document work" left="CLI|Install @bendyline/docblocks-cli with npm, then run docblocks --help. Build, preview, and convert files from your terminal." right="MCP|Connect the local server to an agent. Convert and preview documents, then deliberately save the resulting artifacts."]}',
|
|
6988
7161
|
"",
|
|
6989
|
-
"With a supported Node.js
|
|
7162
|
+
"With a supported version of `Node.js` installed, run `npm install -g @bendyline/docblocks-cli`, then `docblocks --help`. The CLI builds, previews, and converts files from your terminal. Its local MCP server gives agents document tools with explicitly allowed file access. Follow the CLI and MCP guide below for requirements and configuration.",
|
|
6990
7163
|
"",
|
|
6991
7164
|
"## One source, four ways to publish {[diagram]}",
|
|
6992
7165
|
"",
|
|
@@ -7030,7 +7203,7 @@ var WELCOME_DOCUMENT_CONTENT = [
|
|
|
7030
7203
|
"",
|
|
7031
7204
|
"## Export without rebuilding the document {[list]}",
|
|
7032
7205
|
"",
|
|
7033
|
-
"- Create **Word documents and PDFs** for review, printing, and fixed
|
|
7206
|
+
"- Create **Word documents and PDFs** for review, printing, and sharing with a fixed page layout.",
|
|
7034
7207
|
"- Create **PowerPoint decks** from the same annotated sections you preview as a slideshow.",
|
|
7035
7208
|
"- Publish **HTML pages, packaged HTML, and EPUB e-books**.",
|
|
7036
7209
|
"- Keep portable **Markdown or DBK bundles** with their media assets.",
|
|
@@ -7063,7 +7236,7 @@ var WELCOME_DOCUMENT_CONTENT = [
|
|
|
7063
7236
|
].join("\n");
|
|
7064
7237
|
|
|
7065
7238
|
// src/DocBlocksShell/DocBlocksShell.tsx
|
|
7066
|
-
import { Fragment as Fragment11, jsx as
|
|
7239
|
+
import { Fragment as Fragment11, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
7067
7240
|
var editorShellModulePromise = null;
|
|
7068
7241
|
function loadEditorShell() {
|
|
7069
7242
|
editorShellModulePromise ?? (editorShellModulePromise = (async () => {
|
|
@@ -7076,12 +7249,15 @@ function loadEditorShell() {
|
|
|
7076
7249
|
}
|
|
7077
7250
|
var EditorShell = lazy2(loadEditorShell);
|
|
7078
7251
|
var DocumentConflictDialog = lazy2(() => import("./DocumentConflictDialog-5LRVIGXS.js"));
|
|
7079
|
-
var GitUI = lazy2(() => import("./GitUI-
|
|
7252
|
+
var GitUI = lazy2(() => import("./GitUI-RCWUZVS6.js").then((m) => ({ default: m.GitUI })));
|
|
7080
7253
|
var QuickOpenDialog = lazy2(
|
|
7081
7254
|
() => import("./QuickOpenDialog-2KK4SEBU.js").then((m) => ({ default: m.QuickOpenDialog }))
|
|
7082
7255
|
);
|
|
7256
|
+
var KeyboardShortcutsDialog = lazy2(
|
|
7257
|
+
() => import("./KeyboardShortcutsDialog-NOD4P25G.js").then((m) => ({ default: m.KeyboardShortcutsDialog }))
|
|
7258
|
+
);
|
|
7083
7259
|
var WorkspaceSearchPanel = lazy2(
|
|
7084
|
-
() => import("./WorkspaceSearchPanel-
|
|
7260
|
+
() => import("./WorkspaceSearchPanel-J6BKEZQJ.js").then((m) => ({
|
|
7085
7261
|
default: m.WorkspaceSearchPanel
|
|
7086
7262
|
}))
|
|
7087
7263
|
);
|
|
@@ -7089,46 +7265,47 @@ var GitGrantNotice = lazy2(
|
|
|
7089
7265
|
() => import("./GitGrantNotice-I2VNKPLH.js").then((m) => ({ default: m.GitGrantNotice }))
|
|
7090
7266
|
);
|
|
7091
7267
|
var GitToolbarControl = lazy2(
|
|
7092
|
-
() => import("./GitToolbarControl-
|
|
7268
|
+
() => import("./GitToolbarControl-B7KG4MFP.js").then((m) => ({ default: m.GitToolbarControl }))
|
|
7093
7269
|
);
|
|
7094
7270
|
var AiToolbarControl = lazy2(
|
|
7095
|
-
() => import("./AiEditorAssistant-
|
|
7271
|
+
() => import("./AiEditorAssistant-GN2KXKZD.js").then((module) => ({
|
|
7096
7272
|
default: module.AiToolbarControl
|
|
7097
7273
|
}))
|
|
7098
7274
|
);
|
|
7099
7275
|
var PresentationMaker = lazy2(
|
|
7100
|
-
() => import("./PresentationMaker-
|
|
7276
|
+
() => import("./PresentationMaker-ITNP5SDO.js").then((module) => ({
|
|
7101
7277
|
default: module.PresentationMaker
|
|
7102
7278
|
}))
|
|
7103
7279
|
);
|
|
7104
7280
|
var AiReviewPanel = lazy2(
|
|
7105
|
-
() => import("./AiEditorAssistant-
|
|
7281
|
+
() => import("./AiEditorAssistant-GN2KXKZD.js").then((module) => ({
|
|
7106
7282
|
default: module.AiReviewPanel
|
|
7107
7283
|
}))
|
|
7108
7284
|
);
|
|
7109
7285
|
var AiIllustratePanel = lazy2(
|
|
7110
|
-
() => import("./AiDiagrams-
|
|
7286
|
+
() => import("./AiDiagrams-LFV4YU6W.js").then((module) => ({
|
|
7111
7287
|
default: module.AiIllustratePanel
|
|
7112
7288
|
}))
|
|
7113
7289
|
);
|
|
7114
7290
|
var TextFromNarration = lazy2(
|
|
7115
|
-
() => import("./TextFromNarration-
|
|
7291
|
+
() => import("./TextFromNarration-NITJQ4IB.js").then((module) => ({
|
|
7116
7292
|
default: module.TextFromNarration
|
|
7117
7293
|
}))
|
|
7118
7294
|
);
|
|
7119
7295
|
var SpeechToolbarControl = lazy2(
|
|
7120
|
-
() => import("./SpeechToolbarControl-
|
|
7296
|
+
() => import("./SpeechToolbarControl-CLU7RB2G.js").then((module) => ({
|
|
7121
7297
|
default: module.SpeechToolbarControl
|
|
7122
7298
|
}))
|
|
7123
7299
|
);
|
|
7124
7300
|
var SpeechMenuBridge = lazy2(
|
|
7125
|
-
() => import("./SpeechToolbarControl-
|
|
7301
|
+
() => import("./SpeechToolbarControl-CLU7RB2G.js").then((module) => ({
|
|
7126
7302
|
default: module.SpeechMenuBridge
|
|
7127
7303
|
}))
|
|
7128
7304
|
);
|
|
7129
7305
|
var DOCBLOCKS_VIDEO_EXPORT_PALETTE = Object.freeze({
|
|
7130
7306
|
overlay: "rgba(0, 0, 0, 0.72)",
|
|
7131
|
-
|
|
7307
|
+
// A dialog floats over the chrome, so it takes the raised surface.
|
|
7308
|
+
surface: "var(--db-bg-raised)",
|
|
7132
7309
|
control: "var(--db-bg-subtle)",
|
|
7133
7310
|
border: "var(--db-border-strong)",
|
|
7134
7311
|
text: "var(--db-text)",
|
|
@@ -7388,7 +7565,7 @@ async function createHostProviderFromWorkspace(ws) {
|
|
|
7388
7565
|
var DESKTOP_TOOLBAR_WRAP_WIDTH = 900;
|
|
7389
7566
|
var WEB_TOOLBAR_WRAP_WIDTH = 700;
|
|
7390
7567
|
function FolderGlyph() {
|
|
7391
|
-
return /* @__PURE__ */
|
|
7568
|
+
return /* @__PURE__ */ jsx17(
|
|
7392
7569
|
"svg",
|
|
7393
7570
|
{
|
|
7394
7571
|
viewBox: "0 0 24 24",
|
|
@@ -7397,12 +7574,12 @@ function FolderGlyph() {
|
|
|
7397
7574
|
strokeWidth: "1.5",
|
|
7398
7575
|
strokeLinejoin: "round",
|
|
7399
7576
|
"aria-hidden": "true",
|
|
7400
|
-
children: /* @__PURE__ */
|
|
7577
|
+
children: /* @__PURE__ */ jsx17("path", { d: "M3 7a1 1 0 0 1 1-1h5l2 2h9a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7z" })
|
|
7401
7578
|
}
|
|
7402
7579
|
);
|
|
7403
7580
|
}
|
|
7404
7581
|
function FileGlyph() {
|
|
7405
|
-
return /* @__PURE__ */
|
|
7582
|
+
return /* @__PURE__ */ jsxs15(
|
|
7406
7583
|
"svg",
|
|
7407
7584
|
{
|
|
7408
7585
|
viewBox: "0 0 24 24",
|
|
@@ -7412,14 +7589,14 @@ function FileGlyph() {
|
|
|
7412
7589
|
strokeLinejoin: "round",
|
|
7413
7590
|
"aria-hidden": "true",
|
|
7414
7591
|
children: [
|
|
7415
|
-
/* @__PURE__ */
|
|
7416
|
-
/* @__PURE__ */
|
|
7592
|
+
/* @__PURE__ */ jsx17("path", { d: "M6 3h8l5 5v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z" }),
|
|
7593
|
+
/* @__PURE__ */ jsx17("path", { d: "M14 3v5h5" })
|
|
7417
7594
|
]
|
|
7418
7595
|
}
|
|
7419
7596
|
);
|
|
7420
7597
|
}
|
|
7421
7598
|
function CollapseSidebarGlyph() {
|
|
7422
|
-
return /* @__PURE__ */
|
|
7599
|
+
return /* @__PURE__ */ jsxs15(
|
|
7423
7600
|
"svg",
|
|
7424
7601
|
{
|
|
7425
7602
|
viewBox: "0 0 64 64",
|
|
@@ -7430,9 +7607,9 @@ function CollapseSidebarGlyph() {
|
|
|
7430
7607
|
strokeLinejoin: "round",
|
|
7431
7608
|
"aria-hidden": "true",
|
|
7432
7609
|
children: [
|
|
7433
|
-
/* @__PURE__ */
|
|
7434
|
-
/* @__PURE__ */
|
|
7435
|
-
/* @__PURE__ */
|
|
7610
|
+
/* @__PURE__ */ jsx17("rect", { x: "7", y: "10", width: "50", height: "44", rx: "6" }),
|
|
7611
|
+
/* @__PURE__ */ jsx17("path", { d: "M24 10v44" }),
|
|
7612
|
+
/* @__PURE__ */ jsx17("path", { d: "m17 25-7 7 7 7" })
|
|
7436
7613
|
]
|
|
7437
7614
|
}
|
|
7438
7615
|
);
|
|
@@ -7440,9 +7617,11 @@ function CollapseSidebarGlyph() {
|
|
|
7440
7617
|
function DocBlocksShell({
|
|
7441
7618
|
theme: hostTheme = "auto",
|
|
7442
7619
|
logoUrl,
|
|
7620
|
+
logoDarkUrl,
|
|
7443
7621
|
issueReportVersion,
|
|
7444
7622
|
appBuildDate,
|
|
7445
7623
|
ffmpegWasm,
|
|
7624
|
+
pdfWorkerSrc: pdfWorkerSrc2,
|
|
7446
7625
|
calcEngineFactory,
|
|
7447
7626
|
proofing,
|
|
7448
7627
|
proofingDefaultEnabled,
|
|
@@ -7519,7 +7698,7 @@ function DocBlocksShell({
|
|
|
7519
7698
|
setViewPreferences(prefs);
|
|
7520
7699
|
saveViewPreferences(prefs);
|
|
7521
7700
|
}, []);
|
|
7522
|
-
const shellRef =
|
|
7701
|
+
const shellRef = useRef19(null);
|
|
7523
7702
|
const formFactor = useFormFactor(shellRef);
|
|
7524
7703
|
const [sidebarPreference, setSidebarPreference] = useState23(loadSidebarPreference);
|
|
7525
7704
|
const layoutMode = resolveLayoutMode(formFactor, sidebarPreference);
|
|
@@ -7541,7 +7720,7 @@ function DocBlocksShell({
|
|
|
7541
7720
|
const drawerOpen = singlePane && !mobileShowEditor;
|
|
7542
7721
|
const [sidebarWidth, setSidebarWidth] = useState23(loadSidebarWidth);
|
|
7543
7722
|
const canRestoreSplitView = sidebarPreference === "collapsed" && formFactor.splitPaneAllowed;
|
|
7544
|
-
const editorAreaRef =
|
|
7723
|
+
const editorAreaRef = useRef19(null);
|
|
7545
7724
|
const [desktopToolbarWrapped, setDesktopToolbarWrapped] = useState23(false);
|
|
7546
7725
|
useEffect29(() => {
|
|
7547
7726
|
const editorArea = editorAreaRef.current;
|
|
@@ -7572,7 +7751,7 @@ function DocBlocksShell({
|
|
|
7572
7751
|
});
|
|
7573
7752
|
const [browserStoragePersistent, setBrowserStoragePersistent] = useState23(false);
|
|
7574
7753
|
const [saveToast, setSaveToast] = useState23(null);
|
|
7575
|
-
const saveToastTimerRef =
|
|
7754
|
+
const saveToastTimerRef = useRef19(null);
|
|
7576
7755
|
const showToast = useCallback18((kind, message) => {
|
|
7577
7756
|
setSaveToast({ kind, message });
|
|
7578
7757
|
if (saveToastTimerRef.current) clearTimeout(saveToastTimerRef.current);
|
|
@@ -7593,8 +7772,8 @@ function DocBlocksShell({
|
|
|
7593
7772
|
const [installPromptEvent, setInstallPromptEvent] = useState23(
|
|
7594
7773
|
null
|
|
7595
7774
|
);
|
|
7596
|
-
const panesRef =
|
|
7597
|
-
const sidebarRef =
|
|
7775
|
+
const panesRef = useRef19(null);
|
|
7776
|
+
const sidebarRef = useRef19(null);
|
|
7598
7777
|
useInert(sidebarRef, singlePane && !drawerOpen);
|
|
7599
7778
|
useInert(editorAreaRef, drawerOpen);
|
|
7600
7779
|
const openDrawer = useCallback18(() => setMobileShowEditor(false), []);
|
|
@@ -7607,7 +7786,7 @@ function DocBlocksShell({
|
|
|
7607
7786
|
onOpen: openDrawer,
|
|
7608
7787
|
onClose: closeDrawer
|
|
7609
7788
|
});
|
|
7610
|
-
const dragStateRef =
|
|
7789
|
+
const dragStateRef = useRef19(null);
|
|
7611
7790
|
const handleResizerPointerDown = useCallback18(
|
|
7612
7791
|
(e) => {
|
|
7613
7792
|
if (e.button !== 0) return;
|
|
@@ -7811,19 +7990,19 @@ function DocBlocksShell({
|
|
|
7811
7990
|
};
|
|
7812
7991
|
}, [activeWorkspaceDescriptor]);
|
|
7813
7992
|
const nativeWorkspaceId = provider && activeWorkspaceDescriptor?.id === activeWorkspaceId && provider.id === activeWorkspaceId && activeWorkspaceDescriptor.type === "host-native" ? activeWorkspaceDescriptor.id : null;
|
|
7814
|
-
const workingTreeChangedRef =
|
|
7993
|
+
const workingTreeChangedRef = useRef19(() => void 0);
|
|
7815
7994
|
const handleWorkingTreeChanged = useCallback18(() => workingTreeChangedRef.current(), []);
|
|
7816
7995
|
const git = useGit(provider, nativeWorkspaceId, resolvedTheme, handleWorkingTreeChanged);
|
|
7817
|
-
const gitRef =
|
|
7996
|
+
const gitRef = useRef19(git);
|
|
7818
7997
|
gitRef.current = git;
|
|
7819
7998
|
const { scheduleRefresh: gitScheduleRefresh } = git;
|
|
7820
7999
|
const workspaceSettingsEnabled = provider !== null && provider.id === activeWorkspaceId && getTransientWorkspace(provider.id) === null;
|
|
7821
8000
|
const workspaceSettings = useWorkspaceSettings(provider, workspaceSettingsEnabled);
|
|
7822
8001
|
const { refresh: refreshWorkspaceSettings, save: saveWorkspaceSettings } = workspaceSettings;
|
|
7823
8002
|
const workspaceDefaultThemeId = resolveWorkspaceDefaultThemeId(workspaceSettings.settings);
|
|
7824
|
-
const workspaceDefaultThemeRef =
|
|
8003
|
+
const workspaceDefaultThemeRef = useRef19(workspaceDefaultThemeId);
|
|
7825
8004
|
workspaceDefaultThemeRef.current = workspaceDefaultThemeId;
|
|
7826
|
-
const outsideInRenderRef =
|
|
8005
|
+
const outsideInRenderRef = useRef19({
|
|
7827
8006
|
defaultThemeId: () => workspaceDefaultThemeRef.current
|
|
7828
8007
|
});
|
|
7829
8008
|
const workspaceOutputs = useWorkspaceOutputs(
|
|
@@ -7832,10 +8011,10 @@ function DocBlocksShell({
|
|
|
7832
8011
|
workspaceSettings.settings,
|
|
7833
8012
|
workspaceSettingsEnabled
|
|
7834
8013
|
);
|
|
7835
|
-
const workspaceOutputsSchedulerRef =
|
|
8014
|
+
const workspaceOutputsSchedulerRef = useRef19(workspaceOutputs.scheduler);
|
|
7836
8015
|
workspaceOutputsSchedulerRef.current = workspaceOutputs.scheduler;
|
|
7837
8016
|
const workspaceIndex = useWorkspaceIndex(provider, activeWorkspaceId, workspaceIndexMode);
|
|
7838
|
-
const workspaceIndexRef =
|
|
8017
|
+
const workspaceIndexRef = useRef19(workspaceIndex.index);
|
|
7839
8018
|
workspaceIndexRef.current = workspaceIndex.index;
|
|
7840
8019
|
const notifyWorkspaceChanged = useCallback18(
|
|
7841
8020
|
(workspaceId, path) => {
|
|
@@ -7897,7 +8076,7 @@ function DocBlocksShell({
|
|
|
7897
8076
|
const [selectedImage, setSelectedImage] = useState23(void 0);
|
|
7898
8077
|
const [selectedManagedOutput, setSelectedManagedOutput] = useState23(void 0);
|
|
7899
8078
|
const [findMode, setFindMode] = useState23(false);
|
|
7900
|
-
const findModeRef =
|
|
8079
|
+
const findModeRef = useRef19(findMode);
|
|
7901
8080
|
findModeRef.current = findMode;
|
|
7902
8081
|
useEffect29(() => {
|
|
7903
8082
|
setFindMode(false);
|
|
@@ -7912,6 +8091,8 @@ function DocBlocksShell({
|
|
|
7912
8091
|
const findShortcut = useMemo6(findShortcutLabel, []);
|
|
7913
8092
|
const searchShortcut = useMemo6(() => shortcutLabel("workspace-search", isApplePlatform()), []);
|
|
7914
8093
|
const [quickOpenOpen, setQuickOpenOpen] = useState23(false);
|
|
8094
|
+
const [shortcutsOpen, setShortcutsOpen] = useState23(false);
|
|
8095
|
+
const openKeyboardShortcuts = useCallback18(() => setShortcutsOpen(true), []);
|
|
7915
8096
|
const [quickOpenFocusRequest, setQuickOpenFocusRequest] = useState23(0);
|
|
7916
8097
|
const [sidebarView, setSidebarView] = useState23("files");
|
|
7917
8098
|
const [searchMounted, setSearchMounted] = useState23(false);
|
|
@@ -8014,7 +8195,20 @@ function DocBlocksShell({
|
|
|
8014
8195
|
[documentSnapshot.frozen, documentSnapshot.generation, documentSnapshot.targetKey]
|
|
8015
8196
|
);
|
|
8016
8197
|
const [editorPresentationEpoch, setEditorPresentationEpoch] = useState23(0);
|
|
8017
|
-
const
|
|
8198
|
+
const [editorGeneration, setEditorGeneration] = useState23(documentSnapshot.generation);
|
|
8199
|
+
useEffect29(() => {
|
|
8200
|
+
const sync = () => setEditorGeneration(documentSession.getSnapshot().generation);
|
|
8201
|
+
const unsubscribe = documentSession.subscribe(sync);
|
|
8202
|
+
sync();
|
|
8203
|
+
return () => {
|
|
8204
|
+
unsubscribe();
|
|
8205
|
+
};
|
|
8206
|
+
}, [documentSession]);
|
|
8207
|
+
const editorGenerationSettled = editorGeneration === documentSnapshot.generation;
|
|
8208
|
+
useEffect29(() => {
|
|
8209
|
+
setOutsideInPdfWorker(pdfWorkerSrc2);
|
|
8210
|
+
}, [pdfWorkerSrc2]);
|
|
8211
|
+
const editorKey = `${editorGeneration}:${editorPresentationEpoch}`;
|
|
8018
8212
|
const editorPlaceholder = useMemo6(() => {
|
|
8019
8213
|
void editorKey;
|
|
8020
8214
|
return pickEmptyDocumentPrompt();
|
|
@@ -8035,10 +8229,10 @@ function DocBlocksShell({
|
|
|
8035
8229
|
const [initialSharedMode, setInitialSharedMode] = useState23(null);
|
|
8036
8230
|
const [showWelcomeGateway, setShowWelcomeGateway] = useState23(false);
|
|
8037
8231
|
const [aiPanel, setAiPanel] = useState23(null);
|
|
8038
|
-
const navigationRequestRef =
|
|
8232
|
+
const navigationRequestRef = useRef19(0);
|
|
8039
8233
|
const workspaceAuthorityBarrier = useMemo6(() => new WorkspaceAuthorityBarrier(), []);
|
|
8040
|
-
const preparedCloseRequestRef =
|
|
8041
|
-
const pendingDbkConflictsRef =
|
|
8234
|
+
const preparedCloseRequestRef = useRef19(null);
|
|
8235
|
+
const pendingDbkConflictsRef = useRef19(/* @__PURE__ */ new Map());
|
|
8042
8236
|
const afterWorkspaceCommit = useCallback18(
|
|
8043
8237
|
(workspaceId, path) => {
|
|
8044
8238
|
gitScheduleRefresh();
|
|
@@ -8222,10 +8416,12 @@ function DocBlocksShell({
|
|
|
8222
8416
|
},
|
|
8223
8417
|
[afterWorkspaceCommit, gitScheduleRefresh]
|
|
8224
8418
|
);
|
|
8225
|
-
const mediaContainerRef =
|
|
8419
|
+
const mediaContainerRef = useRef19(null);
|
|
8226
8420
|
const [mediaProvider, setMediaProvider] = useState23(null);
|
|
8421
|
+
const [mediaProviderScope, setMediaProviderScope] = useState23(null);
|
|
8422
|
+
const mediaProviderCurrent = mediaProviderScope !== null && mediaProviderScope.provider === provider && mediaProviderScope.file === selectedFile && mediaProviderScope.outsideIn === selectedOutsideIn;
|
|
8227
8423
|
const [mediaEpoch, setMediaEpoch] = useState23(0);
|
|
8228
|
-
const versionsContainerRef =
|
|
8424
|
+
const versionsContainerRef = useRef19(null);
|
|
8229
8425
|
const [versionsContainer, setVersionsContainer] = useState23(null);
|
|
8230
8426
|
const pushHash = useCallback18((wsId, filePath) => {
|
|
8231
8427
|
const hash = buildHash(wsId, filePath);
|
|
@@ -8433,11 +8629,11 @@ function DocBlocksShell({
|
|
|
8433
8629
|
},
|
|
8434
8630
|
[adoptRegularDocument, createDocumentTarget, documentSession, pushHash]
|
|
8435
8631
|
);
|
|
8436
|
-
const startupOpenFromIdsRef =
|
|
8632
|
+
const startupOpenFromIdsRef = useRef19(openFromIds);
|
|
8437
8633
|
startupOpenFromIdsRef.current = openFromIds;
|
|
8438
|
-
const startupOpenSharedDocumentRef =
|
|
8634
|
+
const startupOpenSharedDocumentRef = useRef19(openSharedDocument);
|
|
8439
8635
|
startupOpenSharedDocumentRef.current = openSharedDocument;
|
|
8440
|
-
const startupSeedWelcomeFileRef =
|
|
8636
|
+
const startupSeedWelcomeFileRef = useRef19(seedWelcomeFile);
|
|
8441
8637
|
startupSeedWelcomeFileRef.current = seedWelcomeFile;
|
|
8442
8638
|
const closeWelcomeGateway = useCallback18(() => {
|
|
8443
8639
|
setShowWelcomeGateway((showing) => {
|
|
@@ -8789,7 +8985,7 @@ function DocBlocksShell({
|
|
|
8789
8985
|
};
|
|
8790
8986
|
}, []);
|
|
8791
8987
|
const [offlineReadyToast, setOfflineReadyToast] = useState23(false);
|
|
8792
|
-
const offlineReadyAnnouncedRef =
|
|
8988
|
+
const offlineReadyAnnouncedRef = useRef19(false);
|
|
8793
8989
|
useEffect29(() => {
|
|
8794
8990
|
if (!offlineReady || offlineReadyAnnouncedRef.current) return;
|
|
8795
8991
|
offlineReadyAnnouncedRef.current = true;
|
|
@@ -8805,7 +9001,7 @@ function DocBlocksShell({
|
|
|
8805
9001
|
setStorageFull(false);
|
|
8806
9002
|
}
|
|
8807
9003
|
}, [documentSnapshot.error, documentSnapshot.status]);
|
|
8808
|
-
const autoPersistRequestedRef =
|
|
9004
|
+
const autoPersistRequestedRef = useRef19(false);
|
|
8809
9005
|
useEffect29(() => {
|
|
8810
9006
|
if (!showBrowserStorageWarning || browserStoragePersistent) return;
|
|
8811
9007
|
if (autoPersistRequestedRef.current) return;
|
|
@@ -8818,14 +9014,16 @@ function DocBlocksShell({
|
|
|
8818
9014
|
}).catch(() => {
|
|
8819
9015
|
});
|
|
8820
9016
|
}, [showBrowserStorageWarning, browserStoragePersistent, documentSnapshot.status]);
|
|
8821
|
-
|
|
9017
|
+
useLayoutEffect4(() => {
|
|
8822
9018
|
if (!provider || !selectedFile) {
|
|
8823
9019
|
mediaContainerRef.current = null;
|
|
8824
9020
|
versionsContainerRef.current = null;
|
|
8825
9021
|
setMediaProvider(null);
|
|
9022
|
+
setMediaProviderScope(null);
|
|
8826
9023
|
setVersionsContainer(null);
|
|
8827
9024
|
return;
|
|
8828
9025
|
}
|
|
9026
|
+
setMediaProviderScope({ provider, file: selectedFile, outsideIn: selectedOutsideIn });
|
|
8829
9027
|
if (selectedOutsideIn) {
|
|
8830
9028
|
const container2 = createOutsideInContentContainer(provider, selectedOutsideIn);
|
|
8831
9029
|
const mp2 = createMediaProviderFromContainer(container2);
|
|
@@ -9656,7 +9854,7 @@ function DocBlocksShell({
|
|
|
9656
9854
|
singlePane
|
|
9657
9855
|
]);
|
|
9658
9856
|
const canFind = selectedFile !== null && mediaProvider !== null && selectedManagedOutput !== "catalog-html" && selectedImage === void 0;
|
|
9659
|
-
const canFindRef =
|
|
9857
|
+
const canFindRef = useRef19(canFind);
|
|
9660
9858
|
canFindRef.current = canFind;
|
|
9661
9859
|
const { ensure: ensureWorkspaceIndex } = workspaceIndex;
|
|
9662
9860
|
const openQuickOpen = useCallback18(() => {
|
|
@@ -9682,6 +9880,7 @@ function DocBlocksShell({
|
|
|
9682
9880
|
...canBrowseWorkspace ? { "quick-open": openQuickOpen, "workspace-search": openWorkspaceSearch } : {},
|
|
9683
9881
|
"new-document": () => void handleNewFile(),
|
|
9684
9882
|
"new-folder": () => void handleNewFolder(),
|
|
9883
|
+
shortcuts: openKeyboardShortcuts,
|
|
9685
9884
|
"toggle-sidebar": () => {
|
|
9686
9885
|
if (singlePane) {
|
|
9687
9886
|
setMobileShowEditor((showingEditor) => !showingEditor);
|
|
@@ -9717,6 +9916,7 @@ function DocBlocksShell({
|
|
|
9717
9916
|
saveActiveDocument,
|
|
9718
9917
|
handleNewFile,
|
|
9719
9918
|
handleNewFolder,
|
|
9919
|
+
openKeyboardShortcuts,
|
|
9720
9920
|
singlePane,
|
|
9721
9921
|
mobileShowEditor,
|
|
9722
9922
|
sidebarPreference,
|
|
@@ -9746,7 +9946,7 @@ function DocBlocksShell({
|
|
|
9746
9946
|
}),
|
|
9747
9947
|
[singlePane, mobileShowEditor]
|
|
9748
9948
|
);
|
|
9749
|
-
const actionNewHandledRef =
|
|
9949
|
+
const actionNewHandledRef = useRef19(false);
|
|
9750
9950
|
useEffect29(() => {
|
|
9751
9951
|
if (!provider || actionNewHandledRef.current) return;
|
|
9752
9952
|
if (typeof window === "undefined") return;
|
|
@@ -10753,8 +10953,7 @@ function DocBlocksShell({
|
|
|
10753
10953
|
const url = URL.createObjectURL(blob);
|
|
10754
10954
|
const a = document.createElement("a");
|
|
10755
10955
|
a.href = url;
|
|
10756
|
-
|
|
10757
|
-
a.download = `docblocks-workspaces-${stamp}.zip`;
|
|
10956
|
+
a.download = `docblocks-workspaces-${localDateStamp(/* @__PURE__ */ new Date())}.zip`;
|
|
10758
10957
|
a.click();
|
|
10759
10958
|
URL.revokeObjectURL(url);
|
|
10760
10959
|
if (skipped.length > 0) {
|
|
@@ -10774,7 +10973,7 @@ function DocBlocksShell({
|
|
|
10774
10973
|
if (!storage || typeof storage.persist !== "function") {
|
|
10775
10974
|
await acknowledge({
|
|
10776
10975
|
title: "Persistent storage unavailable",
|
|
10777
|
-
message: "This browser does not support persistent storage requests.
|
|
10976
|
+
message: "This browser does not support persistent storage requests. Use Back up all workspaces regularly."
|
|
10778
10977
|
});
|
|
10779
10978
|
return;
|
|
10780
10979
|
}
|
|
@@ -10790,18 +10989,18 @@ function DocBlocksShell({
|
|
|
10790
10989
|
setBrowserStoragePersistent(true);
|
|
10791
10990
|
await acknowledge({
|
|
10792
10991
|
title: "Storage will be kept for longer",
|
|
10793
|
-
message: "This browser will try to keep DocBlocks data for longer.
|
|
10992
|
+
message: "This browser will try to keep DocBlocks data for longer. Keep using Back up all workspaces regularly."
|
|
10794
10993
|
});
|
|
10795
10994
|
} else {
|
|
10796
10995
|
await acknowledge({
|
|
10797
10996
|
title: "Storage request declined",
|
|
10798
|
-
message: "The browser did not grant permanent storage for DocBlocks. Please try again in a day or two. Meanwhile,
|
|
10997
|
+
message: "The browser did not grant permanent storage for DocBlocks. Please try again in a day or two. Meanwhile, use Back up all workspaces regularly."
|
|
10799
10998
|
});
|
|
10800
10999
|
}
|
|
10801
11000
|
} catch {
|
|
10802
11001
|
await acknowledge({
|
|
10803
11002
|
title: "Storage request failed",
|
|
10804
|
-
message: "DocBlocks could not request persistent browser storage.
|
|
11003
|
+
message: "DocBlocks could not request persistent browser storage. Use Back up all workspaces regularly."
|
|
10805
11004
|
});
|
|
10806
11005
|
}
|
|
10807
11006
|
}, [acknowledge, showToast]);
|
|
@@ -10911,7 +11110,7 @@ function DocBlocksShell({
|
|
|
10911
11110
|
transitionAwayFromDocument
|
|
10912
11111
|
]
|
|
10913
11112
|
);
|
|
10914
|
-
return /* @__PURE__ */
|
|
11113
|
+
return /* @__PURE__ */ jsx17(
|
|
10915
11114
|
"div",
|
|
10916
11115
|
{
|
|
10917
11116
|
ref: shellRef,
|
|
@@ -10920,10 +11119,10 @@ function DocBlocksShell({
|
|
|
10920
11119
|
"data-accent": accentColor,
|
|
10921
11120
|
"data-interface-font": interfaceFont === "fixed" ? "fixed" : void 0,
|
|
10922
11121
|
"data-document-status": documentSnapshot.status,
|
|
10923
|
-
children: /* @__PURE__ */
|
|
11122
|
+
children: /* @__PURE__ */ jsxs15(GitContext.Provider, { value: git, children: [
|
|
10924
11123
|
promptDialog,
|
|
10925
11124
|
confirmDialog,
|
|
10926
|
-
quickOpenOpen && activeWorkspaceId && /* @__PURE__ */
|
|
11125
|
+
quickOpenOpen && activeWorkspaceId && /* @__PURE__ */ jsx17(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx17(
|
|
10927
11126
|
QuickOpenDialog,
|
|
10928
11127
|
{
|
|
10929
11128
|
index: workspaceIndex.index,
|
|
@@ -10937,7 +11136,8 @@ function DocBlocksShell({
|
|
|
10937
11136
|
onClose: () => setQuickOpenOpen(false)
|
|
10938
11137
|
}
|
|
10939
11138
|
) }),
|
|
10940
|
-
|
|
11139
|
+
shortcutsOpen && /* @__PURE__ */ jsx17(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx17(KeyboardShortcutsDialog, { onClose: () => setShortcutsOpen(false) }) }),
|
|
11140
|
+
newDocumentDialogOpen && /* @__PURE__ */ jsx17(
|
|
10941
11141
|
NewDocumentDialog,
|
|
10942
11142
|
{
|
|
10943
11143
|
initialFormat: defaultNewFileFormat,
|
|
@@ -10947,8 +11147,8 @@ function DocBlocksShell({
|
|
|
10947
11147
|
}
|
|
10948
11148
|
}
|
|
10949
11149
|
),
|
|
10950
|
-
workspaceStartupError && /* @__PURE__ */
|
|
10951
|
-
saveToast && /* @__PURE__ */
|
|
11150
|
+
workspaceStartupError && /* @__PURE__ */ jsx17("div", { className: "db-save-toast db-save-toast--error", role: "alert", "aria-live": "assertive", children: workspaceStartupError }),
|
|
11151
|
+
saveToast && /* @__PURE__ */ jsx17(
|
|
10952
11152
|
"div",
|
|
10953
11153
|
{
|
|
10954
11154
|
className: "db-save-toast db-save-toast--" + saveToast.kind,
|
|
@@ -10957,12 +11157,12 @@ function DocBlocksShell({
|
|
|
10957
11157
|
children: saveToast.message
|
|
10958
11158
|
}
|
|
10959
11159
|
),
|
|
10960
|
-
offlineReadyToast && !saveToast && /* @__PURE__ */
|
|
10961
|
-
documentSnapshot.conflict && /* @__PURE__ */
|
|
10962
|
-
/* @__PURE__ */
|
|
10963
|
-
/* @__PURE__ */
|
|
11160
|
+
offlineReadyToast && !saveToast && /* @__PURE__ */ jsx17("div", { className: "db-save-toast db-save-toast--success", role: "status", "aria-live": "polite", children: "DocBlocks is ready to work offline." }),
|
|
11161
|
+
documentSnapshot.conflict && /* @__PURE__ */ jsxs15("div", { className: "db-document-conflict", role: "alert", children: [
|
|
11162
|
+
/* @__PURE__ */ jsx17("span", { children: documentSnapshot.conflict.recoveredDraft ? "A recovery draft from a previous session differs from the saved file. The saved file may be newer. Choose which version to use." : "This document changed outside DocBlocks. Your unsaved version is still intact." }),
|
|
11163
|
+
/* @__PURE__ */ jsx17("div", { className: "db-document-conflict-actions", children: /* @__PURE__ */ jsx17("button", { type: "button", onClick: () => setShowConflictComparison(true), children: "Compare versions" }) })
|
|
10964
11164
|
] }),
|
|
10965
|
-
documentSnapshot.conflict && showConflictComparison && /* @__PURE__ */
|
|
11165
|
+
documentSnapshot.conflict && showConflictComparison && /* @__PURE__ */ jsx17(Suspense2, { fallback: /* @__PURE__ */ jsx17("div", { role: "status", children: "Loading version comparison\u2026" }), children: /* @__PURE__ */ jsx17(
|
|
10966
11166
|
DocumentConflictDialog,
|
|
10967
11167
|
{
|
|
10968
11168
|
conflict: documentSnapshot.conflict,
|
|
@@ -10972,14 +11172,14 @@ function DocBlocksShell({
|
|
|
10972
11172
|
onClose: () => setShowConflictComparison(false)
|
|
10973
11173
|
}
|
|
10974
11174
|
) }),
|
|
10975
|
-
storageFull && !documentSnapshot.conflict && /* @__PURE__ */
|
|
10976
|
-
/* @__PURE__ */
|
|
10977
|
-
/* @__PURE__ */
|
|
10978
|
-
/* @__PURE__ */
|
|
10979
|
-
/* @__PURE__ */
|
|
11175
|
+
storageFull && !documentSnapshot.conflict && /* @__PURE__ */ jsxs15("div", { className: "db-storage-full-banner", role: "alert", children: [
|
|
11176
|
+
/* @__PURE__ */ jsx17("span", { children: "Browser storage is full -- changes can\u2019t be saved. Free up space or back up your work now." }),
|
|
11177
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-storage-full-banner-actions", children: [
|
|
11178
|
+
/* @__PURE__ */ jsx17("button", { type: "button", onClick: () => void handleDownloadAllWorkspaces(), children: "Back up all workspaces" }),
|
|
11179
|
+
/* @__PURE__ */ jsx17("button", { type: "button", onClick: () => setStorageFull(false), children: "Dismiss" })
|
|
10980
11180
|
] })
|
|
10981
11181
|
] }),
|
|
10982
|
-
workspaceSettingsOpen && activeWorkspaceDescriptor && /* @__PURE__ */
|
|
11182
|
+
workspaceSettingsOpen && activeWorkspaceDescriptor && /* @__PURE__ */ jsx17(
|
|
10983
11183
|
WorkspaceSettingsDialog,
|
|
10984
11184
|
{
|
|
10985
11185
|
workspace: activeWorkspaceDescriptor,
|
|
@@ -10992,8 +11192,8 @@ function DocBlocksShell({
|
|
|
10992
11192
|
onClose: () => setWorkspaceSettingsOpen(false)
|
|
10993
11193
|
}
|
|
10994
11194
|
),
|
|
10995
|
-
/* @__PURE__ */
|
|
10996
|
-
/* @__PURE__ */
|
|
11195
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-shell-panes", ref: panesRef, children: [
|
|
11196
|
+
/* @__PURE__ */ jsxs15(
|
|
10997
11197
|
"aside",
|
|
10998
11198
|
{
|
|
10999
11199
|
ref: sidebarRef,
|
|
@@ -11001,11 +11201,12 @@ function DocBlocksShell({
|
|
|
11001
11201
|
"aria-label": "Workspace and files",
|
|
11002
11202
|
style: singlePane ? void 0 : { width: `${sidebarWidth}px` },
|
|
11003
11203
|
children: [
|
|
11004
|
-
/* @__PURE__ */
|
|
11005
|
-
/* @__PURE__ */
|
|
11204
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-shell-sidebar-header", children: [
|
|
11205
|
+
/* @__PURE__ */ jsx17(
|
|
11006
11206
|
AppMenu,
|
|
11007
11207
|
{
|
|
11008
11208
|
logoUrl,
|
|
11209
|
+
logoDarkUrl,
|
|
11009
11210
|
themePreference,
|
|
11010
11211
|
onThemeChange: handleThemeChange,
|
|
11011
11212
|
accentColor,
|
|
@@ -11023,6 +11224,7 @@ function DocBlocksShell({
|
|
|
11023
11224
|
onVersioningPreferenceChange: handleVersioningPreferenceChange,
|
|
11024
11225
|
onOpenWorkspaceSettings: activeWorkspaceDescriptor ? handleOpenWorkspaceSettings : void 0,
|
|
11025
11226
|
onDownloadAllWorkspaces: handleDownloadAllWorkspaces,
|
|
11227
|
+
onShowKeyboardShortcuts: singlePane ? void 0 : openKeyboardShortcuts,
|
|
11026
11228
|
onKeepBrowserData: showBrowserStorageWarning && !browserStoragePersistent ? handleKeepBrowserData : void 0,
|
|
11027
11229
|
onInstallApp: installPromptEvent ? handleInstallApp : void 0,
|
|
11028
11230
|
getStorageEstimate: showBrowserStorageWarning ? getBrowserStorageEstimate : void 0,
|
|
@@ -11034,7 +11236,7 @@ function DocBlocksShell({
|
|
|
11034
11236
|
settingsRequest
|
|
11035
11237
|
}
|
|
11036
11238
|
),
|
|
11037
|
-
/* @__PURE__ */
|
|
11239
|
+
/* @__PURE__ */ jsx17(
|
|
11038
11240
|
WorkspacePicker,
|
|
11039
11241
|
{
|
|
11040
11242
|
activeWorkspaceId,
|
|
@@ -11045,7 +11247,7 @@ function DocBlocksShell({
|
|
|
11045
11247
|
onRemoveWorkspace: (workspace) => void handleRemoveWorkspace(workspace.id)
|
|
11046
11248
|
}
|
|
11047
11249
|
),
|
|
11048
|
-
/* @__PURE__ */
|
|
11250
|
+
/* @__PURE__ */ jsx17(
|
|
11049
11251
|
WorkspaceSettingsButton,
|
|
11050
11252
|
{
|
|
11051
11253
|
onSettings: handleOpenWorkspaceSettings,
|
|
@@ -11056,26 +11258,26 @@ function DocBlocksShell({
|
|
|
11056
11258
|
}
|
|
11057
11259
|
}
|
|
11058
11260
|
),
|
|
11059
|
-
canRestoreSplitView && /* @__PURE__ */
|
|
11261
|
+
canRestoreSplitView && /* @__PURE__ */ jsx17(
|
|
11060
11262
|
"button",
|
|
11061
11263
|
{
|
|
11062
11264
|
className: "db-restore-split",
|
|
11063
11265
|
onClick: () => updateSidebarPreference("pinned"),
|
|
11064
11266
|
"aria-label": "Restore split view",
|
|
11065
11267
|
title: "Restore split view",
|
|
11066
|
-
children: /* @__PURE__ */
|
|
11268
|
+
children: /* @__PURE__ */ jsx17(SplitViewIcon, {})
|
|
11067
11269
|
}
|
|
11068
11270
|
),
|
|
11069
|
-
/* @__PURE__ */
|
|
11271
|
+
/* @__PURE__ */ jsx17("span", { className: "db-window-drag-grip", "aria-hidden": true })
|
|
11070
11272
|
] }),
|
|
11071
|
-
git.available && /* @__PURE__ */
|
|
11273
|
+
git.available && /* @__PURE__ */ jsx17(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx17(
|
|
11072
11274
|
GitUI,
|
|
11073
11275
|
{
|
|
11074
11276
|
onOpenFile: (path) => void handleSelect(path, "file"),
|
|
11075
11277
|
onWorkspaceCloned: handleWorkspaceCloned
|
|
11076
11278
|
}
|
|
11077
11279
|
) }),
|
|
11078
|
-
/* @__PURE__ */
|
|
11280
|
+
/* @__PURE__ */ jsx17(
|
|
11079
11281
|
FileExplorer,
|
|
11080
11282
|
{
|
|
11081
11283
|
className: sidebarView === "search" ? "db-sidebar-view--hidden" : void 0,
|
|
@@ -11109,7 +11311,7 @@ function DocBlocksShell({
|
|
|
11109
11311
|
},
|
|
11110
11312
|
explorerKey
|
|
11111
11313
|
),
|
|
11112
|
-
searchMounted && /* @__PURE__ */
|
|
11314
|
+
searchMounted && /* @__PURE__ */ jsx17(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx17(
|
|
11113
11315
|
WorkspaceSearchPanel,
|
|
11114
11316
|
{
|
|
11115
11317
|
index: workspaceIndex.index,
|
|
@@ -11120,12 +11322,12 @@ function DocBlocksShell({
|
|
|
11120
11322
|
onShowFiles: () => setSidebarView("files")
|
|
11121
11323
|
}
|
|
11122
11324
|
) }),
|
|
11123
|
-
singlePane && showWelcomeGateway && /* @__PURE__ */
|
|
11124
|
-
/* @__PURE__ */
|
|
11125
|
-
/* @__PURE__ */
|
|
11126
|
-
/* @__PURE__ */
|
|
11127
|
-
/* @__PURE__ */
|
|
11128
|
-
/* @__PURE__ */
|
|
11325
|
+
singlePane && showWelcomeGateway && /* @__PURE__ */ jsxs15("section", { className: "db-mobile-first-run", "aria-labelledby": "db-mobile-first-run-title", children: [
|
|
11326
|
+
/* @__PURE__ */ jsx17("p", { className: "db-mobile-first-run-eyebrow", children: "Local-first Markdown editor" }),
|
|
11327
|
+
/* @__PURE__ */ jsx17("h1", { id: "db-mobile-first-run-title", children: "Welcome to DocBlocks" }),
|
|
11328
|
+
/* @__PURE__ */ jsx17("p", { children: "Write visually, keep plain Markdown underneath, and export the same document in useful formats. Keep your documents in the workspace you choose." }),
|
|
11329
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-mobile-first-run-actions", children: [
|
|
11330
|
+
/* @__PURE__ */ jsx17(
|
|
11129
11331
|
"button",
|
|
11130
11332
|
{
|
|
11131
11333
|
type: "button",
|
|
@@ -11136,7 +11338,7 @@ function DocBlocksShell({
|
|
|
11136
11338
|
children: "Tour the welcome document"
|
|
11137
11339
|
}
|
|
11138
11340
|
),
|
|
11139
|
-
/* @__PURE__ */
|
|
11341
|
+
/* @__PURE__ */ jsx17(
|
|
11140
11342
|
"button",
|
|
11141
11343
|
{
|
|
11142
11344
|
type: "button",
|
|
@@ -11147,35 +11349,36 @@ function DocBlocksShell({
|
|
|
11147
11349
|
)
|
|
11148
11350
|
] })
|
|
11149
11351
|
] }),
|
|
11150
|
-
git.available && git.pendingGrant && /* @__PURE__ */
|
|
11151
|
-
/* @__PURE__ */
|
|
11152
|
-
/* @__PURE__ */
|
|
11153
|
-
/* @__PURE__ */
|
|
11154
|
-
/* @__PURE__ */
|
|
11155
|
-
/* @__PURE__ */
|
|
11156
|
-
/* @__PURE__ */
|
|
11157
|
-
showBrowserStorageWarning && /* @__PURE__ */
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
"button",
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11352
|
+
git.available && git.pendingGrant && /* @__PURE__ */ jsx17(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx17(GitGrantNotice, {}) }),
|
|
11353
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-shell-sidebar-footer", children: [
|
|
11354
|
+
/* @__PURE__ */ jsx17("a", { href: "https://docblocks.com/docs/", target: "_blank", rel: "noopener noreferrer", children: "Docs" }),
|
|
11355
|
+
/* @__PURE__ */ jsx17("span", { className: "db-shell-sidebar-footer-separator", "aria-hidden": "true", children: "\u2022" }),
|
|
11356
|
+
/* @__PURE__ */ jsx17("a", { href: "https://docblocks.com/terms/", target: "_blank", rel: "noopener noreferrer", children: "Terms" }),
|
|
11357
|
+
/* @__PURE__ */ jsx17("span", { className: "db-shell-sidebar-footer-separator", "aria-hidden": "true", children: "\u2022" }),
|
|
11358
|
+
/* @__PURE__ */ jsx17("a", { href: issueReportUrl, target: "_blank", rel: "noopener noreferrer", children: "Report issue" }),
|
|
11359
|
+
showBrowserStorageWarning && /* @__PURE__ */ jsx17(Fragment11, { children: /* @__PURE__ */ jsxs15(
|
|
11360
|
+
"button",
|
|
11361
|
+
{
|
|
11362
|
+
type: "button",
|
|
11363
|
+
className: "db-shell-sidebar-footer-action",
|
|
11364
|
+
onClick: () => void handleDownloadAllWorkspaces(),
|
|
11365
|
+
"aria-label": "Back up all workspaces",
|
|
11366
|
+
title: "Browsers can clear site data. Download a backup of every workspace.",
|
|
11367
|
+
children: [
|
|
11368
|
+
/* @__PURE__ */ jsx17(BackupIcon, {}),
|
|
11369
|
+
"Back up"
|
|
11370
|
+
]
|
|
11371
|
+
}
|
|
11372
|
+
) })
|
|
11170
11373
|
] }),
|
|
11171
|
-
/* @__PURE__ */
|
|
11172
|
-
/* @__PURE__ */
|
|
11173
|
-
/* @__PURE__ */
|
|
11374
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-sidebar-collapse-preview", "aria-hidden": "true", children: [
|
|
11375
|
+
/* @__PURE__ */ jsx17("span", { className: "db-sidebar-collapse-preview-icon", children: /* @__PURE__ */ jsx17(CollapseSidebarGlyph, {}) }),
|
|
11376
|
+
/* @__PURE__ */ jsx17("span", { className: "db-sidebar-collapse-preview-label", children: "Release to hide files" })
|
|
11174
11377
|
] })
|
|
11175
11378
|
]
|
|
11176
11379
|
}
|
|
11177
11380
|
),
|
|
11178
|
-
!singlePane && /* @__PURE__ */
|
|
11381
|
+
!singlePane && /* @__PURE__ */ jsx17(
|
|
11179
11382
|
"div",
|
|
11180
11383
|
{
|
|
11181
11384
|
className: "db-shell-sidebar-resizer",
|
|
@@ -11185,7 +11388,7 @@ function DocBlocksShell({
|
|
|
11185
11388
|
onPointerDown: handleResizerPointerDown
|
|
11186
11389
|
}
|
|
11187
11390
|
),
|
|
11188
|
-
singlePane && /* @__PURE__ */
|
|
11391
|
+
singlePane && /* @__PURE__ */ jsx17(
|
|
11189
11392
|
"div",
|
|
11190
11393
|
{
|
|
11191
11394
|
className: "db-shell-scrim",
|
|
@@ -11193,7 +11396,7 @@ function DocBlocksShell({
|
|
|
11193
11396
|
onPointerDown: () => setMobileShowEditor(true)
|
|
11194
11397
|
}
|
|
11195
11398
|
),
|
|
11196
|
-
/* @__PURE__ */
|
|
11399
|
+
/* @__PURE__ */ jsxs15(
|
|
11197
11400
|
"main",
|
|
11198
11401
|
{
|
|
11199
11402
|
ref: editorAreaRef,
|
|
@@ -11204,8 +11407,8 @@ function DocBlocksShell({
|
|
|
11204
11407
|
editorDropActive ? "db-shell-editor-area--drop-active" : ""
|
|
11205
11408
|
].filter(Boolean).join(" "),
|
|
11206
11409
|
children: [
|
|
11207
|
-
selectedFile && mediaProvider ? /* @__PURE__ */
|
|
11208
|
-
selectedManagedOutput === "catalog-html" ? /* @__PURE__ */
|
|
11410
|
+
selectedFile && mediaProvider ? /* @__PURE__ */ jsxs15(Fragment11, { children: [
|
|
11411
|
+
selectedManagedOutput === "catalog-html" ? /* @__PURE__ */ jsx17(
|
|
11209
11412
|
GeneratedCatalogPage,
|
|
11210
11413
|
{
|
|
11211
11414
|
html: editorContent,
|
|
@@ -11213,17 +11416,17 @@ function DocBlocksShell({
|
|
|
11213
11416
|
onOpenSettings: activeWorkspaceDescriptor ? handleOpenWorkspaceSettings : void 0,
|
|
11214
11417
|
onBack: singlePane ? openDrawer : void 0
|
|
11215
11418
|
}
|
|
11216
|
-
) : /* @__PURE__ */
|
|
11419
|
+
) : /* @__PURE__ */ jsx17(
|
|
11217
11420
|
GeneratedFileFrame,
|
|
11218
11421
|
{
|
|
11219
11422
|
kind: selectedManagedOutput,
|
|
11220
11423
|
onOpenSettings: activeWorkspaceDescriptor ? handleOpenWorkspaceSettings : void 0,
|
|
11221
11424
|
onBack: singlePane ? openDrawer : void 0,
|
|
11222
|
-
children: /* @__PURE__ */
|
|
11425
|
+
children: /* @__PURE__ */ jsx17(
|
|
11223
11426
|
Suspense2,
|
|
11224
11427
|
{
|
|
11225
|
-
fallback: /* @__PURE__ */
|
|
11226
|
-
children: /* @__PURE__ */
|
|
11428
|
+
fallback: /* @__PURE__ */ jsx17("div", { className: "db-shell-empty", role: "status", children: "Loading your document\u2026" }),
|
|
11429
|
+
children: editorGenerationSettled && mediaProviderCurrent && /* @__PURE__ */ jsx17(EditorErrorBoundary, { resetKey: `${selectedFile}-${editorKey}`, children: /* @__PURE__ */ jsx17(
|
|
11227
11430
|
EditorShell,
|
|
11228
11431
|
{
|
|
11229
11432
|
initialMarkdown: editorContent,
|
|
@@ -11241,6 +11444,8 @@ function DocBlocksShell({
|
|
|
11241
11444
|
onChange: handleEditorChange,
|
|
11242
11445
|
onLinkClick: handleEditorLinkClick,
|
|
11243
11446
|
colorScheme: resolvedTheme,
|
|
11447
|
+
defaultThemeId: workspaceDefaultThemeId,
|
|
11448
|
+
defaultThemeLabel: "Workspace default",
|
|
11244
11449
|
writeCanvasSettings: editorWriteCanvasSettings,
|
|
11245
11450
|
height: "100%",
|
|
11246
11451
|
placeholder: editorPlaceholder,
|
|
@@ -11271,19 +11476,19 @@ function DocBlocksShell({
|
|
|
11271
11476
|
versioningAutoSaveIdleMs,
|
|
11272
11477
|
onSaveVersion,
|
|
11273
11478
|
statusBarSlotRight,
|
|
11274
|
-
sidePanelSlot: ai && aiPanel && selectedImage === void 0 && (selectedOutsideIn === null || selectedOutsideInEditingEnabled) ? /* @__PURE__ */
|
|
11275
|
-
toolbarSlotLeft: singlePane ? /* @__PURE__ */
|
|
11479
|
+
sidePanelSlot: ai && aiPanel && selectedImage === void 0 && (selectedOutsideIn === null || selectedOutsideInEditingEnabled) ? /* @__PURE__ */ jsx17(Suspense2, { fallback: null, children: aiPanel === "review" ? /* @__PURE__ */ jsx17(AiReviewPanel, { ai, onClose: () => setAiPanel(null) }) : /* @__PURE__ */ jsx17(AiIllustratePanel, { ai, onClose: () => setAiPanel(null) }) }) : void 0,
|
|
11480
|
+
toolbarSlotLeft: singlePane ? /* @__PURE__ */ jsx17(
|
|
11276
11481
|
"button",
|
|
11277
11482
|
{
|
|
11278
11483
|
className: "db-mobile-back",
|
|
11279
11484
|
onClick: () => setMobileShowEditor(false),
|
|
11280
11485
|
"aria-label": "Show file list",
|
|
11281
|
-
children: /* @__PURE__ */
|
|
11486
|
+
children: /* @__PURE__ */ jsx17("span", { className: "db-mobile-files-icon", children: /* @__PURE__ */ jsx17(FolderGlyph, {}) })
|
|
11282
11487
|
}
|
|
11283
11488
|
) : void 0,
|
|
11284
|
-
summarizationDesigner: selectedImage === void 0 && selectedManagedOutput === void 0 && (selectedOutsideIn === null || selectedOutsideInEditingEnabled) ? (onClose) => /* @__PURE__ */
|
|
11285
|
-
toolbarSlotRight: /* @__PURE__ */
|
|
11286
|
-
canFind && /* @__PURE__ */
|
|
11489
|
+
summarizationDesigner: selectedImage === void 0 && selectedManagedOutput === void 0 && (selectedOutsideIn === null || selectedOutsideInEditingEnabled) ? (onClose) => /* @__PURE__ */ jsx17(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx17(PresentationMaker, { ai: ai ?? void 0, onClose }) }) : void 0,
|
|
11490
|
+
toolbarSlotRight: /* @__PURE__ */ jsxs15(Fragment11, { children: [
|
|
11491
|
+
canFind && /* @__PURE__ */ jsx17(
|
|
11287
11492
|
FindButton,
|
|
11288
11493
|
{
|
|
11289
11494
|
active: findMode,
|
|
@@ -11291,7 +11496,7 @@ function DocBlocksShell({
|
|
|
11291
11496
|
shortcutLabel: findShortcut
|
|
11292
11497
|
}
|
|
11293
11498
|
),
|
|
11294
|
-
ai && /* @__PURE__ */
|
|
11499
|
+
ai && /* @__PURE__ */ jsx17(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx17(
|
|
11295
11500
|
AiToolbarControl,
|
|
11296
11501
|
{
|
|
11297
11502
|
ai,
|
|
@@ -11300,8 +11505,8 @@ function DocBlocksShell({
|
|
|
11300
11505
|
onOpenPanel: setAiPanel
|
|
11301
11506
|
}
|
|
11302
11507
|
) }),
|
|
11303
|
-
speech && /* @__PURE__ */
|
|
11304
|
-
/* @__PURE__ */
|
|
11508
|
+
speech && /* @__PURE__ */ jsxs15(Suspense2, { fallback: null, children: [
|
|
11509
|
+
/* @__PURE__ */ jsx17(
|
|
11305
11510
|
TextFromNarration,
|
|
11306
11511
|
{
|
|
11307
11512
|
speech,
|
|
@@ -11311,27 +11516,27 @@ function DocBlocksShell({
|
|
|
11311
11516
|
onOpenSettings: openSettings
|
|
11312
11517
|
}
|
|
11313
11518
|
),
|
|
11314
|
-
hostSupports2("speechOutput") ? /* @__PURE__ */
|
|
11519
|
+
hostSupports2("speechOutput") ? /* @__PURE__ */ jsx17(
|
|
11315
11520
|
SpeechToolbarControl,
|
|
11316
11521
|
{
|
|
11317
11522
|
speech,
|
|
11318
11523
|
onOpenSettings: openSettings,
|
|
11319
11524
|
readOnly: selectedImage !== void 0 || selectedOutsideIn !== null && !selectedOutsideInEditingEnabled
|
|
11320
11525
|
}
|
|
11321
|
-
) : /* @__PURE__ */
|
|
11526
|
+
) : /* @__PURE__ */ jsx17(SpeechMenuBridge, {})
|
|
11322
11527
|
] }),
|
|
11323
|
-
canRestoreSplitView && /* @__PURE__ */
|
|
11528
|
+
canRestoreSplitView && /* @__PURE__ */ jsx17(
|
|
11324
11529
|
"button",
|
|
11325
11530
|
{
|
|
11326
11531
|
className: "db-restore-split",
|
|
11327
11532
|
onClick: () => updateSidebarPreference("pinned"),
|
|
11328
11533
|
"aria-label": "Restore split view",
|
|
11329
11534
|
title: "Restore split view",
|
|
11330
|
-
children: /* @__PURE__ */
|
|
11535
|
+
children: /* @__PURE__ */ jsx17(SplitViewIcon, {})
|
|
11331
11536
|
}
|
|
11332
11537
|
),
|
|
11333
|
-
git.repo && /* @__PURE__ */
|
|
11334
|
-
/* @__PURE__ */
|
|
11538
|
+
git.repo && /* @__PURE__ */ jsx17(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx17(GitToolbarControl, { selectedFile }) }),
|
|
11539
|
+
/* @__PURE__ */ jsx17(
|
|
11335
11540
|
ExportToolbarControls,
|
|
11336
11541
|
{
|
|
11337
11542
|
selectedFile,
|
|
@@ -11351,20 +11556,20 @@ function DocBlocksShell({
|
|
|
11351
11556
|
] })
|
|
11352
11557
|
},
|
|
11353
11558
|
`${selectedFile}-${editorKey}`
|
|
11354
|
-
)
|
|
11559
|
+
) })
|
|
11355
11560
|
}
|
|
11356
11561
|
)
|
|
11357
11562
|
}
|
|
11358
11563
|
),
|
|
11359
|
-
showWelcomeGateway && !singlePane && /* @__PURE__ */
|
|
11360
|
-
/* @__PURE__ */
|
|
11564
|
+
showWelcomeGateway && !singlePane && /* @__PURE__ */ jsxs15("div", { className: "db-welcome-gateway", role: "note", "aria-label": "Welcome tip", children: [
|
|
11565
|
+
/* @__PURE__ */ jsxs15("span", { className: "db-welcome-gateway-text", children: [
|
|
11361
11566
|
"You\u2019re watching this welcome doc in ",
|
|
11362
|
-
/* @__PURE__ */
|
|
11567
|
+
/* @__PURE__ */ jsx17("strong", { children: "Slideshow" }),
|
|
11363
11568
|
" ",
|
|
11364
|
-
"view\
|
|
11569
|
+
"view\u2014it\u2019s a regular Markdown file, and so is everything you\u2019ll write."
|
|
11365
11570
|
] }),
|
|
11366
|
-
/* @__PURE__ */
|
|
11367
|
-
/* @__PURE__ */
|
|
11571
|
+
/* @__PURE__ */ jsx17("button", { className: "db-welcome-gateway-cta", onClick: handleStartWriting, children: "Start writing" }),
|
|
11572
|
+
/* @__PURE__ */ jsx17(
|
|
11368
11573
|
"button",
|
|
11369
11574
|
{
|
|
11370
11575
|
className: "db-welcome-gateway-dismiss",
|
|
@@ -11375,39 +11580,39 @@ function DocBlocksShell({
|
|
|
11375
11580
|
}
|
|
11376
11581
|
)
|
|
11377
11582
|
] })
|
|
11378
|
-
] }) : selectedFolder ? /* @__PURE__ */
|
|
11379
|
-
singlePane && /* @__PURE__ */
|
|
11380
|
-
/* @__PURE__ */
|
|
11583
|
+
] }) : selectedFolder ? /* @__PURE__ */ jsxs15("div", { className: "db-folder-view", children: [
|
|
11584
|
+
singlePane && /* @__PURE__ */ jsxs15("button", { className: "db-mobile-back", onClick: () => setMobileShowEditor(false), children: [
|
|
11585
|
+
/* @__PURE__ */ jsx17("span", { className: "db-mobile-files-icon", children: /* @__PURE__ */ jsx17(FolderGlyph, {}) }),
|
|
11381
11586
|
"Back to files"
|
|
11382
11587
|
] }),
|
|
11383
|
-
/* @__PURE__ */
|
|
11384
|
-
/* @__PURE__ */
|
|
11385
|
-
/* @__PURE__ */
|
|
11588
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-folder-view-header", children: [
|
|
11589
|
+
/* @__PURE__ */ jsx17("span", { className: "db-folder-view-icon", children: /* @__PURE__ */ jsx17(FolderGlyph, {}) }),
|
|
11590
|
+
/* @__PURE__ */ jsx17("span", { className: "db-folder-view-path", children: selectedFolder })
|
|
11386
11591
|
] }),
|
|
11387
|
-
visibleFolderEntries.length === 0 ? /* @__PURE__ */
|
|
11592
|
+
visibleFolderEntries.length === 0 ? /* @__PURE__ */ jsx17("p", { className: "db-folder-view-empty", children: "This folder is empty." }) : /* @__PURE__ */ jsx17("ul", { className: "db-folder-view-list", children: visibleFolderEntries.map((entry) => /* @__PURE__ */ jsxs15(
|
|
11388
11593
|
"li",
|
|
11389
11594
|
{
|
|
11390
11595
|
className: "db-folder-view-item",
|
|
11391
11596
|
onClick: () => handleSelect(entry.path, entry.kind),
|
|
11392
11597
|
children: [
|
|
11393
|
-
/* @__PURE__ */
|
|
11598
|
+
/* @__PURE__ */ jsx17("span", { className: "db-folder-view-item-icon", children: entry.kind === "directory" ? /* @__PURE__ */ jsx17(FolderGlyph, {}) : /* @__PURE__ */ jsx17(FileGlyph, {}) }),
|
|
11394
11599
|
entry.name
|
|
11395
11600
|
]
|
|
11396
11601
|
},
|
|
11397
11602
|
entry.path
|
|
11398
11603
|
)) })
|
|
11399
|
-
] }) : /* @__PURE__ */
|
|
11400
|
-
singlePane && /* @__PURE__ */
|
|
11401
|
-
/* @__PURE__ */
|
|
11604
|
+
] }) : /* @__PURE__ */ jsxs15("div", { className: "db-shell-empty db-shell-empty--workspace", children: [
|
|
11605
|
+
singlePane && /* @__PURE__ */ jsxs15("button", { className: "db-mobile-back", onClick: () => setMobileShowEditor(false), children: [
|
|
11606
|
+
/* @__PURE__ */ jsx17("span", { className: "db-mobile-files-icon", children: /* @__PURE__ */ jsx17(FolderGlyph, {}) }),
|
|
11402
11607
|
"Back to files"
|
|
11403
11608
|
] }),
|
|
11404
|
-
/* @__PURE__ */
|
|
11405
|
-
/* @__PURE__ */
|
|
11406
|
-
/* @__PURE__ */
|
|
11407
|
-
/* @__PURE__ */
|
|
11408
|
-
/* @__PURE__ */
|
|
11409
|
-
/* @__PURE__ */
|
|
11410
|
-
/* @__PURE__ */
|
|
11609
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-workspace-empty-content", children: [
|
|
11610
|
+
/* @__PURE__ */ jsx17("span", { className: "db-workspace-empty-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx17(FileGlyph, {}) }),
|
|
11611
|
+
/* @__PURE__ */ jsx17("h1", { children: activeWorkspaceDescriptor?.name ?? "Workspace" }),
|
|
11612
|
+
/* @__PURE__ */ jsx17("p", { children: "Choose a Markdown document from the sidebar, or create a new one." }),
|
|
11613
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-workspace-empty-actions", children: [
|
|
11614
|
+
/* @__PURE__ */ jsx17("button", { type: "button", onClick: () => void handleNewFile(), children: "New document" }),
|
|
11615
|
+
/* @__PURE__ */ jsx17(
|
|
11411
11616
|
"button",
|
|
11412
11617
|
{
|
|
11413
11618
|
type: "button",
|
|
@@ -11416,7 +11621,7 @@ function DocBlocksShell({
|
|
|
11416
11621
|
children: "New folder"
|
|
11417
11622
|
}
|
|
11418
11623
|
),
|
|
11419
|
-
(hostSupports2("workspaceFolderPicker") || typeof globalThis.showDirectoryPicker === "function") && /* @__PURE__ */
|
|
11624
|
+
(hostSupports2("workspaceFolderPicker") || typeof globalThis.showDirectoryPicker === "function") && /* @__PURE__ */ jsx17(
|
|
11420
11625
|
"button",
|
|
11421
11626
|
{
|
|
11422
11627
|
type: "button",
|
|
@@ -11426,10 +11631,10 @@ function DocBlocksShell({
|
|
|
11426
11631
|
}
|
|
11427
11632
|
)
|
|
11428
11633
|
] }),
|
|
11429
|
-
/* @__PURE__ */
|
|
11634
|
+
/* @__PURE__ */ jsx17("p", { className: "db-workspace-empty-hint", children: "Use the sidebar backup action to keep a portable copy of this workspace." })
|
|
11430
11635
|
] })
|
|
11431
11636
|
] }),
|
|
11432
|
-
/* @__PURE__ */
|
|
11637
|
+
/* @__PURE__ */ jsx17(
|
|
11433
11638
|
UpdateAvailableNotice,
|
|
11434
11639
|
{
|
|
11435
11640
|
available: updateAvailable,
|