@genexus/genexus-ide-ui 3.2.20 → 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-db-properties-configurator.cjs.entry.js +15 -5
- package/dist/cjs/gx-ide-db-properties-configurator.cjs.entry.js.map +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/db-properties-configurator/db-properties-configurator.css +2 -7
- package/dist/collection/components/db-properties-configurator/db-properties-configurator.js +40 -5
- package/dist/collection/components/db-properties-configurator/db-properties-configurator.js.map +1 -1
- package/dist/collection/components/db-properties-configurator/gx-ide-assets/db-properties-configurator/shortcuts.json +15 -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-db-properties-configurator.js +18 -7
- package/dist/components/gx-ide-db-properties-configurator.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-db-properties-configurator.entry.js +16 -6
- package/dist/esm/gx-ide-db-properties-configurator.entry.js.map +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/db-properties-configurator/shortcuts.json +15 -0
- 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-9cf62f0a.entry.js +292 -0
- package/dist/genexus-ide-ui/p-9cf62f0a.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/db-properties-configurator/db-properties-configurator.d.ts +4 -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 +38 -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-e759cfdb.entry.js +0 -281
- package/dist/genexus-ide-ui/p-e759cfdb.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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["pluginDetailsCss","USER_ICON","getIconPath","category","name","colorType","CHEVRON_DOWN_ICON","CHECK_CIRCLE_ICON","EXTENSION_ICON_IMG","getAssetPath","CSS_BUNDLES","GxIdePluginDetails","_GxIdePluginDetails_componentLocale","set","this","_GxIdePluginDetails_chMarkdownViewer","_GxIdePluginDetails_docSectionIdDescriptionMap","Map","_GxIdePluginDetails_versionsMenuOptionsModel","versionsToUpdateMenusModel","_a","data","versions","map","version","id","String","versionId","caption","_GxIdePluginDetails_menuVersionSelectedHandler","event","selectedVersionId","detail","installCallback","Number","undefined","_GxIdePluginDetails_renderUninstallButton","h","class","onClick","__classPrivateFieldGet","_GxIdePluginDetails_uninstallClickedHandler","actions","uninstall","_GxIdePluginDetails_latestVersionId","_b","_GxIdePluginDetails_installClickedHandler","call","_GxIdePluginDetails_openLinkHandler","link","openLinkCallback","preventDefault","uninstallCallback","_GxIdePluginDetails_cancelClickedHandler","cancelCallback","_GxIdePluginDetails_renderInstallProgress","phase","percent","installProgress","downloading","installing","active","progress","stateType","closeType","closedCallback","_GxIdePluginDetails_renderActionButtons","actionButtonCaption","actionButtonClasses","actionButtonCallback","moreVersionsToUpdate","length","installed","install","updateVersion","updateTo","blockAlign","inlineAlign","model","onButtonClick","src","_GxIdePluginDetails_tabSelectionChangedHandler","selectedTabId","newSelectedId","_GxIdePluginDetails_renderDocSectionsSlots","docsTabModel","docSectionTab","markdownValue","get","ref","el","__classPrivateFieldSet","slot","key","theme","value","_GxIdePluginDetails_returnFormatedId","rawId","toLowerCase","replace","_GxIdePluginDetails_renderLinkTag","href","label","cssClass","chImageSrc","target","_GxIdePluginDetails_renderAsideContent","infoCategories","infoCategory","fields__list","displayAsTags","fields","field","fieldValue","url","text","componentWillLoad","Locale","getComponentStrings","docSections","docSection","i","formatedId","content","componentDidLoad","addEventListener","path","composedPath","find","HTMLAnchorElement","render","renderActionButtons","titleLinkDataText","titleLinkDataUrl","titleHasLink","titleText","publisherDataText","publisher","publisherDataUrl","publisherHasLink","publisherText","Host","iconUrl","alt","description","tabListPosition","overflow","contain","onSelectedItemChange","selectedId"],"sources":["src/components/plugin-details/plugin-details.scss?tag=gx-ide-plugin-details&encapsulation=shadow","src/components/plugin-details/plugin-details.tsx"],"sourcesContent":["@import \"../../global/temporary-mercury-overrides/_tab.scss\";\n\n: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: var(--spacing-gap-l);\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: var(--spacing-gap-xl);\n padding-block-start: var(--spacing-padding-xxl);\n padding-block-end: var(--spacing-padding-xl);\n padding-inline: var(--spacing-padding-xxl);\n}\n.plugin__icon {\n grid-area: plugin-icon;\n inline-size: 100%;\n block-size: auto;\n display: block;\n}\n.plugin__details {\n grid-area: plugin-details;\n display: flex;\n flex-direction: column;\n gap: var(--spacing-gap-m);\n}\n.plugin__publisher {\n display: flex;\n align-items: center;\n gap: var(--spacing-gap-xs);\n}\n.plugin__description {\n line-height: var(--line-height-spacious); // WA: Text appears too tight.\n}\n.plugin__actions-container {\n margin-block-start: var(--spacing-padding-m);\n align-items: center;\n // Reserve the taller progress-bar height (control + gap + bar) so swapping\n // the install button for the progress bar doesn't shift the layout.\n min-block-size: calc(var(--control-block-size) + var(--spacing-gap-xs) + 4px);\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: var(--spacing-gap-m);\n\n // WA Biggest Mercury icon (icon-s) 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: var(--font-size-body-s);\n}\n.plugin__info-category {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-gap-m);\n\n &:not(:first-child) {\n padding-block-start: var(--spacing-padding-xl);\n margin-block-start: var(--spacing-padding-xl);\n border-block-start: 1px solid var(--color-border-surface-on-elevation-1);\n }\n}\n.fields__list:not(.fields__list--as-tags) {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-gap-m);\n .field__li {\n display: flex;\n gap: var(--spacing-gap-xl);\n }\n}\n.fields__list--as-tags {\n display: flex;\n flex-wrap: wrap;\n gap: var(--spacing-gap-m);\n\n .field__li {\n border: 1px solid var(--color-border-surface-on-elevation-1);\n padding-block: var(--spacing-padding-xxs);\n padding-inline: var(--spacing-padding-m);\n border-radius: 4px;\n\n text-transform: lowercase;\n }\n .field__link {\n color: var(--color-text-neutral-strawberry);\n\n &:hover {\n color: var(--color-accent-primary-default);\n }\n &:active {\n color: var(--color-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(--color-accent-primary-default);\n &:hover {\n color: var(--color-accent-primary-hover);\n }\n &:active {\n color: var(--color-accent-primary-pressed);\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 (var(--control-block-size) - 2 * var(--control-border-width) - 16px) / 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: stretch;\n gap: 1px;\n}\n\n.install-progress {\n flex: 1;\n min-inline-size: 220px;\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-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"],"mappings":";;;;;;;;;;;;;;AAAA,MAAMA,IAAmB;;;;;;;;;;;;;;;;;ACgBzB,MAAMC,IAAYC,EAAY;EAC5BC,UAAU;EACVC,MAAM;EACNC,WAAW;;;AAEb,MAAMC,IAAoBJ,EAAY;EACpCC,UAAU;EACVC,MAAM;EACNC,WAAW;;;AAEb,MAAME,IAAoBL,EAAY;EACpCC,UAAU;EACVC,MAAM;EACNC,WAAW;;;yCAIb;MAAMG,IAAqBC,EACzB;;AAGF,MAAMC,IAA8B,EAClC,qBACA,uBACA,qBACA,uBACA,mBACA,mBACA,uBACA,kBACA,cACA,gBACA,iBACA;;MASWC,IAAkB;;;;;;;QAK7BC,EAAAC,IAAAC,WAAA;IAEAC,EAAAF,IAAAC,WAAA;;;QAIAE,EAAAH,IAAAC,MAAmD,IAAIG;IA+EvDC,EAAAL,IAAAC,OAA4B;;MAC1B,MAAMK,KAA8CC,IAAAN,KAAKO,KAAKC,cAAQ,QAAAF,WAAA,aAAAA,EAAEG,KACtEC,MAES;QAAEC,IAAIC,OAAOF,EAAQG;QAAYC,SAASJ,EAAQA;;MAG7D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H,WAAWtI;MAC1BuI,KAAI;QAEN1G,EAAA;MAAKC,OAAM;OACRgG,IACCjG,EAAA;MAAIC,OAAM;OACPE,EAAA1B,MAAIsF,GAAA,KAAerD,KAAnBjC,MACCuH,GACAE,GACA,qBAIJlG,EAAA;MAAIC,OAAM;OAAaiG,IAExBI,IACCnG,EAAA1B,MAAIsF,GAAA,KAAerD,KAAnBjC,MACE4H,GACAH,GACA,wDACAtI,KAGFoC,EAAA;MAAGC,OAAM;OACPD,EAAA;MAAU2C,KAAK/E;MAAWqC,OAAM;QAC/BsG,IAILvG,EAAA;MAAGC,OAAM;OAAuBxB,KAAKO,KAAK2H,cAC1C3G,EAAA;MAAKC,OAAM;OACR6F,IACC3F,EAAA1B,MAAIoD,GAAA,KAAqBnB,KAAzBjC;;IAGAuB,EAAA;MAAGC,OAAM;OACPD,EAAA;MAAU2C,KAAKzE;MAAmB+B,OAAM;QACvCE,EAAA1B,MAAIF,GAAA,KAAkB8B,QAAQ8B,YAGlC1D,KAAKO,KAAKmD,aAAahC,EAAA1B,MAAIsB,GAAA,KAAuBW,KAA3BjC,UAI9BuB,EAAA;MAAKC,OAAM;OACRxB,KAAKuE,aAAad,SAAS,KAC1BlC,EAAA;MACEC,OAAM;MACN2G,iBAAgB;MAChBC,UAAS;MACTC,SAAQ;MACRrE,OAAOhE,KAAKuE;MACZ+D,sBAAsB5G,EAAA1B,MAAImE,GAAA;MAC1BoE,YAAYvI,KAAKoE;OAEhB1C,EAAA1B,MAAIsE,GAAA,KAAwBrC,KAA5BjC,SAIPuB,EAAA;MAAKC,OAAM;OACRE,EAAA1B,MAAI4F,GAAA,KAAoB3D,KAAxBjC"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { g as t, r as e, h as i, H as o, a as s } from "./p-9b9ccd0c.js";
|
|
2
|
+
|
|
3
|
+
import { g as a } from "./p-d42e842b.js";
|
|
4
|
+
|
|
5
|
+
import "./p-6534555e.js";
|
|
6
|
+
|
|
7
|
+
import "lit";
|
|
8
|
+
|
|
9
|
+
import "lit/directives/when.js";
|
|
10
|
+
|
|
11
|
+
import "lit/directives/if-defined.js";
|
|
12
|
+
|
|
13
|
+
import { L as r } from "./p-311eedf3.js";
|
|
14
|
+
|
|
15
|
+
import { c as n } from "./p-c5196b3b.js";
|
|
16
|
+
|
|
17
|
+
const c = ":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:var(--spacing-gap-xs)}.list-box::part(item__caption){font-weight:var(--font-style-semi-bold);color:var(--color-text-neutral-default);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.list-box::part(item__inline-caption){grid-template-columns:minmax(0, 1fr) max-content;align-items:center;gap:var(--spacing-gap-m);width:100%;min-width:100%}:host .list-box::part(group__action),:host .list-box::part(group__caption){font-size:var(--font-size-body-s);--ch-action-list-group__expandable-button-size:var(--icon-xs);--ch-action-list-group__expandable-button-image-size:var(--icon-xs)}.list-box::part(custom-image){block-size:40px;inline-size:40px;border-radius:var(--border-radius-m);object-fit:cover;margin-inline-end:12px}.list-box::part(custom-meta){display:flex;align-items:center;gap:var(--spacing-gap-m)}.list-box::part(custom-meta-item){display:inline-flex;align-items:center;gap:var(--spacing-gap-xs);font-size:var(--font-size-body-s);color:var(--color-text-neutral-default);white-space:nowrap}.list-box::part(custom-meta-icon){--ch-image-size:14px}.list-box::part(custom-container){display:flex;flex-direction:column;gap:var(--spacing-gap-xs);width:100%}.list-box::part(item__block-end start){width:100%;min-width:100%}.list-box::part(custom-description){font-size:var(--font-size-body-s);margin:0;color:var(--color-text-neutral-neutral);line-height:var(--line-height-relaxed);margin-inline-end:8px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.list-box::part(custom-footer){display:flex;align-items:center;gap:var(--spacing-gap-m);width:100%;margin-block-start:2px;min-block-size:var(--control-block-size)}.list-box::part(custom-brand){font-weight:var(--font-style-regular);font-size:var(--font-size-body-s);color:var(--color-text-neutral-disabled);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.list-box::part(custom-button){--button-color:var(--color-text-primary-default);margin-inline-start:auto;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;color:var(--button-color);font-size:var(--font-size-body-s);font-weight:var(--font-style-semi-bold);text-transform:capitalize}.list-box::part(custom-button):hover{--button-color:var(--color-text-primary-hover)}.list-box::part(custom-button):active{--button-color:var(--color-text-primary-pressed)}.list-box::part(custom-progress){display:flex;align-items:center;gap:var(--spacing-gap-xs);margin-inline-start:auto;inline-size:140px}.list-box::part(custom-progress-label){font-size:var(--font-size-caption-s);line-height:1;color:var(--color-text-neutral-neutral);white-space:nowrap}.list-box::part(custom-progress-bar){flex:1}";
|
|
18
|
+
|
|
19
|
+
var l = undefined && undefined.__classPrivateFieldGet || function(t, e, i, o) {
|
|
20
|
+
if (i === "a" && !o) throw new TypeError("Private accessor was defined without a getter");
|
|
21
|
+
if (typeof e === "function" ? t !== e || !o : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
22
|
+
return i === "m" ? o : i === "a" ? o.call(t) : o ? o.value : e.get(t);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var p = undefined && undefined.__classPrivateFieldSet || function(t, e, i, o, s) {
|
|
26
|
+
if (o === "m") throw new TypeError("Private method is not writable");
|
|
27
|
+
if (o === "a" && !s) throw new TypeError("Private accessor was defined without a setter");
|
|
28
|
+
if (typeof e === "function" ? t !== e || !s : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
29
|
+
return o === "a" ? s.call(t, i) : s ? s.value = i : e.set(t, i), i;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var m, d, u, h, g, f, b, x, v, w, y;
|
|
33
|
+
|
|
34
|
+
const z = a({
|
|
35
|
+
category: "system",
|
|
36
|
+
name: "filters",
|
|
37
|
+
colorType: "on-surface"
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// plugin icon if no iconUrl was provided
|
|
41
|
+
const _ = t(`./gx-ide-assets/plugin-explorer/images/plugin-icon.svg`);
|
|
42
|
+
|
|
43
|
+
const k = [ "resets/box-sizing", "components/list-box", "components/button", "components/edit", "utils/form", "utils/layout", "utils/typography", "utils/spacing", "chameleon/scrollbar" ];
|
|
44
|
+
|
|
45
|
+
const j = a({
|
|
46
|
+
category: "system",
|
|
47
|
+
name: "search",
|
|
48
|
+
colorType: "on-surface"
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const M = a({
|
|
52
|
+
category: "system",
|
|
53
|
+
name: "star-fill",
|
|
54
|
+
colorType: "warning"
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const T = a({
|
|
58
|
+
category: "system",
|
|
59
|
+
name: "download",
|
|
60
|
+
colorType: "on-surface"
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const W = class {
|
|
64
|
+
constructor(t) {
|
|
65
|
+
e(this, t);
|
|
66
|
+
/**
|
|
67
|
+
* The component hard-coded strings translations.
|
|
68
|
+
*/
|
|
69
|
+
// eslint-disable-next-line @stencil-community/own-props-must-be-private
|
|
70
|
+
m.set(this, void 0);
|
|
71
|
+
d.set(this, false);
|
|
72
|
+
u.set(this, ((t, e) => i => {
|
|
73
|
+
i.stopPropagation();
|
|
74
|
+
this.executeActionCallback(t, e);
|
|
75
|
+
}));
|
|
76
|
+
// Formats a raw downloads count into a compact string (e.g. 4000 -> "4K").
|
|
77
|
+
h.set(this, new Intl.NumberFormat(undefined, {
|
|
78
|
+
notation: "compact",
|
|
79
|
+
maximumFractionDigits: 1
|
|
80
|
+
}));
|
|
81
|
+
g.set(this, (t => {
|
|
82
|
+
const e = typeof t === "number" ? t : Number(t);
|
|
83
|
+
return Number.isFinite(e) ? l(this, h, "f").format(e) : `${t}`;
|
|
84
|
+
}));
|
|
85
|
+
f.set(this, (t => {
|
|
86
|
+
const e = !!t.action;
|
|
87
|
+
const o = t.downloads !== undefined && t.downloads !== null;
|
|
88
|
+
const s = t.rating !== undefined && t.rating !== null;
|
|
89
|
+
const a = o || s;
|
|
90
|
+
const r = {
|
|
91
|
+
id: t.id,
|
|
92
|
+
caption: t.name,
|
|
93
|
+
imgSrc: t.iconUrl,
|
|
94
|
+
type: "actionable",
|
|
95
|
+
additionalInformation: {
|
|
96
|
+
"stretch-start": {
|
|
97
|
+
center: [ {
|
|
98
|
+
part: "custom-image",
|
|
99
|
+
jsx: () => i("img", {
|
|
100
|
+
part: "custom-image",
|
|
101
|
+
src: t.iconUrl || _,
|
|
102
|
+
alt: `${l(this, m, "f").logotype.replace("PLUGIN_NAME_PLACEHOLDER", t.name)}`,
|
|
103
|
+
loading: "lazy"
|
|
104
|
+
})
|
|
105
|
+
} ]
|
|
106
|
+
},
|
|
107
|
+
"inline-caption": a && {
|
|
108
|
+
end: [ {
|
|
109
|
+
part: "custom-meta",
|
|
110
|
+
jsx: () => i("div", {
|
|
111
|
+
part: "custom-meta"
|
|
112
|
+
}, o && i("span", {
|
|
113
|
+
part: "custom-meta-item custom-downloads",
|
|
114
|
+
title: `${t.downloads}`
|
|
115
|
+
}, i("ch-image", {
|
|
116
|
+
part: "custom-meta-icon custom-downloads-icon",
|
|
117
|
+
src: T
|
|
118
|
+
}), l(this, g, "f").call(this, t.downloads)), s && i("span", {
|
|
119
|
+
part: "custom-meta-item custom-rating",
|
|
120
|
+
title: `${t.rating}`
|
|
121
|
+
}, i("ch-image", {
|
|
122
|
+
part: "custom-meta-icon custom-rating-icon",
|
|
123
|
+
src: M
|
|
124
|
+
}), t.rating))
|
|
125
|
+
} ]
|
|
126
|
+
},
|
|
127
|
+
"block-end": {
|
|
128
|
+
start: [ {
|
|
129
|
+
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",
|
|
130
|
+
jsx: () => i("div", {
|
|
131
|
+
part: "custom-container"
|
|
132
|
+
}, i("p", {
|
|
133
|
+
part: "custom-description",
|
|
134
|
+
title: t.description
|
|
135
|
+
}, t.description), i("div", {
|
|
136
|
+
part: "custom-footer"
|
|
137
|
+
}, i("small", {
|
|
138
|
+
part: "custom-brand"
|
|
139
|
+
}, t.publisher), t.installProgress ? i("div", {
|
|
140
|
+
part: "custom-progress"
|
|
141
|
+
}, i("span", {
|
|
142
|
+
part: "custom-progress-label"
|
|
143
|
+
}, t.installProgress.percent, "%"), i("gx-ide-progress-bar", {
|
|
144
|
+
part: "custom-progress-bar",
|
|
145
|
+
class: "plain",
|
|
146
|
+
minimal: true,
|
|
147
|
+
active: true,
|
|
148
|
+
stateType: "in-progress",
|
|
149
|
+
progress: t.installProgress.percent
|
|
150
|
+
})) : e ? i("button", {
|
|
151
|
+
class: "button",
|
|
152
|
+
part: "custom-button",
|
|
153
|
+
onClick: l(this, u, "f").call(this, t.id, t.action)
|
|
154
|
+
}, t.action) : null))
|
|
155
|
+
// {
|
|
156
|
+
// slot: "abcd"
|
|
157
|
+
// } as ActionListItemAdditionalSlot // slot not working
|
|
158
|
+
} ]
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
return r;
|
|
163
|
+
}));
|
|
164
|
+
// Builds the ch-action-list model from groups: one native action-list group
|
|
165
|
+
// per PluginGroupData, plus a separator between groups. The group header only
|
|
166
|
+
// renders a plain-text caption (no custom pill element is supported), so the
|
|
167
|
+
// per-group total is shown as a number appended to the caption.
|
|
168
|
+
b.set(this, (t => {
|
|
169
|
+
const e = [];
|
|
170
|
+
const i = {
|
|
171
|
+
type: "separator"
|
|
172
|
+
};
|
|
173
|
+
t === null || t === void 0 ? void 0 : t.forEach((t => {
|
|
174
|
+
var o, s, a;
|
|
175
|
+
// Skip empty groups so we don't render a header with "(0)".
|
|
176
|
+
if (!((o = t.plugins) === null || o === void 0 ? void 0 : o.length)) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (e.length > 0) {
|
|
180
|
+
e.push(i);
|
|
181
|
+
}
|
|
182
|
+
e.push({
|
|
183
|
+
id: t.id,
|
|
184
|
+
type: "group",
|
|
185
|
+
caption: `${t.caption} (${t.plugins.length})`,
|
|
186
|
+
expandable: (s = t.expandable) !== null && s !== void 0 ? s : true,
|
|
187
|
+
expanded: (a = t.expanded) !== null && a !== void 0 ? a : true,
|
|
188
|
+
items: t.plugins.map((t => l(this, f, "f").call(this, t)))
|
|
189
|
+
});
|
|
190
|
+
}));
|
|
191
|
+
return e;
|
|
192
|
+
}));
|
|
193
|
+
x.set(this, (async t => {
|
|
194
|
+
this.loading = true;
|
|
195
|
+
const e = t.detail;
|
|
196
|
+
this.plugins = await this.filterCallback(e);
|
|
197
|
+
}));
|
|
198
|
+
v.set(this, (() => {
|
|
199
|
+
const t = this.pluginsActionListModel.length;
|
|
200
|
+
return t ? i("ch-action-list-render", {
|
|
201
|
+
model: this.pluginsActionListModel,
|
|
202
|
+
class: "list-box",
|
|
203
|
+
selection: "single",
|
|
204
|
+
onSelectedItemsChange: l(this, y, "f")
|
|
205
|
+
}) : i("gx-ide-empty-state", {
|
|
206
|
+
isAnimated: l(this, d, "f"),
|
|
207
|
+
class: "recent-objects__empty-state",
|
|
208
|
+
stateIconSrc: z,
|
|
209
|
+
stateTitle: l(this, m, "f").emptyStateTitle,
|
|
210
|
+
stateDescription: l(this, m, "f").emptyStateDescription
|
|
211
|
+
});
|
|
212
|
+
}));
|
|
213
|
+
w.set(this, (() => {
|
|
214
|
+
p(this, d, true, "f");
|
|
215
|
+
return i("gx-ide-loader", {
|
|
216
|
+
loaderTitle: l(this, m, "f").loaderTitle,
|
|
217
|
+
description: l(this, m, "f").loaderDescription,
|
|
218
|
+
show: true
|
|
219
|
+
});
|
|
220
|
+
}));
|
|
221
|
+
y.set(this, (t => {
|
|
222
|
+
var e;
|
|
223
|
+
const i = (e = t.detail[0]) === null || e === void 0 ? void 0 : e.item.type;
|
|
224
|
+
if (i === "actionable") {
|
|
225
|
+
const e = t.detail[0].item.id;
|
|
226
|
+
this.showDetailsCallback(e);
|
|
227
|
+
}
|
|
228
|
+
}));
|
|
229
|
+
this.loading = true;
|
|
230
|
+
this.pluginsActionListModel = [];
|
|
231
|
+
this.plugins = undefined;
|
|
232
|
+
this.filterCallback = undefined;
|
|
233
|
+
this.showDetailsCallback = undefined;
|
|
234
|
+
this.executeActionCallback = undefined;
|
|
235
|
+
}
|
|
236
|
+
pluginsChangedHandler(t) {
|
|
237
|
+
this.pluginsActionListModel = l(this, b, "f").call(this, t);
|
|
238
|
+
this.loading = false;
|
|
239
|
+
}
|
|
240
|
+
async componentWillLoad() {
|
|
241
|
+
p(this, m, await r.getComponentStrings(this.el), "f");
|
|
242
|
+
this.pluginsChangedHandler(this.plugins);
|
|
243
|
+
}
|
|
244
|
+
render() {
|
|
245
|
+
return i(o, {
|
|
246
|
+
class: "widget"
|
|
247
|
+
}, i("ch-theme", {
|
|
248
|
+
model: k
|
|
249
|
+
}), i("div", {
|
|
250
|
+
class: "outer-container field-group"
|
|
251
|
+
}, i("ch-edit", {
|
|
252
|
+
id: "search-plugins-input",
|
|
253
|
+
class: "input",
|
|
254
|
+
accessibleName: l(this, m, "f").accessibleName,
|
|
255
|
+
placeholder: l(this, m, "f").searchInputPlaceholder,
|
|
256
|
+
debounce: n.inputDebounce,
|
|
257
|
+
onInput: l(this, x, "f"),
|
|
258
|
+
type: "search",
|
|
259
|
+
startImgSrc: j
|
|
260
|
+
}), i("div", {
|
|
261
|
+
class: "inner-container"
|
|
262
|
+
}, this.loading ? l(this, w, "f").call(this) : l(this, v, "f").call(this))));
|
|
263
|
+
}
|
|
264
|
+
static get assetsDirs() {
|
|
265
|
+
return [ "gx-ide-assets/plugin-explorer" ];
|
|
266
|
+
}
|
|
267
|
+
get el() {
|
|
268
|
+
return s(this);
|
|
269
|
+
}
|
|
270
|
+
static get watchers() {
|
|
271
|
+
return {
|
|
272
|
+
plugins: [ "pluginsChangedHandler" ]
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
m = new WeakMap, d = new WeakMap, u = new WeakMap, h = new WeakMap, g = new WeakMap,
|
|
278
|
+
f = new WeakMap, b = new WeakMap, x = new WeakMap, v = new WeakMap, w = new WeakMap,
|
|
279
|
+
y = new WeakMap;
|
|
280
|
+
|
|
281
|
+
W.style = c;
|
|
282
|
+
|
|
283
|
+
export { W as gx_ide_plugin_explorer };
|
|
284
|
+
//# sourceMappingURL=p-ef8663dd.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["pluginExplorerCss","FILTER_ICON","getIconPath","category","name","colorType","EXTENSION_ICON_IMG","getAssetPath","CSS_BUNDLES","SEARCH_ICON","STAR_ICON","DOWNLOAD_ICON","GxIdePluginManager","_GxIdePluginManager_componentLocale","set","this","_GxIdePluginManager_animateEmptyState","_GxIdePluginManager_actionListButtonClickHandler","pluginId","action","event","stopPropagation","executeActionCallback","_GxIdePluginManager_downloadsFormatter","Intl","NumberFormat","undefined","notation","maximumFractionDigits","_GxIdePluginManager_formatDownloads","value","numericValue","Number","isFinite","__classPrivateFieldGet","format","_GxIdePluginManager_mapPluginToItem","pluginData","hasActionButton","hasDownloads","downloads","hasRating","rating","hasMeta","pluginItem","id","caption","imgSrc","iconUrl","type","additionalInformation","center","part","jsx","h","src","alt","logotype","replace","loading","end","title","call","start","description","publisher","installProgress","percent","class","minimal","active","stateType","progress","onClick","_GxIdePluginManager_mapPluginGroupsToActionListModel","groups","model","separatorItem","forEach","group","_a","plugins","length","push","expandable","_b","expanded","_c","items","map","plugin","_GxIdePluginManager_pluginsFilterInputHandler","async","filterValue","detail","filterCallback","_GxIdePluginManager_evaluateContentToDisplay","pluginsToDisplay","pluginsActionListModel","selection","onSelectedItemsChange","_GxIdePluginManager_pluginSelectedHandler","isAnimated","stateIconSrc","stateTitle","emptyStateTitle","stateDescription","emptyStateDescription","_GxIdePluginManager_renderLoader","__classPrivateFieldSet","loaderTitle","loaderDescription","show","eventType","item","showDetailsCallback","pluginsChangedHandler","newPlugins","componentWillLoad","Locale","getComponentStrings","el","render","Host","accessibleName","placeholder","searchInputPlaceholder","debounce","config","inputDebounce","onInput","startImgSrc"],"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: var(--spacing-gap-xs);\n}\n.list-box::part(item__caption) {\n font-weight: var(--font-style-semi-bold);\n color: var(--color-text-neutral-default);\n @include ellipsis();\n}\n\n// Caption row: name (flexible) + metadata pinned to the end\n.list-box::part(item__inline-caption) {\n grid-template-columns: minmax(0, 1fr) max-content;\n align-items: center;\n gap: var(--spacing-gap-m);\n width: 100%;\n min-width: 100%;\n}\n\n// Group header: Mercury defaults it to body-m (14px), which reads too large\n// next to the 12px item text. Keep it compact so it looks like a section label.\n// The `:host` prefix raises specificity over Mercury's themed ::part rule\n// (same-specificity ::part rules from the adopted theme would otherwise win).\n:host .list-box::part(group__action),\n:host .list-box::part(group__caption) {\n font-size: var(--font-size-body-s);\n // The expand/collapse chevron is sized by these chameleon vars (Mercury sets\n // them to --icon-s = 14px). Match the 12px header so it doesn't look oversized.\n --ch-action-list-group__expandable-button-size: var(--icon-xs);\n --ch-action-list-group__expandable-button-image-size: var(--icon-xs);\n}\n\n// Plugin logo\n.list-box::part(custom-image) {\n block-size: 40px;\n inline-size: 40px;\n border-radius: var(--border-radius-m);\n object-fit: cover;\n margin-inline-end: 12px;\n}\n\n// Metadata (downloads + rating), aligned with the name\n.list-box::part(custom-meta) {\n display: flex;\n align-items: center;\n gap: var(--spacing-gap-m);\n}\n.list-box::part(custom-meta-item) {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-gap-xs);\n font-size: var(--font-size-body-s);\n // Same emphasis as the title. Applied via `color` (not opacity) so the meta\n // icons keep their own color (e.g. the rating star).\n color: var(--color-text-neutral-default);\n white-space: nowrap;\n}\n.list-box::part(custom-meta-icon) {\n --ch-image-size: 14px;\n}\n\n// Content block (description + footer)\n.list-box::part(custom-container) {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-gap-xs);\n width: 100%;\n}\n.list-box::part(item__block-end start) {\n width: 100%;\n min-width: 100%;\n}\n// Description — second level: lighter than the title.\n.list-box::part(custom-description) {\n font-size: var(--font-size-body-s);\n margin: 0;\n color: var(--color-text-neutral-neutral);\n line-height: var(--line-height-relaxed);\n margin-inline-end: 8px;\n @include ellipsis();\n}\n\n// Footer row: publisher + action button.\n// Pin the row height to the standard control height so swapping the action\n// button for the install progress bar doesn't shift the layout.\n.list-box::part(custom-footer) {\n display: flex;\n align-items: center;\n gap: var(--spacing-gap-m);\n width: 100%;\n margin-block-start: 2px;\n min-block-size: var(--control-block-size);\n}\n// Publisher — the least prominent line in the hierarchy: regular weight and\n// the most muted of the three text levels (below title and description).\n.list-box::part(custom-brand) {\n font-weight: var(--font-style-regular);\n font-size: var(--font-size-body-s);\n color: var(--color-text-neutral-disabled);\n @include ellipsis();\n}\n.list-box::part(custom-button) {\n // WA: Style the button like a Mercury primary button\n // \"Slot\" not working apparently.\n --button-color: var(--color-text-primary-default);\n margin-inline-start: auto;\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 color: var(--button-color);\n // Match the surrounding text size so the action doesn't look oversized.\n font-size: var(--font-size-body-s);\n font-weight: var(--font-style-semi-bold);\n text-transform: capitalize;\n}\n.list-box::part(custom-button):hover {\n --button-color: var(--color-text-primary-hover);\n}\n.list-box::part(custom-button):active {\n --button-color: var(--color-text-primary-pressed);\n}\n\n// The install progress is the shared gx-ide-progress-bar, rendered inside the\n// ch-action-list shadow tree via the item's jsx callback, so it must be sized\n// through ::part (like the other custom-* elements), not with plain selectors.\n// A percent label sits inline with the bar so the progress reads as part of\n// the row instead of a detached bar.\n.list-box::part(custom-progress) {\n display: flex;\n align-items: center;\n gap: var(--spacing-gap-xs);\n margin-inline-start: auto;\n inline-size: 140px;\n}\n.list-box::part(custom-progress-label) {\n font-size: var(--font-size-caption-s);\n line-height: 1;\n color: var(--color-text-neutral-neutral);\n white-space: nowrap;\n}\n.list-box::part(custom-progress-bar) {\n flex: 1;\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 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"],"mappings":";;;;;;;;;;;;;;;;AAAA,MAAMA,IAAoB;;;;;;;;;;;;;;;;;ACuB1B,MAAMC,IAAcC,EAAY;EAC9BC,UAAU;EACVC,MAAM;EACNC,WAAW;;;yCAIb;MAAMC,IAAqBC,EACzB;;AAGF,MAAMC,IAA8B,EAClC,qBACA,uBACA,qBACA,mBACA,cACA,gBACA,oBACA,iBACA;;AAGF,MAAMC,IAAcP,EAAY;EAC9BC,UAAU;EACVC,MAAM;EACNC,WAAW;;;AAGb,MAAMK,IAAYR,EAAY;EAC5BC,UAAU;EACVC,MAAM;EACNC,WAAW;;;AAGb,MAAMM,IAAgBT,EAAY;EAChCC,UAAU;EACVC,MAAM;EACNC,WAAW;;;MASAO,IAAkB;;;;;;;QAK7BC,EAAAC,IAAAC,WAAA;IACAC,EAAAF,IAAAC,MAA8B;IAuD9BE,EAAAH,IAAAC,OACE,CAACG,GAAkBC,MAA0BC;MAC3CA,EAAMC;MACNN,KAAKO,sBAAsBJ,GAAUC;AAAO;;QAIhDI,EAAAT,IAAAC,MAAsB,IAAIS,KAAKC,aAAaC,WAAW;MACrDC,UAAU;MACVC,uBAAuB;;IAGzBC,EAAAf,IAAAC,OAAoBe;MAClB,MAAMC,WAAsBD,MAAU,WAAWA,IAAQE,OAAOF;MAChE,OAAOE,OAAOC,SAASF,KACnBG,EAAAnB,MAAIQ,GAAA,KAAqBY,OAAOJ,KAChC,GAAGD;AAAO;IAGhBM,EAAAtB,IAAAC,OAAoBsB;MAClB,MAAMC,MAAoBD,EAAWlB;MACrC,MAAMoB,IACJF,EAAWG,cAAcd,aAAaW,EAAWG,cAAc;MACjE,MAAMC,IACJJ,EAAWK,WAAWhB,aAAaW,EAAWK,WAAW;MAC3D,MAAMC,IAAUJ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9B/C"}
|
|
@@ -22,6 +22,10 @@ export declare class GxIdeDbPropertiesConfigurator {
|
|
|
22
22
|
*/
|
|
23
23
|
readonly propertyChangeCallback: PropertyChangeCallback;
|
|
24
24
|
componentWillLoad(): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Suspends or reactivates the shortcuts.
|
|
27
|
+
*/
|
|
28
|
+
suspendShortcuts(suspendShortcuts: boolean): Promise<void>;
|
|
25
29
|
render(): any;
|
|
26
30
|
}
|
|
27
31
|
export type DSControlKind = "checkbox" | "text" | "password" | "combo" | "combo-editable" | "custom" | "readonly";
|
|
@@ -10,9 +10,19 @@ export declare class GxIdePluginDetails {
|
|
|
10
10
|
readonly data: PluginDetailsData;
|
|
11
11
|
/**
|
|
12
12
|
* Callback that should be invoked when the user performs the install or update action.
|
|
13
|
-
* Receives
|
|
13
|
+
* Receives the ordinal versionId of the selected version (undefined installs the latest).
|
|
14
14
|
*/
|
|
15
|
-
readonly installCallback: (
|
|
15
|
+
readonly installCallback: (versionId?: number) => Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* When set, the component is installing this plugin and shows a determinate progress bar
|
|
18
|
+
* instead of the action button.
|
|
19
|
+
*/
|
|
20
|
+
readonly installProgress?: PluginInstallProgress;
|
|
21
|
+
/**
|
|
22
|
+
* Callback that should be invoked when the user cancels an in-progress
|
|
23
|
+
* install/update from the progress bar.
|
|
24
|
+
*/
|
|
25
|
+
readonly cancelCallback: () => Promise<void>;
|
|
16
26
|
/**
|
|
17
27
|
* Callback that should be invoked when the user attempts to open any link displayed in this component.
|
|
18
28
|
*/
|
|
@@ -42,13 +52,21 @@ export type DocSectionData = {
|
|
|
42
52
|
name: string;
|
|
43
53
|
content: string;
|
|
44
54
|
};
|
|
55
|
+
export type PluginVersionOption = {
|
|
56
|
+
version: string;
|
|
57
|
+
versionId: number;
|
|
58
|
+
};
|
|
59
|
+
export type PluginInstallProgress = {
|
|
60
|
+
phase: "download" | "install";
|
|
61
|
+
percent: number;
|
|
62
|
+
};
|
|
45
63
|
export type PluginDetailsData = {
|
|
46
64
|
id: string;
|
|
47
65
|
name: string | LinkData;
|
|
48
66
|
publisher: string | LinkData;
|
|
49
67
|
installed: boolean;
|
|
50
68
|
updateVersion?: string;
|
|
51
|
-
versions:
|
|
69
|
+
versions: PluginVersionOption[];
|
|
52
70
|
iconUrl: string;
|
|
53
71
|
description: string;
|
|
54
72
|
docSections: DocSectionData[];
|
|
@@ -11,15 +11,18 @@ export declare class GxIdePluginManager {
|
|
|
11
11
|
*/
|
|
12
12
|
pluginsActionListModel: ActionListModel;
|
|
13
13
|
/**
|
|
14
|
-
* List of
|
|
14
|
+
* List of plugin groups to display. Each group is rendered as a native
|
|
15
|
+
* action-list group (with a separator between groups) and its header caption
|
|
16
|
+
* includes the total number of plugins in the group.
|
|
17
|
+
* Usually used to initialize the component.
|
|
15
18
|
*/
|
|
16
|
-
plugins:
|
|
17
|
-
pluginsChangedHandler(newPlugins:
|
|
19
|
+
plugins: PluginGroupData[];
|
|
20
|
+
pluginsChangedHandler(newPlugins: PluginGroupData[]): void;
|
|
18
21
|
/**
|
|
19
22
|
* Callback that should be invoked when the user updates the filter.
|
|
20
23
|
* A debounce should be applied before invoking this function.
|
|
21
24
|
*/
|
|
22
|
-
readonly filterCallback: (text: string) => Promise<
|
|
25
|
+
readonly filterCallback: (text: string) => Promise<PluginGroupData[]>;
|
|
23
26
|
/**
|
|
24
27
|
* Callback that should be invoked when the user clicks or presses Enter
|
|
25
28
|
* on a selected plugin item.
|
|
@@ -32,6 +35,23 @@ export declare class GxIdePluginManager {
|
|
|
32
35
|
componentWillLoad(): Promise<void>;
|
|
33
36
|
render(): any;
|
|
34
37
|
}
|
|
38
|
+
export type PluginGroupData = {
|
|
39
|
+
id: string;
|
|
40
|
+
/**
|
|
41
|
+
* Group header text. The total number of plugins in the group is appended
|
|
42
|
+
* automatically, e.g. "Installed (12)".
|
|
43
|
+
*/
|
|
44
|
+
caption: string;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the group can be collapsed/expanded. Defaults to `true`.
|
|
47
|
+
*/
|
|
48
|
+
expandable?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the group starts expanded. Defaults to `true`.
|
|
51
|
+
*/
|
|
52
|
+
expanded?: boolean;
|
|
53
|
+
plugins: PluginData[];
|
|
54
|
+
};
|
|
35
55
|
export type PluginData = {
|
|
36
56
|
id: string;
|
|
37
57
|
iconUrl: string;
|
|
@@ -39,5 +59,12 @@ export type PluginData = {
|
|
|
39
59
|
description: string;
|
|
40
60
|
publisher: string;
|
|
41
61
|
action?: PluginAction;
|
|
62
|
+
downloads?: number;
|
|
63
|
+
rating?: string | number;
|
|
64
|
+
installProgress?: PluginInstallProgress;
|
|
65
|
+
};
|
|
66
|
+
export type PluginInstallProgress = {
|
|
67
|
+
phase: "download" | "install";
|
|
68
|
+
percent: number;
|
|
42
69
|
};
|
|
43
70
|
export type PluginAction = "install" | "update";
|