From 3e4b8a7ed54829b3712f2af3d4d043bf0a35b5af Mon Sep 17 00:00:00 2001 From: Sean Perkins Date: Tue, 20 Jun 2023 22:57:54 -0400 Subject: [PATCH 1/3] fix(angular): import paths for child components --- packages/core/src/generators/angular.ts | 33 ++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/packages/core/src/generators/angular.ts b/packages/core/src/generators/angular.ts index 1330eef052..c2b66f69e6 100644 --- a/packages/core/src/generators/angular.ts +++ b/packages/core/src/generators/angular.ts @@ -260,6 +260,37 @@ const processAngularCode = (newCode) => stripStateAndPropsRefs(newCode, { replaceWith }), ); +const defaultImportMapper = (standalone?: boolean) => { + return (_component: any, theImport: any, importedValues: any, componentsUsed: any) => { + let importPath = theImport.path; + + const { defaultImport, namedImports, starImport } = importedValues; + + let importValue; + + if (starImport) { + importValue = ` * as ${starImport} `; + } else { + importValue = [defaultImport, namedImports] + .filter(Boolean) + .map((importName) => { + if (!standalone) { + for (const usedComponentName of componentsUsed || []) { + if ((importName || '').indexOf(usedComponentName) > -1) { + // replace the component name with the module name + return (importName || '').replace(usedComponentName, `${usedComponentName}Module`); + } + } + } + return importName; + }) + .join(', '); + } + + return `import ${importValue} from '${importPath}';`; + }; +}; + const DEFAULT_OPTIONS: ToAngularOptions = { preserveImports: false, preserveFileExtensions: false, @@ -467,7 +498,7 @@ export const componentToAngular: TranspilerGenerator = excludeMitosisComponents: !options.standalone && !options.preserveImports, preserveFileExtensions: options.preserveFileExtensions, componentsUsed, - importMapper: options?.importMapper, + importMapper: options?.importMapper || defaultImportMapper(options.standalone), })} @Component({ From d2928dc66f99689f7d5f67934cb923b1bb99fd87 Mon Sep 17 00:00:00 2001 From: Sean Perkins Date: Wed, 21 Jun 2023 22:37:03 -0400 Subject: [PATCH 2/3] refactor: move DEFAULT_OPTIONS into generator --- packages/core/src/generators/angular.ts | 74 ++++++++++++------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/packages/core/src/generators/angular.ts b/packages/core/src/generators/angular.ts index c2b66f69e6..68bc000160 100644 --- a/packages/core/src/generators/angular.ts +++ b/packages/core/src/generators/angular.ts @@ -260,42 +260,6 @@ const processAngularCode = (newCode) => stripStateAndPropsRefs(newCode, { replaceWith }), ); -const defaultImportMapper = (standalone?: boolean) => { - return (_component: any, theImport: any, importedValues: any, componentsUsed: any) => { - let importPath = theImport.path; - - const { defaultImport, namedImports, starImport } = importedValues; - - let importValue; - - if (starImport) { - importValue = ` * as ${starImport} `; - } else { - importValue = [defaultImport, namedImports] - .filter(Boolean) - .map((importName) => { - if (!standalone) { - for (const usedComponentName of componentsUsed || []) { - if ((importName || '').indexOf(usedComponentName) > -1) { - // replace the component name with the module name - return (importName || '').replace(usedComponentName, `${usedComponentName}Module`); - } - } - } - return importName; - }) - .join(', '); - } - - return `import ${importValue} from '${importPath}';`; - }; -}; - -const DEFAULT_OPTIONS: ToAngularOptions = { - preserveImports: false, - preserveFileExtensions: false, -}; - export const componentToAngular: TranspilerGenerator = (userOptions = {}) => ({ component: _component }) => { @@ -307,6 +271,42 @@ export const componentToAngular: TranspilerGenerator = const outputVars = uniq([...metaOutputVars, ...getPropFunctions(json)]); const stateVars = Object.keys(json?.state || {}); + const DEFAULT_OPTIONS: ToAngularOptions = { + preserveImports: false, + preserveFileExtensions: false, + importMapper: (_component: any, theImport: any, importedValues: any, componentsUsed: any) => { + let importPath = theImport.path; + + const { defaultImport, namedImports, starImport } = importedValues; + + let importValue; + + if (starImport) { + importValue = ` * as ${starImport} `; + } else { + importValue = [defaultImport, namedImports] + .filter(Boolean) + .map((importName) => { + if (!userOptions.standalone) { + for (const usedComponentName of componentsUsed || []) { + if ((importName || '').indexOf(usedComponentName) > -1) { + // replace the component name with the module name + return (importName || '').replace( + usedComponentName, + `${usedComponentName}Module`, + ); + } + } + } + return importName; + }) + .join(', '); + } + + return `import ${importValue} from '${importPath}';`; + }, + }; + const options = initializeOptions('angular', DEFAULT_OPTIONS, userOptions); options.plugins = [ ...(options.plugins || []), @@ -498,7 +498,7 @@ export const componentToAngular: TranspilerGenerator = excludeMitosisComponents: !options.standalone && !options.preserveImports, preserveFileExtensions: options.preserveFileExtensions, componentsUsed, - importMapper: options?.importMapper || defaultImportMapper(options.standalone), + importMapper: options?.importMapper, })} @Component({ From b6a05e9e03bd6f4551f46c846690f7ad6302d397 Mon Sep 17 00:00:00 2001 From: Sean Perkins Date: Wed, 21 Jun 2023 22:39:55 -0400 Subject: [PATCH 3/3] chore: update snapshots --- .../__snapshots__/angular.import.test.ts.snap | 74 ++++++------- .../__snapshots__/angular.test.ts.snap | 102 +++++++++--------- 2 files changed, 90 insertions(+), 86 deletions(-) diff --git a/packages/core/src/__tests__/__snapshots__/angular.import.test.ts.snap b/packages/core/src/__tests__/__snapshots__/angular.import.test.ts.snap index 3b2253e1a8..b24bb63888 100644 --- a/packages/core/src/__tests__/__snapshots__/angular.import.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/angular.import.test.ts.snap @@ -343,7 +343,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component, Input } from \\"@angular/core\\"; -import MyBooleanAttributeComponent from \\"./basic-boolean-attribute-component.raw\\"; +import MyBooleanAttributeComponentModule from \\"./basic-boolean-attribute-component.raw\\"; @Component({ selector: \\"my-boolean-attribute, MyBooleanAttribute\\", @@ -386,8 +386,8 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import MyBasicOnMountUpdateComponent from \\"./basic-onMount-update.raw\\"; -import MyBasicComponent from \\"./basic.raw\\"; +import MyBasicOnMountUpdateComponentModule from \\"./basic-onMount-update.raw\\"; +import MyBasicComponentModule from \\"./basic.raw\\"; @Component({ selector: \\"my-basic-child-component, MyBasicChildComponent\\", @@ -984,7 +984,7 @@ import { Component, ViewChild, ElementRef, Input } from \\"@angular/core\\"; import { Builder, builder } from \\"@builder.io/sdk\\"; import { - BuilderBlock as BuilderBlockComponent, + BuilderBlock as BuilderBlockComponentModule, BuilderBlocks, get, set, @@ -1701,7 +1701,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import ContentSlotCode from \\"./content-slot-jsx.raw\\"; +import ContentSlotCodeModule from \\"./content-slot-jsx.raw\\"; @Component({ selector: \\"slot-code, SlotCode\\", @@ -1730,7 +1730,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import ContentSlotCode from \\"./content-slot-jsx.raw\\"; +import ContentSlotCodeModule from \\"./content-slot-jsx.raw\\"; @Component({ selector: \\"slot-code, SlotCode\\", @@ -2662,7 +2662,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component, Input } from \\"@angular/core\\"; -import RenderBlock from \\"./builder-render-block.raw\\"; +import RenderBlockModule from \\"./builder-render-block.raw\\"; @Component({ selector: \\"render-content, RenderContent\\", @@ -3272,12 +3272,12 @@ import { getBlockComponentOptions } from \\"../../functions/get-block-component- import { getBlockProperties } from \\"../../functions/get-block-properties.js\\"; import { getBlockTag } from \\"../../functions/get-block-tag.js\\"; import { getProcessedBlock } from \\"../../functions/get-processed-block.js\\"; -import { getReactNativeBlockStyles } from \\"../../functions/get-react-native-block-styles.js\\"; -import BlockStyles from \\"./block-styles.lite\\"; +import { getReactNativeBlockStylesModule } from \\"../../functions/get-react-native-block-styles.js\\"; +import BlockStylesModule from \\"./block-styles.lite\\"; import { isEmptyHtmlElement } from \\"./render-block.helpers.js\\"; import RenderComponentWithContext from \\"./render-component-with-context.lite\\"; import RenderComponent from \\"./render-component.lite\\"; -import RenderRepeatedBlock from \\"./render-repeated-block.lite\\"; +import RenderRepeatedBlockModule from \\"./render-repeated-block.lite\\"; @Component({ selector: \\"render-block, RenderBlock\\", @@ -3527,7 +3527,7 @@ import { sendComponentsToVisualEditor, trackClick, } from \\"@dummy/injection-js\\"; -import RenderBlocks from \\"@dummy/RenderBlocks.lite.tsx\\"; +import RenderBlocksModule from \\"@dummy/RenderBlocks.lite.tsx\\"; @Component({ selector: \\"render-content, RenderContent\\", @@ -3872,7 +3872,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import Foo from \\"./foo-sub-component.lite\\"; +import FooModule from \\"./foo-sub-component.lite\\"; @Component({ selector: \\"sub-component, SubComponent\\", @@ -4478,7 +4478,7 @@ type Props = { type: string; }; -import MyBooleanAttributeComponent from \\"./basic-boolean-attribute-component.raw\\"; +import MyBooleanAttributeComponentModule from \\"./basic-boolean-attribute-component.raw\\"; @Component({ selector: \\"my-boolean-attribute, MyBooleanAttribute\\", @@ -4521,8 +4521,8 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import MyBasicOnMountUpdateComponent from \\"./basic-onMount-update.raw\\"; -import MyBasicComponent from \\"./basic.raw\\"; +import MyBasicOnMountUpdateComponentModule from \\"./basic-onMount-update.raw\\"; +import MyBasicComponentModule from \\"./basic.raw\\"; @Component({ selector: \\"my-basic-child-component, MyBasicChildComponent\\", @@ -4905,7 +4905,7 @@ type Props = { slotTesting: JSX.Element; }; -import type { JSX } from \\"../../../../jsx-runtime\\"; +import { JSX } from \\"../../../../jsx-runtime\\"; @Component({ selector: \\"content-slot-code, ContentSlotCode\\", @@ -4949,7 +4949,7 @@ const defaultProps = { slotContent: undefined, }; -import type { JSX } from \\"../../../../jsx-runtime\\"; +import { JSX } from \\"../../../../jsx-runtime\\"; @Component({ selector: \\"content-slot-jsx-code, ContentSlotJsxCode\\", @@ -5199,7 +5199,7 @@ export type FormState = \\"unsubmitted\\" | \\"sending\\" | \\"success\\" | \\"e import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; import { - BuilderBlock as BuilderBlockComponent, + BuilderBlock as BuilderBlockComponentModule, BuilderBlocks, get, set, @@ -6005,7 +6005,7 @@ type Props = { [key: string]: string; }; -import ContentSlotCode from \\"./content-slot-jsx.raw\\"; +import ContentSlotCodeModule from \\"./content-slot-jsx.raw\\"; @Component({ selector: \\"slot-code, SlotCode\\", @@ -6038,7 +6038,7 @@ type Props = { [key: string]: string; }; -import ContentSlotCode from \\"./content-slot-jsx.raw\\"; +import ContentSlotCodeModule from \\"./content-slot-jsx.raw\\"; @Component({ selector: \\"slot-code, SlotCode\\", @@ -6714,7 +6714,7 @@ type Props = { slotTesting: JSX.Element; }; -import type { JSX } from \\"../../../../jsx-runtime\\"; +import { JSX } from \\"../../../../jsx-runtime\\"; @Component({ selector: \\"class-name-code, ClassNameCode\\", @@ -7080,7 +7080,9 @@ type RenderContentProps = { }; import { BuilderContent, GetContentOptions } from \\"@builder.io/sdk\\"; -import RenderBlock, { RenderBlockProps } from \\"./builder-render-block.raw\\"; +import RenderBlockModule, { + RenderBlockModuleProps, +} from \\"./builder-render-block.raw\\"; @Component({ selector: \\"render-content, RenderContent\\", @@ -7739,7 +7741,7 @@ export type RenderBlockProps = { }; import { TARGET } from \\"../../constants/target.js\\"; -import type { +import { BuilderContextInterface, RegisteredComponent, } from \\"../../context/types.js\\"; @@ -7750,16 +7752,16 @@ import { getBlockComponentOptions } from \\"../../functions/get-block-component- import { getBlockProperties } from \\"../../functions/get-block-properties.js\\"; import { getBlockTag } from \\"../../functions/get-block-tag.js\\"; import { getProcessedBlock } from \\"../../functions/get-processed-block.js\\"; -import { getReactNativeBlockStyles } from \\"../../functions/get-react-native-block-styles.js\\"; -import type { BuilderBlock } from \\"../../types/builder-block.js\\"; -import type { Nullable } from \\"../../types/typescript.js\\"; -import BlockStyles from \\"./block-styles.lite\\"; +import { getReactNativeBlockStylesModule } from \\"../../functions/get-react-native-block-styles.js\\"; +import { BuilderBlock } from \\"../../types/builder-block.js\\"; +import { Nullable } from \\"../../types/typescript.js\\"; +import BlockStylesModule from \\"./block-styles.lite\\"; import { isEmptyHtmlElement } from \\"./render-block.helpers.js\\"; import RenderComponentWithContext from \\"./render-component-with-context.lite\\"; -import type { RenderComponentProps } from \\"./render-component.lite\\"; +import { RenderComponentProps } from \\"./render-component.lite\\"; import RenderComponent from \\"./render-component.lite\\"; -import RenderRepeatedBlock from \\"./render-repeated-block.lite\\"; -import type { RepeatData } from \\"./types.js\\"; +import RenderRepeatedBlockModule from \\"./render-repeated-block.lite\\"; +import { RepeatData } from \\"./types.js\\"; @Component({ selector: \\"render-block, RenderBlock\\", @@ -8017,7 +8019,7 @@ import { sendComponentsToVisualEditor, trackClick, } from \\"@dummy/injection-js\\"; -import RenderBlocks from \\"@dummy/RenderBlocks.lite.tsx\\"; +import RenderBlocksModule from \\"@dummy/RenderBlocks.lite.tsx\\"; @Component({ selector: \\"render-content, RenderContent\\", @@ -8382,7 +8384,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import Foo from \\"./foo-sub-component.lite\\"; +import FooModule from \\"./foo-sub-component.lite\\"; @Component({ selector: \\"sub-component, SubComponent\\", @@ -8458,8 +8460,8 @@ export type TypeDependencyProps = { foo2: Foo2; }; -import type { Foo } from \\"./foo-type\\"; -import type { Foo as Foo2 } from \\"./type-export.lite\\"; +import { Foo } from \\"./foo-type\\"; +import { Foo as Foo2 } from \\"./type-export.lite\\"; @Component({ selector: \\"type-dependency, TypeDependency\\", @@ -8916,7 +8918,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import Button from \\"./Button.lite\\"; +import ButtonModule from \\"./Button.lite\\"; @Component({ selector: \\"my-component, MyComponent\\", @@ -9445,7 +9447,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import Button from \\"./Button.lite\\"; +import ButtonModule from \\"./Button.lite\\"; @Component({ selector: \\"my-component, MyComponent\\", diff --git a/packages/core/src/__tests__/__snapshots__/angular.test.ts.snap b/packages/core/src/__tests__/__snapshots__/angular.test.ts.snap index c145582a5d..cd4d46fa9d 100644 --- a/packages/core/src/__tests__/__snapshots__/angular.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/angular.test.ts.snap @@ -624,7 +624,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component, Input } from \\"@angular/core\\"; -import MyBooleanAttributeComponent from \\"./basic-boolean-attribute-component.raw\\"; +import MyBooleanAttributeComponentModule from \\"./basic-boolean-attribute-component.raw\\"; @Component({ selector: \\"my-boolean-attribute, MyBooleanAttribute\\", @@ -703,8 +703,8 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import MyBasicOnMountUpdateComponent from \\"./basic-onMount-update.raw\\"; -import MyBasicComponent from \\"./basic.raw\\"; +import MyBasicOnMountUpdateComponentModule from \\"./basic-onMount-update.raw\\"; +import MyBasicComponentModule from \\"./basic.raw\\"; @Component({ selector: \\"my-basic-child-component, MyBasicChildComponent\\", @@ -1816,7 +1816,7 @@ import { Component, ViewChild, ElementRef, Input } from \\"@angular/core\\"; import { Builder, builder } from \\"@builder.io/sdk\\"; import { - BuilderBlock as BuilderBlockComponent, + BuilderBlock as BuilderBlockComponentModule, BuilderBlocks, get, set, @@ -3182,7 +3182,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import ContentSlotCode from \\"./content-slot-jsx.raw\\"; +import ContentSlotCodeModule from \\"./content-slot-jsx.raw\\"; @Component({ selector: \\"slot-code, SlotCode\\", @@ -3233,7 +3233,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import ContentSlotCode from \\"./content-slot-jsx.raw\\"; +import ContentSlotCodeModule from \\"./content-slot-jsx.raw\\"; @Component({ selector: \\"slot-code, SlotCode\\", @@ -4598,7 +4598,7 @@ exports[`Angular > jsx > Javascript Test > contentState 2`] = ` "import { Component, Input } from \\"@angular/core\\"; import { CommonModule } from \\"@angular/common\\"; -import BuilderContext from \\"@dummy/context\\"; +import BuilderContext from \\"@dummy/context.lite\\"; @Component({ selector: \\"render-content, RenderContent\\", @@ -4927,7 +4927,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component, Input } from \\"@angular/core\\"; -import RenderBlock from \\"./builder-render-block.raw\\"; +import RenderBlockModule from \\"./builder-render-block.raw\\"; @Component({ selector: \\"render-content, RenderContent\\", @@ -6006,7 +6006,7 @@ import { getBlockComponentOptions } from \\"../../functions/get-block-component- import { getBlockProperties } from \\"../../functions/get-block-properties.js\\"; import { getBlockTag } from \\"../../functions/get-block-tag.js\\"; import { getProcessedBlock } from \\"../../functions/get-processed-block.js\\"; -import { getReactNativeBlockStyles } from \\"../../functions/get-react-native-block-styles.js\\"; +import { getReactNativeBlockStylesModule } from \\"../../functions/get-react-native-block-styles.js\\"; import { isEmptyHtmlElement } from \\"./render-block.helpers.js\\"; @Component({ @@ -6258,11 +6258,11 @@ import { getBlockProperties } from \\"../../functions/get-block-properties.js\\" import { getBlockTag } from \\"../../functions/get-block-tag.js\\"; import { getProcessedBlock } from \\"../../functions/get-processed-block.js\\"; import { getReactNativeBlockStyles } from \\"../../functions/get-react-native-block-styles.js\\"; -import BlockStyles from \\"./block-styles\\"; +import BlockStyles from \\"./block-styles.lite\\"; import { isEmptyHtmlElement } from \\"./render-block.helpers.js\\"; -import RenderComponentWithContext from \\"./render-component-with-context\\"; -import RenderComponent from \\"./render-component\\"; -import RenderRepeatedBlock from \\"./render-repeated-block\\"; +import RenderComponentWithContext from \\"./render-component-with-context.lite\\"; +import RenderComponent from \\"./render-component.lite\\"; +import RenderRepeatedBlock from \\"./render-repeated-block.lite\\"; @Component({ selector: \\"render-block, RenderBlock\\", @@ -6546,7 +6546,7 @@ exports[`Angular > jsx > Javascript Test > renderContentExample 2`] = ` "import { Component, Input } from \\"@angular/core\\"; import { CommonModule } from \\"@angular/common\\"; -import BuilderContext from \\"@dummy/context\\"; +import BuilderContext from \\"@dummy/context.lite\\"; import { dispatchNewContentToVisualEditor, sendComponentsToVisualEditor, @@ -7140,7 +7140,7 @@ exports[`Angular > jsx > Javascript Test > subComponent 2`] = ` "import { Component } from \\"@angular/core\\"; import { CommonModule } from \\"@angular/common\\"; -import Foo from \\"./foo-sub-component\\"; +import Foo from \\"./foo-sub-component.lite\\"; @Component({ selector: \\"sub-component, SubComponent\\", @@ -8212,7 +8212,7 @@ type Props = { type: string; }; -import MyBooleanAttributeComponent from \\"./basic-boolean-attribute-component.raw\\"; +import MyBooleanAttributeComponentModule from \\"./basic-boolean-attribute-component.raw\\"; @Component({ selector: \\"my-boolean-attribute, MyBooleanAttribute\\", @@ -8296,8 +8296,8 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import MyBasicOnMountUpdateComponent from \\"./basic-onMount-update.raw\\"; -import MyBasicComponent from \\"./basic.raw\\"; +import MyBasicOnMountUpdateComponentModule from \\"./basic-onMount-update.raw\\"; +import MyBasicComponentModule from \\"./basic.raw\\"; @Component({ selector: \\"my-basic-child-component, MyBasicChildComponent\\", @@ -9006,7 +9006,7 @@ type Props = { slotTesting: JSX.Element; }; -import type { JSX } from \\"../../../../jsx-runtime\\"; +import { JSX } from \\"../../../../jsx-runtime\\"; @Component({ selector: \\"content-slot-code, ContentSlotCode\\", @@ -9044,7 +9044,7 @@ type Props = { slotTesting: JSX.Element; }; -import type { JSX } from \\"../../../../jsx-runtime\\"; +import { JSX } from \\"../../../../jsx-runtime\\"; @Component({ selector: \\"content-slot-code, ContentSlotCode\\", @@ -9083,7 +9083,7 @@ const defaultProps = { slotContent: undefined, }; -import type { JSX } from \\"../../../../jsx-runtime\\"; +import { JSX } from \\"../../../../jsx-runtime\\"; @Component({ selector: \\"content-slot-jsx-code, ContentSlotJsxCode\\", @@ -9144,7 +9144,7 @@ const defaultProps = { slotContent: undefined, }; -import type { JSX } from \\"../../../../jsx-runtime\\"; +import { JSX } from \\"../../../../jsx-runtime\\"; @Component({ selector: \\"content-slot-jsx-code, ContentSlotJsxCode\\", @@ -9545,7 +9545,7 @@ export type FormState = \\"unsubmitted\\" | \\"sending\\" | \\"success\\" | \\"e import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; import { - BuilderBlock as BuilderBlockComponent, + BuilderBlock as BuilderBlockComponentModule, BuilderBlocks, get, set, @@ -11109,7 +11109,7 @@ type Props = { [key: string]: string; }; -import ContentSlotCode from \\"./content-slot-jsx.raw\\"; +import ContentSlotCodeModule from \\"./content-slot-jsx.raw\\"; @Component({ selector: \\"slot-code, SlotCode\\", @@ -11168,7 +11168,7 @@ type Props = { [key: string]: string; }; -import ContentSlotCode from \\"./content-slot-jsx.raw\\"; +import ContentSlotCodeModule from \\"./content-slot-jsx.raw\\"; @Component({ selector: \\"slot-code, SlotCode\\", @@ -12414,7 +12414,7 @@ type Props = { slotTesting: JSX.Element; }; -import type { JSX } from \\"../../../../jsx-runtime\\"; +import { JSX } from \\"../../../../jsx-runtime\\"; @Component({ selector: \\"class-name-code, ClassNameCode\\", @@ -12448,7 +12448,7 @@ type Props = { slotTesting: JSX.Element; }; -import type { JSX } from \\"../../../../jsx-runtime\\"; +import { JSX } from \\"../../../../jsx-runtime\\"; @Component({ selector: \\"class-name-code, ClassNameCode\\", @@ -12699,7 +12699,7 @@ exports[`Angular > jsx > Typescript Test > contentState 2`] = ` "import { Component, Input } from \\"@angular/core\\"; import { CommonModule } from \\"@angular/common\\"; -import BuilderContext from \\"@dummy/context\\"; +import BuilderContext from \\"@dummy/context.lite\\"; @Component({ selector: \\"render-content, RenderContent\\", @@ -13079,7 +13079,9 @@ type RenderContentProps = { }; import { BuilderContent, GetContentOptions } from \\"@builder.io/sdk\\"; -import RenderBlock, { RenderBlockProps } from \\"./builder-render-block.raw\\"; +import RenderBlockModule, { + RenderBlockModuleProps, +} from \\"./builder-render-block.raw\\"; @Component({ selector: \\"render-content, RenderContent\\", @@ -14265,7 +14267,7 @@ export type RenderBlockProps = { }; import { TARGET } from \\"../../constants/target.js\\"; -import type { +import { BuilderContextInterface, RegisteredComponent, } from \\"../../context/types.js\\"; @@ -14276,11 +14278,11 @@ import { getBlockComponentOptions } from \\"../../functions/get-block-component- import { getBlockProperties } from \\"../../functions/get-block-properties.js\\"; import { getBlockTag } from \\"../../functions/get-block-tag.js\\"; import { getProcessedBlock } from \\"../../functions/get-processed-block.js\\"; -import { getReactNativeBlockStyles } from \\"../../functions/get-react-native-block-styles.js\\"; -import type { BuilderBlock } from \\"../../types/builder-block.js\\"; -import type { Nullable } from \\"../../types/typescript.js\\"; +import { getReactNativeBlockStylesModule } from \\"../../functions/get-react-native-block-styles.js\\"; +import { BuilderBlock } from \\"../../types/builder-block.js\\"; +import { Nullable } from \\"../../types/typescript.js\\"; import { isEmptyHtmlElement } from \\"./render-block.helpers.js\\"; -import type { RepeatData } from \\"./types.js\\"; +import { RepeatData } from \\"./types.js\\"; @Component({ selector: \\"render-block, RenderBlock\\", @@ -14528,7 +14530,7 @@ export type RenderBlockProps = { }; import { TARGET } from \\"../../constants/target.js\\"; -import type { +import { BuilderContextInterface, RegisteredComponent, } from \\"../../context/types.js\\"; @@ -14540,15 +14542,15 @@ import { getBlockProperties } from \\"../../functions/get-block-properties.js\\" import { getBlockTag } from \\"../../functions/get-block-tag.js\\"; import { getProcessedBlock } from \\"../../functions/get-processed-block.js\\"; import { getReactNativeBlockStyles } from \\"../../functions/get-react-native-block-styles.js\\"; -import type { BuilderBlock } from \\"../../types/builder-block.js\\"; -import type { Nullable } from \\"../../types/typescript.js\\"; -import BlockStyles from \\"./block-styles\\"; +import { BuilderBlock } from \\"../../types/builder-block.js\\"; +import { Nullable } from \\"../../types/typescript.js\\"; +import BlockStyles from \\"./block-styles.lite\\"; import { isEmptyHtmlElement } from \\"./render-block.helpers.js\\"; -import RenderComponentWithContext from \\"./render-component-with-context\\"; -import type { RenderComponentProps } from \\"./render-component\\"; -import RenderComponent from \\"./render-component\\"; -import RenderRepeatedBlock from \\"./render-repeated-block\\"; -import type { RepeatData } from \\"./types.js\\"; +import RenderComponentWithContext from \\"./render-component-with-context.lite\\"; +import { RenderComponentProps } from \\"./render-component.lite\\"; +import RenderComponent from \\"./render-component.lite\\"; +import RenderRepeatedBlock from \\"./render-repeated-block.lite\\"; +import { RepeatData } from \\"./types.js\\"; @Component({ selector: \\"render-block, RenderBlock\\", @@ -14848,7 +14850,7 @@ type Props = { }; }; -import BuilderContext from \\"@dummy/context\\"; +import BuilderContext from \\"@dummy/context.lite\\"; import { dispatchNewContentToVisualEditor, sendComponentsToVisualEditor, @@ -15482,7 +15484,7 @@ exports[`Angular > jsx > Typescript Test > subComponent 2`] = ` "import { Component } from \\"@angular/core\\"; import { CommonModule } from \\"@angular/common\\"; -import Foo from \\"./foo-sub-component\\"; +import Foo from \\"./foo-sub-component.lite\\"; @Component({ selector: \\"sub-component, SubComponent\\", @@ -15592,7 +15594,7 @@ export type TypeDependencyProps = { foo2: Foo2; }; -import type { Foo } from \\"./foo-type\\"; +import { Foo } from \\"./foo-type\\"; @Component({ selector: \\"type-dependency, TypeDependency\\", @@ -15622,8 +15624,8 @@ export type TypeDependencyProps = { foo2: Foo2; }; -import type { Foo } from \\"./foo-type\\"; -import type { Foo as Foo2 } from \\"./type-export\\"; +import { Foo } from \\"./foo-type\\"; +import { Foo as Foo2 } from \\"./type-export.lite\\"; @Component({ selector: \\"type-dependency, TypeDependency\\", @@ -16441,7 +16443,7 @@ exports[`Angular > svelte > Javascript Test > imports 2`] = ` "import { Component } from \\"@angular/core\\"; import { CommonModule } from \\"@angular/common\\"; -import Button from \\"./Button\\"; +import Button from \\"./Button.lite\\"; @Component({ selector: \\"my-component, MyComponent\\", @@ -17385,7 +17387,7 @@ exports[`Angular > svelte > Typescript Test > imports 2`] = ` "import { Component } from \\"@angular/core\\"; import { CommonModule } from \\"@angular/common\\"; -import Button from \\"./Button\\"; +import Button from \\"./Button.lite\\"; @Component({ selector: \\"my-component, MyComponent\\",