@mdzip/editor-vue 1.3.1 → 1.3.11
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 +63 -0
- package/dist/diff-view.d.ts +77 -0
- package/dist/diff-view.d.ts.map +1 -0
- package/dist/diff-view.js +61 -0
- package/dist/diff-view.js.map +1 -0
- package/dist/index.d.ts +64 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +130 -2
- package/dist/index.js.map +1 -1
- package/dist/package-info.d.ts +7 -0
- package/dist/package-info.d.ts.map +1 -0
- package/dist/package-info.js +8 -0
- package/dist/package-info.js.map +1 -0
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
[![MDZip logo][mdzip-logo]][mdzip-url]
|
|
2
|
+
|
|
3
|
+
[mdzip-logo]: https://raw.githubusercontent.com/mdzip-project/mdzip-editor/main/resources/mdzip-mark.svg
|
|
4
|
+
[mdzip-url]: https://mdzip.org
|
|
5
|
+
|
|
1
6
|
# @mdzip/editor-vue
|
|
2
7
|
|
|
3
8
|
Vue 3 component wrapper for the MDZip workspace editor.
|
|
@@ -36,6 +41,31 @@ const props = defineProps<{ bytes: Uint8Array }>();
|
|
|
36
41
|
|
|
37
42
|
The parent element must have an explicit height. The component expands to fill it.
|
|
38
43
|
|
|
44
|
+
## Archive Diff
|
|
45
|
+
|
|
46
|
+
```vue
|
|
47
|
+
<script setup lang="ts">
|
|
48
|
+
import { MdzipDiff } from '@mdzip/editor-vue/diff-view';
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<div style="height: 600px">
|
|
53
|
+
<MdzipDiff
|
|
54
|
+
:before="{ bytes: baseBytes, label: 'Git base' }"
|
|
55
|
+
:after="{ bytes: workingBytes, label: 'Working tree' }"
|
|
56
|
+
initial-path="index.md"
|
|
57
|
+
:toolbar-actions="[{ id: 'refresh', label: 'Refresh', icon: 'refresh', run: refresh }]"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The component emits `selectionChanged` and `failed`. Its exposed handle
|
|
64
|
+
provides `openPath`, `openPreviousChange`, `openNextChange`, `setShowUnchanged`,
|
|
65
|
+
`setNavigationVisible`, and `setToolbarActions`. The built-in toolbar adds
|
|
66
|
+
Previous/Next change buttons and a Show-unchanged toggle; pass a `controls`
|
|
67
|
+
prop (`{ navigation?, changeTraversal?, showUnchanged? }`) to opt any out.
|
|
68
|
+
|
|
39
69
|
## Editor Mode
|
|
40
70
|
|
|
41
71
|
```vue
|
|
@@ -63,6 +93,34 @@ The parent element must have an explicit height. The component expands to fill i
|
|
|
63
93
|
| `initialColorScheme` | `MdzipColorScheme` | — | `'light'` or `'dark'` |
|
|
64
94
|
| `navigationMode` | `MdzipNavigationMode` | `'editor'` | Package navigation mode |
|
|
65
95
|
| `navigationButtonActive` | `boolean` | `true` | Whether the navigation button is shown |
|
|
96
|
+
| `markdownRenderer` | `MdzipMarkdownRenderer \| null` | `null` | Custom markdown renderer (keep the reference stable) |
|
|
97
|
+
| `markdownExtensions` | `readonly MdzipMarkdownRenderExtension[]` | `[]` | Markdown pipeline extensions, diffed by `name` — inline arrays are safe |
|
|
98
|
+
| `entryRenderers` | `readonly MdzipEntryRenderer[]` | `[]` | Entry renderers claiming the content area for matching entries, diffed by `id` — inline arrays are safe |
|
|
99
|
+
| `entrySlotPriority` | `number` | `0` | Matching priority of the `#entry` slot relative to `entryRenderers` |
|
|
100
|
+
|
|
101
|
+
Rendering prop changes apply in place — they never recreate the workspace
|
|
102
|
+
view. See the `@mdzip/editor` Rendering Extensibility docs for the contracts
|
|
103
|
+
and lifecycle rules.
|
|
104
|
+
|
|
105
|
+
### Native entry rendering (`#entry` slot)
|
|
106
|
+
|
|
107
|
+
```vue
|
|
108
|
+
<MdzipWorkspace :bytes="bytes">
|
|
109
|
+
<template #entry="{ context }">
|
|
110
|
+
<ManifestEditor
|
|
111
|
+
v-if="context.path.toLowerCase() === 'manifest.json'"
|
|
112
|
+
:manifest="context.manifest"
|
|
113
|
+
:editable="context.mode === 'editable'"
|
|
114
|
+
@manifest-change="context.updateManifest"
|
|
115
|
+
/>
|
|
116
|
+
</template>
|
|
117
|
+
</MdzipWorkspace>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
A slot render that produces no content (its `v-if` is false) delegates to
|
|
121
|
+
`entryRenderers` and the built-in rendering. The slot mounts in a detached
|
|
122
|
+
tree sharing the host app context (plugins, provide/inject); the context is
|
|
123
|
+
reactive, and the tree unmounts on selection change.
|
|
66
124
|
|
|
67
125
|
## Events
|
|
68
126
|
|
|
@@ -75,6 +133,8 @@ The parent element must have an explicit height. The component expands to fill i
|
|
|
75
133
|
| `dirtyChanged` | `MdzipWorkspaceSnapshot` | Emitted when the dirty flag changes |
|
|
76
134
|
| `validationChanged` | `MdzipWorkspaceSnapshot` | Emitted when validation state changes |
|
|
77
135
|
| `colorSchemeChanged` | `MdzipColorScheme` | Emitted when the color scheme changes |
|
|
136
|
+
| `previewRendered` | `MdzipWorkspaceSnapshot` | Emitted when the preview HTML is mounted |
|
|
137
|
+
| `assetsHydrated` | `MdzipWorkspaceSnapshot` | Emitted once the mounted preview's images have loaded |
|
|
78
138
|
| `failed` | `unknown` | Emitted on unrecoverable errors |
|
|
79
139
|
|
|
80
140
|
## Conversion hook
|
|
@@ -118,4 +178,7 @@ async function save() {
|
|
|
118
178
|
</template>
|
|
119
179
|
```
|
|
120
180
|
|
|
181
|
+
The handle also exposes `whenRendered()`, which resolves once the current preview (including
|
|
182
|
+
its images) is mounted — useful for revealing or animating read-only preview content.
|
|
183
|
+
|
|
121
184
|
See the [`@mdzip/editor`](https://www.npmjs.com/package/@mdzip/editor) package for the full API reference, theming guide, and framework-agnostic usage.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type MdzipDiffControlsOptions, type MdzipDiffSelectionEvent, type MdzipDiffSideInput, type MdzipDiffToolbarAction } from '@mdzip/editor/diff-view';
|
|
3
|
+
export interface MdzipDiffExposed {
|
|
4
|
+
openPath(path: string): Promise<boolean>;
|
|
5
|
+
openPreviousChange(): Promise<boolean>;
|
|
6
|
+
openNextChange(): Promise<boolean>;
|
|
7
|
+
setShowUnchanged(show: boolean): void;
|
|
8
|
+
setNavigationVisible(visible: boolean): void;
|
|
9
|
+
setToolbarActions(actions: readonly MdzipDiffToolbarAction[]): void;
|
|
10
|
+
}
|
|
11
|
+
export declare const MdzipDiff: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
12
|
+
before: {
|
|
13
|
+
type: PropType<MdzipDiffSideInput>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
after: {
|
|
17
|
+
type: PropType<MdzipDiffSideInput>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
initialPath: StringConstructor;
|
|
21
|
+
showUnchanged: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
navigationVisible: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
controls: {
|
|
30
|
+
type: PropType<MdzipDiffControlsOptions>;
|
|
31
|
+
default: undefined;
|
|
32
|
+
};
|
|
33
|
+
toolbarActions: {
|
|
34
|
+
type: PropType<readonly MdzipDiffToolbarAction[]>;
|
|
35
|
+
default: () => never[];
|
|
36
|
+
};
|
|
37
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
40
|
+
selectionChanged: (_event: MdzipDiffSelectionEvent) => true;
|
|
41
|
+
failed: (_error: Error) => true;
|
|
42
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
43
|
+
before: {
|
|
44
|
+
type: PropType<MdzipDiffSideInput>;
|
|
45
|
+
required: true;
|
|
46
|
+
};
|
|
47
|
+
after: {
|
|
48
|
+
type: PropType<MdzipDiffSideInput>;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
initialPath: StringConstructor;
|
|
52
|
+
showUnchanged: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
navigationVisible: {
|
|
57
|
+
type: BooleanConstructor;
|
|
58
|
+
default: boolean;
|
|
59
|
+
};
|
|
60
|
+
controls: {
|
|
61
|
+
type: PropType<MdzipDiffControlsOptions>;
|
|
62
|
+
default: undefined;
|
|
63
|
+
};
|
|
64
|
+
toolbarActions: {
|
|
65
|
+
type: PropType<readonly MdzipDiffToolbarAction[]>;
|
|
66
|
+
default: () => never[];
|
|
67
|
+
};
|
|
68
|
+
}>> & Readonly<{
|
|
69
|
+
onSelectionChanged?: ((_event: MdzipDiffSelectionEvent) => any) | undefined;
|
|
70
|
+
onFailed?: ((_error: Error) => any) | undefined;
|
|
71
|
+
}>, {
|
|
72
|
+
showUnchanged: boolean;
|
|
73
|
+
navigationVisible: boolean;
|
|
74
|
+
controls: MdzipDiffControlsOptions;
|
|
75
|
+
toolbarActions: readonly MdzipDiffToolbarAction[];
|
|
76
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
77
|
+
//# sourceMappingURL=diff-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-view.d.ts","sourceRoot":"","sources":["../src/diff-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,QAAQ,EACd,MAAM,KAAK,CAAC;AACb,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC5B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7C,iBAAiB,CAAC,OAAO,EAAE,SAAS,sBAAsB,EAAE,GAAG,IAAI,CAAC;CACrE;AAED,eAAO,MAAM,SAAS;;cAGQ,QAAQ,CAAC,kBAAkB,CAAC;;;;cAC7B,QAAQ,CAAC,kBAAkB,CAAC;;;;;;;;;;;;;cAIzB,QAAQ,CAAC,wBAAwB,CAAC;;;;cAC7B,QAAQ,CAAC,SAAS,sBAAsB,EAAE,CAAC;;;;;;+BAGjD,uBAAuB;qBACjC,KAAK;;;cAVI,QAAQ,CAAC,kBAAkB,CAAC;;;;cAC7B,QAAQ,CAAC,kBAAkB,CAAC;;;;;;;;;;;;;cAIzB,QAAQ,CAAC,wBAAwB,CAAC;;;;cAC7B,QAAQ,CAAC,SAAS,sBAAsB,EAAE,CAAC;;;;;;;;;;;4EAuD9E,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { defineComponent, h, onMounted, onUnmounted, ref, watch } from 'vue';
|
|
2
|
+
import { MdzipDiffView } from '@mdzip/editor/diff-view';
|
|
3
|
+
export const MdzipDiff = defineComponent({
|
|
4
|
+
name: 'MdzipDiff',
|
|
5
|
+
props: {
|
|
6
|
+
before: { type: Object, required: true },
|
|
7
|
+
after: { type: Object, required: true },
|
|
8
|
+
initialPath: String,
|
|
9
|
+
showUnchanged: { type: Boolean, default: true },
|
|
10
|
+
navigationVisible: { type: Boolean, default: true },
|
|
11
|
+
controls: { type: Object, default: undefined },
|
|
12
|
+
toolbarActions: { type: Array, default: () => [] }
|
|
13
|
+
},
|
|
14
|
+
emits: {
|
|
15
|
+
selectionChanged: (_event) => true,
|
|
16
|
+
failed: (_error) => true
|
|
17
|
+
},
|
|
18
|
+
setup(props, { emit, expose }) {
|
|
19
|
+
const hostRef = ref(null);
|
|
20
|
+
let view = null;
|
|
21
|
+
const options = () => ({
|
|
22
|
+
before: props.before,
|
|
23
|
+
after: props.after,
|
|
24
|
+
initialPath: props.initialPath,
|
|
25
|
+
showUnchanged: props.showUnchanged,
|
|
26
|
+
navigationVisible: props.navigationVisible,
|
|
27
|
+
controls: props.controls,
|
|
28
|
+
toolbarActions: props.toolbarActions,
|
|
29
|
+
onSelectionChanged: (event) => emit('selectionChanged', event),
|
|
30
|
+
onFailed: (error) => emit('failed', error)
|
|
31
|
+
});
|
|
32
|
+
expose({
|
|
33
|
+
openPath: (path) => view?.openPath(path) ?? Promise.resolve(false),
|
|
34
|
+
openPreviousChange: () => view?.openPreviousChange() ?? Promise.resolve(false),
|
|
35
|
+
openNextChange: () => view?.openNextChange() ?? Promise.resolve(false),
|
|
36
|
+
setShowUnchanged: (show) => view?.setShowUnchanged(show),
|
|
37
|
+
setNavigationVisible: (visible) => view?.setNavigationVisible(visible),
|
|
38
|
+
setToolbarActions: (actions) => view?.setToolbarActions(actions)
|
|
39
|
+
});
|
|
40
|
+
onMounted(() => {
|
|
41
|
+
if (!hostRef.value)
|
|
42
|
+
return;
|
|
43
|
+
view = new MdzipDiffView(hostRef.value, options());
|
|
44
|
+
});
|
|
45
|
+
watch([
|
|
46
|
+
() => props.before,
|
|
47
|
+
() => props.after,
|
|
48
|
+
() => props.initialPath
|
|
49
|
+
], () => { if (view)
|
|
50
|
+
void view.open(options()); });
|
|
51
|
+
watch(() => props.showUnchanged, (show) => view?.setShowUnchanged(show));
|
|
52
|
+
watch(() => props.navigationVisible, (visible) => view?.setNavigationVisible(visible));
|
|
53
|
+
watch(() => props.toolbarActions, (actions) => view?.setToolbarActions(actions));
|
|
54
|
+
onUnmounted(() => {
|
|
55
|
+
view?.destroy();
|
|
56
|
+
view = null;
|
|
57
|
+
});
|
|
58
|
+
return () => h('div', { ref: hostRef, style: 'height:100%;overflow:hidden' });
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=diff-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-view.js","sourceRoot":"","sources":["../src/diff-view.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,CAAC,EACD,SAAS,EACT,WAAW,EACX,GAAG,EACH,KAAK,EAEN,MAAM,KAAK,CAAC;AACb,OAAO,EACL,aAAa,EAKd,MAAM,yBAAyB,CAAC;AAWjC,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;IACvC,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE;QACL,MAAM,EAAE,EAAE,IAAI,EAAE,MAAsC,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAsC,EAAE,QAAQ,EAAE,IAAI,EAAE;QACvE,WAAW,EAAE,MAAM;QACnB,aAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;QAC/C,iBAAiB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;QACnD,QAAQ,EAAE,EAAE,IAAI,EAAE,MAA4C,EAAE,OAAO,EAAE,SAAS,EAAE;QACpF,cAAc,EAAE,EAAE,IAAI,EAAE,KAAoD,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;KAClG;IACD,KAAK,EAAE;QACL,gBAAgB,EAAE,CAAC,MAA+B,EAAE,EAAE,CAAC,IAAI;QAC3D,MAAM,EAAE,CAAC,MAAa,EAAE,EAAE,CAAC,IAAI;KAChC;IACD,KAAK,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;QAC3B,MAAM,OAAO,GAAG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-
import type { MdzipControlPolicy, MdzipControlPreset, MdzipColorScheme, MdzipConversionAction, MdzipEditorSnapshot, MdzipEditorCommand, MdzipWorkspaceLayout, MdzipWorkspaceMode, MdzipNavigationMode, MdzipRemoveAssetOptions, MdzipSourceFormat, MdzWorkspace, MdzWorkspaceAsset } from '@mdzip/editor';
|
|
1
|
+
import { type PropType, type VNode } from 'vue';
|
|
2
|
+
import type { MdzipControlPolicy, MdzipControlPreset, MdzipColorScheme, MdzipConversionAction, MdzipConversionContext, MdzipEditorSnapshot, MdzipEditorCommand, MdzipEntryRenderer, MdzipMarkdownRenderExtension, MdzipMarkdownRenderer, MdzipWorkspaceLayout, MdzipWorkspaceMode, MdzipNavigationMode, MdzipRemoveAssetOptions, MdzipSourceFormat, MdzWorkspace, MdzWorkspaceAsset } from '@mdzip/editor';
|
|
3
3
|
export interface MdzipWorkspaceExposed {
|
|
4
4
|
canExecuteCommand(command: MdzipEditorCommand): boolean;
|
|
5
5
|
executeCommand(command: MdzipEditorCommand, file?: File): Promise<boolean>;
|
|
@@ -7,6 +7,7 @@ export interface MdzipWorkspaceExposed {
|
|
|
7
7
|
flush(): Promise<MdzipEditorSnapshot | null>;
|
|
8
8
|
serialize(): Promise<Blob | null>;
|
|
9
9
|
getCurrentSnapshot(): Promise<MdzipEditorSnapshot | null>;
|
|
10
|
+
whenRendered(): Promise<void>;
|
|
10
11
|
markPersisted(): void;
|
|
11
12
|
addAsset(archivePath: string, fileBytes: Uint8Array): Promise<void>;
|
|
12
13
|
replaceAsset(archivePath: string, fileBytes: Uint8Array): Promise<boolean>;
|
|
@@ -56,12 +57,35 @@ export declare const MdzipWorkspace: import("vue").DefineComponent<import("vue")
|
|
|
56
57
|
* conversion dialog.
|
|
57
58
|
*/
|
|
58
59
|
onConversionRequested: {
|
|
59
|
-
type: PropType<(action: MdzipConversionAction) => boolean | Promise<boolean>>;
|
|
60
|
+
type: PropType<(action: MdzipConversionAction, context: MdzipConversionContext) => boolean | Promise<boolean>>;
|
|
60
61
|
default: undefined;
|
|
61
62
|
};
|
|
62
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Custom markdown renderer. Keep the reference stable: identity changes
|
|
65
|
+
* apply via a cheap preview re-render, never a workspace rebuild.
|
|
66
|
+
*/
|
|
67
|
+
markdownRenderer: {
|
|
68
|
+
type: PropType<MdzipMarkdownRenderer | null>;
|
|
69
|
+
default: null;
|
|
70
|
+
};
|
|
71
|
+
/** Markdown pipeline extensions, diffed by `name`. */
|
|
72
|
+
markdownExtensions: {
|
|
73
|
+
type: PropType<readonly MdzipMarkdownRenderExtension[]>;
|
|
74
|
+
default: () => never[];
|
|
75
|
+
};
|
|
76
|
+
/** Entry renderers, diffed by `id`/`priority`. */
|
|
77
|
+
entryRenderers: {
|
|
78
|
+
type: PropType<readonly MdzipEntryRenderer[]>;
|
|
79
|
+
default: () => never[];
|
|
80
|
+
};
|
|
81
|
+
/** Matching priority of the `#entry` slot relative to `entryRenderers`. */
|
|
82
|
+
entrySlotPriority: {
|
|
83
|
+
type: NumberConstructor;
|
|
84
|
+
default: number;
|
|
85
|
+
};
|
|
86
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
63
87
|
[key: string]: any;
|
|
64
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("changed" | "saved" | "workspaceChanged" | "documentChanged" | "assetChanged" | "manifestChanged" | "snapshotChanged" | "
|
|
88
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("selectionChanged" | "failed" | "changed" | "saved" | "workspaceChanged" | "documentChanged" | "assetChanged" | "manifestChanged" | "snapshotChanged" | "dirtyChanged" | "validationChanged" | "colorSchemeChanged" | "previewRendered" | "assetsHydrated")[], "selectionChanged" | "failed" | "changed" | "saved" | "workspaceChanged" | "documentChanged" | "assetChanged" | "manifestChanged" | "snapshotChanged" | "dirtyChanged" | "validationChanged" | "colorSchemeChanged" | "previewRendered" | "assetsHydrated", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
65
89
|
bytes: {
|
|
66
90
|
type: PropType<Uint8Array | null>;
|
|
67
91
|
default: null;
|
|
@@ -99,10 +123,35 @@ export declare const MdzipWorkspace: import("vue").DefineComponent<import("vue")
|
|
|
99
123
|
* conversion dialog.
|
|
100
124
|
*/
|
|
101
125
|
onConversionRequested: {
|
|
102
|
-
type: PropType<(action: MdzipConversionAction) => boolean | Promise<boolean>>;
|
|
126
|
+
type: PropType<(action: MdzipConversionAction, context: MdzipConversionContext) => boolean | Promise<boolean>>;
|
|
103
127
|
default: undefined;
|
|
104
128
|
};
|
|
129
|
+
/**
|
|
130
|
+
* Custom markdown renderer. Keep the reference stable: identity changes
|
|
131
|
+
* apply via a cheap preview re-render, never a workspace rebuild.
|
|
132
|
+
*/
|
|
133
|
+
markdownRenderer: {
|
|
134
|
+
type: PropType<MdzipMarkdownRenderer | null>;
|
|
135
|
+
default: null;
|
|
136
|
+
};
|
|
137
|
+
/** Markdown pipeline extensions, diffed by `name`. */
|
|
138
|
+
markdownExtensions: {
|
|
139
|
+
type: PropType<readonly MdzipMarkdownRenderExtension[]>;
|
|
140
|
+
default: () => never[];
|
|
141
|
+
};
|
|
142
|
+
/** Entry renderers, diffed by `id`/`priority`. */
|
|
143
|
+
entryRenderers: {
|
|
144
|
+
type: PropType<readonly MdzipEntryRenderer[]>;
|
|
145
|
+
default: () => never[];
|
|
146
|
+
};
|
|
147
|
+
/** Matching priority of the `#entry` slot relative to `entryRenderers`. */
|
|
148
|
+
entrySlotPriority: {
|
|
149
|
+
type: NumberConstructor;
|
|
150
|
+
default: number;
|
|
151
|
+
};
|
|
105
152
|
}>> & Readonly<{
|
|
153
|
+
onSelectionChanged?: ((...args: any[]) => any) | undefined;
|
|
154
|
+
onFailed?: ((...args: any[]) => any) | undefined;
|
|
106
155
|
onChanged?: ((...args: any[]) => any) | undefined;
|
|
107
156
|
onSaved?: ((...args: any[]) => any) | undefined;
|
|
108
157
|
onWorkspaceChanged?: ((...args: any[]) => any) | undefined;
|
|
@@ -110,19 +159,23 @@ export declare const MdzipWorkspace: import("vue").DefineComponent<import("vue")
|
|
|
110
159
|
onAssetChanged?: ((...args: any[]) => any) | undefined;
|
|
111
160
|
onManifestChanged?: ((...args: any[]) => any) | undefined;
|
|
112
161
|
onSnapshotChanged?: ((...args: any[]) => any) | undefined;
|
|
113
|
-
onSelectionChanged?: ((...args: any[]) => any) | undefined;
|
|
114
162
|
onDirtyChanged?: ((...args: any[]) => any) | undefined;
|
|
115
163
|
onValidationChanged?: ((...args: any[]) => any) | undefined;
|
|
116
164
|
onColorSchemeChanged?: ((...args: any[]) => any) | undefined;
|
|
117
|
-
|
|
165
|
+
onPreviewRendered?: ((...args: any[]) => any) | undefined;
|
|
166
|
+
onAssetsHydrated?: ((...args: any[]) => any) | undefined;
|
|
118
167
|
}>, {
|
|
168
|
+
controls: MdzipControlPreset | MdzipControlPolicy;
|
|
169
|
+
mode: MdzipWorkspaceMode;
|
|
119
170
|
bytes: Uint8Array<ArrayBufferLike> | null;
|
|
120
171
|
workspace: MdzWorkspace | null;
|
|
121
172
|
fileName: string;
|
|
122
|
-
mode: MdzipWorkspaceMode;
|
|
123
|
-
controls: MdzipControlPreset | MdzipControlPolicy;
|
|
124
173
|
navigationMode: MdzipNavigationMode;
|
|
125
174
|
navigationButtonActive: boolean;
|
|
126
|
-
onConversionRequested: (action: MdzipConversionAction) => boolean | Promise<boolean>;
|
|
175
|
+
onConversionRequested: (action: MdzipConversionAction, context: MdzipConversionContext) => boolean | Promise<boolean>;
|
|
176
|
+
markdownRenderer: MdzipMarkdownRenderer | null;
|
|
177
|
+
markdownExtensions: readonly MdzipMarkdownRenderExtension[];
|
|
178
|
+
entryRenderers: readonly MdzipEntryRenderer[];
|
|
179
|
+
entrySlotPriority: number;
|
|
127
180
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
128
181
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,KAAK,QAAQ,EAEb,KAAK,KAAK,EAEX,MAAM,KAAK,CAAC;AAGb,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAElB,kBAAkB,EAClB,4BAA4B,EAC5B,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EAElB,MAAM,eAAe,CAAC;AA2CvB,MAAM,WAAW,qBAAqB;IACpC,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC;IACxD,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3E,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC,KAAK,IAAI,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IAC7C,SAAS,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAClC,kBAAkB,IAAI,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IAC1D,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,aAAa,IAAI,IAAI,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,UAA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B,EAAE,CAAC;;;IAGxD,2EAA2E;;;;;;;;;cA9C/C,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC;;;;cAC1B,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC;;;;;;;;cAE9B,QAAQ,CAAC,kBAAkB,CAAC;;;kBAChC,QAAQ,CAAC,iBAAiB,CAAC;;cAEvB,QAAQ,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;;;mBAGpD,QAAQ,CAAC,oBAAoB,CAAC;wBACzB,QAAQ,CAAC,gBAAgB,CAAC;;cAEtC,QAAQ,CAAC,mBAAmB,CAAC;;;;;;;IAI/C;;;;OAIG;;cAEiB,QAAQ,CAAC,CACzB,MAAM,EAAE,qBAAqB,EAC7B,OAAO,EAAE,sBAAsB,KAC5B,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;IAGlC;;;OAGG;;cAEe,QAAQ,CAAC,qBAAqB,GAAG,IAAI,CAAC;;;IAGxD,sDAAsD;;cAErC,QAAQ,CAAC,SAAS,4BAA4B,EAAE,CAAC;;;IAGlE,kDAAkD;;cAEjC,QAAQ,CAAC,SAAS,kBAAkB,EAAE,CAAC;;;IAGxD,2EAA2E;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAvB/D,qBAAqB,WACpB,sBAAsB,KAC5B,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;;;;;4EA+NnC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
|
-
import { defineComponent, h, onMounted, onUnmounted, ref, watch } from 'vue';
|
|
1
|
+
import { Comment, Fragment, Text, defineComponent, getCurrentInstance, h, onMounted, onUnmounted, ref, render, shallowRef, watch, } from 'vue';
|
|
2
2
|
import { MdzipWorkspaceView } from '@mdzip/editor';
|
|
3
|
+
import { PACKAGE_INFO } from './package-info.js';
|
|
4
|
+
// Identity-insensitive key for the rendering props: extensions and entry
|
|
5
|
+
// renderers are diffed by their stable name/id (and priority), so inline
|
|
6
|
+
// array bindings with equivalent contents never trigger an update.
|
|
7
|
+
function renderingConfigKey(extensions, entryRenderers) {
|
|
8
|
+
return JSON.stringify([
|
|
9
|
+
extensions.map((extension) => extension.name),
|
|
10
|
+
entryRenderers.map((renderer) => [renderer.id, renderer.priority ?? 0]),
|
|
11
|
+
]);
|
|
12
|
+
}
|
|
13
|
+
// A slot whose `v-if` evaluated false renders only comments/empty text; that
|
|
14
|
+
// counts as "no content" and delegates to the next renderer or the built-in.
|
|
15
|
+
function hasRenderableContent(nodes) {
|
|
16
|
+
if (nodes === null || nodes === undefined || typeof nodes === 'boolean') {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (Array.isArray(nodes)) {
|
|
20
|
+
return nodes.some((node) => hasRenderableContent(node));
|
|
21
|
+
}
|
|
22
|
+
if (typeof nodes === 'string') {
|
|
23
|
+
return nodes.trim().length > 0;
|
|
24
|
+
}
|
|
25
|
+
if (typeof nodes === 'number') {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
const vnode = nodes;
|
|
29
|
+
if (vnode.type === Comment) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
if (vnode.type === Text) {
|
|
33
|
+
return typeof vnode.children === 'string' ? vnode.children.trim().length > 0 : true;
|
|
34
|
+
}
|
|
35
|
+
if (vnode.type === Fragment) {
|
|
36
|
+
return hasRenderableContent(vnode.children);
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
3
40
|
export const MdzipWorkspace = defineComponent({
|
|
4
41
|
name: 'MdzipWorkspace',
|
|
5
42
|
props: {
|
|
@@ -28,6 +65,26 @@ export const MdzipWorkspace = defineComponent({
|
|
|
28
65
|
type: Function,
|
|
29
66
|
default: undefined
|
|
30
67
|
},
|
|
68
|
+
/**
|
|
69
|
+
* Custom markdown renderer. Keep the reference stable: identity changes
|
|
70
|
+
* apply via a cheap preview re-render, never a workspace rebuild.
|
|
71
|
+
*/
|
|
72
|
+
markdownRenderer: {
|
|
73
|
+
type: Object,
|
|
74
|
+
default: null
|
|
75
|
+
},
|
|
76
|
+
/** Markdown pipeline extensions, diffed by `name`. */
|
|
77
|
+
markdownExtensions: {
|
|
78
|
+
type: Array,
|
|
79
|
+
default: () => []
|
|
80
|
+
},
|
|
81
|
+
/** Entry renderers, diffed by `id`/`priority`. */
|
|
82
|
+
entryRenderers: {
|
|
83
|
+
type: Array,
|
|
84
|
+
default: () => []
|
|
85
|
+
},
|
|
86
|
+
/** Matching priority of the `#entry` slot relative to `entryRenderers`. */
|
|
87
|
+
entrySlotPriority: { type: Number, default: 0 },
|
|
31
88
|
},
|
|
32
89
|
emits: [
|
|
33
90
|
'changed',
|
|
@@ -41,11 +98,59 @@ export const MdzipWorkspace = defineComponent({
|
|
|
41
98
|
'dirtyChanged',
|
|
42
99
|
'validationChanged',
|
|
43
100
|
'colorSchemeChanged',
|
|
101
|
+
'previewRendered',
|
|
102
|
+
'assetsHydrated',
|
|
44
103
|
'failed'
|
|
45
104
|
],
|
|
46
|
-
setup(props, { emit, expose }) {
|
|
105
|
+
setup(props, { emit, expose, slots }) {
|
|
47
106
|
const hostRef = ref(null);
|
|
48
107
|
let view = null;
|
|
108
|
+
const appContext = getCurrentInstance()?.appContext ?? null;
|
|
109
|
+
// Adapts the #entry scoped slot onto the framework-independent
|
|
110
|
+
// MdzipEntryRenderer contract. The slot renders inside a detached inner
|
|
111
|
+
// component whose render effect tracks the slot's reactive dependencies,
|
|
112
|
+
// so reactive parent state stays live; the context itself is a
|
|
113
|
+
// shallowRef updated by the core's update() calls. A slot that renders
|
|
114
|
+
// no content (e.g. its v-if is false) delegates to the next renderer.
|
|
115
|
+
const slotContext = shallowRef(null);
|
|
116
|
+
const EntrySlotHost = defineComponent({
|
|
117
|
+
name: 'MdzipEntrySlotHost',
|
|
118
|
+
setup: () => () => {
|
|
119
|
+
const slot = slots['entry'];
|
|
120
|
+
const context = slotContext.value;
|
|
121
|
+
return slot && context ? slot({ context }) : null;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
const entrySlotAdapter = {
|
|
125
|
+
id: 'mdzip-vue-entry-slot',
|
|
126
|
+
get priority() {
|
|
127
|
+
return props.entrySlotPriority;
|
|
128
|
+
},
|
|
129
|
+
matches: (context) => {
|
|
130
|
+
const slot = slots['entry'];
|
|
131
|
+
return slot ? hasRenderableContent(slot({ context })) : false;
|
|
132
|
+
},
|
|
133
|
+
mount: (container, context) => {
|
|
134
|
+
slotContext.value = context;
|
|
135
|
+
const vnode = h(EntrySlotHost);
|
|
136
|
+
if (appContext) {
|
|
137
|
+
vnode.appContext = appContext;
|
|
138
|
+
}
|
|
139
|
+
render(vnode, container);
|
|
140
|
+
return {
|
|
141
|
+
update: (next) => {
|
|
142
|
+
slotContext.value = next;
|
|
143
|
+
},
|
|
144
|
+
destroy: () => {
|
|
145
|
+
render(null, container);
|
|
146
|
+
slotContext.value = null;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
// Stable sort in the core keeps explicit renderers ahead of the slot
|
|
152
|
+
// catch-all at equal priority.
|
|
153
|
+
const composedEntryRenderers = () => slots['entry'] ? [...props.entryRenderers, entrySlotAdapter] : props.entryRenderers;
|
|
49
154
|
expose({
|
|
50
155
|
canExecuteCommand: (command) => view?.canExecuteCommand(command) ?? false,
|
|
51
156
|
executeCommand: (command, file) => view?.executeCommand(command, file) ?? Promise.resolve(false),
|
|
@@ -53,6 +158,7 @@ export const MdzipWorkspace = defineComponent({
|
|
|
53
158
|
flush: () => view?.flush() ?? Promise.resolve(null),
|
|
54
159
|
serialize: () => view?.serialize() ?? Promise.resolve(null),
|
|
55
160
|
getCurrentSnapshot: () => view?.getCurrentSnapshot() ?? Promise.resolve(null),
|
|
161
|
+
whenRendered: () => view?.whenRendered() ?? Promise.resolve(),
|
|
56
162
|
markPersisted: () => view?.markPersisted(),
|
|
57
163
|
addAsset: (archivePath, fileBytes) => view?.addAsset(archivePath, fileBytes) ?? Promise.resolve(),
|
|
58
164
|
replaceAsset: (archivePath, fileBytes) => view?.replaceAsset(archivePath, fileBytes) ?? Promise.resolve(false),
|
|
@@ -69,6 +175,7 @@ export const MdzipWorkspace = defineComponent({
|
|
|
69
175
|
return;
|
|
70
176
|
view?.destroy();
|
|
71
177
|
view = new MdzipWorkspaceView(hostRef.value, {
|
|
178
|
+
libraries: [PACKAGE_INFO],
|
|
72
179
|
controls: props.controls,
|
|
73
180
|
initialLayout: props.initialLayout,
|
|
74
181
|
initialColorScheme: props.initialColorScheme,
|
|
@@ -85,8 +192,13 @@ export const MdzipWorkspace = defineComponent({
|
|
|
85
192
|
onDirtyChanged: (snapshot) => emit('dirtyChanged', snapshot),
|
|
86
193
|
onValidationChanged: (snapshot) => emit('validationChanged', snapshot),
|
|
87
194
|
onColorSchemeChanged: (colorScheme) => emit('colorSchemeChanged', colorScheme),
|
|
195
|
+
onPreviewRendered: (snapshot) => emit('previewRendered', snapshot),
|
|
196
|
+
onAssetsHydrated: (snapshot) => emit('assetsHydrated', snapshot),
|
|
88
197
|
onFailed: (e) => emit('failed', e),
|
|
89
198
|
onConversionRequested: props.onConversionRequested,
|
|
199
|
+
markdownRenderer: props.markdownRenderer ?? undefined,
|
|
200
|
+
markdownExtensions: props.markdownExtensions,
|
|
201
|
+
entryRenderers: composedEntryRenderers(),
|
|
90
202
|
});
|
|
91
203
|
if (props.workspace) {
|
|
92
204
|
void view.openWorkspace(props.workspace, {
|
|
@@ -131,6 +243,22 @@ export const MdzipWorkspace = defineComponent({
|
|
|
131
243
|
], () => {
|
|
132
244
|
createView();
|
|
133
245
|
}, { immediate: false });
|
|
246
|
+
// Rendering config updates apply in place — never a view rebuild. Arrays
|
|
247
|
+
// re-apply only when their name/id key changes; the renderer re-applies
|
|
248
|
+
// on identity change (a cheap preview re-render).
|
|
249
|
+
watch(() => [
|
|
250
|
+
props.markdownRenderer,
|
|
251
|
+
renderingConfigKey(props.markdownExtensions, composedEntryRenderers())
|
|
252
|
+
], ([renderer, key], previous) => {
|
|
253
|
+
if (previous && renderer === previous[0] && key === previous[1]) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
view?.setRenderingOptions({
|
|
257
|
+
markdownRenderer: renderer ?? null,
|
|
258
|
+
markdownExtensions: props.markdownExtensions,
|
|
259
|
+
entryRenderers: composedEntryRenderers(),
|
|
260
|
+
});
|
|
261
|
+
});
|
|
134
262
|
onUnmounted(() => { view?.destroy(); view = null; });
|
|
135
263
|
return () => h('div', { ref: hostRef, style: 'height:100%;overflow:hidden' });
|
|
136
264
|
},
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,eAAe,EACf,kBAAkB,EAClB,CAAC,EACD,SAAS,EACT,WAAW,EACX,GAAG,EACH,MAAM,EACN,UAAU,EACV,KAAK,GAKN,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAuBjD,yEAAyE;AACzE,yEAAyE;AACzE,mEAAmE;AACnE,SAAS,kBAAkB,CACzB,UAAmD,EACnD,cAA6C;IAE7C,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC;QAC7C,cAAc,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC;KACxE,CAA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GAAG,EAAE,CAAC,KAAK,CAAC,cAAc;YAC1B,GAAG,EAAE,CAAC,KAAK,CAAC,sBAAsB;SACnC,EAAE,GAAG,EAAE;YACN,UAAU,EAAE,CAAC;QACf,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;QAEzB,yEAAyE;QACzE,wEAAwE;QACxE,kDAAkD;QAClD,KAAK,CACH,GAAG,EAAE,CAAC;YACJ,KAAK,CAAC,gBAAgB;YACtB,kBAAkB,CAAC,KAAK,CAAC,kBAAkB,EAAE,sBAAsB,EAAE,CAAC;SAC9D,EACV,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE;YAC5B,IAAI,QAAQ,IAAI,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;gBAChE,OAAO;YACT,CAAC;YACD,IAAI,EAAE,mBAAmB,CAAC;gBACxB,gBAAgB,EAAE,QAAQ,IAAI,IAAI;gBAClC,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;gBAC5C,cAAc,EAAE,sBAAsB,EAAE;aACzC,CAAC,CAAC;QACL,CAAC,CACF,CAAC;QAEF,WAAW,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAErD,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,6BAA6B,EAAE,CAAC,CAAC;IAChF,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const PACKAGE_INFO: {
|
|
2
|
+
readonly name: "@mdzip/editor-vue";
|
|
3
|
+
readonly version: "1.3.11";
|
|
4
|
+
readonly repositoryUrl: "https://github.com/mdzip-project/mdzip-editor/tree/main/packages/editor-vue";
|
|
5
|
+
readonly description: "Vue wrapper for the MDZip workspace editor.";
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=package-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-info.d.ts","sourceRoot":"","sources":["../src/package-info.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,YAAY;;;;;CAKf,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Generated from package.json. Do not edit by hand.
|
|
2
|
+
export const PACKAGE_INFO = {
|
|
3
|
+
"name": "@mdzip/editor-vue",
|
|
4
|
+
"version": "1.3.11",
|
|
5
|
+
"repositoryUrl": "https://github.com/mdzip-project/mdzip-editor/tree/main/packages/editor-vue",
|
|
6
|
+
"description": "Vue wrapper for the MDZip workspace editor."
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=package-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-info.js","sourceRoot":"","sources":["../src/package-info.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,mBAAmB;IAC3B,SAAS,EAAE,QAAQ;IACnB,eAAe,EAAE,6EAA6E;IAC9F,aAAa,EAAE,6CAA6C;CACpD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdzip/editor-vue",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.11",
|
|
4
4
|
"description": "Vue wrapper for the MDZip workspace editor.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -19,16 +19,23 @@
|
|
|
19
19
|
".": {
|
|
20
20
|
"types": "./dist/index.d.ts",
|
|
21
21
|
"import": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./diff-view": {
|
|
24
|
+
"types": "./dist/diff-view.d.ts",
|
|
25
|
+
"import": "./dist/diff-view.js"
|
|
22
26
|
}
|
|
23
27
|
},
|
|
24
28
|
"files": [
|
|
25
29
|
"dist"
|
|
26
30
|
],
|
|
27
31
|
"scripts": {
|
|
28
|
-
"
|
|
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"
|
|
29
36
|
},
|
|
30
37
|
"dependencies": {
|
|
31
|
-
"@mdzip/editor": "^1.3.
|
|
38
|
+
"@mdzip/editor": "^1.3.11"
|
|
32
39
|
},
|
|
33
40
|
"peerDependencies": {
|
|
34
41
|
"vue": ">=3.0.0"
|