@builder.io/mitosis 0.0.121 → 0.0.123
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/src/constants/hooks.d.ts +1 -0
- package/dist/src/constants/hooks.js +1 -0
- package/dist/src/generators/alpine/generate.js +3 -1
- package/dist/src/generators/alpine/render-mount-hook.js +3 -3
- package/dist/src/generators/angular.js +8 -10
- package/dist/src/generators/builder.js +7 -6
- package/dist/src/generators/helpers/on-mount.d.ts +5 -0
- package/dist/src/generators/helpers/on-mount.js +21 -0
- package/dist/src/generators/html.js +16 -15
- package/dist/src/generators/lit/generate.js +5 -4
- package/dist/src/generators/marko/generate.js +5 -4
- package/dist/src/generators/mitosis.js +2 -2
- package/dist/src/generators/qwik/component-generator.js +20 -6
- package/dist/src/generators/qwik/component.js +2 -2
- package/dist/src/generators/react/generator.js +44 -19
- package/dist/src/generators/rsc.d.ts +2 -0
- package/dist/src/generators/rsc.js +27 -16
- package/dist/src/generators/solid/index.js +7 -6
- package/dist/src/generators/stencil/generate.js +5 -4
- package/dist/src/generators/svelte/svelte.js +9 -7
- package/dist/src/generators/vue/compositionApi.d.ts +2 -2
- package/dist/src/generators/vue/compositionApi.js +2 -2
- package/dist/src/generators/vue/optionsApi.d.ts +2 -2
- package/dist/src/generators/vue/optionsApi.js +4 -3
- package/dist/src/generators/vue/vue.js +68 -62
- package/dist/src/helpers/create-mitosis-component.d.ts +6 -1
- package/dist/src/helpers/create-mitosis-component.js +16 -1
- package/dist/src/helpers/event-handlers.d.ts +1 -0
- package/dist/src/helpers/event-handlers.js +5 -0
- package/dist/src/helpers/on-event.d.ts +13 -0
- package/dist/src/helpers/on-event.js +53 -0
- package/dist/src/helpers/output.js +2 -4
- package/dist/src/helpers/process-http-requests.js +4 -4
- package/dist/src/helpers/typescript.d.ts +4 -1
- package/dist/src/index.d.ts +7 -1
- package/dist/src/parsers/builder/builder.js +10 -6
- package/dist/src/parsers/jsx/function-parser.js +52 -2
- package/dist/src/parsers/svelte/helpers/post-process.js +5 -5
- package/dist/src/parsers/svelte/html/actions.js +4 -6
- package/dist/src/parsers/svelte/index.js +4 -1
- package/dist/src/parsers/svelte/instance/hooks.js +2 -2
- package/dist/src/parsers/svelte/instance/index.js +3 -5
- package/dist/src/plugins/compile-away-builder-components.js +2 -2
- package/dist/src/types/metadata.d.ts +1 -0
- package/dist/src/types/mitosis-component.d.ts +19 -8
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -44,7 +44,7 @@ export interface ContextSetInfo extends ContextOptions {
|
|
|
44
44
|
value?: MitosisState;
|
|
45
45
|
ref?: string;
|
|
46
46
|
}
|
|
47
|
-
export declare type
|
|
47
|
+
export declare type BaseHook = {
|
|
48
48
|
code: string;
|
|
49
49
|
deps?: string;
|
|
50
50
|
};
|
|
@@ -79,6 +79,16 @@ export declare type TargetBlockDefinition = TargetBlockCode & {
|
|
|
79
79
|
requiresDefault: boolean;
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
+
export declare type OnEventHook = BaseHook & {
|
|
83
|
+
refName: string;
|
|
84
|
+
eventName: string;
|
|
85
|
+
isRoot: boolean;
|
|
86
|
+
deps?: never;
|
|
87
|
+
eventArgName: string;
|
|
88
|
+
};
|
|
89
|
+
export declare type OnMountHook = BaseHook & {
|
|
90
|
+
onSSR?: boolean;
|
|
91
|
+
};
|
|
82
92
|
export declare type MitosisComponent = {
|
|
83
93
|
'@type': '@builder.io/mitosis/component';
|
|
84
94
|
name: string;
|
|
@@ -109,13 +119,14 @@ export declare type MitosisComponent = {
|
|
|
109
119
|
};
|
|
110
120
|
};
|
|
111
121
|
hooks: {
|
|
112
|
-
init?:
|
|
113
|
-
onInit?:
|
|
114
|
-
onMount
|
|
115
|
-
onUnMount?:
|
|
116
|
-
preComponent?:
|
|
117
|
-
postComponent?:
|
|
118
|
-
onUpdate?:
|
|
122
|
+
init?: BaseHook;
|
|
123
|
+
onInit?: BaseHook;
|
|
124
|
+
onMount: OnMountHook[];
|
|
125
|
+
onUnMount?: BaseHook;
|
|
126
|
+
preComponent?: BaseHook;
|
|
127
|
+
postComponent?: BaseHook;
|
|
128
|
+
onUpdate?: BaseHook[];
|
|
129
|
+
onEvent: OnEventHook[];
|
|
119
130
|
};
|
|
120
131
|
targetBlocks?: Dictionary<TargetBlockDefinition>;
|
|
121
132
|
children: MitosisNode[];
|