@bendyline/docblocks 2.2.1 → 2.3.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/THIRD_PARTY_NOTICES.txt +1911 -0
- package/dist/{chunk-M2PUNKHS.js → chunk-2WDJ27EH.js} +26 -0
- package/dist/{chunk-DBJW7BZI.js → chunk-EG3WGSZH.js} +1 -53
- package/dist/{chunk-45T5AFCN.js → chunk-MO2VYEZQ.js} +1 -1
- package/dist/document/index.d.ts +1 -1
- package/dist/filesystem/electron.d.ts +2 -2
- package/dist/filesystem/electron.js +1 -1
- package/dist/filesystem/index.d.ts +3 -3
- package/dist/filesystem/index.js +2 -2
- package/dist/filesystem/indexeddb.d.ts +1 -1
- package/dist/filesystem/memory.d.ts +1 -1
- package/dist/filesystem/native.d.ts +1 -1
- package/dist/host/index.d.ts +12 -4
- package/dist/host/index.js +7 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -3
- package/dist/mcp/index.d.ts +3 -4
- package/dist/mcp/index.js +3 -5
- package/dist/mcp/zod.d.ts +63 -337
- package/dist/mcp/zod.js +3 -22
- package/dist/{types-BEg5SQ1_.d.ts → types-Bb3yccTH.d.ts} +2 -0
- package/dist/{types-Cv4uiosG.d.ts → types-CREx02sE.d.ts} +28 -2
- package/dist/{types-DkvEkg0I.d.ts → types-DapJIsC2.d.ts} +3 -17
- package/dist/vscode/index.d.ts +24 -2
- package/dist/vscode/index.js +45 -4
- package/dist/workspace/index.d.ts +2 -2
- package/package.json +11 -4
package/dist/mcp/zod.js
CHANGED
|
@@ -4,9 +4,8 @@ import {
|
|
|
4
4
|
parseComparisonResult,
|
|
5
5
|
parseConversionResult,
|
|
6
6
|
parseInspectionResult,
|
|
7
|
-
parsePreviewResult
|
|
8
|
-
|
|
9
|
-
} from "../chunk-DBJW7BZI.js";
|
|
7
|
+
parsePreviewResult
|
|
8
|
+
} from "../chunk-EG3WGSZH.js";
|
|
10
9
|
import "../chunk-AYWKIZLD.js";
|
|
11
10
|
|
|
12
11
|
// src/mcp/zod.ts
|
|
@@ -128,7 +127,6 @@ var diagnosticSchema = z.object({
|
|
|
128
127
|
"import",
|
|
129
128
|
"parse",
|
|
130
129
|
"inspect",
|
|
131
|
-
"validate",
|
|
132
130
|
"transform",
|
|
133
131
|
"convert",
|
|
134
132
|
"render",
|
|
@@ -151,7 +149,6 @@ var mcpErrorDetailSchema = z.object({
|
|
|
151
149
|
"import",
|
|
152
150
|
"parse",
|
|
153
151
|
"inspect",
|
|
154
|
-
"validate",
|
|
155
152
|
"transform",
|
|
156
153
|
"convert",
|
|
157
154
|
"render",
|
|
@@ -322,19 +319,6 @@ var inspectionResultSchema = z.object({
|
|
|
322
319
|
detailsTruncated: z.boolean(),
|
|
323
320
|
diagnostics: z.array(diagnosticSchema).max(MCP_WIRE_LIMITS.arrayEntries)
|
|
324
321
|
}).strict().superRefine((value, context) => addExactWireIssue(parseInspectionResult(value), context));
|
|
325
|
-
var validationResultSchema = z.object({
|
|
326
|
-
version: z.literal(1),
|
|
327
|
-
kind: z.literal("validation"),
|
|
328
|
-
sourceFormat: formatSchema,
|
|
329
|
-
targetFormat: formatSchema.nullable(),
|
|
330
|
-
valid: z.boolean(),
|
|
331
|
-
summary: z.object({
|
|
332
|
-
errorCount: nonNegativeSafeIntegerSchema,
|
|
333
|
-
warningCount: nonNegativeSafeIntegerSchema,
|
|
334
|
-
infoCount: nonNegativeSafeIntegerSchema
|
|
335
|
-
}).strict(),
|
|
336
|
-
diagnostics: z.array(diagnosticSchema).max(MCP_WIRE_LIMITS.arrayEntries)
|
|
337
|
-
}).strict().superRefine((value, context) => addExactWireIssue(parseValidationResult(value), context));
|
|
338
322
|
var previewItemSchema = z.object({
|
|
339
323
|
kind: z.enum(["page", "slide", "sheet", "frame"]),
|
|
340
324
|
index: nonNegativeSafeIntegerSchema,
|
|
@@ -554,7 +538,6 @@ var DOCBLOCKS_MCP_TOOL_RESULT_SCHEMAS = Object.freeze({
|
|
|
554
538
|
create_document_bundle: conversionResultSchema,
|
|
555
539
|
save_artifact: saveArtifactResultSchema,
|
|
556
540
|
inspect_document: inspectionResultSchema,
|
|
557
|
-
validate_document: validationResultSchema,
|
|
558
541
|
preview_document: previewResultSchema,
|
|
559
542
|
compare_documents: comparisonResultSchema,
|
|
560
543
|
get_authoring_context: authoringContextResultSchema,
|
|
@@ -578,7 +561,6 @@ var DOCBLOCKS_MCP_TOOL_OUTPUT_SCHEMAS = Object.freeze({
|
|
|
578
561
|
),
|
|
579
562
|
save_artifact: toolOutputSchema(DOCBLOCKS_MCP_TOOL_RESULT_SCHEMAS.save_artifact),
|
|
580
563
|
inspect_document: toolOutputSchema(DOCBLOCKS_MCP_TOOL_RESULT_SCHEMAS.inspect_document),
|
|
581
|
-
validate_document: toolOutputSchema(DOCBLOCKS_MCP_TOOL_RESULT_SCHEMAS.validate_document),
|
|
582
564
|
preview_document: toolOutputSchema(DOCBLOCKS_MCP_TOOL_RESULT_SCHEMAS.preview_document),
|
|
583
565
|
compare_documents: toolOutputSchema(DOCBLOCKS_MCP_TOOL_RESULT_SCHEMAS.compare_documents),
|
|
584
566
|
get_authoring_context: toolOutputSchema(DOCBLOCKS_MCP_TOOL_RESULT_SCHEMAS.get_authoring_context),
|
|
@@ -760,6 +742,5 @@ export {
|
|
|
760
742
|
themeCatalogEntrySchema,
|
|
761
743
|
themeDescriptionSchema,
|
|
762
744
|
toolOutputSchema,
|
|
763
|
-
transformStyleSummarySchema
|
|
764
|
-
validationResultSchema
|
|
745
|
+
transformStyleSummarySchema
|
|
765
746
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SerializedFsError, r as FileSystemProviderCapabilities, k as FileSystemEntrySnapshot, m as FileSystemFileRead, K as FileSystemWriteOptions, n as FileSystemFileSnapshot, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, o as FileSystemMoveOptions, w as FileSystemSnapshot, C as FileSystemWatchEvent, F as FileCommitResult, j as FileSystemEntry, b as FileMeta } from './types-
|
|
1
|
+
import { S as SerializedFsError, r as FileSystemProviderCapabilities, k as FileSystemEntrySnapshot, m as FileSystemFileRead, K as FileSystemWriteOptions, n as FileSystemFileSnapshot, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, o as FileSystemMoveOptions, w as FileSystemSnapshot, C as FileSystemWatchEvent, F as FileCommitResult, j as FileSystemEntry, b as FileMeta } from './types-Bb3yccTH.js';
|
|
2
2
|
import { a as WorkspacePath } from './workspace-path-CWVrcuPL.js';
|
|
3
3
|
|
|
4
4
|
/** Stable capabilities shared by the Electron v2 client and native backend. */
|
|
@@ -382,6 +382,31 @@ type UpdaterStatus = {
|
|
|
382
382
|
};
|
|
383
383
|
/** Menu-command events pushed from the main process to the renderer. */
|
|
384
384
|
type MenuCommand = 'file:new' | 'file:openFolder' | 'file:revealWorkspace' | 'file:settings' | 'git:commit' | 'git:push' | 'git:pull' | 'git:fetch' | 'git:newBranch' | 'git:switchBranch' | 'git:history' | 'git:clone' | 'git:openOnRemote' | 'git:createPullRequest' | 'help:about' | 'help:checkForUpdates' | 'help:viewOnGitHub';
|
|
385
|
+
/**
|
|
386
|
+
* One pinned document mirrored from the renderer into native menu surfaces.
|
|
387
|
+
*
|
|
388
|
+
* The renderer owns the authoritative pinned list (localStorage). The main
|
|
389
|
+
* process only caches the latest snapshot so the tray / menu bar can offer a
|
|
390
|
+
* one-click shortcut per document; it never persists or mutates it.
|
|
391
|
+
*/
|
|
392
|
+
interface HostPinnedDocument {
|
|
393
|
+
readonly workspaceId: string;
|
|
394
|
+
readonly workspaceName: string;
|
|
395
|
+
/** Canonical, root-relative workspace path. */
|
|
396
|
+
readonly path: string;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Renderer-to-main channel that keeps native menu surfaces in sync with
|
|
400
|
+
* renderer-owned state.
|
|
401
|
+
*/
|
|
402
|
+
interface DocBlocksHostMenuAPI {
|
|
403
|
+
/**
|
|
404
|
+
* Publish the current pinned-document list so the desktop tray can offer a
|
|
405
|
+
* shortcut per document that activates it in the main window. Replaces any
|
|
406
|
+
* previously published list; send an empty array to clear the shortcuts.
|
|
407
|
+
*/
|
|
408
|
+
setPinnedDocuments(documents: readonly HostPinnedDocument[]): void;
|
|
409
|
+
}
|
|
385
410
|
/**
|
|
386
411
|
* OS open-file / deep-link event resolved by the host.
|
|
387
412
|
* - 'workspace-file': a file inside an already-registered workspace.
|
|
@@ -486,6 +511,7 @@ interface DocBlocksHostAPI {
|
|
|
486
511
|
git: DocBlocksHostGitAPI;
|
|
487
512
|
updater: DocBlocksHostUpdaterAPI;
|
|
488
513
|
lifecycle: DocBlocksHostLifecycleAPI;
|
|
514
|
+
menu: DocBlocksHostMenuAPI;
|
|
489
515
|
/**
|
|
490
516
|
* Subscribe to menu commands dispatched by the native menu.
|
|
491
517
|
* Returns an unsubscribe function.
|
|
@@ -498,4 +524,4 @@ interface DocBlocksHostAPI {
|
|
|
498
524
|
onOpenRequest(listener: (request: OpenRequest) => void): () => void;
|
|
499
525
|
}
|
|
500
526
|
|
|
501
|
-
export { type
|
|
527
|
+
export { type GitRevision as A, type GitStatus as B, type HostEnvironment as C, type DocBlocksHostAPI as D, ELECTRON_FILE_SYSTEM_V2_CAPABILITIES as E, type HostExportTargetGrant as F, type GitBranchInfo as G, type HostCloseReason as H, type HostFileSystemV2OpenRequest as I, type HostFileSystemV2Result as J, type HostFileSystemV2WatchMessage as K, type HostPinnedDocument as L, type HostPrepareCloseRequest as M, type HostPrepareCloseResult as N, type MenuCommand as O, type OpenRequest as P, type UpdateInstallResult as Q, type UpdaterStatus as R, type UpdateCheckResult as U, type DocBlocksHostExportAPI as a, type DocBlocksHostExternalAPI as b, type DocBlocksHostFfmpegAPI as c, type DocBlocksHostFsAPI as d, type DocBlocksHostFsV2API as e, type DocBlocksHostGitAPI as f, type DocBlocksHostLifecycleAPI as g, type DocBlocksHostMenuAPI as h, type DocBlocksHostShellAPI as i, type DocBlocksHostUpdaterAPI as j, type DocBlocksHostWorkspacesAPI as k, type ElectronWorkspaceInfo as l, type ExternalBinaryCommitResult as m, type GitCapabilities as n, type GitCloneHandle as o, type GitCloneProgress as p, type GitError as q, type GitErrorCode as r, type GitFileAtRevision as s, type GitFileChange as t, type GitFileStatusCode as u, type GitLogEntry as v, type GitLogOptions as w, type GitRemoteInfo as x, type GitRepoDetection as y, type GitResult as z };
|
|
@@ -4,7 +4,7 @@ import { a as WorkspacePath } from './workspace-path-CWVrcuPL.js';
|
|
|
4
4
|
declare const DOCBLOCKS_MCP_WIRE_VERSION: 1;
|
|
5
5
|
type DocBlocksMcpWireVersion = typeof DOCBLOCKS_MCP_WIRE_VERSION;
|
|
6
6
|
/** Canonical artifact-first tools exposed by the local DocBlocks MCP server. */
|
|
7
|
-
declare const DOCBLOCKS_MCP_TOOL_NAMES: readonly ["list_roots", "get_conversion_report", "convert_document", "create_document_bundle", "save_artifact", "inspect_document", "
|
|
7
|
+
declare const DOCBLOCKS_MCP_TOOL_NAMES: readonly ["list_roots", "get_conversion_report", "convert_document", "create_document_bundle", "save_artifact", "inspect_document", "preview_document", "compare_documents", "get_authoring_context", "list_templates", "describe_template", "recommend_templates", "describe_theme", "infer_theme_from_file", "inspect_pptx_layouts", "apply_inferred_theme", "list_formats", "list_themes", "list_transform_styles"];
|
|
8
8
|
type DocBlocksMcpToolName = (typeof DOCBLOCKS_MCP_TOOL_NAMES)[number];
|
|
9
9
|
type AppliedOptionValue = string | number | boolean | null;
|
|
10
10
|
interface AppliedOption {
|
|
@@ -76,7 +76,7 @@ interface BundleDocumentSource {
|
|
|
76
76
|
}
|
|
77
77
|
type DocumentSource = MarkdownDocumentSource | FileDocumentSource | ArtifactDocumentSource | BundleDocumentSource;
|
|
78
78
|
type DiagnosticSeverity = 'info' | 'warning' | 'error';
|
|
79
|
-
type DiagnosticStage = 'resolve' | 'import' | 'parse' | 'inspect' | '
|
|
79
|
+
type DiagnosticStage = 'resolve' | 'import' | 'parse' | 'inspect' | 'transform' | 'convert' | 'render' | 'export' | 'materialize' | 'compare';
|
|
80
80
|
type DiagnosticLocation = {
|
|
81
81
|
readonly kind: 'source';
|
|
82
82
|
readonly line: number;
|
|
@@ -235,20 +235,6 @@ interface InspectionResult {
|
|
|
235
235
|
readonly detailsTruncated: boolean;
|
|
236
236
|
readonly diagnostics: readonly McpDiagnostic[];
|
|
237
237
|
}
|
|
238
|
-
interface ValidationSummary {
|
|
239
|
-
readonly errorCount: number;
|
|
240
|
-
readonly warningCount: number;
|
|
241
|
-
readonly infoCount: number;
|
|
242
|
-
}
|
|
243
|
-
interface ValidationResult {
|
|
244
|
-
readonly version: DocBlocksMcpWireVersion;
|
|
245
|
-
readonly kind: 'validation';
|
|
246
|
-
readonly sourceFormat: string;
|
|
247
|
-
readonly targetFormat: string | null;
|
|
248
|
-
readonly valid: boolean;
|
|
249
|
-
readonly summary: ValidationSummary;
|
|
250
|
-
readonly diagnostics: readonly McpDiagnostic[];
|
|
251
|
-
}
|
|
252
238
|
type PreviewItemKind = 'page' | 'slide' | 'sheet' | 'frame';
|
|
253
239
|
interface PreviewItem {
|
|
254
240
|
readonly kind: PreviewItemKind;
|
|
@@ -496,4 +482,4 @@ type MaterializationOptions = {
|
|
|
496
482
|
readonly expectedSha256: string;
|
|
497
483
|
};
|
|
498
484
|
|
|
499
|
-
export { type
|
|
485
|
+
export { type ListTransformStylesResult as $, type ArtifactRef as A, type BlockSummary as B, type ComparisonResult as C, type DocumentSource as D, type DiagnosticLocation as E, type DiagnosticSeverity as F, type DiagnosticStage as G, type DocBlocksMcpToolName as H, type InspectionResult as I, type DocBlocksMcpWireVersion as J, type DocumentItemSummary as K, type DocumentMetadataSummary as L, type MaterializationOptions as M, type DocumentStatistics as N, type EngineVersion as O, type PreviewResult as P, type FileDocumentSource as Q, type FormatCapabilitySummary as R, type FormatDirectionCapability as S, type InferThemeResult as T, type InferredLayoutSummary as U, type InspectPptxLayoutsResult as V, type LinkSummary as W, type ListFormatsResult as X, type ListRootsResult as Y, type ListTemplatesResult as Z, type ListThemesResult as _, type ConversionResult as a, type MarkdownDocumentSource as a0, type McpErrorDetail as a1, type McpSuccessResult as a2, type OutlineEntry as a3, type PptxLayoutSummary as a4, type PptxSlideSize as a5, type PreviewItem as a6, type PreviewItemKind as a7, type RecommendTemplatesResult as a8, type RootGrantSummary as a9, type SaveArtifactResult as aa, type SavedArtifactDestination as ab, type SourceRange as ac, type TableSummary as ad, type TemplateAuthoringRole as ae, type TemplateBodyPolicy as af, type TemplateContentProfile as ag, type TemplateInputSummary as ah, type TemplateRecommendation as ai, type TemplateSummary as aj, type ThemeCatalogEntry as ak, type ThemeDescription as al, type ThemeDescriptionColors as am, type ThemeSummary as an, type TransformStyleSummary as ao, type McpDiagnostic as b, type McpErrorResult as c, type AppliedOption as d, type AppliedOptionValue as e, type ApplyInferredThemeResult as f, type ArtifactDocumentSource as g, type AssetSummary as h, type AuthoringContextResult as i, type AuthoringGoal as j, type AuthoringSyntaxSummary as k, type AuthoringTemplateSummary as l, type BundleAssetContentSource as m, type BundleAssetRef as n, type BundleDocumentSource as o, type ComparisonCategory as p, type ComparisonChange as q, type ComparisonMetric as r, type ComparisonStatus as s, type ConversionFidelity as t, type ConvertDocumentResult as u, DOCBLOCKS_MCP_TOOL_NAMES as v, DOCBLOCKS_MCP_WIRE_VERSION as w, type DescribeTemplateResult as x, type DescribeThemeResult as y, type DescribedTemplate as z };
|
package/dist/vscode/index.d.ts
CHANGED
|
@@ -22,11 +22,22 @@ declare const DOCBLOCKS_ACCENT_COLORS: readonly ["brown", "green", "blue", "purp
|
|
|
22
22
|
type DocBlocksAccentColor = (typeof DOCBLOCKS_ACCENT_COLORS)[number];
|
|
23
23
|
declare const DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MIN = 12;
|
|
24
24
|
declare const DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MAX = 32;
|
|
25
|
-
declare const DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MIN = 1
|
|
25
|
+
declare const DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MIN = 1;
|
|
26
26
|
declare const DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MAX = 2.4;
|
|
27
|
+
/**
|
|
28
|
+
* Stable ids for the Write-canvas font schemes. This is the wire/persisted
|
|
29
|
+
* contract for the font choice; the human labels and the resolved CSS
|
|
30
|
+
* font-family strings live with the UI in `@bendyline/docblocks-react`
|
|
31
|
+
* (`WRITE_CANVAS_FONT_SCHEMES`). A guard test keeps this list, the react
|
|
32
|
+
* registry, and the VS Code `package.json` enum in sync. `'theme'` is the
|
|
33
|
+
* default and means "inherit from the active theme override".
|
|
34
|
+
*/
|
|
35
|
+
declare const DOCBLOCKS_WRITE_CANVAS_FONT_SCHEMES: readonly ["theme", "serif-sans", "sans-sans", "serif-serif", "pt-serif", "hanken", "playfair-pt-serif", "hanken-lora", "dm-serif-dm-sans", "inter"];
|
|
36
|
+
type DocBlocksWriteCanvasFontScheme = (typeof DOCBLOCKS_WRITE_CANVAS_FONT_SCHEMES)[number];
|
|
27
37
|
interface VscodeWriteCanvasSettings {
|
|
28
38
|
textSize: number;
|
|
29
39
|
lineSpacing: number;
|
|
40
|
+
fontScheme: DocBlocksWriteCanvasFontScheme;
|
|
30
41
|
}
|
|
31
42
|
declare const DEFAULT_VSCODE_WRITE_CANVAS_SETTINGS: Readonly<VscodeWriteCanvasSettings>;
|
|
32
43
|
interface VscodeEditorSettings {
|
|
@@ -219,7 +230,18 @@ declare function parseExtensionToWebviewMessage(value: unknown): ExtensionToWebv
|
|
|
219
230
|
declare function isDocBlocksAccentColor(value: unknown): value is DocBlocksAccentColor;
|
|
220
231
|
declare function isDocBlocksWriteCanvasTextSize(value: unknown): value is number;
|
|
221
232
|
declare function isDocBlocksWriteCanvasLineSpacing(value: unknown): value is number;
|
|
233
|
+
declare function isDocBlocksWriteCanvasFontScheme(value: unknown): value is DocBlocksWriteCanvasFontScheme;
|
|
222
234
|
declare function isSafeExportFilename(value: unknown): value is string;
|
|
223
235
|
declare function isSafeMimeType(value: unknown): value is string;
|
|
224
236
|
|
|
225
|
-
|
|
237
|
+
/**
|
|
238
|
+
* Return whether two document snapshots differ by more than whitespace.
|
|
239
|
+
*
|
|
240
|
+
* VS Code's DocBlocks webview is allowed to hydrate and navigate without
|
|
241
|
+
* authoring a file edit. Before the user's first substantive edit, hosts use
|
|
242
|
+
* this comparison to discard serializer churn that only changes line breaks,
|
|
243
|
+
* indentation, or other whitespace.
|
|
244
|
+
*/
|
|
245
|
+
declare function hasSubstantiveTextChange(baseline: string, candidate: string): boolean;
|
|
246
|
+
|
|
247
|
+
export { DEFAULT_VSCODE_WRITE_CANVAS_SETTINGS, DOCBLOCKS_ACCENT_COLORS, DOCBLOCKS_WRITE_CANVAS_FONT_SCHEMES, DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MAX, DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MIN, DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MAX, DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MIN, type DocBlocksAccentColor, type DocBlocksWriteCanvasFontScheme, type DocumentConflictChoice, type DocumentConflictDetailsMessage, type DocumentSessionMessageStatus, type ExportTargetGrantMessage, type ExtensionToWebviewMessage, type MediaEntryMessage, type VscodeEditorSettings, type VscodeWriteCanvasSettings, type WebviewToExtensionMessage, hasSubstantiveTextChange, isDocBlocksAccentColor, isDocBlocksWriteCanvasFontScheme, isDocBlocksWriteCanvasLineSpacing, isDocBlocksWriteCanvasTextSize, isSafeExportFilename, isSafeMimeType, parseExtensionToWebviewMessage, parseWebviewToExtensionMessage };
|
package/dist/vscode/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HOST_WIRE_LIMITS,
|
|
3
3
|
isBoundedString
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-2WDJ27EH.js";
|
|
5
5
|
|
|
6
6
|
// src/vscode/messages.ts
|
|
7
7
|
var MAX_REQUEST_ID = 2147483647;
|
|
@@ -16,11 +16,24 @@ var DOCBLOCKS_ACCENT_COLORS = [
|
|
|
16
16
|
];
|
|
17
17
|
var DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MIN = 12;
|
|
18
18
|
var DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MAX = 32;
|
|
19
|
-
var DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MIN = 1
|
|
19
|
+
var DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MIN = 1;
|
|
20
20
|
var DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MAX = 2.4;
|
|
21
|
+
var DOCBLOCKS_WRITE_CANVAS_FONT_SCHEMES = [
|
|
22
|
+
"theme",
|
|
23
|
+
"serif-sans",
|
|
24
|
+
"sans-sans",
|
|
25
|
+
"serif-serif",
|
|
26
|
+
"pt-serif",
|
|
27
|
+
"hanken",
|
|
28
|
+
"playfair-pt-serif",
|
|
29
|
+
"hanken-lora",
|
|
30
|
+
"dm-serif-dm-sans",
|
|
31
|
+
"inter"
|
|
32
|
+
];
|
|
21
33
|
var DEFAULT_VSCODE_WRITE_CANVAS_SETTINGS = {
|
|
22
34
|
textSize: 16,
|
|
23
|
-
lineSpacing: 1.7
|
|
35
|
+
lineSpacing: 1.7,
|
|
36
|
+
fontScheme: "theme"
|
|
24
37
|
};
|
|
25
38
|
function parseWebviewToExtensionMessage(value) {
|
|
26
39
|
if (!isRecord(value) || typeof value.type !== "string") return null;
|
|
@@ -295,8 +308,11 @@ function isDocBlocksWriteCanvasLineSpacing(value) {
|
|
|
295
308
|
DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MAX
|
|
296
309
|
);
|
|
297
310
|
}
|
|
311
|
+
function isDocBlocksWriteCanvasFontScheme(value) {
|
|
312
|
+
return DOCBLOCKS_WRITE_CANVAS_FONT_SCHEMES.some((scheme) => scheme === value);
|
|
313
|
+
}
|
|
298
314
|
function parseVscodeWriteCanvasSettings(value) {
|
|
299
|
-
return isRecord(value) && hasOnlyKeys(value, ["textSize", "lineSpacing"]) && isDocBlocksWriteCanvasTextSize(value.textSize) && isDocBlocksWriteCanvasLineSpacing(value.lineSpacing) ? { textSize: value.textSize, lineSpacing: value.lineSpacing } : null;
|
|
315
|
+
return isRecord(value) && hasOnlyKeys(value, ["textSize", "lineSpacing", "fontScheme"]) && isDocBlocksWriteCanvasTextSize(value.textSize) && isDocBlocksWriteCanvasLineSpacing(value.lineSpacing) && isDocBlocksWriteCanvasFontScheme(value.fontScheme) ? { textSize: value.textSize, lineSpacing: value.lineSpacing, fontScheme: value.fontScheme } : null;
|
|
300
316
|
}
|
|
301
317
|
function numberInRange(value, min, max) {
|
|
302
318
|
return typeof value === "number" && Number.isFinite(value) && value >= min && value <= max;
|
|
@@ -372,14 +388,39 @@ function isSafeMimeType(value) {
|
|
|
372
388
|
value
|
|
373
389
|
);
|
|
374
390
|
}
|
|
391
|
+
|
|
392
|
+
// src/vscode/text-change.ts
|
|
393
|
+
function hasSubstantiveTextChange(baseline, candidate) {
|
|
394
|
+
let baselineIndex = 0;
|
|
395
|
+
let candidateIndex = 0;
|
|
396
|
+
while (true) {
|
|
397
|
+
baselineIndex = skipWhitespace(baseline, baselineIndex);
|
|
398
|
+
candidateIndex = skipWhitespace(candidate, candidateIndex);
|
|
399
|
+
const baselineEnded = baselineIndex === baseline.length;
|
|
400
|
+
const candidateEnded = candidateIndex === candidate.length;
|
|
401
|
+
if (baselineEnded || candidateEnded) return baselineEnded !== candidateEnded;
|
|
402
|
+
if (baseline[baselineIndex] !== candidate[candidateIndex]) return true;
|
|
403
|
+
baselineIndex += 1;
|
|
404
|
+
candidateIndex += 1;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
var WHITESPACE_CHARACTER = /\s/u;
|
|
408
|
+
function skipWhitespace(value, start) {
|
|
409
|
+
let index = start;
|
|
410
|
+
while (index < value.length && WHITESPACE_CHARACTER.test(value[index])) index += 1;
|
|
411
|
+
return index;
|
|
412
|
+
}
|
|
375
413
|
export {
|
|
376
414
|
DEFAULT_VSCODE_WRITE_CANVAS_SETTINGS,
|
|
377
415
|
DOCBLOCKS_ACCENT_COLORS,
|
|
416
|
+
DOCBLOCKS_WRITE_CANVAS_FONT_SCHEMES,
|
|
378
417
|
DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MAX,
|
|
379
418
|
DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MIN,
|
|
380
419
|
DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MAX,
|
|
381
420
|
DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MIN,
|
|
421
|
+
hasSubstantiveTextChange,
|
|
382
422
|
isDocBlocksAccentColor,
|
|
423
|
+
isDocBlocksWriteCanvasFontScheme,
|
|
383
424
|
isDocBlocksWriteCanvasLineSpacing,
|
|
384
425
|
isDocBlocksWriteCanvasTextSize,
|
|
385
426
|
isSafeExportFilename,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { q as FileSystemProvider } from '../types-
|
|
2
|
-
import {
|
|
1
|
+
import { q as FileSystemProvider } from '../types-Bb3yccTH.js';
|
|
2
|
+
import { l as ElectronWorkspaceInfo, C as HostEnvironment } from '../types-CREx02sE.js';
|
|
3
3
|
import '../workspace-path-CWVrcuPL.js';
|
|
4
4
|
|
|
5
5
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/docblocks",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Core data structures and filesystem abstractions for DocBlocks",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bendyline",
|
|
@@ -19,13 +19,20 @@
|
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
|
24
|
+
},
|
|
22
25
|
"type": "module",
|
|
23
26
|
"main": "./dist/index.js",
|
|
24
27
|
"module": "./dist/index.js",
|
|
25
28
|
"types": "./dist/index.d.ts",
|
|
26
|
-
"sideEffects":
|
|
29
|
+
"//sideEffects": "tsup's split multi-entry build emits bare imports for shared chunks. Mark only those generated chunks as side-effectful so consumer bundlers retain them without treating the public entries as side-effectful.",
|
|
30
|
+
"sideEffects": [
|
|
31
|
+
"./dist/chunk-*.js"
|
|
32
|
+
],
|
|
27
33
|
"files": [
|
|
28
|
-
"dist"
|
|
34
|
+
"dist",
|
|
35
|
+
"THIRD_PARTY_NOTICES.txt"
|
|
29
36
|
],
|
|
30
37
|
"exports": {
|
|
31
38
|
".": {
|
|
@@ -99,7 +106,7 @@
|
|
|
99
106
|
"typecheck": "tsc --noEmit"
|
|
100
107
|
},
|
|
101
108
|
"dependencies": {
|
|
102
|
-
"@bendyline/squisq": "2.
|
|
109
|
+
"@bendyline/squisq": "2.4.3",
|
|
103
110
|
"zod": "3.25.76"
|
|
104
111
|
}
|
|
105
112
|
}
|