@mdzip/editor-ng 2.4.2 → 2.5.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
@@ -1,7 +1,4 @@
1
- [![MDZip logo][mdzip-logo]][mdzip-url]
2
-
3
- [mdzip-logo]: https://raw.githubusercontent.com/mdzip-project/mdzip-editor/main/resources/mdzip-mark.svg
4
- [mdzip-url]: https://mdzip.org
1
+ <a href="https://mdzip.org"><img src="https://mdzip.org/assets/images/mdzip-mark-square.svg" alt="MDZip logo" width="64" height="64"></a>
5
2
 
6
3
  # @mdzip/editor-ng
7
4
 
@@ -111,6 +108,11 @@ showUnchanged? }`) to opt any of them out.
111
108
  | `entryRenderers` | `readonly MdzipEntryRenderer[]` | `[]` | Entry renderers claiming the content area for matching entries, diffed by `id` — new array identities with the same ids are safe |
112
109
  | `frontMatter` | `MdzipFrontMatterOptions` | `{}` | Front matter panel config (`enabled`, `display`, `collapsible`, `label`) — always registered, diffed by deep equality; new object identities with equal contents are safe |
113
110
  | `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 |
111
+ | `onExtractFiles` | `(request: MdzipExtractRequest) => void \| Promise<void>` | — | An input function, like `onConversionRequested`. Writes files taken out of the archive (the contents pane's Extract…) for hosts that can write to disk; the menu then says **Extract…** instead of offering browser downloads. The request has `files: [{ path, bytes }]` and `selection`. Read when the view is created |
112
+ | `outline` | `boolean \| MdzipOutlineViewOptions` | `false` | The outline panel: `true`, or `{ visible, position, width, levels, collapse, label }`. `visible` and `position` (input changes) apply live; the rest are read when the view is created |
113
+ | `showWhitespace` | `boolean` | `false` | Shows spaces and tabs in the source editor. Applies live |
114
+ | `manifestView` | `'form' \| 'json'` | `'form'` | How `manifest.json` opens. Read when the view is created |
115
+ | `jsonStatus` | `boolean` | `true` | The status line under the editor for `.json` files. Read when the view is created |
114
116
 
115
117
  `controls`, density, `imageHydrationAnimation`, and rendering input changes apply in
116
118
  place — they never recreate the workspace view. Line-number visibility changes
@@ -160,6 +162,10 @@ change.
160
162
  | `assetsHydrated` | `MdzipWorkspaceSnapshot` | Emitted once the mounted preview's images have loaded |
161
163
  | `linkActivated` | `MdzipLinkActivatedEvent` | Emitted for every preview link click before built-in handling; call `event.preventDefault()` to take over |
162
164
  | `failed` | `unknown` | Emitted on unrecoverable errors |
165
+ | `outlineVisibilityChanged` | `boolean` | Emitted when the reader shows or hides the outline from the toolbar |
166
+ | `outlineWidthChanged` | `number` | Emitted with the outline panel's width (pixels) when the reader finishes dragging its edge |
167
+ | `whitespaceVisibilityChanged` | `boolean` | Emitted when the reader shows or hides whitespace from the toolbar |
168
+ | `jsonValidityChanged` | `MdzipJsonValidityChange` | Emitted (debounced while typing) with the open `.json` file's validity; `null`s for other files |
163
169
 
164
170
  ## Conversion hook
165
171
 
@@ -215,6 +221,8 @@ All imperative methods are public instance methods on `MdzipWorkspaceComponent`,
215
221
  so any reference to the component instance works. No view query is required: a
216
222
  template reference variable can hand the instance directly to an event handler.
217
223
 
224
+ Also: `setOutlineVisible(visible)` and `setOutlinePosition('left' | 'right')` move the outline panel, and `extractFiles(paths, { includeFolders })` returns the archive's files as `{ path, bytes }`.
225
+
218
226
  ```ts
219
227
  @Component({
220
228
  imports: [MdzipWorkspaceComponent],
package/dist/README.md CHANGED
@@ -1,259 +1,267 @@
1
- [![MDZip logo][mdzip-logo]][mdzip-url]
2
-
3
- [mdzip-logo]: https://raw.githubusercontent.com/mdzip-project/mdzip-editor/main/resources/mdzip-mark.svg
4
- [mdzip-url]: https://mdzip.org
5
-
6
- # @mdzip/editor-ng
7
-
8
- [![npm](https://img.shields.io/npm/v/@mdzip/editor-ng?logo=npm)](https://www.npmjs.com/package/@mdzip/editor-ng)
9
- [![license](https://img.shields.io/npm/l/@mdzip/editor-ng)](https://github.com/mdzip-project/mdzip-editor/blob/main/LICENSE)
10
-
11
- Angular component wrapper for the MDZip workspace editor.
12
-
13
- `@mdzip/editor-ng` provides a standalone `MdzipWorkspaceComponent` that embeds the full MDZip workspace UI — document preview, editor, package navigator, and asset manager — as a native Angular component.
14
-
15
- ## Install
16
-
17
- ```sh
18
- npm install @mdzip/editor @mdzip/editor-ng
19
- ```
20
-
21
- Peer dependencies: `@angular/common` and `@angular/core` >=20.
22
-
23
- ## Basic Usage
24
-
25
- ```ts
26
- import { MdzipWorkspaceComponent } from '@mdzip/editor-ng';
27
-
28
- @Component({
29
- imports: [MdzipWorkspaceComponent],
30
- template: `
31
- <mdzip-workspace
32
- [bytes]="fileBytes"
33
- fileName="document.mdz"
34
- mode="read-only"
35
- controls="viewer"
36
- (failed)="onError($event)"
37
- />
38
- `,
39
- styles: [':host { display: block; height: 600px; }']
40
- })
41
- export class AppComponent {
42
- fileBytes: Uint8Array | null = null;
43
- }
44
- ```
45
-
46
- The host element must have an explicit height. The component expands to fill it.
47
-
48
- ## Archive Diff
49
-
50
- ```ts
51
- import { MdzipDiffComponent } from '@mdzip/editor-ng';
52
-
53
- @Component({
54
- imports: [MdzipDiffComponent],
55
- template: `
56
- <mdzip-diff
57
- [before]="{ bytes: baseBytes, label: 'Git base' }"
58
- [after]="{ bytes: workingBytes, label: 'Working tree' }"
59
- [toolbarActions]="diffActions"
60
- initialPath="index.md"
61
- />
62
- `,
63
- styles: [':host { display:block; height:600px; }']
64
- })
65
- export class DiffComponent {}
66
- ```
67
-
68
- `MdzipDiffComponent` is read-only. It emits `selectionChanged` and `failed`,
69
- and exposes `openPath`, `openPreviousChange`, `openNextChange`,
70
- `setShowUnchanged`, `setNavigationVisible`, and `setToolbarActions`. The
71
- built-in toolbar adds Previous/Next change buttons and a Show-unchanged
72
- toggle; bind a `controls` input (`{ navigation?, changeTraversal?,
73
- showUnchanged? }`) to opt any of them out.
74
-
75
- ## Editor Mode
76
-
77
- ```ts
78
- <mdzip-workspace
79
- [bytes]="fileBytes"
80
- fileName="document.mdz"
81
- mode="editable"
82
- controls="standalone-editor"
83
- (saved)="onSaved($event)"
84
- (changed)="onChanged($event)"
85
- />
86
- ```
87
-
88
- ## Inputs
89
-
90
- | Input | Type | Default | Description |
91
- |-------|------|---------|-------------|
92
- | `bytes` | `Uint8Array \| null` | `null` | Raw archive bytes to open |
93
- | `workspace` | `MdzWorkspace \| null` | `null` | Pre-built workspace object |
94
- | `fileName` | `string` | `'document.mdz'` | Filename used for format detection and Save dialogs |
95
- | `mode` | `MdzipWorkspaceMode` | `'read-only'` | `'read-only'` or `'editable'` |
96
- | `sourceFormat` | `MdzipSourceFormat` | — | Override format detection: `'mdz'` or `'markdown'` |
97
- | `controls` | `MdzipControlPreset \| MdzipControlPolicy` | `'viewer'` | `'preview'`, `'viewer'`, `'standalone-editor'`, `'hosted-editor'`, or a policy object |
98
- | `toolbarDensity` | `'comfortable' \| 'compact' \| 'dense'` | `'comfortable'` | Semantic sizing preset for built-in toolbar controls |
99
- | `contentDensity` | `'comfortable' \| 'compact'` | `'comfortable'` | Semantic padding preset for editor and preview content |
100
- | `imageHydrationAnimation` | `'auto' \| 'initial' \| 'off'` | `'auto'` | Control preview image reveal animation: every render, first render per document path, or never |
101
- | `initialLayout` | `MdzipWorkspaceLayout` | — | Starting layout: `'preview'`, `'editor'`, `'split'` |
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 |
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 |
105
- | `navigationMode` | `MdzipNavigationMode` | `'editor'` | Package navigation mode |
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". Also shown as buttons on the card that stands in for a `.drawio` image. Read when the view is created |
109
- | `markdownRenderer` | `MdzipMarkdownRenderer` | — | Custom markdown renderer (keep the reference stable) |
110
- | `markdownExtensions` | `readonly MdzipMarkdownRenderExtension[]` | `[]` | Markdown pipeline extensions, diffed by `name` — new array identities with the same names are safe |
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 |
112
- | `frontMatter` | `MdzipFrontMatterOptions` | `{}` | Front matter panel config (`enabled`, `display`, `collapsible`, `label`) — always registered, diffed by deep equality; new object identities with equal contents are safe |
113
- | `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 |
114
-
115
- `controls`, density, `imageHydrationAnimation`, and rendering input changes apply in
116
- place — they never recreate the workspace view. Line-number visibility changes
117
- preserve the current CodeMirror document and selection. See the `@mdzip/editor`
118
- Rendering Extensibility docs for the contracts and lifecycle rules.
119
-
120
- ### Native entry rendering (template directives)
121
-
122
- ```html
123
- <mdzip-workspace [bytes]="bytes" mode="editable">
124
- <ng-template mdzipEntryRenderer="manifest.json" let-context>
125
- <app-internals
126
- [manifest]="context.manifest"
127
- [editable]="context.mode === 'editable'"
128
- (manifestChange)="context.updateManifest($event)"
129
- />
130
- </ng-template>
131
-
132
- <ng-template [mdzipEntryRendererMatch]="isDrawioEntry" let-context>
133
- <app-drawio-viewer [entry]="context" />
134
- </ng-template>
135
- </mdzip-workspace>
136
- ```
137
-
138
- Import `MdzipEntryRendererDirective` alongside the component.
139
- `mdzipEntryRenderer` matches exact archive paths (string or array,
140
- case-insensitive); `[mdzipEntryRendererMatch]` takes a predicate. Optional
141
- `mdzipEntryRendererId` / `mdzipEntryRendererPriority` inputs control diffing
142
- and ordering. Embedded views are created in the component's view container —
143
- change detection and DI work normally — and are destroyed on selection
144
- change.
145
-
146
- ## Outputs
147
-
148
- | Output | Payload | Description |
149
- |--------|---------|-------------|
150
- | `changed` | `MdzipWorkspaceChange` | Emitted when archive bytes change |
151
- | `saved` | `MdzipWorkspaceSave` | Emitted on Save |
152
- | `snapshotChanged` | `MdzipWorkspaceSnapshot` | Emitted on any state change |
153
- | `selectionChanged` | `MdzipWorkspaceSnapshot` | Emitted when the editor selection changes |
154
- | `dirtyChanged` | `MdzipWorkspaceSnapshot` | Emitted when the dirty flag changes |
155
- | `validationChanged` | `MdzipWorkspaceSnapshot` | Emitted when validation state changes |
156
- | `colorSchemeChanged` | `MdzipColorScheme` | Emitted when the color scheme changes |
157
- | `colorSchemePreferenceChanged` | `MdzipColorSchemePreference` | Emitted when the user picks Light, Dark or System in the toolbar menu |
158
- | `previewWidthChanged` | `MdzipPreviewWidthChoice` | Emitted when the user picks a width in the toolbar's page-width menu |
159
- | `previewRendered` | `MdzipWorkspaceSnapshot` | Emitted when the preview HTML is mounted |
160
- | `assetsHydrated` | `MdzipWorkspaceSnapshot` | Emitted once the mounted preview's images have loaded |
161
- | `linkActivated` | `MdzipLinkActivatedEvent` | Emitted for every preview link click before built-in handling; call `event.preventDefault()` to take over |
162
- | `failed` | `unknown` | Emitted on unrecoverable errors |
163
-
164
- ## Conversion hook
165
-
166
- `onConversionRequested` is an **input function** (not an output, because it must return a
167
- value): bind `[onConversionRequested]="handler"` where `handler` is
168
- `(action: MdzipConversionAction) => boolean | Promise<boolean>`. It fires when the user
169
- triggers the markdown→MDZ conversion flow (nav button, Insert Image, or image paste on a
170
- plain `.md`). Return/resolve `true` to take over and suppress the built-in conversion dialog.
171
-
172
- `onPackRequested` is the same kind of input function for the folder→.mdz packing
173
- decision surfaced by the exposed `packFilesAsWorkspace(files, options)` method — fires
174
- only when the file list contains more than one Markdown file, with the same
175
- return contract as `onConversionRequested`.
176
-
177
- ## Image insertion
178
-
179
- Use `[imageInsertMode]="'markdown' | 'ask' | 'html'"` for the built-in image
180
- markup flow. Bind `[imageInsertHandler]="handler"` for host-owned image UI; the
181
- handler can return Markdown or HTML sizing/alignment settings, return `null` to
182
- cancel, or return `undefined` to fall back to `imageInsertMode`.
183
-
184
- Bind `[imageEditHandler]="handler"` to let users edit an *existing* image by
185
- clicking it. Fully opt-in — with no handler bound, clicking an image does
186
- nothing and no edit affordance appears; there is no built-in fallback dialog.
187
-
188
- ## File management (nav pane)
189
-
190
- With `controls="standalone-editor"` or `"hosted-editor"` (or `fileActions: true` in a custom
191
- policy), the navigation pane offers a right-click context menu: new `.md` file, new folder,
192
- rename/move, duplicate, replace, download, copy markdown link, set entry point, set cover
193
- image, and delete. Files can also be dragged between folders, and OS files can be dropped
194
- onto the pane. Copy and Download remain available in read-only mode. The same operations are
195
- exposed as component methods: `removeFile`, `renameFile`, `setEntryPoint`, and `setCoverImage`.
196
- `whenRendered()` resolves once the current preview (including its images) is mounted — useful
197
- for revealing or animating read-only preview content.
198
-
199
- ## Links and anchors
200
-
201
- The `linkActivated` output fires for every preview link click, before the view's own handling, with the
202
- parsed link (`kind`: `'anchor' | 'document' | 'relative' | 'external'`, plus `path`,
203
- `anchor`, `targetPath`, `sourcePath`, modifier keys). Call `event.preventDefault()` in the
204
- handler to route the link yourself; unprevented clicks keep the built-in behavior.
205
- The component also exposes `scrollToAnchor(anchor)` (waits for the preview to mount, resolves whether it
206
- scrolled; safe straight after load), `getAvailableAnchors()`, `openPath(path, { anchor })` (opens another
207
- file, optionally at an anchor) and `getCurrentPath()`. Changing only `fileName` (e.g. after Save As)
208
- renames in place without reopening; set `preserveSelectionOnReopen` to stay on the current file when
209
- the archive content changes. See the
210
- [`@mdzip/editor` README](https://www.npmjs.com/package/@mdzip/editor#links-and-anchors).
211
-
212
- ## Imperative API
213
-
214
- All imperative methods are public instance methods on `MdzipWorkspaceComponent`,
215
- so any reference to the component instance works. No view query is required: a
216
- template reference variable can hand the instance directly to an event handler.
217
-
218
- ```ts
219
- @Component({
220
- imports: [MdzipWorkspaceComponent],
221
- template: `
222
- <mdzip-workspace #workspace [bytes]="bytes" mode="editable" controls="hosted-editor" />
223
- <button (click)="save(workspace)">Save</button>
224
- `,
225
- })
226
- export class AppComponent {
227
- async save(workspace: MdzipWorkspaceComponent): Promise<void> {
228
- // Flush pending edits and persist
229
- const snapshot = await workspace.flush();
230
- if (snapshot) {
231
- await persist(snapshot.bytes);
232
- workspace.markPersisted();
233
- }
234
-
235
- // Execute editor commands
236
- await workspace.executeCommand('bold');
237
- }
238
- }
239
- ```
240
-
241
- To call methods outside an event handler, use a view query — the signal-based
242
- `viewChild` or the classic `@ViewChild` decorator:
243
-
244
- ```ts
245
- private readonly workspace = viewChild.required(MdzipWorkspaceComponent);
246
-
247
- async save(): Promise<void> {
248
- const snapshot = await this.workspace().flush();
249
- if (snapshot) {
250
- await persist(snapshot.bytes);
251
- this.workspace().markPersisted();
252
- }
253
- }
254
- ```
255
-
256
- Methods called before the view initializes are safe: they no-op and resolve to
257
- `false`/`null`/empty rather than throwing.
258
-
259
- See the [`@mdzip/editor`](https://www.npmjs.com/package/@mdzip/editor) package for the full API reference, theming guide, and framework-agnostic usage.
1
+ <a href="https://mdzip.org"><img src="https://mdzip.org/assets/images/mdzip-mark-square.svg" alt="MDZip logo" width="64" height="64"></a>
2
+
3
+ # @mdzip/editor-ng
4
+
5
+ [![npm](https://img.shields.io/npm/v/@mdzip/editor-ng?logo=npm)](https://www.npmjs.com/package/@mdzip/editor-ng)
6
+ [![license](https://img.shields.io/npm/l/@mdzip/editor-ng)](https://github.com/mdzip-project/mdzip-editor/blob/main/LICENSE)
7
+
8
+ Angular component wrapper for the MDZip workspace editor.
9
+
10
+ `@mdzip/editor-ng` provides a standalone `MdzipWorkspaceComponent` that embeds the full MDZip workspace UI — document preview, editor, package navigator, and asset manager — as a native Angular component.
11
+
12
+ ## Install
13
+
14
+ ```sh
15
+ npm install @mdzip/editor @mdzip/editor-ng
16
+ ```
17
+
18
+ Peer dependencies: `@angular/common` and `@angular/core` >=20.
19
+
20
+ ## Basic Usage
21
+
22
+ ```ts
23
+ import { MdzipWorkspaceComponent } from '@mdzip/editor-ng';
24
+
25
+ @Component({
26
+ imports: [MdzipWorkspaceComponent],
27
+ template: `
28
+ <mdzip-workspace
29
+ [bytes]="fileBytes"
30
+ fileName="document.mdz"
31
+ mode="read-only"
32
+ controls="viewer"
33
+ (failed)="onError($event)"
34
+ />
35
+ `,
36
+ styles: [':host { display: block; height: 600px; }']
37
+ })
38
+ export class AppComponent {
39
+ fileBytes: Uint8Array | null = null;
40
+ }
41
+ ```
42
+
43
+ The host element must have an explicit height. The component expands to fill it.
44
+
45
+ ## Archive Diff
46
+
47
+ ```ts
48
+ import { MdzipDiffComponent } from '@mdzip/editor-ng';
49
+
50
+ @Component({
51
+ imports: [MdzipDiffComponent],
52
+ template: `
53
+ <mdzip-diff
54
+ [before]="{ bytes: baseBytes, label: 'Git base' }"
55
+ [after]="{ bytes: workingBytes, label: 'Working tree' }"
56
+ [toolbarActions]="diffActions"
57
+ initialPath="index.md"
58
+ />
59
+ `,
60
+ styles: [':host { display:block; height:600px; }']
61
+ })
62
+ export class DiffComponent {}
63
+ ```
64
+
65
+ `MdzipDiffComponent` is read-only. It emits `selectionChanged` and `failed`,
66
+ and exposes `openPath`, `openPreviousChange`, `openNextChange`,
67
+ `setShowUnchanged`, `setNavigationVisible`, and `setToolbarActions`. The
68
+ built-in toolbar adds Previous/Next change buttons and a Show-unchanged
69
+ toggle; bind a `controls` input (`{ navigation?, changeTraversal?,
70
+ showUnchanged? }`) to opt any of them out.
71
+
72
+ ## Editor Mode
73
+
74
+ ```ts
75
+ <mdzip-workspace
76
+ [bytes]="fileBytes"
77
+ fileName="document.mdz"
78
+ mode="editable"
79
+ controls="standalone-editor"
80
+ (saved)="onSaved($event)"
81
+ (changed)="onChanged($event)"
82
+ />
83
+ ```
84
+
85
+ ## Inputs
86
+
87
+ | Input | Type | Default | Description |
88
+ |-------|------|---------|-------------|
89
+ | `bytes` | `Uint8Array \| null` | `null` | Raw archive bytes to open |
90
+ | `workspace` | `MdzWorkspace \| null` | `null` | Pre-built workspace object |
91
+ | `fileName` | `string` | `'document.mdz'` | Filename used for format detection and Save dialogs |
92
+ | `mode` | `MdzipWorkspaceMode` | `'read-only'` | `'read-only'` or `'editable'` |
93
+ | `sourceFormat` | `MdzipSourceFormat` | — | Override format detection: `'mdz'` or `'markdown'` |
94
+ | `controls` | `MdzipControlPreset \| MdzipControlPolicy` | `'viewer'` | `'preview'`, `'viewer'`, `'standalone-editor'`, `'hosted-editor'`, or a policy object |
95
+ | `toolbarDensity` | `'comfortable' \| 'compact' \| 'dense'` | `'comfortable'` | Semantic sizing preset for built-in toolbar controls |
96
+ | `contentDensity` | `'comfortable' \| 'compact'` | `'comfortable'` | Semantic padding preset for editor and preview content |
97
+ | `imageHydrationAnimation` | `'auto' \| 'initial' \| 'off'` | `'auto'` | Control preview image reveal animation: every render, first render per document path, or never |
98
+ | `initialLayout` | `MdzipWorkspaceLayout` | — | Starting layout: `'preview'`, `'editor'`, `'split'` |
99
+ | `initialColorScheme` | `MdzipColorSchemePreference` | `'system'` | `'light'`, `'dark'` or `'system'` (follows the OS setting live) |
100
+ | `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 |
101
+ | `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 |
102
+ | `navigationMode` | `MdzipNavigationMode` | `'editor'` | Package navigation mode |
103
+ | `navigationButtonActive` | `boolean` | `true` | Whether the navigation button is shown |
104
+ | `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 |
105
+ | `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". Also shown as buttons on the card that stands in for a `.drawio` image. Read when the view is created |
106
+ | `markdownRenderer` | `MdzipMarkdownRenderer` | — | Custom markdown renderer (keep the reference stable) |
107
+ | `markdownExtensions` | `readonly MdzipMarkdownRenderExtension[]` | `[]` | Markdown pipeline extensions, diffed by `name` — new array identities with the same names are safe |
108
+ | `entryRenderers` | `readonly MdzipEntryRenderer[]` | `[]` | Entry renderers claiming the content area for matching entries, diffed by `id` — new array identities with the same ids are safe |
109
+ | `frontMatter` | `MdzipFrontMatterOptions` | `{}` | Front matter panel config (`enabled`, `display`, `collapsible`, `label`) — always registered, diffed by deep equality; new object identities with equal contents are safe |
110
+ | `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 |
111
+ | `onExtractFiles` | `(request: MdzipExtractRequest) => void \| Promise<void>` | — | An input function, like `onConversionRequested`. Writes files taken out of the archive (the contents pane's Extract…) for hosts that can write to disk; the menu then says **Extract…** instead of offering browser downloads. The request has `files: [{ path, bytes }]` and `selection`. Read when the view is created |
112
+ | `outline` | `boolean \| MdzipOutlineViewOptions` | `false` | The outline panel: `true`, or `{ visible, position, width, levels, collapse, label }`. `visible` and `position` (input changes) apply live; the rest are read when the view is created |
113
+ | `showWhitespace` | `boolean` | `false` | Shows spaces and tabs in the source editor. Applies live |
114
+ | `manifestView` | `'form' \| 'json'` | `'form'` | How `manifest.json` opens. Read when the view is created |
115
+ | `jsonStatus` | `boolean` | `true` | The status line under the editor for `.json` files. Read when the view is created |
116
+
117
+ `controls`, density, `imageHydrationAnimation`, and rendering input changes apply in
118
+ place — they never recreate the workspace view. Line-number visibility changes
119
+ preserve the current CodeMirror document and selection. See the `@mdzip/editor`
120
+ Rendering Extensibility docs for the contracts and lifecycle rules.
121
+
122
+ ### Native entry rendering (template directives)
123
+
124
+ ```html
125
+ <mdzip-workspace [bytes]="bytes" mode="editable">
126
+ <ng-template mdzipEntryRenderer="manifest.json" let-context>
127
+ <app-internals
128
+ [manifest]="context.manifest"
129
+ [editable]="context.mode === 'editable'"
130
+ (manifestChange)="context.updateManifest($event)"
131
+ />
132
+ </ng-template>
133
+
134
+ <ng-template [mdzipEntryRendererMatch]="isDrawioEntry" let-context>
135
+ <app-drawio-viewer [entry]="context" />
136
+ </ng-template>
137
+ </mdzip-workspace>
138
+ ```
139
+
140
+ Import `MdzipEntryRendererDirective` alongside the component.
141
+ `mdzipEntryRenderer` matches exact archive paths (string or array,
142
+ case-insensitive); `[mdzipEntryRendererMatch]` takes a predicate. Optional
143
+ `mdzipEntryRendererId` / `mdzipEntryRendererPriority` inputs control diffing
144
+ and ordering. Embedded views are created in the component's view container —
145
+ change detection and DI work normally — and are destroyed on selection
146
+ change.
147
+
148
+ ## Outputs
149
+
150
+ | Output | Payload | Description |
151
+ |--------|---------|-------------|
152
+ | `changed` | `MdzipWorkspaceChange` | Emitted when archive bytes change |
153
+ | `saved` | `MdzipWorkspaceSave` | Emitted on Save |
154
+ | `snapshotChanged` | `MdzipWorkspaceSnapshot` | Emitted on any state change |
155
+ | `selectionChanged` | `MdzipWorkspaceSnapshot` | Emitted when the editor selection changes |
156
+ | `dirtyChanged` | `MdzipWorkspaceSnapshot` | Emitted when the dirty flag changes |
157
+ | `validationChanged` | `MdzipWorkspaceSnapshot` | Emitted when validation state changes |
158
+ | `colorSchemeChanged` | `MdzipColorScheme` | Emitted when the color scheme changes |
159
+ | `colorSchemePreferenceChanged` | `MdzipColorSchemePreference` | Emitted when the user picks Light, Dark or System in the toolbar menu |
160
+ | `previewWidthChanged` | `MdzipPreviewWidthChoice` | Emitted when the user picks a width in the toolbar's page-width menu |
161
+ | `previewRendered` | `MdzipWorkspaceSnapshot` | Emitted when the preview HTML is mounted |
162
+ | `assetsHydrated` | `MdzipWorkspaceSnapshot` | Emitted once the mounted preview's images have loaded |
163
+ | `linkActivated` | `MdzipLinkActivatedEvent` | Emitted for every preview link click before built-in handling; call `event.preventDefault()` to take over |
164
+ | `failed` | `unknown` | Emitted on unrecoverable errors |
165
+ | `outlineVisibilityChanged` | `boolean` | Emitted when the reader shows or hides the outline from the toolbar |
166
+ | `outlineWidthChanged` | `number` | Emitted with the outline panel's width (pixels) when the reader finishes dragging its edge |
167
+ | `whitespaceVisibilityChanged` | `boolean` | Emitted when the reader shows or hides whitespace from the toolbar |
168
+ | `jsonValidityChanged` | `MdzipJsonValidityChange` | Emitted (debounced while typing) with the open `.json` file's validity; `null`s for other files |
169
+
170
+ ## Conversion hook
171
+
172
+ `onConversionRequested` is an **input function** (not an output, because it must return a
173
+ value): bind `[onConversionRequested]="handler"` where `handler` is
174
+ `(action: MdzipConversionAction) => boolean | Promise<boolean>`. It fires when the user
175
+ triggers the markdown→MDZ conversion flow (nav button, Insert Image, or image paste on a
176
+ plain `.md`). Return/resolve `true` to take over and suppress the built-in conversion dialog.
177
+
178
+ `onPackRequested` is the same kind of input function for the folder→.mdz packing
179
+ decision surfaced by the exposed `packFilesAsWorkspace(files, options)` method — fires
180
+ only when the file list contains more than one Markdown file, with the same
181
+ return contract as `onConversionRequested`.
182
+
183
+ ## Image insertion
184
+
185
+ Use `[imageInsertMode]="'markdown' | 'ask' | 'html'"` for the built-in image
186
+ markup flow. Bind `[imageInsertHandler]="handler"` for host-owned image UI; the
187
+ handler can return Markdown or HTML sizing/alignment settings, return `null` to
188
+ cancel, or return `undefined` to fall back to `imageInsertMode`.
189
+
190
+ Bind `[imageEditHandler]="handler"` to let users edit an *existing* image by
191
+ clicking it. Fully opt-in — with no handler bound, clicking an image does
192
+ nothing and no edit affordance appears; there is no built-in fallback dialog.
193
+
194
+ ## File management (nav pane)
195
+
196
+ With `controls="standalone-editor"` or `"hosted-editor"` (or `fileActions: true` in a custom
197
+ policy), the navigation pane offers a right-click context menu: new `.md` file, new folder,
198
+ rename/move, duplicate, replace, download, copy markdown link, set entry point, set cover
199
+ image, and delete. Files can also be dragged between folders, and OS files can be dropped
200
+ onto the pane. Copy and Download remain available in read-only mode. The same operations are
201
+ exposed as component methods: `removeFile`, `renameFile`, `setEntryPoint`, and `setCoverImage`.
202
+ `whenRendered()` resolves once the current preview (including its images) is mounted — useful
203
+ for revealing or animating read-only preview content.
204
+
205
+ ## Links and anchors
206
+
207
+ The `linkActivated` output fires for every preview link click, before the view's own handling, with the
208
+ parsed link (`kind`: `'anchor' | 'document' | 'relative' | 'external'`, plus `path`,
209
+ `anchor`, `targetPath`, `sourcePath`, modifier keys). Call `event.preventDefault()` in the
210
+ handler to route the link yourself; unprevented clicks keep the built-in behavior.
211
+ The component also exposes `scrollToAnchor(anchor)` (waits for the preview to mount, resolves whether it
212
+ scrolled; safe straight after load), `getAvailableAnchors()`, `openPath(path, { anchor })` (opens another
213
+ file, optionally at an anchor) and `getCurrentPath()`. Changing only `fileName` (e.g. after Save As)
214
+ renames in place without reopening; set `preserveSelectionOnReopen` to stay on the current file when
215
+ the archive content changes. See the
216
+ [`@mdzip/editor` README](https://www.npmjs.com/package/@mdzip/editor#links-and-anchors).
217
+
218
+ ## Imperative API
219
+
220
+ All imperative methods are public instance methods on `MdzipWorkspaceComponent`,
221
+ so any reference to the component instance works. No view query is required: a
222
+ template reference variable can hand the instance directly to an event handler.
223
+
224
+ Also: `setOutlineVisible(visible)` and `setOutlinePosition('left' | 'right')` move the outline panel, and `extractFiles(paths, { includeFolders })` returns the archive's files as `{ path, bytes }`.
225
+
226
+ ```ts
227
+ @Component({
228
+ imports: [MdzipWorkspaceComponent],
229
+ template: `
230
+ <mdzip-workspace #workspace [bytes]="bytes" mode="editable" controls="hosted-editor" />
231
+ <button (click)="save(workspace)">Save</button>
232
+ `,
233
+ })
234
+ export class AppComponent {
235
+ async save(workspace: MdzipWorkspaceComponent): Promise<void> {
236
+ // Flush pending edits and persist
237
+ const snapshot = await workspace.flush();
238
+ if (snapshot) {
239
+ await persist(snapshot.bytes);
240
+ workspace.markPersisted();
241
+ }
242
+
243
+ // Execute editor commands
244
+ await workspace.executeCommand('bold');
245
+ }
246
+ }
247
+ ```
248
+
249
+ To call methods outside an event handler, use a view query — the signal-based
250
+ `viewChild` or the classic `@ViewChild` decorator:
251
+
252
+ ```ts
253
+ private readonly workspace = viewChild.required(MdzipWorkspaceComponent);
254
+
255
+ async save(): Promise<void> {
256
+ const snapshot = await this.workspace().flush();
257
+ if (snapshot) {
258
+ await persist(snapshot.bytes);
259
+ this.workspace().markPersisted();
260
+ }
261
+ }
262
+ ```
263
+
264
+ Methods called before the view initializes are safe: they no-op and resolve to
265
+ `false`/`null`/empty rather than throwing.
266
+
267
+ See the [`@mdzip/editor`](https://www.npmjs.com/package/@mdzip/editor) package for the full API reference, theming guide, and framework-agnostic usage.
@@ -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.4.2",
94
+ "version": "2.5.1",
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
  };
@@ -161,6 +161,14 @@ class MdzipWorkspaceComponent {
161
161
  */
162
162
  this.linkActivated = new EventEmitter();
163
163
  this.failed = new EventEmitter();
164
+ /** Emits when the reader shows or hides the outline from the toolbar. */
165
+ this.outlineVisibilityChanged = new EventEmitter();
166
+ /** Emits the outline panel's width (pixels) when the reader finishes dragging its edge. */
167
+ this.outlineWidthChanged = new EventEmitter();
168
+ /** Emits when the reader shows or hides whitespace from the toolbar. */
169
+ this.whitespaceVisibilityChanged = new EventEmitter();
170
+ /** Emits (debounced, while typing) the open `.json` file's validity. */
171
+ this.jsonValidityChanged = new EventEmitter();
164
172
  this.view = null;
165
173
  this.renderingKey = '';
166
174
  this.entryTemplatesSub = null;
@@ -213,6 +221,16 @@ class MdzipWorkspaceComponent {
213
221
  if (this.view && changes['externalLinks']) {
214
222
  this.view.setExternalLinks(this.externalLinks);
215
223
  }
224
+ if (this.view && changes['outline'] && !changes['outline'].firstChange) {
225
+ const outline = this.outline;
226
+ this.view.setOutlineVisible(typeof outline === 'object' ? outline.visible ?? false : outline ?? false);
227
+ if (typeof outline === 'object' && outline.position) {
228
+ this.view.setOutlinePosition(outline.position);
229
+ }
230
+ }
231
+ if (this.view && changes['showWhitespace'] && !changes['showWhitespace'].firstChange) {
232
+ this.view.setWhitespaceVisible(this.showWhitespace ?? false);
233
+ }
216
234
  if (this.view && (changes['bytes'] || changes['workspace'] || changes['mode']
217
235
  || changes['sourceFormat'] || changes['fileName'] || changes['worker'])) {
218
236
  const renameOnly = changes['fileName'] && !changes['fileName'].firstChange
@@ -240,6 +258,18 @@ class MdzipWorkspaceComponent {
240
258
  convertToMdz() {
241
259
  return this.view?.convertToMdz() ?? Promise.resolve(false);
242
260
  }
261
+ /** Shows or hides the outline panel (without emitting `outlineVisibilityChanged`). */
262
+ setOutlineVisible(visible) {
263
+ this.view?.setOutlineVisible(visible);
264
+ }
265
+ /** Puts the outline panel on the left or the right of the document. */
266
+ setOutlinePosition(position) {
267
+ this.view?.setOutlinePosition(position);
268
+ }
269
+ /** The archive's files as `{ path, bytes }`, by file or folder path (see the view's `extractFiles()`). */
270
+ extractFiles(paths, options) {
271
+ return this.view?.extractFiles(paths, options) ?? Promise.resolve([]);
272
+ }
243
273
  focus() {
244
274
  this.view?.focus();
245
275
  }
@@ -360,6 +390,17 @@ class MdzipWorkspaceComponent {
360
390
  onLinkActivated: (event) => this.linkActivated.emit(event),
361
391
  externalLinks: this.externalLinks,
362
392
  onFailed: (e) => this.failed.emit(e),
393
+ onExtractFiles: this.onExtractFiles
394
+ ? (request) => this.onExtractFiles(request)
395
+ : undefined,
396
+ outline: this.outline,
397
+ onOutlineVisibilityChanged: (visible) => this.outlineVisibilityChanged.emit(visible),
398
+ onOutlineWidthChanged: (width) => this.outlineWidthChanged.emit(width),
399
+ showWhitespace: this.showWhitespace,
400
+ onWhitespaceVisibilityChanged: (visible) => this.whitespaceVisibilityChanged.emit(visible),
401
+ manifestView: this.manifestView,
402
+ jsonStatus: this.jsonStatus,
403
+ onJsonValidityChanged: (validity, path) => this.jsonValidityChanged.emit({ validity, path }),
363
404
  onConversionRequested: this.onConversionRequested
364
405
  ? (action, context) => this.onConversionRequested(action, context)
365
406
  : undefined,
@@ -399,7 +440,7 @@ class MdzipWorkspaceComponent {
399
440
  });
400
441
  }
401
442
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: MdzipWorkspaceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
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 }); }
443
+ 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", onExtractFiles: "onExtractFiles", outline: "outline", showWhitespace: "showWhitespace", manifestView: "manifestView", jsonStatus: "jsonStatus" }, 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", outlineVisibilityChanged: "outlineVisibilityChanged", outlineWidthChanged: "outlineWidthChanged", whitespaceVisibilityChanged: "whitespaceVisibilityChanged", jsonValidityChanged: "jsonValidityChanged" }, 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 }); }
403
444
  }
404
445
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: MdzipWorkspaceComponent, decorators: [{
405
446
  type: Component,
@@ -464,6 +505,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImpo
464
505
  type: Input
465
506
  }], externalLinks: [{
466
507
  type: Input
508
+ }], onExtractFiles: [{
509
+ type: Input
510
+ }], outline: [{
511
+ type: Input
512
+ }], showWhitespace: [{
513
+ type: Input
514
+ }], manifestView: [{
515
+ type: Input
516
+ }], jsonStatus: [{
517
+ type: Input
467
518
  }], changed: [{
468
519
  type: Output
469
520
  }], saved: [{
@@ -498,6 +549,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImpo
498
549
  type: Output
499
550
  }], failed: [{
500
551
  type: Output
552
+ }], outlineVisibilityChanged: [{
553
+ type: Output
554
+ }], outlineWidthChanged: [{
555
+ type: Output
556
+ }], whitespaceVisibilityChanged: [{
557
+ type: Output
558
+ }], jsonValidityChanged: [{
559
+ type: Output
501
560
  }], hostRef: [{
502
561
  type: ViewChild,
503
562
  args: ['host']
@@ -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.4.2\",\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.fail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EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,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.5.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 {\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 MdzipExtractedFile,\r\n MdzipExtractRequest,\r\n MdzipJsonValidity,\r\n MdzipOutlinePosition,\r\n MdzipOutlineViewOptions,\r\n} from '@mdzip/editor';\r\n\r\n/** What `jsonValidityChanged` emits: the open `.json` file's validity, or `null`s when another kind of file is open. */\r\nexport interface MdzipJsonValidityChange {\r\n validity: MdzipJsonValidity | null;\r\n path: string | null;\r\n}\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 /**\r\n * Writes files taken out of the archive (the contents pane's Extract…), for\r\n * hosts that can write to disk themselves. With it, the menu says\r\n * **Extract…** instead of offering browser downloads. An input function,\r\n * like `onConversionRequested`, because the view waits for it. Read when the\r\n * view is created.\r\n */\r\n @Input() onExtractFiles?: (request: MdzipExtractRequest) => void | Promise<void>;\r\n /**\r\n * The outline panel: `true` to open it, or options (`visible`, `position`,\r\n * `width`, `levels`, `collapse`, `label`). `visible` and `position` apply\r\n * live; the others are read when the view is created.\r\n */\r\n @Input() outline?: boolean | MdzipOutlineViewOptions;\r\n /** Shows spaces and tabs in the source editor. Applies live. */\r\n @Input() showWhitespace?: boolean;\r\n /** How `manifest.json` opens: `'form'` (the default) or `'json'`. Read when the view is created. */\r\n @Input() manifestView?: 'form' | 'json';\r\n /** The status line under the editor for `.json` files. Defaults to `true`. Read when the view is created. */\r\n @Input() jsonStatus?: boolean;\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 /** Emits when the reader shows or hides the outline from the toolbar. */\r\n @Output() readonly outlineVisibilityChanged = new EventEmitter<boolean>();\r\n /** Emits the outline panel's width (pixels) when the reader finishes dragging its edge. */\r\n @Output() readonly outlineWidthChanged = new EventEmitter<number>();\r\n /** Emits when the reader shows or hides whitespace from the toolbar. */\r\n @Output() readonly whitespaceVisibilityChanged = new EventEmitter<boolean>();\r\n /** Emits (debounced, while typing) the open `.json` file's validity. */\r\n @Output() readonly jsonValidityChanged = new EventEmitter<MdzipJsonValidityChange>();\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['outline'] && !changes['outline'].firstChange) {\r\n const outline = this.outline;\r\n this.view.setOutlineVisible(typeof outline === 'object' ? outline.visible ?? false : outline ?? false);\r\n if (typeof outline === 'object' && outline.position) {\r\n this.view.setOutlinePosition(outline.position);\r\n }\r\n }\r\n if (this.view && changes['showWhitespace'] && !changes['showWhitespace'].firstChange) {\r\n this.view.setWhitespaceVisible(this.showWhitespace ?? false);\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 /** Shows or hides the outline panel (without emitting `outlineVisibilityChanged`). */\r\n setOutlineVisible(visible: boolean): void {\r\n this.view?.setOutlineVisible(visible);\r\n }\r\n\r\n /** Puts the outline panel on the left or the right of the document. */\r\n setOutlinePosition(position: MdzipOutlinePosition): void {\r\n this.view?.setOutlinePosition(position);\r\n }\r\n\r\n /** The archive's files as `{ path, bytes }`, by file or folder path (see the view's `extractFiles()`). */\r\n extractFiles(paths: readonly string[], options?: { includeFolders?: boolean }): Promise<MdzipExtractedFile[]> {\r\n return this.view?.extractFiles(paths, options) ?? Promise.resolve([]);\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 onExtractFiles: this.onExtractFiles\r\n ? (request) => this.onExtractFiles!(request)\r\n : undefined,\r\n outline: this.outline,\r\n onOutlineVisibilityChanged: (visible) => this.outlineVisibilityChanged.emit(visible),\r\n onOutlineWidthChanged: (width) => this.outlineWidthChanged.emit(width),\r\n showWhitespace: this.showWhitespace,\r\n onWhitespaceVisibilityChanged: (visible) => this.whitespaceVisibilityChanged.emit(visible),\r\n manifestView: this.manifestView,\r\n jsonStatus: this.jsonStatus,\r\n onJsonValidityChanged: (validity, path) => this.jsonValidityChanged.emit({ validity, path }),\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,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;A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oBAAA,CAAA,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;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,13 @@
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, 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';
3
+ import { MdzipJsonValidity, 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, MdzipExtractRequest, MdzipOutlineViewOptions, MdzipWorkspaceChange, MdzipWorkspaceSave, MdzipDocumentChangeEvent, MdzipWorkspaceSnapshot, MdzipColorScheme, MdzipPreviewWidthChoice, MdzipLinkActivatedEvent, MdzipEditorCommand, MdzipOutlinePosition, MdzipExtractedFile, 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
+ /** What `jsonValidityChanged` emits: the open `.json` file's validity, or `null`s when another kind of file is open. */
7
+ interface MdzipJsonValidityChange {
8
+ validity: MdzipJsonValidity | null;
9
+ path: string | null;
10
+ }
6
11
  declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit, OnChanges, OnDestroy {
7
12
  bytes: Uint8Array | null;
8
13
  workspace: MdzWorkspace | null;
@@ -88,6 +93,26 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
88
93
  * Changes re-apply to the mounted preview without a re-render.
89
94
  */
90
95
  externalLinks?: MdzipExternalLinkPolicy;
96
+ /**
97
+ * Writes files taken out of the archive (the contents pane's Extract…), for
98
+ * hosts that can write to disk themselves. With it, the menu says
99
+ * **Extract…** instead of offering browser downloads. An input function,
100
+ * like `onConversionRequested`, because the view waits for it. Read when the
101
+ * view is created.
102
+ */
103
+ onExtractFiles?: (request: MdzipExtractRequest) => void | Promise<void>;
104
+ /**
105
+ * The outline panel: `true` to open it, or options (`visible`, `position`,
106
+ * `width`, `levels`, `collapse`, `label`). `visible` and `position` apply
107
+ * live; the others are read when the view is created.
108
+ */
109
+ outline?: boolean | MdzipOutlineViewOptions;
110
+ /** Shows spaces and tabs in the source editor. Applies live. */
111
+ showWhitespace?: boolean;
112
+ /** How `manifest.json` opens: `'form'` (the default) or `'json'`. Read when the view is created. */
113
+ manifestView?: 'form' | 'json';
114
+ /** The status line under the editor for `.json` files. Defaults to `true`. Read when the view is created. */
115
+ jsonStatus?: boolean;
91
116
  readonly changed: EventEmitter<MdzipWorkspaceChange>;
92
117
  readonly saved: EventEmitter<MdzipWorkspaceSave>;
93
118
  readonly workspaceChanged: EventEmitter<MdzipDocumentChangeEvent>;
@@ -113,6 +138,14 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
113
138
  */
114
139
  readonly linkActivated: EventEmitter<MdzipLinkActivatedEvent>;
115
140
  readonly failed: EventEmitter<unknown>;
141
+ /** Emits when the reader shows or hides the outline from the toolbar. */
142
+ readonly outlineVisibilityChanged: EventEmitter<boolean>;
143
+ /** Emits the outline panel's width (pixels) when the reader finishes dragging its edge. */
144
+ readonly outlineWidthChanged: EventEmitter<number>;
145
+ /** Emits when the reader shows or hides whitespace from the toolbar. */
146
+ readonly whitespaceVisibilityChanged: EventEmitter<boolean>;
147
+ /** Emits (debounced, while typing) the open `.json` file's validity. */
148
+ readonly jsonValidityChanged: EventEmitter<MdzipJsonValidityChange>;
116
149
  private readonly hostRef;
117
150
  /**
118
151
  * `<ng-template mdzipEntryRenderer>` declarations projected into the
@@ -131,6 +164,14 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
131
164
  canExecuteCommand(command: MdzipEditorCommand): boolean;
132
165
  executeCommand(command: MdzipEditorCommand, file?: File): Promise<boolean>;
133
166
  convertToMdz(): Promise<boolean>;
167
+ /** Shows or hides the outline panel (without emitting `outlineVisibilityChanged`). */
168
+ setOutlineVisible(visible: boolean): void;
169
+ /** Puts the outline panel on the left or the right of the document. */
170
+ setOutlinePosition(position: MdzipOutlinePosition): void;
171
+ /** The archive's files as `{ path, bytes }`, by file or folder path (see the view's `extractFiles()`). */
172
+ extractFiles(paths: readonly string[], options?: {
173
+ includeFolders?: boolean;
174
+ }): Promise<MdzipExtractedFile[]>;
134
175
  focus(): void;
135
176
  setColorScheme(scheme: MdzipColorSchemePreference): void;
136
177
  flush(): Promise<MdzipEditorSnapshot | null>;
@@ -162,7 +203,7 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
162
203
  private composedEntryRenderers;
163
204
  private applyRenderingOptions;
164
205
  static ɵfac: i0.ɵɵFactoryDeclaration<MdzipWorkspaceComponent, 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>;
206
+ 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; }; "onExtractFiles": { "alias": "onExtractFiles"; "required": false; }; "outline": { "alias": "outline"; "required": false; }; "showWhitespace": { "alias": "showWhitespace"; "required": false; }; "manifestView": { "alias": "manifestView"; "required": false; }; "jsonStatus": { "alias": "jsonStatus"; "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"; "outlineVisibilityChanged": "outlineVisibilityChanged"; "outlineWidthChanged": "outlineWidthChanged"; "whitespaceVisibilityChanged": "whitespaceVisibilityChanged"; "jsonValidityChanged": "jsonValidityChanged"; }, ["entryTemplates"], never, true, never>;
166
207
  }
167
208
 
168
209
  /** Template context available via `let-context` (also the `$implicit` value). */
@@ -234,5 +275,5 @@ declare class MdzipDiffComponent implements AfterViewInit, OnChanges, OnDestroy
234
275
  }
235
276
 
236
277
  export { MdzipDiffComponent, MdzipEntryRendererDirective, MdzipWorkspaceComponent };
237
- export type { MdzipEntryRendererTemplateContext };
278
+ export type { MdzipEntryRendererTemplateContext, MdzipJsonValidityChange };
238
279
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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;;;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B,GAAG,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":[]}
1
+ {"version":3,"file":"index.d.ts","sources":["../src/workspace.component.ts","../src/entry-renderer.directive.ts","../src/diff.component.ts"],"mappings":";;;;;AAmEA;AACA,iCAAiB;AACf,cAAU,iBAAiB;AAC3B;AACD;AAoBD,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;yBACj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dzip/editor-ng",
3
- "version": "2.4.2",
4
- "description": "Angular wrapper for the MDZip workspace editor.",
5
- "license": "Apache-2.0",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/mdzip-project/mdzip-editor.git",
9
- "directory": "packages/editor-ng"
10
- },
11
- "homepage": "https://mdzip.org",
12
- "bugs": {
13
- "url": "https://github.com/mdzip-project/mdzip-editor/issues"
14
- },
15
- "type": "module",
16
- "module": "dist/fesm2022/mdzip-editor-ng.mjs",
17
- "types": "dist/index.d.ts",
18
- "exports": {
19
- "./package.json": {
20
- "default": "./package.json"
21
- },
22
- ".": {
23
- "types": "./dist/index.d.ts",
24
- "default": "./dist/fesm2022/mdzip-editor-ng.mjs"
25
- },
26
- "./mdz-archive.worker.js": "./dist/mdz-archive.worker.js"
27
- },
28
- "sideEffects": false,
29
- "peerDependencies": {
30
- "@angular/common": ">=20.0.0",
31
- "@angular/core": ">=20.0.0",
32
- "@mdzip/editor": "^2.4.2"
33
- },
34
- "dependencies": {
35
- "tslib": "^2.8.1"
36
- },
37
- "devDependencies": {
38
- "@angular/platform-browser": "20.3.24",
39
- "zone.js": "^0.15.0"
40
- },
41
- "scripts": {
42
- "generate:package-info": "node ../../scripts/generate-package-info.mjs",
43
- "prebuild": "npm run generate:package-info",
44
- "build": "ng build @mdzip/editor-ng",
45
- "postbuild": "node scripts/copy-worker-asset.mjs",
46
- "test": "vitest run"
47
- },
48
- "files": [
49
- "dist"
50
- ],
51
- "publishConfig": {
52
- "access": "public"
53
- }
54
- }
1
+ {
2
+ "name": "@mdzip/editor-ng",
3
+ "version": "2.5.1",
4
+ "description": "Angular wrapper for the MDZip workspace editor.",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/mdzip-project/mdzip-editor.git",
9
+ "directory": "packages/editor-ng"
10
+ },
11
+ "homepage": "https://mdzip.org",
12
+ "bugs": {
13
+ "url": "https://github.com/mdzip-project/mdzip-editor/issues"
14
+ },
15
+ "type": "module",
16
+ "module": "dist/fesm2022/mdzip-editor-ng.mjs",
17
+ "types": "dist/index.d.ts",
18
+ "exports": {
19
+ "./package.json": {
20
+ "default": "./package.json"
21
+ },
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "default": "./dist/fesm2022/mdzip-editor-ng.mjs"
25
+ },
26
+ "./mdz-archive.worker.js": "./dist/mdz-archive.worker.js"
27
+ },
28
+ "sideEffects": false,
29
+ "peerDependencies": {
30
+ "@angular/common": ">=20.0.0",
31
+ "@angular/core": ">=20.0.0",
32
+ "@mdzip/editor": "^2.5.0"
33
+ },
34
+ "dependencies": {
35
+ "tslib": "^2.8.1"
36
+ },
37
+ "devDependencies": {
38
+ "@angular/platform-browser": "20.3.24",
39
+ "zone.js": "^0.15.0"
40
+ },
41
+ "scripts": {
42
+ "generate:package-info": "node ../../scripts/generate-package-info.mjs",
43
+ "prebuild": "npm run generate:package-info",
44
+ "build": "ng build @mdzip/editor-ng",
45
+ "postbuild": "node scripts/copy-worker-asset.mjs",
46
+ "test": "vitest run"
47
+ },
48
+ "files": [
49
+ "dist"
50
+ ],
51
+ "publishConfig": {
52
+ "access": "public"
53
+ }
54
+ }