@wavemaker-ai/react-codegen 1.0.0-rc.330 → 1.0.0-rc.332

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.
Files changed (37) hide show
  1. package/build-react-web.js +14 -0
  2. package/build-react-web.js.map +1 -1
  3. package/dist/transpiler/index.d.mts +5 -0
  4. package/dist/transpiler/index.mjs +257 -186
  5. package/dist/transpiler/index.mjs.map +1 -1
  6. package/dist/transpiler/wm-styles.css +0 -4
  7. package/package-lock.json +106 -89
  8. package/package.json +1 -1
  9. package/src/app.generator.js +44 -15
  10. package/src/app.generator.js.map +1 -1
  11. package/src/externalize-next-scripts.js +166 -0
  12. package/src/externalize-next-scripts.js.map +1 -0
  13. package/src/gen-app-override-css.js +4 -13
  14. package/src/gen-app-override-css.js.map +1 -1
  15. package/src/transpile/components/data/form/form-action.transformer.js +4 -3
  16. package/src/transpile/components/data/form/form-action.transformer.js.map +1 -1
  17. package/src/transpile/components/data/list/list-transformer.js +9 -18
  18. package/src/transpile/components/data/list/list-transformer.js.map +1 -1
  19. package/src/transpile/components/form/button.transformer.js +1 -1
  20. package/src/transpile/components/form/button.transformer.js.map +1 -1
  21. package/src/transpile/components/layout/layout-region-factory.js +10 -0
  22. package/src/transpile/components/layout/layout-region-factory.js.map +1 -1
  23. package/src/transpile/components/page/with-partial-container.js +2 -2
  24. package/src/transpile/components/page/with-partial-container.js.map +1 -1
  25. package/src/transpile/components/transform-register.js +3 -0
  26. package/src/transpile/components/transform-register.js.map +1 -1
  27. package/src/transpile/components/web-component/web-component.transformer.js +26 -0
  28. package/src/transpile/components/web-component/web-component.transformer.js.map +1 -0
  29. package/src/transpile/transpile.js +60 -17
  30. package/src/transpile/transpile.js.map +1 -1
  31. package/src/utils.browser.js +39 -17
  32. package/src/utils.browser.js.map +1 -1
  33. package/src/utils.js +3 -123
  34. package/src/utils.js.map +1 -1
  35. package/templates/component/web-component.tsx +61 -0
  36. package/templates/project/app/wm-globals.css +0 -4
  37. package/templates/project/package.json +4 -4
@@ -1,8 +1,4 @@
1
1
  /* === ./wm-globals.css === */
2
- .app-page .app-header-shrink {
3
- flex-shrink: 0;
4
- }
5
-
6
2
  .wm-app
7
3
  .app-composite-widget:has([disabled]):not(:has([aria-readonly='true'])) {
8
4
  opacity: var(--wm-btn-disabled-opacity);
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@wavemaker-ai/react-codegen",
3
- "version": "1.0.0-rc.330",
3
+ "version": "1.0.0-rc.332",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@wavemaker-ai/react-codegen",
9
- "version": "1.0.0-rc.330",
9
+ "version": "1.0.0-rc.332",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "@angular/compiler": "12.2.1",
@@ -594,6 +594,22 @@
594
594
  "@jridgewell/sourcemap-codec": "^1.4.14"
595
595
  }
596
596
  },
597
+ "node_modules/@napi-rs/lzma-linux-x64-gnu": {
598
+ "version": "1.5.1",
599
+ "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==",
600
+ "cpu": [
601
+ "x64"
602
+ ],
603
+ "dev": true,
604
+ "license": "MIT",
605
+ "optional": true,
606
+ "os": [
607
+ "linux"
608
+ ],
609
+ "engines": {
610
+ "node": "^22.20 || ^24.12 || >=25"
611
+ }
612
+ },
597
613
  "node_modules/@pkgjs/parseargs": {
598
614
  "version": "0.11.0",
599
615
  "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
@@ -604,8 +620,8 @@
604
620
  }
605
621
  },
606
622
  "node_modules/@rollup/rollup-android-arm-eabi": {
607
- "version": "4.62.3",
608
- "integrity": "sha512-c0wdcekXtQvvn5Tsrk/+op/gUArrbWaFduBnTLP2l1cKLSQs4diMWjJw3m6A0DdzT8dAAX95KpkJ3qynCePbmw==",
623
+ "version": "4.62.4",
624
+ "integrity": "sha512-RrPokAb7dmbxFoeO3TloqHyOjgye8RkBhSqmp4aJMIex4c9r46ZstPnleDQOq1t46VOVjwIuwNogIqbodV1Vvg==",
609
625
  "cpu": [
610
626
  "arm"
611
627
  ],
@@ -617,8 +633,8 @@
617
633
  ]
618
634
  },
619
635
  "node_modules/@rollup/rollup-android-arm64": {
620
- "version": "4.62.3",
621
- "integrity": "sha512-3YjElDdWN+qXAFbJ/CzPV+0wspLqh54k/I6GfdYtEJRqg7buSgc1yPM3B+93j1M4neobtkATHZTmxK2AMVGfnA==",
636
+ "version": "4.62.4",
637
+ "integrity": "sha512-JKuJc+pnpks2pjy7L/N3v/cAkZxYlnmuZoD840ldbMI5KDbC4iO9NKwPKYdjYFCMAIIlBzYSFHxIJVYzRo2/8A==",
622
638
  "cpu": [
623
639
  "arm64"
624
640
  ],
@@ -630,8 +646,8 @@
630
646
  ]
631
647
  },
632
648
  "node_modules/@rollup/rollup-darwin-arm64": {
633
- "version": "4.62.3",
634
- "integrity": "sha512-Pch2pFNOxxz1hTjypIdPyRTR6riiwRl84+VcN9djS680fw+Co1nAJINrdpqp7KV0NvyuU8ilZXZCjd7ykJl1GQ==",
649
+ "version": "4.62.4",
650
+ "integrity": "sha512-krw5uS2STmvJ02x0uTXHbqQNuz+9eZ1iw+qXk9dmW2gvV4jV7O2hEoOnuhFrpOPiel1mBFtqbxYZZtC46hXLOw==",
635
651
  "cpu": [
636
652
  "arm64"
637
653
  ],
@@ -643,8 +659,8 @@
643
659
  ]
644
660
  },
645
661
  "node_modules/@rollup/rollup-darwin-x64": {
646
- "version": "4.62.3",
647
- "integrity": "sha512-LEuncFUHFiF8t4yZVZvvZA1wk0pjAscRnsrn1EfTEmN4HXotBi2YtcnLRyaK6UbuczW7xZS5ES+81Rdz8Z0T6g==",
662
+ "version": "4.62.4",
663
+ "integrity": "sha512-wsTxtgApb4PrOsNJIm0FZ1h3WvCC+k9uxLJ4ad75hgoS4NiRes2SoJFlDAyMwiUY8IssDqGcHbXuN0sx1tfF1A==",
648
664
  "cpu": [
649
665
  "x64"
650
666
  ],
@@ -656,8 +672,8 @@
656
672
  ]
657
673
  },
658
674
  "node_modules/@rollup/rollup-freebsd-arm64": {
659
- "version": "4.62.3",
660
- "integrity": "sha512-zvBUvsQUpOWALdDsk6qbS8bXf2VxmPisuudNDrY7x0p0jBdsoZl8HsHczIOgkQiZldmcacMKtBzpoGVNeIe2bQ==",
675
+ "version": "4.62.4",
676
+ "integrity": "sha512-GUOnQlyZe3yAXhWOtOMsn5Qkrv5E5mZXa0thbARWi5Ei2szlVXJFQhddZ4HbAzh8q92w5twp+CQvs/eFanz9YQ==",
661
677
  "cpu": [
662
678
  "arm64"
663
679
  ],
@@ -669,8 +685,8 @@
669
685
  ]
670
686
  },
671
687
  "node_modules/@rollup/rollup-freebsd-x64": {
672
- "version": "4.62.3",
673
- "integrity": "sha512-C2KmNrcSem/AMg984H/dev+si0lieQGdXdR/lYGJnuumXnFb9Y7QdiI62obFdLlxRYLBv4P0eUVIDbD4c1vVvw==",
688
+ "version": "4.62.4",
689
+ "integrity": "sha512-/Y7f3QuxjzPKsjA/rfEDa3+0vXqyjmJ50Ln8dPpCmWkKTrUoWHG1cWhTqaAMLob2m2nESWuC7yGrREz019Ztqg==",
674
690
  "cpu": [
675
691
  "x64"
676
692
  ],
@@ -682,8 +698,8 @@
682
698
  ]
683
699
  },
684
700
  "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
685
- "version": "4.62.3",
686
- "integrity": "sha512-ggXnsTAEzNQx74XpunRsiZ9aBZDsI7XIa0hm2nzR9f4WzH5/f/d73ZSDaC5ejJ8YLY4NW+V3wr0tjOaeCq8hqA==",
701
+ "version": "4.62.4",
702
+ "integrity": "sha512-81wiiX3v7aqy+T+bT61TJ78yJjRquqFFTTbAPt08imfQQzkPIW8t6aJbkTagtCCrXMNc9D66+geqlK7ydLPNqA==",
687
703
  "cpu": [
688
704
  "arm"
689
705
  ],
@@ -695,8 +711,8 @@
695
711
  ]
696
712
  },
697
713
  "node_modules/@rollup/rollup-linux-arm-musleabihf": {
698
- "version": "4.62.3",
699
- "integrity": "sha512-2vng+FlzNUhKZxtej3IUqJgbZoQk2M/dwQM20+ULV0R/E/8tr9/P6uEf2iiGIk4HL0zMKh5Jry7mUHdUOvyGgA==",
714
+ "version": "4.62.4",
715
+ "integrity": "sha512-9kmDIvNZqdoHOBZgNtpTBeLWYO/LVipM3H/j62P8848/l/VPEQL6N3uxU9pvP1oZAsXyC2MEnFP3ovRjo7WYNQ==",
700
716
  "cpu": [
701
717
  "arm"
702
718
  ],
@@ -708,8 +724,8 @@
708
724
  ]
709
725
  },
710
726
  "node_modules/@rollup/rollup-linux-arm64-gnu": {
711
- "version": "4.62.3",
712
- "integrity": "sha512-LLLFZKt4/Nraf9rxDkhiU8QVgLF4WmCkfr0L4fj0fPfIZFBib0DeiFk1hhaYKd03LFAFJcxHslhDFlNJLylf5Q==",
727
+ "version": "4.62.4",
728
+ "integrity": "sha512-CcnXHWnXg69g+DX5VWL3FHts3qMRN2uVEHX+BZvGLdd07/gXkn3ePjYtO1LDJvxkGKVHMclKBRa1QUTH+6toYQ==",
713
729
  "cpu": [
714
730
  "arm64"
715
731
  ],
@@ -721,8 +737,8 @@
721
737
  ]
722
738
  },
723
739
  "node_modules/@rollup/rollup-linux-arm64-musl": {
724
- "version": "4.62.3",
725
- "integrity": "sha512-WJkdQCvS9sWNOUBJZfQRKpZGFBztRzcowI+nndmflKgU4XY+3a420FgTOSKTsVqJbnzSxeT4vaJalpOaPo2YCQ==",
740
+ "version": "4.62.4",
741
+ "integrity": "sha512-iFOibiHnTRuhrWLlRsOQFdZJJIa7S8OwkneJr4ocALP16u5yk6lWLINFwhHaEqBFMsKDUZofLkGos7+CPzGB3g==",
726
742
  "cpu": [
727
743
  "arm64"
728
744
  ],
@@ -734,8 +750,8 @@
734
750
  ]
735
751
  },
736
752
  "node_modules/@rollup/rollup-linux-loong64-gnu": {
737
- "version": "4.62.3",
738
- "integrity": "sha512-PwHXCCS2n64/1Ot6rP1YEYA02MGYBcQlr8CSZZyrUG2O7NH6NklYmvr9v3Jy+5e/eDeNchc/ukmKJi9LuflMIQ==",
753
+ "version": "4.62.4",
754
+ "integrity": "sha512-XnWYMI7euHlb5a871xPja+Gm7DRCFU+FGRrtS2sMq9N8FvqtpagUy6gD4YOemC5MRk9xbh8+jYMEJbigFQwsgA==",
739
755
  "cpu": [
740
756
  "loong64"
741
757
  ],
@@ -747,8 +763,8 @@
747
763
  ]
748
764
  },
749
765
  "node_modules/@rollup/rollup-linux-loong64-musl": {
750
- "version": "4.62.3",
751
- "integrity": "sha512-vUjxINQu3RC8NZS3ykk1gN65gIz8pAopOq2HXuZhiIxHdx7TFvDG+jgrdSgInu1Eza4/Rfi2VzZgyIgEH4WOaw==",
766
+ "version": "4.62.4",
767
+ "integrity": "sha512-qGDAlO0U8xedCcsdRm9oaoQY8DAx/QT7uIxJWhCdx0ceIWX783UC9QSYkdpzAe29wNiVfp24+bZdQmn49o45SQ==",
752
768
  "cpu": [
753
769
  "loong64"
754
770
  ],
@@ -760,8 +776,8 @@
760
776
  ]
761
777
  },
762
778
  "node_modules/@rollup/rollup-linux-ppc64-gnu": {
763
- "version": "4.62.3",
764
- "integrity": "sha512-wzko4aJ13+0G3kGnviCg5gnXFKd40izKsrf2uOw12US4XqprkDrmwOpeW14aSNa37V8bfPcz5Fkob6LZ3BAPmA==",
779
+ "version": "4.62.4",
780
+ "integrity": "sha512-ru4H6ezD7ysA5EiEK6qkkaEb4modH8CTej6kUy/gQi20u3kB3G7Zn8snXXkeJSCOFKG/rbPPtM/+9Wgas1961w==",
765
781
  "cpu": [
766
782
  "ppc64"
767
783
  ],
@@ -773,8 +789,8 @@
773
789
  ]
774
790
  },
775
791
  "node_modules/@rollup/rollup-linux-ppc64-musl": {
776
- "version": "4.62.3",
777
- "integrity": "sha512-8120ue0JUMSwy11stlwnfdX3pPd+WZYGCDBwEHWtIHi6pOpZmsEF5QKB7a/UN+XFdqvobxz98kv8RTqikyCEBw==",
792
+ "version": "4.62.4",
793
+ "integrity": "sha512-2W4MO5WQVJnbJaZdvDb9rhBDuFU1nKIepPFpJUBsTh2k1YY2g+ODViaWuyOAjQ5cOP7NvrvLzt3wvHOoiAvc7w==",
778
794
  "cpu": [
779
795
  "ppc64"
780
796
  ],
@@ -786,8 +802,8 @@
786
802
  ]
787
803
  },
788
804
  "node_modules/@rollup/rollup-linux-riscv64-gnu": {
789
- "version": "4.62.3",
790
- "integrity": "sha512-XLFHnR3tXMjbOCh2vtVJHmxt+995uJsTERQyseFDRA0xxMxyTZPLa3OIUlyFaO4mF/Lu0FjmWHCuPXJT1n/IOg==",
805
+ "version": "4.62.4",
806
+ "integrity": "sha512-+fxjfuoAmVMCYV5QyjoIpu0cp5DOiOTeqYFk1AVaxGr+/ravWLX89XfQmptsoWcaVy/TGf2hexzbUOrCQIL1CQ==",
791
807
  "cpu": [
792
808
  "riscv64"
793
809
  ],
@@ -799,8 +815,8 @@
799
815
  ]
800
816
  },
801
817
  "node_modules/@rollup/rollup-linux-riscv64-musl": {
802
- "version": "4.62.3",
803
- "integrity": "sha512-se6yXvNGMIl0f+RQzyh7XAmia8/9kplQx424wnG2w0C1oi6XgO6Y8otKhdXFHbHs88Ihavzmvh1NWjuovE76BQ==",
818
+ "version": "4.62.4",
819
+ "integrity": "sha512-jTn8JfHGL4djjFxPuM06LmNUJDsst2jeVlsd9OmIH6zc5sC9K6rIuO4YajXatLUpBmBKl6b35ro1QZocLi+tcA==",
804
820
  "cpu": [
805
821
  "riscv64"
806
822
  ],
@@ -812,8 +828,8 @@
812
828
  ]
813
829
  },
814
830
  "node_modules/@rollup/rollup-linux-s390x-gnu": {
815
- "version": "4.62.3",
816
- "integrity": "sha512-gNoxRefktVIiGflpONuxWWXZAzIQG++z9qHO3xKwk4WdDMuQja3JHGfE1u0i3PfPDyvhypdk+WrgIJqLhGG7sg==",
831
+ "version": "4.62.4",
832
+ "integrity": "sha512-oCJCJL4pXsoDcP2QZ+JVlPTIRc6266zsIaeJJsWImmF7HO0W8nb6HuSgZlMWxJwaPf8ehbSw8yo0EUw925hKsA==",
817
833
  "cpu": [
818
834
  "s390x"
819
835
  ],
@@ -825,8 +841,8 @@
825
841
  ]
826
842
  },
827
843
  "node_modules/@rollup/rollup-linux-x64-gnu": {
828
- "version": "4.62.3",
829
- "integrity": "sha512-V4KtWtQfAFMU7+9/A/VDps/VI8CHd3cYz0L8sgJzz8qK7eY7wI4ruFD82UYIYvW9Z4DtlTfhQcsl4XyPHW5uSg==",
844
+ "version": "4.62.4",
845
+ "integrity": "sha512-W69hukhZ3KKNRCaMIEzKvcFye42hh0FE1+YoYaf5+Ikacuftoco6yO/xouz0hc5d5W/s3yBro5jRiuEE/Q5vUw==",
830
846
  "cpu": [
831
847
  "x64"
832
848
  ],
@@ -838,8 +854,8 @@
838
854
  ]
839
855
  },
840
856
  "node_modules/@rollup/rollup-linux-x64-musl": {
841
- "version": "4.62.3",
842
- "integrity": "sha512-LBx9LYXvj2CBkMkjLdNAWLwH0MLMin7do2VcVo9kVPibGLkY0BQQut2fv7NVqkXqZ/CrAu9LqDHVV1xHCMpCPw==",
857
+ "version": "4.62.4",
858
+ "integrity": "sha512-qiXbGG2jkjXhzXpsFZSR2Xpb8DN/UaxYsbb/STbuR/6fpaDgRmmaq1B/LmtF2wQFOFOSsK2jdE0RZ3a0zHn4QA==",
843
859
  "cpu": [
844
860
  "x64"
845
861
  ],
@@ -851,8 +867,8 @@
851
867
  ]
852
868
  },
853
869
  "node_modules/@rollup/rollup-openbsd-x64": {
854
- "version": "4.62.3",
855
- "integrity": "sha512-ABVf3Q0RCu7NcyCCOZQI0pJ3GuSdfSl8EXcy88QtdceIMIoCUdfhsJChZ64L9zVM2aJHjde1Bhn5uqSRcX9ySA==",
870
+ "version": "4.62.4",
871
+ "integrity": "sha512-nWeM//hxv8mIo6jD7Hu4o48DVmV9pbV6gsKaWU+4NFyqHoPKwrkRiZGLKUhOBk8qNmDmpwFtPKg80Bo/Tn4xiQ==",
856
872
  "cpu": [
857
873
  "x64"
858
874
  ],
@@ -864,8 +880,8 @@
864
880
  ]
865
881
  },
866
882
  "node_modules/@rollup/rollup-openharmony-arm64": {
867
- "version": "4.62.3",
868
- "integrity": "sha512-+2Cy/ldweGBLlPIKsQLF8U5N44a0KDdbrk1rAjHOM9M2K+kGdIVjHLmmrZIcx+9Ny3ke/1JomCsDI1ocb11+sg==",
883
+ "version": "4.62.4",
884
+ "integrity": "sha512-s62SQ/vgsRSvMwDkOEfTqfgASF0f26ZNaQuTA6Aok5lrikf89yI2W0gFHvZb2Jpgc6N8JnOKZgCK2iciO3CsxQ==",
869
885
  "cpu": [
870
886
  "arm64"
871
887
  ],
@@ -877,8 +893,8 @@
877
893
  ]
878
894
  },
879
895
  "node_modules/@rollup/rollup-win32-arm64-msvc": {
880
- "version": "4.62.3",
881
- "integrity": "sha512-dtZvzc8BedpSaFNy75x6uiWwAGTH+aZHDtdrqP6qk+WcLJrfti6sGje1ZJ9UxyzDLF23d/mV+PaMwuC0hL7UVA==",
896
+ "version": "4.62.4",
897
+ "integrity": "sha512-J6wGf8TVGbXJq+HH+ttTvrcfNKPbuZecV6KT1B8I18BC5IURUh5kl4Yl5OEP5eFIUoI5BWxCsyYMhFsDx8kekw==",
882
898
  "cpu": [
883
899
  "arm64"
884
900
  ],
@@ -890,8 +906,8 @@
890
906
  ]
891
907
  },
892
908
  "node_modules/@rollup/rollup-win32-ia32-msvc": {
893
- "version": "4.62.3",
894
- "integrity": "sha512-Rj8Ra4noo+aYy7sKBggCx0407mws34kAb1ySyWuq5DAtFBQdkSwnsjCgPrhPe9cvgBKZIukpE+CVHvORCS93kQ==",
909
+ "version": "4.62.4",
910
+ "integrity": "sha512-zmfrQd/0wu6oJs8Vq8KwY/YtsKSsLtKe/HwAP4Wqy8LhWjeT55fHRAkOhYQ12wI3ayS4Tt12d5CDRD7N96SAYQ==",
895
911
  "cpu": [
896
912
  "ia32"
897
913
  ],
@@ -903,8 +919,8 @@
903
919
  ]
904
920
  },
905
921
  "node_modules/@rollup/rollup-win32-x64-gnu": {
906
- "version": "4.62.3",
907
- "integrity": "sha512-vp7N084ew/odXn2gi/mzm9mUkQu9l6AiN6dt4IeUM2Uvm9o+cVmP+YkqbMOteLbiGgqBBlJZjIMYVCfOOIVbVQ==",
922
+ "version": "4.62.4",
923
+ "integrity": "sha512-qPzHqdj9rfUD+w79dtE07zi/kFwKyCJqplp5K5ygeLTp7jLpAoc16OAH39HSmRC9UpozaecsleI8uAdEj6v2yw==",
908
924
  "cpu": [
909
925
  "x64"
910
926
  ],
@@ -916,8 +932,8 @@
916
932
  ]
917
933
  },
918
934
  "node_modules/@rollup/rollup-win32-x64-msvc": {
919
- "version": "4.62.3",
920
- "integrity": "sha512-MOG/3gTOn4Fwf574RVOaY61I5o6P90legkFADiTyn1hyjNydT+cerU2rLUwPdZkKKyJ+iT+K9p7WXK4LM1Ka6g==",
935
+ "version": "4.62.4",
936
+ "integrity": "sha512-zD6NdeWEByGE9QF9vCrlJ5YQB4oq9q91kPZS37Jwj5hOkvR1lTBSpsKhKDw4IJtbQ35LsTS1HD9DZYGKIshU1Q==",
921
937
  "cpu": [
922
938
  "x64"
923
939
  ],
@@ -1315,8 +1331,8 @@
1315
1331
  }
1316
1332
  },
1317
1333
  "node_modules/bare-fs": {
1318
- "version": "4.7.4",
1319
- "integrity": "sha512-y1kC+ffIx/tPLdTE693uNjHfzTfr+ravR5tvWlMXe25nELbkqV400S71qHDwbkAQ1FVEZobB1NFRzFbCCcyBCQ==",
1334
+ "version": "4.8.0",
1335
+ "integrity": "sha512-fM+MhCvdQhZ7NV6S95a07gPSqjIYKn6mFaXfx266wN3ajZGl/+1AzH+ubkXQ0fFZvOe2nk9VHkzdYkQE5zMV3Q==",
1320
1336
  "license": "Apache-2.0",
1321
1337
  "dependencies": {
1322
1338
  "bare-events": "^2.5.4",
@@ -1326,7 +1342,7 @@
1326
1342
  "fast-fifo": "^1.3.2"
1327
1343
  },
1328
1344
  "engines": {
1329
- "bare": ">=1.16.0"
1345
+ "bare": ">=1.28.0"
1330
1346
  },
1331
1347
  "peerDependencies": {
1332
1348
  "bare-buffer": "*"
@@ -1369,8 +1385,8 @@
1369
1385
  }
1370
1386
  },
1371
1387
  "node_modules/bare-url": {
1372
- "version": "2.4.6",
1373
- "integrity": "sha512-iQxPClE07hETVpbRoX7JXX3v/ZQViCxe/SYCxylRLzdEx1xJAufPptfiOqR8tqiCtmbtMDANKWszzjLu1PMAZQ==",
1388
+ "version": "2.5.1",
1389
+ "integrity": "sha512-cD5ciQuKlx+eumTCfqbfiL+fhQm+dHbVNB/cX4+d+I/nx4JsVop9VoFEPAs5RJ6I84QR6bZIBjpd2kjDOYeWcg==",
1374
1390
  "license": "Apache-2.0",
1375
1391
  "dependencies": {
1376
1392
  "bare-path": "^3.0.0"
@@ -2798,8 +2814,8 @@
2798
2814
  }
2799
2815
  },
2800
2816
  "node_modules/nanoid": {
2801
- "version": "3.3.16",
2802
- "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==",
2817
+ "version": "3.3.18",
2818
+ "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==",
2803
2819
  "dev": true,
2804
2820
  "funding": [
2805
2821
  {
@@ -2992,8 +3008,8 @@
2992
3008
  }
2993
3009
  },
2994
3010
  "node_modules/postcss": {
2995
- "version": "8.5.25",
2996
- "integrity": "sha512-DTPx3RWSSnWyzLxQnlH0rJP+EW5ekl16ZU4/psbIhA0e53kJfdgaN5vKM+xP7yJtXVu+nfdVFmlgFDEKAe4Pyw==",
3011
+ "version": "8.5.26",
3012
+ "integrity": "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==",
2997
3013
  "dev": true,
2998
3014
  "funding": [
2999
3015
  {
@@ -3011,7 +3027,7 @@
3011
3027
  ],
3012
3028
  "license": "MIT",
3013
3029
  "dependencies": {
3014
- "nanoid": "^3.3.16",
3030
+ "nanoid": "^3.3.17",
3015
3031
  "picocolors": "^1.1.1",
3016
3032
  "source-map-js": "^1.2.1"
3017
3033
  },
@@ -3258,8 +3274,8 @@
3258
3274
  }
3259
3275
  },
3260
3276
  "node_modules/rollup": {
3261
- "version": "4.62.3",
3262
- "integrity": "sha512-Gu0c0iH9FzgX1L1t7ByIbbS3Vmdz+6KHm/EsqmmC71gUQ82yvZRkTK6XzrFObSka91WUVdynqp6nsfilzr5k6Q==",
3277
+ "version": "4.62.4",
3278
+ "integrity": "sha512-RXOqwaPsBGjMNMa4sQjDjHieHEZDFoj/Rdr46l2MU5DfEs16wHJPC2RPTPHWhNl+M3aI472LLqFkFKut4SblOg==",
3263
3279
  "dev": true,
3264
3280
  "license": "MIT",
3265
3281
  "dependencies": {
@@ -3273,31 +3289,32 @@
3273
3289
  "npm": ">=8.0.0"
3274
3290
  },
3275
3291
  "optionalDependencies": {
3276
- "@rollup/rollup-android-arm-eabi": "4.62.3",
3277
- "@rollup/rollup-android-arm64": "4.62.3",
3278
- "@rollup/rollup-darwin-arm64": "4.62.3",
3279
- "@rollup/rollup-darwin-x64": "4.62.3",
3280
- "@rollup/rollup-freebsd-arm64": "4.62.3",
3281
- "@rollup/rollup-freebsd-x64": "4.62.3",
3282
- "@rollup/rollup-linux-arm-gnueabihf": "4.62.3",
3283
- "@rollup/rollup-linux-arm-musleabihf": "4.62.3",
3284
- "@rollup/rollup-linux-arm64-gnu": "4.62.3",
3285
- "@rollup/rollup-linux-arm64-musl": "4.62.3",
3286
- "@rollup/rollup-linux-loong64-gnu": "4.62.3",
3287
- "@rollup/rollup-linux-loong64-musl": "4.62.3",
3288
- "@rollup/rollup-linux-ppc64-gnu": "4.62.3",
3289
- "@rollup/rollup-linux-ppc64-musl": "4.62.3",
3290
- "@rollup/rollup-linux-riscv64-gnu": "4.62.3",
3291
- "@rollup/rollup-linux-riscv64-musl": "4.62.3",
3292
- "@rollup/rollup-linux-s390x-gnu": "4.62.3",
3293
- "@rollup/rollup-linux-x64-gnu": "4.62.3",
3294
- "@rollup/rollup-linux-x64-musl": "4.62.3",
3295
- "@rollup/rollup-openbsd-x64": "4.62.3",
3296
- "@rollup/rollup-openharmony-arm64": "4.62.3",
3297
- "@rollup/rollup-win32-arm64-msvc": "4.62.3",
3298
- "@rollup/rollup-win32-ia32-msvc": "4.62.3",
3299
- "@rollup/rollup-win32-x64-gnu": "4.62.3",
3300
- "@rollup/rollup-win32-x64-msvc": "4.62.3",
3292
+ "@napi-rs/lzma-linux-x64-gnu": "1.5.1",
3293
+ "@rollup/rollup-android-arm-eabi": "4.62.4",
3294
+ "@rollup/rollup-android-arm64": "4.62.4",
3295
+ "@rollup/rollup-darwin-arm64": "4.62.4",
3296
+ "@rollup/rollup-darwin-x64": "4.62.4",
3297
+ "@rollup/rollup-freebsd-arm64": "4.62.4",
3298
+ "@rollup/rollup-freebsd-x64": "4.62.4",
3299
+ "@rollup/rollup-linux-arm-gnueabihf": "4.62.4",
3300
+ "@rollup/rollup-linux-arm-musleabihf": "4.62.4",
3301
+ "@rollup/rollup-linux-arm64-gnu": "4.62.4",
3302
+ "@rollup/rollup-linux-arm64-musl": "4.62.4",
3303
+ "@rollup/rollup-linux-loong64-gnu": "4.62.4",
3304
+ "@rollup/rollup-linux-loong64-musl": "4.62.4",
3305
+ "@rollup/rollup-linux-ppc64-gnu": "4.62.4",
3306
+ "@rollup/rollup-linux-ppc64-musl": "4.62.4",
3307
+ "@rollup/rollup-linux-riscv64-gnu": "4.62.4",
3308
+ "@rollup/rollup-linux-riscv64-musl": "4.62.4",
3309
+ "@rollup/rollup-linux-s390x-gnu": "4.62.4",
3310
+ "@rollup/rollup-linux-x64-gnu": "4.62.4",
3311
+ "@rollup/rollup-linux-x64-musl": "4.62.4",
3312
+ "@rollup/rollup-openbsd-x64": "4.62.4",
3313
+ "@rollup/rollup-openharmony-arm64": "4.62.4",
3314
+ "@rollup/rollup-win32-arm64-msvc": "4.62.4",
3315
+ "@rollup/rollup-win32-ia32-msvc": "4.62.4",
3316
+ "@rollup/rollup-win32-x64-gnu": "4.62.4",
3317
+ "@rollup/rollup-win32-x64-msvc": "4.62.4",
3301
3318
  "fsevents": "~2.3.2"
3302
3319
  }
3303
3320
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker-ai/react-codegen",
3
- "version": "1.0.0-rc.330",
3
+ "version": "1.0.0-rc.332",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -107,6 +107,11 @@ const ALLOWED_RESOURCE_EXT = [
107
107
  let deviceVariables = [];
108
108
  let appVersion;
109
109
  class AppGenerator {
110
+ generateWebComponentHelper() {
111
+ if (!this.hasWebComponent)
112
+ return;
113
+ fs_extra_1.default.copySync(__dirname + "/../templates/component/web-component.tsx", `${this.projectPath}/app/helper/web-component.tsx`);
114
+ }
110
115
  constructor(projectPath, projectService, appUrl, prefabName = "", incBuilder, options, dynamicPrefabProps) {
111
116
  this.projectPath = projectPath;
112
117
  this.projectService = projectService;
@@ -129,6 +134,7 @@ class AppGenerator {
129
134
  SCRIPT_IMPORTS: [],
130
135
  NPM_PACKAGES: [],
131
136
  };
137
+ this.hasWebComponent = false;
132
138
  this.wmxComponents = [];
133
139
  this.isWaveApp = false;
134
140
  this.serviceDefsSource = "STATIC";
@@ -223,7 +229,7 @@ class AppGenerator {
223
229
  if (this.incBuilder) {
224
230
  console.log(`Generating App variables.`);
225
231
  }
226
- return this.projectService.getAppVariables().then(variables => {
232
+ return this.projectService.getAppVariables().then(async (variables) => {
227
233
  this.setDeviceVariables(variables);
228
234
  Object.keys(variables).map((key) => {
229
235
  // @ts-ignore
@@ -237,7 +243,7 @@ class AppGenerator {
237
243
  // include _app.tsx file in root folder
238
244
  this.generateAppConfig(variables);
239
245
  // include _app.script.js file in root folder
240
- this.generateAppScript();
246
+ await this.generateAppScript();
241
247
  });
242
248
  }
243
249
  async generateAppScript() {
@@ -320,7 +326,7 @@ class AppGenerator {
320
326
  return refs;
321
327
  }
322
328
  generateComponent(info, type, name, isPartOfPrefab) {
323
- var _a, _b, _c, _d;
329
+ var _a, _b, _c, _d, _e;
324
330
  if (this.incBuilder && !this.incBuilder.isFragmentModified(name)) {
325
331
  return Promise.resolve();
326
332
  }
@@ -333,7 +339,7 @@ class AppGenerator {
333
339
  try {
334
340
  variables = info.variables ? JSON.parse(info.variables) : {};
335
341
  }
336
- catch (_e) {
342
+ catch (_f) {
337
343
  console.log(`Error parsing variables for ${name}, skipping variables.`);
338
344
  variables = {};
339
345
  }
@@ -361,6 +367,9 @@ class AppGenerator {
361
367
  const output = this.prepareVariables(variables, typeLabel, []);
362
368
  (0, utils_1.writeFile)(`${dest}/${name}.variables.ts`, output);
363
369
  const transpiledOutput = (0, transpile_1.transpileMarkup)(info.markup, this.isPrefabApp, undefined, variables);
370
+ if ((_b = transpiledOutput.webComponents) === null || _b === void 0 ? void 0 : _b.length) {
371
+ this.hasWebComponent = true;
372
+ }
364
373
  if (transpiledOutput.autolayoutCss) {
365
374
  transpiledOutput.autolayoutCss.forEach(rule => this.autolayoutCssRules.add(rule));
366
375
  }
@@ -373,7 +382,7 @@ class AppGenerator {
373
382
  }
374
383
  let effectiveMarkup = transpiledOutput.markup;
375
384
  if (type === "PAGE") {
376
- const hasLayout = (_b = this.pageLayoutMap) === null || _b === void 0 ? void 0 : _b[name];
385
+ const hasLayout = (_c = this.pageLayoutMap) === null || _c === void 0 ? void 0 : _c[name];
377
386
  if (hasLayout) {
378
387
  effectiveMarkup = (0, grouping_util_1.extractInnerPageContent)(transpiledOutput.markup);
379
388
  imports = (0, grouping_util_1.filterImportsByMarkup)(effectiveMarkup, imports);
@@ -410,8 +419,8 @@ class AppGenerator {
410
419
  });
411
420
  if (type === "PAGE") {
412
421
  const componentName = (name.charAt(0).toUpperCase() + name.substring(1)).replace(/-/g, "");
413
- const pageTitleMatch = (_c = info.markup) === null || _c === void 0 ? void 0 : _c.match(/pagetitle=["']([^"']+)["']/i);
414
- const rawPageTitle = (_d = pageTitleMatch === null || pageTitleMatch === void 0 ? void 0 : pageTitleMatch[1]) === null || _d === void 0 ? void 0 : _d.trim();
422
+ const pageTitleMatch = (_d = info.markup) === null || _d === void 0 ? void 0 : _d.match(/pagetitle=["']([^"']+)["']/i);
423
+ const rawPageTitle = (_e = pageTitleMatch === null || pageTitleMatch === void 0 ? void 0 : pageTitleMatch[1]) === null || _e === void 0 ? void 0 : _e.trim();
415
424
  const isExpression = rawPageTitle && /^(bind:|{{)/.test(rawPageTitle);
416
425
  const pageTitle = rawPageTitle && rawPageTitle.length > 0 && !isExpression ? rawPageTitle : componentName;
417
426
  const componentPage = COMPONENT_PAGE_TEMPLATE({
@@ -525,8 +534,7 @@ class AppGenerator {
525
534
  if (!projectPath || !prefabName)
526
535
  return;
527
536
  return this.projectService.getPrefabIndexHtml(prefabName).then(html => {
528
- this.IncludeHtmlLibs(html);
529
- return Promise.resolve({});
537
+ return this.IncludeHtmlLibs(html);
530
538
  });
531
539
  }
532
540
  addIndexHtmlToLayout() {
@@ -534,10 +542,7 @@ class AppGenerator {
534
542
  return Promise.resolve();
535
543
  return this.projectService
536
544
  .getIndexHtml()
537
- .then(html => {
538
- this.IncludeHtmlLibs(html);
539
- return Promise.resolve({});
540
- })
545
+ .then(html => this.IncludeHtmlLibs(html))
541
546
  .catch(() => Promise.resolve({}));
542
547
  }
543
548
  copyPrefabResources(projectPath, prefabName) {
@@ -830,8 +835,31 @@ class AppGenerator {
830
835
  let layoutContent = fs_extra_1.default.readFileSync(`${this.projectPath}/app/layout.tsx`, "utf-8");
831
836
  // optimization to keep the original “only write when we changed something” behavior.
832
837
  let hasChanges = false;
833
- // Extract script and link tags, passing layoutContent to avoid duplicates
834
- const scriptsElements = (0, utils_browser_1.extractScriptAndLinkTags)(html, layoutContent);
838
+ // Inline source cannot be placed directly in TSX: JSX interprets the script's
839
+ // braces as expressions. Keep the body unchanged in a generated asset and let
840
+ // the browser execute it through an ordinary script tag, as Angular does.
841
+ const headAssets = (0, utils_browser_1.extractHtmlHeadAssets)(html, layoutContent);
842
+ const inlineScriptsDir = path_2.default.join(this.projectPath, "public/resources/wm-inline");
843
+ const scriptsElements = headAssets
844
+ .map((asset, index) => {
845
+ if (asset.kind === "tag") {
846
+ return asset.jsx;
847
+ }
848
+ const relativePath = `resources/wm-inline/wm-inline-${index}.js`;
849
+ fs_extra_1.default.mkdirSync(inlineScriptsDir, { recursive: true });
850
+ fs_extra_1.default.writeFileSync(path_2.default.join(inlineScriptsDir, `wm-inline-${index}.js`), asset.content, "utf-8");
851
+ // Attribute names from HTML need their JSX spelling. The script body itself
852
+ // is never transformed or escaped.
853
+ const attributes = asset.attributes
854
+ .replace(/\bcrossorigin\b/gi, "crossOrigin")
855
+ .replace(/\breferrerpolicy\b/gi, "referrerPolicy")
856
+ .replace(/\bnomodule\b/gi, "noModule")
857
+ .trim();
858
+ const scriptTag = `<script${attributes ? ` ${attributes}` : ""} src={\`\${configs.appConfig.basePath}${relativePath}\`}></script>`;
859
+ return layoutContent.includes(relativePath) ? "" : scriptTag;
860
+ })
861
+ .filter(Boolean)
862
+ .join("\n");
835
863
  // Only update if there are new elements to add
836
864
  if (scriptsElements && scriptsElements.trim()) {
837
865
  hasChanges = true;
@@ -1232,6 +1260,7 @@ class AppGenerator {
1232
1260
  .then(() => this.resolveProjectType())
1233
1261
  .then(() => this.setSecurityConfig())
1234
1262
  .then(() => this.generatePagesAndPartials())
1263
+ .then(() => this.generateWebComponentHelper())
1235
1264
  .then(() => this.generateAutoLayoutCSS())
1236
1265
  .then(() => this.addIndexHtmlToLayout())
1237
1266
  .then(() => this.resolvei18nAndServiceDefsSource())