@bendyline/docblocks-react 1.1.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -5
- package/dist/ExportDialog-7LDIXJZ3.js +10 -0
- package/dist/ExportDialog-7LDIXJZ3.js.map +1 -0
- package/dist/ExportToolbarControls-GHAOJMH6.js +508 -0
- package/dist/ExportToolbarControls-GHAOJMH6.js.map +1 -0
- package/dist/GitToolbarControl-GNMRVKWQ.js +136 -0
- package/dist/GitToolbarControl-GNMRVKWQ.js.map +1 -0
- package/dist/GitUI-VHOBQY43.js +1133 -0
- package/dist/GitUI-VHOBQY43.js.map +1 -0
- package/dist/LazyEditorShell-EF2BWRXU.js +6 -0
- package/dist/LazyEditorShell-EF2BWRXU.js.map +1 -0
- package/dist/ShareDialog-63ENBEDZ.js +213 -0
- package/dist/ShareDialog-63ENBEDZ.js.map +1 -0
- package/dist/chunk-4XXSWN3T.js +13 -0
- package/dist/chunk-4XXSWN3T.js.map +1 -0
- package/dist/chunk-57ZJJOC5.js +89 -0
- package/dist/chunk-57ZJJOC5.js.map +1 -0
- package/dist/chunk-5A4KEWKT.js +97 -0
- package/dist/chunk-5A4KEWKT.js.map +1 -0
- package/dist/chunk-DD4VFJQI.js +51 -0
- package/dist/chunk-DD4VFJQI.js.map +1 -0
- package/dist/chunk-FEWQUQML.js +256 -0
- package/dist/chunk-FEWQUQML.js.map +1 -0
- package/dist/chunk-FMGTHSTX.js +110 -0
- package/dist/chunk-FMGTHSTX.js.map +1 -0
- package/dist/chunk-UNYZQXWR.js +324 -0
- package/dist/chunk-UNYZQXWR.js.map +1 -0
- package/dist/chunk-VHDP4IPL.js +70 -0
- package/dist/chunk-VHDP4IPL.js.map +1 -0
- package/dist/chunk-ZI56BNB7.js +270 -0
- package/dist/chunk-ZI56BNB7.js.map +1 -0
- package/dist/editor.d.ts +11 -0
- package/dist/editor.js +9 -0
- package/dist/editor.js.map +1 -0
- package/dist/export/index.d.ts +93 -0
- package/dist/export/index.js +27 -0
- package/dist/export/index.js.map +1 -0
- package/dist/index.d.ts +346 -18
- package/dist/index.js +6169 -18
- package/dist/index.js.map +1 -1
- package/dist/run-export-ICTZITXC.js +10 -0
- package/dist/run-export-ICTZITXC.js.map +1 -0
- package/dist/settings/index.d.ts +36 -0
- package/dist/settings/index.js +14 -0
- package/dist/settings/index.js.map +1 -0
- package/package.json +33 -13
- package/src/styles/docblocks.css +2738 -132
- package/dist/AppMenu/AppMenu.d.ts +0 -26
- package/dist/AppMenu/AppMenu.d.ts.map +0 -1
- package/dist/AppMenu/AppMenu.js +0 -28
- package/dist/AppMenu/AppMenu.js.map +0 -1
- package/dist/AppMenu/index.d.ts +0 -3
- package/dist/AppMenu/index.d.ts.map +0 -1
- package/dist/AppMenu/index.js +0 -2
- package/dist/AppMenu/index.js.map +0 -1
- package/dist/DocBlocksShell/DocBlocksShell.d.ts +0 -36
- package/dist/DocBlocksShell/DocBlocksShell.d.ts.map +0 -1
- package/dist/DocBlocksShell/DocBlocksShell.js +0 -1351
- package/dist/DocBlocksShell/DocBlocksShell.js.map +0 -1
- package/dist/DocBlocksShell/index.d.ts +0 -3
- package/dist/DocBlocksShell/index.d.ts.map +0 -1
- package/dist/DocBlocksShell/index.js +0 -2
- package/dist/DocBlocksShell/index.js.map +0 -1
- package/dist/Export/ExportDialog.d.ts +0 -16
- package/dist/Export/ExportDialog.d.ts.map +0 -1
- package/dist/Export/ExportDialog.js +0 -158
- package/dist/Export/ExportDialog.js.map +0 -1
- package/dist/Export/ExportToolbarControls.d.ts +0 -17
- package/dist/Export/ExportToolbarControls.d.ts.map +0 -1
- package/dist/Export/ExportToolbarControls.js +0 -200
- package/dist/Export/ExportToolbarControls.js.map +0 -1
- package/dist/Export/export-options.d.ts +0 -53
- package/dist/Export/export-options.d.ts.map +0 -1
- package/dist/Export/export-options.js +0 -49
- package/dist/Export/export-options.js.map +0 -1
- package/dist/Export/index.d.ts +0 -6
- package/dist/Export/index.d.ts.map +0 -1
- package/dist/Export/index.js +0 -3
- package/dist/Export/index.js.map +0 -1
- package/dist/Export/run-export.d.ts +0 -8
- package/dist/Export/run-export.d.ts.map +0 -1
- package/dist/Export/run-export.js +0 -296
- package/dist/Export/run-export.js.map +0 -1
- package/dist/Export/transform-summaries.d.ts +0 -7
- package/dist/Export/transform-summaries.d.ts.map +0 -1
- package/dist/Export/transform-summaries.js +0 -6
- package/dist/Export/transform-summaries.js.map +0 -1
- package/dist/FileExplorer/FileExplorer.d.ts +0 -21
- package/dist/FileExplorer/FileExplorer.d.ts.map +0 -1
- package/dist/FileExplorer/FileExplorer.js +0 -140
- package/dist/FileExplorer/FileExplorer.js.map +0 -1
- package/dist/FileExplorer/FileTreeNode.d.ts +0 -18
- package/dist/FileExplorer/FileTreeNode.d.ts.map +0 -1
- package/dist/FileExplorer/FileTreeNode.js +0 -112
- package/dist/FileExplorer/FileTreeNode.js.map +0 -1
- package/dist/FileExplorer/index.d.ts +0 -6
- package/dist/FileExplorer/index.d.ts.map +0 -1
- package/dist/FileExplorer/index.js +0 -4
- package/dist/FileExplorer/index.js.map +0 -1
- package/dist/FileExplorer/useFileTree.d.ts +0 -35
- package/dist/FileExplorer/useFileTree.d.ts.map +0 -1
- package/dist/FileExplorer/useFileTree.js +0 -124
- package/dist/FileExplorer/useFileTree.js.map +0 -1
- package/dist/WorkspacePicker/WorkspacePicker.d.ts +0 -17
- package/dist/WorkspacePicker/WorkspacePicker.d.ts.map +0 -1
- package/dist/WorkspacePicker/WorkspacePicker.js +0 -63
- package/dist/WorkspacePicker/WorkspacePicker.js.map +0 -1
- package/dist/WorkspacePicker/WorkspaceSettingsButton.d.ts +0 -11
- package/dist/WorkspacePicker/WorkspaceSettingsButton.d.ts.map +0 -1
- package/dist/WorkspacePicker/WorkspaceSettingsButton.js +0 -27
- package/dist/WorkspacePicker/WorkspaceSettingsButton.js.map +0 -1
- package/dist/WorkspacePicker/WorkspaceSettingsDialog.d.ts +0 -20
- package/dist/WorkspacePicker/WorkspaceSettingsDialog.d.ts.map +0 -1
- package/dist/WorkspacePicker/WorkspaceSettingsDialog.js +0 -36
- package/dist/WorkspacePicker/WorkspaceSettingsDialog.js.map +0 -1
- package/dist/WorkspacePicker/index.d.ts +0 -3
- package/dist/WorkspacePicker/index.d.ts.map +0 -1
- package/dist/WorkspacePicker/index.js +0 -2
- package/dist/WorkspacePicker/index.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js +0 -2
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/useAutoSave.d.ts +0 -15
- package/dist/hooks/useAutoSave.d.ts.map +0 -1
- package/dist/hooks/useAutoSave.js +0 -83
- package/dist/hooks/useAutoSave.js.map +0 -1
- package/dist/icons.d.ts +0 -7
- package/dist/icons.d.ts.map +0 -1
- package/dist/icons.js +0 -27
- package/dist/icons.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/monaco-slim.d.ts +0 -19
- package/dist/monaco-slim.d.ts.map +0 -1
- package/dist/monaco-slim.js +0 -19
- package/dist/monaco-slim.js.map +0 -1
- package/dist/preferences/versioning.d.ts +0 -27
- package/dist/preferences/versioning.d.ts.map +0 -1
- package/dist/preferences/versioning.js +0 -62
- package/dist/preferences/versioning.js.map +0 -1
- package/src/AppMenu/AppMenu.tsx +0 -264
- package/src/AppMenu/index.ts +0 -2
- package/src/DocBlocksShell/DocBlocksShell.tsx +0 -1778
- package/src/DocBlocksShell/index.ts +0 -2
- package/src/Export/ExportDialog.tsx +0 -383
- package/src/Export/ExportToolbarControls.tsx +0 -313
- package/src/Export/export-options.ts +0 -99
- package/src/Export/index.ts +0 -5
- package/src/Export/run-export.ts +0 -349
- package/src/Export/transform-summaries.ts +0 -14
- package/src/FileExplorer/FileExplorer.tsx +0 -282
- package/src/FileExplorer/FileTreeNode.tsx +0 -214
- package/src/FileExplorer/index.ts +0 -5
- package/src/FileExplorer/useFileTree.ts +0 -178
- package/src/WorkspacePicker/WorkspacePicker.tsx +0 -137
- package/src/WorkspacePicker/WorkspaceSettingsButton.tsx +0 -88
- package/src/WorkspacePicker/WorkspaceSettingsDialog.tsx +0 -121
- package/src/WorkspacePicker/index.ts +0 -2
- package/src/fonts/fonts.css +0 -362
- package/src/fonts/licenses/LICENSE-cormorant-garamond.txt +0 -93
- package/src/fonts/licenses/LICENSE-crimson-text.txt +0 -93
- package/src/fonts/licenses/LICENSE-dm-sans.txt +0 -93
- package/src/fonts/licenses/LICENSE-dm-serif-display.txt +0 -93
- package/src/fonts/licenses/LICENSE-hanken-grotesk.txt +0 -94
- package/src/fonts/licenses/LICENSE-ibm-plex-sans.txt +0 -93
- package/src/fonts/licenses/LICENSE-inter.txt +0 -93
- package/src/fonts/licenses/LICENSE-jetbrains-mono.txt +0 -93
- package/src/fonts/licenses/LICENSE-lora.txt +0 -93
- package/src/fonts/licenses/LICENSE-merriweather.txt +0 -93
- package/src/fonts/licenses/LICENSE-oswald.txt +0 -93
- package/src/fonts/licenses/LICENSE-playfair-display.txt +0 -93
- package/src/fonts/licenses/LICENSE-pt-serif.txt +0 -93
- package/src/fonts/licenses/LICENSE-roboto.txt +0 -93
- package/src/fonts/licenses/LICENSE-source-serif-4.txt +0 -93
- package/src/fonts/woff2/cormorant-garamond-400.woff2 +0 -0
- package/src/fonts/woff2/cormorant-garamond-700.woff2 +0 -0
- package/src/fonts/woff2/crimson-text-400.woff2 +0 -0
- package/src/fonts/woff2/crimson-text-400i.woff2 +0 -0
- package/src/fonts/woff2/crimson-text-700.woff2 +0 -0
- package/src/fonts/woff2/dm-sans-400.woff2 +0 -0
- package/src/fonts/woff2/dm-sans-400i.woff2 +0 -0
- package/src/fonts/woff2/dm-sans-500.woff2 +0 -0
- package/src/fonts/woff2/dm-sans-700.woff2 +0 -0
- package/src/fonts/woff2/dm-serif-display-400.woff2 +0 -0
- package/src/fonts/woff2/hanken-grotesk-400.woff2 +0 -0
- package/src/fonts/woff2/hanken-grotesk-400i.woff2 +0 -0
- package/src/fonts/woff2/hanken-grotesk-500.woff2 +0 -0
- package/src/fonts/woff2/hanken-grotesk-600.woff2 +0 -0
- package/src/fonts/woff2/hanken-grotesk-700.woff2 +0 -0
- package/src/fonts/woff2/ibm-plex-sans-400.woff2 +0 -0
- package/src/fonts/woff2/ibm-plex-sans-400i.woff2 +0 -0
- package/src/fonts/woff2/ibm-plex-sans-500.woff2 +0 -0
- package/src/fonts/woff2/ibm-plex-sans-600.woff2 +0 -0
- package/src/fonts/woff2/ibm-plex-sans-700.woff2 +0 -0
- package/src/fonts/woff2/inter-400.woff2 +0 -0
- package/src/fonts/woff2/inter-400i.woff2 +0 -0
- package/src/fonts/woff2/inter-500.woff2 +0 -0
- package/src/fonts/woff2/inter-600.woff2 +0 -0
- package/src/fonts/woff2/inter-700.woff2 +0 -0
- package/src/fonts/woff2/jetbrains-mono-400.woff2 +0 -0
- package/src/fonts/woff2/jetbrains-mono-400i.woff2 +0 -0
- package/src/fonts/woff2/jetbrains-mono-700.woff2 +0 -0
- package/src/fonts/woff2/lora-400.woff2 +0 -0
- package/src/fonts/woff2/lora-400i.woff2 +0 -0
- package/src/fonts/woff2/lora-700.woff2 +0 -0
- package/src/fonts/woff2/merriweather-400.woff2 +0 -0
- package/src/fonts/woff2/merriweather-700.woff2 +0 -0
- package/src/fonts/woff2/oswald-400.woff2 +0 -0
- package/src/fonts/woff2/oswald-700.woff2 +0 -0
- package/src/fonts/woff2/playfair-display-400.woff2 +0 -0
- package/src/fonts/woff2/playfair-display-700.woff2 +0 -0
- package/src/fonts/woff2/pt-serif-400.woff2 +0 -0
- package/src/fonts/woff2/pt-serif-700.woff2 +0 -0
- package/src/fonts/woff2/roboto-400.woff2 +0 -0
- package/src/fonts/woff2/roboto-400i.woff2 +0 -0
- package/src/fonts/woff2/roboto-700.woff2 +0 -0
- package/src/fonts/woff2/source-serif-4-400.woff2 +0 -0
- package/src/fonts/woff2/source-serif-4-400i.woff2 +0 -0
- package/src/fonts/woff2/source-serif-4-700.woff2 +0 -0
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useAutoSave.ts +0 -116
- package/src/icons.tsx +0 -70
- package/src/index.ts +0 -31
- package/src/monaco-slim.ts +0 -20
- package/src/preferences/versioning.ts +0 -69
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadTransformStyleSummaries
|
|
3
|
+
} from "./chunk-4XXSWN3T.js";
|
|
4
|
+
import {
|
|
5
|
+
Dialog
|
|
6
|
+
} from "./chunk-FMGTHSTX.js";
|
|
7
|
+
import {
|
|
8
|
+
FORMAT_LABELS,
|
|
9
|
+
saveExportOptions
|
|
10
|
+
} from "./chunk-DD4VFJQI.js";
|
|
11
|
+
|
|
12
|
+
// src/Export/ExportDialog.tsx
|
|
13
|
+
import { useState, useCallback, useEffect, useMemo } from "react";
|
|
14
|
+
import { getThemeSummaries } from "@bendyline/squisq/schemas";
|
|
15
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
var FORMATS = ["pdf", "docx", "pptx", "html", "md"];
|
|
17
|
+
var FORMAT_CHIP_LABELS = {
|
|
18
|
+
pdf: "PDF",
|
|
19
|
+
docx: "Word",
|
|
20
|
+
pptx: "PowerPoint",
|
|
21
|
+
html: "HTML",
|
|
22
|
+
md: "Markdown"
|
|
23
|
+
};
|
|
24
|
+
var HTML_STYLE_CHIPS = [
|
|
25
|
+
{
|
|
26
|
+
key: "plain",
|
|
27
|
+
label: "Plain",
|
|
28
|
+
hint: "A lightweight static HTML document."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: "rendered",
|
|
32
|
+
label: "Rendered",
|
|
33
|
+
hint: "Renders via SquisqPlayer with themes and playback support."
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
var HTML_BUNDLE_CHIPS = [
|
|
37
|
+
{
|
|
38
|
+
key: "single",
|
|
39
|
+
label: "Single file",
|
|
40
|
+
hint: "One .html file with images embedded as base64 data URIs."
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
key: "zip",
|
|
44
|
+
label: "ZIP archive",
|
|
45
|
+
hint: "A .zip with index.html plus separate image (and JS) files."
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
function ChipRadioGroup({
|
|
49
|
+
name,
|
|
50
|
+
value,
|
|
51
|
+
options,
|
|
52
|
+
onChange
|
|
53
|
+
}) {
|
|
54
|
+
return /* @__PURE__ */ jsx("div", { className: "db-export-chips", role: "radiogroup", "aria-label": name, children: options.map((opt) => {
|
|
55
|
+
const active = opt.key === value;
|
|
56
|
+
return /* @__PURE__ */ jsx(
|
|
57
|
+
"button",
|
|
58
|
+
{
|
|
59
|
+
type: "button",
|
|
60
|
+
role: "radio",
|
|
61
|
+
"aria-checked": active,
|
|
62
|
+
className: `db-export-chip${active ? " db-export-chip--active" : ""}`,
|
|
63
|
+
onClick: () => onChange(opt.key),
|
|
64
|
+
title: opt.title,
|
|
65
|
+
children: opt.label
|
|
66
|
+
},
|
|
67
|
+
opt.key
|
|
68
|
+
);
|
|
69
|
+
}) });
|
|
70
|
+
}
|
|
71
|
+
function ExportDialog({
|
|
72
|
+
initial,
|
|
73
|
+
exporting,
|
|
74
|
+
error,
|
|
75
|
+
destination,
|
|
76
|
+
onExport,
|
|
77
|
+
onOptionsChange,
|
|
78
|
+
onClose
|
|
79
|
+
}) {
|
|
80
|
+
const [format, setFormat] = useState(initial.format);
|
|
81
|
+
const [themeId, setThemeId] = useState(initial.themeId);
|
|
82
|
+
const [transformStyle, setTransformStyle] = useState(initial.transformStyle);
|
|
83
|
+
const [pageSize, setPageSize] = useState(initial.pageSize);
|
|
84
|
+
const [htmlStyle, setHtmlStyle] = useState(initial.htmlStyle);
|
|
85
|
+
const [htmlBundle, setHtmlBundle] = useState(initial.htmlBundle);
|
|
86
|
+
const [includeLinkedDocs, setIncludeLinkedDocs] = useState(initial.includeLinkedDocs);
|
|
87
|
+
const [entryAsIndex, setEntryAsIndex] = useState(initial.entryAsIndex);
|
|
88
|
+
const [transforms, setTransforms] = useState([]);
|
|
89
|
+
const themes = getThemeSummaries();
|
|
90
|
+
const showTheme = format === "docx" || format === "pdf" || format === "pptx" || format === "html";
|
|
91
|
+
const showTransform = format === "pptx";
|
|
92
|
+
const showPageSize = format === "pdf";
|
|
93
|
+
const showHtmlOptions = format === "html";
|
|
94
|
+
const showIncludeLinked = format === "html";
|
|
95
|
+
const showHtmlBundle = showHtmlOptions && !includeLinkedDocs;
|
|
96
|
+
const showEntryAsIndex = showHtmlOptions && (htmlBundle === "single" || includeLinkedDocs);
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (!showTransform) return;
|
|
99
|
+
let cancelled = false;
|
|
100
|
+
loadTransformStyleSummaries().then((nextTransforms) => {
|
|
101
|
+
if (!cancelled) setTransforms(nextTransforms);
|
|
102
|
+
}).catch(() => {
|
|
103
|
+
if (!cancelled) setTransforms([]);
|
|
104
|
+
});
|
|
105
|
+
return () => {
|
|
106
|
+
cancelled = true;
|
|
107
|
+
};
|
|
108
|
+
}, [showTransform]);
|
|
109
|
+
const currentOptions = useMemo(
|
|
110
|
+
() => ({
|
|
111
|
+
format,
|
|
112
|
+
themeId,
|
|
113
|
+
transformStyle,
|
|
114
|
+
pageSize,
|
|
115
|
+
htmlStyle,
|
|
116
|
+
htmlBundle,
|
|
117
|
+
includeLinkedDocs: showIncludeLinked && includeLinkedDocs,
|
|
118
|
+
entryAsIndex: showEntryAsIndex && entryAsIndex
|
|
119
|
+
}),
|
|
120
|
+
[
|
|
121
|
+
format,
|
|
122
|
+
themeId,
|
|
123
|
+
transformStyle,
|
|
124
|
+
pageSize,
|
|
125
|
+
htmlStyle,
|
|
126
|
+
htmlBundle,
|
|
127
|
+
includeLinkedDocs,
|
|
128
|
+
entryAsIndex,
|
|
129
|
+
showIncludeLinked,
|
|
130
|
+
showEntryAsIndex
|
|
131
|
+
]
|
|
132
|
+
);
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
onOptionsChange?.(currentOptions);
|
|
135
|
+
}, [currentOptions, onOptionsChange]);
|
|
136
|
+
const handleExport = useCallback(() => {
|
|
137
|
+
saveExportOptions(currentOptions);
|
|
138
|
+
onExport(currentOptions);
|
|
139
|
+
}, [currentOptions, onExport]);
|
|
140
|
+
return /* @__PURE__ */ jsxs(
|
|
141
|
+
Dialog,
|
|
142
|
+
{
|
|
143
|
+
title: "Export Document",
|
|
144
|
+
onClose,
|
|
145
|
+
className: "db-export-dialog",
|
|
146
|
+
footerClassName: "db-export-footer",
|
|
147
|
+
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
148
|
+
/* @__PURE__ */ jsx(
|
|
149
|
+
"button",
|
|
150
|
+
{
|
|
151
|
+
type: "button",
|
|
152
|
+
className: "db-export-btn db-export-btn--secondary",
|
|
153
|
+
onClick: onClose,
|
|
154
|
+
children: "Cancel"
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
/* @__PURE__ */ jsx(
|
|
158
|
+
"button",
|
|
159
|
+
{
|
|
160
|
+
type: "button",
|
|
161
|
+
className: "db-export-btn db-export-btn--primary",
|
|
162
|
+
onClick: handleExport,
|
|
163
|
+
disabled: exporting,
|
|
164
|
+
children: exporting ? "Exporting..." : "Export"
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
] }),
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ jsxs("div", { className: "db-export-field", children: [
|
|
170
|
+
/* @__PURE__ */ jsx("span", { className: "db-export-label", children: "Format" }),
|
|
171
|
+
/* @__PURE__ */ jsx(
|
|
172
|
+
ChipRadioGroup,
|
|
173
|
+
{
|
|
174
|
+
name: "Format",
|
|
175
|
+
value: format,
|
|
176
|
+
options: FORMATS.map((f) => ({
|
|
177
|
+
key: f,
|
|
178
|
+
label: FORMAT_CHIP_LABELS[f],
|
|
179
|
+
title: FORMAT_LABELS[f]
|
|
180
|
+
})),
|
|
181
|
+
onChange: setFormat
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
] }),
|
|
185
|
+
destination && /* @__PURE__ */ jsxs("div", { className: "db-export-field", children: [
|
|
186
|
+
/* @__PURE__ */ jsx("label", { className: "db-export-label", htmlFor: "db-export-path", children: "Export to" }),
|
|
187
|
+
/* @__PURE__ */ jsxs("div", { className: "db-export-path-row", children: [
|
|
188
|
+
/* @__PURE__ */ jsx(
|
|
189
|
+
"input",
|
|
190
|
+
{
|
|
191
|
+
id: "db-export-path",
|
|
192
|
+
className: "db-export-path-input",
|
|
193
|
+
value: destination.value,
|
|
194
|
+
readOnly: true,
|
|
195
|
+
disabled: exporting,
|
|
196
|
+
spellCheck: false,
|
|
197
|
+
autoComplete: "off"
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
/* @__PURE__ */ jsx(
|
|
201
|
+
"button",
|
|
202
|
+
{
|
|
203
|
+
type: "button",
|
|
204
|
+
className: "db-export-path-pick",
|
|
205
|
+
onClick: () => void destination.onPick(currentOptions),
|
|
206
|
+
disabled: exporting,
|
|
207
|
+
"aria-label": "Choose export location",
|
|
208
|
+
title: "Choose export location",
|
|
209
|
+
children: "..."
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
] }),
|
|
213
|
+
destination.hint && /* @__PURE__ */ jsx("span", { className: "db-export-hint", children: destination.hint })
|
|
214
|
+
] }),
|
|
215
|
+
showHtmlOptions && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
216
|
+
/* @__PURE__ */ jsxs("div", { className: "db-export-field", children: [
|
|
217
|
+
/* @__PURE__ */ jsx("span", { className: "db-export-label", children: "Style" }),
|
|
218
|
+
/* @__PURE__ */ jsx(
|
|
219
|
+
ChipRadioGroup,
|
|
220
|
+
{
|
|
221
|
+
name: "Style",
|
|
222
|
+
value: htmlStyle,
|
|
223
|
+
options: HTML_STYLE_CHIPS,
|
|
224
|
+
onChange: setHtmlStyle
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
/* @__PURE__ */ jsx("span", { className: "db-export-hint", children: HTML_STYLE_CHIPS.find((c) => c.key === htmlStyle)?.hint })
|
|
228
|
+
] }),
|
|
229
|
+
showHtmlBundle && /* @__PURE__ */ jsxs("div", { className: "db-export-field", children: [
|
|
230
|
+
/* @__PURE__ */ jsx("span", { className: "db-export-label", children: "Bundle" }),
|
|
231
|
+
/* @__PURE__ */ jsx(
|
|
232
|
+
ChipRadioGroup,
|
|
233
|
+
{
|
|
234
|
+
name: "Bundle",
|
|
235
|
+
value: htmlBundle,
|
|
236
|
+
options: HTML_BUNDLE_CHIPS,
|
|
237
|
+
onChange: setHtmlBundle
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
/* @__PURE__ */ jsx("span", { className: "db-export-hint", children: HTML_BUNDLE_CHIPS.find((c) => c.key === htmlBundle)?.hint })
|
|
241
|
+
] }),
|
|
242
|
+
showIncludeLinked && /* @__PURE__ */ jsxs("div", { className: "db-export-field", children: [
|
|
243
|
+
/* @__PURE__ */ jsxs("label", { className: "db-export-checkbox", children: [
|
|
244
|
+
/* @__PURE__ */ jsx(
|
|
245
|
+
"input",
|
|
246
|
+
{
|
|
247
|
+
type: "checkbox",
|
|
248
|
+
checked: includeLinkedDocs,
|
|
249
|
+
onChange: (e) => setIncludeLinkedDocs(e.target.checked)
|
|
250
|
+
}
|
|
251
|
+
),
|
|
252
|
+
/* @__PURE__ */ jsx("span", { children: "Include linked-to documents" })
|
|
253
|
+
] }),
|
|
254
|
+
/* @__PURE__ */ jsx("span", { className: "db-export-hint", children: includeLinkedDocs ? "Follows relative .md links from this page and bundles every reachable document as its own .html in a ZIP. Cross-doc links rewrite from .md to .html." : "Only this document is exported." })
|
|
255
|
+
] }),
|
|
256
|
+
showEntryAsIndex && /* @__PURE__ */ jsxs("div", { className: "db-export-field", children: [
|
|
257
|
+
/* @__PURE__ */ jsxs("label", { className: "db-export-checkbox", children: [
|
|
258
|
+
/* @__PURE__ */ jsx(
|
|
259
|
+
"input",
|
|
260
|
+
{
|
|
261
|
+
type: "checkbox",
|
|
262
|
+
checked: entryAsIndex,
|
|
263
|
+
onChange: (e) => setEntryAsIndex(e.target.checked)
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
/* @__PURE__ */ jsx("span", { children: "Name entry page index.html" })
|
|
267
|
+
] }),
|
|
268
|
+
/* @__PURE__ */ jsx("span", { className: "db-export-hint", children: entryAsIndex ? includeLinkedDocs ? "Renames this page to index.html in the ZIP and rewrites any cross-doc links pointing back at it. Drops straight into a static-site host." : "Downloads as index.html instead of the document name. Drops straight into a static-site host." : "Exports under the document name." })
|
|
269
|
+
] })
|
|
270
|
+
] }),
|
|
271
|
+
showTheme && /* @__PURE__ */ jsxs("div", { className: "db-export-field", children: [
|
|
272
|
+
/* @__PURE__ */ jsx("label", { className: "db-export-label", htmlFor: "db-export-theme", children: "Theme" }),
|
|
273
|
+
/* @__PURE__ */ jsx(
|
|
274
|
+
"select",
|
|
275
|
+
{
|
|
276
|
+
id: "db-export-theme",
|
|
277
|
+
className: "db-export-select",
|
|
278
|
+
value: themeId,
|
|
279
|
+
onChange: (e) => setThemeId(e.target.value),
|
|
280
|
+
children: themes.map((t) => /* @__PURE__ */ jsx("option", { value: t.id, children: t.name }, t.id))
|
|
281
|
+
}
|
|
282
|
+
),
|
|
283
|
+
/* @__PURE__ */ jsx("span", { className: "db-export-hint", children: themes.find((t) => t.id === themeId)?.description })
|
|
284
|
+
] }),
|
|
285
|
+
showTransform && /* @__PURE__ */ jsxs("div", { className: "db-export-field", children: [
|
|
286
|
+
/* @__PURE__ */ jsx("label", { className: "db-export-label", htmlFor: "db-export-transform", children: "Transform" }),
|
|
287
|
+
/* @__PURE__ */ jsx(
|
|
288
|
+
"select",
|
|
289
|
+
{
|
|
290
|
+
id: "db-export-transform",
|
|
291
|
+
className: "db-export-select",
|
|
292
|
+
value: transformStyle,
|
|
293
|
+
onChange: (e) => setTransformStyle(e.target.value),
|
|
294
|
+
children: transforms.length === 0 ? /* @__PURE__ */ jsx("option", { value: transformStyle, children: "Loading..." }) : transforms.map((t) => /* @__PURE__ */ jsx("option", { value: t.id, children: t.name }, t.id))
|
|
295
|
+
}
|
|
296
|
+
),
|
|
297
|
+
/* @__PURE__ */ jsx("span", { className: "db-export-hint", children: transforms.find((t) => t.id === transformStyle)?.description })
|
|
298
|
+
] }),
|
|
299
|
+
showPageSize && /* @__PURE__ */ jsxs("div", { className: "db-export-field", children: [
|
|
300
|
+
/* @__PURE__ */ jsx("label", { className: "db-export-label", htmlFor: "db-export-pagesize", children: "Page Size" }),
|
|
301
|
+
/* @__PURE__ */ jsxs(
|
|
302
|
+
"select",
|
|
303
|
+
{
|
|
304
|
+
id: "db-export-pagesize",
|
|
305
|
+
className: "db-export-select",
|
|
306
|
+
value: pageSize,
|
|
307
|
+
onChange: (e) => setPageSize(e.target.value),
|
|
308
|
+
children: [
|
|
309
|
+
/* @__PURE__ */ jsx("option", { value: "letter", children: "US Letter" }),
|
|
310
|
+
/* @__PURE__ */ jsx("option", { value: "a4", children: "A4" })
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
] }),
|
|
315
|
+
error && /* @__PURE__ */ jsx("p", { className: "db-export-error", role: "alert", children: error })
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export {
|
|
322
|
+
ExportDialog
|
|
323
|
+
};
|
|
324
|
+
//# sourceMappingURL=chunk-UNYZQXWR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Export/ExportDialog.tsx"],"sourcesContent":["/**\n * ExportDialog — modal for choosing export format and options.\n */\n\nimport { useState, useCallback, useEffect, useMemo } from 'react';\nimport { getThemeSummaries } from '@bendyline/squisq/schemas';\nimport type { ExportFormat, ExportOptions, HtmlBundle, HtmlStyle } from './export-options.js';\nimport { FORMAT_LABELS, saveExportOptions } from './export-options.js';\nimport { loadTransformStyleSummaries, type ExportSummaryOption } from './transform-summaries.js';\nimport { Dialog } from '../components/Dialog.js';\n\nexport interface ExportDialogProps {\n /** Initial options (pre-populated from last export). */\n initial: ExportOptions;\n /** Whether the export is currently running. */\n exporting: boolean;\n /**\n * Message from a failed export attempt. Rendered in the dialog, which\n * stays open so the user can adjust options and retry — a failure must\n * never look like a success.\n */\n error?: string | null;\n /** Optional host-provided destination path control. */\n destination?: ExportDestinationControl;\n /** Called when the user confirms the export. */\n onExport: (options: ExportOptions) => void;\n /** Called whenever the currently selected options change. */\n onOptionsChange?: (options: ExportOptions) => void;\n /** Called when the dialog is dismissed. */\n onClose: () => void;\n}\n\nexport interface ExportDestinationControl {\n value: string;\n onPick: (options: ExportOptions) => void | Promise<void>;\n hint?: string;\n}\n\nconst FORMATS: ExportFormat[] = ['pdf', 'docx', 'pptx', 'html', 'md'];\n\n/** Short labels for the Format chip row. The fuller `FORMAT_LABELS` list\n * is still used as a tooltip so users can confirm the file extension. */\nconst FORMAT_CHIP_LABELS: Record<ExportFormat, string> = {\n pdf: 'PDF',\n docx: 'Word',\n pptx: 'PowerPoint',\n html: 'HTML',\n md: 'Markdown',\n};\n\nconst HTML_STYLE_CHIPS: { key: HtmlStyle; label: string; hint: string }[] = [\n {\n key: 'plain',\n label: 'Plain',\n hint: 'A lightweight static HTML document.',\n },\n {\n key: 'rendered',\n label: 'Rendered',\n hint: 'Renders via SquisqPlayer with themes and playback support.',\n },\n];\n\nconst HTML_BUNDLE_CHIPS: { key: HtmlBundle; label: string; hint: string }[] = [\n {\n key: 'single',\n label: 'Single file',\n hint: 'One .html file with images embedded as base64 data URIs.',\n },\n {\n key: 'zip',\n label: 'ZIP archive',\n hint: 'A .zip with index.html plus separate image (and JS) files.',\n },\n];\n\ninterface ChipOption<T extends string> {\n key: T;\n label: string;\n title?: string;\n}\n\nfunction ChipRadioGroup<T extends string>({\n name,\n value,\n options,\n onChange,\n}: {\n name: string;\n value: T;\n options: ChipOption<T>[];\n onChange: (next: T) => void;\n}) {\n return (\n <div className=\"db-export-chips\" role=\"radiogroup\" aria-label={name}>\n {options.map((opt) => {\n const active = opt.key === value;\n return (\n <button\n key={opt.key}\n type=\"button\"\n role=\"radio\"\n aria-checked={active}\n className={`db-export-chip${active ? ' db-export-chip--active' : ''}`}\n onClick={() => onChange(opt.key)}\n title={opt.title}\n >\n {opt.label}\n </button>\n );\n })}\n </div>\n );\n}\n\nexport function ExportDialog({\n initial,\n exporting,\n error,\n destination,\n onExport,\n onOptionsChange,\n onClose,\n}: ExportDialogProps) {\n const [format, setFormat] = useState<ExportFormat>(initial.format);\n const [themeId, setThemeId] = useState(initial.themeId);\n const [transformStyle, setTransformStyle] = useState(initial.transformStyle);\n const [pageSize, setPageSize] = useState(initial.pageSize);\n const [htmlStyle, setHtmlStyle] = useState<HtmlStyle>(initial.htmlStyle);\n const [htmlBundle, setHtmlBundle] = useState<HtmlBundle>(initial.htmlBundle);\n const [includeLinkedDocs, setIncludeLinkedDocs] = useState<boolean>(initial.includeLinkedDocs);\n const [entryAsIndex, setEntryAsIndex] = useState<boolean>(initial.entryAsIndex);\n const [transforms, setTransforms] = useState<ExportSummaryOption[]>([]);\n\n const themes = getThemeSummaries();\n\n // Both HTML styles honor themes now: rendered HTML through the\n // SquisqPlayer's theme system, plain HTML through squisq's\n // `markdownDocToPlainHtml` which emits theme-driven CSS variables\n // and Google Fonts links. Show the dropdown for any export format\n // whose pipeline actually applies the picked theme.\n const showTheme = format === 'docx' || format === 'pdf' || format === 'pptx' || format === 'html';\n const showTransform = format === 'pptx';\n const showPageSize = format === 'pdf';\n const showHtmlOptions = format === 'html';\n // Both HTML styles now have a recursive bundle: plain via\n // `markdownDocsToPlainHtmlBundle`, rendered via\n // `markdownDocsToHtmlBundle` (which rewrites Doc-tree links to\n // `.html` before SquisqPlayer serialization). So the option applies\n // to any HTML export.\n const showIncludeLinked = format === 'html';\n // Multi-doc output is inherently a directory tree, so when recursion\n // is on the Bundle row would only confuse — ZIP is the only valid\n // packaging. Hide the chip row and surface the implication in a hint.\n const showHtmlBundle = showHtmlOptions && !includeLinkedDocs;\n // `entryAsIndex` is only honored in pipelines where we control the\n // output filename ourselves:\n // • single-file HTML downloads → renames `<doc>.html` → `index.html`\n // • recursive bundles → passed through to squisq's bundle helpers\n // In the single-doc ZIP path, squisq's `docToHtmlZip` and our plain-\n // HTML zip writer always emit `index.html` inside the archive, so the\n // checkbox has no observable effect — hide it to avoid surfacing an\n // inert control.\n const showEntryAsIndex = showHtmlOptions && (htmlBundle === 'single' || includeLinkedDocs);\n\n useEffect(() => {\n if (!showTransform) return;\n let cancelled = false;\n\n loadTransformStyleSummaries()\n .then((nextTransforms) => {\n if (!cancelled) setTransforms(nextTransforms);\n })\n .catch(() => {\n if (!cancelled) setTransforms([]);\n });\n\n return () => {\n cancelled = true;\n };\n }, [showTransform]);\n\n const currentOptions = useMemo<ExportOptions>(\n () => ({\n format,\n themeId,\n transformStyle,\n pageSize,\n htmlStyle,\n htmlBundle,\n includeLinkedDocs: showIncludeLinked && includeLinkedDocs,\n entryAsIndex: showEntryAsIndex && entryAsIndex,\n }),\n [\n format,\n themeId,\n transformStyle,\n pageSize,\n htmlStyle,\n htmlBundle,\n includeLinkedDocs,\n entryAsIndex,\n showIncludeLinked,\n showEntryAsIndex,\n ],\n );\n\n useEffect(() => {\n onOptionsChange?.(currentOptions);\n }, [currentOptions, onOptionsChange]);\n\n const handleExport = useCallback(() => {\n saveExportOptions(currentOptions);\n onExport(currentOptions);\n }, [currentOptions, onExport]);\n\n return (\n <Dialog\n title=\"Export Document\"\n onClose={onClose}\n className=\"db-export-dialog\"\n footerClassName=\"db-export-footer\"\n footer={\n <>\n <button\n type=\"button\"\n className=\"db-export-btn db-export-btn--secondary\"\n onClick={onClose}\n >\n Cancel\n </button>\n <button\n type=\"button\"\n className=\"db-export-btn db-export-btn--primary\"\n onClick={handleExport}\n disabled={exporting}\n >\n {exporting ? 'Exporting...' : 'Export'}\n </button>\n </>\n }\n >\n {/* Format — chip radio row for fast switching */}\n <div className=\"db-export-field\">\n <span className=\"db-export-label\">Format</span>\n <ChipRadioGroup\n name=\"Format\"\n value={format}\n options={FORMATS.map((f) => ({\n key: f,\n label: FORMAT_CHIP_LABELS[f],\n title: FORMAT_LABELS[f],\n }))}\n onChange={setFormat}\n />\n </div>\n\n {destination && (\n <div className=\"db-export-field\">\n <label className=\"db-export-label\" htmlFor=\"db-export-path\">\n Export to\n </label>\n <div className=\"db-export-path-row\">\n <input\n id=\"db-export-path\"\n className=\"db-export-path-input\"\n value={destination.value}\n readOnly\n disabled={exporting}\n spellCheck={false}\n autoComplete=\"off\"\n />\n <button\n type=\"button\"\n className=\"db-export-path-pick\"\n onClick={() => void destination.onPick(currentOptions)}\n disabled={exporting}\n aria-label=\"Choose export location\"\n title=\"Choose export location\"\n >\n ...\n </button>\n </div>\n {destination.hint && <span className=\"db-export-hint\">{destination.hint}</span>}\n </div>\n )}\n\n {/* HTML style + bundle (HTML only) — also chip rows */}\n {showHtmlOptions && (\n <>\n <div className=\"db-export-field\">\n <span className=\"db-export-label\">Style</span>\n <ChipRadioGroup\n name=\"Style\"\n value={htmlStyle}\n options={HTML_STYLE_CHIPS}\n onChange={setHtmlStyle}\n />\n <span className=\"db-export-hint\">\n {HTML_STYLE_CHIPS.find((c) => c.key === htmlStyle)?.hint}\n </span>\n </div>\n {showHtmlBundle && (\n <div className=\"db-export-field\">\n <span className=\"db-export-label\">Bundle</span>\n <ChipRadioGroup\n name=\"Bundle\"\n value={htmlBundle}\n options={HTML_BUNDLE_CHIPS}\n onChange={setHtmlBundle}\n />\n <span className=\"db-export-hint\">\n {HTML_BUNDLE_CHIPS.find((c) => c.key === htmlBundle)?.hint}\n </span>\n </div>\n )}\n {showIncludeLinked && (\n <div className=\"db-export-field\">\n <label className=\"db-export-checkbox\">\n <input\n type=\"checkbox\"\n checked={includeLinkedDocs}\n onChange={(e) => setIncludeLinkedDocs(e.target.checked)}\n />\n <span>Include linked-to documents</span>\n </label>\n <span className=\"db-export-hint\">\n {includeLinkedDocs\n ? 'Follows relative .md links from this page and bundles every reachable document as its own .html in a ZIP. Cross-doc links rewrite from .md to .html.'\n : 'Only this document is exported.'}\n </span>\n </div>\n )}\n {showEntryAsIndex && (\n <div className=\"db-export-field\">\n <label className=\"db-export-checkbox\">\n <input\n type=\"checkbox\"\n checked={entryAsIndex}\n onChange={(e) => setEntryAsIndex(e.target.checked)}\n />\n <span>Name entry page index.html</span>\n </label>\n <span className=\"db-export-hint\">\n {entryAsIndex\n ? includeLinkedDocs\n ? 'Renames this page to index.html in the ZIP and rewrites any cross-doc links pointing back at it. Drops straight into a static-site host.'\n : 'Downloads as index.html instead of the document name. Drops straight into a static-site host.'\n : 'Exports under the document name.'}\n </span>\n </div>\n )}\n </>\n )}\n\n {/* Theme */}\n {showTheme && (\n <div className=\"db-export-field\">\n <label className=\"db-export-label\" htmlFor=\"db-export-theme\">\n Theme\n </label>\n <select\n id=\"db-export-theme\"\n className=\"db-export-select\"\n value={themeId}\n onChange={(e) => setThemeId(e.target.value)}\n >\n {themes.map((t) => (\n <option key={t.id} value={t.id}>\n {t.name}\n </option>\n ))}\n </select>\n <span className=\"db-export-hint\">\n {themes.find((t) => t.id === themeId)?.description}\n </span>\n </div>\n )}\n\n {/* Transform (PPTX only) */}\n {showTransform && (\n <div className=\"db-export-field\">\n <label className=\"db-export-label\" htmlFor=\"db-export-transform\">\n Transform\n </label>\n <select\n id=\"db-export-transform\"\n className=\"db-export-select\"\n value={transformStyle}\n onChange={(e) => setTransformStyle(e.target.value)}\n >\n {transforms.length === 0 ? (\n <option value={transformStyle}>Loading...</option>\n ) : (\n transforms.map((t) => (\n <option key={t.id} value={t.id}>\n {t.name}\n </option>\n ))\n )}\n </select>\n <span className=\"db-export-hint\">\n {transforms.find((t) => t.id === transformStyle)?.description}\n </span>\n </div>\n )}\n\n {/* Page size (PDF only) */}\n {showPageSize && (\n <div className=\"db-export-field\">\n <label className=\"db-export-label\" htmlFor=\"db-export-pagesize\">\n Page Size\n </label>\n <select\n id=\"db-export-pagesize\"\n className=\"db-export-select\"\n value={pageSize}\n onChange={(e) => setPageSize(e.target.value as 'letter' | 'a4')}\n >\n <option value=\"letter\">US Letter</option>\n <option value=\"a4\">A4</option>\n </select>\n </div>\n )}\n\n {error && (\n <p className=\"db-export-error\" role=\"alert\">\n {error}\n </p>\n )}\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAIA,SAAS,UAAU,aAAa,WAAW,eAAe;AAC1D,SAAS,yBAAyB;AA6FxB,SA6HF,UA7HE,KA6HF,YA7HE;AA5DV,IAAM,UAA0B,CAAC,OAAO,QAAQ,QAAQ,QAAQ,IAAI;AAIpE,IAAM,qBAAmD;AAAA,EACvD,KAAK;AAAA,EACL,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,IAAI;AACN;AAEA,IAAM,mBAAsE;AAAA,EAC1E;AAAA,IACE,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AACF;AAEA,IAAM,oBAAwE;AAAA,EAC5E;AAAA,IACE,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AACF;AAQA,SAAS,eAAiC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKG;AACD,SACE,oBAAC,SAAI,WAAU,mBAAkB,MAAK,cAAa,cAAY,MAC5D,kBAAQ,IAAI,CAAC,QAAQ;AACpB,UAAM,SAAS,IAAI,QAAQ;AAC3B,WACE;AAAA,MAAC;AAAA;AAAA,QAEC,MAAK;AAAA,QACL,MAAK;AAAA,QACL,gBAAc;AAAA,QACd,WAAW,iBAAiB,SAAS,4BAA4B,EAAE;AAAA,QACnE,SAAS,MAAM,SAAS,IAAI,GAAG;AAAA,QAC/B,OAAO,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AAkB,SAAQ,uBAAsB,uBAEjE;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,IAAG;AAAA,cACH,WAAU;AAAA,cACV,OAAO;AAAA,cACP,UAAU,CAAC,MAAM,kBAAkB,EAAE,OAAO,KAAK;AAAA,cAEhD,qBAAW,WAAW,IACrB,oBAAC,YAAO,OAAO,gBAAgB,wBAAU,IAEzC,WAAW,IAAI,CAAC,MACd,oBAAC,YAAkB,OAAO,EAAE,IACzB,YAAE,QADQ,EAAE,EAEf,CACD;AAAA;AAAA,UAEL;AAAA,UACA,oBAAC,UAAK,WAAU,kBACb,qBAAW,KAAK,CAAC,MAAM,EAAE,OAAO,cAAc,GAAG,aACpD;AAAA,WACF;AAAA,QAID,gBACC,qBAAC,SAAI,WAAU,mBACb;AAAA,8BAAC,WAAM,WAAU,mBAAkB,SAAQ,sBAAqB,uBAEhE;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,IAAG;AAAA,cACH,WAAU;AAAA,cACV,OAAO;AAAA,cACP,UAAU,CAAC,MAAM,YAAY,EAAE,OAAO,KAAwB;AAAA,cAE9D;AAAA,oCAAC,YAAO,OAAM,UAAS,uBAAS;AAAA,gBAChC,oBAAC,YAAO,OAAM,MAAK,gBAAE;AAAA;AAAA;AAAA,UACvB;AAAA,WACF;AAAA,QAGD,SACC,oBAAC,OAAE,WAAU,mBAAkB,MAAK,SACjC,iBACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/editor.ts
|
|
2
|
+
var EMPTY_DOCUMENT_PROMPTS = [
|
|
3
|
+
"Start typing your content, or drop images on top of me...",
|
|
4
|
+
"Write anything -- paste markdown, drag in images, or just start typing...",
|
|
5
|
+
"Type away. Markdown syntax works too...",
|
|
6
|
+
"Chapter 1 begins here...",
|
|
7
|
+
"Once upon a time...",
|
|
8
|
+
"A blank page. Exciting, isn't it?",
|
|
9
|
+
"The first word is always the hardest...",
|
|
10
|
+
"Plot twist: this is where it all starts...",
|
|
11
|
+
"Write something the future you will thank you for...",
|
|
12
|
+
"Begin at the beginning...",
|
|
13
|
+
"Let's begin.",
|
|
14
|
+
"We can be heroes...",
|
|
15
|
+
"Here comes the sun...",
|
|
16
|
+
"And so it begins...",
|
|
17
|
+
"Let it be, let it be...",
|
|
18
|
+
"Don't stop believing...",
|
|
19
|
+
"Started from the bottom...",
|
|
20
|
+
"This is the start of something new...",
|
|
21
|
+
"Ground control to Major Tom...",
|
|
22
|
+
"Come as you are...",
|
|
23
|
+
"Every new beginning...",
|
|
24
|
+
"Hello, is it me you're looking for?",
|
|
25
|
+
"Imagine all the people...",
|
|
26
|
+
"Anything you want, you got it...",
|
|
27
|
+
"Rise above...",
|
|
28
|
+
"Do you have the time...",
|
|
29
|
+
"Here we are now, entertain us...",
|
|
30
|
+
"All the small things...",
|
|
31
|
+
"Should I stay or should I go?",
|
|
32
|
+
"I am a patient boy -- I wait, I wait, I wait...",
|
|
33
|
+
"Destination unknown...",
|
|
34
|
+
"Easy like Sunday morning...",
|
|
35
|
+
"Dance, dance, dance to the radio...",
|
|
36
|
+
"New day rising...",
|
|
37
|
+
"Visit the world...",
|
|
38
|
+
"Positive mental attitude...",
|
|
39
|
+
"Better I sing than I cry...",
|
|
40
|
+
"Disconnect for a minute...",
|
|
41
|
+
"We need new noise...",
|
|
42
|
+
"Shoot the moon...",
|
|
43
|
+
"I'll surprise you sometime -- I'll come around...",
|
|
44
|
+
"Coming out of my cage, and doing just fine...",
|
|
45
|
+
"Throw me to the wolves -- I'll come back, leading the pack...",
|
|
46
|
+
"There comes a time -- no excuses...",
|
|
47
|
+
"It's up to me now, turn on the bright lights...",
|
|
48
|
+
"Do what you want...",
|
|
49
|
+
"Fingers crossed...",
|
|
50
|
+
"This is the start of how it all ends...",
|
|
51
|
+
"It has to start somewhere, it has to start sometime -- what better place than here? what better time than now?",
|
|
52
|
+
"I know myself, and I'll begin again...",
|
|
53
|
+
"Dig me out, dig me in...",
|
|
54
|
+
"Everybody's full of sugar, honey, ice and tea...",
|
|
55
|
+
"Take time with a wounded hand, 'cause it likes to heal...",
|
|
56
|
+
"Grab a brush and put on a little makeup...",
|
|
57
|
+
"Amber is the color of your energy...",
|
|
58
|
+
"Wait -- they don't love it like I love it...",
|
|
59
|
+
"A world's been buried, where love is the law; a you-topia..."
|
|
60
|
+
];
|
|
61
|
+
function pickEmptyDocumentPrompt(random = Math.random) {
|
|
62
|
+
const index = Math.floor(random() * EMPTY_DOCUMENT_PROMPTS.length);
|
|
63
|
+
return EMPTY_DOCUMENT_PROMPTS[index] ?? EMPTY_DOCUMENT_PROMPTS[0];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
EMPTY_DOCUMENT_PROMPTS,
|
|
68
|
+
pickEmptyDocumentPrompt
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=chunk-VHDP4IPL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/editor.ts"],"sourcesContent":["/**\n * Placeholder prompts shown by DocBlocks when a Markdown document is empty.\n * Hosts pick one prompt for each mounted document generation and pass it to\n * Squisq, so the copy remains stable while that document is open.\n */\nexport const EMPTY_DOCUMENT_PROMPTS = [\n 'Start typing your content, or drop images on top of me...',\n 'Write anything -- paste markdown, drag in images, or just start typing...',\n 'Type away. Markdown syntax works too...',\n 'Chapter 1 begins here...',\n 'Once upon a time...',\n \"A blank page. Exciting, isn't it?\",\n 'The first word is always the hardest...',\n 'Plot twist: this is where it all starts...',\n 'Write something the future you will thank you for...',\n 'Begin at the beginning...',\n \"Let's begin.\",\n 'We can be heroes...',\n 'Here comes the sun...',\n 'And so it begins...',\n 'Let it be, let it be...',\n \"Don't stop believing...\",\n 'Started from the bottom...',\n 'This is the start of something new...',\n 'Ground control to Major Tom...',\n 'Come as you are...',\n 'Every new beginning...',\n \"Hello, is it me you're looking for?\",\n 'Imagine all the people...',\n 'Anything you want, you got it...',\n 'Rise above...',\n 'Do you have the time...',\n 'Here we are now, entertain us...',\n 'All the small things...',\n 'Should I stay or should I go?',\n 'I am a patient boy -- I wait, I wait, I wait...',\n 'Destination unknown...',\n 'Easy like Sunday morning...',\n 'Dance, dance, dance to the radio...',\n 'New day rising...',\n 'Visit the world...',\n 'Positive mental attitude...',\n 'Better I sing than I cry...',\n 'Disconnect for a minute...',\n 'We need new noise...',\n 'Shoot the moon...',\n \"I'll surprise you sometime -- I'll come around...\",\n 'Coming out of my cage, and doing just fine...',\n \"Throw me to the wolves -- I'll come back, leading the pack...\",\n 'There comes a time -- no excuses...',\n \"It's up to me now, turn on the bright lights...\",\n 'Do what you want...',\n 'Fingers crossed...',\n 'This is the start of how it all ends...',\n 'It has to start somewhere, it has to start sometime -- what better place than here? what better time than now?',\n \"I know myself, and I'll begin again...\",\n 'Dig me out, dig me in...',\n \"Everybody's full of sugar, honey, ice and tea...\",\n \"Take time with a wounded hand, 'cause it likes to heal...\",\n 'Grab a brush and put on a little makeup...',\n 'Amber is the color of your energy...',\n \"Wait -- they don't love it like I love it...\",\n \"A world's been buried, where love is the law; a you-topia...\",\n] as const;\n\nexport type EmptyDocumentPrompt = (typeof EMPTY_DOCUMENT_PROMPTS)[number];\n\n/** Pick a prompt using the supplied random source, or `Math.random`. */\nexport function pickEmptyDocumentPrompt(random: () => number = Math.random): EmptyDocumentPrompt {\n const index = Math.floor(random() * EMPTY_DOCUMENT_PROMPTS.length);\n return EMPTY_DOCUMENT_PROMPTS[index] ?? EMPTY_DOCUMENT_PROMPTS[0];\n}\n"],"mappings":";AAKO,IAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAKO,SAAS,wBAAwB,SAAuB,KAAK,QAA6B;AAC/F,QAAM,QAAQ,KAAK,MAAM,OAAO,IAAI,uBAAuB,MAAM;AACjE,SAAO,uBAAuB,KAAK,KAAK,uBAAuB,CAAC;AAClE;","names":[]}
|