@mdzip/editor-ng 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,256 +1,272 @@
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
-
112
- `controls`, density, `imageHydrationAnimation`, and rendering input changes apply in
113
- place — they never recreate the workspace view. Line-number visibility changes
114
- preserve the current CodeMirror document and selection. See the `@mdzip/editor`
115
- Rendering Extensibility docs for the contracts and lifecycle rules.
116
-
117
- ### Native entry rendering (template directives)
118
-
119
- ```html
120
- <mdzip-workspace [bytes]="bytes" mode="editable">
121
- <ng-template mdzipEntryRenderer="manifest.json" let-context>
122
- <app-internals
123
- [manifest]="context.manifest"
124
- [editable]="context.mode === 'editable'"
125
- (manifestChange)="context.updateManifest($event)"
126
- />
127
- </ng-template>
128
-
129
- <ng-template [mdzipEntryRendererMatch]="isDrawioEntry" let-context>
130
- <app-drawio-viewer [entry]="context" />
131
- </ng-template>
132
- </mdzip-workspace>
133
- ```
134
-
135
- Import `MdzipEntryRendererDirective` alongside the component.
136
- `mdzipEntryRenderer` matches exact archive paths (string or array,
137
- case-insensitive); `[mdzipEntryRendererMatch]` takes a predicate. Optional
138
- `mdzipEntryRendererId` / `mdzipEntryRendererPriority` inputs control diffing
139
- and ordering. Embedded views are created in the component's view container —
140
- change detection and DI work normally — and are destroyed on selection
141
- change.
142
-
143
- ## Outputs
144
-
145
- | Output | Payload | Description |
146
- |--------|---------|-------------|
147
- | `changed` | `MdzipWorkspaceChange` | Emitted when archive bytes change |
148
- | `saved` | `MdzipWorkspaceSave` | Emitted on Save |
149
- | `snapshotChanged` | `MdzipWorkspaceSnapshot` | Emitted on any state change |
150
- | `selectionChanged` | `MdzipWorkspaceSnapshot` | Emitted when the editor selection changes |
151
- | `dirtyChanged` | `MdzipWorkspaceSnapshot` | Emitted when the dirty flag changes |
152
- | `validationChanged` | `MdzipWorkspaceSnapshot` | Emitted when validation state changes |
153
- | `colorSchemeChanged` | `MdzipColorScheme` | Emitted when the color scheme changes |
154
- | `colorSchemePreferenceChanged` | `MdzipColorSchemePreference` | Emitted when the user picks Light, Dark or System in the toolbar menu |
155
- | `previewWidthChanged` | `MdzipPreviewWidthChoice` | Emitted when the user picks a width in the toolbar's page-width menu |
156
- | `previewRendered` | `MdzipWorkspaceSnapshot` | Emitted when the preview HTML is mounted |
157
- | `assetsHydrated` | `MdzipWorkspaceSnapshot` | Emitted once the mounted preview's images have loaded |
158
- | `linkActivated` | `MdzipLinkActivatedEvent` | Emitted for every preview link click before built-in handling; call `event.preventDefault()` to take over |
159
- | `failed` | `unknown` | Emitted on unrecoverable errors |
160
-
161
- ## Conversion hook
162
-
163
- `onConversionRequested` is an **input function** (not an output, because it must return a
164
- value): bind `[onConversionRequested]="handler"` where `handler` is
165
- `(action: MdzipConversionAction) => boolean | Promise<boolean>`. It fires when the user
166
- triggers the markdown→MDZ conversion flow (nav button, Insert Image, or image paste on a
167
- plain `.md`). Return/resolve `true` to take over and suppress the built-in conversion dialog.
168
-
169
- `onPackRequested` is the same kind of input function for the folder→.mdz packing
170
- decision surfaced by the exposed `packFilesAsWorkspace(files, options)` method — fires
171
- only when the file list contains more than one Markdown file, with the same
172
- return contract as `onConversionRequested`.
173
-
174
- ## Image insertion
175
-
176
- Use `[imageInsertMode]="'markdown' | 'ask' | 'html'"` for the built-in image
177
- markup flow. Bind `[imageInsertHandler]="handler"` for host-owned image UI; the
178
- handler can return Markdown or HTML sizing/alignment settings, return `null` to
179
- cancel, or return `undefined` to fall back to `imageInsertMode`.
180
-
181
- Bind `[imageEditHandler]="handler"` to let users edit an *existing* image by
182
- clicking it. Fully opt-in — with no handler bound, clicking an image does
183
- nothing and no edit affordance appears; there is no built-in fallback dialog.
184
-
185
- ## File management (nav pane)
186
-
187
- With `controls="standalone-editor"` or `"hosted-editor"` (or `fileActions: true` in a custom
188
- policy), the navigation pane offers a right-click context menu: new `.md` file, new folder,
189
- rename/move, duplicate, replace, download, copy markdown link, set entry point, set cover
190
- image, and delete. Files can also be dragged between folders, and OS files can be dropped
191
- onto the pane. Copy and Download remain available in read-only mode. The same operations are
192
- exposed as component methods: `removeFile`, `renameFile`, `setEntryPoint`, and `setCoverImage`.
193
- `whenRendered()` resolves once the current preview (including its images) is mounted — useful
194
- for revealing or animating read-only preview content.
195
-
196
- ## Links and anchors
197
-
198
- The `linkActivated` output fires for every preview link click, before the view's own handling, with the
199
- parsed link (`kind`: `'anchor' | 'document' | 'relative' | 'external'`, plus `path`,
200
- `anchor`, `targetPath`, `sourcePath`, modifier keys). Call `event.preventDefault()` in the
201
- handler to route the link yourself; unprevented clicks keep the built-in behavior.
202
- The component also exposes `scrollToAnchor(anchor)` (waits for the preview to mount, resolves whether it
203
- scrolled; safe straight after load), `getAvailableAnchors()`, `openPath(path, { anchor })` (opens another
204
- file, optionally at an anchor) and `getCurrentPath()`. Changing only `fileName` (e.g. after Save As)
205
- renames in place without reopening; set `preserveSelectionOnReopen` to stay on the current file when
206
- the archive content changes. See the
207
- [`@mdzip/editor` README](https://www.npmjs.com/package/@mdzip/editor#links-and-anchors).
208
-
209
- ## Imperative API
210
-
211
- All imperative methods are public instance methods on `MdzipWorkspaceComponent`,
212
- so any reference to the component instance works. No view query is required: a
213
- template reference variable can hand the instance directly to an event handler.
214
-
215
- ```ts
216
- @Component({
217
- imports: [MdzipWorkspaceComponent],
218
- template: `
219
- <mdzip-workspace #workspace [bytes]="bytes" mode="editable" controls="hosted-editor" />
220
- <button (click)="save(workspace)">Save</button>
221
- `,
222
- })
223
- export class AppComponent {
224
- async save(workspace: MdzipWorkspaceComponent): Promise<void> {
225
- // Flush pending edits and persist
226
- const snapshot = await workspace.flush();
227
- if (snapshot) {
228
- await persist(snapshot.bytes);
229
- workspace.markPersisted();
230
- }
231
-
232
- // Execute editor commands
233
- await workspace.executeCommand('bold');
234
- }
235
- }
236
- ```
237
-
238
- To call methods outside an event handler, use a view query — the signal-based
239
- `viewChild` or the classic `@ViewChild` decorator:
240
-
241
- ```ts
242
- private readonly workspace = viewChild.required(MdzipWorkspaceComponent);
243
-
244
- async save(): Promise<void> {
245
- const snapshot = await this.workspace().flush();
246
- if (snapshot) {
247
- await persist(snapshot.bytes);
248
- this.workspace().markPersisted();
249
- }
250
- }
251
- ```
252
-
253
- Methods called before the view initializes are safe: they no-op and resolve to
254
- `false`/`null`/empty rather than throwing.
255
-
256
- 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
+ | `eagerImages` | `boolean` | `false` | Loads every image as soon as the preview mounts, not only those near the visible part; for a preview nobody scrolls, such as an off-screen copy for printing (use with `progressiveTextRendering: false`). Read when the view is created |
106
+ | `hostFileActions` | `readonly MdzipFileAction[]` | — | The host's own items in the file tree's right-click menu on files (`{ id, label, appliesTo?, primary?, description?, run }`; `label` and `description` may be functions of the file), e.g. "Open in Another Editor". Also shown as buttons on the card that stands in for a `.drawio` image, and on the card for a file the preview can't show (a `primary` one first). Read when the view is created |
107
+ | `fileNote` | `(file) => string \| null` | — | A line on the card for a file the preview can't show, e.g. "Open in Word: changes come back each time you save there." `refreshFileActions()` asks for it and the labels again. Read when the view is created |
108
+ | `fileCardHelp` | `MdzipFileCardHelp` | — | A link at the bottom of that card (`{ label, run }`), to the host's help. 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
+ | `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 |
115
+ | `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 |
116
+ | `showWhitespace` | `boolean` | `false` | Shows spaces and tabs in the source editor. Applies live |
117
+ | `manifestView` | `'form' \| 'json'` | `'form'` | How `manifest.json` opens. Read when the view is created |
118
+ | `jsonStatus` | `boolean` | `true` | The status line under the editor for `.json` files. Read when the view is created |
119
+
120
+ `controls`, density, `imageHydrationAnimation`, and rendering input changes apply in
121
+ place — they never recreate the workspace view. Line-number visibility changes
122
+ preserve the current CodeMirror document and selection. See the `@mdzip/editor`
123
+ Rendering Extensibility docs for the contracts and lifecycle rules.
124
+
125
+ ### Native entry rendering (template directives)
126
+
127
+ ```html
128
+ <mdzip-workspace [bytes]="bytes" mode="editable">
129
+ <ng-template mdzipEntryRenderer="manifest.json" let-context>
130
+ <app-internals
131
+ [manifest]="context.manifest"
132
+ [editable]="context.mode === 'editable'"
133
+ (manifestChange)="context.updateManifest($event)"
134
+ />
135
+ </ng-template>
136
+
137
+ <ng-template [mdzipEntryRendererMatch]="isDrawioEntry" let-context>
138
+ <app-drawio-viewer [entry]="context" />
139
+ </ng-template>
140
+ </mdzip-workspace>
141
+ ```
142
+
143
+ Import `MdzipEntryRendererDirective` alongside the component.
144
+ `mdzipEntryRenderer` matches exact archive paths (string or array,
145
+ case-insensitive); `[mdzipEntryRendererMatch]` takes a predicate. Optional
146
+ `mdzipEntryRendererId` / `mdzipEntryRendererPriority` inputs control diffing
147
+ and ordering. Embedded views are created in the component's view container —
148
+ change detection and DI work normally — and are destroyed on selection
149
+ change.
150
+
151
+ ## Outputs
152
+
153
+ | Output | Payload | Description |
154
+ |--------|---------|-------------|
155
+ | `changed` | `MdzipWorkspaceChange` | Emitted when archive bytes change |
156
+ | `saved` | `MdzipWorkspaceSave` | Emitted on Save |
157
+ | `snapshotChanged` | `MdzipWorkspaceSnapshot` | Emitted on any state change |
158
+ | `selectionChanged` | `MdzipWorkspaceSnapshot` | Emitted when the editor selection changes |
159
+ | `dirtyChanged` | `MdzipWorkspaceSnapshot` | Emitted when the dirty flag changes |
160
+ | `validationChanged` | `MdzipWorkspaceSnapshot` | Emitted when validation state changes |
161
+ | `colorSchemeChanged` | `MdzipColorScheme` | Emitted when the color scheme changes |
162
+ | `colorSchemePreferenceChanged` | `MdzipColorSchemePreference` | Emitted when the user picks Light, Dark or System in the toolbar menu |
163
+ | `previewWidthChanged` | `MdzipPreviewWidthChoice` | Emitted when the user picks a width in the toolbar's page-width menu |
164
+ | `previewRendered` | `MdzipWorkspaceSnapshot` | Emitted when the preview HTML is mounted |
165
+ | `assetsHydrated` | `MdzipWorkspaceSnapshot` | Emitted once the mounted preview's images have loaded |
166
+ | `assetsProgress` | `MdzipAssetsProgress` | `{ loaded, total }` as those images load, for a progress bar (not emitted when there are none) |
167
+ | `linkActivated` | `MdzipLinkActivatedEvent` | Emitted for every preview link click before built-in handling; call `event.preventDefault()` to take over |
168
+ | `failed` | `unknown` | Emitted on unrecoverable errors |
169
+ | `outlineVisibilityChanged` | `boolean` | Emitted when the reader shows or hides the outline from the toolbar |
170
+ | `outlinePositionChanged` | `'left' \| 'right'` | Emitted when the reader moves the outline to the other side from the toolbar |
171
+ | `outlineWidthChanged` | `number` | Emitted with the outline panel's width (pixels) when the reader finishes dragging its edge |
172
+ | `whitespaceVisibilityChanged` | `boolean` | Emitted when the reader shows or hides whitespace from the toolbar |
173
+ | `jsonValidityChanged` | `MdzipJsonValidityChange` | Emitted (debounced while typing) with the open `.json` file's validity; `null`s for other files |
174
+
175
+ ## Conversion hook
176
+
177
+ `onConversionRequested` is an **input function** (not an output, because it must return a
178
+ value): bind `[onConversionRequested]="handler"` where `handler` is
179
+ `(action: MdzipConversionAction) => boolean | Promise<boolean>`. It fires when the user
180
+ triggers the markdown→MDZ conversion flow (nav button, Insert Image, or image paste on a
181
+ plain `.md`). Return/resolve `true` to take over and suppress the built-in conversion dialog.
182
+
183
+ `onPackRequested` is the same kind of input function for the folder→.mdz packing
184
+ decision surfaced by the exposed `packFilesAsWorkspace(files, options)` method — fires
185
+ only when the file list contains more than one Markdown file, with the same
186
+ return contract as `onConversionRequested`.
187
+
188
+ ## Image insertion
189
+
190
+ Use `[imageInsertMode]="'markdown' | 'ask' | 'html'"` for the built-in image
191
+ markup flow. Bind `[imageInsertHandler]="handler"` for host-owned image UI; the
192
+ handler can return Markdown or HTML sizing/alignment settings, return `null` to
193
+ cancel, or return `undefined` to fall back to `imageInsertMode`.
194
+
195
+ Bind `[imageEditHandler]="handler"` to let users edit an *existing* image by
196
+ clicking it. Fully opt-in — with no handler bound, clicking an image does
197
+ nothing and no edit affordance appears; there is no built-in fallback dialog.
198
+
199
+ ## File management (nav pane)
200
+
201
+ With `controls="standalone-editor"` or `"hosted-editor"` (or `fileActions: true` in a custom
202
+ policy), the navigation pane offers a right-click context menu: new `.md` file, new folder,
203
+ rename/move, duplicate, replace, download, copy markdown link, set entry point, set cover
204
+ image, and delete. Files can also be dragged between folders, and OS files can be dropped
205
+ onto the pane. Copy and Download remain available in read-only mode. The same operations are
206
+ exposed as component methods: `removeFile`, `renameFile`, `setEntryPoint`, and `setCoverImage`.
207
+ `whenRendered()` resolves once the current preview (including its images) is mounted — useful
208
+ for revealing or animating read-only preview content.
209
+
210
+ ## Links and anchors
211
+
212
+ The `linkActivated` output fires for every preview link click, before the view's own handling, with the
213
+ parsed link (`kind`: `'anchor' | 'document' | 'relative' | 'external'`, plus `path`,
214
+ `anchor`, `targetPath`, `sourcePath`, modifier keys). Call `event.preventDefault()` in the
215
+ handler to route the link yourself; unprevented clicks keep the built-in behavior.
216
+ The component also exposes `scrollToAnchor(anchor)` (waits for the preview to mount, resolves whether it
217
+ scrolled; safe straight after load), `getAvailableAnchors()`, `openPath(path, { anchor })` (opens another
218
+ file, optionally at an anchor) and `getCurrentPath()`. Changing only `fileName` (e.g. after Save As)
219
+ renames in place without reopening; set `preserveSelectionOnReopen` to stay on the current file when
220
+ the archive content changes. See the
221
+ [`@mdzip/editor` README](https://www.npmjs.com/package/@mdzip/editor#links-and-anchors).
222
+
223
+ ## Imperative API
224
+
225
+ All imperative methods are public instance methods on `MdzipWorkspaceComponent`,
226
+ so any reference to the component instance works. No view query is required: a
227
+ template reference variable can hand the instance directly to an event handler.
228
+
229
+ Also: `setOutlineVisible(visible)` and `setOutlinePosition('left' | 'right')` move the outline panel, `setLayout('source' | 'split' | 'preview')` switches the layout, and `extractFiles(paths, { includeFolders })` returns the archive's files as `{ path, bytes }`.
230
+
231
+ ```ts
232
+ @Component({
233
+ imports: [MdzipWorkspaceComponent],
234
+ template: `
235
+ <mdzip-workspace #workspace [bytes]="bytes" mode="editable" controls="hosted-editor" />
236
+ <button (click)="save(workspace)">Save</button>
237
+ `,
238
+ })
239
+ export class AppComponent {
240
+ async save(workspace: MdzipWorkspaceComponent): Promise<void> {
241
+ // Flush pending edits and persist
242
+ const snapshot = await workspace.flush();
243
+ if (snapshot) {
244
+ await persist(snapshot.bytes);
245
+ workspace.markPersisted();
246
+ }
247
+
248
+ // Execute editor commands
249
+ await workspace.executeCommand('bold');
250
+ }
251
+ }
252
+ ```
253
+
254
+ To call methods outside an event handler, use a view query — the signal-based
255
+ `viewChild` or the classic `@ViewChild` decorator:
256
+
257
+ ```ts
258
+ private readonly workspace = viewChild.required(MdzipWorkspaceComponent);
259
+
260
+ async save(): Promise<void> {
261
+ const snapshot = await this.workspace().flush();
262
+ if (snapshot) {
263
+ await persist(snapshot.bytes);
264
+ this.workspace().markPersisted();
265
+ }
266
+ }
267
+ ```
268
+
269
+ Methods called before the view initializes are safe: they no-op and resolve to
270
+ `false`/`null`/empty rather than throwing.
271
+
272
+ See the [`@mdzip/editor`](https://www.npmjs.com/package/@mdzip/editor) package for the full API reference, theming guide, and framework-agnostic usage.
package/dist/README.md CHANGED
@@ -102,12 +102,20 @@ showUnchanged? }`) to opt any of them out.
102
102
  | `navigationMode` | `MdzipNavigationMode` | `'editor'` | Package navigation mode |
103
103
  | `navigationButtonActive` | `boolean` | `true` | Whether the navigation button is shown |
104
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 |
105
+ | `eagerImages` | `boolean` | `false` | Loads every image as soon as the preview mounts, not only those near the visible part; for a preview nobody scrolls, such as an off-screen copy for printing (use with `progressiveTextRendering: false`). Read when the view is created |
106
+ | `hostFileActions` | `readonly MdzipFileAction[]` | — | The host's own items in the file tree's right-click menu on files (`{ id, label, appliesTo?, primary?, description?, run }`; `label` and `description` may be functions of the file), e.g. "Open in Another Editor". Also shown as buttons on the card that stands in for a `.drawio` image, and on the card for a file the preview can't show (a `primary` one first). Read when the view is created |
107
+ | `fileNote` | `(file) => string \| null` | — | A line on the card for a file the preview can't show, e.g. "Open in Word: changes come back each time you save there." `refreshFileActions()` asks for it and the labels again. Read when the view is created |
108
+ | `fileCardHelp` | `MdzipFileCardHelp` | — | A link at the bottom of that card (`{ label, run }`), to the host's help. Read when the view is created |
106
109
  | `markdownRenderer` | `MdzipMarkdownRenderer` | — | Custom markdown renderer (keep the reference stable) |
107
110
  | `markdownExtensions` | `readonly MdzipMarkdownRenderExtension[]` | `[]` | Markdown pipeline extensions, diffed by `name` — new array identities with the same names are safe |
108
111
  | `entryRenderers` | `readonly MdzipEntryRenderer[]` | `[]` | Entry renderers claiming the content area for matching entries, diffed by `id` — new array identities with the same ids are safe |
109
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 |
110
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
+ | `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 |
115
+ | `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 |
116
+ | `showWhitespace` | `boolean` | `false` | Shows spaces and tabs in the source editor. Applies live |
117
+ | `manifestView` | `'form' \| 'json'` | `'form'` | How `manifest.json` opens. Read when the view is created |
118
+ | `jsonStatus` | `boolean` | `true` | The status line under the editor for `.json` files. Read when the view is created |
111
119
 
112
120
  `controls`, density, `imageHydrationAnimation`, and rendering input changes apply in
113
121
  place — they never recreate the workspace view. Line-number visibility changes
@@ -155,8 +163,14 @@ change.
155
163
  | `previewWidthChanged` | `MdzipPreviewWidthChoice` | Emitted when the user picks a width in the toolbar's page-width menu |
156
164
  | `previewRendered` | `MdzipWorkspaceSnapshot` | Emitted when the preview HTML is mounted |
157
165
  | `assetsHydrated` | `MdzipWorkspaceSnapshot` | Emitted once the mounted preview's images have loaded |
166
+ | `assetsProgress` | `MdzipAssetsProgress` | `{ loaded, total }` as those images load, for a progress bar (not emitted when there are none) |
158
167
  | `linkActivated` | `MdzipLinkActivatedEvent` | Emitted for every preview link click before built-in handling; call `event.preventDefault()` to take over |
159
168
  | `failed` | `unknown` | Emitted on unrecoverable errors |
169
+ | `outlineVisibilityChanged` | `boolean` | Emitted when the reader shows or hides the outline from the toolbar |
170
+ | `outlinePositionChanged` | `'left' \| 'right'` | Emitted when the reader moves the outline to the other side from the toolbar |
171
+ | `outlineWidthChanged` | `number` | Emitted with the outline panel's width (pixels) when the reader finishes dragging its edge |
172
+ | `whitespaceVisibilityChanged` | `boolean` | Emitted when the reader shows or hides whitespace from the toolbar |
173
+ | `jsonValidityChanged` | `MdzipJsonValidityChange` | Emitted (debounced while typing) with the open `.json` file's validity; `null`s for other files |
160
174
 
161
175
  ## Conversion hook
162
176
 
@@ -212,6 +226,8 @@ All imperative methods are public instance methods on `MdzipWorkspaceComponent`,
212
226
  so any reference to the component instance works. No view query is required: a
213
227
  template reference variable can hand the instance directly to an event handler.
214
228
 
229
+ Also: `setOutlineVisible(visible)` and `setOutlinePosition('left' | 'right')` move the outline panel, `setLayout('source' | 'split' | 'preview')` switches the layout, and `extractFiles(paths, { includeFolders })` returns the archive's files as `{ path, bytes }`.
230
+
215
231
  ```ts
216
232
  @Component({
217
233
  imports: [MdzipWorkspaceComponent],
@@ -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.5.0",
94
+ "version": "2.6.0",
95
95
  "repositoryUrl": "https://github.com/mdzip-project/mdzip-editor/tree/main/packages/editor-ng",
96
96
  "description": "Angular wrapper for the MDZip workspace editor."
97
97
  };
@@ -155,12 +155,23 @@ class MdzipWorkspaceComponent {
155
155
  this.previewRendered = new EventEmitter();
156
156
  /** Emits once the mounted preview's images have finished loading. */
157
157
  this.assetsHydrated = new EventEmitter();
158
+ this.assetsProgress = new EventEmitter();
158
159
  /**
159
160
  * Emits for every click on a preview link, before the view's own handling.
160
161
  * Call `event.preventDefault()` in the handler to take over navigation.
161
162
  */
162
163
  this.linkActivated = new EventEmitter();
163
164
  this.failed = new EventEmitter();
165
+ /** Emits when the reader shows or hides the outline from the toolbar. */
166
+ this.outlineVisibilityChanged = new EventEmitter();
167
+ /** Emits the outline panel's side when the reader moves it from the toolbar. */
168
+ this.outlinePositionChanged = new EventEmitter();
169
+ /** Emits the outline panel's width (pixels) when the reader finishes dragging its edge. */
170
+ this.outlineWidthChanged = new EventEmitter();
171
+ /** Emits when the reader shows or hides whitespace from the toolbar. */
172
+ this.whitespaceVisibilityChanged = new EventEmitter();
173
+ /** Emits (debounced, while typing) the open `.json` file's validity. */
174
+ this.jsonValidityChanged = new EventEmitter();
164
175
  this.view = null;
165
176
  this.renderingKey = '';
166
177
  this.entryTemplatesSub = null;
@@ -175,7 +186,7 @@ class MdzipWorkspaceComponent {
175
186
  this.syncView();
176
187
  }
177
188
  ngOnChanges(changes) {
178
- if (this.view && (changes['initialLayout'] || changes['initialColorScheme'] || changes['progressiveTextRendering'] || changes['inlineSvgLinks']
189
+ if (this.view && (changes['initialLayout'] || changes['initialColorScheme'] || changes['progressiveTextRendering'] || changes['inlineSvgLinks'] || changes['eagerImages']
179
190
  || changes['navigationMode'] || changes['navigationButtonActive'])) {
180
191
  this.createView();
181
192
  this.syncView();
@@ -213,6 +224,16 @@ class MdzipWorkspaceComponent {
213
224
  if (this.view && changes['externalLinks']) {
214
225
  this.view.setExternalLinks(this.externalLinks);
215
226
  }
227
+ if (this.view && changes['outline'] && !changes['outline'].firstChange) {
228
+ const outline = this.outline;
229
+ this.view.setOutlineVisible(typeof outline === 'object' ? outline.visible ?? false : outline ?? false);
230
+ if (typeof outline === 'object' && outline.position) {
231
+ this.view.setOutlinePosition(outline.position);
232
+ }
233
+ }
234
+ if (this.view && changes['showWhitespace'] && !changes['showWhitespace'].firstChange) {
235
+ this.view.setWhitespaceVisible(this.showWhitespace ?? false);
236
+ }
216
237
  if (this.view && (changes['bytes'] || changes['workspace'] || changes['mode']
217
238
  || changes['sourceFormat'] || changes['fileName'] || changes['worker'])) {
218
239
  const renameOnly = changes['fileName'] && !changes['fileName'].firstChange
@@ -240,6 +261,22 @@ class MdzipWorkspaceComponent {
240
261
  convertToMdz() {
241
262
  return this.view?.convertToMdz() ?? Promise.resolve(false);
242
263
  }
264
+ /** Shows or hides the outline panel (without emitting `outlineVisibilityChanged`). */
265
+ setOutlineVisible(visible) {
266
+ this.view?.setOutlineVisible(visible);
267
+ }
268
+ /** Puts the outline panel on the left or the right of the document. */
269
+ setOutlinePosition(position) {
270
+ this.view?.setOutlinePosition(position);
271
+ }
272
+ /** Switches to Edit (`'source'`), Split or View (`'preview'`), as the toolbar's buttons do. */
273
+ async setLayout(layout) {
274
+ await this.view?.setLayout(layout);
275
+ }
276
+ /** The archive's files as `{ path, bytes }`, by file or folder path (see the view's `extractFiles()`). */
277
+ extractFiles(paths, options) {
278
+ return this.view?.extractFiles(paths, options) ?? Promise.resolve([]);
279
+ }
243
280
  focus() {
244
281
  this.view?.focus();
245
282
  }
@@ -282,6 +319,10 @@ class MdzipWorkspaceComponent {
282
319
  replaceAsset(archivePath, fileBytes) {
283
320
  return this.view?.replaceAsset(archivePath, fileBytes) ?? Promise.resolve(false);
284
321
  }
322
+ /** Asks the file actions' labels and `fileNote` again (see the view's `refreshFileActions()`). */
323
+ refreshFileActions() {
324
+ this.view?.refreshFileActions();
325
+ }
285
326
  removeAsset(archivePath, options) {
286
327
  return this.view?.removeAsset(archivePath, options) ?? Promise.resolve(false);
287
328
  }
@@ -339,7 +380,10 @@ class MdzipWorkspaceComponent {
339
380
  systemColorScheme: this.systemColorScheme,
340
381
  progressiveTextRendering: this.progressiveTextRendering,
341
382
  inlineSvgLinks: this.inlineSvgLinks,
383
+ eagerImages: this.eagerImages,
342
384
  hostFileActions: this.hostFileActions,
385
+ fileNote: this.fileNote ? (file) => this.fileNote?.(file) ?? null : undefined,
386
+ fileCardHelp: this.fileCardHelp,
343
387
  navigationMode: this.navigationMode,
344
388
  navigationButtonActive: this.navigationButtonActive,
345
389
  onChanged: (bytes, snapshot) => this.changed.emit({ bytes, snapshot }),
@@ -357,9 +401,22 @@ class MdzipWorkspaceComponent {
357
401
  onPreviewWidthChanged: (width) => this.previewWidthChanged.emit(width),
358
402
  onPreviewRendered: (snapshot) => this.previewRendered.emit(snapshot),
359
403
  onAssetsHydrated: (snapshot) => this.assetsHydrated.emit(snapshot),
404
+ onAssetsProgress: (progress) => this.assetsProgress.emit(progress),
360
405
  onLinkActivated: (event) => this.linkActivated.emit(event),
361
406
  externalLinks: this.externalLinks,
362
407
  onFailed: (e) => this.failed.emit(e),
408
+ onExtractFiles: this.onExtractFiles
409
+ ? (request) => this.onExtractFiles(request)
410
+ : undefined,
411
+ outline: this.outline,
412
+ onOutlineVisibilityChanged: (visible) => this.outlineVisibilityChanged.emit(visible),
413
+ onOutlinePositionChanged: (position) => this.outlinePositionChanged.emit(position),
414
+ onOutlineWidthChanged: (width) => this.outlineWidthChanged.emit(width),
415
+ showWhitespace: this.showWhitespace,
416
+ onWhitespaceVisibilityChanged: (visible) => this.whitespaceVisibilityChanged.emit(visible),
417
+ manifestView: this.manifestView,
418
+ jsonStatus: this.jsonStatus,
419
+ onJsonValidityChanged: (validity, path) => this.jsonValidityChanged.emit({ validity, path }),
363
420
  onConversionRequested: this.onConversionRequested
364
421
  ? (action, context) => this.onConversionRequested(action, context)
365
422
  : undefined,
@@ -399,7 +456,7 @@ class MdzipWorkspaceComponent {
399
456
  });
400
457
  }
401
458
  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 }); }
459
+ 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", eagerImages: "eagerImages", hostFileActions: "hostFileActions", fileNote: "fileNote", fileCardHelp: "fileCardHelp", 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", assetsProgress: "assetsProgress", linkActivated: "linkActivated", failed: "failed", outlineVisibilityChanged: "outlineVisibilityChanged", outlinePositionChanged: "outlinePositionChanged", 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
460
  }
404
461
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: MdzipWorkspaceComponent, decorators: [{
405
462
  type: Component,
@@ -444,8 +501,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImpo
444
501
  type: Input
445
502
  }], inlineSvgLinks: [{
446
503
  type: Input
504
+ }], eagerImages: [{
505
+ type: Input
447
506
  }], hostFileActions: [{
448
507
  type: Input
508
+ }], fileNote: [{
509
+ type: Input
510
+ }], fileCardHelp: [{
511
+ type: Input
449
512
  }], navigationMode: [{
450
513
  type: Input
451
514
  }], navigationButtonActive: [{
@@ -464,6 +527,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImpo
464
527
  type: Input
465
528
  }], externalLinks: [{
466
529
  type: Input
530
+ }], onExtractFiles: [{
531
+ type: Input
532
+ }], outline: [{
533
+ type: Input
534
+ }], showWhitespace: [{
535
+ type: Input
536
+ }], manifestView: [{
537
+ type: Input
538
+ }], jsonStatus: [{
539
+ type: Input
467
540
  }], changed: [{
468
541
  type: Output
469
542
  }], saved: [{
@@ -494,10 +567,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImpo
494
567
  type: Output
495
568
  }], assetsHydrated: [{
496
569
  type: Output
570
+ }], assetsProgress: [{
571
+ type: Output
497
572
  }], linkActivated: [{
498
573
  type: Output
499
574
  }], failed: [{
500
575
  type: Output
576
+ }], outlineVisibilityChanged: [{
577
+ type: Output
578
+ }], outlinePositionChanged: [{
579
+ type: Output
580
+ }], outlineWidthChanged: [{
581
+ type: Output
582
+ }], whitespaceVisibilityChanged: [{
583
+ type: Output
584
+ }], jsonValidityChanged: [{
585
+ type: Output
501
586
  }], hostRef: [{
502
587
  type: ViewChild,
503
588
  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.5.0\",\n \"repositoryUrl\": \"https://github.com/mdzip-project/mdzip-editor/tree/main/packages/editor-ng\",\n \"description\": \"Angular wrapper for the MDZip workspace editor.\"\n} as const;\n","import {\r\n AfterContentInit,\r\n AfterViewInit,\r\n ChangeDetectionStrategy,\r\n Component,\r\n ContentChildren,\r\n ElementRef,\r\n EventEmitter,\r\n Input,\r\n OnChanges,\r\n OnDestroy,\r\n Output,\r\n QueryList,\r\n SimpleChanges,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { MdzipEntryRendererDirective } from './entry-renderer.directive';\r\nimport { PACKAGE_INFO } from './package-info.js';\r\nimport { MdzipWorkspaceView } from '@mdzip/editor';\r\nimport type {\r\n MdzipControlPolicy,\r\n MdzipControlPreset,\r\n MdzipContentDensity,\r\n MdzipColorScheme,\r\n MdzipColorSchemePreference,\r\n MdzipPreviewMaxWidth,\r\n MdzipPreviewWidthChoice,\r\n MdzipSystemColorScheme,\r\n MdzipConversionAction,\r\n MdzipConversionContext,\r\n MdzipEditorCommand,\r\n MdzipOpenPathOptions,\r\n MdzipPackFilesContext,\r\n MdzipPackFilesInput,\r\n MdzipPackFilesRequest,\r\n MdzipPackFilesResult,\r\n MdzipDocumentChangeEvent,\r\n MdzipEditorSnapshot,\r\n MdzipEntryRenderer,\r\n MdzipExternalLinkPolicy,\r\n MdzipFrontMatterOptions,\r\n MdzipLinkActivatedEvent,\r\n MdzipMarkdownRenderExtension,\r\n MdzipMarkdownRenderer,\r\n MdzipImageEditHandler,\r\n MdzipImageHydrationAnimation,\r\n MdzipImageInsertHandler,\r\n MdzipImageInsertMode,\r\n MdzipNavigationMode,\r\n MdzipRemoveAssetOptions,\r\n MdzipSourceFormat,\r\n MdzipToolbarDensity,\r\n MdzWorkspace,\r\n MdzWorkspaceAsset,\r\n MdzipWorkspaceChange,\r\n MdzipWorkspaceLayout,\r\n MdzipWorkspaceMode,\r\n MdzipWorkspaceSave,\r\n MdzipWorkspaceSnapshot,\r\n MdzipFileAction,\r\n} from '@mdzip/editor';\r\n\r\n// Identity-insensitive key for the rendering inputs: extensions and entry\r\n// renderers are diffed by their stable name/id (and priority), so template\r\n// expressions that build new arrays each change-detection cycle never\r\n// trigger an update.\r\nfunction renderingConfigKey(\r\n extensions: readonly MdzipMarkdownRenderExtension[],\r\n entryRenderers: readonly MdzipEntryRenderer[],\r\n frontMatter: MdzipFrontMatterOptions\r\n): string {\r\n return JSON.stringify([\r\n extensions.map((extension) => extension.name),\r\n entryRenderers.map((renderer) => [renderer.id, renderer.priority ?? 0]),\r\n // frontMatter carries no functions, so plain deep equality via\r\n // JSON.stringify is enough — no need for the name/id treatment above.\r\n frontMatter,\r\n ]);\r\n}\r\n\r\n@Component({\r\n selector: 'mdzip-workspace',\r\n standalone: true,\r\n template: '<div #host></div>',\r\n styles: [':host { display: block; height: 100%; } div { height: 100%; }'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit, OnChanges, OnDestroy {\r\n @Input() bytes: Uint8Array | null = null;\r\n @Input() workspace: MdzWorkspace | null = null;\r\n @Input() fileName = 'document.mdz';\r\n /**\r\n * When `bytes` or `workspace` change and the workspace reopens, show the file\r\n * the user was on (if it's still there) instead of the entry point (#51).\r\n * A `fileName`-only change never reopens; the name is updated in place.\r\n */\r\n @Input() preserveSelectionOnReopen = false;\r\n @Input() mode: MdzipWorkspaceMode = 'read-only';\r\n @Input() sourceFormat?: MdzipSourceFormat;\r\n /**\r\n * Dedicated Worker running `@mdzip/editor`'s `mdz-archive.worker.js`. When\r\n * provided, archive parsing and reads happen off the main thread instead of\r\n * blocking it — recommended for large archives. The host constructs the\r\n * `Worker` (asset URL resolution varies by build tooling); this component\r\n * forwards it to `MdzipWorkspaceService` unchanged and does not own its\r\n * lifecycle beyond that.\r\n */\r\n @Input() worker?: Worker;\r\n @Input() controls: MdzipControlPreset | MdzipControlPolicy = 'viewer';\r\n @Input() toolbarDensity?: MdzipToolbarDensity;\r\n @Input() contentDensity?: MdzipContentDensity;\r\n @Input() imageHydrationAnimation?: MdzipImageHydrationAnimation;\r\n @Input() imageInsertMode?: MdzipImageInsertMode;\r\n @Input() imageInsertHandler?: MdzipImageInsertHandler;\r\n @Input() imageEditHandler?: MdzipImageEditHandler;\r\n @Input() initialLayout?: MdzipWorkspaceLayout;\r\n @Input() initialColorScheme?: MdzipColorSchemePreference;\r\n /** Preview reading-column width; the user can change it from the toolbar's page-width menu. */\r\n @Input() previewMaxWidth?: MdzipPreviewMaxWidth;\r\n /** What the color scheme menu's System choice follows instead of the OS setting (a host theme), with its own label and icon. */\r\n @Input() systemColorScheme?: MdzipSystemColorScheme;\r\n /**\r\n * Mounts the preview in chunks near the viewport instead of rendering the\r\n * whole document synchronously up front. Recommended for hosts that may\r\n * open very large documents. Defaults to `false`. Constructor-only, like\r\n * `initialColorScheme` — changing it recreates the view.\r\n */\r\n @Input() progressiveTextRendering?: boolean;\r\n /**\r\n * Shows archive SVGs that contain links inline, so the links can be\r\n * clicked (see the view option). Defaults to `true`. Constructor-only.\r\n */\r\n @Input() inlineSvgLinks?: boolean;\r\n /** Extra file tree menu items for files, run by the host (see the view option). Read when the view is created. */\r\n @Input() hostFileActions?: readonly MdzipFileAction[];\r\n @Input() navigationMode: MdzipNavigationMode = 'editor';\r\n @Input() navigationButtonActive = true;\r\n /**\r\n * Host hook for the markdown→MDZ conversion flow. An input function (not an\r\n * output) because it must return/resolve `true` to suppress the built-in\r\n * conversion dialog.\r\n */\r\n @Input() onConversionRequested?: (\r\n action: MdzipConversionAction,\r\n context: MdzipConversionContext\r\n ) => boolean | Promise<boolean>;\r\n /**\r\n * Host hook for the folder→.mdz packing decision surfaced by\r\n * `packFilesAsWorkspace()`. Same input-not-output reasoning as\r\n * `onConversionRequested`.\r\n */\r\n @Input() onPackRequested?: (\r\n request: MdzipPackFilesRequest,\r\n context: MdzipPackFilesContext\r\n ) => boolean | Promise<boolean>;\r\n /**\r\n * Custom markdown renderer. Keep the reference stable: identity changes\r\n * apply via a cheap preview re-render, never a workspace rebuild.\r\n */\r\n @Input() markdownRenderer?: MdzipMarkdownRenderer;\r\n /** Markdown pipeline extensions, diffed by `name`. */\r\n @Input() markdownExtensions: readonly MdzipMarkdownRenderExtension[] = [];\r\n /** Entry renderers, diffed by `id`/`priority`. */\r\n @Input() entryRenderers: readonly MdzipEntryRenderer[] = [];\r\n /**\r\n * Controls how a leading `---`-delimited YAML front matter block renders\r\n * in the preview — display (table/raw), the collapsible expander, and its\r\n * label. Front matter handling is always registered (unlike\r\n * `markdownExtensions`); this only configures it. Diffed by deep equality\r\n * — object literals produced fresh each change-detection cycle are safe.\r\n */\r\n @Input() frontMatter: MdzipFrontMatterOptions = {};\r\n /**\r\n * Rendering policy for external links in the preview, e.g.\r\n * `{ target: '_blank' }` (adds `rel=\"noopener noreferrer\"` by default).\r\n * Changes re-apply to the mounted preview without a re-render.\r\n */\r\n @Input() externalLinks?: MdzipExternalLinkPolicy;\r\n @Output() readonly changed = new EventEmitter<MdzipWorkspaceChange>();\r\n @Output() readonly saved = new EventEmitter<MdzipWorkspaceSave>();\r\n @Output() readonly workspaceChanged = new EventEmitter<MdzipDocumentChangeEvent>();\r\n @Output() readonly documentChanged = new EventEmitter<MdzipDocumentChangeEvent>();\r\n @Output() readonly assetChanged = new EventEmitter<MdzipDocumentChangeEvent>();\r\n @Output() readonly manifestChanged = new EventEmitter<MdzipDocumentChangeEvent>();\r\n @Output() readonly snapshotChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n @Output() readonly selectionChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n @Output() readonly dirtyChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n @Output() readonly validationChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n @Output() readonly colorSchemeChanged = new EventEmitter<MdzipColorScheme>();\r\n /** Emits the user's Light / Dark / System choice from the toolbar menu. */\r\n @Output() readonly colorSchemePreferenceChanged = new EventEmitter<MdzipColorSchemePreference>();\r\n /** Emits the user's choice from the toolbar's page-width menu. */\r\n @Output() readonly previewWidthChanged = new EventEmitter<MdzipPreviewWidthChoice>();\r\n /** Emits when the preview HTML for the current selection is mounted. */\r\n @Output() readonly previewRendered = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n /** Emits once the mounted preview's images have finished loading. */\r\n @Output() readonly assetsHydrated = new EventEmitter<MdzipWorkspaceSnapshot>();\r\n /**\r\n * Emits for every click on a preview link, before the view's own handling.\r\n * Call `event.preventDefault()` in the handler to take over navigation.\r\n */\r\n @Output() readonly linkActivated = new EventEmitter<MdzipLinkActivatedEvent>();\r\n @Output() readonly failed = new EventEmitter<unknown>();\r\n\r\n @ViewChild('host') private readonly hostRef!: ElementRef<HTMLDivElement>;\r\n /**\r\n * `<ng-template mdzipEntryRenderer>` declarations projected into the\r\n * component. Each becomes an entry renderer appended after the\r\n * `entryRenderers` input (stable sort keeps the input ahead at equal\r\n * priority).\r\n */\r\n @ContentChildren(MdzipEntryRendererDirective)\r\n private readonly entryTemplates!: QueryList<MdzipEntryRendererDirective>;\r\n private view: MdzipWorkspaceView | null = null;\r\n private renderingKey = '';\r\n private entryTemplatesSub: { unsubscribe(): void } | null = null;\r\n\r\n ngAfterContentInit(): void {\r\n this.entryTemplatesSub = this.entryTemplates.changes.subscribe(() => {\r\n this.applyRenderingOptions(false);\r\n });\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n this.createView();\r\n this.syncView();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (this.view && (changes['initialLayout'] || changes['initialColorScheme'] || changes['progressiveTextRendering'] || changes['inlineSvgLinks']\r\n || changes['navigationMode'] || changes['navigationButtonActive'])) {\r\n this.createView();\r\n this.syncView();\r\n return;\r\n }\r\n if (this.view && changes['controls']) {\r\n this.view.setControls(this.controls);\r\n }\r\n if (this.view && (changes['toolbarDensity'] || changes['contentDensity'])) {\r\n this.view.setDensityOptions({\r\n toolbarDensity: this.toolbarDensity,\r\n contentDensity: this.contentDensity,\r\n });\r\n }\r\n if (this.view && changes['systemColorScheme']) {\r\n this.view.setSystemColorScheme(this.systemColorScheme ?? null);\r\n }\r\n if (this.view && changes['previewMaxWidth']) {\r\n this.view.setPreviewMaxWidth(this.previewMaxWidth);\r\n }\r\n if (this.view && changes['imageHydrationAnimation']) {\r\n this.view.setImageHydrationAnimation(this.imageHydrationAnimation);\r\n }\r\n if (this.view && (changes['imageInsertMode'] || changes['imageInsertHandler'])) {\r\n this.view.setImageInsertOptions({\r\n imageInsertMode: this.imageInsertMode,\r\n imageInsertHandler: (request) => this.imageInsertHandler?.(request),\r\n });\r\n }\r\n if (this.view && changes['imageEditHandler']) {\r\n this.view.setImageEditOptions({\r\n imageEditHandler: (request) => this.imageEditHandler?.(request),\r\n });\r\n }\r\n if (this.view && changes['externalLinks']) {\r\n this.view.setExternalLinks(this.externalLinks);\r\n }\r\n if (this.view && (changes['bytes'] || changes['workspace'] || changes['mode']\r\n || changes['sourceFormat'] || changes['fileName'] || changes['worker'])) {\r\n const renameOnly = changes['fileName'] && !changes['fileName'].firstChange\r\n && !changes['bytes'] && !changes['workspace'] && !changes['mode']\r\n && !changes['sourceFormat'] && !changes['worker'];\r\n if (!(renameOnly && this.view.setFileName(this.fileName))) {\r\n this.syncView(this.preserveSelectionOnReopen);\r\n }\r\n }\r\n if (this.view && (changes['markdownRenderer'] || changes['markdownExtensions']\r\n || changes['entryRenderers'] || changes['frontMatter'])) {\r\n this.applyRenderingOptions(Boolean(changes['markdownRenderer']));\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.entryTemplatesSub?.unsubscribe();\r\n this.view?.destroy();\r\n }\r\n\r\n canExecuteCommand(command: MdzipEditorCommand): boolean {\r\n return this.view?.canExecuteCommand(command) ?? false;\r\n }\r\n\r\n executeCommand(command: MdzipEditorCommand, file?: File): Promise<boolean> {\r\n return this.view?.executeCommand(command, file) ?? Promise.resolve(false);\r\n }\r\n\r\n convertToMdz(): Promise<boolean> {\r\n return this.view?.convertToMdz() ?? Promise.resolve(false);\r\n }\r\n\r\n focus(): void {\r\n this.view?.focus();\r\n }\r\n\r\n setColorScheme(scheme: MdzipColorSchemePreference): void {\r\n this.view?.setColorScheme(scheme);\r\n }\r\n\r\n flush(): Promise<MdzipEditorSnapshot | null> {\r\n return this.view?.flush() ?? Promise.resolve(null);\r\n }\r\n\r\n serialize(): Promise<Blob | null> {\r\n return this.view?.serialize() ?? Promise.resolve(null);\r\n }\r\n\r\n getCurrentSnapshot(): Promise<MdzipEditorSnapshot | null> {\r\n return this.view?.getCurrentSnapshot() ?? Promise.resolve(null);\r\n }\r\n\r\n whenRendered(): Promise<void> {\r\n return this.view?.whenRendered() ?? Promise.resolve();\r\n }\r\n\r\n /** See `MdzipWorkspaceView.scrollToAnchor` — waits for the preview to mount. */\r\n scrollToAnchor(anchor: string): Promise<boolean> {\r\n return this.view?.scrollToAnchor(anchor) ?? Promise.resolve(false);\r\n }\r\n\r\n getAvailableAnchors(): string[] {\r\n return this.view?.getAvailableAnchors() ?? [];\r\n }\r\n\r\n /** See `MdzipWorkspaceView.openPath` — opens another file, optionally at an anchor. */\r\n openPath(path: string, options?: MdzipOpenPathOptions): Promise<boolean> {\r\n return this.view?.openPath(path, options) ?? Promise.resolve(false);\r\n }\r\n\r\n /** The archive path of the file currently shown, or null before a workspace opens. */\r\n getCurrentPath(): string | null {\r\n return this.view?.getCurrentPath() ?? null;\r\n }\r\n\r\n markPersisted(): void {\r\n this.view?.markPersisted();\r\n }\r\n\r\n addAsset(archivePath: string, fileBytes: Uint8Array): Promise<void> {\r\n return this.view?.addAsset(archivePath, fileBytes) ?? Promise.resolve();\r\n }\r\n\r\n replaceAsset(archivePath: string, fileBytes: Uint8Array): Promise<boolean> {\r\n return this.view?.replaceAsset(archivePath, fileBytes) ?? Promise.resolve(false);\r\n }\r\n\r\n removeAsset(archivePath: string, options?: MdzipRemoveAssetOptions): Promise<boolean> {\r\n return this.view?.removeAsset(archivePath, options) ?? Promise.resolve(false);\r\n }\r\n\r\n removeFile(archivePath: string): Promise<boolean> {\r\n return this.view?.removeFile(archivePath) ?? Promise.resolve(false);\r\n }\r\n\r\n renameFile(oldPath: string, newPath: string): Promise<boolean> {\r\n return this.view?.renameFile(oldPath, newPath) ?? Promise.resolve(false);\r\n }\r\n\r\n setEntryPoint(archivePath: string): Promise<boolean> {\r\n return this.view?.setEntryPoint(archivePath) ?? Promise.resolve(false);\r\n }\r\n\r\n packFilesAsWorkspace(\r\n files: readonly MdzipPackFilesInput[],\r\n options?: { title?: string; fileName?: string }\r\n ): Promise<MdzipPackFilesResult | null> {\r\n return this.view?.packFilesAsWorkspace(files, options) ?? Promise.resolve(null);\r\n }\r\n\r\n setCoverImage(archivePath: string | null): Promise<boolean> {\r\n return this.view?.setCoverImage(archivePath) ?? Promise.resolve(false);\r\n }\r\n\r\n listAssets(): MdzWorkspaceAsset[] {\r\n return this.view?.listAssets() ?? [];\r\n }\r\n\r\n private syncView(preserveSelection = false): void {\r\n const initialPath = preserveSelection ? this.view?.getCurrentPath() ?? undefined : undefined;\r\n if (this.view && this.workspace) {\r\n void this.view.openWorkspace(this.workspace, {\r\n mode: this.mode,\r\n sourceFormat: this.sourceFormat,\r\n fileName: this.fileName,\r\n worker: this.worker,\r\n initialPath\r\n });\r\n } else if (this.view && this.bytes) {\r\n void this.view.open(this.bytes, {\r\n mode: this.mode,\r\n sourceFormat: this.sourceFormat,\r\n fileName: this.fileName,\r\n worker: this.worker,\r\n initialPath\r\n });\r\n }\r\n }\r\n\r\n private createView(): void {\r\n this.view?.destroy();\r\n this.view = new MdzipWorkspaceView(this.hostRef.nativeElement, {\r\n libraries: [PACKAGE_INFO],\r\n controls: this.controls,\r\n toolbarDensity: this.toolbarDensity,\r\n contentDensity: this.contentDensity,\r\n imageHydrationAnimation: this.imageHydrationAnimation,\r\n imageInsertMode: this.imageInsertMode,\r\n initialLayout: this.initialLayout,\r\n initialColorScheme: this.initialColorScheme,\r\n previewMaxWidth: this.previewMaxWidth,\r\n systemColorScheme: this.systemColorScheme,\r\n progressiveTextRendering: this.progressiveTextRendering,\r\n inlineSvgLinks: this.inlineSvgLinks,\r\n hostFileActions: this.hostFileActions,\r\n navigationMode: this.navigationMode,\r\n navigationButtonActive: this.navigationButtonActive,\r\n onChanged: (bytes, snapshot) => this.changed.emit({ bytes, snapshot }),\r\n onSaved: (bytes, snapshot) => this.saved.emit({ bytes, snapshot }),\r\n onWorkspaceChanged: (event) => this.workspaceChanged.emit(event),\r\n onDocumentChanged: (event) => this.documentChanged.emit(event),\r\n onAssetChanged: (event) => this.assetChanged.emit(event),\r\n onManifestChanged: (event) => this.manifestChanged.emit(event),\r\n onSnapshotChanged: (snapshot) => this.snapshotChanged.emit(snapshot),\r\n onSelectionChanged: (snapshot: MdzipWorkspaceSnapshot) => this.selectionChanged.emit(snapshot),\r\n onDirtyChanged: (snapshot: MdzipWorkspaceSnapshot) => this.dirtyChanged.emit(snapshot),\r\n onValidationChanged: (snapshot: MdzipWorkspaceSnapshot) => this.validationChanged.emit(snapshot),\r\n onColorSchemeChanged: (colorScheme: MdzipColorScheme) => this.colorSchemeChanged.emit(colorScheme),\r\n onColorSchemePreferenceChanged: (preference: MdzipColorSchemePreference) =>\r\n this.colorSchemePreferenceChanged.emit(preference),\r\n onPreviewWidthChanged: (width: MdzipPreviewWidthChoice) => this.previewWidthChanged.emit(width),\r\n onPreviewRendered: (snapshot: MdzipWorkspaceSnapshot) => this.previewRendered.emit(snapshot),\r\n onAssetsHydrated: (snapshot: MdzipWorkspaceSnapshot) => this.assetsHydrated.emit(snapshot),\r\n onLinkActivated: (event: MdzipLinkActivatedEvent) => this.linkActivated.emit(event),\r\n externalLinks: this.externalLinks,\r\n onFailed: (e: unknown) => this.failed.emit(e),\r\n onConversionRequested: this.onConversionRequested\r\n ? (action, context) => this.onConversionRequested!(action, context)\r\n : undefined,\r\n onPackRequested: this.onPackRequested\r\n ? (request, context) => this.onPackRequested!(request, context)\r\n : undefined,\r\n imageInsertHandler: (request) => this.imageInsertHandler?.(request),\r\n imageEditHandler: (request) => this.imageEditHandler?.(request),\r\n markdownRenderer: this.markdownRenderer,\r\n markdownExtensions: this.markdownExtensions,\r\n entryRenderers: this.composedEntryRenderers(),\r\n frontMatter: this.frontMatter,\r\n });\r\n this.renderingKey = renderingConfigKey(this.markdownExtensions, this.composedEntryRenderers(), this.frontMatter);\r\n }\r\n\r\n private composedEntryRenderers(): readonly MdzipEntryRenderer[] {\r\n const templates = this.entryTemplates\r\n ? this.entryTemplates.map((directive, index) => directive.toEntryRenderer(index))\r\n : [];\r\n return [...this.entryRenderers, ...templates];\r\n }\r\n\r\n // Applies rendering input changes in place — never a view rebuild. Arrays\r\n // re-apply only when their name/id key changes, so template expressions\r\n // that produce new array identities each cycle are safe.\r\n private applyRenderingOptions(rendererChanged: boolean): void {\r\n const composed = this.composedEntryRenderers();\r\n const key = renderingConfigKey(this.markdownExtensions, composed, this.frontMatter);\r\n if (!rendererChanged && key === this.renderingKey) {\r\n return;\r\n }\r\n this.renderingKey = key;\r\n this.view?.setRenderingOptions({\r\n markdownRenderer: this.markdownRenderer ?? null,\r\n markdownExtensions: this.markdownExtensions,\r\n entryRenderers: composed,\r\n frontMatter: this.frontMatter,\r\n });\r\n }\r\n}\r\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport type {\n MdzipDiffControlsOptions,\n MdzipDiffSelectionEvent,\n MdzipDiffSideInput,\n MdzipDiffToolbarAction,\n MdzipDiffView,\n MdzipDiffViewOptions\n} from '@mdzip/editor/diff-view';\n\n@Component({\n selector: 'mdzip-diff',\n standalone: true,\n template: '<div #host></div>',\n styles: [':host { display:block; height:100%; } div { height:100%; }'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MdzipDiffComponent implements AfterViewInit, OnChanges, OnDestroy {\n @Input({ required: true }) before!: MdzipDiffSideInput;\n @Input({ required: true }) after!: MdzipDiffSideInput;\n @Input() initialPath?: string;\n @Input() showUnchanged = true;\n @Input() navigationVisible = true;\n @Input() controls?: MdzipDiffControlsOptions;\n @Input() toolbarActions: readonly MdzipDiffToolbarAction[] = [];\n @Output() readonly selectionChanged = new EventEmitter<MdzipDiffSelectionEvent>();\n @Output() readonly failed = new EventEmitter<Error>();\n\n @ViewChild('host') private readonly hostRef!: ElementRef<HTMLDivElement>;\n private view: MdzipDiffView | null = null;\n private destroyed = false;\n\n ngAfterViewInit(): void {\n void this.createView();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.view) return;\n if (changes['before'] || changes['after'] || changes['initialPath']) {\n void this.view.open(this.options());\n }\n if (changes['showUnchanged']) this.view.setShowUnchanged(this.showUnchanged);\n if (changes['navigationVisible']) this.view.setNavigationVisible(this.navigationVisible);\n if (changes['toolbarActions']) this.view.setToolbarActions(this.toolbarActions);\n }\n\n ngOnDestroy(): void {\n this.destroyed = true;\n this.view?.destroy();\n this.view = null;\n }\n\n openPath(path: string): Promise<boolean> {\n return this.view?.openPath(path) ?? Promise.resolve(false);\n }\n\n openPreviousChange(): Promise<boolean> {\n return this.view?.openPreviousChange() ?? Promise.resolve(false);\n }\n\n openNextChange(): Promise<boolean> {\n return this.view?.openNextChange() ?? Promise.resolve(false);\n }\n\n setShowUnchanged(show: boolean): void {\n this.view?.setShowUnchanged(show);\n }\n\n setNavigationVisible(visible: boolean): void {\n this.view?.setNavigationVisible(visible);\n }\n\n setToolbarActions(actions: readonly MdzipDiffToolbarAction[]): void {\n this.view?.setToolbarActions(actions);\n }\n\n private async createView(): Promise<void> {\n const { MdzipDiffView } = await import('@mdzip/editor/diff-view');\n if (this.destroyed) return;\n this.view = new MdzipDiffView(this.hostRef.nativeElement, this.options());\n }\n\n private options(): MdzipDiffViewOptions {\n return {\n before: this.before,\n after: this.after,\n initialPath: this.initialPath,\n showUnchanged: this.showUnchanged,\n navigationVisible: this.navigationVisible,\n controls: this.controls,\n toolbarActions: this.toolbarActions,\n onSelectionChanged: (event) => this.selectionChanged.emit(event),\n onFailed: (error) => this.failed.emit(error)\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;A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AA,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.6.0\",\n \"repositoryUrl\": \"https://github.com/mdzip-project/mdzip-editor/tree/main/packages/editor-ng\",\n \"description\": \"Angular wrapper for the MDZip workspace editor.\"\n} as const;\n","import {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n QueryList,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { MdzipEntryRendererDirective } from './entry-renderer.directive';\nimport { PACKAGE_INFO } from './package-info.js';\nimport { MdzipWorkspaceView } from '@mdzip/editor';\nimport type {\n MdzipAssetsProgress,\n MdzipControlPolicy,\n MdzipControlPreset,\n MdzipContentDensity,\n MdzipColorScheme,\n MdzipColorSchemePreference,\n MdzipPreviewMaxWidth,\n MdzipPreviewWidthChoice,\n MdzipSystemColorScheme,\n MdzipConversionAction,\n MdzipConversionContext,\n MdzipEditorCommand,\n MdzipOpenPathOptions,\n MdzipPackFilesContext,\n MdzipPackFilesInput,\n MdzipPackFilesRequest,\n MdzipPackFilesResult,\n MdzipDocumentChangeEvent,\n MdzipEditorSnapshot,\n MdzipEntryRenderer,\n MdzipExternalLinkPolicy,\n MdzipFrontMatterOptions,\n MdzipLinkActivatedEvent,\n MdzipMarkdownRenderExtension,\n MdzipMarkdownRenderer,\n MdzipImageEditHandler,\n MdzipImageHydrationAnimation,\n MdzipImageInsertHandler,\n MdzipImageInsertMode,\n MdzipNavigationMode,\n MdzipRemoveAssetOptions,\n MdzipSourceFormat,\n MdzipToolbarDensity,\n MdzWorkspace,\n MdzWorkspaceAsset,\n MdzipWorkspaceChange,\n MdzipWorkspaceLayout,\n MdzipWorkspaceMode,\n MdzipWorkspaceSave,\n MdzipWorkspaceSnapshot,\n MdzipFileAction,\n MdzipFileActionTarget,\n MdzipFileCardHelp,\n MdzipExtractedFile,\n MdzipExtractRequest,\n MdzipJsonValidity,\n MdzipOutlinePosition,\n MdzipOutlineViewOptions,\n} from '@mdzip/editor';\n\n/** What `jsonValidityChanged` emits: the open `.json` file's validity, or `null`s when another kind of file is open. */\nexport interface MdzipJsonValidityChange {\n validity: MdzipJsonValidity | null;\n path: string | null;\n}\n\n// Identity-insensitive key for the rendering inputs: extensions and entry\n// renderers are diffed by their stable name/id (and priority), so template\n// expressions that build new arrays each change-detection cycle never\n// trigger an update.\nfunction renderingConfigKey(\n extensions: readonly MdzipMarkdownRenderExtension[],\n entryRenderers: readonly MdzipEntryRenderer[],\n frontMatter: MdzipFrontMatterOptions\n): string {\n return JSON.stringify([\n extensions.map((extension) => extension.name),\n entryRenderers.map((renderer) => [renderer.id, renderer.priority ?? 0]),\n // frontMatter carries no functions, so plain deep equality via\n // JSON.stringify is enough — no need for the name/id treatment above.\n frontMatter,\n ]);\n}\n\n@Component({\n selector: 'mdzip-workspace',\n standalone: true,\n template: '<div #host></div>',\n styles: [':host { display: block; height: 100%; } div { height: 100%; }'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit, OnChanges, OnDestroy {\n @Input() bytes: Uint8Array | null = null;\n @Input() workspace: MdzWorkspace | null = null;\n @Input() fileName = 'document.mdz';\n /**\n * When `bytes` or `workspace` change and the workspace reopens, show the file\n * the user was on (if it's still there) instead of the entry point (#51).\n * A `fileName`-only change never reopens; the name is updated in place.\n */\n @Input() preserveSelectionOnReopen = false;\n @Input() mode: MdzipWorkspaceMode = 'read-only';\n @Input() sourceFormat?: MdzipSourceFormat;\n /**\n * Dedicated Worker running `@mdzip/editor`'s `mdz-archive.worker.js`. When\n * provided, archive parsing and reads happen off the main thread instead of\n * blocking it — recommended for large archives. The host constructs the\n * `Worker` (asset URL resolution varies by build tooling); this component\n * forwards it to `MdzipWorkspaceService` unchanged and does not own its\n * lifecycle beyond that.\n */\n @Input() worker?: Worker;\n @Input() controls: MdzipControlPreset | MdzipControlPolicy = 'viewer';\n @Input() toolbarDensity?: MdzipToolbarDensity;\n @Input() contentDensity?: MdzipContentDensity;\n @Input() imageHydrationAnimation?: MdzipImageHydrationAnimation;\n @Input() imageInsertMode?: MdzipImageInsertMode;\n @Input() imageInsertHandler?: MdzipImageInsertHandler;\n @Input() imageEditHandler?: MdzipImageEditHandler;\n @Input() initialLayout?: MdzipWorkspaceLayout;\n @Input() initialColorScheme?: MdzipColorSchemePreference;\n /** Preview reading-column width; the user can change it from the toolbar's page-width menu. */\n @Input() previewMaxWidth?: MdzipPreviewMaxWidth;\n /** What the color scheme menu's System choice follows instead of the OS setting (a host theme), with its own label and icon. */\n @Input() systemColorScheme?: MdzipSystemColorScheme;\n /**\n * Mounts the preview in chunks near the viewport instead of rendering the\n * whole document synchronously up front. Recommended for hosts that may\n * open very large documents. Defaults to `false`. Constructor-only, like\n * `initialColorScheme` — changing it recreates the view.\n */\n @Input() progressiveTextRendering?: boolean;\n /**\n * Shows archive SVGs that contain links inline, so the links can be\n * clicked (see the view option). Defaults to `true`. Constructor-only.\n */\n @Input() inlineSvgLinks?: boolean;\n /**\n * Loads every image as soon as the preview mounts, for a preview nobody\n * scrolls, such as an off-screen copy for printing (see the view option).\n * Defaults to `false`. Constructor-only.\n */\n @Input() eagerImages?: boolean;\n /** Extra file tree menu items for files, run by the host (see the view option). Read when the view is created. */\n @Input() hostFileActions?: readonly MdzipFileAction[];\n /** A line for the card of a file the preview can't show (see the view option). Read when the view is created. */\n @Input() fileNote?: (file: MdzipFileActionTarget) => string | null;\n /** A help link at the bottom of that card (see the view option). Read when the view is created. */\n @Input() fileCardHelp?: MdzipFileCardHelp;\n @Input() navigationMode: MdzipNavigationMode = 'editor';\n @Input() navigationButtonActive = true;\n /**\n * Host hook for the markdown→MDZ conversion flow. An input function (not an\n * output) because it must return/resolve `true` to suppress the built-in\n * conversion dialog.\n */\n @Input() onConversionRequested?: (\n action: MdzipConversionAction,\n context: MdzipConversionContext\n ) => boolean | Promise<boolean>;\n /**\n * Host hook for the folder→.mdz packing decision surfaced by\n * `packFilesAsWorkspace()`. Same input-not-output reasoning as\n * `onConversionRequested`.\n */\n @Input() onPackRequested?: (\n request: MdzipPackFilesRequest,\n context: MdzipPackFilesContext\n ) => boolean | Promise<boolean>;\n /**\n * Custom markdown renderer. Keep the reference stable: identity changes\n * apply via a cheap preview re-render, never a workspace rebuild.\n */\n @Input() markdownRenderer?: MdzipMarkdownRenderer;\n /** Markdown pipeline extensions, diffed by `name`. */\n @Input() markdownExtensions: readonly MdzipMarkdownRenderExtension[] = [];\n /** Entry renderers, diffed by `id`/`priority`. */\n @Input() entryRenderers: readonly MdzipEntryRenderer[] = [];\n /**\n * Controls how a leading `---`-delimited YAML front matter block renders\n * in the preview — display (table/raw), the collapsible expander, and its\n * label. Front matter handling is always registered (unlike\n * `markdownExtensions`); this only configures it. Diffed by deep equality\n * — object literals produced fresh each change-detection cycle are safe.\n */\n @Input() frontMatter: MdzipFrontMatterOptions = {};\n /**\n * Rendering policy for external links in the preview, e.g.\n * `{ target: '_blank' }` (adds `rel=\"noopener noreferrer\"` by default).\n * Changes re-apply to the mounted preview without a re-render.\n */\n @Input() externalLinks?: MdzipExternalLinkPolicy;\n /**\n * Writes files taken out of the archive (the contents pane's Extract…), for\n * hosts that can write to disk themselves. With it, the menu says\n * **Extract…** instead of offering browser downloads. An input function,\n * like `onConversionRequested`, because the view waits for it. Read when the\n * view is created.\n */\n @Input() onExtractFiles?: (request: MdzipExtractRequest) => void | Promise<void>;\n /**\n * The outline panel: `true` to open it, or options (`visible`, `position`,\n * `width`, `levels`, `collapse`, `label`). `visible` and `position` apply\n * live; the others are read when the view is created.\n */\n @Input() outline?: boolean | MdzipOutlineViewOptions;\n /** Shows spaces and tabs in the source editor. Applies live. */\n @Input() showWhitespace?: boolean;\n /** How `manifest.json` opens: `'form'` (the default) or `'json'`. Read when the view is created. */\n @Input() manifestView?: 'form' | 'json';\n /** The status line under the editor for `.json` files. Defaults to `true`. Read when the view is created. */\n @Input() jsonStatus?: boolean;\n @Output() readonly changed = new EventEmitter<MdzipWorkspaceChange>();\n @Output() readonly saved = new EventEmitter<MdzipWorkspaceSave>();\n @Output() readonly workspaceChanged = new EventEmitter<MdzipDocumentChangeEvent>();\n @Output() readonly documentChanged = new EventEmitter<MdzipDocumentChangeEvent>();\n @Output() readonly assetChanged = new EventEmitter<MdzipDocumentChangeEvent>();\n @Output() readonly manifestChanged = new EventEmitter<MdzipDocumentChangeEvent>();\n @Output() readonly snapshotChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly selectionChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly dirtyChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly validationChanged = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly colorSchemeChanged = new EventEmitter<MdzipColorScheme>();\n /** Emits the user's Light / Dark / System choice from the toolbar menu. */\n @Output() readonly colorSchemePreferenceChanged = new EventEmitter<MdzipColorSchemePreference>();\n /** Emits the user's choice from the toolbar's page-width menu. */\n @Output() readonly previewWidthChanged = new EventEmitter<MdzipPreviewWidthChoice>();\n /** Emits when the preview HTML for the current selection is mounted. */\n @Output() readonly previewRendered = new EventEmitter<MdzipWorkspaceSnapshot>();\n /** Emits once the mounted preview's images have finished loading. */\n @Output() readonly assetsHydrated = new EventEmitter<MdzipWorkspaceSnapshot>();\n @Output() readonly assetsProgress = new EventEmitter<MdzipAssetsProgress>();\n /**\n * Emits for every click on a preview link, before the view's own handling.\n * Call `event.preventDefault()` in the handler to take over navigation.\n */\n @Output() readonly linkActivated = new EventEmitter<MdzipLinkActivatedEvent>();\n @Output() readonly failed = new EventEmitter<unknown>();\n /** Emits when the reader shows or hides the outline from the toolbar. */\n @Output() readonly outlineVisibilityChanged = new EventEmitter<boolean>();\n /** Emits the outline panel's side when the reader moves it from the toolbar. */\n @Output() readonly outlinePositionChanged = new EventEmitter<MdzipOutlinePosition>();\n /** Emits the outline panel's width (pixels) when the reader finishes dragging its edge. */\n @Output() readonly outlineWidthChanged = new EventEmitter<number>();\n /** Emits when the reader shows or hides whitespace from the toolbar. */\n @Output() readonly whitespaceVisibilityChanged = new EventEmitter<boolean>();\n /** Emits (debounced, while typing) the open `.json` file's validity. */\n @Output() readonly jsonValidityChanged = new EventEmitter<MdzipJsonValidityChange>();\n\n @ViewChild('host') private readonly hostRef!: ElementRef<HTMLDivElement>;\n /**\n * `<ng-template mdzipEntryRenderer>` declarations projected into the\n * component. Each becomes an entry renderer appended after the\n * `entryRenderers` input (stable sort keeps the input ahead at equal\n * priority).\n */\n @ContentChildren(MdzipEntryRendererDirective)\n private readonly entryTemplates!: QueryList<MdzipEntryRendererDirective>;\n private view: MdzipWorkspaceView | null = null;\n private renderingKey = '';\n private entryTemplatesSub: { unsubscribe(): void } | null = null;\n\n ngAfterContentInit(): void {\n this.entryTemplatesSub = this.entryTemplates.changes.subscribe(() => {\n this.applyRenderingOptions(false);\n });\n }\n\n ngAfterViewInit(): void {\n this.createView();\n this.syncView();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (this.view && (changes['initialLayout'] || changes['initialColorScheme'] || changes['progressiveTextRendering'] || changes['inlineSvgLinks'] || changes['eagerImages']\n || changes['navigationMode'] || changes['navigationButtonActive'])) {\n this.createView();\n this.syncView();\n return;\n }\n if (this.view && changes['controls']) {\n this.view.setControls(this.controls);\n }\n if (this.view && (changes['toolbarDensity'] || changes['contentDensity'])) {\n this.view.setDensityOptions({\n toolbarDensity: this.toolbarDensity,\n contentDensity: this.contentDensity,\n });\n }\n if (this.view && changes['systemColorScheme']) {\n this.view.setSystemColorScheme(this.systemColorScheme ?? null);\n }\n if (this.view && changes['previewMaxWidth']) {\n this.view.setPreviewMaxWidth(this.previewMaxWidth);\n }\n if (this.view && changes['imageHydrationAnimation']) {\n this.view.setImageHydrationAnimation(this.imageHydrationAnimation);\n }\n if (this.view && (changes['imageInsertMode'] || changes['imageInsertHandler'])) {\n this.view.setImageInsertOptions({\n imageInsertMode: this.imageInsertMode,\n imageInsertHandler: (request) => this.imageInsertHandler?.(request),\n });\n }\n if (this.view && changes['imageEditHandler']) {\n this.view.setImageEditOptions({\n imageEditHandler: (request) => this.imageEditHandler?.(request),\n });\n }\n if (this.view && changes['externalLinks']) {\n this.view.setExternalLinks(this.externalLinks);\n }\n if (this.view && changes['outline'] && !changes['outline'].firstChange) {\n const outline = this.outline;\n this.view.setOutlineVisible(typeof outline === 'object' ? outline.visible ?? false : outline ?? false);\n if (typeof outline === 'object' && outline.position) {\n this.view.setOutlinePosition(outline.position);\n }\n }\n if (this.view && changes['showWhitespace'] && !changes['showWhitespace'].firstChange) {\n this.view.setWhitespaceVisible(this.showWhitespace ?? false);\n }\n if (this.view && (changes['bytes'] || changes['workspace'] || changes['mode']\n || changes['sourceFormat'] || changes['fileName'] || changes['worker'])) {\n const renameOnly = changes['fileName'] && !changes['fileName'].firstChange\n && !changes['bytes'] && !changes['workspace'] && !changes['mode']\n && !changes['sourceFormat'] && !changes['worker'];\n if (!(renameOnly && this.view.setFileName(this.fileName))) {\n this.syncView(this.preserveSelectionOnReopen);\n }\n }\n if (this.view && (changes['markdownRenderer'] || changes['markdownExtensions']\n || changes['entryRenderers'] || changes['frontMatter'])) {\n this.applyRenderingOptions(Boolean(changes['markdownRenderer']));\n }\n }\n\n ngOnDestroy(): void {\n this.entryTemplatesSub?.unsubscribe();\n this.view?.destroy();\n }\n\n canExecuteCommand(command: MdzipEditorCommand): boolean {\n return this.view?.canExecuteCommand(command) ?? false;\n }\n\n executeCommand(command: MdzipEditorCommand, file?: File): Promise<boolean> {\n return this.view?.executeCommand(command, file) ?? Promise.resolve(false);\n }\n\n convertToMdz(): Promise<boolean> {\n return this.view?.convertToMdz() ?? Promise.resolve(false);\n }\n\n /** Shows or hides the outline panel (without emitting `outlineVisibilityChanged`). */\n setOutlineVisible(visible: boolean): void {\n this.view?.setOutlineVisible(visible);\n }\n\n /** Puts the outline panel on the left or the right of the document. */\n setOutlinePosition(position: MdzipOutlinePosition): void {\n this.view?.setOutlinePosition(position);\n }\n\n /** Switches to Edit (`'source'`), Split or View (`'preview'`), as the toolbar's buttons do. */\n async setLayout(layout: MdzipWorkspaceLayout): Promise<void> {\n await this.view?.setLayout(layout);\n }\n\n /** The archive's files as `{ path, bytes }`, by file or folder path (see the view's `extractFiles()`). */\n extractFiles(paths: readonly string[], options?: { includeFolders?: boolean }): Promise<MdzipExtractedFile[]> {\n return this.view?.extractFiles(paths, options) ?? Promise.resolve([]);\n }\n\n focus(): void {\n this.view?.focus();\n }\n\n setColorScheme(scheme: MdzipColorSchemePreference): void {\n this.view?.setColorScheme(scheme);\n }\n\n flush(): Promise<MdzipEditorSnapshot | null> {\n return this.view?.flush() ?? Promise.resolve(null);\n }\n\n serialize(): Promise<Blob | null> {\n return this.view?.serialize() ?? Promise.resolve(null);\n }\n\n getCurrentSnapshot(): Promise<MdzipEditorSnapshot | null> {\n return this.view?.getCurrentSnapshot() ?? Promise.resolve(null);\n }\n\n whenRendered(): Promise<void> {\n return this.view?.whenRendered() ?? Promise.resolve();\n }\n\n /** See `MdzipWorkspaceView.scrollToAnchor` — waits for the preview to mount. */\n scrollToAnchor(anchor: string): Promise<boolean> {\n return this.view?.scrollToAnchor(anchor) ?? Promise.resolve(false);\n }\n\n getAvailableAnchors(): string[] {\n return this.view?.getAvailableAnchors() ?? [];\n }\n\n /** See `MdzipWorkspaceView.openPath` — opens another file, optionally at an anchor. */\n openPath(path: string, options?: MdzipOpenPathOptions): Promise<boolean> {\n return this.view?.openPath(path, options) ?? Promise.resolve(false);\n }\n\n /** The archive path of the file currently shown, or null before a workspace opens. */\n getCurrentPath(): string | null {\n return this.view?.getCurrentPath() ?? null;\n }\n\n markPersisted(): void {\n this.view?.markPersisted();\n }\n\n addAsset(archivePath: string, fileBytes: Uint8Array): Promise<void> {\n return this.view?.addAsset(archivePath, fileBytes) ?? Promise.resolve();\n }\n\n replaceAsset(archivePath: string, fileBytes: Uint8Array): Promise<boolean> {\n return this.view?.replaceAsset(archivePath, fileBytes) ?? Promise.resolve(false);\n }\n\n /** Asks the file actions' labels and `fileNote` again (see the view's `refreshFileActions()`). */\n refreshFileActions(): void {\n this.view?.refreshFileActions();\n }\n\n removeAsset(archivePath: string, options?: MdzipRemoveAssetOptions): Promise<boolean> {\n return this.view?.removeAsset(archivePath, options) ?? Promise.resolve(false);\n }\n\n removeFile(archivePath: string): Promise<boolean> {\n return this.view?.removeFile(archivePath) ?? Promise.resolve(false);\n }\n\n renameFile(oldPath: string, newPath: string): Promise<boolean> {\n return this.view?.renameFile(oldPath, newPath) ?? Promise.resolve(false);\n }\n\n setEntryPoint(archivePath: string): Promise<boolean> {\n return this.view?.setEntryPoint(archivePath) ?? Promise.resolve(false);\n }\n\n packFilesAsWorkspace(\n files: readonly MdzipPackFilesInput[],\n options?: { title?: string; fileName?: string }\n ): Promise<MdzipPackFilesResult | null> {\n return this.view?.packFilesAsWorkspace(files, options) ?? Promise.resolve(null);\n }\n\n setCoverImage(archivePath: string | null): Promise<boolean> {\n return this.view?.setCoverImage(archivePath) ?? Promise.resolve(false);\n }\n\n listAssets(): MdzWorkspaceAsset[] {\n return this.view?.listAssets() ?? [];\n }\n\n private syncView(preserveSelection = false): void {\n const initialPath = preserveSelection ? this.view?.getCurrentPath() ?? undefined : undefined;\n if (this.view && this.workspace) {\n void this.view.openWorkspace(this.workspace, {\n mode: this.mode,\n sourceFormat: this.sourceFormat,\n fileName: this.fileName,\n worker: this.worker,\n initialPath\n });\n } else if (this.view && this.bytes) {\n void this.view.open(this.bytes, {\n mode: this.mode,\n sourceFormat: this.sourceFormat,\n fileName: this.fileName,\n worker: this.worker,\n initialPath\n });\n }\n }\n\n private createView(): void {\n this.view?.destroy();\n this.view = new MdzipWorkspaceView(this.hostRef.nativeElement, {\n libraries: [PACKAGE_INFO],\n controls: this.controls,\n toolbarDensity: this.toolbarDensity,\n contentDensity: this.contentDensity,\n imageHydrationAnimation: this.imageHydrationAnimation,\n imageInsertMode: this.imageInsertMode,\n initialLayout: this.initialLayout,\n initialColorScheme: this.initialColorScheme,\n previewMaxWidth: this.previewMaxWidth,\n systemColorScheme: this.systemColorScheme,\n progressiveTextRendering: this.progressiveTextRendering,\n inlineSvgLinks: this.inlineSvgLinks,\n eagerImages: this.eagerImages,\n hostFileActions: this.hostFileActions,\n fileNote: this.fileNote ? (file) => this.fileNote?.(file) ?? null : undefined,\n fileCardHelp: this.fileCardHelp,\n navigationMode: this.navigationMode,\n navigationButtonActive: this.navigationButtonActive,\n onChanged: (bytes, snapshot) => this.changed.emit({ bytes, snapshot }),\n onSaved: (bytes, snapshot) => this.saved.emit({ bytes, snapshot }),\n onWorkspaceChanged: (event) => this.workspaceChanged.emit(event),\n onDocumentChanged: (event) => this.documentChanged.emit(event),\n onAssetChanged: (event) => this.assetChanged.emit(event),\n onManifestChanged: (event) => this.manifestChanged.emit(event),\n onSnapshotChanged: (snapshot) => this.snapshotChanged.emit(snapshot),\n onSelectionChanged: (snapshot: MdzipWorkspaceSnapshot) => this.selectionChanged.emit(snapshot),\n onDirtyChanged: (snapshot: MdzipWorkspaceSnapshot) => this.dirtyChanged.emit(snapshot),\n onValidationChanged: (snapshot: MdzipWorkspaceSnapshot) => this.validationChanged.emit(snapshot),\n onColorSchemeChanged: (colorScheme: MdzipColorScheme) => this.colorSchemeChanged.emit(colorScheme),\n onColorSchemePreferenceChanged: (preference: MdzipColorSchemePreference) =>\n this.colorSchemePreferenceChanged.emit(preference),\n onPreviewWidthChanged: (width: MdzipPreviewWidthChoice) => this.previewWidthChanged.emit(width),\n onPreviewRendered: (snapshot: MdzipWorkspaceSnapshot) => this.previewRendered.emit(snapshot),\n onAssetsHydrated: (snapshot: MdzipWorkspaceSnapshot) => this.assetsHydrated.emit(snapshot),\n onAssetsProgress: (progress: MdzipAssetsProgress) => this.assetsProgress.emit(progress),\n onLinkActivated: (event: MdzipLinkActivatedEvent) => this.linkActivated.emit(event),\n externalLinks: this.externalLinks,\n onFailed: (e: unknown) => this.failed.emit(e),\n onExtractFiles: this.onExtractFiles\n ? (request) => this.onExtractFiles!(request)\n : undefined,\n outline: this.outline,\n onOutlineVisibilityChanged: (visible) => this.outlineVisibilityChanged.emit(visible),\n onOutlinePositionChanged: (position) => this.outlinePositionChanged.emit(position),\n onOutlineWidthChanged: (width) => this.outlineWidthChanged.emit(width),\n showWhitespace: this.showWhitespace,\n onWhitespaceVisibilityChanged: (visible) => this.whitespaceVisibilityChanged.emit(visible),\n manifestView: this.manifestView,\n jsonStatus: this.jsonStatus,\n onJsonValidityChanged: (validity, path) => this.jsonValidityChanged.emit({ validity, path }),\n onConversionRequested: this.onConversionRequested\n ? (action, context) => this.onConversionRequested!(action, context)\n : undefined,\n onPackRequested: this.onPackRequested\n ? (request, context) => this.onPackRequested!(request, context)\n : undefined,\n imageInsertHandler: (request) => this.imageInsertHandler?.(request),\n imageEditHandler: (request) => this.imageEditHandler?.(request),\n markdownRenderer: this.markdownRenderer,\n markdownExtensions: this.markdownExtensions,\n entryRenderers: this.composedEntryRenderers(),\n frontMatter: this.frontMatter,\n });\n this.renderingKey = renderingConfigKey(this.markdownExtensions, this.composedEntryRenderers(), this.frontMatter);\n }\n\n private composedEntryRenderers(): readonly MdzipEntryRenderer[] {\n const templates = this.entryTemplates\n ? this.entryTemplates.map((directive, index) => directive.toEntryRenderer(index))\n : [];\n return [...this.entryRenderers, ...templates];\n }\n\n // Applies rendering input changes in place — never a view rebuild. Arrays\n // re-apply only when their name/id key changes, so template expressions\n // that produce new array identities each cycle are safe.\n private applyRenderingOptions(rendererChanged: boolean): void {\n const composed = this.composedEntryRenderers();\n const key = renderingConfigKey(this.markdownExtensions, composed, this.frontMatter);\n if (!rendererChanged && key === this.renderingKey) {\n return;\n }\n this.renderingKey = key;\n this.view?.setRenderingOptions({\n markdownRenderer: this.markdownRenderer ?? null,\n markdownExtensions: this.markdownExtensions,\n entryRenderers: composed,\n frontMatter: this.frontMatter,\n });\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport type {\n MdzipDiffControlsOptions,\n MdzipDiffSelectionEvent,\n MdzipDiffSideInput,\n MdzipDiffToolbarAction,\n MdzipDiffView,\n MdzipDiffViewOptions\n} from '@mdzip/editor/diff-view';\n\n@Component({\n selector: 'mdzip-diff',\n standalone: true,\n template: '<div #host></div>',\n styles: [':host { display:block; height:100%; } div { height:100%; }'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MdzipDiffComponent implements AfterViewInit, OnChanges, OnDestroy {\n @Input({ required: true }) before!: MdzipDiffSideInput;\n @Input({ required: true }) after!: MdzipDiffSideInput;\n @Input() initialPath?: string;\n @Input() showUnchanged = true;\n @Input() navigationVisible = true;\n @Input() controls?: MdzipDiffControlsOptions;\n @Input() toolbarActions: readonly MdzipDiffToolbarAction[] = [];\n @Output() readonly selectionChanged = new EventEmitter<MdzipDiffSelectionEvent>();\n @Output() readonly failed = new EventEmitter<Error>();\n\n @ViewChild('host') private readonly hostRef!: ElementRef<HTMLDivElement>;\n private view: MdzipDiffView | null = null;\n private destroyed = false;\n\n ngAfterViewInit(): void {\n void this.createView();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.view) return;\n if (changes['before'] || changes['after'] || changes['initialPath']) {\n void this.view.open(this.options());\n }\n if (changes['showUnchanged']) this.view.setShowUnchanged(this.showUnchanged);\n if (changes['navigationVisible']) this.view.setNavigationVisible(this.navigationVisible);\n if (changes['toolbarActions']) this.view.setToolbarActions(this.toolbarActions);\n }\n\n ngOnDestroy(): void {\n this.destroyed = true;\n this.view?.destroy();\n this.view = null;\n }\n\n openPath(path: string): Promise<boolean> {\n return this.view?.openPath(path) ?? Promise.resolve(false);\n }\n\n openPreviousChange(): Promise<boolean> {\n return this.view?.openPreviousChange() ?? Promise.resolve(false);\n }\n\n openNextChange(): Promise<boolean> {\n return this.view?.openNextChange() ?? Promise.resolve(false);\n }\n\n setShowUnchanged(show: boolean): void {\n this.view?.setShowUnchanged(show);\n }\n\n setNavigationVisible(visible: boolean): void {\n this.view?.setNavigationVisible(visible);\n }\n\n setToolbarActions(actions: readonly MdzipDiffToolbarAction[]): void {\n this.view?.setToolbarActions(actions);\n }\n\n private async createView(): Promise<void> {\n const { MdzipDiffView } = await import('@mdzip/editor/diff-view');\n if (this.destroyed) return;\n this.view = new MdzipDiffView(this.hostRef.nativeElement, this.options());\n }\n\n private options(): MdzipDiffViewOptions {\n return {\n before: this.before,\n after: this.after,\n initialPath: this.initialPath,\n showUnchanged: this.showUnchanged,\n navigationVisible: this.navigationVisible,\n controls: this.controls,\n toolbarActions: this.toolbarActions,\n onSelectionChanged: (event) => this.selectionChanged.emit(event),\n onFailed: (error) => this.failed.emit(error)\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AASA;;;;;;;;;;;;;;;;;AAiBG;MAKU,2BAA2B,CAAA;AAJxC,IAAA,WAAA,GAAA;AAKW,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,EAAC,WAA8C,EAAC;AAC5D,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;;QAGnD,IAAA,CAAA,kBAAkB,GAA+B,EAAE;AAoD7D,IAAA;;AA3CC,IAAA,eAAe,CAAC,KAAa,EAAA;QAC3B,MAAM,KAAK,GAAG,CAAC,OAAO,IAAI,CAAC,kBAAkB,KAAK;AAChD,cAAE,CAAC,IAAI,CAAC,kBAAkB;AAC1B,cAAE,IAAI,CA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gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;AAChE,YAAA,QAAQ,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;SAC5C;IACH;+GA7EW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,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;;;;"}
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, MdzipFileActionTarget, MdzipFileCardHelp, MdzipNavigationMode, MdzipConversionAction, MdzipConversionContext, MdzipPackFilesRequest, MdzipPackFilesContext, MdzipMarkdownRenderer, MdzipMarkdownRenderExtension, MdzipEntryRenderer, MdzipFrontMatterOptions, MdzipExternalLinkPolicy, MdzipExtractRequest, MdzipOutlineViewOptions, MdzipWorkspaceChange, MdzipWorkspaceSave, MdzipDocumentChangeEvent, MdzipWorkspaceSnapshot, MdzipColorScheme, MdzipPreviewWidthChoice, MdzipAssetsProgress, MdzipLinkActivatedEvent, MdzipOutlinePosition, MdzipEditorCommand, 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;
@@ -49,8 +54,18 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
49
54
  * clicked (see the view option). Defaults to `true`. Constructor-only.
50
55
  */
51
56
  inlineSvgLinks?: boolean;
57
+ /**
58
+ * Loads every image as soon as the preview mounts, for a preview nobody
59
+ * scrolls, such as an off-screen copy for printing (see the view option).
60
+ * Defaults to `false`. Constructor-only.
61
+ */
62
+ eagerImages?: boolean;
52
63
  /** Extra file tree menu items for files, run by the host (see the view option). Read when the view is created. */
53
64
  hostFileActions?: readonly MdzipFileAction[];
65
+ /** A line for the card of a file the preview can't show (see the view option). Read when the view is created. */
66
+ fileNote?: (file: MdzipFileActionTarget) => string | null;
67
+ /** A help link at the bottom of that card (see the view option). Read when the view is created. */
68
+ fileCardHelp?: MdzipFileCardHelp;
54
69
  navigationMode: MdzipNavigationMode;
55
70
  navigationButtonActive: boolean;
56
71
  /**
@@ -88,6 +103,26 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
88
103
  * Changes re-apply to the mounted preview without a re-render.
89
104
  */
90
105
  externalLinks?: MdzipExternalLinkPolicy;
106
+ /**
107
+ * Writes files taken out of the archive (the contents pane's Extract…), for
108
+ * hosts that can write to disk themselves. With it, the menu says
109
+ * **Extract…** instead of offering browser downloads. An input function,
110
+ * like `onConversionRequested`, because the view waits for it. Read when the
111
+ * view is created.
112
+ */
113
+ onExtractFiles?: (request: MdzipExtractRequest) => void | Promise<void>;
114
+ /**
115
+ * The outline panel: `true` to open it, or options (`visible`, `position`,
116
+ * `width`, `levels`, `collapse`, `label`). `visible` and `position` apply
117
+ * live; the others are read when the view is created.
118
+ */
119
+ outline?: boolean | MdzipOutlineViewOptions;
120
+ /** Shows spaces and tabs in the source editor. Applies live. */
121
+ showWhitespace?: boolean;
122
+ /** How `manifest.json` opens: `'form'` (the default) or `'json'`. Read when the view is created. */
123
+ manifestView?: 'form' | 'json';
124
+ /** The status line under the editor for `.json` files. Defaults to `true`. Read when the view is created. */
125
+ jsonStatus?: boolean;
91
126
  readonly changed: EventEmitter<MdzipWorkspaceChange>;
92
127
  readonly saved: EventEmitter<MdzipWorkspaceSave>;
93
128
  readonly workspaceChanged: EventEmitter<MdzipDocumentChangeEvent>;
@@ -107,12 +142,23 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
107
142
  readonly previewRendered: EventEmitter<MdzipWorkspaceSnapshot>;
108
143
  /** Emits once the mounted preview's images have finished loading. */
109
144
  readonly assetsHydrated: EventEmitter<MdzipWorkspaceSnapshot>;
145
+ readonly assetsProgress: EventEmitter<MdzipAssetsProgress>;
110
146
  /**
111
147
  * Emits for every click on a preview link, before the view's own handling.
112
148
  * Call `event.preventDefault()` in the handler to take over navigation.
113
149
  */
114
150
  readonly linkActivated: EventEmitter<MdzipLinkActivatedEvent>;
115
151
  readonly failed: EventEmitter<unknown>;
152
+ /** Emits when the reader shows or hides the outline from the toolbar. */
153
+ readonly outlineVisibilityChanged: EventEmitter<boolean>;
154
+ /** Emits the outline panel's side when the reader moves it from the toolbar. */
155
+ readonly outlinePositionChanged: EventEmitter<MdzipOutlinePosition>;
156
+ /** Emits the outline panel's width (pixels) when the reader finishes dragging its edge. */
157
+ readonly outlineWidthChanged: EventEmitter<number>;
158
+ /** Emits when the reader shows or hides whitespace from the toolbar. */
159
+ readonly whitespaceVisibilityChanged: EventEmitter<boolean>;
160
+ /** Emits (debounced, while typing) the open `.json` file's validity. */
161
+ readonly jsonValidityChanged: EventEmitter<MdzipJsonValidityChange>;
116
162
  private readonly hostRef;
117
163
  /**
118
164
  * `<ng-template mdzipEntryRenderer>` declarations projected into the
@@ -131,6 +177,16 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
131
177
  canExecuteCommand(command: MdzipEditorCommand): boolean;
132
178
  executeCommand(command: MdzipEditorCommand, file?: File): Promise<boolean>;
133
179
  convertToMdz(): Promise<boolean>;
180
+ /** Shows or hides the outline panel (without emitting `outlineVisibilityChanged`). */
181
+ setOutlineVisible(visible: boolean): void;
182
+ /** Puts the outline panel on the left or the right of the document. */
183
+ setOutlinePosition(position: MdzipOutlinePosition): void;
184
+ /** Switches to Edit (`'source'`), Split or View (`'preview'`), as the toolbar's buttons do. */
185
+ setLayout(layout: MdzipWorkspaceLayout): Promise<void>;
186
+ /** The archive's files as `{ path, bytes }`, by file or folder path (see the view's `extractFiles()`). */
187
+ extractFiles(paths: readonly string[], options?: {
188
+ includeFolders?: boolean;
189
+ }): Promise<MdzipExtractedFile[]>;
134
190
  focus(): void;
135
191
  setColorScheme(scheme: MdzipColorSchemePreference): void;
136
192
  flush(): Promise<MdzipEditorSnapshot | null>;
@@ -147,6 +203,8 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
147
203
  markPersisted(): void;
148
204
  addAsset(archivePath: string, fileBytes: Uint8Array): Promise<void>;
149
205
  replaceAsset(archivePath: string, fileBytes: Uint8Array): Promise<boolean>;
206
+ /** Asks the file actions' labels and `fileNote` again (see the view's `refreshFileActions()`). */
207
+ refreshFileActions(): void;
150
208
  removeAsset(archivePath: string, options?: MdzipRemoveAssetOptions): Promise<boolean>;
151
209
  removeFile(archivePath: string): Promise<boolean>;
152
210
  renameFile(oldPath: string, newPath: string): Promise<boolean>;
@@ -162,7 +220,7 @@ declare class MdzipWorkspaceComponent implements AfterContentInit, AfterViewInit
162
220
  private composedEntryRenderers;
163
221
  private applyRenderingOptions;
164
222
  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>;
223
+ 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; }; "eagerImages": { "alias": "eagerImages"; "required": false; }; "hostFileActions": { "alias": "hostFileActions"; "required": false; }; "fileNote": { "alias": "fileNote"; "required": false; }; "fileCardHelp": { "alias": "fileCardHelp"; "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"; "assetsProgress": "assetsProgress"; "linkActivated": "linkActivated"; "failed": "failed"; "outlineVisibilityChanged": "outlineVisibilityChanged"; "outlinePositionChanged": "outlinePositionChanged"; "outlineWidthChanged": "outlineWidthChanged"; "whitespaceVisibilityChanged": "whitespaceVisibilityChanged"; "jsonValidityChanged": "jsonValidityChanged"; }, ["entryTemplates"], never, true, never>;
166
224
  }
167
225
 
168
226
  /** Template context available via `let-context` (also the `$implicit` value). */
@@ -234,5 +292,5 @@ declare class MdzipDiffComponent implements AfterViewInit, OnChanges, OnDestroy
234
292
  }
235
293
 
236
294
  export { MdzipDiffComponent, MdzipEntryRendererDirective, MdzipWorkspaceComponent };
237
- export type { MdzipEntryRendererTemplateContext };
295
+ export type { MdzipEntryRendererTemplateContext, MdzipJsonValidityChange };
238
296
  //# 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;;;AAGG;;;AAGM,+BAA2B,eAAe;oBAC1B,mBAAmB;AACnC;AACT;;;;AAIG;AACM,qCACC,qBAAqB,WACpB,sBAAsB,eAClB,OAAO;AACtB;;;;AAIG;AACM,gCACE,qBAAqB,WACrB,qBAAqB,eACjB,OAAO;AACtB;;;AAGG;uBACyB,qBAAqB;;AAExC,iCAA6B,4BAA4B;;AAEzD,6BAAyB,kBAAkB;AACpD;;;;;;AAMG;iBACmB,uBAAuB;AAC7C;;;;AAIG;oBACsB,uBAAuB;sBACtB,YAAA,CAAA,oBAAA;oBACF,YAAA,CAAA,kBAAA;+BACW,YAAA,CAAA,wBAAA;8BACD,YAAA,CAAA,wBAAA;2BACH,YAAA,CAAA,wBAAA;8BACG,YAAA,CAAA,wBAAA;8BACA,YAAA,CAAA,sBAAA;+BACC,YAAA,CAAA,sBAAA;2BACJ,YAAA,CAAA,sBAAA;gCACK,YAAA,CAAA,sBAAA;iCACC,YAAA,CAAA,gBAAA;;2CAEU,YAAA,CAAA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AEN;;;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":";;;;;AAsEA;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;yBACjB,uBAAuB;uBACzB,qBAAqB;oBACxB,oBAAoB;yBACf,0BAA0B;;sBAE7B,oBAAoB;;wBAElB,sBAAsB;AACnD;;;;;AAKG;;AAEH;;;AAGG;;AAEH;;;;AAIG;;;AAGM,+BAA2B,eAAe;;sBAExB,qBAAqB;;mBAExB,iBAAiB;oBAChB,mBAAmB;AACnC;AACT;;;;AAIG;AACM,qCACC,qBAAqB,WACpB,sBAAsB,eAClB,OAAO;AACtB;;;;AAIG;AACM,gCACE,qBAAqB,WACrB,qBAAqB,eACjB,OAAO;AACtB;;;AAGG;uBACyB,qBAAqB;;AAExC,iCAA6B,4BAA4B;;AAEzD,6BAAyB,kBAAkB;AACpD;;;;;;AAMG;iBACmB,uBAAuB;AAC7C;;;;AAIG;oBACsB,uBAAuB;AAChD;;;;;;AAMG;AACM,+BAA2B,mBAAmB,YAAY,OAAO;AAC1E;;;;AAIG;AACM,wBAAoB,uBAAuB;;;;AAI3C;;;sBAGiB,YAAA,CAAA,oBAAA;o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B;+CAIY,OAAO;kBAIpC,iBAAiB;AAI/B;AAqBA;AAqEA;AAUA;yCA1dW,uBAAuB;2CAAvB,uBAAuB;AAwenC;;AC1kBD;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":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdzip/editor-ng",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "Angular wrapper for the MDZip workspace editor.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "peerDependencies": {
30
30
  "@angular/common": ">=20.0.0",
31
31
  "@angular/core": ">=20.0.0",
32
- "@mdzip/editor": "^2.5.0"
32
+ "@mdzip/editor": "^2.6.0"
33
33
  },
34
34
  "dependencies": {
35
35
  "tslib": "^2.8.1"