@aerogel/core 0.0.0-next.aa6e27a9c197d1ee10c9fe018ee8c0fc6ff77767 → 0.0.0-next.abea39863ad0f7c484b8b1f365870e43e9bdd0ba
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/aerogel-core.css +1 -0
- package/dist/aerogel-core.d.ts +683 -579
- package/dist/aerogel-core.js +2180 -1828
- package/dist/aerogel-core.js.map +1 -1
- package/package.json +7 -2
- package/src/components/AppLayout.vue +1 -3
- package/src/components/AppOverlays.vue +0 -27
- package/src/components/contracts/AlertModal.ts +15 -0
- package/src/components/contracts/ConfirmModal.ts +12 -5
- package/src/components/contracts/DropdownMenu.ts +17 -3
- package/src/components/contracts/ErrorReportModal.ts +8 -4
- package/src/components/contracts/Input.ts +7 -7
- package/src/components/contracts/LoadingModal.ts +12 -4
- package/src/components/contracts/Modal.ts +12 -4
- package/src/components/contracts/PromptModal.ts +8 -2
- package/src/components/contracts/Select.ts +21 -12
- package/src/components/contracts/Toast.ts +4 -2
- package/src/components/contracts/index.ts +3 -1
- package/src/components/headless/HeadlessButton.vue +2 -1
- package/src/components/headless/HeadlessInput.vue +3 -3
- package/src/components/headless/HeadlessInputInput.vue +6 -6
- package/src/components/headless/HeadlessInputTextArea.vue +4 -4
- package/src/components/headless/HeadlessModal.vue +22 -51
- package/src/components/headless/HeadlessModalContent.vue +11 -5
- package/src/components/headless/HeadlessModalDescription.vue +12 -0
- package/src/components/headless/HeadlessSelect.vue +34 -19
- package/src/components/headless/HeadlessSelectOption.vue +1 -1
- package/src/components/headless/HeadlessSelectOptions.vue +16 -4
- package/src/components/headless/HeadlessSelectValue.vue +4 -1
- package/src/components/headless/HeadlessSwitch.vue +96 -0
- package/src/components/headless/index.ts +2 -0
- package/src/components/index.ts +2 -1
- package/src/components/ui/AdvancedOptions.vue +1 -1
- package/src/components/ui/AlertModal.vue +7 -3
- package/src/components/ui/Button.vue +33 -16
- package/src/components/ui/Checkbox.vue +5 -5
- package/src/components/ui/ConfirmModal.vue +12 -4
- package/src/components/ui/DropdownMenu.vue +18 -19
- package/src/components/ui/DropdownMenuOption.vue +22 -0
- package/src/components/ui/DropdownMenuOptions.vue +44 -0
- package/src/components/ui/EditableContent.vue +4 -4
- package/src/components/ui/ErrorLogs.vue +19 -0
- package/src/components/ui/ErrorLogsModal.vue +48 -0
- package/src/components/ui/ErrorReportModal.vue +18 -7
- package/src/components/ui/Input.vue +4 -4
- package/src/components/ui/LoadingModal.vue +6 -4
- package/src/components/ui/Markdown.vue +31 -3
- package/src/components/ui/Modal.vue +83 -22
- package/src/components/ui/ModalContext.vue +2 -1
- package/src/components/ui/ProgressBar.vue +9 -8
- package/src/components/ui/PromptModal.vue +8 -5
- package/src/components/ui/Select.vue +10 -4
- package/src/components/ui/SelectLabel.vue +13 -2
- package/src/components/ui/SelectOption.vue +29 -0
- package/src/components/ui/SelectOptions.vue +24 -20
- package/src/components/ui/SelectTrigger.vue +3 -3
- package/src/components/ui/SettingsModal.vue +4 -40
- package/src/components/ui/Switch.vue +11 -0
- package/src/components/ui/Toast.vue +20 -16
- package/src/components/ui/index.ts +6 -0
- package/src/directives/measure.ts +11 -5
- package/src/errors/Errors.ts +18 -15
- package/src/errors/index.ts +6 -2
- package/src/errors/settings/Debug.vue +39 -0
- package/src/errors/settings/index.ts +10 -0
- package/src/forms/FormController.test.ts +32 -9
- package/src/forms/FormController.ts +23 -22
- package/src/forms/index.ts +0 -1
- package/src/forms/utils.ts +34 -34
- package/src/index.css +37 -5
- package/src/lang/index.ts +5 -1
- package/src/lang/settings/Language.vue +48 -0
- package/src/lang/settings/index.ts +10 -0
- package/src/services/App.state.ts +11 -1
- package/src/services/App.ts +9 -1
- package/src/services/Events.test.ts +8 -8
- package/src/services/Events.ts +2 -8
- package/src/services/index.ts +5 -2
- package/src/testing/index.ts +4 -0
- package/src/ui/UI.state.ts +3 -13
- package/src/ui/UI.ts +107 -83
- package/src/ui/index.ts +16 -17
- package/src/utils/classes.ts +41 -0
- package/src/utils/composition/events.ts +2 -4
- package/src/utils/composition/forms.ts +16 -1
- package/src/utils/composition/state.ts +11 -2
- package/src/utils/index.ts +3 -1
- package/src/utils/markdown.ts +35 -1
- package/src/utils/types.ts +3 -0
- package/src/utils/vue.ts +28 -125
- package/src/components/composition.ts +0 -23
- package/src/components/contracts/shared.ts +0 -9
- package/src/components/utils.ts +0 -107
- package/src/forms/composition.ts +0 -6
- package/src/utils/tailwindcss.test.ts +0 -26
- package/src/utils/tailwindcss.ts +0 -7
- package/src/utils/vdom.ts +0 -31
package/src/utils/vue.ts
CHANGED
|
@@ -1,55 +1,26 @@
|
|
|
1
1
|
import { fail, toString } from '@noeldemartin/utils';
|
|
2
|
-
import {
|
|
3
|
-
import type { Directive, InjectionKey, MaybeRef,
|
|
2
|
+
import { Comment, Static, Text, inject, reactive } from 'vue';
|
|
3
|
+
import type { Directive, InjectionKey, MaybeRef, Ref, UnwrapNestedRefs, VNode } from 'vue';
|
|
4
4
|
|
|
5
5
|
export type AcceptRefs<T> = { [K in keyof T]: T[K] | RefUnion<T[K]> };
|
|
6
|
-
export type BaseProp<T> = { type?: PropType<T>; validator?(value: unknown): boolean };
|
|
7
|
-
export type ComponentProps<T = {}> = T & Record<string, unknown>;
|
|
8
|
-
export type OptionalProp<T> = BaseProp<T> & { default: T | (() => T) | null };
|
|
9
6
|
export type RefUnion<T> = T extends infer R ? Ref<R> : never;
|
|
10
|
-
export type RequiredProp<T> = BaseProp<T> & { required: true };
|
|
11
7
|
export type Unref<T> = { [K in keyof T]: T[K] extends MaybeRef<infer Value> ? Value : T[K] };
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
9
|
+
function renderVNodeAttrs(node: VNode): string {
|
|
10
|
+
return Object.entries(node.props ?? {}).reduce((attrs, [name, value]) => {
|
|
11
|
+
return attrs + `${name}="${toString(value)}"`;
|
|
12
|
+
}, '');
|
|
18
13
|
}
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export function computedAsync<T>(getter: () => Promise<T>): Ref<T | undefined> {
|
|
28
|
-
const result = ref<T>();
|
|
29
|
-
const asyncValue = computed(getter);
|
|
30
|
-
|
|
31
|
-
watch(asyncValue, async () => (result.value = await asyncValue.value), { immediate: true });
|
|
32
|
-
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function defineDirective(directive: Directive): Directive {
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
+
export function defineDirective<TValue = any, TModifiers extends string = string>(
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
directive: Directive<any, TValue, TModifiers>,
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
): Directive<any, TValue, TModifiers> {
|
|
37
21
|
return directive;
|
|
38
22
|
}
|
|
39
23
|
|
|
40
|
-
export function enumProp<Enum extends Record<string, unknown>>(
|
|
41
|
-
enumeration: Enum,
|
|
42
|
-
defaultValue?: Enum[keyof Enum],
|
|
43
|
-
): OptionalProp<Enum[keyof Enum]> {
|
|
44
|
-
const values = Object.values(enumeration) as Enum[keyof Enum][];
|
|
45
|
-
|
|
46
|
-
return {
|
|
47
|
-
type: String as unknown as PropType<Enum[keyof Enum]>,
|
|
48
|
-
default: defaultValue ?? values[0] ?? null,
|
|
49
|
-
validator: (value) => values.includes(value as Enum[keyof Enum]),
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
24
|
export function injectReactive<T extends object>(key: InjectionKey<T> | string): UnwrapNestedRefs<T> | undefined {
|
|
54
25
|
const value = inject(key);
|
|
55
26
|
|
|
@@ -67,92 +38,24 @@ export function injectOrFail<T>(key: InjectionKey<T> | string, errorMessage?: st
|
|
|
67
38
|
return inject(key) ?? fail(errorMessage ?? `Could not resolve '${toString(key)}' injection key`);
|
|
68
39
|
}
|
|
69
40
|
|
|
70
|
-
export function
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function mixedProp<T>(type?: PropType<T>): OptionalProp<T | null>;
|
|
78
|
-
export function mixedProp<T>(type: PropType<T>, defaultValue: T): OptionalProp<T>;
|
|
79
|
-
export function mixedProp<T>(type?: PropType<T>, defaultValue?: T): OptionalProp<T | null> {
|
|
80
|
-
return {
|
|
81
|
-
type,
|
|
82
|
-
default: defaultValue ?? null,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export function numberProp(): OptionalProp<number | null>;
|
|
87
|
-
export function numberProp(defaultValue: number): OptionalProp<number>;
|
|
88
|
-
export function numberProp(defaultValue: number | null = null): OptionalProp<number | null> {
|
|
89
|
-
return {
|
|
90
|
-
type: Number,
|
|
91
|
-
default: defaultValue,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export function objectProp<T = Object>(): OptionalProp<T | null>;
|
|
96
|
-
export function objectProp<T>(defaultValue: () => T): OptionalProp<T>;
|
|
97
|
-
export function objectProp<T = Object>(defaultValue: (() => T) | null = null): OptionalProp<T | null> {
|
|
98
|
-
return {
|
|
99
|
-
type: Object,
|
|
100
|
-
default: defaultValue,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
41
|
+
export function renderVNode(node: VNode | string): string {
|
|
42
|
+
if (typeof node === 'string') {
|
|
43
|
+
return node;
|
|
44
|
+
}
|
|
103
45
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
required: true,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
46
|
+
if (node.type === Comment) {
|
|
47
|
+
return '';
|
|
48
|
+
}
|
|
110
49
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const values = Object.values(enumeration);
|
|
50
|
+
if (node.type === Text || node.type === Static) {
|
|
51
|
+
return node.children as string;
|
|
52
|
+
}
|
|
115
53
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
validator: (value) => values.includes(value),
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export function requiredMixedProp<T>(type?: PropType<T>): RequiredProp<T> {
|
|
124
|
-
return {
|
|
125
|
-
type,
|
|
126
|
-
required: true,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export function requiredNumberProp(): RequiredProp<number> {
|
|
131
|
-
return {
|
|
132
|
-
type: Number,
|
|
133
|
-
required: true,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export function requiredObjectProp<T = Object>(): RequiredProp<T> {
|
|
138
|
-
return {
|
|
139
|
-
type: Object,
|
|
140
|
-
required: true,
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export function requiredStringProp(): RequiredProp<string> {
|
|
145
|
-
return {
|
|
146
|
-
type: String,
|
|
147
|
-
required: true,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
54
|
+
if (node.type === 'br') {
|
|
55
|
+
return '\n\n';
|
|
56
|
+
}
|
|
150
57
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return {
|
|
155
|
-
type: String,
|
|
156
|
-
default: defaultValue,
|
|
157
|
-
};
|
|
58
|
+
return `<${node.type} ${renderVNodeAttrs(node)}>${Array.from(node.children as Array<VNode | string>)
|
|
59
|
+
.map(renderVNode)
|
|
60
|
+
.join('')}</${node.type}>`;
|
|
158
61
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { customRef } from 'vue';
|
|
2
|
-
import type { Ref } from 'vue';
|
|
3
|
-
|
|
4
|
-
import { getElement } from '@aerogel/core/components/utils';
|
|
5
|
-
|
|
6
|
-
export function elementRef(): Ref<HTMLElement | undefined> {
|
|
7
|
-
return customRef((track, trigger) => {
|
|
8
|
-
let value: HTMLElement | undefined = undefined;
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
get() {
|
|
12
|
-
track();
|
|
13
|
-
|
|
14
|
-
return value;
|
|
15
|
-
},
|
|
16
|
-
set(newValue) {
|
|
17
|
-
value = getElement(newValue);
|
|
18
|
-
|
|
19
|
-
trigger();
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
}
|
package/src/components/utils.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import clsx from 'clsx';
|
|
2
|
-
import { computed, customRef, inject, onUnmounted, unref } from 'vue';
|
|
3
|
-
import { cva } from 'class-variance-authority';
|
|
4
|
-
import { isObject } from '@noeldemartin/utils';
|
|
5
|
-
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import type { ClassValue } from 'clsx';
|
|
7
|
-
import type { ComputedRef, ExtractPropTypes, PropType, Ref, UnwrapNestedRefs } from 'vue';
|
|
8
|
-
import type { GetClosureArgs, GetClosureResult, Nullable } from '@noeldemartin/utils';
|
|
9
|
-
|
|
10
|
-
import type { HasElement } from '@aerogel/core/components/contracts/shared';
|
|
11
|
-
import type { FormController } from '@aerogel/core/forms';
|
|
12
|
-
|
|
13
|
-
export type CVAConfig<T> = NonNullable<GetClosureArgs<typeof cva<T>>[1]>;
|
|
14
|
-
export type CVAProps<T> = NonNullable<GetClosureArgs<GetClosureResult<typeof cva<T>>>[0]>;
|
|
15
|
-
export type RefsObject<T> = { [K in keyof T]: Ref<T[K]> | T[K] };
|
|
16
|
-
export type Variants<T extends Record<string, string | boolean>> = Required<{
|
|
17
|
-
[K in keyof T]: Exclude<T[K], undefined> extends string
|
|
18
|
-
? { [key in Exclude<T[K], undefined>]: string | null }
|
|
19
|
-
: { true: string | null; false: string | null };
|
|
20
|
-
}>;
|
|
21
|
-
|
|
22
|
-
export type ComponentPropDefinitions<T> = {
|
|
23
|
-
[K in keyof T]: {
|
|
24
|
-
type?: PropType<T[K]>;
|
|
25
|
-
default: T[K] | (() => T[K]) | null;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export type PickComponentProps<TValues, TDefinitions> = {
|
|
30
|
-
[K in keyof TValues]: K extends keyof TDefinitions ? TValues[K] : never;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export function computedVariantClasses<T>(
|
|
34
|
-
value: RefsObject<{ baseClasses?: string } & CVAProps<T>>,
|
|
35
|
-
config: { baseClasses?: string } & CVAConfig<T>,
|
|
36
|
-
): ComputedRef<string> {
|
|
37
|
-
return computed(() => {
|
|
38
|
-
const { baseClasses: valueBaseClasses, ...valueRefs } = value;
|
|
39
|
-
const { baseClasses: configBaseClasses, ...configs } = config;
|
|
40
|
-
const variants = cva(configBaseClasses, configs as CVAConfig<T>);
|
|
41
|
-
const values = Object.entries(valueRefs).reduce((extractedValues, [name, valueRef]) => {
|
|
42
|
-
extractedValues[name as keyof CVAProps<T>] = unref(valueRef);
|
|
43
|
-
|
|
44
|
-
return extractedValues;
|
|
45
|
-
}, {} as CVAProps<T>);
|
|
46
|
-
|
|
47
|
-
return classes(variants(values), unref(valueBaseClasses));
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function classes(...inputs: ClassValue[]): string {
|
|
52
|
-
return twMerge(clsx(inputs));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function elementRef(): Ref<HTMLElement | undefined> {
|
|
56
|
-
return customRef((track, trigger) => {
|
|
57
|
-
let value: HTMLElement | undefined = undefined;
|
|
58
|
-
|
|
59
|
-
return {
|
|
60
|
-
get() {
|
|
61
|
-
track();
|
|
62
|
-
|
|
63
|
-
return value;
|
|
64
|
-
},
|
|
65
|
-
set(newValue) {
|
|
66
|
-
value = getElement(newValue);
|
|
67
|
-
|
|
68
|
-
trigger();
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function extractComponentProps<TDefinitions extends {}, TValues extends ExtractPropTypes<TDefinitions>>(
|
|
75
|
-
values: TValues,
|
|
76
|
-
definitions: TDefinitions,
|
|
77
|
-
): PickComponentProps<TValues, TDefinitions> {
|
|
78
|
-
return Object.keys(definitions).reduce(
|
|
79
|
-
(extracted, prop) => {
|
|
80
|
-
extracted[prop] = values[prop as keyof TValues];
|
|
81
|
-
|
|
82
|
-
return extracted;
|
|
83
|
-
},
|
|
84
|
-
{} as Record<string, unknown>,
|
|
85
|
-
) as PickComponentProps<TValues, TDefinitions>;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export function getElement(value: unknown): HTMLElement | undefined {
|
|
89
|
-
if (value instanceof HTMLElement) {
|
|
90
|
-
return value;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (hasElement(value)) {
|
|
94
|
-
return value.$el;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export function hasElement(value: unknown): value is UnwrapNestedRefs<HasElement> {
|
|
99
|
-
return isObject(value) && '$el' in value;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export function onFormFocus(input: { name: Nullable<string> }, listener: () => unknown): void {
|
|
103
|
-
const form = inject<FormController | null>('form', null);
|
|
104
|
-
const stop = form?.on('focus', (name) => input.name === name && listener());
|
|
105
|
-
|
|
106
|
-
onUnmounted(() => stop?.());
|
|
107
|
-
}
|
package/src/forms/composition.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import FormController from '@aerogel/core/forms/FormController';
|
|
2
|
-
import type { FormData, FormFieldDefinitions } from '@aerogel/core/forms/FormController';
|
|
3
|
-
|
|
4
|
-
export function useForm<const T extends FormFieldDefinitions>(fields: T): FormController<T> & FormData<T> {
|
|
5
|
-
return new FormController(fields) as FormController<T> & FormData<T>;
|
|
6
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
|
|
3
|
-
import { removeInteractiveClasses } from './tailwindcss';
|
|
4
|
-
|
|
5
|
-
describe('TailwindCSS utils', () => {
|
|
6
|
-
|
|
7
|
-
it('Removes interactive classes', () => {
|
|
8
|
-
const cases: [string, string][] = [
|
|
9
|
-
['text-red hover:text-green', 'text-red'],
|
|
10
|
-
['text-red hover:text-green text-lg', 'text-red text-lg'],
|
|
11
|
-
[
|
|
12
|
-
`
|
|
13
|
-
text-red text-lg
|
|
14
|
-
focus:text-yellow
|
|
15
|
-
hover:focus:text-black
|
|
16
|
-
`,
|
|
17
|
-
'text-red text-lg',
|
|
18
|
-
],
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
cases.forEach(([original, expected]) => {
|
|
22
|
-
expect(removeInteractiveClasses(original)).toEqual(expected);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
});
|
package/src/utils/tailwindcss.ts
DELETED
package/src/utils/vdom.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Comment, Static, Text } from 'vue';
|
|
2
|
-
import { toString } from '@noeldemartin/utils';
|
|
3
|
-
import type { VNode } from 'vue';
|
|
4
|
-
|
|
5
|
-
function renderAttrs(node: VNode): string {
|
|
6
|
-
return Object.entries(node.props ?? {}).reduce((attrs, [name, value]) => {
|
|
7
|
-
return attrs + `${name}="${toString(value)}"`;
|
|
8
|
-
}, '');
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function renderNode(node: VNode | string): string {
|
|
12
|
-
if (typeof node === 'string') {
|
|
13
|
-
return node;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (node.type === Comment) {
|
|
17
|
-
return '';
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (node.type === Text || node.type === Static) {
|
|
21
|
-
return node.children as string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (node.type === 'br') {
|
|
25
|
-
return '\n\n';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return `<${node.type} ${renderAttrs(node)}>${Array.from(node.children as Array<VNode | string>)
|
|
29
|
-
.map(renderNode)
|
|
30
|
-
.join('')}</${node.type}>`;
|
|
31
|
-
}
|