@mdzip/editor-react 2.4.1 → 2.5.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 +211 -214
- package/dist/package-info.d.ts +1 -1
- package/dist/package-info.js +1 -1
- package/package.json +51 -51
package/README.md
CHANGED
|
@@ -1,214 +1,211 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
|
83
|
-
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
| `
|
|
96
|
-
| `
|
|
97
|
-
| `
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
100
|
-
| `
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
|
138
|
-
|
|
139
|
-
| `
|
|
140
|
-
| `
|
|
141
|
-
| `
|
|
142
|
-
| `
|
|
143
|
-
| `
|
|
144
|
-
| `
|
|
145
|
-
| `
|
|
146
|
-
| `
|
|
147
|
-
| `
|
|
148
|
-
| `
|
|
149
|
-
| `
|
|
150
|
-
| `
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
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-react
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@mdzip/editor-react)
|
|
6
|
+
[](https://github.com/mdzip-project/mdzip-editor/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
React component wrapper for the MDZip workspace editor.
|
|
9
|
+
|
|
10
|
+
`@mdzip/editor-react` provides a `MdzipWorkspace` component that embeds the full MDZip workspace UI — document preview, editor, package navigator, and asset manager — as a native React component.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install @mdzip/editor-react
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Peer dependencies: `react` and `react-dom` >=18.
|
|
19
|
+
|
|
20
|
+
## Basic Usage
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { MdzipWorkspace } from '@mdzip/editor-react';
|
|
24
|
+
|
|
25
|
+
export function Viewer({ bytes }: { bytes: Uint8Array }) {
|
|
26
|
+
return (
|
|
27
|
+
<div style={{ height: 600 }}>
|
|
28
|
+
<MdzipWorkspace
|
|
29
|
+
bytes={bytes}
|
|
30
|
+
fileName="document.mdz"
|
|
31
|
+
mode="read-only"
|
|
32
|
+
controls="viewer"
|
|
33
|
+
onFailed={console.error}
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The parent element must have an explicit height. The component expands to fill it.
|
|
41
|
+
|
|
42
|
+
## Archive Diff
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { MdzipDiff } from '@mdzip/editor-react/diff-view';
|
|
46
|
+
|
|
47
|
+
<div style={{ height: 600 }}>
|
|
48
|
+
<MdzipDiff
|
|
49
|
+
before={{ bytes: baseBytes, label: 'Git base' }}
|
|
50
|
+
after={{ bytes: workingBytes, label: 'Working tree' }}
|
|
51
|
+
initialPath="index.md"
|
|
52
|
+
toolbarActions={[{ id: 'refresh', label: 'Refresh', icon: 'refresh', run: refresh }]}
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`MdzipDiff` is read-only and updates the existing comparison view when its
|
|
58
|
+
props change. A ref exposes `openPath`, `openPreviousChange`, `openNextChange`,
|
|
59
|
+
`setShowUnchanged`, `setNavigationVisible`, and `setToolbarActions`. The
|
|
60
|
+
built-in toolbar adds Previous/Next change buttons and a Show-unchanged
|
|
61
|
+
toggle; pass a `controls` prop (`{ navigation?, changeTraversal?,
|
|
62
|
+
showUnchanged? }`) to opt any of them out.
|
|
63
|
+
|
|
64
|
+
## Editor Mode
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
<MdzipWorkspace
|
|
68
|
+
bytes={bytes}
|
|
69
|
+
fileName="document.mdz"
|
|
70
|
+
mode="editable"
|
|
71
|
+
controls="standalone-editor"
|
|
72
|
+
onSaved={({ bytes }) => persist(bytes)}
|
|
73
|
+
onChanged={({ bytes }) => setDirty(true)}
|
|
74
|
+
/>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Props
|
|
78
|
+
|
|
79
|
+
| Prop | Type | Default | Description |
|
|
80
|
+
|------|------|---------|-------------|
|
|
81
|
+
| `bytes` | `Uint8Array \| null` | — | Raw archive bytes to open |
|
|
82
|
+
| `workspace` | `MdzWorkspace \| null` | — | Pre-built workspace object |
|
|
83
|
+
| `fileName` | `string` | `'document.mdz'` | Filename used for format detection and Save dialogs |
|
|
84
|
+
| `mode` | `MdzipWorkspaceMode` | `'read-only'` | `'read-only'` or `'editable'` |
|
|
85
|
+
| `sourceFormat` | `MdzipSourceFormat` | — | Override format detection: `'mdz'` or `'markdown'` |
|
|
86
|
+
| `controls` | `MdzipControlPreset \| MdzipControlPolicy` | `'viewer'` | `'preview'`, `'viewer'`, `'standalone-editor'`, `'hosted-editor'`, or a policy object |
|
|
87
|
+
| `toolbarDensity` | `'comfortable' \| 'compact' \| 'dense'` | `'comfortable'` | Semantic sizing preset for built-in toolbar controls |
|
|
88
|
+
| `contentDensity` | `'comfortable' \| 'compact'` | `'comfortable'` | Semantic padding preset for editor and preview content |
|
|
89
|
+
| `imageHydrationAnimation` | `'auto' \| 'initial' \| 'off'` | `'auto'` | Control preview image reveal animation: every render, first render per document path, or never |
|
|
90
|
+
| `initialLayout` | `MdzipWorkspaceLayout` | — | Starting layout: `'preview'`, `'editor'`, `'split'` |
|
|
91
|
+
| `initialColorScheme` | `MdzipColorSchemePreference` | `'system'` | `'light'`, `'dark'` or `'system'` (follows the OS setting live) |
|
|
92
|
+
| `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 |
|
|
93
|
+
| `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 |
|
|
94
|
+
| `navigationMode` | `MdzipNavigationMode` | — | Package navigation mode |
|
|
95
|
+
| `navigationButtonActive` | `boolean` | — | Whether the navigation button is shown |
|
|
96
|
+
| `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 |
|
|
97
|
+
| `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 |
|
|
98
|
+
| `markdownRenderer` | `MdzipMarkdownRenderer` | — | Custom markdown renderer (keep the reference stable, e.g. `useMemo`) |
|
|
99
|
+
| `markdownExtensions` | `readonly MdzipMarkdownRenderExtension[]` | `[]` | Markdown pipeline extensions, diffed by `name` — inline arrays are safe |
|
|
100
|
+
| `entryRenderers` | `readonly MdzipEntryRenderer[]` | `[]` | Entry renderers claiming the content area for matching entries, diffed by `id` — inline arrays are safe |
|
|
101
|
+
| `renderEntry` | `(context) => ReactNode \| undefined` | — | Catch-all entry renderer: return a node to claim the selected entry, `undefined` to delegate |
|
|
102
|
+
| `renderEntryPriority` | `number` | `0` | Matching priority of `renderEntry` relative to `entryRenderers` |
|
|
103
|
+
| `frontMatter` | `MdzipFrontMatterOptions` | `{}` | Front matter panel config (`enabled`, `display`, `collapsible`, `label`) — always registered, diffed by deep equality; inline objects are safe |
|
|
104
|
+
| `externalLinks` | `MdzipExternalLinkPolicy` | — | External-link policy, e.g. `{ target: '_blank' }` (adds `rel="noopener noreferrer"`); optional `rel` and `predicate(href)`. Re-applies without a re-render only when `target`, `rel` or `predicate` change; inline objects are safe |
|
|
105
|
+
|
|
106
|
+
`controls`, density, `imageHydrationAnimation`, and rendering prop changes apply in
|
|
107
|
+
place — they never recreate the workspace view. Line-number visibility changes
|
|
108
|
+
preserve the current CodeMirror document and selection. See the `@mdzip/editor`
|
|
109
|
+
Rendering Extensibility docs for the contracts and lifecycle rules.
|
|
110
|
+
|
|
111
|
+
### Native entry rendering
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
<MdzipWorkspace
|
|
115
|
+
bytes={bytes}
|
|
116
|
+
renderEntry={(context) =>
|
|
117
|
+
context.path.toLowerCase() === 'manifest.json'
|
|
118
|
+
? <ManifestEditor
|
|
119
|
+
manifest={context.manifest}
|
|
120
|
+
editable={context.mode === 'editable'}
|
|
121
|
+
onManifestChange={context.updateManifest}
|
|
122
|
+
/>
|
|
123
|
+
: undefined}
|
|
124
|
+
/>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The wrapper owns the React root: it mounts when the entry is claimed,
|
|
128
|
+
re-renders on context updates and on every parent commit (entry content
|
|
129
|
+
stays live with parent state — inline closures are safe and never
|
|
130
|
+
re-mount), and unmounts on selection change.
|
|
131
|
+
|
|
132
|
+
## Callbacks
|
|
133
|
+
|
|
134
|
+
| Prop | Signature | Description |
|
|
135
|
+
|------|-----------|-------------|
|
|
136
|
+
| `onChanged` | `(event: MdzipWorkspaceChange) => void` | Called when archive bytes change |
|
|
137
|
+
| `onSaved` | `(event: MdzipWorkspaceSave) => void` | Called on Save |
|
|
138
|
+
| `onSnapshotChanged` | `(snapshot: MdzipWorkspaceSnapshot) => void` | Called on any state change |
|
|
139
|
+
| `onSelectionChanged` | `(snapshot: MdzipWorkspaceSnapshot) => void` | Called when the editor selection changes |
|
|
140
|
+
| `onDirtyChanged` | `(snapshot: MdzipWorkspaceSnapshot) => void` | Called when the dirty flag changes |
|
|
141
|
+
| `onValidationChanged` | `(snapshot: MdzipWorkspaceSnapshot) => void` | Called when validation state changes |
|
|
142
|
+
| `onColorSchemeChanged` | `(colorScheme: MdzipColorScheme) => void` | Called when the color scheme changes |
|
|
143
|
+
| `onColorSchemePreferenceChanged` | `(preference: MdzipColorSchemePreference) => void` | Called when the user picks Light, Dark or System in the toolbar menu |
|
|
144
|
+
| `onPreviewWidthChanged` | `(width: MdzipPreviewWidthChoice) => void` | Called when the user picks a width in the toolbar's page-width menu |
|
|
145
|
+
| `onPreviewRendered` | `(snapshot: MdzipWorkspaceSnapshot) => void` | Called when the preview HTML is mounted |
|
|
146
|
+
| `onAssetsHydrated` | `(snapshot: MdzipWorkspaceSnapshot) => void` | Called once the mounted preview's images have loaded |
|
|
147
|
+
| `onLinkActivated` | `(event: MdzipLinkActivatedEvent) => void` | Called for every preview link click before built-in handling; call `event.preventDefault()` to take over |
|
|
148
|
+
| `onFailed` | `(error: unknown) => void` | Called on unrecoverable errors |
|
|
149
|
+
| `onConversionRequested` | `(action: MdzipConversionAction) => boolean \| Promise<boolean>` | Host hook for the markdown→MDZ conversion flow (nav button, Insert Image, or image paste on a plain `.md`). Return/resolve `true` to take over and suppress the built-in conversion dialog |
|
|
150
|
+
| `onPackRequested` | `(request: MdzipPackFilesRequest, context: MdzipPackFilesContext) => boolean \| Promise<boolean>` | Host hook for the folder→.mdz packing decision surfaced by the `packFilesAsWorkspace(files, options)` ref method — fires only when the file list contains more than one Markdown file. Same return contract as `onConversionRequested` |
|
|
151
|
+
|
|
152
|
+
## Image insertion
|
|
153
|
+
|
|
154
|
+
Use `imageInsertMode="markdown"`, `"ask"`, or `"html"` for the built-in image
|
|
155
|
+
markup flow. Pass `imageInsertHandler` for host-owned image UI; the handler can
|
|
156
|
+
return Markdown or HTML sizing/alignment settings, return `null` to cancel, or
|
|
157
|
+
return `undefined` to fall back to `imageInsertMode`.
|
|
158
|
+
|
|
159
|
+
Pass `imageEditHandler` to let users edit an *existing* image by clicking it.
|
|
160
|
+
Fully opt-in — with no handler, clicking an image does nothing and no edit
|
|
161
|
+
affordance appears; there is no built-in fallback dialog.
|
|
162
|
+
|
|
163
|
+
## File management (nav pane)
|
|
164
|
+
|
|
165
|
+
With `controls="standalone-editor"` or `"hosted-editor"` (or `fileActions: true` in a custom
|
|
166
|
+
policy), the navigation pane offers a right-click context menu: new `.md` file, new folder,
|
|
167
|
+
rename/move, duplicate, replace, download, copy markdown link, set entry point, set cover
|
|
168
|
+
image, and delete. Files can also be dragged between folders, and OS files can be dropped
|
|
169
|
+
onto the pane to add them as assets. Copy and Download remain available in read-only mode.
|
|
170
|
+
The same operations are exposed imperatively: `removeFile`, `renameFile`, `setEntryPoint`,
|
|
171
|
+
and `setCoverImage` on the handle. The handle also exposes `whenRendered()`, which resolves
|
|
172
|
+
once the current preview (including its images) is mounted — useful for revealing or
|
|
173
|
+
animating read-only preview content.
|
|
174
|
+
|
|
175
|
+
## Links and anchors
|
|
176
|
+
|
|
177
|
+
`onLinkActivated` fires for every preview link click, before the view's own handling, with the
|
|
178
|
+
parsed link (`kind`: `'anchor' | 'document' | 'relative' | 'external'`, plus `path`,
|
|
179
|
+
`anchor`, `targetPath`, `sourcePath`, modifier keys). Call `event.preventDefault()` in the
|
|
180
|
+
handler to route the link yourself; unprevented clicks keep the built-in behavior.
|
|
181
|
+
The handle also exposes `scrollToAnchor(anchor)` (waits for the preview to mount, resolves whether it
|
|
182
|
+
scrolled; safe straight after load), `getAvailableAnchors()`, `openPath(path, { anchor })` (opens another
|
|
183
|
+
file, optionally at an anchor) and `getCurrentPath()`. Changing only `fileName` (e.g. after Save As)
|
|
184
|
+
renames in place without reopening; set `preserveSelectionOnReopen` to stay on the current file when
|
|
185
|
+
the archive content changes. See the
|
|
186
|
+
[`@mdzip/editor` README](https://www.npmjs.com/package/@mdzip/editor#links-and-anchors).
|
|
187
|
+
|
|
188
|
+
## Imperative API
|
|
189
|
+
|
|
190
|
+
Use a `ref` to access the imperative handle:
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
import { useRef } from 'react';
|
|
194
|
+
import { MdzipWorkspace, type MdzipWorkspaceHandle } from '@mdzip/editor-react';
|
|
195
|
+
|
|
196
|
+
const ref = useRef<MdzipWorkspaceHandle>(null);
|
|
197
|
+
|
|
198
|
+
// Flush pending edits and persist
|
|
199
|
+
const snapshot = await ref.current?.flush();
|
|
200
|
+
if (snapshot) {
|
|
201
|
+
await save(snapshot.bytes);
|
|
202
|
+
ref.current?.markPersisted();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Execute editor commands
|
|
206
|
+
await ref.current?.executeCommand('bold');
|
|
207
|
+
|
|
208
|
+
return <MdzipWorkspace ref={ref} ... />;
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
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/package-info.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const PACKAGE_INFO: {
|
|
2
2
|
readonly name: "@mdzip/editor-react";
|
|
3
|
-
readonly version: "2.
|
|
3
|
+
readonly version: "2.5.0";
|
|
4
4
|
readonly repositoryUrl: "https://github.com/mdzip-project/mdzip-editor/tree/main/packages/editor-react";
|
|
5
5
|
readonly description: "React wrapper for the MDZip workspace editor.";
|
|
6
6
|
};
|
package/dist/package-info.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Generated from package.json. Do not edit by hand.
|
|
2
2
|
export const PACKAGE_INFO = {
|
|
3
3
|
"name": "@mdzip/editor-react",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0",
|
|
5
5
|
"repositoryUrl": "https://github.com/mdzip-project/mdzip-editor/tree/main/packages/editor-react",
|
|
6
6
|
"description": "React wrapper for the MDZip workspace editor."
|
|
7
7
|
};
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@mdzip/editor-react",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "React wrapper for the MDZip workspace editor.",
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/mdzip-project/mdzip-editor.git",
|
|
9
|
-
"directory": "packages/editor-react"
|
|
10
|
-
},
|
|
11
|
-
"homepage": "https://mdzip.org",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/mdzip-project/mdzip-editor/issues"
|
|
14
|
-
},
|
|
15
|
-
"type": "module",
|
|
16
|
-
"main": "dist/index.js",
|
|
17
|
-
"types": "dist/index.d.ts",
|
|
18
|
-
"exports": {
|
|
19
|
-
".": {
|
|
20
|
-
"types": "./dist/index.d.ts",
|
|
21
|
-
"import": "./dist/index.js"
|
|
22
|
-
},
|
|
23
|
-
"./diff-view": {
|
|
24
|
-
"types": "./dist/diff-view.d.ts",
|
|
25
|
-
"import": "./dist/diff-view.js"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"files": [
|
|
29
|
-
"dist"
|
|
30
|
-
],
|
|
31
|
-
"scripts": {
|
|
32
|
-
"generate:package-info": "node ../../scripts/generate-package-info.mjs",
|
|
33
|
-
"prebuild": "npm run generate:package-info",
|
|
34
|
-
"build": "tsc -p tsconfig.json",
|
|
35
|
-
"test": "vitest run"
|
|
36
|
-
},
|
|
37
|
-
"dependencies": {
|
|
38
|
-
"@mdzip/editor": "^2.
|
|
39
|
-
},
|
|
40
|
-
"peerDependencies": {
|
|
41
|
-
"react": ">=18.0.0",
|
|
42
|
-
"react-dom": ">=18.0.0"
|
|
43
|
-
},
|
|
44
|
-
"devDependencies": {
|
|
45
|
-
"@types/react": "^19.1.6",
|
|
46
|
-
"@types/react-dom": "^19.1.5"
|
|
47
|
-
},
|
|
48
|
-
"publishConfig": {
|
|
49
|
-
"access": "public"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@mdzip/editor-react",
|
|
3
|
+
"version": "2.5.0",
|
|
4
|
+
"description": "React wrapper for the MDZip workspace editor.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/mdzip-project/mdzip-editor.git",
|
|
9
|
+
"directory": "packages/editor-react"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://mdzip.org",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/mdzip-project/mdzip-editor/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "dist/index.js",
|
|
17
|
+
"types": "dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./diff-view": {
|
|
24
|
+
"types": "./dist/diff-view.d.ts",
|
|
25
|
+
"import": "./dist/diff-view.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"generate:package-info": "node ../../scripts/generate-package-info.mjs",
|
|
33
|
+
"prebuild": "npm run generate:package-info",
|
|
34
|
+
"build": "tsc -p tsconfig.json",
|
|
35
|
+
"test": "vitest run"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@mdzip/editor": "^2.5.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"react": ">=18.0.0",
|
|
42
|
+
"react-dom": ">=18.0.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/react": "^19.1.6",
|
|
46
|
+
"@types/react-dom": "^19.1.5"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
}
|
|
51
|
+
}
|