vuewrite 0.0.21-a → 0.0.21

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.
@@ -46,7 +46,7 @@ declare type HistoryAction = {
46
46
  selection: TextEditorSelection;
47
47
  };
48
48
 
49
- declare type Renderer = (block: Block) => HTMLAttributes & {
49
+ declare type Modifier = (block: Block) => HTMLAttributes & {
50
50
  tag?: string;
51
51
  } | undefined;
52
52
 
@@ -59,7 +59,7 @@ export declare type Style = {
59
59
 
60
60
  export declare const TextEditor: __VLS_WithTemplateSlots<DefineComponent<__VLS_TypePropsToRuntimeProps<{
61
61
  decorator?: Decorator | undefined;
62
- renderer?: Renderer | undefined;
62
+ modifier?: Modifier | undefined;
63
63
  single?: boolean | undefined;
64
64
  modelValue?: string | {
65
65
  text: string;
@@ -113,7 +113,7 @@ keydown: (...args: any[]) => void;
113
113
  "update:styles": (...args: any[]) => void;
114
114
  }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
115
115
  decorator?: Decorator | undefined;
116
- renderer?: Renderer | undefined;
116
+ modifier?: Modifier | undefined;
117
117
  single?: boolean | undefined;
118
118
  modelValue?: string | {
119
119
  text: string;
@@ -253,7 +253,7 @@ declare class TextEditorStore {
253
253
  export declare const TextEditorView: DefineComponent<Readonly<{
254
254
  styles?: any;
255
255
  decorator?: any;
256
- renderer?: any;
256
+ modifier?: any;
257
257
  parser?: any;
258
258
  modelValue?: any;
259
259
  }>, () => VNode<RendererNode, RendererElement, {
@@ -261,13 +261,13 @@ modelValue?: any;
261
261
  }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<Readonly<{
262
262
  styles?: any;
263
263
  decorator?: any;
264
- renderer?: any;
264
+ modifier?: any;
265
265
  parser?: any;
266
266
  modelValue?: any;
267
267
  }>>>, {
268
268
  readonly styles?: any;
269
269
  readonly decorator?: any;
270
- readonly renderer?: any;
270
+ readonly modifier?: any;
271
271
  readonly parser?: any;
272
272
  readonly modelValue?: any;
273
273
  }, {}>;
package/dist/vuewrite.js CHANGED
@@ -557,7 +557,7 @@ class TextEditorStore {
557
557
  let uidCounter = 0;
558
558
  const uid = () => (uidCounter++).toString();
559
559
  const _sfc_main$2 = defineComponent({
560
- props: ["block", "slots", "static", "decorator", "renderer", "parser"],
560
+ props: ["block", "slots", "static", "decorator", "modifier", "parser"],
561
561
  emits: ["postrender"],
562
562
  setup(props, { emit }) {
563
563
  const slot = computed(() => {
@@ -697,7 +697,7 @@ const _sfc_main$2 = defineComponent({
697
697
  const blockProps = {
698
698
  "data-vw-block-id": props.block.id
699
699
  };
700
- const additionalProps = props.renderer && props.renderer(props.block);
700
+ const additionalProps = props.modifier && props.modifier(props.block);
701
701
  if (additionalProps) {
702
702
  if (additionalProps.tag) {
703
703
  elementTag = additionalProps.tag;
@@ -825,7 +825,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
825
825
  __name: "TextEditor",
826
826
  props: {
827
827
  decorator: { type: Function },
828
- renderer: { type: Function },
828
+ modifier: { type: Function },
829
829
  single: { type: Boolean },
830
830
  modelValue: {},
831
831
  parser: { type: Function },
@@ -1037,11 +1037,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1037
1037
  key: block.id,
1038
1038
  block,
1039
1039
  slots: unref(slots),
1040
- renderer: props.renderer,
1040
+ modifier: props.modifier,
1041
1041
  decorator: props.decorator,
1042
1042
  parser: props.parser,
1043
1043
  onPostrender: onPostRender
1044
- }, null, 8, ["block", "slots", "renderer", "decorator", "parser"]);
1044
+ }, null, 8, ["block", "slots", "modifier", "decorator", "parser"]);
1045
1045
  }), 128)),
1046
1046
  unref(store).blocks.length === 1 && unref(store).blocks[0].text === "" && !unref(store).blocks[0].type ? renderSlot(_ctx.$slots, "placeholder", { key: 0 }) : createCommentVNode("", true)
1047
1047
  ], 544);
@@ -1049,7 +1049,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1049
1049
  }
1050
1050
  });
1051
1051
  const _sfc_main = defineComponent({
1052
- props: ["modelValue", "decorator", "parser", "styles", "renderer"],
1052
+ props: ["modelValue", "decorator", "parser", "styles", "modifier"],
1053
1053
  setup(props, { slots }) {
1054
1054
  const blocks = computed(() => {
1055
1055
  if (Array.isArray(props.modelValue)) {
@@ -1062,7 +1062,7 @@ const _sfc_main = defineComponent({
1062
1062
  block,
1063
1063
  slots,
1064
1064
  decorator: props.decorator,
1065
- renderer: props.renderer,
1065
+ modifier: props.modifier,
1066
1066
  parser: props.parser,
1067
1067
  static: true
1068
1068
  })));
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "vuewrite",
3
3
  "description": "Rich Text Editor based on Vue3 reactivity",
4
4
  "private": false,
5
- "version": "0.0.21-a",
5
+ "version": "0.0.21",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "author": "den59k",