@genexus/mercury 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundles.d.ts CHANGED
@@ -298,10 +298,10 @@ export declare const getThemeBundles: (basePath: string, bundleNamePrefix?: stri
298
298
  readonly attachStyleSheet: boolean;
299
299
  }];
300
300
  /**
301
- * Given the bundles array and the basePath (optional), returns the given
302
- * bundles in the format of type `ThemeModel`.
301
+ * Given the bundles array and the basePath or options (optional), returns the
302
+ * given bundles in the format of type `ThemeModel`.
303
303
  *
304
- * This is useful for defining the following in a dialog:
304
+ * This is useful for loading the themes in a component. Example:
305
305
  *
306
306
  * ```tsx
307
307
  * const CSS_BUNDLES: ThemeModel = getBundles(
@@ -315,8 +315,7 @@ export declare const getThemeBundles: (basePath: string, bundleNamePrefix?: stri
315
315
  * "utils/form",
316
316
  * "utils/layout",
317
317
  * ],
318
- * "./assets/css/", (optional)
319
- * "mercury" (optional)
318
+ * "/assets/css/" or { basePath: "/assets/css/", bundleNamePrefix: ..., bundleMappings: ... }, (optional)
320
319
  * );
321
320
  *
322
321
  * HTML/render/template:
@@ -326,12 +325,18 @@ export declare const getThemeBundles: (basePath: string, bundleNamePrefix?: stri
326
325
  * </Host>
327
326
  * ```
328
327
  */
329
- export declare const getBundles: (bundles: MercuryBundleOptimized[] | MercuryBundleFull[], basePath?: string, bundleNamePrefix?: string) => ThemeModel;
328
+ export declare const getBundles: (bundles: MercuryBundleOptimized[] | MercuryBundleFull[], optionsOrBasePath?: string | {
329
+ basePath?: string;
330
+ bundleNamePrefix?: string;
331
+ bundleMappings?: MercuryBundleMapping;
332
+ }) => ThemeModel;
330
333
  /**
331
334
  * Establish the mapping between the bundle name and its generated hash.
332
335
  *
333
336
  * If the bundles are created with the CLI that provides Mercury
334
337
  * (`mercury` command), this mapping must be set to download the right bundles
335
338
  * with the ch-theme component.
339
+ *
340
+ * After that, the `getBundles` utility can be used.
336
341
  */
337
342
  export declare const setBundleMapping: (mappings: MercuryBundleMapping) => void;
package/dist/bundles.js CHANGED
@@ -1 +1 @@
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};
1
+ "use strict";let s;const c=(o,n)=>{const{attachStyleSheet:t,bundleName:l,bundleNamePrefix:p,bundleMappings:m}=n,e=p?p+l:l,u=m??s,g=u?u[l]:l,d=`${o}${g}.css`;return t===void 0?{name:e,url:d}:{name:e,url:d,attachStyleSheet:t}};export const getThemeBundles=(o,n)=>[c(o,{bundleName:"components/accordion",bundleNamePrefix:n}),c(o,{bundleName:"components/button",bundleNamePrefix:n}),c(o,{bundleName:"components/chat",bundleNamePrefix:n}),c(o,{bundleName:"components/checkbox",bundleNamePrefix:n}),c(o,{bundleName:"components/code",bundleNamePrefix:n}),c(o,{bundleName:"components/combo-box",bundleNamePrefix:n}),c(o,{bundleName:"components/flexible-layout",bundleNamePrefix:n}),c(o,{bundleName:"components/dialog",bundleNamePrefix:n}),c(o,{bundleName:"components/dropdown",bundleNamePrefix:n}),c(o,{bundleName:"components/icon",bundleNamePrefix:n}),c(o,{bundleName:"components/edit",bundleNamePrefix:n}),c(o,{bundleName:"components/layout-splitter",bundleNamePrefix:n}),c(o,{bundleName:"components/list-box",bundleNamePrefix:n}),c(o,{bundleName:"components/markdown-viewer",bundleNamePrefix:n,attachStyleSheet:!1}),c(o,{bundleName:"components/navigation-list",bundleNamePrefix:n}),c(o,{bundleName:"components/pills",bundleNamePrefix:n}),c(o,{bundleName:"components/radio-group",bundleNamePrefix:n}),c(o,{bundleName:"components/segmented-control",bundleNamePrefix:n}),c(o,{bundleName:"components/sidebar",bundleNamePrefix:n}),c(o,{bundleName:"components/slider",bundleNamePrefix:n}),c(o,{bundleName:"components/switch",bundleNamePrefix:n}),c(o,{bundleName:"components/tab",bundleNamePrefix:n}),c(o,{bundleName:"components/tabular-grid",bundleNamePrefix:n}),c(o,{bundleName:"components/ticket-list",bundleNamePrefix:n}),c(o,{bundleName:"components/tooltip",bundleNamePrefix:n}),c(o,{bundleName:"components/tree-view",bundleNamePrefix:n}),c(o,{bundleName:"components/widget",bundleNamePrefix:n}),c(o,{bundleName:"resets/box-sizing",bundleNamePrefix:n}),c(o,{bundleName:"utils/form",bundleNamePrefix:n}),c(o,{bundleName:"utils/elevation",bundleNamePrefix:n}),c(o,{bundleName:"utils/form--full",bundleNamePrefix:n}),c(o,{bundleName:"utils/layout",bundleNamePrefix:n}),c(o,{bundleName:"utils/spacing",bundleNamePrefix:n}),c(o,{bundleName:"utils/typography",bundleNamePrefix:n}),c(o,{bundleName:"chameleon/scrollbar",bundleNamePrefix:n})];const y=(o,n)=>n?o.map(t=>n+t):o;export const getBundles=(o,n)=>{let t,l,p;return typeof n=="object"?(t=n.basePath,l=n.bundleNamePrefix,p=n.bundleMappings):t=n,t?o.map(m=>c(t,{bundleName:m,bundleNamePrefix:l,bundleMappings:p})):y(o,l)},setBundleMapping=o=>{s=o};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genexus/mercury",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Mercury Design System is a robust and scalable solution designed to improve product development.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",