vuewrite 0.0.17 → 0.0.18
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/dist/vuewrite.d.ts +21 -32
- package/dist/vuewrite.js +17 -28
- package/package.json +1 -1
package/dist/vuewrite.d.ts
CHANGED
|
@@ -6,11 +6,12 @@ import { HTMLAttributes } from 'vue';
|
|
|
6
6
|
import { PropType } from 'vue';
|
|
7
7
|
import { PublicProps } from 'vue';
|
|
8
8
|
import { Ref } from 'vue';
|
|
9
|
+
import { RendererElement } from 'vue';
|
|
10
|
+
import { RendererNode } from 'vue';
|
|
11
|
+
import { VNode } from 'vue';
|
|
9
12
|
|
|
10
13
|
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
11
14
|
|
|
12
|
-
declare type __VLS_NonUndefinedable_2<T> = T extends undefined ? never : T;
|
|
13
|
-
|
|
14
15
|
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
15
16
|
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
17
|
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
@@ -20,15 +21,6 @@ declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
23
|
|
|
23
|
-
declare type __VLS_TypePropsToRuntimeProps_2<T> = {
|
|
24
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
25
|
-
type: PropType<__VLS_NonUndefinedable_2<T[K]>>;
|
|
26
|
-
} : {
|
|
27
|
-
type: PropType<T[K]>;
|
|
28
|
-
required: true;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
24
|
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
33
25
|
new (): {
|
|
34
26
|
$slots: S;
|
|
@@ -242,27 +234,24 @@ declare class TextEditorStore {
|
|
|
242
234
|
selectAll(): void;
|
|
243
235
|
}
|
|
244
236
|
|
|
245
|
-
export declare const TextEditorView: DefineComponent<
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
styles?:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
modelValue
|
|
257
|
-
|
|
258
|
-
styles?:
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
styles?: Style[] | undefined;
|
|
264
|
-
preventMultiline?: boolean | undefined;
|
|
265
|
-
}>>>, {}, {}>;
|
|
237
|
+
export declare const TextEditorView: DefineComponent<Readonly<{
|
|
238
|
+
styles?: any;
|
|
239
|
+
decorator?: any;
|
|
240
|
+
parser?: any;
|
|
241
|
+
modelValue?: any;
|
|
242
|
+
}>, () => VNode<RendererNode, RendererElement, {
|
|
243
|
+
[key: string]: any;
|
|
244
|
+
}>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<Readonly<{
|
|
245
|
+
styles?: any;
|
|
246
|
+
decorator?: any;
|
|
247
|
+
parser?: any;
|
|
248
|
+
modelValue?: any;
|
|
249
|
+
}>>>, {
|
|
250
|
+
readonly styles?: any;
|
|
251
|
+
readonly decorator?: any;
|
|
252
|
+
readonly parser?: any;
|
|
253
|
+
readonly modelValue?: any;
|
|
254
|
+
}, {}>;
|
|
266
255
|
|
|
267
256
|
declare type TextParser = (text: string) => Style[];
|
|
268
257
|
|
package/dist/vuewrite.js
CHANGED
|
@@ -666,8 +666,12 @@ const _sfc_main$2 = defineComponent({
|
|
|
666
666
|
return h(elementTag, attrs, text);
|
|
667
667
|
};
|
|
668
668
|
return () => {
|
|
669
|
-
if (slot.value)
|
|
670
|
-
|
|
669
|
+
if (slot.value) {
|
|
670
|
+
const component = slot.value({ content, props: blockProps, block: props.block });
|
|
671
|
+
if (Array.isArray(component) && component.length === 1)
|
|
672
|
+
return component[0];
|
|
673
|
+
return component;
|
|
674
|
+
}
|
|
671
675
|
return h("div", blockProps, content());
|
|
672
676
|
};
|
|
673
677
|
}
|
|
@@ -913,38 +917,23 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
913
917
|
};
|
|
914
918
|
}
|
|
915
919
|
});
|
|
916
|
-
const _sfc_main =
|
|
917
|
-
|
|
918
|
-
props
|
|
919
|
-
modelValue: {},
|
|
920
|
-
decorator: { type: Function },
|
|
921
|
-
parser: {},
|
|
922
|
-
styles: {},
|
|
923
|
-
preventMultiline: { type: Boolean }
|
|
924
|
-
},
|
|
925
|
-
setup(__props) {
|
|
926
|
-
const props = __props;
|
|
927
|
-
const slots = useSlots();
|
|
920
|
+
const _sfc_main = defineComponent({
|
|
921
|
+
props: ["modelValue", "decorator", "parser", "styles"],
|
|
922
|
+
setup(props, { slots }) {
|
|
928
923
|
const blocks = computed(() => {
|
|
929
924
|
if (Array.isArray(props.modelValue)) {
|
|
930
925
|
return props.modelValue;
|
|
931
926
|
}
|
|
932
927
|
return [{ text: props.modelValue, styles: props.styles ?? [] }];
|
|
933
928
|
});
|
|
934
|
-
return (
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
parser: props.parser,
|
|
943
|
-
static: ""
|
|
944
|
-
}, null, 8, ["block", "slots", "decorator", "parser"]);
|
|
945
|
-
}), 128))
|
|
946
|
-
]);
|
|
947
|
-
};
|
|
929
|
+
return () => h("div", blocks.value.map((block) => h(_sfc_main$2, {
|
|
930
|
+
key: block.id,
|
|
931
|
+
block,
|
|
932
|
+
slots,
|
|
933
|
+
decorator: props.decorator,
|
|
934
|
+
parser: props.parser,
|
|
935
|
+
static: true
|
|
936
|
+
})));
|
|
948
937
|
}
|
|
949
938
|
});
|
|
950
939
|
export {
|