@dskripchenko/markdown-editor 0.2.1 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9eedfee: `toolbarTarget` shows the visual mode's toolbar in the host's own element (wysiwyg 0.7), and `modeSwitch: false` hides the mode buttons when the host switches modes itself through `v-model:mode`.
8
+
3
9
  ## 0.2.1
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -237,6 +237,11 @@ var MarkdownEditor_default = /* @__PURE__ */ (0, vue.defineComponent)({
237
237
  maxHeight: { default: void 0 },
238
238
  blockRenderers: { default: void 0 },
239
239
  toolbarItems: { default: void 0 },
240
+ toolbarTarget: { default: void 0 },
241
+ modeSwitch: {
242
+ type: Boolean,
243
+ default: true
244
+ },
240
245
  slashCommands: { default: void 0 },
241
246
  locale: { default: void 0 },
242
247
  labels: { default: void 0 },
@@ -338,7 +343,7 @@ var MarkdownEditor_default = /* @__PURE__ */ (0, vue.defineComponent)({
338
343
  "--dsk-md-min-h": __props.minHeight,
339
344
  "--dsk-md-max-h": __props.maxHeight
340
345
  })
341
- }, [__props.modes.length > 1 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
346
+ }, [__props.modeSwitch && __props.modes.length > 1 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
342
347
  key: 0,
343
348
  class: "dsk-md__modes",
344
349
  role: "group",
@@ -366,6 +371,7 @@ var MarkdownEditor_default = /* @__PURE__ */ (0, vue.defineComponent)({
366
371
  "max-height": __props.maxHeight,
367
372
  "block-renderers": __props.blockRenderers,
368
373
  "toolbar-items": __props.toolbarItems,
374
+ "toolbar-target": __props.toolbarTarget,
369
375
  "slash-commands": __props.slashCommands,
370
376
  locale: __props.locale,
371
377
  "onUpdate:modelValue": onHtml
@@ -377,6 +383,7 @@ var MarkdownEditor_default = /* @__PURE__ */ (0, vue.defineComponent)({
377
383
  "max-height",
378
384
  "block-renderers",
379
385
  "toolbar-items",
386
+ "toolbar-target",
380
387
  "slash-commands",
381
388
  "locale"
382
389
  ])], 40, _hoisted_3)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_4, [(0, vue.createElementVNode)("textarea", {
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ declare const __VLS_export: DefineComponent<__VLS_PublicProps, {
24
24
  modelValue: string;
25
25
  placeholder: string;
26
26
  toolbarItems: ToolbarItem[];
27
+ toolbarTarget: string | HTMLElement;
27
28
  readonly: boolean;
28
29
  minHeight: string;
29
30
  maxHeight: string;
@@ -32,6 +33,7 @@ declare const __VLS_export: DefineComponent<__VLS_PublicProps, {
32
33
  locale: MarkdownEditorLocale;
33
34
  labels: Partial<MarkdownEditorLabels>;
34
35
  modes: MarkdownEditorMode[];
36
+ modeSwitch: boolean;
35
37
  linkBase: string;
36
38
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
37
39
 
@@ -48,6 +50,10 @@ declare type __VLS_Props = {
48
50
  maxHeight?: string;
49
51
  blockRenderers?: BlockRenderers;
50
52
  toolbarItems?: ToolbarItems;
53
+ /** Where the visual mode's toolbar is shown instead of above the text (an element or a CSS selector): the host's own bar. */
54
+ toolbarTarget?: string | HTMLElement;
55
+ /** The mode buttons above the editor; off when the host switches modes itself (`v-model:mode`). */
56
+ modeSwitch?: boolean;
51
57
  slashCommands?: SlashCommands;
52
58
  locale?: MarkdownEditorLocale;
53
59
  labels?: Partial<MarkdownEditorLabels>;
package/dist/index.mjs CHANGED
@@ -236,6 +236,11 @@ var MarkdownEditor_default = /* @__PURE__ */ defineComponent({
236
236
  maxHeight: { default: void 0 },
237
237
  blockRenderers: { default: void 0 },
238
238
  toolbarItems: { default: void 0 },
239
+ toolbarTarget: { default: void 0 },
240
+ modeSwitch: {
241
+ type: Boolean,
242
+ default: true
243
+ },
239
244
  slashCommands: { default: void 0 },
240
245
  locale: { default: void 0 },
241
246
  labels: { default: void 0 },
@@ -337,7 +342,7 @@ var MarkdownEditor_default = /* @__PURE__ */ defineComponent({
337
342
  "--dsk-md-min-h": __props.minHeight,
338
343
  "--dsk-md-max-h": __props.maxHeight
339
344
  })
340
- }, [__props.modes.length > 1 ? (openBlock(), createElementBlock("div", {
345
+ }, [__props.modeSwitch && __props.modes.length > 1 ? (openBlock(), createElementBlock("div", {
341
346
  key: 0,
342
347
  class: "dsk-md__modes",
343
348
  role: "group",
@@ -365,6 +370,7 @@ var MarkdownEditor_default = /* @__PURE__ */ defineComponent({
365
370
  "max-height": __props.maxHeight,
366
371
  "block-renderers": __props.blockRenderers,
367
372
  "toolbar-items": __props.toolbarItems,
373
+ "toolbar-target": __props.toolbarTarget,
368
374
  "slash-commands": __props.slashCommands,
369
375
  locale: __props.locale,
370
376
  "onUpdate:modelValue": onHtml
@@ -376,6 +382,7 @@ var MarkdownEditor_default = /* @__PURE__ */ defineComponent({
376
382
  "max-height",
377
383
  "block-renderers",
378
384
  "toolbar-items",
385
+ "toolbar-target",
379
386
  "slash-commands",
380
387
  "locale"
381
388
  ])], 40, _hoisted_3)) : (openBlock(), createElementBlock("div", _hoisted_4, [createElementVNode("textarea", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dskripchenko/markdown-editor",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "A Markdown editor for Vue 3 that edits like a word processor: the value is Markdown, the editing is the @dskripchenko/wysiwyg engine — its toolbar, slash menu, shortcuts and live blocks — with source and side-by-side modes, and a lossless round trip",
5
5
  "keywords": [
6
6
  "markdown",
@@ -52,13 +52,13 @@
52
52
  ],
53
53
  "peerDependencies": {
54
54
  "@dskripchenko/ui": "^1.19.1",
55
- "@dskripchenko/wysiwyg": "^0.6.0",
55
+ "@dskripchenko/wysiwyg": "^0.7.0",
56
56
  "vue": "^3.4.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@changesets/cli": "^3.0.3",
60
60
  "@dskripchenko/ui": "^1.19.1",
61
- "@dskripchenko/wysiwyg": "^0.6.0",
61
+ "@dskripchenko/wysiwyg": "^0.7.0",
62
62
  "@eslint/js": "^10.0.1",
63
63
  "@microsoft/api-extractor": "^7.60.1",
64
64
  "@types/node": "^22.20.5",