@genexus/genexus-ide-ui 1.1.12 → 1.1.14
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/cjs/MERCURY_ASSETS-15c5c1ac.js +9 -0
- package/dist/cjs/MERCURY_ASSETS-15c5c1ac.js.map +1 -0
- package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/gx-ide-about.cjs.entry.js +29 -15
- package/dist/cjs/gx-ide-about.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-ai-message.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-bpm-app-declaration.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-bpm-export-xpdl.cjs.entry.js +2 -2
- package/dist/cjs/gx-ide-bpm-export-xpdl.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-bpm-task-documents.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-chat-container_2.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-create-kb-from-server.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-current-user-info.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-dashboard-home.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-data-selector.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-data-type-selector.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-design-import.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/gx-ide-empty-state.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-entity-selector.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-file-item.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-file-uploader.cjs.entry.js +1 -14
- package/dist/cjs/gx-ide-file-uploader.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-kb-manager-export.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-kb-manager-import.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-manage-module-references-v2.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-manage-module-references.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-new-kb.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-object-selector.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-open-api-import.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-plugin-details.cjs.entry.js +201 -0
- package/dist/cjs/gx-ide-plugin-details.cjs.entry.js.map +1 -0
- package/dist/cjs/gx-ide-plugin-explorer.cjs.entry.js +159 -0
- package/dist/cjs/gx-ide-plugin-explorer.cjs.entry.js.map +1 -0
- package/dist/cjs/gx-ide-references.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-sc-chat-container.cjs.entry.js +0 -1
- package/dist/cjs/gx-ide-sc-chat-container.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-select-kb-items.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-share-kb.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-splash.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-start-page.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-team-dev-bring-changes.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-team-dev-history.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-welcome-page.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-ww-attributes.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/_helpers/empty-state/gx-ide-empty-state.css +4 -0
- package/dist/collection/components/_helpers/empty-state/gx-ide-empty-state.js +1 -1
- package/dist/collection/components/_helpers/empty-state/gx-ide-empty-state.js.map +1 -1
- package/dist/collection/components/{_branding/about → about}/about.css +44 -15
- package/dist/collection/components/{_branding/about → about}/about.js +46 -62
- package/dist/collection/components/about/about.js.map +1 -0
- package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/langs/about.lang.en.json +3 -3
- package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/langs/about.lang.ja.json +3 -3
- package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/langs/about.lang.zh.json +3 -3
- package/dist/collection/components/bpm/export-xpdl/bpm-export-xpdl.js +2 -2
- package/dist/collection/components/bpm/export-xpdl/bpm-export-xpdl.js.map +1 -1
- package/dist/collection/components/file-uploader/file-uploader.js +0 -13
- package/dist/collection/components/file-uploader/file-uploader.js.map +1 -1
- package/dist/collection/components/plugin-details/gx-ide-assets/plugin-details/langs/plugin-details.lang.en.json +9 -0
- package/dist/collection/components/plugin-details/gx-ide-assets/plugin-details/langs/plugin-details.lang.ja.json +9 -0
- package/dist/collection/components/plugin-details/gx-ide-assets/plugin-details/langs/plugin-details.lang.zh.json +9 -0
- package/dist/collection/components/plugin-details/plugin-details.css +168 -0
- package/dist/collection/components/plugin-details/plugin-details.js +292 -0
- package/dist/collection/components/plugin-details/plugin-details.js.map +1 -0
- package/dist/collection/components/plugin-explorer/gx-ide-assets/plugin-explorer/images/plugin-icon.svg +10 -0
- package/dist/collection/components/plugin-explorer/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.en.json +10 -0
- package/dist/collection/components/plugin-explorer/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.ja.json +10 -0
- package/dist/collection/components/plugin-explorer/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.zh.json +10 -0
- package/dist/collection/components/plugin-explorer/plugin-explorer.css +106 -0
- package/dist/collection/components/plugin-explorer/plugin-explorer.js +263 -0
- package/dist/collection/components/plugin-explorer/plugin-explorer.js.map +1 -0
- package/dist/collection/components/team-dev/bring-changes/gx-ide-assets/team-dev-bring-changes/langs/team-dev-bring-changes.lang.ja.json +45 -45
- package/dist/collection/pages/assets/images/plugin/docker-iso.svg +12 -0
- package/dist/collection/showcase/chat-container/callbacks.js +0 -1
- package/dist/collection/showcase/chat-container/callbacks.js.map +1 -1
- package/dist/collection/testing/locale.e2e.js +2 -0
- package/dist/collection/testing/locale.e2e.js.map +1 -1
- package/dist/components/MERCURY_ASSETS.js +1 -1
- package/dist/components/MERCURY_ASSETS.js.map +1 -1
- package/dist/components/gx-ide-about.js +32 -19
- package/dist/components/gx-ide-about.js.map +1 -1
- package/dist/components/gx-ide-bpm-export-xpdl.js +2 -2
- package/dist/components/gx-ide-bpm-export-xpdl.js.map +1 -1
- package/dist/components/gx-ide-empty-state2.js +2 -2
- package/dist/components/gx-ide-empty-state2.js.map +1 -1
- package/dist/components/gx-ide-file-uploader.js +0 -13
- package/dist/components/gx-ide-file-uploader.js.map +1 -1
- package/dist/components/gx-ide-plugin-details.d.ts +11 -0
- package/dist/components/gx-ide-plugin-details.js +222 -0
- package/dist/components/gx-ide-plugin-details.js.map +1 -0
- package/dist/components/gx-ide-plugin-explorer.d.ts +11 -0
- package/dist/components/gx-ide-plugin-explorer.js +194 -0
- package/dist/components/gx-ide-plugin-explorer.js.map +1 -0
- package/dist/components/gx-ide-sc-chat-container.js +0 -1
- package/dist/components/gx-ide-sc-chat-container.js.map +1 -1
- package/dist/esm/MERCURY_ASSETS-7c06e424.js +7 -0
- package/dist/esm/MERCURY_ASSETS-7c06e424.js.map +1 -0
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-about.entry.js +29 -15
- package/dist/esm/gx-ide-about.entry.js.map +1 -1
- package/dist/esm/gx-ide-ai-message.entry.js +1 -1
- package/dist/esm/gx-ide-bpm-app-declaration.entry.js +1 -1
- package/dist/esm/gx-ide-bpm-export-xpdl.entry.js +2 -2
- package/dist/esm/gx-ide-bpm-export-xpdl.entry.js.map +1 -1
- package/dist/esm/gx-ide-bpm-task-documents.entry.js +1 -1
- package/dist/esm/gx-ide-chat-container_2.entry.js +1 -1
- package/dist/esm/gx-ide-create-kb-from-server.entry.js +1 -1
- package/dist/esm/gx-ide-current-user-info.entry.js +1 -1
- package/dist/esm/gx-ide-dashboard-home.entry.js +1 -1
- package/dist/esm/gx-ide-data-selector.entry.js +1 -1
- package/dist/esm/gx-ide-data-type-selector.entry.js +1 -1
- package/dist/esm/gx-ide-design-import.entry.js +1 -1
- package/dist/esm/gx-ide-empty-state.entry.js +2 -2
- package/dist/esm/gx-ide-empty-state.entry.js.map +1 -1
- package/dist/esm/gx-ide-entity-selector.entry.js +1 -1
- package/dist/esm/gx-ide-file-item.entry.js +1 -1
- package/dist/esm/gx-ide-file-uploader.entry.js +1 -14
- package/dist/esm/gx-ide-file-uploader.entry.js.map +1 -1
- package/dist/esm/gx-ide-kb-manager-export.entry.js +1 -1
- package/dist/esm/gx-ide-kb-manager-import.entry.js +1 -1
- package/dist/esm/gx-ide-manage-module-references-v2.entry.js +1 -1
- package/dist/esm/gx-ide-manage-module-references.entry.js +1 -1
- package/dist/esm/gx-ide-new-kb.entry.js +1 -1
- package/dist/esm/gx-ide-object-selector.entry.js +1 -1
- package/dist/esm/gx-ide-open-api-import.entry.js +1 -1
- package/dist/esm/gx-ide-plugin-details.entry.js +197 -0
- package/dist/esm/gx-ide-plugin-details.entry.js.map +1 -0
- package/dist/esm/gx-ide-plugin-explorer.entry.js +155 -0
- package/dist/esm/gx-ide-plugin-explorer.entry.js.map +1 -0
- package/dist/esm/gx-ide-references.entry.js +1 -1
- package/dist/esm/gx-ide-sc-chat-container.entry.js +0 -1
- package/dist/esm/gx-ide-sc-chat-container.entry.js.map +1 -1
- package/dist/esm/gx-ide-select-kb-items.entry.js +1 -1
- package/dist/esm/gx-ide-share-kb.entry.js +1 -1
- package/dist/esm/gx-ide-splash.entry.js +1 -1
- package/dist/esm/gx-ide-start-page.entry.js +1 -1
- package/dist/esm/gx-ide-team-dev-bring-changes.entry.js +1 -1
- package/dist/esm/gx-ide-team-dev-history.entry.js +1 -1
- package/dist/esm/gx-ide-welcome-page.entry.js +1 -1
- package/dist/esm/gx-ide-ww-attributes.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
- package/dist/genexus-ide-ui/gx-ide-assets/about/langs/about.lang.en.json +3 -3
- package/dist/genexus-ide-ui/gx-ide-assets/about/langs/about.lang.ja.json +3 -3
- package/dist/genexus-ide-ui/gx-ide-assets/about/langs/about.lang.zh.json +3 -3
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-details/langs/plugin-details.lang.en.json +9 -0
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-details/langs/plugin-details.lang.ja.json +9 -0
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-details/langs/plugin-details.lang.zh.json +9 -0
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-explorer/images/plugin-icon.svg +10 -0
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.en.json +10 -0
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.ja.json +10 -0
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.zh.json +10 -0
- package/dist/genexus-ide-ui/gx-ide-assets/team-dev-bring-changes/langs/team-dev-bring-changes.lang.ja.json +45 -45
- package/dist/genexus-ide-ui/{p-14fc5c24.entry.js → p-0cd3ab87.entry.js} +19 -19
- package/dist/genexus-ide-ui/{p-704499e5.entry.js → p-1292a6b9.entry.js} +40 -40
- package/dist/genexus-ide-ui/{p-4d4ed703.entry.js → p-16138f55.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-7abe2214.entry.js → p-1be1db4e.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-ede7bd20.js → p-2987a259.js} +6674 -5218
- package/dist/genexus-ide-ui/p-2987a259.js.map +1 -0
- package/dist/genexus-ide-ui/{p-a47d71eb.entry.js → p-4328be14.entry.js} +7 -7
- package/dist/genexus-ide-ui/p-4328be14.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-4e943649.entry.js → p-45539ad0.entry.js} +2 -2
- package/dist/genexus-ide-ui/p-476b74a1.entry.js +109 -0
- package/dist/genexus-ide-ui/p-476b74a1.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-6d996621.entry.js → p-4e6425f3.entry.js} +1 -2
- package/dist/genexus-ide-ui/p-4e6425f3.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-a8d0b62e.entry.js → p-52f37ec7.entry.js} +8 -8
- package/dist/genexus-ide-ui/{p-4538dea5.entry.js → p-54fb1287.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-74715731.entry.js → p-60e39b2f.entry.js} +2 -2
- package/dist/genexus-ide-ui/p-641c79a9.entry.js +198 -0
- package/dist/genexus-ide-ui/p-641c79a9.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-88c81f18.entry.js → p-667965d3.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-41a4364d.entry.js → p-7053c38e.entry.js} +11 -11
- package/dist/genexus-ide-ui/{p-29c69938.entry.js → p-72e346b9.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-ecba870e.entry.js → p-74a0cb25.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-c38ce0bf.entry.js → p-760d8f2a.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-9dcb8fb7.entry.js → p-7ae2a57f.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-1c7ea1cb.entry.js → p-7d107d2f.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-690942cb.entry.js → p-7d7cf30d.entry.js} +35 -51
- package/dist/genexus-ide-ui/p-7d7cf30d.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-01d96378.entry.js → p-7f65f9e3.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-eb9e760d.entry.js → p-83cc3bcd.entry.js} +2 -2
- package/dist/genexus-ide-ui/p-84c1c1bb.entry.js +270 -0
- package/dist/genexus-ide-ui/p-84c1c1bb.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-844b7117.entry.js → p-86365635.entry.js} +3 -3
- package/dist/genexus-ide-ui/p-86365635.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-04205aa4.entry.js → p-93cdb6f8.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-0acf517c.entry.js → p-a869ec48.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-bc760bb3.entry.js → p-b465f29d.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-ff28c49d.entry.js → p-bbb5b0fb.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-8cb937b7.entry.js → p-c50b9883.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-3b983843.entry.js → p-c92332af.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-c7badbf1.entry.js → p-c9bca7c0.entry.js} +20 -20
- package/dist/genexus-ide-ui/{p-3da8db15.entry.js → p-ca6eb9fd.entry.js} +30 -30
- package/dist/genexus-ide-ui/{p-67e0b419.entry.js → p-ca9978e1.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-7d8812b0.entry.js → p-d77582b8.entry.js} +2 -2
- package/dist/genexus-ide-ui/{p-aab809c4.entry.js → p-fd440291.entry.js} +2 -2
- package/dist/types/components/{_branding/about → about}/about.d.ts +6 -10
- package/dist/types/components/plugin-details/plugin-details.d.ts +55 -0
- package/dist/types/components/plugin-explorer/plugin-explorer.d.ts +43 -0
- package/dist/types/components.d.ts +106 -22
- package/package.json +3 -3
- package/dist/cjs/MERCURY_ASSETS-972bf7f4.js +0 -9
- package/dist/cjs/MERCURY_ASSETS-972bf7f4.js.map +0 -1
- package/dist/collection/components/_branding/about/about.js.map +0 -1
- package/dist/esm/MERCURY_ASSETS-039222dd.js +0 -7
- package/dist/esm/MERCURY_ASSETS-039222dd.js.map +0 -1
- package/dist/genexus-ide-ui/p-0550fd5f.entry.js +0 -96
- package/dist/genexus-ide-ui/p-0550fd5f.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-690942cb.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-6d996621.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-844b7117.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-a47d71eb.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-ede7bd20.js.map +0 -1
- /package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/images/copyrights-illustration.png +0 -0
- /package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/images/next-arrow.svg +0 -0
- /package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/images/next-logo.svg +0 -0
- /package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/images/next-square.svg +0 -0
- /package/dist/genexus-ide-ui/{p-14fc5c24.entry.js.map → p-0cd3ab87.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-704499e5.entry.js.map → p-1292a6b9.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-4d4ed703.entry.js.map → p-16138f55.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-7abe2214.entry.js.map → p-1be1db4e.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-4e943649.entry.js.map → p-45539ad0.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-a8d0b62e.entry.js.map → p-52f37ec7.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-4538dea5.entry.js.map → p-54fb1287.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-74715731.entry.js.map → p-60e39b2f.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-88c81f18.entry.js.map → p-667965d3.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-41a4364d.entry.js.map → p-7053c38e.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-29c69938.entry.js.map → p-72e346b9.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-ecba870e.entry.js.map → p-74a0cb25.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-c38ce0bf.entry.js.map → p-760d8f2a.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-9dcb8fb7.entry.js.map → p-7ae2a57f.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-1c7ea1cb.entry.js.map → p-7d107d2f.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-01d96378.entry.js.map → p-7f65f9e3.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-eb9e760d.entry.js.map → p-83cc3bcd.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-04205aa4.entry.js.map → p-93cdb6f8.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-0acf517c.entry.js.map → p-a869ec48.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-bc760bb3.entry.js.map → p-b465f29d.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-ff28c49d.entry.js.map → p-bbb5b0fb.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-8cb937b7.entry.js.map → p-c50b9883.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-3b983843.entry.js.map → p-c92332af.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-c7badbf1.entry.js.map → p-c9bca7c0.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-3da8db15.entry.js.map → p-ca6eb9fd.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-67e0b419.entry.js.map → p-ca9978e1.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-7d8812b0.entry.js.map → p-d77582b8.entry.js.map} +0 -0
- /package/dist/genexus-ide-ui/{p-aab809c4.entry.js.map → p-fd440291.entry.js.map} +0 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { g as getAssetPath, r as registerInstance, h, H as Host, a as getElement } from './index-10af18cf.js';
|
|
2
|
+
import { g as getIconPath } from './MERCURY_ASSETS-7c06e424.js';
|
|
3
|
+
import { L as Locale } from './locale-e5107fad.js';
|
|
4
|
+
|
|
5
|
+
const pluginDetailsCss = ":host{display:grid;block-size:100%;grid-template-areas:\"header header\" \"main aside\";grid-template-rows:max-content 1fr;grid-template-columns:1fr 280px;row-gap:12px}.section{display:contents}.header{display:grid;grid-area:header;grid-template-areas:\"plugin-icon plugin-details\";grid-template-columns:64px 1fr;column-gap:16px;padding:24px 24px 16px 24px}.plugin__icon{grid-area:plugin-icon;max-width:100%}.plugin__details{grid-area:plugin-details;display:flex;flex-direction:column;gap:8px}.plugin__publisher{display:flex;align-items:center;gap:4px}.plugin__description{line-height:1.5}.plugin__actions-container{margin-block-start:8px;align-items:center}.action-button{min-inline-size:100px}.action-button.more-versions-available{border-start-end-radius:0 !important;border-end-end-radius:0 !important}.installed-container{display:flex;align-items:center;gap:6px}.installed-container ch-image{--ch-image-size:20px}.main{grid-area:main}.docsTab{block-size:100%}.aside{grid-area:aside;overflow:auto;border-block-start:1px solid var(--items-container__border-color)}.fields__list{list-style:none;padding:0;margin:0;font-size:12px}.plugin__info-category{display:flex;flex-direction:column;gap:8px}.plugin__info-category:not(:first-child){padding-block-start:16px;margin-block-start:16px;border-block-start:1px solid var(--mer-border-color__on-elevation--01)}.fields__list:not(.fields__list--as-tags){display:flex;flex-direction:column;gap:8px}.fields__list:not(.fields__list--as-tags) .field__li{display:flex;gap:16px}.fields__list--as-tags{display:flex;flex-wrap:wrap;gap:6px}.fields__list--as-tags .field__li{border:1px solid var(--mer-border-color__on-elevation--01);padding:2px 8px;border-radius:4px;text-transform:lowercase}.fields__list--as-tags .field__link{color:var(--mer-text__on-surface)}.fields__list--as-tags .field__link:hover{color:var(--mer-accent__primary)}.fields__list--as-tags .field__link:active{color:var(--mer-accent__primary--hover)}.field__name,.field__value{flex:1}.field__link{color:var(--mer-accent__primary)}.field__link:hover{color:var(--mer-accent__primary--hover)}.field__link:active{color:var(--mer-accent__primary--active)}.docsTab{background-color:transparent !important}.dropdown.button-icon-only::part(expandable-button){padding:calc( ( var(--control__block-size) - 2 * var(--control__border-width) - var(--mer-icon__box--md) ) / 2 ) !important;border-start-start-radius:0 !important;border-end-start-radius:0 !important}.version-buttons-container{display:flex;align-items:center;gap:1px}ch-markdown-viewer{block-size:100%;overflow:auto}.text-underline{text-decoration:underline}";
|
|
6
|
+
|
|
7
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f)
|
|
9
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
11
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
12
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
13
|
+
};
|
|
14
|
+
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
15
|
+
if (kind === "m")
|
|
16
|
+
throw new TypeError("Private method is not writable");
|
|
17
|
+
if (kind === "a" && !f)
|
|
18
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
19
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
20
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
21
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
22
|
+
};
|
|
23
|
+
var _GxIdePluginDetails_componentLocale, _GxIdePluginDetails_docSectionIdDescriptionMap, _GxIdePluginDetails_versionsMenuOptionsModel, _GxIdePluginDetails_menuVersionSelectedHandler, _GxIdePluginDetails_renderUninstallButton, _GxIdePluginDetails_installClickedHandler, _GxIdePluginDetails_updateVersionHandler, _GxIdePluginDetails_openLinkHandler, _GxIdePluginDetails_uninstallClickedHandler, _GxIdePluginDetails_renderActionButtons, _GxIdePluginDetails_tabSelectionChangedHandler, _GxIdePluginDetails_renderDocSectionsSlots, _GxIdePluginDetails_returnFormatedId, _GxIdePluginDetails_renderAsideContent;
|
|
24
|
+
const USER_ICON = getIconPath({
|
|
25
|
+
category: "system",
|
|
26
|
+
name: "user",
|
|
27
|
+
colorType: "on-elevation"
|
|
28
|
+
});
|
|
29
|
+
const CHEVRON_DOWN_ICON = getIconPath({
|
|
30
|
+
category: "system",
|
|
31
|
+
name: "chevron-down",
|
|
32
|
+
colorType: "on-primary"
|
|
33
|
+
});
|
|
34
|
+
const CHECK_CIRCLE_ICON = getIconPath({
|
|
35
|
+
category: "system",
|
|
36
|
+
name: "check-circle",
|
|
37
|
+
colorType: "success"
|
|
38
|
+
});
|
|
39
|
+
// plugin icon if no iconUri was provided
|
|
40
|
+
const EXTENSION_ICON_IMG = getAssetPath(`./gx-ide-assets/plugin-manager/images/plugin-icon.svg`);
|
|
41
|
+
const CSS_BUNDLES = [
|
|
42
|
+
"resets/box-sizing",
|
|
43
|
+
"chameleon/scrollbar",
|
|
44
|
+
"components/button",
|
|
45
|
+
"components/dropdown",
|
|
46
|
+
"components/edit",
|
|
47
|
+
"components/icon",
|
|
48
|
+
"components/list-box",
|
|
49
|
+
"components/tab",
|
|
50
|
+
"utils/form",
|
|
51
|
+
"utils/layout",
|
|
52
|
+
"utils/spacing",
|
|
53
|
+
"utils/typography"
|
|
54
|
+
];
|
|
55
|
+
const GxIdePluginDetails = class {
|
|
56
|
+
constructor(hostRef) {
|
|
57
|
+
registerInstance(this, hostRef);
|
|
58
|
+
/**
|
|
59
|
+
* The component hard-coded strings translations.
|
|
60
|
+
*/
|
|
61
|
+
// eslint-disable-next-line @stencil-community/own-props-must-be-private
|
|
62
|
+
_GxIdePluginDetails_componentLocale.set(this, void 0);
|
|
63
|
+
// A map between docSection "id", and docSection "description".
|
|
64
|
+
// "id" is generated inside this component.
|
|
65
|
+
_GxIdePluginDetails_docSectionIdDescriptionMap.set(this, new Map());
|
|
66
|
+
_GxIdePluginDetails_versionsMenuOptionsModel.set(this, () => {
|
|
67
|
+
var _a;
|
|
68
|
+
const versionsToUpdateMenusModel = (_a = this.data.versions) === null || _a === void 0 ? void 0 : _a.map(version => {
|
|
69
|
+
return { id: version, caption: version };
|
|
70
|
+
});
|
|
71
|
+
return versionsToUpdateMenusModel;
|
|
72
|
+
});
|
|
73
|
+
_GxIdePluginDetails_menuVersionSelectedHandler.set(this, (event) => {
|
|
74
|
+
const selectedVersion = event.detail.id;
|
|
75
|
+
this.installCallback(selectedVersion);
|
|
76
|
+
});
|
|
77
|
+
_GxIdePluginDetails_renderUninstallButton.set(this, () => {
|
|
78
|
+
return (h("button", { class: "button-tertiary", onClick: __classPrivateFieldGet(this, _GxIdePluginDetails_uninstallClickedHandler, "f") }, __classPrivateFieldGet(this, _GxIdePluginDetails_componentLocale, "f").actions.uninstall));
|
|
79
|
+
});
|
|
80
|
+
_GxIdePluginDetails_installClickedHandler.set(this, () => {
|
|
81
|
+
this.installCallback();
|
|
82
|
+
});
|
|
83
|
+
_GxIdePluginDetails_updateVersionHandler.set(this, (id) => () => {
|
|
84
|
+
this.installCallback(id);
|
|
85
|
+
});
|
|
86
|
+
_GxIdePluginDetails_openLinkHandler.set(this, (link) => (event) => {
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
this.openLinkCallback(link);
|
|
89
|
+
});
|
|
90
|
+
_GxIdePluginDetails_uninstallClickedHandler.set(this, () => {
|
|
91
|
+
this.uninstallCallback();
|
|
92
|
+
});
|
|
93
|
+
_GxIdePluginDetails_renderActionButtons.set(this, () => {
|
|
94
|
+
var _a;
|
|
95
|
+
let actionButtonCaption;
|
|
96
|
+
let actionButtonClasses = "button-primary action-button";
|
|
97
|
+
let actionButtonCallback;
|
|
98
|
+
const moreVersionsToUpdate = (_a = this.data.versions) === null || _a === void 0 ? void 0 : _a.length;
|
|
99
|
+
if (!this.data.installed) {
|
|
100
|
+
actionButtonCaption = __classPrivateFieldGet(this, _GxIdePluginDetails_componentLocale, "f").actions.install;
|
|
101
|
+
actionButtonCallback = __classPrivateFieldGet(this, _GxIdePluginDetails_installClickedHandler, "f");
|
|
102
|
+
}
|
|
103
|
+
else if (this.data.updateVersion) {
|
|
104
|
+
actionButtonCaption = `${__classPrivateFieldGet(this, _GxIdePluginDetails_componentLocale, "f").actions.updateTo} ${this.data.updateVersion}`;
|
|
105
|
+
actionButtonCallback = __classPrivateFieldGet(this, _GxIdePluginDetails_updateVersionHandler, "f").call(this, this.data.updateVersion);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
actionButtonCaption = __classPrivateFieldGet(this, _GxIdePluginDetails_componentLocale, "f").actions.installed;
|
|
109
|
+
}
|
|
110
|
+
if (moreVersionsToUpdate) {
|
|
111
|
+
actionButtonClasses = `${actionButtonClasses} more-versions-available`;
|
|
112
|
+
}
|
|
113
|
+
return [
|
|
114
|
+
h("div", { class: "version-buttons-container" }, h("button", { class: actionButtonClasses, onClick: actionButtonCallback }, actionButtonCaption), moreVersionsToUpdate ? (h("ch-action-menu-render", { class: "dropdown button-primary button-icon-only", blockAlign: "outside-end", inlineAlign: "inside-start", model: __classPrivateFieldGet(this, _GxIdePluginDetails_versionsMenuOptionsModel, "f").call(this), onButtonClick: __classPrivateFieldGet(this, _GxIdePluginDetails_menuVersionSelectedHandler, "f") }, h("ch-image", { src: CHEVRON_DOWN_ICON, class: "icon-md" }))) : null)
|
|
115
|
+
];
|
|
116
|
+
});
|
|
117
|
+
_GxIdePluginDetails_tabSelectionChangedHandler.set(this, (event) => {
|
|
118
|
+
this.selectedTabId = event.detail.newSelectedId;
|
|
119
|
+
});
|
|
120
|
+
_GxIdePluginDetails_renderDocSectionsSlots.set(this, () => {
|
|
121
|
+
return this.docsTabModel.map(docSectionTab => {
|
|
122
|
+
if (docSectionTab.id === this.selectedTabId) {
|
|
123
|
+
const markdownValue = __classPrivateFieldGet(this, _GxIdePluginDetails_docSectionIdDescriptionMap, "f").get(docSectionTab.id);
|
|
124
|
+
return (h("ch-markdown-viewer", { slot: docSectionTab.id, key: docSectionTab.id, class: "markdown spacing-body scrollable", theme: "components/markdown-viewer", value: markdownValue }));
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
_GxIdePluginDetails_returnFormatedId.set(this, (rawId) => {
|
|
129
|
+
return rawId.toLowerCase().replace(/\s+/g, "-");
|
|
130
|
+
});
|
|
131
|
+
_GxIdePluginDetails_renderAsideContent.set(this, () => {
|
|
132
|
+
return this.data.infoCategories.map(infoCategory => {
|
|
133
|
+
return (h("div", { class: "plugin__info-category" }, h("h3", { class: "subtitle-semi-bold-s" }, infoCategory.name), h("ul", { class: {
|
|
134
|
+
"fields__list": true,
|
|
135
|
+
"fields__list--as-tags": infoCategory.displayAsTags
|
|
136
|
+
} }, infoCategory.fields.map(field => {
|
|
137
|
+
// If the field name isn’t specified, only the value is shown — usually a link.
|
|
138
|
+
const fieldValue = typeof field.value === "string" ? field.value : (h("a", { class: "field__link", onClick: __classPrivateFieldGet(this, _GxIdePluginDetails_openLinkHandler, "f").call(this, field.value.url) }, field.value.text));
|
|
139
|
+
return (h("li", { class: "field__li" }, field.name && !infoCategory.displayAsTags
|
|
140
|
+
? // displaysAsTags forces the items to be displayed as tags
|
|
141
|
+
// no span.field__name and span.field__value
|
|
142
|
+
[
|
|
143
|
+
h("span", { class: "field__name body-semi-bold-s" }, field.name),
|
|
144
|
+
h("span", { class: "field__value body-regular-s" }, fieldValue)
|
|
145
|
+
]
|
|
146
|
+
: fieldValue));
|
|
147
|
+
}))));
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
this.docsTabModel = [];
|
|
151
|
+
this.selectedTabId = undefined;
|
|
152
|
+
this.data = undefined;
|
|
153
|
+
this.installCallback = undefined;
|
|
154
|
+
this.openLinkCallback = undefined;
|
|
155
|
+
this.uninstallCallback = undefined;
|
|
156
|
+
}
|
|
157
|
+
async componentWillLoad() {
|
|
158
|
+
var _a;
|
|
159
|
+
__classPrivateFieldSet(this, _GxIdePluginDetails_componentLocale, await Locale.getComponentStrings(this.el), "f");
|
|
160
|
+
if ((_a = this.data.docSections) === null || _a === void 0 ? void 0 : _a.length) {
|
|
161
|
+
this.docsTabModel = this.data.docSections.map((docSection, i) => {
|
|
162
|
+
const formatedId = __classPrivateFieldGet(this, _GxIdePluginDetails_returnFormatedId, "f").call(this, docSection.name);
|
|
163
|
+
__classPrivateFieldGet(this, _GxIdePluginDetails_docSectionIdDescriptionMap, "f").set(formatedId, docSection.content);
|
|
164
|
+
if (i === 0) {
|
|
165
|
+
this.selectedTabId = formatedId;
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
id: formatedId,
|
|
169
|
+
name: docSection.name
|
|
170
|
+
};
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
render() {
|
|
175
|
+
const renderActionButtons = !this.data.installed ||
|
|
176
|
+
(this.data.installed && !!this.data.updateVersion);
|
|
177
|
+
const titleLinkDataText = this.data.name.text;
|
|
178
|
+
const titleLinkDataUrl = this.data.name.url;
|
|
179
|
+
const titleHasLink = titleLinkDataText && titleLinkDataUrl;
|
|
180
|
+
const titleText = titleLinkDataText || this.data.name;
|
|
181
|
+
const publisherDataText = this.data.publisher.text;
|
|
182
|
+
const publisherDataUrl = this.data.publisher.url;
|
|
183
|
+
const publisherHasLink = publisherDataText && publisherDataUrl;
|
|
184
|
+
const publisherText = publisherDataText || this.data.publisher;
|
|
185
|
+
return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("section", { class: "section" }, h("header", { class: "header" }, h("img", { class: "plugin__icon", src: this.data.iconUrl || EXTENSION_ICON_IMG, alt: "plugin extension icon" }), h("div", { class: "plugin__details" }, titleHasLink ? (h("h2", { class: "heading-5" }, h("a", { href: titleLinkDataUrl, onClick: __classPrivateFieldGet(this, _GxIdePluginDetails_openLinkHandler, "f").call(this, titleLinkDataUrl), class: "text-underline" }, titleText))) : (h("h2", { class: "heading-5" }, titleText)), publisherHasLink ? (h("a", { href: publisherDataUrl, onClick: __classPrivateFieldGet(this, _GxIdePluginDetails_openLinkHandler, "f").call(this, publisherDataUrl), class: "text-underline plugin__publisher tiny-semi-bold-l" }, h("ch-image", { src: USER_ICON, class: "icon-md" }), publisherText)) : (h("p", { class: "plugin__publisher tiny-semi-bold-l" }, h("ch-image", { src: USER_ICON, class: "icon-md" }), publisherText)), h("p", { class: "plugin__description" }, this.data.description), h("div", { class: "buttons-spacer plugin__actions-container" }, renderActionButtons ? (__classPrivateFieldGet(this, _GxIdePluginDetails_renderActionButtons, "f").call(this)) : (
|
|
186
|
+
// installed and no updates
|
|
187
|
+
h("p", { class: "installed-container subtitle-semi-bold-s" }, h("ch-image", { src: CHECK_CIRCLE_ICON, class: "icon-md" }), __classPrivateFieldGet(this, _GxIdePluginDetails_componentLocale, "f").actions.installed)), this.data.installed && __classPrivateFieldGet(this, _GxIdePluginDetails_renderUninstallButton, "f").call(this)))), h("div", { class: "main" }, this.docsTabModel.length > 0 && (h("ch-tab-render", { class: "tab docsTab scrollable", tabListPosition: "block-start", overflow: "auto", contain: "size", model: this.docsTabModel, onSelectedItemChange: __classPrivateFieldGet(this, _GxIdePluginDetails_tabSelectionChangedHandler, "f"), selectedId: this.selectedTabId }, __classPrivateFieldGet(this, _GxIdePluginDetails_renderDocSectionsSlots, "f").call(this)))), h("div", { class: "aside spacing-body scrollable" }, __classPrivateFieldGet(this, _GxIdePluginDetails_renderAsideContent, "f").call(this)))));
|
|
188
|
+
}
|
|
189
|
+
static get assetsDirs() { return ["gx-ide-assets/plugin-details"]; }
|
|
190
|
+
get el() { return getElement(this); }
|
|
191
|
+
};
|
|
192
|
+
_GxIdePluginDetails_componentLocale = new WeakMap(), _GxIdePluginDetails_docSectionIdDescriptionMap = new WeakMap(), _GxIdePluginDetails_versionsMenuOptionsModel = new WeakMap(), _GxIdePluginDetails_menuVersionSelectedHandler = new WeakMap(), _GxIdePluginDetails_renderUninstallButton = new WeakMap(), _GxIdePluginDetails_installClickedHandler = new WeakMap(), _GxIdePluginDetails_updateVersionHandler = new WeakMap(), _GxIdePluginDetails_openLinkHandler = new WeakMap(), _GxIdePluginDetails_uninstallClickedHandler = new WeakMap(), _GxIdePluginDetails_renderActionButtons = new WeakMap(), _GxIdePluginDetails_tabSelectionChangedHandler = new WeakMap(), _GxIdePluginDetails_renderDocSectionsSlots = new WeakMap(), _GxIdePluginDetails_returnFormatedId = new WeakMap(), _GxIdePluginDetails_renderAsideContent = new WeakMap();
|
|
193
|
+
GxIdePluginDetails.style = pluginDetailsCss;
|
|
194
|
+
|
|
195
|
+
export { GxIdePluginDetails as gx_ide_plugin_details };
|
|
196
|
+
|
|
197
|
+
//# sourceMappingURL=gx-ide-plugin-details.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"gx-ide-plugin-details.entry.js","mappings":";;;;AAAA,MAAM,gBAAgB,GAAG,2jFAA2jF;;;;;;;;;;;;;;;;;;;ACgBplF,MAAM,SAAS,GAAG,WAAW,CAAC;IAC5B,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,cAAc;CAC1B,CAAC,CAAC;AACH,MAAM,iBAAiB,GAAG,WAAW,CAAC;IACpC,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,YAAY;CACxB,CAAC,CAAC;AACH,MAAM,iBAAiB,GAAG,WAAW,CAAC;IACpC,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH;AACA,MAAM,kBAAkB,GAAG,YAAY,CACrC,uDAAuD,CACxD,CAAC;AAEF,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,qBAAqB;IACrB,mBAAmB;IACnB,qBAAqB;IACrB,iBAAiB;IACjB,iBAAiB;IACjB,qBAAqB;IACrB,gBAAgB;IAChB,YAAY;IACZ,cAAc;IACd,eAAe;IACf,kBAAkB;CACnB,CAAC;MAQW,kBAAkB;;;;;;;QAK7B,sDAAsB;;;QAItB,yDAAmD,IAAI,GAAG,EAAE,EAAC;QAgD7D,uDAA4B;;YAC1B,MAAM,0BAA0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AAI,+CAAqB,MAAzB,IAAI,CAAuB;;QAG3B,SAAG,KAAK,EAAC,0CAA0C,IACjD,gBACE,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAC,SAAS,GACL,EACX,uBAAA,IAAI,2CAAiB,CAAC,OAAO,CAAC,SAAS,CACtC,CACL,EACA,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,uBAAA,IAAI,iDAAuB,MAA3B,IAAI,CAAyB,CACjD,CACF,CACC,EACT,WAAK,KAAK,EAAC,MAAM,IACd,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,KAC3B,qBACE,KAAK,EAAC,wBAAwB,EAC9B,eAAe,EAAC,aAAa,EAC7B,QAAQ,EAAC,MAAM,EACf,OAAO,EAAC,MAAM,EACd,KAAK,EAAE,IAAI,CAAC,YAAY,EACxB,oBAAoB,EAAE,uBAAA,IAAI,sDAA4B,EACtD,UAAU,EAAE,IAAI,CAAC,aAAa,IAE7B,uBAAA,IAAI,kDAAwB,MAA5B,IAAI,CAA0B,CACjB,CACjB,CACG,EACN,WAAK,KAAK,EAAC,+BAA+B,IACvC,uBAAA,IAAI,8CAAoB,MAAxB,IAAI,CAAsB,CACvB,CACE,CAEL,EACP;KACH;;;;;;;;;","names":[],"sources":["src/components/plugin-details/plugin-details.scss?tag=gx-ide-plugin-details&encapsulation=shadow","src/components/plugin-details/plugin-details.tsx"],"sourcesContent":[":host {\n display: grid;\n block-size: 100%;\n grid-template-areas:\n \"header header\"\n \"main aside\";\n grid-template-rows: max-content 1fr;\n grid-template-columns: 1fr 280px;\n row-gap: 12px;\n}\n\n.section {\n display: contents;\n}\n\n// header\n.header {\n display: grid;\n grid-area: header;\n grid-template-areas: \"plugin-icon plugin-details\";\n grid-template-columns: 64px 1fr;\n column-gap: 16px;\n padding: 24px 24px 16px 24px;\n}\n.plugin__icon {\n grid-area: plugin-icon;\n max-width: 100%;\n}\n.plugin__details {\n grid-area: plugin-details;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.plugin__publisher {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n.plugin__description {\n line-height: 1.5; // WA: Text appears too tight.\n}\n.plugin__actions-container {\n margin-block-start: 8px;\n align-items: center;\n}\n.action-button {\n min-inline-size: 100px;\n\n &.more-versions-available {\n border-start-end-radius: 0 !important;\n border-end-end-radius: 0 !important;\n }\n}\n.installed-container {\n display: flex;\n align-items: center;\n gap: 6px;\n\n // WA Biggest Mercury icon (icon-md) looks small in this case.\n // Mercury should expose more icon sizes.\n ch-image {\n --ch-image-size: 20px;\n }\n}\n\n// main\n.main {\n grid-area: main;\n}\n.docsTab {\n block-size: 100%;\n}\n\n// aside\n.aside {\n grid-area: aside;\n overflow: auto;\n border-block-start: 1px solid var(--items-container__border-color);\n}\n.fields__list {\n list-style: none;\n padding: 0;\n margin: 0;\n font-size: 12px;\n}\n.plugin__info-category {\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n &:not(:first-child) {\n $space: 16px;\n padding-block-start: $space;\n margin-block-start: $space;\n border-block-start: 1px solid var(--mer-border-color__on-elevation--01);\n }\n}\n.fields__list:not(.fields__list--as-tags) {\n display: flex;\n flex-direction: column;\n gap: 8px;\n .field__li {\n display: flex;\n gap: 16px;\n }\n}\n.fields__list--as-tags {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n\n .field__li {\n border: 1px solid var(--mer-border-color__on-elevation--01);\n padding: 2px 8px;\n border-radius: 4px;\n\n text-transform: lowercase;\n }\n .field__link {\n color: var(--mer-text__on-surface);\n\n &:hover {\n color: var(--mer-accent__primary);\n }\n &:active {\n color: var(--mer-accent__primary--hover);\n }\n }\n}\n\n.field__name,\n.field__value {\n flex: 1;\n}\n// WA: Link styles should be defined Mercury\n.field__link {\n color: var(--mer-accent__primary);\n &:hover {\n color: var(--mer-accent__primary--hover);\n }\n &:active {\n color: var(--mer-accent__primary--active);\n }\n}\n// WA: Remove tab elevation background color\n.docsTab {\n background-color: transparent !important;\n}\n\n// WA: Styles for \"button-icon-only\" should be defined on mercury\n.dropdown.button-icon-only::part(expandable-button) {\n padding: calc(\n (\n var(--control__block-size) - 2 * var(--control__border-width) -\n var(--mer-icon__box--md)\n ) / 2\n ) !important;\n border-start-start-radius: 0 !important;\n border-end-start-radius: 0 !important;\n}\n\n.version-buttons-container {\n display: flex;\n align-items: center;\n gap: 1px;\n}\n\nch-markdown-viewer {\n block-size: 100%;\n overflow: auto;\n}\n\n// WA: Need text with underline. This should be defined on Mercury\n.text-underline {\n text-decoration: underline;\n}\n","import {\n Component,\n Host,\n State,\n Prop,\n Element,\n h,\n getAssetPath,\n JSX\n} from \"@stencil/core\";\n\nimport { getIconPath, MercuryBundles } from \"@genexus/mercury\";\nimport { Locale } from \"../../common/locale\";\nimport { ActionMenuModel, TabModel } from \"@genexus/chameleon-controls-library\";\nimport { TabItemModel } from \"@genexus/chameleon-controls-library/dist/types/components/tab/types\";\n\nconst USER_ICON = getIconPath({\n category: \"system\",\n name: \"user\",\n colorType: \"on-elevation\"\n});\nconst CHEVRON_DOWN_ICON = getIconPath({\n category: \"system\",\n name: \"chevron-down\",\n colorType: \"on-primary\"\n});\nconst CHECK_CIRCLE_ICON = getIconPath({\n category: \"system\",\n name: \"check-circle\",\n colorType: \"success\"\n});\n\n// plugin icon if no iconUri was provided\nconst EXTENSION_ICON_IMG = getAssetPath(\n `./gx-ide-assets/plugin-manager/images/plugin-icon.svg`\n);\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"chameleon/scrollbar\",\n \"components/button\",\n \"components/dropdown\",\n \"components/edit\",\n \"components/icon\",\n \"components/list-box\",\n \"components/tab\",\n \"utils/form\",\n \"utils/layout\",\n \"utils/spacing\",\n \"utils/typography\"\n];\n\n@Component({\n tag: \"gx-ide-plugin-details\",\n styleUrl: \"plugin-details.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/plugin-details\"]\n})\nexport class GxIdePluginDetails {\n /**\n * The component hard-coded strings translations.\n */\n // eslint-disable-next-line @stencil-community/own-props-must-be-private\n #componentLocale: any;\n\n // A map between docSection \"id\", and docSection \"description\".\n // \"id\" is generated inside this component.\n #docSectionIdDescriptionMap: Map<string, string> = new Map();\n\n @Element() el: HTMLGxIdePluginDetailsElement;\n\n @State() docsTabModel: TabModel = [];\n @State() selectedTabId: string;\n\n /**\n * Specifies all the information related to a plugin.\n */\n @Prop() readonly data!: PluginDetailsData;\n\n /**\n * Callback that should be invoked when the user performs the install or update action.\n * Receives an optional version string when a specific version is selected.\n */\n @Prop() readonly installCallback!: (version?: string) => Promise<void>;\n\n /**\n * Callback that should be invoked when the user attempts to open any link displayed in this component.\n */\n @Prop() readonly openLinkCallback!: (url: string) => Promise<void>;\n\n /**\n * Callback that should be invoked when the user performs the uninstall action.\n */\n @Prop() readonly uninstallCallback!: () => Promise<void>;\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n\n if (this.data.docSections?.length) {\n this.docsTabModel = this.data.docSections.map((docSection, i) => {\n const formatedId = this.#returnFormatedId(docSection.name);\n\n this.#docSectionIdDescriptionMap.set(formatedId, docSection.content);\n\n if (i === 0) {\n this.selectedTabId = formatedId;\n }\n return {\n id: formatedId,\n name: docSection.name\n } as TabItemModel;\n });\n }\n }\n\n #versionsMenuOptionsModel = (): ActionMenuModel => {\n const versionsToUpdateMenusModel: ActionMenuModel = this.data.versions?.map(\n version => {\n return { id: version, caption: version };\n }\n );\n return versionsToUpdateMenusModel;\n };\n\n #menuVersionSelectedHandler = (\n event: CustomEvent<{\n id?: string;\n }>\n ) => {\n const selectedVersion = event.detail.id;\n this.installCallback(selectedVersion);\n };\n\n #renderUninstallButton = (): JSX.Element => {\n return (\n <button class=\"button-tertiary\" onClick={this.#uninstallClickedHandler}>\n {this.#componentLocale.actions.uninstall}\n </button>\n );\n };\n\n #installClickedHandler = () => {\n this.installCallback();\n };\n\n #updateVersionHandler = (id: string) => () => {\n this.installCallback(id);\n };\n\n #openLinkHandler = (link: string) => (event: MouseEvent) => {\n event.preventDefault();\n this.openLinkCallback(link);\n };\n\n #uninstallClickedHandler = () => {\n this.uninstallCallback();\n };\n\n #renderActionButtons = (): JSX.Element => {\n let actionButtonCaption;\n let actionButtonClasses = \"button-primary action-button\";\n let actionButtonCallback;\n const moreVersionsToUpdate = this.data.versions?.length;\n\n if (!this.data.installed) {\n actionButtonCaption = this.#componentLocale.actions.install;\n actionButtonCallback = this.#installClickedHandler;\n } else if (this.data.updateVersion) {\n actionButtonCaption = `${this.#componentLocale.actions.updateTo} ${\n this.data.updateVersion\n }`;\n actionButtonCallback = this.#updateVersionHandler(\n this.data.updateVersion\n );\n } else {\n actionButtonCaption = this.#componentLocale.actions.installed;\n }\n\n if (moreVersionsToUpdate) {\n actionButtonClasses = `${actionButtonClasses} more-versions-available`;\n }\n\n return [\n <div class=\"version-buttons-container\">\n <button class={actionButtonClasses} onClick={actionButtonCallback}>\n {actionButtonCaption}\n </button>\n {moreVersionsToUpdate ? (\n <ch-action-menu-render\n class=\"dropdown button-primary button-icon-only\"\n blockAlign=\"outside-end\"\n inlineAlign=\"inside-start\"\n model={this.#versionsMenuOptionsModel()}\n onButtonClick={this.#menuVersionSelectedHandler}\n >\n <ch-image src={CHEVRON_DOWN_ICON} class=\"icon-md\"></ch-image>\n </ch-action-menu-render>\n ) : null}\n </div>\n ];\n };\n\n #tabSelectionChangedHandler = (\n event: CustomEvent<{\n lastSelectedIndex: number;\n newSelectedId: string;\n newSelectedIndex: number;\n }>\n ): void => {\n this.selectedTabId = event.detail.newSelectedId;\n };\n\n #renderDocSectionsSlots = (): JSX.Element => {\n return this.docsTabModel.map(docSectionTab => {\n if (docSectionTab.id === this.selectedTabId) {\n const markdownValue = this.#docSectionIdDescriptionMap.get(\n docSectionTab.id\n );\n\n return (\n <ch-markdown-viewer\n slot={docSectionTab.id}\n key={docSectionTab.id}\n class=\"markdown spacing-body scrollable\"\n theme=\"components/markdown-viewer\"\n value={markdownValue}\n ></ch-markdown-viewer>\n );\n }\n });\n };\n\n #returnFormatedId = (rawId: string): string => {\n return rawId.toLowerCase().replace(/\\s+/g, \"-\");\n };\n\n #renderAsideContent = (): JSX.Element => {\n return this.data.infoCategories.map(infoCategory => {\n return (\n <div class=\"plugin__info-category\">\n <h3 class=\"subtitle-semi-bold-s\">{infoCategory.name}</h3>\n <ul\n class={{\n \"fields__list\": true,\n \"fields__list--as-tags\": infoCategory.displayAsTags\n }}\n >\n {infoCategory.fields.map(field => {\n // If the field name isn’t specified, only the value is shown — usually a link.\n const fieldValue: string | HTMLAnchorElement =\n typeof field.value === \"string\" ? (\n (field.value as string)\n ) : (\n <a\n class=\"field__link\"\n onClick={this.#openLinkHandler(\n (field.value as LinkData).url\n )}\n >\n {(field.value as LinkData).text}\n </a>\n );\n return (\n <li class=\"field__li\">\n {field.name && !infoCategory.displayAsTags\n ? // displaysAsTags forces the items to be displayed as tags\n // no span.field__name and span.field__value\n [\n <span class=\"field__name body-semi-bold-s\">\n {field.name}\n </span>,\n <span class=\"field__value body-regular-s\">\n {fieldValue}\n </span>\n ]\n : fieldValue}\n </li>\n );\n })}\n </ul>\n </div>\n );\n });\n };\n\n render() {\n const renderActionButtons =\n !this.data.installed ||\n (this.data.installed && !!this.data.updateVersion);\n\n const titleLinkDataText = (this.data.name as LinkData).text;\n const titleLinkDataUrl = (this.data.name as LinkData).url;\n const titleHasLink = titleLinkDataText && titleLinkDataUrl;\n const titleText = titleLinkDataText || this.data.name;\n\n const publisherDataText = (this.data.publisher as LinkData).text;\n const publisherDataUrl = (this.data.publisher as LinkData).url;\n const publisherHasLink = publisherDataText && publisherDataUrl;\n const publisherText = publisherDataText || this.data.publisher;\n\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <section class=\"section\">\n <header class=\"header\">\n <img\n class=\"plugin__icon\"\n src={this.data.iconUrl || EXTENSION_ICON_IMG}\n alt=\"plugin extension icon\"\n />\n <div class=\"plugin__details\">\n {titleHasLink ? (\n <h2 class=\"heading-5\">\n <a\n href={titleLinkDataUrl}\n onClick={this.#openLinkHandler(titleLinkDataUrl)}\n class=\"text-underline\"\n >\n {titleText}\n </a>\n </h2>\n ) : (\n <h2 class=\"heading-5\">{titleText}</h2>\n )}\n\n {publisherHasLink ? (\n <a\n href={publisherDataUrl}\n onClick={this.#openLinkHandler(publisherDataUrl)}\n class=\"text-underline plugin__publisher tiny-semi-bold-l\"\n >\n <ch-image src={USER_ICON} class=\"icon-md\"></ch-image>\n {publisherText}\n </a>\n ) : (\n <p class=\"plugin__publisher tiny-semi-bold-l\">\n <ch-image src={USER_ICON} class=\"icon-md\"></ch-image>\n {publisherText}\n </p>\n )}\n\n <p class=\"plugin__description\">{this.data.description}</p>\n <div class=\"buttons-spacer plugin__actions-container\">\n {renderActionButtons ? (\n this.#renderActionButtons()\n ) : (\n // installed and no updates\n <p class=\"installed-container subtitle-semi-bold-s\">\n <ch-image\n src={CHECK_CIRCLE_ICON}\n class=\"icon-md\"\n ></ch-image>\n {this.#componentLocale.actions.installed}\n </p>\n )}\n {this.data.installed && this.#renderUninstallButton()}\n </div>\n </div>\n </header>\n <div class=\"main\">\n {this.docsTabModel.length > 0 && (\n <ch-tab-render\n class=\"tab docsTab scrollable\"\n tabListPosition=\"block-start\"\n overflow=\"auto\"\n contain=\"size\"\n model={this.docsTabModel}\n onSelectedItemChange={this.#tabSelectionChangedHandler}\n selectedId={this.selectedTabId}\n >\n {this.#renderDocSectionsSlots()}\n </ch-tab-render>\n )}\n </div>\n <div class=\"aside spacing-body scrollable\">\n {this.#renderAsideContent()}\n </div>\n </section>\n {/* <slot></slot> */}\n </Host>\n );\n }\n}\n\n// plugin-details.types.ts\n\nexport type LinkData = {\n text: string;\n url: string;\n};\n\nexport type PluginFieldData = {\n name?: string;\n value: string | LinkData;\n};\n\nexport type PluginInfoCategoryData = {\n name: string;\n fields: PluginFieldData[];\n displayAsTags: boolean;\n};\n\nexport type DocSectionData = {\n name: string;\n content: string;\n};\n\nexport type PluginDetailsData = {\n id: string;\n name: string | LinkData;\n publisher: string | LinkData;\n installed: boolean;\n updateVersion?: string;\n versions: string[];\n iconUrl: string;\n description: string;\n docSections: DocSectionData[];\n infoCategories: PluginInfoCategoryData[];\n};\n"],"version":3}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { g as getAssetPath, r as registerInstance, h, H as Host, a as getElement } from './index-10af18cf.js';
|
|
2
|
+
import { g as getIconPath } from './MERCURY_ASSETS-7c06e424.js';
|
|
3
|
+
import { L as Locale } from './locale-e5107fad.js';
|
|
4
|
+
import { c as config } from './config-1ef9d75a.js';
|
|
5
|
+
|
|
6
|
+
const pluginExplorerCss = ":host{display:grid;block-size:100%;position:relative}.outer-container{grid-template-rows:max-content 1fr}.inner-container{position:relative}.list-box::part(item){width:100%;min-width:100%}.list-box::part(item__action){gap:4px}.list-box::part(item__caption){font-weight:600}.list-box::part(custom-container){display:flex;flex-direction:column;gap:4px;width:100%}.list-box::part(custom-image){block-size:32px;inline-size:32px;margin-inline-end:12px}.list-box::part(custom-description){font-size:12px;margin:0;opacity:0.8;line-height:1.4;margin-inline-end:8px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.list-box::part(item__block-end start){width:100%;min-width:100%}.list-box::part(custom-brand){font-weight:600;display:flex;gap:4px;align-items:center}.list-box::part(custom-brand-icon){--icon-path:var(--icon__system_user_neutral--enabled);display:inline-block;background-image:var(--icon-path);background-size:contain;background-repeat:no-repeat;background-position:center center;block-size:16px;inline-size:16px}.list-box::part(custom-button){--control__border-color:var(--button-background-color);--button-color:var(--mer-text__primary);--button-color--enabled:var(--mer-text__on-primary);--button-color--active:var(--mer-text__on-primary--active);display:inline-grid;grid-auto-flow:column;grid-auto-columns:max-content;justify-content:center;padding-block:var(--control__padding-block);padding-inline:var(--control__padding-inline);box-sizing:border-box;background-color:var(--button-background-color);color:var(--button-color);font-weight:600;margin-block-end:auto;margin-block-start:auto;text-transform:capitalize}.list-box::part(custom-button):hover{--button-color:var(--mer-text__primary--hover)}.list-box::part(custom-button):active{--button-color:var(--mer-text__primary--active)}";
|
|
7
|
+
|
|
8
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f)
|
|
10
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
11
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
12
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
13
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
|
+
};
|
|
15
|
+
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
16
|
+
if (kind === "m")
|
|
17
|
+
throw new TypeError("Private method is not writable");
|
|
18
|
+
if (kind === "a" && !f)
|
|
19
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
20
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
21
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
22
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
23
|
+
};
|
|
24
|
+
var _GxIdePluginManager_componentLocale, _GxIdePluginManager_animateEmptyState, _GxIdePluginManager_actionListButtonClickHandler, _GxIdePluginManager_mapPluginDataToActionListModel, _GxIdePluginManager_pluginsFilterInputHandler, _GxIdePluginManager_evaluateContentToDisplay, _GxIdePluginManager_renderLoader, _GxIdePluginManager_pluginSelectedHandler;
|
|
25
|
+
const FILTER_ICON = getIconPath({
|
|
26
|
+
category: "system",
|
|
27
|
+
name: "filters",
|
|
28
|
+
colorType: "on-elevation"
|
|
29
|
+
});
|
|
30
|
+
// plugin icon if no iconUrl was provided
|
|
31
|
+
const EXTENSION_ICON_IMG = getAssetPath(`./gx-ide-assets/plugin-manager/images/plugin-icon.svg`);
|
|
32
|
+
const CSS_BUNDLES = [
|
|
33
|
+
"resets/box-sizing",
|
|
34
|
+
"components/list-box",
|
|
35
|
+
"components/button",
|
|
36
|
+
"components/edit",
|
|
37
|
+
"utils/form",
|
|
38
|
+
"utils/layout",
|
|
39
|
+
"utils/typography",
|
|
40
|
+
"utils/spacing",
|
|
41
|
+
"chameleon/scrollbar"
|
|
42
|
+
];
|
|
43
|
+
const GxIdePluginManager = class {
|
|
44
|
+
constructor(hostRef) {
|
|
45
|
+
registerInstance(this, hostRef);
|
|
46
|
+
/**
|
|
47
|
+
* The component hard-coded strings translations.
|
|
48
|
+
*/
|
|
49
|
+
// eslint-disable-next-line @stencil-community/own-props-must-be-private
|
|
50
|
+
_GxIdePluginManager_componentLocale.set(this, void 0);
|
|
51
|
+
_GxIdePluginManager_animateEmptyState.set(this, false);
|
|
52
|
+
_GxIdePluginManager_actionListButtonClickHandler.set(this, (pluginId, action) => (event) => {
|
|
53
|
+
event.stopPropagation();
|
|
54
|
+
this.executeActionCallback(pluginId, action);
|
|
55
|
+
});
|
|
56
|
+
_GxIdePluginManager_mapPluginDataToActionListModel.set(this, (pluginsData) => {
|
|
57
|
+
const pluginsActionListModel = [];
|
|
58
|
+
const separatorItem = { type: "separator" };
|
|
59
|
+
pluginsData === null || pluginsData === void 0 ? void 0 : pluginsData.forEach((pluginData, index) => {
|
|
60
|
+
const hasActionButton = !!pluginData.action;
|
|
61
|
+
const pluginItem = {
|
|
62
|
+
id: pluginData.id,
|
|
63
|
+
caption: pluginData.name,
|
|
64
|
+
imgSrc: pluginData.iconUrl,
|
|
65
|
+
type: "actionable",
|
|
66
|
+
additionalInformation: {
|
|
67
|
+
"stretch-start": {
|
|
68
|
+
center: [
|
|
69
|
+
{
|
|
70
|
+
part: "custom-image",
|
|
71
|
+
jsx: () => (h("img", { part: "custom-image", src: pluginData.iconUrl || EXTENSION_ICON_IMG, alt: `${__classPrivateFieldGet(this, _GxIdePluginManager_componentLocale, "f").logotype.replace("PLUGIN_NAME_PLACEHOLDER", pluginData.name)}`, loading: "lazy" }))
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"block-end": {
|
|
76
|
+
start: [
|
|
77
|
+
{
|
|
78
|
+
part: "custom-description custom-button custom-container custom-brand custom-brand-icon custom-image item__block-end start",
|
|
79
|
+
jsx: () => (h("div", { part: "custom-container", title: pluginData.description }, h("p", { part: "custom-description" }, pluginData.description), h("small", { part: "custom-brand" }, h("span", { part: "custom-brand-icon" }), pluginData.publisher)))
|
|
80
|
+
}
|
|
81
|
+
// {
|
|
82
|
+
// slot: "abcd"
|
|
83
|
+
// } as ActionListItemAdditionalSlot // slot not working
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"stretch-end": hasActionButton && {
|
|
87
|
+
center: [
|
|
88
|
+
{
|
|
89
|
+
jsx: () => (h("button", { part: "custom-button", onClick: __classPrivateFieldGet(this, _GxIdePluginManager_actionListButtonClickHandler, "f").call(this, pluginData.id, pluginData.action) }, pluginData.action))
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
if (index !== 0) {
|
|
96
|
+
pluginsActionListModel.push(separatorItem);
|
|
97
|
+
}
|
|
98
|
+
pluginsActionListModel.push(pluginItem);
|
|
99
|
+
});
|
|
100
|
+
return pluginsActionListModel;
|
|
101
|
+
});
|
|
102
|
+
_GxIdePluginManager_pluginsFilterInputHandler.set(this, async (event) => {
|
|
103
|
+
this.loading = true;
|
|
104
|
+
const filterValue = event.detail;
|
|
105
|
+
this.plugins = await this.filterCallback(filterValue);
|
|
106
|
+
});
|
|
107
|
+
_GxIdePluginManager_evaluateContentToDisplay.set(this, () => {
|
|
108
|
+
const pluginsToDisplay = this.pluginsActionListModel.length;
|
|
109
|
+
return pluginsToDisplay ? (h("ch-action-list-render", { model: this.pluginsActionListModel, class: "list-box", selection: "single", onSelectedItemsChange: __classPrivateFieldGet(this, _GxIdePluginManager_pluginSelectedHandler, "f") })) : (h("gx-ide-empty-state", { isAnimated: __classPrivateFieldGet(this, _GxIdePluginManager_animateEmptyState, "f"), class: "recent-objects__empty-state", stateIconSrc: FILTER_ICON, stateTitle: __classPrivateFieldGet(this, _GxIdePluginManager_componentLocale, "f").emptyStateTitle, stateDescription: __classPrivateFieldGet(this, _GxIdePluginManager_componentLocale, "f").emptyStateDescription }));
|
|
110
|
+
});
|
|
111
|
+
_GxIdePluginManager_renderLoader.set(this, () => {
|
|
112
|
+
__classPrivateFieldSet(this, _GxIdePluginManager_animateEmptyState, true, "f");
|
|
113
|
+
return (h("gx-ide-loader", { loaderTitle: __classPrivateFieldGet(this, _GxIdePluginManager_componentLocale, "f").loaderTitle, description: __classPrivateFieldGet(this, _GxIdePluginManager_componentLocale, "f").loaderDescription, show: true }));
|
|
114
|
+
});
|
|
115
|
+
_GxIdePluginManager_pluginSelectedHandler.set(this, (event) => {
|
|
116
|
+
var _a;
|
|
117
|
+
const eventType = (_a = event.detail[0]) === null || _a === void 0 ? void 0 : _a.item.type;
|
|
118
|
+
if (eventType === "actionable") {
|
|
119
|
+
const pluginId = event.detail[0].item.id;
|
|
120
|
+
this.showDetailsCallback(pluginId);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
this.loading = true;
|
|
124
|
+
this.pluginsActionListModel = [];
|
|
125
|
+
this.plugins = undefined;
|
|
126
|
+
this.filterCallback = undefined;
|
|
127
|
+
this.showDetailsCallback = undefined;
|
|
128
|
+
this.executeActionCallback = undefined;
|
|
129
|
+
}
|
|
130
|
+
pluginsChangedHandler(newPlugins) {
|
|
131
|
+
this.pluginsActionListModel =
|
|
132
|
+
__classPrivateFieldGet(this, _GxIdePluginManager_mapPluginDataToActionListModel, "f").call(this, newPlugins);
|
|
133
|
+
this.loading = false;
|
|
134
|
+
}
|
|
135
|
+
async componentWillLoad() {
|
|
136
|
+
__classPrivateFieldSet(this, _GxIdePluginManager_componentLocale, await Locale.getComponentStrings(this.el), "f");
|
|
137
|
+
this.pluginsChangedHandler(this.plugins);
|
|
138
|
+
}
|
|
139
|
+
render() {
|
|
140
|
+
return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("div", { class: "outer-container field-group" }, h("ch-edit", { id: "search-plugins-input", class: "input", accessibleName: __classPrivateFieldGet(this, _GxIdePluginManager_componentLocale, "f").accessibleName, placeholder: __classPrivateFieldGet(this, _GxIdePluginManager_componentLocale, "f").searchInputPlaceholder, debounce: config.inputDebounce, onInput: __classPrivateFieldGet(this, _GxIdePluginManager_pluginsFilterInputHandler, "f"), type: "search" }), h("div", { class: "inner-container" }, this.loading
|
|
141
|
+
? __classPrivateFieldGet(this, _GxIdePluginManager_renderLoader, "f").call(this)
|
|
142
|
+
: __classPrivateFieldGet(this, _GxIdePluginManager_evaluateContentToDisplay, "f").call(this)))));
|
|
143
|
+
}
|
|
144
|
+
static get assetsDirs() { return ["gx-ide-assets/plugin-explorer"]; }
|
|
145
|
+
get el() { return getElement(this); }
|
|
146
|
+
static get watchers() { return {
|
|
147
|
+
"plugins": ["pluginsChangedHandler"]
|
|
148
|
+
}; }
|
|
149
|
+
};
|
|
150
|
+
_GxIdePluginManager_componentLocale = new WeakMap(), _GxIdePluginManager_animateEmptyState = new WeakMap(), _GxIdePluginManager_actionListButtonClickHandler = new WeakMap(), _GxIdePluginManager_mapPluginDataToActionListModel = new WeakMap(), _GxIdePluginManager_pluginsFilterInputHandler = new WeakMap(), _GxIdePluginManager_evaluateContentToDisplay = new WeakMap(), _GxIdePluginManager_renderLoader = new WeakMap(), _GxIdePluginManager_pluginSelectedHandler = new WeakMap();
|
|
151
|
+
GxIdePluginManager.style = pluginExplorerCss;
|
|
152
|
+
|
|
153
|
+
export { GxIdePluginManager as gx_ide_plugin_explorer };
|
|
154
|
+
|
|
155
|
+
//# sourceMappingURL=gx-ide-plugin-explorer.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"gx-ide-plugin-explorer.entry.js","mappings":";;;;;AAAA,MAAM,iBAAiB,GAAG,+wDAA+wD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,iBAAiB;QACrB,uBAAA,IAAI,uCAAoB,MAAM,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,MAAA,CAAC;QAClE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC1C;IA2ID,MAAM;QACJ,QACE,EAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,IAClB,gBAAU,KAAK,EAAE,WAAW,GAAa,EAEzC,WAAK,KAAK,EAAC,6BAA6B,IACtC,eACE,EAAE,EAAC,sBAAsB,EACzB,KAAK,EAAC,OAAO,EACb,cAAc,EAAE,uBAAA,IAAI,2CAAiB,CAAC,cAAc,EACpD,WAAW,EAAE,uBAAA,IAAI,2CAAiB,CAAC,sBAAsB,EACzD,QAAQ,EAAE,MAAM,CAAC,aAAa,EAC9B,OAAO,EAAE,uBAAA,IAAI,qDAA2B,EACxC,IAAI,EAAC,QAAQ,GACJ,EACX,WAAK,KAAK,EAAC,iBAAiB,IACzB,IAAI,CAAC,OAAO;cACT,uBAAA,IAAI,wCAAc,MAAlB,IAAI,CAAgB;cACpB,uBAAA,IAAI,oDAA0B,MAA9B,IAAI,CAA4B,CAChC,CACF,CACD,EACP;KACH;;;;;;;;;;;;","names":[],"sources":["src/components/plugin-explorer/plugin-explorer.scss?tag=gx-ide-plugin-explorer&encapsulation=shadow","src/components/plugin-explorer/plugin-explorer.tsx"],"sourcesContent":["@import \"../../global/gx-ide-mixins.scss\";\n\n:host {\n display: grid;\n block-size: 100%;\n position: relative;\n}\n\n.outer-container {\n grid-template-rows: max-content 1fr;\n}\n.inner-container {\n position: relative;\n}\n\n.list-box::part(item) {\n width: 100%;\n min-width: 100%;\n}\n.list-box::part(item__action) {\n gap: 4px;\n}\n.list-box::part(item__caption) {\n font-weight: 600;\n}\n.list-box::part(custom-container) {\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: 100%;\n}\n.list-box::part(custom-image) {\n block-size: 32px;\n inline-size: 32px;\n margin-inline-end: 12px;\n}\n.list-box::part(custom-description) {\n font-size: 12px;\n margin: 0;\n opacity: 0.8;\n line-height: 1.4;\n margin-inline-end: 8px;\n @include ellipsis();\n}\n.list-box::part(item__block-end start) {\n width: 100%;\n min-width: 100%;\n}\n.list-box::part(custom-brand) {\n font-weight: 600;\n display: flex;\n gap: 4px;\n align-items: center;\n}\n.list-box::part(custom-brand-icon) {\n // --icon-path: var(--icon__system_publish_on-elevation--enabled);\n --icon-path: var(--icon__system_user_neutral--enabled);\n display: inline-block;\n background-image: var(--icon-path);\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center center;\n block-size: 16px;\n inline-size: 16px;\n}\n.list-box::part(custom-button) {\n // WA: Style the button like a Mercury primary button\n // \"Slot\" not working apparently.\n --control__border-color: var(--button-background-color);\n --button-color: var(--mer-text__primary);\n --button-color--enabled: var(--mer-text__on-primary);\n --button-color--active: var(--mer-text__on-primary--active);\n display: inline-grid;\n grid-auto-flow: column;\n grid-auto-columns: max-content;\n justify-content: center;\n padding-block: var(--control__padding-block);\n padding-inline: var(--control__padding-inline);\n box-sizing: border-box;\n background-color: var(--button-background-color);\n color: var(--button-color);\n font-weight: 600;\n margin-block-end: auto;\n margin-block-start: auto;\n text-transform: capitalize;\n}\n.list-box::part(custom-button):hover {\n --button-color: var(--mer-text__primary--hover);\n}\n.list-box::part(custom-button):active {\n --button-color: var(--mer-text__primary--active);\n}\n","import {\n Component,\n Host,\n Prop,\n State,\n Element,\n h,\n Watch,\n getAssetPath\n} from \"@stencil/core\";\n\nimport { getIconPath, MercuryBundles } from \"@genexus/mercury\";\nimport { Locale } from \"../../common/locale\";\nimport { config } from \"../../common/config\";\n\nimport { ActionListModel } from \"@genexus/chameleon-controls-library\";\nimport {\n ActionListItemModel,\n ActionListItemModelExtended,\n ActionListItemSeparator\n} from \"@genexus/chameleon-controls-library/dist/types/components/action-list/types\";\n\nconst FILTER_ICON = getIconPath({\n category: \"system\",\n name: \"filters\",\n colorType: \"on-elevation\"\n});\n\n// plugin icon if no iconUrl was provided\nconst EXTENSION_ICON_IMG = getAssetPath(\n `./gx-ide-assets/plugin-manager/images/plugin-icon.svg`\n);\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/list-box\",\n \"components/button\",\n \"components/edit\",\n \"utils/form\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\n\n@Component({\n tag: \"gx-ide-plugin-explorer\",\n styleUrl: \"plugin-explorer.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/plugin-explorer\"]\n})\nexport class GxIdePluginManager {\n /**\n * The component hard-coded strings translations.\n */\n // eslint-disable-next-line @stencil-community/own-props-must-be-private\n #componentLocale: any;\n #animateEmptyState: boolean = false;\n\n @Element() el: HTMLGxIdePluginExplorerElement;\n\n /**\n * If true it will hide the content, and display a loader\n */\n @State() loading: boolean = true;\n\n /**\n * The plugins model as ActionListModel, which is the model the ch-action-list expects\n */\n @State() pluginsActionListModel: ActionListModel = [];\n\n /**\n * List of plugins to display. Usually used to initialize the component.\n */\n @Prop({ mutable: true }) plugins: PluginData[];\n @Watch(\"plugins\")\n pluginsChangedHandler(newPlugins: PluginData[]) {\n this.pluginsActionListModel =\n this.#mapPluginDataToActionListModel(newPlugins);\n this.loading = false;\n }\n\n /**\n * Callback that should be invoked when the user updates the filter.\n * A debounce should be applied before invoking this function.\n */\n @Prop() readonly filterCallback!: (text: string) => Promise<PluginData[]>;\n\n /**\n * Callback that should be invoked when the user clicks or presses Enter\n * on a selected plugin item.\n */\n @Prop() readonly showDetailsCallback!: (pluginId: string) => Promise<void>;\n\n /**\n * Callback that should be invoked when the user clicks on a plugin's action button.\n */\n @Prop() readonly executeActionCallback!: (\n pluginId: string,\n action: PluginAction\n ) => Promise<void>;\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n this.pluginsChangedHandler(this.plugins);\n }\n\n #actionListButtonClickHandler =\n (pluginId: string, action: PluginAction) => (event: MouseEvent) => {\n event.stopPropagation();\n this.executeActionCallback(pluginId, action);\n };\n\n #mapPluginDataToActionListModel = (\n pluginsData: PluginData[]\n ): ActionListModel => {\n const pluginsActionListModel: ActionListModel = [];\n const separatorItem: ActionListItemSeparator = { type: \"separator\" };\n\n pluginsData?.forEach((pluginData, index) => {\n const hasActionButton = !!pluginData.action;\n const pluginItem = {\n id: pluginData.id,\n caption: pluginData.name,\n imgSrc: pluginData.iconUrl,\n type: \"actionable\",\n\n additionalInformation: {\n \"stretch-start\": {\n center: [\n {\n part: \"custom-image\",\n jsx: () => (\n <img\n part=\"custom-image\"\n src={pluginData.iconUrl || EXTENSION_ICON_IMG}\n alt={`${this.#componentLocale.logotype.replace(\n \"PLUGIN_NAME_PLACEHOLDER\",\n pluginData.name\n )}`}\n loading=\"lazy\"\n />\n )\n }\n ]\n },\n \"block-end\": {\n start: [\n {\n part: \"custom-description custom-button custom-container custom-brand custom-brand-icon custom-image item__block-end start\",\n jsx: () => (\n <div part=\"custom-container\" title={pluginData.description}>\n <p part=\"custom-description\">{pluginData.description}</p>\n <small part=\"custom-brand\">\n <span part=\"custom-brand-icon\"></span>\n {pluginData.publisher}\n </small>\n </div>\n )\n }\n // {\n // slot: \"abcd\"\n // } as ActionListItemAdditionalSlot // slot not working\n ]\n },\n \"stretch-end\": hasActionButton && {\n center: [\n {\n jsx: () => (\n <button\n part=\"custom-button\"\n onClick={this.#actionListButtonClickHandler(\n pluginData.id,\n pluginData.action\n )}\n >\n {pluginData.action}\n </button>\n )\n }\n ]\n }\n }\n } as ActionListItemModel;\n if (index !== 0) {\n pluginsActionListModel.push(separatorItem);\n }\n pluginsActionListModel.push(pluginItem);\n });\n\n return pluginsActionListModel;\n };\n\n #pluginsFilterInputHandler = async (\n event: CustomEvent<string> | InputEvent\n ) => {\n this.loading = true;\n const filterValue = event.detail as string;\n this.plugins = await this.filterCallback(filterValue);\n };\n\n #evaluateContentToDisplay = () => {\n const pluginsToDisplay = this.pluginsActionListModel.length;\n return pluginsToDisplay ? (\n <ch-action-list-render\n model={this.pluginsActionListModel}\n class=\"list-box\"\n selection=\"single\"\n onSelectedItemsChange={this.#pluginSelectedHandler}\n >\n {/* <p slot=\"abcd\">Slot for \"abcd\" id</p> */}\n </ch-action-list-render>\n ) : (\n <gx-ide-empty-state\n isAnimated={this.#animateEmptyState}\n class=\"recent-objects__empty-state\"\n stateIconSrc={FILTER_ICON}\n stateTitle={this.#componentLocale.emptyStateTitle}\n stateDescription={this.#componentLocale.emptyStateDescription}\n ></gx-ide-empty-state>\n );\n };\n\n #renderLoader = () => {\n this.#animateEmptyState = true;\n return (\n <gx-ide-loader\n loaderTitle={this.#componentLocale.loaderTitle}\n description={this.#componentLocale.loaderDescription}\n show\n ></gx-ide-loader>\n );\n };\n\n #pluginSelectedHandler = (\n event: CustomEvent<ActionListItemModelExtended[]>\n ) => {\n const eventType = event.detail[0]?.item.type;\n if (eventType === \"actionable\") {\n const pluginId = event.detail[0].item.id;\n this.showDetailsCallback(pluginId);\n }\n };\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n\n <div class=\"outer-container field-group\">\n <ch-edit\n id=\"search-plugins-input\"\n class=\"input\"\n accessibleName={this.#componentLocale.accessibleName}\n placeholder={this.#componentLocale.searchInputPlaceholder}\n debounce={config.inputDebounce}\n onInput={this.#pluginsFilterInputHandler}\n type=\"search\"\n ></ch-edit>\n <div class=\"inner-container\">\n {this.loading\n ? this.#renderLoader()\n : this.#evaluateContentToDisplay()}\n </div>\n </div>\n </Host>\n );\n }\n}\n\nexport type PluginData = {\n id: string;\n iconUrl: string;\n name: string;\n description: string;\n publisher: string;\n action?: PluginAction;\n};\n\nexport type PluginAction = \"install\" | \"update\";\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, g as getAssetPath, h, H as Host, a as getElement } from './index-10af18cf.js';
|
|
2
|
-
import { g as getIconPath } from './MERCURY_ASSETS-
|
|
2
|
+
import { g as getIconPath } from './MERCURY_ASSETS-7c06e424.js';
|
|
3
3
|
import { L as Locale } from './locale-e5107fad.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -68,7 +68,6 @@ To create code blocks, you’ll use three backticks (\` \`\`\` \`) or three tild
|
|
|
68
68
|
\`\`\`
|
|
69
69
|
`;
|
|
70
70
|
const sendChatToLLM = (chatRef) => () => {
|
|
71
|
-
console.log("dsa");
|
|
72
71
|
chatRef.generatingResponse = true;
|
|
73
72
|
chatRef.addNewMessage({
|
|
74
73
|
id: `${new Date().getTime()}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gx-ide-sc-chat-container.entry.js","mappings":";;;;AAMA,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAEpD,IAAI,OAAuB,CAAC;AAE5B,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDnC,CAAC;AAEF,MAAM,iCAAiC,GAAG;;;;;;;;;;;CAWzC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,OAA0B,KAAK;IACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACnB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAElC,OAAO,CAAC,aAAa,CAAC;QACpB,EAAE,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,WAAW;QACpB,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC;IAEH,OAAO,GAAG,UAAU,CAAC;QACnB,OAAO,CAAC,iBAAiB,CACvB;YACE,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,gCAAgC;YACzC,MAAM,EAAE,SAAS;SAClB,EACD,SAAS,CACV,CAAC;QAEF,OAAO,GAAG,UAAU,CAAC;YACnB,cAAc,CAAC,OAAO,EAAE,EAAE,EAAE,2BAA2B,E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AA6B;oBACtC,QAAQ,EAAE,OAAO;iBAClB;aACF,CAAC;SACH;KACF;IA4DD,MAAM;QACJ,QACE,EAAC,IAAI,QACH,gBAAU,KAAK,EAAE,WAAW,GAAa,EACzC,6BACE,SAAS,EAAC,mBAAmB,EAC7B,wBAAwB,EAAE,uBAAA,IAAI,6DAAiC,EAC/D,0BAA0B,EAAE,uBAAA,IAAI,+DAAmC,EACnE,GAAG,EAAE,EAAE,KACJ,uBAAA,IAAI,0CAAqB,EAAmC,MAAA,CAAC,EAEhE,KAAK,EAAC,aAAa,IAEnB,eACE,SAAS,EAAE,uBAAA,IAAI,2CAAe,EAC9B,KAAK,EAAC,MAAM,EACZ,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAC3C,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,UAAU,EAAE,wBAAwB,CAClC,4BAA4B,EAC5B,SAAS,EACT,MAAM,CACP,EACD,KAAK,EAAE,IAAI,CAAC,SAAS,EACrB,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EACjD,YAAY,EAAE,gBAAgB,EAC9B,GAAG,EAAE,EAAE,KAAK,uBAAA,IAAI,mCAAc,EAAuB,MAAA,CAAC,IAEtD,2BACE,GAAG,EAAE,EAAE,KACJ,uBAAA,IAAI,wCAAmB,EAAiC,MAAA,CAAC,EAE5D,IAAI,EAAC,YAAY,EACjB,+BAA+B,EAC7B,uBAAA,IAAI,oEAAwC,EAE9C,gBAAgB,EAAE;gBAChB,uCAAuC;gBACvC,0FAA0F;gBAC1F,gDAAgD;aACjD,GACoB,EACvB,WAAK,IAAI,EAAC,oBAAoB,oEAExB,CACE,CACY,CACnB,EACP;KACH;;;;;;;","names":[],"sources":["src/showcase/chat-container/callbacks.ts","src/showcase/chat-container/chat-showcase.scss?tag=gx-ide-sc-chat-container&encapsulation=shadow","src/showcase/chat-container/chat.showcase.tsx"],"sourcesContent":["import {\n ChatInternalCallbacks,\n ChatMessage,\n ChatTranslations\n} from \"@genexus/chameleon-controls-library\";\n\nconst PROCESSING_PLACEHOLDER = \"{{ASSISTANT_NAME}}\";\n\nlet timeOut: NodeJS.Timeout;\n\nconst ASSISTANT_RESPONSE_MARKDOWN = `\n###### Code block {#code-block}\nTo create code blocks, you’ll use three backticks (\\` \\`\\`\\` \\`) or three tildes (\\`~~~\\`) on the lines before and after the code block.\n\n\\`\\`\\`\n{\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"age\": 25\n}\n\\`\\`\\`\n\nAnother way to create code blocks is to indent every line of the block by at least four spaces or one tab.\n\n <html>\n <head>\n </head>\n </html>\n\n\n###### Syntax Highlighting {#syntax-highlighting}\nThis feature allows you to add color highlighting for whatever language your code was written in.\nTo add syntax highlighting, specify a language next to the backticks before the fenced code block.\n\n\\`\\`\\`json\n{\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"age\": 25\n}\n\\`\\`\\`\n\n\\`\\`\\`javascript\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport Markdown from 'react-markdown'\nimport rehypeHighlight from 'rehype-highlight'\n\nconst markdown = \\`\n# Your markdown here\n\\`\n\nReactDOM.render(\n <Markdown rehypePlugins={[rehypeHighlight]}>{markdown}</Markdown>,\n document.querySelector('#content')\n)\n\\`\\`\\`\n\n###### Horizontal Rules {#horizontal-rules}\nTo create a horizontal rule, use three or more asterisks (\\`***\\`), dashes (\\`---\\`), or underscores (\\`___\\`) on a line by themselves.\n`;\n\nconst ASSISTANT_RESPONSE_SHORT_MARKDOWN = `\n###### Code block {#code-block}\nTo create code blocks, you’ll use three backticks (\\` \\`\\`\\` \\`) or three tildes (\\`~~~\\`) on the lines before and after the code block.\n\n\\`\\`\\`json\n{\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"age\": 25\n}\n\\`\\`\\`\n`;\n\nconst sendChatToLLM = (chatRef: HTMLChChatElement) => () => {\n console.log(\"dsa\");\n chatRef.generatingResponse = true;\n\n chatRef.addNewMessage({\n id: `${new Date().getTime()}`,\n role: \"assistant\",\n content: \"Analyzing\",\n status: \"waiting\"\n });\n\n timeOut = setTimeout(() => {\n chatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: \"Processing with Chat with LLMs\",\n status: \"waiting\"\n },\n \"replace\"\n );\n\n timeOut = setTimeout(() => {\n dummyStreaming(chatRef, 20, ASSISTANT_RESPONSE_MARKDOWN, \"replace\");\n }, 10000);\n }, 20000);\n};\n\nexport const chatCallbacksWithChatRef = (\n chChatRef: HTMLChChatElement\n): ChatInternalCallbacks => {\n return {\n clear: () => new Promise(resolve => resolve()),\n sendChatToLLM: sendChatToLLM(chChatRef),\n uploadImage: () => new Promise(resolve => resolve(\"\")),\n stopGeneratingAnswer: () => {\n clearTimeout(timeOut);\n\n chChatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: \"\",\n status: \"complete\"\n },\n \"concat\"\n );\n\n return new Promise(resolve => setTimeout(() => resolve, 10));\n }\n };\n};\n\nfunction dummyStreaming(\n chatRef: HTMLChChatElement,\n counter: number,\n stringToDisplay: string,\n mode: \"concat\" | \"replace\"\n) {\n timeOut = setTimeout(\n () => {\n const streamingCompleted = counter >= stringToDisplay.length;\n\n chatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: stringToDisplay.substring(counter - 20, counter),\n\n // {\n // message: stringToDisplay.substring(counter - 20, counter),\n // files: streamingCompleted\n // ? [\n // {\n // url: \"https://next.genexus.ai\",\n // caption: \"Mars Exploration Contract\"\n // },\n // {\n // url: \"https://gx-chameleon.netlify.app\",\n // caption: \"Venus Exploration Contract\"\n // }\n // ]\n // : undefined\n // },\n status: streamingCompleted ? \"complete\" : \"streaming\"\n },\n mode\n );\n\n if (!streamingCompleted) {\n dummyStreaming(chatRef, counter + 20, stringToDisplay, \"concat\");\n } else {\n chatRef.generatingResponse = false;\n }\n },\n counter % 200 === 0 ? 50 : 40\n );\n}\n\nexport const chatTranslations: ChatTranslations = {\n accessibleName: {\n clearChat: \"Clear chat\",\n copyResponseButton: \"Copy assistant response\",\n downloadCodeButton: \"Download code\",\n imagePicker: \"Select images\",\n removeUploadedImage: \"Remove uploaded image\",\n sendButton: \"Send\",\n sendInput: \"Message\",\n stopGeneratingAnswerButton: \"Stop generating answer\"\n },\n placeholder: {\n sendInput: \"Ask me a question...\"\n },\n text: {\n copyCodeButton: \"Copy code\",\n processing: `Processing with ${PROCESSING_PLACEHOLDER}`,\n sourceFiles: \"Source files:\"\n }\n};\n\nexport const chatRecord: ChatMessage[] = [\n { id: \"1\", role: \"user\", content: \"Hello world\" },\n { id: \"2\", role: \"assistant\", content: ASSISTANT_RESPONSE_MARKDOWN },\n { id: \"3\", role: \"user\", content: \"Hello world 1\" },\n { id: \"4\", role: \"assistant\", content: ASSISTANT_RESPONSE_SHORT_MARKDOWN },\n { id: \"5\", role: \"user\", content: \"Hello world 2\" },\n { id: \"6\", role: \"assistant\", content: ASSISTANT_RESPONSE_SHORT_MARKDOWN },\n { id: \"7\", role: \"user\", content: \"Hello world 3\" },\n { id: \"8\", role: \"assistant\", content: ASSISTANT_RESPONSE_SHORT_MARKDOWN },\n { id: \"9\", role: \"user\", content: \"Hello world 4\" },\n { id: \"10\", role: \"assistant\", content: ASSISTANT_RESPONSE_SHORT_MARKDOWN }\n];\n\nexport const longChatRecord: ChatMessage[] = Array.from(\n { length: 40 },\n (_, index) =>\n index % 2 === 0\n ? {\n id: `index: ${index}`,\n role: \"user\",\n content:\n `index: ${index}` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n`\n }\n : {\n id: `index: ${index}`,\n role: \"assistant\",\n content:\n ASSISTANT_RESPONSE_SHORT_MARKDOWN +\n `\\nindex: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n`\n }\n);\n\nexport const codeFixerRecord: ChatMessage[] = [\n {\n id: \"1\",\n role: \"user\",\n content: \"Please give me an example about...\",\n metadata: \"14:55\"\n },\n {\n id: \"2\",\n role: \"assistant\",\n status: \"complete\",\n content:\n \"Action required example. Action required example. Action required example.\",\n metadata: \"14:56\"\n },\n {\n id: \"3\",\n role: \"assistant\",\n status: \"complete\",\n content:\n \"Some fields contain missing or invalid data, which may prevent the process from completing correctly. Review your input carefully and make any necessary corrections before continuing.\",\n metadata: \"14:57\",\n parts: \"warning\"\n },\n {\n id: \"4\",\n role: \"error\",\n content:\n \"An unexpected error occurred while processing your request, and the operation couldn’t be completed.Please check your internet connection or try again later. If the problem persists, contact support.\",\n metadata: \"14:58\"\n },\n {\n id: \"5\",\n role: \"assistant\",\n status: \"complete\",\n content:\n \"Your information has been saved successfully, and all changes are now reflected in your account. You can continue with the next steps or return to the dashboard at any time.\",\n metadata: \"14:59\",\n parts: \"success\"\n },\n {\n id: \"6\",\n role: \"user\",\n content:\n \"Implement the function calculate_average_grade in grades.py that takes a list of grades as input and returns the average grade as a floating-point number\",\n metadata: \"15:00\"\n },\n {\n id: \"7\",\n role: \"assistant\",\n status: \"complete\",\n content:\n \"You can provide further details or updates regarding your support ticket and its associated code. Your input here helps us better understand and address your issue effectively.\",\n metadata: \"15:01\"\n },\n {\n id: \"8\",\n role: \"assistant\",\n status: \"waiting\",\n content: \"You can provide further details or updates\"\n },\n {\n id: \"9\",\n role: \"assistant\",\n status: \"complete\",\n content: ASSISTANT_RESPONSE_SHORT_MARKDOWN\n }\n];\n",":host {\n block-size: 100%;\n display: grid;\n}\n","import {\n Component,\n Host,\n h,\n State,\n Prop,\n getAssetPath,\n Method\n} from \"@stencil/core\";\nimport { mercuryChatMessageRender } from \"../../components/chat/code-render\";\n\nimport { MercuryBundles } from \"@genexus/mercury\";\n\nconst AI_AVATAR = getAssetPath(\n `./gx-ide-assets/chat-welcome/images/ai-avatar.svg`\n);\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"utils/elevation\",\n \"components/chat\"\n];\n\nimport {\n chatCallbacksWithChatRef,\n chatTranslations,\n codeFixerRecord\n} from \"./callbacks\";\nimport {\n ChatMessage,\n ChatInternalCallbacks\n} from \"@genexus/chameleon-controls-library\";\nimport { ChatMessageUser } from \"@genexus/chameleon-controls-library/dist/types/components/chat/types\";\n\n@Component({\n tag: \"gx-ide-sc-chat-container\",\n styleUrl: \"chat-showcase.scss\",\n shadow: true\n})\nexport class GxIdeScChatContainer {\n #chatContainerRef!: HTMLGxIdeChatContainerElement;\n #chatWelcomeRef!: HTMLGxIdeChatWelcomeElement;\n #chChatRef!: HTMLChChatElement;\n #chatCallbacks: ChatInternalCallbacks;\n\n /**\n * If true, the chat items length will be 0, since this is a requirement for dipslaying the ch-chat\n * \"empty-chat\" slot that welcome screen uses to display.\n */\n @Prop() readonly mode: \"welcome\" | \"messages-sample\" | \"empty\" =\n \"messages-sample\";\n\n @State() generatingResponse: boolean = false;\n @State() loadingState:\n | \"all-records-loaded\"\n | \"initial\"\n | \"loading\"\n | \"more-data-to-fetch\" = \"all-records-loaded\";\n @State() showAdditionalContent: boolean = false;\n @State() conversationCopied: boolean = false;\n @State() assistantStatus: string = \"Getting Data\";\n @State() chatItems: ChatMessage[] = [];\n\n /**\n * It will exit the wellcome screen and remove it from the dom.\n */\n @Method()\n async exitWelcome() {\n // hand exitWelcome to gx-ide-chat-welcome\n this.#chatWelcomeRef.exitWelcome();\n }\n\n #copyConversationCallbackHandler = () => {\n this.#chatContainerRef.showCopyConversationMessage();\n };\n\n #deleteConversationCallbackHandler = () => {};\n\n componentDidLoad() {\n setTimeout(() => {\n this.assistantStatus = \"Creating Data Base..\";\n }, 1000);\n }\n\n componentDidRender() {\n if (!this.#chatCallbacks && this.#chChatRef) {\n this.#chatCallbacks = chatCallbacksWithChatRef(this.#chChatRef);\n }\n }\n\n async componentWillLoad() {\n if (this.mode === \"messages-sample\") {\n this.chatItems = codeFixerRecord;\n } else if (this.mode === \"welcome\") {\n this.chatItems = [];\n } else if (this.mode === \"empty\") {\n this.chatItems = [\n {\n id: \"1\",\n role: \"assistant\",\n status: \"complete\",\n content: \"Hello! I am your assistant.\",\n metadata: \"14:56\"\n }\n ];\n }\n }\n #suggestedPrompRequestedCallbackHandler = async (\n prompt: string\n ): Promise<void> => {\n let assistantFinalResponse: string;\n if (prompt.toLowerCase().includes(\"transaction\")) {\n assistantFinalResponse =\n 'To create a transaction in GeneXus, start by opening your KB (Knowledge Base) and selecting \"Transaction\" from the \"New Object\" options. Give it a name and define its attributes, starting with a primary key followed by the related data fields. GeneXus will automatically infer the data structure and relationships based on how you define the attributes and their nesting. Once saved, it generates the necessary database tables and forms for inserting, updating, and deleting records. You can then run the application to test the transaction directly in your browser.';\n } else if (prompt.toLowerCase().includes(\"entity\")) {\n assistantFinalResponse =\n 'In GeneXus, creating an entity usually means defining a Transaction object that represents a real-world concept like \"Customer\" or \"Product.\" To do this, create a new Transaction, name it after the entity, and define its attributes—starting with a unique identifier (like CustomerId) and then adding other fields (like CustomerName, CustomerEmail). GeneXus treats this Transaction as an entity and uses it to generate the corresponding table and interface automatically.';\n } else {\n assistantFinalResponse =\n \"Sorry, I didn’t catch that—mind rephrasing it? 😅\";\n }\n\n const userPrompt: ChatMessageUser = {\n id: \"1\",\n role: \"user\",\n content: prompt\n };\n this.#chChatRef.addNewMessage(userPrompt);\n setTimeout(() => {\n this.#chChatRef.addNewMessage({\n id: `${new Date().getTime()}`,\n role: \"assistant\",\n content: \"Analyzing\",\n status: \"waiting\"\n });\n setTimeout(() => {\n this.#chChatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: \"Processing with Chat with LLMs\",\n status: \"waiting\"\n },\n \"replace\"\n );\n setTimeout(() => {\n this.#chChatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: \"Getting information\",\n status: \"waiting\"\n },\n \"replace\"\n );\n this.#chChatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: assistantFinalResponse,\n status: \"complete\"\n },\n \"replace\"\n );\n }, 1500);\n }, 1500);\n }, 100);\n };\n\n render() {\n return (\n <Host>\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <gx-ide-chat-container\n chatTitle=\"GeneXus Assistant\"\n copyConversationCallback={this.#copyConversationCallbackHandler}\n deleteConversationCallback={this.#deleteConversationCallbackHandler}\n ref={el =>\n (this.#chatContainerRef = el as HTMLGxIdeChatContainerElement)\n }\n class=\"elevation-1\"\n >\n <ch-chat\n callbacks={this.#chatCallbacks}\n class=\"chat\"\n generatingResponse={this.generatingResponse}\n loadingState={this.loadingState} // \"all-records-loaded\" to display the welcome screen\n renderItem={mercuryChatMessageRender(\n \"components/markdown-viewer\",\n AI_AVATAR,\n \"Nexa\"\n )}\n items={this.chatItems} // length 0 to display the welcome screen\n showAdditionalContent={this.showAdditionalContent}\n translations={chatTranslations}\n ref={el => (this.#chChatRef = el as HTMLChChatElement)}\n >\n <gx-ide-chat-welcome\n ref={el =>\n (this.#chatWelcomeRef = el as HTMLGxIdeChatWelcomeElement)\n }\n slot=\"empty-chat\"\n suggestedPrompRequestedCallback={\n this.#suggestedPrompRequestedCallbackHandler\n }\n suggestedPrompts={[\n \"I need to represente a product entity\",\n \"I want to create a Customer Tracking application. Can you help me with the architecture?\",\n \"I need to create a REST API for my application\"\n ]}\n ></gx-ide-chat-welcome>\n <div slot=\"additional-content\">\n Custom content that is rendered when the chat renders content\n </div>\n </ch-chat>\n </gx-ide-chat-container>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"gx-ide-sc-chat-container.entry.js","mappings":";;;;AAMA,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAEpD,IAAI,OAAuB,CAAC;AAE5B,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDnC,CAAC;AAEF,MAAM,iCAAiC,GAAG;;;;;;;;;;;CAWzC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,OAA0B,KAAK;IACpD,OAAO,CAAC,kBAAkB,GAAG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AAI,wCAAmB,EAAiC,MAAA,CAAC,EAE5D,IAAI,EAAC,YAAY,EACjB,+BAA+B,EAC7B,uBAAA,IAAI,oEAAwC,EAE9C,gBAAgB,EAAE;gBAChB,uCAAuC;gBACvC,0FAA0F;gBAC1F,gDAAgD;aACjD,GACoB,EACvB,WAAK,IAAI,EAAC,oBAAoB,oEAExB,CACE,CACY,CACnB,EACP;KACH;;;;;;;","names":[],"sources":["src/showcase/chat-container/callbacks.ts","src/showcase/chat-container/chat-showcase.scss?tag=gx-ide-sc-chat-container&encapsulation=shadow","src/showcase/chat-container/chat.showcase.tsx"],"sourcesContent":["import {\n ChatInternalCallbacks,\n ChatMessage,\n ChatTranslations\n} from \"@genexus/chameleon-controls-library\";\n\nconst PROCESSING_PLACEHOLDER = \"{{ASSISTANT_NAME}}\";\n\nlet timeOut: NodeJS.Timeout;\n\nconst ASSISTANT_RESPONSE_MARKDOWN = `\n###### Code block {#code-block}\nTo create code blocks, you’ll use three backticks (\\` \\`\\`\\` \\`) or three tildes (\\`~~~\\`) on the lines before and after the code block.\n\n\\`\\`\\`\n{\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"age\": 25\n}\n\\`\\`\\`\n\nAnother way to create code blocks is to indent every line of the block by at least four spaces or one tab.\n\n <html>\n <head>\n </head>\n </html>\n\n\n###### Syntax Highlighting {#syntax-highlighting}\nThis feature allows you to add color highlighting for whatever language your code was written in.\nTo add syntax highlighting, specify a language next to the backticks before the fenced code block.\n\n\\`\\`\\`json\n{\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"age\": 25\n}\n\\`\\`\\`\n\n\\`\\`\\`javascript\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport Markdown from 'react-markdown'\nimport rehypeHighlight from 'rehype-highlight'\n\nconst markdown = \\`\n# Your markdown here\n\\`\n\nReactDOM.render(\n <Markdown rehypePlugins={[rehypeHighlight]}>{markdown}</Markdown>,\n document.querySelector('#content')\n)\n\\`\\`\\`\n\n###### Horizontal Rules {#horizontal-rules}\nTo create a horizontal rule, use three or more asterisks (\\`***\\`), dashes (\\`---\\`), or underscores (\\`___\\`) on a line by themselves.\n`;\n\nconst ASSISTANT_RESPONSE_SHORT_MARKDOWN = `\n###### Code block {#code-block}\nTo create code blocks, you’ll use three backticks (\\` \\`\\`\\` \\`) or three tildes (\\`~~~\\`) on the lines before and after the code block.\n\n\\`\\`\\`json\n{\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"age\": 25\n}\n\\`\\`\\`\n`;\n\nconst sendChatToLLM = (chatRef: HTMLChChatElement) => () => {\n chatRef.generatingResponse = true;\n\n chatRef.addNewMessage({\n id: `${new Date().getTime()}`,\n role: \"assistant\",\n content: \"Analyzing\",\n status: \"waiting\"\n });\n\n timeOut = setTimeout(() => {\n chatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: \"Processing with Chat with LLMs\",\n status: \"waiting\"\n },\n \"replace\"\n );\n\n timeOut = setTimeout(() => {\n dummyStreaming(chatRef, 20, ASSISTANT_RESPONSE_MARKDOWN, \"replace\");\n }, 10000);\n }, 20000);\n};\n\nexport const chatCallbacksWithChatRef = (\n chChatRef: HTMLChChatElement\n): ChatInternalCallbacks => {\n return {\n clear: () => new Promise(resolve => resolve()),\n sendChatToLLM: sendChatToLLM(chChatRef),\n uploadImage: () => new Promise(resolve => resolve(\"\")),\n stopGeneratingAnswer: () => {\n clearTimeout(timeOut);\n\n chChatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: \"\",\n status: \"complete\"\n },\n \"concat\"\n );\n\n return new Promise(resolve => setTimeout(() => resolve, 10));\n }\n };\n};\n\nfunction dummyStreaming(\n chatRef: HTMLChChatElement,\n counter: number,\n stringToDisplay: string,\n mode: \"concat\" | \"replace\"\n) {\n timeOut = setTimeout(\n () => {\n const streamingCompleted = counter >= stringToDisplay.length;\n\n chatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: stringToDisplay.substring(counter - 20, counter),\n\n // {\n // message: stringToDisplay.substring(counter - 20, counter),\n // files: streamingCompleted\n // ? [\n // {\n // url: \"https://next.genexus.ai\",\n // caption: \"Mars Exploration Contract\"\n // },\n // {\n // url: \"https://gx-chameleon.netlify.app\",\n // caption: \"Venus Exploration Contract\"\n // }\n // ]\n // : undefined\n // },\n status: streamingCompleted ? \"complete\" : \"streaming\"\n },\n mode\n );\n\n if (!streamingCompleted) {\n dummyStreaming(chatRef, counter + 20, stringToDisplay, \"concat\");\n } else {\n chatRef.generatingResponse = false;\n }\n },\n counter % 200 === 0 ? 50 : 40\n );\n}\n\nexport const chatTranslations: ChatTranslations = {\n accessibleName: {\n clearChat: \"Clear chat\",\n copyResponseButton: \"Copy assistant response\",\n downloadCodeButton: \"Download code\",\n imagePicker: \"Select images\",\n removeUploadedImage: \"Remove uploaded image\",\n sendButton: \"Send\",\n sendInput: \"Message\",\n stopGeneratingAnswerButton: \"Stop generating answer\"\n },\n placeholder: {\n sendInput: \"Ask me a question...\"\n },\n text: {\n copyCodeButton: \"Copy code\",\n processing: `Processing with ${PROCESSING_PLACEHOLDER}`,\n sourceFiles: \"Source files:\"\n }\n};\n\nexport const chatRecord: ChatMessage[] = [\n { id: \"1\", role: \"user\", content: \"Hello world\" },\n { id: \"2\", role: \"assistant\", content: ASSISTANT_RESPONSE_MARKDOWN },\n { id: \"3\", role: \"user\", content: \"Hello world 1\" },\n { id: \"4\", role: \"assistant\", content: ASSISTANT_RESPONSE_SHORT_MARKDOWN },\n { id: \"5\", role: \"user\", content: \"Hello world 2\" },\n { id: \"6\", role: \"assistant\", content: ASSISTANT_RESPONSE_SHORT_MARKDOWN },\n { id: \"7\", role: \"user\", content: \"Hello world 3\" },\n { id: \"8\", role: \"assistant\", content: ASSISTANT_RESPONSE_SHORT_MARKDOWN },\n { id: \"9\", role: \"user\", content: \"Hello world 4\" },\n { id: \"10\", role: \"assistant\", content: ASSISTANT_RESPONSE_SHORT_MARKDOWN }\n];\n\nexport const longChatRecord: ChatMessage[] = Array.from(\n { length: 40 },\n (_, index) =>\n index % 2 === 0\n ? {\n id: `index: ${index}`,\n role: \"user\",\n content:\n `index: ${index}` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n`\n }\n : {\n id: `index: ${index}`,\n role: \"assistant\",\n content:\n ASSISTANT_RESPONSE_SHORT_MARKDOWN +\n `\\nindex: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n` +\n `index: ${index}\\n`\n }\n);\n\nexport const codeFixerRecord: ChatMessage[] = [\n {\n id: \"1\",\n role: \"user\",\n content: \"Please give me an example about...\",\n metadata: \"14:55\"\n },\n {\n id: \"2\",\n role: \"assistant\",\n status: \"complete\",\n content:\n \"Action required example. Action required example. Action required example.\",\n metadata: \"14:56\"\n },\n {\n id: \"3\",\n role: \"assistant\",\n status: \"complete\",\n content:\n \"Some fields contain missing or invalid data, which may prevent the process from completing correctly. Review your input carefully and make any necessary corrections before continuing.\",\n metadata: \"14:57\",\n parts: \"warning\"\n },\n {\n id: \"4\",\n role: \"error\",\n content:\n \"An unexpected error occurred while processing your request, and the operation couldn’t be completed.Please check your internet connection or try again later. If the problem persists, contact support.\",\n metadata: \"14:58\"\n },\n {\n id: \"5\",\n role: \"assistant\",\n status: \"complete\",\n content:\n \"Your information has been saved successfully, and all changes are now reflected in your account. You can continue with the next steps or return to the dashboard at any time.\",\n metadata: \"14:59\",\n parts: \"success\"\n },\n {\n id: \"6\",\n role: \"user\",\n content:\n \"Implement the function calculate_average_grade in grades.py that takes a list of grades as input and returns the average grade as a floating-point number\",\n metadata: \"15:00\"\n },\n {\n id: \"7\",\n role: \"assistant\",\n status: \"complete\",\n content:\n \"You can provide further details or updates regarding your support ticket and its associated code. Your input here helps us better understand and address your issue effectively.\",\n metadata: \"15:01\"\n },\n {\n id: \"8\",\n role: \"assistant\",\n status: \"waiting\",\n content: \"You can provide further details or updates\"\n },\n {\n id: \"9\",\n role: \"assistant\",\n status: \"complete\",\n content: ASSISTANT_RESPONSE_SHORT_MARKDOWN\n }\n];\n",":host {\n block-size: 100%;\n display: grid;\n}\n","import {\n Component,\n Host,\n h,\n State,\n Prop,\n getAssetPath,\n Method\n} from \"@stencil/core\";\nimport { mercuryChatMessageRender } from \"../../components/chat/code-render\";\n\nimport { MercuryBundles } from \"@genexus/mercury\";\n\nconst AI_AVATAR = getAssetPath(\n `./gx-ide-assets/chat-welcome/images/ai-avatar.svg`\n);\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"utils/elevation\",\n \"components/chat\"\n];\n\nimport {\n chatCallbacksWithChatRef,\n chatTranslations,\n codeFixerRecord\n} from \"./callbacks\";\nimport {\n ChatMessage,\n ChatInternalCallbacks\n} from \"@genexus/chameleon-controls-library\";\nimport { ChatMessageUser } from \"@genexus/chameleon-controls-library/dist/types/components/chat/types\";\n\n@Component({\n tag: \"gx-ide-sc-chat-container\",\n styleUrl: \"chat-showcase.scss\",\n shadow: true\n})\nexport class GxIdeScChatContainer {\n #chatContainerRef!: HTMLGxIdeChatContainerElement;\n #chatWelcomeRef!: HTMLGxIdeChatWelcomeElement;\n #chChatRef!: HTMLChChatElement;\n #chatCallbacks: ChatInternalCallbacks;\n\n /**\n * If true, the chat items length will be 0, since this is a requirement for dipslaying the ch-chat\n * \"empty-chat\" slot that welcome screen uses to display.\n */\n @Prop() readonly mode: \"welcome\" | \"messages-sample\" | \"empty\" =\n \"messages-sample\";\n\n @State() generatingResponse: boolean = false;\n @State() loadingState:\n | \"all-records-loaded\"\n | \"initial\"\n | \"loading\"\n | \"more-data-to-fetch\" = \"all-records-loaded\";\n @State() showAdditionalContent: boolean = false;\n @State() conversationCopied: boolean = false;\n @State() assistantStatus: string = \"Getting Data\";\n @State() chatItems: ChatMessage[] = [];\n\n /**\n * It will exit the wellcome screen and remove it from the dom.\n */\n @Method()\n async exitWelcome() {\n // hand exitWelcome to gx-ide-chat-welcome\n this.#chatWelcomeRef.exitWelcome();\n }\n\n #copyConversationCallbackHandler = () => {\n this.#chatContainerRef.showCopyConversationMessage();\n };\n\n #deleteConversationCallbackHandler = () => {};\n\n componentDidLoad() {\n setTimeout(() => {\n this.assistantStatus = \"Creating Data Base..\";\n }, 1000);\n }\n\n componentDidRender() {\n if (!this.#chatCallbacks && this.#chChatRef) {\n this.#chatCallbacks = chatCallbacksWithChatRef(this.#chChatRef);\n }\n }\n\n async componentWillLoad() {\n if (this.mode === \"messages-sample\") {\n this.chatItems = codeFixerRecord;\n } else if (this.mode === \"welcome\") {\n this.chatItems = [];\n } else if (this.mode === \"empty\") {\n this.chatItems = [\n {\n id: \"1\",\n role: \"assistant\",\n status: \"complete\",\n content: \"Hello! I am your assistant.\",\n metadata: \"14:56\"\n }\n ];\n }\n }\n #suggestedPrompRequestedCallbackHandler = async (\n prompt: string\n ): Promise<void> => {\n let assistantFinalResponse: string;\n if (prompt.toLowerCase().includes(\"transaction\")) {\n assistantFinalResponse =\n 'To create a transaction in GeneXus, start by opening your KB (Knowledge Base) and selecting \"Transaction\" from the \"New Object\" options. Give it a name and define its attributes, starting with a primary key followed by the related data fields. GeneXus will automatically infer the data structure and relationships based on how you define the attributes and their nesting. Once saved, it generates the necessary database tables and forms for inserting, updating, and deleting records. You can then run the application to test the transaction directly in your browser.';\n } else if (prompt.toLowerCase().includes(\"entity\")) {\n assistantFinalResponse =\n 'In GeneXus, creating an entity usually means defining a Transaction object that represents a real-world concept like \"Customer\" or \"Product.\" To do this, create a new Transaction, name it after the entity, and define its attributes—starting with a unique identifier (like CustomerId) and then adding other fields (like CustomerName, CustomerEmail). GeneXus treats this Transaction as an entity and uses it to generate the corresponding table and interface automatically.';\n } else {\n assistantFinalResponse =\n \"Sorry, I didn’t catch that—mind rephrasing it? 😅\";\n }\n\n const userPrompt: ChatMessageUser = {\n id: \"1\",\n role: \"user\",\n content: prompt\n };\n this.#chChatRef.addNewMessage(userPrompt);\n setTimeout(() => {\n this.#chChatRef.addNewMessage({\n id: `${new Date().getTime()}`,\n role: \"assistant\",\n content: \"Analyzing\",\n status: \"waiting\"\n });\n setTimeout(() => {\n this.#chChatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: \"Processing with Chat with LLMs\",\n status: \"waiting\"\n },\n \"replace\"\n );\n setTimeout(() => {\n this.#chChatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: \"Getting information\",\n status: \"waiting\"\n },\n \"replace\"\n );\n this.#chChatRef.updateLastMessage(\n {\n role: \"assistant\",\n content: assistantFinalResponse,\n status: \"complete\"\n },\n \"replace\"\n );\n }, 1500);\n }, 1500);\n }, 100);\n };\n\n render() {\n return (\n <Host>\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <gx-ide-chat-container\n chatTitle=\"GeneXus Assistant\"\n copyConversationCallback={this.#copyConversationCallbackHandler}\n deleteConversationCallback={this.#deleteConversationCallbackHandler}\n ref={el =>\n (this.#chatContainerRef = el as HTMLGxIdeChatContainerElement)\n }\n class=\"elevation-1\"\n >\n <ch-chat\n callbacks={this.#chatCallbacks}\n class=\"chat\"\n generatingResponse={this.generatingResponse}\n loadingState={this.loadingState} // \"all-records-loaded\" to display the welcome screen\n renderItem={mercuryChatMessageRender(\n \"components/markdown-viewer\",\n AI_AVATAR,\n \"Nexa\"\n )}\n items={this.chatItems} // length 0 to display the welcome screen\n showAdditionalContent={this.showAdditionalContent}\n translations={chatTranslations}\n ref={el => (this.#chChatRef = el as HTMLChChatElement)}\n >\n <gx-ide-chat-welcome\n ref={el =>\n (this.#chatWelcomeRef = el as HTMLGxIdeChatWelcomeElement)\n }\n slot=\"empty-chat\"\n suggestedPrompRequestedCallback={\n this.#suggestedPrompRequestedCallbackHandler\n }\n suggestedPrompts={[\n \"I need to represente a product entity\",\n \"I want to create a Customer Tracking application. Can you help me with the architecture?\",\n \"I need to create a REST API for my application\"\n ]}\n ></gx-ide-chat-welcome>\n <div slot=\"additional-content\">\n Custom content that is rendered when the chat renders content\n </div>\n </ch-chat>\n </gx-ide-chat-container>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, g as getAssetPath, h, H as Host, a as getElement } from './index-10af18cf.js';
|
|
2
|
-
import { g as getIconPath } from './MERCURY_ASSETS-
|
|
2
|
+
import { g as getIconPath } from './MERCURY_ASSETS-7c06e424.js';
|
|
3
3
|
import { L as Locale } from './locale-e5107fad.js';
|
|
4
4
|
|
|
5
5
|
const ACTIVE_ITEM_DEFAULT_ICON = getIconPath({
|