wavemaker-dev-mcp 0.1.1 → 1.0.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/README.md +75 -51
- package/dist/index.js +131 -180
- package/dist/index.js.map +1 -1
- package/dist/layout-tools.d.ts +27 -3
- package/dist/layout-tools.d.ts.map +1 -1
- package/dist/layout-tools.js +85 -32
- package/dist/layout-tools.js.map +1 -1
- package/dist/skills/loader.d.ts +36 -0
- package/dist/skills/loader.d.ts.map +1 -0
- package/dist/skills/loader.js +107 -0
- package/dist/skills/loader.js.map +1 -0
- package/package.json +8 -4
- package/skills/components/wm-accordion-pane.md +44 -0
- package/skills/components/wm-accordion.md +43 -0
- package/skills/components/wm-alert-dialog.md +42 -0
- package/skills/components/wm-anchor.md +51 -0
- package/skills/components/wm-audio.md +41 -0
- package/skills/components/wm-button-group.md +36 -0
- package/skills/components/wm-button.md +114 -0
- package/skills/components/wm-calendar.md +54 -0
- package/skills/components/wm-card.md +60 -0
- package/skills/components/wm-carousel.md +43 -0
- package/skills/components/wm-chart.md +104 -0
- package/skills/components/wm-checkbox.md +52 -0
- package/skills/components/wm-checkboxset.md +75 -0
- package/skills/components/wm-chips.md +78 -0
- package/skills/components/wm-composite.md +30 -0
- package/skills/components/wm-confirm-dialog.md +43 -0
- package/skills/components/wm-container.md +100 -0
- package/skills/components/wm-currency.md +69 -0
- package/skills/components/wm-datatable.md +146 -0
- package/skills/components/wm-date-time.md +80 -0
- package/skills/components/wm-date.md +78 -0
- package/skills/components/wm-dialog-body.md +28 -0
- package/skills/components/wm-dialog-container.md +48 -0
- package/skills/components/wm-dialog-content.md +31 -0
- package/skills/components/wm-dialog-footer.md +28 -0
- package/skills/components/wm-dialog-header.md +43 -0
- package/skills/components/wm-dialog.md +40 -0
- package/skills/components/wm-file-upload.md +58 -0
- package/skills/components/wm-footer.md +31 -0
- package/skills/components/wm-form-field.md +81 -0
- package/skills/components/wm-form.md +58 -0
- package/skills/components/wm-grid-column.md +30 -0
- package/skills/components/wm-header.md +31 -0
- package/skills/components/wm-html.md +31 -0
- package/skills/components/wm-icon.md +40 -0
- package/skills/components/wm-iframe-dialog.md +52 -0
- package/skills/components/wm-iframe.md +35 -0
- package/skills/components/wm-label.md +45 -0
- package/skills/components/wm-left-nav.md +35 -0
- package/skills/components/wm-linear-layout-item.md +28 -0
- package/skills/components/wm-linear-layout.md +92 -0
- package/skills/components/wm-list.md +92 -0
- package/skills/components/wm-live-filter.md +50 -0
- package/skills/components/wm-live-form.md +35 -0
- package/skills/components/wm-login-dialog.md +50 -0
- package/skills/components/wm-login.md +39 -0
- package/skills/components/wm-marquee.md +31 -0
- package/skills/components/wm-menu.md +71 -0
- package/skills/components/wm-message.md +41 -0
- package/skills/components/wm-nav-item.md +28 -0
- package/skills/components/wm-nav.md +61 -0
- package/skills/components/wm-number.md +62 -0
- package/skills/components/wm-page-content.md +34 -0
- package/skills/components/wm-page-dialog.md +45 -0
- package/skills/components/wm-page-toast.md +34 -0
- package/skills/components/wm-page.md +34 -0
- package/skills/components/wm-pagination.md +62 -0
- package/skills/components/wm-panel.md +69 -0
- package/skills/components/wm-partial-container.md +32 -0
- package/skills/components/wm-picture.md +46 -0
- package/skills/components/wm-popover.md +51 -0
- package/skills/components/wm-prefab-container.md +29 -0
- package/skills/components/wm-prefab.md +35 -0
- package/skills/components/wm-progress-bar.md +42 -0
- package/skills/components/wm-progress-circle.md +45 -0
- package/skills/components/wm-radioset.md +66 -0
- package/skills/components/wm-rating.md +76 -0
- package/skills/components/wm-rich-text-editor.md +36 -0
- package/skills/components/wm-right-nav.md +32 -0
- package/skills/components/wm-search.md +66 -0
- package/skills/components/wm-select.md +129 -0
- package/skills/components/wm-slider.md +53 -0
- package/skills/components/wm-spinner.md +43 -0
- package/skills/components/wm-tab-pane.md +45 -0
- package/skills/components/wm-table.md +113 -0
- package/skills/components/wm-tabs.md +48 -0
- package/skills/components/wm-text.md +65 -0
- package/skills/components/wm-textarea.md +47 -0
- package/skills/components/wm-tile.md +34 -0
- package/skills/components/wm-time.md +63 -0
- package/skills/components/wm-top-nav.md +31 -0
- package/skills/components/wm-tree.md +41 -0
- package/skills/components/wm-upload.md +42 -0
- package/skills/components/wm-video.md +48 -0
- package/skills/components/wm-wizard.md +59 -0
- package/skills/index.json +1151 -0
- package/skills/tokens/border.md +85 -0
- package/skills/tokens/colors.md +97 -0
- package/skills/tokens/elevation.md +73 -0
- package/skills/tokens/spacing.md +89 -0
- package/skills/tokens/typography.md +88 -0
- package/dist/components.d.ts +0 -17
- package/dist/components.d.ts.map +0 -1
- package/dist/components.js +0 -67
- package/dist/components.js.map +0 -1
- package/dist/paths.d.ts +0 -43
- package/dist/paths.d.ts.map +0 -1
- package/dist/paths.js +0 -103
- package/dist/paths.js.map +0 -1
- package/dist/search.d.ts +0 -15
- package/dist/search.d.ts.map +0 -1
- package/dist/search.js +0 -130
- package/dist/search.js.map +0 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: token-group
|
|
3
|
+
name: border
|
|
4
|
+
tags: [border, radius, rounded, outline, width, corner, shape]
|
|
5
|
+
summary: Border width scale (1px base) and border-radius scale (2px base) for consistent shapes.
|
|
6
|
+
generated: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Border & Radius
|
|
10
|
+
|
|
11
|
+
## Border Widths
|
|
12
|
+
|
|
13
|
+
Base: `--wm-border-width-base: 1px`. All widths are multiples of this base.
|
|
14
|
+
|
|
15
|
+
| Token | CSS Variable | Value |
|
|
16
|
+
|-------|-------------|-------|
|
|
17
|
+
| 0 (none) | `--wm-border-width-0` | 0px |
|
|
18
|
+
| 1 (default) | `--wm-border-width-1` | 1px |
|
|
19
|
+
| 2 | `--wm-border-width-2` | 2px |
|
|
20
|
+
| 3 | `--wm-border-width-3` | 3px |
|
|
21
|
+
| 4 | `--wm-border-width-4` | 4px |
|
|
22
|
+
|
|
23
|
+
Use `--wm-border-color` (defaults to `--wm-color-outline-variant`) and `--wm-border-style-base` (solid) for default border appearance.
|
|
24
|
+
|
|
25
|
+
## Border Styles
|
|
26
|
+
|
|
27
|
+
| Style | CSS Variable |
|
|
28
|
+
|-------|-------------|
|
|
29
|
+
| Solid (default) | `--wm-border-style-solid` |
|
|
30
|
+
| Dashed | `--wm-border-style-dashed` |
|
|
31
|
+
| Dotted | `--wm-border-style-dotted` |
|
|
32
|
+
| None | `--wm-border-style-none` |
|
|
33
|
+
| Double | `--wm-border-style-double` |
|
|
34
|
+
|
|
35
|
+
## Border Radius
|
|
36
|
+
|
|
37
|
+
Base: `--wm-radius-base: 2px`. Named sizes for semantic use.
|
|
38
|
+
|
|
39
|
+
| Name | CSS Variable | Value | Use for |
|
|
40
|
+
|------|-------------|-------|---------|
|
|
41
|
+
| None | `--wm-radius-none` | 0px | Sharp corners |
|
|
42
|
+
| XXS | `--wm-radius-xxs` | 2px | Subtle rounding |
|
|
43
|
+
| XS | `--wm-radius-xs` | 4px | Inputs, chips |
|
|
44
|
+
| SM | `--wm-radius-sm` | 8px | Cards, panels |
|
|
45
|
+
| MD | `--wm-radius-md` | 12px | Dialogs |
|
|
46
|
+
| LG | `--wm-radius-lg` | 16px | Bottom sheets |
|
|
47
|
+
| XL | `--wm-radius-xl` | 28px | Large containers |
|
|
48
|
+
| XXL | `--wm-radius-xxl` | 32px | Full-rounding on wide elements |
|
|
49
|
+
| Pill | `--wm-radius-pill` | 1000px | Badges, tags, toggles |
|
|
50
|
+
| Circle | `--wm-radius-circle` | 50% | Avatar images, icon buttons |
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
```less
|
|
55
|
+
// Card with standard rounding and subtle border
|
|
56
|
+
.my-card {
|
|
57
|
+
border: var(--wm-border-width-1) var(--wm-border-style-solid) var(--wm-border-color);
|
|
58
|
+
border-radius: var(--wm-radius-sm);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Pill-shaped tag
|
|
62
|
+
.tag {
|
|
63
|
+
border-radius: var(--wm-radius-pill);
|
|
64
|
+
padding: 2px var(--wm-gap-2);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```jsx
|
|
69
|
+
// WmContainer with rounded corners
|
|
70
|
+
<WmContainer name="card" className="app-card" styles={{ borderRadius: "var(--wm-radius-sm)" }} />
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Icon Sizes
|
|
74
|
+
|
|
75
|
+
| Name | CSS Variable | Value |
|
|
76
|
+
|------|-------------|-------|
|
|
77
|
+
| Base | `--wm-icon-size` | 24px |
|
|
78
|
+
| XS | `--wm-icon-size-xs` | calc(base × 0.5) |
|
|
79
|
+
| SM | `--wm-icon-size-sm` | calc(base × 0.75) |
|
|
80
|
+
| MD | `--wm-icon-size-md` | calc(base × 1) |
|
|
81
|
+
| LG | `--wm-icon-size-lg` | calc(base × 1.25) |
|
|
82
|
+
| 2X | `--wm-icon-size-2x` | calc(base × 1.5) |
|
|
83
|
+
| 3X | `--wm-icon-size-3x` | calc(base × 1.75) |
|
|
84
|
+
| 4X | `--wm-icon-size-4x` | calc(base × 2) |
|
|
85
|
+
| 5X | `--wm-icon-size-5x` | calc(base × 2.25) |
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: token-group
|
|
3
|
+
name: colors
|
|
4
|
+
tags: [color, palette, primary, secondary, semantic, surface, brand, state]
|
|
5
|
+
summary: Material Design 3 color system — brand, semantic, and surface colors as CSS custom properties.
|
|
6
|
+
generated: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Colors
|
|
10
|
+
|
|
11
|
+
WaveMaker uses a Material Design 3-based color system. All values are CSS custom properties on `:root` and can be overridden per-theme.
|
|
12
|
+
|
|
13
|
+
## Brand Colors
|
|
14
|
+
|
|
15
|
+
| Name | CSS Variable | Default | Usage |
|
|
16
|
+
|------|-------------|---------|-------|
|
|
17
|
+
| Primary | `--wm-color-primary` | `#FF7250` | Main brand color — buttons, links, active states |
|
|
18
|
+
| On Primary | `--wm-color-on-primary` | `#FFFFFF` | Text/icons on primary background |
|
|
19
|
+
| Primary Container | `--wm-color-primary-container` | `#ffe3dc` | Light tint of primary — badges, chips |
|
|
20
|
+
| On Primary Container | `--wm-color-on-primary-container` | `#2d201d` | Text on primary-container |
|
|
21
|
+
| Secondary | `--wm-color-secondary` | `#656DF9` | Secondary brand color |
|
|
22
|
+
| On Secondary | `--wm-color-on-secondary` | `#FFFFFF` | Text/icons on secondary |
|
|
23
|
+
| Secondary Container | `--wm-color-secondary-container` | `#e2e3ff` | Light tint of secondary |
|
|
24
|
+
| Tertiary | `--wm-color-tertiary` | `#E0B313` | Accent / highlight color |
|
|
25
|
+
| On Tertiary | `--wm-color-on-tertiary` | `#FFFFFF` | Text/icons on tertiary |
|
|
26
|
+
| Tertiary Container | `--wm-color-tertiary-container` | `#fff5d3` | Light tint of tertiary |
|
|
27
|
+
|
|
28
|
+
## Semantic Colors
|
|
29
|
+
|
|
30
|
+
| Name | CSS Variable | Default | Usage |
|
|
31
|
+
|------|-------------|---------|-------|
|
|
32
|
+
| Success | `--wm-color-success` | `#5AC588` | Positive outcomes, confirmations |
|
|
33
|
+
| On Success | `--wm-color-on-success` | `#FFFFFF` | Text/icons on success |
|
|
34
|
+
| Success Container | `--wm-color-success-container` | `#d6ffe8` | Light success background |
|
|
35
|
+
| Info | `--wm-color-info` | `#00c8ff` | Informational messages |
|
|
36
|
+
| On Info | `--wm-color-on-info` | `#FFFFFF` | Text/icons on info |
|
|
37
|
+
| Info Container | `--wm-color-info-container` | `#ddf7ff` | Light info background |
|
|
38
|
+
| Warning | `--wm-color-warning` | `#ffae00` | Caution states |
|
|
39
|
+
| On Warning | `--wm-color-on-warning` | `#FFFFFF` | Text/icons on warning |
|
|
40
|
+
| Warning Container | `--wm-color-warning-container` | `#fff4d5` | Light warning background |
|
|
41
|
+
| Error | `--wm-color-error` | `#EF3F3F` | Validation errors, danger states |
|
|
42
|
+
| On Error | `--wm-color-on-error` | `#FFFFFF` | Text/icons on error |
|
|
43
|
+
| Error Container | `--wm-color-error-container` | `#F9DEDC` | Light error background |
|
|
44
|
+
|
|
45
|
+
## Surface & Layout Colors
|
|
46
|
+
|
|
47
|
+
| Name | CSS Variable | Default | Usage |
|
|
48
|
+
|------|-------------|---------|-------|
|
|
49
|
+
| Background | `--wm-color-background` | `#FFFFFF` | Page background |
|
|
50
|
+
| On Background | `--wm-color-on-background` | `#35363B` | Default body text |
|
|
51
|
+
| Surface | `--wm-color-surface` | `#FFFFFF` | Card/panel backgrounds |
|
|
52
|
+
| Surface Variant | `--wm-color-surface-variant` | `#FBFBFC` | Subtle surface tint |
|
|
53
|
+
| Surface Container | `--wm-color-surface-container` | `#ebebf7` | Slightly elevated surface |
|
|
54
|
+
| Surface Container Low | `--wm-color-surface-container-low` | `#f0f2ff` | Lower-elevation surface |
|
|
55
|
+
| Surface Container High | `--wm-color-surface-container-high` | `#e8e8f1` | Higher-elevation surface |
|
|
56
|
+
| On Surface | `--wm-color-on-surface` | `#1D1B20` | Primary text on surface |
|
|
57
|
+
| On Surface Variant | `--wm-color-on-surface-variant` | `#4F556D` | Secondary text / icons on surface |
|
|
58
|
+
| Outline | `--wm-color-outline` | `#79747E` | Borders, dividers |
|
|
59
|
+
| Outline Variant | `--wm-color-outline-variant` | `#E4E4E4` | Subtle borders |
|
|
60
|
+
|
|
61
|
+
## Utility
|
|
62
|
+
|
|
63
|
+
| Name | CSS Variable | Default |
|
|
64
|
+
|------|-------------|---------|
|
|
65
|
+
| White | `--wm-color-white` | `#FFFFFF` |
|
|
66
|
+
| Black | `--wm-color-black` | `#000000` |
|
|
67
|
+
| Shadow | `--wm-color-shadow` | `#dfdfdf` |
|
|
68
|
+
| Scrim | `--wm-color-scrim` | `#000000` |
|
|
69
|
+
|
|
70
|
+
## Interaction State Variants (from semantics layer)
|
|
71
|
+
|
|
72
|
+
Applied automatically on interactive elements via `color-mix()`:
|
|
73
|
+
|
|
74
|
+
| State | Opacity | CSS Variable (example — primary) |
|
|
75
|
+
|-------|---------|----------------------------------|
|
|
76
|
+
| Hover | 8% | `--wm-color-primary-hover` |
|
|
77
|
+
| Focus | 12% | `--wm-color-primary-focus` |
|
|
78
|
+
| Active | 16% | `--wm-color-primary-active` |
|
|
79
|
+
|
|
80
|
+
## Usage
|
|
81
|
+
|
|
82
|
+
```less
|
|
83
|
+
// In component LESS
|
|
84
|
+
.my-button {
|
|
85
|
+
background: var(--wm-color-primary);
|
|
86
|
+
color: var(--wm-color-on-primary);
|
|
87
|
+
border-color: var(--wm-color-outline);
|
|
88
|
+
}
|
|
89
|
+
.my-button:hover {
|
|
90
|
+
background: var(--wm-color-primary-hover);
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```jsx
|
|
95
|
+
// In JSX inline styles
|
|
96
|
+
<WmContainer styles={{ background: "var(--wm-color-surface-container)" }} />
|
|
97
|
+
```
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: token-group
|
|
3
|
+
name: elevation
|
|
4
|
+
tags: [shadow, elevation, box-shadow, depth, z-index, layer]
|
|
5
|
+
summary: Shadow/elevation system with 5 levels. Use to convey depth and layer hierarchy.
|
|
6
|
+
generated: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Elevation
|
|
10
|
+
|
|
11
|
+
WaveMaker uses a 5-level elevation system based on box-shadows. Higher elevation = more prominent shadow = visually "closer" to the user.
|
|
12
|
+
|
|
13
|
+
## Elevation Levels
|
|
14
|
+
|
|
15
|
+
| Level | CSS Variable | Use for |
|
|
16
|
+
|-------|-------------|---------|
|
|
17
|
+
| None | `--wm-elevation-shadow-none` | Flat elements, backgrounds |
|
|
18
|
+
| 1 (lowest) | `--wm-elevation-shadow-1` | Cards, panels, slight lift |
|
|
19
|
+
| 2 | `--wm-elevation-shadow-2` | Dropdowns, popovers |
|
|
20
|
+
| 3 | `--wm-elevation-shadow-3` | Navigation drawers, side sheets |
|
|
21
|
+
| 4 | `--wm-elevation-shadow-4` | FABs, focused elements |
|
|
22
|
+
| 5 (highest) | `--wm-elevation-shadow-5` | Modal dialogs, top-level overlays |
|
|
23
|
+
|
|
24
|
+
## Box Shadow (semantic alias)
|
|
25
|
+
|
|
26
|
+
Use `--wm-box-shadow-*` as a simpler alias with concrete rgba values:
|
|
27
|
+
|
|
28
|
+
| Level | CSS Variable | Value |
|
|
29
|
+
|-------|-------------|-------|
|
|
30
|
+
| 1 | `--wm-box-shadow-1` | `0px 1px 2px 0px rgba(0, 0, 0, 0.30), 0px 1px 3px 1px rgba(0, 0, 0, 0.15)` |
|
|
31
|
+
| 2 | `--wm-box-shadow-2` | `0px 1px 2px 0px rgba(0, 0, 0, 0.30), 0px 2px 6px 2px rgba(0, 0, 0, 0.15)` |
|
|
32
|
+
| 3 | `--wm-box-shadow-3` | `0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.30)` |
|
|
33
|
+
| 4 | `--wm-box-shadow-4` | `0px 6px 10px 4px rgba(0, 0, 0, 0.15), 0px 2px 3px 0px rgba(0, 0, 0, 0.30)` |
|
|
34
|
+
| 5 | `--wm-box-shadow-5` | `0px 8px 12px 6px rgba(0, 0, 0, 0.15), 0px 4px 4px 0px rgba(0, 0, 0, 0.30)` |
|
|
35
|
+
|
|
36
|
+
> **Prefer `--wm-elevation-shadow-*`** over `--wm-box-shadow-*` in component styles — elevation vars reference the theme's shadow color token and adapt to dark mode.
|
|
37
|
+
|
|
38
|
+
## Opacity Tokens (interaction states)
|
|
39
|
+
|
|
40
|
+
| State | CSS Variable | Value | Applied to |
|
|
41
|
+
|-------|-------------|-------|-----------|
|
|
42
|
+
| Hover | `--wm-opacity-hover` | 8% | Hover overlay on interactive elements |
|
|
43
|
+
| Focus | `--wm-opacity-focus` | 12% | Focus ring opacity |
|
|
44
|
+
| Active | `--wm-opacity-active` | 16% | Pressed state |
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
```less
|
|
49
|
+
// Apply elevation to a card
|
|
50
|
+
.my-card {
|
|
51
|
+
box-shadow: var(--wm-elevation-shadow-1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Elevate on hover
|
|
55
|
+
.my-card:hover {
|
|
56
|
+
box-shadow: var(--wm-elevation-shadow-2);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```jsx
|
|
61
|
+
// Via WmContainer inline style
|
|
62
|
+
<WmContainer name="card" styles={{ boxShadow: "var(--wm-elevation-shadow-2)" }} />
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Choosing the Right Level
|
|
66
|
+
|
|
67
|
+
| Scenario | Level |
|
|
68
|
+
|----------|-------|
|
|
69
|
+
| Static card / panel | 1 |
|
|
70
|
+
| Dropdown / menu | 2 |
|
|
71
|
+
| Drawer / side sheet | 3 |
|
|
72
|
+
| Floating action | 4 |
|
|
73
|
+
| Dialog / modal | 5 |
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: token-group
|
|
3
|
+
name: spacing
|
|
4
|
+
tags: [gap, padding, margin, space, layout, spacing, tokens]
|
|
5
|
+
summary: 4px-base spacing scale used for gaps, padding, margins, and WmLinearLayout spacing values.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Spacing Tokens
|
|
9
|
+
|
|
10
|
+
WaveMaker uses a 4px base grid. All spacing should reference these tokens instead of arbitrary pixel values. Two token families cover spacing: `--wm-gap-*` (container gaps) and `--wm-space-*` (padding / margin).
|
|
11
|
+
|
|
12
|
+
## Gap Scale (`--wm-gap-*`)
|
|
13
|
+
|
|
14
|
+
Use for `gap`, `columngap` props on `WmContainer`, and CSS `gap` rules.
|
|
15
|
+
|
|
16
|
+
| Token name | CSS Variable | Value |
|
|
17
|
+
|-----------|-------------|-------|
|
|
18
|
+
| gap-1 / xs | `--wm-gap-1` | 4px |
|
|
19
|
+
| gap-2 / sm | `--wm-gap-2` | 8px |
|
|
20
|
+
| gap-3 | `--wm-gap-3` | 12px |
|
|
21
|
+
| gap-4 / md | `--wm-gap-4` | 16px |
|
|
22
|
+
| gap-6 / lg | `--wm-gap-6` | 24px |
|
|
23
|
+
| gap-8 / xl | `--wm-gap-8` | 32px |
|
|
24
|
+
| gap-12 | `--wm-gap-12` | 48px |
|
|
25
|
+
|
|
26
|
+
## Space Scale (`--wm-space-*`)
|
|
27
|
+
|
|
28
|
+
Use for CSS `padding` and `margin` in inline styles or LESS.
|
|
29
|
+
|
|
30
|
+
| Token name | CSS Variable | Value |
|
|
31
|
+
|-----------|-------------|-------|
|
|
32
|
+
| space-1 | `--wm-space-1` | 4px |
|
|
33
|
+
| space-2 | `--wm-space-2` | 8px |
|
|
34
|
+
| space-3 | `--wm-space-3` | 12px |
|
|
35
|
+
| space-4 | `--wm-space-4` | 16px |
|
|
36
|
+
| space-5 | `--wm-space-5` | 20px |
|
|
37
|
+
| space-6 | `--wm-space-6` | 24px |
|
|
38
|
+
| space-8 | `--wm-space-8` | 32px |
|
|
39
|
+
|
|
40
|
+
## WmLinearLayout Spacing Map
|
|
41
|
+
|
|
42
|
+
The `spacing` prop on `WmLinearLayout` uses an internal pt-based scale, not pixels. Use these values:
|
|
43
|
+
|
|
44
|
+
| Semantic | spacing value | Visual gap |
|
|
45
|
+
|----------|--------------|-----------|
|
|
46
|
+
| xs | 3 | ~4px |
|
|
47
|
+
| sm | 6 | ~8px |
|
|
48
|
+
| md | 12 | ~16px |
|
|
49
|
+
| lg | 18 | ~24px |
|
|
50
|
+
| xl | 24 | ~32px |
|
|
51
|
+
|
|
52
|
+
## Usage in JSX
|
|
53
|
+
|
|
54
|
+
```jsx
|
|
55
|
+
{/* Container gap via prop */}
|
|
56
|
+
<WmContainer name="card" gap={16} padding="var(--wm-space-4)" />
|
|
57
|
+
|
|
58
|
+
{/* LinearLayout spacing via token */}
|
|
59
|
+
<WmLinearLayout name="row" direction="row" spacing={12} />
|
|
60
|
+
|
|
61
|
+
{/* Inline style with token */}
|
|
62
|
+
<WmContainer name="section" styles={{ padding: "var(--wm-space-6)" }} />
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Usage in LESS
|
|
66
|
+
|
|
67
|
+
```less
|
|
68
|
+
.my-component {
|
|
69
|
+
padding: var(--wm-space-4); // 16px
|
|
70
|
+
gap: var(--wm-gap-2); // 8px
|
|
71
|
+
margin-bottom: var(--wm-gap-4); // 16px
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Choosing the Right Token
|
|
76
|
+
|
|
77
|
+
| Use case | Recommended token |
|
|
78
|
+
|----------|-----------------|
|
|
79
|
+
| Items in a row/column layout | `WmLinearLayout spacing={12}` (md) |
|
|
80
|
+
| Card internal padding | `--wm-space-4` (16px) |
|
|
81
|
+
| Section-to-section gap | `--wm-gap-6` (24px) or `spacing={18}` |
|
|
82
|
+
| Tight icon+label gap | `spacing={6}` or `--wm-gap-2` (8px) |
|
|
83
|
+
| Page section padding | `--wm-space-6` (24px) |
|
|
84
|
+
|
|
85
|
+
## Notes
|
|
86
|
+
|
|
87
|
+
- Base unit: `--wm-gap-base: 4px` — all gap tokens are multiples of this.
|
|
88
|
+
- Never use raw pixel values in styles when a token exists at that scale.
|
|
89
|
+
- `--wm-space-*` and `--wm-gap-*` have the same values but are semantically distinct — `gap` is for layout gaps, `space` is for padding/margin.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: token-group
|
|
3
|
+
name: typography
|
|
4
|
+
tags: [font, text, heading, body, label, display, typography, size, weight]
|
|
5
|
+
summary: Type scale — display, heading, body, and label styles as CSS custom properties.
|
|
6
|
+
generated: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Typography
|
|
10
|
+
|
|
11
|
+
WaveMaker uses a Material Design 3 type scale. All text styles are CSS custom properties with `font-family`, `font-size`, `font-weight`, `line-height`, and `letter-spacing` variants.
|
|
12
|
+
|
|
13
|
+
Font family: **Roboto** (brand/plain), fallback: **Arial, Helvetica, sans-serif**.
|
|
14
|
+
|
|
15
|
+
## Type Scale
|
|
16
|
+
|
|
17
|
+
| Style | Font-size variable | Size | Weight | Line-height |
|
|
18
|
+
|-------|--------------------|------|--------|------------|
|
|
19
|
+
| Display Large | `--wm-display-large-font-size` | 57px | 400 | 64px |
|
|
20
|
+
| Display Medium | `--wm-display-medium-font-size` | 45px | 400 | 52px |
|
|
21
|
+
| Display Small | `--wm-display-small-font-size` | 36px | 400 | 44px |
|
|
22
|
+
| H1 | `--wm-h1-font-size` | 32px | 400 | 40px |
|
|
23
|
+
| H2 | `--wm-h2-font-size` | 28px | 400 | 36px |
|
|
24
|
+
| H3 | `--wm-h3-font-size` | 24px | 400 | 32px |
|
|
25
|
+
| H4 | `--wm-h4-font-size` | 22px | 400 | 28px |
|
|
26
|
+
| H5 | `--wm-h5-font-size` | 16px | 500 | 24px |
|
|
27
|
+
| H6 | `--wm-h6-font-size` | 14px | 500 | 20px |
|
|
28
|
+
| Body Large | `--wm-body-large-font-size` | 16px | 400 | 24px |
|
|
29
|
+
| Body Medium | `--wm-body-medium-font-size` | 14px | 400 | 20px |
|
|
30
|
+
| Body Small | `--wm-body-small-font-size` | 12px | 400 | 16px |
|
|
31
|
+
| Label Large | `--wm-label-large-font-size` | 14px | 500 | 20px |
|
|
32
|
+
| Label Medium | `--wm-label-medium-font-size` | 12px | 500 | 16px |
|
|
33
|
+
| Label Small | `--wm-label-small-font-size` | 11px | 500 | 16px |
|
|
34
|
+
|
|
35
|
+
## Font Weights
|
|
36
|
+
|
|
37
|
+
| Name | CSS Variable | Value |
|
|
38
|
+
|------|-------------|-------|
|
|
39
|
+
| Thin | `--wm-font-weight-thin` | 100 |
|
|
40
|
+
| Light | `--wm-font-weight-light` | 300 |
|
|
41
|
+
| Regular | `--wm-font-weight-regular` | 400 |
|
|
42
|
+
| Medium | `--wm-font-weight-medium` | 500 |
|
|
43
|
+
| Semibold | `--wm-font-weight-semibold` | 600 |
|
|
44
|
+
| Bold | `--wm-font-weight-bold` | 700 |
|
|
45
|
+
| Extrabold | `--wm-font-weight-extrabold` | 800 |
|
|
46
|
+
| Black | `--wm-font-weight-black` | 900 |
|
|
47
|
+
|
|
48
|
+
## Font Families
|
|
49
|
+
|
|
50
|
+
| Name | CSS Variable | Value |
|
|
51
|
+
|------|-------------|-------|
|
|
52
|
+
| Brand | `--wm-font-family-brand` | Roboto, var(--wm-font-family-backup) |
|
|
53
|
+
| Plain | `--wm-font-family-plain` | Roboto, var(--wm-font-family-backup) |
|
|
54
|
+
| Backup | `--wm-font-family-backup` | Arial, Helvetica, sans-serif |
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
```less
|
|
59
|
+
// In LESS
|
|
60
|
+
.my-heading {
|
|
61
|
+
font-size: var(--wm-h2-font-size);
|
|
62
|
+
font-weight: var(--wm-h2-font-weight);
|
|
63
|
+
line-height: var(--wm-h2-line-height);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.my-body-text {
|
|
67
|
+
font-size: var(--wm-body-medium-font-size);
|
|
68
|
+
font-weight: var(--wm-body-medium-font-weight);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```jsx
|
|
73
|
+
// In WmLabel via variant prop
|
|
74
|
+
<WmLabel name="heading" caption="Title" type="h2" variant="default:h2" />
|
|
75
|
+
<WmLabel name="body" caption="Content" variant="text:secondary" />
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## WmLabel ↔ Typography Mapping
|
|
79
|
+
|
|
80
|
+
| WmLabel type | Style applied |
|
|
81
|
+
|-------------|--------------|
|
|
82
|
+
| `type="h1"` | H1 (32px, regular) |
|
|
83
|
+
| `type="h2"` | H2 (28px, regular) |
|
|
84
|
+
| `type="h3"` | H3 (24px, regular) |
|
|
85
|
+
| `type="h4"` | H4 (22px, regular) |
|
|
86
|
+
| `type="h5"` | H5 (16px, medium) |
|
|
87
|
+
| `type="h6"` | H6 (14px, medium) |
|
|
88
|
+
| `type="p"` | Body medium (14px, regular) |
|
package/dist/components.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Strip leading `Wm` and lowercase (e.g. WmSelect -> select).
|
|
3
|
-
*/
|
|
4
|
-
export declare function normalizeComponentQuery(name: string): string;
|
|
5
|
-
/**
|
|
6
|
-
* Build a likely `Wm*` name from user input (`select` -> `WmSelect`, `WmButton` -> `WmButton`).
|
|
7
|
-
*/
|
|
8
|
-
export declare function toWmComponentName(input: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* Find props files under `.../components` whose path likely matches the widget (e.g. `.../select/props.js`).
|
|
11
|
-
*/
|
|
12
|
-
export declare function findPropsPathsByHint(runtimeRoot: string, hint: string): Promise<string[]>;
|
|
13
|
-
/**
|
|
14
|
-
* Find references to a component name in source (fallback when path hint fails).
|
|
15
|
-
*/
|
|
16
|
-
export declare function findComponentRefs(runtimeRoot: string, componentName: string, maxResults: number): Promise<import("./search.js").ContentMatch[]>;
|
|
17
|
-
//# sourceMappingURL=components.d.ts.map
|
package/dist/components.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKvD;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAgB/F;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iDAOrG"}
|
package/dist/components.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.normalizeComponentQuery = normalizeComponentQuery;
|
|
7
|
-
exports.toWmComponentName = toWmComponentName;
|
|
8
|
-
exports.findPropsPathsByHint = findPropsPathsByHint;
|
|
9
|
-
exports.findComponentRefs = findComponentRefs;
|
|
10
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
11
|
-
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
12
|
-
const paths_js_1 = require("./paths.js");
|
|
13
|
-
const search_js_1 = require("./search.js");
|
|
14
|
-
/**
|
|
15
|
-
* Strip leading `Wm` and lowercase (e.g. WmSelect -> select).
|
|
16
|
-
*/
|
|
17
|
-
function normalizeComponentQuery(name) {
|
|
18
|
-
let s = name.trim();
|
|
19
|
-
if (s.startsWith("Wm"))
|
|
20
|
-
s = s.slice(2);
|
|
21
|
-
return s.toLowerCase();
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Build a likely `Wm*` name from user input (`select` -> `WmSelect`, `WmButton` -> `WmButton`).
|
|
25
|
-
*/
|
|
26
|
-
function toWmComponentName(input) {
|
|
27
|
-
const s = input.trim().replace(/^Wm/i, "");
|
|
28
|
-
if (!s)
|
|
29
|
-
return input.trim();
|
|
30
|
-
const pascal = s.charAt(0).toUpperCase() + s.slice(1);
|
|
31
|
-
return `Wm${pascal}`;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Find props files under `.../components` whose path likely matches the widget (e.g. `.../select/props.js`).
|
|
35
|
-
*/
|
|
36
|
-
async function findPropsPathsByHint(runtimeRoot, hint) {
|
|
37
|
-
const key = normalizeComponentQuery(hint);
|
|
38
|
-
if (!key)
|
|
39
|
-
return [];
|
|
40
|
-
const componentsRoot = (0, paths_js_1.resolveRuntimeComponentsRoot)(runtimeRoot);
|
|
41
|
-
const files = await (0, fast_glob_1.default)("**/props.{js,ts}", {
|
|
42
|
-
cwd: componentsRoot,
|
|
43
|
-
onlyFiles: true,
|
|
44
|
-
dot: false,
|
|
45
|
-
});
|
|
46
|
-
const matches = files.filter((f) => {
|
|
47
|
-
const lower = f.toLowerCase();
|
|
48
|
-
return lower.includes(`/${key}/`) || lower.includes(`/${key}.`) || lower.startsWith(`${key}/`);
|
|
49
|
-
});
|
|
50
|
-
return matches
|
|
51
|
-
.map((f) => node_path_1.default.relative(runtimeRoot, node_path_1.default.join(componentsRoot, f)).replace(/\\/g, "/"))
|
|
52
|
-
.sort();
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Find references to a component name in source (fallback when path hint fails).
|
|
56
|
-
*/
|
|
57
|
-
async function findComponentRefs(runtimeRoot, componentName, maxResults) {
|
|
58
|
-
const pattern = componentName.trim();
|
|
59
|
-
if (!pattern)
|
|
60
|
-
return [];
|
|
61
|
-
const componentsRoot = (0, paths_js_1.resolveRuntimeComponentsRoot)(runtimeRoot);
|
|
62
|
-
const rg = (0, search_js_1.searchWithRipgrep)(componentsRoot, pattern, maxResults);
|
|
63
|
-
if (rg !== null)
|
|
64
|
-
return rg;
|
|
65
|
-
return (0, search_js_1.searchWithNode)(componentsRoot, pattern, maxResults, "**/*.{js,ts,tsx,jsx}");
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=components.js.map
|
package/dist/components.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":";;;;;AAQA,0DAIC;AAKD,8CAKC;AAKD,oDAgBC;AAKD,8CAOC;AAvDD,0DAA6B;AAC7B,0DAA2B;AAC3B,yCAA0D;AAC1D,2CAAgE;AAEhE;;GAEG;AACH,SAAgB,uBAAuB,CAAC,IAAY;IAClD,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IACpB,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC3C,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IAC5B,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtD,OAAO,KAAK,MAAM,EAAE,CAAC;AACvB,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,oBAAoB,CAAC,WAAmB,EAAE,IAAY;IAC1E,MAAM,GAAG,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,MAAM,cAAc,GAAG,IAAA,uCAA4B,EAAC,WAAW,CAAC,CAAC;IACjE,MAAM,KAAK,GAAG,MAAM,IAAA,mBAAE,EAAC,kBAAkB,EAAE;QACzC,GAAG,EAAE,cAAc;QACnB,SAAS,EAAE,IAAI;QACf,GAAG,EAAE,KAAK;KACX,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QACjC,MAAM,KAAK,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;IACjG,CAAC,CAAC,CAAC;IACH,OAAO,OAAO;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,mBAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;SACxF,IAAI,EAAE,CAAC;AACZ,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,iBAAiB,CAAC,WAAmB,EAAE,aAAqB,EAAE,UAAkB;IACpG,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC;IACrC,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACxB,MAAM,cAAc,GAAG,IAAA,uCAA4B,EAAC,WAAW,CAAC,CAAC;IACjE,MAAM,EAAE,GAAG,IAAA,6BAAiB,EAAC,cAAc,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAClE,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IAC3B,OAAO,IAAA,0BAAc,EAAC,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,sBAAsB,CAAC,CAAC;AACrF,CAAC"}
|
package/dist/paths.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export declare function existsDir(p: string): boolean;
|
|
2
|
-
/**
|
|
3
|
-
* How the react-runtime root was chosen (first match wins).
|
|
4
|
-
*/
|
|
5
|
-
export type ReactRuntimeResolution = "WM_REACT_RUNTIME_SOURCE" | "WM_REACT_RUNTIME_ROOT" | `node_modules:${string}`;
|
|
6
|
-
/**
|
|
7
|
-
* How the foundation-css root was chosen (first match wins).
|
|
8
|
-
*/
|
|
9
|
-
export type FoundationResolution = "WM_FOUNDATION_CSS_SOURCE" | "WM_FOUNDATION_CSS_ROOT" | `node_modules:${string}`;
|
|
10
|
-
export type ResolvedRoots = {
|
|
11
|
-
projectRoot: string;
|
|
12
|
-
reactRuntime: {
|
|
13
|
-
path: string;
|
|
14
|
-
resolution: ReactRuntimeResolution;
|
|
15
|
-
} | null;
|
|
16
|
-
foundationCss: {
|
|
17
|
-
path: string;
|
|
18
|
-
resolution: FoundationResolution;
|
|
19
|
-
packageName: string;
|
|
20
|
-
} | null;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Prefer local source clones, then explicit package roots, then node_modules.
|
|
24
|
-
*
|
|
25
|
-
* React runtime: `WM_REACT_RUNTIME_SOURCE` → `WM_REACT_RUNTIME_ROOT` → `node_modules/@wavemaker/react-runtime`
|
|
26
|
-
* Foundation: `WM_FOUNDATION_CSS_SOURCE` → `WM_FOUNDATION_CSS_ROOT` → `node_modules` packages
|
|
27
|
-
*/
|
|
28
|
-
export declare function resolveRoots(cwd?: string): ResolvedRoots;
|
|
29
|
-
/**
|
|
30
|
-
* Local react-runtime repos often use `src/components`; published packages use `components`.
|
|
31
|
-
*/
|
|
32
|
-
export declare function resolveRuntimeComponentsRoot(runtimeRoot: string): string;
|
|
33
|
-
/**
|
|
34
|
-
* Ensure `relativePath` resolves under `root` (no traversal).
|
|
35
|
-
*/
|
|
36
|
-
export declare function safeReadUnderRoot(root: string, relativePath: string): {
|
|
37
|
-
ok: true;
|
|
38
|
-
absolute: string;
|
|
39
|
-
} | {
|
|
40
|
-
ok: false;
|
|
41
|
-
error: string;
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=paths.d.ts.map
|
package/dist/paths.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAMA,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAM5C;AAQD;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAC9B,yBAAyB,GACzB,uBAAuB,GACvB,gBAAgB,MAAM,EAAE,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,GAAG,wBAAwB,GAAG,gBAAgB,MAAM,EAAE,CAAC;AAEpH,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,sBAAsB,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1E,aAAa,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,oBAAoB,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC/F,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,SAAgB,GAAG,aAAa,CA6C/D;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAIxE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAQnI"}
|
package/dist/paths.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.existsDir = existsDir;
|
|
7
|
-
exports.resolveRoots = resolveRoots;
|
|
8
|
-
exports.resolveRuntimeComponentsRoot = resolveRuntimeComponentsRoot;
|
|
9
|
-
exports.safeReadUnderRoot = safeReadUnderRoot;
|
|
10
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
11
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
12
|
-
const RUNTIME_PKG = "@wavemaker/react-runtime";
|
|
13
|
-
const FOUNDATION_CANDIDATES = ["@wavemaker/foundation-css", "@wavemaker-ai/foundation-css"];
|
|
14
|
-
function existsDir(p) {
|
|
15
|
-
try {
|
|
16
|
-
return node_fs_1.default.statSync(p).isDirectory();
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function resolvePackageDir(projectRoot, packageName) {
|
|
23
|
-
const nested = node_path_1.default.join(projectRoot, "node_modules", packageName);
|
|
24
|
-
if (existsDir(nested))
|
|
25
|
-
return nested;
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Prefer local source clones, then explicit package roots, then node_modules.
|
|
30
|
-
*
|
|
31
|
-
* React runtime: `WM_REACT_RUNTIME_SOURCE` → `WM_REACT_RUNTIME_ROOT` → `node_modules/@wavemaker/react-runtime`
|
|
32
|
-
* Foundation: `WM_FOUNDATION_CSS_SOURCE` → `WM_FOUNDATION_CSS_ROOT` → `node_modules` packages
|
|
33
|
-
*/
|
|
34
|
-
function resolveRoots(cwd = process.cwd()) {
|
|
35
|
-
const projectRoot = cwd;
|
|
36
|
-
let reactRuntime = null;
|
|
37
|
-
const srcRt = process.env.WM_REACT_RUNTIME_SOURCE?.trim();
|
|
38
|
-
if (srcRt && existsDir(srcRt)) {
|
|
39
|
-
reactRuntime = { path: node_path_1.default.resolve(srcRt), resolution: "WM_REACT_RUNTIME_SOURCE" };
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
const envRt = process.env.WM_REACT_RUNTIME_ROOT?.trim();
|
|
43
|
-
if (envRt && existsDir(envRt)) {
|
|
44
|
-
reactRuntime = { path: node_path_1.default.resolve(envRt), resolution: "WM_REACT_RUNTIME_ROOT" };
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
const d = resolvePackageDir(projectRoot, RUNTIME_PKG);
|
|
48
|
-
if (d)
|
|
49
|
-
reactRuntime = { path: d, resolution: `node_modules:${RUNTIME_PKG}` };
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
let foundationCss = null;
|
|
53
|
-
const srcFd = process.env.WM_FOUNDATION_CSS_SOURCE?.trim();
|
|
54
|
-
if (srcFd && existsDir(srcFd)) {
|
|
55
|
-
foundationCss = {
|
|
56
|
-
path: node_path_1.default.resolve(srcFd),
|
|
57
|
-
resolution: "WM_FOUNDATION_CSS_SOURCE",
|
|
58
|
-
packageName: "(WM_FOUNDATION_CSS_SOURCE)",
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
const envFd = process.env.WM_FOUNDATION_CSS_ROOT?.trim();
|
|
63
|
-
if (envFd && existsDir(envFd)) {
|
|
64
|
-
foundationCss = {
|
|
65
|
-
path: node_path_1.default.resolve(envFd),
|
|
66
|
-
resolution: "WM_FOUNDATION_CSS_ROOT",
|
|
67
|
-
packageName: "(WM_FOUNDATION_CSS_ROOT)",
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
for (const name of FOUNDATION_CANDIDATES) {
|
|
72
|
-
const d = resolvePackageDir(projectRoot, name);
|
|
73
|
-
if (d) {
|
|
74
|
-
foundationCss = { path: d, resolution: `node_modules:${name}`, packageName: name };
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return { projectRoot, reactRuntime, foundationCss };
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Local react-runtime repos often use `src/components`; published packages use `components`.
|
|
84
|
-
*/
|
|
85
|
-
function resolveRuntimeComponentsRoot(runtimeRoot) {
|
|
86
|
-
const srcComponents = node_path_1.default.join(runtimeRoot, "src", "components");
|
|
87
|
-
if (existsDir(srcComponents))
|
|
88
|
-
return srcComponents;
|
|
89
|
-
return node_path_1.default.join(runtimeRoot, "components");
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Ensure `relativePath` resolves under `root` (no traversal).
|
|
93
|
-
*/
|
|
94
|
-
function safeReadUnderRoot(root, relativePath) {
|
|
95
|
-
const absRoot = node_path_1.default.resolve(root);
|
|
96
|
-
const joined = node_path_1.default.resolve(absRoot, relativePath);
|
|
97
|
-
const rel = node_path_1.default.relative(absRoot, joined);
|
|
98
|
-
if (rel.startsWith("..") || node_path_1.default.isAbsolute(rel)) {
|
|
99
|
-
return { ok: false, error: "Path escapes root directory" };
|
|
100
|
-
}
|
|
101
|
-
return { ok: true, absolute: joined };
|
|
102
|
-
}
|
|
103
|
-
//# sourceMappingURL=paths.js.map
|