@mdzip/editor-ng 1.4.8 → 2.0.1

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 CHANGED
@@ -106,6 +106,7 @@ showUnchanged? }`) to opt any of them out.
106
106
  | `markdownExtensions` | `readonly MdzipMarkdownRenderExtension[]` | `[]` | Markdown pipeline extensions, diffed by `name` — new array identities with the same names are safe |
107
107
  | `entryRenderers` | `readonly MdzipEntryRenderer[]` | `[]` | Entry renderers claiming the content area for matching entries, diffed by `id` — new array identities with the same ids are safe |
108
108
  | `frontMatter` | `MdzipFrontMatterOptions` | `{}` | Front matter panel config (`enabled`, `display`, `collapsible`, `label`) — always registered, diffed by deep equality; new object identities with equal contents are safe |
109
+ | `externalLinks` | `MdzipExternalLinkPolicy` | — | External-link policy, e.g. `{ target: '_blank' }` (adds `rel="noopener noreferrer"`); optional `rel` and `predicate(href)`. Re-applies without a re-render; diffed by reference — keep the object stable |
109
110
 
110
111
  `controls`, density, `imageHydrationAnimation`, and rendering input changes apply in
111
112
  place — they never recreate the workspace view. Line-number visibility changes
@@ -151,6 +152,7 @@ change.
151
152
  | `colorSchemeChanged` | `MdzipColorScheme` | Emitted when the color scheme changes |
152
153
  | `previewRendered` | `MdzipWorkspaceSnapshot` | Emitted when the preview HTML is mounted |
153
154
  | `assetsHydrated` | `MdzipWorkspaceSnapshot` | Emitted once the mounted preview's images have loaded |
155
+ | `linkActivated` | `MdzipLinkActivatedEvent` | Emitted for every preview link click before built-in handling; call `event.preventDefault()` to take over |
154
156
  | `failed` | `unknown` | Emitted on unrecoverable errors |
155
157
 
156
158
  ## Conversion hook
@@ -188,6 +190,16 @@ exposed as component methods: `removeFile`, `renameFile`, `setEntryPoint`, and `
188
190
  `whenRendered()` resolves once the current preview (including its images) is mounted — useful
189
191
  for revealing or animating read-only preview content.
190
192
 
193
+ ## Links and anchors
194
+
195
+ The `linkActivated` output fires for every preview link click, before the view's own handling, with the
196
+ parsed link (`kind`: `'anchor' | 'document' | 'relative' | 'external'`, plus `path`,
197
+ `anchor`, `targetPath`, `sourcePath`, modifier keys). Call `event.preventDefault()` in the
198
+ handler to route the link yourself; unprevented clicks keep the built-in behavior.
199
+ The component also exposes `scrollToAnchor(anchor)` (waits for the preview to mount, resolves whether it
200
+ scrolled; safe straight after load) and `getAvailableAnchors()`. See the
201
+ [`@mdzip/editor` README](https://www.npmjs.com/package/@mdzip/editor#links-and-anchors).
202
+
191
203
  ## Imperative API
192
204
 
193
205
  All imperative methods are public instance methods on `MdzipWorkspaceComponent`,
package/dist/README.md CHANGED
@@ -106,6 +106,7 @@ showUnchanged? }`) to opt any of them out.
106
106
  | `markdownExtensions` | `readonly MdzipMarkdownRenderExtension[]` | `[]` | Markdown pipeline extensions, diffed by `name` — new array identities with the same names are safe |
107
107
  | `entryRenderers` | `readonly MdzipEntryRenderer[]` | `[]` | Entry renderers claiming the content area for matching entries, diffed by `id` — new array identities with the same ids are safe |
108
108
  | `frontMatter` | `MdzipFrontMatterOptions` | `{}` | Front matter panel config (`enabled`, `display`, `collapsible`, `label`) — always registered, diffed by deep equality; new object identities with equal contents are safe |
109
+ | `externalLinks` | `MdzipExternalLinkPolicy` | — | External-link policy, e.g. `{ target: '_blank' }` (adds `rel="noopener noreferrer"`); optional `rel` and `predicate(href)`. Re-applies without a re-render; diffed by reference — keep the object stable |
109
110
 
110
111
  `controls`, density, `imageHydrationAnimation`, and rendering input changes apply in
111
112
  place — they never recreate the workspace view. Line-number visibility changes
@@ -151,6 +152,7 @@ change.
151
152
  | `colorSchemeChanged` | `MdzipColorScheme` | Emitted when the color scheme changes |
152
153
  | `previewRendered` | `MdzipWorkspaceSnapshot` | Emitted when the preview HTML is mounted |
153
154
  | `assetsHydrated` | `MdzipWorkspaceSnapshot` | Emitted once the mounted preview's images have loaded |
155
+ | `linkActivated` | `MdzipLinkActivatedEvent` | Emitted for every preview link click before built-in handling; call `event.preventDefault()` to take over |
154
156
  | `failed` | `unknown` | Emitted on unrecoverable errors |
155
157
 
156
158
  ## Conversion hook
@@ -188,6 +190,16 @@ exposed as component methods: `removeFile`, `renameFile`, `setEntryPoint`, and `
188
190
  `whenRendered()` resolves once the current preview (including its images) is mounted — useful
189
191
  for revealing or animating read-only preview content.
190
192
 
193
+ ## Links and anchors
194
+
195
+ The `linkActivated` output fires for every preview link click, before the view's own handling, with the
196
+ parsed link (`kind`: `'anchor' | 'document' | 'relative' | 'external'`, plus `path`,
197
+ `anchor`, `targetPath`, `sourcePath`, modifier keys). Call `event.preventDefault()` in the
198
+ handler to route the link yourself; unprevented clicks keep the built-in behavior.
199
+ The component also exposes `scrollToAnchor(anchor)` (waits for the preview to mount, resolves whether it
200
+ scrolled; safe straight after load) and `getAvailableAnchors()`. See the
201
+ [`@mdzip/editor` README](https://www.npmjs.com/package/@mdzip/editor#links-and-anchors).
202
+
191
203
  ## Imperative API
192
204
 
193
205
  All imperative methods are public instance methods on `MdzipWorkspaceComponent`,
@@ -91,9 +91,9 @@ 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": "1.4.8",
94
+ "version": "2.0.1",
95
95
  "repositoryUrl": "https://github.com/mdzip-project/mdzip-editor/tree/main/packages/editor-ng",
96
- "description": "Angular UI components for the MDZip workspace engine."
96
+ "description": "Angular wrapper for the MDZip workspace editor."
97
97
  };
98
98
 
99
99
  // Identity-insensitive key for the rendering inputs: extensions and entry
@@ -145,6 +145,11 @@ class MdzipWorkspaceComponent {
145
145
  this.previewRendered = new EventEmitter();
146
146
  /** Emits once the mounted preview's images have finished loading. */
147
147
  this.assetsHydrated = new EventEmitter();
148
+ /**
149
+ * Emits for every click on a preview link, before the view's own handling.
150
+ * Call `event.preventDefault()` in the handler to take over navigation.
151
+ */
152
+ this.linkActivated = new EventEmitter();
148
153
  this.failed = new EventEmitter();
149
154
  this.view = null;
150
155
  this.renderingKey = '';
@@ -189,6 +194,9 @@ class MdzipWorkspaceComponent {
189
194
  imageEditHandler: (request) => this.imageEditHandler?.(request),
190
195
  });
191
196
  }
197
+ if (this.view && changes['externalLinks']) {
198
+ this.view.setExternalLinks(this.externalLinks);
199
+ }
192
200
  if (this.view && (changes['bytes'] || changes['workspace'] || changes['mode']
193
201
  || changes['sourceFormat'] || changes['fileName'] || changes['worker'])) {
194
202
  this.syncView();
@@ -229,6 +237,13 @@ class MdzipWorkspaceComponent {
229
237
  whenRendered() {
230
238
  return this.view?.whenRendered() ?? Promise.resolve();
231
239
  }
240
+ /** See `MdzipWorkspaceView.scrollToAnchor` — waits for the preview to mount. */
241
+ scrollToAnchor(anchor) {
242
+ return this.view?.scrollToAnchor(anchor) ?? Promise.resolve(false);
243
+ }
244
+ getAvailableAnchors() {
245
+ return this.view?.getAvailableAnchors() ?? [];
246
+ }
232
247
  markPersisted() {
233
248
  this.view?.markPersisted();
234
249
  }
@@ -304,6 +319,8 @@ class MdzipWorkspaceComponent {
304
319
  onColorSchemeChanged: (colorScheme) => this.colorSchemeChanged.emit(colorScheme),
305
320
  onPreviewRendered: (snapshot) => this.previewRendered.emit(snapshot),
306
321
  onAssetsHydrated: (snapshot) => this.assetsHydrated.emit(snapshot),
322
+ onLinkActivated: (event) => this.linkActivated.emit(event),
323
+ externalLinks: this.externalLinks,
307
324
  onFailed: (e) => this.failed.emit(e),
308
325
  onConversionRequested: this.onConversionRequested
309
326
  ? (action, context) => this.onConversionRequested(action, context)
@@ -344,7 +361,7 @@ class MdzipWorkspaceComponent {
344
361
  });
345
362
  }
346
363
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: MdzipWorkspaceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
347
- 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", mode: "mode", sourceFormat: "sourceFormat", worker: "worker", controls: "controls", toolbarDensity: "toolbarDensity", contentDensity: "contentDensity", imageHydrationAnimation: "imageHydrationAnimation", imageInsertMode: "imageInsertMode", imageInsertHandler: "imageInsertHandler", imageEditHandler: "imageEditHandler", initialLayout: "initialLayout", initialColorScheme: "initialColorScheme", progressiveTextRendering: "progressiveTextRendering", navigationMode: "navigationMode", navigationButtonActive: "navigationButtonActive", onConversionRequested: "onConversionRequested", onPackRequested: "onPackRequested", markdownRenderer: "markdownRenderer", markdownExtensions: "markdownExtensions", entryRenderers: "entryRenderers", frontMatter: "frontMatter" }, outputs: { changed: "changed", saved: "saved", workspaceChanged: "workspaceChanged", documentChanged: "documentChanged", assetChanged: "assetChanged", manifestChanged: "manifestChanged", snapshotChanged: "snapshotChanged", selectionChanged: "selectionChanged", dirtyChanged: "dirtyChanged", validationChanged: "validationChanged", colorSchemeChanged: "colorSchemeChanged", previewRendered: "previewRendered", assetsHydrated: "assetsHydrated", 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 }); }
364
+ 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", mode: "mode", sourceFormat: "sourceFormat", worker: "worker", controls: "controls", toolbarDensity: "toolbarDensity", contentDensity: "contentDensity", imageHydrationAnimation: "imageHydrationAnimation", imageInsertMode: "imageInsertMode", imageInsertHandler: "imageInsertHandler", imageEditHandler: "imageEditHandler", initialLayout: "initialLayout", initialColorScheme: "initialColorScheme", 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", 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 }); }
348
365
  }
349
366
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: MdzipWorkspaceComponent, decorators: [{
350
367
  type: Component,
@@ -397,6 +414,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImpo
397
414
  type: Input
398
415
  }], frontMatter: [{
399
416
  type: Input
417
+ }], externalLinks: [{
418
+ type: Input
400
419
  }], changed: [{
401
420
  type: Output
402
421
  }], saved: [{
@@ -423,6 +442,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImpo
423
442
  type: Output
424
443
  }], assetsHydrated: [{
425
444
  type: Output
445
+ }], linkActivated: [{
446
+ type: Output
426
447
  }], failed: [{
427
448
  type: Output
428
449
  }], hostRef: [{
@@ -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\": \"1.4.8\",\n \"repositoryUrl\": \"https://github.com/mdzip-project/mdzip-editor/tree/main/packages/editor-ng\",\n \"description\": \"Angular UI components for the MDZip workspace engine.\"\n} as const;\n","import {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n QueryList,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { MdzipEntryRendererDirective } from './entry-renderer.directive';\nimport { PACKAGE_INFO } from './package-info.js';\nimport { MdzipWorkspaceView } from '@mdzip/editor';\nimport type {\n MdzipControlPolicy,\n MdzipControlPreset,\n MdzipContentDensity,\n MdzipColorScheme,\n MdzipConversionAction,\n MdzipConversionContext,\n MdzipEditorCommand,\n MdzipPackFilesContext,\n MdzipPackFilesInput,\n MdzipPackFilesRequest,\n MdzipPackFilesResult,\n MdzipDocumentChangeEvent,\n MdzipEditorSnapshot,\n MdzipEntryRenderer,\n MdzipFrontMatterOptions,\n MdzipMarkdownRenderExtension,\n MdzipMarkdownRenderer,\n MdzipImageEditHandler,\n MdzipImageHydrationAnimation,\n MdzipImageInsertHandler,\n MdzipImageInsertMode,\n MdzipNavigationMode,\n MdzipRemoveAssetOptions,\n MdzipSourceFormat,\n MdzipToolbarDensity,\n MdzWorkspace,\n MdzWorkspaceAsset,\n MdzipWorkspaceChange,\n MdzipWorkspaceLayout,\n MdzipWorkspaceMode,\n MdzipWorkspaceSave,\n MdzipWorkspaceSnapshot,\n} from '@mdzip/editor';\n\n// Identity-insensitive key for the rendering inputs: extensions and entry\n// renderers are diffed by their stable name/id (and priority), so template\n// expressions that build new arrays each change-detection cycle never\n// trigger an update.\nfunction renderingConfigKey(\n extensions: readonly MdzipMarkdownRenderExtension[],\n entryRenderers: readonly MdzipEntryRenderer[],\n frontMatter: MdzipFrontMatterOptions\n): string {\n return JSON.stringify([\n extensions.map((extension) => extension.name),\n entryRenderers.map((renderer) => [renderer.id, renderer.priority ?? 0]),\n // frontMatter carries no functions, so plain deep equality via\n // JSON.stringify is enough — no need for the name/id treatment above.\n frontMatter,\n ]);\n}\n\n@Component({\n selector: 'mdzip-workspace',\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 MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit, OnChanges, OnDestroy {\n @Input() bytes: Uint8Array | null = null;\n @Input() workspace: MdzWorkspace | null = null;\n @Input() fileName = 'document.mdz';\n @Input() mode: MdzipWorkspaceMode = 'read-only';\n @Input() sourceFormat?: MdzipSourceFormat;\n /**\n * Dedicated Worker running `@mdzip/editor`'s `mdz-archive.worker.js`. When\n * provided, archive parsing and reads happen off the main thread instead of\n * blocking it — recommended for large archives. The host constructs the\n * `Worker` (asset URL resolution varies by build tooling); this component\n * forwards it to `MdzipWorkspaceService` unchanged and does not own its\n * lifecycle beyond that.\n */\n @Input() worker?: Worker;\n @Input() controls: MdzipControlPreset | MdzipControlPolicy = 'viewer';\n @Input() toolbarDensity?: MdzipToolbarDensity;\n @Input() contentDensity?: MdzipContentDensity;\n @Input() imageHydrationAnimation?: MdzipImageHydrationAnimation;\n @Input() imageInsertMode?: MdzipImageInsertMode;\n @Input() imageInsertHandler?: MdzipImageInsertHandler;\n @Input() imageEditHandler?: MdzipImageEditHandler;\n @Input() initialLayout?: MdzipWorkspaceLayout;\n @Input() initialColorScheme?: MdzipColorScheme;\n /**\n * Mounts the preview in chunks near the viewport instead of rendering the\n * whole document synchronously up front. Recommended for hosts that may\n * open very large documents. Defaults to `false`. Constructor-only, like\n * `initialColorScheme` — changing it recreates the view.\n */\n @Input() progressiveTextRendering?: boolean;\n @Input() navigationMode: MdzipNavigationMode = 'editor';\n @Input() navigationButtonActive = true;\n /**\n * Host hook for the markdown→MDZ conversion flow. An input function (not an\n * output) because it must return/resolve `true` to suppress the built-in\n * conversion dialog.\n */\n @Input() onConversionRequested?: (\n action: MdzipConversionAction,\n context: MdzipConversionContext\n ) => boolean | Promise<boolean>;\n /**\n * Host hook for the folder→.mdz packing decision surfaced by\n * `packFilesAsWorkspace()`. Same input-not-output reasoning as\n * `onConversionRequested`.\n */\n @Input() onPackRequested?: (\n request: MdzipPackFilesRequest,\n context: MdzipPackFilesContext\n ) => boolean | Promise<boolean>;\n /**\n * Custom markdown renderer. Keep the reference stable: identity changes\n * apply via a cheap preview re-render, never a workspace rebuild.\n */\n @Input() markdownRenderer?: MdzipMarkdownRenderer;\n /** Markdown pipeline extensions, diffed by `name`. */\n @Input() markdownExtensions: readonly MdzipMarkdownRenderExtension[] = [];\n /** Entry renderers, diffed by `id`/`priority`. */\n @Input() entryRenderers: readonly MdzipEntryRenderer[] = [];\n /**\n * Controls how a leading `---`-delimited YAML front matter block renders\n * in the preview — display (table/raw), the collapsible expander, and its\n * label. Front matter handling is always registered (unlike\n * `markdownExtensions`); this only configures it. Diffed by deep equality\n * — object literals produced fresh each change-detection cycle are safe.\n */\n @Input() frontMatter: MdzipFrontMatterOptions = {};\n @Output() readonly changed = new EventEmitter<MdzipWorkspaceChange>();\n @Output() readonly saved = new EventEmitter<MdzipWorkspaceSave>();\n @Output() readonly workspaceChanged = new EventEmitter<MdzipDocumentChangeEvent>();\n @Output() readonly documentChanged = new EventEmitter<MdzipDocumentChangeEvent>();\n @Output() readonly assetChanged = new EventEmitter<MdzipDocumentChangeEvent>();\n @Output() readonly manifestChanged = new EventEmitter<MdzipDocumentChangeEvent>();\n @Output() readonly snapshotChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly selectionChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly dirtyChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly validationChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly colorSchemeChanged = new EventEmitter<MdzipColorScheme>();\n /** Emits when the preview HTML for the current selection is mounted. */\n @Output() readonly previewRendered = new EventEmitter<MdzipWorkspaceSnapshot>();\n /** Emits once the mounted preview's images have finished loading. */\n @Output() readonly assetsHydrated = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly failed = new EventEmitter<unknown>();\n\n @ViewChild('host') private readonly hostRef!: ElementRef<HTMLDivElement>;\n /**\n * `<ng-template mdzipEntryRenderer>` declarations projected into the\n * component. Each becomes an entry renderer appended after the\n * `entryRenderers` input (stable sort keeps the input ahead at equal\n * priority).\n */\n @ContentChildren(MdzipEntryRendererDirective)\n private readonly entryTemplates!: QueryList<MdzipEntryRendererDirective>;\n private view: MdzipWorkspaceView | null = null;\n private renderingKey = '';\n private entryTemplatesSub: { unsubscribe(): void } | null = null;\n\n ngAfterContentInit(): void {\n this.entryTemplatesSub = this.entryTemplates.changes.subscribe(() => {\n this.applyRenderingOptions(false);\n });\n }\n\n ngAfterViewInit(): void {\n this.createView();\n this.syncView();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (this.view && (changes['initialLayout'] || changes['initialColorScheme'] || changes['progressiveTextRendering']\n || changes['navigationMode'] || changes['navigationButtonActive'])) {\n this.createView();\n this.syncView();\n return;\n }\n if (this.view && changes['controls']) {\n this.view.setControls(this.controls);\n }\n if (this.view && (changes['toolbarDensity'] || changes['contentDensity'])) {\n this.view.setDensityOptions({\n toolbarDensity: this.toolbarDensity,\n contentDensity: this.contentDensity,\n });\n }\n if (this.view && changes['imageHydrationAnimation']) {\n this.view.setImageHydrationAnimation(this.imageHydrationAnimation);\n }\n if (this.view && (changes['imageInsertMode'] || changes['imageInsertHandler'])) {\n this.view.setImageInsertOptions({\n imageInsertMode: this.imageInsertMode,\n imageInsertHandler: (request) => this.imageInsertHandler?.(request),\n });\n }\n if (this.view && changes['imageEditHandler']) {\n this.view.setImageEditOptions({\n imageEditHandler: (request) => this.imageEditHandler?.(request),\n });\n }\n if (this.view && (changes['bytes'] || changes['workspace'] || changes['mode']\n || changes['sourceFormat'] || changes['fileName'] || changes['worker'])) {\n this.syncView();\n }\n if (this.view && (changes['markdownRenderer'] || changes['markdownExtensions']\n || changes['entryRenderers'] || changes['frontMatter'])) {\n this.applyRenderingOptions(Boolean(changes['markdownRenderer']));\n }\n }\n\n ngOnDestroy(): void {\n this.entryTemplatesSub?.unsubscribe();\n this.view?.destroy();\n }\n\n canExecuteCommand(command: MdzipEditorCommand): boolean {\n return this.view?.canExecuteCommand(command) ?? false;\n }\n\n executeCommand(command: MdzipEditorCommand, file?: File): Promise<boolean> {\n return this.view?.executeCommand(command, file) ?? Promise.resolve(false);\n }\n\n convertToMdz(): Promise<boolean> {\n return this.view?.convertToMdz() ?? Promise.resolve(false);\n }\n\n focus(): void {\n this.view?.focus();\n }\n\n setColorScheme(scheme: MdzipColorScheme): void {\n this.view?.setColorScheme(scheme);\n }\n\n flush(): Promise<MdzipEditorSnapshot | null> {\n return this.view?.flush() ?? Promise.resolve(null);\n }\n\n serialize(): Promise<Blob | null> {\n return this.view?.serialize() ?? Promise.resolve(null);\n }\n\n getCurrentSnapshot(): Promise<MdzipEditorSnapshot | null> {\n return this.view?.getCurrentSnapshot() ?? Promise.resolve(null);\n }\n\n whenRendered(): Promise<void> {\n return this.view?.whenRendered() ?? Promise.resolve();\n }\n\n markPersisted(): void {\n this.view?.markPersisted();\n }\n\n addAsset(archivePath: string, fileBytes: Uint8Array): Promise<void> {\n return this.view?.addAsset(archivePath, fileBytes) ?? Promise.resolve();\n }\n\n replaceAsset(archivePath: string, fileBytes: Uint8Array): Promise<boolean> {\n return this.view?.replaceAsset(archivePath, fileBytes) ?? Promise.resolve(false);\n }\n\n removeAsset(archivePath: string, options?: MdzipRemoveAssetOptions): Promise<boolean> {\n return this.view?.removeAsset(archivePath, options) ?? Promise.resolve(false);\n }\n\n removeFile(archivePath: string): Promise<boolean> {\n return this.view?.removeFile(archivePath) ?? Promise.resolve(false);\n }\n\n renameFile(oldPath: string, newPath: string): Promise<boolean> {\n return this.view?.renameFile(oldPath, newPath) ?? Promise.resolve(false);\n }\n\n setEntryPoint(archivePath: string): Promise<boolean> {\n return this.view?.setEntryPoint(archivePath) ?? Promise.resolve(false);\n }\n\n packFilesAsWorkspace(\n files: readonly MdzipPackFilesInput[],\n options?: { title?: string; fileName?: string }\n ): Promise<MdzipPackFilesResult | null> {\n return this.view?.packFilesAsWorkspace(files, options) ?? Promise.resolve(null);\n }\n\n setCoverImage(archivePath: string | null): Promise<boolean> {\n return this.view?.setCoverImage(archivePath) ?? Promise.resolve(false);\n }\n\n listAssets(): MdzWorkspaceAsset[] {\n return this.view?.listAssets() ?? [];\n }\n\n private syncView(): void {\n if (this.view && this.workspace) {\n void this.view.openWorkspace(this.workspace, {\n mode: this.mode,\n sourceFormat: this.sourceFormat,\n fileName: this.fileName,\n worker: this.worker\n });\n } else if (this.view && this.bytes) {\n void this.view.open(this.bytes, {\n mode: this.mode,\n sourceFormat: this.sourceFormat,\n fileName: this.fileName,\n worker: this.worker\n });\n }\n }\n\n private createView(): void {\n this.view?.destroy();\n this.view = new MdzipWorkspaceView(this.hostRef.nativeElement, {\n libraries: [PACKAGE_INFO],\n controls: this.controls,\n toolbarDensity: this.toolbarDensity,\n contentDensity: this.contentDensity,\n imageHydrationAnimation: this.imageHydrationAnimation,\n imageInsertMode: this.imageInsertMode,\n initialLayout: this.initialLayout,\n initialColorScheme: this.initialColorScheme,\n progressiveTextRendering: this.progressiveTextRendering,\n navigationMode: this.navigationMode,\n navigationButtonActive: this.navigationButtonActive,\n onChanged: (bytes, snapshot) => this.changed.emit({ bytes, snapshot }),\n onSaved: (bytes, snapshot) => this.saved.emit({ bytes, snapshot }),\n onWorkspaceChanged: (event) => this.workspaceChanged.emit(event),\n onDocumentChanged: (event) => this.documentChanged.emit(event),\n onAssetChanged: (event) => this.assetChanged.emit(event),\n onManifestChanged: (event) => this.manifestChanged.emit(event),\n onSnapshotChanged: (snapshot) => this.snapshotChanged.emit(snapshot),\n onSelectionChanged: (snapshot: MdzipWorkspaceSnapshot) => this.selectionChanged.emit(snapshot),\n onDirtyChanged: (snapshot: MdzipWorkspaceSnapshot) => this.dirtyChanged.emit(snapshot),\n onValidationChanged: (snapshot: MdzipWorkspaceSnapshot) => this.validationChanged.emit(snapshot),\n onColorSchemeChanged: (colorScheme: MdzipColorScheme) => this.colorSchemeChanged.emit(colorScheme),\n onPreviewRendered: (snapshot: MdzipWorkspaceSnapshot) => this.previewRendered.emit(snapshot),\n onAssetsHydrated: (snapshot: MdzipWorkspaceSnapshot) => this.assetsHydrated.emit(snapshot),\n onFailed: (e: unknown) => this.failed.emit(e),\n onConversionRequested: this.onConversionRequested\n ? (action, context) => this.onConversionRequested!(action, context)\n : undefined,\n onPackRequested: this.onPackRequested\n ? (request, context) => this.onPackRequested!(request, context)\n : undefined,\n imageInsertHandler: (request) => this.imageInsertHandler?.(request),\n imageEditHandler: (request) => this.imageEditHandler?.(request),\n markdownRenderer: this.markdownRenderer,\n markdownExtensions: this.markdownExtensions,\n entryRenderers: this.composedEntryRenderers(),\n frontMatter: this.frontMatter,\n });\n this.renderingKey = renderingConfigKey(this.markdownExtensions, this.composedEntryRenderers(), this.frontMatter);\n }\n\n private composedEntryRenderers(): readonly MdzipEntryRenderer[] {\n const templates = this.entryTemplates\n ? this.entryTemplates.map((directive, index) => directive.toEntryRenderer(index))\n : [];\n return [...this.entryRenderers, ...templates];\n }\n\n // Applies rendering input changes in place — never a view rebuild. Arrays\n // re-apply only when their name/id key changes, so template expressions\n // that produce new array identities each cycle are safe.\n private applyRenderingOptions(rendererChanged: boolean): void {\n const composed = this.composedEntryRenderers();\n const key = renderingConfigKey(this.markdownExtensions, composed, this.frontMatter);\n if (!rendererChanged && key === this.renderingKey) {\n return;\n }\n this.renderingKey = key;\n this.view?.setRenderingOptions({\n markdownRenderer: this.markdownRenderer ?? null,\n markdownExtensions: this.markdownExtensions,\n entryRenderers: composed,\n frontMatter: this.frontMatter,\n });\n }\n}\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","/**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AA,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.0.1\",\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 {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n QueryList,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { MdzipEntryRendererDirective } from './entry-renderer.directive';\nimport { PACKAGE_INFO } from './package-info.js';\nimport { MdzipWorkspaceView } from '@mdzip/editor';\nimport type {\n MdzipControlPolicy,\n MdzipControlPreset,\n MdzipContentDensity,\n MdzipColorScheme,\n MdzipConversionAction,\n MdzipConversionContext,\n MdzipEditorCommand,\n MdzipPackFilesContext,\n MdzipPackFilesInput,\n MdzipPackFilesRequest,\n MdzipPackFilesResult,\n MdzipDocumentChangeEvent,\n MdzipEditorSnapshot,\n MdzipEntryRenderer,\n MdzipExternalLinkPolicy,\n MdzipFrontMatterOptions,\n MdzipLinkActivatedEvent,\n MdzipMarkdownRenderExtension,\n MdzipMarkdownRenderer,\n MdzipImageEditHandler,\n MdzipImageHydrationAnimation,\n MdzipImageInsertHandler,\n MdzipImageInsertMode,\n MdzipNavigationMode,\n MdzipRemoveAssetOptions,\n MdzipSourceFormat,\n MdzipToolbarDensity,\n MdzWorkspace,\n MdzWorkspaceAsset,\n MdzipWorkspaceChange,\n MdzipWorkspaceLayout,\n MdzipWorkspaceMode,\n MdzipWorkspaceSave,\n MdzipWorkspaceSnapshot,\n} from '@mdzip/editor';\n\n// Identity-insensitive key for the rendering inputs: extensions and entry\n// renderers are diffed by their stable name/id (and priority), so template\n// expressions that build new arrays each change-detection cycle never\n// trigger an update.\nfunction renderingConfigKey(\n extensions: readonly MdzipMarkdownRenderExtension[],\n entryRenderers: readonly MdzipEntryRenderer[],\n frontMatter: MdzipFrontMatterOptions\n): string {\n return JSON.stringify([\n extensions.map((extension) => extension.name),\n entryRenderers.map((renderer) => [renderer.id, renderer.priority ?? 0]),\n // frontMatter carries no functions, so plain deep equality via\n // JSON.stringify is enough — no need for the name/id treatment above.\n frontMatter,\n ]);\n}\n\n@Component({\n selector: 'mdzip-workspace',\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 MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit, OnChanges, OnDestroy {\n @Input() bytes: Uint8Array | null = null;\n @Input() workspace: MdzWorkspace | null = null;\n @Input() fileName = 'document.mdz';\n @Input() mode: MdzipWorkspaceMode = 'read-only';\n @Input() sourceFormat?: MdzipSourceFormat;\n /**\n * Dedicated Worker running `@mdzip/editor`'s `mdz-archive.worker.js`. When\n * provided, archive parsing and reads happen off the main thread instead of\n * blocking it — recommended for large archives. The host constructs the\n * `Worker` (asset URL resolution varies by build tooling); this component\n * forwards it to `MdzipWorkspaceService` unchanged and does not own its\n * lifecycle beyond that.\n */\n @Input() worker?: Worker;\n @Input() controls: MdzipControlPreset | MdzipControlPolicy = 'viewer';\n @Input() toolbarDensity?: MdzipToolbarDensity;\n @Input() contentDensity?: MdzipContentDensity;\n @Input() imageHydrationAnimation?: MdzipImageHydrationAnimation;\n @Input() imageInsertMode?: MdzipImageInsertMode;\n @Input() imageInsertHandler?: MdzipImageInsertHandler;\n @Input() imageEditHandler?: MdzipImageEditHandler;\n @Input() initialLayout?: MdzipWorkspaceLayout;\n @Input() initialColorScheme?: MdzipColorScheme;\n /**\n * Mounts the preview in chunks near the viewport instead of rendering the\n * whole document synchronously up front. Recommended for hosts that may\n * open very large documents. Defaults to `false`. Constructor-only, like\n * `initialColorScheme` — changing it recreates the view.\n */\n @Input() progressiveTextRendering?: boolean;\n @Input() navigationMode: MdzipNavigationMode = 'editor';\n @Input() navigationButtonActive = true;\n /**\n * Host hook for the markdown→MDZ conversion flow. An input function (not an\n * output) because it must return/resolve `true` to suppress the built-in\n * conversion dialog.\n */\n @Input() onConversionRequested?: (\n action: MdzipConversionAction,\n context: MdzipConversionContext\n ) => boolean | Promise<boolean>;\n /**\n * Host hook for the folder→.mdz packing decision surfaced by\n * `packFilesAsWorkspace()`. Same input-not-output reasoning as\n * `onConversionRequested`.\n */\n @Input() onPackRequested?: (\n request: MdzipPackFilesRequest,\n context: MdzipPackFilesContext\n ) => boolean | Promise<boolean>;\n /**\n * Custom markdown renderer. Keep the reference stable: identity changes\n * apply via a cheap preview re-render, never a workspace rebuild.\n */\n @Input() markdownRenderer?: MdzipMarkdownRenderer;\n /** Markdown pipeline extensions, diffed by `name`. */\n @Input() markdownExtensions: readonly MdzipMarkdownRenderExtension[] = [];\n /** Entry renderers, diffed by `id`/`priority`. */\n @Input() entryRenderers: readonly MdzipEntryRenderer[] = [];\n /**\n * Controls how a leading `---`-delimited YAML front matter block renders\n * in the preview — display (table/raw), the collapsible expander, and its\n * label. Front matter handling is always registered (unlike\n * `markdownExtensions`); this only configures it. Diffed by deep equality\n * — object literals produced fresh each change-detection cycle are safe.\n */\n @Input() frontMatter: MdzipFrontMatterOptions = {};\n /**\n * Rendering policy for external links in the preview, e.g.\n * `{ target: '_blank' }` (adds `rel=\"noopener noreferrer\"` by default).\n * Changes re-apply to the mounted preview without a re-render.\n */\n @Input() externalLinks?: MdzipExternalLinkPolicy;\n @Output() readonly changed = new EventEmitter<MdzipWorkspaceChange>();\n @Output() readonly saved = new EventEmitter<MdzipWorkspaceSave>();\n @Output() readonly workspaceChanged = new EventEmitter<MdzipDocumentChangeEvent>();\n @Output() readonly documentChanged = new EventEmitter<MdzipDocumentChangeEvent>();\n @Output() readonly assetChanged = new EventEmitter<MdzipDocumentChangeEvent>();\n @Output() readonly manifestChanged = new EventEmitter<MdzipDocumentChangeEvent>();\n @Output() readonly snapshotChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly selectionChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly dirtyChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly validationChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly colorSchemeChanged = new EventEmitter<MdzipColorScheme>();\n /** Emits when the preview HTML for the current selection is mounted. */\n @Output() readonly previewRendered = new EventEmitter<MdzipWorkspaceSnapshot>();\n /** Emits once the mounted preview's images have finished loading. */\n @Output() readonly assetsHydrated = new EventEmitter<MdzipWorkspaceSnapshot>();\n /**\n * Emits for every click on a preview link, before the view's own handling.\n * Call `event.preventDefault()` in the handler to take over navigation.\n */\n @Output() readonly linkActivated = new EventEmitter<MdzipLinkActivatedEvent>();\n @Output() readonly failed = new EventEmitter<unknown>();\n\n @ViewChild('host') private readonly hostRef!: ElementRef<HTMLDivElement>;\n /**\n * `<ng-template mdzipEntryRenderer>` declarations projected into the\n * component. Each becomes an entry renderer appended after the\n * `entryRenderers` input (stable sort keeps the input ahead at equal\n * priority).\n */\n @ContentChildren(MdzipEntryRendererDirective)\n private readonly entryTemplates!: QueryList<MdzipEntryRendererDirective>;\n private view: MdzipWorkspaceView | null = null;\n private renderingKey = '';\n private entryTemplatesSub: { unsubscribe(): void } | null = null;\n\n ngAfterContentInit(): void {\n this.entryTemplatesSub = this.entryTemplates.changes.subscribe(() => {\n this.applyRenderingOptions(false);\n });\n }\n\n ngAfterViewInit(): void {\n this.createView();\n this.syncView();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (this.view && (changes['initialLayout'] || changes['initialColorScheme'] || changes['progressiveTextRendering']\n || changes['navigationMode'] || changes['navigationButtonActive'])) {\n this.createView();\n this.syncView();\n return;\n }\n if (this.view && changes['controls']) {\n this.view.setControls(this.controls);\n }\n if (this.view && (changes['toolbarDensity'] || changes['contentDensity'])) {\n this.view.setDensityOptions({\n toolbarDensity: this.toolbarDensity,\n contentDensity: this.contentDensity,\n });\n }\n if (this.view && changes['imageHydrationAnimation']) {\n this.view.setImageHydrationAnimation(this.imageHydrationAnimation);\n }\n if (this.view && (changes['imageInsertMode'] || changes['imageInsertHandler'])) {\n this.view.setImageInsertOptions({\n imageInsertMode: this.imageInsertMode,\n imageInsertHandler: (request) => this.imageInsertHandler?.(request),\n });\n }\n if (this.view && changes['imageEditHandler']) {\n this.view.setImageEditOptions({\n imageEditHandler: (request) => this.imageEditHandler?.(request),\n });\n }\n if (this.view && changes['externalLinks']) {\n this.view.setExternalLinks(this.externalLinks);\n }\n if (this.view && (changes['bytes'] || changes['workspace'] || changes['mode']\n || changes['sourceFormat'] || changes['fileName'] || changes['worker'])) {\n this.syncView();\n }\n if (this.view && (changes['markdownRenderer'] || changes['markdownExtensions']\n || changes['entryRenderers'] || changes['frontMatter'])) {\n this.applyRenderingOptions(Boolean(changes['markdownRenderer']));\n }\n }\n\n ngOnDestroy(): void {\n this.entryTemplatesSub?.unsubscribe();\n this.view?.destroy();\n }\n\n canExecuteCommand(command: MdzipEditorCommand): boolean {\n return this.view?.canExecuteCommand(command) ?? false;\n }\n\n executeCommand(command: MdzipEditorCommand, file?: File): Promise<boolean> {\n return this.view?.executeCommand(command, file) ?? Promise.resolve(false);\n }\n\n convertToMdz(): Promise<boolean> {\n return this.view?.convertToMdz() ?? Promise.resolve(false);\n }\n\n focus(): void {\n this.view?.focus();\n }\n\n setColorScheme(scheme: MdzipColorScheme): void {\n this.view?.setColorScheme(scheme);\n }\n\n flush(): Promise<MdzipEditorSnapshot | null> {\n return this.view?.flush() ?? Promise.resolve(null);\n }\n\n serialize(): Promise<Blob | null> {\n return this.view?.serialize() ?? Promise.resolve(null);\n }\n\n getCurrentSnapshot(): Promise<MdzipEditorSnapshot | null> {\n return this.view?.getCurrentSnapshot() ?? Promise.resolve(null);\n }\n\n whenRendered(): Promise<void> {\n return this.view?.whenRendered() ?? Promise.resolve();\n }\n\n /** See `MdzipWorkspaceView.scrollToAnchor` — waits for the preview to mount. */\n scrollToAnchor(anchor: string): Promise<boolean> {\n return this.view?.scrollToAnchor(anchor) ?? Promise.resolve(false);\n }\n\n getAvailableAnchors(): string[] {\n return this.view?.getAvailableAnchors() ?? [];\n }\n\n markPersisted(): void {\n this.view?.markPersisted();\n }\n\n addAsset(archivePath: string, fileBytes: Uint8Array): Promise<void> {\n return this.view?.addAsset(archivePath, fileBytes) ?? Promise.resolve();\n }\n\n replaceAsset(archivePath: string, fileBytes: Uint8Array): Promise<boolean> {\n return this.view?.replaceAsset(archivePath, fileBytes) ?? Promise.resolve(false);\n }\n\n removeAsset(archivePath: string, options?: MdzipRemoveAssetOptions): Promise<boolean> {\n return this.view?.removeAsset(archivePath, options) ?? Promise.resolve(false);\n }\n\n removeFile(archivePath: string): Promise<boolean> {\n return this.view?.removeFile(archivePath) ?? Promise.resolve(false);\n }\n\n renameFile(oldPath: string, newPath: string): Promise<boolean> {\n return this.view?.renameFile(oldPath, newPath) ?? Promise.resolve(false);\n }\n\n setEntryPoint(archivePath: string): Promise<boolean> {\n return this.view?.setEntryPoint(archivePath) ?? Promise.resolve(false);\n }\n\n packFilesAsWorkspace(\n files: readonly MdzipPackFilesInput[],\n options?: { title?: string; fileName?: string }\n ): Promise<MdzipPackFilesResult | null> {\n return this.view?.packFilesAsWorkspace(files, options) ?? Promise.resolve(null);\n }\n\n setCoverImage(archivePath: string | null): Promise<boolean> {\n return this.view?.setCoverImage(archivePath) ?? Promise.resolve(false);\n }\n\n listAssets(): MdzWorkspaceAsset[] {\n return this.view?.listAssets() ?? [];\n }\n\n private syncView(): void {\n if (this.view && this.workspace) {\n void this.view.openWorkspace(this.workspace, {\n mode: this.mode,\n sourceFormat: this.sourceFormat,\n fileName: this.fileName,\n worker: this.worker\n });\n } else if (this.view && this.bytes) {\n void this.view.open(this.bytes, {\n mode: this.mode,\n sourceFormat: this.sourceFormat,\n fileName: this.fileName,\n worker: this.worker\n });\n }\n }\n\n private createView(): void {\n this.view?.destroy();\n this.view = new MdzipWorkspaceView(this.hostRef.nativeElement, {\n libraries: [PACKAGE_INFO],\n controls: this.controls,\n toolbarDensity: this.toolbarDensity,\n contentDensity: this.contentDensity,\n imageHydrationAnimation: this.imageHydrationAnimation,\n imageInsertMode: this.imageInsertMode,\n initialLayout: this.initialLayout,\n initialColorScheme: this.initialColorScheme,\n progressiveTextRendering: this.progressiveTextRendering,\n navigationMode: this.navigationMode,\n navigationButtonActive: this.navigationButtonActive,\n onChanged: (bytes, snapshot) => this.changed.emit({ bytes, snapshot }),\n onSaved: (bytes, snapshot) => this.saved.emit({ bytes, snapshot }),\n onWorkspaceChanged: (event) => this.workspaceChanged.emit(event),\n onDocumentChanged: (event) => this.documentChanged.emit(event),\n onAssetChanged: (event) => this.assetChanged.emit(event),\n onManifestChanged: (event) => this.manifestChanged.emit(event),\n onSnapshotChanged: (snapshot) => this.snapshotChanged.emit(snapshot),\n onSelectionChanged: (snapshot: MdzipWorkspaceSnapshot) => this.selectionChanged.emit(snapshot),\n onDirtyChanged: (snapshot: MdzipWorkspaceSnapshot) => this.dirtyChanged.emit(snapshot),\n onValidationChanged: (snapshot: MdzipWorkspaceSnapshot) => this.validationChanged.emit(snapshot),\n onColorSchemeChanged: (colorScheme: MdzipColorScheme) => this.colorSchemeChanged.emit(colorScheme),\n onPreviewRendered: (snapshot: MdzipWorkspaceSnapshot) => this.previewRendered.emit(snapshot),\n onAssetsHydrated: (snapshot: MdzipWorkspaceSnapshot) => this.assetsHydrated.emit(snapshot),\n onLinkActivated: (event: MdzipLinkActivatedEvent) => this.linkActivated.emit(event),\n externalLinks: this.externalLinks,\n onFailed: (e: unknown) => this.failed.emit(e),\n onConversionRequested: this.onConversionRequested\n ? (action, context) => this.onConversionRequested!(action, context)\n : undefined,\n onPackRequested: this.onPackRequested\n ? (request, context) => this.onPackRequested!(request, context)\n : undefined,\n imageInsertHandler: (request) => this.imageInsertHandler?.(request),\n imageEditHandler: (request) => this.imageEditHandler?.(request),\n markdownRenderer: this.markdownRenderer,\n markdownExtensions: this.markdownExtensions,\n entryRenderers: this.composedEntryRenderers(),\n frontMatter: this.frontMatter,\n });\n this.renderingKey = renderingConfigKey(this.markdownExtensions, this.composedEntryRenderers(), this.frontMatter);\n }\n\n private composedEntryRenderers(): readonly MdzipEntryRenderer[] {\n const templates = this.entryTemplates\n ? this.entryTemplates.map((directive, index) => directive.toEntryRenderer(index))\n : [];\n return [...this.entryRenderers, ...templates];\n }\n\n // Applies rendering input changes in place — never a view rebuild. Arrays\n // re-apply only when their name/id key changes, so template expressions\n // that produce new array identities each cycle are safe.\n private applyRenderingOptions(rendererChanged: boolean): void {\n const composed = this.composedEntryRenderers();\n const key = renderingConfigKey(this.markdownExtensions, composed, this.frontMatter);\n if (!rendererChanged && key === this.renderingKey) {\n return;\n }\n this.renderingKey = key;\n this.view?.setRenderingOptions({\n markdownRenderer: this.markdownRenderer ?? null,\n markdownExtensions: this.markdownExtensions,\n entryRenderers: composed,\n frontMatter: this.frontMatter,\n });\n }\n}\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,CAAC,OAAO,KAAK,IAAI,CAAC;AACzB,kBAAE,IAAI,CAAC,uBAAuB,CAAC,OAAO;kBACpC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;AAC9C,YAAA,KAAK,EAAE,CAAC,SAAS,EAAE,OAAO,KAAI;AAC5B,gBAAA,MAAM,eAAe,GAAsC;AACzD,oBAAA,SAAS,E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;sBACxB;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA,SAAS;uBAAC,MAAM;;;ACxCnB;;AAEG;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { AfterContentInit, AfterViewInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges, TemplateRef } from '@angular/core';
3
- import { MdzWorkspace, MdzipWorkspaceMode, MdzipSourceFormat, MdzipControlPreset, MdzipControlPolicy, MdzipToolbarDensity, MdzipContentDensity, MdzipImageHydrationAnimation, MdzipImageInsertMode, MdzipImageInsertHandler, MdzipImageEditHandler, MdzipWorkspaceLayout, MdzipColorScheme, MdzipNavigationMode, MdzipConversionAction, MdzipConversionContext, MdzipPackFilesRequest, MdzipPackFilesContext, MdzipMarkdownRenderer, MdzipMarkdownRenderExtension, MdzipEntryRenderer, MdzipFrontMatterOptions, MdzipWorkspaceChange, MdzipWorkspaceSave, MdzipDocumentChangeEvent, MdzipWorkspaceSnapshot, MdzipEditorCommand, MdzipEditorSnapshot, MdzipRemoveAssetOptions, MdzipPackFilesInput, MdzipPackFilesResult, MdzWorkspaceAsset, MdzipEntryRenderContext } from '@mdzip/editor';
3
+ import { MdzWorkspace, MdzipWorkspaceMode, MdzipSourceFormat, MdzipControlPreset, MdzipControlPolicy, MdzipToolbarDensity, MdzipContentDensity, MdzipImageHydrationAnimation, MdzipImageInsertMode, MdzipImageInsertHandler, MdzipImageEditHandler, MdzipWorkspaceLayout, MdzipColorScheme, MdzipNavigationMode, MdzipConversionAction, MdzipConversionContext, MdzipPackFilesRequest, MdzipPackFilesContext, MdzipMarkdownRenderer, MdzipMarkdownRenderExtension, MdzipEntryRenderer, MdzipFrontMatterOptions, MdzipExternalLinkPolicy, MdzipWorkspaceChange, MdzipWorkspaceSave, MdzipDocumentChangeEvent, MdzipWorkspaceSnapshot, MdzipLinkActivatedEvent, MdzipEditorCommand, MdzipEditorSnapshot, 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 {
@@ -65,6 +65,12 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
65
65
  * — object literals produced fresh each change-detection cycle are safe.
66
66
  */
67
67
  frontMatter: MdzipFrontMatterOptions;
68
+ /**
69
+ * Rendering policy for external links in the preview, e.g.
70
+ * `{ target: '_blank' }` (adds `rel="noopener noreferrer"` by default).
71
+ * Changes re-apply to the mounted preview without a re-render.
72
+ */
73
+ externalLinks?: MdzipExternalLinkPolicy;
68
74
  readonly changed: EventEmitter<MdzipWorkspaceChange>;
69
75
  readonly saved: EventEmitter<MdzipWorkspaceSave>;
70
76
  readonly workspaceChanged: EventEmitter<MdzipDocumentChangeEvent>;
@@ -80,6 +86,11 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
80
86
  readonly previewRendered: EventEmitter<MdzipWorkspaceSnapshot>;
81
87
  /** Emits once the mounted preview's images have finished loading. */
82
88
  readonly assetsHydrated: EventEmitter<MdzipWorkspaceSnapshot>;
89
+ /**
90
+ * Emits for every click on a preview link, before the view's own handling.
91
+ * Call `event.preventDefault()` in the handler to take over navigation.
92
+ */
93
+ readonly linkActivated: EventEmitter<MdzipLinkActivatedEvent>;
83
94
  readonly failed: EventEmitter<unknown>;
84
95
  private readonly hostRef;
85
96
  /**
@@ -105,6 +116,9 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
105
116
  serialize(): Promise<Blob | null>;
106
117
  getCurrentSnapshot(): Promise<MdzipEditorSnapshot | null>;
107
118
  whenRendered(): Promise<void>;
119
+ /** See `MdzipWorkspaceView.scrollToAnchor` — waits for the preview to mount. */
120
+ scrollToAnchor(anchor: string): Promise<boolean>;
121
+ getAvailableAnchors(): string[];
108
122
  markPersisted(): void;
109
123
  addAsset(archivePath: string, fileBytes: Uint8Array): Promise<void>;
110
124
  replaceAsset(archivePath: string, fileBytes: Uint8Array): Promise<boolean>;
@@ -123,7 +137,7 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
123
137
  private composedEntryRenderers;
124
138
  private applyRenderingOptions;
125
139
  static ɵfac: i0.ɵɵFactoryDeclaration<MdzipWorkspaceComponent, never>;
126
- static ɵcmp: i0.ɵɵComponentDeclaration<MdzipWorkspaceComponent, "mdzip-workspace", never, { "bytes": { "alias": "bytes"; "required": false; }; "workspace": { "alias": "workspace"; "required": false; }; "fileName": { "alias": "fileName"; "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; }; "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; }; }, { "changed": "changed"; "saved": "saved"; "workspaceChanged": "workspaceChanged"; "documentChanged": "documentChanged"; "assetChanged": "assetChanged"; "manifestChanged": "manifestChanged"; "snapshotChanged": "snapshotChanged"; "selectionChanged": "selectionChanged"; "dirtyChanged": "dirtyChanged"; "validationChanged": "validationChanged"; "colorSchemeChanged": "colorSchemeChanged"; "previewRendered": "previewRendered"; "assetsHydrated": "assetsHydrated"; "failed": "failed"; }, ["entryTemplates"], never, true, never>;
140
+ static ɵcmp: i0.ɵɵComponentDeclaration<MdzipWorkspaceComponent, "mdzip-workspace", never, { "bytes": { "alias": "bytes"; "required": false; }; "workspace": { "alias": "workspace"; "required": false; }; "fileName": { "alias": "fileName"; "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; }; "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"; "previewRendered": "previewRendered"; "assetsHydrated": "assetsHydrated"; "linkActivated": "linkActivated"; "failed": "failed"; }, ["entryTemplates"], never, true, never>;
127
141
  }
128
142
 
129
143
  /** Template context available via `let-context` (also the `$implicit` value). */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sources":["../src/workspace.component.ts","../src/entry-renderer.directive.ts","../src/diff.component.ts"],"mappings":";;;;;AAwEA,cAAA,uBAOa,4BAAmC,EAAA,wBAAiC,EAAA,SAAW;AACjF,WAAO,UAAU;AACjB,eAAW,YAAY;AACvB;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,gBAAgB;AAC9C;;;;;AAKG;;oBAEsB,mBAAmB;AACnC;AACT;;;;AAIG;AACM,qCACC,qBAAqB,WACpB,sBAAsB,eAClB,OAAO;AACtB;;;;AAIG;AACM,gCACE,qBAAqB,WACrB,qBAAqB,eACjB,OAAO;AACtB;;;AAGG;uBACyB,qBAAqB;;AAExC,iCAA6B,4BAA4B;;AAEzD,6BAAyB,kBAAkB;AACpD;;;;;;AAMG;iBACmB,uBAAuB;sBACnB,YAAA,CAAA,oBAAA;oBACF,YAAA,CAAA,kBAAA;+BACW,YAAA,CAAA,wBAAA;8BACD,YAAA,CAAA,wBAAA;2BACH,YAAA,CAAA,wBAAA;8BACG,YAAA,CAAA,wBAAA;8BACA,YAAA,CAAA,sBAAA;+BACC,YAAA,CAAA,sBAAA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;AAI/B,0BAAsB,OAAO;AAI7B,sBAAkB,OAAO;AAIzB;AAIA;AAIA,wCAAoC,sBAAsB;;AAU1D;yCAjEW,kBAAkB;2CAAlB,kBAAkB;AA8E9B;;;;","names":[]}
1
+ {"version":3,"file":"index.d.ts","sources":["../src/workspace.component.ts","../src/entry-renderer.directive.ts","../src/diff.component.ts"],"mappings":";;;;;AA0EA,cAAA,uBAOa,4BAAmC,EAAA,wBAAiC,EAAA,SAAW;AACjF,WAAO,UAAU;AACjB,eAAW,YAAY;AACvB;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,gBAAgB;AAC9C;;;;;AAKG;;oBAEsB,mBAAmB;AACnC;AACT;;;;AAIG;AACM,qCACC,qBAAqB,WACpB,sBAAsB,eAClB,OAAO;AACtB;;;;AAIG;AACM,gCACE,qBAAqB,WACrB,qBAAqB,eACjB,OAAO;AACtB;;;AAGG;uBACyB,qBAAqB;;AAExC,iCAA6B,4BAA4B;;AAEzD,6BAAyB,kBAAkB;AACpD;;;;;;AAMG;iBACmB,uBAAuB;AAC7C;;;;AAIG;oBACsB,uBAAuB;sBACtB,YAAA,CAAA,oBAAA;oBACF,YAAA,CAAA,kBAAA;+BACW,YAAA,CAAA,wBAAA;8BACD,YAAA,CAAA,wBAAA;2BACH,YAAA,CAAA,wBAAA;8BACG,YAAA,CAAA,wBAAA;8BACA,YAAA,CAAA,sBAAA;+BACC,YAAA,CAAA,sBAAA;2BACJ,YAAA,CAAA,sBAAA;gCACK,YAAA,CAAA,sBAAA;iCACC,YAAA,CAAA,gBAAA;;8BAEH,YAAA,CAAA,sBAAA;;6BAED,YAAA,CAAA,sBAAA;AACjC;;;AAGG;4BAC6B,YAAA,CAAA,uBAAA;q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