@genexus/mercury 0.12.9 → 0.13.1

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 (102) hide show
  1. package/dist/bundles/css/all.css +1 -1
  2. package/dist/bundles/css/base/base.css +1 -1
  3. package/dist/bundles/css/base/icons.css +1 -1
  4. package/dist/bundles/css/chameleon/scrollbar.css +1 -1
  5. package/dist/bundles/css/components/accordion.css +1 -1
  6. package/dist/bundles/css/components/button.css +1 -1
  7. package/dist/bundles/css/components/chat.css +1 -1
  8. package/dist/bundles/css/components/checkbox.css +1 -1
  9. package/dist/bundles/css/components/code.css +1 -1
  10. package/dist/bundles/css/components/combo-box.css +1 -1
  11. package/dist/bundles/css/components/dialog.css +1 -1
  12. package/dist/bundles/css/components/dropdown.css +1 -1
  13. package/dist/bundles/css/components/edit.css +1 -1
  14. package/dist/bundles/css/components/flexible-layout.css +1 -1
  15. package/dist/bundles/css/components/icon.css +1 -1
  16. package/dist/bundles/css/components/layout-splitter.css +1 -1
  17. package/dist/bundles/css/components/list-box.css +1 -1
  18. package/dist/bundles/css/components/markdown-viewer.css +1 -1
  19. package/dist/bundles/css/components/navigation-list.css +1 -1
  20. package/dist/bundles/css/components/pills.css +1 -1
  21. package/dist/bundles/css/components/radio-group.css +1 -1
  22. package/dist/bundles/css/components/segmented-control.css +1 -1
  23. package/dist/bundles/css/components/sidebar.css +1 -1
  24. package/dist/bundles/css/components/slider.css +1 -1
  25. package/dist/bundles/css/components/switch.css +1 -1
  26. package/dist/bundles/css/components/tab.css +1 -1
  27. package/dist/bundles/css/components/tabular-grid.css +1 -1
  28. package/dist/bundles/css/components/ticket-list.css +1 -1
  29. package/dist/bundles/css/components/tooltip.css +1 -1
  30. package/dist/bundles/css/components/tree-view.css +1 -1
  31. package/dist/bundles/css/components/widget.css +1 -1
  32. package/dist/bundles/css/resets/box-sizing.css +1 -1
  33. package/dist/bundles/css/utils/elevation.css +1 -1
  34. package/dist/bundles/css/utils/form--full.css +1 -1
  35. package/dist/bundles/css/utils/form.css +1 -1
  36. package/dist/bundles/css/utils/layout.css +1 -1
  37. package/dist/bundles/css/utils/spacing.css +1 -1
  38. package/dist/bundles/css/utils/typography.css +1 -1
  39. package/dist/bundles/js/all.js +1 -0
  40. package/dist/bundles/js/base/base.js +1 -0
  41. package/dist/bundles/js/base/icons.js +1 -0
  42. package/dist/bundles/js/bundle-mappings.js +231 -0
  43. package/dist/bundles/js/chameleon/scrollbar.js +1 -0
  44. package/dist/bundles/js/components/accordion.js +1 -0
  45. package/dist/bundles/js/components/button.js +1 -0
  46. package/dist/bundles/js/components/chat.js +1 -0
  47. package/dist/bundles/js/components/checkbox.js +1 -0
  48. package/dist/bundles/js/components/code.js +1 -0
  49. package/dist/bundles/js/components/combo-box.js +1 -0
  50. package/dist/bundles/js/components/dialog.js +1 -0
  51. package/dist/bundles/js/components/dropdown.js +1 -0
  52. package/dist/bundles/js/components/edit.js +1 -0
  53. package/dist/bundles/js/components/flexible-layout.js +1 -0
  54. package/dist/bundles/js/components/icon.js +1 -0
  55. package/dist/bundles/js/components/layout-splitter.js +1 -0
  56. package/dist/bundles/js/components/list-box.js +1 -0
  57. package/dist/bundles/js/components/markdown-viewer.js +1 -0
  58. package/dist/bundles/js/components/navigation-list.js +1 -0
  59. package/dist/bundles/js/components/pills.js +1 -0
  60. package/dist/bundles/js/components/radio-group.js +1 -0
  61. package/dist/bundles/js/components/segmented-control.js +1 -0
  62. package/dist/bundles/js/components/sidebar.js +1 -0
  63. package/dist/bundles/js/components/slider.js +1 -0
  64. package/dist/bundles/js/components/switch.js +1 -0
  65. package/dist/bundles/js/components/tab.js +1 -0
  66. package/dist/bundles/js/components/tabular-grid.js +1 -0
  67. package/dist/bundles/js/components/ticket-list.js +1 -0
  68. package/dist/bundles/js/components/tooltip.js +1 -0
  69. package/dist/bundles/js/components/tree-view.js +1 -0
  70. package/dist/bundles/js/components/widget.js +1 -0
  71. package/dist/bundles/js/resets/box-sizing.js +1 -0
  72. package/dist/bundles/js/utils/elevation.js +1 -0
  73. package/dist/bundles/js/utils/form--full.js +1 -0
  74. package/dist/bundles/js/utils/form.js +1 -0
  75. package/dist/bundles/js/utils/layout.js +1 -0
  76. package/dist/bundles/js/utils/spacing.js +1 -0
  77. package/dist/bundles/js/utils/typography.js +1 -0
  78. package/dist/bundles.d.ts +153 -146
  79. package/dist/bundles.js +1 -1
  80. package/dist/cli/bundle.d.ts +2 -0
  81. package/dist/cli/bundle.js +20 -0
  82. package/dist/cli/internal/constants.d.ts +28 -0
  83. package/dist/cli/internal/constants.js +33 -0
  84. package/dist/cli/internal/create-bundles-with-custom-paths.d.ts +2 -0
  85. package/dist/cli/internal/create-bundles-with-custom-paths.js +67 -0
  86. package/dist/cli/internal/file-management.d.ts +4 -0
  87. package/dist/cli/internal/file-management.js +20 -0
  88. package/dist/cli/internal/print-utils.d.ts +18 -0
  89. package/dist/cli/internal/print-utils.js +33 -0
  90. package/dist/cli/internal/transpile-bundle-and-create-mappings.d.ts +3 -0
  91. package/dist/cli/internal/transpile-bundle-and-create-mappings.js +85 -0
  92. package/dist/cli/internal/types.d.ts +21 -0
  93. package/dist/cli/internal/types.js +1 -0
  94. package/dist/cli/internal/utils.d.ts +11 -0
  95. package/dist/cli/internal/utils.js +42 -0
  96. package/dist/cli/internal/validate-args.d.ts +2 -0
  97. package/dist/cli/internal/validate-args.js +119 -0
  98. package/dist/cli/mercury.d.ts +2 -0
  99. package/dist/cli/mercury.js +14 -0
  100. package/dist/mercury.scss +2 -0
  101. package/dist/types.d.ts +3 -0
  102. package/package.json +13 -3
@@ -0,0 +1 @@
1
+ export const bundle = `.field{display:grid}.field-group-inline,.field-group{--spacing-body-block-start: var(--mer-spacing--md);--spacing-body-block-end: var(--mer-spacing--md);--spacing-body-inline-start: var(--mer-spacing--md);--spacing-body-inline-end: var(--mer-spacing--md);row-gap:var(--field-group__row-gap);column-gap:var(--field-group__column-gap)}.field-group{display:grid}.field-group-inline{display:flex;flex-wrap:wrap}.field-group-cols-2{display:grid;column-gap:var(--field__column-gap);row-gap:var(--field-group__row-gap);grid-template-columns:max-content auto}.field-block{row-gap:var(--field__row-gap);grid-template-rows:max-content 1fr}.field-inline{column-gap:var(--field__column-gap);grid-template-columns:max-content 1fr}.field-group-cols-2 .label,.field-inline>.label{margin-block-start:var(--field-inline-label__margin-block-start)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.label{color:var(--label__color);font-weight:var(--label__font-weight);font-size:var(--label__font-size);line-height:var(--label__line-height)}.label--disabled{--label__color: var(--label__color--disabled)}`;
@@ -0,0 +1 @@
1
+ export const bundle = `.layout{--spacing-body-block-start: var(--mer-spacing--md);--spacing-body-block-end: var(--mer-spacing--md);--spacing-body-inline-start: var(--mer-spacing--lg);--spacing-body-inline-end: var(--mer-spacing--lg);display:grid;gap:var(--mer-spacing--md)}.layout__panel{display:grid}.layout--cols-1{grid-template-rows:1fr;grid-template-columns:1fr}.layout--cols-2{grid-template-rows:1fr;grid-template-columns:repeat(2, 1fr)}.layout--cols-3{grid-template-rows:1fr;grid-template-columns:repeat(3, 1fr)}.layout--cols-4{grid-template-rows:1fr;grid-template-columns:repeat(4, 1fr)}.layout--cols-1-2{grid-template-rows:1fr;grid-template-columns:1fr 2fr}.layout--cols-2-1{grid-template-rows:1fr;grid-template-columns:2fr 1fr}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.control-footer,.control-footer-with-border{--control-footer-justify-content: end;padding-block-start:var(--mer-spacing--xs);display:flex;justify-content:var(--control-footer-justify-content);align-items:center}.control-footer-start{--control-footer-justify-content: start}.control-footer-center{--control-footer-justify-content: center}.control-footer-space-between{--control-footer-justify-content: space-between}.control-footer-with-border{border-block-start:var(--mer-border__width--sm) solid var(--mer-border-color__on-elevation--01)}.control-header,.control-header-with-border{padding-block-end:var(--mer-spacing--md)}.control-header-with-border{border-block-end:var(--mer-border__width--sm) solid var(--mer-border-color__on-elevation--01)}`;
@@ -0,0 +1 @@
1
+ export const bundle = `.spacing-body,:host(.spacing-body){padding-block:var(--spacing-body-block-start) var(--spacing-body-block-end);padding-inline:var(--spacing-body-inline-start) var(--spacing-body-inline-end)}.spacing-body-block,:host(.spacing-body-block){padding-block:var(--spacing-body-block-start) var(--spacing-body-block-end)}.spacing-body-block-start,:host(.spacing-body-block-start){padding-block-start:var(--spacing-body-block-start)}.spacing-body-block-end,:host(.spacing-body-block-end){padding-block-end:var(--spacing-body-block-end)}.spacing-body-inline,:host(.spacing-body-inline){padding-inline:var(--spacing-body-inline-start) var(--spacing-body-inline-end)}.spacing-body-inline-start,:host(.spacing-body-inline-start){padding-inline-start:var(--spacing-body-inline-start)}.spacing-body-inline-end,:host(.spacing-body-inline-end){padding-inline-end:var(--spacing-body-inline-end)}.spacing-body,:host(.spacing-body){padding-block:var(--spacing-body-block-start) var(--spacing-body-block-end);padding-inline:var(--spacing-body-inline-start) var(--spacing-body-inline-end)}.spacing-body-block,:host(.spacing-body-block){padding-block:var(--spacing-body-block-start) var(--spacing-body-block-end)}.spacing-body-block-start,:host(.spacing-body-block-start){padding-block-start:var(--spacing-body-block-start)}.spacing-body-block-end,:host(.spacing-body-block-end){padding-block-end:var(--spacing-body-block-end)}.spacing-body-inline,:host(.spacing-body-inline){padding-inline:var(--spacing-body-inline-start) var(--spacing-body-inline-end)}.spacing-body-inline-start,:host(.spacing-body-inline-start){padding-inline-start:var(--spacing-body-inline-start)}.spacing-body-inline-end,:host(.spacing-body-inline-end){padding-inline-end:var(--spacing-body-inline-end)}.spacing-body,:host(.spacing-body){padding-block:var(--spacing-body-block-start) var(--spacing-body-block-end);padding-inline:var(--spacing-body-inline-start) var(--spacing-body-inline-end)}.spacing-body-block,:host(.spacing-body-block){padding-block:var(--spacing-body-block-start) var(--spacing-body-block-end)}.spacing-body-block-start,:host(.spacing-body-block-start){padding-block-start:var(--spacing-body-block-start)}.spacing-body-block-end,:host(.spacing-body-block-end){padding-block-end:var(--spacing-body-block-end)}.spacing-body-inline,:host(.spacing-body-inline){padding-inline:var(--spacing-body-inline-start) var(--spacing-body-inline-end)}.spacing-body-inline-start,:host(.spacing-body-inline-start){padding-inline-start:var(--spacing-body-inline-start)}.spacing-body-inline-end,:host(.spacing-body-inline-end){padding-inline-end:var(--spacing-body-inline-end)}.spacing-body,:host(.spacing-body){padding-block:var(--spacing-body-block-start) var(--spacing-body-block-end);padding-inline:var(--spacing-body-inline-start) var(--spacing-body-inline-end)}.spacing-body-block,:host(.spacing-body-block){padding-block:var(--spacing-body-block-start) var(--spacing-body-block-end)}.spacing-body-block-start,:host(.spacing-body-block-start){padding-block-start:var(--spacing-body-block-start)}.spacing-body-block-end,:host(.spacing-body-block-end){padding-block-end:var(--spacing-body-block-end)}.spacing-body-inline,:host(.spacing-body-inline){padding-inline:var(--spacing-body-inline-start) var(--spacing-body-inline-end)}.spacing-body-inline-start,:host(.spacing-body-inline-start){padding-inline-start:var(--spacing-body-inline-start)}.spacing-body-inline-end,:host(.spacing-body-inline-end){padding-inline-end:var(--spacing-body-inline-end)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}`;
@@ -0,0 +1 @@
1
+ export const bundle = `.heading-6,.heading-5,.heading-4,.heading-3,.heading-2,.heading-1{--heading-base__font-family: var(--mer-font-family--title);--heading__color: var( --mer-heading__gray--light );--heading-h1__font-size: var(--mer-font__size--xl);--heading-h1__font-weight: var(--mer-font__weight--bold);--heading-h1__line-height: var(--mer-line-height--tight);--heading-h2__font-size: var(--mer-font__size--lg);--heading-h2__font-weight: var(--mer-font__weight--bold);--heading-h2__line-height: var(--mer-line-height--tight);--heading-h3__font-size: var(--mer-font__size--sm);--heading-h3__font-weight: var(--mer-font__weight--bold);--heading-h3__line-height: var(--mer-line-height--regular);--heading-h4__font-size: var(--mer-font__size--xs);--heading-h4__font-weight: var(--mer-font__weight--bold);--heading-h4__line-height: var(--mer-line-height--spaced);--heading-h5__font-size: var(--mer-font__size--2xs);--heading-h5__font-weight: var(--mer-font__weight--bold);--heading-h5__line-height: var(--mer-line-height--spaced);--heading-h6__font-size: var(--mer-font__size--3xs);--heading-h6__font-weight: var(--mer-font__weight--semi-bold);--heading-h6__line-height: var(--mer-line-height--spaced);font-family:var(--mer-font-family--title);line-height:var(--mer-line-height--tight);color:var(--heading__color)}.heading-1{font-size:var(--mer-font__size--xl);font-weight:var(--mer-font__weight--bold);line-height:var(--heading-h1__line-height)}.heading-2{font-size:var(--mer-font__size--lg);font-weight:var(--mer-font__weight--bold);line-height:var(--heading-h2__line-height)}.heading-3{font-size:var(--mer-font__size--sm);font-weight:var(--mer-font__weight--bold);line-height:var(--heading-h3__line-height)}.heading-4{font-size:var(--mer-font__size--xs);font-weight:var(--mer-font__weight--bold);line-height:var(--heading-h4__line-height)}.heading-5{font-size:var(--mer-font__size--2xs);font-weight:var(--mer-font__weight--bold);line-height:var(--heading-h5__line-height)}.heading-6{font-size:var(--mer-font__size--3xs);font-weight:var(--mer-font__weight--semi-bold);line-height:var(--heading-h6__line-height)}.heading-gray--light{--heading__color: var(--mer-heading__gray--light)}.text-body-italic-xs,.text-body-italic-s,.text-body-italic-m,.text-body-italic-l,.text-body-highlighted-xs,.text-body-highlighted-s,.text-body-highlighted-m,.text-body-highlighted-l,.text-body-regular-xs,.text-body-regular-s,.text-body-regular-m,.text-body-regular-l{--text-body__font-size--l: var(--mer-font__size--sm);--text-body__font-size--m: var(--mer-font__size--xs);--text-body__font-size--s: var(--mer-font__size--3xs);--text-body__font-size--xs: var(--mer-font__size--4xs);--text-body__line-height: var(--mer-line-height--spaced);--text-body-regular__font-weight: var(--mer-font__weight--regular);--text-body-highlighted__font-weight: var(--mer-font__weight--semi-bold);--text-body-italic__font-weight: var(--mer-font__weight--regular)}.text-body-regular-l{font-size:var(--text-body__font-size--l);font-weight:var(--text-body-regular__font-weight);line-height:var(--text-body__line-height)}.text-body-regular-m{font-size:var(--text-body__font-size--m);font-weight:var(--text-body-regular__font-weight);line-height:var(--text-body__line-height)}.text-body-regular-s{font-size:var(--text-body__font-size--s);font-weight:var(--text-body-regular__font-weight);line-height:var(--text-body__line-height)}.text-body-regular-xs{font-size:var(--text-body__font-size--xs);font-weight:var(--text-body-regular__font-weight);line-height:var(--text-body__line-height)}.text-body-highlighted-l{font-size:var(--text-body__font-size--l);font-weight:var(--text-body-highlighted__font-weight);line-height:var(--text-body__line-height)}.text-body-highlighted-m{font-size:var(--text-body__font-size--m);font-weight:var(--text-body-highlighted__font-weight);line-height:var(--text-body__line-height)}.text-body-highlighted-s{font-size:var(--text-body__font-size--s);font-weight:var(--text-body-highlighted__font-weight);line-height:var(--text-body__line-height)}.text-body-highlighted-xs{font-size:var(--text-body__font-size--xs);font-weight:var(--text-body-highlighted__font-weight);line-height:var(--text-body__line-height)}.text-body-italic-l{font-size:var(--text-body__font-size--l);font-style:italic;font-weight:var(--text-body-italic__font-weight);line-height:var(--text-body__line-height)}.text-body-italic-m{font-size:var(--text-body__font-size--m);font-style:italic;font-weight:var(--text-body-italic__font-weight);line-height:var(--text-body__line-height)}.text-body-italic-s{font-size:var(--text-body__font-size--s);font-style:italic;font-weight:var(--text-body-italic__font-weight);line-height:var(--text-body__line-height)}.text-body-italic-xs{font-size:var(--text-body__font-size--xs);font-style:italic;font-weight:var(--text-body-italic__font-weight);line-height:var(--text-body__line-height)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}h1,h2,h3,h4,h5,h6,p{font:unset;margin:0;padding:0;color:unset}`;
package/dist/bundles.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import type { ThemeModel } from "@genexus/chameleon-controls-library";
2
- import type { MercuryBundleComponent, MercuryBundleComponentForm, MercuryBundleFull, MercuryBundleOptimized, MercuryBundleReset, MercuryBundleUtil, MercuryBundleUtilFormFull } from "./types.ts";
3
- type BundleNames = MercuryBundleComponent | MercuryBundleComponentForm | MercuryBundleReset | MercuryBundleUtil | MercuryBundleUtilFormFull;
2
+ import type { MercuryBundleFull, MercuryBundleMapping, MercuryBundleOptimized } from "./types.ts";
4
3
  /**
5
4
  * Given the basePath, returns all bundles (except base and icons) in the
6
5
  * format of type `ThemeModel`.
@@ -17,285 +16,285 @@ type BundleNames = MercuryBundleComponent | MercuryBundleComponentForm | Mercury
17
16
  * </body>
18
17
  * ```
19
18
  */
20
- export declare const getThemeBundles: (basePath: string) => [{
21
- readonly name: BundleNames;
22
- readonly url: `${string}components/accordion.css`;
19
+ export declare const getThemeBundles: (basePath: string, bundleNamePrefix?: string) => [{
20
+ readonly name: string;
21
+ readonly url: string;
23
22
  readonly attachStyleSheet?: undefined;
24
23
  } | {
25
- readonly name: BundleNames;
26
- readonly url: `${string}components/accordion.css`;
24
+ readonly name: string;
25
+ readonly url: string;
27
26
  readonly attachStyleSheet: boolean;
28
27
  }, {
29
- readonly name: BundleNames;
30
- readonly url: `${string}components/button.css`;
28
+ readonly name: string;
29
+ readonly url: string;
31
30
  readonly attachStyleSheet?: undefined;
32
31
  } | {
33
- readonly name: BundleNames;
34
- readonly url: `${string}components/button.css`;
32
+ readonly name: string;
33
+ readonly url: string;
35
34
  readonly attachStyleSheet: boolean;
36
35
  }, {
37
- readonly name: BundleNames;
38
- readonly url: `${string}components/chat.css`;
36
+ readonly name: string;
37
+ readonly url: string;
39
38
  readonly attachStyleSheet?: undefined;
40
39
  } | {
41
- readonly name: BundleNames;
42
- readonly url: `${string}components/chat.css`;
40
+ readonly name: string;
41
+ readonly url: string;
43
42
  readonly attachStyleSheet: boolean;
44
43
  }, {
45
- readonly name: BundleNames;
46
- readonly url: `${string}components/checkbox.css`;
44
+ readonly name: string;
45
+ readonly url: string;
47
46
  readonly attachStyleSheet?: undefined;
48
47
  } | {
49
- readonly name: BundleNames;
50
- readonly url: `${string}components/checkbox.css`;
48
+ readonly name: string;
49
+ readonly url: string;
51
50
  readonly attachStyleSheet: boolean;
52
51
  }, {
53
- readonly name: BundleNames;
54
- readonly url: `${string}components/code.css`;
52
+ readonly name: string;
53
+ readonly url: string;
55
54
  readonly attachStyleSheet?: undefined;
56
55
  } | {
57
- readonly name: BundleNames;
58
- readonly url: `${string}components/code.css`;
56
+ readonly name: string;
57
+ readonly url: string;
59
58
  readonly attachStyleSheet: boolean;
60
59
  }, {
61
- readonly name: BundleNames;
62
- readonly url: `${string}components/combo-box.css`;
60
+ readonly name: string;
61
+ readonly url: string;
63
62
  readonly attachStyleSheet?: undefined;
64
63
  } | {
65
- readonly name: BundleNames;
66
- readonly url: `${string}components/combo-box.css`;
64
+ readonly name: string;
65
+ readonly url: string;
67
66
  readonly attachStyleSheet: boolean;
68
67
  }, {
69
- readonly name: BundleNames;
70
- readonly url: `${string}components/flexible-layout.css`;
68
+ readonly name: string;
69
+ readonly url: string;
71
70
  readonly attachStyleSheet?: undefined;
72
71
  } | {
73
- readonly name: BundleNames;
74
- readonly url: `${string}components/flexible-layout.css`;
72
+ readonly name: string;
73
+ readonly url: string;
75
74
  readonly attachStyleSheet: boolean;
76
75
  }, {
77
- readonly name: BundleNames;
78
- readonly url: `${string}components/dialog.css`;
76
+ readonly name: string;
77
+ readonly url: string;
79
78
  readonly attachStyleSheet?: undefined;
80
79
  } | {
81
- readonly name: BundleNames;
82
- readonly url: `${string}components/dialog.css`;
80
+ readonly name: string;
81
+ readonly url: string;
83
82
  readonly attachStyleSheet: boolean;
84
83
  }, {
85
- readonly name: BundleNames;
86
- readonly url: `${string}components/dropdown.css`;
84
+ readonly name: string;
85
+ readonly url: string;
87
86
  readonly attachStyleSheet?: undefined;
88
87
  } | {
89
- readonly name: BundleNames;
90
- readonly url: `${string}components/dropdown.css`;
88
+ readonly name: string;
89
+ readonly url: string;
91
90
  readonly attachStyleSheet: boolean;
92
91
  }, {
93
- readonly name: BundleNames;
94
- readonly url: `${string}components/icon.css`;
92
+ readonly name: string;
93
+ readonly url: string;
95
94
  readonly attachStyleSheet?: undefined;
96
95
  } | {
97
- readonly name: BundleNames;
98
- readonly url: `${string}components/icon.css`;
96
+ readonly name: string;
97
+ readonly url: string;
99
98
  readonly attachStyleSheet: boolean;
100
99
  }, {
101
- readonly name: BundleNames;
102
- readonly url: `${string}components/edit.css`;
100
+ readonly name: string;
101
+ readonly url: string;
103
102
  readonly attachStyleSheet?: undefined;
104
103
  } | {
105
- readonly name: BundleNames;
106
- readonly url: `${string}components/edit.css`;
104
+ readonly name: string;
105
+ readonly url: string;
107
106
  readonly attachStyleSheet: boolean;
108
107
  }, {
109
- readonly name: BundleNames;
110
- readonly url: `${string}components/layout-splitter.css`;
108
+ readonly name: string;
109
+ readonly url: string;
111
110
  readonly attachStyleSheet?: undefined;
112
111
  } | {
113
- readonly name: BundleNames;
114
- readonly url: `${string}components/layout-splitter.css`;
112
+ readonly name: string;
113
+ readonly url: string;
115
114
  readonly attachStyleSheet: boolean;
116
115
  }, {
117
- readonly name: BundleNames;
118
- readonly url: `${string}components/list-box.css`;
116
+ readonly name: string;
117
+ readonly url: string;
119
118
  readonly attachStyleSheet?: undefined;
120
119
  } | {
121
- readonly name: BundleNames;
122
- readonly url: `${string}components/list-box.css`;
120
+ readonly name: string;
121
+ readonly url: string;
123
122
  readonly attachStyleSheet: boolean;
124
123
  }, {
125
- readonly name: BundleNames;
126
- readonly url: `${string}components/markdown-viewer.css`;
124
+ readonly name: string;
125
+ readonly url: string;
127
126
  readonly attachStyleSheet?: undefined;
128
127
  } | {
129
- readonly name: BundleNames;
130
- readonly url: `${string}components/markdown-viewer.css`;
128
+ readonly name: string;
129
+ readonly url: string;
131
130
  readonly attachStyleSheet: boolean;
132
131
  }, {
133
- readonly name: BundleNames;
134
- readonly url: `${string}components/navigation-list.css`;
132
+ readonly name: string;
133
+ readonly url: string;
135
134
  readonly attachStyleSheet?: undefined;
136
135
  } | {
137
- readonly name: BundleNames;
138
- readonly url: `${string}components/navigation-list.css`;
136
+ readonly name: string;
137
+ readonly url: string;
139
138
  readonly attachStyleSheet: boolean;
140
139
  }, {
141
- readonly name: BundleNames;
142
- readonly url: `${string}components/pills.css`;
140
+ readonly name: string;
141
+ readonly url: string;
143
142
  readonly attachStyleSheet?: undefined;
144
143
  } | {
145
- readonly name: BundleNames;
146
- readonly url: `${string}components/pills.css`;
144
+ readonly name: string;
145
+ readonly url: string;
147
146
  readonly attachStyleSheet: boolean;
148
147
  }, {
149
- readonly name: BundleNames;
150
- readonly url: `${string}components/radio-group.css`;
148
+ readonly name: string;
149
+ readonly url: string;
151
150
  readonly attachStyleSheet?: undefined;
152
151
  } | {
153
- readonly name: BundleNames;
154
- readonly url: `${string}components/radio-group.css`;
152
+ readonly name: string;
153
+ readonly url: string;
155
154
  readonly attachStyleSheet: boolean;
156
155
  }, {
157
- readonly name: BundleNames;
158
- readonly url: `${string}components/segmented-control.css`;
156
+ readonly name: string;
157
+ readonly url: string;
159
158
  readonly attachStyleSheet?: undefined;
160
159
  } | {
161
- readonly name: BundleNames;
162
- readonly url: `${string}components/segmented-control.css`;
160
+ readonly name: string;
161
+ readonly url: string;
163
162
  readonly attachStyleSheet: boolean;
164
163
  }, {
165
- readonly name: BundleNames;
166
- readonly url: `${string}components/sidebar.css`;
164
+ readonly name: string;
165
+ readonly url: string;
167
166
  readonly attachStyleSheet?: undefined;
168
167
  } | {
169
- readonly name: BundleNames;
170
- readonly url: `${string}components/sidebar.css`;
168
+ readonly name: string;
169
+ readonly url: string;
171
170
  readonly attachStyleSheet: boolean;
172
171
  }, {
173
- readonly name: BundleNames;
174
- readonly url: `${string}components/slider.css`;
172
+ readonly name: string;
173
+ readonly url: string;
175
174
  readonly attachStyleSheet?: undefined;
176
175
  } | {
177
- readonly name: BundleNames;
178
- readonly url: `${string}components/slider.css`;
176
+ readonly name: string;
177
+ readonly url: string;
179
178
  readonly attachStyleSheet: boolean;
180
179
  }, {
181
- readonly name: BundleNames;
182
- readonly url: `${string}components/tab.css`;
180
+ readonly name: string;
181
+ readonly url: string;
183
182
  readonly attachStyleSheet?: undefined;
184
183
  } | {
185
- readonly name: BundleNames;
186
- readonly url: `${string}components/tab.css`;
184
+ readonly name: string;
185
+ readonly url: string;
187
186
  readonly attachStyleSheet: boolean;
188
187
  }, {
189
- readonly name: BundleNames;
190
- readonly url: `${string}components/tabular-grid.css`;
188
+ readonly name: string;
189
+ readonly url: string;
191
190
  readonly attachStyleSheet?: undefined;
192
191
  } | {
193
- readonly name: BundleNames;
194
- readonly url: `${string}components/tabular-grid.css`;
192
+ readonly name: string;
193
+ readonly url: string;
195
194
  readonly attachStyleSheet: boolean;
196
195
  }, {
197
- readonly name: BundleNames;
198
- readonly url: `${string}components/ticket-list.css`;
196
+ readonly name: string;
197
+ readonly url: string;
199
198
  readonly attachStyleSheet?: undefined;
200
199
  } | {
201
- readonly name: BundleNames;
202
- readonly url: `${string}components/ticket-list.css`;
200
+ readonly name: string;
201
+ readonly url: string;
203
202
  readonly attachStyleSheet: boolean;
204
203
  }, {
205
- readonly name: BundleNames;
206
- readonly url: `${string}components/switch.css`;
204
+ readonly name: string;
205
+ readonly url: string;
207
206
  readonly attachStyleSheet?: undefined;
208
207
  } | {
209
- readonly name: BundleNames;
210
- readonly url: `${string}components/switch.css`;
208
+ readonly name: string;
209
+ readonly url: string;
211
210
  readonly attachStyleSheet: boolean;
212
211
  }, {
213
- readonly name: BundleNames;
214
- readonly url: `${string}components/tooltip.css`;
212
+ readonly name: string;
213
+ readonly url: string;
215
214
  readonly attachStyleSheet?: undefined;
216
215
  } | {
217
- readonly name: BundleNames;
218
- readonly url: `${string}components/tooltip.css`;
216
+ readonly name: string;
217
+ readonly url: string;
219
218
  readonly attachStyleSheet: boolean;
220
219
  }, {
221
- readonly name: BundleNames;
222
- readonly url: `${string}components/tree-view.css`;
220
+ readonly name: string;
221
+ readonly url: string;
223
222
  readonly attachStyleSheet?: undefined;
224
223
  } | {
225
- readonly name: BundleNames;
226
- readonly url: `${string}components/tree-view.css`;
224
+ readonly name: string;
225
+ readonly url: string;
227
226
  readonly attachStyleSheet: boolean;
228
227
  }, {
229
- readonly name: BundleNames;
230
- readonly url: `${string}components/widget.css`;
228
+ readonly name: string;
229
+ readonly url: string;
231
230
  readonly attachStyleSheet?: undefined;
232
231
  } | {
233
- readonly name: BundleNames;
234
- readonly url: `${string}components/widget.css`;
232
+ readonly name: string;
233
+ readonly url: string;
235
234
  readonly attachStyleSheet: boolean;
236
235
  }, {
237
- readonly name: BundleNames;
238
- readonly url: `${string}resets/box-sizing.css`;
236
+ readonly name: string;
237
+ readonly url: string;
239
238
  readonly attachStyleSheet?: undefined;
240
239
  } | {
241
- readonly name: BundleNames;
242
- readonly url: `${string}resets/box-sizing.css`;
240
+ readonly name: string;
241
+ readonly url: string;
243
242
  readonly attachStyleSheet: boolean;
244
243
  }, {
245
- readonly name: BundleNames;
246
- readonly url: `${string}utils/form.css`;
244
+ readonly name: string;
245
+ readonly url: string;
247
246
  readonly attachStyleSheet?: undefined;
248
247
  } | {
249
- readonly name: BundleNames;
250
- readonly url: `${string}utils/form.css`;
248
+ readonly name: string;
249
+ readonly url: string;
251
250
  readonly attachStyleSheet: boolean;
252
251
  }, {
253
- readonly name: BundleNames;
254
- readonly url: `${string}utils/elevation.css`;
252
+ readonly name: string;
253
+ readonly url: string;
255
254
  readonly attachStyleSheet?: undefined;
256
255
  } | {
257
- readonly name: BundleNames;
258
- readonly url: `${string}utils/elevation.css`;
256
+ readonly name: string;
257
+ readonly url: string;
259
258
  readonly attachStyleSheet: boolean;
260
259
  }, {
261
- readonly name: BundleNames;
262
- readonly url: `${string}utils/form--full.css`;
260
+ readonly name: string;
261
+ readonly url: string;
263
262
  readonly attachStyleSheet?: undefined;
264
263
  } | {
265
- readonly name: BundleNames;
266
- readonly url: `${string}utils/form--full.css`;
264
+ readonly name: string;
265
+ readonly url: string;
267
266
  readonly attachStyleSheet: boolean;
268
267
  }, {
269
- readonly name: BundleNames;
270
- readonly url: `${string}utils/layout.css`;
268
+ readonly name: string;
269
+ readonly url: string;
271
270
  readonly attachStyleSheet?: undefined;
272
271
  } | {
273
- readonly name: BundleNames;
274
- readonly url: `${string}utils/layout.css`;
272
+ readonly name: string;
273
+ readonly url: string;
275
274
  readonly attachStyleSheet: boolean;
276
275
  }, {
277
- readonly name: BundleNames;
278
- readonly url: `${string}utils/spacing.css`;
276
+ readonly name: string;
277
+ readonly url: string;
279
278
  readonly attachStyleSheet?: undefined;
280
279
  } | {
281
- readonly name: BundleNames;
282
- readonly url: `${string}utils/spacing.css`;
280
+ readonly name: string;
281
+ readonly url: string;
283
282
  readonly attachStyleSheet: boolean;
284
283
  }, {
285
- readonly name: BundleNames;
286
- readonly url: `${string}utils/typography.css`;
284
+ readonly name: string;
285
+ readonly url: string;
287
286
  readonly attachStyleSheet?: undefined;
288
287
  } | {
289
- readonly name: BundleNames;
290
- readonly url: `${string}utils/typography.css`;
288
+ readonly name: string;
289
+ readonly url: string;
291
290
  readonly attachStyleSheet: boolean;
292
291
  }, {
293
- readonly name: BundleNames;
294
- readonly url: `${string}chameleon/scrollbar.css`;
292
+ readonly name: string;
293
+ readonly url: string;
295
294
  readonly attachStyleSheet?: undefined;
296
295
  } | {
297
- readonly name: BundleNames;
298
- readonly url: `${string}chameleon/scrollbar.css`;
296
+ readonly name: string;
297
+ readonly url: string;
299
298
  readonly attachStyleSheet: boolean;
300
299
  }];
301
300
  /**
@@ -316,7 +315,8 @@ export declare const getThemeBundles: (basePath: string) => [{
316
315
  * "utils/form",
317
316
  * "utils/layout",
318
317
  * ],
319
- * "./assets/css/"
318
+ * "./assets/css/", (optional)
319
+ * "mercury" (optional)
320
320
  * );
321
321
  *
322
322
  * HTML/render/template:
@@ -326,5 +326,12 @@ export declare const getThemeBundles: (basePath: string) => [{
326
326
  * </Host>
327
327
  * ```
328
328
  */
329
- export declare const getBundles: (bundles: MercuryBundleOptimized[] | MercuryBundleFull[], basePath?: string) => ThemeModel;
330
- export {};
329
+ export declare const getBundles: (bundles: MercuryBundleOptimized[] | MercuryBundleFull[], basePath?: string, bundleNamePrefix?: string) => ThemeModel;
330
+ /**
331
+ * Establish the mapping between the bundle name and its generated hash.
332
+ *
333
+ * If the bundles are created with the CLI that provides Mercury
334
+ * (`mercury` command), this mapping must be set to download the right bundles
335
+ * with the ch-theme component.
336
+ */
337
+ export declare const setBundleMapping: (mappings: MercuryBundleMapping) => void;
package/dist/bundles.js CHANGED
@@ -1 +1 @@
1
- "use strict";const n=(o,c,p=void 0)=>p===void 0?{name:c,url:`${o}${c}.css`}:{name:c,url:`${o}${c}.css`,attachStyleSheet:p};export const getThemeBundles=o=>[n(o,"components/accordion"),n(o,"components/button"),n(o,"components/chat"),n(o,"components/checkbox"),n(o,"components/code"),n(o,"components/combo-box"),n(o,"components/flexible-layout"),n(o,"components/dialog"),n(o,"components/dropdown"),n(o,"components/icon"),n(o,"components/edit"),n(o,"components/layout-splitter"),n(o,"components/list-box"),n(o,"components/markdown-viewer",!1),n(o,"components/navigation-list"),n(o,"components/pills"),n(o,"components/radio-group"),n(o,"components/segmented-control"),n(o,"components/sidebar"),n(o,"components/slider"),n(o,"components/tab"),n(o,"components/tabular-grid"),n(o,"components/ticket-list"),n(o,"components/switch"),n(o,"components/tooltip"),n(o,"components/tree-view"),n(o,"components/widget"),n(o,"resets/box-sizing"),n(o,"utils/form"),n(o,"utils/elevation"),n(o,"utils/form--full"),n(o,"utils/layout"),n(o,"utils/spacing"),n(o,"utils/typography"),n(o,"chameleon/scrollbar")],getBundles=(o,c)=>c?o.map(p=>n(c,p)):o;
1
+ "use strict";let s;const n=(c,o,p,t=void 0)=>{const g=p?p+o:o,m=s?s[o]:o,w=`${c}${m}.css`;return t===void 0?{name:g,url:w}:{name:g,url:w,attachStyleSheet:t}};export const getThemeBundles=(c,o)=>[n(c,"components/accordion",o),n(c,"components/button",o),n(c,"components/chat",o),n(c,"components/checkbox",o),n(c,"components/code",o),n(c,"components/combo-box",o),n(c,"components/flexible-layout",o),n(c,"components/dialog",o),n(c,"components/dropdown",o),n(c,"components/icon",o),n(c,"components/edit",o),n(c,"components/layout-splitter",o),n(c,"components/list-box",o),n(c,"components/markdown-viewer",o,!1),n(c,"components/navigation-list",o),n(c,"components/pills",o),n(c,"components/radio-group",o),n(c,"components/segmented-control",o),n(c,"components/sidebar",o),n(c,"components/slider",o),n(c,"components/switch",o),n(c,"components/tab",o),n(c,"components/tabular-grid",o),n(c,"components/ticket-list",o),n(c,"components/tooltip",o),n(c,"components/tree-view",o),n(c,"components/widget",o),n(c,"resets/box-sizing",o),n(c,"utils/form",o),n(c,"utils/elevation",o),n(c,"utils/form--full",o),n(c,"utils/layout",o),n(c,"utils/spacing",o),n(c,"utils/typography",o),n(c,"chameleon/scrollbar",o)];const v=(c,o)=>o?c.map(p=>o+p):c;export const getBundles=(c,o,p)=>o?c.map(t=>n(o,t,p)):v(c,p),setBundleMapping=c=>{s=c};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ import { ensureDirectoryExistsAndItsClear, walkSync, copyDirectories } from "./internal/file-management.js";
3
+ import { BASE_BUNDLES_OUT_DIR, SCSS_BUNDLES_INPUT_DIR, SCSS_BUNDLES_OUT_DIR } from "./internal/constants.js";
4
+ import { createBundleMappingsFile, transpileCssBundleWithPlaceholder } from "./internal/transpile-bundle-and-create-mappings.js";
5
+ import { measureTime } from "./internal/utils.js";
6
+ measureTime(() => {
7
+ // Improve process visualization
8
+ console.log("");
9
+ // Clear bundle directories
10
+ ensureDirectoryExistsAndItsClear(BASE_BUNDLES_OUT_DIR);
11
+ // Copy the src/bundles/scss content to the dist/bundles/scss and create the
12
+ // bundles
13
+ copyDirectories(SCSS_BUNDLES_INPUT_DIR, SCSS_BUNDLES_OUT_DIR);
14
+ // Transpile scss bundles into .css and .js files
15
+ for (const fileMetadata of walkSync(SCSS_BUNDLES_OUT_DIR)) {
16
+ transpileCssBundleWithPlaceholder(fileMetadata);
17
+ }
18
+ // Import all .js files into a single file (defined in `BUNDLE_MAPPING_FILE` var)
19
+ createBundleMappingsFile();
20
+ });
@@ -0,0 +1,28 @@
1
+ export declare const KB = 1000;
2
+ export declare const SCSS_BUNDLES_INPUT_DIR: string;
3
+ export declare const BASE_BUNDLES_OUT_DIR: string;
4
+ export declare const SCSS_BUNDLES_OUT_DIR: string;
5
+ export declare const CSS_BUNDLES_OUT_DIR: string;
6
+ export declare const JS_BUNDLES_OUT_DIR: string;
7
+ export declare const BASE_BUNDLE = "base/base";
8
+ export declare const BASE_BUNDLE_WITH_BACK_SLASH = "\\base\\base";
9
+ export declare const BASE_GLOBANT_BUNDLE = "base/base-globant";
10
+ export declare const BUNDLE_MAPPING_FILE = "bundle-mappings.js";
11
+ export declare const BUNDLE_MAPPING_TO_HASH_FILE = "bundle-to-hash-mappings.ts";
12
+ export declare const BASE_SCSS_FILE = "base.scss";
13
+ export declare const BASE_GLOBANT_FILE = "base-globant";
14
+ export declare const BASE_GLOBANT_CSS_FILE = "base-globant.css";
15
+ export declare const BASE_GLOBANT_JS_FILE = "base-globant.js";
16
+ export declare const BASE_GLOBANT_SCSS_FILE = "base-globant.scss";
17
+ export declare const ICONS_PATH_PLACEHOLDER = "{{ICONS_PATH}}";
18
+ export declare const FONT_FACE_PATH_PLACEHOLDER = "{{FONT_FACE_PATH}}";
19
+ export declare const DEFAULT_FONT_FACE_PATH = "./assets/fonts/";
20
+ export declare const DEFAULT_ICONS_PATH = "./assets/icons/";
21
+ export declare const DEFAULT_OUT_DIR_PATH = "./.mercury";
22
+ export declare const SEPARATE_BY_COMMA_REGEX: RegExp;
23
+ export declare const SPECIAL_CHARS_IN_BUNDLE_NAME_REGEX: RegExp;
24
+ export declare const BUNDLE_MAPPING_ENTRIES: {
25
+ readonly BUNDLE_NAME: "bundleName";
26
+ readonly FILE_DIR: "fileDir";
27
+ readonly TRANSPILED_BUNDLE: "transpiledBundle";
28
+ };
@@ -0,0 +1,33 @@
1
+ import path from "node:path";
2
+ export const KB = 1000;
3
+ export const SCSS_BUNDLES_INPUT_DIR = path.join("src", "bundles", "scss");
4
+ export const BASE_BUNDLES_OUT_DIR = path.join("dist", "bundles");
5
+ export const SCSS_BUNDLES_OUT_DIR = path.join(BASE_BUNDLES_OUT_DIR, "scss");
6
+ export const CSS_BUNDLES_OUT_DIR = path.join(BASE_BUNDLES_OUT_DIR, "css");
7
+ export const JS_BUNDLES_OUT_DIR = path.join(BASE_BUNDLES_OUT_DIR, "js");
8
+ export const BASE_BUNDLE = "base/base";
9
+ export const BASE_BUNDLE_WITH_BACK_SLASH = "\\base\\base";
10
+ export const BASE_GLOBANT_BUNDLE = "base/base-globant";
11
+ // Files
12
+ export const BUNDLE_MAPPING_FILE = "bundle-mappings.js";
13
+ export const BUNDLE_MAPPING_TO_HASH_FILE = "bundle-to-hash-mappings.ts";
14
+ export const BASE_SCSS_FILE = "base.scss";
15
+ export const BASE_GLOBANT_FILE = "base-globant";
16
+ export const BASE_GLOBANT_CSS_FILE = "base-globant.css";
17
+ export const BASE_GLOBANT_JS_FILE = "base-globant.js";
18
+ export const BASE_GLOBANT_SCSS_FILE = "base-globant.scss";
19
+ // Placeholders
20
+ export const ICONS_PATH_PLACEHOLDER = "{{ICONS_PATH}}";
21
+ export const FONT_FACE_PATH_PLACEHOLDER = "{{FONT_FACE_PATH}}";
22
+ // Defaults
23
+ export const DEFAULT_FONT_FACE_PATH = "./assets/fonts/";
24
+ export const DEFAULT_ICONS_PATH = "./assets/icons/";
25
+ export const DEFAULT_OUT_DIR_PATH = "./.mercury";
26
+ export const SEPARATE_BY_COMMA_REGEX = /\s*,\s*/g;
27
+ export const SPECIAL_CHARS_IN_BUNDLE_NAME_REGEX = /[\/-]/g;
28
+ // Bundle mapping entries
29
+ export const BUNDLE_MAPPING_ENTRIES = {
30
+ BUNDLE_NAME: "bundleName",
31
+ FILE_DIR: "fileDir",
32
+ TRANSPILED_BUNDLE: "transpiledBundle"
33
+ };
@@ -0,0 +1,2 @@
1
+ import type { CLIArguments } from "./types";
2
+ export declare const createBundlesWithCustomPaths: (args: CLIArguments) => void;