@genexus/genexus-ide-ui 0.0.139 → 0.0.141

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.
Files changed (81) hide show
  1. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  2. package/dist/cjs/gx-ide-bpm-import-files.cjs.entry.js +103 -0
  3. package/dist/cjs/gx-ide-bpm-import-files.cjs.entry.js.map +1 -0
  4. package/dist/cjs/gx-ide-design-import.cjs.entry.js +567 -0
  5. package/dist/cjs/gx-ide-design-import.cjs.entry.js.map +1 -0
  6. package/dist/cjs/gx-ide-entity-selector.cjs.entry.js +1 -1
  7. package/dist/cjs/gx-ide-entity-selector.cjs.entry.js.map +1 -1
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/collection/collection-manifest.json +4 -4
  10. package/dist/collection/components/_helpers/entity-selector/entity-selector.css +2 -2
  11. package/dist/collection/components/_helpers/entity-selector/entity-selector.js.map +1 -1
  12. package/dist/collection/components/bpm/import-files/gx-ide-assets/bpm-import-files/langs/bpm-import-files.lang.en.json +18 -0
  13. package/dist/collection/components/bpm/import-files/helpers.js.map +1 -0
  14. package/dist/collection/components/bpm/{files-selector/files-selector.css → import-files/import-files.css} +27 -0
  15. package/dist/collection/components/bpm/{files-selector/files-selector.js → import-files/import-files.js} +32 -33
  16. package/dist/collection/components/bpm/import-files/import-files.js.map +1 -0
  17. package/dist/collection/components/{import-from-design/import-from-design.js → design-import/design-import.js} +115 -64
  18. package/dist/collection/components/design-import/design-import.js.map +1 -0
  19. package/dist/collection/components/{import-from-design/gx-ide-assets/import-from-design/langs/import-from-design.lang.en.json → design-import/gx-ide-assets/design-import/langs/design-import.lang.en.json} +2 -1
  20. package/dist/components/entity-selector.js +1 -1
  21. package/dist/components/entity-selector.js.map +1 -1
  22. package/dist/components/gx-ide-bpm-import-files.d.ts +11 -0
  23. package/dist/components/gx-ide-bpm-import-files.js +172 -0
  24. package/dist/components/gx-ide-bpm-import-files.js.map +1 -0
  25. package/dist/components/gx-ide-design-import.d.ts +11 -0
  26. package/dist/components/{gx-ide-import-from-design.js → gx-ide-design-import.js} +95 -49
  27. package/dist/components/gx-ide-design-import.js.map +1 -0
  28. package/dist/esm/genexus-ide-ui.js +1 -1
  29. package/dist/esm/gx-ide-bpm-import-files.entry.js +99 -0
  30. package/dist/esm/gx-ide-bpm-import-files.entry.js.map +1 -0
  31. package/dist/esm/gx-ide-design-import.entry.js +563 -0
  32. package/dist/esm/gx-ide-design-import.entry.js.map +1 -0
  33. package/dist/esm/gx-ide-entity-selector.entry.js +1 -1
  34. package/dist/esm/gx-ide-entity-selector.entry.js.map +1 -1
  35. package/dist/esm/loader.js +1 -1
  36. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  37. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
  38. package/dist/genexus-ide-ui/gx-ide-assets/bpm-import-files/langs/bpm-import-files.lang.en.json +18 -0
  39. package/dist/genexus-ide-ui/gx-ide-assets/{import-from-design/langs/import-from-design.lang.en.json → design-import/langs/design-import.lang.en.json} +2 -1
  40. package/dist/genexus-ide-ui/{p-82291acd.entry.js → p-03b2a741.entry.js} +43 -19
  41. package/dist/genexus-ide-ui/p-03b2a741.entry.js.map +1 -0
  42. package/dist/genexus-ide-ui/{p-9bf62c5c.entry.js → p-c46c7974.entry.js} +244 -175
  43. package/dist/genexus-ide-ui/p-c46c7974.entry.js.map +1 -0
  44. package/dist/genexus-ide-ui/{p-3345a1bc.entry.js → p-e07809d0.entry.js} +2 -2
  45. package/dist/genexus-ide-ui/p-e07809d0.entry.js.map +1 -0
  46. package/dist/types/components/bpm/{files-selector/files-selector.d.ts → import-files/import-files.d.ts} +11 -5
  47. package/dist/types/components/{import-from-design/import-from-design.d.ts → design-import/design-import.d.ts} +24 -10
  48. package/dist/types/components.d.ts +202 -200
  49. package/package.json +1 -1
  50. package/dist/cjs/gx-ide-bpm-files-selector.cjs.entry.js +0 -101
  51. package/dist/cjs/gx-ide-bpm-files-selector.cjs.entry.js.map +0 -1
  52. package/dist/cjs/gx-ide-import-from-design.cjs.entry.js +0 -522
  53. package/dist/cjs/gx-ide-import-from-design.cjs.entry.js.map +0 -1
  54. package/dist/collection/components/bpm/files-selector/files-selector.js.map +0 -1
  55. package/dist/collection/components/bpm/files-selector/gx-ide-assets/bpm-files-selector/langs/bpm-files-selector.lang.en.json +0 -14
  56. package/dist/collection/components/bpm/files-selector/helpers.js.map +0 -1
  57. package/dist/collection/components/import-from-design/import-from-design.js.map +0 -1
  58. package/dist/components/gx-ide-bpm-files-selector.d.ts +0 -11
  59. package/dist/components/gx-ide-bpm-files-selector.js +0 -164
  60. package/dist/components/gx-ide-bpm-files-selector.js.map +0 -1
  61. package/dist/components/gx-ide-import-from-design.d.ts +0 -11
  62. package/dist/components/gx-ide-import-from-design.js.map +0 -1
  63. package/dist/esm/gx-ide-bpm-files-selector.entry.js +0 -97
  64. package/dist/esm/gx-ide-bpm-files-selector.entry.js.map +0 -1
  65. package/dist/esm/gx-ide-import-from-design.entry.js +0 -518
  66. package/dist/esm/gx-ide-import-from-design.entry.js.map +0 -1
  67. package/dist/genexus-ide-ui/gx-ide-assets/bpm-files-selector/langs/bpm-files-selector.lang.en.json +0 -14
  68. package/dist/genexus-ide-ui/p-3345a1bc.entry.js.map +0 -1
  69. package/dist/genexus-ide-ui/p-82291acd.entry.js.map +0 -1
  70. package/dist/genexus-ide-ui/p-9bf62c5c.entry.js.map +0 -1
  71. /package/dist/collection/components/bpm/{files-selector/gx-ide-assets/bpm-files-selector/langs/bpm-files-selector.lang.ja.json → import-files/gx-ide-assets/bpm-import-files/langs/bpm-import-files.lang.ja.json} +0 -0
  72. /package/dist/collection/components/bpm/{files-selector/gx-ide-assets/bpm-files-selector/langs/bpm-files-selector.lang.zh.json → import-files/gx-ide-assets/bpm-import-files/langs/bpm-import-files.lang.zh.json} +0 -0
  73. /package/dist/collection/components/bpm/{files-selector → import-files}/helpers.js +0 -0
  74. /package/dist/collection/components/{import-from-design/import-from-design.css → design-import/design-import.css} +0 -0
  75. /package/dist/collection/components/{import-from-design/gx-ide-assets/import-from-design/langs/import-from-design.lang.ja.json → design-import/gx-ide-assets/design-import/langs/design-import.lang.ja.json} +0 -0
  76. /package/dist/collection/components/{import-from-design/gx-ide-assets/import-from-design/langs/import-from-design.lang.zh.json → design-import/gx-ide-assets/design-import/langs/design-import.lang.zh.json} +0 -0
  77. /package/dist/genexus-ide-ui/gx-ide-assets/{bpm-files-selector/langs/bpm-files-selector.lang.ja.json → bpm-import-files/langs/bpm-import-files.lang.ja.json} +0 -0
  78. /package/dist/genexus-ide-ui/gx-ide-assets/{bpm-files-selector/langs/bpm-files-selector.lang.zh.json → bpm-import-files/langs/bpm-import-files.lang.zh.json} +0 -0
  79. /package/dist/genexus-ide-ui/gx-ide-assets/{import-from-design/langs/import-from-design.lang.ja.json → design-import/langs/design-import.lang.ja.json} +0 -0
  80. /package/dist/genexus-ide-ui/gx-ide-assets/{import-from-design/langs/import-from-design.lang.zh.json → design-import/langs/design-import.lang.zh.json} +0 -0
  81. /package/dist/types/components/bpm/{files-selector → import-files}/helpers.d.ts +0 -0
@@ -0,0 +1,563 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-5bd24426.js';
2
+ import { L as Locale } from './locale-3c32f251.js';
3
+ import { c as config } from './config-a492e15e.js';
4
+ import { r as renderFormItems } from './common-aaad5759.js';
5
+
6
+ const designImportCss = ":root{--ui-animaton-speed:0.2s}.gxg-title-01{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-01-font-weight);font-size:var(--ds-title-01-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-01--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-01-font-weight);font-size:var(--ds-title-01-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-title-02{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-02-font-weight);font-size:var(--ds-title-02-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-02--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-02-font-weight);font-size:var(--ds-title-02-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable);color:var(--color-on-primary)}.gxg-title-03{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-03-font-weight);font-size:var(--ds-title-03-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-03--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-03-font-weight);font-size:var(--ds-title-03-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-title-04{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-04-font-weight);font-size:var(--ds-title-04-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-04--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-04-font-weight);font-size:var(--ds-title-04-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-title-05{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-05-font-weight);font-size:var(--ds-title-05-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-05--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-05-font-weight);font-size:var(--ds-title-05-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-text{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable)}.gxg-text--negative{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-text--gray{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--dimmed)}.gxg-quote{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);font-style:italic}.gxg-quote--negative{color:var(--ds-base-font-color--negative)}.gxg-link{line-height:unset;font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--link);text-decoration:underline;cursor:pointer;display:inline-block}.gxg-link:hover{color:var(--ds-base-font-color--link-hover)}.gxg-link:active{color:var(--ds-base-font-color--link-active)}.gxg-link-gray{line-height:unset;font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--link);text-decoration:underline;cursor:pointer;display:inline-block;color:var(--ds-base-font-color--dimmed)}.gxg-link-gray:hover{line-height:unset;font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--link);text-decoration:underline;cursor:pointer;display:inline-block;color:var(--ds-base-font-color--dimmed);filter:brightness(1.4)}.gxg-alert-error{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--error);display:inline-block}.gxg-alert-warning{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--warning);display:inline-block}.gxg-alert-success{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--success);display:inline-block}.gxg-tab--disabled{color:var(--color-primary-disabled);pointer-events:none}.gxg-tab--disabled[disabled]{color:var(--color-primary-disabled);pointer-events:none}.gxg-label{font-family:var(--ds-base-font-family-primary);font-weight:var(--gxg-label-font-weight);font-size:var(--gxg-label-font-size);color:var(--gxg-label-color);text-align:center;line-height:1.455em;display:flex;align-items:center}.gxg-label:hover{color:var(--color-primary-hover)}.gxg-label:focus{color:var(--color-primary-active)}.gxg-label:active{color:var(--color-primary-active)}.gxg-label[disabled]{color:var(--color-primary-disabled)}.gxg-label--negative{color:var(--color-on-primary)}.gxg-label--negative[disabled]{color:var(--color-on-disabled)}.gxg-scrollbar{}.gxg-scrollbar::-webkit-scrollbar{width:var(--gxg-scrollbar-width);height:var(--gxg-scrollbar-width)}.gxg-scrollbar::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background);border-radius:var(--gxg-scrollbar-track-border-radius)}.gxg-scrollbar::-webkit-scrollbar-thumb{background-color:var(--gxg-scrollbar-track-thumb-background);border-radius:var(--gxg-scrollbar-track-thumb-radius)}.gxg-scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--gxg-scrollbar-track-thumb-hover-background)}.gxg-scrollbar::-webkit-scrollbar-corner{background:rgba(0, 0, 0, 0)}.gxi-hidden{display:none !important}.gxi-full-height{height:100%}.gxi-overflow-auto{overflow:auto}.gxi-display-flex{display:flex}.align-start{display:flex;align-items:start}.align-center{display:flex;align-items:center}.align-end{display:flex;align-items:end}.overflow-auto{overflow:auto}.justify-start{display:flex;justify-content:start}.justify-center{display:flex;justify-content:center}.justify-end{display:flex;justify-content:end}.grid{display:grid;grid-row-gap:var(--gx-ide-grid-row-gap);grid-column-gap:var(--gx-ide-grid-column-gap);grid-template-rows:auto}ch-grid-cell{display:flex}ch-grid{overflow:auto;height:100%}ch-grid-column{z-index:99;border-bottom:1px solid var(--mer-color__neutral-gray--800)}ch-grid-column:first-child{padding-inline-start:var(--gx-ide-container__padding) !important}ch-grid-column:last-child{padding-inline-end:var(--gx-ide-container__padding) !important}ch-grid-cell{--mer-spacing--xs:var(--gx-ide-container__padding)}.layout{display:grid;gap:var(--mer-spacing--lg);box-sizing:border-box}.layout--two-cols{grid-template-columns:1fr 1fr}.layout--space-above{padding-block-start:var(--mer-spacing--lg)}gxg-tabs{box-shadow:none}:host(.gx-ide-component){height:100% !important;display:flex !important;flex-direction:column !important}:host(:focus-within) gx-ide-top-bar::part(wrapper){background-color:var(--color-secondary-enabled)}.gx-ide-main-wrapper{color:var(--gx-ide-component-text-color);font-weight:var(--mer-font__weight--regular);font-size:var(--mer-font__size--xs);font-family:var(--mer-font-family--primary);height:100%;background-color:var(--gx-ide-component-background-color);display:flex;flex-direction:column;flex-grow:1;box-sizing:border-box}.gx-ide-main{flex-grow:1;overflow-y:auto;}.gx-ide-main::-webkit-scrollbar{width:var(--gxg-scrollbar-width);height:var(--gxg-scrollbar-width)}.gx-ide-main::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background);border-radius:var(--gxg-scrollbar-track-border-radius)}.gx-ide-main::-webkit-scrollbar-thumb{background-color:var(--gxg-scrollbar-track-thumb-background);border-radius:var(--gxg-scrollbar-track-thumb-radius)}.gx-ide-main::-webkit-scrollbar-thumb:hover{background-color:var(--gxg-scrollbar-track-thumb-hover-background)}.gx-ide-main::-webkit-scrollbar-corner{background:rgba(0, 0, 0, 0)}.gx-ide-overflow{overflow-y:auto;}.gx-ide-overflow::-webkit-scrollbar{width:var(--gxg-scrollbar-width);height:var(--gxg-scrollbar-width)}.gx-ide-overflow::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background);border-radius:var(--gxg-scrollbar-track-border-radius)}.gx-ide-overflow::-webkit-scrollbar-thumb{background-color:var(--gxg-scrollbar-track-thumb-background);border-radius:var(--gxg-scrollbar-track-thumb-radius)}.gx-ide-overflow::-webkit-scrollbar-thumb:hover{background-color:var(--gxg-scrollbar-track-thumb-hover-background)}.gx-ide-overflow::-webkit-scrollbar-corner{background:rgba(0, 0, 0, 0)}.tree-container{display:flex;height:100%;width:100%;box-sizing:border-box}p{margin:0;font-size:var(--mer-font__size--xxs)}:root{--ui-animaton-speed:0.2s}.gxg-title-01{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-01-font-weight);font-size:var(--ds-title-01-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-01--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-01-font-weight);font-size:var(--ds-title-01-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-title-02{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-02-font-weight);font-size:var(--ds-title-02-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-02--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-02-font-weight);font-size:var(--ds-title-02-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable);color:var(--color-on-primary)}.gxg-title-03{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-03-font-weight);font-size:var(--ds-title-03-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-03--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-03-font-weight);font-size:var(--ds-title-03-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;text-transform:uppercase;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-title-04{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-04-font-weight);font-size:var(--ds-title-04-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-04--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-04-font-weight);font-size:var(--ds-title-04-font-size);letter-spacing:var(--ds-base-font-letter-spacing--comfortable);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-title-05{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-05-font-weight);font-size:var(--ds-title-05-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable)}.gxg-title-05--negative{font-family:var(--ds-base-font-family-primary);font-weight:var(--ds-title-05-font-weight);font-size:var(--ds-title-05-font-size);letter-spacing:var(--ds-base-font-letter-spacing--regular);color:var(--ds-base-font-color);text-align:start;line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-text{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable)}.gxg-text--negative{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--negative)}.gxg-text--gray{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--dimmed)}.gxg-quote{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);font-style:italic}.gxg-quote--negative{color:var(--ds-base-font-color--negative)}.gxg-link{line-height:unset;font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--link);text-decoration:underline;cursor:pointer;display:inline-block}.gxg-link:hover{color:var(--ds-base-font-color--link-hover)}.gxg-link:active{color:var(--ds-base-font-color--link-active)}.gxg-link-gray{line-height:unset;font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--link);text-decoration:underline;cursor:pointer;display:inline-block;color:var(--ds-base-font-color--dimmed)}.gxg-link-gray:hover{line-height:unset;font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--link);text-decoration:underline;cursor:pointer;display:inline-block;color:var(--ds-base-font-color--dimmed);filter:brightness(1.4)}.gxg-alert-error{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--error);display:inline-block}.gxg-alert-warning{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--warning);display:inline-block}.gxg-alert-success{font-family:var(--ds-base-font-family-primary);font-size:var(--ds-base-font-size);color:var(--ds-base-font-size-color);font-weight:var(--ds-base-font-size-weight);line-height:var(--ds-base-font-line-height--comfortable);color:var(--ds-base-font-color--success);display:inline-block}.gxg-tab--disabled{color:var(--color-primary-disabled);pointer-events:none}.gxg-tab--disabled[disabled]{color:var(--color-primary-disabled);pointer-events:none}.gxg-label{font-family:var(--ds-base-font-family-primary);font-weight:var(--gxg-label-font-weight);font-size:var(--gxg-label-font-size);color:var(--gxg-label-color);text-align:center;line-height:1.455em;display:flex;align-items:center}.gxg-label:hover{color:var(--color-primary-hover)}.gxg-label:focus{color:var(--color-primary-active)}.gxg-label:active{color:var(--color-primary-active)}.gxg-label[disabled]{color:var(--color-primary-disabled)}.gxg-label--negative{color:var(--color-on-primary)}.gxg-label--negative[disabled]{color:var(--color-on-disabled)}.gxg-scrollbar{}.gxg-scrollbar::-webkit-scrollbar{width:var(--gxg-scrollbar-width);height:var(--gxg-scrollbar-width)}.gxg-scrollbar::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background);border-radius:var(--gxg-scrollbar-track-border-radius)}.gxg-scrollbar::-webkit-scrollbar-thumb{background-color:var(--gxg-scrollbar-track-thumb-background);border-radius:var(--gxg-scrollbar-track-thumb-radius)}.gxg-scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--gxg-scrollbar-track-thumb-hover-background)}.gxg-scrollbar::-webkit-scrollbar-corner{background:rgba(0, 0, 0, 0)}.options{padding:var(--gx-ide-container__padding);border-block-end:1px solid var(--gx-ide-container-border-color);grid-template-columns:auto 1fr;grid-template-areas:\"path-url-label path-url-wrapper\" \"access-token-label access-token\" \"style-label style\" \"module-label module\" \"checkboxes-options checkboxes-options\"}.options .path-url-label{grid-area:path-url-label}.options .path-url-wrapper{grid-area:path-url-wrapper;display:flex;flex-direction:row;gap:var(--gx-ide-grid-row-gap)}.options .path-url-wrapper__buttons-container{display:flex;flex-direction:row;gap:var(--gx-ide-container-elements-spacing)}.options .access-token-label{grid-area:access-token-label}.options .access-token{grid-area:access-token}.options .style-label{grid-area:style-label}.options .style{grid-area:style}.options .module-label{grid-area:module-label}.options .module{grid-area:module}.options .checkboxes-options{grid-area:checkboxes-options}.options--hide-access-token{grid-template-areas:\"path-url-label path-url-wrapper\" \"style-label style\" \"module-label module\" \"checkboxes-options checkboxes-options\"}.options .checkboxes-options{display:flex;justify-content:space-between;gap:var(--gx-ide-grid-row-gap)}.options .checkboxes-options__col-right{display:flex;opacity:1;transition:opacity 200ms;gap:var(--gx-ide-grid-row-gap)}.options .checkboxes-options__col-right--hidden{opacity:0}.messages-container{padding:var(--gx-ide-container__padding);height:100%;overflow-y:auto;}.messages-container::-webkit-scrollbar{width:var(--gxg-scrollbar-width);height:var(--gxg-scrollbar-width)}.messages-container::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background);border-radius:var(--gxg-scrollbar-track-border-radius)}.messages-container::-webkit-scrollbar-thumb{background-color:var(--gxg-scrollbar-track-thumb-background);border-radius:var(--gxg-scrollbar-track-thumb-radius)}.messages-container::-webkit-scrollbar-thumb:hover{background-color:var(--gxg-scrollbar-track-thumb-hover-background)}.messages-container::-webkit-scrollbar-corner{background:rgba(0, 0, 0, 0)}.main{display:flex;height:100%;justify-content:center;overflow:auto}.main .design-tree,.main .design-tabs{transition:flex 200ms}.main .tree-container{flex:1}.main .design-tabs{flex:2}.main .design-tabs--fit-images img{object-fit:contain;width:100%;height:100%}.main .design-tabs img{display:block}.main--shrunken-tree .tree-container{flex:0.5}.main--shrunken-tree .design-tabs{flex:2.5}.panel-tab{height:100%;display:grid;grid-template-columns:1fr 1fr}.panel-tab .panel-item{width:100%;height:100%;overflow:auto;font-size:var(--mer-font__size--xxs);line-height:normal}.panel-tab .panel-item::-webkit-scrollbar{width:var(--gxg-scrollbar-width);height:var(--gxg-scrollbar-width)}.panel-tab .panel-item::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background);border-radius:var(--gxg-scrollbar-track-border-radius)}.panel-tab .panel-item::-webkit-scrollbar-thumb{background-color:var(--gxg-scrollbar-track-thumb-background);border-radius:var(--gxg-scrollbar-track-thumb-radius)}.panel-tab .panel-item::-webkit-scrollbar-thumb:hover{background-color:var(--gxg-scrollbar-track-thumb-hover-background)}.panel-tab .panel-item::-webkit-scrollbar-corner{background:rgba(0, 0, 0, 0)}.tab--hidden{display:none}";
7
+
8
+ const DESIGN_DATA_TYPE_PANELS = "panels";
9
+ const DESIGN_DATA_TYPE_STENCILS = "stencils";
10
+ const DESIGN_DATA_TYPE_IMAGES = "images";
11
+ const DESIGN_DATA_TYPE_DESIGN_SYSTEM = "design_system";
12
+ const DESIGN_DATA_TYPE_FONTS = "fonts";
13
+ const GxIdeImportFromDesign = class {
14
+ constructor(hostRef) {
15
+ registerInstance(this, hostRef);
16
+ this.componentDidRenderFirstTime = createEvent(this, "componentDidRenderFirstTime", 7);
17
+ this.renderedFirstTime = false;
18
+ /**
19
+ * An array that keeps track of the tree items id's (design system data type + item id) along with the content, that will be used to save and retrieve items information, in order to avoid using a callback to get items information that was already get. loadedItemsArray will be reset every time a new design is loaded.
20
+ */
21
+ this.loadedItems = new Map();
22
+ /**
23
+ * The path/URL value when loadCallback was called for the last time. This is used to determine
24
+ * if there is a difference with the actual path/URL value, in order to know if calling loadCallback
25
+ * again is required on blur on Path/URL/File input.
26
+ */
27
+ this.pathOnLoadCallback = "";
28
+ this.panelsSelected = [];
29
+ this.stencilsSelected = [];
30
+ // private imagesSelected: string[] = [];
31
+ // private designSystemSelected: string[] = [];
32
+ this.fontsSelected = [];
33
+ // 9.LOCAL METHODS //
34
+ this.attachTreeMouseListeners = () => {
35
+ this.treeDataEl.addEventListener("mouseenter", this.treeMouseEnter);
36
+ this.treeDataEl.addEventListener("mouseleave", this.treeMouseLeave);
37
+ };
38
+ this.removeTreeMouseListeners = () => {
39
+ this.treeDataEl.removeEventListener("mouseenter", this.treeMouseEnter);
40
+ this.treeDataEl.removeEventListener("mouseleave", this.treeMouseLeave);
41
+ };
42
+ this.treeMouseEnter = () => {
43
+ this.shrunkenTree = false;
44
+ };
45
+ this.treeMouseLeave = () => {
46
+ this.shrunkenTree = true;
47
+ };
48
+ this.messageType = (message) => {
49
+ if (message.type === "error") {
50
+ return "text-alert-error";
51
+ }
52
+ else if (message.type === "warning") {
53
+ return "text-alert-warning";
54
+ }
55
+ else {
56
+ return "text-gray";
57
+ }
58
+ };
59
+ this.objectsTreeSelectedItemsChangedHandler = async (event) => {
60
+ var _a;
61
+ if (event.detail.length) {
62
+ const item = (_a = event.detail[0]) === null || _a === void 0 ? void 0 : _a.item;
63
+ const itemComposedId = item.id;
64
+ const idList = itemComposedId.split("@");
65
+ const itemId = idList[0];
66
+ const itemDesignType = idList[1];
67
+ const isChildNode = itemId && itemId !== "parent";
68
+ const isDesignSystem = itemDesignType === "design_system";
69
+ if (isChildNode || isDesignSystem) {
70
+ this.selectedDesignType = itemDesignType;
71
+ const loadedItem = this.getLoadedItem(itemComposedId);
72
+ if (!loadedItem) {
73
+ const designDataDetail = await this.getDesignDataDetail(itemId, this.selectedDesignType);
74
+ this.loadedItems.set(itemComposedId, {
75
+ designType: this.selectedDesignType,
76
+ designDataDetail: designDataDetail
77
+ });
78
+ }
79
+ else {
80
+ /* Item has been queried already. The item content exists already. */
81
+ this.selectedDesignType = loadedItem.designType;
82
+ this.selectedDesignItem = loadedItem.designDataDetail;
83
+ this.getCodeFactory(loadedItem.designType);
84
+ this.renderDetailDataTree(loadedItem.designType);
85
+ }
86
+ }
87
+ }
88
+ };
89
+ this.getLoadedItem = (id) => {
90
+ var _a;
91
+ return (_a = this.loadedItems) === null || _a === void 0 ? void 0 : _a.get(id);
92
+ };
93
+ this.objectsTreeCheckedItemsChangedHandler = (event) => {
94
+ const items = Array.from(event.detail.values());
95
+ let currentParentId = null;
96
+ const result = {};
97
+ for (const item of items) {
98
+ if (item.item.id.startsWith("parent@")) {
99
+ currentParentId = item.item.id.split("@")[1];
100
+ result[currentParentId] = [];
101
+ }
102
+ else if (item.item.checked && currentParentId) {
103
+ const parentId = item.item.id.split("@")[1];
104
+ if (parentId === currentParentId) {
105
+ const id = item.item.id.split("@")[0];
106
+ result[currentParentId].push(id);
107
+ }
108
+ }
109
+ }
110
+ // const { designSystem, fonts, images, panels, stencils } = result;
111
+ const { fonts, panels, stencils } = result;
112
+ // this.designSystemSelected = designSystem;
113
+ this.fontsSelected = fonts;
114
+ // this.imagesSelected = images;
115
+ this.panelsSelected = panels;
116
+ this.stencilsSelected = stencils;
117
+ };
118
+ this.selectFile = () => {
119
+ this.pathURLFile.openFile();
120
+ };
121
+ this.pathOnFileSelected = async (e) => {
122
+ this.selectedFile = e.detail[0];
123
+ const fileName = e.detail[0].name;
124
+ this.path = fileName;
125
+ this.showAccessToken = await this.requiresAccessTokenCallback(this.pathURLFile.value);
126
+ };
127
+ this.pathURLFileBlurHandler = async () => {
128
+ this.showAccessToken = await this.requiresAccessTokenCallback(this.pathURLFile.value);
129
+ if (this.path !== this.pathOnLoadCallback) {
130
+ // if loadOnBlur is true, and the actual path/URL value differs from the one
131
+ // when loadCallback was called the last time, it is required to call loadCallback
132
+ // again, because the DesignData might differ from the actual.
133
+ this.loadData();
134
+ }
135
+ };
136
+ this.loadData = async () => {
137
+ this.isLoading = true;
138
+ const source = this.selectedFile ? this.selectedFile : this.path;
139
+ const token = this.accessTokenEl ? this.accessTokenEl.value : undefined;
140
+ this.designData = null;
141
+ await this.loadCallback(source, token, this.messageCallback).then((designData) => {
142
+ // this.isLoading = false;
143
+ this.messages = [];
144
+ this.designData = designData;
145
+ if (this.designData) {
146
+ this.panelsSelected = [
147
+ ...this.designData.panels.map(item => item.id)
148
+ ];
149
+ this.stencilsSelected = [
150
+ ...this.designData.stencils.map(item => item.id)
151
+ ];
152
+ // this.imagesSelected = [
153
+ // ...this.designData.images.map(item => item.id)
154
+ // ];
155
+ // this.designSystemSelected = [
156
+ // ...this.designData.designSystem.map(item => item.id)
157
+ // ];
158
+ this.fontsSelected = [...this.designData.fonts.map(item => item.id)];
159
+ }
160
+ else {
161
+ // There was probably an error
162
+ this.panelsSelected = [];
163
+ this.stencilsSelected = [];
164
+ // this.imagesSelected = [];
165
+ // this.designSystemSelected = [];
166
+ this.fontsSelected = [];
167
+ }
168
+ });
169
+ this.pathOnLoadCallback = this.path;
170
+ this.isLoading = false;
171
+ };
172
+ this.messageCallback = message => {
173
+ this.messages = [...this.messages, message];
174
+ };
175
+ this.getDesignDataDetail = async (id, designType) => {
176
+ let loadFn;
177
+ switch (designType) {
178
+ case DESIGN_DATA_TYPE_IMAGES:
179
+ loadFn = this.loadImageCallback;
180
+ break;
181
+ case DESIGN_DATA_TYPE_DESIGN_SYSTEM:
182
+ loadFn = this.loadDesignSystemCallback;
183
+ break;
184
+ case DESIGN_DATA_TYPE_FONTS:
185
+ loadFn = this.loadFontCallback;
186
+ break;
187
+ case DESIGN_DATA_TYPE_PANELS:
188
+ case DESIGN_DATA_TYPE_STENCILS:
189
+ loadFn = this.loadPanelDataCallback;
190
+ break;
191
+ }
192
+ let returnedData;
193
+ await loadFn(id).then((data) => {
194
+ this.selectedDesignType = designType;
195
+ this.selectedDesignItem = data;
196
+ this.getCodeFactory(designType);
197
+ this.renderDetailDataTree(designType);
198
+ returnedData = data;
199
+ });
200
+ return returnedData;
201
+ };
202
+ this.confirm = () => {
203
+ var _a, _b;
204
+ this.confirmCallback({
205
+ panels: this.panelsSelected,
206
+ stencils: this.stencilsSelected,
207
+ fonts: this.fontsSelected,
208
+ /* images: this.imagesSelected, */
209
+ moduleId: (_b = (_a = this.filterModuleEl) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.id,
210
+ styleName: this.optionStyleEl.value,
211
+ importAsWebPanels: this.optionImportAsEl.checked
212
+ });
213
+ };
214
+ this.cancel = () => {
215
+ this.cancelCallback();
216
+ this.isLoading = false;
217
+ };
218
+ this.fitImagesHandler = (e) => {
219
+ this.fitImages = e.detail.value;
220
+ };
221
+ this.shrinkTreeHandler = (e) => {
222
+ const checked = e.detail.value;
223
+ this.shrinkTree = checked;
224
+ if (checked) {
225
+ this.shrunkenTree = true;
226
+ }
227
+ else {
228
+ this.shrunkenTree = false;
229
+ }
230
+ };
231
+ this.importAsWebPanelsChangedHandler = () => {
232
+ // When "Import as Web Panels" checkbox value changes, loadCallback has to be
233
+ // called again, because the received DesignData differs between having
234
+ // "Import as Web Panels" checked or not. This only makes sense if a file is
235
+ // selected or the Path/URL input is not empty
236
+ if (this.path.length !== 0 || !this.selectedFile) {
237
+ this.loadData();
238
+ }
239
+ };
240
+ this.pathURLFileValueChangedHandler = (e) => {
241
+ this.path = e.detail;
242
+ };
243
+ // 9.LOCAL METHODS -> RENDERS //
244
+ this.renderOptions = () => {
245
+ var _a;
246
+ return (h("div", { class: {
247
+ "options grid": true,
248
+ "options--hide-access-token": !this.showAccessToken
249
+ } }, h("gxg-label", { class: "path-url-label" }, this._componentLocale.options.path), h("div", { class: "path-url-wrapper" }, h("gxg-form-text", { value: this.path, onFileSelected: this.pathOnFileSelected, onBlur: this.pathURLFileBlurHandler, ref: (el) => (this.pathURLFile = el), clearButton: true, part: "option-path", disabled: this.isLoading, type: "file", acceptFile: this.extensions, class: "path-url", placeholder: this._componentLocale.options.pathPlaceholder, onValueChanged: this.pathURLFileValueChangedHandler }), h("div", { class: "path-url-wrapper__buttons-container" }, h("gxg-button", { id: "button-select-file", type: "primary-text-only", onClick: this.selectFile, part: "gxg-button gxg-button--select-file", disabled: this.isLoading, class: "select-file" }, "..."), h("gxg-button", { id: "button-load", type: "primary-text-only", onClick: this.loadData, part: "gxg-button gxg-button--load", disabled: this.path.length === 0 || this.isLoading, class: "load-file" }, this._componentLocale.options.btnLoad))), this.showAccessToken
250
+ ? [
251
+ h("gxg-label", { class: { "access-token-label": true } }, this._componentLocale.options.accessToken),
252
+ h("gxg-form-text", { class: { "access-token": true }, ref: (el) => (this.accessTokenEl = el), part: "access-token", disabled: this.isLoading })
253
+ ]
254
+ : null, h("gxg-label", { class: "style-label" }, this._componentLocale.options.style), h("gxg-combo-box", { disabled: !this.styles || this.isLoading, "display-validation-styles": true, "display-validation-message": true, ref: (el) => (this.optionStyleEl = el), part: "option-style", class: "style" }, renderFormItems("gxg-combo-box-item", (_a = this.styles) !== null && _a !== void 0 ? _a : [])), h("gxg-label", { class: "module-label" }, this._componentLocale.options.module), h("gx-ide-entity-selector", { value: this.defaultModule, defaultValue: this.defaultModule, selectEntityCallback: this.selectModuleCallback, ref: (el) => (this.filterModuleEl = el), class: "module" }), h("div", { class: "checkboxes-options" }, h("gxg-form-checkbox", { label: this._componentLocale.options.importAs, class: "import-as-web-panels", ref: (el) => (this.optionImportAsEl = el), part: "option-import-as-web-panels", disabled: this.isLoading, onChange: this.importAsWebPanelsChangedHandler }), h("div", { class: {
255
+ "checkboxes-options__col-right": true,
256
+ "checkboxes-options__col-right--hidden": !this.designDataTreeDataModel.length
257
+ } }, h("gxg-form-checkbox", { label: this._componentLocale.options.fitImages, part: "fit-images-checkbox", disabled: this.isLoading || !this.designDataTreeDataModel.length, onChange: this.fitImagesHandler }), h("gxg-form-checkbox", { label: this._componentLocale.options.toggleTree, part: "shrink-tree-checkbox", disabled: this.isLoading || !this.designDataTreeDataModel.length, onChange: this.shrinkTreeHandler })))));
258
+ };
259
+ this.renderMessages = () => {
260
+ return this.messages.length > 0 ? (h("div", { class: "messages-container", ref: (el) => (this.messagesList = el) }, this.messages.map(message => (h("gxg-text", { type: this.messageType(message) }, message.type, ": ", message.text))))) : null;
261
+ };
262
+ this.renderMain = () => {
263
+ if (this.designData) {
264
+ return (
265
+ /* #main*/
266
+ h("main", { class: { "main": true, "main--shrunken-tree": this.shrunkenTree } }, [this.renderDesignTree(), this.renderDesignTabs()]));
267
+ }
268
+ else if (!this.isLoading) {
269
+ return h("main", { class: "main" }, this.renderNoDesignData());
270
+ }
271
+ else {
272
+ return this.renderMessages();
273
+ }
274
+ };
275
+ this.renderNoDesignData = () => {
276
+ if (!this.isLoading) {
277
+ return (h("gxg-text", { textAlign: config.gxgMessage.common.textAlign, padding: config.gxgMessage.common.textAlign, type: config.gxgMessage.common.type, maxWidth: config.gxgMessage.common.maxWidth, part: "no-design-selected" }, this._componentLocale.messages.noDesignSelected, " ", h("br", null), h("gxg-text", { type: "text-link-no-line", onClick: this.selectFile, part: "begin-by-loading-one" }, this._componentLocale.messages.selectDesign)));
278
+ }
279
+ };
280
+ this.renderDesignTree = () => {
281
+ return (h("div", { class: "tree-container" }, h("gxg-tree-view", { part: "data-tree", class: "design-tree", id: "data-tree", treeModel: this.designDataTreeDataModel, dragDisabled: true, dropDisabled: true, toggleCheckboxes: true, checkbox: true, checked: true, onCheckedItemsChange: this.objectsTreeCheckedItemsChangedHandler, onSelectedItemsChange: this.objectsTreeSelectedItemsChangedHandler, ref: el => (this.treeDataEl = el) })));
282
+ };
283
+ this.renderFooter = () => {
284
+ return [
285
+ h("gxg-button", { id: "button-ok", type: "primary-text-only", onClick: this.confirm, part: "gxg-button gxg-button--ok", disabled: this.isLoading, slot: "footer-end" }, this._componentLocale.footer.btnOk),
286
+ h("gxg-button", { id: "button-cancel", type: "outlined", onClick: this.cancel, part: "gxg-button gxg-button--cancel", slot: "footer-end" }, this._componentLocale.footer.btnCancel)
287
+ ];
288
+ };
289
+ this.renderPanelTab = () => {
290
+ const renderControlsTree = (this.selectedDesignType === DESIGN_DATA_TYPE_PANELS ||
291
+ this.selectedDesignType === DESIGN_DATA_TYPE_STENCILS) &&
292
+ this.detailTreeModel.length > 0;
293
+ return (h("div", { class: {
294
+ "panel-tab": true,
295
+ "panel-tab--controls-tree": renderControlsTree
296
+ }, part: "data-panel-composition-container" }, this.selectedDesignItem &&
297
+ this.selectedDesignItem.composition &&
298
+ this.selectedDesignItem.composition.preview ? (h("div", { part: "data-panel-composition-preview", class: "panel-item" }, h("img", { src: this.selectedDesignItem && this.selectedDesignItem.composition
299
+ ? this.selectedDesignItem.composition.preview
300
+ : undefined, alt: "Preview" }))) : null, renderControlsTree ? (h("gxg-tree-view", { part: "data-panel-composition-tree", class: "panel-item", id: "gxg-tree-panel-data", treeModel: this.detailTreeModel, dragDisabled: true, dropDisabled: true })) : null));
301
+ };
302
+ this.renderImageTab = () => {
303
+ return (h("div", { part: "data-panel-composition-preview", class: "data-preview" }, h("img", { src: this.selectedDesignItem ? this.selectedDesignItem : undefined, alt: "Preview" })));
304
+ };
305
+ this.tabActivatedHandler = (tabActivated) => {
306
+ if (tabActivated.detail) {
307
+ const tab = tabActivated.detail.tab;
308
+ this.activeTabs = Object.assign(Object.assign({}, this.activeTabs), { [this.selectedDesignType]: tab });
309
+ }
310
+ };
311
+ this.isTabActive = (tab) => {
312
+ const activeTab = this.selectedDesignType;
313
+ if (this.activeTabs[activeTab] === tab) {
314
+ return true;
315
+ }
316
+ else {
317
+ return false;
318
+ }
319
+ };
320
+ this.renderDesignTabs = () => {
321
+ return (h("gxg-tabs", { class: {
322
+ "design-tabs": true,
323
+ "design-tabs--fit-images": this.fitImages
324
+ }, part: "data-tabs", "no-border": true, noPadding: true, buttonsBorderAbove: true }, h("gxg-tab-bar", { slot: "tab-bar-container" }, h("gxg-tab-button", { hidden: !this.selectedDesignType ||
325
+ this.selectedDesignType !== DESIGN_DATA_TYPE_DESIGN_SYSTEM, slot: "tab-bar", "tab-label": this._componentLocale.tabs.tokens, tab: "tokens", key: "tokens", onTabActivated: this.tabActivatedHandler, isSelected: this.isTabActive("tokens") }), h("gxg-tab-button", { hidden: !this.selectedDesignType ||
326
+ this.selectedDesignType !== DESIGN_DATA_TYPE_DESIGN_SYSTEM, slot: "tab-bar", "tab-label": this._componentLocale.tabs.styles, tab: "styles", key: "styles", onTabActivated: this.tabActivatedHandler, isSelected: this.isTabActive("styles") }), h("gxg-tab-button", { hidden: !this.selectedDesignType ||
327
+ this.selectedDesignType === DESIGN_DATA_TYPE_DESIGN_SYSTEM, slot: "tab-bar", "tab-label": this._componentLocale.tabs.composition, tab: "composition", key: "composition", onTabActivated: this.tabActivatedHandler, isSelected: this.isTabActive("composition") }), h("gxg-tab-button", { hidden: !this.selectedDesignType ||
328
+ (this.selectedDesignType !== DESIGN_DATA_TYPE_PANELS &&
329
+ this.selectedDesignType !== DESIGN_DATA_TYPE_STENCILS), slot: "tab-bar", "tab-label": this._componentLocale.tabs.layout, tab: "layout", key: "layout", onTabActivated: this.tabActivatedHandler, isSelected: this.isTabActive("layout") }), h("gxg-tab-button", { hidden: !this.selectedDesignType ||
330
+ (this.selectedDesignType !== DESIGN_DATA_TYPE_PANELS &&
331
+ this.selectedDesignType !== DESIGN_DATA_TYPE_STENCILS), slot: "tab-bar", "tab-label": this._componentLocale.tabs.code, tab: "code", key: "code", onTabActivated: this.tabActivatedHandler, isSelected: this.isTabActive("code") })), h("gxg-tab", { tab: "tokens", key: "tokens", isSelected: this.isTabActive("tokens") }, h("div", { ref: (el) => (this.tokensFactoryRenderEl = el) })), h("gxg-tab", { tab: "styles", key: "styles", isSelected: this.isTabActive("styles") }, h("div", { ref: (el) => (this.stylesFactoryRenderEl = el) })), h("gxg-tab", { tab: "composition", key: "composition", isSelected: this.isTabActive("composition") }, this.selectedDesignType === DESIGN_DATA_TYPE_IMAGES ||
332
+ this.selectedDesignType === DESIGN_DATA_TYPE_FONTS
333
+ ? this.renderImageTab()
334
+ : this.renderPanelTab()), h("gxg-tab", { tab: "layout", key: "layout", isSelected: this.isTabActive("layout") }, h("div", { ref: (el) => (this.layoutFactoryRenderEl = el) })), h("gxg-tab", { tab: "code", key: "code", isSelected: this.isTabActive("code") }, h("div", { ref: (el) => (this.codeFactoryRenderEl = el) }))));
335
+ };
336
+ this.activeTabs = {
337
+ panels: "composition",
338
+ stencils: "composition",
339
+ images: "composition",
340
+ fonts: "composition",
341
+ design_system: "tokens"
342
+ };
343
+ this.path = "";
344
+ this.designData = null;
345
+ this.detailTreeModel = [];
346
+ this.isLoading = false;
347
+ this.messages = [];
348
+ this.selectedFile = undefined;
349
+ this.selectedDesignType = undefined;
350
+ this.selectedDesignItem = undefined;
351
+ this.showAccessToken = undefined;
352
+ this.designDataTreeDataModel = [];
353
+ this.updateTabsActiveTab = false;
354
+ this.fitImages = false;
355
+ this.shrinkTree = false;
356
+ this.shrunkenTree = false;
357
+ this.treeSh = false;
358
+ this.displayTitle = false;
359
+ this.extensions = undefined;
360
+ this.defaultModule = undefined;
361
+ this.selectModuleCallback = undefined;
362
+ this.cancelCallback = undefined;
363
+ this.confirmCallback = undefined;
364
+ this.loadCallback = undefined;
365
+ this.loadDesignSystemCallback = undefined;
366
+ this.loadFontCallback = undefined;
367
+ this.loadImageCallback = undefined;
368
+ this.loadPanelDataCallback = undefined;
369
+ this.requiresAccessTokenCallback = undefined;
370
+ this.shadow = false;
371
+ this.styles = undefined;
372
+ this.textEditorFactoryCallback = undefined;
373
+ }
374
+ watchDesignDataHandler(newDesignData) {
375
+ if (newDesignData) {
376
+ this.designDataTreeDataModel = [
377
+ {
378
+ order: 0,
379
+ id: `parent@${DESIGN_DATA_TYPE_PANELS}`,
380
+ class: "category tree-view-item",
381
+ leaf: false,
382
+ caption: this._componentLocale.tree.panels,
383
+ startImgSrc: "general/knowledge-base",
384
+ checkbox: true,
385
+ checked: true,
386
+ expanded: true,
387
+ items: this.designData.panels.map((item, i) => ({
388
+ id: `${item.id}@${DESIGN_DATA_TYPE_PANELS}`,
389
+ class: "object tree-view-item",
390
+ leaf: true,
391
+ caption: item.name,
392
+ startImgSrc: "general/generator",
393
+ checkbox: true,
394
+ checked: true,
395
+ selected: i === 0
396
+ }))
397
+ },
398
+ {
399
+ order: 1,
400
+ id: `parent@${DESIGN_DATA_TYPE_STENCILS}`,
401
+ class: "category tree-view-item",
402
+ leaf: false,
403
+ caption: this._componentLocale.tree.stencils,
404
+ startImgSrc: "general/knowledge-base",
405
+ checkbox: true,
406
+ checked: true,
407
+ expanded: true,
408
+ items: this.designData.stencils.map(item => ({
409
+ id: `${item.id}@${DESIGN_DATA_TYPE_STENCILS}`,
410
+ class: "object tree-view-item",
411
+ leaf: true,
412
+ caption: item.name,
413
+ startImgSrc: "general/generator",
414
+ checkbox: true,
415
+ checked: true
416
+ }))
417
+ },
418
+ {
419
+ order: 2,
420
+ id: `parent@${DESIGN_DATA_TYPE_IMAGES}`,
421
+ class: "category tree-view-item",
422
+ leaf: false,
423
+ caption: this._componentLocale.tree.images,
424
+ startImgSrc: "general/knowledge-base",
425
+ checkbox: true,
426
+ checked: true,
427
+ expanded: true,
428
+ items: this.designData.images.map(item => ({
429
+ id: `${item.id}@${DESIGN_DATA_TYPE_IMAGES}`,
430
+ class: "object tree-view-item",
431
+ leaf: true,
432
+ caption: item.name,
433
+ startImgSrc: "general/generator",
434
+ checkbox: true,
435
+ checked: true
436
+ }))
437
+ },
438
+ {
439
+ order: 3,
440
+ id: `parent@${DESIGN_DATA_TYPE_FONTS}`,
441
+ class: "category tree-view-item",
442
+ leaf: false,
443
+ caption: this._componentLocale.tree.fonts,
444
+ startImgSrc: "general/knowledge-base",
445
+ checkbox: true,
446
+ checked: true,
447
+ expanded: true,
448
+ items: this.designData.fonts.map(item => ({
449
+ id: `${item.id}@${DESIGN_DATA_TYPE_FONTS}`,
450
+ class: "object tree-view-item",
451
+ leaf: true,
452
+ caption: item.name,
453
+ startImgSrc: "general/generator",
454
+ checkbox: true,
455
+ checked: true
456
+ }))
457
+ },
458
+ {
459
+ order: 4,
460
+ id: `parent@${DESIGN_DATA_TYPE_DESIGN_SYSTEM}`,
461
+ class: "category tree-view-item",
462
+ leaf: true,
463
+ caption: this._componentLocale.tree.designSystem,
464
+ startImgSrc: "general/knowledge-base",
465
+ checkbox: true,
466
+ checked: true
467
+ }
468
+ ];
469
+ }
470
+ }
471
+ watchShrinkTreeHandler(shrink) {
472
+ if (shrink) {
473
+ this.attachTreeMouseListeners();
474
+ }
475
+ else {
476
+ this.removeTreeMouseListeners();
477
+ }
478
+ }
479
+ // 6.COMPONENT LIFECYCLE EVENTS //
480
+ async componentWillLoad() {
481
+ this._componentLocale = await Locale.getComponentStrings(this.el);
482
+ }
483
+ componentDidRender() {
484
+ if (!this.renderedFirstTime) {
485
+ this.componentDidRenderFirstTime.emit(this._componentLocale.componentName);
486
+ this.renderedFirstTime = true;
487
+ }
488
+ }
489
+ disconnectedCallback() {
490
+ this.removeTreeMouseListeners();
491
+ }
492
+ // 7.LISTENERS //
493
+ watchMessagesHandler(newValue, oldValue) {
494
+ if (newValue !== oldValue) {
495
+ if (this.messagesList) {
496
+ this.messagesList.scrollTop = this.messagesList.scrollHeight;
497
+ }
498
+ }
499
+ }
500
+ // 8.PUBLIC METHODS API //
501
+ /**
502
+ * Validate necessary data input
503
+ */
504
+ async validate() {
505
+ const isValid = true;
506
+ return isValid;
507
+ }
508
+ loadTreeItemCompositionModel(controls) {
509
+ const modelList = [];
510
+ for (const control of controls) {
511
+ let model = {
512
+ id: control.name,
513
+ caption: control.name,
514
+ startImgSrc: control.type,
515
+ checkbox: false,
516
+ expanded: true,
517
+ leaf: control.leaf
518
+ };
519
+ if (control.controls) {
520
+ model = Object.assign(Object.assign({}, model), { items: this.loadTreeItemCompositionModel(control.controls) });
521
+ }
522
+ modelList.push(model);
523
+ }
524
+ return modelList;
525
+ }
526
+ getCodeFactory(designType) {
527
+ switch (designType) {
528
+ case DESIGN_DATA_TYPE_PANELS:
529
+ case DESIGN_DATA_TYPE_STENCILS:
530
+ this.textEditorFactoryCallback("html", this.codeFactoryRenderEl, this.selectedDesignItem.code);
531
+ this.textEditorFactoryCallback("html", this.layoutFactoryRenderEl, this.selectedDesignItem.layout);
532
+ break;
533
+ case DESIGN_DATA_TYPE_DESIGN_SYSTEM:
534
+ this.textEditorFactoryCallback("tokens", this.tokensFactoryRenderEl, this.selectedDesignItem.tokens);
535
+ this.textEditorFactoryCallback("styles", this.stylesFactoryRenderEl, this.selectedDesignItem.styles);
536
+ break;
537
+ }
538
+ }
539
+ renderDetailDataTree(designType) {
540
+ switch (designType) {
541
+ case DESIGN_DATA_TYPE_PANELS:
542
+ case DESIGN_DATA_TYPE_STENCILS:
543
+ this.detailTreeModel = this.loadTreeItemCompositionModel(this.selectedDesignItem.composition.controls);
544
+ break;
545
+ }
546
+ }
547
+ // 10.RENDER() FUNCTION //
548
+ render() {
549
+ return (h(Host, { class: "gx-ide-component" }, h("div", { class: "gx-ide-main-wrapper" }, h("gx-ide-container", { noContentPadding: true, noContentGap: true, displayBorderBottom: true, part: "options-container", slimmerFooter: config.gxIdeContainer.slimmerFooter, containerTitle: this.displayTitle ? this._componentLocale.componentName : null }, this.renderOptions(), this.renderMain(), this.renderFooter()))));
550
+ }
551
+ static get assetsDirs() { return ["gx-ide-assets/design-import"]; }
552
+ get el() { return getElement(this); }
553
+ static get watchers() { return {
554
+ "designData": ["watchDesignDataHandler"],
555
+ "shrinkTree": ["watchShrinkTreeHandler"],
556
+ "messages": ["watchMessagesHandler"]
557
+ }; }
558
+ };
559
+ GxIdeImportFromDesign.style = designImportCss;
560
+
561
+ export { GxIdeImportFromDesign as gx_ide_design_import };
562
+
563
+ //# sourceMappingURL=gx-ide-design-import.entry.js.map