@bendyline/docblocks-react 2.7.4 → 2.7.6
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 +59 -28
- package/dist/{AiDiagrams-QZMJNGDT.js → AiDiagrams-VOCEZS6U.js} +4 -2
- package/dist/{AiEditorAssistant-4HFFGVU4.js → AiEditorAssistant-2MW6UYNI.js} +51 -11
- package/dist/{AiStudyDialog-P3E7PJV5.js → AiStudyDialog-DQZVTBI7.js} +14 -4
- package/dist/{AudioExportDialog-IOYIEAER.js → AudioExportDialog-EICCBSSE.js} +1 -1
- package/dist/{ExportToolbarControls-HOV424TO.js → ExportToolbarControls-4LYTXGT3.js} +1 -1
- package/dist/{PresentationMaker-MUMFAXEI.js → PresentationMaker-T526TBRJ.js} +2 -2
- package/dist/{SpeechToolbarControl-KNI2C4JJ.js → SpeechToolbarControl-E6OSJGHL.js} +217 -71
- package/dist/{TextFromNarration-EYOMW2IW.js → TextFromNarration-ME6FAYWO.js} +1 -1
- package/dist/{WorkspaceSearchPanel-J6BKEZQJ.js → WorkspaceSearchPanel-MEBBTK7F.js} +3 -3
- package/dist/{chunk-I44HKDQX.js → chunk-3TSJQESW.js} +16 -3
- package/dist/chunk-45YTIVYS.js +1162 -0
- package/dist/{chunk-FBPCURCS.js → chunk-7HBKKXRV.js} +291 -82
- package/dist/{chunk-KBDZDFPU.js → chunk-BNKIPCXO.js} +4 -1
- package/dist/{chunk-2IYBBFQX.js → chunk-BZRYQENB.js} +59 -16
- package/dist/{chunk-DICE7VBJ.js → chunk-KHQ44ZFA.js} +16 -1
- package/dist/chunk-NOYDVL6M.js +180 -0
- package/dist/{chunk-PNZFIIWW.js → chunk-PRUEYW3G.js} +23 -5
- package/dist/{chunk-7V34VUK6.js → chunk-T42BH6YX.js} +128 -103
- package/dist/editor.js +2 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +817 -710
- package/dist/settings/index.js +2 -1
- package/package.json +8 -8
- package/src/styles/docblocks.css +542 -16
- package/dist/chunk-D4HIOS7E.js +0 -812
- package/dist/{QuickOpenDialog-ENVFGIHS.js → QuickOpenDialog-3QEX7RZG.js} +3 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProgressivePlayer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BZRYQENB.js";
|
|
4
|
+
import {
|
|
5
|
+
useConfirmDialog
|
|
6
|
+
} from "./chunk-KBUHWZCF.js";
|
|
4
7
|
import {
|
|
5
8
|
BackupIcon,
|
|
6
9
|
FolderIcon,
|
|
@@ -14,13 +17,10 @@ import {
|
|
|
14
17
|
SortByNameIcon,
|
|
15
18
|
SplitViewIcon,
|
|
16
19
|
WorkspaceIcon
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import {
|
|
19
|
-
useConfirmDialog
|
|
20
|
-
} from "./chunk-KBUHWZCF.js";
|
|
20
|
+
} from "./chunk-KHQ44ZFA.js";
|
|
21
21
|
import {
|
|
22
22
|
createSpeechInputProvider
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-BNKIPCXO.js";
|
|
24
24
|
import {
|
|
25
25
|
sharedDocumentFilename
|
|
26
26
|
} from "./chunk-SPUPWCSI.js";
|
|
@@ -87,7 +87,8 @@ import {
|
|
|
87
87
|
saveProofingPreferences,
|
|
88
88
|
saveThemePreference,
|
|
89
89
|
saveWriteCanvasPreferences
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-7HBKKXRV.js";
|
|
91
|
+
import "./chunk-TBLZBNQF.js";
|
|
91
92
|
import {
|
|
92
93
|
FindButton,
|
|
93
94
|
focusFindInput,
|
|
@@ -100,13 +101,13 @@ import {
|
|
|
100
101
|
matchShortcut,
|
|
101
102
|
shortcutLabel
|
|
102
103
|
} from "./chunk-ACQF63SB.js";
|
|
103
|
-
import "./chunk-
|
|
104
|
+
import "./chunk-PRUEYW3G.js";
|
|
104
105
|
import {
|
|
105
106
|
buildIssueReportUrl,
|
|
106
107
|
displayBuildDate,
|
|
107
108
|
localDateStamp,
|
|
108
109
|
openExternalUrl
|
|
109
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-T42BH6YX.js";
|
|
110
111
|
import "./chunk-K4I3NJFL.js";
|
|
111
112
|
import {
|
|
112
113
|
ExportDialog
|
|
@@ -3758,11 +3759,11 @@ async function prepareHostLifecycle(session, request) {
|
|
|
3758
3759
|
|
|
3759
3760
|
// src/DocBlocksShell/DocBlocksShell.tsx
|
|
3760
3761
|
import {
|
|
3761
|
-
useState as
|
|
3762
|
-
useCallback as
|
|
3763
|
-
useEffect as
|
|
3762
|
+
useState as useState24,
|
|
3763
|
+
useCallback as useCallback19,
|
|
3764
|
+
useEffect as useEffect30,
|
|
3764
3765
|
useLayoutEffect as useLayoutEffect4,
|
|
3765
|
-
useRef as
|
|
3766
|
+
useRef as useRef20,
|
|
3766
3767
|
useMemo as useMemo6,
|
|
3767
3768
|
lazy as lazy2,
|
|
3768
3769
|
Suspense as Suspense2
|
|
@@ -3816,7 +3817,7 @@ import {
|
|
|
3816
3817
|
} from "@bendyline/docblocks/workspace";
|
|
3817
3818
|
|
|
3818
3819
|
// src/AppMenu/AppMenu.tsx
|
|
3819
|
-
import { useState as
|
|
3820
|
+
import { useState as useState8, useCallback as useCallback9, useRef as useRef9, useEffect as useEffect9 } from "react";
|
|
3820
3821
|
import {
|
|
3821
3822
|
getHostEnvironment
|
|
3822
3823
|
} from "@bendyline/docblocks/host";
|
|
@@ -4133,8 +4134,87 @@ function SpeechSettingsControls({ speech }) {
|
|
|
4133
4134
|
] });
|
|
4134
4135
|
}
|
|
4135
4136
|
|
|
4137
|
+
// src/Settings/TraySettings.tsx
|
|
4138
|
+
import { useCallback as useCallback8, useEffect as useEffect8, useRef as useRef8, useState as useState7 } from "react";
|
|
4139
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
4140
|
+
function trayPlace(platform) {
|
|
4141
|
+
switch (platform) {
|
|
4142
|
+
case "darwin":
|
|
4143
|
+
return { legend: "Menu bar", label: "Show DocBlocks in the menu bar" };
|
|
4144
|
+
case "win32":
|
|
4145
|
+
return {
|
|
4146
|
+
legend: "Notification area",
|
|
4147
|
+
label: "Show DocBlocks in the notification area"
|
|
4148
|
+
};
|
|
4149
|
+
default:
|
|
4150
|
+
return { legend: "System tray", label: "Show DocBlocks in the system tray" };
|
|
4151
|
+
}
|
|
4152
|
+
}
|
|
4153
|
+
function TraySettingsControls({ menu, platform }) {
|
|
4154
|
+
const [enabled, setEnabled] = useState7(null);
|
|
4155
|
+
const [saving, setSaving] = useState7(false);
|
|
4156
|
+
const [failure, setFailure] = useState7(null);
|
|
4157
|
+
const mounted = useRef8(true);
|
|
4158
|
+
useEffect8(() => {
|
|
4159
|
+
mounted.current = true;
|
|
4160
|
+
const read2 = menu.getTrayEnabled;
|
|
4161
|
+
if (read2) {
|
|
4162
|
+
read2.call(menu).then(
|
|
4163
|
+
(value) => {
|
|
4164
|
+
if (mounted.current) setEnabled(value);
|
|
4165
|
+
},
|
|
4166
|
+
() => {
|
|
4167
|
+
if (mounted.current) setFailure("DocBlocks could not read this setting.");
|
|
4168
|
+
}
|
|
4169
|
+
);
|
|
4170
|
+
}
|
|
4171
|
+
return () => {
|
|
4172
|
+
mounted.current = false;
|
|
4173
|
+
};
|
|
4174
|
+
}, [menu]);
|
|
4175
|
+
const change = useCallback8(
|
|
4176
|
+
async (next) => {
|
|
4177
|
+
const write2 = menu.setTrayEnabled;
|
|
4178
|
+
if (!write2) return;
|
|
4179
|
+
setSaving(true);
|
|
4180
|
+
setFailure(null);
|
|
4181
|
+
setEnabled(next);
|
|
4182
|
+
try {
|
|
4183
|
+
const saved = await write2.call(menu, next);
|
|
4184
|
+
if (mounted.current) setEnabled(saved);
|
|
4185
|
+
} catch {
|
|
4186
|
+
if (mounted.current) {
|
|
4187
|
+
setEnabled(!next);
|
|
4188
|
+
setFailure("DocBlocks could not change this setting. Try again.");
|
|
4189
|
+
}
|
|
4190
|
+
} finally {
|
|
4191
|
+
if (mounted.current) setSaving(false);
|
|
4192
|
+
}
|
|
4193
|
+
},
|
|
4194
|
+
[menu]
|
|
4195
|
+
);
|
|
4196
|
+
const place = trayPlace(platform);
|
|
4197
|
+
return /* @__PURE__ */ jsxs7("fieldset", { className: "db-settings-fieldset", children: [
|
|
4198
|
+
/* @__PURE__ */ jsx8("legend", { className: "db-settings-legend", children: place.legend }),
|
|
4199
|
+
/* @__PURE__ */ jsxs7("label", { className: "db-settings-checkbox", children: [
|
|
4200
|
+
/* @__PURE__ */ jsx8(
|
|
4201
|
+
"input",
|
|
4202
|
+
{
|
|
4203
|
+
type: "checkbox",
|
|
4204
|
+
checked: enabled === true,
|
|
4205
|
+
disabled: enabled === null || saving,
|
|
4206
|
+
onChange: (event) => void change(event.currentTarget.checked)
|
|
4207
|
+
}
|
|
4208
|
+
),
|
|
4209
|
+
place.label
|
|
4210
|
+
] }),
|
|
4211
|
+
/* @__PURE__ */ jsx8("p", { className: "db-settings-hint", children: "One click to a new document, a folder, or any document you have pinned." }),
|
|
4212
|
+
failure && /* @__PURE__ */ jsx8("p", { className: "db-settings-hint db-settings-ai-error", role: "alert", children: failure })
|
|
4213
|
+
] });
|
|
4214
|
+
}
|
|
4215
|
+
|
|
4136
4216
|
// src/AppMenu/AppMenu.tsx
|
|
4137
|
-
import { Fragment as Fragment5, jsx as
|
|
4217
|
+
import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
4138
4218
|
function formatBytes(bytes) {
|
|
4139
4219
|
if (!Number.isFinite(bytes) || bytes < 0) return "\u2014";
|
|
4140
4220
|
let value = bytes;
|
|
@@ -4179,21 +4259,22 @@ function AppMenu({
|
|
|
4179
4259
|
appBuildDate,
|
|
4180
4260
|
ai,
|
|
4181
4261
|
speech,
|
|
4262
|
+
tray,
|
|
4182
4263
|
settingsRequest = 0
|
|
4183
4264
|
}) {
|
|
4184
|
-
const [isOpen, setIsOpen] =
|
|
4185
|
-
const [showAbout, setShowAbout] =
|
|
4186
|
-
const [showSettings, setShowSettings] =
|
|
4187
|
-
|
|
4265
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
4266
|
+
const [showAbout, setShowAbout] = useState8(false);
|
|
4267
|
+
const [showSettings, setShowSettings] = useState8(false);
|
|
4268
|
+
useEffect9(() => {
|
|
4188
4269
|
if (settingsRequest > 0) setShowSettings(true);
|
|
4189
4270
|
}, [settingsRequest]);
|
|
4190
|
-
const [requestingPersistentStorage, setRequestingPersistentStorage] =
|
|
4271
|
+
const [requestingPersistentStorage, setRequestingPersistentStorage] = useState8(false);
|
|
4191
4272
|
const surface = getHostEnvironment()?.surface ?? "web";
|
|
4192
4273
|
const moreInformationUrl = MORE_INFORMATION_URLS[surface] ?? MORE_INFORMATION_URLS.web;
|
|
4193
|
-
const containerRef =
|
|
4274
|
+
const containerRef = useRef9(null);
|
|
4194
4275
|
const { menuRef, triggerRef, handleMenuKeyDown, handleTriggerKeyDown, closeMenu } = useMenuKeyboard(isOpen, setIsOpen);
|
|
4195
|
-
const [storageEstimate, setStorageEstimate] =
|
|
4196
|
-
|
|
4276
|
+
const [storageEstimate, setStorageEstimate] = useState8(null);
|
|
4277
|
+
useEffect9(() => {
|
|
4197
4278
|
if (!showSettings || !getStorageEstimate) return;
|
|
4198
4279
|
let cancelled = false;
|
|
4199
4280
|
getStorageEstimate().then((estimate) => {
|
|
@@ -4205,7 +4286,7 @@ function AppMenu({
|
|
|
4205
4286
|
cancelled = true;
|
|
4206
4287
|
};
|
|
4207
4288
|
}, [showSettings, getStorageEstimate]);
|
|
4208
|
-
|
|
4289
|
+
useEffect9(() => {
|
|
4209
4290
|
if (!isOpen) return;
|
|
4210
4291
|
function handleOutsideClick(e) {
|
|
4211
4292
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -4215,14 +4296,14 @@ function AppMenu({
|
|
|
4215
4296
|
document.addEventListener("mousedown", handleOutsideClick);
|
|
4216
4297
|
return () => document.removeEventListener("mousedown", handleOutsideClick);
|
|
4217
4298
|
}, [closeMenu, isOpen]);
|
|
4218
|
-
const handleAction =
|
|
4299
|
+
const handleAction = useCallback9(
|
|
4219
4300
|
(action) => {
|
|
4220
4301
|
closeMenu(true);
|
|
4221
4302
|
action();
|
|
4222
4303
|
},
|
|
4223
4304
|
[closeMenu]
|
|
4224
4305
|
);
|
|
4225
|
-
const handleKeepBrowserDataFromSettings =
|
|
4306
|
+
const handleKeepBrowserDataFromSettings = useCallback9(async () => {
|
|
4226
4307
|
if (!onKeepBrowserData || requestingPersistentStorage) return;
|
|
4227
4308
|
setShowSettings(false);
|
|
4228
4309
|
setRequestingPersistentStorage(true);
|
|
@@ -4232,9 +4313,9 @@ function AppMenu({
|
|
|
4232
4313
|
setRequestingPersistentStorage(false);
|
|
4233
4314
|
}
|
|
4234
4315
|
}, [onKeepBrowserData, requestingPersistentStorage]);
|
|
4235
|
-
return /* @__PURE__ */
|
|
4236
|
-
/* @__PURE__ */
|
|
4237
|
-
/* @__PURE__ */
|
|
4316
|
+
return /* @__PURE__ */ jsxs8(Fragment5, { children: [
|
|
4317
|
+
/* @__PURE__ */ jsxs8("div", { ref: containerRef, className: "db-app-menu", children: [
|
|
4318
|
+
/* @__PURE__ */ jsxs8(
|
|
4238
4319
|
"button",
|
|
4239
4320
|
{
|
|
4240
4321
|
ref: triggerRef,
|
|
@@ -4244,8 +4325,8 @@ function AppMenu({
|
|
|
4244
4325
|
"aria-expanded": isOpen,
|
|
4245
4326
|
"aria-haspopup": "menu",
|
|
4246
4327
|
children: [
|
|
4247
|
-
logoUrl ? /* @__PURE__ */
|
|
4248
|
-
/* @__PURE__ */
|
|
4328
|
+
logoUrl ? /* @__PURE__ */ jsxs8(Fragment5, { children: [
|
|
4329
|
+
/* @__PURE__ */ jsx9(
|
|
4249
4330
|
"img",
|
|
4250
4331
|
{
|
|
4251
4332
|
src: logoUrl,
|
|
@@ -4255,7 +4336,7 @@ function AppMenu({
|
|
|
4255
4336
|
height: 242
|
|
4256
4337
|
}
|
|
4257
4338
|
),
|
|
4258
|
-
logoDarkUrl && /* @__PURE__ */
|
|
4339
|
+
logoDarkUrl && /* @__PURE__ */ jsx9(
|
|
4259
4340
|
"img",
|
|
4260
4341
|
{
|
|
4261
4342
|
src: logoDarkUrl,
|
|
@@ -4265,8 +4346,8 @@ function AppMenu({
|
|
|
4265
4346
|
height: 242
|
|
4266
4347
|
}
|
|
4267
4348
|
)
|
|
4268
|
-
] }) : /* @__PURE__ */
|
|
4269
|
-
/* @__PURE__ */
|
|
4349
|
+
] }) : /* @__PURE__ */ jsx9("span", { className: "db-app-menu-label", children: "docblocks" }),
|
|
4350
|
+
/* @__PURE__ */ jsx9(
|
|
4270
4351
|
"span",
|
|
4271
4352
|
{
|
|
4272
4353
|
className: `db-app-menu-caret${isOpen ? " db-app-menu-caret--open" : ""}`,
|
|
@@ -4276,7 +4357,7 @@ function AppMenu({
|
|
|
4276
4357
|
]
|
|
4277
4358
|
}
|
|
4278
4359
|
),
|
|
4279
|
-
isOpen && /* @__PURE__ */
|
|
4360
|
+
isOpen && /* @__PURE__ */ jsxs8(
|
|
4280
4361
|
"div",
|
|
4281
4362
|
{
|
|
4282
4363
|
ref: menuRef,
|
|
@@ -4284,7 +4365,7 @@ function AppMenu({
|
|
|
4284
4365
|
role: "menu",
|
|
4285
4366
|
onKeyDown: handleMenuKeyDown,
|
|
4286
4367
|
children: [
|
|
4287
|
-
/* @__PURE__ */
|
|
4368
|
+
/* @__PURE__ */ jsx9(
|
|
4288
4369
|
"button",
|
|
4289
4370
|
{
|
|
4290
4371
|
className: "db-app-menu-item",
|
|
@@ -4294,7 +4375,7 @@ function AppMenu({
|
|
|
4294
4375
|
children: "Settings"
|
|
4295
4376
|
}
|
|
4296
4377
|
),
|
|
4297
|
-
onInstallApp && /* @__PURE__ */
|
|
4378
|
+
onInstallApp && /* @__PURE__ */ jsx9(
|
|
4298
4379
|
"button",
|
|
4299
4380
|
{
|
|
4300
4381
|
className: "db-app-menu-item",
|
|
@@ -4304,8 +4385,8 @@ function AppMenu({
|
|
|
4304
4385
|
children: "Install DocBlocks\u2026"
|
|
4305
4386
|
}
|
|
4306
4387
|
),
|
|
4307
|
-
(onDownloadAllWorkspaces || onRestoreBackup || onKeepBrowserData) && /* @__PURE__ */
|
|
4308
|
-
onDownloadAllWorkspaces && /* @__PURE__ */
|
|
4388
|
+
(onDownloadAllWorkspaces || onRestoreBackup || onKeepBrowserData) && /* @__PURE__ */ jsx9("div", { className: "db-app-menu-divider" }),
|
|
4389
|
+
onDownloadAllWorkspaces && /* @__PURE__ */ jsx9(
|
|
4309
4390
|
"button",
|
|
4310
4391
|
{
|
|
4311
4392
|
className: "db-app-menu-item",
|
|
@@ -4315,7 +4396,7 @@ function AppMenu({
|
|
|
4315
4396
|
children: "Back up all workspaces"
|
|
4316
4397
|
}
|
|
4317
4398
|
),
|
|
4318
|
-
onRestoreBackup && /* @__PURE__ */
|
|
4399
|
+
onRestoreBackup && /* @__PURE__ */ jsx9(
|
|
4319
4400
|
"button",
|
|
4320
4401
|
{
|
|
4321
4402
|
className: "db-app-menu-item",
|
|
@@ -4325,7 +4406,7 @@ function AppMenu({
|
|
|
4325
4406
|
children: "Restore backup\u2026"
|
|
4326
4407
|
}
|
|
4327
4408
|
),
|
|
4328
|
-
onKeepBrowserData && /* @__PURE__ */
|
|
4409
|
+
onKeepBrowserData && /* @__PURE__ */ jsx9(
|
|
4329
4410
|
"button",
|
|
4330
4411
|
{
|
|
4331
4412
|
className: "db-app-menu-item",
|
|
@@ -4335,8 +4416,8 @@ function AppMenu({
|
|
|
4335
4416
|
children: "Protect data from browser cleanup"
|
|
4336
4417
|
}
|
|
4337
4418
|
),
|
|
4338
|
-
/* @__PURE__ */
|
|
4339
|
-
onShowKeyboardShortcuts && /* @__PURE__ */
|
|
4419
|
+
/* @__PURE__ */ jsx9("div", { className: "db-app-menu-divider" }),
|
|
4420
|
+
onShowKeyboardShortcuts && /* @__PURE__ */ jsxs8(
|
|
4340
4421
|
"button",
|
|
4341
4422
|
{
|
|
4342
4423
|
className: "db-app-menu-item db-app-menu-item--with-shortcut",
|
|
@@ -4346,11 +4427,11 @@ function AppMenu({
|
|
|
4346
4427
|
onClick: () => handleAction(onShowKeyboardShortcuts),
|
|
4347
4428
|
children: [
|
|
4348
4429
|
"Keyboard shortcuts",
|
|
4349
|
-
/* @__PURE__ */
|
|
4430
|
+
/* @__PURE__ */ jsx9("span", { className: "db-app-menu-shortcut", "aria-hidden": "true", children: "F1" })
|
|
4350
4431
|
]
|
|
4351
4432
|
}
|
|
4352
4433
|
),
|
|
4353
|
-
/* @__PURE__ */
|
|
4434
|
+
/* @__PURE__ */ jsx9(
|
|
4354
4435
|
"a",
|
|
4355
4436
|
{
|
|
4356
4437
|
className: "db-app-menu-item",
|
|
@@ -4363,7 +4444,7 @@ function AppMenu({
|
|
|
4363
4444
|
children: "Documentation"
|
|
4364
4445
|
}
|
|
4365
4446
|
),
|
|
4366
|
-
/* @__PURE__ */
|
|
4447
|
+
/* @__PURE__ */ jsx9(
|
|
4367
4448
|
"button",
|
|
4368
4449
|
{
|
|
4369
4450
|
className: "db-app-menu-item",
|
|
@@ -4377,53 +4458,54 @@ function AppMenu({
|
|
|
4377
4458
|
}
|
|
4378
4459
|
)
|
|
4379
4460
|
] }),
|
|
4380
|
-
showSettings && /* @__PURE__ */
|
|
4381
|
-
/* @__PURE__ */
|
|
4461
|
+
showSettings && /* @__PURE__ */ jsxs8(SettingsDialog, { onClose: () => setShowSettings(false), children: [
|
|
4462
|
+
/* @__PURE__ */ jsx9(
|
|
4382
4463
|
ThemeSettings,
|
|
4383
4464
|
{
|
|
4384
4465
|
value: themePreference,
|
|
4385
4466
|
onChange: (preference) => onThemeChange?.(preference)
|
|
4386
4467
|
}
|
|
4387
4468
|
),
|
|
4388
|
-
/* @__PURE__ */
|
|
4469
|
+
/* @__PURE__ */ jsx9(
|
|
4389
4470
|
AccentColorSettings,
|
|
4390
4471
|
{
|
|
4391
4472
|
value: accentColor,
|
|
4392
4473
|
onChange: (color) => onAccentColorChange?.(color)
|
|
4393
4474
|
}
|
|
4394
4475
|
),
|
|
4395
|
-
/* @__PURE__ */
|
|
4476
|
+
/* @__PURE__ */ jsx9(
|
|
4396
4477
|
InterfaceFontSettings,
|
|
4397
4478
|
{
|
|
4398
4479
|
value: interfaceFont,
|
|
4399
4480
|
onChange: (font) => onInterfaceFontChange?.(font)
|
|
4400
4481
|
}
|
|
4401
4482
|
),
|
|
4402
|
-
/* @__PURE__ */
|
|
4483
|
+
/* @__PURE__ */ jsx9(
|
|
4403
4484
|
WriteCanvasSettingsControls,
|
|
4404
4485
|
{
|
|
4405
4486
|
value: writeCanvasSettings,
|
|
4406
4487
|
onChange: (settings) => onWriteCanvasSettingsChange?.(settings)
|
|
4407
4488
|
}
|
|
4408
4489
|
),
|
|
4409
|
-
/* @__PURE__ */
|
|
4490
|
+
/* @__PURE__ */ jsx9(
|
|
4410
4491
|
ProofingSettingsControls,
|
|
4411
4492
|
{
|
|
4412
4493
|
value: proofingPreferences,
|
|
4413
4494
|
onChange: (settings) => onProofingPreferencesChange?.(settings)
|
|
4414
4495
|
}
|
|
4415
4496
|
),
|
|
4416
|
-
ai && /* @__PURE__ */
|
|
4417
|
-
speech && /* @__PURE__ */
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
/* @__PURE__ */
|
|
4497
|
+
ai && /* @__PURE__ */ jsx9(AiSettingsControls, { ai }),
|
|
4498
|
+
speech && /* @__PURE__ */ jsx9(SpeechSettingsControls, { speech }),
|
|
4499
|
+
tray && /* @__PURE__ */ jsx9(TraySettingsControls, { menu: tray, platform: getHostEnvironment()?.platform }),
|
|
4500
|
+
getStorageEstimate && /* @__PURE__ */ jsxs8("fieldset", { className: "db-settings-fieldset", children: [
|
|
4501
|
+
/* @__PURE__ */ jsx9("legend", { className: "db-settings-legend", children: "Storage" }),
|
|
4502
|
+
/* @__PURE__ */ jsx9("p", { className: "db-settings-hint", children: storageEstimate ? `DocBlocks documents and app data are using ${formatBytes(
|
|
4421
4503
|
storageEstimate.usage
|
|
4422
4504
|
)} of the ${formatBytes(
|
|
4423
4505
|
storageEstimate.quota
|
|
4424
4506
|
)} this browser allows for the site.` : "Storage usage is not available in this browser." }),
|
|
4425
|
-
storagePersistent !== void 0 && /* @__PURE__ */
|
|
4426
|
-
onKeepBrowserData && /* @__PURE__ */
|
|
4507
|
+
storagePersistent !== void 0 && /* @__PURE__ */ jsx9("p", { className: "db-settings-hint", children: storagePersistent ? "Protected from routine browser cleanup on this device." : "Browsers may clear site data under storage pressure unless protection is granted." }),
|
|
4508
|
+
onKeepBrowserData && /* @__PURE__ */ jsx9(
|
|
4427
4509
|
"button",
|
|
4428
4510
|
{
|
|
4429
4511
|
type: "button",
|
|
@@ -4434,16 +4516,16 @@ function AppMenu({
|
|
|
4434
4516
|
}
|
|
4435
4517
|
)
|
|
4436
4518
|
] }),
|
|
4437
|
-
onVersioningPreferenceChange && /* @__PURE__ */
|
|
4438
|
-
/* @__PURE__ */
|
|
4439
|
-
/* @__PURE__ */
|
|
4519
|
+
onVersioningPreferenceChange && /* @__PURE__ */ jsxs8("fieldset", { className: "db-settings-fieldset", children: [
|
|
4520
|
+
/* @__PURE__ */ jsx9("legend", { className: "db-settings-legend", children: "Version history" }),
|
|
4521
|
+
/* @__PURE__ */ jsxs8("p", { className: "db-settings-hint", children: [
|
|
4440
4522
|
"When on, DocBlocks keeps prior revisions of each document inside a sibling",
|
|
4441
4523
|
" ",
|
|
4442
|
-
/* @__PURE__ */
|
|
4524
|
+
/* @__PURE__ */ jsx9("code", { children: "<name>_files/.versions/" }),
|
|
4443
4525
|
" folder. Individual workspaces can override this default in their own settings."
|
|
4444
4526
|
] }),
|
|
4445
|
-
/* @__PURE__ */
|
|
4446
|
-
/* @__PURE__ */
|
|
4527
|
+
/* @__PURE__ */ jsxs8("label", { className: "db-settings-radio", children: [
|
|
4528
|
+
/* @__PURE__ */ jsx9(
|
|
4447
4529
|
"input",
|
|
4448
4530
|
{
|
|
4449
4531
|
type: "radio",
|
|
@@ -4455,8 +4537,8 @@ function AppMenu({
|
|
|
4455
4537
|
),
|
|
4456
4538
|
"On for all workspaces"
|
|
4457
4539
|
] }),
|
|
4458
|
-
/* @__PURE__ */
|
|
4459
|
-
/* @__PURE__ */
|
|
4540
|
+
/* @__PURE__ */ jsxs8("label", { className: "db-settings-radio", children: [
|
|
4541
|
+
/* @__PURE__ */ jsx9(
|
|
4460
4542
|
"input",
|
|
4461
4543
|
{
|
|
4462
4544
|
type: "radio",
|
|
@@ -4468,8 +4550,8 @@ function AppMenu({
|
|
|
4468
4550
|
),
|
|
4469
4551
|
"On in browser workspaces, off for local folders"
|
|
4470
4552
|
] }),
|
|
4471
|
-
/* @__PURE__ */
|
|
4472
|
-
/* @__PURE__ */
|
|
4553
|
+
/* @__PURE__ */ jsxs8("label", { className: "db-settings-radio", children: [
|
|
4554
|
+
/* @__PURE__ */ jsx9(
|
|
4473
4555
|
"input",
|
|
4474
4556
|
{
|
|
4475
4557
|
type: "radio",
|
|
@@ -4481,7 +4563,7 @@ function AppMenu({
|
|
|
4481
4563
|
),
|
|
4482
4564
|
"Off for all workspaces"
|
|
4483
4565
|
] }),
|
|
4484
|
-
onOpenWorkspaceSettings && /* @__PURE__ */
|
|
4566
|
+
onOpenWorkspaceSettings && /* @__PURE__ */ jsx9(
|
|
4485
4567
|
"button",
|
|
4486
4568
|
{
|
|
4487
4569
|
type: "button",
|
|
@@ -4495,38 +4577,38 @@ function AppMenu({
|
|
|
4495
4577
|
)
|
|
4496
4578
|
] })
|
|
4497
4579
|
] }),
|
|
4498
|
-
showAbout && /* @__PURE__ */
|
|
4499
|
-
/* @__PURE__ */
|
|
4500
|
-
/* @__PURE__ */
|
|
4580
|
+
showAbout && /* @__PURE__ */ jsxs8(Dialog, { title: "About DocBlocks", onClose: () => setShowAbout(false), children: [
|
|
4581
|
+
/* @__PURE__ */ jsxs8("p", { children: [
|
|
4582
|
+
/* @__PURE__ */ jsx9("strong", { children: "DocBlocks" }),
|
|
4501
4583
|
" is a local-first Markdown document editor. Your files stay under your control."
|
|
4502
4584
|
] }),
|
|
4503
|
-
appVersion && /* @__PURE__ */
|
|
4504
|
-
/* @__PURE__ */
|
|
4505
|
-
/* @__PURE__ */
|
|
4585
|
+
appVersion && /* @__PURE__ */ jsxs8("p", { className: "db-about-version", children: [
|
|
4586
|
+
/* @__PURE__ */ jsx9("span", { children: "Version" }),
|
|
4587
|
+
/* @__PURE__ */ jsx9("code", { "aria-label": `DocBlocks version ${appVersion}`, children: appVersion })
|
|
4506
4588
|
] }),
|
|
4507
|
-
appBuildDate && /* @__PURE__ */
|
|
4508
|
-
/* @__PURE__ */
|
|
4509
|
-
/* @__PURE__ */
|
|
4589
|
+
appBuildDate && /* @__PURE__ */ jsxs8("p", { className: "db-about-version", children: [
|
|
4590
|
+
/* @__PURE__ */ jsx9("span", { children: "Build" }),
|
|
4591
|
+
/* @__PURE__ */ jsx9("time", { dateTime: appBuildDate, children: displayBuildDate(appBuildDate) })
|
|
4510
4592
|
] }),
|
|
4511
|
-
/* @__PURE__ */
|
|
4593
|
+
/* @__PURE__ */ jsxs8("p", { children: [
|
|
4512
4594
|
"Built with",
|
|
4513
4595
|
" ",
|
|
4514
|
-
/* @__PURE__ */
|
|
4596
|
+
/* @__PURE__ */ jsx9("a", { href: "https://github.com/bendyline/squisq", target: "_blank", rel: "noopener noreferrer", children: "squisq" }),
|
|
4515
4597
|
" ",
|
|
4516
4598
|
"by",
|
|
4517
4599
|
" ",
|
|
4518
|
-
/* @__PURE__ */
|
|
4600
|
+
/* @__PURE__ */ jsx9("a", { href: "https://bendyline.com", target: "_blank", rel: "noopener noreferrer", children: "Bendyline" }),
|
|
4519
4601
|
"."
|
|
4520
4602
|
] }),
|
|
4521
|
-
surface === "web" && /* @__PURE__ */
|
|
4603
|
+
surface === "web" && /* @__PURE__ */ jsxs8("p", { children: [
|
|
4522
4604
|
"See our free desktop apps at",
|
|
4523
4605
|
" ",
|
|
4524
|
-
/* @__PURE__ */
|
|
4606
|
+
/* @__PURE__ */ jsx9("a", { href: MORE_INFORMATION_URLS.electron, target: "_blank", rel: "noopener noreferrer", children: "docblocks.com/desktop" }),
|
|
4525
4607
|
"."
|
|
4526
4608
|
] }),
|
|
4527
|
-
/* @__PURE__ */
|
|
4528
|
-
/* @__PURE__ */
|
|
4529
|
-
/* @__PURE__ */
|
|
4609
|
+
/* @__PURE__ */ jsxs8("p", { className: "db-dialog-links", children: [
|
|
4610
|
+
/* @__PURE__ */ jsx9("a", { href: moreInformationUrl, target: "_blank", rel: "noopener noreferrer", children: "More information..." }),
|
|
4611
|
+
/* @__PURE__ */ jsx9(
|
|
4530
4612
|
"a",
|
|
4531
4613
|
{
|
|
4532
4614
|
href: "https://github.com/bendyline/docblocks",
|
|
@@ -4535,7 +4617,7 @@ function AppMenu({
|
|
|
4535
4617
|
children: "GitHub"
|
|
4536
4618
|
}
|
|
4537
4619
|
),
|
|
4538
|
-
/* @__PURE__ */
|
|
4620
|
+
/* @__PURE__ */ jsx9(
|
|
4539
4621
|
"a",
|
|
4540
4622
|
{
|
|
4541
4623
|
href: "https://github.com/bendyline/docblocks/releases",
|
|
@@ -4544,7 +4626,7 @@ function AppMenu({
|
|
|
4544
4626
|
children: "Release notes"
|
|
4545
4627
|
}
|
|
4546
4628
|
),
|
|
4547
|
-
/* @__PURE__ */
|
|
4629
|
+
/* @__PURE__ */ jsx9(
|
|
4548
4630
|
"a",
|
|
4549
4631
|
{
|
|
4550
4632
|
href: "https://github.com/bendyline/docblocks/issues",
|
|
@@ -4553,7 +4635,7 @@ function AppMenu({
|
|
|
4553
4635
|
children: "Support"
|
|
4554
4636
|
}
|
|
4555
4637
|
),
|
|
4556
|
-
/* @__PURE__ */
|
|
4638
|
+
/* @__PURE__ */ jsx9(
|
|
4557
4639
|
"a",
|
|
4558
4640
|
{
|
|
4559
4641
|
href: "https://github.com/bendyline/docblocks/blob/main/LICENSE",
|
|
@@ -4562,7 +4644,7 @@ function AppMenu({
|
|
|
4562
4644
|
children: "License (MIT)"
|
|
4563
4645
|
}
|
|
4564
4646
|
),
|
|
4565
|
-
/* @__PURE__ */
|
|
4647
|
+
/* @__PURE__ */ jsx9(
|
|
4566
4648
|
"a",
|
|
4567
4649
|
{
|
|
4568
4650
|
href: "https://github.com/bendyline/docblocks/blob/main/NOTICE.md",
|
|
@@ -4630,18 +4712,18 @@ async function restoreBrowserBackup(file) {
|
|
|
4630
4712
|
}
|
|
4631
4713
|
|
|
4632
4714
|
// src/WorkspacePicker/WorkspaceSettingsButton.tsx
|
|
4633
|
-
import { useState as
|
|
4634
|
-
import { jsx as
|
|
4715
|
+
import { useState as useState9, useCallback as useCallback10, useRef as useRef10, useEffect as useEffect10 } from "react";
|
|
4716
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
4635
4717
|
function WorkspaceSettingsButton({
|
|
4636
4718
|
onSettings,
|
|
4637
4719
|
onRename,
|
|
4638
4720
|
onDownload,
|
|
4639
4721
|
onRemove
|
|
4640
4722
|
}) {
|
|
4641
|
-
const [isOpen, setIsOpen] =
|
|
4642
|
-
const containerRef =
|
|
4723
|
+
const [isOpen, setIsOpen] = useState9(false);
|
|
4724
|
+
const containerRef = useRef10(null);
|
|
4643
4725
|
const { menuRef, triggerRef, handleMenuKeyDown, handleTriggerKeyDown, closeMenu } = useMenuKeyboard(isOpen, setIsOpen);
|
|
4644
|
-
|
|
4726
|
+
useEffect10(() => {
|
|
4645
4727
|
if (!isOpen) return;
|
|
4646
4728
|
function handleOutsideClick(e) {
|
|
4647
4729
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -4651,15 +4733,15 @@ function WorkspaceSettingsButton({
|
|
|
4651
4733
|
document.addEventListener("mousedown", handleOutsideClick);
|
|
4652
4734
|
return () => document.removeEventListener("mousedown", handleOutsideClick);
|
|
4653
4735
|
}, [closeMenu, isOpen]);
|
|
4654
|
-
const handleAction =
|
|
4736
|
+
const handleAction = useCallback10(
|
|
4655
4737
|
(action) => {
|
|
4656
4738
|
closeMenu(true);
|
|
4657
4739
|
action();
|
|
4658
4740
|
},
|
|
4659
4741
|
[closeMenu]
|
|
4660
4742
|
);
|
|
4661
|
-
return /* @__PURE__ */
|
|
4662
|
-
/* @__PURE__ */
|
|
4743
|
+
return /* @__PURE__ */ jsxs9("div", { ref: containerRef, className: "db-ws-settings", children: [
|
|
4744
|
+
/* @__PURE__ */ jsx10(
|
|
4663
4745
|
"button",
|
|
4664
4746
|
{
|
|
4665
4747
|
ref: triggerRef,
|
|
@@ -4670,10 +4752,10 @@ function WorkspaceSettingsButton({
|
|
|
4670
4752
|
"aria-haspopup": "menu",
|
|
4671
4753
|
"aria-label": "Workspace settings",
|
|
4672
4754
|
title: "Workspace settings",
|
|
4673
|
-
children: /* @__PURE__ */
|
|
4755
|
+
children: /* @__PURE__ */ jsx10(WorkspaceIcon, {})
|
|
4674
4756
|
}
|
|
4675
4757
|
),
|
|
4676
|
-
isOpen && /* @__PURE__ */
|
|
4758
|
+
isOpen && /* @__PURE__ */ jsxs9(
|
|
4677
4759
|
"div",
|
|
4678
4760
|
{
|
|
4679
4761
|
ref: menuRef,
|
|
@@ -4681,7 +4763,7 @@ function WorkspaceSettingsButton({
|
|
|
4681
4763
|
role: "menu",
|
|
4682
4764
|
onKeyDown: handleMenuKeyDown,
|
|
4683
4765
|
children: [
|
|
4684
|
-
/* @__PURE__ */
|
|
4766
|
+
/* @__PURE__ */ jsx10(
|
|
4685
4767
|
"button",
|
|
4686
4768
|
{
|
|
4687
4769
|
className: "db-ws-settings-item",
|
|
@@ -4691,7 +4773,7 @@ function WorkspaceSettingsButton({
|
|
|
4691
4773
|
children: "Workspace settings\u2026"
|
|
4692
4774
|
}
|
|
4693
4775
|
),
|
|
4694
|
-
/* @__PURE__ */
|
|
4776
|
+
/* @__PURE__ */ jsx10(
|
|
4695
4777
|
"button",
|
|
4696
4778
|
{
|
|
4697
4779
|
className: "db-ws-settings-item",
|
|
@@ -4701,7 +4783,7 @@ function WorkspaceSettingsButton({
|
|
|
4701
4783
|
children: "Rename workspace"
|
|
4702
4784
|
}
|
|
4703
4785
|
),
|
|
4704
|
-
/* @__PURE__ */
|
|
4786
|
+
/* @__PURE__ */ jsx10(
|
|
4705
4787
|
"button",
|
|
4706
4788
|
{
|
|
4707
4789
|
className: "db-ws-settings-item",
|
|
@@ -4711,8 +4793,8 @@ function WorkspaceSettingsButton({
|
|
|
4711
4793
|
children: "Back up this workspace"
|
|
4712
4794
|
}
|
|
4713
4795
|
),
|
|
4714
|
-
/* @__PURE__ */
|
|
4715
|
-
/* @__PURE__ */
|
|
4796
|
+
/* @__PURE__ */ jsx10("div", { className: "db-ws-settings-divider" }),
|
|
4797
|
+
/* @__PURE__ */ jsx10(
|
|
4716
4798
|
"button",
|
|
4717
4799
|
{
|
|
4718
4800
|
className: "db-ws-settings-item db-ws-settings-item--danger",
|
|
@@ -4729,7 +4811,7 @@ function WorkspaceSettingsButton({
|
|
|
4729
4811
|
}
|
|
4730
4812
|
|
|
4731
4813
|
// src/WorkspacePicker/WorkspaceSettingsDialog.tsx
|
|
4732
|
-
import { useEffect as
|
|
4814
|
+
import { useEffect as useEffect11, useMemo as useMemo2, useState as useState10 } from "react";
|
|
4733
4815
|
import { getThemeSummaries } from "@bendyline/squisq/schemas";
|
|
4734
4816
|
import {
|
|
4735
4817
|
diffWorkspaceSettings,
|
|
@@ -4783,7 +4865,7 @@ function resolveVersioningEnabled(workspace, globalPref, workspaceSettings) {
|
|
|
4783
4865
|
}
|
|
4784
4866
|
|
|
4785
4867
|
// src/WorkspacePicker/WorkspaceSettingsDialog.tsx
|
|
4786
|
-
import { Fragment as Fragment6, jsx as
|
|
4868
|
+
import { Fragment as Fragment6, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
4787
4869
|
var VERSIONING_LABELS = {
|
|
4788
4870
|
on: "on",
|
|
4789
4871
|
"browser-only": "on for browser workspaces, off for local folders",
|
|
@@ -4832,15 +4914,15 @@ function WorkspaceSettingsDialog({
|
|
|
4832
4914
|
}) {
|
|
4833
4915
|
const writable = isWorkspaceSettingsWritable(settings);
|
|
4834
4916
|
const base = settings.settings;
|
|
4835
|
-
const [draft, setDraft] =
|
|
4917
|
+
const [draft, setDraft] = useState10(
|
|
4836
4918
|
() => initialDraft(workspace, settings.settings)
|
|
4837
4919
|
);
|
|
4838
|
-
const [touched, setTouched] =
|
|
4839
|
-
|
|
4920
|
+
const [touched, setTouched] = useState10(false);
|
|
4921
|
+
useEffect11(() => {
|
|
4840
4922
|
if (!touched) setDraft(initialDraft(workspace, settings.settings));
|
|
4841
4923
|
}, [settings.settings, touched, workspace]);
|
|
4842
|
-
const [saving, setSaving] =
|
|
4843
|
-
const [saveError, setSaveError] =
|
|
4924
|
+
const [saving, setSaving] = useState10(false);
|
|
4925
|
+
const [saveError, setSaveError] = useState10(null);
|
|
4844
4926
|
const themes = useMemo2(() => getThemeSummaries(), []);
|
|
4845
4927
|
const patch = useMemo2(() => diffWorkspaceSettings(base, draft), [base, draft]);
|
|
4846
4928
|
const validation = useMemo2(() => tryApplyWorkspaceSettingsPatch(base, patch), [base, patch]);
|
|
@@ -4865,16 +4947,16 @@ function WorkspaceSettingsDialog({
|
|
|
4865
4947
|
}
|
|
4866
4948
|
};
|
|
4867
4949
|
const notice = settings.status === "loading" ? "Loading workspace settings\u2026" : writable ? null : settings.message ?? "These workspace settings cannot be changed here.";
|
|
4868
|
-
return /* @__PURE__ */
|
|
4950
|
+
return /* @__PURE__ */ jsxs10(
|
|
4869
4951
|
Dialog,
|
|
4870
4952
|
{
|
|
4871
4953
|
title: "Workspace settings",
|
|
4872
4954
|
size: "wide",
|
|
4873
4955
|
onClose,
|
|
4874
4956
|
closeOnBackdrop: !changed,
|
|
4875
|
-
footer: writable ? /* @__PURE__ */
|
|
4876
|
-
/* @__PURE__ */
|
|
4877
|
-
/* @__PURE__ */
|
|
4957
|
+
footer: writable ? /* @__PURE__ */ jsxs10(Fragment6, { children: [
|
|
4958
|
+
/* @__PURE__ */ jsx11("button", { type: "button", className: "db-git-secondary-btn", onClick: onClose, children: "Cancel" }),
|
|
4959
|
+
/* @__PURE__ */ jsx11(
|
|
4878
4960
|
"button",
|
|
4879
4961
|
{
|
|
4880
4962
|
type: "button",
|
|
@@ -4884,19 +4966,19 @@ function WorkspaceSettingsDialog({
|
|
|
4884
4966
|
children: saving ? "Saving\u2026" : "Save"
|
|
4885
4967
|
}
|
|
4886
4968
|
)
|
|
4887
|
-
] }) : /* @__PURE__ */
|
|
4969
|
+
] }) : /* @__PURE__ */ jsx11("button", { type: "button", className: "db-git-secondary-btn", onClick: onClose, children: "Close" }),
|
|
4888
4970
|
children: [
|
|
4889
|
-
/* @__PURE__ */
|
|
4890
|
-
/* @__PURE__ */
|
|
4971
|
+
/* @__PURE__ */ jsxs10("p", { className: "db-settings-hint", children: [
|
|
4972
|
+
/* @__PURE__ */ jsx11("strong", { children: workspace.name }),
|
|
4891
4973
|
" \xB7",
|
|
4892
4974
|
" ",
|
|
4893
4975
|
isLocal ? "Local folder workspace" : "Browser workspace",
|
|
4894
4976
|
" \xB7 saved in",
|
|
4895
4977
|
" ",
|
|
4896
|
-
/* @__PURE__ */
|
|
4978
|
+
/* @__PURE__ */ jsx11("code", { children: ".docblocks/workspace.json" })
|
|
4897
4979
|
] }),
|
|
4898
|
-
notice && /* @__PURE__ */
|
|
4899
|
-
/* @__PURE__ */
|
|
4980
|
+
notice && /* @__PURE__ */ jsx11("p", { className: "db-settings-status db-settings-status--warning", role: "status", children: notice }),
|
|
4981
|
+
/* @__PURE__ */ jsx11(
|
|
4900
4982
|
WorkspaceSettingsControls,
|
|
4901
4983
|
{
|
|
4902
4984
|
value: draft,
|
|
@@ -4913,14 +4995,14 @@ function WorkspaceSettingsDialog({
|
|
|
4913
4995
|
regenerating: outputsStatus.state === "running"
|
|
4914
4996
|
}
|
|
4915
4997
|
),
|
|
4916
|
-
(saveError || !validation.ok && changed) && /* @__PURE__ */
|
|
4998
|
+
(saveError || !validation.ok && changed) && /* @__PURE__ */ jsx11("p", { className: "db-settings-status db-settings-status--warning", role: "alert", children: saveError ?? (!validation.ok ? validation.message : null) })
|
|
4917
4999
|
]
|
|
4918
5000
|
}
|
|
4919
5001
|
);
|
|
4920
5002
|
}
|
|
4921
5003
|
|
|
4922
5004
|
// src/WorkspaceSettings/useWorkspaceSettings.ts
|
|
4923
|
-
import { useCallback as
|
|
5005
|
+
import { useCallback as useCallback11, useEffect as useEffect12, useRef as useRef11, useState as useState11 } from "react";
|
|
4924
5006
|
import { maybeGetDocBlocksHost } from "@bendyline/docblocks/host";
|
|
4925
5007
|
import { getFileSystemProviderV2 as getFileSystemProviderV24 } from "@bendyline/docblocks/filesystem";
|
|
4926
5008
|
import {
|
|
@@ -4935,15 +5017,15 @@ function sameState(left, right) {
|
|
|
4935
5017
|
}
|
|
4936
5018
|
function useWorkspaceSettings(provider, enabled) {
|
|
4937
5019
|
const providerV2 = provider && enabled ? getFileSystemProviderV24(provider) : null;
|
|
4938
|
-
const [state, setState] =
|
|
5020
|
+
const [state, setState] = useState11(
|
|
4939
5021
|
providerV2 ? LOADING_WORKSPACE_SETTINGS : UNAVAILABLE_WORKSPACE_SETTINGS
|
|
4940
5022
|
);
|
|
4941
|
-
const stateRef =
|
|
5023
|
+
const stateRef = useRef11(state);
|
|
4942
5024
|
stateRef.current = state;
|
|
4943
|
-
const generationRef =
|
|
4944
|
-
const [refreshKey, setRefreshKey] =
|
|
4945
|
-
const refresh =
|
|
4946
|
-
const providerRef =
|
|
5025
|
+
const generationRef = useRef11(0);
|
|
5026
|
+
const [refreshKey, setRefreshKey] = useState11(0);
|
|
5027
|
+
const refresh = useCallback11(() => setRefreshKey((key) => key + 1), []);
|
|
5028
|
+
const providerRef = useRef11(providerV2);
|
|
4947
5029
|
if (providerRef.current !== providerV2) {
|
|
4948
5030
|
providerRef.current = providerV2;
|
|
4949
5031
|
generationRef.current += 1;
|
|
@@ -4951,7 +5033,7 @@ function useWorkspaceSettings(provider, enabled) {
|
|
|
4951
5033
|
stateRef.current = reset;
|
|
4952
5034
|
setState(reset);
|
|
4953
5035
|
}
|
|
4954
|
-
|
|
5036
|
+
useEffect12(() => {
|
|
4955
5037
|
if (!providerV2) return;
|
|
4956
5038
|
const generation = generationRef.current;
|
|
4957
5039
|
let cancelled = false;
|
|
@@ -4966,7 +5048,7 @@ function useWorkspaceSettings(provider, enabled) {
|
|
|
4966
5048
|
cancelled = true;
|
|
4967
5049
|
};
|
|
4968
5050
|
}, [providerV2, refreshKey]);
|
|
4969
|
-
|
|
5051
|
+
useEffect12(() => {
|
|
4970
5052
|
if (!providerV2) return;
|
|
4971
5053
|
window.addEventListener("focus", refresh);
|
|
4972
5054
|
const stopResume = maybeGetDocBlocksHost()?.lifecycle?.onResume?.(refresh);
|
|
@@ -4985,7 +5067,7 @@ function useWorkspaceSettings(provider, enabled) {
|
|
|
4985
5067
|
void subscription?.dispose();
|
|
4986
5068
|
};
|
|
4987
5069
|
}, [providerV2, refresh]);
|
|
4988
|
-
const save =
|
|
5070
|
+
const save = useCallback11(
|
|
4989
5071
|
async (patch) => {
|
|
4990
5072
|
if (!providerV2) throw new Error(UNAVAILABLE_WORKSPACE_SETTINGS.message ?? void 0);
|
|
4991
5073
|
const generation = generationRef.current;
|
|
@@ -5002,7 +5084,7 @@ function useWorkspaceSettings(provider, enabled) {
|
|
|
5002
5084
|
}
|
|
5003
5085
|
|
|
5004
5086
|
// src/WorkspaceSettings/useWorkspaceOutputs.ts
|
|
5005
|
-
import { useEffect as
|
|
5087
|
+
import { useEffect as useEffect13, useState as useState12, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
5006
5088
|
import { getFileSystemProviderV2 as getFileSystemProviderV25 } from "@bendyline/docblocks/filesystem";
|
|
5007
5089
|
import {
|
|
5008
5090
|
createWorkspaceOutputsScheduler,
|
|
@@ -5026,8 +5108,8 @@ var noSubscription = () => () => void 0;
|
|
|
5026
5108
|
var idleStatus = () => IDLE_WORKSPACE_OUTPUTS_STATUS;
|
|
5027
5109
|
function useWorkspaceOutputs(provider, workspaceId, settings, enabled) {
|
|
5028
5110
|
const providerV2 = provider && enabled ? getFileSystemProviderV25(provider) : null;
|
|
5029
|
-
const [scheduler, setScheduler] =
|
|
5030
|
-
|
|
5111
|
+
const [scheduler, setScheduler] = useState12(null);
|
|
5112
|
+
useEffect13(() => {
|
|
5031
5113
|
if (!providerV2 || !workspaceId) {
|
|
5032
5114
|
setScheduler(null);
|
|
5033
5115
|
return;
|
|
@@ -5048,7 +5130,7 @@ function useWorkspaceOutputs(provider, workspaceId, settings, enabled) {
|
|
|
5048
5130
|
next.dispose();
|
|
5049
5131
|
};
|
|
5050
5132
|
}, [providerV2, workspaceId]);
|
|
5051
|
-
|
|
5133
|
+
useEffect13(() => {
|
|
5052
5134
|
scheduler?.updateSettings(settings);
|
|
5053
5135
|
}, [scheduler, settings]);
|
|
5054
5136
|
const status = useSyncExternalStore2(
|
|
@@ -5083,22 +5165,22 @@ async function assertNotGeneratedCatalog(provider, path) {
|
|
|
5083
5165
|
}
|
|
5084
5166
|
|
|
5085
5167
|
// src/WorkspaceSettings/GeneratedFileView.tsx
|
|
5086
|
-
import { Fragment as Fragment7, jsx as
|
|
5168
|
+
import { Fragment as Fragment7, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
5087
5169
|
function GeneratedFileNotice({ kind, onOpenSettings, onBack }) {
|
|
5088
|
-
return /* @__PURE__ */
|
|
5089
|
-
onBack && /* @__PURE__ */
|
|
5090
|
-
/* @__PURE__ */
|
|
5091
|
-
/* @__PURE__ */
|
|
5170
|
+
return /* @__PURE__ */ jsxs11("div", { className: "db-generated-file-notice", role: "note", children: [
|
|
5171
|
+
onBack && /* @__PURE__ */ jsx12("button", { type: "button", className: "db-generated-file-back", onClick: onBack, children: "Back to files" }),
|
|
5172
|
+
/* @__PURE__ */ jsxs11("span", { className: "db-generated-file-notice-text", children: [
|
|
5173
|
+
/* @__PURE__ */ jsx12("strong", { children: "Generated by DocBlocks \xB7 read-only." }),
|
|
5092
5174
|
" ",
|
|
5093
5175
|
kind === "catalog-html" ? "This catalog page is rebuilt from the documents in this folder as you save." : "This catalog data is rebuilt from the documents in this folder as you save."
|
|
5094
5176
|
] }),
|
|
5095
|
-
onOpenSettings && /* @__PURE__ */
|
|
5177
|
+
onOpenSettings && /* @__PURE__ */ jsx12("button", { type: "button", className: "db-git-secondary-btn", onClick: onOpenSettings, children: "Catalog settings\u2026" })
|
|
5096
5178
|
] });
|
|
5097
5179
|
}
|
|
5098
5180
|
function GeneratedCatalogPage({ html, fileName, ...notice }) {
|
|
5099
|
-
return /* @__PURE__ */
|
|
5100
|
-
/* @__PURE__ */
|
|
5101
|
-
/* @__PURE__ */
|
|
5181
|
+
return /* @__PURE__ */ jsxs11("div", { className: "db-generated-file", children: [
|
|
5182
|
+
/* @__PURE__ */ jsx12(GeneratedFileNotice, { kind: "catalog-html", ...notice }),
|
|
5183
|
+
/* @__PURE__ */ jsx12(
|
|
5102
5184
|
"iframe",
|
|
5103
5185
|
{
|
|
5104
5186
|
className: "db-generated-file-preview",
|
|
@@ -5111,10 +5193,10 @@ function GeneratedCatalogPage({ html, fileName, ...notice }) {
|
|
|
5111
5193
|
] });
|
|
5112
5194
|
}
|
|
5113
5195
|
function GeneratedFileFrame({ kind, children, ...notice }) {
|
|
5114
|
-
if (!kind) return /* @__PURE__ */
|
|
5115
|
-
return /* @__PURE__ */
|
|
5116
|
-
/* @__PURE__ */
|
|
5117
|
-
/* @__PURE__ */
|
|
5196
|
+
if (!kind) return /* @__PURE__ */ jsx12(Fragment7, { children });
|
|
5197
|
+
return /* @__PURE__ */ jsxs11("div", { className: "db-generated-file", children: [
|
|
5198
|
+
/* @__PURE__ */ jsx12(GeneratedFileNotice, { kind, ...notice }),
|
|
5199
|
+
/* @__PURE__ */ jsx12("div", { className: "db-generated-file-body", children })
|
|
5118
5200
|
] });
|
|
5119
5201
|
}
|
|
5120
5202
|
|
|
@@ -5126,14 +5208,14 @@ import {
|
|
|
5126
5208
|
} from "@bendyline/docblocks/workspace-settings";
|
|
5127
5209
|
|
|
5128
5210
|
// src/hooks/useDocumentSession.ts
|
|
5129
|
-
import { useState as
|
|
5211
|
+
import { useState as useState13, useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
5130
5212
|
import {
|
|
5131
5213
|
DocumentRecoveryJournal,
|
|
5132
5214
|
DocumentSession,
|
|
5133
5215
|
getDefaultDocumentRecoveryStorage
|
|
5134
5216
|
} from "@bendyline/docblocks/document";
|
|
5135
5217
|
function useDocumentSession(autoSaveDelayMs = 500) {
|
|
5136
|
-
const [session] =
|
|
5218
|
+
const [session] = useState13(
|
|
5137
5219
|
() => new DocumentSession({
|
|
5138
5220
|
autoSaveDelayMs,
|
|
5139
5221
|
recoveryJournal: new DocumentRecoveryJournal(getDefaultDocumentRecoveryStorage())
|
|
@@ -5149,14 +5231,14 @@ function useDocumentSession(autoSaveDelayMs = 500) {
|
|
|
5149
5231
|
|
|
5150
5232
|
// src/Export/DeferredExportToolbarControls.tsx
|
|
5151
5233
|
import { lazy, Suspense } from "react";
|
|
5152
|
-
import { jsx as
|
|
5234
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
5153
5235
|
var ExportToolbarControlsImplementation = lazy(
|
|
5154
|
-
() => import("./ExportToolbarControls-
|
|
5236
|
+
() => import("./ExportToolbarControls-4LYTXGT3.js").then((module) => ({
|
|
5155
5237
|
default: module.ExportToolbarControls
|
|
5156
5238
|
}))
|
|
5157
5239
|
);
|
|
5158
5240
|
function ExportToolbarControls(props) {
|
|
5159
|
-
return /* @__PURE__ */
|
|
5241
|
+
return /* @__PURE__ */ jsx13(Suspense, { fallback: null, children: /* @__PURE__ */ jsx13(ExportToolbarControlsImplementation, { ...props }) });
|
|
5160
5242
|
}
|
|
5161
5243
|
|
|
5162
5244
|
// src/Export/host-export-save.ts
|
|
@@ -5196,27 +5278,27 @@ async function saveBlobToHost(exports, documentId, blob, filename, grantId) {
|
|
|
5196
5278
|
}
|
|
5197
5279
|
|
|
5198
5280
|
// src/Git/useGit.ts
|
|
5199
|
-
import { useCallback as
|
|
5281
|
+
import { useCallback as useCallback13, useEffect as useEffect15, useMemo as useMemo3, useRef as useRef13, useState as useState15 } from "react";
|
|
5200
5282
|
import { maybeGetDocBlocksHost as maybeGetDocBlocksHost2 } from "@bendyline/docblocks/host";
|
|
5201
5283
|
|
|
5202
5284
|
// src/Git/useGitStatus.ts
|
|
5203
|
-
import { useCallback as
|
|
5285
|
+
import { useCallback as useCallback12, useEffect as useEffect14, useRef as useRef12, useState as useState14 } from "react";
|
|
5204
5286
|
var SCHEDULE_REFRESH_MS = 1500;
|
|
5205
5287
|
function statusKey(status) {
|
|
5206
5288
|
return JSON.stringify(status);
|
|
5207
5289
|
}
|
|
5208
5290
|
function useGitStatus(gitApi, repositoryId, enabled) {
|
|
5209
|
-
const [status, setStatus] =
|
|
5210
|
-
const lastKeyRef =
|
|
5211
|
-
const timerRef =
|
|
5212
|
-
const generationRef =
|
|
5213
|
-
const apply =
|
|
5291
|
+
const [status, setStatus] = useState14(null);
|
|
5292
|
+
const lastKeyRef = useRef12(null);
|
|
5293
|
+
const timerRef = useRef12(null);
|
|
5294
|
+
const generationRef = useRef12(0);
|
|
5295
|
+
const apply = useCallback12((next) => {
|
|
5214
5296
|
const key = statusKey(next);
|
|
5215
5297
|
if (key === lastKeyRef.current) return;
|
|
5216
5298
|
lastKeyRef.current = key;
|
|
5217
5299
|
setStatus(next);
|
|
5218
5300
|
}, []);
|
|
5219
|
-
|
|
5301
|
+
useEffect14(() => {
|
|
5220
5302
|
generationRef.current += 1;
|
|
5221
5303
|
if (timerRef.current) {
|
|
5222
5304
|
clearTimeout(timerRef.current);
|
|
@@ -5234,7 +5316,7 @@ function useGitStatus(gitApi, repositoryId, enabled) {
|
|
|
5234
5316
|
unsubscribe();
|
|
5235
5317
|
};
|
|
5236
5318
|
}, [gitApi, repositoryId, enabled, apply]);
|
|
5237
|
-
const refresh =
|
|
5319
|
+
const refresh = useCallback12(() => {
|
|
5238
5320
|
if (!gitApi || !repositoryId || !enabled) return;
|
|
5239
5321
|
const generation = generationRef.current;
|
|
5240
5322
|
void gitApi.status(repositoryId).then(
|
|
@@ -5248,14 +5330,14 @@ function useGitStatus(gitApi, repositoryId, enabled) {
|
|
|
5248
5330
|
() => void 0
|
|
5249
5331
|
);
|
|
5250
5332
|
}, [gitApi, repositoryId, enabled, apply]);
|
|
5251
|
-
const scheduleRefresh =
|
|
5333
|
+
const scheduleRefresh = useCallback12(() => {
|
|
5252
5334
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
5253
5335
|
timerRef.current = setTimeout(() => {
|
|
5254
5336
|
timerRef.current = null;
|
|
5255
5337
|
refresh();
|
|
5256
5338
|
}, SCHEDULE_REFRESH_MS);
|
|
5257
5339
|
}, [refresh]);
|
|
5258
|
-
|
|
5340
|
+
useEffect14(() => {
|
|
5259
5341
|
return () => {
|
|
5260
5342
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
5261
5343
|
};
|
|
@@ -5281,8 +5363,8 @@ function useGit(provider, requestedWorkspaceId, theme, onWorkingTreeChanged) {
|
|
|
5281
5363
|
const host = maybeGetDocBlocksHost2();
|
|
5282
5364
|
const gitApi = host?.git ?? null;
|
|
5283
5365
|
const workspaceId = gitApi ? requestedWorkspaceId : null;
|
|
5284
|
-
const [capabilities, setCapabilities] =
|
|
5285
|
-
|
|
5366
|
+
const [capabilities, setCapabilities] = useState15(null);
|
|
5367
|
+
useEffect15(() => {
|
|
5286
5368
|
if (!gitApi) return;
|
|
5287
5369
|
let cancelled = false;
|
|
5288
5370
|
let timer = null;
|
|
@@ -5308,10 +5390,10 @@ function useGit(provider, requestedWorkspaceId, theme, onWorkingTreeChanged) {
|
|
|
5308
5390
|
};
|
|
5309
5391
|
}, [gitApi]);
|
|
5310
5392
|
const available = gitApi !== null && capabilities?.gitAvailable === true;
|
|
5311
|
-
const [repo, setRepo] =
|
|
5312
|
-
const [remoteWeb, setRemoteWeb] =
|
|
5313
|
-
const [pendingGrant, setPendingGrant] =
|
|
5314
|
-
const loadRemote =
|
|
5393
|
+
const [repo, setRepo] = useState15(null);
|
|
5394
|
+
const [remoteWeb, setRemoteWeb] = useState15(null);
|
|
5395
|
+
const [pendingGrant, setPendingGrant] = useState15(null);
|
|
5396
|
+
const loadRemote = useCallback13(
|
|
5315
5397
|
(repositoryId2, isCancelled) => {
|
|
5316
5398
|
if (!gitApi) return;
|
|
5317
5399
|
void gitApi.listRemotes(repositoryId2).then(
|
|
@@ -5325,7 +5407,7 @@ function useGit(provider, requestedWorkspaceId, theme, onWorkingTreeChanged) {
|
|
|
5325
5407
|
},
|
|
5326
5408
|
[gitApi]
|
|
5327
5409
|
);
|
|
5328
|
-
|
|
5410
|
+
useEffect15(() => {
|
|
5329
5411
|
setRepo(null);
|
|
5330
5412
|
setRemoteWeb(null);
|
|
5331
5413
|
setPendingGrant(null);
|
|
@@ -5351,8 +5433,8 @@ function useGit(provider, requestedWorkspaceId, theme, onWorkingTreeChanged) {
|
|
|
5351
5433
|
cancelled = true;
|
|
5352
5434
|
};
|
|
5353
5435
|
}, [gitApi, workspaceId, available, loadRemote]);
|
|
5354
|
-
const [grantBusy, setGrantBusy] =
|
|
5355
|
-
const enableExpandedRepo =
|
|
5436
|
+
const [grantBusy, setGrantBusy] = useState15(false);
|
|
5437
|
+
const enableExpandedRepo = useCallback13(
|
|
5356
5438
|
async (opts) => {
|
|
5357
5439
|
if (!gitApi || !workspaceId) return false;
|
|
5358
5440
|
setGrantBusy(true);
|
|
@@ -5373,15 +5455,15 @@ function useGit(provider, requestedWorkspaceId, theme, onWorkingTreeChanged) {
|
|
|
5373
5455
|
const isRepo = repositoryId !== null;
|
|
5374
5456
|
const { status, refresh, scheduleRefresh } = useGitStatus(gitApi, repositoryId, isRepo);
|
|
5375
5457
|
const badges = useMemo3(() => buildBadgeMap(status?.changes ?? []), [status]);
|
|
5376
|
-
const [busy, setBusy] =
|
|
5377
|
-
const [lastResult, setLastResult] =
|
|
5378
|
-
const [dialog, setDialog] =
|
|
5379
|
-
const openDialog =
|
|
5458
|
+
const [busy, setBusy] = useState15(null);
|
|
5459
|
+
const [lastResult, setLastResult] = useState15(null);
|
|
5460
|
+
const [dialog, setDialog] = useState15({ kind: "none" });
|
|
5461
|
+
const openDialog = useCallback13((next) => {
|
|
5380
5462
|
setLastResult(null);
|
|
5381
5463
|
setDialog(next);
|
|
5382
5464
|
}, []);
|
|
5383
|
-
const closeDialog =
|
|
5384
|
-
const routeError =
|
|
5465
|
+
const closeDialog = useCallback13(() => setDialog({ kind: "none" }), []);
|
|
5466
|
+
const routeError = useCallback13(
|
|
5385
5467
|
(operation, error) => {
|
|
5386
5468
|
if (error.code === "auth-failed") {
|
|
5387
5469
|
setDialog({
|
|
@@ -5395,15 +5477,15 @@ function useGit(provider, requestedWorkspaceId, theme, onWorkingTreeChanged) {
|
|
|
5395
5477
|
},
|
|
5396
5478
|
[]
|
|
5397
5479
|
);
|
|
5398
|
-
const statusRef =
|
|
5399
|
-
|
|
5480
|
+
const statusRef = useRef13(status);
|
|
5481
|
+
useEffect15(() => {
|
|
5400
5482
|
statusRef.current = status;
|
|
5401
5483
|
}, [status]);
|
|
5402
|
-
const workingTreeChangedRef =
|
|
5403
|
-
|
|
5484
|
+
const workingTreeChangedRef = useRef13(onWorkingTreeChanged);
|
|
5485
|
+
useEffect15(() => {
|
|
5404
5486
|
workingTreeChangedRef.current = onWorkingTreeChanged;
|
|
5405
5487
|
}, [onWorkingTreeChanged]);
|
|
5406
|
-
const runAction =
|
|
5488
|
+
const runAction = useCallback13(
|
|
5407
5489
|
async (kind, operation, action, successMessage) => {
|
|
5408
5490
|
if (!gitApi || !repositoryId) return false;
|
|
5409
5491
|
setBusy(kind);
|
|
@@ -5433,7 +5515,7 @@ function useGit(provider, requestedWorkspaceId, theme, onWorkingTreeChanged) {
|
|
|
5433
5515
|
},
|
|
5434
5516
|
[gitApi, repositoryId, refresh, routeError]
|
|
5435
5517
|
);
|
|
5436
|
-
const commit =
|
|
5518
|
+
const commit = useCallback13(
|
|
5437
5519
|
(message, paths) => runAction(
|
|
5438
5520
|
"commit",
|
|
5439
5521
|
"commit",
|
|
@@ -5442,7 +5524,7 @@ function useGit(provider, requestedWorkspaceId, theme, onWorkingTreeChanged) {
|
|
|
5442
5524
|
),
|
|
5443
5525
|
[runAction]
|
|
5444
5526
|
);
|
|
5445
|
-
const push =
|
|
5527
|
+
const push = useCallback13(async () => {
|
|
5446
5528
|
const setUpstream = statusRef.current?.upstream === null;
|
|
5447
5529
|
await runAction(
|
|
5448
5530
|
"push",
|
|
@@ -5451,13 +5533,13 @@ function useGit(provider, requestedWorkspaceId, theme, onWorkingTreeChanged) {
|
|
|
5451
5533
|
setUpstream ? "Branch published" : "Pushed"
|
|
5452
5534
|
);
|
|
5453
5535
|
}, [runAction]);
|
|
5454
|
-
const pull =
|
|
5536
|
+
const pull = useCallback13(async () => {
|
|
5455
5537
|
await runAction("pull", "pull", (api, repository) => api.pull(repository), "Pulled");
|
|
5456
5538
|
}, [runAction]);
|
|
5457
|
-
const fetchRemote =
|
|
5539
|
+
const fetchRemote = useCallback13(async () => {
|
|
5458
5540
|
await runAction("fetch", "fetch", (api, repository) => api.fetch(repository), "Fetched");
|
|
5459
5541
|
}, [runAction]);
|
|
5460
|
-
const createBranch =
|
|
5542
|
+
const createBranch = useCallback13(
|
|
5461
5543
|
(name) => runAction(
|
|
5462
5544
|
"branch",
|
|
5463
5545
|
"branch",
|
|
@@ -5466,7 +5548,7 @@ function useGit(provider, requestedWorkspaceId, theme, onWorkingTreeChanged) {
|
|
|
5466
5548
|
),
|
|
5467
5549
|
[runAction]
|
|
5468
5550
|
);
|
|
5469
|
-
const switchBranch =
|
|
5551
|
+
const switchBranch = useCallback13(
|
|
5470
5552
|
(name) => runAction(
|
|
5471
5553
|
"branch",
|
|
5472
5554
|
"branch",
|
|
@@ -5475,7 +5557,7 @@ function useGit(provider, requestedWorkspaceId, theme, onWorkingTreeChanged) {
|
|
|
5475
5557
|
),
|
|
5476
5558
|
[runAction]
|
|
5477
5559
|
);
|
|
5478
|
-
const openOnRemote =
|
|
5560
|
+
const openOnRemote = useCallback13(
|
|
5479
5561
|
(filePath) => {
|
|
5480
5562
|
if (!remoteWeb || !host) return;
|
|
5481
5563
|
let url = remoteWeb.webUrl;
|
|
@@ -5487,7 +5569,7 @@ function useGit(provider, requestedWorkspaceId, theme, onWorkingTreeChanged) {
|
|
|
5487
5569
|
},
|
|
5488
5570
|
[remoteWeb, host]
|
|
5489
5571
|
);
|
|
5490
|
-
const createPullRequest =
|
|
5572
|
+
const createPullRequest = useCallback13(async () => {
|
|
5491
5573
|
if (!gitApi || !repositoryId) return;
|
|
5492
5574
|
setBusy("pr");
|
|
5493
5575
|
setLastResult(null);
|
|
@@ -5611,7 +5693,7 @@ function retainFileSystemProvider(provider) {
|
|
|
5611
5693
|
}
|
|
5612
5694
|
|
|
5613
5695
|
// src/DocBlocksShell/document-title.ts
|
|
5614
|
-
import { useEffect as
|
|
5696
|
+
import { useEffect as useEffect16 } from "react";
|
|
5615
5697
|
var APP_TITLE = "DocBlocks";
|
|
5616
5698
|
var INSTALLED_DISPLAY_QUERIES = [
|
|
5617
5699
|
"(display-mode: window-controls-overlay)",
|
|
@@ -5635,7 +5717,7 @@ function titleForSelectedFile(selectedFile, homeDocumentTitle = APP_TITLE, homeD
|
|
|
5635
5717
|
return includeAppName ? `${name} - ${APP_TITLE}` : name;
|
|
5636
5718
|
}
|
|
5637
5719
|
function useDocumentTitle(selectedFile, homeDocumentTitle, homeDocumentPath) {
|
|
5638
|
-
|
|
5720
|
+
useEffect16(() => {
|
|
5639
5721
|
if (typeof document === "undefined") return;
|
|
5640
5722
|
const displayQueries = typeof globalThis.matchMedia === "function" ? INSTALLED_DISPLAY_QUERIES.map((query) => globalThis.matchMedia(query)) : [];
|
|
5641
5723
|
const updateTitle = () => {
|
|
@@ -5959,37 +6041,37 @@ function summariseImport(result) {
|
|
|
5959
6041
|
}
|
|
5960
6042
|
|
|
5961
6043
|
// src/components/usePromptDialog.ts
|
|
5962
|
-
import React2, { useCallback as
|
|
6044
|
+
import React2, { useCallback as useCallback15, useEffect as useEffect18, useRef as useRef15, useState as useState17 } from "react";
|
|
5963
6045
|
|
|
5964
6046
|
// src/components/PromptDialog.tsx
|
|
5965
|
-
import { useCallback as
|
|
5966
|
-
import { Fragment as Fragment8, jsx as
|
|
6047
|
+
import { useCallback as useCallback14, useEffect as useEffect17, useId as useId3, useRef as useRef14, useState as useState16 } from "react";
|
|
6048
|
+
import { Fragment as Fragment8, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5967
6049
|
function PromptDialog({ request, onSettle }) {
|
|
5968
|
-
const [value, setValue] =
|
|
5969
|
-
const inputRef =
|
|
6050
|
+
const [value, setValue] = useState16(request.initialValue ?? "");
|
|
6051
|
+
const inputRef = useRef14(null);
|
|
5970
6052
|
const inputId = useId3();
|
|
5971
|
-
const cancel =
|
|
5972
|
-
const submit =
|
|
6053
|
+
const cancel = useCallback14(() => onSettle(null), [onSettle]);
|
|
6054
|
+
const submit = useCallback14(() => {
|
|
5973
6055
|
if (value.trim() === "") return;
|
|
5974
6056
|
onSettle(value);
|
|
5975
6057
|
}, [onSettle, value]);
|
|
5976
6058
|
const initialSelection = request.initialSelection;
|
|
5977
|
-
|
|
6059
|
+
useEffect17(() => {
|
|
5978
6060
|
const input = inputRef.current;
|
|
5979
6061
|
if (!input) return;
|
|
5980
6062
|
if (initialSelection) input.setSelectionRange(initialSelection[0], initialSelection[1]);
|
|
5981
6063
|
else input.select();
|
|
5982
6064
|
}, []);
|
|
5983
|
-
return /* @__PURE__ */
|
|
6065
|
+
return /* @__PURE__ */ jsx14(
|
|
5984
6066
|
Dialog,
|
|
5985
6067
|
{
|
|
5986
6068
|
title: request.title,
|
|
5987
6069
|
onClose: cancel,
|
|
5988
6070
|
initialFocusRef: inputRef,
|
|
5989
6071
|
closeOnBackdrop: false,
|
|
5990
|
-
footer: /* @__PURE__ */
|
|
5991
|
-
/* @__PURE__ */
|
|
5992
|
-
/* @__PURE__ */
|
|
6072
|
+
footer: /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
6073
|
+
/* @__PURE__ */ jsx14("button", { type: "button", className: "db-git-secondary-btn", onClick: cancel, children: "Cancel" }),
|
|
6074
|
+
/* @__PURE__ */ jsx14(
|
|
5993
6075
|
"button",
|
|
5994
6076
|
{
|
|
5995
6077
|
type: "button",
|
|
@@ -6000,9 +6082,9 @@ function PromptDialog({ request, onSettle }) {
|
|
|
6000
6082
|
}
|
|
6001
6083
|
)
|
|
6002
6084
|
] }),
|
|
6003
|
-
children: /* @__PURE__ */
|
|
6004
|
-
/* @__PURE__ */
|
|
6005
|
-
/* @__PURE__ */
|
|
6085
|
+
children: /* @__PURE__ */ jsxs12("div", { className: "db-git-form-row", children: [
|
|
6086
|
+
/* @__PURE__ */ jsx14("label", { className: "db-git-form-label", htmlFor: inputId, children: request.label }),
|
|
6087
|
+
/* @__PURE__ */ jsx14(
|
|
6006
6088
|
"input",
|
|
6007
6089
|
{
|
|
6008
6090
|
id: inputId,
|
|
@@ -6025,17 +6107,17 @@ function PromptDialog({ request, onSettle }) {
|
|
|
6025
6107
|
|
|
6026
6108
|
// src/components/usePromptDialog.ts
|
|
6027
6109
|
function usePromptDialog() {
|
|
6028
|
-
const [pending, setPending] =
|
|
6029
|
-
const pendingRef =
|
|
6030
|
-
const nextIdRef =
|
|
6031
|
-
const settlePending =
|
|
6110
|
+
const [pending, setPending] = useState17(null);
|
|
6111
|
+
const pendingRef = useRef15(null);
|
|
6112
|
+
const nextIdRef = useRef15(0);
|
|
6113
|
+
const settlePending = useCallback15((value) => {
|
|
6032
6114
|
const current = pendingRef.current;
|
|
6033
6115
|
if (!current) return;
|
|
6034
6116
|
pendingRef.current = null;
|
|
6035
6117
|
setPending((open) => open?.id === current.id ? null : open);
|
|
6036
6118
|
current.settle(value);
|
|
6037
6119
|
}, []);
|
|
6038
|
-
const prompt =
|
|
6120
|
+
const prompt = useCallback15(
|
|
6039
6121
|
(request) => new Promise((resolve) => {
|
|
6040
6122
|
settlePending(null);
|
|
6041
6123
|
const next = { id: ++nextIdRef.current, request, settle: resolve };
|
|
@@ -6044,7 +6126,7 @@ function usePromptDialog() {
|
|
|
6044
6126
|
}),
|
|
6045
6127
|
[settlePending]
|
|
6046
6128
|
);
|
|
6047
|
-
|
|
6129
|
+
useEffect18(() => {
|
|
6048
6130
|
return () => settlePending(null);
|
|
6049
6131
|
}, [settlePending]);
|
|
6050
6132
|
const promptDialog = pending ? React2.createElement(PromptDialog, {
|
|
@@ -6057,37 +6139,37 @@ function usePromptDialog() {
|
|
|
6057
6139
|
}
|
|
6058
6140
|
|
|
6059
6141
|
// src/components/NewDocumentDialog.tsx
|
|
6060
|
-
import { useCallback as
|
|
6061
|
-
import { Fragment as Fragment9, jsx as
|
|
6142
|
+
import { useCallback as useCallback16, useEffect as useEffect19, useId as useId4, useRef as useRef16, useState as useState18 } from "react";
|
|
6143
|
+
import { Fragment as Fragment9, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6062
6144
|
function NewDocumentDialog({
|
|
6063
6145
|
onSettle,
|
|
6064
6146
|
initialFormat = "markdown"
|
|
6065
6147
|
}) {
|
|
6066
|
-
const [name, setName] =
|
|
6067
|
-
const [format, setFormat] =
|
|
6068
|
-
const inputRef =
|
|
6148
|
+
const [name, setName] = useState18("Untitled");
|
|
6149
|
+
const [format, setFormat] = useState18(initialFormat);
|
|
6150
|
+
const inputRef = useRef16(null);
|
|
6069
6151
|
const nameId = useId4();
|
|
6070
6152
|
const formatId = useId4();
|
|
6071
6153
|
const hintId = useId4();
|
|
6072
6154
|
const hint = newFileFormatHint(format);
|
|
6073
6155
|
const filename = newFileName(name, format);
|
|
6074
|
-
const cancel =
|
|
6075
|
-
const submit =
|
|
6156
|
+
const cancel = useCallback16(() => onSettle(null), [onSettle]);
|
|
6157
|
+
const submit = useCallback16(() => {
|
|
6076
6158
|
if (filename) onSettle({ filename, format });
|
|
6077
6159
|
}, [filename, format, onSettle]);
|
|
6078
|
-
|
|
6160
|
+
useEffect19(() => {
|
|
6079
6161
|
inputRef.current?.select();
|
|
6080
6162
|
}, []);
|
|
6081
|
-
return /* @__PURE__ */
|
|
6163
|
+
return /* @__PURE__ */ jsx15(
|
|
6082
6164
|
Dialog,
|
|
6083
6165
|
{
|
|
6084
6166
|
title: "New document",
|
|
6085
6167
|
onClose: cancel,
|
|
6086
6168
|
initialFocusRef: inputRef,
|
|
6087
6169
|
closeOnBackdrop: false,
|
|
6088
|
-
footer: /* @__PURE__ */
|
|
6089
|
-
/* @__PURE__ */
|
|
6090
|
-
/* @__PURE__ */
|
|
6170
|
+
footer: /* @__PURE__ */ jsxs13(Fragment9, { children: [
|
|
6171
|
+
/* @__PURE__ */ jsx15("button", { type: "button", className: "db-git-secondary-btn", onClick: cancel, children: "Cancel" }),
|
|
6172
|
+
/* @__PURE__ */ jsx15(
|
|
6091
6173
|
"button",
|
|
6092
6174
|
{
|
|
6093
6175
|
type: "button",
|
|
@@ -6098,9 +6180,9 @@ function NewDocumentDialog({
|
|
|
6098
6180
|
}
|
|
6099
6181
|
)
|
|
6100
6182
|
] }),
|
|
6101
|
-
children: /* @__PURE__ */
|
|
6102
|
-
/* @__PURE__ */
|
|
6103
|
-
/* @__PURE__ */
|
|
6183
|
+
children: /* @__PURE__ */ jsxs13("div", { className: "db-new-document-fields", children: [
|
|
6184
|
+
/* @__PURE__ */ jsx15("label", { className: "db-git-form-label", htmlFor: nameId, children: "Document name" }),
|
|
6185
|
+
/* @__PURE__ */ jsx15(
|
|
6104
6186
|
"input",
|
|
6105
6187
|
{
|
|
6106
6188
|
id: nameId,
|
|
@@ -6116,8 +6198,8 @@ function NewDocumentDialog({
|
|
|
6116
6198
|
}
|
|
6117
6199
|
}
|
|
6118
6200
|
),
|
|
6119
|
-
/* @__PURE__ */
|
|
6120
|
-
/* @__PURE__ */
|
|
6201
|
+
/* @__PURE__ */ jsx15("label", { className: "db-git-form-label", htmlFor: formatId, children: "Type" }),
|
|
6202
|
+
/* @__PURE__ */ jsx15(
|
|
6121
6203
|
"select",
|
|
6122
6204
|
{
|
|
6123
6205
|
id: formatId,
|
|
@@ -6125,10 +6207,10 @@ function NewDocumentDialog({
|
|
|
6125
6207
|
"aria-describedby": hint ? hintId : void 0,
|
|
6126
6208
|
value: format,
|
|
6127
6209
|
onChange: (e) => setFormat(e.target.value),
|
|
6128
|
-
children: /* @__PURE__ */
|
|
6210
|
+
children: /* @__PURE__ */ jsx15(NewFileFormatOptions, {})
|
|
6129
6211
|
}
|
|
6130
6212
|
),
|
|
6131
|
-
hint && /* @__PURE__ */
|
|
6213
|
+
hint && /* @__PURE__ */ jsx15("p", { id: hintId, className: "db-new-document-hint", children: hint })
|
|
6132
6214
|
] })
|
|
6133
6215
|
}
|
|
6134
6216
|
);
|
|
@@ -6136,7 +6218,7 @@ function NewDocumentDialog({
|
|
|
6136
6218
|
|
|
6137
6219
|
// src/DocBlocksShell/EditorErrorBoundary.tsx
|
|
6138
6220
|
import { Component } from "react";
|
|
6139
|
-
import { jsx as
|
|
6221
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6140
6222
|
var EditorErrorBoundary = class extends Component {
|
|
6141
6223
|
constructor() {
|
|
6142
6224
|
super(...arguments);
|
|
@@ -6151,11 +6233,11 @@ var EditorErrorBoundary = class extends Component {
|
|
|
6151
6233
|
render() {
|
|
6152
6234
|
const { error } = this.state;
|
|
6153
6235
|
if (!error) return this.props.children;
|
|
6154
|
-
return /* @__PURE__ */
|
|
6155
|
-
/* @__PURE__ */
|
|
6156
|
-
/* @__PURE__ */
|
|
6157
|
-
/* @__PURE__ */
|
|
6158
|
-
/* @__PURE__ */
|
|
6236
|
+
return /* @__PURE__ */ jsx16("div", { className: "db-shell-empty db-shell-empty--workspace", role: "alert", children: /* @__PURE__ */ jsxs14("div", { className: "db-workspace-empty-content", children: [
|
|
6237
|
+
/* @__PURE__ */ jsx16("h1", { children: "This document couldn\u2019t be displayed" }),
|
|
6238
|
+
/* @__PURE__ */ jsx16("p", { children: "The editor ran into a problem drawing it. The document itself is unaffected." }),
|
|
6239
|
+
/* @__PURE__ */ jsx16("div", { className: "db-workspace-empty-actions", children: /* @__PURE__ */ jsx16("button", { type: "button", onClick: () => this.setState({ error: null }), children: "Try again" }) }),
|
|
6240
|
+
/* @__PURE__ */ jsx16("p", { className: "db-workspace-empty-hint", children: error.message })
|
|
6159
6241
|
] }) });
|
|
6160
6242
|
}
|
|
6161
6243
|
};
|
|
@@ -6444,10 +6526,10 @@ function saveViewPreferences(preferences) {
|
|
|
6444
6526
|
}
|
|
6445
6527
|
|
|
6446
6528
|
// src/layout/useFormFactor.ts
|
|
6447
|
-
import { useEffect as
|
|
6529
|
+
import { useEffect as useEffect21, useMemo as useMemo4, useState as useState20 } from "react";
|
|
6448
6530
|
|
|
6449
6531
|
// src/layout/useMediaQuery.ts
|
|
6450
|
-
import { useEffect as
|
|
6532
|
+
import { useEffect as useEffect20, useState as useState19 } from "react";
|
|
6451
6533
|
var INSTALLED_DISPLAY_QUERIES2 = [
|
|
6452
6534
|
"(display-mode: window-controls-overlay)",
|
|
6453
6535
|
"(display-mode: standalone)"
|
|
@@ -6460,8 +6542,8 @@ function isInstalledDisplayMode() {
|
|
|
6460
6542
|
return INSTALLED_DISPLAY_QUERIES2.some(matchesMediaQuery);
|
|
6461
6543
|
}
|
|
6462
6544
|
function useMediaQuery(query) {
|
|
6463
|
-
const [matches, setMatches] =
|
|
6464
|
-
|
|
6545
|
+
const [matches, setMatches] = useState19(() => matchesMediaQuery(query));
|
|
6546
|
+
useEffect20(() => {
|
|
6465
6547
|
if (typeof globalThis.matchMedia !== "function") return;
|
|
6466
6548
|
const list = globalThis.matchMedia(query);
|
|
6467
6549
|
const update = () => setMatches(list.matches);
|
|
@@ -6480,11 +6562,11 @@ function initialSize() {
|
|
|
6480
6562
|
return { width: window.innerWidth, height: window.innerHeight };
|
|
6481
6563
|
}
|
|
6482
6564
|
function useFormFactor(rootRef, override) {
|
|
6483
|
-
const [size, setSize] =
|
|
6565
|
+
const [size, setSize] = useState20(initialSize);
|
|
6484
6566
|
const coarse = useMediaQuery(COARSE_POINTER_QUERY);
|
|
6485
6567
|
const anyHover = useMediaQuery(ANY_HOVER_QUERY);
|
|
6486
|
-
const [installed, setInstalled] =
|
|
6487
|
-
|
|
6568
|
+
const [installed, setInstalled] = useState20(isInstalledDisplayMode);
|
|
6569
|
+
useEffect21(() => {
|
|
6488
6570
|
const element = rootRef.current;
|
|
6489
6571
|
const readWindow = () => setSize(initialSize());
|
|
6490
6572
|
if (!element || typeof ResizeObserver === "undefined") {
|
|
@@ -6508,7 +6590,7 @@ function useFormFactor(rootRef, override) {
|
|
|
6508
6590
|
observer.observe(element);
|
|
6509
6591
|
return () => observer.disconnect();
|
|
6510
6592
|
}, [rootRef]);
|
|
6511
|
-
|
|
6593
|
+
useEffect21(() => {
|
|
6512
6594
|
if (typeof globalThis.matchMedia !== "function") return;
|
|
6513
6595
|
const update = () => setInstalled(isInstalledDisplayMode());
|
|
6514
6596
|
const lists = ["(display-mode: window-controls-overlay)", "(display-mode: standalone)"].map(
|
|
@@ -6535,9 +6617,9 @@ function useFormFactor(rootRef, override) {
|
|
|
6535
6617
|
}
|
|
6536
6618
|
|
|
6537
6619
|
// src/layout/useInert.ts
|
|
6538
|
-
import { useEffect as
|
|
6620
|
+
import { useEffect as useEffect22 } from "react";
|
|
6539
6621
|
function useInert(ref, inert) {
|
|
6540
|
-
|
|
6622
|
+
useEffect22(() => {
|
|
6541
6623
|
const element = ref.current;
|
|
6542
6624
|
if (!element) return;
|
|
6543
6625
|
element.toggleAttribute("inert", inert);
|
|
@@ -6546,9 +6628,9 @@ function useInert(ref, inert) {
|
|
|
6546
6628
|
}
|
|
6547
6629
|
|
|
6548
6630
|
// src/layout/useKeyboardInset.ts
|
|
6549
|
-
import { useEffect as
|
|
6631
|
+
import { useEffect as useEffect23 } from "react";
|
|
6550
6632
|
function useKeyboardInset(enabled) {
|
|
6551
|
-
|
|
6633
|
+
useEffect23(() => {
|
|
6552
6634
|
if (!enabled || typeof window === "undefined") return;
|
|
6553
6635
|
const viewport = window.visualViewport;
|
|
6554
6636
|
if (!viewport) return;
|
|
@@ -6580,10 +6662,10 @@ function useKeyboardInset(enabled) {
|
|
|
6580
6662
|
}
|
|
6581
6663
|
|
|
6582
6664
|
// src/layout/useFormFactorAttributes.ts
|
|
6583
|
-
import { useEffect as
|
|
6665
|
+
import { useEffect as useEffect24, useRef as useRef17 } from "react";
|
|
6584
6666
|
function useFormFactorAttributes(rootRef, formFactor, layoutMode, drawerOpen) {
|
|
6585
|
-
const published =
|
|
6586
|
-
|
|
6667
|
+
const published = useRef17(/* @__PURE__ */ new Map());
|
|
6668
|
+
useEffect24(() => {
|
|
6587
6669
|
const owned = published.current;
|
|
6588
6670
|
return () => {
|
|
6589
6671
|
for (const [target, names] of owned) {
|
|
@@ -6592,7 +6674,7 @@ function useFormFactorAttributes(rootRef, formFactor, layoutMode, drawerOpen) {
|
|
|
6592
6674
|
owned.clear();
|
|
6593
6675
|
};
|
|
6594
6676
|
}, []);
|
|
6595
|
-
|
|
6677
|
+
useEffect24(() => {
|
|
6596
6678
|
if (typeof document === "undefined") return;
|
|
6597
6679
|
const attributes = {
|
|
6598
6680
|
...formFactorDataAttributes(formFactor, layoutMode)
|
|
@@ -6618,10 +6700,10 @@ function useFormFactorAttributes(rootRef, formFactor, layoutMode, drawerOpen) {
|
|
|
6618
6700
|
}
|
|
6619
6701
|
|
|
6620
6702
|
// src/layout/useInterfaceFontAttribute.ts
|
|
6621
|
-
import { useEffect as
|
|
6703
|
+
import { useEffect as useEffect25 } from "react";
|
|
6622
6704
|
var INTERFACE_FONT_ATTRIBUTE = "data-db-interface-font";
|
|
6623
6705
|
function useInterfaceFontAttribute(preference) {
|
|
6624
|
-
|
|
6706
|
+
useEffect25(() => {
|
|
6625
6707
|
if (typeof document === "undefined") return;
|
|
6626
6708
|
const root = document.documentElement;
|
|
6627
6709
|
if (preference !== "system") {
|
|
@@ -6634,7 +6716,7 @@ function useInterfaceFontAttribute(preference) {
|
|
|
6634
6716
|
}
|
|
6635
6717
|
|
|
6636
6718
|
// src/DocBlocksShell/useEdgeSwipe.ts
|
|
6637
|
-
import { useEffect as
|
|
6719
|
+
import { useEffect as useEffect26 } from "react";
|
|
6638
6720
|
var EDGE_ZONE_PX = 24;
|
|
6639
6721
|
var AXIS_LOCK_PX = 10;
|
|
6640
6722
|
var COMMIT_FRACTION = 0.4;
|
|
@@ -6647,7 +6729,7 @@ function useEdgeSwipe({
|
|
|
6647
6729
|
onOpen,
|
|
6648
6730
|
onClose
|
|
6649
6731
|
}) {
|
|
6650
|
-
|
|
6732
|
+
useEffect26(() => {
|
|
6651
6733
|
const surface = surfaceRef.current;
|
|
6652
6734
|
if (!enabled || !surface) return;
|
|
6653
6735
|
let pointerId = null;
|
|
@@ -6729,11 +6811,11 @@ function useEdgeSwipe({
|
|
|
6729
6811
|
}
|
|
6730
6812
|
|
|
6731
6813
|
// src/DocBlocksShell/useEditorFileDrop.ts
|
|
6732
|
-
import { useEffect as
|
|
6814
|
+
import { useEffect as useEffect27, useState as useState21 } from "react";
|
|
6733
6815
|
var INTERNAL_DRAG_TYPE2 = "application/x-docblocks-entry";
|
|
6734
6816
|
function useEditorFileDrop(targetRef, enabled, onFiles) {
|
|
6735
|
-
const [dropActive, setDropActive] =
|
|
6736
|
-
|
|
6817
|
+
const [dropActive, setDropActive] = useState21(false);
|
|
6818
|
+
useEffect27(() => {
|
|
6737
6819
|
const element = targetRef.current;
|
|
6738
6820
|
if (!enabled || !element) {
|
|
6739
6821
|
setDropActive(false);
|
|
@@ -6795,11 +6877,11 @@ function useEditorFileDrop(targetRef, enabled, onFiles) {
|
|
|
6795
6877
|
}
|
|
6796
6878
|
|
|
6797
6879
|
// src/DocBlocksShell/useShellShortcuts.ts
|
|
6798
|
-
import { useEffect as
|
|
6880
|
+
import { useEffect as useEffect28, useRef as useRef18 } from "react";
|
|
6799
6881
|
function useShellShortcuts(handlers, layoutMode) {
|
|
6800
|
-
const handlersRef =
|
|
6882
|
+
const handlersRef = useRef18(handlers);
|
|
6801
6883
|
handlersRef.current = handlers;
|
|
6802
|
-
|
|
6884
|
+
useEffect28(() => {
|
|
6803
6885
|
if (typeof window === "undefined") return;
|
|
6804
6886
|
const onKeyDown = (event) => {
|
|
6805
6887
|
const id = matchShortcut(event, layoutMode);
|
|
@@ -6816,8 +6898,8 @@ function useShellShortcuts(handlers, layoutMode) {
|
|
|
6816
6898
|
}
|
|
6817
6899
|
|
|
6818
6900
|
// src/DocBlocksShell/UpdateAvailableNotice.tsx
|
|
6819
|
-
import { useState as
|
|
6820
|
-
import { Fragment as Fragment10, jsx as
|
|
6901
|
+
import { useState as useState22 } from "react";
|
|
6902
|
+
import { Fragment as Fragment10, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
6821
6903
|
var UPDATE_PROMPT_ID = "db-update-available-prompt";
|
|
6822
6904
|
function UpdateAvailableNotice({
|
|
6823
6905
|
available,
|
|
@@ -6825,12 +6907,12 @@ function UpdateAvailableNotice({
|
|
|
6825
6907
|
blocked = false,
|
|
6826
6908
|
statusBarVisible
|
|
6827
6909
|
}) {
|
|
6828
|
-
const [promptOpen, setPromptOpen] =
|
|
6829
|
-
const [applying, setApplying] =
|
|
6910
|
+
const [promptOpen, setPromptOpen] = useState22(false);
|
|
6911
|
+
const [applying, setApplying] = useState22(false);
|
|
6830
6912
|
if (!available || !onApplyUpdate) return null;
|
|
6831
6913
|
const promptVisible = promptOpen && !blocked;
|
|
6832
|
-
return /* @__PURE__ */
|
|
6833
|
-
/* @__PURE__ */
|
|
6914
|
+
return /* @__PURE__ */ jsxs15(Fragment10, { children: [
|
|
6915
|
+
/* @__PURE__ */ jsx17(
|
|
6834
6916
|
"button",
|
|
6835
6917
|
{
|
|
6836
6918
|
type: "button",
|
|
@@ -6844,16 +6926,16 @@ function UpdateAvailableNotice({
|
|
|
6844
6926
|
children: "Update available"
|
|
6845
6927
|
}
|
|
6846
6928
|
),
|
|
6847
|
-
promptVisible && /* @__PURE__ */
|
|
6929
|
+
promptVisible && /* @__PURE__ */ jsxs15(
|
|
6848
6930
|
"div",
|
|
6849
6931
|
{
|
|
6850
6932
|
id: UPDATE_PROMPT_ID,
|
|
6851
6933
|
className: `db-update-banner${statusBarVisible ? "" : " db-update-banner--floating"}`,
|
|
6852
6934
|
role: "alert",
|
|
6853
6935
|
children: [
|
|
6854
|
-
/* @__PURE__ */
|
|
6855
|
-
/* @__PURE__ */
|
|
6856
|
-
/* @__PURE__ */
|
|
6936
|
+
/* @__PURE__ */ jsx17("span", { children: "A new version of DocBlocks is available. Reload to update the editor and site pages." }),
|
|
6937
|
+
/* @__PURE__ */ jsxs15("div", { className: "db-update-banner-actions", children: [
|
|
6938
|
+
/* @__PURE__ */ jsx17(
|
|
6857
6939
|
"button",
|
|
6858
6940
|
{
|
|
6859
6941
|
type: "button",
|
|
@@ -6865,7 +6947,7 @@ function UpdateAvailableNotice({
|
|
|
6865
6947
|
children: applying ? "Updating\u2026" : "Reload"
|
|
6866
6948
|
}
|
|
6867
6949
|
),
|
|
6868
|
-
/* @__PURE__ */
|
|
6950
|
+
/* @__PURE__ */ jsx17("button", { type: "button", onClick: () => setPromptOpen(false), disabled: applying, children: "Later" })
|
|
6869
6951
|
] })
|
|
6870
6952
|
]
|
|
6871
6953
|
}
|
|
@@ -6874,19 +6956,19 @@ function UpdateAvailableNotice({
|
|
|
6874
6956
|
}
|
|
6875
6957
|
|
|
6876
6958
|
// src/DocBlocksShell/WelcomeScreen.tsx
|
|
6877
|
-
import { jsx as
|
|
6959
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
6878
6960
|
var WELCOME_HEADLINE = "The Markdown editor that turns one file into anything.";
|
|
6879
6961
|
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.";
|
|
6880
6962
|
var WELCOME_PRIVACY_NOTE = "No account, and your documents stay on this device.";
|
|
6881
|
-
var DOCBLOCKS_APPS_URL = "https://docblocks.com/
|
|
6963
|
+
var DOCBLOCKS_APPS_URL = "https://docblocks.com/docs/#apps";
|
|
6882
6964
|
function WelcomeScreen({
|
|
6883
6965
|
onCreateDocument,
|
|
6884
6966
|
onTour,
|
|
6885
6967
|
onDismiss,
|
|
6886
6968
|
offerApps = false
|
|
6887
6969
|
}) {
|
|
6888
|
-
return /* @__PURE__ */
|
|
6889
|
-
/* @__PURE__ */
|
|
6970
|
+
return /* @__PURE__ */ jsxs16("section", { className: "db-welcome-gateway", "aria-labelledby": "db-welcome-gateway-title", children: [
|
|
6971
|
+
/* @__PURE__ */ jsx18(
|
|
6890
6972
|
"button",
|
|
6891
6973
|
{
|
|
6892
6974
|
type: "button",
|
|
@@ -6897,16 +6979,16 @@ function WelcomeScreen({
|
|
|
6897
6979
|
children: "\xD7"
|
|
6898
6980
|
}
|
|
6899
6981
|
),
|
|
6900
|
-
/* @__PURE__ */
|
|
6901
|
-
/* @__PURE__ */
|
|
6902
|
-
/* @__PURE__ */
|
|
6903
|
-
/* @__PURE__ */
|
|
6904
|
-
/* @__PURE__ */
|
|
6905
|
-
/* @__PURE__ */
|
|
6906
|
-
/* @__PURE__ */
|
|
6907
|
-
/* @__PURE__ */
|
|
6908
|
-
/* @__PURE__ */
|
|
6909
|
-
offerApps && /* @__PURE__ */
|
|
6982
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-welcome-gateway-body", children: [
|
|
6983
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-welcome-gateway-copy", children: [
|
|
6984
|
+
/* @__PURE__ */ jsx18("p", { className: "db-welcome-gateway-eyebrow", children: "Welcome to DocBlocks" }),
|
|
6985
|
+
/* @__PURE__ */ jsx18("h1", { id: "db-welcome-gateway-title", children: WELCOME_HEADLINE }),
|
|
6986
|
+
/* @__PURE__ */ jsx18("p", { children: WELCOME_SUMMARY }),
|
|
6987
|
+
/* @__PURE__ */ jsx18("p", { className: "db-welcome-gateway-note", children: WELCOME_PRIVACY_NOTE }),
|
|
6988
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-welcome-gateway-actions", children: [
|
|
6989
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: "db-welcome-gateway-primary", onClick: onCreateDocument, children: "Create a document" }),
|
|
6990
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: "db-welcome-gateway-cta", onClick: onTour, children: "Tour the welcome document" }),
|
|
6991
|
+
offerApps && /* @__PURE__ */ jsx18(
|
|
6910
6992
|
"a",
|
|
6911
6993
|
{
|
|
6912
6994
|
className: "db-welcome-gateway-apps",
|
|
@@ -6918,61 +7000,61 @@ function WelcomeScreen({
|
|
|
6918
7000
|
)
|
|
6919
7001
|
] })
|
|
6920
7002
|
] }),
|
|
6921
|
-
/* @__PURE__ */
|
|
7003
|
+
/* @__PURE__ */ jsx18(WelcomeLoop, {})
|
|
6922
7004
|
] })
|
|
6923
7005
|
] });
|
|
6924
7006
|
}
|
|
6925
7007
|
function WelcomeLoop() {
|
|
6926
|
-
return /* @__PURE__ */
|
|
6927
|
-
/* @__PURE__ */
|
|
6928
|
-
/* @__PURE__ */
|
|
6929
|
-
/* @__PURE__ */
|
|
6930
|
-
/* @__PURE__ */
|
|
7008
|
+
return /* @__PURE__ */ jsxs16("div", { className: "db-welcome-loop", "aria-hidden": "true", children: [
|
|
7009
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-welcome-loop-source", children: [
|
|
7010
|
+
/* @__PURE__ */ jsx18("span", { className: "db-welcome-loop-file", children: "Lisbon.md" }),
|
|
7011
|
+
/* @__PURE__ */ jsxs16("code", { children: [
|
|
7012
|
+
/* @__PURE__ */ jsx18("span", { className: "db-welcome-loop-mark", children: "# " }),
|
|
6931
7013
|
"Lisbon in three days",
|
|
6932
7014
|
"\n",
|
|
6933
7015
|
"Trams, tiles, and pastries.",
|
|
6934
7016
|
"\n\n",
|
|
6935
|
-
/* @__PURE__ */
|
|
7017
|
+
/* @__PURE__ */ jsx18("span", { className: "db-welcome-loop-mark", children: "## " }),
|
|
6936
7018
|
"Day one",
|
|
6937
7019
|
"\n",
|
|
6938
|
-
/* @__PURE__ */
|
|
7020
|
+
/* @__PURE__ */ jsx18("span", { className: "db-welcome-loop-mark", children: "- " }),
|
|
6939
7021
|
"Ride Tram 28",
|
|
6940
7022
|
"\n",
|
|
6941
|
-
/* @__PURE__ */
|
|
7023
|
+
/* @__PURE__ */ jsx18("span", { className: "db-welcome-loop-mark", children: "- " }),
|
|
6942
7024
|
"Sunset at Gra\xE7a"
|
|
6943
7025
|
] })
|
|
6944
7026
|
] }),
|
|
6945
|
-
/* @__PURE__ */
|
|
6946
|
-
/* @__PURE__ */
|
|
6947
|
-
/* @__PURE__ */
|
|
6948
|
-
/* @__PURE__ */
|
|
6949
|
-
/* @__PURE__ */
|
|
6950
|
-
/* @__PURE__ */
|
|
6951
|
-
/* @__PURE__ */
|
|
6952
|
-
/* @__PURE__ */
|
|
7027
|
+
/* @__PURE__ */ jsx18("div", { className: "db-welcome-loop-arrow", children: "\u2192" }),
|
|
7028
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-welcome-loop-stage", children: [
|
|
7029
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-welcome-loop-frame db-welcome-loop-frame--page", children: [
|
|
7030
|
+
/* @__PURE__ */ jsx18("strong", { children: "Lisbon in three days" }),
|
|
7031
|
+
/* @__PURE__ */ jsx18("span", { children: "Trams, tiles, and pastries." }),
|
|
7032
|
+
/* @__PURE__ */ jsx18("em", { children: "Day one" }),
|
|
7033
|
+
/* @__PURE__ */ jsx18("span", { children: "\u2022 Ride Tram 28" }),
|
|
7034
|
+
/* @__PURE__ */ jsx18("span", { children: "\u2022 Sunset at Gra\xE7a" })
|
|
6953
7035
|
] }),
|
|
6954
|
-
/* @__PURE__ */
|
|
6955
|
-
/* @__PURE__ */
|
|
6956
|
-
/* @__PURE__ */
|
|
7036
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-welcome-loop-frame db-welcome-loop-frame--slide", children: [
|
|
7037
|
+
/* @__PURE__ */ jsx18("strong", { children: "Lisbon in three days" }),
|
|
7038
|
+
/* @__PURE__ */ jsx18("span", { children: "Trams, tiles, and pastries." })
|
|
6957
7039
|
] }),
|
|
6958
|
-
/* @__PURE__ */
|
|
6959
|
-
/* @__PURE__ */
|
|
6960
|
-
/* @__PURE__ */
|
|
6961
|
-
/* @__PURE__ */
|
|
6962
|
-
/* @__PURE__ */
|
|
6963
|
-
/* @__PURE__ */
|
|
7040
|
+
/* @__PURE__ */ jsxs16("div", { className: "db-welcome-loop-frame db-welcome-loop-frame--video", children: [
|
|
7041
|
+
/* @__PURE__ */ jsx18("em", { children: "Day one" }),
|
|
7042
|
+
/* @__PURE__ */ jsx18("span", { children: "\u2022 Ride Tram 28" }),
|
|
7043
|
+
/* @__PURE__ */ jsx18("span", { children: "\u2022 Sunset at Gra\xE7a" }),
|
|
7044
|
+
/* @__PURE__ */ jsx18("i", { className: "db-welcome-loop-play", children: "\u25B6" }),
|
|
7045
|
+
/* @__PURE__ */ jsx18("i", { className: "db-welcome-loop-progress" })
|
|
6964
7046
|
] })
|
|
6965
7047
|
] }),
|
|
6966
|
-
/* @__PURE__ */
|
|
6967
|
-
/* @__PURE__ */
|
|
6968
|
-
/* @__PURE__ */
|
|
6969
|
-
/* @__PURE__ */
|
|
7048
|
+
/* @__PURE__ */ jsxs16("ol", { className: "db-welcome-loop-labels", children: [
|
|
7049
|
+
/* @__PURE__ */ jsx18("li", { children: "PDF" }),
|
|
7050
|
+
/* @__PURE__ */ jsx18("li", { children: "Slides" }),
|
|
7051
|
+
/* @__PURE__ */ jsx18("li", { children: "Video" })
|
|
6970
7052
|
] })
|
|
6971
7053
|
] });
|
|
6972
7054
|
}
|
|
6973
7055
|
|
|
6974
7056
|
// src/DocBlocksShell/useDocumentLinkProvider.ts
|
|
6975
|
-
import { useCallback as
|
|
7057
|
+
import { useCallback as useCallback17 } from "react";
|
|
6976
7058
|
|
|
6977
7059
|
// src/DocBlocksShell/document-links.ts
|
|
6978
7060
|
import { parseWorkspacePath as parseWorkspacePath7 } from "@bendyline/docblocks/filesystem";
|
|
@@ -7021,7 +7103,7 @@ function createDocumentLinkCandidates(entries, selectedFile, query) {
|
|
|
7021
7103
|
// src/DocBlocksShell/useDocumentLinkProvider.ts
|
|
7022
7104
|
var LISTING_WAIT_MS = 5e3;
|
|
7023
7105
|
function useDocumentLinkProvider(index, selectedFile, ensureIndex) {
|
|
7024
|
-
return
|
|
7106
|
+
return useCallback17(
|
|
7025
7107
|
async (query) => {
|
|
7026
7108
|
if (!index || !selectedFile) return [];
|
|
7027
7109
|
ensureIndex();
|
|
@@ -7034,7 +7116,7 @@ function useDocumentLinkProvider(index, selectedFile, ensureIndex) {
|
|
|
7034
7116
|
}
|
|
7035
7117
|
|
|
7036
7118
|
// src/WorkspaceIndex/useWorkspaceIndex.ts
|
|
7037
|
-
import { useCallback as
|
|
7119
|
+
import { useCallback as useCallback18, useEffect as useEffect29, useMemo as useMemo5, useRef as useRef19, useState as useState23, useSyncExternalStore as useSyncExternalStore4 } from "react";
|
|
7038
7120
|
import { getFileSystemProviderV2 as getFileSystemProviderV29 } from "@bendyline/docblocks/filesystem";
|
|
7039
7121
|
import { maybeGetDocBlocksHost as maybeGetDocBlocksHost3 } from "@bendyline/docblocks/host";
|
|
7040
7122
|
var IDLE_WORKSPACE_INDEX_STATUS = Object.freeze({
|
|
@@ -7066,9 +7148,9 @@ function whenIdle(callback) {
|
|
|
7066
7148
|
}
|
|
7067
7149
|
function useWorkspaceIndex(provider, workspaceId, mode = "eager") {
|
|
7068
7150
|
const providerV2 = provider && mode !== "off" ? getFileSystemProviderV29(provider) : null;
|
|
7069
|
-
const [index, setIndex] =
|
|
7070
|
-
const startRequestedRef =
|
|
7071
|
-
|
|
7151
|
+
const [index, setIndex] = useState23(null);
|
|
7152
|
+
const startRequestedRef = useRef19(false);
|
|
7153
|
+
useEffect29(() => {
|
|
7072
7154
|
setIndex(null);
|
|
7073
7155
|
startRequestedRef.current = false;
|
|
7074
7156
|
if (!providerV2 || !workspaceId) return;
|
|
@@ -7090,7 +7172,7 @@ function useWorkspaceIndex(provider, workspaceId, mode = "eager") {
|
|
|
7090
7172
|
created?.dispose();
|
|
7091
7173
|
};
|
|
7092
7174
|
}, [providerV2, workspaceId, mode]);
|
|
7093
|
-
|
|
7175
|
+
useEffect29(() => {
|
|
7094
7176
|
if (!index) return;
|
|
7095
7177
|
const refresh = () => index.refresh();
|
|
7096
7178
|
const onVisibilityChange = () => {
|
|
@@ -7107,16 +7189,16 @@ function useWorkspaceIndex(provider, workspaceId, mode = "eager") {
|
|
|
7107
7189
|
stopResume?.();
|
|
7108
7190
|
};
|
|
7109
7191
|
}, [index]);
|
|
7110
|
-
const subscribe =
|
|
7192
|
+
const subscribe = useCallback18(
|
|
7111
7193
|
(listener) => index ? index.subscribe(listener) : () => void 0,
|
|
7112
7194
|
[index]
|
|
7113
7195
|
);
|
|
7114
|
-
const getStatus =
|
|
7196
|
+
const getStatus = useCallback18(
|
|
7115
7197
|
() => index ? index.getStatus() : IDLE_WORKSPACE_INDEX_STATUS,
|
|
7116
7198
|
[index]
|
|
7117
7199
|
);
|
|
7118
7200
|
const status = useSyncExternalStore4(subscribe, getStatus, getStatus);
|
|
7119
|
-
const ensure =
|
|
7201
|
+
const ensure = useCallback18(() => {
|
|
7120
7202
|
if (!index) {
|
|
7121
7203
|
startRequestedRef.current = true;
|
|
7122
7204
|
return;
|
|
@@ -7357,63 +7439,75 @@ function isWelcomeDocumentPath(path) {
|
|
|
7357
7439
|
function isAppDefaultWorkspace(workspaceId, hostDefaultWorkspaceIds) {
|
|
7358
7440
|
return hostDefaultWorkspaceIds ? hostDefaultWorkspaceIds.has(workspaceId) : workspaceId === DEFAULT_WORKSPACE_ID;
|
|
7359
7441
|
}
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
"
|
|
7391
|
-
"
|
|
7392
|
-
"
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7442
|
+
function welcomeDocumentContent({
|
|
7443
|
+
browserStorage,
|
|
7444
|
+
desktopApp
|
|
7445
|
+
}) {
|
|
7446
|
+
return [
|
|
7447
|
+
"---",
|
|
7448
|
+
"squisq-theme: warm-earth",
|
|
7449
|
+
"squisq-cover-slide: false",
|
|
7450
|
+
"---",
|
|
7451
|
+
"",
|
|
7452
|
+
'# Welcome to DocBlocks {[title subtitle="Write once. Share it as a document, a deck, or a video."]}',
|
|
7453
|
+
"",
|
|
7454
|
+
"This is an ordinary document, so go ahead and change it. Click anywhere and type; DocBlocks saves as you go.",
|
|
7455
|
+
"",
|
|
7456
|
+
"## Write the way you already do {[list]}",
|
|
7457
|
+
"",
|
|
7458
|
+
"- Type to add text, and use the toolbar for headings, lists, and bold or italic text.",
|
|
7459
|
+
"- Choose **Insert** in the toolbar to add a table, a checklist, a chart, a diagram, or a picture.",
|
|
7460
|
+
"- Choose **Source** to see the Markdown text behind this page. Both views edit the same document.",
|
|
7461
|
+
"",
|
|
7462
|
+
"## One document, many ways to share it {[diagram]}",
|
|
7463
|
+
"",
|
|
7464
|
+
"```diagram",
|
|
7465
|
+
" +-----------------+",
|
|
7466
|
+
" | Your document |",
|
|
7467
|
+
" +--------+--------+",
|
|
7468
|
+
" |",
|
|
7469
|
+
" +-----------+------+-----+------------+",
|
|
7470
|
+
" | | | |",
|
|
7471
|
+
" v v v v",
|
|
7472
|
+
"+-------+ +--------+ +----------+ +---------+",
|
|
7473
|
+
"| PDF | | Word | | Slides | | Video |",
|
|
7474
|
+
"+-------+ +--------+ +----------+ +---------+",
|
|
7475
|
+
"```",
|
|
7476
|
+
"",
|
|
7477
|
+
"## Present it or send it {[content]}",
|
|
7478
|
+
"",
|
|
7479
|
+
"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.",
|
|
7480
|
+
"",
|
|
7481
|
+
"## Your documents stay yours {[factCard]}",
|
|
7482
|
+
"",
|
|
7483
|
+
// Not "files other apps can open": in the browser they live in browser storage.
|
|
7484
|
+
"There is no account to create. Your documents stay on this device, written in plain Markdown that any text editor can read." + // Only browser storage shows Back up in the file list. Elsewhere the
|
|
7485
|
+
// documents are files the device itself keeps.
|
|
7486
|
+
(browserStorage ? " Choose **Back up** at the bottom of the file list to keep a copy somewhere safe." : ""),
|
|
7487
|
+
"",
|
|
7488
|
+
"## Make your own {[list]}",
|
|
7489
|
+
"",
|
|
7490
|
+
"1. Choose **New File** above the file list and give it a name.",
|
|
7491
|
+
"2. Write a heading and a few sentences.",
|
|
7492
|
+
"3. Choose **Slideshow** to present it, or **Export** to share it.",
|
|
7493
|
+
"",
|
|
7494
|
+
"## Go further {[list]}",
|
|
7495
|
+
"",
|
|
7496
|
+
desktopApp ? "- Choose **Open Folder** in the workspace menu above the file list to work on Markdown files you already have." : "- [Get the desktop app](https://docblocks.com/desktop/) to work in folders on your computer.",
|
|
7497
|
+
"- [Add DocBlocks to VS Code](https://docblocks.com/vscode/) to edit documents beside your code.",
|
|
7498
|
+
"- [Read the guides](https://docblocks.com/docs/) for everything else.",
|
|
7499
|
+
// End with a newline, as the Write view saves every document. Without it,
|
|
7500
|
+
// merely opening the welcome document in Write rewrote the file.
|
|
7501
|
+
""
|
|
7502
|
+
].join("\n");
|
|
7503
|
+
}
|
|
7504
|
+
var WELCOME_DOCUMENT_CONTENT = welcomeDocumentContent({
|
|
7505
|
+
browserStorage: true,
|
|
7506
|
+
desktopApp: false
|
|
7507
|
+
});
|
|
7414
7508
|
|
|
7415
7509
|
// src/DocBlocksShell/DocBlocksShell.tsx
|
|
7416
|
-
import { Fragment as Fragment11, jsx as
|
|
7510
|
+
import { Fragment as Fragment11, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7417
7511
|
var editorShellModulePromise = null;
|
|
7418
7512
|
function loadEditorShell() {
|
|
7419
7513
|
editorShellModulePromise ?? (editorShellModulePromise = (async () => {
|
|
@@ -7428,13 +7522,13 @@ var EditorShell = lazy2(loadEditorShell);
|
|
|
7428
7522
|
var DocumentConflictDialog = lazy2(() => import("./DocumentConflictDialog-DZ2BV2IH.js"));
|
|
7429
7523
|
var GitUI = lazy2(() => import("./GitUI-F3CNBURE.js").then((m) => ({ default: m.GitUI })));
|
|
7430
7524
|
var QuickOpenDialog = lazy2(
|
|
7431
|
-
() => import("./QuickOpenDialog-
|
|
7525
|
+
() => import("./QuickOpenDialog-3QEX7RZG.js").then((m) => ({ default: m.QuickOpenDialog }))
|
|
7432
7526
|
);
|
|
7433
7527
|
var KeyboardShortcutsDialog = lazy2(
|
|
7434
7528
|
() => import("./KeyboardShortcutsDialog-HVKDFP5Z.js").then((m) => ({ default: m.KeyboardShortcutsDialog }))
|
|
7435
7529
|
);
|
|
7436
7530
|
var WorkspaceSearchPanel = lazy2(
|
|
7437
|
-
() => import("./WorkspaceSearchPanel-
|
|
7531
|
+
() => import("./WorkspaceSearchPanel-MEBBTK7F.js").then((m) => ({
|
|
7438
7532
|
default: m.WorkspaceSearchPanel
|
|
7439
7533
|
}))
|
|
7440
7534
|
);
|
|
@@ -7445,37 +7539,37 @@ var GitToolbarControl = lazy2(
|
|
|
7445
7539
|
() => import("./GitToolbarControl-B7KG4MFP.js").then((m) => ({ default: m.GitToolbarControl }))
|
|
7446
7540
|
);
|
|
7447
7541
|
var AiToolbarControl = lazy2(
|
|
7448
|
-
() => import("./AiEditorAssistant-
|
|
7542
|
+
() => import("./AiEditorAssistant-2MW6UYNI.js").then((module) => ({
|
|
7449
7543
|
default: module.AiToolbarControl
|
|
7450
7544
|
}))
|
|
7451
7545
|
);
|
|
7452
7546
|
var PresentationMaker = lazy2(
|
|
7453
|
-
() => import("./PresentationMaker-
|
|
7547
|
+
() => import("./PresentationMaker-T526TBRJ.js").then((module) => ({
|
|
7454
7548
|
default: module.PresentationMaker
|
|
7455
7549
|
}))
|
|
7456
7550
|
);
|
|
7457
7551
|
var AiReviewPanel = lazy2(
|
|
7458
|
-
() => import("./AiEditorAssistant-
|
|
7552
|
+
() => import("./AiEditorAssistant-2MW6UYNI.js").then((module) => ({
|
|
7459
7553
|
default: module.AiReviewPanel
|
|
7460
7554
|
}))
|
|
7461
7555
|
);
|
|
7462
7556
|
var AiIllustratePanel = lazy2(
|
|
7463
|
-
() => import("./AiDiagrams-
|
|
7557
|
+
() => import("./AiDiagrams-VOCEZS6U.js").then((module) => ({
|
|
7464
7558
|
default: module.AiIllustratePanel
|
|
7465
7559
|
}))
|
|
7466
7560
|
);
|
|
7467
7561
|
var TextFromNarration = lazy2(
|
|
7468
|
-
() => import("./TextFromNarration-
|
|
7562
|
+
() => import("./TextFromNarration-ME6FAYWO.js").then((module) => ({
|
|
7469
7563
|
default: module.TextFromNarration
|
|
7470
7564
|
}))
|
|
7471
7565
|
);
|
|
7472
7566
|
var SpeechToolbarControl = lazy2(
|
|
7473
|
-
() => import("./SpeechToolbarControl-
|
|
7567
|
+
() => import("./SpeechToolbarControl-E6OSJGHL.js").then((module) => ({
|
|
7474
7568
|
default: module.SpeechToolbarControl
|
|
7475
7569
|
}))
|
|
7476
7570
|
);
|
|
7477
7571
|
var SpeechMenuBridge = lazy2(
|
|
7478
|
-
() => import("./SpeechToolbarControl-
|
|
7572
|
+
() => import("./SpeechToolbarControl-E6OSJGHL.js").then((module) => ({
|
|
7479
7573
|
default: module.SpeechMenuBridge
|
|
7480
7574
|
}))
|
|
7481
7575
|
);
|
|
@@ -7553,10 +7647,10 @@ function isMemoryWorkspaceProvider(provider) {
|
|
|
7553
7647
|
return typeof candidate.captureContents === "function" && typeof candidate.replaceContents === "function" && typeof candidate.treeVersion === "number";
|
|
7554
7648
|
}
|
|
7555
7649
|
function useOsTheme() {
|
|
7556
|
-
const [dark, setDark] =
|
|
7650
|
+
const [dark, setDark] = useState24(
|
|
7557
7651
|
() => typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
7558
7652
|
);
|
|
7559
|
-
|
|
7653
|
+
useEffect30(() => {
|
|
7560
7654
|
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
7561
7655
|
const handler = (e) => setDark(e.matches);
|
|
7562
7656
|
mq.addEventListener("change", handler);
|
|
@@ -7742,7 +7836,7 @@ async function createHostProviderFromWorkspace(ws) {
|
|
|
7742
7836
|
var DESKTOP_TOOLBAR_WRAP_WIDTH = 900;
|
|
7743
7837
|
var WEB_TOOLBAR_WRAP_WIDTH = 700;
|
|
7744
7838
|
function FolderGlyph() {
|
|
7745
|
-
return /* @__PURE__ */
|
|
7839
|
+
return /* @__PURE__ */ jsx19(
|
|
7746
7840
|
"svg",
|
|
7747
7841
|
{
|
|
7748
7842
|
viewBox: "0 0 24 24",
|
|
@@ -7751,12 +7845,12 @@ function FolderGlyph() {
|
|
|
7751
7845
|
strokeWidth: "1.5",
|
|
7752
7846
|
strokeLinejoin: "round",
|
|
7753
7847
|
"aria-hidden": "true",
|
|
7754
|
-
children: /* @__PURE__ */
|
|
7848
|
+
children: /* @__PURE__ */ jsx19("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" })
|
|
7755
7849
|
}
|
|
7756
7850
|
);
|
|
7757
7851
|
}
|
|
7758
7852
|
function FileGlyph() {
|
|
7759
|
-
return /* @__PURE__ */
|
|
7853
|
+
return /* @__PURE__ */ jsxs17(
|
|
7760
7854
|
"svg",
|
|
7761
7855
|
{
|
|
7762
7856
|
viewBox: "0 0 24 24",
|
|
@@ -7766,14 +7860,14 @@ function FileGlyph() {
|
|
|
7766
7860
|
strokeLinejoin: "round",
|
|
7767
7861
|
"aria-hidden": "true",
|
|
7768
7862
|
children: [
|
|
7769
|
-
/* @__PURE__ */
|
|
7770
|
-
/* @__PURE__ */
|
|
7863
|
+
/* @__PURE__ */ jsx19("path", { d: "M6 3h8l5 5v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z" }),
|
|
7864
|
+
/* @__PURE__ */ jsx19("path", { d: "M14 3v5h5" })
|
|
7771
7865
|
]
|
|
7772
7866
|
}
|
|
7773
7867
|
);
|
|
7774
7868
|
}
|
|
7775
7869
|
function CollapseSidebarGlyph() {
|
|
7776
|
-
return /* @__PURE__ */
|
|
7870
|
+
return /* @__PURE__ */ jsxs17(
|
|
7777
7871
|
"svg",
|
|
7778
7872
|
{
|
|
7779
7873
|
viewBox: "0 0 64 64",
|
|
@@ -7784,9 +7878,9 @@ function CollapseSidebarGlyph() {
|
|
|
7784
7878
|
strokeLinejoin: "round",
|
|
7785
7879
|
"aria-hidden": "true",
|
|
7786
7880
|
children: [
|
|
7787
|
-
/* @__PURE__ */
|
|
7788
|
-
/* @__PURE__ */
|
|
7789
|
-
/* @__PURE__ */
|
|
7881
|
+
/* @__PURE__ */ jsx19("rect", { x: "7", y: "10", width: "50", height: "44", rx: "6" }),
|
|
7882
|
+
/* @__PURE__ */ jsx19("path", { d: "M24 10v44" }),
|
|
7883
|
+
/* @__PURE__ */ jsx19("path", { d: "m17 25-7 7 7 7" })
|
|
7790
7884
|
]
|
|
7791
7885
|
}
|
|
7792
7886
|
);
|
|
@@ -7823,10 +7917,10 @@ function DocBlocksShell({
|
|
|
7823
7917
|
offlineReady = false
|
|
7824
7918
|
}) {
|
|
7825
7919
|
const osTheme = useOsTheme();
|
|
7826
|
-
const [themePreference, setThemePreference] =
|
|
7827
|
-
const [accentColor, setAccentColor] =
|
|
7828
|
-
const [interfaceFont, setInterfaceFont] =
|
|
7829
|
-
const [writeCanvasSettings, setWriteCanvasSettings] =
|
|
7920
|
+
const [themePreference, setThemePreference] = useState24(loadThemePreference);
|
|
7921
|
+
const [accentColor, setAccentColor] = useState24(loadAccentColor);
|
|
7922
|
+
const [interfaceFont, setInterfaceFont] = useState24(loadInterfaceFont);
|
|
7923
|
+
const [writeCanvasSettings, setWriteCanvasSettings] = useState24(
|
|
7830
7924
|
loadWriteCanvasPreferences
|
|
7831
7925
|
);
|
|
7832
7926
|
const editorWriteCanvasSettings = useMemo6(
|
|
@@ -7840,66 +7934,67 @@ function DocBlocksShell({
|
|
|
7840
7934
|
const resolvedTheme = resolveShellTheme({ preference: themePreference, hostTheme, osTheme });
|
|
7841
7935
|
const ai = hostSupports2("aiAssist") ? maybeGetDocBlocksHost4()?.ai : void 0;
|
|
7842
7936
|
const speech = hostSupports2("speechModelManagement") ? maybeGetDocBlocksHost4()?.speech : void 0;
|
|
7843
|
-
const
|
|
7844
|
-
const
|
|
7937
|
+
const trayMenu = hostSupports2("trayIcon") ? maybeGetDocBlocksHost4()?.menu : void 0;
|
|
7938
|
+
const [settingsRequest, setSettingsRequest] = useState24(0);
|
|
7939
|
+
const openSettings = useCallback19(() => setSettingsRequest((count) => count + 1), []);
|
|
7845
7940
|
const speechInput = useMemo6(
|
|
7846
7941
|
() => speech && hostSupports2("speechInput") ? createSpeechInputProvider(speech, { onRequestSetup: openSettings }) : null,
|
|
7847
7942
|
[speech, openSettings]
|
|
7848
7943
|
);
|
|
7849
|
-
const handleThemeChange =
|
|
7944
|
+
const handleThemeChange = useCallback19((pref) => {
|
|
7850
7945
|
setThemePreference(pref);
|
|
7851
7946
|
saveThemePreference(pref);
|
|
7852
7947
|
}, []);
|
|
7853
|
-
|
|
7948
|
+
useEffect30(() => {
|
|
7854
7949
|
if (hostSupports2("ownsWindowChrome") || typeof document === "undefined") return;
|
|
7855
7950
|
const metas = document.querySelectorAll('meta[name="theme-color"]');
|
|
7856
7951
|
metas.forEach((meta) => {
|
|
7857
7952
|
meta.content = DB_CHROME_COLORS[resolvedTheme];
|
|
7858
7953
|
});
|
|
7859
7954
|
}, [resolvedTheme]);
|
|
7860
|
-
const handleAccentColorChange =
|
|
7955
|
+
const handleAccentColorChange = useCallback19((color) => {
|
|
7861
7956
|
setAccentColor(color);
|
|
7862
7957
|
saveAccentColor(color);
|
|
7863
7958
|
}, []);
|
|
7864
|
-
const handleWriteCanvasSettingsChange =
|
|
7959
|
+
const handleWriteCanvasSettingsChange = useCallback19((settings) => {
|
|
7865
7960
|
setWriteCanvasSettings(settings);
|
|
7866
7961
|
saveWriteCanvasPreferences(settings);
|
|
7867
7962
|
}, []);
|
|
7868
|
-
const [proofingPreferences, setProofingPreferences] =
|
|
7869
|
-
const handleProofingPreferencesChange =
|
|
7963
|
+
const [proofingPreferences, setProofingPreferences] = useState24(loadProofingPreferences);
|
|
7964
|
+
const handleProofingPreferencesChange = useCallback19((settings) => {
|
|
7870
7965
|
setProofingPreferences(settings);
|
|
7871
7966
|
saveProofingPreferences(settings);
|
|
7872
7967
|
}, []);
|
|
7873
|
-
const [viewPreferences, setViewPreferences] =
|
|
7874
|
-
const handleViewPreferencesChange =
|
|
7968
|
+
const [viewPreferences, setViewPreferences] = useState24(loadViewPreferences);
|
|
7969
|
+
const handleViewPreferencesChange = useCallback19((prefs) => {
|
|
7875
7970
|
setViewPreferences(prefs);
|
|
7876
7971
|
saveViewPreferences(prefs);
|
|
7877
7972
|
}, []);
|
|
7878
|
-
const shellRef =
|
|
7973
|
+
const shellRef = useRef20(null);
|
|
7879
7974
|
const formFactor = useFormFactor(shellRef);
|
|
7880
|
-
const [sidebarPreference, setSidebarPreference] =
|
|
7975
|
+
const [sidebarPreference, setSidebarPreference] = useState24(loadSidebarPreference);
|
|
7881
7976
|
const layoutMode = resolveLayoutMode(formFactor, sidebarPreference);
|
|
7882
7977
|
const singlePane = layoutMode === "single-pane";
|
|
7883
|
-
const updateSidebarPreference =
|
|
7978
|
+
const updateSidebarPreference = useCallback19((preference) => {
|
|
7884
7979
|
setSidebarPreference(preference);
|
|
7885
7980
|
saveSidebarPreference(preference);
|
|
7886
7981
|
}, []);
|
|
7887
7982
|
const defaultPreviewViewportPreset = useResponsivePreviewViewportPreset();
|
|
7888
|
-
const [mobileShowEditor, setMobileShowEditor] =
|
|
7983
|
+
const [mobileShowEditor, setMobileShowEditor] = useState24(
|
|
7889
7984
|
() => singlePane && isWelcomeGatewayDismissed()
|
|
7890
7985
|
);
|
|
7891
|
-
|
|
7986
|
+
useEffect30(() => {
|
|
7892
7987
|
if (singlePane) void loadEditorShell();
|
|
7893
7988
|
}, [singlePane]);
|
|
7894
7989
|
useFormFactorAttributes(shellRef, formFactor, layoutMode, !mobileShowEditor);
|
|
7895
7990
|
useInterfaceFontAttribute(interfaceFont);
|
|
7896
7991
|
useKeyboardInset(formFactor.pointer === "coarse");
|
|
7897
7992
|
const drawerOpen = singlePane && !mobileShowEditor;
|
|
7898
|
-
const [sidebarWidth, setSidebarWidth] =
|
|
7993
|
+
const [sidebarWidth, setSidebarWidth] = useState24(loadSidebarWidth);
|
|
7899
7994
|
const canRestoreSplitView = sidebarPreference === "collapsed" && formFactor.splitPaneAllowed;
|
|
7900
|
-
const editorAreaRef =
|
|
7901
|
-
const [desktopToolbarWrapped, setDesktopToolbarWrapped] =
|
|
7902
|
-
|
|
7995
|
+
const editorAreaRef = useRef20(null);
|
|
7996
|
+
const [desktopToolbarWrapped, setDesktopToolbarWrapped] = useState24(false);
|
|
7997
|
+
useEffect30(() => {
|
|
7903
7998
|
const editorArea = editorAreaRef.current;
|
|
7904
7999
|
if (!editorArea || singlePane) {
|
|
7905
8000
|
setDesktopToolbarWrapped(false);
|
|
@@ -7920,24 +8015,25 @@ function DocBlocksShell({
|
|
|
7920
8015
|
}, [singlePane]);
|
|
7921
8016
|
const showBrowserStorageWarning = hostSupports2("browserOriginStorage");
|
|
7922
8017
|
const hostEnvironment = getHostEnvironment2();
|
|
8018
|
+
const desktopApp = hostEnvironment?.surface === "electron";
|
|
7923
8019
|
const appVersion = hostEnvironment ? `${hostEnvironment.appVersion} ${hostEnvironment.surfaceLabel}` : issueReportVersion ?? "web";
|
|
7924
8020
|
const issueReportUrl = buildIssueReportUrl({
|
|
7925
8021
|
reportedAt: /* @__PURE__ */ new Date(),
|
|
7926
8022
|
version: appVersion,
|
|
7927
8023
|
userAgent: typeof navigator === "undefined" ? "" : navigator.userAgent
|
|
7928
8024
|
});
|
|
7929
|
-
const [browserStoragePersistent, setBrowserStoragePersistent] =
|
|
7930
|
-
const [saveToast, setSaveToast] =
|
|
7931
|
-
const saveToastTimerRef =
|
|
7932
|
-
const showToast =
|
|
8025
|
+
const [browserStoragePersistent, setBrowserStoragePersistent] = useState24(false);
|
|
8026
|
+
const [saveToast, setSaveToast] = useState24(null);
|
|
8027
|
+
const saveToastTimerRef = useRef20(null);
|
|
8028
|
+
const showToast = useCallback19((kind, message) => {
|
|
7933
8029
|
setSaveToast({ kind, message });
|
|
7934
8030
|
if (saveToastTimerRef.current) clearTimeout(saveToastTimerRef.current);
|
|
7935
8031
|
saveToastTimerRef.current = setTimeout(() => setSaveToast(null), 3e3);
|
|
7936
8032
|
}, []);
|
|
7937
8033
|
const { prompt: promptForText, promptDialog } = usePromptDialog();
|
|
7938
|
-
const [newDocumentDialogOpen, setNewDocumentDialogOpen] =
|
|
8034
|
+
const [newDocumentDialogOpen, setNewDocumentDialogOpen] = useState24(false);
|
|
7939
8035
|
const { confirm: confirmAction, acknowledge, confirmDialog } = useConfirmDialog();
|
|
7940
|
-
const confirmDeleteEntry =
|
|
8036
|
+
const confirmDeleteEntry = useCallback19(
|
|
7941
8037
|
(message) => confirmAction({
|
|
7942
8038
|
title: "Delete",
|
|
7943
8039
|
message,
|
|
@@ -7946,15 +8042,15 @@ function DocBlocksShell({
|
|
|
7946
8042
|
}),
|
|
7947
8043
|
[confirmAction]
|
|
7948
8044
|
);
|
|
7949
|
-
const [installPromptEvent, setInstallPromptEvent] =
|
|
8045
|
+
const [installPromptEvent, setInstallPromptEvent] = useState24(
|
|
7950
8046
|
null
|
|
7951
8047
|
);
|
|
7952
|
-
const panesRef =
|
|
7953
|
-
const sidebarRef =
|
|
8048
|
+
const panesRef = useRef20(null);
|
|
8049
|
+
const sidebarRef = useRef20(null);
|
|
7954
8050
|
useInert(sidebarRef, singlePane && !drawerOpen);
|
|
7955
8051
|
useInert(editorAreaRef, drawerOpen);
|
|
7956
|
-
const openDrawer =
|
|
7957
|
-
const closeDrawer =
|
|
8052
|
+
const openDrawer = useCallback19(() => setMobileShowEditor(false), []);
|
|
8053
|
+
const closeDrawer = useCallback19(() => setMobileShowEditor(true), []);
|
|
7958
8054
|
useEdgeSwipe({
|
|
7959
8055
|
surfaceRef: panesRef,
|
|
7960
8056
|
drawerRef: sidebarRef,
|
|
@@ -7963,8 +8059,8 @@ function DocBlocksShell({
|
|
|
7963
8059
|
onOpen: openDrawer,
|
|
7964
8060
|
onClose: closeDrawer
|
|
7965
8061
|
});
|
|
7966
|
-
const dragStateRef =
|
|
7967
|
-
const handleResizerPointerDown =
|
|
8062
|
+
const dragStateRef = useRef20(null);
|
|
8063
|
+
const handleResizerPointerDown = useCallback19(
|
|
7968
8064
|
(e) => {
|
|
7969
8065
|
if (e.button !== 0) return;
|
|
7970
8066
|
dragStateRef.current = { startX: e.clientX, startWidth: sidebarWidth };
|
|
@@ -8016,15 +8112,15 @@ function DocBlocksShell({
|
|
|
8016
8112
|
},
|
|
8017
8113
|
[sidebarWidth, updateSidebarPreference]
|
|
8018
8114
|
);
|
|
8019
|
-
const [provider, setProvider] =
|
|
8020
|
-
const [workspaceStartupError, setWorkspaceStartupError] =
|
|
8115
|
+
const [provider, setProvider] = useState24(null);
|
|
8116
|
+
const [workspaceStartupError, setWorkspaceStartupError] = useState24(null);
|
|
8021
8117
|
const workspaceStarting = provider === null && workspaceStartupError === null;
|
|
8022
|
-
const [activeWorkspaceId, setActiveWorkspaceId] =
|
|
8023
|
-
const [defaultNewFileFormat, setDefaultNewFileFormat] =
|
|
8024
|
-
|
|
8118
|
+
const [activeWorkspaceId, setActiveWorkspaceId] = useState24(null);
|
|
8119
|
+
const [defaultNewFileFormat, setDefaultNewFileFormat] = useState24(DEFAULT_NEW_FILE_FORMAT);
|
|
8120
|
+
useEffect30(() => {
|
|
8025
8121
|
setDefaultNewFileFormat(loadLastNewFileFormat(activeWorkspaceId));
|
|
8026
8122
|
}, [activeWorkspaceId]);
|
|
8027
|
-
const rememberNewFileFormat =
|
|
8123
|
+
const rememberNewFileFormat = useCallback19(
|
|
8028
8124
|
(format) => {
|
|
8029
8125
|
setDefaultNewFileFormat(format);
|
|
8030
8126
|
if (activeWorkspaceId && getTransientWorkspace(activeWorkspaceId) === null) {
|
|
@@ -8033,19 +8129,19 @@ function DocBlocksShell({
|
|
|
8033
8129
|
},
|
|
8034
8130
|
[activeWorkspaceId]
|
|
8035
8131
|
);
|
|
8036
|
-
const [activeWorkspaceDescriptor, setActiveWorkspaceDescriptor] =
|
|
8132
|
+
const [activeWorkspaceDescriptor, setActiveWorkspaceDescriptor] = useState24(null);
|
|
8037
8133
|
const defaultProofingIgnoreStore = useMemo6(
|
|
8038
8134
|
() => createLocalProofingIgnoreStore(() => activeWorkspaceId),
|
|
8039
8135
|
[activeWorkspaceId]
|
|
8040
8136
|
);
|
|
8041
8137
|
const effectiveProofingIgnoreStore = proofingIgnoreStore === void 0 ? defaultProofingIgnoreStore : proofingIgnoreStore;
|
|
8042
|
-
|
|
8138
|
+
useEffect30(() => {
|
|
8043
8139
|
if (!provider || getTransientWorkspace(provider.id)) return;
|
|
8044
8140
|
const providerV2 = getFileSystemProviderV211(provider);
|
|
8045
8141
|
return providerV2 ? retainFileSystemProvider(providerV2) : void 0;
|
|
8046
8142
|
}, [provider]);
|
|
8047
|
-
const [descriptorRefreshKey, setDescriptorRefreshKey] =
|
|
8048
|
-
|
|
8143
|
+
const [descriptorRefreshKey, setDescriptorRefreshKey] = useState24(0);
|
|
8144
|
+
useEffect30(() => {
|
|
8049
8145
|
let cancelled = false;
|
|
8050
8146
|
if (!activeWorkspaceId) {
|
|
8051
8147
|
setActiveWorkspaceDescriptor(null);
|
|
@@ -8058,12 +8154,12 @@ function DocBlocksShell({
|
|
|
8058
8154
|
cancelled = true;
|
|
8059
8155
|
};
|
|
8060
8156
|
}, [activeWorkspaceId, descriptorRefreshKey]);
|
|
8061
|
-
const [pinnedDocuments, setPinnedDocuments] =
|
|
8062
|
-
const [pinnedDocumentAvailability, setPinnedDocumentAvailability] =
|
|
8063
|
-
|
|
8157
|
+
const [pinnedDocuments, setPinnedDocuments] = useState24(loadPinnedDocuments);
|
|
8158
|
+
const [pinnedDocumentAvailability, setPinnedDocumentAvailability] = useState24(() => /* @__PURE__ */ new Map());
|
|
8159
|
+
useEffect30(() => {
|
|
8064
8160
|
savePinnedDocuments(pinnedDocuments);
|
|
8065
8161
|
}, [pinnedDocuments]);
|
|
8066
|
-
|
|
8162
|
+
useEffect30(() => {
|
|
8067
8163
|
const menu = maybeGetDocBlocksHost4()?.menu;
|
|
8068
8164
|
if (!hostSupports2("pinnedDocumentMirror") || !menu) return;
|
|
8069
8165
|
menu.setPinnedDocuments(
|
|
@@ -8074,7 +8170,7 @@ function DocBlocksShell({
|
|
|
8074
8170
|
}))
|
|
8075
8171
|
);
|
|
8076
8172
|
}, [pinnedDocuments]);
|
|
8077
|
-
const setPinnedAvailability =
|
|
8173
|
+
const setPinnedAvailability = useCallback19(
|
|
8078
8174
|
(document2, availability) => {
|
|
8079
8175
|
const key = pinnedDocumentKey(document2);
|
|
8080
8176
|
setPinnedDocumentAvailability((current) => {
|
|
@@ -8093,7 +8189,7 @@ function DocBlocksShell({
|
|
|
8093
8189
|
})),
|
|
8094
8190
|
[pinnedDocumentAvailability, pinnedDocuments]
|
|
8095
8191
|
);
|
|
8096
|
-
|
|
8192
|
+
useEffect30(() => {
|
|
8097
8193
|
if (!provider || !activeWorkspaceId) return;
|
|
8098
8194
|
const activePins = pinnedDocuments.filter(
|
|
8099
8195
|
(document2) => document2.workspaceId === activeWorkspaceId
|
|
@@ -8143,10 +8239,10 @@ function DocBlocksShell({
|
|
|
8143
8239
|
void subscription?.dispose();
|
|
8144
8240
|
};
|
|
8145
8241
|
}, [activeWorkspaceId, pinnedDocuments, provider, setPinnedAvailability]);
|
|
8146
|
-
const [transientMoveDestinations, setTransientMoveDestinations] =
|
|
8242
|
+
const [transientMoveDestinations, setTransientMoveDestinations] = useState24(
|
|
8147
8243
|
[]
|
|
8148
8244
|
);
|
|
8149
|
-
|
|
8245
|
+
useEffect30(() => {
|
|
8150
8246
|
if (activeWorkspaceDescriptor?.type !== "transient") {
|
|
8151
8247
|
setTransientMoveDestinations([]);
|
|
8152
8248
|
return;
|
|
@@ -8168,19 +8264,19 @@ function DocBlocksShell({
|
|
|
8168
8264
|
};
|
|
8169
8265
|
}, [activeWorkspaceDescriptor]);
|
|
8170
8266
|
const nativeWorkspaceId = provider && activeWorkspaceDescriptor?.id === activeWorkspaceId && provider.id === activeWorkspaceId && activeWorkspaceDescriptor.type === "host-native" ? activeWorkspaceDescriptor.id : null;
|
|
8171
|
-
const workingTreeChangedRef =
|
|
8172
|
-
const handleWorkingTreeChanged =
|
|
8267
|
+
const workingTreeChangedRef = useRef20(() => void 0);
|
|
8268
|
+
const handleWorkingTreeChanged = useCallback19(() => workingTreeChangedRef.current(), []);
|
|
8173
8269
|
const git = useGit(provider, nativeWorkspaceId, resolvedTheme, handleWorkingTreeChanged);
|
|
8174
|
-
const gitRef =
|
|
8270
|
+
const gitRef = useRef20(git);
|
|
8175
8271
|
gitRef.current = git;
|
|
8176
8272
|
const { scheduleRefresh: gitScheduleRefresh } = git;
|
|
8177
8273
|
const workspaceSettingsEnabled = provider !== null && provider.id === activeWorkspaceId && getTransientWorkspace(provider.id) === null;
|
|
8178
8274
|
const workspaceSettings = useWorkspaceSettings(provider, workspaceSettingsEnabled);
|
|
8179
8275
|
const { refresh: refreshWorkspaceSettings, save: saveWorkspaceSettings } = workspaceSettings;
|
|
8180
8276
|
const workspaceDefaultThemeId = resolveWorkspaceDefaultThemeId(workspaceSettings.settings);
|
|
8181
|
-
const workspaceDefaultThemeRef =
|
|
8277
|
+
const workspaceDefaultThemeRef = useRef20(workspaceDefaultThemeId);
|
|
8182
8278
|
workspaceDefaultThemeRef.current = workspaceDefaultThemeId;
|
|
8183
|
-
const outsideInRenderRef =
|
|
8279
|
+
const outsideInRenderRef = useRef20({
|
|
8184
8280
|
defaultThemeId: () => workspaceDefaultThemeRef.current
|
|
8185
8281
|
});
|
|
8186
8282
|
const workspaceOutputs = useWorkspaceOutputs(
|
|
@@ -8189,12 +8285,12 @@ function DocBlocksShell({
|
|
|
8189
8285
|
workspaceSettings.settings,
|
|
8190
8286
|
workspaceSettingsEnabled
|
|
8191
8287
|
);
|
|
8192
|
-
const workspaceOutputsSchedulerRef =
|
|
8288
|
+
const workspaceOutputsSchedulerRef = useRef20(workspaceOutputs.scheduler);
|
|
8193
8289
|
workspaceOutputsSchedulerRef.current = workspaceOutputs.scheduler;
|
|
8194
8290
|
const workspaceIndex = useWorkspaceIndex(provider, activeWorkspaceId, workspaceIndexMode);
|
|
8195
|
-
const workspaceIndexRef =
|
|
8291
|
+
const workspaceIndexRef = useRef20(workspaceIndex.index);
|
|
8196
8292
|
workspaceIndexRef.current = workspaceIndex.index;
|
|
8197
|
-
const notifyWorkspaceChanged =
|
|
8293
|
+
const notifyWorkspaceChanged = useCallback19(
|
|
8198
8294
|
(workspaceId, path) => {
|
|
8199
8295
|
const scheduler = workspaceOutputsSchedulerRef.current;
|
|
8200
8296
|
if (scheduler && workspaceId && scheduler.workspaceId === workspaceId) scheduler.notify(path);
|
|
@@ -8211,9 +8307,9 @@ function DocBlocksShell({
|
|
|
8211
8307
|
workspaceOutputsSchedulerRef.current?.notify();
|
|
8212
8308
|
workspaceIndexRef.current?.refresh({ force: true });
|
|
8213
8309
|
};
|
|
8214
|
-
const [workspaceSettingsOpen, setWorkspaceSettingsOpen] =
|
|
8215
|
-
const [versioningPreference, setVersioningPreference] =
|
|
8216
|
-
const handleVersioningPreferenceChange =
|
|
8310
|
+
const [workspaceSettingsOpen, setWorkspaceSettingsOpen] = useState24(false);
|
|
8311
|
+
const [versioningPreference, setVersioningPreference] = useState24(loadVersioningPreference);
|
|
8312
|
+
const handleVersioningPreferenceChange = useCallback19((pref) => {
|
|
8217
8313
|
setVersioningPreference(pref);
|
|
8218
8314
|
saveVersioningPreference(pref);
|
|
8219
8315
|
}, []);
|
|
@@ -8227,11 +8323,11 @@ function DocBlocksShell({
|
|
|
8227
8323
|
() => workspaceVersionKeep !== void 0 ? { type: "keep-last-n", n: workspaceVersionKeep } : versioningPrunePolicy,
|
|
8228
8324
|
[versioningPrunePolicy, workspaceVersionKeep]
|
|
8229
8325
|
);
|
|
8230
|
-
const handleOpenWorkspaceSettings =
|
|
8326
|
+
const handleOpenWorkspaceSettings = useCallback19(() => {
|
|
8231
8327
|
if (!activeWorkspaceDescriptor) return;
|
|
8232
8328
|
setWorkspaceSettingsOpen(true);
|
|
8233
8329
|
}, [activeWorkspaceDescriptor]);
|
|
8234
|
-
const handleSaveWorkspaceSettings =
|
|
8330
|
+
const handleSaveWorkspaceSettings = useCallback19(
|
|
8235
8331
|
async (patch) => {
|
|
8236
8332
|
const descriptor = activeWorkspaceDescriptor;
|
|
8237
8333
|
if (!isEmptyWorkspaceSettingsPatch2(patch)) await saveWorkspaceSettings(patch);
|
|
@@ -8244,22 +8340,22 @@ function DocBlocksShell({
|
|
|
8244
8340
|
},
|
|
8245
8341
|
[activeWorkspaceDescriptor, saveWorkspaceSettings]
|
|
8246
8342
|
);
|
|
8247
|
-
const handleRegenerateWorkspaceOutputs =
|
|
8343
|
+
const handleRegenerateWorkspaceOutputs = useCallback19(() => {
|
|
8248
8344
|
void workspaceOutputsSchedulerRef.current?.regenerate({ force: true });
|
|
8249
8345
|
}, []);
|
|
8250
|
-
const [selectedFile, setSelectedFile] =
|
|
8251
|
-
const [selectedSourceFile, setSelectedSourceFile] =
|
|
8252
|
-
const [selectedOutsideIn, setSelectedOutsideIn] =
|
|
8253
|
-
const [selectedOutsideInEditingEnabled, setSelectedOutsideInEditingEnabled] =
|
|
8254
|
-
const [selectedImage, setSelectedImage] =
|
|
8255
|
-
const [selectedManagedOutput, setSelectedManagedOutput] =
|
|
8256
|
-
const [findMode, setFindMode] =
|
|
8257
|
-
const findModeRef =
|
|
8346
|
+
const [selectedFile, setSelectedFile] = useState24(null);
|
|
8347
|
+
const [selectedSourceFile, setSelectedSourceFile] = useState24(null);
|
|
8348
|
+
const [selectedOutsideIn, setSelectedOutsideIn] = useState24(null);
|
|
8349
|
+
const [selectedOutsideInEditingEnabled, setSelectedOutsideInEditingEnabled] = useState24(false);
|
|
8350
|
+
const [selectedImage, setSelectedImage] = useState24(void 0);
|
|
8351
|
+
const [selectedManagedOutput, setSelectedManagedOutput] = useState24(void 0);
|
|
8352
|
+
const [findMode, setFindMode] = useState24(false);
|
|
8353
|
+
const findModeRef = useRef20(findMode);
|
|
8258
8354
|
findModeRef.current = findMode;
|
|
8259
|
-
|
|
8355
|
+
useEffect30(() => {
|
|
8260
8356
|
setFindMode(false);
|
|
8261
8357
|
}, [selectedFile]);
|
|
8262
|
-
const openFind =
|
|
8358
|
+
const openFind = useCallback19(() => {
|
|
8263
8359
|
if (!findModeRef.current) {
|
|
8264
8360
|
setFindMode(true);
|
|
8265
8361
|
return;
|
|
@@ -8268,14 +8364,14 @@ function DocBlocksShell({
|
|
|
8268
8364
|
}, []);
|
|
8269
8365
|
const findShortcut = useMemo6(findShortcutLabel, []);
|
|
8270
8366
|
const searchShortcut = useMemo6(() => shortcutLabel("workspace-search", isApplePlatform()), []);
|
|
8271
|
-
const [quickOpenOpen, setQuickOpenOpen] =
|
|
8272
|
-
const [shortcutsOpen, setShortcutsOpen] =
|
|
8273
|
-
const openKeyboardShortcuts =
|
|
8274
|
-
const [quickOpenFocusRequest, setQuickOpenFocusRequest] =
|
|
8275
|
-
const [sidebarView, setSidebarView] =
|
|
8276
|
-
const [searchMounted, setSearchMounted] =
|
|
8277
|
-
const [searchFocusRequest, setSearchFocusRequest] =
|
|
8278
|
-
|
|
8367
|
+
const [quickOpenOpen, setQuickOpenOpen] = useState24(false);
|
|
8368
|
+
const [shortcutsOpen, setShortcutsOpen] = useState24(false);
|
|
8369
|
+
const openKeyboardShortcuts = useCallback19(() => setShortcutsOpen(true), []);
|
|
8370
|
+
const [quickOpenFocusRequest, setQuickOpenFocusRequest] = useState24(0);
|
|
8371
|
+
const [sidebarView, setSidebarView] = useState24("files");
|
|
8372
|
+
const [searchMounted, setSearchMounted] = useState24(false);
|
|
8373
|
+
const [searchFocusRequest, setSearchFocusRequest] = useState24(0);
|
|
8374
|
+
useEffect30(() => {
|
|
8279
8375
|
if (!activeWorkspaceId || !selectedFile) return;
|
|
8280
8376
|
if (getTransientWorkspace(activeWorkspaceId) === null) {
|
|
8281
8377
|
recordRecentDocument(activeWorkspaceId, selectedFile);
|
|
@@ -8286,7 +8382,7 @@ function DocBlocksShell({
|
|
|
8286
8382
|
const layoutMode2 = defaultOutsideInLayoutMode(selectedOutsideIn);
|
|
8287
8383
|
return layoutMode2 && viewPreferences.layoutMode === void 0 ? { ...viewPreferences, layoutMode: layoutMode2 } : viewPreferences;
|
|
8288
8384
|
}, [selectedOutsideIn, viewPreferences]);
|
|
8289
|
-
const adoptSelectedDocument =
|
|
8385
|
+
const adoptSelectedDocument = useCallback19((document2) => {
|
|
8290
8386
|
setSelectedFile(document2?.displayPath ?? null);
|
|
8291
8387
|
setSelectedSourceFile(document2?.sourcePath ?? null);
|
|
8292
8388
|
setSelectedOutsideIn(document2?.outsideIn ?? null);
|
|
@@ -8294,7 +8390,7 @@ function DocBlocksShell({
|
|
|
8294
8390
|
setSelectedImage(document2?.image);
|
|
8295
8391
|
setSelectedManagedOutput(document2?.managedOutput);
|
|
8296
8392
|
}, []);
|
|
8297
|
-
const adoptRegularDocument =
|
|
8393
|
+
const adoptRegularDocument = useCallback19((path) => {
|
|
8298
8394
|
if (path === null) {
|
|
8299
8395
|
setSelectedFile(null);
|
|
8300
8396
|
setSelectedSourceFile(null);
|
|
@@ -8317,7 +8413,7 @@ function DocBlocksShell({
|
|
|
8317
8413
|
}
|
|
8318
8414
|
return URL.createObjectURL(new Blob([selectedImage.data], { type: selectedImage.mimeType }));
|
|
8319
8415
|
}, [selectedImage]);
|
|
8320
|
-
|
|
8416
|
+
useEffect30(
|
|
8321
8417
|
() => () => {
|
|
8322
8418
|
if (selectedImageUrl) URL.revokeObjectURL(selectedImageUrl);
|
|
8323
8419
|
},
|
|
@@ -8363,8 +8459,8 @@ function DocBlocksShell({
|
|
|
8363
8459
|
() => hostSupports2("exportDestinations") && exportDestinationAdapter ? createImageSaveOutput(exportDestinationAdapter) : void 0,
|
|
8364
8460
|
[exportDestinationAdapter]
|
|
8365
8461
|
);
|
|
8366
|
-
const [selectedFolder, setSelectedFolder] =
|
|
8367
|
-
const [folderEntries, setFolderEntries] =
|
|
8462
|
+
const [selectedFolder, setSelectedFolder] = useState24(null);
|
|
8463
|
+
const [folderEntries, setFolderEntries] = useState24([]);
|
|
8368
8464
|
const visibleFolderEntries = useMemo6(
|
|
8369
8465
|
() => filterVisibleFileEntries(folderEntries),
|
|
8370
8466
|
[folderEntries]
|
|
@@ -8378,8 +8474,8 @@ function DocBlocksShell({
|
|
|
8378
8474
|
} : null,
|
|
8379
8475
|
[documentSnapshot.frozen, documentSnapshot.generation, documentSnapshot.targetKey]
|
|
8380
8476
|
);
|
|
8381
|
-
const [editorGeneration, setEditorGeneration] =
|
|
8382
|
-
|
|
8477
|
+
const [editorGeneration, setEditorGeneration] = useState24(documentSnapshot.generation);
|
|
8478
|
+
useEffect30(() => {
|
|
8383
8479
|
const sync = () => setEditorGeneration(documentSession.getSnapshot().generation);
|
|
8384
8480
|
const unsubscribe = documentSession.subscribe(sync);
|
|
8385
8481
|
sync();
|
|
@@ -8388,7 +8484,7 @@ function DocBlocksShell({
|
|
|
8388
8484
|
};
|
|
8389
8485
|
}, [documentSession]);
|
|
8390
8486
|
const editorGenerationSettled = editorGeneration === documentSnapshot.generation;
|
|
8391
|
-
|
|
8487
|
+
useEffect30(() => {
|
|
8392
8488
|
setOutsideInPdfWorker(pdfWorkerSrc2);
|
|
8393
8489
|
}, [pdfWorkerSrc2]);
|
|
8394
8490
|
const editorKey = String(editorGeneration);
|
|
@@ -8396,43 +8492,43 @@ function DocBlocksShell({
|
|
|
8396
8492
|
void editorKey;
|
|
8397
8493
|
return pickEmptyDocumentPrompt();
|
|
8398
8494
|
}, [editorKey]);
|
|
8399
|
-
const [explorerKey, setExplorerKey] =
|
|
8495
|
+
const [explorerKey, setExplorerKey] = useState24(0);
|
|
8400
8496
|
const workspaceOutputsResult = workspaceOutputs.status.result;
|
|
8401
|
-
|
|
8497
|
+
useEffect30(() => {
|
|
8402
8498
|
if (!workspaceOutputsResult?.outputs.some((output) => output.created)) return;
|
|
8403
8499
|
if (provider && getFileSystemProviderV211(provider)?.capabilities.watch) return;
|
|
8404
8500
|
setExplorerKey((key) => key + 1);
|
|
8405
8501
|
}, [provider, workspaceOutputsResult]);
|
|
8406
|
-
const [fileExplorerSortMode, setFileExplorerSortMode] =
|
|
8407
|
-
const handleFileExplorerSortModeChange =
|
|
8502
|
+
const [fileExplorerSortMode, setFileExplorerSortMode] = useState24(loadFileExplorerSortMode);
|
|
8503
|
+
const handleFileExplorerSortModeChange = useCallback19((mode) => {
|
|
8408
8504
|
setFileExplorerSortMode(mode);
|
|
8409
8505
|
saveFileExplorerSortMode(mode);
|
|
8410
8506
|
}, []);
|
|
8411
|
-
const [initialView, setInitialView] =
|
|
8412
|
-
const [initialSharedMode, setInitialSharedMode] =
|
|
8413
|
-
const [showWelcomeGateway, setShowWelcomeGateway] =
|
|
8507
|
+
const [initialView, setInitialView] = useState24("wysiwyg");
|
|
8508
|
+
const [initialSharedMode, setInitialSharedMode] = useState24(null);
|
|
8509
|
+
const [showWelcomeGateway, setShowWelcomeGateway] = useState24(false);
|
|
8414
8510
|
const welcomeScreenShown = showWelcomeGateway && !singlePane;
|
|
8415
|
-
const welcomeCoveredRef =
|
|
8511
|
+
const welcomeCoveredRef = useRef20(null);
|
|
8416
8512
|
useInert(welcomeCoveredRef, welcomeScreenShown);
|
|
8417
|
-
const closeWelcomeGateway =
|
|
8513
|
+
const closeWelcomeGateway = useCallback19(() => {
|
|
8418
8514
|
setShowWelcomeGateway((showing) => {
|
|
8419
8515
|
if (showing) markWelcomeGatewayDismissed();
|
|
8420
8516
|
return false;
|
|
8421
8517
|
});
|
|
8422
8518
|
}, []);
|
|
8423
|
-
const [aiPanel, setAiPanel] =
|
|
8424
|
-
const navigationRequestRef =
|
|
8519
|
+
const [aiPanel, setAiPanel] = useState24(null);
|
|
8520
|
+
const navigationRequestRef = useRef20(0);
|
|
8425
8521
|
const workspaceAuthorityBarrier = useMemo6(() => new WorkspaceAuthorityBarrier(), []);
|
|
8426
|
-
const preparedCloseRequestRef =
|
|
8427
|
-
const pendingDbkConflictsRef =
|
|
8428
|
-
const afterWorkspaceCommit =
|
|
8522
|
+
const preparedCloseRequestRef = useRef20(null);
|
|
8523
|
+
const pendingDbkConflictsRef = useRef20(/* @__PURE__ */ new Map());
|
|
8524
|
+
const afterWorkspaceCommit = useCallback19(
|
|
8429
8525
|
(workspaceId, path) => {
|
|
8430
8526
|
gitScheduleRefresh();
|
|
8431
8527
|
notifyWorkspaceChanged(workspaceId, path);
|
|
8432
8528
|
},
|
|
8433
8529
|
[gitScheduleRefresh, notifyWorkspaceChanged]
|
|
8434
8530
|
);
|
|
8435
|
-
const createDocumentTarget =
|
|
8531
|
+
const createDocumentTarget = useCallback19(
|
|
8436
8532
|
(fsProvider, workspaceId, filePath, outsideIn = null) => {
|
|
8437
8533
|
if (outsideIn) {
|
|
8438
8534
|
return createOutsideInDocumentTarget(
|
|
@@ -8608,20 +8704,20 @@ function DocBlocksShell({
|
|
|
8608
8704
|
},
|
|
8609
8705
|
[afterWorkspaceCommit, gitScheduleRefresh]
|
|
8610
8706
|
);
|
|
8611
|
-
const mediaContainerRef =
|
|
8612
|
-
const [mediaProvider, setMediaProvider] =
|
|
8613
|
-
const [mediaProviderScope, setMediaProviderScope] =
|
|
8707
|
+
const mediaContainerRef = useRef20(null);
|
|
8708
|
+
const [mediaProvider, setMediaProvider] = useState24(null);
|
|
8709
|
+
const [mediaProviderScope, setMediaProviderScope] = useState24(null);
|
|
8614
8710
|
const mediaProviderCurrent = mediaProviderScope !== null && mediaProviderScope.provider === provider && mediaProviderScope.file === selectedFile && mediaProviderScope.outsideIn === selectedOutsideIn;
|
|
8615
|
-
const [mediaEpoch, setMediaEpoch] =
|
|
8616
|
-
const versionsContainerRef =
|
|
8617
|
-
const [versionsContainer, setVersionsContainer] =
|
|
8618
|
-
const pushHash =
|
|
8711
|
+
const [mediaEpoch, setMediaEpoch] = useState24(0);
|
|
8712
|
+
const versionsContainerRef = useRef20(null);
|
|
8713
|
+
const [versionsContainer, setVersionsContainer] = useState24(null);
|
|
8714
|
+
const pushHash = useCallback19((wsId, filePath) => {
|
|
8619
8715
|
const hash = buildHash(wsId, filePath);
|
|
8620
8716
|
if (window.location.hash !== hash) {
|
|
8621
8717
|
window.history.pushState(null, "", hash);
|
|
8622
8718
|
}
|
|
8623
8719
|
}, []);
|
|
8624
|
-
const openFromIds =
|
|
8720
|
+
const openFromIds = useCallback19(
|
|
8625
8721
|
async (wsId, filePath, push, view, navigationRequestId, sharedMode = null) => {
|
|
8626
8722
|
const requestId = navigationRequestId ?? ++navigationRequestRef.current;
|
|
8627
8723
|
if (requestId !== navigationRequestRef.current) return null;
|
|
@@ -8708,7 +8804,7 @@ function DocBlocksShell({
|
|
|
8708
8804
|
},
|
|
8709
8805
|
[adoptSelectedDocument, createDocumentTarget, documentSession, pushHash]
|
|
8710
8806
|
);
|
|
8711
|
-
const adoptTransientWorkspace =
|
|
8807
|
+
const adoptTransientWorkspace = useCallback19(
|
|
8712
8808
|
async (options) => {
|
|
8713
8809
|
const descriptor = {
|
|
8714
8810
|
id: options.id,
|
|
@@ -8738,7 +8834,7 @@ function DocBlocksShell({
|
|
|
8738
8834
|
},
|
|
8739
8835
|
[openFromIds, closeWelcomeGateway]
|
|
8740
8836
|
);
|
|
8741
|
-
const openSharedDocument =
|
|
8837
|
+
const openSharedDocument = useCallback19(
|
|
8742
8838
|
async (payload, navigationRequestId) => {
|
|
8743
8839
|
const id = `transient-shared-${navigationRequestId}`;
|
|
8744
8840
|
const mem = await createMemoryFileSystemProvider(id, "Shared document");
|
|
@@ -8771,7 +8867,7 @@ function DocBlocksShell({
|
|
|
8771
8867
|
},
|
|
8772
8868
|
[adoptTransientWorkspace]
|
|
8773
8869
|
);
|
|
8774
|
-
const seedWelcomeFile =
|
|
8870
|
+
const seedWelcomeFile = useCallback19(
|
|
8775
8871
|
async (fs, seedWhenEmpty, navigationRequestId) => {
|
|
8776
8872
|
const isCurrent = () => navigationRequestId === void 0 || navigationRequestId === navigationRequestRef.current;
|
|
8777
8873
|
if (!isCurrent()) return;
|
|
@@ -8796,7 +8892,10 @@ function DocBlocksShell({
|
|
|
8796
8892
|
}
|
|
8797
8893
|
if (!seedWhenEmpty || entries.length > 0) return;
|
|
8798
8894
|
const welcomePath = WELCOME_DOCUMENT_PATH;
|
|
8799
|
-
const welcomeContent =
|
|
8895
|
+
const welcomeContent = welcomeDocumentContent({
|
|
8896
|
+
browserStorage: showBrowserStorageWarning,
|
|
8897
|
+
desktopApp
|
|
8898
|
+
});
|
|
8800
8899
|
let seededContent = welcomeContent;
|
|
8801
8900
|
try {
|
|
8802
8901
|
await writeProviderText(fs, welcomePath, welcomeContent, "create");
|
|
@@ -8820,25 +8919,32 @@ function DocBlocksShell({
|
|
|
8820
8919
|
saveLastState({ workspaceId: fs.id, filePath: welcomePath, view: "wysiwyg" });
|
|
8821
8920
|
if (!isWelcomeGatewayDismissed()) setShowWelcomeGateway(true);
|
|
8822
8921
|
},
|
|
8823
|
-
[
|
|
8922
|
+
[
|
|
8923
|
+
adoptRegularDocument,
|
|
8924
|
+
createDocumentTarget,
|
|
8925
|
+
desktopApp,
|
|
8926
|
+
documentSession,
|
|
8927
|
+
pushHash,
|
|
8928
|
+
showBrowserStorageWarning
|
|
8929
|
+
]
|
|
8824
8930
|
);
|
|
8825
|
-
const startupOpenFromIdsRef =
|
|
8931
|
+
const startupOpenFromIdsRef = useRef20(openFromIds);
|
|
8826
8932
|
startupOpenFromIdsRef.current = openFromIds;
|
|
8827
|
-
const startupOpenSharedDocumentRef =
|
|
8933
|
+
const startupOpenSharedDocumentRef = useRef20(openSharedDocument);
|
|
8828
8934
|
startupOpenSharedDocumentRef.current = openSharedDocument;
|
|
8829
|
-
const startupSeedWelcomeFileRef =
|
|
8935
|
+
const startupSeedWelcomeFileRef = useRef20(seedWelcomeFile);
|
|
8830
8936
|
startupSeedWelcomeFileRef.current = seedWelcomeFile;
|
|
8831
|
-
const [focusAfterWelcome, setFocusAfterWelcome] =
|
|
8832
|
-
const handleTourWelcome =
|
|
8937
|
+
const [focusAfterWelcome, setFocusAfterWelcome] = useState24(false);
|
|
8938
|
+
const handleTourWelcome = useCallback19(() => {
|
|
8833
8939
|
closeWelcomeGateway();
|
|
8834
8940
|
setFocusAfterWelcome(true);
|
|
8835
8941
|
}, [closeWelcomeGateway]);
|
|
8836
|
-
|
|
8942
|
+
useEffect30(() => {
|
|
8837
8943
|
if (!focusAfterWelcome || welcomeScreenShown) return;
|
|
8838
8944
|
setFocusAfterWelcome(false);
|
|
8839
8945
|
editorAreaRef.current?.querySelector('[contenteditable="true"]')?.focus({ preventScroll: true });
|
|
8840
8946
|
}, [focusAfterWelcome, welcomeScreenShown]);
|
|
8841
|
-
|
|
8947
|
+
useEffect30(() => {
|
|
8842
8948
|
const requestId = ++navigationRequestRef.current;
|
|
8843
8949
|
let cancelled = false;
|
|
8844
8950
|
const isCurrent = () => !cancelled && requestId === navigationRequestRef.current;
|
|
@@ -9050,7 +9156,7 @@ function DocBlocksShell({
|
|
|
9050
9156
|
if (navigationRequestRef.current === requestId) navigationRequestRef.current += 1;
|
|
9051
9157
|
};
|
|
9052
9158
|
}, [pushHash, workspaceAuthorityBarrier]);
|
|
9053
|
-
|
|
9159
|
+
useEffect30(() => {
|
|
9054
9160
|
const onPopState = () => {
|
|
9055
9161
|
const requestedHash = window.location.hash;
|
|
9056
9162
|
const restoreCurrentHash = () => {
|
|
@@ -9092,7 +9198,7 @@ function DocBlocksShell({
|
|
|
9092
9198
|
window.addEventListener("popstate", onPopState);
|
|
9093
9199
|
return () => window.removeEventListener("popstate", onPopState);
|
|
9094
9200
|
}, [activeWorkspaceId, openFromIds, openSharedDocument, selectedFile, showToast]);
|
|
9095
|
-
|
|
9201
|
+
useEffect30(() => {
|
|
9096
9202
|
if (!showBrowserStorageWarning || typeof navigator === "undefined") return;
|
|
9097
9203
|
const storage = navigator.storage;
|
|
9098
9204
|
if (!storage || typeof storage.persisted !== "function") return;
|
|
@@ -9105,7 +9211,7 @@ function DocBlocksShell({
|
|
|
9105
9211
|
cancelled = true;
|
|
9106
9212
|
};
|
|
9107
9213
|
}, [showBrowserStorageWarning]);
|
|
9108
|
-
|
|
9214
|
+
useEffect30(() => {
|
|
9109
9215
|
if (hasDocBlocksHost() || typeof window === "undefined") return;
|
|
9110
9216
|
const onBeforeInstallPrompt = (e) => {
|
|
9111
9217
|
e.preventDefault();
|
|
@@ -9128,7 +9234,7 @@ function DocBlocksShell({
|
|
|
9128
9234
|
window.removeEventListener("appinstalled", onAppInstalled);
|
|
9129
9235
|
};
|
|
9130
9236
|
}, []);
|
|
9131
|
-
const handleInstallApp =
|
|
9237
|
+
const handleInstallApp = useCallback19(async () => {
|
|
9132
9238
|
const promptEvent = installPromptEvent;
|
|
9133
9239
|
setInstallPromptEvent(null);
|
|
9134
9240
|
if (!promptEvent) return;
|
|
@@ -9138,7 +9244,7 @@ function DocBlocksShell({
|
|
|
9138
9244
|
} catch {
|
|
9139
9245
|
}
|
|
9140
9246
|
}, [installPromptEvent]);
|
|
9141
|
-
|
|
9247
|
+
useEffect30(() => {
|
|
9142
9248
|
const handler = (e) => {
|
|
9143
9249
|
const target = e.target.closest?.("[data-view]");
|
|
9144
9250
|
if (target) {
|
|
@@ -9154,7 +9260,7 @@ function DocBlocksShell({
|
|
|
9154
9260
|
window.addEventListener("click", handler, true);
|
|
9155
9261
|
return () => window.removeEventListener("click", handler, true);
|
|
9156
9262
|
}, [activeWorkspaceId, selectedFile, closeWelcomeGateway]);
|
|
9157
|
-
const saveActiveDocument =
|
|
9263
|
+
const saveActiveDocument = useCallback19(() => {
|
|
9158
9264
|
void (async () => {
|
|
9159
9265
|
try {
|
|
9160
9266
|
await documentSession.flush("manual");
|
|
@@ -9167,30 +9273,30 @@ function DocBlocksShell({
|
|
|
9167
9273
|
}
|
|
9168
9274
|
})();
|
|
9169
9275
|
}, [documentSession, showToast]);
|
|
9170
|
-
|
|
9276
|
+
useEffect30(() => {
|
|
9171
9277
|
return () => {
|
|
9172
9278
|
if (saveToastTimerRef.current) clearTimeout(saveToastTimerRef.current);
|
|
9173
9279
|
};
|
|
9174
9280
|
}, []);
|
|
9175
|
-
const [offlineReadyToast, setOfflineReadyToast] =
|
|
9176
|
-
const offlineReadyAnnouncedRef =
|
|
9177
|
-
|
|
9281
|
+
const [offlineReadyToast, setOfflineReadyToast] = useState24(false);
|
|
9282
|
+
const offlineReadyAnnouncedRef = useRef20(false);
|
|
9283
|
+
useEffect30(() => {
|
|
9178
9284
|
if (!offlineReady || offlineReadyAnnouncedRef.current) return;
|
|
9179
9285
|
offlineReadyAnnouncedRef.current = true;
|
|
9180
9286
|
setOfflineReadyToast(true);
|
|
9181
9287
|
const timer = setTimeout(() => setOfflineReadyToast(false), 3e3);
|
|
9182
9288
|
return () => clearTimeout(timer);
|
|
9183
9289
|
}, [offlineReady]);
|
|
9184
|
-
const [storageFull, setStorageFull] =
|
|
9185
|
-
|
|
9290
|
+
const [storageFull, setStorageFull] = useState24(false);
|
|
9291
|
+
useEffect30(() => {
|
|
9186
9292
|
if (documentSnapshot.error && isQuotaExceededError(documentSnapshot.error)) {
|
|
9187
9293
|
setStorageFull(true);
|
|
9188
9294
|
} else if (documentSnapshot.status === "saved") {
|
|
9189
9295
|
setStorageFull(false);
|
|
9190
9296
|
}
|
|
9191
9297
|
}, [documentSnapshot.error, documentSnapshot.status]);
|
|
9192
|
-
const autoPersistRequestedRef =
|
|
9193
|
-
|
|
9298
|
+
const autoPersistRequestedRef = useRef20(false);
|
|
9299
|
+
useEffect30(() => {
|
|
9194
9300
|
if (!showBrowserStorageWarning || browserStoragePersistent) return;
|
|
9195
9301
|
if (autoPersistRequestedRef.current) return;
|
|
9196
9302
|
if (documentSnapshot.status !== "saved") return;
|
|
@@ -9238,8 +9344,8 @@ function DocBlocksShell({
|
|
|
9238
9344
|
mp.dispose();
|
|
9239
9345
|
};
|
|
9240
9346
|
}, [provider, selectedFile, selectedOutsideIn, mediaEpoch]);
|
|
9241
|
-
const [mediaEditRenders, setMediaEditRenders] =
|
|
9242
|
-
|
|
9347
|
+
const [mediaEditRenders, setMediaEditRenders] = useState24(null);
|
|
9348
|
+
useEffect30(() => {
|
|
9243
9349
|
setMediaEditRenders(null);
|
|
9244
9350
|
if (!mediaProvider) return;
|
|
9245
9351
|
let manager = null;
|
|
@@ -9263,7 +9369,7 @@ function DocBlocksShell({
|
|
|
9263
9369
|
selectedSourceFile ?? selectedFile,
|
|
9264
9370
|
workspaceIndex.ensure
|
|
9265
9371
|
);
|
|
9266
|
-
|
|
9372
|
+
useEffect30(() => {
|
|
9267
9373
|
const ref = versioningRef;
|
|
9268
9374
|
if (!ref) return;
|
|
9269
9375
|
const assign = (mgr2) => {
|
|
@@ -9287,7 +9393,7 @@ function DocBlocksShell({
|
|
|
9287
9393
|
(output) => output.status === "written" && sameProviderPath(output.path, selectedFile)
|
|
9288
9394
|
) ? workspaceOutputsResult : null;
|
|
9289
9395
|
}, [selectedFile, selectedManagedOutput, workspaceOutputsResult]);
|
|
9290
|
-
|
|
9396
|
+
useEffect30(() => {
|
|
9291
9397
|
if (!provider) return;
|
|
9292
9398
|
const providerV2 = getFileSystemProviderV211(provider);
|
|
9293
9399
|
const lifecycle = maybeGetDocBlocksHost4()?.lifecycle;
|
|
@@ -9368,7 +9474,7 @@ function DocBlocksShell({
|
|
|
9368
9474
|
documentSnapshot.targetKey,
|
|
9369
9475
|
showToast
|
|
9370
9476
|
]);
|
|
9371
|
-
const transitionAwayFromDocument =
|
|
9477
|
+
const transitionAwayFromDocument = useCallback19(
|
|
9372
9478
|
async (requestId) => {
|
|
9373
9479
|
if (requestId !== navigationRequestRef.current) return false;
|
|
9374
9480
|
try {
|
|
@@ -9387,15 +9493,15 @@ function DocBlocksShell({
|
|
|
9387
9493
|
},
|
|
9388
9494
|
[documentSession, showToast]
|
|
9389
9495
|
);
|
|
9390
|
-
const [showConflictComparison, setShowConflictComparison] =
|
|
9391
|
-
const readConflictFile =
|
|
9496
|
+
const [showConflictComparison, setShowConflictComparison] = useState24(false);
|
|
9497
|
+
const readConflictFile = useCallback19(async () => {
|
|
9392
9498
|
const path = selectedSourceFile ?? selectedFile;
|
|
9393
9499
|
if (!provider || !path || activeWorkspaceId && getTransientWorkspace(activeWorkspaceId)) {
|
|
9394
9500
|
return null;
|
|
9395
9501
|
}
|
|
9396
9502
|
return readStableFileSnapshot(provider, path);
|
|
9397
9503
|
}, [provider, selectedSourceFile, selectedFile, activeWorkspaceId]);
|
|
9398
|
-
const handleUseExternalDocument =
|
|
9504
|
+
const handleUseExternalDocument = useCallback19(async () => {
|
|
9399
9505
|
const conflictKey = documentSession.getSnapshot().conflict?.targetKey;
|
|
9400
9506
|
const pendingDbk = conflictKey ? pendingDbkConflictsRef.current.get(conflictKey) : void 0;
|
|
9401
9507
|
try {
|
|
@@ -9419,7 +9525,7 @@ function DocBlocksShell({
|
|
|
9419
9525
|
return false;
|
|
9420
9526
|
}
|
|
9421
9527
|
}, [activeWorkspaceId, adoptSelectedDocument, documentSession, pushHash]);
|
|
9422
|
-
const handleKeepLocalDocument =
|
|
9528
|
+
const handleKeepLocalDocument = useCallback19(async () => {
|
|
9423
9529
|
const conflictKey = documentSession.getSnapshot().conflict?.targetKey;
|
|
9424
9530
|
try {
|
|
9425
9531
|
await documentSession.resolveConflict("use-local");
|
|
@@ -9434,7 +9540,7 @@ function DocBlocksShell({
|
|
|
9434
9540
|
return false;
|
|
9435
9541
|
}
|
|
9436
9542
|
}, [documentSession]);
|
|
9437
|
-
|
|
9543
|
+
useEffect30(() => {
|
|
9438
9544
|
const needsWarning = ["dirty", "saving", "error", "conflict"].includes(documentSnapshot.status);
|
|
9439
9545
|
if (!documentSnapshot.targetKey) return;
|
|
9440
9546
|
const flushBestEffort = () => {
|
|
@@ -9460,7 +9566,7 @@ function DocBlocksShell({
|
|
|
9460
9566
|
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
9461
9567
|
};
|
|
9462
9568
|
}, [documentSession, documentSnapshot.status, documentSnapshot.targetKey]);
|
|
9463
|
-
|
|
9569
|
+
useEffect30(() => {
|
|
9464
9570
|
const lifecycle = maybeGetDocBlocksHost4()?.lifecycle;
|
|
9465
9571
|
if (!hostSupports2("guardedClose") || !lifecycle) return;
|
|
9466
9572
|
const stopPrepare = lifecycle.onPrepareClose(async (request) => {
|
|
@@ -9486,7 +9592,7 @@ function DocBlocksShell({
|
|
|
9486
9592
|
stopCancel?.();
|
|
9487
9593
|
};
|
|
9488
9594
|
}, [documentSession]);
|
|
9489
|
-
const handleWorkspaceSelect =
|
|
9595
|
+
const handleWorkspaceSelect = useCallback19(
|
|
9490
9596
|
async (ws) => {
|
|
9491
9597
|
const requestId = ++navigationRequestRef.current;
|
|
9492
9598
|
await touchWorkspace2(ws.id);
|
|
@@ -9518,7 +9624,7 @@ function DocBlocksShell({
|
|
|
9518
9624
|
},
|
|
9519
9625
|
[adoptSelectedDocument, pushHash, transitionAwayFromDocument]
|
|
9520
9626
|
);
|
|
9521
|
-
const unpinDocument =
|
|
9627
|
+
const unpinDocument = useCallback19((document2) => {
|
|
9522
9628
|
const key = pinnedDocumentKey(document2);
|
|
9523
9629
|
setPinnedDocuments((current) => removePinnedDocument(current, document2));
|
|
9524
9630
|
setPinnedDocumentAvailability((current) => {
|
|
@@ -9528,7 +9634,7 @@ function DocBlocksShell({
|
|
|
9528
9634
|
return next;
|
|
9529
9635
|
});
|
|
9530
9636
|
}, []);
|
|
9531
|
-
const confirmMissingPinnedDocument =
|
|
9637
|
+
const confirmMissingPinnedDocument = useCallback19(
|
|
9532
9638
|
async (document2) => {
|
|
9533
9639
|
setPinnedAvailability(document2, "missing");
|
|
9534
9640
|
const shouldUnpin = await confirmAction({
|
|
@@ -9541,7 +9647,7 @@ function DocBlocksShell({
|
|
|
9541
9647
|
},
|
|
9542
9648
|
[confirmAction, setPinnedAvailability, unpinDocument]
|
|
9543
9649
|
);
|
|
9544
|
-
const handleTogglePin =
|
|
9650
|
+
const handleTogglePin = useCallback19(
|
|
9545
9651
|
(path) => {
|
|
9546
9652
|
if (!activeWorkspaceId || !provider) return;
|
|
9547
9653
|
const canonicalPath2 = parseWorkspacePath8(path);
|
|
@@ -9579,7 +9685,7 @@ function DocBlocksShell({
|
|
|
9579
9685
|
() => pinnedDocuments.filter((document2) => document2.workspaceId === activeWorkspaceId).map((document2) => document2.path),
|
|
9580
9686
|
[activeWorkspaceId, pinnedDocuments]
|
|
9581
9687
|
);
|
|
9582
|
-
const handlePinnedDocumentSelect =
|
|
9688
|
+
const handlePinnedDocumentSelect = useCallback19(
|
|
9583
9689
|
async (document2) => {
|
|
9584
9690
|
const requestId = ++navigationRequestRef.current;
|
|
9585
9691
|
const workspace = await getWorkspace(document2.workspaceId);
|
|
@@ -9707,7 +9813,7 @@ function DocBlocksShell({
|
|
|
9707
9813
|
showToast
|
|
9708
9814
|
]
|
|
9709
9815
|
);
|
|
9710
|
-
const handleMoveTransientWorkspace =
|
|
9816
|
+
const handleMoveTransientWorkspace = useCallback19(
|
|
9711
9817
|
async (destinationWorkspaceId) => {
|
|
9712
9818
|
if (!activeWorkspaceId || !provider || !selectedFile) {
|
|
9713
9819
|
throw new Error("Select the temporary document before moving it.");
|
|
@@ -9821,7 +9927,7 @@ function DocBlocksShell({
|
|
|
9821
9927
|
transientMoveDestinations
|
|
9822
9928
|
]
|
|
9823
9929
|
);
|
|
9824
|
-
const handleOpenFolder =
|
|
9930
|
+
const handleOpenFolder = useCallback19(async () => {
|
|
9825
9931
|
const requestId = ++navigationRequestRef.current;
|
|
9826
9932
|
try {
|
|
9827
9933
|
if (hostSupports2("workspaceFolderPicker")) {
|
|
@@ -9867,7 +9973,7 @@ function DocBlocksShell({
|
|
|
9867
9973
|
} catch {
|
|
9868
9974
|
}
|
|
9869
9975
|
}, [adoptSelectedDocument, pushHash, transitionAwayFromDocument]);
|
|
9870
|
-
const handleWorkspaceCloned =
|
|
9976
|
+
const handleWorkspaceCloned = useCallback19(
|
|
9871
9977
|
(info) => {
|
|
9872
9978
|
const requestId = ++navigationRequestRef.current;
|
|
9873
9979
|
void (async () => {
|
|
@@ -9892,10 +9998,10 @@ function DocBlocksShell({
|
|
|
9892
9998
|
},
|
|
9893
9999
|
[adoptSelectedDocument, pushHash, transitionAwayFromDocument]
|
|
9894
10000
|
);
|
|
9895
|
-
const handleNewFile =
|
|
10001
|
+
const handleNewFile = useCallback19(() => {
|
|
9896
10002
|
if (provider) setNewDocumentDialogOpen(true);
|
|
9897
10003
|
}, [provider]);
|
|
9898
|
-
const createNewDocument =
|
|
10004
|
+
const createNewDocument = useCallback19(
|
|
9899
10005
|
async ({ filename, format }) => {
|
|
9900
10006
|
if (!provider) return;
|
|
9901
10007
|
const path = "/" + filename;
|
|
@@ -9994,7 +10100,7 @@ function DocBlocksShell({
|
|
|
9994
10100
|
showToast
|
|
9995
10101
|
]
|
|
9996
10102
|
);
|
|
9997
|
-
const handleNewFolder =
|
|
10103
|
+
const handleNewFolder = useCallback19(async () => {
|
|
9998
10104
|
if (!provider) return;
|
|
9999
10105
|
const name = await promptForText({
|
|
10000
10106
|
title: "New folder",
|
|
@@ -10042,15 +10148,15 @@ function DocBlocksShell({
|
|
|
10042
10148
|
singlePane
|
|
10043
10149
|
]);
|
|
10044
10150
|
const canFind = selectedFile !== null && mediaProvider !== null && selectedManagedOutput !== "catalog-html" && selectedImage === void 0;
|
|
10045
|
-
const canFindRef =
|
|
10151
|
+
const canFindRef = useRef20(canFind);
|
|
10046
10152
|
canFindRef.current = canFind;
|
|
10047
10153
|
const { ensure: ensureWorkspaceIndex } = workspaceIndex;
|
|
10048
|
-
const openQuickOpen =
|
|
10154
|
+
const openQuickOpen = useCallback19(() => {
|
|
10049
10155
|
ensureWorkspaceIndex();
|
|
10050
10156
|
setQuickOpenOpen(true);
|
|
10051
10157
|
setQuickOpenFocusRequest((request) => request + 1);
|
|
10052
10158
|
}, [ensureWorkspaceIndex]);
|
|
10053
|
-
const openWorkspaceSearch =
|
|
10159
|
+
const openWorkspaceSearch = useCallback19(() => {
|
|
10054
10160
|
ensureWorkspaceIndex();
|
|
10055
10161
|
if (singlePane) setMobileShowEditor(false);
|
|
10056
10162
|
else if (sidebarPreference === "collapsed") updateSidebarPreference("pinned");
|
|
@@ -10118,7 +10224,7 @@ function DocBlocksShell({
|
|
|
10118
10224
|
]
|
|
10119
10225
|
);
|
|
10120
10226
|
useShellShortcuts(shortcutHandlers, layoutMode);
|
|
10121
|
-
|
|
10227
|
+
useEffect30(
|
|
10122
10228
|
() => maybeGetDocBlocksHost4()?.lifecycle?.onBack?.(() => {
|
|
10123
10229
|
if (dismissTopmostDialog()) return true;
|
|
10124
10230
|
const escape = new KeyboardEvent("keydown", {
|
|
@@ -10140,8 +10246,8 @@ function DocBlocksShell({
|
|
|
10140
10246
|
}),
|
|
10141
10247
|
[singlePane, mobileShowEditor]
|
|
10142
10248
|
);
|
|
10143
|
-
const actionNewHandledRef =
|
|
10144
|
-
|
|
10249
|
+
const actionNewHandledRef = useRef20(false);
|
|
10250
|
+
useEffect30(() => {
|
|
10145
10251
|
if (!provider || actionNewHandledRef.current) return;
|
|
10146
10252
|
if (typeof window === "undefined") return;
|
|
10147
10253
|
const params = new URLSearchParams(window.location.search);
|
|
@@ -10156,7 +10262,7 @@ function DocBlocksShell({
|
|
|
10156
10262
|
);
|
|
10157
10263
|
void handleNewFile();
|
|
10158
10264
|
}, [provider, handleNewFile]);
|
|
10159
|
-
const handleRevealWorkspace =
|
|
10265
|
+
const handleRevealWorkspace = useCallback19(async () => {
|
|
10160
10266
|
const shell = maybeGetDocBlocksHost4()?.shell;
|
|
10161
10267
|
if (!hostSupports2("revealInFileManager") || !shell?.revealInFolder || !activeWorkspaceId) {
|
|
10162
10268
|
return;
|
|
@@ -10166,7 +10272,7 @@ function DocBlocksShell({
|
|
|
10166
10272
|
await shell.revealInFolder(ws.id);
|
|
10167
10273
|
}
|
|
10168
10274
|
}, [activeWorkspaceId]);
|
|
10169
|
-
const handleOpenWorkspaceFolder =
|
|
10275
|
+
const handleOpenWorkspaceFolder = useCallback19(() => {
|
|
10170
10276
|
const shell = maybeGetDocBlocksHost4()?.shell;
|
|
10171
10277
|
if (!hostSupports2("openWorkspaceFolder") || !shell?.openWorkspaceFolder || !nativeWorkspaceId) {
|
|
10172
10278
|
return;
|
|
@@ -10178,7 +10284,7 @@ function DocBlocksShell({
|
|
|
10178
10284
|
);
|
|
10179
10285
|
});
|
|
10180
10286
|
}, [nativeWorkspaceId, showToast]);
|
|
10181
|
-
|
|
10287
|
+
useEffect30(() => {
|
|
10182
10288
|
const host = maybeGetDocBlocksHost4();
|
|
10183
10289
|
if (!hostSupports2("menuCommands") || !host?.onMenuCommand) return;
|
|
10184
10290
|
return host.onMenuCommand((cmd) => {
|
|
@@ -10245,7 +10351,7 @@ function DocBlocksShell({
|
|
|
10245
10351
|
}
|
|
10246
10352
|
});
|
|
10247
10353
|
}, [handleNewFile, handleOpenFolder, handleRevealWorkspace, acknowledge, openFind]);
|
|
10248
|
-
const handleSelect =
|
|
10354
|
+
const handleSelect = useCallback19(
|
|
10249
10355
|
async (path, kind, createWikiArticle = false) => {
|
|
10250
10356
|
if (!provider || !activeWorkspaceId) return;
|
|
10251
10357
|
const requestId = ++navigationRequestRef.current;
|
|
@@ -10329,7 +10435,7 @@ function DocBlocksShell({
|
|
|
10329
10435
|
defaultNewFileFormat
|
|
10330
10436
|
]
|
|
10331
10437
|
);
|
|
10332
|
-
const wikiNavigationRef =
|
|
10438
|
+
const wikiNavigationRef = useRef20(handleSelect);
|
|
10333
10439
|
wikiNavigationRef.current = handleSelect;
|
|
10334
10440
|
const wikiLinks = useMemo6(() => {
|
|
10335
10441
|
if (!provider || !selectedFile || !activeWorkspaceId) return null;
|
|
@@ -10391,7 +10497,7 @@ function DocBlocksShell({
|
|
|
10391
10497
|
workspaceIndex.ensure,
|
|
10392
10498
|
workspaceIndex.status.generation
|
|
10393
10499
|
]);
|
|
10394
|
-
const handleEnableOutsideInEditing =
|
|
10500
|
+
const handleEnableOutsideInEditing = useCallback19(
|
|
10395
10501
|
async (path) => {
|
|
10396
10502
|
if (!provider || !activeWorkspaceId) {
|
|
10397
10503
|
throw new Error("Open the workspace before enabling Markdown editing.");
|
|
@@ -10453,7 +10559,7 @@ function DocBlocksShell({
|
|
|
10453
10559
|
return null;
|
|
10454
10560
|
}
|
|
10455
10561
|
}, [workspaceSettings.settings]);
|
|
10456
|
-
const outsideInActionsForEntry =
|
|
10562
|
+
const outsideInActionsForEntry = useCallback19(
|
|
10457
10563
|
(entry) => {
|
|
10458
10564
|
if (entry.kind !== "file" || resolveOutsideInLayout2(entry.path) === null) return [];
|
|
10459
10565
|
if (catalogHtmlPath !== null && sameProviderPath(entry.path, catalogHtmlPath)) return [];
|
|
@@ -10469,7 +10575,7 @@ function DocBlocksShell({
|
|
|
10469
10575
|
},
|
|
10470
10576
|
[catalogHtmlPath, handleEnableOutsideInEditing, selectedFile, selectedOutsideInEditingEnabled]
|
|
10471
10577
|
);
|
|
10472
|
-
const actionsForEntry =
|
|
10578
|
+
const actionsForEntry = useCallback19(
|
|
10473
10579
|
(entry) => {
|
|
10474
10580
|
const nativeActions = createNativeFileActions(
|
|
10475
10581
|
entry,
|
|
@@ -10492,7 +10598,7 @@ function DocBlocksShell({
|
|
|
10492
10598
|
() => quickOpenOpen && activeWorkspaceId ? loadRecentDocuments(activeWorkspaceId) : [],
|
|
10493
10599
|
[quickOpenOpen, activeWorkspaceId]
|
|
10494
10600
|
);
|
|
10495
|
-
const handleQuickOpenChoice =
|
|
10601
|
+
const handleQuickOpenChoice = useCallback19(
|
|
10496
10602
|
(item) => {
|
|
10497
10603
|
setQuickOpenOpen(false);
|
|
10498
10604
|
if (item.workspaceId === activeWorkspaceId) {
|
|
@@ -10506,13 +10612,13 @@ function DocBlocksShell({
|
|
|
10506
10612
|
},
|
|
10507
10613
|
[activeWorkspaceId, handleSelect, handlePinnedDocumentSelect, pinnedDocumentItems]
|
|
10508
10614
|
);
|
|
10509
|
-
const handleSearchOpen =
|
|
10615
|
+
const handleSearchOpen = useCallback19(
|
|
10510
10616
|
(request) => {
|
|
10511
10617
|
void handleSelect(request.path, "file");
|
|
10512
10618
|
},
|
|
10513
10619
|
[handleSelect]
|
|
10514
10620
|
);
|
|
10515
|
-
const handleEditorLinkClick =
|
|
10621
|
+
const handleEditorLinkClick = useCallback19(
|
|
10516
10622
|
(href) => {
|
|
10517
10623
|
const target = resolveShellEditorLinkTarget(href, selectedSourceFile ?? selectedFile);
|
|
10518
10624
|
if (!target) {
|
|
@@ -10551,7 +10657,7 @@ function DocBlocksShell({
|
|
|
10551
10657
|
},
|
|
10552
10658
|
[handleSelect, provider, selectedFile, selectedSourceFile, showToast]
|
|
10553
10659
|
);
|
|
10554
|
-
const handleTreeMutation =
|
|
10660
|
+
const handleTreeMutation = useCallback19(
|
|
10555
10661
|
async (change, mutate) => {
|
|
10556
10662
|
if (!provider) {
|
|
10557
10663
|
await mutate();
|
|
@@ -10635,7 +10741,7 @@ function DocBlocksShell({
|
|
|
10635
10741
|
showToast
|
|
10636
10742
|
]
|
|
10637
10743
|
);
|
|
10638
|
-
const handleTreeChange =
|
|
10744
|
+
const handleTreeChange = useCallback19(
|
|
10639
10745
|
async (change) => {
|
|
10640
10746
|
if (!provider) return;
|
|
10641
10747
|
notifyWorkspaceChanged(activeWorkspaceId);
|
|
@@ -10706,7 +10812,7 @@ function DocBlocksShell({
|
|
|
10706
10812
|
setPinnedAvailability
|
|
10707
10813
|
]
|
|
10708
10814
|
);
|
|
10709
|
-
const acquirePinnedDocumentProvider =
|
|
10815
|
+
const acquirePinnedDocumentProvider = useCallback19(
|
|
10710
10816
|
async (document2) => {
|
|
10711
10817
|
const workspace = await getWorkspace(document2.workspaceId);
|
|
10712
10818
|
if (!workspace) return { kind: "missing-workspace" };
|
|
@@ -10730,7 +10836,7 @@ function DocBlocksShell({
|
|
|
10730
10836
|
},
|
|
10731
10837
|
[activeWorkspaceId, provider]
|
|
10732
10838
|
);
|
|
10733
|
-
const markRelocatedPinnedDocument =
|
|
10839
|
+
const markRelocatedPinnedDocument = useCallback19((document2, newPath) => {
|
|
10734
10840
|
const relocated = {
|
|
10735
10841
|
workspaceId: document2.workspaceId,
|
|
10736
10842
|
workspaceName: document2.workspaceName,
|
|
@@ -10749,7 +10855,7 @@ function DocBlocksShell({
|
|
|
10749
10855
|
return next;
|
|
10750
10856
|
});
|
|
10751
10857
|
}, []);
|
|
10752
|
-
const handlePinnedDocumentRename =
|
|
10858
|
+
const handlePinnedDocumentRename = useCallback19(
|
|
10753
10859
|
async (document2) => {
|
|
10754
10860
|
if (document2.availability === "missing") {
|
|
10755
10861
|
await confirmMissingPinnedDocument(document2);
|
|
@@ -10836,7 +10942,7 @@ function DocBlocksShell({
|
|
|
10836
10942
|
showToast
|
|
10837
10943
|
]
|
|
10838
10944
|
);
|
|
10839
|
-
const handlePinnedDocumentDelete =
|
|
10945
|
+
const handlePinnedDocumentDelete = useCallback19(
|
|
10840
10946
|
async (document2) => {
|
|
10841
10947
|
if (document2.availability === "missing") {
|
|
10842
10948
|
await confirmMissingPinnedDocument(document2);
|
|
@@ -10904,9 +11010,9 @@ function DocBlocksShell({
|
|
|
10904
11010
|
showToast
|
|
10905
11011
|
]
|
|
10906
11012
|
);
|
|
10907
|
-
const restoreInputRef =
|
|
10908
|
-
const restoreInProgress =
|
|
10909
|
-
const handleRestoreBackup =
|
|
11013
|
+
const restoreInputRef = useRef20(null);
|
|
11014
|
+
const restoreInProgress = useRef20(false);
|
|
11015
|
+
const handleRestoreBackup = useCallback19(
|
|
10910
11016
|
async (file) => {
|
|
10911
11017
|
if (restoreInProgress.current) {
|
|
10912
11018
|
showToast("error", "A backup is already being restored. Please wait.");
|
|
@@ -10933,7 +11039,7 @@ function DocBlocksShell({
|
|
|
10933
11039
|
},
|
|
10934
11040
|
[documentSession, handleWorkspaceSelect, showToast]
|
|
10935
11041
|
);
|
|
10936
|
-
const importOrRestore =
|
|
11042
|
+
const importOrRestore = useCallback19(
|
|
10937
11043
|
async (files) => {
|
|
10938
11044
|
const backups = hostSupports2("nativeWorkspaces") ? [] : files.filter((file) => /\.zip$/i.test(file.name));
|
|
10939
11045
|
const documents = files.filter((file) => !backups.includes(file));
|
|
@@ -10943,7 +11049,7 @@ function DocBlocksShell({
|
|
|
10943
11049
|
},
|
|
10944
11050
|
[handleRestoreBackup, provider]
|
|
10945
11051
|
);
|
|
10946
|
-
const handleImportFiles =
|
|
11052
|
+
const handleImportFiles = useCallback19(
|
|
10947
11053
|
async (files) => {
|
|
10948
11054
|
if (!provider) return;
|
|
10949
11055
|
const result = await importOrRestore(files);
|
|
@@ -10955,7 +11061,7 @@ function DocBlocksShell({
|
|
|
10955
11061
|
},
|
|
10956
11062
|
[activeWorkspaceId, notifyWorkspaceChanged, provider, showToast, importOrRestore]
|
|
10957
11063
|
);
|
|
10958
|
-
const handleImportFilesToEditor =
|
|
11064
|
+
const handleImportFilesToEditor = useCallback19(
|
|
10959
11065
|
async (files) => {
|
|
10960
11066
|
if (!provider) return;
|
|
10961
11067
|
const result = await importOrRestore(files);
|
|
@@ -10977,7 +11083,7 @@ function DocBlocksShell({
|
|
|
10977
11083
|
provider !== null,
|
|
10978
11084
|
(files) => void handleImportFilesToEditor(files)
|
|
10979
11085
|
);
|
|
10980
|
-
const handleEditorChange =
|
|
11086
|
+
const handleEditorChange = useCallback19(
|
|
10981
11087
|
(source) => {
|
|
10982
11088
|
if (!editorSessionScope) return;
|
|
10983
11089
|
try {
|
|
@@ -10987,7 +11093,7 @@ function DocBlocksShell({
|
|
|
10987
11093
|
},
|
|
10988
11094
|
[documentSession, editorSessionScope]
|
|
10989
11095
|
);
|
|
10990
|
-
const handleRenameWorkspace =
|
|
11096
|
+
const handleRenameWorkspace = useCallback19(async () => {
|
|
10991
11097
|
if (!activeWorkspaceId) return;
|
|
10992
11098
|
const ws = await getWorkspace(activeWorkspaceId);
|
|
10993
11099
|
if (!ws) return;
|
|
@@ -11004,7 +11110,7 @@ function DocBlocksShell({
|
|
|
11004
11110
|
);
|
|
11005
11111
|
setDescriptorRefreshKey((key) => key + 1);
|
|
11006
11112
|
}, [activeWorkspaceId, promptForText]);
|
|
11007
|
-
const openTransient =
|
|
11113
|
+
const openTransient = useCallback19(
|
|
11008
11114
|
async (req, navigationRequestId) => {
|
|
11009
11115
|
const isCurrent = () => navigationRequestId === navigationRequestRef.current;
|
|
11010
11116
|
const host = getDocBlocksHost();
|
|
@@ -11081,7 +11187,7 @@ function DocBlocksShell({
|
|
|
11081
11187
|
},
|
|
11082
11188
|
[adoptTransientWorkspace]
|
|
11083
11189
|
);
|
|
11084
|
-
|
|
11190
|
+
useEffect30(() => {
|
|
11085
11191
|
const host = maybeGetDocBlocksHost4();
|
|
11086
11192
|
if (!hostSupports2("openRequests") || !host) return;
|
|
11087
11193
|
return host.onOpenRequest((req) => {
|
|
@@ -11106,7 +11212,7 @@ function DocBlocksShell({
|
|
|
11106
11212
|
});
|
|
11107
11213
|
});
|
|
11108
11214
|
}, [openFromIds, openTransient, workspaceAuthorityBarrier, showToast, closeWelcomeGateway]);
|
|
11109
|
-
const openTransientFromHandle =
|
|
11215
|
+
const openTransientFromHandle = useCallback19(
|
|
11110
11216
|
async (handle) => {
|
|
11111
11217
|
const name = handle.name;
|
|
11112
11218
|
const isBundle = /\.(dbk|zip)$/i.test(name);
|
|
@@ -11148,7 +11254,7 @@ function DocBlocksShell({
|
|
|
11148
11254
|
},
|
|
11149
11255
|
[adoptTransientWorkspace]
|
|
11150
11256
|
);
|
|
11151
|
-
|
|
11257
|
+
useEffect30(() => {
|
|
11152
11258
|
if (hostSupports2("openRequests") || typeof window === "undefined") return;
|
|
11153
11259
|
const launchQueue = window.launchQueue;
|
|
11154
11260
|
if (!launchQueue) return;
|
|
@@ -11164,7 +11270,7 @@ function DocBlocksShell({
|
|
|
11164
11270
|
});
|
|
11165
11271
|
}, [openTransientFromHandle, showToast]);
|
|
11166
11272
|
const updateStatusBarVisible = viewPreferences.showStatusBar === true && selectedFile !== null && mediaProvider !== null;
|
|
11167
|
-
const handleDownloadWorkspace =
|
|
11273
|
+
const handleDownloadWorkspace = useCallback19(async () => {
|
|
11168
11274
|
if (!provider) return;
|
|
11169
11275
|
try {
|
|
11170
11276
|
await documentSession.flush("backup");
|
|
@@ -11189,7 +11295,7 @@ function DocBlocksShell({
|
|
|
11189
11295
|
showToast("error", err instanceof Error ? err.message : "Failed to download workspace.");
|
|
11190
11296
|
}
|
|
11191
11297
|
}, [provider, documentSession, showToast]);
|
|
11192
|
-
const handleDownloadAllWorkspaces =
|
|
11298
|
+
const handleDownloadAllWorkspaces = useCallback19(async () => {
|
|
11193
11299
|
try {
|
|
11194
11300
|
await documentSession.flush("backup");
|
|
11195
11301
|
const [{ MemoryContentContainer }, { containerToZip }] = await Promise.all([
|
|
@@ -11262,7 +11368,7 @@ function DocBlocksShell({
|
|
|
11262
11368
|
showToast("error", err instanceof Error ? err.message : "Failed to download all workspaces.");
|
|
11263
11369
|
}
|
|
11264
11370
|
}, [documentSession, acknowledge, showToast]);
|
|
11265
|
-
const handleKeepBrowserData =
|
|
11371
|
+
const handleKeepBrowserData = useCallback19(async () => {
|
|
11266
11372
|
if (typeof navigator === "undefined") return;
|
|
11267
11373
|
const storage = navigator.storage;
|
|
11268
11374
|
if (!storage || typeof storage.persist !== "function") {
|
|
@@ -11299,7 +11405,7 @@ function DocBlocksShell({
|
|
|
11299
11405
|
});
|
|
11300
11406
|
}
|
|
11301
11407
|
}, [acknowledge, showToast]);
|
|
11302
|
-
const getBrowserStorageEstimate =
|
|
11408
|
+
const getBrowserStorageEstimate = useCallback19(async () => {
|
|
11303
11409
|
if (typeof navigator === "undefined") return null;
|
|
11304
11410
|
const storage = navigator.storage;
|
|
11305
11411
|
if (!storage || typeof storage.estimate !== "function") return null;
|
|
@@ -11311,7 +11417,7 @@ function DocBlocksShell({
|
|
|
11311
11417
|
return null;
|
|
11312
11418
|
}
|
|
11313
11419
|
}, []);
|
|
11314
|
-
const handleRemoveWorkspace =
|
|
11420
|
+
const handleRemoveWorkspace = useCallback19(
|
|
11315
11421
|
async (workspaceId) => {
|
|
11316
11422
|
const ws = await getWorkspace(workspaceId);
|
|
11317
11423
|
const removingActive = workspaceId === activeWorkspaceId;
|
|
@@ -11405,7 +11511,7 @@ function DocBlocksShell({
|
|
|
11405
11511
|
transitionAwayFromDocument
|
|
11406
11512
|
]
|
|
11407
11513
|
);
|
|
11408
|
-
return /* @__PURE__ */
|
|
11514
|
+
return /* @__PURE__ */ jsx19(
|
|
11409
11515
|
"div",
|
|
11410
11516
|
{
|
|
11411
11517
|
ref: shellRef,
|
|
@@ -11414,10 +11520,10 @@ function DocBlocksShell({
|
|
|
11414
11520
|
"data-accent": accentColor,
|
|
11415
11521
|
"data-interface-font": interfaceFont === "fixed" ? "fixed" : void 0,
|
|
11416
11522
|
"data-document-status": documentSnapshot.status,
|
|
11417
|
-
children: /* @__PURE__ */
|
|
11523
|
+
children: /* @__PURE__ */ jsxs17(GitContext.Provider, { value: git, children: [
|
|
11418
11524
|
promptDialog,
|
|
11419
11525
|
confirmDialog,
|
|
11420
|
-
quickOpenOpen && activeWorkspaceId && /* @__PURE__ */
|
|
11526
|
+
quickOpenOpen && activeWorkspaceId && /* @__PURE__ */ jsx19(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx19(
|
|
11421
11527
|
QuickOpenDialog,
|
|
11422
11528
|
{
|
|
11423
11529
|
index: workspaceIndex.index,
|
|
@@ -11431,8 +11537,8 @@ function DocBlocksShell({
|
|
|
11431
11537
|
onClose: () => setQuickOpenOpen(false)
|
|
11432
11538
|
}
|
|
11433
11539
|
) }),
|
|
11434
|
-
shortcutsOpen && /* @__PURE__ */
|
|
11435
|
-
newDocumentDialogOpen && /* @__PURE__ */
|
|
11540
|
+
shortcutsOpen && /* @__PURE__ */ jsx19(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx19(KeyboardShortcutsDialog, { onClose: () => setShortcutsOpen(false) }) }),
|
|
11541
|
+
newDocumentDialogOpen && /* @__PURE__ */ jsx19(
|
|
11436
11542
|
NewDocumentDialog,
|
|
11437
11543
|
{
|
|
11438
11544
|
initialFormat: defaultNewFileFormat,
|
|
@@ -11442,8 +11548,8 @@ function DocBlocksShell({
|
|
|
11442
11548
|
}
|
|
11443
11549
|
}
|
|
11444
11550
|
),
|
|
11445
|
-
workspaceStartupError && /* @__PURE__ */
|
|
11446
|
-
saveToast && /* @__PURE__ */
|
|
11551
|
+
workspaceStartupError && /* @__PURE__ */ jsx19("div", { className: "db-save-toast db-save-toast--error", role: "alert", "aria-live": "assertive", children: workspaceStartupError }),
|
|
11552
|
+
saveToast && /* @__PURE__ */ jsx19(
|
|
11447
11553
|
"div",
|
|
11448
11554
|
{
|
|
11449
11555
|
className: "db-save-toast db-save-toast--" + saveToast.kind,
|
|
@@ -11452,12 +11558,12 @@ function DocBlocksShell({
|
|
|
11452
11558
|
children: saveToast.message
|
|
11453
11559
|
}
|
|
11454
11560
|
),
|
|
11455
|
-
offlineReadyToast && !saveToast && /* @__PURE__ */
|
|
11456
|
-
documentSnapshot.conflict && /* @__PURE__ */
|
|
11457
|
-
/* @__PURE__ */
|
|
11458
|
-
/* @__PURE__ */
|
|
11561
|
+
offlineReadyToast && !saveToast && /* @__PURE__ */ jsx19("div", { className: "db-save-toast db-save-toast--success", role: "status", "aria-live": "polite", children: "DocBlocks is ready to work offline." }),
|
|
11562
|
+
documentSnapshot.conflict && /* @__PURE__ */ jsxs17("div", { className: "db-document-conflict", role: "alert", children: [
|
|
11563
|
+
/* @__PURE__ */ jsx19("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." }),
|
|
11564
|
+
/* @__PURE__ */ jsx19("div", { className: "db-document-conflict-actions", children: /* @__PURE__ */ jsx19("button", { type: "button", onClick: () => setShowConflictComparison(true), children: "Compare versions" }) })
|
|
11459
11565
|
] }),
|
|
11460
|
-
documentSnapshot.conflict && showConflictComparison && /* @__PURE__ */
|
|
11566
|
+
documentSnapshot.conflict && showConflictComparison && /* @__PURE__ */ jsx19(Suspense2, { fallback: /* @__PURE__ */ jsx19("div", { role: "status", children: "Loading version comparison\u2026" }), children: /* @__PURE__ */ jsx19(
|
|
11461
11567
|
DocumentConflictDialog,
|
|
11462
11568
|
{
|
|
11463
11569
|
conflict: documentSnapshot.conflict,
|
|
@@ -11467,14 +11573,14 @@ function DocBlocksShell({
|
|
|
11467
11573
|
onClose: () => setShowConflictComparison(false)
|
|
11468
11574
|
}
|
|
11469
11575
|
) }),
|
|
11470
|
-
storageFull && !documentSnapshot.conflict && /* @__PURE__ */
|
|
11471
|
-
/* @__PURE__ */
|
|
11472
|
-
/* @__PURE__ */
|
|
11473
|
-
/* @__PURE__ */
|
|
11474
|
-
/* @__PURE__ */
|
|
11576
|
+
storageFull && !documentSnapshot.conflict && /* @__PURE__ */ jsxs17("div", { className: "db-storage-full-banner", role: "alert", children: [
|
|
11577
|
+
/* @__PURE__ */ jsx19("span", { children: "Browser storage is full -- changes can\u2019t be saved. Free up space or back up your work now." }),
|
|
11578
|
+
/* @__PURE__ */ jsxs17("div", { className: "db-storage-full-banner-actions", children: [
|
|
11579
|
+
/* @__PURE__ */ jsx19("button", { type: "button", onClick: () => void handleDownloadAllWorkspaces(), children: "Back up all workspaces" }),
|
|
11580
|
+
/* @__PURE__ */ jsx19("button", { type: "button", onClick: () => setStorageFull(false), children: "Dismiss" })
|
|
11475
11581
|
] })
|
|
11476
11582
|
] }),
|
|
11477
|
-
workspaceSettingsOpen && activeWorkspaceDescriptor && /* @__PURE__ */
|
|
11583
|
+
workspaceSettingsOpen && activeWorkspaceDescriptor && /* @__PURE__ */ jsx19(
|
|
11478
11584
|
WorkspaceSettingsDialog,
|
|
11479
11585
|
{
|
|
11480
11586
|
workspace: activeWorkspaceDescriptor,
|
|
@@ -11487,8 +11593,8 @@ function DocBlocksShell({
|
|
|
11487
11593
|
onClose: () => setWorkspaceSettingsOpen(false)
|
|
11488
11594
|
}
|
|
11489
11595
|
),
|
|
11490
|
-
/* @__PURE__ */
|
|
11491
|
-
/* @__PURE__ */
|
|
11596
|
+
/* @__PURE__ */ jsxs17("div", { className: "db-shell-panes", ref: panesRef, children: [
|
|
11597
|
+
/* @__PURE__ */ jsxs17(
|
|
11492
11598
|
"aside",
|
|
11493
11599
|
{
|
|
11494
11600
|
ref: sidebarRef,
|
|
@@ -11496,8 +11602,8 @@ function DocBlocksShell({
|
|
|
11496
11602
|
"aria-label": "Workspace and files",
|
|
11497
11603
|
style: singlePane ? void 0 : { width: `${sidebarWidth}px` },
|
|
11498
11604
|
children: [
|
|
11499
|
-
/* @__PURE__ */
|
|
11500
|
-
/* @__PURE__ */
|
|
11605
|
+
/* @__PURE__ */ jsxs17("div", { className: "db-shell-sidebar-header", children: [
|
|
11606
|
+
/* @__PURE__ */ jsx19(
|
|
11501
11607
|
AppMenu,
|
|
11502
11608
|
{
|
|
11503
11609
|
logoUrl,
|
|
@@ -11529,10 +11635,11 @@ function DocBlocksShell({
|
|
|
11529
11635
|
appBuildDate,
|
|
11530
11636
|
ai,
|
|
11531
11637
|
speech,
|
|
11638
|
+
tray: trayMenu,
|
|
11532
11639
|
settingsRequest
|
|
11533
11640
|
}
|
|
11534
11641
|
),
|
|
11535
|
-
/* @__PURE__ */
|
|
11642
|
+
/* @__PURE__ */ jsx19(
|
|
11536
11643
|
"input",
|
|
11537
11644
|
{
|
|
11538
11645
|
ref: restoreInputRef,
|
|
@@ -11547,7 +11654,7 @@ function DocBlocksShell({
|
|
|
11547
11654
|
}
|
|
11548
11655
|
}
|
|
11549
11656
|
),
|
|
11550
|
-
/* @__PURE__ */
|
|
11657
|
+
/* @__PURE__ */ jsx19(
|
|
11551
11658
|
WorkspacePicker,
|
|
11552
11659
|
{
|
|
11553
11660
|
activeWorkspaceId,
|
|
@@ -11559,7 +11666,7 @@ function DocBlocksShell({
|
|
|
11559
11666
|
onRemoveWorkspace: (workspace) => void handleRemoveWorkspace(workspace.id)
|
|
11560
11667
|
}
|
|
11561
11668
|
),
|
|
11562
|
-
/* @__PURE__ */
|
|
11669
|
+
/* @__PURE__ */ jsx19(
|
|
11563
11670
|
WorkspaceSettingsButton,
|
|
11564
11671
|
{
|
|
11565
11672
|
onSettings: handleOpenWorkspaceSettings,
|
|
@@ -11570,26 +11677,26 @@ function DocBlocksShell({
|
|
|
11570
11677
|
}
|
|
11571
11678
|
}
|
|
11572
11679
|
),
|
|
11573
|
-
canRestoreSplitView && /* @__PURE__ */
|
|
11680
|
+
canRestoreSplitView && /* @__PURE__ */ jsx19(
|
|
11574
11681
|
"button",
|
|
11575
11682
|
{
|
|
11576
11683
|
className: "db-restore-split",
|
|
11577
11684
|
onClick: () => updateSidebarPreference("pinned"),
|
|
11578
11685
|
"aria-label": "Restore split view",
|
|
11579
11686
|
title: "Restore split view",
|
|
11580
|
-
children: /* @__PURE__ */
|
|
11687
|
+
children: /* @__PURE__ */ jsx19(SplitViewIcon, {})
|
|
11581
11688
|
}
|
|
11582
11689
|
),
|
|
11583
|
-
/* @__PURE__ */
|
|
11690
|
+
/* @__PURE__ */ jsx19("span", { className: "db-window-drag-grip", "aria-hidden": true })
|
|
11584
11691
|
] }),
|
|
11585
|
-
git.available && /* @__PURE__ */
|
|
11692
|
+
git.available && /* @__PURE__ */ jsx19(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx19(
|
|
11586
11693
|
GitUI,
|
|
11587
11694
|
{
|
|
11588
11695
|
onOpenFile: (path) => void handleSelect(path, "file"),
|
|
11589
11696
|
onWorkspaceCloned: handleWorkspaceCloned
|
|
11590
11697
|
}
|
|
11591
11698
|
) }),
|
|
11592
|
-
/* @__PURE__ */
|
|
11699
|
+
/* @__PURE__ */ jsx19(
|
|
11593
11700
|
FileExplorer,
|
|
11594
11701
|
{
|
|
11595
11702
|
loading: workspaceStarting,
|
|
@@ -11624,7 +11731,7 @@ function DocBlocksShell({
|
|
|
11624
11731
|
},
|
|
11625
11732
|
explorerKey
|
|
11626
11733
|
),
|
|
11627
|
-
searchMounted && /* @__PURE__ */
|
|
11734
|
+
searchMounted && /* @__PURE__ */ jsx19(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx19(
|
|
11628
11735
|
WorkspaceSearchPanel,
|
|
11629
11736
|
{
|
|
11630
11737
|
index: workspaceIndex.index,
|
|
@@ -11635,17 +11742,17 @@ function DocBlocksShell({
|
|
|
11635
11742
|
onShowFiles: () => setSidebarView("files")
|
|
11636
11743
|
}
|
|
11637
11744
|
) }),
|
|
11638
|
-
singlePane && showWelcomeGateway && /* @__PURE__ */
|
|
11639
|
-
/* @__PURE__ */
|
|
11640
|
-
/* @__PURE__ */
|
|
11641
|
-
/* @__PURE__ */
|
|
11745
|
+
singlePane && showWelcomeGateway && /* @__PURE__ */ jsxs17("section", { className: "db-mobile-first-run", "aria-labelledby": "db-mobile-first-run-title", children: [
|
|
11746
|
+
/* @__PURE__ */ jsx19("p", { className: "db-mobile-first-run-eyebrow", children: "Local-first Markdown editor" }),
|
|
11747
|
+
/* @__PURE__ */ jsx19("h1", { id: "db-mobile-first-run-title", children: "Welcome to DocBlocks" }),
|
|
11748
|
+
/* @__PURE__ */ jsxs17("p", { children: [
|
|
11642
11749
|
WELCOME_SUMMARY,
|
|
11643
11750
|
" ",
|
|
11644
11751
|
WELCOME_PRIVACY_NOTE
|
|
11645
11752
|
] }),
|
|
11646
|
-
/* @__PURE__ */
|
|
11647
|
-
/* @__PURE__ */
|
|
11648
|
-
/* @__PURE__ */
|
|
11753
|
+
/* @__PURE__ */ jsxs17("div", { className: "db-mobile-first-run-actions", children: [
|
|
11754
|
+
/* @__PURE__ */ jsx19("button", { type: "button", onClick: () => void handleNewFile(), children: "Create a document" }),
|
|
11755
|
+
/* @__PURE__ */ jsx19(
|
|
11649
11756
|
"button",
|
|
11650
11757
|
{
|
|
11651
11758
|
type: "button",
|
|
@@ -11659,14 +11766,14 @@ function DocBlocksShell({
|
|
|
11659
11766
|
)
|
|
11660
11767
|
] })
|
|
11661
11768
|
] }),
|
|
11662
|
-
git.available && git.pendingGrant && /* @__PURE__ */
|
|
11663
|
-
/* @__PURE__ */
|
|
11664
|
-
/* @__PURE__ */
|
|
11665
|
-
/* @__PURE__ */
|
|
11666
|
-
/* @__PURE__ */
|
|
11667
|
-
/* @__PURE__ */
|
|
11668
|
-
/* @__PURE__ */
|
|
11669
|
-
showBrowserStorageWarning && /* @__PURE__ */
|
|
11769
|
+
git.available && git.pendingGrant && /* @__PURE__ */ jsx19(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx19(GitGrantNotice, {}) }),
|
|
11770
|
+
/* @__PURE__ */ jsxs17("div", { className: "db-shell-sidebar-footer", children: [
|
|
11771
|
+
/* @__PURE__ */ jsx19("a", { href: "https://docblocks.com/docs/", target: "_blank", rel: "noopener noreferrer", children: "Docs" }),
|
|
11772
|
+
/* @__PURE__ */ jsx19("span", { className: "db-shell-sidebar-footer-separator", "aria-hidden": "true", children: "\u2022" }),
|
|
11773
|
+
/* @__PURE__ */ jsx19("a", { href: "https://docblocks.com/terms/", target: "_blank", rel: "noopener noreferrer", children: "Terms" }),
|
|
11774
|
+
/* @__PURE__ */ jsx19("span", { className: "db-shell-sidebar-footer-separator", "aria-hidden": "true", children: "\u2022" }),
|
|
11775
|
+
/* @__PURE__ */ jsx19("a", { href: issueReportUrl, target: "_blank", rel: "noopener noreferrer", children: "Report issue" }),
|
|
11776
|
+
showBrowserStorageWarning && /* @__PURE__ */ jsx19(Fragment11, { children: /* @__PURE__ */ jsxs17(
|
|
11670
11777
|
"button",
|
|
11671
11778
|
{
|
|
11672
11779
|
type: "button",
|
|
@@ -11675,20 +11782,20 @@ function DocBlocksShell({
|
|
|
11675
11782
|
"aria-label": "Back up all workspaces",
|
|
11676
11783
|
title: "Browsers can clear site data. Download a backup of every workspace.",
|
|
11677
11784
|
children: [
|
|
11678
|
-
/* @__PURE__ */
|
|
11785
|
+
/* @__PURE__ */ jsx19(BackupIcon, {}),
|
|
11679
11786
|
"Back up"
|
|
11680
11787
|
]
|
|
11681
11788
|
}
|
|
11682
11789
|
) })
|
|
11683
11790
|
] }),
|
|
11684
|
-
/* @__PURE__ */
|
|
11685
|
-
/* @__PURE__ */
|
|
11686
|
-
/* @__PURE__ */
|
|
11791
|
+
/* @__PURE__ */ jsxs17("div", { className: "db-sidebar-collapse-preview", "aria-hidden": "true", children: [
|
|
11792
|
+
/* @__PURE__ */ jsx19("span", { className: "db-sidebar-collapse-preview-icon", children: /* @__PURE__ */ jsx19(CollapseSidebarGlyph, {}) }),
|
|
11793
|
+
/* @__PURE__ */ jsx19("span", { className: "db-sidebar-collapse-preview-label", children: "Release to hide files" })
|
|
11687
11794
|
] })
|
|
11688
11795
|
]
|
|
11689
11796
|
}
|
|
11690
11797
|
),
|
|
11691
|
-
!singlePane && /* @__PURE__ */
|
|
11798
|
+
!singlePane && /* @__PURE__ */ jsx19(
|
|
11692
11799
|
"div",
|
|
11693
11800
|
{
|
|
11694
11801
|
className: "db-shell-sidebar-resizer",
|
|
@@ -11698,7 +11805,7 @@ function DocBlocksShell({
|
|
|
11698
11805
|
onPointerDown: handleResizerPointerDown
|
|
11699
11806
|
}
|
|
11700
11807
|
),
|
|
11701
|
-
singlePane && /* @__PURE__ */
|
|
11808
|
+
singlePane && /* @__PURE__ */ jsx19(
|
|
11702
11809
|
"div",
|
|
11703
11810
|
{
|
|
11704
11811
|
className: "db-shell-scrim",
|
|
@@ -11706,7 +11813,7 @@ function DocBlocksShell({
|
|
|
11706
11813
|
onPointerDown: () => setMobileShowEditor(true)
|
|
11707
11814
|
}
|
|
11708
11815
|
),
|
|
11709
|
-
/* @__PURE__ */
|
|
11816
|
+
/* @__PURE__ */ jsxs17(
|
|
11710
11817
|
"main",
|
|
11711
11818
|
{
|
|
11712
11819
|
ref: editorAreaRef,
|
|
@@ -11717,8 +11824,8 @@ function DocBlocksShell({
|
|
|
11717
11824
|
editorDropActive ? "db-shell-editor-area--drop-active" : ""
|
|
11718
11825
|
].filter(Boolean).join(" "),
|
|
11719
11826
|
children: [
|
|
11720
|
-
/* @__PURE__ */
|
|
11721
|
-
selectedFile && mediaProvider ? /* @__PURE__ */
|
|
11827
|
+
/* @__PURE__ */ jsxs17("div", { ref: welcomeCoveredRef, className: "db-shell-editor-content", children: [
|
|
11828
|
+
selectedFile && mediaProvider ? /* @__PURE__ */ jsx19(Fragment11, { children: selectedManagedOutput === "catalog-html" ? /* @__PURE__ */ jsx19(
|
|
11722
11829
|
GeneratedCatalogPage,
|
|
11723
11830
|
{
|
|
11724
11831
|
html: editorContent,
|
|
@@ -11726,17 +11833,17 @@ function DocBlocksShell({
|
|
|
11726
11833
|
onOpenSettings: activeWorkspaceDescriptor ? handleOpenWorkspaceSettings : void 0,
|
|
11727
11834
|
onBack: singlePane ? openDrawer : void 0
|
|
11728
11835
|
}
|
|
11729
|
-
) : /* @__PURE__ */
|
|
11836
|
+
) : /* @__PURE__ */ jsx19(
|
|
11730
11837
|
GeneratedFileFrame,
|
|
11731
11838
|
{
|
|
11732
11839
|
kind: selectedManagedOutput,
|
|
11733
11840
|
onOpenSettings: activeWorkspaceDescriptor ? handleOpenWorkspaceSettings : void 0,
|
|
11734
11841
|
onBack: singlePane ? openDrawer : void 0,
|
|
11735
|
-
children: /* @__PURE__ */
|
|
11842
|
+
children: /* @__PURE__ */ jsx19(
|
|
11736
11843
|
Suspense2,
|
|
11737
11844
|
{
|
|
11738
|
-
fallback: /* @__PURE__ */
|
|
11739
|
-
children: editorGenerationSettled && mediaProviderCurrent && /* @__PURE__ */
|
|
11845
|
+
fallback: /* @__PURE__ */ jsx19("div", { className: "db-shell-empty", role: "status", children: "Loading your document\u2026" }),
|
|
11846
|
+
children: editorGenerationSettled && mediaProviderCurrent && /* @__PURE__ */ jsx19(EditorErrorBoundary, { resetKey: `${selectedFile}-${editorKey}`, children: /* @__PURE__ */ jsx19(
|
|
11740
11847
|
EditorShell,
|
|
11741
11848
|
{
|
|
11742
11849
|
initialMarkdown: editorContent,
|
|
@@ -11787,19 +11894,19 @@ function DocBlocksShell({
|
|
|
11787
11894
|
versioningAutoSaveIdleMs,
|
|
11788
11895
|
onSaveVersion,
|
|
11789
11896
|
statusBarSlotRight,
|
|
11790
|
-
sidePanelSlot: ai && aiPanel && selectedImage === void 0 && (selectedOutsideIn === null || selectedOutsideInEditingEnabled) ? /* @__PURE__ */
|
|
11791
|
-
toolbarSlotLeft: singlePane ? /* @__PURE__ */
|
|
11897
|
+
sidePanelSlot: ai && aiPanel && selectedImage === void 0 && (selectedOutsideIn === null || selectedOutsideInEditingEnabled) ? /* @__PURE__ */ jsx19(Suspense2, { fallback: null, children: aiPanel === "review" ? /* @__PURE__ */ jsx19(AiReviewPanel, { ai, onClose: () => setAiPanel(null) }) : /* @__PURE__ */ jsx19(AiIllustratePanel, { ai, onClose: () => setAiPanel(null) }) }) : void 0,
|
|
11898
|
+
toolbarSlotLeft: singlePane ? /* @__PURE__ */ jsx19(
|
|
11792
11899
|
"button",
|
|
11793
11900
|
{
|
|
11794
11901
|
className: "db-mobile-back",
|
|
11795
11902
|
onClick: () => setMobileShowEditor(false),
|
|
11796
11903
|
"aria-label": "Show file list",
|
|
11797
|
-
children: /* @__PURE__ */
|
|
11904
|
+
children: /* @__PURE__ */ jsx19("span", { className: "db-mobile-files-icon", children: /* @__PURE__ */ jsx19(FolderGlyph, {}) })
|
|
11798
11905
|
}
|
|
11799
11906
|
) : void 0,
|
|
11800
|
-
summarizationDesigner: selectedImage === void 0 && selectedManagedOutput === void 0 && (selectedOutsideIn === null || selectedOutsideInEditingEnabled) ? (onClose) => /* @__PURE__ */
|
|
11801
|
-
toolbarSlotRight: /* @__PURE__ */
|
|
11802
|
-
canFind && /* @__PURE__ */
|
|
11907
|
+
summarizationDesigner: selectedImage === void 0 && selectedManagedOutput === void 0 && (selectedOutsideIn === null || selectedOutsideInEditingEnabled) ? (onClose) => /* @__PURE__ */ jsx19(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx19(PresentationMaker, { ai: ai ?? void 0, onClose }) }) : void 0,
|
|
11908
|
+
toolbarSlotRight: /* @__PURE__ */ jsxs17(Fragment11, { children: [
|
|
11909
|
+
canFind && /* @__PURE__ */ jsx19(
|
|
11803
11910
|
FindButton,
|
|
11804
11911
|
{
|
|
11805
11912
|
active: findMode,
|
|
@@ -11807,7 +11914,7 @@ function DocBlocksShell({
|
|
|
11807
11914
|
shortcutLabel: findShortcut
|
|
11808
11915
|
}
|
|
11809
11916
|
),
|
|
11810
|
-
ai && /* @__PURE__ */
|
|
11917
|
+
ai && /* @__PURE__ */ jsx19(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx19(
|
|
11811
11918
|
AiToolbarControl,
|
|
11812
11919
|
{
|
|
11813
11920
|
ai,
|
|
@@ -11816,8 +11923,8 @@ function DocBlocksShell({
|
|
|
11816
11923
|
onOpenPanel: setAiPanel
|
|
11817
11924
|
}
|
|
11818
11925
|
) }),
|
|
11819
|
-
speech && /* @__PURE__ */
|
|
11820
|
-
/* @__PURE__ */
|
|
11926
|
+
speech && /* @__PURE__ */ jsxs17(Suspense2, { fallback: null, children: [
|
|
11927
|
+
/* @__PURE__ */ jsx19(
|
|
11821
11928
|
TextFromNarration,
|
|
11822
11929
|
{
|
|
11823
11930
|
speech,
|
|
@@ -11827,27 +11934,27 @@ function DocBlocksShell({
|
|
|
11827
11934
|
onOpenSettings: openSettings
|
|
11828
11935
|
}
|
|
11829
11936
|
),
|
|
11830
|
-
hostSupports2("speechOutput") ? /* @__PURE__ */
|
|
11937
|
+
hostSupports2("speechOutput") ? /* @__PURE__ */ jsx19(
|
|
11831
11938
|
SpeechToolbarControl,
|
|
11832
11939
|
{
|
|
11833
11940
|
speech,
|
|
11834
11941
|
onOpenSettings: openSettings,
|
|
11835
11942
|
readOnly: selectedImage !== void 0 || selectedOutsideIn !== null && !selectedOutsideInEditingEnabled
|
|
11836
11943
|
}
|
|
11837
|
-
) : /* @__PURE__ */
|
|
11944
|
+
) : /* @__PURE__ */ jsx19(SpeechMenuBridge, {})
|
|
11838
11945
|
] }),
|
|
11839
|
-
canRestoreSplitView && /* @__PURE__ */
|
|
11946
|
+
canRestoreSplitView && /* @__PURE__ */ jsx19(
|
|
11840
11947
|
"button",
|
|
11841
11948
|
{
|
|
11842
11949
|
className: "db-restore-split",
|
|
11843
11950
|
onClick: () => updateSidebarPreference("pinned"),
|
|
11844
11951
|
"aria-label": "Restore split view",
|
|
11845
11952
|
title: "Restore split view",
|
|
11846
|
-
children: /* @__PURE__ */
|
|
11953
|
+
children: /* @__PURE__ */ jsx19(SplitViewIcon, {})
|
|
11847
11954
|
}
|
|
11848
11955
|
),
|
|
11849
|
-
git.repo && /* @__PURE__ */
|
|
11850
|
-
/* @__PURE__ */
|
|
11956
|
+
git.repo && /* @__PURE__ */ jsx19(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx19(GitToolbarControl, { selectedFile }) }),
|
|
11957
|
+
/* @__PURE__ */ jsx19(
|
|
11851
11958
|
ExportToolbarControls,
|
|
11852
11959
|
{
|
|
11853
11960
|
selectedFile,
|
|
@@ -11871,39 +11978,39 @@ function DocBlocksShell({
|
|
|
11871
11978
|
}
|
|
11872
11979
|
)
|
|
11873
11980
|
}
|
|
11874
|
-
) }) : selectedFolder ? /* @__PURE__ */
|
|
11875
|
-
singlePane && /* @__PURE__ */
|
|
11876
|
-
/* @__PURE__ */
|
|
11981
|
+
) }) : selectedFolder ? /* @__PURE__ */ jsxs17("div", { className: "db-folder-view", children: [
|
|
11982
|
+
singlePane && /* @__PURE__ */ jsxs17("button", { className: "db-mobile-back", onClick: () => setMobileShowEditor(false), children: [
|
|
11983
|
+
/* @__PURE__ */ jsx19("span", { className: "db-mobile-files-icon", children: /* @__PURE__ */ jsx19(FolderGlyph, {}) }),
|
|
11877
11984
|
"Back to files"
|
|
11878
11985
|
] }),
|
|
11879
|
-
/* @__PURE__ */
|
|
11880
|
-
/* @__PURE__ */
|
|
11881
|
-
/* @__PURE__ */
|
|
11986
|
+
/* @__PURE__ */ jsxs17("div", { className: "db-folder-view-header", children: [
|
|
11987
|
+
/* @__PURE__ */ jsx19("span", { className: "db-folder-view-icon", children: /* @__PURE__ */ jsx19(FolderGlyph, {}) }),
|
|
11988
|
+
/* @__PURE__ */ jsx19("span", { className: "db-folder-view-path", children: selectedFolder })
|
|
11882
11989
|
] }),
|
|
11883
|
-
visibleFolderEntries.length === 0 ? /* @__PURE__ */
|
|
11990
|
+
visibleFolderEntries.length === 0 ? /* @__PURE__ */ jsx19("p", { className: "db-folder-view-empty", children: "This folder is empty." }) : /* @__PURE__ */ jsx19("ul", { className: "db-folder-view-list", children: visibleFolderEntries.map((entry) => /* @__PURE__ */ jsxs17(
|
|
11884
11991
|
"li",
|
|
11885
11992
|
{
|
|
11886
11993
|
className: "db-folder-view-item",
|
|
11887
11994
|
onClick: () => handleSelect(entry.path, entry.kind),
|
|
11888
11995
|
children: [
|
|
11889
|
-
/* @__PURE__ */
|
|
11996
|
+
/* @__PURE__ */ jsx19("span", { className: "db-folder-view-item-icon", children: entry.kind === "directory" ? /* @__PURE__ */ jsx19(FolderGlyph, {}) : /* @__PURE__ */ jsx19(FileGlyph, {}) }),
|
|
11890
11997
|
entry.name
|
|
11891
11998
|
]
|
|
11892
11999
|
},
|
|
11893
12000
|
entry.path
|
|
11894
12001
|
)) })
|
|
11895
|
-
] }) : /* @__PURE__ */
|
|
11896
|
-
singlePane && /* @__PURE__ */
|
|
11897
|
-
/* @__PURE__ */
|
|
12002
|
+
] }) : /* @__PURE__ */ jsxs17("div", { className: "db-shell-empty db-shell-empty--workspace", children: [
|
|
12003
|
+
singlePane && /* @__PURE__ */ jsxs17("button", { className: "db-mobile-back", onClick: () => setMobileShowEditor(false), children: [
|
|
12004
|
+
/* @__PURE__ */ jsx19("span", { className: "db-mobile-files-icon", children: /* @__PURE__ */ jsx19(FolderGlyph, {}) }),
|
|
11898
12005
|
"Back to files"
|
|
11899
12006
|
] }),
|
|
11900
|
-
/* @__PURE__ */
|
|
11901
|
-
/* @__PURE__ */
|
|
11902
|
-
/* @__PURE__ */
|
|
11903
|
-
/* @__PURE__ */
|
|
11904
|
-
/* @__PURE__ */
|
|
11905
|
-
/* @__PURE__ */
|
|
11906
|
-
/* @__PURE__ */
|
|
12007
|
+
/* @__PURE__ */ jsxs17("div", { className: "db-workspace-empty-content", children: [
|
|
12008
|
+
/* @__PURE__ */ jsx19("span", { className: "db-workspace-empty-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx19(FileGlyph, {}) }),
|
|
12009
|
+
/* @__PURE__ */ jsx19("h1", { children: activeWorkspaceDescriptor?.name ?? "Workspace" }),
|
|
12010
|
+
/* @__PURE__ */ jsx19("p", { children: "Choose a Markdown document from the sidebar, or create a new one." }),
|
|
12011
|
+
/* @__PURE__ */ jsxs17("div", { className: "db-workspace-empty-actions", children: [
|
|
12012
|
+
/* @__PURE__ */ jsx19("button", { type: "button", onClick: () => void handleNewFile(), children: "New document" }),
|
|
12013
|
+
/* @__PURE__ */ jsx19(
|
|
11907
12014
|
"button",
|
|
11908
12015
|
{
|
|
11909
12016
|
type: "button",
|
|
@@ -11912,7 +12019,7 @@ function DocBlocksShell({
|
|
|
11912
12019
|
children: "New folder"
|
|
11913
12020
|
}
|
|
11914
12021
|
),
|
|
11915
|
-
(hostSupports2("workspaceFolderPicker") || typeof globalThis.showDirectoryPicker === "function") && /* @__PURE__ */
|
|
12022
|
+
(hostSupports2("workspaceFolderPicker") || typeof globalThis.showDirectoryPicker === "function") && /* @__PURE__ */ jsx19(
|
|
11916
12023
|
"button",
|
|
11917
12024
|
{
|
|
11918
12025
|
type: "button",
|
|
@@ -11922,10 +12029,10 @@ function DocBlocksShell({
|
|
|
11922
12029
|
}
|
|
11923
12030
|
)
|
|
11924
12031
|
] }),
|
|
11925
|
-
/* @__PURE__ */
|
|
12032
|
+
showBrowserStorageWarning && /* @__PURE__ */ jsx19("p", { className: "db-workspace-empty-hint", children: "Use the sidebar backup action to keep a portable copy of this workspace." })
|
|
11926
12033
|
] })
|
|
11927
12034
|
] }),
|
|
11928
|
-
/* @__PURE__ */
|
|
12035
|
+
/* @__PURE__ */ jsx19(
|
|
11929
12036
|
UpdateAvailableNotice,
|
|
11930
12037
|
{
|
|
11931
12038
|
available: updateAvailable,
|
|
@@ -11935,7 +12042,7 @@ function DocBlocksShell({
|
|
|
11935
12042
|
}
|
|
11936
12043
|
)
|
|
11937
12044
|
] }),
|
|
11938
|
-
welcomeScreenShown && /* @__PURE__ */
|
|
12045
|
+
welcomeScreenShown && /* @__PURE__ */ jsx19(
|
|
11939
12046
|
WelcomeScreen,
|
|
11940
12047
|
{
|
|
11941
12048
|
onCreateDocument: handleNewFile,
|