@bendyline/docblocks-react 2.7.2 → 2.7.3
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/THIRD_PARTY_NOTICES.txt +215 -23
- package/dist/{AiDiagrams-LFV4YU6W.js → AiDiagrams-QE3LVYFK.js} +2 -2
- package/dist/{AiEditorAssistant-GN2KXKZD.js → AiEditorAssistant-YLJ5OZK2.js} +203 -164
- package/dist/AiStudyDialog-4TQZZGU3.js +1150 -0
- package/dist/{ExportToolbarControls-2FEIHNMW.js → ExportToolbarControls-A2YBKUUD.js} +32 -3
- package/dist/{KeyboardShortcutsDialog-NOD4P25G.js → KeyboardShortcutsDialog-G5OBDTNR.js} +1 -1
- package/dist/{PresentationMaker-ITNP5SDO.js → PresentationMaker-P2JP6UUX.js} +2 -2
- package/dist/{Settings-RDYvDDI0.d.ts → Settings-ByNImjk5.d.ts} +2 -4
- package/dist/{chunk-X3DDTJKR.js → chunk-3CE5RH2B.js} +255 -17
- package/dist/{chunk-HRWEGPTY.js → chunk-6PA7QBZT.js} +90 -21
- package/dist/{chunk-K7XJDJUJ.js → chunk-ACQF63SB.js} +14 -4
- package/dist/{chunk-SSB43524.js → chunk-EOU2JWAQ.js} +22 -2
- package/dist/chunk-XNT66JC2.js +168 -0
- package/dist/{chunk-NAH52736.js → chunk-YPIVCCTB.js} +969 -98
- package/dist/{chunk-BLUEZG7T.js → chunk-ZMCQO57Q.js} +1 -1
- package/dist/editor.js +3 -3
- package/dist/export/index.d.ts +10 -2
- package/dist/export/index.js +1 -1
- package/dist/index.d.ts +14 -4
- package/dist/index.js +365 -381
- package/dist/{run-export-CS3HRNAZ.js → run-export-OHRNT2TP.js} +1 -1
- package/dist/settings/index.d.ts +1 -1
- package/dist/settings/index.js +1 -1
- package/package.json +8 -8
- package/src/styles/docblocks.css +497 -57
package/dist/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProgressivePlayer
|
|
3
|
+
} from "./chunk-2IYBBFQX.js";
|
|
1
4
|
import {
|
|
2
5
|
BackupIcon,
|
|
3
6
|
FolderIcon,
|
|
@@ -18,9 +21,6 @@ import {
|
|
|
18
21
|
import {
|
|
19
22
|
createSpeechInputProvider
|
|
20
23
|
} from "./chunk-KBDZDFPU.js";
|
|
21
|
-
import {
|
|
22
|
-
ProgressivePlayer
|
|
23
|
-
} from "./chunk-2IYBBFQX.js";
|
|
24
24
|
import {
|
|
25
25
|
sharedDocumentFilename
|
|
26
26
|
} from "./chunk-SPUPWCSI.js";
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
} from "./chunk-KWG6UP5O.js";
|
|
52
52
|
import {
|
|
53
53
|
runExport
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-6PA7QBZT.js";
|
|
55
55
|
import {
|
|
56
56
|
createImageSaveOutput
|
|
57
57
|
} from "./chunk-UONFWKJ7.js";
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
saveProofingPreferences,
|
|
88
88
|
saveThemePreference,
|
|
89
89
|
saveWriteCanvasPreferences
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-ZMCQO57Q.js";
|
|
91
91
|
import {
|
|
92
92
|
FindButton,
|
|
93
93
|
focusFindInput,
|
|
@@ -99,9 +99,14 @@ import {
|
|
|
99
99
|
isApplePlatform,
|
|
100
100
|
matchShortcut,
|
|
101
101
|
shortcutLabel
|
|
102
|
-
} from "./chunk-
|
|
103
|
-
import "./chunk-
|
|
104
|
-
import
|
|
102
|
+
} from "./chunk-ACQF63SB.js";
|
|
103
|
+
import "./chunk-EOU2JWAQ.js";
|
|
104
|
+
import {
|
|
105
|
+
buildIssueReportUrl,
|
|
106
|
+
displayBuildDate,
|
|
107
|
+
localDateStamp,
|
|
108
|
+
openExternalUrl
|
|
109
|
+
} from "./chunk-YPIVCCTB.js";
|
|
105
110
|
import "./chunk-K4I3NJFL.js";
|
|
106
111
|
import {
|
|
107
112
|
ExportDialog
|
|
@@ -2443,6 +2448,7 @@ function isInternalDrag(dataTransfer) {
|
|
|
2443
2448
|
}
|
|
2444
2449
|
function FileExplorer({
|
|
2445
2450
|
provider,
|
|
2451
|
+
loading = false,
|
|
2446
2452
|
metadataRefreshKey,
|
|
2447
2453
|
activeFilePath,
|
|
2448
2454
|
sortMode,
|
|
@@ -3169,7 +3175,7 @@ function FileExplorer({
|
|
|
3169
3175
|
]
|
|
3170
3176
|
}
|
|
3171
3177
|
),
|
|
3172
|
-
tree.loading ? /* @__PURE__ */ jsx5("div", { className: "db-tree", role: "status", "aria-live": "polite", children: /* @__PURE__ */ jsx5("div", { className: "db-tree-loading", children: "Loading..." }) }) : filterVisibleFileEntries(tree.entries).length === 0 ? /* @__PURE__ */ jsx5("div", { className: "db-tree", children: /* @__PURE__ */ jsx5("div", { className: "db-tree-empty", children: "No files yet" }) }) : /* @__PURE__ */ jsx5(
|
|
3178
|
+
tree.loading || loading ? /* @__PURE__ */ jsx5("div", { className: "db-tree", role: "status", "aria-live": "polite", children: /* @__PURE__ */ jsx5("div", { className: "db-tree-loading", children: "Loading..." }) }) : filterVisibleFileEntries(tree.entries).length === 0 ? /* @__PURE__ */ jsx5("div", { className: "db-tree", children: /* @__PURE__ */ jsx5("div", { className: "db-tree-empty", children: "No files yet" }) }) : /* @__PURE__ */ jsx5(
|
|
3173
3179
|
"div",
|
|
3174
3180
|
{
|
|
3175
3181
|
ref: treeRef,
|
|
@@ -3236,6 +3242,7 @@ function WorkspacePicker({
|
|
|
3236
3242
|
onCloneRepository,
|
|
3237
3243
|
onRemoveWorkspace,
|
|
3238
3244
|
refreshKey,
|
|
3245
|
+
loading = false,
|
|
3239
3246
|
className
|
|
3240
3247
|
}) {
|
|
3241
3248
|
const [workspaces, setWorkspaces] = useState5([]);
|
|
@@ -3392,7 +3399,7 @@ function WorkspacePicker({
|
|
|
3392
3399
|
}
|
|
3393
3400
|
}, [newWorkspaceName, newWorkspacePending, onSelect, refresh, workspaces]);
|
|
3394
3401
|
const activeWs = workspaces.find((w) => w.id === activeWorkspaceId);
|
|
3395
|
-
const activeWorkspaceName = activeWs?.name ?? "No workspace";
|
|
3402
|
+
const activeWorkspaceName = activeWs?.name ?? (loading ? "Loading\u2026" : "No workspace");
|
|
3396
3403
|
return /* @__PURE__ */ jsxs5("div", { ref: pickerRef, className: `db-workspace-picker ${className ?? ""}`, children: [
|
|
3397
3404
|
/* @__PURE__ */ jsxs5(
|
|
3398
3405
|
"button",
|
|
@@ -4034,17 +4041,6 @@ function SpeechSettingsControls({ speech }) {
|
|
|
4034
4041
|
] });
|
|
4035
4042
|
}
|
|
4036
4043
|
|
|
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
|
-
|
|
4048
4044
|
// src/AppMenu/AppMenu.tsx
|
|
4049
4045
|
import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
4050
4046
|
function formatBytes(bytes) {
|
|
@@ -4099,7 +4095,8 @@ function AppMenu({
|
|
|
4099
4095
|
if (settingsRequest > 0) setShowSettings(true);
|
|
4100
4096
|
}, [settingsRequest]);
|
|
4101
4097
|
const [requestingPersistentStorage, setRequestingPersistentStorage] = useState7(false);
|
|
4102
|
-
const
|
|
4098
|
+
const surface = getHostEnvironment()?.surface ?? "web";
|
|
4099
|
+
const moreInformationUrl = MORE_INFORMATION_URLS[surface] ?? MORE_INFORMATION_URLS.web;
|
|
4103
4100
|
const containerRef = useRef8(null);
|
|
4104
4101
|
const { menuRef, triggerRef, handleMenuKeyDown, handleTriggerKeyDown, closeMenu } = useMenuKeyboard(isOpen, setIsOpen);
|
|
4105
4102
|
const [storageEstimate, setStorageEstimate] = useState7(null);
|
|
@@ -4400,22 +4397,6 @@ function AppMenu({
|
|
|
4400
4397
|
/* @__PURE__ */ jsx8("strong", { children: "DocBlocks" }),
|
|
4401
4398
|
" is a local-first Markdown document editor. Your files stay under your control."
|
|
4402
4399
|
] }),
|
|
4403
|
-
/* @__PURE__ */ jsxs7("aside", { className: "db-about-beta", children: [
|
|
4404
|
-
/* @__PURE__ */ jsx8("strong", { children: "Beta Software." }),
|
|
4405
|
-
" We're still working through initial hiccups and issues. Please bear with us, make sure you keep backups, and",
|
|
4406
|
-
" ",
|
|
4407
|
-
/* @__PURE__ */ jsx8(
|
|
4408
|
-
"a",
|
|
4409
|
-
{
|
|
4410
|
-
href: "https://github.com/bendyline/docblocks/issues/new",
|
|
4411
|
-
target: "_blank",
|
|
4412
|
-
rel: "noopener noreferrer",
|
|
4413
|
-
children: "open issues"
|
|
4414
|
-
}
|
|
4415
|
-
),
|
|
4416
|
-
" ",
|
|
4417
|
-
"where you find them. Thanks!"
|
|
4418
|
-
] }),
|
|
4419
4400
|
appVersion && /* @__PURE__ */ jsxs7("p", { className: "db-about-version", children: [
|
|
4420
4401
|
/* @__PURE__ */ jsx8("span", { children: "Version" }),
|
|
4421
4402
|
/* @__PURE__ */ jsx8("code", { "aria-label": `DocBlocks version ${appVersion}`, children: appVersion })
|
|
@@ -4434,6 +4415,12 @@ function AppMenu({
|
|
|
4434
4415
|
/* @__PURE__ */ jsx8("a", { href: "https://bendyline.com", target: "_blank", rel: "noopener noreferrer", children: "Bendyline" }),
|
|
4435
4416
|
"."
|
|
4436
4417
|
] }),
|
|
4418
|
+
surface === "web" && /* @__PURE__ */ jsxs7("p", { children: [
|
|
4419
|
+
"See our free desktop apps at",
|
|
4420
|
+
" ",
|
|
4421
|
+
/* @__PURE__ */ jsx8("a", { href: MORE_INFORMATION_URLS.electron, target: "_blank", rel: "noopener noreferrer", children: "docblocks.com/desktop" }),
|
|
4422
|
+
"."
|
|
4423
|
+
] }),
|
|
4437
4424
|
/* @__PURE__ */ jsxs7("p", { className: "db-dialog-links", children: [
|
|
4438
4425
|
/* @__PURE__ */ jsx8("a", { href: moreInformationUrl, target: "_blank", rel: "noopener noreferrer", children: "More information..." }),
|
|
4439
4426
|
/* @__PURE__ */ jsx8(
|
|
@@ -5008,7 +4995,7 @@ function useDocumentSession(autoSaveDelayMs = 500) {
|
|
|
5008
4995
|
import { lazy, Suspense } from "react";
|
|
5009
4996
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
5010
4997
|
var ExportToolbarControlsImplementation = lazy(
|
|
5011
|
-
() => import("./ExportToolbarControls-
|
|
4998
|
+
() => import("./ExportToolbarControls-A2YBKUUD.js").then((module) => ({
|
|
5012
4999
|
default: module.ExportToolbarControls
|
|
5013
5000
|
}))
|
|
5014
5001
|
);
|
|
@@ -6050,35 +6037,6 @@ function resolveShellTheme({
|
|
|
6050
6037
|
return osTheme;
|
|
6051
6038
|
}
|
|
6052
6039
|
|
|
6053
|
-
// src/DocBlocksShell/issue-report.ts
|
|
6054
|
-
var NEW_ISSUE_URL = "https://github.com/bendyline/docblocks/issues/new";
|
|
6055
|
-
var VERSION_VALUE_LIMIT = 128;
|
|
6056
|
-
var USER_AGENT_VALUE_LIMIT = 512;
|
|
6057
|
-
function normalizeEnvironmentValue(value, fallback, limit) {
|
|
6058
|
-
const normalized = value.replace(/[\r\n]+/g, " ").trim().slice(0, limit);
|
|
6059
|
-
return normalized || fallback;
|
|
6060
|
-
}
|
|
6061
|
-
function buildIssueReportUrl(environment) {
|
|
6062
|
-
const body = [
|
|
6063
|
-
"## Description",
|
|
6064
|
-
"",
|
|
6065
|
-
"<!-- What happened, and what did you expect? -->",
|
|
6066
|
-
"",
|
|
6067
|
-
"## Environment",
|
|
6068
|
-
"",
|
|
6069
|
-
`- Date: ${localDateStamp(environment.reportedAt)}`,
|
|
6070
|
-
`- DocBlocks: ${normalizeEnvironmentValue(environment.version, "unknown", VERSION_VALUE_LIMIT)}`,
|
|
6071
|
-
`- User agent: ${normalizeEnvironmentValue(
|
|
6072
|
-
environment.userAgent,
|
|
6073
|
-
"unavailable",
|
|
6074
|
-
USER_AGENT_VALUE_LIMIT
|
|
6075
|
-
)}`
|
|
6076
|
-
].join("\n");
|
|
6077
|
-
const url = new URL(NEW_ISSUE_URL);
|
|
6078
|
-
url.searchParams.set("body", body);
|
|
6079
|
-
return url.href;
|
|
6080
|
-
}
|
|
6081
|
-
|
|
6082
6040
|
// src/DocBlocksShell/last-state.ts
|
|
6083
6041
|
import { tryParseWorkspacePath as tryParseWorkspacePath2 } from "@bendyline/docblocks/filesystem";
|
|
6084
6042
|
var LAST_STATE_KEY = "docblocks:lastState";
|
|
@@ -6733,6 +6691,104 @@ function UpdateAvailableNotice({
|
|
|
6733
6691
|
] });
|
|
6734
6692
|
}
|
|
6735
6693
|
|
|
6694
|
+
// src/DocBlocksShell/WelcomeScreen.tsx
|
|
6695
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
6696
|
+
var WELCOME_HEADLINE = "The Markdown editor that turns one file into anything.";
|
|
6697
|
+
var WELCOME_SUMMARY = "Write the way you normally would, then share the same file as a PDF, a Word document, a slide deck, or a video.";
|
|
6698
|
+
var WELCOME_PRIVACY_NOTE = "No account, and your documents stay on this device.";
|
|
6699
|
+
var DOCBLOCKS_APPS_URL = "https://docblocks.com/desktop/";
|
|
6700
|
+
function WelcomeScreen({
|
|
6701
|
+
onCreateDocument,
|
|
6702
|
+
onTour,
|
|
6703
|
+
onDismiss,
|
|
6704
|
+
offerApps = false
|
|
6705
|
+
}) {
|
|
6706
|
+
return /* @__PURE__ */ jsxs15("section", { className: "db-welcome-gateway", "aria-labelledby": "db-welcome-gateway-title", children: [
|
|
6707
|
+
/* @__PURE__ */ jsx17(
|
|
6708
|
+
"button",
|
|
6709
|
+
{
|
|
6710
|
+
type: "button",
|
|
6711
|
+
className: "db-welcome-gateway-dismiss",
|
|
6712
|
+
onClick: onDismiss,
|
|
6713
|
+
"aria-label": "Dismiss welcome",
|
|
6714
|
+
title: "Dismiss",
|
|
6715
|
+
children: "\xD7"
|
|
6716
|
+
}
|
|
6717
|
+
),
|
|
6718
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-welcome-gateway-body", children: [
|
|
6719
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-welcome-gateway-copy", children: [
|
|
6720
|
+
/* @__PURE__ */ jsx17("p", { className: "db-welcome-gateway-eyebrow", children: "Welcome to DocBlocks" }),
|
|
6721
|
+
/* @__PURE__ */ jsx17("h1", { id: "db-welcome-gateway-title", children: WELCOME_HEADLINE }),
|
|
6722
|
+
/* @__PURE__ */ jsx17("p", { children: WELCOME_SUMMARY }),
|
|
6723
|
+
/* @__PURE__ */ jsx17("p", { className: "db-welcome-gateway-note", children: WELCOME_PRIVACY_NOTE }),
|
|
6724
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-welcome-gateway-actions", children: [
|
|
6725
|
+
/* @__PURE__ */ jsx17("button", { type: "button", className: "db-welcome-gateway-primary", onClick: onCreateDocument, children: "Create a document" }),
|
|
6726
|
+
/* @__PURE__ */ jsx17("button", { type: "button", className: "db-welcome-gateway-cta", onClick: onTour, children: "Tour the welcome document" }),
|
|
6727
|
+
offerApps && /* @__PURE__ */ jsx17(
|
|
6728
|
+
"a",
|
|
6729
|
+
{
|
|
6730
|
+
className: "db-welcome-gateway-apps",
|
|
6731
|
+
href: DOCBLOCKS_APPS_URL,
|
|
6732
|
+
target: "_blank",
|
|
6733
|
+
rel: "noopener noreferrer",
|
|
6734
|
+
children: "Check out the DocBlocks apps"
|
|
6735
|
+
}
|
|
6736
|
+
)
|
|
6737
|
+
] })
|
|
6738
|
+
] }),
|
|
6739
|
+
/* @__PURE__ */ jsx17(WelcomeLoop, {})
|
|
6740
|
+
] })
|
|
6741
|
+
] });
|
|
6742
|
+
}
|
|
6743
|
+
function WelcomeLoop() {
|
|
6744
|
+
return /* @__PURE__ */ jsxs15("div", { className: "db-welcome-loop", "aria-hidden": "true", children: [
|
|
6745
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-welcome-loop-source", children: [
|
|
6746
|
+
/* @__PURE__ */ jsx17("span", { className: "db-welcome-loop-file", children: "Lisbon.md" }),
|
|
6747
|
+
/* @__PURE__ */ jsxs15("code", { children: [
|
|
6748
|
+
/* @__PURE__ */ jsx17("span", { className: "db-welcome-loop-mark", children: "# " }),
|
|
6749
|
+
"Lisbon in three days",
|
|
6750
|
+
"\n",
|
|
6751
|
+
"Trams, tiles, and pastries.",
|
|
6752
|
+
"\n\n",
|
|
6753
|
+
/* @__PURE__ */ jsx17("span", { className: "db-welcome-loop-mark", children: "## " }),
|
|
6754
|
+
"Day one",
|
|
6755
|
+
"\n",
|
|
6756
|
+
/* @__PURE__ */ jsx17("span", { className: "db-welcome-loop-mark", children: "- " }),
|
|
6757
|
+
"Ride Tram 28",
|
|
6758
|
+
"\n",
|
|
6759
|
+
/* @__PURE__ */ jsx17("span", { className: "db-welcome-loop-mark", children: "- " }),
|
|
6760
|
+
"Sunset at Gra\xE7a"
|
|
6761
|
+
] })
|
|
6762
|
+
] }),
|
|
6763
|
+
/* @__PURE__ */ jsx17("div", { className: "db-welcome-loop-arrow", children: "\u2192" }),
|
|
6764
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-welcome-loop-stage", children: [
|
|
6765
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-welcome-loop-frame db-welcome-loop-frame--page", children: [
|
|
6766
|
+
/* @__PURE__ */ jsx17("strong", { children: "Lisbon in three days" }),
|
|
6767
|
+
/* @__PURE__ */ jsx17("span", { children: "Trams, tiles, and pastries." }),
|
|
6768
|
+
/* @__PURE__ */ jsx17("em", { children: "Day one" }),
|
|
6769
|
+
/* @__PURE__ */ jsx17("span", { children: "\u2022 Ride Tram 28" }),
|
|
6770
|
+
/* @__PURE__ */ jsx17("span", { children: "\u2022 Sunset at Gra\xE7a" })
|
|
6771
|
+
] }),
|
|
6772
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-welcome-loop-frame db-welcome-loop-frame--slide", children: [
|
|
6773
|
+
/* @__PURE__ */ jsx17("strong", { children: "Lisbon in three days" }),
|
|
6774
|
+
/* @__PURE__ */ jsx17("span", { children: "Trams, tiles, and pastries." })
|
|
6775
|
+
] }),
|
|
6776
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-welcome-loop-frame db-welcome-loop-frame--video", children: [
|
|
6777
|
+
/* @__PURE__ */ jsx17("em", { children: "Day one" }),
|
|
6778
|
+
/* @__PURE__ */ jsx17("span", { children: "\u2022 Ride Tram 28" }),
|
|
6779
|
+
/* @__PURE__ */ jsx17("span", { children: "\u2022 Sunset at Gra\xE7a" }),
|
|
6780
|
+
/* @__PURE__ */ jsx17("i", { className: "db-welcome-loop-play", children: "\u25B6" }),
|
|
6781
|
+
/* @__PURE__ */ jsx17("i", { className: "db-welcome-loop-progress" })
|
|
6782
|
+
] })
|
|
6783
|
+
] }),
|
|
6784
|
+
/* @__PURE__ */ jsxs15("ol", { className: "db-welcome-loop-labels", children: [
|
|
6785
|
+
/* @__PURE__ */ jsx17("li", { children: "PDF" }),
|
|
6786
|
+
/* @__PURE__ */ jsx17("li", { children: "Slides" }),
|
|
6787
|
+
/* @__PURE__ */ jsx17("li", { children: "Video" })
|
|
6788
|
+
] })
|
|
6789
|
+
] });
|
|
6790
|
+
}
|
|
6791
|
+
|
|
6736
6792
|
// src/DocBlocksShell/useDocumentLinkProvider.ts
|
|
6737
6793
|
import { useCallback as useCallback16 } from "react";
|
|
6738
6794
|
|
|
@@ -7107,7 +7163,15 @@ function createNativeFileActions(entry, workspaceId, host) {
|
|
|
7107
7163
|
|
|
7108
7164
|
// src/DocBlocksShell/welcome-document.ts
|
|
7109
7165
|
import { DEFAULT_WORKSPACE_ID } from "@bendyline/docblocks/workspace";
|
|
7110
|
-
var WELCOME_DOCUMENT_PATH = "/
|
|
7166
|
+
var WELCOME_DOCUMENT_PATH = "/Welcome.md";
|
|
7167
|
+
var WELCOME_DOCUMENT_NAMES = /* @__PURE__ */ new Set([
|
|
7168
|
+
"welcome.md",
|
|
7169
|
+
// Seeded as `aboutDocBlocks.md` through 2.7 (`aboutDocblocks.md` before that).
|
|
7170
|
+
"aboutdocblocks.md"
|
|
7171
|
+
]);
|
|
7172
|
+
function isWelcomeDocumentPath(path) {
|
|
7173
|
+
return WELCOME_DOCUMENT_NAMES.has(path.replace(/^\//, "").toLowerCase());
|
|
7174
|
+
}
|
|
7111
7175
|
function isAppDefaultWorkspace(workspaceId, hostDefaultWorkspaceIds) {
|
|
7112
7176
|
return hostDefaultWorkspaceIds ? hostDefaultWorkspaceIds.has(workspaceId) : workspaceId === DEFAULT_WORKSPACE_ID;
|
|
7113
7177
|
}
|
|
@@ -7117,126 +7181,57 @@ var WELCOME_DOCUMENT_CONTENT = [
|
|
|
7117
7181
|
"squisq-cover-slide: false",
|
|
7118
7182
|
"---",
|
|
7119
7183
|
"",
|
|
7120
|
-
'# DocBlocks {[title subtitle="
|
|
7121
|
-
"",
|
|
7122
|
-
"Write in plain Markdown. Shape it visually. Keep it portable.",
|
|
7123
|
-
"",
|
|
7124
|
-
"## A document editor that never asks you to stop owning the document {[factCard]}",
|
|
7125
|
-
"",
|
|
7126
|
-
"DocBlocks pairs a friendly visual writing surface with the durable source format you already know. There is no account to create, no proprietary document to rescue later, and no requirement to send your work to a hosted editor.",
|
|
7127
|
-
"",
|
|
7128
|
-
"## Start with three small moves {[list]}",
|
|
7129
|
-
"",
|
|
7130
|
-
"1. Choose **New file** in the file pane and give your document a name, such as `my-first-document.md`. On a small screen, open the file pane first.",
|
|
7131
|
-
"2. Add a heading and a few sentences in **Write**, then switch to **Source** to see the Markdown behind them. Both views edit the same document.",
|
|
7132
|
-
"3. Try a Document, Page, Slideshow, or Video preview, then open **Export and share** to make a PDF, Word document, or another supported file.",
|
|
7133
|
-
"",
|
|
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."]}',
|
|
7135
|
-
"",
|
|
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.",
|
|
7184
|
+
'# Welcome to DocBlocks {[title subtitle="Write once. Share it as a document, a deck, or a video."]}',
|
|
7137
7185
|
"",
|
|
7138
|
-
"
|
|
7186
|
+
"This is an ordinary document, so go ahead and change it. Click anywhere and type; DocBlocks saves as you go.",
|
|
7139
7187
|
"",
|
|
7140
|
-
"
|
|
7141
|
-
"- Launch DocBlocks and choose **Open a folder** to work in a folder you own. Your Markdown and media stay in that folder.",
|
|
7142
|
-
"- Open an existing document or create a new file. Edits save automatically; check any save or conflict message before closing.",
|
|
7143
|
-
"- Use the same Write, Source, preview, and export workflow as the web app, with native menus and file opening.",
|
|
7188
|
+
"## Write the way you already do {[list]}",
|
|
7144
7189
|
"",
|
|
7145
|
-
"
|
|
7190
|
+
"- Type to add text, and use the toolbar for headings, lists, and bold or italic text.",
|
|
7191
|
+
"- Choose **Insert** in the toolbar to add a table, a checklist, a chart, a diagram, or a picture.",
|
|
7192
|
+
"- Choose **Source** to see the Markdown text behind this page. Both views edit the same document.",
|
|
7146
7193
|
"",
|
|
7147
|
-
"
|
|
7148
|
-
"- Choose **Install DocBlocks\u2026** in the app menu when offered. The installed web app keeps using the same browser storage.",
|
|
7149
|
-
"- Once the app has finished downloading for offline use, you can keep editing without a connection.",
|
|
7150
|
-
"- Use **Back up all workspaces** in the app menu to keep a backup before clearing browser data or moving to a new device.",
|
|
7151
|
-
"",
|
|
7152
|
-
"## Work inside VS Code {[content]}",
|
|
7153
|
-
"",
|
|
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.",
|
|
7155
|
-
"",
|
|
7156
|
-
"## On a phone or tablet {[content]}",
|
|
7157
|
-
"",
|
|
7158
|
-
"Use the web app on your phone or tablet today. Native apps for iPhone, iPad, and Android are in preview, with store distribution pending. Preview builds offer an **On this device** workspace, picked folders, and system sharing. Keep an exported copy of important work: uninstalling a native app removes its private device workspace.",
|
|
7159
|
-
"",
|
|
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."]}',
|
|
7161
|
-
"",
|
|
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.",
|
|
7163
|
-
"",
|
|
7164
|
-
"## One source, four ways to publish {[diagram]}",
|
|
7194
|
+
"## One document, many ways to share it {[diagram]}",
|
|
7165
7195
|
"",
|
|
7166
7196
|
"```diagram",
|
|
7167
|
-
"
|
|
7168
|
-
"|
|
|
7169
|
-
"
|
|
7170
|
-
"
|
|
7171
|
-
"
|
|
7172
|
-
"
|
|
7173
|
-
"
|
|
7174
|
-
"+-------+
|
|
7175
|
-
"|
|
|
7176
|
-
"+-------+
|
|
7197
|
+
" +-----------------+",
|
|
7198
|
+
" | Your document |",
|
|
7199
|
+
" +--------+--------+",
|
|
7200
|
+
" |",
|
|
7201
|
+
" +-----------+------+-----+------------+",
|
|
7202
|
+
" | | | |",
|
|
7203
|
+
" v v v v",
|
|
7204
|
+
"+-------+ +--------+ +----------+ +---------+",
|
|
7205
|
+
"| PDF | | Word | | Slides | | Video |",
|
|
7206
|
+
"+-------+ +--------+ +----------+ +---------+",
|
|
7177
7207
|
"```",
|
|
7178
7208
|
"",
|
|
7179
|
-
"##
|
|
7180
|
-
"",
|
|
7181
|
-
"Use the rich editor for headings, lists, tables, links, images, media, and everyday formatting. Switch to raw Markdown for exact control. Add themes, transform styles, and squiggly-square section annotations when a passage deserves its own visual treatment. The readable `.md` source stays at the center of the workflow.",
|
|
7209
|
+
"## Present it or send it {[content]}",
|
|
7182
7210
|
"",
|
|
7183
|
-
"
|
|
7211
|
+
"Each heading starts a new slide, so this document is already a slideshow. Choose **Slideshow** at the top to see it, or **Export** to save it as a PDF, a Word document, a PowerPoint deck, an e-book, a web page, or a video.",
|
|
7184
7212
|
"",
|
|
7185
|
-
"
|
|
7186
|
-
"- **Page** \u2014 See how it behaves as a web page.",
|
|
7187
|
-
"- **Slideshow** \u2014 Step through headings as designed presentation blocks.",
|
|
7188
|
-
"- **Video** \u2014 Rehearse timing, motion, narration, and media in a player-ready view.",
|
|
7213
|
+
"## Your documents stay yours {[factCard]}",
|
|
7189
7214
|
"",
|
|
7190
|
-
"
|
|
7215
|
+
"There is no account to create. Your documents stay on this device as plain text files that other apps can open too. Choose **Back up** at the bottom of the file list to keep a copy somewhere safe.",
|
|
7191
7216
|
"",
|
|
7192
|
-
"
|
|
7193
|
-
"- **Dictation and read aloud** run on your computer. Where available, open **Settings \u2192 Speech** to download a dictation model or narration voices, then use the microphone or read-aloud controls.",
|
|
7194
|
-
"- These tools depend on the app, device, and installed models. Writing, previewing, and exporting work without setting them up.",
|
|
7217
|
+
"## Make your own {[list]}",
|
|
7195
7218
|
"",
|
|
7196
|
-
"
|
|
7219
|
+
"1. Choose **New File** above the file list and give it a name.",
|
|
7220
|
+
"2. Write a heading and a few sentences.",
|
|
7221
|
+
"3. Choose **Slideshow** to present it, or **Export** to share it.",
|
|
7197
7222
|
"",
|
|
7198
|
-
"
|
|
7199
|
-
"- **Automatic saving** protects the active revision while still surfacing conflicts or save errors.",
|
|
7200
|
-
"- **Optional version history** keeps plain sibling revisions when you want a trail of changes.",
|
|
7201
|
-
"- **Copy-by-link sharing** puts a Markdown copy in a link that opens straight into a Document, Page, Slideshow, or Video view.",
|
|
7202
|
-
"- **Offline-ready, local-first storage** keeps browser work on this device and native work inside folders you choose.",
|
|
7223
|
+
"## Go further {[list]}",
|
|
7203
7224
|
"",
|
|
7204
|
-
"
|
|
7205
|
-
"",
|
|
7206
|
-
"-
|
|
7207
|
-
"- Create **PowerPoint decks** from the same annotated sections you preview as a slideshow.",
|
|
7208
|
-
"- Publish **HTML pages, packaged HTML, and EPUB e-books**.",
|
|
7209
|
-
"- Keep portable **Markdown or DBK bundles** with their media assets.",
|
|
7210
|
-
"- Use the linked CLI registry for **spreadsheets, MP4 video, animated GIF, batch conversion, and more**.",
|
|
7211
|
-
"",
|
|
7212
|
-
"## Local-first is concrete, not decorative {[quote]}",
|
|
7213
|
-
"",
|
|
7214
|
-
"> Your browser workspace stays on this device. Native folders are opened only when you choose them. Your Markdown remains useful in DocBlocks, Git, a terminal, another editor, or an AI-assisted workflow.",
|
|
7215
|
-
"",
|
|
7216
|
-
"## Agents get document tools, not a blank check {[factCard]}",
|
|
7217
|
-
"",
|
|
7218
|
-
"The local MCP server converts plain text or Markdown directly and can optionally inspect, preview, or compare documents. Results remain temporary session artifacts until they are deliberately saved, and filesystem access begins with explicit roots rather than assumed authority.",
|
|
7219
|
-
"",
|
|
7220
|
-
"## Take your documents to another app {[content]}",
|
|
7221
|
-
"",
|
|
7222
|
-
"DocBlocks does not automatically sync workspaces between apps or devices. Open the same folder in Desktop or VS Code, or export Markdown and its media to move your work. A DBK bundle keeps documents and media together for another DocBlocks app. A share link contains a snapshot; later edits do not update that copy.",
|
|
7223
|
-
"",
|
|
7224
|
-
"## Explore DocBlocks {[list]}",
|
|
7225
|
-
"",
|
|
7226
|
-
"- [Desktop app](https://docblocks.com/desktop/) \u2014 downloads and first steps for macOS (Apple silicon), Windows, and Linux.",
|
|
7227
|
-
"- [Web app](https://docblocks.com/web/) \u2014 browser storage, installation, and offline use.",
|
|
7228
|
-
"- [Mobile preview](https://docblocks.com/docs/#mobile-preview) \u2014 iPhone, iPad, and Android status and build guide.",
|
|
7229
|
-
"- [VS Code extension](https://docblocks.com/vscode/) \u2014 rich Markdown editing inside a workspace.",
|
|
7230
|
-
"- [CLI and MCP server](https://docblocks.com/cli/) \u2014 conversion, rendering, and agent workflows.",
|
|
7231
|
-
"- [Supported formats](https://docblocks.com/formats/) \u2014 current import and export directions.",
|
|
7232
|
-
"- [Documentation](https://docblocks.com/docs/) \u2014 compare the apps and follow the getting-started guides.",
|
|
7225
|
+
"- [Get the desktop app](https://docblocks.com/desktop/) to work in folders on your computer.",
|
|
7226
|
+
"- [Add DocBlocks to VS Code](https://docblocks.com/vscode/) to edit documents beside your code.",
|
|
7227
|
+
"- [Read the guides](https://docblocks.com/docs/) for everything else.",
|
|
7233
7228
|
// End with a newline, as the Write view saves every document. Without it,
|
|
7234
7229
|
// merely opening the welcome document in Write rewrote the file.
|
|
7235
7230
|
""
|
|
7236
7231
|
].join("\n");
|
|
7237
7232
|
|
|
7238
7233
|
// src/DocBlocksShell/DocBlocksShell.tsx
|
|
7239
|
-
import { Fragment as Fragment11, jsx as
|
|
7234
|
+
import { Fragment as Fragment11, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
7240
7235
|
var editorShellModulePromise = null;
|
|
7241
7236
|
function loadEditorShell() {
|
|
7242
7237
|
editorShellModulePromise ?? (editorShellModulePromise = (async () => {
|
|
@@ -7254,7 +7249,7 @@ var QuickOpenDialog = lazy2(
|
|
|
7254
7249
|
() => import("./QuickOpenDialog-2KK4SEBU.js").then((m) => ({ default: m.QuickOpenDialog }))
|
|
7255
7250
|
);
|
|
7256
7251
|
var KeyboardShortcutsDialog = lazy2(
|
|
7257
|
-
() => import("./KeyboardShortcutsDialog-
|
|
7252
|
+
() => import("./KeyboardShortcutsDialog-G5OBDTNR.js").then((m) => ({ default: m.KeyboardShortcutsDialog }))
|
|
7258
7253
|
);
|
|
7259
7254
|
var WorkspaceSearchPanel = lazy2(
|
|
7260
7255
|
() => import("./WorkspaceSearchPanel-J6BKEZQJ.js").then((m) => ({
|
|
@@ -7268,22 +7263,22 @@ var GitToolbarControl = lazy2(
|
|
|
7268
7263
|
() => import("./GitToolbarControl-B7KG4MFP.js").then((m) => ({ default: m.GitToolbarControl }))
|
|
7269
7264
|
);
|
|
7270
7265
|
var AiToolbarControl = lazy2(
|
|
7271
|
-
() => import("./AiEditorAssistant-
|
|
7266
|
+
() => import("./AiEditorAssistant-YLJ5OZK2.js").then((module) => ({
|
|
7272
7267
|
default: module.AiToolbarControl
|
|
7273
7268
|
}))
|
|
7274
7269
|
);
|
|
7275
7270
|
var PresentationMaker = lazy2(
|
|
7276
|
-
() => import("./PresentationMaker-
|
|
7271
|
+
() => import("./PresentationMaker-P2JP6UUX.js").then((module) => ({
|
|
7277
7272
|
default: module.PresentationMaker
|
|
7278
7273
|
}))
|
|
7279
7274
|
);
|
|
7280
7275
|
var AiReviewPanel = lazy2(
|
|
7281
|
-
() => import("./AiEditorAssistant-
|
|
7276
|
+
() => import("./AiEditorAssistant-YLJ5OZK2.js").then((module) => ({
|
|
7282
7277
|
default: module.AiReviewPanel
|
|
7283
7278
|
}))
|
|
7284
7279
|
);
|
|
7285
7280
|
var AiIllustratePanel = lazy2(
|
|
7286
|
-
() => import("./AiDiagrams-
|
|
7281
|
+
() => import("./AiDiagrams-QE3LVYFK.js").then((module) => ({
|
|
7287
7282
|
default: module.AiIllustratePanel
|
|
7288
7283
|
}))
|
|
7289
7284
|
);
|
|
@@ -7565,7 +7560,7 @@ async function createHostProviderFromWorkspace(ws) {
|
|
|
7565
7560
|
var DESKTOP_TOOLBAR_WRAP_WIDTH = 900;
|
|
7566
7561
|
var WEB_TOOLBAR_WRAP_WIDTH = 700;
|
|
7567
7562
|
function FolderGlyph() {
|
|
7568
|
-
return /* @__PURE__ */
|
|
7563
|
+
return /* @__PURE__ */ jsx18(
|
|
7569
7564
|
"svg",
|
|
7570
7565
|
{
|
|
7571
7566
|
viewBox: "0 0 24 24",
|
|
@@ -7574,12 +7569,12 @@ function FolderGlyph() {
|
|
|
7574
7569
|
strokeWidth: "1.5",
|
|
7575
7570
|
strokeLinejoin: "round",
|
|
7576
7571
|
"aria-hidden": "true",
|
|
7577
|
-
children: /* @__PURE__ */
|
|
7572
|
+
children: /* @__PURE__ */ jsx18("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" })
|
|
7578
7573
|
}
|
|
7579
7574
|
);
|
|
7580
7575
|
}
|
|
7581
7576
|
function FileGlyph() {
|
|
7582
|
-
return /* @__PURE__ */
|
|
7577
|
+
return /* @__PURE__ */ jsxs16(
|
|
7583
7578
|
"svg",
|
|
7584
7579
|
{
|
|
7585
7580
|
viewBox: "0 0 24 24",
|
|
@@ -7589,14 +7584,14 @@ function FileGlyph() {
|
|
|
7589
7584
|
strokeLinejoin: "round",
|
|
7590
7585
|
"aria-hidden": "true",
|
|
7591
7586
|
children: [
|
|
7592
|
-
/* @__PURE__ */
|
|
7593
|
-
/* @__PURE__ */
|
|
7587
|
+
/* @__PURE__ */ jsx18("path", { d: "M6 3h8l5 5v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z" }),
|
|
7588
|
+
/* @__PURE__ */ jsx18("path", { d: "M14 3v5h5" })
|
|
7594
7589
|
]
|
|
7595
7590
|
}
|
|
7596
7591
|
);
|
|
7597
7592
|
}
|
|
7598
7593
|
function CollapseSidebarGlyph() {
|
|
7599
|
-
return /* @__PURE__ */
|
|
7594
|
+
return /* @__PURE__ */ jsxs16(
|
|
7600
7595
|
"svg",
|
|
7601
7596
|
{
|
|
7602
7597
|
viewBox: "0 0 64 64",
|
|
@@ -7607,9 +7602,9 @@ function CollapseSidebarGlyph() {
|
|
|
7607
7602
|
strokeLinejoin: "round",
|
|
7608
7603
|
"aria-hidden": "true",
|
|
7609
7604
|
children: [
|
|
7610
|
-
/* @__PURE__ */
|
|
7611
|
-
/* @__PURE__ */
|
|
7612
|
-
/* @__PURE__ */
|
|
7605
|
+
/* @__PURE__ */ jsx18("rect", { x: "7", y: "10", width: "50", height: "44", rx: "6" }),
|
|
7606
|
+
/* @__PURE__ */ jsx18("path", { d: "M24 10v44" }),
|
|
7607
|
+
/* @__PURE__ */ jsx18("path", { d: "m17 25-7 7 7 7" })
|
|
7613
7608
|
]
|
|
7614
7609
|
}
|
|
7615
7610
|
);
|
|
@@ -7841,6 +7836,7 @@ function DocBlocksShell({
|
|
|
7841
7836
|
);
|
|
7842
7837
|
const [provider, setProvider] = useState23(null);
|
|
7843
7838
|
const [workspaceStartupError, setWorkspaceStartupError] = useState23(null);
|
|
7839
|
+
const workspaceStarting = provider === null && workspaceStartupError === null;
|
|
7844
7840
|
const [activeWorkspaceId, setActiveWorkspaceId] = useState23(null);
|
|
7845
7841
|
const [defaultNewFileFormat, setDefaultNewFileFormat] = useState23(DEFAULT_NEW_FILE_FORMAT);
|
|
7846
7842
|
useEffect29(() => {
|
|
@@ -8194,7 +8190,6 @@ function DocBlocksShell({
|
|
|
8194
8190
|
} : null,
|
|
8195
8191
|
[documentSnapshot.frozen, documentSnapshot.generation, documentSnapshot.targetKey]
|
|
8196
8192
|
);
|
|
8197
|
-
const [editorPresentationEpoch, setEditorPresentationEpoch] = useState23(0);
|
|
8198
8193
|
const [editorGeneration, setEditorGeneration] = useState23(documentSnapshot.generation);
|
|
8199
8194
|
useEffect29(() => {
|
|
8200
8195
|
const sync = () => setEditorGeneration(documentSession.getSnapshot().generation);
|
|
@@ -8208,7 +8203,7 @@ function DocBlocksShell({
|
|
|
8208
8203
|
useEffect29(() => {
|
|
8209
8204
|
setOutsideInPdfWorker(pdfWorkerSrc2);
|
|
8210
8205
|
}, [pdfWorkerSrc2]);
|
|
8211
|
-
const editorKey =
|
|
8206
|
+
const editorKey = String(editorGeneration);
|
|
8212
8207
|
const editorPlaceholder = useMemo6(() => {
|
|
8213
8208
|
void editorKey;
|
|
8214
8209
|
return pickEmptyDocumentPrompt();
|
|
@@ -8228,6 +8223,15 @@ function DocBlocksShell({
|
|
|
8228
8223
|
const [initialView, setInitialView] = useState23("wysiwyg");
|
|
8229
8224
|
const [initialSharedMode, setInitialSharedMode] = useState23(null);
|
|
8230
8225
|
const [showWelcomeGateway, setShowWelcomeGateway] = useState23(false);
|
|
8226
|
+
const welcomeScreenShown = showWelcomeGateway && !singlePane;
|
|
8227
|
+
const welcomeCoveredRef = useRef19(null);
|
|
8228
|
+
useInert(welcomeCoveredRef, welcomeScreenShown);
|
|
8229
|
+
const closeWelcomeGateway = useCallback18(() => {
|
|
8230
|
+
setShowWelcomeGateway((showing) => {
|
|
8231
|
+
if (showing) markWelcomeGatewayDismissed();
|
|
8232
|
+
return false;
|
|
8233
|
+
});
|
|
8234
|
+
}, []);
|
|
8231
8235
|
const [aiPanel, setAiPanel] = useState23(null);
|
|
8232
8236
|
const navigationRequestRef = useRef19(0);
|
|
8233
8237
|
const workspaceAuthorityBarrier = useMemo6(() => new WorkspaceAuthorityBarrier(), []);
|
|
@@ -8536,6 +8540,7 @@ function DocBlocksShell({
|
|
|
8536
8540
|
options.navigationRequestId,
|
|
8537
8541
|
options.sharedMode ?? null
|
|
8538
8542
|
) !== null;
|
|
8543
|
+
if (opened) closeWelcomeGateway();
|
|
8539
8544
|
return opened;
|
|
8540
8545
|
} finally {
|
|
8541
8546
|
if (!opened && getTransientWorkspace(options.id)?.provider === options.provider) {
|
|
@@ -8543,7 +8548,7 @@ function DocBlocksShell({
|
|
|
8543
8548
|
}
|
|
8544
8549
|
}
|
|
8545
8550
|
},
|
|
8546
|
-
[openFromIds]
|
|
8551
|
+
[openFromIds, closeWelcomeGateway]
|
|
8547
8552
|
);
|
|
8548
8553
|
const openSharedDocument = useCallback18(
|
|
8549
8554
|
async (payload, navigationRequestId) => {
|
|
@@ -8585,18 +8590,18 @@ function DocBlocksShell({
|
|
|
8585
8590
|
const entries = await readProviderDirectory2(fs, "/");
|
|
8586
8591
|
if (!isCurrent()) return;
|
|
8587
8592
|
const visibleEntries = filterVisibleFileEntries(entries);
|
|
8588
|
-
if (visibleEntries.length === 1 && visibleEntries[0].kind === "file" && visibleEntries[0].path
|
|
8593
|
+
if (visibleEntries.length === 1 && visibleEntries[0].kind === "file" && isWelcomeDocumentPath(visibleEntries[0].path)) {
|
|
8589
8594
|
const aboutPath = visibleEntries[0].path;
|
|
8590
8595
|
const content = await readProviderText(fs, aboutPath);
|
|
8591
8596
|
if (content !== null && isCurrent()) {
|
|
8592
8597
|
await documentSession.transitionTo(createDocumentTarget(fs, fs.id, aboutPath), content);
|
|
8593
8598
|
if (!isCurrent()) return;
|
|
8594
8599
|
adoptRegularDocument(aboutPath);
|
|
8595
|
-
setInitialView("
|
|
8600
|
+
setInitialView("wysiwyg");
|
|
8596
8601
|
setInitialSharedMode(null);
|
|
8597
8602
|
setExplorerKey((k) => k + 1);
|
|
8598
8603
|
pushHash(fs.id, aboutPath);
|
|
8599
|
-
saveLastState({ workspaceId: fs.id, filePath: aboutPath, view: "
|
|
8604
|
+
saveLastState({ workspaceId: fs.id, filePath: aboutPath, view: "wysiwyg" });
|
|
8600
8605
|
if (!isWelcomeGatewayDismissed()) setShowWelcomeGateway(true);
|
|
8601
8606
|
}
|
|
8602
8607
|
return;
|
|
@@ -8620,11 +8625,11 @@ function DocBlocksShell({
|
|
|
8620
8625
|
);
|
|
8621
8626
|
if (!isCurrent()) return;
|
|
8622
8627
|
adoptRegularDocument(welcomePath);
|
|
8623
|
-
setInitialView("
|
|
8628
|
+
setInitialView("wysiwyg");
|
|
8624
8629
|
setInitialSharedMode(null);
|
|
8625
8630
|
setExplorerKey((k) => k + 1);
|
|
8626
8631
|
pushHash(fs.id, welcomePath);
|
|
8627
|
-
saveLastState({ workspaceId: fs.id, filePath: welcomePath, view: "
|
|
8632
|
+
saveLastState({ workspaceId: fs.id, filePath: welcomePath, view: "wysiwyg" });
|
|
8628
8633
|
if (!isWelcomeGatewayDismissed()) setShowWelcomeGateway(true);
|
|
8629
8634
|
},
|
|
8630
8635
|
[adoptRegularDocument, createDocumentTarget, documentSession, pushHash]
|
|
@@ -8635,21 +8640,16 @@ function DocBlocksShell({
|
|
|
8635
8640
|
startupOpenSharedDocumentRef.current = openSharedDocument;
|
|
8636
8641
|
const startupSeedWelcomeFileRef = useRef19(seedWelcomeFile);
|
|
8637
8642
|
startupSeedWelcomeFileRef.current = seedWelcomeFile;
|
|
8638
|
-
const
|
|
8639
|
-
|
|
8640
|
-
if (showing) markWelcomeGatewayDismissed();
|
|
8641
|
-
return false;
|
|
8642
|
-
});
|
|
8643
|
-
}, []);
|
|
8644
|
-
const handleStartWriting = useCallback18(() => {
|
|
8643
|
+
const [focusAfterWelcome, setFocusAfterWelcome] = useState23(false);
|
|
8644
|
+
const handleTourWelcome = useCallback18(() => {
|
|
8645
8645
|
closeWelcomeGateway();
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
if (
|
|
8650
|
-
|
|
8651
|
-
}
|
|
8652
|
-
}, [
|
|
8646
|
+
setFocusAfterWelcome(true);
|
|
8647
|
+
}, [closeWelcomeGateway]);
|
|
8648
|
+
useEffect29(() => {
|
|
8649
|
+
if (!focusAfterWelcome || welcomeScreenShown) return;
|
|
8650
|
+
setFocusAfterWelcome(false);
|
|
8651
|
+
editorAreaRef.current?.querySelector('[contenteditable="true"]')?.focus({ preventScroll: true });
|
|
8652
|
+
}, [focusAfterWelcome, welcomeScreenShown]);
|
|
8653
8653
|
useEffect29(() => {
|
|
8654
8654
|
const requestId = ++navigationRequestRef.current;
|
|
8655
8655
|
let cancelled = false;
|
|
@@ -9882,14 +9882,20 @@ function DocBlocksShell({
|
|
|
9882
9882
|
"new-folder": () => void handleNewFolder(),
|
|
9883
9883
|
shortcuts: openKeyboardShortcuts,
|
|
9884
9884
|
"toggle-sidebar": () => {
|
|
9885
|
+
if (canRestoreSplitView) {
|
|
9886
|
+
updateSidebarPreference("pinned");
|
|
9887
|
+
return;
|
|
9888
|
+
}
|
|
9885
9889
|
if (singlePane) {
|
|
9886
9890
|
setMobileShowEditor((showingEditor) => !showingEditor);
|
|
9887
9891
|
return;
|
|
9888
9892
|
}
|
|
9889
|
-
updateSidebarPreference(
|
|
9893
|
+
updateSidebarPreference("collapsed");
|
|
9894
|
+
setMobileShowEditor(true);
|
|
9890
9895
|
},
|
|
9891
9896
|
"focus-files": () => {
|
|
9892
9897
|
if (singlePane) setMobileShowEditor(false);
|
|
9898
|
+
setSidebarView("files");
|
|
9893
9899
|
window.requestAnimationFrame(() => {
|
|
9894
9900
|
const tree = document.querySelector(".db-tree");
|
|
9895
9901
|
const target = tree?.querySelector('.db-tree-row[tabindex="0"]') ?? tree?.querySelector(".db-tree-row");
|
|
@@ -9919,7 +9925,7 @@ function DocBlocksShell({
|
|
|
9919
9925
|
openKeyboardShortcuts,
|
|
9920
9926
|
singlePane,
|
|
9921
9927
|
mobileShowEditor,
|
|
9922
|
-
|
|
9928
|
+
canRestoreSplitView,
|
|
9923
9929
|
updateSidebarPreference
|
|
9924
9930
|
]
|
|
9925
9931
|
);
|
|
@@ -10256,24 +10262,12 @@ function DocBlocksShell({
|
|
|
10256
10262
|
}
|
|
10257
10263
|
if (target.kind === "fragment") return false;
|
|
10258
10264
|
if (target.kind === "external") {
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
);
|
|
10266
|
-
});
|
|
10267
|
-
} else if (typeof window !== "undefined") {
|
|
10268
|
-
try {
|
|
10269
|
-
window.open(target.url, "_blank", "noopener,noreferrer");
|
|
10270
|
-
} catch (error) {
|
|
10271
|
-
showToast(
|
|
10272
|
-
"error",
|
|
10273
|
-
error instanceof Error ? error.message : "Could not open the external link."
|
|
10274
|
-
);
|
|
10275
|
-
}
|
|
10276
|
-
}
|
|
10265
|
+
void openExternalUrl(target.url).catch((error) => {
|
|
10266
|
+
showToast(
|
|
10267
|
+
"error",
|
|
10268
|
+
error instanceof Error ? error.message : "Could not open the external link."
|
|
10269
|
+
);
|
|
10270
|
+
});
|
|
10277
10271
|
return true;
|
|
10278
10272
|
}
|
|
10279
10273
|
void (async () => {
|
|
@@ -10796,6 +10790,7 @@ function DocBlocksShell({
|
|
|
10796
10790
|
if (!opened && requestId === navigationRequestRef.current) {
|
|
10797
10791
|
throw new Error("The requested workspace file is no longer available.");
|
|
10798
10792
|
}
|
|
10793
|
+
if (opened) closeWelcomeGateway();
|
|
10799
10794
|
return opened;
|
|
10800
10795
|
}
|
|
10801
10796
|
);
|
|
@@ -10807,7 +10802,7 @@ function DocBlocksShell({
|
|
|
10807
10802
|
);
|
|
10808
10803
|
});
|
|
10809
10804
|
});
|
|
10810
|
-
}, [openFromIds, openTransient, workspaceAuthorityBarrier, showToast]);
|
|
10805
|
+
}, [openFromIds, openTransient, workspaceAuthorityBarrier, showToast, closeWelcomeGateway]);
|
|
10811
10806
|
const openTransientFromHandle = useCallback18(
|
|
10812
10807
|
async (handle) => {
|
|
10813
10808
|
const name = handle.name;
|
|
@@ -11110,7 +11105,7 @@ function DocBlocksShell({
|
|
|
11110
11105
|
transitionAwayFromDocument
|
|
11111
11106
|
]
|
|
11112
11107
|
);
|
|
11113
|
-
return /* @__PURE__ */
|
|
11108
|
+
return /* @__PURE__ */ jsx18(
|
|
11114
11109
|
"div",
|
|
11115
11110
|
{
|
|
11116
11111
|
ref: shellRef,
|
|
@@ -11119,10 +11114,10 @@ function DocBlocksShell({
|
|
|
11119
11114
|
"data-accent": accentColor,
|
|
11120
11115
|
"data-interface-font": interfaceFont === "fixed" ? "fixed" : void 0,
|
|
11121
11116
|
"data-document-status": documentSnapshot.status,
|
|
11122
|
-
children: /* @__PURE__ */
|
|
11117
|
+
children: /* @__PURE__ */ jsxs16(GitContext.Provider, { value: git, children: [
|
|
11123
11118
|
promptDialog,
|
|
11124
11119
|
confirmDialog,
|
|
11125
|
-
quickOpenOpen && activeWorkspaceId && /* @__PURE__ */
|
|
11120
|
+
quickOpenOpen && activeWorkspaceId && /* @__PURE__ */ jsx18(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx18(
|
|
11126
11121
|
QuickOpenDialog,
|
|
11127
11122
|
{
|
|
11128
11123
|
index: workspaceIndex.index,
|
|
@@ -11136,8 +11131,8 @@ function DocBlocksShell({
|
|
|
11136
11131
|
onClose: () => setQuickOpenOpen(false)
|
|
11137
11132
|
}
|
|
11138
11133
|
) }),
|
|
11139
|
-
shortcutsOpen && /* @__PURE__ */
|
|
11140
|
-
newDocumentDialogOpen && /* @__PURE__ */
|
|
11134
|
+
shortcutsOpen && /* @__PURE__ */ jsx18(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx18(KeyboardShortcutsDialog, { onClose: () => setShortcutsOpen(false) }) }),
|
|
11135
|
+
newDocumentDialogOpen && /* @__PURE__ */ jsx18(
|
|
11141
11136
|
NewDocumentDialog,
|
|
11142
11137
|
{
|
|
11143
11138
|
initialFormat: defaultNewFileFormat,
|
|
@@ -11147,8 +11142,8 @@ function DocBlocksShell({
|
|
|
11147
11142
|
}
|
|
11148
11143
|
}
|
|
11149
11144
|
),
|
|
11150
|
-
workspaceStartupError && /* @__PURE__ */
|
|
11151
|
-
saveToast && /* @__PURE__ */
|
|
11145
|
+
workspaceStartupError && /* @__PURE__ */ jsx18("div", { className: "db-save-toast db-save-toast--error", role: "alert", "aria-live": "assertive", children: workspaceStartupError }),
|
|
11146
|
+
saveToast && /* @__PURE__ */ jsx18(
|
|
11152
11147
|
"div",
|
|
11153
11148
|
{
|
|
11154
11149
|
className: "db-save-toast db-save-toast--" + saveToast.kind,
|
|
@@ -11157,12 +11152,12 @@ function DocBlocksShell({
|
|
|
11157
11152
|
children: saveToast.message
|
|
11158
11153
|
}
|
|
11159
11154
|
),
|
|
11160
|
-
offlineReadyToast && !saveToast && /* @__PURE__ */
|
|
11161
|
-
documentSnapshot.conflict && /* @__PURE__ */
|
|
11162
|
-
/* @__PURE__ */
|
|
11163
|
-
/* @__PURE__ */
|
|
11155
|
+
offlineReadyToast && !saveToast && /* @__PURE__ */ jsx18("div", { className: "db-save-toast db-save-toast--success", role: "status", "aria-live": "polite", children: "DocBlocks is ready to work offline." }),
|
|
11156
|
+
documentSnapshot.conflict && /* @__PURE__ */ jsxs16("div", { className: "db-document-conflict", role: "alert", children: [
|
|
11157
|
+
/* @__PURE__ */ jsx18("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." }),
|
|
11158
|
+
/* @__PURE__ */ jsx18("div", { className: "db-document-conflict-actions", children: /* @__PURE__ */ jsx18("button", { type: "button", onClick: () => setShowConflictComparison(true), children: "Compare versions" }) })
|
|
11164
11159
|
] }),
|
|
11165
|
-
documentSnapshot.conflict && showConflictComparison && /* @__PURE__ */
|
|
11160
|
+
documentSnapshot.conflict && showConflictComparison && /* @__PURE__ */ jsx18(Suspense2, { fallback: /* @__PURE__ */ jsx18("div", { role: "status", children: "Loading version comparison\u2026" }), children: /* @__PURE__ */ jsx18(
|
|
11166
11161
|
DocumentConflictDialog,
|
|
11167
11162
|
{
|
|
11168
11163
|
conflict: documentSnapshot.conflict,
|
|
@@ -11172,14 +11167,14 @@ function DocBlocksShell({
|
|
|
11172
11167
|
onClose: () => setShowConflictComparison(false)
|
|
11173
11168
|
}
|
|
11174
11169
|
) }),
|
|
11175
|
-
storageFull && !documentSnapshot.conflict && /* @__PURE__ */
|
|
11176
|
-
/* @__PURE__ */
|
|
11177
|
-
/* @__PURE__ */
|
|
11178
|
-
/* @__PURE__ */
|
|
11179
|
-
/* @__PURE__ */
|
|
11170
|
+
storageFull && !documentSnapshot.conflict && /* @__PURE__ */ jsxs16("div", { className: "db-storage-full-banner", role: "alert", children: [
|
|
11171
|
+
/* @__PURE__ */ jsx18("span", { children: "Browser storage is full -- changes can\u2019t be saved. Free up space or back up your work now." }),
|
|
11172
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-storage-full-banner-actions", children: [
|
|
11173
|
+
/* @__PURE__ */ jsx18("button", { type: "button", onClick: () => void handleDownloadAllWorkspaces(), children: "Back up all workspaces" }),
|
|
11174
|
+
/* @__PURE__ */ jsx18("button", { type: "button", onClick: () => setStorageFull(false), children: "Dismiss" })
|
|
11180
11175
|
] })
|
|
11181
11176
|
] }),
|
|
11182
|
-
workspaceSettingsOpen && activeWorkspaceDescriptor && /* @__PURE__ */
|
|
11177
|
+
workspaceSettingsOpen && activeWorkspaceDescriptor && /* @__PURE__ */ jsx18(
|
|
11183
11178
|
WorkspaceSettingsDialog,
|
|
11184
11179
|
{
|
|
11185
11180
|
workspace: activeWorkspaceDescriptor,
|
|
@@ -11192,8 +11187,8 @@ function DocBlocksShell({
|
|
|
11192
11187
|
onClose: () => setWorkspaceSettingsOpen(false)
|
|
11193
11188
|
}
|
|
11194
11189
|
),
|
|
11195
|
-
/* @__PURE__ */
|
|
11196
|
-
/* @__PURE__ */
|
|
11190
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-shell-panes", ref: panesRef, children: [
|
|
11191
|
+
/* @__PURE__ */ jsxs16(
|
|
11197
11192
|
"aside",
|
|
11198
11193
|
{
|
|
11199
11194
|
ref: sidebarRef,
|
|
@@ -11201,8 +11196,8 @@ function DocBlocksShell({
|
|
|
11201
11196
|
"aria-label": "Workspace and files",
|
|
11202
11197
|
style: singlePane ? void 0 : { width: `${sidebarWidth}px` },
|
|
11203
11198
|
children: [
|
|
11204
|
-
/* @__PURE__ */
|
|
11205
|
-
/* @__PURE__ */
|
|
11199
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-shell-sidebar-header", children: [
|
|
11200
|
+
/* @__PURE__ */ jsx18(
|
|
11206
11201
|
AppMenu,
|
|
11207
11202
|
{
|
|
11208
11203
|
logoUrl,
|
|
@@ -11236,10 +11231,11 @@ function DocBlocksShell({
|
|
|
11236
11231
|
settingsRequest
|
|
11237
11232
|
}
|
|
11238
11233
|
),
|
|
11239
|
-
/* @__PURE__ */
|
|
11234
|
+
/* @__PURE__ */ jsx18(
|
|
11240
11235
|
WorkspacePicker,
|
|
11241
11236
|
{
|
|
11242
11237
|
activeWorkspaceId,
|
|
11238
|
+
loading: workspaceStarting,
|
|
11243
11239
|
refreshKey: descriptorRefreshKey,
|
|
11244
11240
|
onSelect: handleWorkspaceSelect,
|
|
11245
11241
|
onOpenFolder: handleOpenFolder,
|
|
@@ -11247,7 +11243,7 @@ function DocBlocksShell({
|
|
|
11247
11243
|
onRemoveWorkspace: (workspace) => void handleRemoveWorkspace(workspace.id)
|
|
11248
11244
|
}
|
|
11249
11245
|
),
|
|
11250
|
-
/* @__PURE__ */
|
|
11246
|
+
/* @__PURE__ */ jsx18(
|
|
11251
11247
|
WorkspaceSettingsButton,
|
|
11252
11248
|
{
|
|
11253
11249
|
onSettings: handleOpenWorkspaceSettings,
|
|
@@ -11258,28 +11254,29 @@ function DocBlocksShell({
|
|
|
11258
11254
|
}
|
|
11259
11255
|
}
|
|
11260
11256
|
),
|
|
11261
|
-
canRestoreSplitView && /* @__PURE__ */
|
|
11257
|
+
canRestoreSplitView && /* @__PURE__ */ jsx18(
|
|
11262
11258
|
"button",
|
|
11263
11259
|
{
|
|
11264
11260
|
className: "db-restore-split",
|
|
11265
11261
|
onClick: () => updateSidebarPreference("pinned"),
|
|
11266
11262
|
"aria-label": "Restore split view",
|
|
11267
11263
|
title: "Restore split view",
|
|
11268
|
-
children: /* @__PURE__ */
|
|
11264
|
+
children: /* @__PURE__ */ jsx18(SplitViewIcon, {})
|
|
11269
11265
|
}
|
|
11270
11266
|
),
|
|
11271
|
-
/* @__PURE__ */
|
|
11267
|
+
/* @__PURE__ */ jsx18("span", { className: "db-window-drag-grip", "aria-hidden": true })
|
|
11272
11268
|
] }),
|
|
11273
|
-
git.available && /* @__PURE__ */
|
|
11269
|
+
git.available && /* @__PURE__ */ jsx18(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx18(
|
|
11274
11270
|
GitUI,
|
|
11275
11271
|
{
|
|
11276
11272
|
onOpenFile: (path) => void handleSelect(path, "file"),
|
|
11277
11273
|
onWorkspaceCloned: handleWorkspaceCloned
|
|
11278
11274
|
}
|
|
11279
11275
|
) }),
|
|
11280
|
-
/* @__PURE__ */
|
|
11276
|
+
/* @__PURE__ */ jsx18(
|
|
11281
11277
|
FileExplorer,
|
|
11282
11278
|
{
|
|
11279
|
+
loading: workspaceStarting,
|
|
11283
11280
|
className: sidebarView === "search" ? "db-sidebar-view--hidden" : void 0,
|
|
11284
11281
|
onShowSearch: canBrowseWorkspace ? openWorkspaceSearch : void 0,
|
|
11285
11282
|
searchShortcutLabel: searchShortcut,
|
|
@@ -11311,7 +11308,7 @@ function DocBlocksShell({
|
|
|
11311
11308
|
},
|
|
11312
11309
|
explorerKey
|
|
11313
11310
|
),
|
|
11314
|
-
searchMounted && /* @__PURE__ */
|
|
11311
|
+
searchMounted && /* @__PURE__ */ jsx18(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx18(
|
|
11315
11312
|
WorkspaceSearchPanel,
|
|
11316
11313
|
{
|
|
11317
11314
|
index: workspaceIndex.index,
|
|
@@ -11322,41 +11319,38 @@ function DocBlocksShell({
|
|
|
11322
11319
|
onShowFiles: () => setSidebarView("files")
|
|
11323
11320
|
}
|
|
11324
11321
|
) }),
|
|
11325
|
-
singlePane && showWelcomeGateway && /* @__PURE__ */
|
|
11326
|
-
/* @__PURE__ */
|
|
11327
|
-
/* @__PURE__ */
|
|
11328
|
-
/* @__PURE__ */
|
|
11329
|
-
|
|
11330
|
-
|
|
11322
|
+
singlePane && showWelcomeGateway && /* @__PURE__ */ jsxs16("section", { className: "db-mobile-first-run", "aria-labelledby": "db-mobile-first-run-title", children: [
|
|
11323
|
+
/* @__PURE__ */ jsx18("p", { className: "db-mobile-first-run-eyebrow", children: "Local-first Markdown editor" }),
|
|
11324
|
+
/* @__PURE__ */ jsx18("h1", { id: "db-mobile-first-run-title", children: "Welcome to DocBlocks" }),
|
|
11325
|
+
/* @__PURE__ */ jsxs16("p", { children: [
|
|
11326
|
+
WELCOME_SUMMARY,
|
|
11327
|
+
" ",
|
|
11328
|
+
WELCOME_PRIVACY_NOTE
|
|
11329
|
+
] }),
|
|
11330
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-mobile-first-run-actions", children: [
|
|
11331
|
+
/* @__PURE__ */ jsx18("button", { type: "button", onClick: () => void handleNewFile(), children: "Create a document" }),
|
|
11332
|
+
/* @__PURE__ */ jsx18(
|
|
11331
11333
|
"button",
|
|
11332
11334
|
{
|
|
11333
11335
|
type: "button",
|
|
11336
|
+
className: "db-mobile-first-run-secondary",
|
|
11334
11337
|
onClick: () => {
|
|
11335
11338
|
closeWelcomeGateway();
|
|
11336
11339
|
setMobileShowEditor(true);
|
|
11337
11340
|
},
|
|
11338
11341
|
children: "Tour the welcome document"
|
|
11339
11342
|
}
|
|
11340
|
-
),
|
|
11341
|
-
/* @__PURE__ */ jsx17(
|
|
11342
|
-
"button",
|
|
11343
|
-
{
|
|
11344
|
-
type: "button",
|
|
11345
|
-
className: "db-mobile-first-run-secondary",
|
|
11346
|
-
onClick: () => void handleNewFile(),
|
|
11347
|
-
children: "Create a document"
|
|
11348
|
-
}
|
|
11349
11343
|
)
|
|
11350
11344
|
] })
|
|
11351
11345
|
] }),
|
|
11352
|
-
git.available && git.pendingGrant && /* @__PURE__ */
|
|
11353
|
-
/* @__PURE__ */
|
|
11354
|
-
/* @__PURE__ */
|
|
11355
|
-
/* @__PURE__ */
|
|
11356
|
-
/* @__PURE__ */
|
|
11357
|
-
/* @__PURE__ */
|
|
11358
|
-
/* @__PURE__ */
|
|
11359
|
-
showBrowserStorageWarning && /* @__PURE__ */
|
|
11346
|
+
git.available && git.pendingGrant && /* @__PURE__ */ jsx18(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx18(GitGrantNotice, {}) }),
|
|
11347
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-shell-sidebar-footer", children: [
|
|
11348
|
+
/* @__PURE__ */ jsx18("a", { href: "https://docblocks.com/docs/", target: "_blank", rel: "noopener noreferrer", children: "Docs" }),
|
|
11349
|
+
/* @__PURE__ */ jsx18("span", { className: "db-shell-sidebar-footer-separator", "aria-hidden": "true", children: "\u2022" }),
|
|
11350
|
+
/* @__PURE__ */ jsx18("a", { href: "https://docblocks.com/terms/", target: "_blank", rel: "noopener noreferrer", children: "Terms" }),
|
|
11351
|
+
/* @__PURE__ */ jsx18("span", { className: "db-shell-sidebar-footer-separator", "aria-hidden": "true", children: "\u2022" }),
|
|
11352
|
+
/* @__PURE__ */ jsx18("a", { href: issueReportUrl, target: "_blank", rel: "noopener noreferrer", children: "Report issue" }),
|
|
11353
|
+
showBrowserStorageWarning && /* @__PURE__ */ jsx18(Fragment11, { children: /* @__PURE__ */ jsxs16(
|
|
11360
11354
|
"button",
|
|
11361
11355
|
{
|
|
11362
11356
|
type: "button",
|
|
@@ -11365,20 +11359,20 @@ function DocBlocksShell({
|
|
|
11365
11359
|
"aria-label": "Back up all workspaces",
|
|
11366
11360
|
title: "Browsers can clear site data. Download a backup of every workspace.",
|
|
11367
11361
|
children: [
|
|
11368
|
-
/* @__PURE__ */
|
|
11362
|
+
/* @__PURE__ */ jsx18(BackupIcon, {}),
|
|
11369
11363
|
"Back up"
|
|
11370
11364
|
]
|
|
11371
11365
|
}
|
|
11372
11366
|
) })
|
|
11373
11367
|
] }),
|
|
11374
|
-
/* @__PURE__ */
|
|
11375
|
-
/* @__PURE__ */
|
|
11376
|
-
/* @__PURE__ */
|
|
11368
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-sidebar-collapse-preview", "aria-hidden": "true", children: [
|
|
11369
|
+
/* @__PURE__ */ jsx18("span", { className: "db-sidebar-collapse-preview-icon", children: /* @__PURE__ */ jsx18(CollapseSidebarGlyph, {}) }),
|
|
11370
|
+
/* @__PURE__ */ jsx18("span", { className: "db-sidebar-collapse-preview-label", children: "Release to hide files" })
|
|
11377
11371
|
] })
|
|
11378
11372
|
]
|
|
11379
11373
|
}
|
|
11380
11374
|
),
|
|
11381
|
-
!singlePane && /* @__PURE__ */
|
|
11375
|
+
!singlePane && /* @__PURE__ */ jsx18(
|
|
11382
11376
|
"div",
|
|
11383
11377
|
{
|
|
11384
11378
|
className: "db-shell-sidebar-resizer",
|
|
@@ -11388,7 +11382,7 @@ function DocBlocksShell({
|
|
|
11388
11382
|
onPointerDown: handleResizerPointerDown
|
|
11389
11383
|
}
|
|
11390
11384
|
),
|
|
11391
|
-
singlePane && /* @__PURE__ */
|
|
11385
|
+
singlePane && /* @__PURE__ */ jsx18(
|
|
11392
11386
|
"div",
|
|
11393
11387
|
{
|
|
11394
11388
|
className: "db-shell-scrim",
|
|
@@ -11396,7 +11390,7 @@ function DocBlocksShell({
|
|
|
11396
11390
|
onPointerDown: () => setMobileShowEditor(true)
|
|
11397
11391
|
}
|
|
11398
11392
|
),
|
|
11399
|
-
/* @__PURE__ */
|
|
11393
|
+
/* @__PURE__ */ jsxs16(
|
|
11400
11394
|
"main",
|
|
11401
11395
|
{
|
|
11402
11396
|
ref: editorAreaRef,
|
|
@@ -11407,8 +11401,8 @@ function DocBlocksShell({
|
|
|
11407
11401
|
editorDropActive ? "db-shell-editor-area--drop-active" : ""
|
|
11408
11402
|
].filter(Boolean).join(" "),
|
|
11409
11403
|
children: [
|
|
11410
|
-
|
|
11411
|
-
selectedManagedOutput === "catalog-html" ? /* @__PURE__ */
|
|
11404
|
+
/* @__PURE__ */ jsxs16("div", { ref: welcomeCoveredRef, className: "db-shell-editor-content", children: [
|
|
11405
|
+
selectedFile && mediaProvider ? /* @__PURE__ */ jsx18(Fragment11, { children: selectedManagedOutput === "catalog-html" ? /* @__PURE__ */ jsx18(
|
|
11412
11406
|
GeneratedCatalogPage,
|
|
11413
11407
|
{
|
|
11414
11408
|
html: editorContent,
|
|
@@ -11416,17 +11410,17 @@ function DocBlocksShell({
|
|
|
11416
11410
|
onOpenSettings: activeWorkspaceDescriptor ? handleOpenWorkspaceSettings : void 0,
|
|
11417
11411
|
onBack: singlePane ? openDrawer : void 0
|
|
11418
11412
|
}
|
|
11419
|
-
) : /* @__PURE__ */
|
|
11413
|
+
) : /* @__PURE__ */ jsx18(
|
|
11420
11414
|
GeneratedFileFrame,
|
|
11421
11415
|
{
|
|
11422
11416
|
kind: selectedManagedOutput,
|
|
11423
11417
|
onOpenSettings: activeWorkspaceDescriptor ? handleOpenWorkspaceSettings : void 0,
|
|
11424
11418
|
onBack: singlePane ? openDrawer : void 0,
|
|
11425
|
-
children: /* @__PURE__ */
|
|
11419
|
+
children: /* @__PURE__ */ jsx18(
|
|
11426
11420
|
Suspense2,
|
|
11427
11421
|
{
|
|
11428
|
-
fallback: /* @__PURE__ */
|
|
11429
|
-
children: editorGenerationSettled && mediaProviderCurrent && /* @__PURE__ */
|
|
11422
|
+
fallback: /* @__PURE__ */ jsx18("div", { className: "db-shell-empty", role: "status", children: "Loading your document\u2026" }),
|
|
11423
|
+
children: editorGenerationSettled && mediaProviderCurrent && /* @__PURE__ */ jsx18(EditorErrorBoundary, { resetKey: `${selectedFile}-${editorKey}`, children: /* @__PURE__ */ jsx18(
|
|
11430
11424
|
EditorShell,
|
|
11431
11425
|
{
|
|
11432
11426
|
initialMarkdown: editorContent,
|
|
@@ -11476,19 +11470,19 @@ function DocBlocksShell({
|
|
|
11476
11470
|
versioningAutoSaveIdleMs,
|
|
11477
11471
|
onSaveVersion,
|
|
11478
11472
|
statusBarSlotRight,
|
|
11479
|
-
sidePanelSlot: ai && aiPanel && selectedImage === void 0 && (selectedOutsideIn === null || selectedOutsideInEditingEnabled) ? /* @__PURE__ */
|
|
11480
|
-
toolbarSlotLeft: singlePane ? /* @__PURE__ */
|
|
11473
|
+
sidePanelSlot: ai && aiPanel && selectedImage === void 0 && (selectedOutsideIn === null || selectedOutsideInEditingEnabled) ? /* @__PURE__ */ jsx18(Suspense2, { fallback: null, children: aiPanel === "review" ? /* @__PURE__ */ jsx18(AiReviewPanel, { ai, onClose: () => setAiPanel(null) }) : /* @__PURE__ */ jsx18(AiIllustratePanel, { ai, onClose: () => setAiPanel(null) }) }) : void 0,
|
|
11474
|
+
toolbarSlotLeft: singlePane ? /* @__PURE__ */ jsx18(
|
|
11481
11475
|
"button",
|
|
11482
11476
|
{
|
|
11483
11477
|
className: "db-mobile-back",
|
|
11484
11478
|
onClick: () => setMobileShowEditor(false),
|
|
11485
11479
|
"aria-label": "Show file list",
|
|
11486
|
-
children: /* @__PURE__ */
|
|
11480
|
+
children: /* @__PURE__ */ jsx18("span", { className: "db-mobile-files-icon", children: /* @__PURE__ */ jsx18(FolderGlyph, {}) })
|
|
11487
11481
|
}
|
|
11488
11482
|
) : void 0,
|
|
11489
|
-
summarizationDesigner: selectedImage === void 0 && selectedManagedOutput === void 0 && (selectedOutsideIn === null || selectedOutsideInEditingEnabled) ? (onClose) => /* @__PURE__ */
|
|
11490
|
-
toolbarSlotRight: /* @__PURE__ */
|
|
11491
|
-
canFind && /* @__PURE__ */
|
|
11483
|
+
summarizationDesigner: selectedImage === void 0 && selectedManagedOutput === void 0 && (selectedOutsideIn === null || selectedOutsideInEditingEnabled) ? (onClose) => /* @__PURE__ */ jsx18(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx18(PresentationMaker, { ai: ai ?? void 0, onClose }) }) : void 0,
|
|
11484
|
+
toolbarSlotRight: /* @__PURE__ */ jsxs16(Fragment11, { children: [
|
|
11485
|
+
canFind && /* @__PURE__ */ jsx18(
|
|
11492
11486
|
FindButton,
|
|
11493
11487
|
{
|
|
11494
11488
|
active: findMode,
|
|
@@ -11496,7 +11490,7 @@ function DocBlocksShell({
|
|
|
11496
11490
|
shortcutLabel: findShortcut
|
|
11497
11491
|
}
|
|
11498
11492
|
),
|
|
11499
|
-
ai && /* @__PURE__ */
|
|
11493
|
+
ai && /* @__PURE__ */ jsx18(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx18(
|
|
11500
11494
|
AiToolbarControl,
|
|
11501
11495
|
{
|
|
11502
11496
|
ai,
|
|
@@ -11505,8 +11499,8 @@ function DocBlocksShell({
|
|
|
11505
11499
|
onOpenPanel: setAiPanel
|
|
11506
11500
|
}
|
|
11507
11501
|
) }),
|
|
11508
|
-
speech && /* @__PURE__ */
|
|
11509
|
-
/* @__PURE__ */
|
|
11502
|
+
speech && /* @__PURE__ */ jsxs16(Suspense2, { fallback: null, children: [
|
|
11503
|
+
/* @__PURE__ */ jsx18(
|
|
11510
11504
|
TextFromNarration,
|
|
11511
11505
|
{
|
|
11512
11506
|
speech,
|
|
@@ -11516,27 +11510,27 @@ function DocBlocksShell({
|
|
|
11516
11510
|
onOpenSettings: openSettings
|
|
11517
11511
|
}
|
|
11518
11512
|
),
|
|
11519
|
-
hostSupports2("speechOutput") ? /* @__PURE__ */
|
|
11513
|
+
hostSupports2("speechOutput") ? /* @__PURE__ */ jsx18(
|
|
11520
11514
|
SpeechToolbarControl,
|
|
11521
11515
|
{
|
|
11522
11516
|
speech,
|
|
11523
11517
|
onOpenSettings: openSettings,
|
|
11524
11518
|
readOnly: selectedImage !== void 0 || selectedOutsideIn !== null && !selectedOutsideInEditingEnabled
|
|
11525
11519
|
}
|
|
11526
|
-
) : /* @__PURE__ */
|
|
11520
|
+
) : /* @__PURE__ */ jsx18(SpeechMenuBridge, {})
|
|
11527
11521
|
] }),
|
|
11528
|
-
canRestoreSplitView && /* @__PURE__ */
|
|
11522
|
+
canRestoreSplitView && /* @__PURE__ */ jsx18(
|
|
11529
11523
|
"button",
|
|
11530
11524
|
{
|
|
11531
11525
|
className: "db-restore-split",
|
|
11532
11526
|
onClick: () => updateSidebarPreference("pinned"),
|
|
11533
11527
|
"aria-label": "Restore split view",
|
|
11534
11528
|
title: "Restore split view",
|
|
11535
|
-
children: /* @__PURE__ */
|
|
11529
|
+
children: /* @__PURE__ */ jsx18(SplitViewIcon, {})
|
|
11536
11530
|
}
|
|
11537
11531
|
),
|
|
11538
|
-
git.repo && /* @__PURE__ */
|
|
11539
|
-
/* @__PURE__ */
|
|
11532
|
+
git.repo && /* @__PURE__ */ jsx18(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx18(GitToolbarControl, { selectedFile }) }),
|
|
11533
|
+
/* @__PURE__ */ jsx18(
|
|
11540
11534
|
ExportToolbarControls,
|
|
11541
11535
|
{
|
|
11542
11536
|
selectedFile,
|
|
@@ -11560,87 +11554,77 @@ function DocBlocksShell({
|
|
|
11560
11554
|
}
|
|
11561
11555
|
)
|
|
11562
11556
|
}
|
|
11563
|
-
),
|
|
11564
|
-
|
|
11565
|
-
|
|
11566
|
-
"
|
|
11567
|
-
/* @__PURE__ */ jsx17("strong", { children: "Slideshow" }),
|
|
11568
|
-
" ",
|
|
11569
|
-
"view\u2014it\u2019s a regular Markdown file, and so is everything you\u2019ll write."
|
|
11557
|
+
) }) : selectedFolder ? /* @__PURE__ */ jsxs16("div", { className: "db-folder-view", children: [
|
|
11558
|
+
singlePane && /* @__PURE__ */ jsxs16("button", { className: "db-mobile-back", onClick: () => setMobileShowEditor(false), children: [
|
|
11559
|
+
/* @__PURE__ */ jsx18("span", { className: "db-mobile-files-icon", children: /* @__PURE__ */ jsx18(FolderGlyph, {}) }),
|
|
11560
|
+
"Back to files"
|
|
11570
11561
|
] }),
|
|
11571
|
-
/* @__PURE__ */
|
|
11572
|
-
|
|
11573
|
-
"
|
|
11562
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-folder-view-header", children: [
|
|
11563
|
+
/* @__PURE__ */ jsx18("span", { className: "db-folder-view-icon", children: /* @__PURE__ */ jsx18(FolderGlyph, {}) }),
|
|
11564
|
+
/* @__PURE__ */ jsx18("span", { className: "db-folder-view-path", children: selectedFolder })
|
|
11565
|
+
] }),
|
|
11566
|
+
visibleFolderEntries.length === 0 ? /* @__PURE__ */ jsx18("p", { className: "db-folder-view-empty", children: "This folder is empty." }) : /* @__PURE__ */ jsx18("ul", { className: "db-folder-view-list", children: visibleFolderEntries.map((entry) => /* @__PURE__ */ jsxs16(
|
|
11567
|
+
"li",
|
|
11574
11568
|
{
|
|
11575
|
-
className: "db-
|
|
11576
|
-
onClick:
|
|
11577
|
-
|
|
11578
|
-
|
|
11579
|
-
|
|
11580
|
-
|
|
11581
|
-
|
|
11582
|
-
|
|
11583
|
-
|
|
11584
|
-
|
|
11585
|
-
/* @__PURE__ */
|
|
11586
|
-
|
|
11587
|
-
|
|
11588
|
-
|
|
11589
|
-
/* @__PURE__ */
|
|
11590
|
-
|
|
11569
|
+
className: "db-folder-view-item",
|
|
11570
|
+
onClick: () => handleSelect(entry.path, entry.kind),
|
|
11571
|
+
children: [
|
|
11572
|
+
/* @__PURE__ */ jsx18("span", { className: "db-folder-view-item-icon", children: entry.kind === "directory" ? /* @__PURE__ */ jsx18(FolderGlyph, {}) : /* @__PURE__ */ jsx18(FileGlyph, {}) }),
|
|
11573
|
+
entry.name
|
|
11574
|
+
]
|
|
11575
|
+
},
|
|
11576
|
+
entry.path
|
|
11577
|
+
)) })
|
|
11578
|
+
] }) : /* @__PURE__ */ jsxs16("div", { className: "db-shell-empty db-shell-empty--workspace", children: [
|
|
11579
|
+
singlePane && /* @__PURE__ */ jsxs16("button", { className: "db-mobile-back", onClick: () => setMobileShowEditor(false), children: [
|
|
11580
|
+
/* @__PURE__ */ jsx18("span", { className: "db-mobile-files-icon", children: /* @__PURE__ */ jsx18(FolderGlyph, {}) }),
|
|
11581
|
+
"Back to files"
|
|
11582
|
+
] }),
|
|
11583
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-workspace-empty-content", children: [
|
|
11584
|
+
/* @__PURE__ */ jsx18("span", { className: "db-workspace-empty-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx18(FileGlyph, {}) }),
|
|
11585
|
+
/* @__PURE__ */ jsx18("h1", { children: activeWorkspaceDescriptor?.name ?? "Workspace" }),
|
|
11586
|
+
/* @__PURE__ */ jsx18("p", { children: "Choose a Markdown document from the sidebar, or create a new one." }),
|
|
11587
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-workspace-empty-actions", children: [
|
|
11588
|
+
/* @__PURE__ */ jsx18("button", { type: "button", onClick: () => void handleNewFile(), children: "New document" }),
|
|
11589
|
+
/* @__PURE__ */ jsx18(
|
|
11590
|
+
"button",
|
|
11591
|
+
{
|
|
11592
|
+
type: "button",
|
|
11593
|
+
className: "db-workspace-empty-secondary",
|
|
11594
|
+
onClick: () => void handleNewFolder(),
|
|
11595
|
+
children: "New folder"
|
|
11596
|
+
}
|
|
11597
|
+
),
|
|
11598
|
+
(hostSupports2("workspaceFolderPicker") || typeof globalThis.showDirectoryPicker === "function") && /* @__PURE__ */ jsx18(
|
|
11599
|
+
"button",
|
|
11600
|
+
{
|
|
11601
|
+
type: "button",
|
|
11602
|
+
className: "db-workspace-empty-secondary",
|
|
11603
|
+
onClick: () => void handleOpenFolder(),
|
|
11604
|
+
children: "Open a folder"
|
|
11605
|
+
}
|
|
11606
|
+
)
|
|
11607
|
+
] }),
|
|
11608
|
+
/* @__PURE__ */ jsx18("p", { className: "db-workspace-empty-hint", children: "Use the sidebar backup action to keep a portable copy of this workspace." })
|
|
11609
|
+
] })
|
|
11591
11610
|
] }),
|
|
11592
|
-
|
|
11593
|
-
|
|
11611
|
+
/* @__PURE__ */ jsx18(
|
|
11612
|
+
UpdateAvailableNotice,
|
|
11594
11613
|
{
|
|
11595
|
-
|
|
11596
|
-
|
|
11597
|
-
|
|
11598
|
-
|
|
11599
|
-
|
|
11600
|
-
|
|
11601
|
-
},
|
|
11602
|
-
entry.path
|
|
11603
|
-
)) })
|
|
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, {}) }),
|
|
11607
|
-
"Back to files"
|
|
11608
|
-
] }),
|
|
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(
|
|
11616
|
-
"button",
|
|
11617
|
-
{
|
|
11618
|
-
type: "button",
|
|
11619
|
-
className: "db-workspace-empty-secondary",
|
|
11620
|
-
onClick: () => void handleNewFolder(),
|
|
11621
|
-
children: "New folder"
|
|
11622
|
-
}
|
|
11623
|
-
),
|
|
11624
|
-
(hostSupports2("workspaceFolderPicker") || typeof globalThis.showDirectoryPicker === "function") && /* @__PURE__ */ jsx17(
|
|
11625
|
-
"button",
|
|
11626
|
-
{
|
|
11627
|
-
type: "button",
|
|
11628
|
-
className: "db-workspace-empty-secondary",
|
|
11629
|
-
onClick: () => void handleOpenFolder(),
|
|
11630
|
-
children: "Open a folder"
|
|
11631
|
-
}
|
|
11632
|
-
)
|
|
11633
|
-
] }),
|
|
11634
|
-
/* @__PURE__ */ jsx17("p", { className: "db-workspace-empty-hint", children: "Use the sidebar backup action to keep a portable copy of this workspace." })
|
|
11635
|
-
] })
|
|
11614
|
+
available: updateAvailable,
|
|
11615
|
+
onApplyUpdate,
|
|
11616
|
+
blocked: documentSnapshot.conflict !== null || storageFull,
|
|
11617
|
+
statusBarVisible: updateStatusBarVisible
|
|
11618
|
+
}
|
|
11619
|
+
)
|
|
11636
11620
|
] }),
|
|
11637
|
-
/* @__PURE__ */
|
|
11638
|
-
|
|
11621
|
+
welcomeScreenShown && /* @__PURE__ */ jsx18(
|
|
11622
|
+
WelcomeScreen,
|
|
11639
11623
|
{
|
|
11640
|
-
|
|
11641
|
-
|
|
11642
|
-
|
|
11643
|
-
|
|
11624
|
+
onCreateDocument: handleNewFile,
|
|
11625
|
+
onTour: handleTourWelcome,
|
|
11626
|
+
onDismiss: handleTourWelcome,
|
|
11627
|
+
offerApps: hostEnvironment === null
|
|
11644
11628
|
}
|
|
11645
11629
|
)
|
|
11646
11630
|
]
|