@genexus/genexus-ide-ui 3.2.21 → 3.2.22
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/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/gx-ide-plugin-details.cjs.entry.js +31 -13
- package/dist/cjs/gx-ide-plugin-details.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-plugin-explorer.cjs.entry.js +97 -48
- package/dist/cjs/gx-ide-plugin-explorer.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-progress-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/_helpers/progress-bar/progress-bar.css +10 -0
- package/dist/collection/components/plugin-details/gx-ide-assets/plugin-details/langs/plugin-details.lang.en.json +3 -1
- package/dist/collection/components/plugin-details/gx-ide-assets/plugin-details/langs/plugin-details.lang.ja.json +3 -1
- package/dist/collection/components/plugin-details/gx-ide-assets/plugin-details/langs/plugin-details.lang.zh.json +3 -1
- package/dist/collection/components/plugin-details/plugin-details.css +7 -1
- package/dist/collection/components/plugin-details/plugin-details.js +75 -16
- package/dist/collection/components/plugin-details/plugin-details.js.map +1 -1
- package/dist/collection/components/plugin-explorer/plugin-explorer.css +83 -26
- package/dist/collection/components/plugin-explorer/plugin-explorer.js +105 -56
- package/dist/collection/components/plugin-explorer/plugin-explorer.js.map +1 -1
- package/dist/components/gx-ide-plugin-details.js +40 -14
- package/dist/components/gx-ide-plugin-details.js.map +1 -1
- package/dist/components/gx-ide-plugin-explorer.js +107 -52
- package/dist/components/gx-ide-plugin-explorer.js.map +1 -1
- package/dist/components/progress-bar.js +1 -1
- package/dist/components/progress-bar.js.map +1 -1
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-plugin-details.entry.js +31 -13
- package/dist/esm/gx-ide-plugin-details.entry.js.map +1 -1
- package/dist/esm/gx-ide-plugin-explorer.entry.js +97 -48
- package/dist/esm/gx-ide-plugin-explorer.entry.js.map +1 -1
- package/dist/esm/gx-ide-progress-bar.entry.js +1 -1
- package/dist/esm/gx-ide-progress-bar.entry.js.map +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/plugin-details/langs/plugin-details.lang.en.json +3 -1
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-details/langs/plugin-details.lang.ja.json +3 -1
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-details/langs/plugin-details.lang.zh.json +3 -1
- package/dist/genexus-ide-ui/{p-b3c5c315.entry.js → p-63e41ecd.entry.js} +2 -2
- package/dist/genexus-ide-ui/p-63e41ecd.entry.js.map +1 -0
- package/dist/genexus-ide-ui/p-e82d9621.entry.js +317 -0
- package/dist/genexus-ide-ui/p-e82d9621.entry.js.map +1 -0
- package/dist/genexus-ide-ui/p-ef8663dd.entry.js +284 -0
- package/dist/genexus-ide-ui/p-ef8663dd.entry.js.map +1 -0
- package/dist/types/components/plugin-details/plugin-details.d.ts +21 -3
- package/dist/types/components/plugin-explorer/plugin-explorer.d.ts +31 -4
- package/dist/types/components.d.ts +34 -14
- package/package.json +1 -1
- package/dist/genexus-ide-ui/p-514445ac.entry.js +0 -291
- package/dist/genexus-ide-ui/p-514445ac.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-b3c5c315.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-fc0bc991.entry.js +0 -204
- package/dist/genexus-ide-ui/p-fc0bc991.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-details.js","sourceRoot":"","sources":["../../../src/components/plugin-details/plugin-details.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,K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mB,CAAC,CAAC,CAAC,CACrB,uBAAA,IAAI,+CAAqB,MAAzB,IAAI,CAAuB,CAC5B,CAAC,CAAC,CAAC;4BACF,2BAA2B;4BAC3B,SAAG,KAAK,EAAC,0CAA0C;gCACjD,gBAAU,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAC,QAAQ,GAAY;gCAC3D,uBAAA,IAAI,2CAAiB,CAAC,OAAO,CAAC,SAAS,CACtC,CACL;4BACA,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,uBAAA,IAAI,iDAAuB,MAA3B,IAAI,CAAyB,CACjD,CACF,CACC;gBACT,WAAK,KAAK,EAAC,MAAM,IACd,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,CAC/B,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;gBACN,WAAK,KAAK,EAAC,+BAA+B,IACvC,uBAAA,IAAI,8CAAoB,MAAxB,IAAI,CAAsB,CACvB,CACE,CAEL,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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-surface\"\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 #chMarkdownViewer: HTMLChMarkdownViewerElement;\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 componentDidLoad() {\n this.#chMarkdownViewer.addEventListener(\"click\", event => {\n // Listens for clicks on links inside <ch-markdown-viewer>.\n // If a link (<a>) is clicked and openLinkCallback is defined,\n // it prevents the default navigation and delegates the event\n // to this.#openLinkHandler, passing the link's href.\n const path = event.composedPath() as EventTarget[];\n\n const link = path.find(el => el instanceof HTMLAnchorElement) as\n | HTMLAnchorElement\n | undefined;\n\n if (link?.href) {\n this.#openLinkHandler(link.href)(event);\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 if (this.openLinkCallback) {\n event.preventDefault();\n this.openLinkCallback(link);\n }\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-m\"></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 ref={(el: HTMLChMarkdownViewerElement) =>\n (this.#chMarkdownViewer = el as HTMLChMarkdownViewerElement)\n }\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 #renderLinkTag = (\n href: string,\n label: string,\n cssClass?: string,\n chImageSrc?: string\n ): HTMLAnchorElement => {\n return (\n <a\n href={href}\n target=\"_blank\"\n onClick={this.#openLinkHandler(href)}\n class={cssClass}\n >\n {chImageSrc && <ch-image src={chImageSrc} class=\"icon-m\"></ch-image>}\n {label}\n </a>\n );\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 : this.#renderLinkTag(\n (field.value as LinkData).url,\n (field.value as LinkData).text,\n \"field__link\"\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 has-link\">\n {this.#renderLinkTag(\n titleLinkDataUrl,\n titleText as string,\n \"text-underline\"\n )}\n </h2>\n ) : (\n <h2 class=\"heading-5\">{titleText}</h2>\n )}\n {publisherHasLink ? (\n this.#renderLinkTag(\n publisherDataUrl,\n titleText as string,\n \"text-underline plugin__publisher caption-semi-bold-l\",\n USER_ICON\n )\n ) : (\n <p class=\"plugin__publisher caption-semi-bold-l\">\n <ch-image src={USER_ICON} class=\"icon-s\"></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 src={CHECK_CIRCLE_ICON} class=\"icon-s\"></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"]}
|
|
1
|
+
{"version":3,"file":"plugin-details.js","sourceRoot":"","sources":["../../../src/components/plugin-details/plugin-details.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,OAAO,EACP,CAAC,EACD,YAAY,EAEb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C,MAAM,SAAS,GAAG,WAAW,CAAC;IAC5B,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,YAAY;CACxB,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,yCAAyC;AACzC,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;AAQF,MAAM,OAAO,kBAAkB;;QAC7B;;WAEG;QACH,wEAAwE;QACxE,sDAAsB;QAEtB,uDAA+C;QAE/C,+DAA+D;QAC/D,2CAA2C;QAC3C,yDAAmD,IAAI,GAAG,EAAE,EA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AClD,mBAAmB,CAAC,CAAC,CAAC,CACrB,uBAAA,IAAI,+CAAqB,MAAzB,IAAI,CAAuB,CAC5B,CAAC,CAAC,CAAC;4BACF,2BAA2B;4BAC3B,SAAG,KAAK,EAAC,0CAA0C;gCACjD,gBAAU,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAC,QAAQ,GAAY;gCAC3D,uBAAA,IAAI,2CAAiB,CAAC,OAAO,CAAC,SAAS,CACtC,CACL;4BACA,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,uBAAA,IAAI,iDAAuB,MAA3B,IAAI,CAAyB,CACjD,CACF,CACC;gBACT,WAAK,KAAK,EAAC,MAAM,IACd,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,CAC/B,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;gBACN,WAAK,KAAK,EAAC,+BAA+B,IACvC,uBAAA,IAAI,8CAAoB,MAAxB,IAAI,CAAsB,CACvB,CACE,CAEL,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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-surface\"\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 #chMarkdownViewer: HTMLChMarkdownViewerElement;\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 the ordinal versionId of the selected version (undefined installs the latest).\n */\n @Prop() readonly installCallback!: (versionId?: number) => Promise<void>;\n\n /**\n * When set, the component is installing this plugin and shows a determinate progress bar\n * instead of the action button.\n */\n @Prop() readonly installProgress?: PluginInstallProgress;\n\n /**\n * Callback that should be invoked when the user cancels an in-progress\n * install/update from the progress bar.\n */\n @Prop() readonly cancelCallback!: () => 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 componentDidLoad() {\n // Guard: #chMarkdownViewer is unset when there are no docSections.\n this.#chMarkdownViewer?.addEventListener(\"click\", event => {\n // Listens for clicks on links inside <ch-markdown-viewer>.\n // If a link (<a>) is clicked and openLinkCallback is defined,\n // it prevents the default navigation and delegates the event\n // to this.#openLinkHandler, passing the link's href.\n const path = event.composedPath() as EventTarget[];\n\n const link = path.find(el => el instanceof HTMLAnchorElement) as\n | HTMLAnchorElement\n | undefined;\n\n if (link?.href) {\n this.#openLinkHandler(link.href)(event);\n }\n });\n }\n\n #versionsMenuOptionsModel = (): ActionMenuModel => {\n const versionsToUpdateMenusModel: ActionMenuModel = this.data.versions?.map(\n version => {\n // The menu id carries the ordinal versionId; the caption shows the human-readable version.\n return { id: String(version.versionId), caption: version.version };\n }\n );\n return versionsToUpdateMenusModel;\n };\n\n #menuVersionSelectedHandler = (\n event: CustomEvent<{\n id?: string;\n }>\n ) => {\n const selectedVersionId = event.detail.id;\n this.installCallback(\n selectedVersionId != null ? Number(selectedVersionId) : undefined\n );\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 // The latest version is listed first; its ordinal drives install/update from the primary button.\n #latestVersionId = (): number | undefined =>\n this.data.versions?.[0]?.versionId;\n\n #installClickedHandler = () => {\n this.installCallback(this.#latestVersionId());\n };\n\n #openLinkHandler = (link: string) => (event: MouseEvent) => {\n if (this.openLinkCallback) {\n event.preventDefault();\n this.openLinkCallback(link);\n }\n };\n\n #uninstallClickedHandler = () => {\n this.uninstallCallback();\n };\n\n #cancelClickedHandler = () => {\n this.cancelCallback();\n };\n\n #renderInstallProgress = (): JSX.Element => {\n const { phase, percent } = this.installProgress;\n const caption =\n phase === \"download\"\n ? this.#componentLocale.actions.downloading\n : this.#componentLocale.actions.installing;\n\n return (\n <gx-ide-progress-bar\n class=\"install-progress plain\"\n active\n caption={`${caption} ${percent}%`}\n progress={percent}\n stateType=\"in-progress\"\n closeType=\"button\"\n closedCallback={this.#cancelClickedHandler}\n ></gx-ide-progress-bar>\n );\n };\n\n #renderActionButtons = (): JSX.Element => {\n // While an install/update is running, replace the buttons with a determinate progress bar.\n if (this.installProgress) {\n return this.#renderInstallProgress();\n }\n\n let actionButtonCaption;\n let actionButtonClasses = \"button-primary action-button\";\n let actionButtonCallback;\n const moreVersionsToUpdate = this.data.versions?.length > 1;\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 = () =>\n this.installCallback(this.#latestVersionId());\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-m\"></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 ref={(el: HTMLChMarkdownViewerElement) =>\n (this.#chMarkdownViewer = el as HTMLChMarkdownViewerElement)\n }\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 #renderLinkTag = (\n href: string,\n label: string,\n cssClass?: string,\n chImageSrc?: string\n ): HTMLAnchorElement => {\n return (\n <a\n href={href}\n target=\"_blank\"\n onClick={this.#openLinkHandler(href)}\n class={cssClass}\n >\n {chImageSrc && <ch-image src={chImageSrc} class=\"icon-m\"></ch-image>}\n {label}\n </a>\n );\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 : this.#renderLinkTag(\n (field.value as LinkData).url,\n (field.value as LinkData).text,\n \"field__link\"\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 has-link\">\n {this.#renderLinkTag(\n titleLinkDataUrl,\n titleText as string,\n \"text-underline\"\n )}\n </h2>\n ) : (\n <h2 class=\"heading-5\">{titleText}</h2>\n )}\n {publisherHasLink ? (\n this.#renderLinkTag(\n publisherDataUrl,\n titleText as string,\n \"text-underline plugin__publisher caption-semi-bold-l\",\n USER_ICON\n )\n ) : (\n <p class=\"plugin__publisher caption-semi-bold-l\">\n <ch-image src={USER_ICON} class=\"icon-s\"></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 src={CHECK_CIRCLE_ICON} class=\"icon-s\"></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 PluginVersionOption = {\n version: string;\n versionId: number;\n};\n\nexport type PluginInstallProgress = {\n phase: \"download\" | \"install\";\n percent: number;\n};\n\nexport type PluginDetailsData = {\n id: string;\n name: string | LinkData;\n publisher: string | LinkData;\n installed: boolean;\n updateVersion?: string;\n versions: PluginVersionOption[];\n iconUrl: string;\n description: string;\n docSections: DocSectionData[];\n infoCategories: PluginInfoCategoryData[];\n};\n"]}
|
|
@@ -27,6 +27,52 @@ Found on /common/helpers.tsx hiChar function is used to add a span/class to ever
|
|
|
27
27
|
|
|
28
28
|
.list-box::part(item__caption) {
|
|
29
29
|
font-weight: var(--font-style-semi-bold);
|
|
30
|
+
color: var(--color-text-neutral-default);
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
text-overflow: ellipsis;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.list-box::part(item__inline-caption) {
|
|
37
|
+
grid-template-columns: minmax(0, 1fr) max-content;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: var(--spacing-gap-m);
|
|
40
|
+
width: 100%;
|
|
41
|
+
min-width: 100%;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host .list-box::part(group__action),
|
|
45
|
+
:host .list-box::part(group__caption) {
|
|
46
|
+
font-size: var(--font-size-body-s);
|
|
47
|
+
--ch-action-list-group__expandable-button-size: var(--icon-xs);
|
|
48
|
+
--ch-action-list-group__expandable-button-image-size: var(--icon-xs);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.list-box::part(custom-image) {
|
|
52
|
+
block-size: 40px;
|
|
53
|
+
inline-size: 40px;
|
|
54
|
+
border-radius: var(--border-radius-m);
|
|
55
|
+
object-fit: cover;
|
|
56
|
+
margin-inline-end: 12px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.list-box::part(custom-meta) {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: var(--spacing-gap-m);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.list-box::part(custom-meta-item) {
|
|
66
|
+
display: inline-flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: var(--spacing-gap-xs);
|
|
69
|
+
font-size: var(--font-size-body-s);
|
|
70
|
+
color: var(--color-text-neutral-default);
|
|
71
|
+
white-space: nowrap;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.list-box::part(custom-meta-icon) {
|
|
75
|
+
--ch-image-size: 14px;
|
|
30
76
|
}
|
|
31
77
|
|
|
32
78
|
.list-box::part(custom-container) {
|
|
@@ -36,16 +82,15 @@ Found on /common/helpers.tsx hiChar function is used to add a span/class to ever
|
|
|
36
82
|
width: 100%;
|
|
37
83
|
}
|
|
38
84
|
|
|
39
|
-
.list-box::part(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
margin-inline-end: 12px;
|
|
85
|
+
.list-box::part(item__block-end start) {
|
|
86
|
+
width: 100%;
|
|
87
|
+
min-width: 100%;
|
|
43
88
|
}
|
|
44
89
|
|
|
45
90
|
.list-box::part(custom-description) {
|
|
46
91
|
font-size: var(--font-size-body-s);
|
|
47
92
|
margin: 0;
|
|
48
|
-
|
|
93
|
+
color: var(--color-text-neutral-neutral);
|
|
49
94
|
line-height: var(--line-height-relaxed);
|
|
50
95
|
margin-inline-end: 8px;
|
|
51
96
|
overflow: hidden;
|
|
@@ -53,33 +98,27 @@ Found on /common/helpers.tsx hiChar function is used to add a span/class to ever
|
|
|
53
98
|
text-overflow: ellipsis;
|
|
54
99
|
}
|
|
55
100
|
|
|
56
|
-
.list-box::part(
|
|
57
|
-
width: 100%;
|
|
58
|
-
min-width: 100%;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.list-box::part(custom-brand) {
|
|
62
|
-
font-weight: var(--font-style-semi-bold);
|
|
101
|
+
.list-box::part(custom-footer) {
|
|
63
102
|
display: flex;
|
|
64
|
-
gap: var(--spacing-gap-xs);
|
|
65
103
|
align-items: center;
|
|
104
|
+
gap: var(--spacing-gap-m);
|
|
105
|
+
width: 100%;
|
|
106
|
+
margin-block-start: 2px;
|
|
107
|
+
min-block-size: var(--control-block-size);
|
|
66
108
|
}
|
|
67
109
|
|
|
68
|
-
.list-box::part(custom-brand
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
block-size: 16px;
|
|
76
|
-
inline-size: 16px;
|
|
110
|
+
.list-box::part(custom-brand) {
|
|
111
|
+
font-weight: var(--font-style-regular);
|
|
112
|
+
font-size: var(--font-size-body-s);
|
|
113
|
+
color: var(--color-text-neutral-disabled);
|
|
114
|
+
overflow: hidden;
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
text-overflow: ellipsis;
|
|
77
117
|
}
|
|
78
118
|
|
|
79
119
|
.list-box::part(custom-button) {
|
|
80
120
|
--button-color: var(--color-text-primary-default);
|
|
81
|
-
|
|
82
|
-
--button-color--active: var(--color-text-neutral-on-pressed);
|
|
121
|
+
margin-inline-start: auto;
|
|
83
122
|
display: inline-grid;
|
|
84
123
|
grid-auto-flow: column;
|
|
85
124
|
grid-auto-columns: max-content;
|
|
@@ -88,9 +127,8 @@ Found on /common/helpers.tsx hiChar function is used to add a span/class to ever
|
|
|
88
127
|
padding-inline: var(--control-padding-inline);
|
|
89
128
|
box-sizing: border-box;
|
|
90
129
|
color: var(--button-color);
|
|
130
|
+
font-size: var(--font-size-body-s);
|
|
91
131
|
font-weight: var(--font-style-semi-bold);
|
|
92
|
-
margin-block-end: auto;
|
|
93
|
-
margin-block-start: auto;
|
|
94
132
|
text-transform: capitalize;
|
|
95
133
|
}
|
|
96
134
|
|
|
@@ -100,4 +138,23 @@ Found on /common/helpers.tsx hiChar function is used to add a span/class to ever
|
|
|
100
138
|
|
|
101
139
|
.list-box::part(custom-button):active {
|
|
102
140
|
--button-color: var(--color-text-primary-pressed);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.list-box::part(custom-progress) {
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
gap: var(--spacing-gap-xs);
|
|
147
|
+
margin-inline-start: auto;
|
|
148
|
+
inline-size: 140px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.list-box::part(custom-progress-label) {
|
|
152
|
+
font-size: var(--font-size-caption-s);
|
|
153
|
+
line-height: 1;
|
|
154
|
+
color: var(--color-text-neutral-neutral);
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.list-box::part(custom-progress-bar) {
|
|
159
|
+
flex: 1;
|
|
103
160
|
}
|
|
@@ -14,7 +14,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
14
14
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
15
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
16
|
};
|
|
17
|
-
var _GxIdePluginManager_componentLocale, _GxIdePluginManager_animateEmptyState, _GxIdePluginManager_actionListButtonClickHandler,
|
|
17
|
+
var _GxIdePluginManager_componentLocale, _GxIdePluginManager_animateEmptyState, _GxIdePluginManager_actionListButtonClickHandler, _GxIdePluginManager_downloadsFormatter, _GxIdePluginManager_formatDownloads, _GxIdePluginManager_mapPluginToItem, _GxIdePluginManager_mapPluginGroupsToActionListModel, _GxIdePluginManager_pluginsFilterInputHandler, _GxIdePluginManager_evaluateContentToDisplay, _GxIdePluginManager_renderLoader, _GxIdePluginManager_pluginSelectedHandler;
|
|
18
18
|
import { Host, h, getAssetPath } from "@stencil/core";
|
|
19
19
|
import { getIconPath } from "@genexus/mercury";
|
|
20
20
|
import { Locale } from "../../common/locale";
|
|
@@ -25,7 +25,7 @@ const FILTER_ICON = getIconPath({
|
|
|
25
25
|
colorType: "on-surface"
|
|
26
26
|
});
|
|
27
27
|
// plugin icon if no iconUrl was provided
|
|
28
|
-
const EXTENSION_ICON_IMG = getAssetPath(`./gx-ide-assets/plugin-
|
|
28
|
+
const EXTENSION_ICON_IMG = getAssetPath(`./gx-ide-assets/plugin-explorer/images/plugin-icon.svg`);
|
|
29
29
|
const CSS_BUNDLES = [
|
|
30
30
|
"resets/box-sizing",
|
|
31
31
|
"components/list-box",
|
|
@@ -37,6 +37,21 @@ const CSS_BUNDLES = [
|
|
|
37
37
|
"utils/spacing",
|
|
38
38
|
"chameleon/scrollbar"
|
|
39
39
|
];
|
|
40
|
+
const SEARCH_ICON = getIconPath({
|
|
41
|
+
category: "system",
|
|
42
|
+
name: "search",
|
|
43
|
+
colorType: "on-surface"
|
|
44
|
+
});
|
|
45
|
+
const STAR_ICON = getIconPath({
|
|
46
|
+
category: "system",
|
|
47
|
+
name: "star-fill",
|
|
48
|
+
colorType: "warning"
|
|
49
|
+
});
|
|
50
|
+
const DOWNLOAD_ICON = getIconPath({
|
|
51
|
+
category: "system",
|
|
52
|
+
name: "download",
|
|
53
|
+
colorType: "on-surface"
|
|
54
|
+
});
|
|
40
55
|
export class GxIdePluginManager {
|
|
41
56
|
constructor() {
|
|
42
57
|
/**
|
|
@@ -49,51 +64,85 @@ export class GxIdePluginManager {
|
|
|
49
64
|
event.stopPropagation();
|
|
50
65
|
this.executeActionCallback(pluginId, action);
|
|
51
66
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
67
|
+
// Formats a raw downloads count into a compact string (e.g. 4000 -> "4K").
|
|
68
|
+
_GxIdePluginManager_downloadsFormatter.set(this, new Intl.NumberFormat(undefined, {
|
|
69
|
+
notation: "compact",
|
|
70
|
+
maximumFractionDigits: 1
|
|
71
|
+
}));
|
|
72
|
+
_GxIdePluginManager_formatDownloads.set(this, (value) => {
|
|
73
|
+
const numericValue = typeof value === "number" ? value : Number(value);
|
|
74
|
+
return Number.isFinite(numericValue)
|
|
75
|
+
? __classPrivateFieldGet(this, _GxIdePluginManager_downloadsFormatter, "f").format(numericValue)
|
|
76
|
+
: `${value}`;
|
|
77
|
+
});
|
|
78
|
+
_GxIdePluginManager_mapPluginToItem.set(this, (pluginData) => {
|
|
79
|
+
const hasActionButton = !!pluginData.action;
|
|
80
|
+
const hasDownloads = pluginData.downloads !== undefined && pluginData.downloads !== null;
|
|
81
|
+
const hasRating = pluginData.rating !== undefined && pluginData.rating !== null;
|
|
82
|
+
const hasMeta = hasDownloads || hasRating;
|
|
83
|
+
const pluginItem = {
|
|
84
|
+
id: pluginData.id,
|
|
85
|
+
caption: pluginData.name,
|
|
86
|
+
imgSrc: pluginData.iconUrl,
|
|
87
|
+
type: "actionable",
|
|
88
|
+
additionalInformation: {
|
|
89
|
+
"stretch-start": {
|
|
90
|
+
center: [
|
|
91
|
+
{
|
|
92
|
+
part: "custom-image",
|
|
93
|
+
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" }))
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"inline-caption": hasMeta && {
|
|
98
|
+
end: [
|
|
99
|
+
{
|
|
100
|
+
part: "custom-meta",
|
|
101
|
+
jsx: () => (h("div", { part: "custom-meta" }, hasDownloads && (h("span", { part: "custom-meta-item custom-downloads", title: `${pluginData.downloads}` }, h("ch-image", { part: "custom-meta-icon custom-downloads-icon", src: DOWNLOAD_ICON }), __classPrivateFieldGet(this, _GxIdePluginManager_formatDownloads, "f").call(this, pluginData.downloads))), hasRating && (h("span", { part: "custom-meta-item custom-rating", title: `${pluginData.rating}` }, h("ch-image", { part: "custom-meta-icon custom-rating-icon", src: STAR_ICON }), pluginData.rating))))
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
"block-end": {
|
|
106
|
+
start: [
|
|
107
|
+
{
|
|
108
|
+
part: "custom-description custom-button custom-container custom-brand custom-footer custom-meta custom-meta-item custom-meta-icon custom-progress custom-progress-label custom-progress-bar item__block-end start",
|
|
109
|
+
jsx: () => (h("div", { part: "custom-container" }, h("p", { part: "custom-description", title: pluginData.description }, pluginData.description), h("div", { part: "custom-footer" }, h("small", { part: "custom-brand" }, pluginData.publisher), pluginData.installProgress ? (h("div", { part: "custom-progress" }, h("span", { part: "custom-progress-label" }, pluginData.installProgress.percent, "%"), h("gx-ide-progress-bar", { part: "custom-progress-bar", class: "plain", minimal: true, active: true, stateType: "in-progress", progress: pluginData.installProgress.percent }))) : hasActionButton ? (h("button", { class: "button", part: "custom-button", onClick: __classPrivateFieldGet(this, _GxIdePluginManager_actionListButtonClickHandler, "f").call(this, pluginData.id, pluginData.action) }, pluginData.action)) : null)))
|
|
110
|
+
}
|
|
111
|
+
// {
|
|
112
|
+
// slot: "abcd"
|
|
113
|
+
// } as ActionListItemAdditionalSlot // slot not working
|
|
114
|
+
]
|
|
89
115
|
}
|
|
90
|
-
};
|
|
91
|
-
if (index !== 0) {
|
|
92
|
-
pluginsActionListModel.push(separatorItem);
|
|
93
116
|
}
|
|
94
|
-
|
|
117
|
+
};
|
|
118
|
+
return pluginItem;
|
|
119
|
+
});
|
|
120
|
+
// Builds the ch-action-list model from groups: one native action-list group
|
|
121
|
+
// per PluginGroupData, plus a separator between groups. The group header only
|
|
122
|
+
// renders a plain-text caption (no custom pill element is supported), so the
|
|
123
|
+
// per-group total is shown as a number appended to the caption.
|
|
124
|
+
_GxIdePluginManager_mapPluginGroupsToActionListModel.set(this, (groups) => {
|
|
125
|
+
const model = [];
|
|
126
|
+
const separatorItem = { type: "separator" };
|
|
127
|
+
groups === null || groups === void 0 ? void 0 : groups.forEach(group => {
|
|
128
|
+
var _a, _b, _c;
|
|
129
|
+
// Skip empty groups so we don't render a header with "(0)".
|
|
130
|
+
if (!((_a = group.plugins) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (model.length > 0) {
|
|
134
|
+
model.push(separatorItem);
|
|
135
|
+
}
|
|
136
|
+
model.push({
|
|
137
|
+
id: group.id,
|
|
138
|
+
type: "group",
|
|
139
|
+
caption: `${group.caption} (${group.plugins.length})`,
|
|
140
|
+
expandable: (_b = group.expandable) !== null && _b !== void 0 ? _b : true,
|
|
141
|
+
expanded: (_c = group.expanded) !== null && _c !== void 0 ? _c : true,
|
|
142
|
+
items: group.plugins.map(plugin => __classPrivateFieldGet(this, _GxIdePluginManager_mapPluginToItem, "f").call(this, plugin))
|
|
143
|
+
});
|
|
95
144
|
});
|
|
96
|
-
return
|
|
145
|
+
return model;
|
|
97
146
|
});
|
|
98
147
|
_GxIdePluginManager_pluginsFilterInputHandler.set(this, async (event) => {
|
|
99
148
|
this.loading = true;
|
|
@@ -125,7 +174,7 @@ export class GxIdePluginManager {
|
|
|
125
174
|
}
|
|
126
175
|
pluginsChangedHandler(newPlugins) {
|
|
127
176
|
this.pluginsActionListModel =
|
|
128
|
-
__classPrivateFieldGet(this,
|
|
177
|
+
__classPrivateFieldGet(this, _GxIdePluginManager_mapPluginGroupsToActionListModel, "f").call(this, newPlugins);
|
|
129
178
|
this.loading = false;
|
|
130
179
|
}
|
|
131
180
|
async componentWillLoad() {
|
|
@@ -133,7 +182,7 @@ export class GxIdePluginManager {
|
|
|
133
182
|
this.pluginsChangedHandler(this.plugins);
|
|
134
183
|
}
|
|
135
184
|
render() {
|
|
136
|
-
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
|
|
185
|
+
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", startImgSrc: SEARCH_ICON }), h("div", { class: "inner-container" }, this.loading
|
|
137
186
|
? __classPrivateFieldGet(this, _GxIdePluginManager_renderLoader, "f").call(this)
|
|
138
187
|
: __classPrivateFieldGet(this, _GxIdePluginManager_evaluateContentToDisplay, "f").call(this)))));
|
|
139
188
|
}
|
|
@@ -156,13 +205,13 @@ export class GxIdePluginManager {
|
|
|
156
205
|
"type": "unknown",
|
|
157
206
|
"mutable": true,
|
|
158
207
|
"complexType": {
|
|
159
|
-
"original": "
|
|
160
|
-
"resolved": "
|
|
208
|
+
"original": "PluginGroupData[]",
|
|
209
|
+
"resolved": "PluginGroupData[]",
|
|
161
210
|
"references": {
|
|
162
|
-
"
|
|
211
|
+
"PluginGroupData": {
|
|
163
212
|
"location": "local",
|
|
164
213
|
"path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/plugin-explorer/plugin-explorer.tsx",
|
|
165
|
-
"id": "src/components/plugin-explorer/plugin-explorer.tsx::
|
|
214
|
+
"id": "src/components/plugin-explorer/plugin-explorer.tsx::PluginGroupData"
|
|
166
215
|
}
|
|
167
216
|
}
|
|
168
217
|
},
|
|
@@ -170,24 +219,24 @@ export class GxIdePluginManager {
|
|
|
170
219
|
"optional": false,
|
|
171
220
|
"docs": {
|
|
172
221
|
"tags": [],
|
|
173
|
-
"text": "List of
|
|
222
|
+
"text": "List of plugin groups to display. Each group is rendered as a native\naction-list group (with a separator between groups) and its header caption\nincludes the total number of plugins in the group.\nUsually used to initialize the component."
|
|
174
223
|
}
|
|
175
224
|
},
|
|
176
225
|
"filterCallback": {
|
|
177
226
|
"type": "unknown",
|
|
178
227
|
"mutable": false,
|
|
179
228
|
"complexType": {
|
|
180
|
-
"original": "(text: string) => Promise<
|
|
181
|
-
"resolved": "(text: string) => Promise<
|
|
229
|
+
"original": "(\n text: string\n ) => Promise<PluginGroupData[]>",
|
|
230
|
+
"resolved": "(text: string) => Promise<PluginGroupData[]>",
|
|
182
231
|
"references": {
|
|
183
232
|
"Promise": {
|
|
184
233
|
"location": "global",
|
|
185
234
|
"id": "global::Promise"
|
|
186
235
|
},
|
|
187
|
-
"
|
|
236
|
+
"PluginGroupData": {
|
|
188
237
|
"location": "local",
|
|
189
238
|
"path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/plugin-explorer/plugin-explorer.tsx",
|
|
190
|
-
"id": "src/components/plugin-explorer/plugin-explorer.tsx::
|
|
239
|
+
"id": "src/components/plugin-explorer/plugin-explorer.tsx::PluginGroupData"
|
|
191
240
|
}
|
|
192
241
|
}
|
|
193
242
|
},
|
|
@@ -259,5 +308,5 @@ export class GxIdePluginManager {
|
|
|
259
308
|
}];
|
|
260
309
|
}
|
|
261
310
|
}
|
|
262
|
-
_GxIdePluginManager_componentLocale = new WeakMap(), _GxIdePluginManager_animateEmptyState = new WeakMap(), _GxIdePluginManager_actionListButtonClickHandler = new WeakMap(),
|
|
311
|
+
_GxIdePluginManager_componentLocale = new WeakMap(), _GxIdePluginManager_animateEmptyState = new WeakMap(), _GxIdePluginManager_actionListButtonClickHandler = new WeakMap(), _GxIdePluginManager_downloadsFormatter = new WeakMap(), _GxIdePluginManager_formatDownloads = new WeakMap(), _GxIdePluginManager_mapPluginToItem = new WeakMap(), _GxIdePluginManager_mapPluginGroupsToActionListModel = new WeakMap(), _GxIdePluginManager_pluginsFilterInputHandler = new WeakMap(), _GxIdePluginManager_evaluateContentToDisplay = new WeakMap(), _GxIdePluginManager_renderLoader = new WeakMap(), _GxIdePluginManager_pluginSelectedHandler = new WeakMap();
|
|
263
312
|
//# sourceMappingURL=plugin-explorer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-explorer.js","sourceRoot":"","sources":["../../../src/components/plugin-explorer/plug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AAC,OAAO;oBACX,CAAC,CAAC,uBAAA,IAAI,wCAAc,MAAlB,IAAI,CAAgB;oBACtB,CAAC,CAAC,uBAAA,IAAI,oDAA0B,MAA9B,IAAI,CAA4B,CAChC,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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-surface\"\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\">{pluginData.publisher}</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"]}
|
|
1
|
+
{"version":3,"file":"plugin-explorer.js","sourceRoot":"","sources":["../../../src/components/plugin-explorer/plugin-explorer.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,CAAC,EACD,KAAK,EACL,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAU7C,MAAM,WAAW,GAAG,WAAW,CAAC;IAC9B,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,YAAY;CACxB,CAAC,CAAC;AAEH,yCAAyC;AACzC,MAAM,kBAAkB,GAAG,YAAY,CACrC,wDAAwD,CACzD,CAAC;AAEF,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,qBAAqB;IACrB,mBAAmB;IACnB,iBAAiB;IACjB,YAAY;IACZ,cAAc;IACd,kBAAkB;I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AssetPath\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 ActionListItemActionable,\n ActionListItemGroup,\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-surface\"\n});\n\n// plugin icon if no iconUrl was provided\nconst EXTENSION_ICON_IMG = getAssetPath(\n `./gx-ide-assets/plugin-explorer/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\nconst SEARCH_ICON = getIconPath({\n category: \"system\",\n name: \"search\",\n colorType: \"on-surface\"\n});\n\nconst STAR_ICON = getIconPath({\n category: \"system\",\n name: \"star-fill\",\n colorType: \"warning\"\n});\n\nconst DOWNLOAD_ICON = getIconPath({\n category: \"system\",\n name: \"download\",\n colorType: \"on-surface\"\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 plugin groups to display. Each group is rendered as a native\n * action-list group (with a separator between groups) and its header caption\n * includes the total number of plugins in the group.\n * Usually used to initialize the component.\n */\n @Prop({ mutable: true }) plugins: PluginGroupData[];\n @Watch(\"plugins\")\n pluginsChangedHandler(newPlugins: PluginGroupData[]) {\n this.pluginsActionListModel =\n this.#mapPluginGroupsToActionListModel(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!: (\n text: string\n ) => Promise<PluginGroupData[]>;\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 // Formats a raw downloads count into a compact string (e.g. 4000 -> \"4K\").\n #downloadsFormatter = new Intl.NumberFormat(undefined, {\n notation: \"compact\",\n maximumFractionDigits: 1\n });\n\n #formatDownloads = (value: number): string => {\n const numericValue = typeof value === \"number\" ? value : Number(value);\n return Number.isFinite(numericValue)\n ? this.#downloadsFormatter.format(numericValue)\n : `${value}`;\n };\n\n #mapPluginToItem = (pluginData: PluginData): ActionListItemActionable => {\n const hasActionButton = !!pluginData.action;\n const hasDownloads =\n pluginData.downloads !== undefined && pluginData.downloads !== null;\n const hasRating =\n pluginData.rating !== undefined && pluginData.rating !== null;\n const hasMeta = hasDownloads || hasRating;\n\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 \"inline-caption\": hasMeta && {\n end: [\n {\n part: \"custom-meta\",\n jsx: () => (\n <div part=\"custom-meta\">\n {hasDownloads && (\n <span\n part=\"custom-meta-item custom-downloads\"\n title={`${pluginData.downloads}`}\n >\n <ch-image\n part=\"custom-meta-icon custom-downloads-icon\"\n src={DOWNLOAD_ICON}\n ></ch-image>\n {this.#formatDownloads(pluginData.downloads)}\n </span>\n )}\n {hasRating && (\n <span\n part=\"custom-meta-item custom-rating\"\n title={`${pluginData.rating}`}\n >\n <ch-image\n part=\"custom-meta-icon custom-rating-icon\"\n src={STAR_ICON}\n ></ch-image>\n {pluginData.rating}\n </span>\n )}\n </div>\n )\n }\n ]\n },\n \"block-end\": {\n start: [\n {\n part: \"custom-description custom-button custom-container custom-brand custom-footer custom-meta custom-meta-item custom-meta-icon custom-progress custom-progress-label custom-progress-bar item__block-end start\",\n jsx: () => (\n <div part=\"custom-container\">\n <p part=\"custom-description\" title={pluginData.description}>\n {pluginData.description}\n </p>\n <div part=\"custom-footer\">\n <small part=\"custom-brand\">{pluginData.publisher}</small>\n {pluginData.installProgress ? (\n <div part=\"custom-progress\">\n <span part=\"custom-progress-label\">\n {pluginData.installProgress.percent}%\n </span>\n <gx-ide-progress-bar\n part=\"custom-progress-bar\"\n class=\"plain\"\n minimal\n active\n stateType=\"in-progress\"\n progress={pluginData.installProgress.percent}\n ></gx-ide-progress-bar>\n </div>\n ) : hasActionButton ? (\n <button\n class=\"button\"\n part=\"custom-button\"\n onClick={this.#actionListButtonClickHandler(\n pluginData.id,\n pluginData.action\n )}\n >\n {pluginData.action}\n </button>\n ) : null}\n </div>\n </div>\n )\n }\n // {\n // slot: \"abcd\"\n // } as ActionListItemAdditionalSlot // slot not working\n ]\n }\n }\n } as ActionListItemActionable;\n\n return pluginItem;\n };\n\n // Builds the ch-action-list model from groups: one native action-list group\n // per PluginGroupData, plus a separator between groups. The group header only\n // renders a plain-text caption (no custom pill element is supported), so the\n // per-group total is shown as a number appended to the caption.\n #mapPluginGroupsToActionListModel = (\n groups: PluginGroupData[]\n ): ActionListModel => {\n const model: ActionListModel = [];\n const separatorItem: ActionListItemSeparator = { type: \"separator\" };\n\n groups?.forEach(group => {\n // Skip empty groups so we don't render a header with \"(0)\".\n if (!group.plugins?.length) {\n return;\n }\n if (model.length > 0) {\n model.push(separatorItem);\n }\n model.push({\n id: group.id,\n type: \"group\",\n caption: `${group.caption} (${group.plugins.length})`,\n expandable: group.expandable ?? true,\n expanded: group.expanded ?? true,\n items: group.plugins.map(plugin => this.#mapPluginToItem(plugin))\n } as ActionListItemGroup);\n });\n\n return model;\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 startImgSrc={SEARCH_ICON}\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 PluginGroupData = {\n id: string;\n /**\n * Group header text. The total number of plugins in the group is appended\n * automatically, e.g. \"Installed (12)\".\n */\n caption: string;\n /**\n * Whether the group can be collapsed/expanded. Defaults to `true`.\n */\n expandable?: boolean;\n /**\n * Whether the group starts expanded. Defaults to `true`.\n */\n expanded?: boolean;\n plugins: PluginData[];\n};\n\nexport type PluginData = {\n id: string;\n iconUrl: string;\n name: string;\n description: string;\n publisher: string;\n action?: PluginAction;\n downloads?: number;\n rating?: string | number;\n // When set, the card shows a determinate progress bar instead of the action button.\n installProgress?: PluginInstallProgress;\n};\n\nexport type PluginInstallProgress = {\n phase: \"download\" | \"install\";\n percent: number;\n};\n\nexport type PluginAction = \"install\" | \"update\";\n"]}
|