diff --git a/__snapshots__/custom-select/showcase/webkit/DBCustomSelect-should-match-screenshot-1/DBCustomSelect-should-match-screenshot.png b/__snapshots__/custom-select/showcase/webkit/DBCustomSelect-should-match-screenshot-1/DBCustomSelect-should-match-screenshot.png index 5513c2fe359c..f9e5deabfe21 100644 Binary files a/__snapshots__/custom-select/showcase/webkit/DBCustomSelect-should-match-screenshot-1/DBCustomSelect-should-match-screenshot.png and b/__snapshots__/custom-select/showcase/webkit/DBCustomSelect-should-match-screenshot-1/DBCustomSelect-should-match-screenshot.png differ diff --git a/package-lock.json b/package-lock.json index 86e6a07acfd3..3dcf3839b664 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3499,10 +3499,11 @@ } }, "node_modules/@builder.io/mitosis": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@builder.io/mitosis/-/mitosis-0.10.0.tgz", - "integrity": "sha512-/4muYT6Mzj+5ZGjcw4EwMgUejRElFjrUik02RKoRRkL5XolovSh54uVyCeoulRnmEu/ivF0kyGhzLOaipdDpRg==", + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@builder.io/mitosis/-/mitosis-0.12.1.tgz", + "integrity": "sha512-6jwAbTUb5fnYqGVe1Ll4JWrJmJJEkAkG1T4k9Jx+z9/7SzBzNnwo19EXEKlSE8FnHod0i6+sx5j/tcWoD9fplw==", "dev": true, + "license": "MIT", "dependencies": { "@angular/compiler": "^11.2.11", "@babel/core": "7.14.5", @@ -3530,12 +3531,14 @@ } }, "node_modules/@builder.io/mitosis-cli": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@builder.io/mitosis-cli/-/mitosis-cli-0.10.0.tgz", - "integrity": "sha512-EnkZ5Uh35jQ7GGZRb5m0ctBUZru0siZ3geSIY9RH/pcFJyB4E7WkxbHfWsAVq5YDlj0Zk4Ufs0Qy1cvXARKYYA==", + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@builder.io/mitosis-cli/-/mitosis-cli-0.12.1.tgz", + "integrity": "sha512-XzCZkerE+ZgZ4hbliHhA4z81vSMhO7s3ZS9aUTeZCuQNjw5yBQEirs5vlNJL6PBQipgQRJLtVwuhQOXxODe5ow==", "dev": true, + "license": "MIT", "dependencies": { - "@builder.io/mitosis": "0.10.0", + "@builder.io/mitosis": "0.12.1", + "cosmiconfig": "9.0.0", "debug": "^4.3.4", "dedent": "^0.7.0", "esbuild": "^0.12.16", @@ -3581,6 +3584,7 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-11.2.14.tgz", "integrity": "sha512-XBOK3HgA+/y6Cz7kOX4zcJYmgJ264XnfcbXUMU2cD7Ac+mbNhLPKohWrEiSWalfcjnpf5gRfufQrQP7lpAGu0A==", "dev": true, + "license": "MIT", "dependencies": { "tslib": "^2.0.0" } @@ -3590,6 +3594,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.5.tgz", "integrity": "sha512-RN/AwP2DJmQTZSfiDaD+JQQ/J99KsIpOCfBE5pL+5jJSt7nI3nYGoAXZu+ffYSQ029NLs2DstZb+eR81uuARgg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.14.5", "@babel/generator": "^7.14.5", @@ -3620,6 +3625,7 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin-prettier.js" }, @@ -3635,6 +3641,7 @@ "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-3.2.4.tgz", "integrity": "sha512-6m8WBhIp0dfwu0SkgfOxJqh+HpdyfqSSLfKKRZSFbDuEQXDDndb8fTpRWkUrX/uBenkex3MgnVk0J3b3Y5byog==", "dev": true, + "license": "MIT", "peerDependencies": { "@volar/vue-language-plugin-pug": "^1.0.4", "@volar/vue-typescript": "^1.0.4", @@ -3655,6 +3662,7 @@ "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-2.10.1.tgz", "integrity": "sha512-Wlq7Z5v2ueCubWo0TZzKc9XHcm7TDxqcuzRuGd0gcENfzfT4JZ9yDlCbEgxWgiPmLHkBjfOtpAWkcT28MCDpUQ==", "dev": true, + "license": "MIT", "peerDependencies": { "prettier": "^1.16.4 || ^2.0.0", "svelte": "^3.2.0 || ^4.0.0-next.0" @@ -3665,6 +3673,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -3674,6 +3683,7 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -42560,8 +42570,8 @@ }, "devDependencies": { "@builder.io/eslint-plugin-mitosis": "0.0.17", - "@builder.io/mitosis": "0.10.0", - "@builder.io/mitosis-cli": "0.10.0", + "@builder.io/mitosis": "0.12.1", + "@builder.io/mitosis-cli": "0.12.1", "@typescript-eslint/eslint-plugin": "8.37.0", "cpr": "3.0.1", "cssnano": "7.1.0", diff --git a/packages/components/configs/angular/index.cjs b/packages/components/configs/angular/index.cjs index 89d4c2139402..827e59f644d0 100644 --- a/packages/components/configs/angular/index.cjs +++ b/packages/components/configs/angular/index.cjs @@ -6,6 +6,7 @@ const onClickPlugin = require('../plugins/on-click.cjs'); module.exports = { typescript: true, attributePassing: { + enabled: true, customRef: '_ref' }, api: 'signals', diff --git a/packages/components/package.json b/packages/components/package.json index 33d19959f39b..0c58bc91fef4 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -46,8 +46,8 @@ }, "devDependencies": { "@builder.io/eslint-plugin-mitosis": "0.0.17", - "@builder.io/mitosis": "0.10.0", - "@builder.io/mitosis-cli": "0.10.0", + "@builder.io/mitosis": "0.12.1", + "@builder.io/mitosis-cli": "0.12.1", "@typescript-eslint/eslint-plugin": "8.37.0", "cpr": "3.0.1", "cssnano": "7.1.0", diff --git a/packages/components/scripts/post-build/angular.ts b/packages/components/scripts/post-build/angular.ts index e4846d39986a..313560688d26 100644 --- a/packages/components/scripts/post-build/angular.ts +++ b/packages/components/scripts/post-build/angular.ts @@ -1,6 +1,6 @@ import { replaceInFileSync } from 'replace-in-file'; -import { readFileSync, writeFileSync } from 'node:fs'; +import { writeFileSync } from 'node:fs'; import components, { Overwrite } from './components.js'; @@ -21,7 +21,7 @@ const setControlValueAccessorReplacements = ( replacements.push({ from: '} from "@angular/core";', to: - `Renderer2, model } from "@angular/core";\n` + + `Renderer2 } from "@angular/core";\n` + `import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n` }); @@ -58,7 +58,7 @@ const setControlValueAccessorReplacements = ( // insert custom interface functions before ngOnInit // TODO update attribute by config if necessary (e.g. for checked attribute?) replacements.push({ - from: 'ngOnInit()', + from: 'ngAfterViewInit()', to: ` writeValue(value: any) { ${valueAccessorRequired ? 'if(value){' : ''} @@ -83,7 +83,7 @@ const setControlValueAccessorReplacements = ( this.disabled.set(disabled); } - ngOnInit()` + ngAfterViewInit()` }); }; @@ -169,29 +169,12 @@ export default (tmp?: boolean) => { }); const replacements: Overwrite[] = [ - // TODO: We don't need this after Angular drops support for v17 in may 2025 { from: /allowSignalWrites: true,/g, to: '' } ]; - if ( - readFileSync(file) - .toString() - .includes('this.initialized.set(true);') - ) { - // TODO: Solve this in mitosis by splitting onInit and onMount into ngOnInit and ngAfterViewInit - replacements.push({ - from: 'this.initialized.set(true);', - to: '' - }); - replacements.push({ - from: 'ngAfterViewInit() {', - to: 'ngAfterViewInit() {\nthis.initialized.set(true);\n' - }); - } - if (component.config?.angular?.controlValueAccessor) { setControlValueAccessorReplacements( replacements, diff --git a/packages/components/scripts/post-build/components.ts b/packages/components/scripts/post-build/components.ts index 363245f891a2..a614566741c4 100644 --- a/packages/components/scripts/post-build/components.ts +++ b/packages/components/scripts/post-build/components.ts @@ -75,18 +75,7 @@ export const getComponents = (): Component[] => [ { from: 'attr.checked', to: 'checked' - }, - // To remove whitespaces from label... - { - from: `