@genexus/genexus-ide-ui 1.1.46 → 1.1.47
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/gx-ide-start-page.cjs.entry.js +9 -4
- package/dist/cjs/gx-ide-start-page.cjs.entry.js.map +1 -1
- package/dist/collection/components/start-page/start-page.js +9 -4
- package/dist/collection/components/start-page/start-page.js.map +1 -1
- package/dist/components/gx-ide-start-page.js +9 -4
- package/dist/components/gx-ide-start-page.js.map +1 -1
- package/dist/esm/gx-ide-start-page.entry.js +9 -4
- package/dist/esm/gx-ide-start-page.entry.js.map +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
- package/dist/genexus-ide-ui/{p-8ec19a9a.entry.js → p-ab1e2886.entry.js} +9 -6
- package/dist/genexus-ide-ui/p-ab1e2886.entry.js.map +1 -0
- package/package.json +1 -1
- package/dist/genexus-ide-ui/p-8ec19a9a.entry.js.map +0 -1
|
@@ -177,25 +177,30 @@ export class GxIdeStartPage {
|
|
|
177
177
|
var _a, _b;
|
|
178
178
|
this.loading =
|
|
179
179
|
(!this.kbs || ((_a = this.kbs) === null || _a === void 0 ? void 0 : _a.length) === 0) && !this.secondarySection;
|
|
180
|
+
const renderCreateProjectCard = this.createKBCallback;
|
|
181
|
+
const renderOpenProjectCard = this.openKbCallback;
|
|
180
182
|
const renderViewSamplesCard = ((_b = this.samples) === null || _b === void 0 ? void 0 : _b.length) && this.openSampleCallback;
|
|
183
|
+
const renderCardsContainer = renderCreateProjectCard || renderOpenProjectCard || renderViewSamplesCard;
|
|
181
184
|
return (h(Host, { class: "scrollable" }, h("ch-theme", { model: CSS_BUNDLES }), h("main", { class: "main scrollable" }, h("section", {
|
|
182
185
|
// Create a new Knowledge Base
|
|
183
186
|
class: "section-create-new-kb"
|
|
184
187
|
}, h("header", {
|
|
185
188
|
// main header
|
|
186
189
|
class: "section-create-new-kb__header"
|
|
187
|
-
}, h("h1", { class: "heading-5 section-create-new-kb__title" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createKB.title), h("p", { class: "body-regular-m" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createKB.description)), h("section", { class: "section-create-new-kb__actions scrollable" }, h("article", {
|
|
190
|
+
}, h("h1", { class: "heading-5 section-create-new-kb__title" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createKB.title), h("p", { class: "body-regular-m" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createKB.description)), renderCardsContainer && (h("section", { class: "section-create-new-kb__actions scrollable" }, renderCreateProjectCard && (h("article", {
|
|
188
191
|
// create project
|
|
189
192
|
class: "card card-filled"
|
|
190
|
-
}, h("header", { class: "card__header" }, h("div", { class: "card__header-description" }, h("h2", { class: "subtitle-semi-bold-xs card__header-title" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createProject.title), h("p", { class: "body-regular-s" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createProject.description))), h("footer", { class: "card__footer" }, h("button", { class: "button-primary", onClick: __classPrivateFieldGet(this, _GxIdeStartPage_createKBClickHandler, "f").call(this, false) }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createProject.buttonCaption))), h("article", {
|
|
193
|
+
}, h("header", { class: "card__header" }, h("div", { class: "card__header-description" }, h("h2", { class: "subtitle-semi-bold-xs card__header-title" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createProject.title), h("p", { class: "body-regular-s" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createProject.description))), h("footer", { class: "card__footer" }, h("button", { class: "button-primary", onClick: __classPrivateFieldGet(this, _GxIdeStartPage_createKBClickHandler, "f").call(this, false) }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createProject.buttonCaption)))), renderOpenProjectCard && (h("article", {
|
|
191
194
|
// open existing project
|
|
192
195
|
class: "card-filled"
|
|
193
|
-
}, h("header", { class: "card__header" }, h("div", { class: "card__header-description" }, h("h2", { class: "subtitle-semi-bold-xs" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").openExistingProject.title), h("p", { class: "body-regular-s" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").openExistingProject
|
|
196
|
+
}, h("header", { class: "card__header" }, h("div", { class: "card__header-description" }, h("h2", { class: "subtitle-semi-bold-xs" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").openExistingProject.title), h("p", { class: "body-regular-s" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").openExistingProject
|
|
197
|
+
.description))), h("footer", { class: "card__footer" }, h("button", { class: "button-secondary cancel-btn", onClick: __classPrivateFieldGet(this, _GxIdeStartPage_createKBClickHandler, "f").call(this, true) }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").openExistingProject
|
|
198
|
+
.buttonCaption)))), renderViewSamplesCard ? (h("article", {
|
|
194
199
|
// view samples
|
|
195
200
|
class: "card-filled"
|
|
196
201
|
}, h("header", { class: "card__header" }, h("div", { class: "card__header-description" }, h("h2", { class: "subtitle-semi-bold-xs" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").viewSamples.title), h("p", { class: "body-regular-s" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").viewSamples.description))), h("footer", { class: "card__footer" }, h("div", { class: "buttons-spacer samples-buttons-container" }, this.samples.map(sample => {
|
|
197
202
|
return (h("button", { class: "button-secondary", onClick: () => this.openSampleCallback(sample) }, sample.name));
|
|
198
|
-
}))))) : null)), h("section", { class: "section-secondary scrollable" }, this.loading ? (h("gx-ide-loader", { class: "loader", loaderTitle: __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").recentKBs.loaderTitle, description: __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").recentKBs.loaderDescription, show: true })) : (__classPrivateFieldGet(this, _GxIdeStartPage_instances, "m", _GxIdeStartPage_evaluateContentToRender).call(this))))));
|
|
203
|
+
}))))) : null))), h("section", { class: "section-secondary scrollable" }, this.loading ? (h("gx-ide-loader", { class: "loader", loaderTitle: __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").recentKBs.loaderTitle, description: __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").recentKBs.loaderDescription, show: true })) : (__classPrivateFieldGet(this, _GxIdeStartPage_instances, "m", _GxIdeStartPage_evaluateContentToRender).call(this))))));
|
|
199
204
|
}
|
|
200
205
|
static get is() { return "gx-ide-start-page"; }
|
|
201
206
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-page.js","sourceRoot":"","sources":["../../../src/components/start-page/start-page.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,UAAU;AACV,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,kBAAkB;AAClB,OAAO,EAAkB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAA2B,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGjD,SAAS;AACT,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,wFAAwF;AAExF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,kBAAkB,GAAgB;IACtC,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;CACd,CAAC;AAEF,MAAM,WAAW,GAAG,WAAW,CAAC;IAC9B,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,S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ChC,CACO,CACL,CACF,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;;IAzSG,OAAO,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC;QACpC,CAAC,CAAC,uBAAA,IAAI,wCAAkB,MAAtB,IAAI,CAAoB;QAC1B,CAAC,CAAC,uBAAA,IAAI,8CAAwB,MAA5B,IAAI,CAA0B,CAAC;AACrC,CAAC","sourcesContent":["// Stencil\nimport { Component, Host, h, Prop, State, Element, Watch } from \"@stencil/core\";\n// Other Libraries\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport { formatDistanceToNow, Locale as LocaleDateFns } from \"date-fns\";\nimport { ja, zhCN, enUS } from \"date-fns/locale\";\n// import { enUS } from \"date-fns/locale\";\nimport { ChEditCustomEvent } from \"@genexus/chameleon-controls-library\";\n// Custom\nimport { Locale } from \"../../common/locale\";\n\n// const locale = enUS; // use `zhCN` for Chinese, `ja` for Japanese, `enUS` for English\n\nimport { formatDate } from \"../../common/helpers\";\n\nconst LANGS_DATE_FNS_MAP: LanguageMap = {\n \"en\": enUS,\n \"ja\": ja,\n \"zh-CN\": zhCN,\n \"zh-TW\": zhCN,\n \"zh-HK\": zhCN\n};\n\nconst DETAIL_ICON = getIconPath({\n category: \"system\",\n name: \"detail\",\n colorType: \"primary\"\n});\nconst FILTER_ICON = getIconPath({\n category: \"window-tools\",\n name: \"filter\",\n colorType: \"on-elevation\"\n});\nconst KB_DEFAULT_ICON = getIconPath({\n category: \"objects\",\n name: \"knowledge-base\"\n});\nconst SEARCH_ICON = getIconPath({\n category: \"system\",\n name: \"search\",\n colorType: \"on-elevation\"\n});\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"utils/typography\",\n \"utils/layout\",\n \"components/edit\",\n \"components/icon\",\n \"components/button\",\n \"chameleon/scrollbar\",\n \"utils/typography\"\n];\n\n@Component({\n tag: \"gx-ide-start-page\",\n styleUrl: \"start-page.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/start-page\"]\n})\nexport class GxIdeStartPage {\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 #userLanguage: LocaleDateFns;\n\n @Element() el: HTMLGxIdeStartPageElement;\n\n /**\n * The kbs after the filter value.\n */\n @State() filteredKbs: RecentKBData[];\n\n @State() kbFilterValue: string = \"\";\n @Watch(\"kbFilterValue\")\n kbFilterValueChanged(newKbFilterValue: string) {\n this.filteredKbs = this.kbs.filter(kb =>\n kb.name.toLowerCase().includes(newKbFilterValue.toLocaleLowerCase())\n );\n }\n\n /**\n * True if the start page is waiting, either for the kb's list or the secondary section.\n */\n @State() loading: boolean = true;\n\n /**\n * Callback invoked to create a new KB. It must be specified whether this create is create from server or not, through the parameter 'fromServer'.\n */\n @Prop() readonly createKBCallback!: (fromServer: boolean) => Promise<void>;\n\n /**\n * User's kbs array\n */\n @Prop() readonly kbs: RecentKBData[];\n @Watch(\"kbs\")\n kbsChanged(newKbs: RecentKBData[]) {\n this.filteredKbs = newKbs;\n this.kbFilterValue = \"\"; // clear filter\n }\n\n /**\n * The minimum required of kbs to display a filter.\n */\n @Prop() readonly kbsFilterThreshold: number;\n\n /**\n * Callback invoked to open a KB when the user clicks on a KB card.\n */\n @Prop() readonly openKbCallback!: (id: string) => Promise<void>;\n\n /**\n * Callback invoked when the user clicks a button to open a sample.\n */\n @Prop() readonly openSampleCallback!: (sample: SampleData) => Promise<void>;\n\n /**\n * List of samples available to be displayed in the samples card.\n */\n @Prop() readonly samples?: SampleData[];\n\n /**\n * The secondary section that will appear below the \"Create a new Knowledge Base\" main section. This section will be displayed if there are no recent kbs.\n */\n @Prop() readonly secondarySection?: SecondarySection;\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n\n // initialize filteredKbs\n this.kbsChanged(this.kbs);\n\n // get user language to display the kb \"last opened\" value in the appropriate language.\n const userLanguage: keyof LanguageMap = document.documentElement\n .lang as keyof LanguageMap;\n this.#userLanguage = LANGS_DATE_FNS_MAP[userLanguage];\n }\n\n #createKBClickHandler = (fromServer: boolean) => (event: MouseEvent) => {\n event.stopPropagation();\n this.createKBCallback(fromServer);\n };\n\n #filterKbs = (event: ChEditCustomEvent<string> | InputEvent) => {\n this.kbFilterValue = event.detail as string;\n };\n\n #openKbClickHandler = (kbId: string) => (event: MouseEvent) => {\n event.stopPropagation();\n this.openKbCallback(kbId);\n };\n\n // renders\n\n #evaluateContentToRender() {\n return this.kbs && this.kbs.length > 0\n ? this.#renderKbsSection()\n : this.#renderSecondarySection();\n }\n\n #renderKbsSection = () => {\n const hideKbsFilter = this.kbs.length < this.kbsFilterThreshold;\n const kbsListEmpty = this.filteredKbs.length === 0;\n let contentToRender: HTMLGxgIdeLoaderElement | HTMLElement[];\n\n // Evaluate what is the content to display.\n if (this.filteredKbs.length > 0) {\n contentToRender = this.#renderKbs();\n } else {\n // No kb has pass the filter. Display an empty-state.\n contentToRender = (\n <gx-ide-empty-state\n isAnimated\n stateIconSrc={FILTER_ICON}\n stateTitle={this.#componentLocale.recentKBs.noMatches}\n ></gx-ide-empty-state>\n );\n }\n\n return (\n <section class=\"section-kbs\">\n <header\n class={{\n \"section-kbs__header\": true\n }}\n >\n <label\n class=\"subtitle-regular-s section-kbs__title\"\n htmlFor=\"filter-kbs\"\n >\n {this.#componentLocale.recentKBs.title}\n </label>\n <ch-edit\n // Render always, and display or hide, ro prevent FOUC, and also prevent\n // the header block-size from growing a little bit when the input renders.\n id=\"filter-kbs\"\n value={this.kbFilterValue}\n class={{\n \"input\": true,\n \"section-kbs__filter--hidden\": hideKbsFilter\n }}\n startImgSrc={SEARCH_ICON}\n placeholder={this.#componentLocale.recentKBs.filterKbsPlaceholder}\n onInput={!hideKbsFilter && this.#filterKbs}\n disabled={hideKbsFilter}\n ></ch-edit>\n </header>\n\n <div\n class={{\n \"section-kbs__list\": true,\n \"section-kbs__list--empty\": kbsListEmpty,\n \"scrollable\": true\n }}\n >\n {this.filteredKbs.length > 0 ? this.#renderKbs() : contentToRender}\n </div>\n </section>\n );\n };\n\n #renderKbs = (): HTMLElement[] => {\n return this.filteredKbs?.map((kb, index) => {\n // relative time ago\n\n const relativeDate = kb.lastOpenedDate\n ? formatDistanceToNow(new Date(kb.lastOpenedDate), {\n addSuffix: true,\n locale: this.#userLanguage\n })\n : undefined;\n\n // convert date to date format, since toISOString() requires date as Date.\n const dateAsDate = kb.lastOpenedDate\n ? new Date(kb.lastOpenedDate)\n : undefined;\n\n let dateFormated = formatDate(dateAsDate, \"date-time-short\");\n\n // icon\n const kbIcon = kb.icon ?? KB_DEFAULT_ICON;\n\n return (\n <article class=\"kb__item\" key={index}>\n <div class=\"kb__details\">\n <ch-image class=\"icon-md\" src={kbIcon}></ch-image>\n <button\n class=\"body-regular-m kb__name\"\n onClick={this.#openKbClickHandler(kb.id)}\n >\n {kb.name}\n </button>\n </div>\n {relativeDate && (\n <p class=\"body-regular-m kb__modified\">\n {`${this.#componentLocale.recentKBs.opened}`}{\" \"}\n <time dateTime={dateFormated}>{dateFormated}</time>\n </p>\n )}\n </article>\n );\n });\n };\n\n #renderSecondarySection = (): HTMLElement | null => {\n if (!this.secondarySection) {\n return null;\n }\n\n const multipleCards = this.secondarySection.cards.length > 2;\n\n return (\n <section\n // Recent Knowledge Bases\n class=\"section-no-kbs\"\n >\n <header>\n <h2 class=\"body-regular-s section-secondary__title\">\n {this.secondarySection.title}\n </h2>\n </header>\n\n <section\n class={{\n \"section-secondary__actions\": true,\n \"section-secondary__actions--two-cards\": !multipleCards,\n \"section-secondary__actions--multiple-cards\": multipleCards,\n \"scrollable\": true\n }}\n >\n {this.secondarySection.cards.map((card, index) => {\n return (\n <article class=\"card card-outlined\" key={index}>\n <span class=\"icon-capsule\">\n <ch-image\n class=\"icon-md icon-circular\"\n src={card.icon.src}\n aria-label={card.icon.ariaLabel}\n ></ch-image>\n </span>\n <header class=\"card__header\">\n <h2 class=\"subtitle-semi-bold-xs card__header-title\">\n {card.title}\n </h2>\n {card.description.map(paragraph => (\n <p class=\"body-regular-s card__header-description\">\n {paragraph}\n </p>\n ))}\n {card.action && (\n <button\n class=\"button-tertiary button-icon-and-text button-tertiary-no-padding-inline-start\"\n onClick={card.action.callback && card.action.callback}\n >\n <ch-image class=\"icon-md\" src={DETAIL_ICON}></ch-image>\n {card.action.caption}\n </button>\n )}\n </header>\n </article>\n );\n })}\n </section>\n </section>\n );\n };\n\n render() {\n this.loading =\n (!this.kbs || this.kbs?.length === 0) && !this.secondarySection;\n\n const renderViewSamplesCard =\n this.samples?.length && this.openSampleCallback;\n\n return (\n <Host class=\"scrollable\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <main class=\"main scrollable\">\n <section\n // Create a new Knowledge Base\n class=\"section-create-new-kb\"\n >\n <header\n // main header\n class=\"section-create-new-kb__header\"\n >\n <h1 class=\"heading-5 section-create-new-kb__title\">\n {this.#componentLocale.createKB.title}\n </h1>\n <p class=\"body-regular-m\">\n {this.#componentLocale.createKB.description}\n </p>\n </header>\n\n <section class=\"section-create-new-kb__actions scrollable\">\n <article\n // create project\n class=\"card card-filled\"\n >\n <header class=\"card__header\">\n <div class=\"card__header-description\">\n <h2 class=\"subtitle-semi-bold-xs card__header-title\">\n {this.#componentLocale.createProject.title}\n </h2>\n <p class=\"body-regular-s\">\n {this.#componentLocale.createProject.description}\n </p>\n </div>\n </header>\n <footer class=\"card__footer\">\n <button\n class=\"button-primary\"\n onClick={this.#createKBClickHandler(false)}\n >\n {this.#componentLocale.createProject.buttonCaption}\n </button>\n </footer>\n </article>\n\n <article\n // open existing project\n class=\"card-filled\"\n >\n <header class=\"card__header\">\n <div class=\"card__header-description\">\n <h2 class=\"subtitle-semi-bold-xs\">\n {this.#componentLocale.openExistingProject.title}\n </h2>\n <p class=\"body-regular-s\">\n {this.#componentLocale.openExistingProject.description}\n </p>\n </div>\n </header>\n <footer class=\"card__footer\">\n <button\n class=\"button-secondary cancel-btn\"\n onClick={this.#createKBClickHandler(true)}\n >\n {this.#componentLocale.openExistingProject.buttonCaption}\n </button>\n </footer>\n </article>\n\n {renderViewSamplesCard ? (\n <article\n // view samples\n class=\"card-filled\"\n >\n <header class=\"card__header\">\n <div class=\"card__header-description\">\n <h2 class=\"subtitle-semi-bold-xs\">\n {this.#componentLocale.viewSamples.title}\n </h2>\n <p class=\"body-regular-s\">\n {this.#componentLocale.viewSamples.description}\n </p>\n </div>\n </header>\n <footer class=\"card__footer\">\n <div class=\"buttons-spacer samples-buttons-container\">\n {this.samples.map(sample => {\n return (\n <button\n class=\"button-secondary\"\n onClick={() => this.openSampleCallback(sample)}\n >\n {sample.name}\n </button>\n );\n })}\n </div>\n </footer>\n </article>\n ) : null}\n </section>\n </section>\n <section class=\"section-secondary scrollable\">\n {this.loading ? (\n <gx-ide-loader\n class=\"loader\"\n loaderTitle={this.#componentLocale.recentKBs.loaderTitle}\n description={this.#componentLocale.recentKBs.loaderDescription}\n show\n ></gx-ide-loader>\n ) : (\n this.#evaluateContentToRender()\n )}\n </section>\n </main>\n </Host>\n );\n }\n}\n\nexport type CardInfo = {\n icon?: {\n src: string;\n ariaLabel: string;\n };\n title: string;\n description: string[];\n action?: {\n iconSrc: string;\n caption: string;\n callback?: () => void;\n };\n};\n\ntype LanguageMap = {\n \"en\": LocaleDateFns;\n \"ja\": LocaleDateFns;\n \"zh-CN\": LocaleDateFns;\n \"zh-TW\": LocaleDateFns;\n \"zh-HK\": LocaleDateFns;\n};\n\nexport type RecentKBData = {\n id?: string;\n name: string;\n lastOpenedDate?: Date;\n icon: string;\n};\n\nexport type SampleData = {\n name: string;\n serverUrl: string;\n kbName: string;\n};\n\nexport type SecondarySection = {\n title: string;\n cards: CardInfo[];\n};\n"]}
|
|
1
|
+
{"version":3,"file":"start-page.js","sourceRoot":"","sources":["../../../src/components/start-page/start-page.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,UAAU;AACV,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,kBAAkB;AAClB,OAAO,EAAkB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAA2B,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGjD,SAAS;AACT,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,wFAAwF;AAExF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,kBAAkB,GAAgB;IACtC,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;CACd,CAAC;AAEF,MAAM,WAAW,GAAG,WAAW,CAAC;IAC9B,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AACH,MAAM,WAAW,GAAG,WAAW,CAAC;IAC9B,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,cAAc;CAC1B,CAAC,CAAC;AACH,MAAM,eAAe,GAAG,WAAW,CAAC;IAClC,QAAQ,EAAE,SAAS;IACnB,IAAI,EAAE,gBAAgB;CACvB,CAAC,CAAC;AACH,MAAM,WAAW,GAAG,WAAW,CAAC;IAC9B,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,cAAc;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;;IAzTG,OAAO,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC;QACpC,CAAC,CAAC,uBAAA,IAAI,wCAAkB,MAAtB,IAAI,CAAoB;QAC1B,CAAC,CAAC,uBAAA,IAAI,8CAAwB,MAA5B,IAAI,CAA0B,CAAC;AACrC,CAAC","sourcesContent":["// Stencil\nimport { Component, Host, h, Prop, State, Element, Watch } from \"@stencil/core\";\n// Other Libraries\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport { formatDistanceToNow, Locale as LocaleDateFns } from \"date-fns\";\nimport { ja, zhCN, enUS } from \"date-fns/locale\";\n// import { enUS } from \"date-fns/locale\";\nimport { ChEditCustomEvent } from \"@genexus/chameleon-controls-library\";\n// Custom\nimport { Locale } from \"../../common/locale\";\n\n// const locale = enUS; // use `zhCN` for Chinese, `ja` for Japanese, `enUS` for English\n\nimport { formatDate } from \"../../common/helpers\";\n\nconst LANGS_DATE_FNS_MAP: LanguageMap = {\n \"en\": enUS,\n \"ja\": ja,\n \"zh-CN\": zhCN,\n \"zh-TW\": zhCN,\n \"zh-HK\": zhCN\n};\n\nconst DETAIL_ICON = getIconPath({\n category: \"system\",\n name: \"detail\",\n colorType: \"primary\"\n});\nconst FILTER_ICON = getIconPath({\n category: \"window-tools\",\n name: \"filter\",\n colorType: \"on-elevation\"\n});\nconst KB_DEFAULT_ICON = getIconPath({\n category: \"objects\",\n name: \"knowledge-base\"\n});\nconst SEARCH_ICON = getIconPath({\n category: \"system\",\n name: \"search\",\n colorType: \"on-elevation\"\n});\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"utils/typography\",\n \"utils/layout\",\n \"components/edit\",\n \"components/icon\",\n \"components/button\",\n \"chameleon/scrollbar\",\n \"utils/typography\"\n];\n\n@Component({\n tag: \"gx-ide-start-page\",\n styleUrl: \"start-page.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/start-page\"]\n})\nexport class GxIdeStartPage {\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 #userLanguage: LocaleDateFns;\n\n @Element() el: HTMLGxIdeStartPageElement;\n\n /**\n * The kbs after the filter value.\n */\n @State() filteredKbs: RecentKBData[];\n\n @State() kbFilterValue: string = \"\";\n @Watch(\"kbFilterValue\")\n kbFilterValueChanged(newKbFilterValue: string) {\n this.filteredKbs = this.kbs.filter(kb =>\n kb.name.toLowerCase().includes(newKbFilterValue.toLocaleLowerCase())\n );\n }\n\n /**\n * True if the start page is waiting, either for the kb's list or the secondary section.\n */\n @State() loading: boolean = true;\n\n /**\n * Callback invoked to create a new KB. It must be specified whether this create is create from server or not, through the parameter 'fromServer'.\n */\n @Prop() readonly createKBCallback!: (fromServer: boolean) => Promise<void>;\n\n /**\n * User's kbs array\n */\n @Prop() readonly kbs: RecentKBData[];\n @Watch(\"kbs\")\n kbsChanged(newKbs: RecentKBData[]) {\n this.filteredKbs = newKbs;\n this.kbFilterValue = \"\"; // clear filter\n }\n\n /**\n * The minimum required of kbs to display a filter.\n */\n @Prop() readonly kbsFilterThreshold: number;\n\n /**\n * Callback invoked to open a KB when the user clicks on a KB card.\n */\n @Prop() readonly openKbCallback!: (id: string) => Promise<void>;\n\n /**\n * Callback invoked when the user clicks a button to open a sample.\n */\n @Prop() readonly openSampleCallback!: (sample: SampleData) => Promise<void>;\n\n /**\n * List of samples available to be displayed in the samples card.\n */\n @Prop() readonly samples?: SampleData[];\n\n /**\n * The secondary section that will appear below the \"Create a new Knowledge Base\" main section. This section will be displayed if there are no recent kbs.\n */\n @Prop() readonly secondarySection?: SecondarySection;\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n\n // initialize filteredKbs\n this.kbsChanged(this.kbs);\n\n // get user language to display the kb \"last opened\" value in the appropriate language.\n const userLanguage: keyof LanguageMap = document.documentElement\n .lang as keyof LanguageMap;\n this.#userLanguage = LANGS_DATE_FNS_MAP[userLanguage];\n }\n\n #createKBClickHandler = (fromServer: boolean) => (event: MouseEvent) => {\n event.stopPropagation();\n this.createKBCallback(fromServer);\n };\n\n #filterKbs = (event: ChEditCustomEvent<string> | InputEvent) => {\n this.kbFilterValue = event.detail as string;\n };\n\n #openKbClickHandler = (kbId: string) => (event: MouseEvent) => {\n event.stopPropagation();\n this.openKbCallback(kbId);\n };\n\n // renders\n\n #evaluateContentToRender() {\n return this.kbs && this.kbs.length > 0\n ? this.#renderKbsSection()\n : this.#renderSecondarySection();\n }\n\n #renderKbsSection = () => {\n const hideKbsFilter = this.kbs.length < this.kbsFilterThreshold;\n const kbsListEmpty = this.filteredKbs.length === 0;\n let contentToRender: HTMLGxgIdeLoaderElement | HTMLElement[];\n\n // Evaluate what is the content to display.\n if (this.filteredKbs.length > 0) {\n contentToRender = this.#renderKbs();\n } else {\n // No kb has pass the filter. Display an empty-state.\n contentToRender = (\n <gx-ide-empty-state\n isAnimated\n stateIconSrc={FILTER_ICON}\n stateTitle={this.#componentLocale.recentKBs.noMatches}\n ></gx-ide-empty-state>\n );\n }\n\n return (\n <section class=\"section-kbs\">\n <header\n class={{\n \"section-kbs__header\": true\n }}\n >\n <label\n class=\"subtitle-regular-s section-kbs__title\"\n htmlFor=\"filter-kbs\"\n >\n {this.#componentLocale.recentKBs.title}\n </label>\n <ch-edit\n // Render always, and display or hide, ro prevent FOUC, and also prevent\n // the header block-size from growing a little bit when the input renders.\n id=\"filter-kbs\"\n value={this.kbFilterValue}\n class={{\n \"input\": true,\n \"section-kbs__filter--hidden\": hideKbsFilter\n }}\n startImgSrc={SEARCH_ICON}\n placeholder={this.#componentLocale.recentKBs.filterKbsPlaceholder}\n onInput={!hideKbsFilter && this.#filterKbs}\n disabled={hideKbsFilter}\n ></ch-edit>\n </header>\n\n <div\n class={{\n \"section-kbs__list\": true,\n \"section-kbs__list--empty\": kbsListEmpty,\n \"scrollable\": true\n }}\n >\n {this.filteredKbs.length > 0 ? this.#renderKbs() : contentToRender}\n </div>\n </section>\n );\n };\n\n #renderKbs = (): HTMLElement[] => {\n return this.filteredKbs?.map((kb, index) => {\n // relative time ago\n\n const relativeDate = kb.lastOpenedDate\n ? formatDistanceToNow(new Date(kb.lastOpenedDate), {\n addSuffix: true,\n locale: this.#userLanguage\n })\n : undefined;\n\n // convert date to date format, since toISOString() requires date as Date.\n const dateAsDate = kb.lastOpenedDate\n ? new Date(kb.lastOpenedDate)\n : undefined;\n\n let dateFormated = formatDate(dateAsDate, \"date-time-short\");\n\n // icon\n const kbIcon = kb.icon ?? KB_DEFAULT_ICON;\n\n return (\n <article class=\"kb__item\" key={index}>\n <div class=\"kb__details\">\n <ch-image class=\"icon-md\" src={kbIcon}></ch-image>\n <button\n class=\"body-regular-m kb__name\"\n onClick={this.#openKbClickHandler(kb.id)}\n >\n {kb.name}\n </button>\n </div>\n {relativeDate && (\n <p class=\"body-regular-m kb__modified\">\n {`${this.#componentLocale.recentKBs.opened}`}{\" \"}\n <time dateTime={dateFormated}>{dateFormated}</time>\n </p>\n )}\n </article>\n );\n });\n };\n\n #renderSecondarySection = (): HTMLElement | null => {\n if (!this.secondarySection) {\n return null;\n }\n\n const multipleCards = this.secondarySection.cards.length > 2;\n\n return (\n <section\n // Recent Knowledge Bases\n class=\"section-no-kbs\"\n >\n <header>\n <h2 class=\"body-regular-s section-secondary__title\">\n {this.secondarySection.title}\n </h2>\n </header>\n\n <section\n class={{\n \"section-secondary__actions\": true,\n \"section-secondary__actions--two-cards\": !multipleCards,\n \"section-secondary__actions--multiple-cards\": multipleCards,\n \"scrollable\": true\n }}\n >\n {this.secondarySection.cards.map((card, index) => {\n return (\n <article class=\"card card-outlined\" key={index}>\n <span class=\"icon-capsule\">\n <ch-image\n class=\"icon-md icon-circular\"\n src={card.icon.src}\n aria-label={card.icon.ariaLabel}\n ></ch-image>\n </span>\n <header class=\"card__header\">\n <h2 class=\"subtitle-semi-bold-xs card__header-title\">\n {card.title}\n </h2>\n {card.description.map(paragraph => (\n <p class=\"body-regular-s card__header-description\">\n {paragraph}\n </p>\n ))}\n {card.action && (\n <button\n class=\"button-tertiary button-icon-and-text button-tertiary-no-padding-inline-start\"\n onClick={card.action.callback && card.action.callback}\n >\n <ch-image class=\"icon-md\" src={DETAIL_ICON}></ch-image>\n {card.action.caption}\n </button>\n )}\n </header>\n </article>\n );\n })}\n </section>\n </section>\n );\n };\n\n render() {\n this.loading =\n (!this.kbs || this.kbs?.length === 0) && !this.secondarySection;\n\n const renderCreateProjectCard = this.createKBCallback;\n const renderOpenProjectCard = this.openKbCallback;\n const renderViewSamplesCard =\n this.samples?.length && this.openSampleCallback;\n const renderCardsContainer =\n renderCreateProjectCard || renderOpenProjectCard || renderViewSamplesCard;\n\n return (\n <Host class=\"scrollable\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <main class=\"main scrollable\">\n <section\n // Create a new Knowledge Base\n class=\"section-create-new-kb\"\n >\n <header\n // main header\n class=\"section-create-new-kb__header\"\n >\n <h1 class=\"heading-5 section-create-new-kb__title\">\n {this.#componentLocale.createKB.title}\n </h1>\n <p class=\"body-regular-m\">\n {this.#componentLocale.createKB.description}\n </p>\n </header>\n\n {renderCardsContainer && (\n <section class=\"section-create-new-kb__actions scrollable\">\n {renderCreateProjectCard && (\n <article\n // create project\n class=\"card card-filled\"\n >\n <header class=\"card__header\">\n <div class=\"card__header-description\">\n <h2 class=\"subtitle-semi-bold-xs card__header-title\">\n {this.#componentLocale.createProject.title}\n </h2>\n <p class=\"body-regular-s\">\n {this.#componentLocale.createProject.description}\n </p>\n </div>\n </header>\n <footer class=\"card__footer\">\n <button\n class=\"button-primary\"\n onClick={this.#createKBClickHandler(false)}\n >\n {this.#componentLocale.createProject.buttonCaption}\n </button>\n </footer>\n </article>\n )}\n\n {renderOpenProjectCard && (\n <article\n // open existing project\n class=\"card-filled\"\n >\n <header class=\"card__header\">\n <div class=\"card__header-description\">\n <h2 class=\"subtitle-semi-bold-xs\">\n {this.#componentLocale.openExistingProject.title}\n </h2>\n <p class=\"body-regular-s\">\n {\n this.#componentLocale.openExistingProject\n .description\n }\n </p>\n </div>\n </header>\n <footer class=\"card__footer\">\n <button\n class=\"button-secondary cancel-btn\"\n onClick={this.#createKBClickHandler(true)}\n >\n {\n this.#componentLocale.openExistingProject\n .buttonCaption\n }\n </button>\n </footer>\n </article>\n )}\n\n {renderViewSamplesCard ? (\n <article\n // view samples\n class=\"card-filled\"\n >\n <header class=\"card__header\">\n <div class=\"card__header-description\">\n <h2 class=\"subtitle-semi-bold-xs\">\n {this.#componentLocale.viewSamples.title}\n </h2>\n <p class=\"body-regular-s\">\n {this.#componentLocale.viewSamples.description}\n </p>\n </div>\n </header>\n <footer class=\"card__footer\">\n <div class=\"buttons-spacer samples-buttons-container\">\n {this.samples.map(sample => {\n return (\n <button\n class=\"button-secondary\"\n onClick={() => this.openSampleCallback(sample)}\n >\n {sample.name}\n </button>\n );\n })}\n </div>\n </footer>\n </article>\n ) : null}\n </section>\n )}\n </section>\n <section class=\"section-secondary scrollable\">\n {this.loading ? (\n <gx-ide-loader\n class=\"loader\"\n loaderTitle={this.#componentLocale.recentKBs.loaderTitle}\n description={this.#componentLocale.recentKBs.loaderDescription}\n show\n ></gx-ide-loader>\n ) : (\n this.#evaluateContentToRender()\n )}\n </section>\n </main>\n </Host>\n );\n }\n}\n\nexport type CardInfo = {\n icon?: {\n src: string;\n ariaLabel: string;\n };\n title: string;\n description: string[];\n action?: {\n iconSrc: string;\n caption: string;\n callback?: () => void;\n };\n};\n\ntype LanguageMap = {\n \"en\": LocaleDateFns;\n \"ja\": LocaleDateFns;\n \"zh-CN\": LocaleDateFns;\n \"zh-TW\": LocaleDateFns;\n \"zh-HK\": LocaleDateFns;\n};\n\nexport type RecentKBData = {\n id?: string;\n name: string;\n lastOpenedDate?: Date;\n icon: string;\n};\n\nexport type SampleData = {\n name: string;\n serverUrl: string;\n kbName: string;\n};\n\nexport type SecondarySection = {\n title: string;\n cards: CardInfo[];\n};\n"]}
|
|
@@ -2677,25 +2677,30 @@ const GxIdeStartPage$1 = /*@__PURE__*/ proxyCustomElement(class GxIdeStartPage e
|
|
|
2677
2677
|
var _a, _b;
|
|
2678
2678
|
this.loading =
|
|
2679
2679
|
(!this.kbs || ((_a = this.kbs) === null || _a === void 0 ? void 0 : _a.length) === 0) && !this.secondarySection;
|
|
2680
|
+
const renderCreateProjectCard = this.createKBCallback;
|
|
2681
|
+
const renderOpenProjectCard = this.openKbCallback;
|
|
2680
2682
|
const renderViewSamplesCard = ((_b = this.samples) === null || _b === void 0 ? void 0 : _b.length) && this.openSampleCallback;
|
|
2683
|
+
const renderCardsContainer = renderCreateProjectCard || renderOpenProjectCard || renderViewSamplesCard;
|
|
2681
2684
|
return (h(Host, { class: "scrollable" }, h("ch-theme", { model: CSS_BUNDLES }), h("main", { class: "main scrollable" }, h("section", {
|
|
2682
2685
|
// Create a new Knowledge Base
|
|
2683
2686
|
class: "section-create-new-kb"
|
|
2684
2687
|
}, h("header", {
|
|
2685
2688
|
// main header
|
|
2686
2689
|
class: "section-create-new-kb__header"
|
|
2687
|
-
}, h("h1", { class: "heading-5 section-create-new-kb__title" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createKB.title), h("p", { class: "body-regular-m" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createKB.description)), h("section", { class: "section-create-new-kb__actions scrollable" }, h("article", {
|
|
2690
|
+
}, h("h1", { class: "heading-5 section-create-new-kb__title" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createKB.title), h("p", { class: "body-regular-m" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createKB.description)), renderCardsContainer && (h("section", { class: "section-create-new-kb__actions scrollable" }, renderCreateProjectCard && (h("article", {
|
|
2688
2691
|
// create project
|
|
2689
2692
|
class: "card card-filled"
|
|
2690
|
-
}, h("header", { class: "card__header" }, h("div", { class: "card__header-description" }, h("h2", { class: "subtitle-semi-bold-xs card__header-title" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createProject.title), h("p", { class: "body-regular-s" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createProject.description))), h("footer", { class: "card__footer" }, h("button", { class: "button-primary", onClick: __classPrivateFieldGet(this, _GxIdeStartPage_createKBClickHandler, "f").call(this, false) }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createProject.buttonCaption))), h("article", {
|
|
2693
|
+
}, h("header", { class: "card__header" }, h("div", { class: "card__header-description" }, h("h2", { class: "subtitle-semi-bold-xs card__header-title" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createProject.title), h("p", { class: "body-regular-s" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createProject.description))), h("footer", { class: "card__footer" }, h("button", { class: "button-primary", onClick: __classPrivateFieldGet(this, _GxIdeStartPage_createKBClickHandler, "f").call(this, false) }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").createProject.buttonCaption)))), renderOpenProjectCard && (h("article", {
|
|
2691
2694
|
// open existing project
|
|
2692
2695
|
class: "card-filled"
|
|
2693
|
-
}, h("header", { class: "card__header" }, h("div", { class: "card__header-description" }, h("h2", { class: "subtitle-semi-bold-xs" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").openExistingProject.title), h("p", { class: "body-regular-s" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").openExistingProject
|
|
2696
|
+
}, h("header", { class: "card__header" }, h("div", { class: "card__header-description" }, h("h2", { class: "subtitle-semi-bold-xs" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").openExistingProject.title), h("p", { class: "body-regular-s" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").openExistingProject
|
|
2697
|
+
.description))), h("footer", { class: "card__footer" }, h("button", { class: "button-secondary cancel-btn", onClick: __classPrivateFieldGet(this, _GxIdeStartPage_createKBClickHandler, "f").call(this, true) }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").openExistingProject
|
|
2698
|
+
.buttonCaption)))), renderViewSamplesCard ? (h("article", {
|
|
2694
2699
|
// view samples
|
|
2695
2700
|
class: "card-filled"
|
|
2696
2701
|
}, h("header", { class: "card__header" }, h("div", { class: "card__header-description" }, h("h2", { class: "subtitle-semi-bold-xs" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").viewSamples.title), h("p", { class: "body-regular-s" }, __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").viewSamples.description))), h("footer", { class: "card__footer" }, h("div", { class: "buttons-spacer samples-buttons-container" }, this.samples.map(sample => {
|
|
2697
2702
|
return (h("button", { class: "button-secondary", onClick: () => this.openSampleCallback(sample) }, sample.name));
|
|
2698
|
-
}))))) : null)), h("section", { class: "section-secondary scrollable" }, this.loading ? (h("gx-ide-loader", { class: "loader", loaderTitle: __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").recentKBs.loaderTitle, description: __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").recentKBs.loaderDescription, show: true })) : (__classPrivateFieldGet(this, _GxIdeStartPage_instances, "m", _GxIdeStartPage_evaluateContentToRender).call(this))))));
|
|
2703
|
+
}))))) : null))), h("section", { class: "section-secondary scrollable" }, this.loading ? (h("gx-ide-loader", { class: "loader", loaderTitle: __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").recentKBs.loaderTitle, description: __classPrivateFieldGet(this, _GxIdeStartPage_componentLocale, "f").recentKBs.loaderDescription, show: true })) : (__classPrivateFieldGet(this, _GxIdeStartPage_instances, "m", _GxIdeStartPage_evaluateContentToRender).call(this))))));
|
|
2699
2704
|
}
|
|
2700
2705
|
static get assetsDirs() { return ["gx-ide-assets/start-page"]; }
|
|
2701
2706
|
get el() { return this; }
|