@genexus/genexus-ide-ui 1.1.13 → 1.1.15
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-about.cjs.entry.js +29 -15
- package/dist/cjs/gx-ide-about.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-bpm-export-xpdl.cjs.entry.js +2 -2
- package/dist/cjs/gx-ide-bpm-export-xpdl.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-data-type-selector.cjs.entry.js +121 -40
- package/dist/cjs/gx-ide-data-type-selector.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/gx-ide-empty-state.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-file-uploader.cjs.entry.js +0 -13
- package/dist/cjs/gx-ide-file-uploader.cjs.entry.js.map +1 -1
- package/dist/cjs/gx-ide-plugin-details.cjs.entry.js +201 -0
- package/dist/cjs/gx-ide-plugin-details.cjs.entry.js.map +1 -0
- package/dist/cjs/gx-ide-plugin-explorer.cjs.entry.js +159 -0
- package/dist/cjs/gx-ide-plugin-explorer.cjs.entry.js.map +1 -0
- package/dist/cjs/gx-ide-sc-chat-container.cjs.entry.js +0 -1
- package/dist/cjs/gx-ide-sc-chat-container.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/_helpers/empty-state/gx-ide-empty-state.css +4 -0
- package/dist/collection/components/_helpers/empty-state/gx-ide-empty-state.js +1 -1
- package/dist/collection/components/_helpers/empty-state/gx-ide-empty-state.js.map +1 -1
- package/dist/collection/components/{_branding/about → about}/about.css +44 -15
- package/dist/collection/components/{_branding/about → about}/about.js +46 -62
- package/dist/collection/components/about/about.js.map +1 -0
- package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/langs/about.lang.en.json +3 -3
- package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/langs/about.lang.ja.json +3 -3
- package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/langs/about.lang.zh.json +3 -3
- package/dist/collection/components/bpm/export-xpdl/bpm-export-xpdl.js +2 -2
- package/dist/collection/components/bpm/export-xpdl/bpm-export-xpdl.js.map +1 -1
- package/dist/collection/components/data-type-selector/data-type-selector.css +1 -0
- package/dist/collection/components/data-type-selector/data-type-selector.js +165 -43
- package/dist/collection/components/data-type-selector/data-type-selector.js.map +1 -1
- package/dist/collection/components/data-type-selector/gx-ide-assets/data-type-selector/langs/data-type-selector.lang.en.json +1 -1
- package/dist/collection/components/data-type-selector/helpers.js +2 -0
- package/dist/collection/components/data-type-selector/helpers.js.map +1 -1
- package/dist/collection/components/file-uploader/file-uploader.js +0 -13
- package/dist/collection/components/file-uploader/file-uploader.js.map +1 -1
- package/dist/collection/components/plugin-details/gx-ide-assets/plugin-details/langs/plugin-details.lang.en.json +9 -0
- package/dist/collection/components/plugin-details/gx-ide-assets/plugin-details/langs/plugin-details.lang.ja.json +9 -0
- package/dist/collection/components/plugin-details/gx-ide-assets/plugin-details/langs/plugin-details.lang.zh.json +9 -0
- package/dist/collection/components/plugin-details/plugin-details.css +168 -0
- package/dist/collection/components/plugin-details/plugin-details.js +292 -0
- package/dist/collection/components/plugin-details/plugin-details.js.map +1 -0
- package/dist/collection/components/plugin-explorer/gx-ide-assets/plugin-explorer/images/plugin-icon.svg +10 -0
- package/dist/collection/components/plugin-explorer/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.en.json +10 -0
- package/dist/collection/components/plugin-explorer/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.ja.json +10 -0
- package/dist/collection/components/plugin-explorer/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.zh.json +10 -0
- package/dist/collection/components/plugin-explorer/plugin-explorer.css +106 -0
- package/dist/collection/components/plugin-explorer/plugin-explorer.js +263 -0
- package/dist/collection/components/plugin-explorer/plugin-explorer.js.map +1 -0
- package/dist/collection/components/team-dev/bring-changes/gx-ide-assets/team-dev-bring-changes/langs/team-dev-bring-changes.lang.ja.json +45 -45
- package/dist/collection/pages/assets/images/plugin/docker-iso.svg +12 -0
- package/dist/collection/showcase/chat-container/callbacks.js +0 -1
- package/dist/collection/showcase/chat-container/callbacks.js.map +1 -1
- package/dist/collection/testing/locale.e2e.js +2 -0
- package/dist/collection/testing/locale.e2e.js.map +1 -1
- package/dist/components/gx-ide-about.js +32 -19
- package/dist/components/gx-ide-about.js.map +1 -1
- package/dist/components/gx-ide-bpm-export-xpdl.js +2 -2
- package/dist/components/gx-ide-bpm-export-xpdl.js.map +1 -1
- package/dist/components/gx-ide-data-type-selector.js +126 -42
- package/dist/components/gx-ide-data-type-selector.js.map +1 -1
- package/dist/components/gx-ide-empty-state2.js +2 -2
- package/dist/components/gx-ide-empty-state2.js.map +1 -1
- package/dist/components/gx-ide-file-uploader.js +0 -13
- package/dist/components/gx-ide-file-uploader.js.map +1 -1
- package/dist/components/gx-ide-plugin-details.d.ts +11 -0
- package/dist/components/gx-ide-plugin-details.js +222 -0
- package/dist/components/gx-ide-plugin-details.js.map +1 -0
- package/dist/components/gx-ide-plugin-explorer.d.ts +11 -0
- package/dist/components/gx-ide-plugin-explorer.js +194 -0
- package/dist/components/gx-ide-plugin-explorer.js.map +1 -0
- package/dist/components/gx-ide-sc-chat-container.js +0 -1
- package/dist/components/gx-ide-sc-chat-container.js.map +1 -1
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-about.entry.js +29 -15
- package/dist/esm/gx-ide-about.entry.js.map +1 -1
- package/dist/esm/gx-ide-bpm-export-xpdl.entry.js +2 -2
- package/dist/esm/gx-ide-bpm-export-xpdl.entry.js.map +1 -1
- package/dist/esm/gx-ide-data-type-selector.entry.js +121 -40
- package/dist/esm/gx-ide-data-type-selector.entry.js.map +1 -1
- package/dist/esm/gx-ide-empty-state.entry.js +2 -2
- package/dist/esm/gx-ide-empty-state.entry.js.map +1 -1
- package/dist/esm/gx-ide-file-uploader.entry.js +0 -13
- package/dist/esm/gx-ide-file-uploader.entry.js.map +1 -1
- package/dist/esm/gx-ide-plugin-details.entry.js +197 -0
- package/dist/esm/gx-ide-plugin-details.entry.js.map +1 -0
- package/dist/esm/gx-ide-plugin-explorer.entry.js +155 -0
- package/dist/esm/gx-ide-plugin-explorer.entry.js.map +1 -0
- package/dist/esm/gx-ide-sc-chat-container.entry.js +0 -1
- package/dist/esm/gx-ide-sc-chat-container.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/about/langs/about.lang.en.json +3 -3
- package/dist/genexus-ide-ui/gx-ide-assets/about/langs/about.lang.ja.json +3 -3
- package/dist/genexus-ide-ui/gx-ide-assets/about/langs/about.lang.zh.json +3 -3
- package/dist/genexus-ide-ui/gx-ide-assets/data-type-selector/langs/data-type-selector.lang.en.json +1 -1
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-details/langs/plugin-details.lang.en.json +9 -0
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-details/langs/plugin-details.lang.ja.json +9 -0
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-details/langs/plugin-details.lang.zh.json +9 -0
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-explorer/images/plugin-icon.svg +10 -0
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.en.json +10 -0
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.ja.json +10 -0
- package/dist/genexus-ide-ui/gx-ide-assets/plugin-explorer/langs/plugin-explorer.lang.zh.json +10 -0
- package/dist/genexus-ide-ui/gx-ide-assets/team-dev-bring-changes/langs/team-dev-bring-changes.lang.ja.json +45 -45
- package/dist/genexus-ide-ui/{p-a47d71eb.entry.js → p-4328be14.entry.js} +7 -7
- package/dist/genexus-ide-ui/p-4328be14.entry.js.map +1 -0
- package/dist/genexus-ide-ui/p-476b74a1.entry.js +109 -0
- package/dist/genexus-ide-ui/p-476b74a1.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-6d996621.entry.js → p-4e6425f3.entry.js} +1 -2
- package/dist/genexus-ide-ui/p-4e6425f3.entry.js.map +1 -0
- package/dist/genexus-ide-ui/p-641c79a9.entry.js +198 -0
- package/dist/genexus-ide-ui/p-641c79a9.entry.js.map +1 -0
- package/dist/genexus-ide-ui/p-6b4fdf55.entry.js +344 -0
- package/dist/genexus-ide-ui/p-6b4fdf55.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-17dc4c9c.entry.js → p-7d7cf30d.entry.js} +35 -51
- package/dist/genexus-ide-ui/p-7d7cf30d.entry.js.map +1 -0
- package/dist/genexus-ide-ui/p-84c1c1bb.entry.js +270 -0
- package/dist/genexus-ide-ui/p-84c1c1bb.entry.js.map +1 -0
- package/dist/genexus-ide-ui/{p-844b7117.entry.js → p-86365635.entry.js} +3 -3
- package/dist/genexus-ide-ui/p-86365635.entry.js.map +1 -0
- package/dist/types/components/{_branding/about → about}/about.d.ts +6 -10
- package/dist/types/components/data-type-selector/data-type-selector.d.ts +16 -12
- package/dist/types/components/plugin-details/plugin-details.d.ts +55 -0
- package/dist/types/components/plugin-explorer/plugin-explorer.d.ts +43 -0
- package/dist/types/components.d.ts +126 -26
- package/package.json +1 -1
- package/dist/collection/components/_branding/about/about.js.map +0 -1
- package/dist/genexus-ide-ui/p-0550fd5f.entry.js +0 -96
- package/dist/genexus-ide-ui/p-0550fd5f.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-17dc4c9c.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-6d996621.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-844b7117.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-a47d71eb.entry.js.map +0 -1
- package/dist/genexus-ide-ui/p-ca6eb9fd.entry.js +0 -255
- package/dist/genexus-ide-ui/p-ca6eb9fd.entry.js.map +0 -1
- /package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/images/copyrights-illustration.png +0 -0
- /package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/images/next-arrow.svg +0 -0
- /package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/images/next-logo.svg +0 -0
- /package/dist/collection/components/{_branding/about → about}/gx-ide-assets/about/images/next-square.svg +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gx-ide-file-uploader.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,eAAe,GAAG,ulcAAulc;;;;;;;;;;;;;;;;;;;ACiB/mc,MAAM,SAAS,GAAGA,0BAAW,CAAC;IAC5B,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,KAAK;IACX,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,qBAAqB;IACrB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,qBAAqB;CACtB,CAAC;MAaW,YAAY;;;;QACvB,iDAAuB;QACvB,4CAAgC;QAiEhC,oCAAe,CAAC,EAAC;;QAQjB,mCAAc;YACZ,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAChD,EAAC;;QAwDF,wCAAmB,CAAC,CAAY;;YAC9B,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,yDAAA,iEAAiB,EAAjB,IAAmB,IAAA,OAAA,CAAC;YACpB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;SACxB,EAAC;;QAGF,wCAAmB,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I,EAAE,EAAE;YAClE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;SAC1B;KACF;IAED,OAAO;QACL,OAAO,EAAE,KAAK;QACd,KAAK,EACH,CAAA,MAAA,MAAA,uBAAA,IAAI,sCAAkB,0CAAE,MAAM,0CAAE,eAAe,KAAI,mBAAmB;KACzE,CAAC;AACJ,CAAC,qEAGc,KAAe;IAC5B,MAAM,UAAU,GAAW,EAAE,CAAC;IAE9B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI;;QAC5B,MAAM,UAAU,GAAG,uBAAA,IAAI,0DAAa,MAAjB,IAAI,EAAc,IAAI,CAAC,CAAC;QAC3C,IAAI,UAAU,CAAC,OAAO,EAAE;YACtB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACvB;aAAM;YACL,MAAA,IAAI,CAAC,2BAA2B,qDAAG;gBACjC,QAAQ,EAAE,IAAI,CAAC,IAAI;gBACnB,KAAK,EAAE,UAAU,CAAC,KAAK;aACxB,CAAC,CAAC;SACJ;KACF,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC;;;;;","names":["getIconPath","Locale","h","Host"],"sources":["src/components/file-uploader/file-uploader.scss?tag=gx-ide-file-uploader&encapsulation=shadow","src/components/file-uploader/file-uploader.tsx"],"sourcesContent":["@import \"../../global/gx-ide-common.scss\";\n@import \"../../global/gx-ide-mixins.scss\";\n@import \"../../../node_modules/@genexus/mercury/dist/assets/scss/helpers.scss\";\n\n:host {\n display: block;\n inline-size: 100%;\n block-size: 100%;\n padding-inline-end: 0 !important;\n}\n\n.file-uploader-dialog {\n display: flex;\n flex-direction: column;\n block-size: 100%;\n background-color: var(--mer-surface__background);\n position: relative;\n\n .dialog-content {\n flex: 1;\n min-block-size: 0;\n overflow: auto;\n }\n\n .dialog-footer {\n padding-inline-end: var(--spacing-body-inline-end);\n }\n}\n\n.file-uploader {\n display: flex;\n flex-direction: column;\n inline-size: 100%;\n block-size: 100%;\n\n &__list {\n display: flex;\n flex-direction: column;\n inline-size: 100%;\n block-size: 100%;\n\n &-header {\n position: sticky;\n top: 0;\n z-index: 1;\n background-color: var(--mer-surface__elevation--01);\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-inline-end: var(--spacing-body-inline-end);\n }\n\n &-content {\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--xs);\n padding-inline-end: var(--spacing-body-inline-end);\n padding-block-end: var(--mer-spacing--md);\n }\n }\n\n &__list-title-container {\n display: flex;\n align-items: center;\n gap: var(--mer-spacing--2xs);\n white-space: nowrap;\n }\n\n &__drop-zone {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n inline-size: calc(100% - var(--spacing-body-inline-end));\n block-size: calc(100% - var(--mer-spacing--sm));\n min-block-size: 200px;\n margin-block-end: var(--mer-spacing--sm);\n background: var(--mer-surface__elevation--01);\n border: var(--mer-border__width--md) dashed var(--mer-border-color__dim);\n border-radius: var(--mer-border__radius--md);\n transition: border-color 0.3s ease, background-color 0.3s ease,\n opacity 0.3s ease;\n\n &--dragging {\n border-color: var(--mer-accent__primary);\n background: var(--mer-accent__primary--hover);\n opacity: 0.7;\n }\n\n .text-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--mer-spacing--2xs);\n margin-block-start: var(--mer-spacing--xs);\n }\n }\n}\n\n.hidden-input {\n display: none;\n}\n\n.label-primary-row {\n display: flex;\n align-items: center;\n gap: var(--mer-spacing--xs);\n}\n","/* eslint-disable @stencil-community/own-methods-must-be-private */\n/* eslint-disable @stencil-community/own-props-must-be-private */\n/* STENCIL IMPORTS */\nimport {\n Component,\n Host,\n h,\n Prop,\n Element,\n State,\n Method\n} from \"@stencil/core\";\n\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport { Locale } from \"../../common/locale\";\nimport { UploadedFile, FileUploadState, UploadResult } from \"./types\";\n\nconst PLUS_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"add\",\n colorType: \"primary\"\n});\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/button\",\n \"components/icon\",\n \"components/list-box\",\n \"components/edit\",\n \"utils/typography\",\n \"utils/spacing\",\n \"utils/form\",\n \"utils/layout\",\n \"utils/elevation\",\n \"chameleon/scrollbar\"\n];\n\ntype FileValidationResult = {\n isValid: boolean;\n error?: string;\n};\n\n@Component({\n tag: \"gx-ide-file-uploader\",\n styleUrl: \"file-uploader.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/file-uploader\"]\n})\nexport class FileUploader {\n #_componentLocale: any;\n #fileInputEl!: HTMLInputElement;\n\n @Element() el!: HTMLGxIdeFileUploaderElement;\n\n /** Allowed file types/extensions (e.g. ['.jpg', '.png', 'image/*', 'application/pdf']) */\n @Prop() readonly types?: string[] = [];\n\n /** Whether multiple files can be selected */\n @Prop() readonly multiple: boolean = false;\n\n /** Whether file names can be edited */\n @Prop() readonly canEditName: boolean = false;\n\n /** Label to display in the uploader dialog */\n @Prop() readonly label?: string;\n\n /** Function to handle file upload */\n @Prop() readonly uploadFunction!: (\n file: File,\n progressCallback: (progress: number) => void\n ) => Promise<UploadResult>;\n\n /** Function to cancel file upload */\n @Prop() readonly cancelUploadFunction?: (fileId: string) => Promise<void>;\n\n /** Callback when a file is uploaded successfully */\n @Prop() readonly fileUploadedCallback?: (file: UploadedFile) => Promise<void>;\n\n /** Callback when the dialog is canceled */\n @Prop() readonly dialogCanceledCallback?: () => Promise<void>;\n\n /** Callback when the dialog is confirmed with files */\n @Prop() readonly dialogConfirmedCallback?: (\n files: UploadedFile[]\n ) => Promise<void>;\n\n /** Callback when upload is cancelled */\n @Prop() readonly uploadCancelledCallback?: (fileId: string) => Promise<void>;\n\n /** Callback when file is renamed */\n @Prop() readonly fileRenamedCallback?: (data: {\n fileId: string;\n newName: string;\n }) => Promise<void>;\n\n /** Callback when a file validation error occurs */\n @Prop() readonly fileValidationErrorCallback?: (data: {\n fileName: string;\n error: string;\n }) => Promise<void>;\n\n /** Callback when a file deletion error occurs */\n @Prop() readonly fileDeletionErrorCallback?: (data: {\n fileName: string;\n error: string;\n }) => Promise<void>;\n\n /** Callback when a file is deleted */\n @Prop() readonly fileDeletedCallback?: (file: UploadedFile) => Promise<void>;\n\n /** Callback before deleting a file to get confirmation */\n @Prop() readonly onBeforeDelete?: (file: UploadedFile) => Promise<boolean>;\n\n @State() private fileStates: Map<string, FileUploadState> = new Map();\n @State() private isDragging: boolean = false;\n #dragCounter = 0;\n\n /** Initializes component with locale strings */\n async componentWillLoad() {\n this.#_componentLocale = await Locale.getComponentStrings(this.el);\n }\n\n /** Generates a unique ID for file identification */\n #generateId = (): string => {\n return Math.random().toString(36).substr(2, 9);\n };\n\n /** Validates if a file matches the allowed types */\n #isValidFile(file: File): FileValidationResult {\n // If no types specified, accept any file\n if (!this.types || this.types.length === 0) {\n return { isValid: true };\n }\n\n for (const type of this.types) {\n // Handle wildcards like 'image/*'\n if (type.includes(\"/*\")) {\n const baseType = type.split(\"/\")[0];\n if (file.type.startsWith(baseType)) {\n return { isValid: true };\n }\n }\n // Handle extensions like '.jpg'\n else if (type.startsWith(\".\")) {\n if (file.name.toLowerCase().endsWith(type.toLowerCase())) {\n return { isValid: true };\n }\n }\n // Handle specific MIME types\n else if (file.type === type || file.type === `application/${type}`) {\n return { isValid: true };\n }\n }\n\n return {\n isValid: false,\n error:\n this.#_componentLocale?.errors?.invalidFileType || \"Invalid file type\"\n };\n }\n\n /** Filters valid files from a FileList */\n #getValidFiles(files: FileList): File[] {\n const validFiles: File[] = [];\n\n Array.from(files).forEach(file => {\n const validation = this.#isValidFile(file);\n if (validation.isValid) {\n validFiles.push(file);\n } else {\n this.fileValidationErrorCallback?.({\n fileName: file.name,\n error: validation.error\n });\n }\n });\n\n return validFiles;\n }\n\n /** Handles drag enter event */\n #handleDragEnter = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.#dragCounter++;\n this.isDragging = true;\n };\n\n /** Handles drag leave event */\n #handleDragLeave = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.#dragCounter--;\n if (this.#dragCounter === 0) {\n this.isDragging = false;\n }\n };\n\n /** Handles drag over event */\n #handleDragOver = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n };\n\n /** Handles drop event */\n #handleDrop = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.isDragging = false;\n this.#dragCounter = 0;\n\n const files = e.dataTransfer?.files;\n if (files) {\n this.#handleFiles(files);\n }\n };\n\n /** Triggers file input click */\n #handleFileSelect = () => {\n this.#fileInputEl?.click();\n };\n\n /** Handles file input change event */\n #handleFileInput = (e: Event) => {\n const files = (e.target as HTMLInputElement).files;\n if (files) {\n this.#handleFiles(files);\n }\n };\n\n /** Processes files and starts upload */\n #handleFiles = (files: FileList) => {\n const validFiles: File[] = this.#getValidFiles(files);\n\n validFiles.forEach(async file => {\n const id = this.#generateId();\n const fileState: FileUploadState = {\n id,\n name: file.name,\n file,\n pending: true,\n progress: 0\n };\n\n if (!this.multiple) {\n this.fileStates.clear();\n }\n\n this.fileStates = new Map(this.fileStates.set(id, fileState));\n\n if (this.uploadFunction) {\n try {\n const uploadPromise = this.uploadFunction(file, progress => {\n const state = this.fileStates.get(id);\n if (state) {\n const updatedState = {\n ...state,\n progress: progress,\n pending: progress < 100\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n }\n });\n\n // Store the upload promise/object for potential cancellation\n const stateWithPromise = {\n ...this.fileStates.get(id),\n uploadPromise\n };\n this.fileStates = new Map(this.fileStates.set(id, stateWithPromise));\n\n const result = await uploadPromise;\n console.log(\"Upload result:\", { id, result });\n\n const state = this.fileStates.get(id);\n if (state) {\n if (result.success && result.remoteId) {\n const updatedState = {\n ...state,\n remoteId: result.remoteId,\n pending: false,\n progress: 100\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n console.log(\"File uploaded successfully:\", updatedState);\n await this.fileUploadedCallback?.({\n name: state.name,\n originalName: state.file.name,\n remoteId: result.remoteId\n });\n } else {\n const updatedState = {\n ...state,\n error: result.errors?.upload || \"Upload failed\",\n pending: false\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n console.log(\"File upload failed:\", updatedState);\n }\n }\n } catch (error) {\n const state = this.fileStates.get(id);\n if (state) {\n const updatedState = {\n ...state,\n error:\n error instanceof Error\n ? error.message\n : \"Unknown error occurred\",\n pending: false\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n console.log(\"File upload error:\", updatedState);\n }\n }\n }\n });\n\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n };\n\n /** Handles file name change */\n #handleNameChange = async (\n event: CustomEvent<{ id: string; name: string }>\n ) => {\n const { id, name } = event.detail;\n const file = this.fileStates.get(id);\n\n if (file) {\n const updatedFile = {\n ...file,\n name: name.trim(),\n isEditing: false\n };\n\n this.fileStates = new Map(this.fileStates.set(id, updatedFile));\n await this.fileRenamedCallback?.({ fileId: id, newName: name.trim() });\n }\n };\n\n /** Handles individual file cancellation or deletion */\n #handleFileCancel = async (event: CustomEvent<string>) => {\n const id = event.detail;\n const state = this.fileStates.get(id);\n if (state) {\n try {\n if (state.pending) {\n // Cancel upload in progress\n if (\n state.uploadPromise &&\n typeof state.uploadPromise.cancel === \"function\"\n ) {\n state.uploadPromise.cancel();\n } else if (this.cancelUploadFunction) {\n await this.cancelUploadFunction(id);\n }\n\n await this.uploadCancelledCallback?.(id);\n\n this.fileStates.delete(id);\n this.fileStates = new Map(this.fileStates);\n } else {\n const fileToDelete: UploadedFile = {\n name: state.name,\n originalName: state.file.name,\n remoteId: state.remoteId\n };\n\n const shouldDelete = await this.onBeforeDelete?.(fileToDelete);\n\n if (shouldDelete) {\n await this.fileDeletedCallback?.(fileToDelete);\n this.fileStates.delete(id);\n this.fileStates = new Map(this.fileStates);\n }\n }\n } catch (error) {\n await this.fileDeletionErrorCallback?.({\n fileName: state.name,\n error:\n error instanceof Error ? error.message : \"Unknown error occurred\"\n });\n }\n }\n };\n\n /** Handles dialog confirmation */\n #handleConfirm = async () => {\n // Verificar si hay subidas en progreso\n const hasPendingUploads = Array.from(this.fileStates.values()).some(\n file => file.pending\n );\n\n if (hasPendingUploads) {\n return; // No permitir confirmar si hay subidas en progreso\n }\n\n // Obtener todos los archivos que están completamente subidos\n const uploadedFiles: UploadedFile[] = Array.from(this.fileStates.values())\n .filter(file => {\n const isValid = !file.pending && file.remoteId && !file.error;\n console.log(\"File validation:\", {\n id: file.id,\n name: file.name,\n pending: file.pending,\n remoteId: file.remoteId,\n error: file.error,\n isValid\n });\n return isValid;\n })\n .map(file => ({\n name: file.name,\n originalName: file.file.name,\n remoteId: file.remoteId as string\n }));\n\n console.log(\"Files to be confirmed:\", uploadedFiles);\n\n if (uploadedFiles.length > 0) {\n await this.dialogConfirmedCallback?.(uploadedFiles);\n }\n\n // Clear file states\n this.fileStates.clear();\n this.fileStates = new Map();\n\n // Reset file input\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n };\n\n /** Handles dialog cancellation */\n #handleCancel = async () => {\n try {\n // Cancelamos todas las subidas en progreso\n for (const [id, state] of this.fileStates.entries()) {\n if (state.pending && this.cancelUploadFunction) {\n try {\n await this.cancelUploadFunction(id);\n await this.uploadCancelledCallback?.(id);\n } catch (error) {\n // Error handling for upload cancellation\n }\n }\n }\n\n // Limpiamos todos los estados\n this.fileStates.clear();\n this.fileStates = new Map();\n\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n\n await this.dialogCanceledCallback?.();\n } catch (error) {\n this.fileStates.clear();\n this.fileStates = new Map();\n await this.dialogCanceledCallback?.();\n }\n };\n\n /** Clears the current file selection */\n @Method()\n async clear() {\n for (const [id, state] of this.fileStates.entries()) {\n if (state.pending && this.cancelUploadFunction) {\n try {\n await this.cancelUploadFunction(id);\n await this.uploadCancelledCallback?.(id);\n } catch (error) {\n // Error handling for upload cancellation\n }\n }\n }\n this.fileStates.clear();\n }\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <input\n type=\"file\"\n class=\"hidden-input\"\n multiple={this.multiple}\n accept={this.types\n ?.map(type => (type.startsWith(\".\") ? type : `.${type}`))\n .join(\",\")}\n onChange={this.#handleFileInput}\n ref={el => (this.#fileInputEl = el as HTMLInputElement)}\n aria-hidden=\"true\"\n tabIndex={-1}\n style={{ display: \"none\" }}\n />\n <div class=\"file-uploader-dialog\">\n <div class=\"dialog-content\">\n {this.isDragging || this.fileStates.size === 0 ? (\n <div\n class={{\n \"file-uploader__drop-zone\": true,\n \"file-uploader__drop-zone--dragging\": this.isDragging\n }}\n onDragEnter={this.#handleDragEnter}\n onDragLeave={this.#handleDragLeave}\n onDragOver={this.#handleDragOver}\n onDrop={this.#handleDrop}\n >\n <button\n class=\"button-tertiary button-icon-and-text\"\n type=\"button\"\n onClick={this.#handleFileSelect}\n >\n <ch-image class=\"icon-md\" src={PLUS_ICON}></ch-image>\n <label class=\"label\">\n {this.multiple\n ? this.#_componentLocale?.header.uploadButtonMultiple\n : this.#_componentLocale?.header.uploadButtonSingle}\n </label>\n </button>\n <div class=\"text-container\">\n <div class=\"label-primary-row\">\n <label class=\"label\">\n {this.label || this.#_componentLocale?.header.orText}\n </label>\n <label class=\"label\">\n {this.#_componentLocale?.header.dragAndDrop}\n </label>\n </div>\n <span class=\"caption\">\n {this.types && this.types.length > 0\n ? this.#_componentLocale?.header.acceptedFiles.replace(\n \"{0}\",\n this.types.join(\", \")\n )\n : this.#_componentLocale?.header.allFilesAccepted}\n </span>\n </div>\n </div>\n ) : (\n <div class=\"file-uploader__list\">\n <div class=\"file-uploader__list-header spacing-body-block-end\">\n <div class=\"file-uploader__list-title-container\">\n <label class=\"label\">\n {this.label ||\n this.#_componentLocale?.fileList.attachedFiles}\n </label>\n <span class=\"caption\">\n {this.#_componentLocale?.fileList.filesCount.replace(\n \"{0}\",\n this.fileStates.size.toString()\n )}\n </span>\n </div>\n {this.multiple && (\n <button\n class=\"button-tertiary button-icon-and-text\"\n type=\"button\"\n onClick={this.#handleFileSelect}\n >\n <ch-image class=\"icon-md\" src={PLUS_ICON}></ch-image>\n <label class=\"label\">\n {this.multiple\n ? this.#_componentLocale?.header.uploadButtonMultiple\n : this.#_componentLocale?.header.uploadButtonSingle}\n </label>\n </button>\n )}\n </div>\n <div class=\"file-uploader__list-content scrollable\">\n {Array.from(this.fileStates.values()).map(file => (\n <gx-ide-file-item\n key={file.id}\n file={file}\n editable={this.canEditName}\n onFileNameChange={this.#handleNameChange}\n onFileDelete={this.#handleFileCancel}\n onFileCancel={this.#handleFileCancel}\n />\n ))}\n </div>\n </div>\n )}\n </div>\n <div class=\"dialog-footer control-footer control-footer-with-border\">\n <div class=\"buttons-spacer\">\n <button\n class=\"button-secondary\"\n type=\"button\"\n onClick={this.#handleCancel}\n >\n {this.#_componentLocale?.buttons.cancel}\n </button>\n <button\n class=\"button-primary\"\n type=\"button\"\n onClick={this.#handleConfirm}\n disabled={\n this.fileStates.size === 0 ||\n Array.from(this.fileStates.values()).some(\n file => file.pending\n )\n }\n >\n {this.#_componentLocale?.buttons.confirm}\n </button>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"gx-ide-file-uploader.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,eAAe,GAAG,ulcAAulc;;;;;;;;;;;;;;;;;;;ACiB/mc,MAAM,SAAS,GAAGA,0BAAW,CAAC;IAC5B,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,KAAK;IACX,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,qBAAqB;IACrB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,qBAAqB;CACtB,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,sCAAkB,0CAAE,MAAM,0CAAE,eAAe,KAAI,mBAAmB;KACzE,CAAC;AACJ,CAAC,qEAGc,KAAe;IAC5B,MAAM,UAAU,GAAW,EAAE,CAAC;IAE9B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI;;QAC5B,MAAM,UAAU,GAAG,uBAAA,IAAI,0DAAa,MAAjB,IAAI,EAAc,IAAI,CAAC,CAAC;QAC3C,IAAI,UAAU,CAAC,OAAO,EAAE;YACtB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACvB;aAAM;YACL,MAAA,IAAI,CAAC,2BAA2B,qDAAG;gBACjC,QAAQ,EAAE,IAAI,CAAC,IAAI;gBACnB,KAAK,EAAE,UAAU,CAAC,KAAK;aACxB,CAAC,CAAC;SACJ;KACF,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC;;;;;","names":["getIconPath","Locale","h","Host"],"sources":["src/components/file-uploader/file-uploader.scss?tag=gx-ide-file-uploader&encapsulation=shadow","src/components/file-uploader/file-uploader.tsx"],"sourcesContent":["@import \"../../global/gx-ide-common.scss\";\n@import \"../../global/gx-ide-mixins.scss\";\n@import \"../../../node_modules/@genexus/mercury/dist/assets/scss/helpers.scss\";\n\n:host {\n display: block;\n inline-size: 100%;\n block-size: 100%;\n padding-inline-end: 0 !important;\n}\n\n.file-uploader-dialog {\n display: flex;\n flex-direction: column;\n block-size: 100%;\n background-color: var(--mer-surface__background);\n position: relative;\n\n .dialog-content {\n flex: 1;\n min-block-size: 0;\n overflow: auto;\n }\n\n .dialog-footer {\n padding-inline-end: var(--spacing-body-inline-end);\n }\n}\n\n.file-uploader {\n display: flex;\n flex-direction: column;\n inline-size: 100%;\n block-size: 100%;\n\n &__list {\n display: flex;\n flex-direction: column;\n inline-size: 100%;\n block-size: 100%;\n\n &-header {\n position: sticky;\n top: 0;\n z-index: 1;\n background-color: var(--mer-surface__elevation--01);\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-inline-end: var(--spacing-body-inline-end);\n }\n\n &-content {\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--xs);\n padding-inline-end: var(--spacing-body-inline-end);\n padding-block-end: var(--mer-spacing--md);\n }\n }\n\n &__list-title-container {\n display: flex;\n align-items: center;\n gap: var(--mer-spacing--2xs);\n white-space: nowrap;\n }\n\n &__drop-zone {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n inline-size: calc(100% - var(--spacing-body-inline-end));\n block-size: calc(100% - var(--mer-spacing--sm));\n min-block-size: 200px;\n margin-block-end: var(--mer-spacing--sm);\n background: var(--mer-surface__elevation--01);\n border: var(--mer-border__width--md) dashed var(--mer-border-color__dim);\n border-radius: var(--mer-border__radius--md);\n transition: border-color 0.3s ease, background-color 0.3s ease,\n opacity 0.3s ease;\n\n &--dragging {\n border-color: var(--mer-accent__primary);\n background: var(--mer-accent__primary--hover);\n opacity: 0.7;\n }\n\n .text-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--mer-spacing--2xs);\n margin-block-start: var(--mer-spacing--xs);\n }\n }\n}\n\n.hidden-input {\n display: none;\n}\n\n.label-primary-row {\n display: flex;\n align-items: center;\n gap: var(--mer-spacing--xs);\n}\n","/* eslint-disable @stencil-community/own-methods-must-be-private */\n/* eslint-disable @stencil-community/own-props-must-be-private */\n/* STENCIL IMPORTS */\nimport {\n Component,\n Host,\n h,\n Prop,\n Element,\n State,\n Method\n} from \"@stencil/core\";\n\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport { Locale } from \"../../common/locale\";\nimport { UploadedFile, FileUploadState, UploadResult } from \"./types\";\n\nconst PLUS_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"add\",\n colorType: \"primary\"\n});\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/button\",\n \"components/icon\",\n \"components/list-box\",\n \"components/edit\",\n \"utils/typography\",\n \"utils/spacing\",\n \"utils/form\",\n \"utils/layout\",\n \"utils/elevation\",\n \"chameleon/scrollbar\"\n];\n\ntype FileValidationResult = {\n isValid: boolean;\n error?: string;\n};\n\n@Component({\n tag: \"gx-ide-file-uploader\",\n styleUrl: \"file-uploader.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/file-uploader\"]\n})\nexport class FileUploader {\n #_componentLocale: any;\n #fileInputEl!: HTMLInputElement;\n\n @Element() el!: HTMLGxIdeFileUploaderElement;\n\n /** Allowed file types/extensions (e.g. ['.jpg', '.png', 'image/*', 'application/pdf']) */\n @Prop() readonly types?: string[] = [];\n\n /** Whether multiple files can be selected */\n @Prop() readonly multiple: boolean = false;\n\n /** Whether file names can be edited */\n @Prop() readonly canEditName: boolean = false;\n\n /** Label to display in the uploader dialog */\n @Prop() readonly label?: string;\n\n /** Function to handle file upload */\n @Prop() readonly uploadFunction!: (\n file: File,\n progressCallback: (progress: number) => void\n ) => Promise<UploadResult>;\n\n /** Function to cancel file upload */\n @Prop() readonly cancelUploadFunction?: (fileId: string) => Promise<void>;\n\n /** Callback when a file is uploaded successfully */\n @Prop() readonly fileUploadedCallback?: (file: UploadedFile) => Promise<void>;\n\n /** Callback when the dialog is canceled */\n @Prop() readonly dialogCanceledCallback?: () => Promise<void>;\n\n /** Callback when the dialog is confirmed with files */\n @Prop() readonly dialogConfirmedCallback?: (\n files: UploadedFile[]\n ) => Promise<void>;\n\n /** Callback when upload is cancelled */\n @Prop() readonly uploadCancelledCallback?: (fileId: string) => Promise<void>;\n\n /** Callback when file is renamed */\n @Prop() readonly fileRenamedCallback?: (data: {\n fileId: string;\n newName: string;\n }) => Promise<void>;\n\n /** Callback when a file validation error occurs */\n @Prop() readonly fileValidationErrorCallback?: (data: {\n fileName: string;\n error: string;\n }) => Promise<void>;\n\n /** Callback when a file deletion error occurs */\n @Prop() readonly fileDeletionErrorCallback?: (data: {\n fileName: string;\n error: string;\n }) => Promise<void>;\n\n /** Callback when a file is deleted */\n @Prop() readonly fileDeletedCallback?: (file: UploadedFile) => Promise<void>;\n\n /** Callback before deleting a file to get confirmation */\n @Prop() readonly onBeforeDelete?: (file: UploadedFile) => Promise<boolean>;\n\n @State() private fileStates: Map<string, FileUploadState> = new Map();\n @State() private isDragging: boolean = false;\n #dragCounter = 0;\n\n /** Initializes component with locale strings */\n async componentWillLoad() {\n this.#_componentLocale = await Locale.getComponentStrings(this.el);\n }\n\n /** Generates a unique ID for file identification */\n #generateId = (): string => {\n return Math.random().toString(36).substr(2, 9);\n };\n\n /** Validates if a file matches the allowed types */\n #isValidFile(file: File): FileValidationResult {\n // If no types specified, accept any file\n if (!this.types || this.types.length === 0) {\n return { isValid: true };\n }\n\n for (const type of this.types) {\n // Handle wildcards like 'image/*'\n if (type.includes(\"/*\")) {\n const baseType = type.split(\"/\")[0];\n if (file.type.startsWith(baseType)) {\n return { isValid: true };\n }\n }\n // Handle extensions like '.jpg'\n else if (type.startsWith(\".\")) {\n if (file.name.toLowerCase().endsWith(type.toLowerCase())) {\n return { isValid: true };\n }\n }\n // Handle specific MIME types\n else if (file.type === type || file.type === `application/${type}`) {\n return { isValid: true };\n }\n }\n\n return {\n isValid: false,\n error:\n this.#_componentLocale?.errors?.invalidFileType || \"Invalid file type\"\n };\n }\n\n /** Filters valid files from a FileList */\n #getValidFiles(files: FileList): File[] {\n const validFiles: File[] = [];\n\n Array.from(files).forEach(file => {\n const validation = this.#isValidFile(file);\n if (validation.isValid) {\n validFiles.push(file);\n } else {\n this.fileValidationErrorCallback?.({\n fileName: file.name,\n error: validation.error\n });\n }\n });\n\n return validFiles;\n }\n\n /** Handles drag enter event */\n #handleDragEnter = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.#dragCounter++;\n this.isDragging = true;\n };\n\n /** Handles drag leave event */\n #handleDragLeave = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.#dragCounter--;\n if (this.#dragCounter === 0) {\n this.isDragging = false;\n }\n };\n\n /** Handles drag over event */\n #handleDragOver = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n };\n\n /** Handles drop event */\n #handleDrop = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.isDragging = false;\n this.#dragCounter = 0;\n\n const files = e.dataTransfer?.files;\n if (files) {\n this.#handleFiles(files);\n }\n };\n\n /** Triggers file input click */\n #handleFileSelect = () => {\n this.#fileInputEl?.click();\n };\n\n /** Handles file input change event */\n #handleFileInput = (e: Event) => {\n const files = (e.target as HTMLInputElement).files;\n if (files) {\n this.#handleFiles(files);\n }\n };\n\n /** Processes files and starts upload */\n #handleFiles = (files: FileList) => {\n const validFiles: File[] = this.#getValidFiles(files);\n\n validFiles.forEach(async file => {\n const id = this.#generateId();\n const fileState: FileUploadState = {\n id,\n name: file.name,\n file,\n pending: true,\n progress: 0\n };\n\n if (!this.multiple) {\n this.fileStates.clear();\n }\n\n this.fileStates = new Map(this.fileStates.set(id, fileState));\n\n if (this.uploadFunction) {\n try {\n const uploadPromise = this.uploadFunction(file, progress => {\n const state = this.fileStates.get(id);\n if (state) {\n const updatedState = {\n ...state,\n progress: progress,\n pending: progress < 100\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n }\n });\n\n // Store the upload promise/object for potential cancellation\n const stateWithPromise = {\n ...this.fileStates.get(id),\n uploadPromise\n };\n this.fileStates = new Map(this.fileStates.set(id, stateWithPromise));\n\n const result = await uploadPromise;\n\n const state = this.fileStates.get(id);\n if (state) {\n if (result.success && result.remoteId) {\n const updatedState = {\n ...state,\n remoteId: result.remoteId,\n pending: false,\n progress: 100\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n\n await this.fileUploadedCallback?.({\n name: state.name,\n originalName: state.file.name,\n remoteId: result.remoteId\n });\n } else {\n const updatedState = {\n ...state,\n error: result.errors?.upload || \"Upload failed\",\n pending: false\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n }\n }\n } catch (error) {\n const state = this.fileStates.get(id);\n if (state) {\n const updatedState = {\n ...state,\n error:\n error instanceof Error\n ? error.message\n : \"Unknown error occurred\",\n pending: false\n };\n this.fileStates = new Map(this.fileStates.set(id, updatedState));\n }\n }\n }\n });\n\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n };\n\n /** Handles file name change */\n #handleNameChange = async (\n event: CustomEvent<{ id: string; name: string }>\n ) => {\n const { id, name } = event.detail;\n const file = this.fileStates.get(id);\n\n if (file) {\n const updatedFile = {\n ...file,\n name: name.trim(),\n isEditing: false\n };\n\n this.fileStates = new Map(this.fileStates.set(id, updatedFile));\n await this.fileRenamedCallback?.({ fileId: id, newName: name.trim() });\n }\n };\n\n /** Handles individual file cancellation or deletion */\n #handleFileCancel = async (event: CustomEvent<string>) => {\n const id = event.detail;\n const state = this.fileStates.get(id);\n if (state) {\n try {\n if (state.pending) {\n // Cancel upload in progress\n if (\n state.uploadPromise &&\n typeof state.uploadPromise.cancel === \"function\"\n ) {\n state.uploadPromise.cancel();\n } else if (this.cancelUploadFunction) {\n await this.cancelUploadFunction(id);\n }\n\n await this.uploadCancelledCallback?.(id);\n\n this.fileStates.delete(id);\n this.fileStates = new Map(this.fileStates);\n } else {\n const fileToDelete: UploadedFile = {\n name: state.name,\n originalName: state.file.name,\n remoteId: state.remoteId\n };\n\n const shouldDelete = await this.onBeforeDelete?.(fileToDelete);\n\n if (shouldDelete) {\n await this.fileDeletedCallback?.(fileToDelete);\n this.fileStates.delete(id);\n this.fileStates = new Map(this.fileStates);\n }\n }\n } catch (error) {\n await this.fileDeletionErrorCallback?.({\n fileName: state.name,\n error:\n error instanceof Error ? error.message : \"Unknown error occurred\"\n });\n }\n }\n };\n\n /** Handles dialog confirmation */\n #handleConfirm = async () => {\n // Verificar si hay subidas en progreso\n const hasPendingUploads = Array.from(this.fileStates.values()).some(\n file => file.pending\n );\n\n if (hasPendingUploads) {\n return; // No permitir confirmar si hay subidas en progreso\n }\n\n // Obtener todos los archivos que están completamente subidos\n const uploadedFiles: UploadedFile[] = Array.from(this.fileStates.values())\n .filter(file => {\n const isValid = !file.pending && file.remoteId && !file.error;\n return isValid;\n })\n .map(file => ({\n name: file.name,\n originalName: file.file.name,\n remoteId: file.remoteId as string\n }));\n\n if (uploadedFiles.length > 0) {\n await this.dialogConfirmedCallback?.(uploadedFiles);\n }\n\n // Clear file states\n this.fileStates.clear();\n this.fileStates = new Map();\n\n // Reset file input\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n };\n\n /** Handles dialog cancellation */\n #handleCancel = async () => {\n try {\n // Cancelamos todas las subidas en progreso\n for (const [id, state] of this.fileStates.entries()) {\n if (state.pending && this.cancelUploadFunction) {\n try {\n await this.cancelUploadFunction(id);\n await this.uploadCancelledCallback?.(id);\n } catch (error) {\n // Error handling for upload cancellation\n }\n }\n }\n\n // Limpiamos todos los estados\n this.fileStates.clear();\n this.fileStates = new Map();\n\n if (this.#fileInputEl) {\n this.#fileInputEl.value = \"\";\n }\n\n await this.dialogCanceledCallback?.();\n } catch (error) {\n this.fileStates.clear();\n this.fileStates = new Map();\n await this.dialogCanceledCallback?.();\n }\n };\n\n /** Clears the current file selection */\n @Method()\n async clear() {\n for (const [id, state] of this.fileStates.entries()) {\n if (state.pending && this.cancelUploadFunction) {\n try {\n await this.cancelUploadFunction(id);\n await this.uploadCancelledCallback?.(id);\n } catch (error) {\n // Error handling for upload cancellation\n }\n }\n }\n this.fileStates.clear();\n }\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <input\n type=\"file\"\n class=\"hidden-input\"\n multiple={this.multiple}\n accept={this.types\n ?.map(type => (type.startsWith(\".\") ? type : `.${type}`))\n .join(\",\")}\n onChange={this.#handleFileInput}\n ref={el => (this.#fileInputEl = el as HTMLInputElement)}\n aria-hidden=\"true\"\n tabIndex={-1}\n style={{ display: \"none\" }}\n />\n <div class=\"file-uploader-dialog\">\n <div class=\"dialog-content\">\n {this.isDragging || this.fileStates.size === 0 ? (\n <div\n class={{\n \"file-uploader__drop-zone\": true,\n \"file-uploader__drop-zone--dragging\": this.isDragging\n }}\n onDragEnter={this.#handleDragEnter}\n onDragLeave={this.#handleDragLeave}\n onDragOver={this.#handleDragOver}\n onDrop={this.#handleDrop}\n >\n <button\n class=\"button-tertiary button-icon-and-text\"\n type=\"button\"\n onClick={this.#handleFileSelect}\n >\n <ch-image class=\"icon-md\" src={PLUS_ICON}></ch-image>\n <label class=\"label\">\n {this.multiple\n ? this.#_componentLocale?.header.uploadButtonMultiple\n : this.#_componentLocale?.header.uploadButtonSingle}\n </label>\n </button>\n <div class=\"text-container\">\n <div class=\"label-primary-row\">\n <label class=\"label\">\n {this.label || this.#_componentLocale?.header.orText}\n </label>\n <label class=\"label\">\n {this.#_componentLocale?.header.dragAndDrop}\n </label>\n </div>\n <span class=\"caption\">\n {this.types && this.types.length > 0\n ? this.#_componentLocale?.header.acceptedFiles.replace(\n \"{0}\",\n this.types.join(\", \")\n )\n : this.#_componentLocale?.header.allFilesAccepted}\n </span>\n </div>\n </div>\n ) : (\n <div class=\"file-uploader__list\">\n <div class=\"file-uploader__list-header spacing-body-block-end\">\n <div class=\"file-uploader__list-title-container\">\n <label class=\"label\">\n {this.label ||\n this.#_componentLocale?.fileList.attachedFiles}\n </label>\n <span class=\"caption\">\n {this.#_componentLocale?.fileList.filesCount.replace(\n \"{0}\",\n this.fileStates.size.toString()\n )}\n </span>\n </div>\n {this.multiple && (\n <button\n class=\"button-tertiary button-icon-and-text\"\n type=\"button\"\n onClick={this.#handleFileSelect}\n >\n <ch-image class=\"icon-md\" src={PLUS_ICON}></ch-image>\n <label class=\"label\">\n {this.multiple\n ? this.#_componentLocale?.header.uploadButtonMultiple\n : this.#_componentLocale?.header.uploadButtonSingle}\n </label>\n </button>\n )}\n </div>\n <div class=\"file-uploader__list-content scrollable\">\n {Array.from(this.fileStates.values()).map(file => (\n <gx-ide-file-item\n key={file.id}\n file={file}\n editable={this.canEditName}\n onFileNameChange={this.#handleNameChange}\n onFileDelete={this.#handleFileCancel}\n onFileCancel={this.#handleFileCancel}\n />\n ))}\n </div>\n </div>\n )}\n </div>\n <div class=\"dialog-footer control-footer control-footer-with-border\">\n <div class=\"buttons-spacer\">\n <button\n class=\"button-secondary\"\n type=\"button\"\n onClick={this.#handleCancel}\n >\n {this.#_componentLocale?.buttons.cancel}\n </button>\n <button\n class=\"button-primary\"\n type=\"button\"\n onClick={this.#handleConfirm}\n disabled={\n this.fileStates.size === 0 ||\n Array.from(this.fileStates.values()).some(\n file => file.pending\n )\n }\n >\n {this.#_componentLocale?.buttons.confirm}\n </button>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e227aefb.js');
|
|
6
|
+
const MERCURY_ASSETS = require('./MERCURY_ASSETS-15c5c1ac.js');
|
|
7
|
+
const locale = require('./locale-ff30a5f3.js');
|
|
8
|
+
|
|
9
|
+
const pluginDetailsCss = ":host{display:grid;block-size:100%;grid-template-areas:\"header header\" \"main aside\";grid-template-rows:max-content 1fr;grid-template-columns:1fr 280px;row-gap:12px}.section{display:contents}.header{display:grid;grid-area:header;grid-template-areas:\"plugin-icon plugin-details\";grid-template-columns:64px 1fr;column-gap:16px;padding:24px 24px 16px 24px}.plugin__icon{grid-area:plugin-icon;max-width:100%}.plugin__details{grid-area:plugin-details;display:flex;flex-direction:column;gap:8px}.plugin__publisher{display:flex;align-items:center;gap:4px}.plugin__description{line-height:1.5}.plugin__actions-container{margin-block-start:8px;align-items:center}.action-button{min-inline-size:100px}.action-button.more-versions-available{border-start-end-radius:0 !important;border-end-end-radius:0 !important}.installed-container{display:flex;align-items:center;gap:6px}.installed-container ch-image{--ch-image-size:20px}.main{grid-area:main}.docsTab{block-size:100%}.aside{grid-area:aside;overflow:auto;border-block-start:1px solid var(--items-container__border-color)}.fields__list{list-style:none;padding:0;margin:0;font-size:12px}.plugin__info-category{display:flex;flex-direction:column;gap:8px}.plugin__info-category:not(:first-child){padding-block-start:16px;margin-block-start:16px;border-block-start:1px solid var(--mer-border-color__on-elevation--01)}.fields__list:not(.fields__list--as-tags){display:flex;flex-direction:column;gap:8px}.fields__list:not(.fields__list--as-tags) .field__li{display:flex;gap:16px}.fields__list--as-tags{display:flex;flex-wrap:wrap;gap:6px}.fields__list--as-tags .field__li{border:1px solid var(--mer-border-color__on-elevation--01);padding:2px 8px;border-radius:4px;text-transform:lowercase}.fields__list--as-tags .field__link{color:var(--mer-text__on-surface)}.fields__list--as-tags .field__link:hover{color:var(--mer-accent__primary)}.fields__list--as-tags .field__link:active{color:var(--mer-accent__primary--hover)}.field__name,.field__value{flex:1}.field__link{color:var(--mer-accent__primary)}.field__link:hover{color:var(--mer-accent__primary--hover)}.field__link:active{color:var(--mer-accent__primary--active)}.docsTab{background-color:transparent !important}.dropdown.button-icon-only::part(expandable-button){padding:calc( ( var(--control__block-size) - 2 * var(--control__border-width) - var(--mer-icon__box--md) ) / 2 ) !important;border-start-start-radius:0 !important;border-end-start-radius:0 !important}.version-buttons-container{display:flex;align-items:center;gap:1px}ch-markdown-viewer{block-size:100%;overflow:auto}.text-underline{text-decoration:underline}";
|
|
10
|
+
|
|
11
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f)
|
|
13
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
14
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
15
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
16
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
17
|
+
};
|
|
18
|
+
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
19
|
+
if (kind === "m")
|
|
20
|
+
throw new TypeError("Private method is not writable");
|
|
21
|
+
if (kind === "a" && !f)
|
|
22
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
23
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
24
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
25
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
26
|
+
};
|
|
27
|
+
var _GxIdePluginDetails_componentLocale, _GxIdePluginDetails_docSectionIdDescriptionMap, _GxIdePluginDetails_versionsMenuOptionsModel, _GxIdePluginDetails_menuVersionSelectedHandler, _GxIdePluginDetails_renderUninstallButton, _GxIdePluginDetails_installClickedHandler, _GxIdePluginDetails_updateVersionHandler, _GxIdePluginDetails_openLinkHandler, _GxIdePluginDetails_uninstallClickedHandler, _GxIdePluginDetails_renderActionButtons, _GxIdePluginDetails_tabSelectionChangedHandler, _GxIdePluginDetails_renderDocSectionsSlots, _GxIdePluginDetails_returnFormatedId, _GxIdePluginDetails_renderAsideContent;
|
|
28
|
+
const USER_ICON = MERCURY_ASSETS.getIconPath({
|
|
29
|
+
category: "system",
|
|
30
|
+
name: "user",
|
|
31
|
+
colorType: "on-elevation"
|
|
32
|
+
});
|
|
33
|
+
const CHEVRON_DOWN_ICON = MERCURY_ASSETS.getIconPath({
|
|
34
|
+
category: "system",
|
|
35
|
+
name: "chevron-down",
|
|
36
|
+
colorType: "on-primary"
|
|
37
|
+
});
|
|
38
|
+
const CHECK_CIRCLE_ICON = MERCURY_ASSETS.getIconPath({
|
|
39
|
+
category: "system",
|
|
40
|
+
name: "check-circle",
|
|
41
|
+
colorType: "success"
|
|
42
|
+
});
|
|
43
|
+
// plugin icon if no iconUri was provided
|
|
44
|
+
const EXTENSION_ICON_IMG = index.getAssetPath(`./gx-ide-assets/plugin-manager/images/plugin-icon.svg`);
|
|
45
|
+
const CSS_BUNDLES = [
|
|
46
|
+
"resets/box-sizing",
|
|
47
|
+
"chameleon/scrollbar",
|
|
48
|
+
"components/button",
|
|
49
|
+
"components/dropdown",
|
|
50
|
+
"components/edit",
|
|
51
|
+
"components/icon",
|
|
52
|
+
"components/list-box",
|
|
53
|
+
"components/tab",
|
|
54
|
+
"utils/form",
|
|
55
|
+
"utils/layout",
|
|
56
|
+
"utils/spacing",
|
|
57
|
+
"utils/typography"
|
|
58
|
+
];
|
|
59
|
+
const GxIdePluginDetails = class {
|
|
60
|
+
constructor(hostRef) {
|
|
61
|
+
index.registerInstance(this, hostRef);
|
|
62
|
+
/**
|
|
63
|
+
* The component hard-coded strings translations.
|
|
64
|
+
*/
|
|
65
|
+
// eslint-disable-next-line @stencil-community/own-props-must-be-private
|
|
66
|
+
_GxIdePluginDetails_componentLocale.set(this, void 0);
|
|
67
|
+
// A map between docSection "id", and docSection "description".
|
|
68
|
+
// "id" is generated inside this component.
|
|
69
|
+
_GxIdePluginDetails_docSectionIdDescriptionMap.set(this, new Map());
|
|
70
|
+
_GxIdePluginDetails_versionsMenuOptionsModel.set(this, () => {
|
|
71
|
+
var _a;
|
|
72
|
+
const versionsToUpdateMenusModel = (_a = this.data.versions) === null || _a === void 0 ? void 0 : _a.map(version => {
|
|
73
|
+
return { id: version, caption: version };
|
|
74
|
+
});
|
|
75
|
+
return versionsToUpdateMenusModel;
|
|
76
|
+
});
|
|
77
|
+
_GxIdePluginDetails_menuVersionSelectedHandler.set(this, (event) => {
|
|
78
|
+
const selectedVersion = event.detail.id;
|
|
79
|
+
this.installCallback(selectedVersion);
|
|
80
|
+
});
|
|
81
|
+
_GxIdePluginDetails_renderUninstallButton.set(this, () => {
|
|
82
|
+
return (index.h("button", { class: "button-tertiary", onClick: __classPrivateFieldGet(this, _GxIdePluginDetails_uninstallClickedHandler, "f") }, __classPrivateFieldGet(this, _GxIdePluginDetails_componentLocale, "f").actions.uninstall));
|
|
83
|
+
});
|
|
84
|
+
_GxIdePluginDetails_installClickedHandler.set(this, () => {
|
|
85
|
+
this.installCallback();
|
|
86
|
+
});
|
|
87
|
+
_GxIdePluginDetails_updateVersionHandler.set(this, (id) => () => {
|
|
88
|
+
this.installCallback(id);
|
|
89
|
+
});
|
|
90
|
+
_GxIdePluginDetails_openLinkHandler.set(this, (link) => (event) => {
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
this.openLinkCallback(link);
|
|
93
|
+
});
|
|
94
|
+
_GxIdePluginDetails_uninstallClickedHandler.set(this, () => {
|
|
95
|
+
this.uninstallCallback();
|
|
96
|
+
});
|
|
97
|
+
_GxIdePluginDetails_renderActionButtons.set(this, () => {
|
|
98
|
+
var _a;
|
|
99
|
+
let actionButtonCaption;
|
|
100
|
+
let actionButtonClasses = "button-primary action-button";
|
|
101
|
+
let actionButtonCallback;
|
|
102
|
+
const moreVersionsToUpdate = (_a = this.data.versions) === null || _a === void 0 ? void 0 : _a.length;
|
|
103
|
+
if (!this.data.installed) {
|
|
104
|
+
actionButtonCaption = __classPrivateFieldGet(this, _GxIdePluginDetails_componentLocale, "f").actions.install;
|
|
105
|
+
actionButtonCallback = __classPrivateFieldGet(this, _GxIdePluginDetails_installClickedHandler, "f");
|
|
106
|
+
}
|
|
107
|
+
else if (this.data.updateVersion) {
|
|
108
|
+
actionButtonCaption = `${__classPrivateFieldGet(this, _GxIdePluginDetails_componentLocale, "f").actions.updateTo} ${this.data.updateVersion}`;
|
|
109
|
+
actionButtonCallback = __classPrivateFieldGet(this, _GxIdePluginDetails_updateVersionHandler, "f").call(this, this.data.updateVersion);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
actionButtonCaption = __classPrivateFieldGet(this, _GxIdePluginDetails_componentLocale, "f").actions.installed;
|
|
113
|
+
}
|
|
114
|
+
if (moreVersionsToUpdate) {
|
|
115
|
+
actionButtonClasses = `${actionButtonClasses} more-versions-available`;
|
|
116
|
+
}
|
|
117
|
+
return [
|
|
118
|
+
index.h("div", { class: "version-buttons-container" }, index.h("button", { class: actionButtonClasses, onClick: actionButtonCallback }, actionButtonCaption), moreVersionsToUpdate ? (index.h("ch-action-menu-render", { class: "dropdown button-primary button-icon-only", blockAlign: "outside-end", inlineAlign: "inside-start", model: __classPrivateFieldGet(this, _GxIdePluginDetails_versionsMenuOptionsModel, "f").call(this), onButtonClick: __classPrivateFieldGet(this, _GxIdePluginDetails_menuVersionSelectedHandler, "f") }, index.h("ch-image", { src: CHEVRON_DOWN_ICON, class: "icon-md" }))) : null)
|
|
119
|
+
];
|
|
120
|
+
});
|
|
121
|
+
_GxIdePluginDetails_tabSelectionChangedHandler.set(this, (event) => {
|
|
122
|
+
this.selectedTabId = event.detail.newSelectedId;
|
|
123
|
+
});
|
|
124
|
+
_GxIdePluginDetails_renderDocSectionsSlots.set(this, () => {
|
|
125
|
+
return this.docsTabModel.map(docSectionTab => {
|
|
126
|
+
if (docSectionTab.id === this.selectedTabId) {
|
|
127
|
+
const markdownValue = __classPrivateFieldGet(this, _GxIdePluginDetails_docSectionIdDescriptionMap, "f").get(docSectionTab.id);
|
|
128
|
+
return (index.h("ch-markdown-viewer", { slot: docSectionTab.id, key: docSectionTab.id, class: "markdown spacing-body scrollable", theme: "components/markdown-viewer", value: markdownValue }));
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
_GxIdePluginDetails_returnFormatedId.set(this, (rawId) => {
|
|
133
|
+
return rawId.toLowerCase().replace(/\s+/g, "-");
|
|
134
|
+
});
|
|
135
|
+
_GxIdePluginDetails_renderAsideContent.set(this, () => {
|
|
136
|
+
return this.data.infoCategories.map(infoCategory => {
|
|
137
|
+
return (index.h("div", { class: "plugin__info-category" }, index.h("h3", { class: "subtitle-semi-bold-s" }, infoCategory.name), index.h("ul", { class: {
|
|
138
|
+
"fields__list": true,
|
|
139
|
+
"fields__list--as-tags": infoCategory.displayAsTags
|
|
140
|
+
} }, infoCategory.fields.map(field => {
|
|
141
|
+
// If the field name isn’t specified, only the value is shown — usually a link.
|
|
142
|
+
const fieldValue = typeof field.value === "string" ? field.value : (index.h("a", { class: "field__link", onClick: __classPrivateFieldGet(this, _GxIdePluginDetails_openLinkHandler, "f").call(this, field.value.url) }, field.value.text));
|
|
143
|
+
return (index.h("li", { class: "field__li" }, field.name && !infoCategory.displayAsTags
|
|
144
|
+
? // displaysAsTags forces the items to be displayed as tags
|
|
145
|
+
// no span.field__name and span.field__value
|
|
146
|
+
[
|
|
147
|
+
index.h("span", { class: "field__name body-semi-bold-s" }, field.name),
|
|
148
|
+
index.h("span", { class: "field__value body-regular-s" }, fieldValue)
|
|
149
|
+
]
|
|
150
|
+
: fieldValue));
|
|
151
|
+
}))));
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
this.docsTabModel = [];
|
|
155
|
+
this.selectedTabId = undefined;
|
|
156
|
+
this.data = undefined;
|
|
157
|
+
this.installCallback = undefined;
|
|
158
|
+
this.openLinkCallback = undefined;
|
|
159
|
+
this.uninstallCallback = undefined;
|
|
160
|
+
}
|
|
161
|
+
async componentWillLoad() {
|
|
162
|
+
var _a;
|
|
163
|
+
__classPrivateFieldSet(this, _GxIdePluginDetails_componentLocale, await locale.Locale.getComponentStrings(this.el), "f");
|
|
164
|
+
if ((_a = this.data.docSections) === null || _a === void 0 ? void 0 : _a.length) {
|
|
165
|
+
this.docsTabModel = this.data.docSections.map((docSection, i) => {
|
|
166
|
+
const formatedId = __classPrivateFieldGet(this, _GxIdePluginDetails_returnFormatedId, "f").call(this, docSection.name);
|
|
167
|
+
__classPrivateFieldGet(this, _GxIdePluginDetails_docSectionIdDescriptionMap, "f").set(formatedId, docSection.content);
|
|
168
|
+
if (i === 0) {
|
|
169
|
+
this.selectedTabId = formatedId;
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
id: formatedId,
|
|
173
|
+
name: docSection.name
|
|
174
|
+
};
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
render() {
|
|
179
|
+
const renderActionButtons = !this.data.installed ||
|
|
180
|
+
(this.data.installed && !!this.data.updateVersion);
|
|
181
|
+
const titleLinkDataText = this.data.name.text;
|
|
182
|
+
const titleLinkDataUrl = this.data.name.url;
|
|
183
|
+
const titleHasLink = titleLinkDataText && titleLinkDataUrl;
|
|
184
|
+
const titleText = titleLinkDataText || this.data.name;
|
|
185
|
+
const publisherDataText = this.data.publisher.text;
|
|
186
|
+
const publisherDataUrl = this.data.publisher.url;
|
|
187
|
+
const publisherHasLink = publisherDataText && publisherDataUrl;
|
|
188
|
+
const publisherText = publisherDataText || this.data.publisher;
|
|
189
|
+
return (index.h(index.Host, { class: "widget" }, index.h("ch-theme", { model: CSS_BUNDLES }), index.h("section", { class: "section" }, index.h("header", { class: "header" }, index.h("img", { class: "plugin__icon", src: this.data.iconUrl || EXTENSION_ICON_IMG, alt: "plugin extension icon" }), index.h("div", { class: "plugin__details" }, titleHasLink ? (index.h("h2", { class: "heading-5" }, index.h("a", { href: titleLinkDataUrl, onClick: __classPrivateFieldGet(this, _GxIdePluginDetails_openLinkHandler, "f").call(this, titleLinkDataUrl), class: "text-underline" }, titleText))) : (index.h("h2", { class: "heading-5" }, titleText)), publisherHasLink ? (index.h("a", { href: publisherDataUrl, onClick: __classPrivateFieldGet(this, _GxIdePluginDetails_openLinkHandler, "f").call(this, publisherDataUrl), class: "text-underline plugin__publisher tiny-semi-bold-l" }, index.h("ch-image", { src: USER_ICON, class: "icon-md" }), publisherText)) : (index.h("p", { class: "plugin__publisher tiny-semi-bold-l" }, index.h("ch-image", { src: USER_ICON, class: "icon-md" }), publisherText)), index.h("p", { class: "plugin__description" }, this.data.description), index.h("div", { class: "buttons-spacer plugin__actions-container" }, renderActionButtons ? (__classPrivateFieldGet(this, _GxIdePluginDetails_renderActionButtons, "f").call(this)) : (
|
|
190
|
+
// installed and no updates
|
|
191
|
+
index.h("p", { class: "installed-container subtitle-semi-bold-s" }, index.h("ch-image", { src: CHECK_CIRCLE_ICON, class: "icon-md" }), __classPrivateFieldGet(this, _GxIdePluginDetails_componentLocale, "f").actions.installed)), this.data.installed && __classPrivateFieldGet(this, _GxIdePluginDetails_renderUninstallButton, "f").call(this)))), index.h("div", { class: "main" }, this.docsTabModel.length > 0 && (index.h("ch-tab-render", { class: "tab docsTab scrollable", tabListPosition: "block-start", overflow: "auto", contain: "size", model: this.docsTabModel, onSelectedItemChange: __classPrivateFieldGet(this, _GxIdePluginDetails_tabSelectionChangedHandler, "f"), selectedId: this.selectedTabId }, __classPrivateFieldGet(this, _GxIdePluginDetails_renderDocSectionsSlots, "f").call(this)))), index.h("div", { class: "aside spacing-body scrollable" }, __classPrivateFieldGet(this, _GxIdePluginDetails_renderAsideContent, "f").call(this)))));
|
|
192
|
+
}
|
|
193
|
+
static get assetsDirs() { return ["gx-ide-assets/plugin-details"]; }
|
|
194
|
+
get el() { return index.getElement(this); }
|
|
195
|
+
};
|
|
196
|
+
_GxIdePluginDetails_componentLocale = new WeakMap(), _GxIdePluginDetails_docSectionIdDescriptionMap = new WeakMap(), _GxIdePluginDetails_versionsMenuOptionsModel = new WeakMap(), _GxIdePluginDetails_menuVersionSelectedHandler = new WeakMap(), _GxIdePluginDetails_renderUninstallButton = new WeakMap(), _GxIdePluginDetails_installClickedHandler = new WeakMap(), _GxIdePluginDetails_updateVersionHandler = new WeakMap(), _GxIdePluginDetails_openLinkHandler = new WeakMap(), _GxIdePluginDetails_uninstallClickedHandler = new WeakMap(), _GxIdePluginDetails_renderActionButtons = new WeakMap(), _GxIdePluginDetails_tabSelectionChangedHandler = new WeakMap(), _GxIdePluginDetails_renderDocSectionsSlots = new WeakMap(), _GxIdePluginDetails_returnFormatedId = new WeakMap(), _GxIdePluginDetails_renderAsideContent = new WeakMap();
|
|
197
|
+
GxIdePluginDetails.style = pluginDetailsCss;
|
|
198
|
+
|
|
199
|
+
exports.gx_ide_plugin_details = GxIdePluginDetails;
|
|
200
|
+
|
|
201
|
+
//# sourceMappingURL=gx-ide-plugin-details.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":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,iBAAK,KAAK,EAAC,MAAM,IACd,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,KAC3BA,2BACE,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,EACNA,iBAAK,KAAK,EAAC,+BAA+B,IACvC,uBAAA,IAAI,8CAAoB,MAAxB,IAAI,CAAsB,CACvB,CACE,CAEL,EACP;KACH;;;;;;;;;","names":["getIconPath","getAssetPath","h","Locale","Host"],"sources":["src/components/plugin-details/plugin-details.scss?tag=gx-ide-plugin-details&encapsulation=shadow","src/components/plugin-details/plugin-details.tsx"],"sourcesContent":[":host {\n display: grid;\n block-size: 100%;\n grid-template-areas:\n \"header header\"\n \"main aside\";\n grid-template-rows: max-content 1fr;\n grid-template-columns: 1fr 280px;\n row-gap: 12px;\n}\n\n.section {\n display: contents;\n}\n\n// header\n.header {\n display: grid;\n grid-area: header;\n grid-template-areas: \"plugin-icon plugin-details\";\n grid-template-columns: 64px 1fr;\n column-gap: 16px;\n padding: 24px 24px 16px 24px;\n}\n.plugin__icon {\n grid-area: plugin-icon;\n max-width: 100%;\n}\n.plugin__details {\n grid-area: plugin-details;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.plugin__publisher {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n.plugin__description {\n line-height: 1.5; // WA: Text appears too tight.\n}\n.plugin__actions-container {\n margin-block-start: 8px;\n align-items: center;\n}\n.action-button {\n min-inline-size: 100px;\n\n &.more-versions-available {\n border-start-end-radius: 0 !important;\n border-end-end-radius: 0 !important;\n }\n}\n.installed-container {\n display: flex;\n align-items: center;\n gap: 6px;\n\n // WA Biggest Mercury icon (icon-md) looks small in this case.\n // Mercury should expose more icon sizes.\n ch-image {\n --ch-image-size: 20px;\n }\n}\n\n// main\n.main {\n grid-area: main;\n}\n.docsTab {\n block-size: 100%;\n}\n\n// aside\n.aside {\n grid-area: aside;\n overflow: auto;\n border-block-start: 1px solid var(--items-container__border-color);\n}\n.fields__list {\n list-style: none;\n padding: 0;\n margin: 0;\n font-size: 12px;\n}\n.plugin__info-category {\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n &:not(:first-child) {\n $space: 16px;\n padding-block-start: $space;\n margin-block-start: $space;\n border-block-start: 1px solid var(--mer-border-color__on-elevation--01);\n }\n}\n.fields__list:not(.fields__list--as-tags) {\n display: flex;\n flex-direction: column;\n gap: 8px;\n .field__li {\n display: flex;\n gap: 16px;\n }\n}\n.fields__list--as-tags {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n\n .field__li {\n border: 1px solid var(--mer-border-color__on-elevation--01);\n padding: 2px 8px;\n border-radius: 4px;\n\n text-transform: lowercase;\n }\n .field__link {\n color: var(--mer-text__on-surface);\n\n &:hover {\n color: var(--mer-accent__primary);\n }\n &:active {\n color: var(--mer-accent__primary--hover);\n }\n }\n}\n\n.field__name,\n.field__value {\n flex: 1;\n}\n// WA: Link styles should be defined Mercury\n.field__link {\n color: var(--mer-accent__primary);\n &:hover {\n color: var(--mer-accent__primary--hover);\n }\n &:active {\n color: var(--mer-accent__primary--active);\n }\n}\n// WA: Remove tab elevation background color\n.docsTab {\n background-color: transparent !important;\n}\n\n// WA: Styles for \"button-icon-only\" should be defined on mercury\n.dropdown.button-icon-only::part(expandable-button) {\n padding: calc(\n (\n var(--control__block-size) - 2 * var(--control__border-width) -\n var(--mer-icon__box--md)\n ) / 2\n ) !important;\n border-start-start-radius: 0 !important;\n border-end-start-radius: 0 !important;\n}\n\n.version-buttons-container {\n display: flex;\n align-items: center;\n gap: 1px;\n}\n\nch-markdown-viewer {\n block-size: 100%;\n overflow: auto;\n}\n\n// WA: Need text with underline. This should be defined on Mercury\n.text-underline {\n text-decoration: underline;\n}\n","import {\n Component,\n Host,\n State,\n Prop,\n Element,\n h,\n getAssetPath,\n JSX\n} from \"@stencil/core\";\n\nimport { getIconPath, MercuryBundles } from \"@genexus/mercury\";\nimport { Locale } from \"../../common/locale\";\nimport { ActionMenuModel, TabModel } from \"@genexus/chameleon-controls-library\";\nimport { TabItemModel } from \"@genexus/chameleon-controls-library/dist/types/components/tab/types\";\n\nconst USER_ICON = getIconPath({\n category: \"system\",\n name: \"user\",\n colorType: \"on-elevation\"\n});\nconst CHEVRON_DOWN_ICON = getIconPath({\n category: \"system\",\n name: \"chevron-down\",\n colorType: \"on-primary\"\n});\nconst CHECK_CIRCLE_ICON = getIconPath({\n category: \"system\",\n name: \"check-circle\",\n colorType: \"success\"\n});\n\n// plugin icon if no iconUri was provided\nconst EXTENSION_ICON_IMG = getAssetPath(\n `./gx-ide-assets/plugin-manager/images/plugin-icon.svg`\n);\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"chameleon/scrollbar\",\n \"components/button\",\n \"components/dropdown\",\n \"components/edit\",\n \"components/icon\",\n \"components/list-box\",\n \"components/tab\",\n \"utils/form\",\n \"utils/layout\",\n \"utils/spacing\",\n \"utils/typography\"\n];\n\n@Component({\n tag: \"gx-ide-plugin-details\",\n styleUrl: \"plugin-details.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/plugin-details\"]\n})\nexport class GxIdePluginDetails {\n /**\n * The component hard-coded strings translations.\n */\n // eslint-disable-next-line @stencil-community/own-props-must-be-private\n #componentLocale: any;\n\n // A map between docSection \"id\", and docSection \"description\".\n // \"id\" is generated inside this component.\n #docSectionIdDescriptionMap: Map<string, string> = new Map();\n\n @Element() el: HTMLGxIdePluginDetailsElement;\n\n @State() docsTabModel: TabModel = [];\n @State() selectedTabId: string;\n\n /**\n * Specifies all the information related to a plugin.\n */\n @Prop() readonly data!: PluginDetailsData;\n\n /**\n * Callback that should be invoked when the user performs the install or update action.\n * Receives an optional version string when a specific version is selected.\n */\n @Prop() readonly installCallback!: (version?: string) => Promise<void>;\n\n /**\n * Callback that should be invoked when the user attempts to open any link displayed in this component.\n */\n @Prop() readonly openLinkCallback!: (url: string) => Promise<void>;\n\n /**\n * Callback that should be invoked when the user performs the uninstall action.\n */\n @Prop() readonly uninstallCallback!: () => Promise<void>;\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n\n if (this.data.docSections?.length) {\n this.docsTabModel = this.data.docSections.map((docSection, i) => {\n const formatedId = this.#returnFormatedId(docSection.name);\n\n this.#docSectionIdDescriptionMap.set(formatedId, docSection.content);\n\n if (i === 0) {\n this.selectedTabId = formatedId;\n }\n return {\n id: formatedId,\n name: docSection.name\n } as TabItemModel;\n });\n }\n }\n\n #versionsMenuOptionsModel = (): ActionMenuModel => {\n const versionsToUpdateMenusModel: ActionMenuModel = this.data.versions?.map(\n version => {\n return { id: version, caption: version };\n }\n );\n return versionsToUpdateMenusModel;\n };\n\n #menuVersionSelectedHandler = (\n event: CustomEvent<{\n id?: string;\n }>\n ) => {\n const selectedVersion = event.detail.id;\n this.installCallback(selectedVersion);\n };\n\n #renderUninstallButton = (): JSX.Element => {\n return (\n <button class=\"button-tertiary\" onClick={this.#uninstallClickedHandler}>\n {this.#componentLocale.actions.uninstall}\n </button>\n );\n };\n\n #installClickedHandler = () => {\n this.installCallback();\n };\n\n #updateVersionHandler = (id: string) => () => {\n this.installCallback(id);\n };\n\n #openLinkHandler = (link: string) => (event: MouseEvent) => {\n event.preventDefault();\n this.openLinkCallback(link);\n };\n\n #uninstallClickedHandler = () => {\n this.uninstallCallback();\n };\n\n #renderActionButtons = (): JSX.Element => {\n let actionButtonCaption;\n let actionButtonClasses = \"button-primary action-button\";\n let actionButtonCallback;\n const moreVersionsToUpdate = this.data.versions?.length;\n\n if (!this.data.installed) {\n actionButtonCaption = this.#componentLocale.actions.install;\n actionButtonCallback = this.#installClickedHandler;\n } else if (this.data.updateVersion) {\n actionButtonCaption = `${this.#componentLocale.actions.updateTo} ${\n this.data.updateVersion\n }`;\n actionButtonCallback = this.#updateVersionHandler(\n this.data.updateVersion\n );\n } else {\n actionButtonCaption = this.#componentLocale.actions.installed;\n }\n\n if (moreVersionsToUpdate) {\n actionButtonClasses = `${actionButtonClasses} more-versions-available`;\n }\n\n return [\n <div class=\"version-buttons-container\">\n <button class={actionButtonClasses} onClick={actionButtonCallback}>\n {actionButtonCaption}\n </button>\n {moreVersionsToUpdate ? (\n <ch-action-menu-render\n class=\"dropdown button-primary button-icon-only\"\n blockAlign=\"outside-end\"\n inlineAlign=\"inside-start\"\n model={this.#versionsMenuOptionsModel()}\n onButtonClick={this.#menuVersionSelectedHandler}\n >\n <ch-image src={CHEVRON_DOWN_ICON} class=\"icon-md\"></ch-image>\n </ch-action-menu-render>\n ) : null}\n </div>\n ];\n };\n\n #tabSelectionChangedHandler = (\n event: CustomEvent<{\n lastSelectedIndex: number;\n newSelectedId: string;\n newSelectedIndex: number;\n }>\n ): void => {\n this.selectedTabId = event.detail.newSelectedId;\n };\n\n #renderDocSectionsSlots = (): JSX.Element => {\n return this.docsTabModel.map(docSectionTab => {\n if (docSectionTab.id === this.selectedTabId) {\n const markdownValue = this.#docSectionIdDescriptionMap.get(\n docSectionTab.id\n );\n\n return (\n <ch-markdown-viewer\n slot={docSectionTab.id}\n key={docSectionTab.id}\n class=\"markdown spacing-body scrollable\"\n theme=\"components/markdown-viewer\"\n value={markdownValue}\n ></ch-markdown-viewer>\n );\n }\n });\n };\n\n #returnFormatedId = (rawId: string): string => {\n return rawId.toLowerCase().replace(/\\s+/g, \"-\");\n };\n\n #renderAsideContent = (): JSX.Element => {\n return this.data.infoCategories.map(infoCategory => {\n return (\n <div class=\"plugin__info-category\">\n <h3 class=\"subtitle-semi-bold-s\">{infoCategory.name}</h3>\n <ul\n class={{\n \"fields__list\": true,\n \"fields__list--as-tags\": infoCategory.displayAsTags\n }}\n >\n {infoCategory.fields.map(field => {\n // If the field name isn’t specified, only the value is shown — usually a link.\n const fieldValue: string | HTMLAnchorElement =\n typeof field.value === \"string\" ? (\n (field.value as string)\n ) : (\n <a\n class=\"field__link\"\n onClick={this.#openLinkHandler(\n (field.value as LinkData).url\n )}\n >\n {(field.value as LinkData).text}\n </a>\n );\n return (\n <li class=\"field__li\">\n {field.name && !infoCategory.displayAsTags\n ? // displaysAsTags forces the items to be displayed as tags\n // no span.field__name and span.field__value\n [\n <span class=\"field__name body-semi-bold-s\">\n {field.name}\n </span>,\n <span class=\"field__value body-regular-s\">\n {fieldValue}\n </span>\n ]\n : fieldValue}\n </li>\n );\n })}\n </ul>\n </div>\n );\n });\n };\n\n render() {\n const renderActionButtons =\n !this.data.installed ||\n (this.data.installed && !!this.data.updateVersion);\n\n const titleLinkDataText = (this.data.name as LinkData).text;\n const titleLinkDataUrl = (this.data.name as LinkData).url;\n const titleHasLink = titleLinkDataText && titleLinkDataUrl;\n const titleText = titleLinkDataText || this.data.name;\n\n const publisherDataText = (this.data.publisher as LinkData).text;\n const publisherDataUrl = (this.data.publisher as LinkData).url;\n const publisherHasLink = publisherDataText && publisherDataUrl;\n const publisherText = publisherDataText || this.data.publisher;\n\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <section class=\"section\">\n <header class=\"header\">\n <img\n class=\"plugin__icon\"\n src={this.data.iconUrl || EXTENSION_ICON_IMG}\n alt=\"plugin extension icon\"\n />\n <div class=\"plugin__details\">\n {titleHasLink ? (\n <h2 class=\"heading-5\">\n <a\n href={titleLinkDataUrl}\n onClick={this.#openLinkHandler(titleLinkDataUrl)}\n class=\"text-underline\"\n >\n {titleText}\n </a>\n </h2>\n ) : (\n <h2 class=\"heading-5\">{titleText}</h2>\n )}\n\n {publisherHasLink ? (\n <a\n href={publisherDataUrl}\n onClick={this.#openLinkHandler(publisherDataUrl)}\n class=\"text-underline plugin__publisher tiny-semi-bold-l\"\n >\n <ch-image src={USER_ICON} class=\"icon-md\"></ch-image>\n {publisherText}\n </a>\n ) : (\n <p class=\"plugin__publisher tiny-semi-bold-l\">\n <ch-image src={USER_ICON} class=\"icon-md\"></ch-image>\n {publisherText}\n </p>\n )}\n\n <p class=\"plugin__description\">{this.data.description}</p>\n <div class=\"buttons-spacer plugin__actions-container\">\n {renderActionButtons ? (\n this.#renderActionButtons()\n ) : (\n // installed and no updates\n <p class=\"installed-container subtitle-semi-bold-s\">\n <ch-image\n src={CHECK_CIRCLE_ICON}\n class=\"icon-md\"\n ></ch-image>\n {this.#componentLocale.actions.installed}\n </p>\n )}\n {this.data.installed && this.#renderUninstallButton()}\n </div>\n </div>\n </header>\n <div class=\"main\">\n {this.docsTabModel.length > 0 && (\n <ch-tab-render\n class=\"tab docsTab scrollable\"\n tabListPosition=\"block-start\"\n overflow=\"auto\"\n contain=\"size\"\n model={this.docsTabModel}\n onSelectedItemChange={this.#tabSelectionChangedHandler}\n selectedId={this.selectedTabId}\n >\n {this.#renderDocSectionsSlots()}\n </ch-tab-render>\n )}\n </div>\n <div class=\"aside spacing-body scrollable\">\n {this.#renderAsideContent()}\n </div>\n </section>\n {/* <slot></slot> */}\n </Host>\n );\n }\n}\n\n// plugin-details.types.ts\n\nexport type LinkData = {\n text: string;\n url: string;\n};\n\nexport type PluginFieldData = {\n name?: string;\n value: string | LinkData;\n};\n\nexport type PluginInfoCategoryData = {\n name: string;\n fields: PluginFieldData[];\n displayAsTags: boolean;\n};\n\nexport type DocSectionData = {\n name: string;\n content: string;\n};\n\nexport type PluginDetailsData = {\n id: string;\n name: string | LinkData;\n publisher: string | LinkData;\n installed: boolean;\n updateVersion?: string;\n versions: string[];\n iconUrl: string;\n description: string;\n docSections: DocSectionData[];\n infoCategories: PluginInfoCategoryData[];\n};\n"],"version":3}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e227aefb.js');
|
|
6
|
+
const MERCURY_ASSETS = require('./MERCURY_ASSETS-15c5c1ac.js');
|
|
7
|
+
const locale = require('./locale-ff30a5f3.js');
|
|
8
|
+
const config = require('./config-6a768514.js');
|
|
9
|
+
|
|
10
|
+
const pluginExplorerCss = ":host{display:grid;block-size:100%;position:relative}.outer-container{grid-template-rows:max-content 1fr}.inner-container{position:relative}.list-box::part(item){width:100%;min-width:100%}.list-box::part(item__action){gap:4px}.list-box::part(item__caption){font-weight:600}.list-box::part(custom-container){display:flex;flex-direction:column;gap:4px;width:100%}.list-box::part(custom-image){block-size:32px;inline-size:32px;margin-inline-end:12px}.list-box::part(custom-description){font-size:12px;margin:0;opacity:0.8;line-height:1.4;margin-inline-end:8px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.list-box::part(item__block-end start){width:100%;min-width:100%}.list-box::part(custom-brand){font-weight:600;display:flex;gap:4px;align-items:center}.list-box::part(custom-brand-icon){--icon-path:var(--icon__system_user_neutral--enabled);display:inline-block;background-image:var(--icon-path);background-size:contain;background-repeat:no-repeat;background-position:center center;block-size:16px;inline-size:16px}.list-box::part(custom-button){--control__border-color:var(--button-background-color);--button-color:var(--mer-text__primary);--button-color--enabled:var(--mer-text__on-primary);--button-color--active:var(--mer-text__on-primary--active);display:inline-grid;grid-auto-flow:column;grid-auto-columns:max-content;justify-content:center;padding-block:var(--control__padding-block);padding-inline:var(--control__padding-inline);box-sizing:border-box;background-color:var(--button-background-color);color:var(--button-color);font-weight:600;margin-block-end:auto;margin-block-start:auto;text-transform:capitalize}.list-box::part(custom-button):hover{--button-color:var(--mer-text__primary--hover)}.list-box::part(custom-button):active{--button-color:var(--mer-text__primary--active)}";
|
|
11
|
+
|
|
12
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
13
|
+
if (kind === "a" && !f)
|
|
14
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
15
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
16
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
17
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
18
|
+
};
|
|
19
|
+
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
20
|
+
if (kind === "m")
|
|
21
|
+
throw new TypeError("Private method is not writable");
|
|
22
|
+
if (kind === "a" && !f)
|
|
23
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
24
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
25
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
26
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
27
|
+
};
|
|
28
|
+
var _GxIdePluginManager_componentLocale, _GxIdePluginManager_animateEmptyState, _GxIdePluginManager_actionListButtonClickHandler, _GxIdePluginManager_mapPluginDataToActionListModel, _GxIdePluginManager_pluginsFilterInputHandler, _GxIdePluginManager_evaluateContentToDisplay, _GxIdePluginManager_renderLoader, _GxIdePluginManager_pluginSelectedHandler;
|
|
29
|
+
const FILTER_ICON = MERCURY_ASSETS.getIconPath({
|
|
30
|
+
category: "system",
|
|
31
|
+
name: "filters",
|
|
32
|
+
colorType: "on-elevation"
|
|
33
|
+
});
|
|
34
|
+
// plugin icon if no iconUrl was provided
|
|
35
|
+
const EXTENSION_ICON_IMG = index.getAssetPath(`./gx-ide-assets/plugin-manager/images/plugin-icon.svg`);
|
|
36
|
+
const CSS_BUNDLES = [
|
|
37
|
+
"resets/box-sizing",
|
|
38
|
+
"components/list-box",
|
|
39
|
+
"components/button",
|
|
40
|
+
"components/edit",
|
|
41
|
+
"utils/form",
|
|
42
|
+
"utils/layout",
|
|
43
|
+
"utils/typography",
|
|
44
|
+
"utils/spacing",
|
|
45
|
+
"chameleon/scrollbar"
|
|
46
|
+
];
|
|
47
|
+
const GxIdePluginManager = class {
|
|
48
|
+
constructor(hostRef) {
|
|
49
|
+
index.registerInstance(this, hostRef);
|
|
50
|
+
/**
|
|
51
|
+
* The component hard-coded strings translations.
|
|
52
|
+
*/
|
|
53
|
+
// eslint-disable-next-line @stencil-community/own-props-must-be-private
|
|
54
|
+
_GxIdePluginManager_componentLocale.set(this, void 0);
|
|
55
|
+
_GxIdePluginManager_animateEmptyState.set(this, false);
|
|
56
|
+
_GxIdePluginManager_actionListButtonClickHandler.set(this, (pluginId, action) => (event) => {
|
|
57
|
+
event.stopPropagation();
|
|
58
|
+
this.executeActionCallback(pluginId, action);
|
|
59
|
+
});
|
|
60
|
+
_GxIdePluginManager_mapPluginDataToActionListModel.set(this, (pluginsData) => {
|
|
61
|
+
const pluginsActionListModel = [];
|
|
62
|
+
const separatorItem = { type: "separator" };
|
|
63
|
+
pluginsData === null || pluginsData === void 0 ? void 0 : pluginsData.forEach((pluginData, index$1) => {
|
|
64
|
+
const hasActionButton = !!pluginData.action;
|
|
65
|
+
const pluginItem = {
|
|
66
|
+
id: pluginData.id,
|
|
67
|
+
caption: pluginData.name,
|
|
68
|
+
imgSrc: pluginData.iconUrl,
|
|
69
|
+
type: "actionable",
|
|
70
|
+
additionalInformation: {
|
|
71
|
+
"stretch-start": {
|
|
72
|
+
center: [
|
|
73
|
+
{
|
|
74
|
+
part: "custom-image",
|
|
75
|
+
jsx: () => (index.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" }))
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"block-end": {
|
|
80
|
+
start: [
|
|
81
|
+
{
|
|
82
|
+
part: "custom-description custom-button custom-container custom-brand custom-brand-icon custom-image item__block-end start",
|
|
83
|
+
jsx: () => (index.h("div", { part: "custom-container", title: pluginData.description }, index.h("p", { part: "custom-description" }, pluginData.description), index.h("small", { part: "custom-brand" }, index.h("span", { part: "custom-brand-icon" }), pluginData.publisher)))
|
|
84
|
+
}
|
|
85
|
+
// {
|
|
86
|
+
// slot: "abcd"
|
|
87
|
+
// } as ActionListItemAdditionalSlot // slot not working
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
"stretch-end": hasActionButton && {
|
|
91
|
+
center: [
|
|
92
|
+
{
|
|
93
|
+
jsx: () => (index.h("button", { part: "custom-button", onClick: __classPrivateFieldGet(this, _GxIdePluginManager_actionListButtonClickHandler, "f").call(this, pluginData.id, pluginData.action) }, pluginData.action))
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
if (index$1 !== 0) {
|
|
100
|
+
pluginsActionListModel.push(separatorItem);
|
|
101
|
+
}
|
|
102
|
+
pluginsActionListModel.push(pluginItem);
|
|
103
|
+
});
|
|
104
|
+
return pluginsActionListModel;
|
|
105
|
+
});
|
|
106
|
+
_GxIdePluginManager_pluginsFilterInputHandler.set(this, async (event) => {
|
|
107
|
+
this.loading = true;
|
|
108
|
+
const filterValue = event.detail;
|
|
109
|
+
this.plugins = await this.filterCallback(filterValue);
|
|
110
|
+
});
|
|
111
|
+
_GxIdePluginManager_evaluateContentToDisplay.set(this, () => {
|
|
112
|
+
const pluginsToDisplay = this.pluginsActionListModel.length;
|
|
113
|
+
return pluginsToDisplay ? (index.h("ch-action-list-render", { model: this.pluginsActionListModel, class: "list-box", selection: "single", onSelectedItemsChange: __classPrivateFieldGet(this, _GxIdePluginManager_pluginSelectedHandler, "f") })) : (index.h("gx-ide-empty-state", { isAnimated: __classPrivateFieldGet(this, _GxIdePluginManager_animateEmptyState, "f"), class: "recent-objects__empty-state", stateIconSrc: FILTER_ICON, stateTitle: __classPrivateFieldGet(this, _GxIdePluginManager_componentLocale, "f").emptyStateTitle, stateDescription: __classPrivateFieldGet(this, _GxIdePluginManager_componentLocale, "f").emptyStateDescription }));
|
|
114
|
+
});
|
|
115
|
+
_GxIdePluginManager_renderLoader.set(this, () => {
|
|
116
|
+
__classPrivateFieldSet(this, _GxIdePluginManager_animateEmptyState, true, "f");
|
|
117
|
+
return (index.h("gx-ide-loader", { loaderTitle: __classPrivateFieldGet(this, _GxIdePluginManager_componentLocale, "f").loaderTitle, description: __classPrivateFieldGet(this, _GxIdePluginManager_componentLocale, "f").loaderDescription, show: true }));
|
|
118
|
+
});
|
|
119
|
+
_GxIdePluginManager_pluginSelectedHandler.set(this, (event) => {
|
|
120
|
+
var _a;
|
|
121
|
+
const eventType = (_a = event.detail[0]) === null || _a === void 0 ? void 0 : _a.item.type;
|
|
122
|
+
if (eventType === "actionable") {
|
|
123
|
+
const pluginId = event.detail[0].item.id;
|
|
124
|
+
this.showDetailsCallback(pluginId);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
this.loading = true;
|
|
128
|
+
this.pluginsActionListModel = [];
|
|
129
|
+
this.plugins = undefined;
|
|
130
|
+
this.filterCallback = undefined;
|
|
131
|
+
this.showDetailsCallback = undefined;
|
|
132
|
+
this.executeActionCallback = undefined;
|
|
133
|
+
}
|
|
134
|
+
pluginsChangedHandler(newPlugins) {
|
|
135
|
+
this.pluginsActionListModel =
|
|
136
|
+
__classPrivateFieldGet(this, _GxIdePluginManager_mapPluginDataToActionListModel, "f").call(this, newPlugins);
|
|
137
|
+
this.loading = false;
|
|
138
|
+
}
|
|
139
|
+
async componentWillLoad() {
|
|
140
|
+
__classPrivateFieldSet(this, _GxIdePluginManager_componentLocale, await locale.Locale.getComponentStrings(this.el), "f");
|
|
141
|
+
this.pluginsChangedHandler(this.plugins);
|
|
142
|
+
}
|
|
143
|
+
render() {
|
|
144
|
+
return (index.h(index.Host, { class: "widget" }, index.h("ch-theme", { model: CSS_BUNDLES }), index.h("div", { class: "outer-container field-group" }, index.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.config.inputDebounce, onInput: __classPrivateFieldGet(this, _GxIdePluginManager_pluginsFilterInputHandler, "f"), type: "search" }), index.h("div", { class: "inner-container" }, this.loading
|
|
145
|
+
? __classPrivateFieldGet(this, _GxIdePluginManager_renderLoader, "f").call(this)
|
|
146
|
+
: __classPrivateFieldGet(this, _GxIdePluginManager_evaluateContentToDisplay, "f").call(this)))));
|
|
147
|
+
}
|
|
148
|
+
static get assetsDirs() { return ["gx-ide-assets/plugin-explorer"]; }
|
|
149
|
+
get el() { return index.getElement(this); }
|
|
150
|
+
static get watchers() { return {
|
|
151
|
+
"plugins": ["pluginsChangedHandler"]
|
|
152
|
+
}; }
|
|
153
|
+
};
|
|
154
|
+
_GxIdePluginManager_componentLocale = new WeakMap(), _GxIdePluginManager_animateEmptyState = new WeakMap(), _GxIdePluginManager_actionListButtonClickHandler = new WeakMap(), _GxIdePluginManager_mapPluginDataToActionListModel = new WeakMap(), _GxIdePluginManager_pluginsFilterInputHandler = new WeakMap(), _GxIdePluginManager_evaluateContentToDisplay = new WeakMap(), _GxIdePluginManager_renderLoader = new WeakMap(), _GxIdePluginManager_pluginSelectedHandler = new WeakMap();
|
|
155
|
+
GxIdePluginManager.style = pluginExplorerCss;
|
|
156
|
+
|
|
157
|
+
exports.gx_ide_plugin_explorer = GxIdePluginManager;
|
|
158
|
+
|
|
159
|
+
//# sourceMappingURL=gx-ide-plugin-explorer.cjs.entry.js.map
|