Skip to content

Commit 3c1cee9

Browse files
committed
Merge branch 'main' of https://github.com/BuilderIO/mitosis into feature/multiple-outputs
2 parents 0406727 + 345852b commit 3c1cee9

39 files changed

+2717
-149
lines changed

packages/core/jsx-runtime.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,7 @@ export declare namespace JSX {
10061006

10071007
interface ContainerElementSVGAttributes<T>
10081008
extends CoreSVGAttributes<T>,
1009+
ShapeElementSVGAttributes<T>,
10091010
Pick<
10101011
PresentationSVGAttributes,
10111012
| 'clip-path'
@@ -1078,6 +1079,7 @@ export declare namespace JSX {
10781079

10791080
interface ShapeElementSVGAttributes<T>
10801081
extends CoreSVGAttributes<T>,
1082+
ShapeElementSVGAttributes<T>,
10811083
Pick<
10821084
PresentationSVGAttributes,
10831085
| 'color'

packages/core/src/__tests__/__snapshots__/angular.import.test.ts.snap

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3235,6 +3235,68 @@ export class MyBasicComponentModule {}
32353235
"
32363236
`;
32373237
3238+
exports[`Angular with Preserve Imports and File Extensions Javascript Test renderContentExample 1`] = `
3239+
"import { NgModule } from \\"@angular/core\\";
3240+
import { BrowserModule } from \\"@angular/platform-browser\\";
3241+
3242+
import { Component, Input } from \\"@angular/core\\";
3243+
3244+
type Props = {
3245+
customComponents: string[];
3246+
content: {
3247+
blocks: any[];
3248+
id: string;
3249+
};
3250+
};
3251+
3252+
import {
3253+
sendComponentsToVisualEditor,
3254+
dispatchNewContentToVisualEditor,
3255+
trackClick,
3256+
} from \\"@dummy/injection-js\\";
3257+
import BuilderContext from \\"@dummy/context.lite\\";
3258+
import RenderBlocks from \\"@dummy/RenderBlocks.lite.tsx\\";
3259+
3260+
@Component({
3261+
selector: \\"render-content, RenderContent\\",
3262+
template: \`
3263+
<div class=\\"div\\" (click)=\\"trackClick(content.id)\\">
3264+
<render-blocks [blocks]=\\"content.blocks\\"></render-blocks>
3265+
</div>
3266+
\`,
3267+
styles: [
3268+
\`
3269+
.div {
3270+
display: flex;
3271+
flex-direction: columns;
3272+
}
3273+
\`,
3274+
],
3275+
})
3276+
export class RenderContent {
3277+
trackClick = trackClick;
3278+
3279+
@Input() content: Props[\\"content\\"];
3280+
@Input() customComponents: Props[\\"customComponents\\"];
3281+
3282+
ngOnInit() {
3283+
sendComponentsToVisualEditor(this.customComponents);
3284+
}
3285+
3286+
ngAfterContentChecked() {
3287+
dispatchNewContentToVisualEditor(this.content);
3288+
}
3289+
}
3290+
3291+
@NgModule({
3292+
declarations: [RenderContent],
3293+
imports: [BrowserModule, RenderBlocksModule],
3294+
exports: [RenderContent],
3295+
})
3296+
export class RenderContentModule {}
3297+
"
3298+
`;
3299+
32383300
exports[`Angular with Preserve Imports and File Extensions Javascript Test rootFragmentMultiNode 1`] = `
32393301
"import { NgModule } from \\"@angular/core\\";
32403302
import { BrowserModule } from \\"@angular/platform-browser\\";
@@ -6911,6 +6973,68 @@ export class MyBasicComponentModule {}
69116973
"
69126974
`;
69136975
6976+
exports[`Angular with Preserve Imports and File Extensions Typescript Test renderContentExample 1`] = `
6977+
"import { NgModule } from \\"@angular/core\\";
6978+
import { BrowserModule } from \\"@angular/platform-browser\\";
6979+
6980+
import { Component, Input } from \\"@angular/core\\";
6981+
6982+
type Props = {
6983+
customComponents: string[];
6984+
content: {
6985+
blocks: any[];
6986+
id: string;
6987+
};
6988+
};
6989+
6990+
import {
6991+
sendComponentsToVisualEditor,
6992+
dispatchNewContentToVisualEditor,
6993+
trackClick,
6994+
} from \\"@dummy/injection-js\\";
6995+
import BuilderContext from \\"@dummy/context.lite\\";
6996+
import RenderBlocks from \\"@dummy/RenderBlocks.lite.tsx\\";
6997+
6998+
@Component({
6999+
selector: \\"render-content, RenderContent\\",
7000+
template: \`
7001+
<div class=\\"div\\" (click)=\\"trackClick(content.id)\\">
7002+
<render-blocks [blocks]=\\"content.blocks\\"></render-blocks>
7003+
</div>
7004+
\`,
7005+
styles: [
7006+
\`
7007+
.div {
7008+
display: flex;
7009+
flex-direction: columns;
7010+
}
7011+
\`,
7012+
],
7013+
})
7014+
export class RenderContent {
7015+
trackClick = trackClick;
7016+
7017+
@Input() content: Props[\\"content\\"];
7018+
@Input() customComponents: Props[\\"customComponents\\"];
7019+
7020+
ngOnInit() {
7021+
sendComponentsToVisualEditor(this.customComponents);
7022+
}
7023+
7024+
ngAfterContentChecked() {
7025+
dispatchNewContentToVisualEditor(this.content);
7026+
}
7027+
}
7028+
7029+
@NgModule({
7030+
declarations: [RenderContent],
7031+
imports: [BrowserModule, RenderBlocksModule],
7032+
exports: [RenderContent],
7033+
})
7034+
export class RenderContentModule {}
7035+
"
7036+
`;
7037+
69147038
exports[`Angular with Preserve Imports and File Extensions Typescript Test rootFragmentMultiNode 1`] = `
69157039
"import { NgModule } from \\"@angular/core\\";
69167040
import { BrowserModule } from \\"@angular/platform-browser\\";

packages/core/src/__tests__/__snapshots__/angular.mapper.test.ts.snap

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3300,6 +3300,69 @@ export class MyBasicComponentModule {}
33003300
"
33013301
`;
33023302
3303+
exports[`Angular with Import Mapper Tests Javascript Test renderContentExample 1`] = `
3304+
"import { NgModule } from \\"@angular/core\\";
3305+
import { BrowserModule } from \\"@angular/platform-browser\\";
3306+
3307+
import { Component, Input } from \\"@angular/core\\";
3308+
3309+
type Props = {
3310+
customComponents: string[];
3311+
content: {
3312+
blocks: any[];
3313+
id: string;
3314+
};
3315+
};
3316+
3317+
import {
3318+
sendComponentsToVisualEditor,
3319+
dispatchNewContentToVisualEditor,
3320+
trackClick,
3321+
} from \\"@dummy/injection-js\\";
3322+
import BuilderContext from \\"@dummy/context.lite\\";
3323+
import RenderBlocksModule from \\"@dummy/RenderBlocks.lite.tsx/angular\\";
3324+
3325+
@Component({
3326+
selector: \\"render-content, RenderContent\\",
3327+
template: \`
3328+
<div class=\\"div\\" (click)=\\"trackClick(content.id)\\">
3329+
<render-blocks [blocks]=\\"content.blocks\\"></render-blocks>
3330+
</div>
3331+
\`,
3332+
styles: [
3333+
\`
3334+
.div {
3335+
display: flex;
3336+
flex-direction: columns;
3337+
}
3338+
\`,
3339+
],
3340+
})
3341+
export class RenderContent {
3342+
trackClick = trackClick;
3343+
3344+
@Input() content: Props[\\"content\\"];
3345+
@Input() customComponents: Props[\\"customComponents\\"];
3346+
3347+
ngOnInit() {
3348+
sendComponentsToVisualEditor(this.customComponents);
3349+
}
3350+
3351+
ngAfterContentChecked() {
3352+
dispatchNewContentToVisualEditor(this.content);
3353+
}
3354+
}
3355+
3356+
@NgModule({
3357+
declarations: [RenderContent],
3358+
imports: [BrowserModule, RenderBlocksModule],
3359+
exports: [RenderContent],
3360+
bootstrap: [SomeOtherComponent],
3361+
})
3362+
export class RenderContentModule {}
3363+
"
3364+
`;
3365+
33033366
exports[`Angular with Import Mapper Tests Javascript Test rootFragmentMultiNode 1`] = `
33043367
"import { NgModule } from \\"@angular/core\\";
33053368
import { BrowserModule } from \\"@angular/platform-browser\\";
@@ -7057,6 +7120,69 @@ export class MyBasicComponentModule {}
70577120
"
70587121
`;
70597122
7123+
exports[`Angular with Import Mapper Tests Typescript Test renderContentExample 1`] = `
7124+
"import { NgModule } from \\"@angular/core\\";
7125+
import { BrowserModule } from \\"@angular/platform-browser\\";
7126+
7127+
import { Component, Input } from \\"@angular/core\\";
7128+
7129+
type Props = {
7130+
customComponents: string[];
7131+
content: {
7132+
blocks: any[];
7133+
id: string;
7134+
};
7135+
};
7136+
7137+
import {
7138+
sendComponentsToVisualEditor,
7139+
dispatchNewContentToVisualEditor,
7140+
trackClick,
7141+
} from \\"@dummy/injection-js\\";
7142+
import BuilderContext from \\"@dummy/context.lite\\";
7143+
import RenderBlocksModule from \\"@dummy/RenderBlocks.lite.tsx/angular\\";
7144+
7145+
@Component({
7146+
selector: \\"render-content, RenderContent\\",
7147+
template: \`
7148+
<div class=\\"div\\" (click)=\\"trackClick(content.id)\\">
7149+
<render-blocks [blocks]=\\"content.blocks\\"></render-blocks>
7150+
</div>
7151+
\`,
7152+
styles: [
7153+
\`
7154+
.div {
7155+
display: flex;
7156+
flex-direction: columns;
7157+
}
7158+
\`,
7159+
],
7160+
})
7161+
export class RenderContent {
7162+
trackClick = trackClick;
7163+
7164+
@Input() content: Props[\\"content\\"];
7165+
@Input() customComponents: Props[\\"customComponents\\"];
7166+
7167+
ngOnInit() {
7168+
sendComponentsToVisualEditor(this.customComponents);
7169+
}
7170+
7171+
ngAfterContentChecked() {
7172+
dispatchNewContentToVisualEditor(this.content);
7173+
}
7174+
}
7175+
7176+
@NgModule({
7177+
declarations: [RenderContent],
7178+
imports: [BrowserModule, RenderBlocksModule],
7179+
exports: [RenderContent],
7180+
bootstrap: [SomeOtherComponent],
7181+
})
7182+
export class RenderContentModule {}
7183+
"
7184+
`;
7185+
70607186
exports[`Angular with Import Mapper Tests Typescript Test rootFragmentMultiNode 1`] = `
70617187
"import { NgModule } from \\"@angular/core\\";
70627188
import { BrowserModule } from \\"@angular/platform-browser\\";

0 commit comments

Comments
 (0)