@mdzip/editor-ng 2.1.0 → 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/README.md +3 -0
- package/dist/README.md +3 -0
- package/dist/fesm2022/mdzip-editor-ng.mjs +15 -3
- package/dist/fesm2022/mdzip-editor-ng.mjs.map +1 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/mdz-archive.worker.js +111 -44
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -100,9 +100,12 @@ showUnchanged? }`) to opt any of them out.
|
|
|
100
100
|
| `imageHydrationAnimation` | `'auto' \| 'initial' \| 'off'` | `'auto'` | Control preview image reveal animation: every render, first render per document path, or never |
|
|
101
101
|
| `initialLayout` | `MdzipWorkspaceLayout` | — | Starting layout: `'preview'`, `'editor'`, `'split'` |
|
|
102
102
|
| `initialColorScheme` | `MdzipColorSchemePreference` | `'system'` | `'light'`, `'dark'` or `'system'` (follows the OS setting live) |
|
|
103
|
+
| `systemColorScheme` | `MdzipSystemColorScheme` | — | Makes the color scheme menu's System choice follow the host's theme instead of the OS setting, with its own `label` and `icon`, e.g. `{ colorScheme: 'dark', label: 'VS Code theme', icon: '<svg…>' }`; changes apply live |
|
|
103
104
|
| `previewMaxWidth` | `MdzipPreviewMaxWidth` | `'default'` | Preview reading-column width: `'narrow'`, `'default'`, `'wide'`, `'full'` or a pixel number; the user can change it from the toolbar's page-width menu |
|
|
104
105
|
| `navigationMode` | `MdzipNavigationMode` | `'editor'` | Package navigation mode |
|
|
105
106
|
| `navigationButtonActive` | `boolean` | `true` | Whether the navigation button is shown |
|
|
107
|
+
| `inlineSvgLinks` | `boolean` | `true` | Shows archive SVGs that contain links inline, so the links can be clicked (draw.io `.drawio.svg` diagrams, for example); other SVGs stay images. Read when the view is created |
|
|
108
|
+
| `hostFileActions` | `readonly MdzipFileAction[]` | — | The host's own items in the file tree's right-click menu on files (`{ id, label, appliesTo?, run }`), e.g. "Open in Another Editor". Read when the view is created |
|
|
106
109
|
| `markdownRenderer` | `MdzipMarkdownRenderer` | — | Custom markdown renderer (keep the reference stable) |
|
|
107
110
|
| `markdownExtensions` | `readonly MdzipMarkdownRenderExtension[]` | `[]` | Markdown pipeline extensions, diffed by `name` — new array identities with the same names are safe |
|
|
108
111
|
| `entryRenderers` | `readonly MdzipEntryRenderer[]` | `[]` | Entry renderers claiming the content area for matching entries, diffed by `id` — new array identities with the same ids are safe |
|
package/dist/README.md
CHANGED
|
@@ -100,9 +100,12 @@ showUnchanged? }`) to opt any of them out.
|
|
|
100
100
|
| `imageHydrationAnimation` | `'auto' \| 'initial' \| 'off'` | `'auto'` | Control preview image reveal animation: every render, first render per document path, or never |
|
|
101
101
|
| `initialLayout` | `MdzipWorkspaceLayout` | — | Starting layout: `'preview'`, `'editor'`, `'split'` |
|
|
102
102
|
| `initialColorScheme` | `MdzipColorSchemePreference` | `'system'` | `'light'`, `'dark'` or `'system'` (follows the OS setting live) |
|
|
103
|
+
| `systemColorScheme` | `MdzipSystemColorScheme` | — | Makes the color scheme menu's System choice follow the host's theme instead of the OS setting, with its own `label` and `icon`, e.g. `{ colorScheme: 'dark', label: 'VS Code theme', icon: '<svg…>' }`; changes apply live |
|
|
103
104
|
| `previewMaxWidth` | `MdzipPreviewMaxWidth` | `'default'` | Preview reading-column width: `'narrow'`, `'default'`, `'wide'`, `'full'` or a pixel number; the user can change it from the toolbar's page-width menu |
|
|
104
105
|
| `navigationMode` | `MdzipNavigationMode` | `'editor'` | Package navigation mode |
|
|
105
106
|
| `navigationButtonActive` | `boolean` | `true` | Whether the navigation button is shown |
|
|
107
|
+
| `inlineSvgLinks` | `boolean` | `true` | Shows archive SVGs that contain links inline, so the links can be clicked (draw.io `.drawio.svg` diagrams, for example); other SVGs stay images. Read when the view is created |
|
|
108
|
+
| `hostFileActions` | `readonly MdzipFileAction[]` | — | The host's own items in the file tree's right-click menu on files (`{ id, label, appliesTo?, run }`), e.g. "Open in Another Editor". Read when the view is created |
|
|
106
109
|
| `markdownRenderer` | `MdzipMarkdownRenderer` | — | Custom markdown renderer (keep the reference stable) |
|
|
107
110
|
| `markdownExtensions` | `readonly MdzipMarkdownRenderExtension[]` | `[]` | Markdown pipeline extensions, diffed by `name` — new array identities with the same names are safe |
|
|
108
111
|
| `entryRenderers` | `readonly MdzipEntryRenderer[]` | `[]` | Entry renderers claiming the content area for matching entries, diffed by `id` — new array identities with the same ids are safe |
|
|
@@ -91,7 +91,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImpo
|
|
|
91
91
|
// Generated from package.json. Do not edit by hand.
|
|
92
92
|
const PACKAGE_INFO = {
|
|
93
93
|
"name": "@mdzip/editor-ng",
|
|
94
|
-
"version": "2.
|
|
94
|
+
"version": "2.3.0",
|
|
95
95
|
"repositoryUrl": "https://github.com/mdzip-project/mdzip-editor/tree/main/packages/editor-ng",
|
|
96
96
|
"description": "Angular wrapper for the MDZip workspace editor."
|
|
97
97
|
};
|
|
@@ -175,7 +175,7 @@ class MdzipWorkspaceComponent {
|
|
|
175
175
|
this.syncView();
|
|
176
176
|
}
|
|
177
177
|
ngOnChanges(changes) {
|
|
178
|
-
if (this.view && (changes['initialLayout'] || changes['initialColorScheme'] || changes['progressiveTextRendering']
|
|
178
|
+
if (this.view && (changes['initialLayout'] || changes['initialColorScheme'] || changes['progressiveTextRendering'] || changes['inlineSvgLinks']
|
|
179
179
|
|| changes['navigationMode'] || changes['navigationButtonActive'])) {
|
|
180
180
|
this.createView();
|
|
181
181
|
this.syncView();
|
|
@@ -190,6 +190,9 @@ class MdzipWorkspaceComponent {
|
|
|
190
190
|
contentDensity: this.contentDensity,
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
+
if (this.view && changes['systemColorScheme']) {
|
|
194
|
+
this.view.setSystemColorScheme(this.systemColorScheme ?? null);
|
|
195
|
+
}
|
|
193
196
|
if (this.view && changes['previewMaxWidth']) {
|
|
194
197
|
this.view.setPreviewMaxWidth(this.previewMaxWidth);
|
|
195
198
|
}
|
|
@@ -333,7 +336,10 @@ class MdzipWorkspaceComponent {
|
|
|
333
336
|
initialLayout: this.initialLayout,
|
|
334
337
|
initialColorScheme: this.initialColorScheme,
|
|
335
338
|
previewMaxWidth: this.previewMaxWidth,
|
|
339
|
+
systemColorScheme: this.systemColorScheme,
|
|
336
340
|
progressiveTextRendering: this.progressiveTextRendering,
|
|
341
|
+
inlineSvgLinks: this.inlineSvgLinks,
|
|
342
|
+
hostFileActions: this.hostFileActions,
|
|
337
343
|
navigationMode: this.navigationMode,
|
|
338
344
|
navigationButtonActive: this.navigationButtonActive,
|
|
339
345
|
onChanged: (bytes, snapshot) => this.changed.emit({ bytes, snapshot }),
|
|
@@ -393,7 +399,7 @@ class MdzipWorkspaceComponent {
|
|
|
393
399
|
});
|
|
394
400
|
}
|
|
395
401
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: MdzipWorkspaceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
396
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: MdzipWorkspaceComponent, isStandalone: true, selector: "mdzip-workspace", inputs: { bytes: "bytes", workspace: "workspace", fileName: "fileName", preserveSelectionOnReopen: "preserveSelectionOnReopen", mode: "mode", sourceFormat: "sourceFormat", worker: "worker", controls: "controls", toolbarDensity: "toolbarDensity", contentDensity: "contentDensity", imageHydrationAnimation: "imageHydrationAnimation", imageInsertMode: "imageInsertMode", imageInsertHandler: "imageInsertHandler", imageEditHandler: "imageEditHandler", initialLayout: "initialLayout", initialColorScheme: "initialColorScheme", previewMaxWidth: "previewMaxWidth", progressiveTextRendering: "progressiveTextRendering", navigationMode: "navigationMode", navigationButtonActive: "navigationButtonActive", onConversionRequested: "onConversionRequested", onPackRequested: "onPackRequested", markdownRenderer: "markdownRenderer", markdownExtensions: "markdownExtensions", entryRenderers: "entryRenderers", frontMatter: "frontMatter", externalLinks: "externalLinks" }, outputs: { changed: "changed", saved: "saved", workspaceChanged: "workspaceChanged", documentChanged: "documentChanged", assetChanged: "assetChanged", manifestChanged: "manifestChanged", snapshotChanged: "snapshotChanged", selectionChanged: "selectionChanged", dirtyChanged: "dirtyChanged", validationChanged: "validationChanged", colorSchemeChanged: "colorSchemeChanged", colorSchemePreferenceChanged: "colorSchemePreferenceChanged", previewWidthChanged: "previewWidthChanged", previewRendered: "previewRendered", assetsHydrated: "assetsHydrated", linkActivated: "linkActivated", failed: "failed" }, queries: [{ propertyName: "entryTemplates", predicate: MdzipEntryRendererDirective }], viewQueries: [{ propertyName: "hostRef", first: true, predicate: ["host"], descendants: true }], usesOnChanges: true, ngImport: i0, template: '<div #host></div>', isInline: true, styles: [":host{display:block;height:100%}div{height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
402
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: MdzipWorkspaceComponent, isStandalone: true, selector: "mdzip-workspace", inputs: { bytes: "bytes", workspace: "workspace", fileName: "fileName", preserveSelectionOnReopen: "preserveSelectionOnReopen", mode: "mode", sourceFormat: "sourceFormat", worker: "worker", controls: "controls", toolbarDensity: "toolbarDensity", contentDensity: "contentDensity", imageHydrationAnimation: "imageHydrationAnimation", imageInsertMode: "imageInsertMode", imageInsertHandler: "imageInsertHandler", imageEditHandler: "imageEditHandler", initialLayout: "initialLayout", initialColorScheme: "initialColorScheme", previewMaxWidth: "previewMaxWidth", systemColorScheme: "systemColorScheme", progressiveTextRendering: "progressiveTextRendering", inlineSvgLinks: "inlineSvgLinks", hostFileActions: "hostFileActions", navigationMode: "navigationMode", navigationButtonActive: "navigationButtonActive", onConversionRequested: "onConversionRequested", onPackRequested: "onPackRequested", markdownRenderer: "markdownRenderer", markdownExtensions: "markdownExtensions", entryRenderers: "entryRenderers", frontMatter: "frontMatter", externalLinks: "externalLinks" }, outputs: { changed: "changed", saved: "saved", workspaceChanged: "workspaceChanged", documentChanged: "documentChanged", assetChanged: "assetChanged", manifestChanged: "manifestChanged", snapshotChanged: "snapshotChanged", selectionChanged: "selectionChanged", dirtyChanged: "dirtyChanged", validationChanged: "validationChanged", colorSchemeChanged: "colorSchemeChanged", colorSchemePreferenceChanged: "colorSchemePreferenceChanged", previewWidthChanged: "previewWidthChanged", previewRendered: "previewRendered", assetsHydrated: "assetsHydrated", linkActivated: "linkActivated", failed: "failed" }, queries: [{ propertyName: "entryTemplates", predicate: MdzipEntryRendererDirective }], viewQueries: [{ propertyName: "hostRef", first: true, predicate: ["host"], descendants: true }], usesOnChanges: true, ngImport: i0, template: '<div #host></div>', isInline: true, styles: [":host{display:block;height:100%}div{height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
397
403
|
}
|
|
398
404
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: MdzipWorkspaceComponent, decorators: [{
|
|
399
405
|
type: Component,
|
|
@@ -432,8 +438,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImpo
|
|
|
432
438
|
type: Input
|
|
433
439
|
}], previewMaxWidth: [{
|
|
434
440
|
type: Input
|
|
441
|
+
}], systemColorScheme: [{
|
|
442
|
+
type: Input
|
|
435
443
|
}], progressiveTextRendering: [{
|
|
436
444
|
type: Input
|
|
445
|
+
}], inlineSvgLinks: [{
|
|
446
|
+
type: Input
|
|
447
|
+
}], hostFileActions: [{
|
|
448
|
+
type: Input
|
|
437
449
|
}], navigationMode: [{
|
|
438
450
|
type: Input
|
|
439
451
|
}], navigationButtonActive: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdzip-editor-ng.mjs","sources":["../../src/entry-renderer.directive.ts","../../src/package-info.ts","../../src/workspace.component.ts","../../src/diff.component.ts","../../src/mdzip-editor-ng.ts"],"sourcesContent":["import { Directive, Input, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport type { MdzipEntryRenderContext, MdzipEntryRenderer } from '@mdzip/editor';\n\n/** Template context available via `let-context` (also the `$implicit` value). */\nexport interface MdzipEntryRendererTemplateContext {\n $implicit: MdzipEntryRenderContext;\n context: MdzipEntryRenderContext;\n}\n\n/**\n * Declares an entry renderer template inside `<mdzip-workspace>`:\n *\n * ```html\n * <mdzip-workspace [bytes]=\"bytes\" mode=\"editable\">\n * <ng-template mdzipEntryRenderer=\"manifest.json\" let-context>\n * <app-internals [manifest]=\"context.manifest\" />\n * </ng-template>\n * </mdzip-workspace>\n * ```\n *\n * Match either by exact archive path(s) via `mdzipEntryRenderer`, or with a\n * predicate via `[mdzipEntryRendererMatch]`. The embedded view is created in\n * the workspace component's view container (so change detection and\n * dependency injection work normally), its DOM is moved into the editor's\n * entry pane, and the view is destroyed when the selection changes or the\n * workspace is destroyed.\n */\n@Directive({\n selector: 'ng-template[mdzipEntryRenderer], ng-template[mdzipEntryRendererMatch]',\n standalone: true\n})\nexport class MdzipEntryRendererDirective {\n readonly templateRef = inject(TemplateRef<MdzipEntryRendererTemplateContext>);\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /** Exact archive path(s) to claim, case-insensitive. */\n @Input() mdzipEntryRenderer: string | readonly string[] = '';\n /** Predicate alternative for extension/MIME/path-family matching. */\n @Input() mdzipEntryRendererMatch?: (context: MdzipEntryRenderContext) => boolean;\n /** Stable id used for renderer diffing. Defaults to the matched paths. */\n @Input() mdzipEntryRendererId?: string;\n /** Matching priority relative to the `entryRenderers` input. Default 0. */\n @Input() mdzipEntryRendererPriority?: number;\n\n /** Adapts this template onto the framework-independent renderer contract. */\n toEntryRenderer(index: number): MdzipEntryRenderer {\n const paths = (typeof this.mdzipEntryRenderer === 'string'\n ? [this.mdzipEntryRenderer]\n : this.mdzipEntryRenderer\n ).filter((path) => path.length > 0).map((path) => path.toLowerCase());\n\n return {\n id: this.mdzipEntryRendererId\n ?? (paths.length > 0 ? `mdzip-ng-template:${paths.join(',')}` : `mdzip-ng-template#${index}`),\n priority: this.mdzipEntryRendererPriority ?? 0,\n matches: (context) => this.mdzipEntryRendererMatch\n ? this.mdzipEntryRendererMatch(context)\n : paths.includes(context.path.toLowerCase()),\n mount: (container, context) => {\n const templateContext: MdzipEntryRendererTemplateContext = {\n $implicit: context,\n context\n };\n const viewRef = this.viewContainerRef.createEmbeddedView(this.templateRef, templateContext);\n viewRef.detectChanges();\n const movedNodes = [...(viewRef.rootNodes as Node[])];\n for (const node of movedNodes) {\n container.appendChild(node);\n }\n return {\n update: (next) => {\n templateContext.$implicit = next;\n templateContext.context = next;\n viewRef.markForCheck();\n viewRef.detectChanges();\n },\n destroy: () => {\n viewRef.destroy();\n // The nodes were moved out of Angular's host container; make\n // sure none linger if the renderer did not remove them.\n for (const node of movedNodes) {\n node.parentNode?.removeChild(node);\n }\n }\n };\n }\n };\n }\n}\n","// Generated from package.json. Do not edit by hand.\nexport const PACKAGE_INFO = {\n \"name\": \"@mdzip/editor-ng\",\n \"version\": \"2.1.0\",\n \"repositoryUrl\": \"https://github.com/mdzip-project/mdzip-editor/tree/main/packages/editor-ng\",\n \"description\": \"Angular wrapper for the MDZip workspace editor.\"\n} as const;\n","import {\r\n AfterContentInit,\r\n AfterViewInit,\r\n ChangeDetectionStrategy,\r\n Component,\r\n ContentChildren,\r\n ElementRef,\r\n EventEmitter,\r\n Input,\r\n OnChanges,\r\n OnDestroy,\r\n Output,\r\n QueryList,\r\n SimpleChanges,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { MdzipEntryRendererDirective } from './entry-renderer.directive';\r\nimport { PACKAGE_INFO } from './package-info.js';\r\nimport { MdzipWorkspaceView } from '@mdzip/editor';\r\nimport type {\r\n MdzipControlPolicy,\r\n MdzipControlPreset,\r\n MdzipContentDensity,\r\n MdzipColorScheme,\r\n MdzipColorSchemePreference,\r\n MdzipPreviewMaxWidth,\r\n MdzipPreviewWidthChoice,\r\n MdzipConversionAction,\r\n MdzipConversionContext,\r\n MdzipEditorCommand,\r\n MdzipOpenPathOptions,\r\n MdzipPackFilesContext,\r\n MdzipPackFilesInput,\r\n MdzipPackFilesRequest,\r\n MdzipPackFilesResult,\r\n MdzipDocumentChangeEvent,\r\n MdzipEditorSnapshot,\r\n MdzipEntryRenderer,\r\n MdzipExternalLinkPolicy,\r\n MdzipFrontMatterOptions,\r\n MdzipLinkActivatedEvent,\r\n MdzipMarkdownRenderExtension,\r\n MdzipMarkdownRenderer,\r\n MdzipImageEditHandler,\r\n MdzipImageHydrationAnimation,\r\n MdzipImageInsertHandler,\r\n MdzipImageInsertMode,\r\n MdzipNavigationMode,\r\n MdzipRemoveAssetOptions,\r\n MdzipSourceFormat,\r\n MdzipToolbarDensity,\r\n MdzWorkspace,\r\n MdzWorkspaceAsset,\r\n MdzipWorkspaceChange,\r\n MdzipWorkspaceLayout,\r\n MdzipWorkspaceMode,\r\n MdzipWorkspaceSave,\r\n MdzipWorkspaceSnapshot,\r\n} from '@mdzip/editor';\r\n\r\n// Identity-insensitive key for the rendering inputs: extensions and entry\r\n// renderers are diffed by their stable name/id (and priority), so template\r\n// expressions that build new arrays each change-detection cycle never\r\n// trigger an update.\r\nfunction renderingConfigKey(\r\n extensions: readonly MdzipMarkdownRenderExtension[],\r\n entryRenderers: readonly MdzipEntryRenderer[],\r\n frontMatter: MdzipFrontMatterOptions\r\n): string {\r\n return JSON.stringify([\r\n extensions.map((extension) => extension.name),\r\n entryRenderers.map((renderer) => [renderer.id, renderer.priority ?? 0]),\r\n // frontMatter carries no functions, so plain deep equality via\r\n // JSON.stringify is enough — no need for the name/id treatment above.\r\n frontMatter,\r\n ]);\r\n}\r\n\r\n@Component({\r\n selector: 'mdzip-workspace',\r\n standalone: true,\r\n template: '<div #host></div>',\r\n styles: [':host { display: block; height: 100%; } div { height: 100%; }'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit, OnChanges, OnDestroy {\r\n @Input() bytes: Uint8Array | null = null;\r\n @Input() workspace: MdzWorkspace | null = null;\r\n @Input() fileName = 'document.mdz';\r\n /**\r\n * When `bytes` or `workspace` change and the workspace reopens, show the file\r\n * the user was on (if it's still there) instead of the entry point (#51).\r\n * A `fileName`-only change never reopens; the name is updated in place.\r\n */\r\n @Input() preserveSelectionOnReopen = false;\r\n @Input() mode: MdzipWorkspaceMode = 'read-only';\r\n @Input() sourceFormat?: MdzipSourceFormat;\r\n /**\r\n * Dedicated Worker running `@mdzip/editor`'s `mdz-archive.worker.js`. When\r\n * provided, archive parsing and reads happen off the main thread instead of\r\n * blocking it — recommended for large archives. The host constructs the\r\n * `Worker` (asset URL resolution varies by build tooling); this component\r\n * forwards it to `MdzipWorkspaceService` unchanged and does not own its\r\n * lifecycle beyond that.\r\n */\r\n @Input() worker?: Worker;\r\n @Input() controls: MdzipControlPreset | MdzipControlPolicy = 'viewer';\r\n @Input() toolbarDensity?: MdzipToolbarDensity;\r\n @Input() contentDensity?: MdzipContentDensity;\r\n @Input() imageHydrationAnimation?: MdzipImageHydrationAnimation;\r\n @Input() imageInsertMode?: MdzipImageInsertMode;\r\n @Input() imageInsertHandler?: MdzipImageInsertHandler;\r\n @Input() imageEditHandler?: MdzipImageEditHandler;\r\n @Input() initialLayout?: MdzipWorkspaceLayout;\r\n @Input() initialColorScheme?: MdzipColorSchemePreference;\r\n /** Preview reading-column width; the user can change it from the toolbar's page-width menu. */\r\n @Input() previewMaxWidth?: MdzipPreviewMaxWidth;\r\n /**\r\n * Mounts the preview in chunks near the viewport instead of rendering the\r\n * whole document synchronously up front. Recommended for hosts that may\r\n * open very large documents. Defaults to `false`. Constructor-only, like\r\n * `initialColorScheme` — changing it recreates the view.\r\n */\r\n @Input() progressiveTextRendering?: boolean;\r\n @Input() navigationMode: MdzipNavigationMode = 'editor';\r\n @Input() navigationButtonActive = true;\r\n /**\r\n * Host hook for the markdown→MDZ conversion flow. An input function (not an\r\n * output) because it must return/resolve `true` to suppress the built-in\r\n * conversion dialog.\r\n */\r\n @Input() onConversionRequested?: (\r\n action: MdzipConversionAction,\r\n context: MdzipConversionContext\r\n ) => boolean | Promise<boolean>;\r\n /**\r\n * Host hook for the folder→.mdz packing decision surfaced by\r\n * `packFilesAsWorkspace()`. Same input-not-output reasoning as\r\n * `onConversionRequested`.\r\n */\r\n @Input() onPackRequested?: (\r\n request: MdzipPackFilesRequest,\r\n context: MdzipPackFilesContext\r\n ) => boolean | Promise<boolean>;\r\n /**\r\n * Custom markdown renderer. Keep the reference stable: identity changes\r\n * apply via a cheap preview re-render, never a workspace rebuild.\r\n */\r\n @Input() markdownRenderer?: MdzipMarkdownRenderer;\r\n /** Markdown pipeline extensions, diffed by `name`. */\r\n @Input() markdownExtensions: readonly MdzipMarkdownRenderExtension[] = [];\r\n /** Entry renderers, diffed by `id`/`priority`. */\r\n @Input() entryRenderers: readonly MdzipEntryRenderer[] = [];\r\n /**\r\n * Controls how a leading `---`-delimited YAML front matter block renders\r\n * in the preview — display (table/raw), the collapsible expander, and its\r\n * label. Front matter handling is always registered (unlike\r\n * `markdownExtensions`); this only configures it. Diffed by deep equality\r\n * — object literals produced fresh each change-detection cycle are safe.\r\n */\r\n @Input() frontMatter: MdzipFrontMatterOptions = {};\r\n /**\r\n * Rendering policy for external links in the preview, e.g.\r\n * `{ target: '_blank' }` (adds `rel=\"noopener noreferrer\"` by default).\r\n * Changes re-apply to the mounted preview without a re-render.\r\n */\r\n @Input() externalLinks?: MdzipExternalLinkPolicy;\r\n @Output() readonly changed = new EventEmitter<MdzipWorkspaceChange>();\r\n @Output() readonly saved = new EventEmitter<MdzipWorkspaceSave>();\r\n @Output() readonly workspaceChanged = new EventEmitter<MdzipDocumentChangeEvent>();\r\n @Output() readonly documentChanged = new EventEmitter<MdzipDocumentChangeEvent>();\r\n @Output() readonly assetChanged = new EventEmitter<MdzipDocumentChangeEvent>();\r\n @Output() readonly manifestChanged = new EventEmitter<MdzipDocumentChangeEvent>();\r\n @Output() readonly snapshotChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n @Output() readonly selectionChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n @Output() readonly dirtyChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n @Output() readonly validationChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n @Output() readonly colorSchemeChanged = new EventEmitter<MdzipColorScheme>();\r\n /** Emits the user's Light / Dark / System choice from the toolbar menu. */\r\n @Output() readonly colorSchemePreferenceChanged = new EventEmitter<MdzipColorSchemePreference>();\r\n /** Emits the user's choice from the toolbar's page-width menu. */\r\n @Output() readonly previewWidthChanged = new EventEmitter<MdzipPreviewWidthChoice>();\r\n /** Emits when the preview HTML for the current selection is mounted. */\r\n @Output() readonly previewRendered = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n /** Emits once the mounted preview's images have finished loading. */\r\n @Output() readonly assetsHydrated = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n /**\r\n * Emits for every click on a preview link, before the view's own handling.\r\n * Call `event.preventDefault()` in the handler to take over navigation.\r\n */\r\n @Output() readonly linkActivated = new EventEmitter<MdzipLinkActivatedEvent>();\r\n @Output() readonly failed = new EventEmitter<unknown>();\r\n\r\n @ViewChild('host') private readonly hostRef!: ElementRef<HTMLDivElement>;\r\n /**\r\n * `<ng-template mdzipEntryRenderer>` declarations projected into the\r\n * component. Each becomes an entry renderer appended after the\r\n * `entryRenderers` input (stable sort keeps the input ahead at equal\r\n * priority).\r\n */\r\n @ContentChildren(MdzipEntryRendererDirective)\r\n private readonly entryTemplates!: QueryList<MdzipEntryRendererDirective>;\r\n private view: MdzipWorkspaceView | null = null;\r\n private renderingKey = '';\r\n private entryTemplatesSub: { unsubscribe(): void } | null = null;\r\n\r\n ngAfterContentInit(): void {\r\n this.entryTemplatesSub = this.entryTemplates.changes.subscribe(() => {\r\n this.applyRenderingOptions(false);\r\n });\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n this.createView();\r\n this.syncView();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (this.view && (changes['initialLayout'] || changes['initialColorScheme'] || changes['progressiveTextRendering']\r\n || changes['navigationMode'] || changes['navigationButtonActive'])) {\r\n this.createView();\r\n this.syncView();\r\n return;\r\n }\r\n if (this.view && changes['controls']) {\r\n this.view.setControls(this.controls);\r\n }\r\n if (this.view && (changes['toolbarDensity'] || changes['contentDensity'])) {\r\n this.view.setDensityOptions({\r\n toolbarDensity: this.toolbarDensity,\r\n contentDensity: this.contentDensity,\r\n });\r\n }\r\n if (this.view && changes['previewMaxWidth']) {\r\n this.view.setPreviewMaxWidth(this.previewMaxWidth);\r\n }\r\n if (this.view && changes['imageHydrationAnimation']) {\r\n this.view.setImageHydrationAnimation(this.imageHydrationAnimation);\r\n }\r\n if (this.view && (changes['imageInsertMode'] || changes['imageInsertHandler'])) {\r\n this.view.setImageInsertOptions({\r\n imageInsertMode: this.imageInsertMode,\r\n imageInsertHandler: (request) => this.imageInsertHandler?.(request),\r\n });\r\n }\r\n if (this.view && changes['imageEditHandler']) {\r\n this.view.setImageEditOptions({\r\n imageEditHandler: (request) => this.imageEditHandler?.(request),\r\n });\r\n }\r\n if (this.view && changes['externalLinks']) {\r\n this.view.setExternalLinks(this.externalLinks);\r\n }\r\n if (this.view && (changes['bytes'] || changes['workspace'] || changes['mode']\r\n || changes['sourceFormat'] || changes['fileName'] || changes['worker'])) {\r\n const renameOnly = changes['fileName'] && !changes['fileName'].firstChange\r\n && !changes['bytes'] && !changes['workspace'] && !changes['mode']\r\n && !changes['sourceFormat'] && !changes['worker'];\r\n if (!(renameOnly && this.view.setFileName(this.fileName))) {\r\n this.syncView(this.preserveSelectionOnReopen);\r\n }\r\n }\r\n if (this.view && (changes['markdownRenderer'] || changes['markdownExtensions']\r\n || changes['entryRenderers'] || changes['frontMatter'])) {\r\n this.applyRenderingOptions(Boolean(changes['markdownRenderer']));\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.entryTemplatesSub?.unsubscribe();\r\n this.view?.destroy();\r\n }\r\n\r\n canExecuteCommand(command: MdzipEditorCommand): boolean {\r\n return this.view?.canExecuteCommand(command) ?? false;\r\n }\r\n\r\n executeCommand(command: MdzipEditorCommand, file?: File): Promise<boolean> {\r\n return this.view?.executeCommand(command, file) ?? Promise.resolve(false);\r\n }\r\n\r\n convertToMdz(): Promise<boolean> {\r\n return this.view?.convertToMdz() ?? Promise.resolve(false);\r\n }\r\n\r\n focus(): void {\r\n this.view?.focus();\r\n }\r\n\r\n setColorScheme(scheme: MdzipColorSchemePreference): void {\r\n this.view?.setColorScheme(scheme);\r\n }\r\n\r\n flush(): Promise<MdzipEditorSnapshot | null> {\r\n return this.view?.flush() ?? Promise.resolve(null);\r\n }\r\n\r\n serialize(): Promise<Blob | null> {\r\n return this.view?.serialize() ?? Promise.resolve(null);\r\n }\r\n\r\n getCurrentSnapshot(): Promise<MdzipEditorSnapshot | null> {\r\n return this.view?.getCurrentSnapshot() ?? Promise.resolve(null);\r\n }\r\n\r\n whenRendered(): Promise<void> {\r\n return this.view?.whenRendered() ?? Promise.resolve();\r\n }\r\n\r\n /** See `MdzipWorkspaceView.scrollToAnchor` — waits for the preview to mount. */\r\n scrollToAnchor(anchor: string): Promise<boolean> {\r\n return this.view?.scrollToAnchor(anchor) ?? Promise.resolve(false);\r\n }\r\n\r\n getAvailableAnchors(): string[] {\r\n return this.view?.getAvailableAnchors() ?? [];\r\n }\r\n\r\n /** See `MdzipWorkspaceView.openPath` — opens another file, optionally at an anchor. */\r\n openPath(path: string, options?: MdzipOpenPathOptions): Promise<boolean> {\r\n return this.view?.openPath(path, options) ?? Promise.resolve(false);\r\n }\r\n\r\n /** The archive path of the file currently shown, or null before a workspace opens. */\r\n getCurrentPath(): string | null {\r\n return this.view?.getCurrentPath() ?? null;\r\n }\r\n\r\n markPersisted(): void {\r\n this.view?.markPersisted();\r\n }\r\n\r\n addAsset(archivePath: string, fileBytes: Uint8Array): Promise<void> {\r\n return this.view?.addAsset(archivePath, fileBytes) ?? Promise.resolve();\r\n }\r\n\r\n replaceAsset(archivePath: string, fileBytes: Uint8Array): Promise<boolean> {\r\n return this.view?.replaceAsset(archivePath, fileBytes) ?? Promise.resolve(false);\r\n }\r\n\r\n removeAsset(archivePath: string, options?: MdzipRemoveAssetOptions): Promise<boolean> {\r\n return this.view?.removeAsset(archivePath, options) ?? Promise.resolve(false);\r\n }\r\n\r\n removeFile(archivePath: string): Promise<boolean> {\r\n return this.view?.removeFile(archivePath) ?? Promise.resolve(false);\r\n }\r\n\r\n renameFile(oldPath: string, newPath: string): Promise<boolean> {\r\n return this.view?.renameFile(oldPath, newPath) ?? Promise.resolve(false);\r\n }\r\n\r\n setEntryPoint(archivePath: string): Promise<boolean> {\r\n return this.view?.setEntryPoint(archivePath) ?? Promise.resolve(false);\r\n }\r\n\r\n packFilesAsWorkspace(\r\n files: readonly MdzipPackFilesInput[],\r\n options?: { title?: string; fileName?: string }\r\n ): Promise<MdzipPackFilesResult | null> {\r\n return this.view?.packFilesAsWorkspace(files, options) ?? Promise.resolve(null);\r\n }\r\n\r\n setCoverImage(archivePath: string | null): Promise<boolean> {\r\n return this.view?.setCoverImage(archivePath) ?? Promise.resolve(false);\r\n }\r\n\r\n listAssets(): MdzWorkspaceAsset[] {\r\n return this.view?.listAssets() ?? [];\r\n }\r\n\r\n private syncView(preserveSelection = false): void {\r\n const initialPath = preserveSelection ? this.view?.getCurrentPath() ?? undefined : undefined;\r\n if (this.view && this.workspace) {\r\n void this.view.openWorkspace(this.workspace, {\r\n mode: this.mode,\r\n sourceFormat: this.sourceFormat,\r\n fileName: this.fileName,\r\n worker: this.worker,\r\n initialPath\r\n });\r\n } else if (this.view && this.bytes) {\r\n void this.view.open(this.bytes, {\r\n mode: this.mode,\r\n sourceFormat: this.sourceFormat,\r\n fileName: this.fileName,\r\n worker: this.worker,\r\n initialPath\r\n });\r\n }\r\n }\r\n\r\n private createView(): void {\r\n this.view?.destroy();\r\n this.view = new MdzipWorkspaceView(this.hostRef.nativeElement, {\r\n libraries: [PACKAGE_INFO],\r\n controls: this.controls,\r\n toolbarDensity: this.toolbarDensity,\r\n contentDensity: this.contentDensity,\r\n imageHydrationAnimation: this.imageHydrationAnimation,\r\n imageInsertMode: this.imageInsertMode,\r\n initialLayout: this.initialLayout,\r\n initialColorScheme: this.initialColorScheme,\r\n previewMaxWidth: this.previewMaxWidth,\r\n progressiveTextRendering: this.progressiveTextRendering,\r\n navigationMode: this.navigationMode,\r\n navigationButtonActive: this.navigationButtonActive,\r\n onChanged: (bytes, snapshot) => this.changed.emit({ bytes, snapshot }),\r\n onSaved: (bytes, snapshot) => this.saved.emit({ bytes, snapshot }),\r\n onWorkspaceChanged: (event) => this.workspaceChanged.emit(event),\r\n onDocumentChanged: (event) => this.documentChanged.emit(event),\r\n onAssetChanged: (event) => this.assetChanged.emit(event),\r\n onManifestChanged: (event) => this.manifestChanged.emit(event),\r\n onSnapshotChanged: (snapshot) => this.snapshotChanged.emit(snapshot),\r\n onSelectionChanged: (snapshot: MdzipWorkspaceSnapshot) => this.selectionChanged.emit(snapshot),\r\n onDirtyChanged: (snapshot: MdzipWorkspaceSnapshot) => this.dirtyChanged.emit(snapshot),\r\n onValidationChanged: (snapshot: MdzipWorkspaceSnapshot) => this.validationChanged.emit(snapshot),\r\n onColorSchemeChanged: (colorScheme: MdzipColorScheme) => this.colorSchemeChanged.emit(colorScheme),\r\n onColorSchemePreferenceChanged: (preference: MdzipColorSchemePreference) =>\r\n this.colorSchemePreferenceChanged.emit(preference),\r\n onPreviewWidthChanged: (width: MdzipPreviewWidthChoice) => this.previewWidthChanged.emit(width),\r\n onPreviewRendered: (snapshot: MdzipWorkspaceSnapshot) => this.previewRendered.emit(snapshot),\r\n onAssetsHydrated: (snapshot: MdzipWorkspaceSnapshot) => this.assetsHydrated.emit(snapshot),\r\n onLinkActivated: (event: MdzipLinkActivatedEvent) => this.linkActivated.emit(event),\r\n externalLinks: this.externalLinks,\r\n onFailed: (e: unknown) => this.failed.emit(e),\r\n onConversionRequested: this.onConversionRequested\r\n ? (action, context) => this.onConversionRequested!(action, context)\r\n : undefined,\r\n onPackRequested: this.onPackRequested\r\n ? (request, context) => this.onPackRequested!(request, context)\r\n : undefined,\r\n imageInsertHandler: (request) => this.imageInsertHandler?.(request),\r\n imageEditHandler: (request) => this.imageEditHandler?.(request),\r\n markdownRenderer: this.markdownRenderer,\r\n markdownExtensions: this.markdownExtensions,\r\n entryRenderers: this.composedEntryRenderers(),\r\n frontMatter: this.frontMatter,\r\n });\r\n this.renderingKey = renderingConfigKey(this.markdownExtensions, this.composedEntryRenderers(), this.frontMatter);\r\n }\r\n\r\n private composedEntryRenderers(): readonly MdzipEntryRenderer[] {\r\n const templates = this.entryTemplates\r\n ? this.entryTemplates.map((directive, index) => directive.toEntryRenderer(index))\r\n : [];\r\n return [...this.entryRenderers, ...templates];\r\n }\r\n\r\n // Applies rendering input changes in place — never a view rebuild. Arrays\r\n // re-apply only when their name/id key changes, so template expressions\r\n // that produce new array identities each cycle are safe.\r\n private applyRenderingOptions(rendererChanged: boolean): void {\r\n const composed = this.composedEntryRenderers();\r\n const key = renderingConfigKey(this.markdownExtensions, composed, this.frontMatter);\r\n if (!rendererChanged && key === this.renderingKey) {\r\n return;\r\n }\r\n this.renderingKey = key;\r\n this.view?.setRenderingOptions({\r\n markdownRenderer: this.markdownRenderer ?? null,\r\n markdownExtensions: this.markdownExtensions,\r\n entryRenderers: composed,\r\n frontMatter: this.frontMatter,\r\n });\r\n }\r\n}\r\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport type {\n MdzipDiffControlsOptions,\n MdzipDiffSelectionEvent,\n MdzipDiffSideInput,\n MdzipDiffToolbarAction,\n MdzipDiffView,\n MdzipDiffViewOptions\n} from '@mdzip/editor/diff-view';\n\n@Component({\n selector: 'mdzip-diff',\n standalone: true,\n template: '<div #host></div>',\n styles: [':host { display:block; height:100%; } div { height:100%; }'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MdzipDiffComponent implements AfterViewInit, OnChanges, OnDestroy {\n @Input({ required: true }) before!: MdzipDiffSideInput;\n @Input({ required: true }) after!: MdzipDiffSideInput;\n @Input() initialPath?: string;\n @Input() showUnchanged = true;\n @Input() navigationVisible = true;\n @Input() controls?: MdzipDiffControlsOptions;\n @Input() toolbarActions: readonly MdzipDiffToolbarAction[] = [];\n @Output() readonly selectionChanged = new EventEmitter<MdzipDiffSelectionEvent>();\n @Output() readonly failed = new EventEmitter<Error>();\n\n @ViewChild('host') private readonly hostRef!: ElementRef<HTMLDivElement>;\n private view: MdzipDiffView | null = null;\n private destroyed = false;\n\n ngAfterViewInit(): void {\n void this.createView();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.view) return;\n if (changes['before'] || changes['after'] || changes['initialPath']) {\n void this.view.open(this.options());\n }\n if (changes['showUnchanged']) this.view.setShowUnchanged(this.showUnchanged);\n if (changes['navigationVisible']) this.view.setNavigationVisible(this.navigationVisible);\n if (changes['toolbarActions']) this.view.setToolbarActions(this.toolbarActions);\n }\n\n ngOnDestroy(): void {\n this.destroyed = true;\n this.view?.destroy();\n this.view = null;\n }\n\n openPath(path: string): Promise<boolean> {\n return this.view?.openPath(path) ?? Promise.resolve(false);\n }\n\n openPreviousChange(): Promise<boolean> {\n return this.view?.openPreviousChange() ?? Promise.resolve(false);\n }\n\n openNextChange(): Promise<boolean> {\n return this.view?.openNextChange() ?? Promise.resolve(false);\n }\n\n setShowUnchanged(show: boolean): void {\n this.view?.setShowUnchanged(show);\n }\n\n setNavigationVisible(visible: boolean): void {\n this.view?.setNavigationVisible(visible);\n }\n\n setToolbarActions(actions: readonly MdzipDiffToolbarAction[]): void {\n this.view?.setToolbarActions(actions);\n }\n\n private async createView(): Promise<void> {\n const { MdzipDiffView } = await import('@mdzip/editor/diff-view');\n if (this.destroyed) return;\n this.view = new MdzipDiffView(this.hostRef.nativeElement, this.options());\n }\n\n private options(): MdzipDiffViewOptions {\n return {\n before: this.before,\n after: this.after,\n initialPath: this.initialPath,\n showUnchanged: this.showUnchanged,\n navigationVisible: this.navigationVisible,\n controls: this.controls,\n toolbarActions: this.toolbarActions,\n onSelectionChanged: (event) => this.selectionChanged.emit(event),\n onFailed: (error) => this.failed.emit(error)\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AASA;;;;;;;;;;;;;;;;;AAiBG;MAKU,2BAA2B,CAAA;AAJxC,IAAA,WAAA,GAAA;AAKW,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,EAAC,WAA8C,EAAC;AAC5D,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;;QAGnD,IAAA,CAAA,kBAAkB,GAA+B,EAAE;AAoD7D,IAAA;;AA3CC,IAAA,eAAe,CAAC,KAAa,EAAA;QAC3B,MAAM,KAAK,GAAG,CAAC,OAAO,IAAI,CAAC,kBAAkB,KAAK;AAChD,cAAE,CAAC,IAAI,CAAC,kBAAkB;AAC1B,cAAE,IAAI,CAAC,kBAAkB,EACzB,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;QAErE,OAAO;YACL,EAAE,EAAE,IAAI,CAAC;oBACH,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,CAAA,kBAAA,EAAqB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAE,GAAG,CAAA,kBAAA,EAAqB,KAAK,CAAA,CAAE,CAAC;AAC/F,YAAA,QAAQ,EAAE,IAAI,CAAC,0BAA0B,IAAI,CAAC;YAC9C,OAAO,EAAE,CAA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AAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,kBAAkB,2cAJnB,mBAAmB,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,oDAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAIlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAP9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,cACV,IAAI,EAAA,QAAA,EACN,mBAAmB,EAAA,eAAA,EAEZ,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,oDAAA,CAAA,EAAA;;sBAG9C,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBACxB,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBACxB;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA,SAAS;uBAAC,MAAM;;;ACxCnB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mdzip-editor-ng.mjs","sources":["../../src/entry-renderer.directive.ts","../../src/package-info.ts","../../src/workspace.component.ts","../../src/diff.component.ts","../../src/mdzip-editor-ng.ts"],"sourcesContent":["import { Directive, Input, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport type { MdzipEntryRenderContext, MdzipEntryRenderer } from '@mdzip/editor';\n\n/** Template context available via `let-context` (also the `$implicit` value). */\nexport interface MdzipEntryRendererTemplateContext {\n $implicit: MdzipEntryRenderContext;\n context: MdzipEntryRenderContext;\n}\n\n/**\n * Declares an entry renderer template inside `<mdzip-workspace>`:\n *\n * ```html\n * <mdzip-workspace [bytes]=\"bytes\" mode=\"editable\">\n * <ng-template mdzipEntryRenderer=\"manifest.json\" let-context>\n * <app-internals [manifest]=\"context.manifest\" />\n * </ng-template>\n * </mdzip-workspace>\n * ```\n *\n * Match either by exact archive path(s) via `mdzipEntryRenderer`, or with a\n * predicate via `[mdzipEntryRendererMatch]`. The embedded view is created in\n * the workspace component's view container (so change detection and\n * dependency injection work normally), its DOM is moved into the editor's\n * entry pane, and the view is destroyed when the selection changes or the\n * workspace is destroyed.\n */\n@Directive({\n selector: 'ng-template[mdzipEntryRenderer], ng-template[mdzipEntryRendererMatch]',\n standalone: true\n})\nexport class MdzipEntryRendererDirective {\n readonly templateRef = inject(TemplateRef<MdzipEntryRendererTemplateContext>);\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /** Exact archive path(s) to claim, case-insensitive. */\n @Input() mdzipEntryRenderer: string | readonly string[] = '';\n /** Predicate alternative for extension/MIME/path-family matching. */\n @Input() mdzipEntryRendererMatch?: (context: MdzipEntryRenderContext) => boolean;\n /** Stable id used for renderer diffing. Defaults to the matched paths. */\n @Input() mdzipEntryRendererId?: string;\n /** Matching priority relative to the `entryRenderers` input. Default 0. */\n @Input() mdzipEntryRendererPriority?: number;\n\n /** Adapts this template onto the framework-independent renderer contract. */\n toEntryRenderer(index: number): MdzipEntryRenderer {\n const paths = (typeof this.mdzipEntryRenderer === 'string'\n ? [this.mdzipEntryRenderer]\n : this.mdzipEntryRenderer\n ).filter((path) => path.length > 0).map((path) => path.toLowerCase());\n\n return {\n id: this.mdzipEntryRendererId\n ?? (paths.length > 0 ? `mdzip-ng-template:${paths.join(',')}` : `mdzip-ng-template#${index}`),\n priority: this.mdzipEntryRendererPriority ?? 0,\n matches: (context) => this.mdzipEntryRendererMatch\n ? this.mdzipEntryRendererMatch(context)\n : paths.includes(context.path.toLowerCase()),\n mount: (container, context) => {\n const templateContext: MdzipEntryRendererTemplateContext = {\n $implicit: context,\n context\n };\n const viewRef = this.viewContainerRef.createEmbeddedView(this.templateRef, templateContext);\n viewRef.detectChanges();\n const movedNodes = [...(viewRef.rootNodes as Node[])];\n for (const node of movedNodes) {\n container.appendChild(node);\n }\n return {\n update: (next) => {\n templateContext.$implicit = next;\n templateContext.context = next;\n viewRef.markForCheck();\n viewRef.detectChanges();\n },\n destroy: () => {\n viewRef.destroy();\n // The nodes were moved out of Angular's host container; make\n // sure none linger if the renderer did not remove them.\n for (const node of movedNodes) {\n node.parentNode?.removeChild(node);\n }\n }\n };\n }\n };\n }\n}\n","// Generated from package.json. Do not edit by hand.\nexport const PACKAGE_INFO = {\n \"name\": \"@mdzip/editor-ng\",\n \"version\": \"2.3.0\",\n \"repositoryUrl\": \"https://github.com/mdzip-project/mdzip-editor/tree/main/packages/editor-ng\",\n \"description\": \"Angular wrapper for the MDZip workspace editor.\"\n} as const;\n","import {\r\n AfterContentInit,\r\n AfterViewInit,\r\n ChangeDetectionStrategy,\r\n Component,\r\n ContentChildren,\r\n ElementRef,\r\n EventEmitter,\r\n Input,\r\n OnChanges,\r\n OnDestroy,\r\n Output,\r\n QueryList,\r\n SimpleChanges,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { MdzipEntryRendererDirective } from './entry-renderer.directive';\r\nimport { PACKAGE_INFO } from './package-info.js';\r\nimport { MdzipWorkspaceView } from '@mdzip/editor';\r\nimport type {\r\n MdzipControlPolicy,\r\n MdzipControlPreset,\r\n MdzipContentDensity,\r\n MdzipColorScheme,\r\n MdzipColorSchemePreference,\r\n MdzipPreviewMaxWidth,\r\n MdzipPreviewWidthChoice,\r\n MdzipSystemColorScheme,\r\n MdzipConversionAction,\r\n MdzipConversionContext,\r\n MdzipEditorCommand,\r\n MdzipOpenPathOptions,\r\n MdzipPackFilesContext,\r\n MdzipPackFilesInput,\r\n MdzipPackFilesRequest,\r\n MdzipPackFilesResult,\r\n MdzipDocumentChangeEvent,\r\n MdzipEditorSnapshot,\r\n MdzipEntryRenderer,\r\n MdzipExternalLinkPolicy,\r\n MdzipFrontMatterOptions,\r\n MdzipLinkActivatedEvent,\r\n MdzipMarkdownRenderExtension,\r\n MdzipMarkdownRenderer,\r\n MdzipImageEditHandler,\r\n MdzipImageHydrationAnimation,\r\n MdzipImageInsertHandler,\r\n MdzipImageInsertMode,\r\n MdzipNavigationMode,\r\n MdzipRemoveAssetOptions,\r\n MdzipSourceFormat,\r\n MdzipToolbarDensity,\r\n MdzWorkspace,\r\n MdzWorkspaceAsset,\r\n MdzipWorkspaceChange,\r\n MdzipWorkspaceLayout,\r\n MdzipWorkspaceMode,\r\n MdzipWorkspaceSave,\r\n MdzipWorkspaceSnapshot,\r\n MdzipFileAction,\r\n} from '@mdzip/editor';\r\n\r\n// Identity-insensitive key for the rendering inputs: extensions and entry\r\n// renderers are diffed by their stable name/id (and priority), so template\r\n// expressions that build new arrays each change-detection cycle never\r\n// trigger an update.\r\nfunction renderingConfigKey(\r\n extensions: readonly MdzipMarkdownRenderExtension[],\r\n entryRenderers: readonly MdzipEntryRenderer[],\r\n frontMatter: MdzipFrontMatterOptions\r\n): string {\r\n return JSON.stringify([\r\n extensions.map((extension) => extension.name),\r\n entryRenderers.map((renderer) => [renderer.id, renderer.priority ?? 0]),\r\n // frontMatter carries no functions, so plain deep equality via\r\n // JSON.stringify is enough — no need for the name/id treatment above.\r\n frontMatter,\r\n ]);\r\n}\r\n\r\n@Component({\r\n selector: 'mdzip-workspace',\r\n standalone: true,\r\n template: '<div #host></div>',\r\n styles: [':host { display: block; height: 100%; } div { height: 100%; }'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit, OnChanges, OnDestroy {\r\n @Input() bytes: Uint8Array | null = null;\r\n @Input() workspace: MdzWorkspace | null = null;\r\n @Input() fileName = 'document.mdz';\r\n /**\r\n * When `bytes` or `workspace` change and the workspace reopens, show the file\r\n * the user was on (if it's still there) instead of the entry point (#51).\r\n * A `fileName`-only change never reopens; the name is updated in place.\r\n */\r\n @Input() preserveSelectionOnReopen = false;\r\n @Input() mode: MdzipWorkspaceMode = 'read-only';\r\n @Input() sourceFormat?: MdzipSourceFormat;\r\n /**\r\n * Dedicated Worker running `@mdzip/editor`'s `mdz-archive.worker.js`. When\r\n * provided, archive parsing and reads happen off the main thread instead of\r\n * blocking it — recommended for large archives. The host constructs the\r\n * `Worker` (asset URL resolution varies by build tooling); this component\r\n * forwards it to `MdzipWorkspaceService` unchanged and does not own its\r\n * lifecycle beyond that.\r\n */\r\n @Input() worker?: Worker;\r\n @Input() controls: MdzipControlPreset | MdzipControlPolicy = 'viewer';\r\n @Input() toolbarDensity?: MdzipToolbarDensity;\r\n @Input() contentDensity?: MdzipContentDensity;\r\n @Input() imageHydrationAnimation?: MdzipImageHydrationAnimation;\r\n @Input() imageInsertMode?: MdzipImageInsertMode;\r\n @Input() imageInsertHandler?: MdzipImageInsertHandler;\r\n @Input() imageEditHandler?: MdzipImageEditHandler;\r\n @Input() initialLayout?: MdzipWorkspaceLayout;\r\n @Input() initialColorScheme?: MdzipColorSchemePreference;\r\n /** Preview reading-column width; the user can change it from the toolbar's page-width menu. */\r\n @Input() previewMaxWidth?: MdzipPreviewMaxWidth;\r\n /** What the color scheme menu's System choice follows instead of the OS setting (a host theme), with its own label and icon. */\r\n @Input() systemColorScheme?: MdzipSystemColorScheme;\r\n /**\r\n * Mounts the preview in chunks near the viewport instead of rendering the\r\n * whole document synchronously up front. Recommended for hosts that may\r\n * open very large documents. Defaults to `false`. Constructor-only, like\r\n * `initialColorScheme` — changing it recreates the view.\r\n */\r\n @Input() progressiveTextRendering?: boolean;\r\n /**\r\n * Shows archive SVGs that contain links inline, so the links can be\r\n * clicked (see the view option). Defaults to `true`. Constructor-only.\r\n */\r\n @Input() inlineSvgLinks?: boolean;\r\n /** Extra file tree menu items for files, run by the host (see the view option). Read when the view is created. */\r\n @Input() hostFileActions?: readonly MdzipFileAction[];\r\n @Input() navigationMode: MdzipNavigationMode = 'editor';\r\n @Input() navigationButtonActive = true;\r\n /**\r\n * Host hook for the markdown→MDZ conversion flow. An input function (not an\r\n * output) because it must return/resolve `true` to suppress the built-in\r\n * conversion dialog.\r\n */\r\n @Input() onConversionRequested?: (\r\n action: MdzipConversionAction,\r\n context: MdzipConversionContext\r\n ) => boolean | Promise<boolean>;\r\n /**\r\n * Host hook for the folder→.mdz packing decision surfaced by\r\n * `packFilesAsWorkspace()`. Same input-not-output reasoning as\r\n * `onConversionRequested`.\r\n */\r\n @Input() onPackRequested?: (\r\n request: MdzipPackFilesRequest,\r\n context: MdzipPackFilesContext\r\n ) => boolean | Promise<boolean>;\r\n /**\r\n * Custom markdown renderer. Keep the reference stable: identity changes\r\n * apply via a cheap preview re-render, never a workspace rebuild.\r\n */\r\n @Input() markdownRenderer?: MdzipMarkdownRenderer;\r\n /** Markdown pipeline extensions, diffed by `name`. */\r\n @Input() markdownExtensions: readonly MdzipMarkdownRenderExtension[] = [];\r\n /** Entry renderers, diffed by `id`/`priority`. */\r\n @Input() entryRenderers: readonly MdzipEntryRenderer[] = [];\r\n /**\r\n * Controls how a leading `---`-delimited YAML front matter block renders\r\n * in the preview — display (table/raw), the collapsible expander, and its\r\n * label. Front matter handling is always registered (unlike\r\n * `markdownExtensions`); this only configures it. Diffed by deep equality\r\n * — object literals produced fresh each change-detection cycle are safe.\r\n */\r\n @Input() frontMatter: MdzipFrontMatterOptions = {};\r\n /**\r\n * Rendering policy for external links in the preview, e.g.\r\n * `{ target: '_blank' }` (adds `rel=\"noopener noreferrer\"` by default).\r\n * Changes re-apply to the mounted preview without a re-render.\r\n */\r\n @Input() externalLinks?: MdzipExternalLinkPolicy;\r\n @Output() readonly changed = new EventEmitter<MdzipWorkspaceChange>();\r\n @Output() readonly saved = new EventEmitter<MdzipWorkspaceSave>();\r\n @Output() readonly workspaceChanged = new EventEmitter<MdzipDocumentChangeEvent>();\r\n @Output() readonly documentChanged = new EventEmitter<MdzipDocumentChangeEvent>();\r\n @Output() readonly assetChanged = new EventEmitter<MdzipDocumentChangeEvent>();\r\n @Output() readonly manifestChanged = new EventEmitter<MdzipDocumentChangeEvent>();\r\n @Output() readonly snapshotChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n @Output() readonly selectionChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n @Output() readonly dirtyChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n @Output() readonly validationChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n @Output() readonly colorSchemeChanged = new EventEmitter<MdzipColorScheme>();\r\n /** Emits the user's Light / Dark / System choice from the toolbar menu. */\r\n @Output() readonly colorSchemePreferenceChanged = new EventEmitter<MdzipColorSchemePreference>();\r\n /** Emits the user's choice from the toolbar's page-width menu. */\r\n @Output() readonly previewWidthChanged = new EventEmitter<MdzipPreviewWidthChoice>();\r\n /** Emits when the preview HTML for the current selection is mounted. */\r\n @Output() readonly previewRendered = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n /** Emits once the mounted preview's images have finished loading. */\r\n @Output() readonly assetsHydrated = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n /**\r\n * Emits for every click on a preview link, before the view's own handling.\r\n * Call `event.preventDefault()` in the handler to take over navigation.\r\n */\r\n @Output() readonly linkActivated = new EventEmitter<MdzipLinkActivatedEvent>();\r\n @Output() readonly failed = new EventEmitter<unknown>();\r\n\r\n @ViewChild('host') private readonly hostRef!: ElementRef<HTMLDivElement>;\r\n /**\r\n * `<ng-template mdzipEntryRenderer>` declarations projected into the\r\n * component. Each becomes an entry renderer appended after the\r\n * `entryRenderers` input (stable sort keeps the input ahead at equal\r\n * priority).\r\n */\r\n @ContentChildren(MdzipEntryRendererDirective)\r\n private readonly entryTemplates!: QueryList<MdzipEntryRendererDirective>;\r\n private view: MdzipWorkspaceView | null = null;\r\n private renderingKey = '';\r\n private entryTemplatesSub: { unsubscribe(): void } | null = null;\r\n\r\n ngAfterContentInit(): void {\r\n this.entryTemplatesSub = this.entryTemplates.changes.subscribe(() => {\r\n this.applyRenderingOptions(false);\r\n });\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n this.createView();\r\n this.syncView();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (this.view && (changes['initialLayout'] || changes['initialColorScheme'] || changes['progressiveTextRendering'] || changes['inlineSvgLinks']\r\n || changes['navigationMode'] || changes['navigationButtonActive'])) {\r\n this.createView();\r\n this.syncView();\r\n return;\r\n }\r\n if (this.view && changes['controls']) {\r\n this.view.setControls(this.controls);\r\n }\r\n if (this.view && (changes['toolbarDensity'] || changes['contentDensity'])) {\r\n this.view.setDensityOptions({\r\n toolbarDensity: this.toolbarDensity,\r\n contentDensity: this.contentDensity,\r\n });\r\n }\r\n if (this.view && changes['systemColorScheme']) {\r\n this.view.setSystemColorScheme(this.systemColorScheme ?? null);\r\n }\r\n if (this.view && changes['previewMaxWidth']) {\r\n this.view.setPreviewMaxWidth(this.previewMaxWidth);\r\n }\r\n if (this.view && changes['imageHydrationAnimation']) {\r\n this.view.setImageHydrationAnimation(this.imageHydrationAnimation);\r\n }\r\n if (this.view && (changes['imageInsertMode'] || changes['imageInsertHandler'])) {\r\n this.view.setImageInsertOptions({\r\n imageInsertMode: this.imageInsertMode,\r\n imageInsertHandler: (request) => this.imageInsertHandler?.(request),\r\n });\r\n }\r\n if (this.view && changes['imageEditHandler']) {\r\n this.view.setImageEditOptions({\r\n imageEditHandler: (request) => this.imageEditHandler?.(request),\r\n });\r\n }\r\n if (this.view && changes['externalLinks']) {\r\n this.view.setExternalLinks(this.externalLinks);\r\n }\r\n if (this.view && (changes['bytes'] || changes['workspace'] || changes['mode']\r\n || changes['sourceFormat'] || changes['fileName'] || changes['worker'])) {\r\n const renameOnly = changes['fileName'] && !changes['fileName'].firstChange\r\n && !changes['bytes'] && !changes['workspace'] && !changes['mode']\r\n && !changes['sourceFormat'] && !changes['worker'];\r\n if (!(renameOnly && this.view.setFileName(this.fileName))) {\r\n this.syncView(this.preserveSelectionOnReopen);\r\n }\r\n }\r\n if (this.view && (changes['markdownRenderer'] || changes['markdownExtensions']\r\n || changes['entryRenderers'] || changes['frontMatter'])) {\r\n this.applyRenderingOptions(Boolean(changes['markdownRenderer']));\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.entryTemplatesSub?.unsubscribe();\r\n this.view?.destroy();\r\n }\r\n\r\n canExecuteCommand(command: MdzipEditorCommand): boolean {\r\n return this.view?.canExecuteCommand(command) ?? false;\r\n }\r\n\r\n executeCommand(command: MdzipEditorCommand, file?: File): Promise<boolean> {\r\n return this.view?.executeCommand(command, file) ?? Promise.resolve(false);\r\n }\r\n\r\n convertToMdz(): Promise<boolean> {\r\n return this.view?.convertToMdz() ?? Promise.resolve(false);\r\n }\r\n\r\n focus(): void {\r\n this.view?.focus();\r\n }\r\n\r\n setColorScheme(scheme: MdzipColorSchemePreference): void {\r\n this.view?.setColorScheme(scheme);\r\n }\r\n\r\n flush(): Promise<MdzipEditorSnapshot | null> {\r\n return this.view?.flush() ?? Promise.resolve(null);\r\n }\r\n\r\n serialize(): Promise<Blob | null> {\r\n return this.view?.serialize() ?? Promise.resolve(null);\r\n }\r\n\r\n getCurrentSnapshot(): Promise<MdzipEditorSnapshot | null> {\r\n return this.view?.getCurrentSnapshot() ?? Promise.resolve(null);\r\n }\r\n\r\n whenRendered(): Promise<void> {\r\n return this.view?.whenRendered() ?? Promise.resolve();\r\n }\r\n\r\n /** See `MdzipWorkspaceView.scrollToAnchor` — waits for the preview to mount. */\r\n scrollToAnchor(anchor: string): Promise<boolean> {\r\n return this.view?.scrollToAnchor(anchor) ?? Promise.resolve(false);\r\n }\r\n\r\n getAvailableAnchors(): string[] {\r\n return this.view?.getAvailableAnchors() ?? [];\r\n }\r\n\r\n /** See `MdzipWorkspaceView.openPath` — opens another file, optionally at an anchor. */\r\n openPath(path: string, options?: MdzipOpenPathOptions): Promise<boolean> {\r\n return this.view?.openPath(path, options) ?? Promise.resolve(false);\r\n }\r\n\r\n /** The archive path of the file currently shown, or null before a workspace opens. */\r\n getCurrentPath(): string | null {\r\n return this.view?.getCurrentPath() ?? null;\r\n }\r\n\r\n markPersisted(): void {\r\n this.view?.markPersisted();\r\n }\r\n\r\n addAsset(archivePath: string, fileBytes: Uint8Array): Promise<void> {\r\n return this.view?.addAsset(archivePath, fileBytes) ?? Promise.resolve();\r\n }\r\n\r\n replaceAsset(archivePath: string, fileBytes: Uint8Array): Promise<boolean> {\r\n return this.view?.replaceAsset(archivePath, fileBytes) ?? Promise.resolve(false);\r\n }\r\n\r\n removeAsset(archivePath: string, options?: MdzipRemoveAssetOptions): Promise<boolean> {\r\n return this.view?.removeAsset(archivePath, options) ?? Promise.resolve(false);\r\n }\r\n\r\n removeFile(archivePath: string): Promise<boolean> {\r\n return this.view?.removeFile(archivePath) ?? Promise.resolve(false);\r\n }\r\n\r\n renameFile(oldPath: string, newPath: string): Promise<boolean> {\r\n return this.view?.renameFile(oldPath, newPath) ?? Promise.resolve(false);\r\n }\r\n\r\n setEntryPoint(archivePath: string): Promise<boolean> {\r\n return this.view?.setEntryPoint(archivePath) ?? Promise.resolve(false);\r\n }\r\n\r\n packFilesAsWorkspace(\r\n files: readonly MdzipPackFilesInput[],\r\n options?: { title?: string; fileName?: string }\r\n ): Promise<MdzipPackFilesResult | null> {\r\n return this.view?.packFilesAsWorkspace(files, options) ?? Promise.resolve(null);\r\n }\r\n\r\n setCoverImage(archivePath: string | null): Promise<boolean> {\r\n return this.view?.setCoverImage(archivePath) ?? Promise.resolve(false);\r\n }\r\n\r\n listAssets(): MdzWorkspaceAsset[] {\r\n return this.view?.listAssets() ?? [];\r\n }\r\n\r\n private syncView(preserveSelection = false): void {\r\n const initialPath = preserveSelection ? this.view?.getCurrentPath() ?? undefined : undefined;\r\n if (this.view && this.workspace) {\r\n void this.view.openWorkspace(this.workspace, {\r\n mode: this.mode,\r\n sourceFormat: this.sourceFormat,\r\n fileName: this.fileName,\r\n worker: this.worker,\r\n initialPath\r\n });\r\n } else if (this.view && this.bytes) {\r\n void this.view.open(this.bytes, {\r\n mode: this.mode,\r\n sourceFormat: this.sourceFormat,\r\n fileName: this.fileName,\r\n worker: this.worker,\r\n initialPath\r\n });\r\n }\r\n }\r\n\r\n private createView(): void {\r\n this.view?.destroy();\r\n this.view = new MdzipWorkspaceView(this.hostRef.nativeElement, {\r\n libraries: [PACKAGE_INFO],\r\n controls: this.controls,\r\n toolbarDensity: this.toolbarDensity,\r\n contentDensity: this.contentDensity,\r\n imageHydrationAnimation: this.imageHydrationAnimation,\r\n imageInsertMode: this.imageInsertMode,\r\n initialLayout: this.initialLayout,\r\n initialColorScheme: this.initialColorScheme,\r\n previewMaxWidth: this.previewMaxWidth,\r\n systemColorScheme: this.systemColorScheme,\r\n progressiveTextRendering: this.progressiveTextRendering,\r\n inlineSvgLinks: this.inlineSvgLinks,\r\n hostFileActions: this.hostFileActions,\r\n navigationMode: this.navigationMode,\r\n navigationButtonActive: this.navigationButtonActive,\r\n onChanged: (bytes, snapshot) => this.changed.emit({ bytes, snapshot }),\r\n onSaved: (bytes, snapshot) => this.saved.emit({ bytes, snapshot }),\r\n onWorkspaceChanged: (event) => this.workspaceChanged.emit(event),\r\n onDocumentChanged: (event) => this.documentChanged.emit(event),\r\n onAssetChanged: (event) => this.assetChanged.emit(event),\r\n onManifestChanged: (event) => this.manifestChanged.emit(event),\r\n onSnapshotChanged: (snapshot) => this.snapshotChanged.emit(snapshot),\r\n onSelectionChanged: (snapshot: MdzipWorkspaceSnapshot) => this.selectionChanged.emit(snapshot),\r\n onDirtyChanged: (snapshot: MdzipWorkspaceSnapshot) => this.dirtyChanged.emit(snapshot),\r\n onValidationChanged: (snapshot: MdzipWorkspaceSnapshot) => this.validationChanged.emit(snapshot),\r\n onColorSchemeChanged: (colorScheme: MdzipColorScheme) => this.colorSchemeChanged.emit(colorScheme),\r\n onColorSchemePreferenceChanged: (preference: MdzipColorSchemePreference) =>\r\n this.colorSchemePreferenceChanged.emit(preference),\r\n onPreviewWidthChanged: (width: MdzipPreviewWidthChoice) => this.previewWidthChanged.emit(width),\r\n onPreviewRendered: (snapshot: MdzipWorkspaceSnapshot) => this.previewRendered.emit(snapshot),\r\n onAssetsHydrated: (snapshot: MdzipWorkspaceSnapshot) => this.assetsHydrated.emit(snapshot),\r\n onLinkActivated: (event: MdzipLinkActivatedEvent) => this.linkActivated.emit(event),\r\n externalLinks: this.externalLinks,\r\n onFailed: (e: unknown) => this.failed.emit(e),\r\n onConversionRequested: this.onConversionRequested\r\n ? (action, context) => this.onConversionRequested!(action, context)\r\n : undefined,\r\n onPackRequested: this.onPackRequested\r\n ? (request, context) => this.onPackRequested!(request, context)\r\n : undefined,\r\n imageInsertHandler: (request) => this.imageInsertHandler?.(request),\r\n imageEditHandler: (request) => this.imageEditHandler?.(request),\r\n markdownRenderer: this.markdownRenderer,\r\n markdownExtensions: this.markdownExtensions,\r\n entryRenderers: this.composedEntryRenderers(),\r\n frontMatter: this.frontMatter,\r\n });\r\n this.renderingKey = renderingConfigKey(this.markdownExtensions, this.composedEntryRenderers(), this.frontMatter);\r\n }\r\n\r\n private composedEntryRenderers(): readonly MdzipEntryRenderer[] {\r\n const templates = this.entryTemplates\r\n ? this.entryTemplates.map((directive, index) => directive.toEntryRenderer(index))\r\n : [];\r\n return [...this.entryRenderers, ...templates];\r\n }\r\n\r\n // Applies rendering input changes in place — never a view rebuild. Arrays\r\n // re-apply only when their name/id key changes, so template expressions\r\n // that produce new array identities each cycle are safe.\r\n private applyRenderingOptions(rendererChanged: boolean): void {\r\n const composed = this.composedEntryRenderers();\r\n const key = renderingConfigKey(this.markdownExtensions, composed, this.frontMatter);\r\n if (!rendererChanged && key === this.renderingKey) {\r\n return;\r\n }\r\n this.renderingKey = key;\r\n this.view?.setRenderingOptions({\r\n markdownRenderer: this.markdownRenderer ?? null,\r\n markdownExtensions: this.markdownExtensions,\r\n entryRenderers: composed,\r\n frontMatter: this.frontMatter,\r\n });\r\n }\r\n}\r\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport type {\n MdzipDiffControlsOptions,\n MdzipDiffSelectionEvent,\n MdzipDiffSideInput,\n MdzipDiffToolbarAction,\n MdzipDiffView,\n MdzipDiffViewOptions\n} from '@mdzip/editor/diff-view';\n\n@Component({\n selector: 'mdzip-diff',\n standalone: true,\n template: '<div #host></div>',\n styles: [':host { display:block; height:100%; } div { height:100%; }'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MdzipDiffComponent implements AfterViewInit, OnChanges, OnDestroy {\n @Input({ required: true }) before!: MdzipDiffSideInput;\n @Input({ required: true }) after!: MdzipDiffSideInput;\n @Input() initialPath?: string;\n @Input() showUnchanged = true;\n @Input() navigationVisible = true;\n @Input() controls?: MdzipDiffControlsOptions;\n @Input() toolbarActions: readonly MdzipDiffToolbarAction[] = [];\n @Output() readonly selectionChanged = new EventEmitter<MdzipDiffSelectionEvent>();\n @Output() readonly failed = new EventEmitter<Error>();\n\n @ViewChild('host') private readonly hostRef!: ElementRef<HTMLDivElement>;\n private view: MdzipDiffView | null = null;\n private destroyed = false;\n\n ngAfterViewInit(): void {\n void this.createView();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.view) return;\n if (changes['before'] || changes['after'] || changes['initialPath']) {\n void this.view.open(this.options());\n }\n if (changes['showUnchanged']) this.view.setShowUnchanged(this.showUnchanged);\n if (changes['navigationVisible']) this.view.setNavigationVisible(this.navigationVisible);\n if (changes['toolbarActions']) this.view.setToolbarActions(this.toolbarActions);\n }\n\n ngOnDestroy(): void {\n this.destroyed = true;\n this.view?.destroy();\n this.view = null;\n }\n\n openPath(path: string): Promise<boolean> {\n return this.view?.openPath(path) ?? Promise.resolve(false);\n }\n\n openPreviousChange(): Promise<boolean> {\n return this.view?.openPreviousChange() ?? Promise.resolve(false);\n }\n\n openNextChange(): Promise<boolean> {\n return this.view?.openNextChange() ?? Promise.resolve(false);\n }\n\n setShowUnchanged(show: boolean): void {\n this.view?.setShowUnchanged(show);\n }\n\n setNavigationVisible(visible: boolean): void {\n this.view?.setNavigationVisible(visible);\n }\n\n setToolbarActions(actions: readonly MdzipDiffToolbarAction[]): void {\n this.view?.setToolbarActions(actions);\n }\n\n private async createView(): Promise<void> {\n const { MdzipDiffView } = await import('@mdzip/editor/diff-view');\n if (this.destroyed) return;\n this.view = new MdzipDiffView(this.hostRef.nativeElement, this.options());\n }\n\n private options(): MdzipDiffViewOptions {\n return {\n before: this.before,\n after: this.after,\n initialPath: this.initialPath,\n showUnchanged: this.showUnchanged,\n navigationVisible: this.navigationVisible,\n controls: this.controls,\n toolbarActions: this.toolbarActions,\n onSelectionChanged: (event) => this.selectionChanged.emit(event),\n onFailed: (error) => this.failed.emit(error)\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AASA;;;;;;;;;;;;;;;;;AAiBG;MAKU,2BAA2B,CAAA;AAJxC,IAAA,WAAA,GAAA;AAKW,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,EAAC,WAA8C,EAAC;AAC5D,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;;QAGnD,IAAA,CAAA,kBAAkB,GAA+B,EAAE;AAoD7D,IAAA;;AA3CC,IAAA,eAAe,CAAC,KAAa,EAAA;QAC3B,MAAM,KAAK,GAAG,CAAC,OAAO,IAAI,CAAC,kBAAkB,KAAK;AAChD,cAAE,CAAC,IAAI,CAAC,kBAAkB;AAC1B,cAAE,IAAI,CAAC,kBAAkB,EACzB,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;QAErE,OAAO;YACL,EAAE,EAAE,IAAI,CAAC;oBACH,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,CAAA,kBAAA,EAAqB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAE,GAAG,CAAA,kBAAA,EAAqB,KAAK,CAAA,CAAE,CAAC;AAC/F,YAAA,QAAQ,EAAE,IAA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anges, OnDestroy, EventEmitter, SimpleChanges, TemplateRef } from '@angular/core';
|
|
3
|
-
import { MdzWorkspace, MdzipWorkspaceMode, MdzipSourceFormat, MdzipControlPreset, MdzipControlPolicy, MdzipToolbarDensity, MdzipContentDensity, MdzipImageHydrationAnimation, MdzipImageInsertMode, MdzipImageInsertHandler, MdzipImageEditHandler, MdzipWorkspaceLayout, MdzipColorSchemePreference, MdzipPreviewMaxWidth, MdzipNavigationMode, MdzipConversionAction, MdzipConversionContext, MdzipPackFilesRequest, MdzipPackFilesContext, MdzipMarkdownRenderer, MdzipMarkdownRenderExtension, MdzipEntryRenderer, MdzipFrontMatterOptions, MdzipExternalLinkPolicy, MdzipWorkspaceChange, MdzipWorkspaceSave, MdzipDocumentChangeEvent, MdzipWorkspaceSnapshot, MdzipColorScheme, MdzipPreviewWidthChoice, MdzipLinkActivatedEvent, MdzipEditorCommand, MdzipEditorSnapshot, MdzipOpenPathOptions, MdzipRemoveAssetOptions, MdzipPackFilesInput, MdzipPackFilesResult, MdzWorkspaceAsset, MdzipEntryRenderContext } from '@mdzip/editor';
|
|
3
|
+
import { MdzWorkspace, MdzipWorkspaceMode, MdzipSourceFormat, MdzipControlPreset, MdzipControlPolicy, MdzipToolbarDensity, MdzipContentDensity, MdzipImageHydrationAnimation, MdzipImageInsertMode, MdzipImageInsertHandler, MdzipImageEditHandler, MdzipWorkspaceLayout, MdzipColorSchemePreference, MdzipPreviewMaxWidth, MdzipSystemColorScheme, MdzipFileAction, MdzipNavigationMode, MdzipConversionAction, MdzipConversionContext, MdzipPackFilesRequest, MdzipPackFilesContext, MdzipMarkdownRenderer, MdzipMarkdownRenderExtension, MdzipEntryRenderer, MdzipFrontMatterOptions, MdzipExternalLinkPolicy, MdzipWorkspaceChange, MdzipWorkspaceSave, MdzipDocumentChangeEvent, MdzipWorkspaceSnapshot, MdzipColorScheme, MdzipPreviewWidthChoice, MdzipLinkActivatedEvent, MdzipEditorCommand, MdzipEditorSnapshot, MdzipOpenPathOptions, MdzipRemoveAssetOptions, MdzipPackFilesInput, MdzipPackFilesResult, MdzWorkspaceAsset, MdzipEntryRenderContext } from '@mdzip/editor';
|
|
4
4
|
import { MdzipDiffSideInput, MdzipDiffControlsOptions, MdzipDiffToolbarAction, MdzipDiffSelectionEvent } from '@mdzip/editor/diff-view';
|
|
5
5
|
|
|
6
6
|
declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit, OnChanges, OnDestroy {
|
|
@@ -35,6 +35,8 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
|
|
|
35
35
|
initialColorScheme?: MdzipColorSchemePreference;
|
|
36
36
|
/** Preview reading-column width; the user can change it from the toolbar's page-width menu. */
|
|
37
37
|
previewMaxWidth?: MdzipPreviewMaxWidth;
|
|
38
|
+
/** What the color scheme menu's System choice follows instead of the OS setting (a host theme), with its own label and icon. */
|
|
39
|
+
systemColorScheme?: MdzipSystemColorScheme;
|
|
38
40
|
/**
|
|
39
41
|
* Mounts the preview in chunks near the viewport instead of rendering the
|
|
40
42
|
* whole document synchronously up front. Recommended for hosts that may
|
|
@@ -42,6 +44,13 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
|
|
|
42
44
|
* `initialColorScheme` — changing it recreates the view.
|
|
43
45
|
*/
|
|
44
46
|
progressiveTextRendering?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Shows archive SVGs that contain links inline, so the links can be
|
|
49
|
+
* clicked (see the view option). Defaults to `true`. Constructor-only.
|
|
50
|
+
*/
|
|
51
|
+
inlineSvgLinks?: boolean;
|
|
52
|
+
/** Extra file tree menu items for files, run by the host (see the view option). Read when the view is created. */
|
|
53
|
+
hostFileActions?: readonly MdzipFileAction[];
|
|
45
54
|
navigationMode: MdzipNavigationMode;
|
|
46
55
|
navigationButtonActive: boolean;
|
|
47
56
|
/**
|
|
@@ -153,7 +162,7 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
|
|
|
153
162
|
private composedEntryRenderers;
|
|
154
163
|
private applyRenderingOptions;
|
|
155
164
|
static ɵfac: i0.ɵɵFactoryDeclaration<MdzipWorkspaceComponent, never>;
|
|
156
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MdzipWorkspaceComponent, "mdzip-workspace", never, { "bytes": { "alias": "bytes"; "required": false; }; "workspace": { "alias": "workspace"; "required": false; }; "fileName": { "alias": "fileName"; "required": false; }; "preserveSelectionOnReopen": { "alias": "preserveSelectionOnReopen"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "sourceFormat": { "alias": "sourceFormat"; "required": false; }; "worker": { "alias": "worker"; "required": false; }; "controls": { "alias": "controls"; "required": false; }; "toolbarDensity": { "alias": "toolbarDensity"; "required": false; }; "contentDensity": { "alias": "contentDensity"; "required": false; }; "imageHydrationAnimation": { "alias": "imageHydrationAnimation"; "required": false; }; "imageInsertMode": { "alias": "imageInsertMode"; "required": false; }; "imageInsertHandler": { "alias": "imageInsertHandler"; "required": false; }; "imageEditHandler": { "alias": "imageEditHandler"; "required": false; }; "initialLayout": { "alias": "initialLayout"; "required": false; }; "initialColorScheme": { "alias": "initialColorScheme"; "required": false; }; "previewMaxWidth": { "alias": "previewMaxWidth"; "required": false; }; "progressiveTextRendering": { "alias": "progressiveTextRendering"; "required": false; }; "navigationMode": { "alias": "navigationMode"; "required": false; }; "navigationButtonActive": { "alias": "navigationButtonActive"; "required": false; }; "onConversionRequested": { "alias": "onConversionRequested"; "required": false; }; "onPackRequested": { "alias": "onPackRequested"; "required": false; }; "markdownRenderer": { "alias": "markdownRenderer"; "required": false; }; "markdownExtensions": { "alias": "markdownExtensions"; "required": false; }; "entryRenderers": { "alias": "entryRenderers"; "required": false; }; "frontMatter": { "alias": "frontMatter"; "required": false; }; "externalLinks": { "alias": "externalLinks"; "required": false; }; }, { "changed": "changed"; "saved": "saved"; "workspaceChanged": "workspaceChanged"; "documentChanged": "documentChanged"; "assetChanged": "assetChanged"; "manifestChanged": "manifestChanged"; "snapshotChanged": "snapshotChanged"; "selectionChanged": "selectionChanged"; "dirtyChanged": "dirtyChanged"; "validationChanged": "validationChanged"; "colorSchemeChanged": "colorSchemeChanged"; "colorSchemePreferenceChanged": "colorSchemePreferenceChanged"; "previewWidthChanged": "previewWidthChanged"; "previewRendered": "previewRendered"; "assetsHydrated": "assetsHydrated"; "linkActivated": "linkActivated"; "failed": "failed"; }, ["entryTemplates"], never, true, never>;
|
|
165
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MdzipWorkspaceComponent, "mdzip-workspace", never, { "bytes": { "alias": "bytes"; "required": false; }; "workspace": { "alias": "workspace"; "required": false; }; "fileName": { "alias": "fileName"; "required": false; }; "preserveSelectionOnReopen": { "alias": "preserveSelectionOnReopen"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "sourceFormat": { "alias": "sourceFormat"; "required": false; }; "worker": { "alias": "worker"; "required": false; }; "controls": { "alias": "controls"; "required": false; }; "toolbarDensity": { "alias": "toolbarDensity"; "required": false; }; "contentDensity": { "alias": "contentDensity"; "required": false; }; "imageHydrationAnimation": { "alias": "imageHydrationAnimation"; "required": false; }; "imageInsertMode": { "alias": "imageInsertMode"; "required": false; }; "imageInsertHandler": { "alias": "imageInsertHandler"; "required": false; }; "imageEditHandler": { "alias": "imageEditHandler"; "required": false; }; "initialLayout": { "alias": "initialLayout"; "required": false; }; "initialColorScheme": { "alias": "initialColorScheme"; "required": false; }; "previewMaxWidth": { "alias": "previewMaxWidth"; "required": false; }; "systemColorScheme": { "alias": "systemColorScheme"; "required": false; }; "progressiveTextRendering": { "alias": "progressiveTextRendering"; "required": false; }; "inlineSvgLinks": { "alias": "inlineSvgLinks"; "required": false; }; "hostFileActions": { "alias": "hostFileActions"; "required": false; }; "navigationMode": { "alias": "navigationMode"; "required": false; }; "navigationButtonActive": { "alias": "navigationButtonActive"; "required": false; }; "onConversionRequested": { "alias": "onConversionRequested"; "required": false; }; "onPackRequested": { "alias": "onPackRequested"; "required": false; }; "markdownRenderer": { "alias": "markdownRenderer"; "required": false; }; "markdownExtensions": { "alias": "markdownExtensions"; "required": false; }; "entryRenderers": { "alias": "entryRenderers"; "required": false; }; "frontMatter": { "alias": "frontMatter"; "required": false; }; "externalLinks": { "alias": "externalLinks"; "required": false; }; }, { "changed": "changed"; "saved": "saved"; "workspaceChanged": "workspaceChanged"; "documentChanged": "documentChanged"; "assetChanged": "assetChanged"; "manifestChanged": "manifestChanged"; "snapshotChanged": "snapshotChanged"; "selectionChanged": "selectionChanged"; "dirtyChanged": "dirtyChanged"; "validationChanged": "validationChanged"; "colorSchemeChanged": "colorSchemeChanged"; "colorSchemePreferenceChanged": "colorSchemePreferenceChanged"; "previewWidthChanged": "previewWidthChanged"; "previewRendered": "previewRendered"; "assetsHydrated": "assetsHydrated"; "linkActivated": "linkActivated"; "failed": "failed"; }, ["entryTemplates"], never, true, never>;
|
|
157
166
|
}
|
|
158
167
|
|
|
159
168
|
/** Template context available via `let-context` (also the `$implicit` value). */
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../src/workspace.component.ts","../src/entry-renderer.directive.ts","../src/diff.component.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../src/workspace.component.ts","../src/entry-renderer.directive.ts","../src/diff.component.ts"],"mappings":";;;;;AAgFA,cAAA,uBAOa,4BAAmC,EAAA,wBAAiC,EAAA,SAAW;AACjF,WAAO,UAAU;AACjB,eAAW,YAAY;AACvB;AACT;;;;AAIG;AACM;UACM,kBAAkB;mBACT,iBAAiB;AACzC;;;;;;;AAOG;aACe,MAAM;AACf,cAAU,kBAAkB,GAAG,kBAAkB;qBAChC,mBAAmB;qBACnB,mBAAmB;8BACV,4BAA4B;sBACpC,oBAAoB;yBACjB,uBAAuB;uBACzB,qBAAqB;oBACxB,oBAAoB;yBACf,0BAA0B;;sBAE7B,oBAAoB;;wBAElB,sBAAsB;AACnD;;;;;AAKG;;AAEH;;;AAGG;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G,OAAO;qCAI3C,OAAO;AAIxC,kDAA8C,OAAO;wCAIjB,OAAO;yCAKzB,mBAAmB;;;AACY,QAC9C,OAAO,CAAC,oBAAoB;+CAIY,OAAO;kBAIpC,iBAAiB;AAI/B;AAqBA;AAqDA;AAUA;yCA9XW,uBAAuB;2CAAvB,uBAAuB;AA4YnC;;ACheD;AACA,2CAAiB;eACJ,uBAAuB;aACzB,uBAAuB;AACjC;AAED;;;;;;;;;;;;;;;;;AAiBG;AACH,cAAA,2BAIa;0BACS,WAAA;AACpB;;AAGS;;wCAEoC,uBAAuB;;;;;;AAOpE,oCAAgC,kBAAkB;yCAdvC,2BAA2B;2CAA3B,2BAA2B;AAyDvC;;AClED,cAAA,8BAOgC,aAAW,EAAA,SAAe,EAAA,SAAW;YAC/B,kBAAkB;WACnB,kBAAkB;;AAE5C;AACA;eACW,wBAAwB;AACnC,6BAAyB,sBAAsB;+BACrB,YAAA,CAAA,uBAAA;qBACV,YAAA,CAAA,KAAA;AAEN;;;AAInB;AAIA,yBAAqB,aAAa;AAUlC;4BAMwB,OAAO;AAI/B,0BAAsB,OAAO;AAI7B,sBAAkB,OAAO;AAIzB;AAIA;AAIA,wCAAoC,sBAAsB;;AAU1D;yCAjEW,kBAAkB;2CAAlB,kBAAkB;AA8E9B;;;;","names":[]}
|
|
@@ -6728,8 +6728,21 @@ var MDZ_SPEC_VERSION = "1.2.0";
|
|
|
6728
6728
|
var MDZ_SUPPORTED_MAJOR = 1;
|
|
6729
6729
|
var MDZ_MODES = ["document", "project"];
|
|
6730
6730
|
var MDZ_SUPPORT_FILE_NAMES = ["readme", "agents", "license", "changelog", "contributing"];
|
|
6731
|
-
|
|
6732
|
-
|
|
6731
|
+
var MdzError = class _MdzError extends Error {
|
|
6732
|
+
code;
|
|
6733
|
+
constructor(code, message, options) {
|
|
6734
|
+
super(`${code}: ${message}`, options);
|
|
6735
|
+
this.name = "MdzError";
|
|
6736
|
+
this.code = code;
|
|
6737
|
+
}
|
|
6738
|
+
/** An `MdzError` from a `"CODE: message"` string. */
|
|
6739
|
+
static fromMessage(text, options) {
|
|
6740
|
+
const match = /^(ERR_[A-Z0-9_]+):\s*([\s\S]*)$/.exec(text);
|
|
6741
|
+
return match ? new _MdzError(match[1], match[2], options) : new _MdzError("ERR_UNKNOWN", text, options);
|
|
6742
|
+
}
|
|
6743
|
+
};
|
|
6744
|
+
function mdzError(code, message, options) {
|
|
6745
|
+
return new MdzError(code, message, options);
|
|
6733
6746
|
}
|
|
6734
6747
|
var CONTROL_RE = /[\u0000-\u001f\u007f]/;
|
|
6735
6748
|
var RESERVED_RE = /[\\:*?"<>|]/;
|
|
@@ -7071,7 +7084,7 @@ function insideArchive(archive, segments, host, withFragment, directory) {
|
|
|
7071
7084
|
|
|
7072
7085
|
// ../../node_modules/@mdzip/core-js/dist/mdz-core.js
|
|
7073
7086
|
var PRODUCER_SPEC_VERSION = MDZ_SPEC_VERSION;
|
|
7074
|
-
var CORE_LIBRARY_VERSION = "2.
|
|
7087
|
+
var CORE_LIBRARY_VERSION = "2.1.1";
|
|
7075
7088
|
var CORE_LIBRARY_URL = "https://github.com/mdzip-project/mdzip-core-js";
|
|
7076
7089
|
function isSymlinkEntry(entry) {
|
|
7077
7090
|
const mode = entry?.unixPermissions;
|
|
@@ -7150,10 +7163,9 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
7150
7163
|
try {
|
|
7151
7164
|
return await load4();
|
|
7152
7165
|
} catch (error2) {
|
|
7153
|
-
if (/^ERR_[A-Z_]+:/.test(error2 instanceof Error ? error2.message : ""))
|
|
7166
|
+
if (error2 instanceof MdzError || /^ERR_[A-Z_]+:/.test(error2 instanceof Error ? error2.message : ""))
|
|
7154
7167
|
throw error2;
|
|
7155
|
-
|
|
7156
|
-
throw mdzError("ERR_ZIP_INVALID", `not a readable ZIP archive (${message})`);
|
|
7168
|
+
throw mdzError("ERR_ZIP_INVALID", "The file is not a valid ZIP archive.", { cause: error2 });
|
|
7157
7169
|
}
|
|
7158
7170
|
}
|
|
7159
7171
|
/** Rejects NFC-duplicate entries and files that are also directories (§5.4, §13.1): never picks one. */
|
|
@@ -7190,10 +7202,11 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
7190
7202
|
*
|
|
7191
7203
|
* @param input - Raw archive bytes.
|
|
7192
7204
|
* @param zipFactory - Optional custom zip loader.
|
|
7205
|
+
* @param options - Validation controls (see {@link MdzValidateOptions}).
|
|
7193
7206
|
*/
|
|
7194
|
-
static async validate(input, zipFactory) {
|
|
7207
|
+
static async validate(input, zipFactory, options) {
|
|
7195
7208
|
const archive = await _MdzArchiveCore.open(input, zipFactory);
|
|
7196
|
-
return archive.validate();
|
|
7209
|
+
return archive.validate(options);
|
|
7197
7210
|
}
|
|
7198
7211
|
/**
|
|
7199
7212
|
* Adds or replaces an archive entry and returns a newly generated archive blob.
|
|
@@ -7255,24 +7268,24 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
7255
7268
|
const path = nfc(MdzPackagerCore.normalizePath(write.path));
|
|
7256
7269
|
const pathError = _MdzArchiveCore.validateArchivePath(path);
|
|
7257
7270
|
if (pathError) {
|
|
7258
|
-
throw
|
|
7271
|
+
throw MdzError.fromMessage(`ERR_PATH_INVALID: ${pathError}`);
|
|
7259
7272
|
}
|
|
7260
7273
|
normalizedWrites.set(path, { path, content: write.content });
|
|
7261
7274
|
}
|
|
7262
7275
|
const sourceBytes = await _MdzArchiveCore.readArchiveInputBytes(input);
|
|
7263
7276
|
const archive = await _MdzArchiveCore.open(sourceBytes);
|
|
7264
7277
|
const existingPaths = archive.listPaths();
|
|
7265
|
-
const removable = [...
|
|
7278
|
+
const removable = [...archive.listPaths({ includeDirectories: true }), ...archive.listSpecialFiles()];
|
|
7266
7279
|
const normalizedRemovals = /* @__PURE__ */ new Map();
|
|
7267
7280
|
for (const removal of removals) {
|
|
7268
7281
|
const path = MdzPackagerCore.normalizePath(removal);
|
|
7269
7282
|
const pathError = _MdzArchiveCore.validateArchivePath(path);
|
|
7270
7283
|
if (pathError) {
|
|
7271
|
-
throw
|
|
7284
|
+
throw MdzError.fromMessage(`ERR_PATH_INVALID: ${pathError}`);
|
|
7272
7285
|
}
|
|
7273
7286
|
const stored = removable.find((p) => samePath(p, path));
|
|
7274
7287
|
if (stored === void 0) {
|
|
7275
|
-
throw
|
|
7288
|
+
throw MdzError.fromMessage(`ERR_NOT_FOUND: Entry "${path}" was not found in archive.`);
|
|
7276
7289
|
}
|
|
7277
7290
|
normalizedRemovals.set(nfc(stored), stored);
|
|
7278
7291
|
}
|
|
@@ -7325,7 +7338,7 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
7325
7338
|
const nextManifest = manifestObject ?? (normalizedRemovals.has("manifest.json") ? null : existingManifest);
|
|
7326
7339
|
const entryPointAfter = _MdzArchiveCore.resolveEntryPointStrict(nextPaths, nextManifest);
|
|
7327
7340
|
if (entryPointBefore && !explicitManifest && !samePath(entryPointBefore, entryPointAfter)) {
|
|
7328
|
-
throw
|
|
7341
|
+
throw MdzError.fromMessage(`ERR_ENTRYPOINT_CHANGED: this change would move the entry point from "${entryPointBefore}" to "${entryPointAfter}"; set manifest entryPoint to change it.`);
|
|
7329
7342
|
}
|
|
7330
7343
|
let patchedBytes;
|
|
7331
7344
|
try {
|
|
@@ -7380,13 +7393,13 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
7380
7393
|
continue;
|
|
7381
7394
|
}
|
|
7382
7395
|
if (entry.localOffset + 30 > source.length || view.getUint32(entry.localOffset, true) !== 67324752) {
|
|
7383
|
-
throw
|
|
7396
|
+
throw MdzError.fromMessage(`ERR_ZIP_UNSUPPORTED: malformed local header for "${entry.name}"`);
|
|
7384
7397
|
}
|
|
7385
7398
|
const localNameLen = view.getUint16(entry.localOffset + 26, true);
|
|
7386
7399
|
const localExtraLen = view.getUint16(entry.localOffset + 28, true);
|
|
7387
7400
|
const dataStart = entry.localOffset + 30 + localNameLen + localExtraLen;
|
|
7388
7401
|
if (dataStart + entry.compressedSize > source.length) {
|
|
7389
|
-
throw
|
|
7402
|
+
throw MdzError.fromMessage(`ERR_ZIP_UNSUPPORTED: entry data out of bounds for "${entry.name}"`);
|
|
7390
7403
|
}
|
|
7391
7404
|
output.push({
|
|
7392
7405
|
nameBytes: entry.nameBytes,
|
|
@@ -7512,27 +7525,27 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
7512
7525
|
}
|
|
7513
7526
|
}
|
|
7514
7527
|
if (eocd < 0) {
|
|
7515
|
-
throw
|
|
7528
|
+
throw MdzError.fromMessage("ERR_ZIP_UNSUPPORTED: end of central directory not found");
|
|
7516
7529
|
}
|
|
7517
7530
|
if (view.getUint16(eocd + 4, true) !== 0 || view.getUint16(eocd + 6, true) !== 0) {
|
|
7518
|
-
throw
|
|
7531
|
+
throw MdzError.fromMessage("ERR_ZIP_UNSUPPORTED: multi-disk archives are not supported");
|
|
7519
7532
|
}
|
|
7520
7533
|
const totalEntries = view.getUint16(eocd + 10, true);
|
|
7521
7534
|
const centralSize = view.getUint32(eocd + 12, true);
|
|
7522
7535
|
const centralOffset = view.getUint32(eocd + 16, true);
|
|
7523
7536
|
if (totalEntries === 65535 || centralSize === 4294967295 || centralOffset === 4294967295) {
|
|
7524
|
-
throw
|
|
7537
|
+
throw MdzError.fromMessage("ERR_ZIP_UNSUPPORTED: ZIP64 archives are not supported");
|
|
7525
7538
|
}
|
|
7526
7539
|
const entries = [];
|
|
7527
7540
|
const decoder = new TextDecoder("utf-8", { fatal: false });
|
|
7528
7541
|
let pos = centralOffset;
|
|
7529
7542
|
for (let i = 0; i < totalEntries; i++) {
|
|
7530
7543
|
if (pos + 46 > source.length || view.getUint32(pos, true) !== 33639248) {
|
|
7531
|
-
throw
|
|
7544
|
+
throw MdzError.fromMessage("ERR_ZIP_UNSUPPORTED: malformed central directory");
|
|
7532
7545
|
}
|
|
7533
7546
|
const flags = view.getUint16(pos + 8, true);
|
|
7534
7547
|
if ((flags & 1) !== 0) {
|
|
7535
|
-
throw
|
|
7548
|
+
throw MdzError.fromMessage("ERR_ZIP_UNSUPPORTED: encrypted entries are not supported");
|
|
7536
7549
|
}
|
|
7537
7550
|
const compressedSize = view.getUint32(pos + 20, true);
|
|
7538
7551
|
const uncompressedSize = view.getUint32(pos + 24, true);
|
|
@@ -7541,11 +7554,11 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
7541
7554
|
const commentLen = view.getUint16(pos + 32, true);
|
|
7542
7555
|
const localOffset = view.getUint32(pos + 42, true);
|
|
7543
7556
|
if (compressedSize === 4294967295 || uncompressedSize === 4294967295 || localOffset === 4294967295) {
|
|
7544
|
-
throw
|
|
7557
|
+
throw MdzError.fromMessage("ERR_ZIP_UNSUPPORTED: ZIP64 archives are not supported");
|
|
7545
7558
|
}
|
|
7546
7559
|
const nameBytes = source.slice(pos + 46, pos + 46 + nameLen);
|
|
7547
7560
|
if ((flags & 2048) === 0 && nameBytes.some((byte) => byte > 127)) {
|
|
7548
|
-
throw
|
|
7561
|
+
throw MdzError.fromMessage("ERR_ZIP_UNSUPPORTED: non-UTF-8 entry names are not supported");
|
|
7549
7562
|
}
|
|
7550
7563
|
entries.push({
|
|
7551
7564
|
name: _MdzArchiveCore.normalizePath(decoder.decode(nameBytes)),
|
|
@@ -7712,11 +7725,11 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
7712
7725
|
if (manifest && "entryPoint" in manifest && manifest.entryPoint !== void 0) {
|
|
7713
7726
|
const problem = _MdzArchiveCore.entryPointError(manifest.entryPoint);
|
|
7714
7727
|
if (problem)
|
|
7715
|
-
throw
|
|
7728
|
+
throw MdzError.fromMessage(`ERR_ENTRYPOINT_INVALID: ${problem}`);
|
|
7716
7729
|
const value = manifest.entryPoint;
|
|
7717
7730
|
const found = find(value.startsWith("./") ? value.slice(2) : value);
|
|
7718
7731
|
if (!found)
|
|
7719
|
-
throw
|
|
7732
|
+
throw MdzError.fromMessage(`ERR_ENTRYPOINT_MISSING: manifest.json references "${value}" which is not in the archive`);
|
|
7720
7733
|
return found;
|
|
7721
7734
|
}
|
|
7722
7735
|
const index = find("index.md");
|
|
@@ -7729,8 +7742,8 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
7729
7742
|
if (content.length === 0 && rootMarkdown.length === 1)
|
|
7730
7743
|
return rootMarkdown[0];
|
|
7731
7744
|
if (rootMarkdown.length === 0)
|
|
7732
|
-
throw
|
|
7733
|
-
throw
|
|
7745
|
+
throw MdzError.fromMessage("ERR_ENTRYPOINT_UNRESOLVED: No Markdown file found at the archive root.");
|
|
7746
|
+
throw MdzError.fromMessage("ERR_ENTRYPOINT_UNRESOLVED: Multiple Markdown files at the archive root and no manifest.json entryPoint. Add an index.md or manifest.json entryPoint.");
|
|
7734
7747
|
}
|
|
7735
7748
|
/**
|
|
7736
7749
|
* Infers a MIME type from an archive path.
|
|
@@ -8134,7 +8147,7 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
8134
8147
|
* @param options - Workspace open controls.
|
|
8135
8148
|
*/
|
|
8136
8149
|
async openWorkspace(options) {
|
|
8137
|
-
const validation = await this.validate();
|
|
8150
|
+
const validation = await this.validate({ checkImages: false });
|
|
8138
8151
|
const manifest = await this.readManifest().catch(() => null);
|
|
8139
8152
|
const mode = await this.resolveMode().catch(() => "document");
|
|
8140
8153
|
const entryPoint = await this.resolveEntryPoint().catch(() => null);
|
|
@@ -8195,7 +8208,7 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
8195
8208
|
*/
|
|
8196
8209
|
static validateManifest(manifest) {
|
|
8197
8210
|
if (!manifest || typeof manifest !== "object" || Array.isArray(manifest)) {
|
|
8198
|
-
throw
|
|
8211
|
+
throw MdzError.fromMessage("ERR_MANIFEST_INVALID: manifest.json must be a JSON object.");
|
|
8199
8212
|
}
|
|
8200
8213
|
const ignored = checkManifest(manifest);
|
|
8201
8214
|
_MdzArchiveCore.checkLegacyMdzField(manifest);
|
|
@@ -8260,7 +8273,7 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
8260
8273
|
* skipped (§4, §13.1); ignored descriptive manifest fields and duplicate members (§6.4); a
|
|
8261
8274
|
* missing `cover`; and missing version metadata.
|
|
8262
8275
|
*/
|
|
8263
|
-
async validate() {
|
|
8276
|
+
async validate(options) {
|
|
8264
8277
|
const errors = [];
|
|
8265
8278
|
const warnings = [];
|
|
8266
8279
|
for (const path of _MdzArchiveCore.getArchivePaths(this.zip)) {
|
|
@@ -8313,12 +8326,49 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
8313
8326
|
errors.push(message);
|
|
8314
8327
|
}
|
|
8315
8328
|
}
|
|
8329
|
+
if (options?.checkImages !== false)
|
|
8330
|
+
warnings.push(...await this.missingImageWarnings());
|
|
8316
8331
|
return {
|
|
8317
8332
|
isValid: errors.length === 0,
|
|
8318
8333
|
errors,
|
|
8319
8334
|
warnings
|
|
8320
8335
|
};
|
|
8321
8336
|
}
|
|
8337
|
+
/**
|
|
8338
|
+
* Images a Markdown document uses (`` and `<img src>`) that aren't in the archive. A
|
|
8339
|
+
* warning, not an error: the spec doesn't make a broken image non-conforming, but it's the
|
|
8340
|
+
* most common producer mistake. Web and `data:` images, and paths that leave the archive, are
|
|
8341
|
+
* not checked here.
|
|
8342
|
+
*/
|
|
8343
|
+
async missingImageWarnings() {
|
|
8344
|
+
const warnings = [];
|
|
8345
|
+
for (const document of this.listPaths().filter((p) => _MdzArchiveCore.isMarkdownFile(p))) {
|
|
8346
|
+
let markdown;
|
|
8347
|
+
try {
|
|
8348
|
+
markdown = await this.readText(document);
|
|
8349
|
+
} catch {
|
|
8350
|
+
continue;
|
|
8351
|
+
}
|
|
8352
|
+
const seen = /* @__PURE__ */ new Set();
|
|
8353
|
+
for (const ref of _MdzArchiveCore.extractImageReferences(markdown)) {
|
|
8354
|
+
if (seen.has(ref))
|
|
8355
|
+
continue;
|
|
8356
|
+
seen.add(ref);
|
|
8357
|
+
const target = this.resolveLink(document, ref, void 0, { use: "embed" });
|
|
8358
|
+
if (target.kind !== "unresolved" || target.reason !== "not-found")
|
|
8359
|
+
continue;
|
|
8360
|
+
let message = `${document} uses image "${ref}", which is not in the archive.`;
|
|
8361
|
+
try {
|
|
8362
|
+
const nearMatch = this.findCaseOnlyMatch(_MdzArchiveCore.resolvePath(document, ref));
|
|
8363
|
+
if (nearMatch)
|
|
8364
|
+
message += ` (Did you mean "${nearMatch}"? Paths are case-sensitive.)`;
|
|
8365
|
+
} catch {
|
|
8366
|
+
}
|
|
8367
|
+
warnings.push(message);
|
|
8368
|
+
}
|
|
8369
|
+
}
|
|
8370
|
+
return warnings;
|
|
8371
|
+
}
|
|
8322
8372
|
/**
|
|
8323
8373
|
* Resolves the primary markdown entry point for rendering.
|
|
8324
8374
|
*
|
|
@@ -8359,10 +8409,10 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
8359
8409
|
const normalized = _MdzArchiveCore.normalizePath(path);
|
|
8360
8410
|
const entry = this.findEntryWithDirectoryFallback(normalized);
|
|
8361
8411
|
if (!entry) {
|
|
8362
|
-
throw
|
|
8412
|
+
throw MdzError.fromMessage(`ERR_NOT_FOUND: Entry "${normalized}" was not found in archive.`);
|
|
8363
8413
|
}
|
|
8364
8414
|
if (entry.dir) {
|
|
8365
|
-
throw
|
|
8415
|
+
throw MdzError.fromMessage(`ERR_IS_DIRECTORY: Entry "${normalized}" is a directory.`);
|
|
8366
8416
|
}
|
|
8367
8417
|
return entry;
|
|
8368
8418
|
}
|
|
@@ -8463,7 +8513,7 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
8463
8513
|
const parsed = JSON.parse(String(raw));
|
|
8464
8514
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
8465
8515
|
if (requireValid)
|
|
8466
|
-
throw
|
|
8516
|
+
throw MdzError.fromMessage("ERR_MANIFEST_INVALID: Existing manifest.json is invalid: expected a JSON object.");
|
|
8467
8517
|
return null;
|
|
8468
8518
|
}
|
|
8469
8519
|
return parsed;
|
|
@@ -8471,7 +8521,7 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
8471
8521
|
if (requireValid) {
|
|
8472
8522
|
if (error2 instanceof Error && /expected a JSON object/.test(error2.message))
|
|
8473
8523
|
throw error2;
|
|
8474
|
-
throw
|
|
8524
|
+
throw MdzError.fromMessage("ERR_MANIFEST_INVALID: Existing manifest.json is invalid JSON.");
|
|
8475
8525
|
}
|
|
8476
8526
|
return null;
|
|
8477
8527
|
}
|
|
@@ -8482,7 +8532,7 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
8482
8532
|
const parsed = JSON.parse(raw);
|
|
8483
8533
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
8484
8534
|
if (requireValid)
|
|
8485
|
-
throw
|
|
8535
|
+
throw MdzError.fromMessage("ERR_MANIFEST_INVALID: Replacement manifest.json is invalid: expected a JSON object.");
|
|
8486
8536
|
return {};
|
|
8487
8537
|
}
|
|
8488
8538
|
return parsed;
|
|
@@ -8490,7 +8540,7 @@ var MdzArchiveCore = class _MdzArchiveCore {
|
|
|
8490
8540
|
if (requireValid) {
|
|
8491
8541
|
if (error2 instanceof Error && /expected a JSON object/.test(error2.message))
|
|
8492
8542
|
throw error2;
|
|
8493
|
-
throw
|
|
8543
|
+
throw MdzError.fromMessage("ERR_MANIFEST_INVALID: Replacement manifest.json is invalid JSON.");
|
|
8494
8544
|
}
|
|
8495
8545
|
return {};
|
|
8496
8546
|
}
|
|
@@ -8730,17 +8780,31 @@ var MdzPackagerCore = class _MdzPackagerCore {
|
|
|
8730
8780
|
* @param rootName - Root/source label for fallback title.
|
|
8731
8781
|
* @param options - Packaging options.
|
|
8732
8782
|
*/
|
|
8783
|
+
/** The `producer.application` to write: the given fields that are non-empty strings, or null if none are. */
|
|
8784
|
+
static producerApplication(application) {
|
|
8785
|
+
if (!application)
|
|
8786
|
+
return null;
|
|
8787
|
+
const node = {};
|
|
8788
|
+
for (const key of ["name", "version", "url"]) {
|
|
8789
|
+
const value = application[key];
|
|
8790
|
+
if (typeof value === "string" && value.trim())
|
|
8791
|
+
node[key] = value.trim();
|
|
8792
|
+
}
|
|
8793
|
+
return Object.keys(node).length ? node : null;
|
|
8794
|
+
}
|
|
8733
8795
|
static buildManifestFromOptions(rootName, options) {
|
|
8734
|
-
const hasManifestOption = options.mapFiles || !!options.title || !!options.mode || !!options.entryPoint || !!options.language || !!options.author || !!options.description || !!options.docVersion;
|
|
8796
|
+
const hasManifestOption = options.mapFiles || !!options.title || !!options.mode || !!options.entryPoint || !!options.language || !!options.author || !!options.description || !!options.docVersion || !!_MdzPackagerCore.producerApplication(options.application);
|
|
8735
8797
|
if (!hasManifestOption)
|
|
8736
8798
|
return null;
|
|
8737
8799
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
8800
|
+
const application = _MdzPackagerCore.producerApplication(options.application);
|
|
8738
8801
|
return _MdzPackagerCore.pruneManifest({
|
|
8739
8802
|
spec: {
|
|
8740
8803
|
name: "mdzip-spec",
|
|
8741
8804
|
version: PRODUCER_SPEC_VERSION
|
|
8742
8805
|
},
|
|
8743
8806
|
producer: {
|
|
8807
|
+
...application ? { application } : {},
|
|
8744
8808
|
core: {
|
|
8745
8809
|
name: "mdzip-core-js",
|
|
8746
8810
|
version: CORE_LIBRARY_VERSION,
|
|
@@ -8935,7 +8999,7 @@ var MdzPackagerCore = class _MdzPackagerCore {
|
|
|
8935
8999
|
const path = _MdzPackagerCore.normalizePath(targetPath || (isFile ? source.name : "asset.bin"));
|
|
8936
9000
|
const pathError = _MdzPackagerCore.validateArchivePath(path);
|
|
8937
9001
|
if (pathError)
|
|
8938
|
-
throw
|
|
9002
|
+
throw MdzError.fromMessage(`ERR_PATH_INVALID: ${pathError}`);
|
|
8939
9003
|
const bytes = await _MdzPackagerCore.readBinarySource(source);
|
|
8940
9004
|
const mimeType = isBlob && source.type ? source.type : MdzArchiveCore.inferMimeType(path);
|
|
8941
9005
|
return {
|
|
@@ -8981,13 +9045,16 @@ var MdzPackagerCore = class _MdzPackagerCore {
|
|
|
8981
9045
|
mode,
|
|
8982
9046
|
entryPoint
|
|
8983
9047
|
});
|
|
9048
|
+
const application = _MdzPackagerCore.producerApplication(options?.application);
|
|
9049
|
+
if (application)
|
|
9050
|
+
manifest.producer = { ...manifest.producer ?? {}, application };
|
|
8984
9051
|
const files = [
|
|
8985
9052
|
...await Promise.all(workspace.documents.map(async (document) => {
|
|
8986
9053
|
let text = document.text;
|
|
8987
9054
|
if (!text && document.readText) {
|
|
8988
9055
|
text = await document.readText();
|
|
8989
9056
|
} else if (!text && document.isLazy) {
|
|
8990
|
-
throw
|
|
9057
|
+
throw MdzError.fromMessage(`ERR_LAZY_TEXT_UNAVAILABLE: document "${document.path}" was opened lazily but has no readText() reader (likely dropped by serialization); building would write an empty file`);
|
|
8991
9058
|
}
|
|
8992
9059
|
return { path: document.path, text };
|
|
8993
9060
|
})),
|
|
@@ -9025,7 +9092,7 @@ var MdzPackagerCore = class _MdzPackagerCore {
|
|
|
9025
9092
|
try {
|
|
9026
9093
|
manifest = JSON.parse(raw);
|
|
9027
9094
|
} catch {
|
|
9028
|
-
throw
|
|
9095
|
+
throw MdzError.fromMessage("ERR_MANIFEST_INVALID: manifest.json is not valid JSON");
|
|
9029
9096
|
}
|
|
9030
9097
|
MdzArchiveCore.validateManifest(manifest);
|
|
9031
9098
|
return manifest;
|
|
@@ -9065,14 +9132,14 @@ var MdzPackagerCore = class _MdzPackagerCore {
|
|
|
9065
9132
|
return new Uint8Array(source);
|
|
9066
9133
|
if (typeof source.arrayBuffer === "function")
|
|
9067
9134
|
return new Uint8Array(await source.arrayBuffer());
|
|
9068
|
-
throw
|
|
9135
|
+
throw MdzError.fromMessage("ERR_ASSET_BYTES_INVALID: Asset source is not readable as bytes.");
|
|
9069
9136
|
}
|
|
9070
9137
|
static async readWorkspaceAssetBytes(asset) {
|
|
9071
9138
|
if (asset.bytes)
|
|
9072
9139
|
return _MdzPackagerCore.readBinarySource(asset.bytes);
|
|
9073
9140
|
if (asset.readBytes)
|
|
9074
9141
|
return asset.readBytes();
|
|
9075
|
-
throw
|
|
9142
|
+
throw MdzError.fromMessage(`ERR_ASSET_BYTES_MISSING: Asset "${asset.path}" has no bytes or readBytes() source.`);
|
|
9076
9143
|
}
|
|
9077
9144
|
/**
|
|
9078
9145
|
* Builds an `.mdz` archive from input files and packaging options.
|
|
@@ -9085,7 +9152,7 @@ var MdzPackagerCore = class _MdzPackagerCore {
|
|
|
9085
9152
|
static async buildArchive(files, rootName, options, zipWriterFactory) {
|
|
9086
9153
|
const cleanInput = files.map((f) => ({ path: _MdzPackagerCore.normalizePath(f.path), file: f.file, data: f.data, text: f.text })).filter((f) => f.path && !f.path.endsWith("/"));
|
|
9087
9154
|
if (!cleanInput.length) {
|
|
9088
|
-
throw
|
|
9155
|
+
throw MdzError.fromMessage("ERR_PACK_NO_INPUT: No files found to package.");
|
|
9089
9156
|
}
|
|
9090
9157
|
let manifest = _MdzPackagerCore.buildManifestFromOptions(rootName, options);
|
|
9091
9158
|
const skipMap = /* @__PURE__ */ new Map();
|
|
@@ -9155,7 +9222,7 @@ var MdzPackagerCore = class _MdzPackagerCore {
|
|
|
9155
9222
|
}
|
|
9156
9223
|
if (options.createIndex && !resolvedEntryPoint) {
|
|
9157
9224
|
if (manifest?.entryPoint) {
|
|
9158
|
-
throw
|
|
9225
|
+
throw MdzError.fromMessage(`ERR_PACK_ENTRYPOINT_MISSING: Manifest entry-point "${manifest.entryPoint}" does not exist.`);
|
|
9159
9226
|
}
|
|
9160
9227
|
const sortedMarkdownPaths = markdownPaths.slice().sort((a, b) => a.localeCompare(b, void 0, { sensitivity: "base" }));
|
|
9161
9228
|
const generated = _MdzPackagerCore.buildGeneratedIndex(sortedMarkdownPaths, options.title || rootName);
|
|
@@ -9167,7 +9234,7 @@ var MdzPackagerCore = class _MdzPackagerCore {
|
|
|
9167
9234
|
}
|
|
9168
9235
|
const declaredEntryPoint = manifest.entryPoint;
|
|
9169
9236
|
if (declaredEntryPoint && !archivePaths.some((p) => samePath(p, declaredEntryPoint.replace(/^\.\//, "")))) {
|
|
9170
|
-
throw
|
|
9237
|
+
throw MdzError.fromMessage(`ERR_PACK_ENTRYPOINT_MISSING: Manifest entry-point "${declaredEntryPoint}" does not exist in archive.`);
|
|
9171
9238
|
}
|
|
9172
9239
|
if (!declaredEntryPoint && resolvedEntryPoint) {
|
|
9173
9240
|
manifest.entryPoint = resolvedEntryPoint;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdzip/editor-ng",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Angular wrapper for the MDZip workspace editor.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@angular/common": ">=20.0.0",
|
|
31
31
|
"@angular/core": ">=20.0.0",
|
|
32
|
-
"@mdzip/editor": "^2.
|
|
32
|
+
"@mdzip/editor": "^2.3.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"tslib": "^2.8.1"
|