@builder.io/mitosis 0.0.135 → 0.0.136
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/media-sizes.d.ts +1 -1
- package/dist/src/generators/builder.d.ts +1 -1
- package/dist/src/generators/context/qwik.d.ts +1 -1
- package/dist/src/generators/context/react.d.ts +1 -1
- package/dist/src/generators/context/rsc.d.ts +1 -1
- package/dist/src/generators/context/solid.d.ts +1 -1
- package/dist/src/generators/qwik/component.d.ts +1 -1
- package/dist/src/generators/qwik/helpers/state.d.ts +5 -5
- package/dist/src/generators/qwik/helpers/styles.d.ts +1 -1
- package/dist/src/generators/qwik/src-generator.d.ts +1 -1
- package/dist/src/generators/react/generator.js +1 -1
- package/dist/src/generators/react-native/sanitize-react-native-block-styles.d.ts +1 -1
- package/dist/src/generators/rsc.d.ts +1 -1
- package/dist/src/generators/solid/state/state.d.ts +1 -1
- package/dist/src/generators/solid/types.d.ts +1 -1
- package/dist/src/generators/svelte/blocks.d.ts +1 -1
- package/dist/src/generators/svelte/types.d.ts +1 -1
- package/dist/src/generators/swift-ui.d.ts +1 -1
- package/dist/src/generators/taro.d.ts +1 -1
- package/dist/src/generators/vue/blocks.d.ts +1 -1
- package/dist/src/generators/vue/helpers.d.ts +1 -1
- package/dist/src/generators/vue/types.d.ts +3 -3
- package/dist/src/helpers/babel-transform.d.ts +1 -1
- package/dist/src/helpers/component-file-extensions.d.ts +1 -1
- package/dist/src/helpers/create-mitosis-component.d.ts +1 -1
- package/dist/src/helpers/get-state-object-string.d.ts +1 -1
- package/dist/src/helpers/json.d.ts +1 -1
- package/dist/src/helpers/map-refs.d.ts +1 -1
- package/dist/src/helpers/nullable.d.ts +1 -1
- package/dist/src/helpers/plugins/process-code/index.d.ts +1 -1
- package/dist/src/helpers/plugins/process-code/types.d.ts +2 -2
- package/dist/src/helpers/plugins/process-signals.js +2 -0
- package/dist/src/helpers/render-imports.d.ts +1 -1
- package/dist/src/helpers/replace-identifiers.d.ts +2 -2
- package/dist/src/helpers/slots.d.ts +1 -1
- package/dist/src/helpers/strip-state-and-props-refs.d.ts +2 -2
- package/dist/src/helpers/styles/collect-css.d.ts +1 -1
- package/dist/src/helpers/styles/helpers.d.ts +2 -2
- package/dist/src/helpers/transform-state-setters.d.ts +1 -1
- package/dist/src/helpers/typescript.d.ts +4 -4
- package/dist/src/index.d.ts +2 -2
- package/dist/src/parsers/builder/builder.d.ts +2 -2
- package/dist/src/parsers/context.d.ts +1 -1
- package/dist/src/parsers/jsx/index.d.ts +1 -0
- package/dist/src/parsers/jsx/types.d.ts +2 -2
- package/dist/src/parsers/svelte/helpers/post-process.d.ts +1 -1
- package/dist/src/parsers/svelte/index.js +1 -1
- package/dist/src/parsers/svelte/types/index.d.ts +1 -1
- package/dist/src/plugins/compile-away-builder-components.d.ts +2 -2
- package/dist/src/plugins/compile-away-builder-components.js +1 -2
- package/dist/src/plugins/compile-away-components.d.ts +1 -1
- package/dist/src/plugins/map-styles.d.ts +1 -1
- package/dist/src/symbols/symbol-processor.d.ts +1 -1
- package/dist/src/targets.d.ts +21 -21
- package/dist/src/types/config.d.ts +6 -6
- package/dist/src/types/json.d.ts +6 -6
- package/dist/src/types/metadata.d.ts +3 -3
- package/dist/src/types/mitosis-component.d.ts +14 -14
- package/dist/src/types/mitosis-context.d.ts +1 -1
- package/dist/src/types/mitosis-node.d.ts +7 -7
- package/dist/src/types/mitosis-styles.d.ts +1 -1
- package/dist/src/types/plugins.d.ts +1 -1
- package/dist/src/types/transpiler.d.ts +2 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { ParseMitosisOptions } from '../parsers/jsx/types';
|
|
2
2
|
import type { MitosisComponent } from './mitosis-component';
|
|
3
3
|
import { BaseTranspilerOptions } from './transpiler';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type Format = 'esm' | 'cjs';
|
|
5
|
+
export type Language = 'js' | 'ts';
|
|
6
6
|
interface TranspilerOptions {
|
|
7
7
|
format?: Format;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export
|
|
9
|
+
type Targets = typeof import('../targets').targets;
|
|
10
|
+
export type Target = keyof Targets;
|
|
11
|
+
export type GeneratorOptions = {
|
|
12
12
|
[K in Target]: NonNullable<Parameters<Targets[K]>[0]> & {
|
|
13
13
|
transpiler?: TranspilerOptions;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type MitosisConfig = {
|
|
17
17
|
commonOptions?: Omit<BaseTranspilerOptions, 'experimental'>;
|
|
18
18
|
/**
|
|
19
19
|
* List of targets to compile to.
|
package/dist/src/types/json.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type JSONPrimitive = string | null | number | boolean | undefined;
|
|
2
|
+
export type JSONObject = {
|
|
3
3
|
[key: string]: _JSON | undefined;
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
6
6
|
* We use an underscore to avoid collisions with the global `JSON` primitive type.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
8
|
+
export type _JSON = JSONPrimitive | JSONObject | _JSON[];
|
|
9
|
+
export type JSONPrimitiveOrNode = JSONPrimitive | babel.Node;
|
|
10
|
+
export type JSONOrNodeObject = {
|
|
11
11
|
[key: string]: JSONOrNode;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type JSONOrNode = JSONPrimitiveOrNode | JSONOrNodeObject | JSONOrNode[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Target } from '..';
|
|
2
2
|
import { SolidState } from '../generators/solid/types';
|
|
3
3
|
import { Dictionary } from '../helpers/typescript';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type Targets = typeof import('../targets').targets;
|
|
5
|
+
type TargetOptions = {
|
|
6
6
|
[K in Target]?: Partial<NonNullable<Parameters<Targets[K]>[0]>>;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type ComponentMetadata = {
|
|
9
9
|
[index: string]: any;
|
|
10
10
|
httpRequests?: Record<string, string>;
|
|
11
11
|
options?: TargetOptions;
|
|
@@ -31,8 +31,8 @@ export interface MitosisImport {
|
|
|
31
31
|
};
|
|
32
32
|
importKind?: 'type' | 'typeof' | 'value' | null;
|
|
33
33
|
}
|
|
34
|
-
export
|
|
35
|
-
export
|
|
34
|
+
export type ReactivityType = 'normal' | 'reactive';
|
|
35
|
+
export type ContextOptions = {
|
|
36
36
|
type?: ReactivityType;
|
|
37
37
|
};
|
|
38
38
|
export interface ContextGetInfo extends ContextOptions {
|
|
@@ -44,15 +44,15 @@ export interface ContextSetInfo extends ContextOptions {
|
|
|
44
44
|
value?: MitosisState;
|
|
45
45
|
ref?: string;
|
|
46
46
|
}
|
|
47
|
-
export
|
|
47
|
+
export type BaseHook = {
|
|
48
48
|
code: string;
|
|
49
49
|
deps?: string;
|
|
50
50
|
};
|
|
51
|
-
export
|
|
51
|
+
export type MitosisComponentInput = {
|
|
52
52
|
name: string;
|
|
53
53
|
defaultValue: any;
|
|
54
54
|
};
|
|
55
|
-
export
|
|
55
|
+
export type MitosisExports = {
|
|
56
56
|
[name: string]: MitosisExport;
|
|
57
57
|
};
|
|
58
58
|
export interface MitosisExport {
|
|
@@ -60,26 +60,26 @@ export interface MitosisExport {
|
|
|
60
60
|
usedInLocal?: boolean;
|
|
61
61
|
isFunction?: boolean;
|
|
62
62
|
}
|
|
63
|
-
export
|
|
64
|
-
export
|
|
63
|
+
export type StateValueType = 'function' | 'getter' | 'method' | 'property';
|
|
64
|
+
export type StateValue = {
|
|
65
65
|
code: string;
|
|
66
66
|
typeParameter?: string;
|
|
67
67
|
type: StateValueType;
|
|
68
68
|
propertyType?: ReactivityType;
|
|
69
69
|
};
|
|
70
|
-
export
|
|
71
|
-
export
|
|
70
|
+
export type MitosisState = Dictionary<StateValue | undefined>;
|
|
71
|
+
export type TargetBlock<Return, Targets extends Target = Target> = Partial<{
|
|
72
72
|
[T in Targets | 'default']?: Return;
|
|
73
73
|
}>;
|
|
74
|
-
export
|
|
74
|
+
export type TargetBlockCode = TargetBlock<{
|
|
75
75
|
code: string;
|
|
76
76
|
}>;
|
|
77
|
-
export
|
|
77
|
+
export type TargetBlockDefinition = TargetBlockCode & {
|
|
78
78
|
settings: {
|
|
79
79
|
requiresDefault: boolean;
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
-
export
|
|
82
|
+
export type OnEventHook = BaseHook & {
|
|
83
83
|
refName: string;
|
|
84
84
|
eventName: string;
|
|
85
85
|
isRoot: boolean;
|
|
@@ -87,10 +87,10 @@ export declare type OnEventHook = BaseHook & {
|
|
|
87
87
|
eventArgName: string;
|
|
88
88
|
elementArgName?: string;
|
|
89
89
|
};
|
|
90
|
-
export
|
|
90
|
+
export type OnMountHook = BaseHook & {
|
|
91
91
|
onSSR?: boolean;
|
|
92
92
|
};
|
|
93
|
-
export
|
|
93
|
+
export type MitosisComponent = {
|
|
94
94
|
'@type': '@builder.io/mitosis/component';
|
|
95
95
|
name: string;
|
|
96
96
|
imports: MitosisImport[];
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { JSONObject } from './json';
|
|
2
|
-
export
|
|
3
|
-
|
|
2
|
+
export type SpreadType = 'normal' | 'event-handlers';
|
|
3
|
+
type BindingProperties = {
|
|
4
4
|
type: 'spread';
|
|
5
5
|
spreadType: SpreadType;
|
|
6
6
|
} | {
|
|
7
7
|
type: 'single';
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type Binding = {
|
|
10
10
|
code: string;
|
|
11
11
|
arguments?: string[];
|
|
12
12
|
} & BindingProperties;
|
|
13
|
-
export
|
|
13
|
+
export type BaseNode = {
|
|
14
14
|
'@type': '@builder.io/mitosis/node';
|
|
15
15
|
meta: JSONObject;
|
|
16
16
|
name: string;
|
|
@@ -44,8 +44,8 @@ export declare type BaseNode = {
|
|
|
44
44
|
};
|
|
45
45
|
children: MitosisNode[];
|
|
46
46
|
};
|
|
47
|
-
export
|
|
48
|
-
export
|
|
47
|
+
export type SpecialNodesNames = 'For' | 'Fragment' | 'Show' | 'Slot';
|
|
48
|
+
export type ForNode = BaseNode & {
|
|
49
49
|
name: 'For';
|
|
50
50
|
scope: {
|
|
51
51
|
forName: string | undefined;
|
|
@@ -53,6 +53,6 @@ export declare type ForNode = BaseNode & {
|
|
|
53
53
|
collectionName: string | undefined;
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
|
-
export
|
|
56
|
+
export type MitosisNode = BaseNode | ForNode;
|
|
57
57
|
export declare const checkIsForNode: (node: MitosisNode) => node is ForNode;
|
|
58
58
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type MitosisStyles = Omit<Partial<CSSStyleDeclaration>, 'length' | 'getPropertyPriority' | 'getPropertyValue' | 'item' | 'removeProperty' | 'setProperty'>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MitosisComponent } from './mitosis-component';
|
|
2
|
-
export
|
|
2
|
+
export type Plugin = (options?: any) => {
|
|
3
3
|
json?: {
|
|
4
4
|
pre?: (json: MitosisComponent) => MitosisComponent | void;
|
|
5
5
|
post?: (json: MitosisComponent) => MitosisComponent | void;
|
|
@@ -4,11 +4,11 @@ export interface TranspilerArgs {
|
|
|
4
4
|
path?: string;
|
|
5
5
|
component: MitosisComponent;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type Transpiler<R = string> = (args: TranspilerArgs) => R;
|
|
8
8
|
/**
|
|
9
9
|
* This type guarantees that all code generators receive the same base options
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type TranspilerGenerator<X extends BaseTranspilerOptions, Y = string> = (args?: X) => Transpiler<Y>;
|
|
12
12
|
export interface BaseTranspilerOptions {
|
|
13
13
|
experimental?: {
|
|
14
14
|
[key: string]: any;
|