igniteui-theming 25.0.0 → 25.0.2
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 +2 -2
- package/dist/mcp/generators/css.js +1 -8
- package/dist/mcp/generators/sass.d.ts +1 -1
- package/dist/mcp/generators/sass.js +26 -3
- package/dist/mcp/index.js +3 -3
- package/dist/mcp/json/components/themes.json.js +17 -17
- package/dist/mcp/knowledge/docs/setup/platform.md.js +4 -0
- package/dist/mcp/knowledge/index.d.ts +1 -1
- package/dist/mcp/knowledge/index.js +1 -4
- package/dist/mcp/knowledge/platform-setup.d.ts +2 -0
- package/dist/mcp/knowledge/platforms/index.d.ts +8 -11
- package/dist/mcp/knowledge/platforms/index.js +22 -14
- package/dist/mcp/knowledge/platforms/react.d.ts +2 -2
- package/dist/mcp/knowledge/platforms/react.js +3 -3
- package/dist/mcp/knowledge/sass-api.d.ts +2 -2
- package/dist/mcp/resources/presets.d.ts +12 -0
- package/dist/mcp/resources/presets.js +44 -1
- package/dist/mcp/tools/descriptions.d.ts +8 -8
- package/dist/mcp/tools/descriptions.js +25 -7
- package/dist/mcp/tools/handlers/component-theme.js +23 -5
- package/dist/mcp/tools/handlers/custom-palette.js +2 -1
- package/dist/mcp/tools/handlers/elevations.js +2 -1
- package/dist/mcp/tools/handlers/layout.js +1 -1
- package/dist/mcp/tools/handlers/palette.js +2 -3
- package/dist/mcp/tools/handlers/platform.js +247 -86
- package/dist/mcp/tools/handlers/theme.js +3 -0
- package/dist/mcp/tools/handlers/typography.js +2 -1
- package/dist/mcp/tools/schemas.d.ts +31 -31
- package/dist/mcp/utils/sass.d.ts +20 -0
- package/dist/mcp/utils/sass.js +16 -0
- package/dist/mcp/utils/types.d.ts +2 -1
- package/dist/mcp/utils/types.js +2 -1
- package/json/components/bootstrap.json +1 -1
- package/json/components/fluent.json +1 -1
- package/json/components/indigo.json +1 -1
- package/json/components/material.json +1 -1
- package/json/components/themes.json +53 -28
- package/package.json +15 -7
- package/sass/animations/_easings.scss +24 -24
- package/sass/bem/_index.scss +16 -14
- package/sass/color/_charts.scss +20 -20
- package/sass/color/_functions.scss +18 -18
- package/sass/color/_mixins.scss +1 -1
- package/sass/elevations/_functions.scss +4 -4
- package/sass/elevations/_mixins.scss +2 -2
- package/sass/elevations/presets/_index.scss +3 -3
- package/sass/elevations/presets/_indigo.scss +16 -16
- package/sass/elevations/presets/_material.scss +3 -3
- package/sass/tailwind/utilities/_common.scss +1 -1
- package/sass/themes/_functions.scss +15 -15
- package/sass/themes/_mixins.scss +9 -9
- package/sass/themes/charts/_category-chart-theme.scss +2 -9
- package/sass/themes/charts/_data-chart-theme.scss +1 -1
- package/sass/themes/charts/_doughnut-chart-theme.scss +1 -1
- package/sass/themes/charts/_financial-chart-theme.scss +2 -9
- package/sass/themes/charts/_funnel-chart-theme.scss +1 -1
- package/sass/themes/charts/_gauge-theme.scss +2 -2
- package/sass/themes/charts/_geo-map-theme.scss +1 -1
- package/sass/themes/charts/_graph-theme.scss +1 -1
- package/sass/themes/charts/_pie-chart-theme.scss +1 -1
- package/sass/themes/charts/_shape-chart-theme.scss +2 -9
- package/sass/themes/charts/_sparkline-theme.scss +2 -2
- package/sass/themes/components/action-strip/_action-strip-theme.scss +1 -1
- package/sass/themes/components/avatar/_avatar-theme.scss +2 -2
- package/sass/themes/components/badge/_badge-theme.scss +2 -2
- package/sass/themes/components/banner/_banner-theme.scss +1 -1
- package/sass/themes/components/bottom-nav/_bottom-nav-theme.scss +2 -2
- package/sass/themes/components/button/_button-theme.scss +5 -5
- package/sass/themes/components/button/_contained-button-theme.scss +5 -5
- package/sass/themes/components/button/_fab-button-theme.scss +5 -5
- package/sass/themes/components/button/_flat-button-theme.scss +17 -17
- package/sass/themes/components/button/_outlined-button-theme.scss +17 -17
- package/sass/themes/components/button-group/_button-group-theme.scss +5 -5
- package/sass/themes/components/calendar/_calendar-theme.scss +18 -20
- package/sass/themes/components/card/_card-theme.scss +3 -3
- package/sass/themes/components/carousel/_carousel-theme.scss +8 -8
- package/sass/themes/components/chat/_chat-theme.scss +1 -1
- package/sass/themes/components/checkbox/_checkbox-theme.scss +6 -6
- package/sass/themes/components/chip/_chip-theme.scss +5 -5
- package/sass/themes/components/column-actions/_column-actions-theme.scss +1 -1
- package/sass/themes/components/combo/_combo-theme.scss +3 -3
- package/sass/themes/components/dialog/_dialog-theme.scss +4 -4
- package/sass/themes/components/divider/_divider-theme.scss +1 -1
- package/sass/themes/components/dock-manager/_dock-manager-theme.scss +1 -1
- package/sass/themes/components/drop-down/_drop-down-theme.scss +10 -10
- package/sass/themes/components/expansion-panel/_expansion-panel-theme.scss +4 -4
- package/sass/themes/components/grid/_grid-summary-theme.scss +3 -3
- package/sass/themes/components/grid/_grid-theme.scss +56 -17
- package/sass/themes/components/grid/_grid-toolbar-theme.scss +1 -1
- package/sass/themes/components/highlight/_highlight-theme.scss +1 -1
- package/sass/themes/components/icon/_icon-theme.scss +1 -1
- package/sass/themes/components/icon-button/_contained-icon-button-theme.scss +8 -8
- package/sass/themes/components/icon-button/_flat-icon-button-theme.scss +12 -12
- package/sass/themes/components/icon-button/_icon-button-theme.scss +4 -4
- package/sass/themes/components/icon-button/_outlined-icon-button-theme.scss +13 -13
- package/sass/themes/components/input/_file-input-theme.scss +1 -1
- package/sass/themes/components/input/_input-theme.scss +23 -23
- package/sass/themes/components/list/_list-theme.scss +6 -6
- package/sass/themes/components/navbar/_navbar-theme.scss +4 -4
- package/sass/themes/components/navdrawer/_navdrawer-theme.scss +3 -3
- package/sass/themes/components/overlay/_overlay-theme.scss +1 -1
- package/sass/themes/components/paginator/_paginator-theme.scss +1 -1
- package/sass/themes/components/progress/_circular-theme.scss +1 -1
- package/sass/themes/components/progress/_linear-theme.scss +1 -1
- package/sass/themes/components/query-builder/_query-builder-theme.scss +2 -2
- package/sass/themes/components/radio/_radio-theme.scss +5 -5
- package/sass/themes/components/rating/_rating-theme.scss +1 -1
- package/sass/themes/components/ripple/_ripple-theme.scss +1 -1
- package/sass/themes/components/scrollbar/_scrollbar-theme.scss +1 -1
- package/sass/themes/components/select/_select-theme.scss +1 -1
- package/sass/themes/components/slider/_slider-theme.scss +7 -7
- package/sass/themes/components/snackbar/_snackbar-theme.scss +2 -2
- package/sass/themes/components/splitter/_splitter-theme.scss +1 -1
- package/sass/themes/components/stepper/_stepper-theme.scss +2 -2
- package/sass/themes/components/switch/_switch-theme.scss +13 -13
- package/sass/themes/components/tabs/_tabs-theme.scss +8 -8
- package/sass/themes/components/time-picker/_time-picker-theme.scss +8 -8
- package/sass/themes/components/toast/_toast-theme.scss +3 -3
- package/sass/themes/components/tooltip/_tooltip-theme.scss +2 -2
- package/sass/themes/components/tree/_tree-theme.scss +17 -17
- package/sass/themes/components/watermark/_watermark-theme.scss +1 -1
- package/sass/themes/schemas/charts/dark/_category-chart.scss +5 -5
- package/sass/themes/schemas/charts/dark/_data-chart.scss +5 -5
- package/sass/themes/schemas/charts/dark/_doughnut-chart.scss +5 -5
- package/sass/themes/schemas/charts/dark/_financial-chart.scss +5 -5
- package/sass/themes/schemas/charts/dark/_funnel-chart.scss +5 -5
- package/sass/themes/schemas/charts/dark/_gauge.scss +9 -9
- package/sass/themes/schemas/charts/dark/_geo-map.scss +5 -5
- package/sass/themes/schemas/charts/dark/_graph.scss +5 -5
- package/sass/themes/schemas/charts/dark/_pie-chart.scss +5 -5
- package/sass/themes/schemas/charts/dark/_shape-chart.scss +5 -5
- package/sass/themes/schemas/charts/dark/_sparkline.scss +5 -5
- package/sass/themes/schemas/charts/light/_category-chart.scss +8 -8
- package/sass/themes/schemas/charts/light/_data-chart.scss +8 -8
- package/sass/themes/schemas/charts/light/_doughnut-chart.scss +8 -8
- package/sass/themes/schemas/charts/light/_financial-chart.scss +8 -8
- package/sass/themes/schemas/charts/light/_funnel-chart.scss +8 -8
- package/sass/themes/schemas/charts/light/_gauge.scss +19 -19
- package/sass/themes/schemas/charts/light/_geo-map.scss +8 -8
- package/sass/themes/schemas/charts/light/_graph.scss +8 -8
- package/sass/themes/schemas/charts/light/_pie-chart.scss +8 -8
- package/sass/themes/schemas/charts/light/_shape-chart.scss +8 -8
- package/sass/themes/schemas/charts/light/_sparkline.scss +9 -9
- package/sass/themes/schemas/components/dark/_action-strip.scss +5 -5
- package/sass/themes/schemas/components/dark/_avatar.scss +5 -5
- package/sass/themes/schemas/components/dark/_badge.scss +5 -5
- package/sass/themes/schemas/components/dark/_banner.scss +5 -5
- package/sass/themes/schemas/components/dark/_bottom-nav.scss +5 -5
- package/sass/themes/schemas/components/dark/_button-group.scss +6 -6
- package/sass/themes/schemas/components/dark/_button.scss +65 -65
- package/sass/themes/schemas/components/dark/_calendar.scss +24 -24
- package/sass/themes/schemas/components/dark/_card.scss +5 -5
- package/sass/themes/schemas/components/dark/_carousel.scss +5 -5
- package/sass/themes/schemas/components/dark/_chat.scss +5 -5
- package/sass/themes/schemas/components/dark/_checkbox.scss +5 -5
- package/sass/themes/schemas/components/dark/_chip.scss +7 -7
- package/sass/themes/schemas/components/dark/_column-actions.scss +5 -5
- package/sass/themes/schemas/components/dark/_combo.scss +6 -6
- package/sass/themes/schemas/components/dark/_date-picker.scss +8 -8
- package/sass/themes/schemas/components/dark/_date-range-picker.scss +5 -5
- package/sass/themes/schemas/components/dark/_dialog.scss +5 -5
- package/sass/themes/schemas/components/dark/_divider.scss +5 -5
- package/sass/themes/schemas/components/dark/_dock-manager.scss +5 -5
- package/sass/themes/schemas/components/dark/_drop-down.scss +5 -5
- package/sass/themes/schemas/components/dark/_expansion-panel.scss +5 -5
- package/sass/themes/schemas/components/dark/_file-input.scss +5 -5
- package/sass/themes/schemas/components/dark/_grid-filtering.scss +5 -5
- package/sass/themes/schemas/components/dark/_grid-summary.scss +9 -9
- package/sass/themes/schemas/components/dark/_grid-toolbar.scss +5 -5
- package/sass/themes/schemas/components/dark/_grid.scss +57 -14
- package/sass/themes/schemas/components/dark/_highlight.scss +7 -7
- package/sass/themes/schemas/components/dark/_icon-button.scss +46 -46
- package/sass/themes/schemas/components/dark/_icon.scss +5 -5
- package/sass/themes/schemas/components/dark/_input-group.scss +6 -6
- package/sass/themes/schemas/components/dark/_label.scss +5 -5
- package/sass/themes/schemas/components/dark/_list.scss +5 -5
- package/sass/themes/schemas/components/dark/_navbar.scss +5 -5
- package/sass/themes/schemas/components/dark/_navdrawer.scss +5 -5
- package/sass/themes/schemas/components/dark/_overlay.scss +5 -5
- package/sass/themes/schemas/components/dark/_pagination.scss +5 -5
- package/sass/themes/schemas/components/dark/_pivot-data-selector.scss +9 -9
- package/sass/themes/schemas/components/dark/_progress.scss +10 -10
- package/sass/themes/schemas/components/dark/_query-builder.scss +3 -3
- package/sass/themes/schemas/components/dark/_radio.scss +5 -5
- package/sass/themes/schemas/components/dark/_rating.scss +5 -5
- package/sass/themes/schemas/components/dark/_resize-indicator.scss +9 -9
- package/sass/themes/schemas/components/dark/_ripple.scss +5 -5
- package/sass/themes/schemas/components/dark/_scrollbar.scss +5 -5
- package/sass/themes/schemas/components/dark/_select.scss +5 -5
- package/sass/themes/schemas/components/dark/_slider.scss +5 -5
- package/sass/themes/schemas/components/dark/_snackbar.scss +6 -6
- package/sass/themes/schemas/components/dark/_splitter.scss +13 -7
- package/sass/themes/schemas/components/dark/_stepper.scss +5 -5
- package/sass/themes/schemas/components/dark/_switch.scss +5 -5
- package/sass/themes/schemas/components/dark/_tabs.scss +5 -5
- package/sass/themes/schemas/components/dark/_tile-manager.scss +11 -11
- package/sass/themes/schemas/components/dark/_time-picker.scss +5 -5
- package/sass/themes/schemas/components/dark/_toast.scss +4 -4
- package/sass/themes/schemas/components/dark/_tooltip.scss +7 -7
- package/sass/themes/schemas/components/dark/_tree.scss +5 -5
- package/sass/themes/schemas/components/dark/_validator.scss +5 -5
- package/sass/themes/schemas/components/dark/_watermark.scss +5 -5
- package/sass/themes/schemas/components/dark/calendar/_base.scss +9 -9
- package/sass/themes/schemas/components/dark/calendar/_days-view.scss +11 -11
- package/sass/themes/schemas/components/dark/calendar/_picker.scss +8 -8
- package/sass/themes/schemas/components/dark/calendar/_year-month-view.scss +11 -11
- package/sass/themes/schemas/components/elevation/_button-group.scss +3 -3
- package/sass/themes/schemas/components/elevation/_carousel.scss +2 -2
- package/sass/themes/schemas/components/light/_action-strip.scss +9 -9
- package/sass/themes/schemas/components/light/_avatar.scss +9 -9
- package/sass/themes/schemas/components/light/_badge.scss +12 -12
- package/sass/themes/schemas/components/light/_banner.scss +9 -9
- package/sass/themes/schemas/components/light/_bottom-nav.scss +12 -12
- package/sass/themes/schemas/components/light/_button-group.scss +14 -14
- package/sass/themes/schemas/components/light/_button.scss +103 -103
- package/sass/themes/schemas/components/light/_calendar.scss +28 -28
- package/sass/themes/schemas/components/light/_card.scss +14 -42
- package/sass/themes/schemas/components/light/_carousel.scss +12 -12
- package/sass/themes/schemas/components/light/_chat.scss +9 -9
- package/sass/themes/schemas/components/light/_checkbox.scss +9 -9
- package/sass/themes/schemas/components/light/_chip.scss +27 -27
- package/sass/themes/schemas/components/light/_column-actions.scss +9 -9
- package/sass/themes/schemas/components/light/_combo.scss +11 -11
- package/sass/themes/schemas/components/light/_date-picker.scss +8 -8
- package/sass/themes/schemas/components/light/_date-range-picker.scss +9 -9
- package/sass/themes/schemas/components/light/_dialog.scss +14 -23
- package/sass/themes/schemas/components/light/_divider.scss +7 -7
- package/sass/themes/schemas/components/light/_dock-manager.scss +9 -9
- package/sass/themes/schemas/components/light/_drop-down.scss +16 -24
- package/sass/themes/schemas/components/light/_expansion-panel.scss +12 -24
- package/sass/themes/schemas/components/light/_file-input.scss +1 -1
- package/sass/themes/schemas/components/light/_grid-filtering.scss +9 -9
- package/sass/themes/schemas/components/light/_grid-summary.scss +13 -26
- package/sass/themes/schemas/components/light/_grid-toolbar.scss +9 -9
- package/sass/themes/schemas/components/light/_grid.scss +162 -68
- package/sass/themes/schemas/components/light/_highlight.scss +10 -10
- package/sass/themes/schemas/components/light/_icon-button.scss +48 -48
- package/sass/themes/schemas/components/light/_icon.scss +9 -9
- package/sass/themes/schemas/components/light/_input-group.scss +17 -26
- package/sass/themes/schemas/components/light/_label.scss +8 -8
- package/sass/themes/schemas/components/light/_list.scss +13 -33
- package/sass/themes/schemas/components/light/_navbar.scss +12 -12
- package/sass/themes/schemas/components/light/_navdrawer.scss +14 -26
- package/sass/themes/schemas/components/light/_overlay.scss +9 -9
- package/sass/themes/schemas/components/light/_pagination.scss +9 -9
- package/sass/themes/schemas/components/light/_pivot-data-selector.scss +9 -9
- package/sass/themes/schemas/components/light/_progress.scss +13 -13
- package/sass/themes/schemas/components/light/_query-builder.scss +10 -10
- package/sass/themes/schemas/components/light/_radio.scss +9 -9
- package/sass/themes/schemas/components/light/_rating.scss +9 -9
- package/sass/themes/schemas/components/light/_resize-indicator.scss +8 -8
- package/sass/themes/schemas/components/light/_ripple.scss +9 -9
- package/sass/themes/schemas/components/light/_scrollbar.scss +9 -9
- package/sass/themes/schemas/components/light/_select.scss +9 -9
- package/sass/themes/schemas/components/light/_slider.scss +11 -17
- package/sass/themes/schemas/components/light/_snackbar.scss +9 -9
- package/sass/themes/schemas/components/light/_splitter.scss +9 -9
- package/sass/themes/schemas/components/light/_stepper.scss +8 -8
- package/sass/themes/schemas/components/light/_switch.scss +9 -9
- package/sass/themes/schemas/components/light/_tabs.scss +9 -9
- package/sass/themes/schemas/components/light/_tile-manager.scss +10 -10
- package/sass/themes/schemas/components/light/_time-picker.scss +10 -19
- package/sass/themes/schemas/components/light/_toast.scss +11 -11
- package/sass/themes/schemas/components/light/_tooltip.scss +10 -10
- package/sass/themes/schemas/components/light/_tree.scss +8 -8
- package/sass/themes/schemas/components/light/_validator.scss +9 -9
- package/sass/themes/schemas/components/light/_watermark.scss +9 -9
- package/sass/themes/schemas/components/light/calendar/_base.scss +9 -29
- package/sass/themes/schemas/components/light/calendar/_days-view.scss +8 -17
- package/sass/themes/schemas/components/light/calendar/_picker.scss +9 -17
- package/sass/themes/schemas/components/light/calendar/_year-month-view.scss +9 -17
- package/sass/typography/_functions.scss +14 -14
- package/sass/typography/_mixins.scss +7 -7
- package/sass/utils/_css.scss +1 -1
- package/sass/utils/_map.scss +5 -5
- package/sass/utils/_math.scss +6 -5
- package/sass/utils/_meta.scss +4 -4
- package/tailwind/utilities/bootstrap.css +1 -1
- package/tailwind/utilities/fluent.css +1 -1
- package/tailwind/utilities/indigo.css +1 -1
- package/tailwind/utilities/material.css +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const FRAGMENTS = {
|
|
2
2
|
/** Platform parameter description */
|
|
3
|
-
PLATFORM: `Target platform: "angular" for Ignite UI for Angular, "webcomponents" for Ignite UI for Web Components, "react" for Ignite UI for React,
|
|
3
|
+
PLATFORM: `Target platform: "angular" for Ignite UI for Angular, "webcomponents" for Ignite UI for Web Components, "react" for Ignite UI for React, "blazor" for Ignite UI for Blazor, or "generic" for platform-agnostic output (standalone igniteui-theming usage). If omitted, generates generic code. Use detect_platform tool first to auto-detect from project files.`,
|
|
4
4
|
/** Color format examples - CSS Color Level 4 */
|
|
5
5
|
COLOR_FORMAT: `Valid CSS color formats: hex ("#3F51B5", "#3F51B5AA"), rgb/rgba ("rgb(63, 81, 181)", "rgb(63 81 181 / 0.5)"), hsl/hsla ("hsl(231, 48%, 48%)", "hsl(231 48% 48% / 0.5)"), hwb ("hwb(231 20% 30%)"), lab/lch ("lab(50% 40 59)", "lch(50% 80 30)"), oklab/oklch ("oklab(59% 0.1 0.1)", "oklch(60% 0.15 50)"), color() for wide-gamut ("color(display-p3 1 0.5 0)"), or CSS named colors ("indigo", "rebeccapurple").`,
|
|
6
6
|
/** Variant parameter description */
|
|
@@ -18,7 +18,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
19
|
// detect_platform - Simple tool
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
|
-
detect_platform: `Detect the target
|
|
21
|
+
detect_platform: `Detect the target platform by analyzing dependencies and project config files.
|
|
22
22
|
|
|
23
23
|
<use_case>
|
|
24
24
|
Use this tool FIRST before generating any theme code to ensure platform-optimized output.
|
|
@@ -30,21 +30,28 @@ const TOOL_DESCRIPTIONS = {
|
|
|
30
30
|
1. Ignite UI packages (HIGH - 100): igniteui-angular, igniteui-webcomponents, igniteui-react, IgniteUI.Blazor
|
|
31
31
|
2. Config files (MEDIUM-HIGH - 80): angular.json, vite.config.*, next.config.*, .csproj
|
|
32
32
|
3. Framework packages (LOW - 40): @angular/core, react, lit (fallback only)
|
|
33
|
+
4. Generic fallback: When no Ignite UI product is found, returns "generic" for standalone theming
|
|
33
34
|
</detection_signals>
|
|
34
35
|
|
|
35
36
|
<output>
|
|
36
37
|
Returns:
|
|
37
|
-
- platform: "angular" | "webcomponents" | "react" | "blazor" | null
|
|
38
|
+
- platform: "angular" | "webcomponents" | "react" | "blazor" | "generic" | null
|
|
38
39
|
- confidence: "high" | "medium" | "low" | "none"
|
|
39
|
-
- ambiguous: true if multiple platforms detected (requires user to specify explicitly)
|
|
40
|
+
- ambiguous: true if multiple Ignite UI platforms detected (requires user to specify explicitly)
|
|
40
41
|
- alternatives: Array of detected platforms when ambiguous
|
|
41
42
|
- signals: Array of detection signals found
|
|
42
43
|
- detectedPackage: The primary package that triggered detection
|
|
43
44
|
- platformInfo: Name, theming module path, and description
|
|
45
|
+
|
|
46
|
+
"generic" means no Ignite UI product framework was found. Most tools work in generic mode
|
|
47
|
+
(palette, typography, elevations, theme generation, color references, layout tokens with scope).
|
|
48
|
+
Component-specific tools (create_component_theme, get_component_design_tokens) are NOT available
|
|
49
|
+
in generic mode. The response includes Sass load path guidance based on detected build tooling.
|
|
50
|
+
null is reserved for error states (package.json read failure) or ambiguous multi-product detection.
|
|
44
51
|
</output>
|
|
45
52
|
|
|
46
53
|
<ambiguous_handling>
|
|
47
|
-
When multiple platforms are detected with significant confidence (≥60), returns:
|
|
54
|
+
When multiple Ignite UI platforms are detected with significant confidence (≥60), returns:
|
|
48
55
|
- platform: null
|
|
49
56
|
- ambiguous: true
|
|
50
57
|
- alternatives: List of possible platforms with their signals
|
|
@@ -57,7 +64,11 @@ const TOOL_DESCRIPTIONS = {
|
|
|
57
64
|
- create_theme: Generate complete theme
|
|
58
65
|
- create_typography: Set up typography
|
|
59
66
|
- create_elevations: Configure shadows
|
|
60
|
-
</related_tools
|
|
67
|
+
</related_tools>
|
|
68
|
+
|
|
69
|
+
<related_resources>
|
|
70
|
+
- "theming://guidance/platform-setup": Comprehensive setup guide covering detection workflow, Sass load path configuration, dependency handling, and the recommended theming sequence. Read this for detailed platform-specific setup instructions.
|
|
71
|
+
</related_resources>`,
|
|
61
72
|
// ---------------------------------------------------------------------------
|
|
62
73
|
// create_palette - Medium complexity
|
|
63
74
|
// ---------------------------------------------------------------------------
|
|
@@ -542,6 +553,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
542
553
|
<behavior>
|
|
543
554
|
- Sets --ig-size in the chosen scope (defaults to :root)
|
|
544
555
|
- Accepts "small", "medium", "large" (mapped to 1, 2, 3) or numeric values
|
|
556
|
+
- When platform is "generic", do NOT use the "component" parameter (it resolves Ignite UI component selectors). Use "scope" with a custom CSS selector instead, or omit both for :root.
|
|
545
557
|
</behavior>
|
|
546
558
|
|
|
547
559
|
<sass_notes>
|
|
@@ -585,6 +597,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
585
597
|
- Optional overrides for --ig-spacing-inline and --ig-spacing-block
|
|
586
598
|
- 0 = no spacing, 1 = default, 2 = double (fractions allowed)
|
|
587
599
|
- spacing is required; inline/block are optional overrides
|
|
600
|
+
- When platform is "generic", do NOT use the "component" parameter (it resolves Ignite UI component selectors). Use "scope" with a custom CSS selector instead, or omit both for :root.
|
|
588
601
|
</behavior>
|
|
589
602
|
|
|
590
603
|
<sass_notes>
|
|
@@ -626,6 +639,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
626
639
|
<behavior>
|
|
627
640
|
- Sets --ig-radius-factor in the chosen scope (defaults to :root)
|
|
628
641
|
- 0 = minimum radius, 1 = maximum radius, values between interpolate
|
|
642
|
+
- When platform is "generic", do NOT use the "component" parameter (it resolves Ignite UI component selectors). Use "scope" with a custom CSS selector instead, or omit both for :root.
|
|
629
643
|
</behavior>
|
|
630
644
|
|
|
631
645
|
<sass_notes>
|
|
@@ -659,6 +673,10 @@ const TOOL_DESCRIPTIONS = {
|
|
|
659
673
|
ALWAYS call this tool FIRST before using create_component_theme. It returns the
|
|
660
674
|
exact token names that can be customized for a component, preventing hallucination
|
|
661
675
|
of invalid property names.
|
|
676
|
+
|
|
677
|
+
NOTE: This tool returns tokens for Ignite UI framework components. It is NOT useful
|
|
678
|
+
when the detected platform is "generic" — component theming requires a specific
|
|
679
|
+
Ignite UI product (angular, webcomponents, react, or blazor).
|
|
662
680
|
</use_case>
|
|
663
681
|
|
|
664
682
|
<workflow>
|
|
@@ -1032,7 +1050,7 @@ Important: Gray progression is INVERTED for dark themes (50=darkest, 900=lightes
|
|
|
1032
1050
|
// ---------------------------------------------------------------------------
|
|
1033
1051
|
// Layout tool parameters
|
|
1034
1052
|
// ---------------------------------------------------------------------------
|
|
1035
|
-
layoutComponent: `Optional component name to scope the layout change (e.g., "flat-button", "calendar", "avatar"). If omitted, the change applies globally via :root.`,
|
|
1053
|
+
layoutComponent: `Optional component name to scope the layout change (e.g., "flat-button", "calendar", "avatar"). If omitted, the change applies globally via :root. Note: component targets Ignite UI framework selectors — do not use with platform "generic". Use "scope" instead for custom CSS selectors.`,
|
|
1036
1054
|
scope: `Optional CSS selector scope for the change (e.g., ".my-theme", ":root", "#app"). Ignored when component is provided.`,
|
|
1037
1055
|
sizeValue: `Size value to set for --ig-size. Accepts "small" (1), "medium" (2), "large" (3), or numeric 1, 2, 3 only.`,
|
|
1038
1056
|
spacing: "Spacing scale multiplier for --ig-spacing. 0 = none, 1 = default, 2 = double. Fractions allowed.",
|
|
@@ -5,8 +5,7 @@ import { getComponentTheme, searchComponents, COMPONENT_NAMES, validateTokens }
|
|
|
5
5
|
import "../../knowledge/custom-palettes.js";
|
|
6
6
|
import "../../utils/types.js";
|
|
7
7
|
import "../../knowledge/palettes.js";
|
|
8
|
-
import "
|
|
9
|
-
import "node:path";
|
|
8
|
+
import { PLATFORM_METADATA } from "../../knowledge/platforms/index.js";
|
|
10
9
|
async function handleCreateComponentTheme(params) {
|
|
11
10
|
const {
|
|
12
11
|
platform,
|
|
@@ -38,6 +37,25 @@ Please specify which platform you're using to generate the correct variable pref
|
|
|
38
37
|
isError: true
|
|
39
38
|
};
|
|
40
39
|
}
|
|
40
|
+
if (platform === "generic") {
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: "text",
|
|
45
|
+
text: `**Error:** \`create_component_theme\` requires a specific Ignite UI product platform.
|
|
46
|
+
|
|
47
|
+
The \`"generic"\` platform is not supported for component theming because component selectors and variable prefixes are platform-specific and do not exist in generic mode.
|
|
48
|
+
|
|
49
|
+
**Valid platforms:**
|
|
50
|
+
- \`angular\` - Ignite UI for Angular
|
|
51
|
+
- \`webcomponents\` - Ignite UI for Web Components
|
|
52
|
+
- \`react\` - Ignite UI for React
|
|
53
|
+
- \`blazor\` - Ignite UI for Blazor`
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
isError: true
|
|
57
|
+
};
|
|
58
|
+
}
|
|
41
59
|
const theme = getComponentTheme(normalizedComponent);
|
|
42
60
|
if (!theme) {
|
|
43
61
|
const suggestions = searchComponents(normalizedComponent);
|
|
@@ -84,7 +102,7 @@ Please use \`create_component_theme\` with one of the specific variant names abo
|
|
|
84
102
|
if (availability?.angular) availablePlatforms.push("Angular");
|
|
85
103
|
if (availability?.webcomponents)
|
|
86
104
|
availablePlatforms.push("Web Components");
|
|
87
|
-
const error = `**Error:** The \`${component}\` component is not available on ${platform
|
|
105
|
+
const error = `**Error:** The \`${component}\` component is not available on ${PLATFORM_METADATA[platform]?.name ?? platform}. ${availablePlatforms.length > 0 ? `It is available on: ${availablePlatforms.join(", ")}.` : ""}`;
|
|
88
106
|
return {
|
|
89
107
|
content: [{ type: "text", text: error }],
|
|
90
108
|
isError: true
|
|
@@ -148,7 +166,7 @@ Use \`get_component_design_tokens\` to see all tokens with descriptions.`
|
|
|
148
166
|
const responseParts = [];
|
|
149
167
|
responseParts.push(result.description);
|
|
150
168
|
responseParts.push("");
|
|
151
|
-
const platformNote = platform ? `Platform: ${platform
|
|
169
|
+
const platformNote = platform ? `Platform: ${PLATFORM_METADATA[platform]?.name ?? platform}` : "Platform: Not specified (generic output). Specify `platform` for optimized imports.";
|
|
152
170
|
responseParts.push(platformNote);
|
|
153
171
|
responseParts.push(
|
|
154
172
|
`Design System: ${designSystem.charAt(0).toUpperCase() + designSystem.slice(1)} (${variant})`
|
|
@@ -201,7 +219,7 @@ Use \`get_component_design_tokens\` to see all tokens with descriptions.`
|
|
|
201
219
|
const responseParts = [];
|
|
202
220
|
responseParts.push(result.description);
|
|
203
221
|
responseParts.push("");
|
|
204
|
-
const platformNote = platform ? `Platform: ${platform
|
|
222
|
+
const platformNote = platform ? `Platform: ${PLATFORM_METADATA[platform]?.name ?? platform}` : "Platform: Not specified (generic output). Specify `platform` for optimized imports.";
|
|
205
223
|
responseParts.push(platformNote);
|
|
206
224
|
responseParts.push(
|
|
207
225
|
`Design System: ${designSystem.charAt(0).toUpperCase() + designSystem.slice(1)} (${variant})`
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { generateCustomPaletteCss, formatCssOutput } from "../../generators/css.js";
|
|
2
2
|
import { PALETTE_PRESETS } from "../../knowledge/palettes.js";
|
|
3
|
+
import { PLATFORM_METADATA } from "../../knowledge/platforms/index.js";
|
|
3
4
|
import { toVariableName, generateCustomPaletteCode, generateHeader, generateUseStatement } from "../../utils/sass.js";
|
|
4
5
|
import { validateCustomPalette, formatCustomPaletteValidation } from "../../validators/custom-palette.js";
|
|
5
6
|
import "../../utils/color.js";
|
|
@@ -157,7 +158,7 @@ ${paletteLines.join("\n")}
|
|
|
157
158
|
responseParts.push(
|
|
158
159
|
`Created a custom ${variant} color palette based on ${designSystem} defaults.`
|
|
159
160
|
);
|
|
160
|
-
const platformNote = params.platform ? `Platform: ${params.platform
|
|
161
|
+
const platformNote = params.platform ? `Platform: ${PLATFORM_METADATA[params.platform]?.name ?? params.platform}` : "Platform: Not specified (generic output). Specify `platform` for optimized code.";
|
|
161
162
|
responseParts.push("");
|
|
162
163
|
responseParts.push(platformNote);
|
|
163
164
|
const shadesMode = Object.entries(colors).filter(([_, def]) => def.mode === "shades").map(([name]) => name);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { generateElevations } from "../../generators/sass.js";
|
|
2
|
+
import { PLATFORM_METADATA } from "../../knowledge/platforms/index.js";
|
|
2
3
|
function handleCreateElevations(params) {
|
|
3
4
|
const result = generateElevations({
|
|
4
5
|
platform: params.platform,
|
|
@@ -7,7 +8,7 @@ function handleCreateElevations(params) {
|
|
|
7
8
|
name: params.name
|
|
8
9
|
});
|
|
9
10
|
const responseParts = [result.description];
|
|
10
|
-
const platformNote = params.platform ? `Platform: ${params.platform
|
|
11
|
+
const platformNote = params.platform ? `Platform: ${PLATFORM_METADATA[params.platform]?.name ?? params.platform}` : "Platform: Not specified (generic output). Specify `platform` for optimized code.";
|
|
11
12
|
responseParts.push("");
|
|
12
13
|
responseParts.push(platformNote);
|
|
13
14
|
responseParts.push("");
|
|
@@ -36,7 +36,7 @@ ${list.map((name) => `- ${name}`).join("\n")}`
|
|
|
36
36
|
}
|
|
37
37
|
const selectorsEntry = COMPONENT_METADATA[normalized].selectors;
|
|
38
38
|
let selectors = [];
|
|
39
|
-
if (platform) {
|
|
39
|
+
if (platform && platform !== "generic") {
|
|
40
40
|
selectors = getComponentSelector(normalized, platform);
|
|
41
41
|
if (selectors.length === 0) {
|
|
42
42
|
const availability = getComponentPlatformAvailability(normalized);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { generatePaletteCss, formatCssOutput } from "../../generators/css.js";
|
|
2
2
|
import { generatePalette } from "../../generators/sass.js";
|
|
3
|
+
import { PLATFORM_METADATA } from "../../knowledge/platforms/index.js";
|
|
3
4
|
import "../../knowledge/colors.js";
|
|
4
5
|
import "../../knowledge/component-metadata.js";
|
|
5
6
|
import "../../knowledge/custom-palettes.js";
|
|
6
7
|
import "../../utils/types.js";
|
|
7
8
|
import "../../knowledge/palettes.js";
|
|
8
|
-
import "node:fs";
|
|
9
|
-
import "node:path";
|
|
10
9
|
import "../../utils/color.js";
|
|
11
10
|
import { validatePaletteColors, formatValidationResult, generateWarningComments } from "../../validators/palette.js";
|
|
12
11
|
async function handleCreatePalette(params) {
|
|
@@ -100,7 +99,7 @@ function handleSassOutput(params, validation) {
|
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
101
|
const responseParts = [result.description];
|
|
103
|
-
const platformNote = params.platform ? `Platform: ${params.platform
|
|
102
|
+
const platformNote = params.platform ? `Platform: ${PLATFORM_METADATA[params.platform]?.name ?? params.platform}` : "Platform: Not specified (generic output). Specify `platform` for optimized code.";
|
|
104
103
|
responseParts.push("");
|
|
105
104
|
responseParts.push(platformNote);
|
|
106
105
|
const validationText = formatValidationResult(validation);
|
|
@@ -18,11 +18,250 @@ function formatSignal(signal) {
|
|
|
18
18
|
return "unknown";
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
const SASS_CONFIG_GUIDANCE = [
|
|
22
|
+
{
|
|
23
|
+
match: "exact",
|
|
24
|
+
key: "angular.json",
|
|
25
|
+
description: "An `angular.json` config file was detected. To use Sass output from this MCP, ensure your Angular project includes `node_modules` in the Sass load paths:",
|
|
26
|
+
lang: "json",
|
|
27
|
+
code: [
|
|
28
|
+
"// In angular.json → architect → build → options:",
|
|
29
|
+
'"stylePreprocessorOptions": {',
|
|
30
|
+
' "includePaths": ["node_modules"]',
|
|
31
|
+
"}"
|
|
32
|
+
].join("\n")
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
match: "prefix",
|
|
36
|
+
key: "vite.config",
|
|
37
|
+
description: "A Vite config file was detected. To use Sass output from this MCP, ensure your Vite config includes `node_modules` in the Sass load paths:",
|
|
38
|
+
lang: "js",
|
|
39
|
+
code: [
|
|
40
|
+
"// In vite.config.ts/js:",
|
|
41
|
+
"css: {",
|
|
42
|
+
" preprocessorOptions: {",
|
|
43
|
+
" scss: {",
|
|
44
|
+
" loadPaths: ['node_modules']",
|
|
45
|
+
" }",
|
|
46
|
+
" }",
|
|
47
|
+
"}"
|
|
48
|
+
].join("\n")
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
match: "prefix",
|
|
52
|
+
key: "next.config",
|
|
53
|
+
description: "A Next.js config file was detected. To use Sass output from this MCP, ensure your Next.js config includes `node_modules` in the Sass load paths:",
|
|
54
|
+
lang: "js",
|
|
55
|
+
code: [
|
|
56
|
+
"// In next.config.js/mjs/ts:",
|
|
57
|
+
"sassOptions: {",
|
|
58
|
+
" loadPaths: ['node_modules']",
|
|
59
|
+
"}"
|
|
60
|
+
].join("\n")
|
|
61
|
+
}
|
|
62
|
+
];
|
|
63
|
+
const SASS_CONFIG_FALLBACK = "To use Sass output from this MCP, ensure your project's Sass compiler has `node_modules` in its `loadPaths`. The exact configuration depends on your build tool — Angular CLI uses `includePaths` in `angular.json`, while most other tools (Vite, Next.js, sass CLI) use `loadPaths`. Investigate the project's build configuration to find the right place to add this.";
|
|
64
|
+
function findSassGuidance(fileName) {
|
|
65
|
+
return SASS_CONFIG_GUIDANCE.find(
|
|
66
|
+
(entry) => entry.match === "exact" ? fileName === entry.key : fileName.startsWith(entry.key)
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
function buildToolEligibilitySection() {
|
|
70
|
+
return [
|
|
71
|
+
"### Available Tools",
|
|
72
|
+
"",
|
|
73
|
+
"The following tools work in generic (standalone) mode:",
|
|
74
|
+
"",
|
|
75
|
+
"- `create_palette` — Generate color palettes",
|
|
76
|
+
"- `create_custom_palette` — Generate fully custom palettes",
|
|
77
|
+
"- `create_typography` — Set up typography/type scales",
|
|
78
|
+
"- `create_elevations` — Configure shadow/elevation system",
|
|
79
|
+
"- `create_theme` — Generate a complete theme",
|
|
80
|
+
"- `set_size` / `set_spacing` / `set_roundness` — Layout tokens (use `scope` with a custom CSS selector or omit for `:root`; do **not** use `component` as it targets Ignite UI component selectors)",
|
|
81
|
+
"- `get_color` — Get CSS variable references for palette colors",
|
|
82
|
+
"- `read_resource` — Read theming reference data",
|
|
83
|
+
"",
|
|
84
|
+
"### Not Available in Generic Mode",
|
|
85
|
+
"",
|
|
86
|
+
"- `create_component_theme` — Requires a specific Ignite UI product platform (angular, webcomponents, react, or blazor) for component selectors and variable prefixes",
|
|
87
|
+
"- `get_component_design_tokens` — Returns tokens for Ignite UI framework components which are not present in generic mode",
|
|
88
|
+
""
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
function buildSassConfigSection(signals) {
|
|
92
|
+
const lines = ["### Sass Configuration", ""];
|
|
93
|
+
const configFileSignals = signals.filter((s) => s.type === "config_file");
|
|
94
|
+
if (configFileSignals.length === 0) {
|
|
95
|
+
lines.push(SASS_CONFIG_FALLBACK, "");
|
|
96
|
+
return lines;
|
|
97
|
+
}
|
|
98
|
+
for (const signal of configFileSignals) {
|
|
99
|
+
if (signal.type !== "config_file") continue;
|
|
100
|
+
const guidance = findSassGuidance(signal.file);
|
|
101
|
+
if (guidance) {
|
|
102
|
+
lines.push(
|
|
103
|
+
guidance.description,
|
|
104
|
+
"",
|
|
105
|
+
`\`\`\`${guidance.lang}`,
|
|
106
|
+
guidance.code,
|
|
107
|
+
"```",
|
|
108
|
+
""
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return lines;
|
|
113
|
+
}
|
|
114
|
+
function buildOutputFormatNotes(hasThemingPackage) {
|
|
115
|
+
const lines = ["### Output Format Notes", ""];
|
|
116
|
+
if (!hasThemingPackage) {
|
|
117
|
+
lines.push(
|
|
118
|
+
"The `igniteui-theming` package was **not found** in this project's dependencies.",
|
|
119
|
+
"",
|
|
120
|
+
"- **CSS output** works without any local installation — the MCP compiles Sass to CSS server-side.",
|
|
121
|
+
"- **Sass output** requires `igniteui-theming` to be resolvable in your project. Run `npm install igniteui-theming` to install it, then configure `loadPaths` as described above."
|
|
122
|
+
);
|
|
123
|
+
} else {
|
|
124
|
+
lines.push(
|
|
125
|
+
"The `igniteui-theming` package is installed in this project.",
|
|
126
|
+
"",
|
|
127
|
+
"- **CSS output** is compiled server-side by the MCP — no Sass toolchain needed.",
|
|
128
|
+
"- **Sass output** uses `@use 'igniteui-theming' as *;` and requires the `loadPaths` configuration described above."
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
return lines;
|
|
132
|
+
}
|
|
133
|
+
function buildAmbiguousResponse(result) {
|
|
134
|
+
const alternatives = result.alternatives;
|
|
135
|
+
const lines = [
|
|
136
|
+
"## Platform Detection Result",
|
|
137
|
+
"",
|
|
138
|
+
"**Status:** Ambiguous - Multiple platforms detected",
|
|
139
|
+
"",
|
|
140
|
+
"The project appears to contain dependencies for multiple Ignite UI platforms. This might be a monorepo or a project transitioning between frameworks.",
|
|
141
|
+
"",
|
|
142
|
+
"### Detected Platforms",
|
|
143
|
+
""
|
|
144
|
+
];
|
|
145
|
+
for (const alt of alternatives) {
|
|
146
|
+
const metadata = PLATFORM_METADATA[alt.platform];
|
|
147
|
+
lines.push(
|
|
148
|
+
`#### ${metadata.name}`,
|
|
149
|
+
`- **Confidence:** ${alt.confidence}%`,
|
|
150
|
+
`- **Signals:** ${alt.signals.map(formatSignal).join(", ")}`,
|
|
151
|
+
`- **Theming module:** \`${metadata.themingModule}\``,
|
|
152
|
+
""
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
lines.push(
|
|
156
|
+
"### Action Required",
|
|
157
|
+
"",
|
|
158
|
+
"Please specify the platform explicitly when calling theme generation tools:",
|
|
159
|
+
""
|
|
160
|
+
);
|
|
161
|
+
for (const alt of alternatives) {
|
|
162
|
+
const metadata = PLATFORM_METADATA[alt.platform];
|
|
163
|
+
lines.push(`- Use \`platform: '${alt.platform}'\` for ${metadata.name}`);
|
|
164
|
+
}
|
|
165
|
+
return lines;
|
|
166
|
+
}
|
|
167
|
+
function buildGenericResponse(result, hasThemingPackage) {
|
|
168
|
+
const metadata = PLATFORM_METADATA.generic;
|
|
169
|
+
const lines = [
|
|
170
|
+
"## Platform Detection Result",
|
|
171
|
+
"",
|
|
172
|
+
`**Detected Platform:** ${metadata.name}`,
|
|
173
|
+
`**Confidence:** ${result.confidence}`,
|
|
174
|
+
`**Theming Module:** \`${metadata.themingModule}\``,
|
|
175
|
+
"",
|
|
176
|
+
metadata.description,
|
|
177
|
+
""
|
|
178
|
+
];
|
|
179
|
+
if (result.signals && result.signals.length > 0) {
|
|
180
|
+
lines.push(
|
|
181
|
+
`**Detection Signals:** ${result.signals.map(formatSignal).join(", ")}`,
|
|
182
|
+
""
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
lines.push(
|
|
186
|
+
...buildToolEligibilitySection(),
|
|
187
|
+
...buildSassConfigSection(result.signals ?? []),
|
|
188
|
+
...buildOutputFormatNotes(hasThemingPackage)
|
|
189
|
+
);
|
|
190
|
+
return lines;
|
|
191
|
+
}
|
|
192
|
+
function buildPlatformResponse(result, licensed) {
|
|
193
|
+
const platform = result.platform;
|
|
194
|
+
const metadata = PLATFORM_METADATA[platform];
|
|
195
|
+
const lines = [
|
|
196
|
+
"## Platform Detection Result",
|
|
197
|
+
"",
|
|
198
|
+
`**Detected Platform:** ${metadata.name}`,
|
|
199
|
+
`**Confidence:** ${result.confidence}`
|
|
200
|
+
];
|
|
201
|
+
if (result.detectedPackage) {
|
|
202
|
+
lines.push(`**Detected Package:** ${result.detectedPackage}`);
|
|
203
|
+
if (platform === "angular") {
|
|
204
|
+
const isLicensed = isLicensedPackage(result.detectedPackage);
|
|
205
|
+
lines.push(
|
|
206
|
+
`**Package Type:** ${isLicensed ? "Licensed (@infragistics)" : "Open Source (npm)"}`
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (result.signals && result.signals.length > 0) {
|
|
211
|
+
lines.push(
|
|
212
|
+
`**Detection Signals:** ${result.signals.map(formatSignal).join(", ")}`
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
const themingModule = platform === "angular" && licensed ? metadata.licensedThemingModule : metadata.themingModule;
|
|
216
|
+
lines.push(`**Theming Module:** \`${themingModule}\``, "");
|
|
217
|
+
let usageLine = `When generating theme code, use \`platform: '${platform}'\``;
|
|
218
|
+
if (platform === "angular" && licensed) {
|
|
219
|
+
usageLine += " and `licensed: true`";
|
|
220
|
+
}
|
|
221
|
+
usageLine += " to ensure the correct Sass syntax is generated for this platform.";
|
|
222
|
+
lines.push("### Usage", "", usageLine, "", metadata.description);
|
|
223
|
+
if (result.confidence === "low") {
|
|
224
|
+
lines.push(
|
|
225
|
+
"",
|
|
226
|
+
"### Note",
|
|
227
|
+
"",
|
|
228
|
+
"Detection confidence is **low**. This means no Ignite UI package was found, only framework packages. Please verify this is the correct platform before generating themes."
|
|
229
|
+
);
|
|
230
|
+
} else if (result.confidence === "medium") {
|
|
231
|
+
lines.push(
|
|
232
|
+
"",
|
|
233
|
+
"### Note",
|
|
234
|
+
"",
|
|
235
|
+
"Detection confidence is **medium**. Consider verifying the platform if the generated code doesn't work as expected."
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
return lines;
|
|
239
|
+
}
|
|
240
|
+
function buildNullPlatformResponse(result) {
|
|
241
|
+
return [
|
|
242
|
+
"## Platform Detection Result",
|
|
243
|
+
"",
|
|
244
|
+
"**Platform:** Not detected",
|
|
245
|
+
`**Reason:** ${result.reason}`,
|
|
246
|
+
"",
|
|
247
|
+
"### Recommendation",
|
|
248
|
+
"",
|
|
249
|
+
"Please specify the platform explicitly when calling theme generation tools:",
|
|
250
|
+
"",
|
|
251
|
+
"- Use `platform: 'angular'` for Ignite UI for Angular",
|
|
252
|
+
"- Use `platform: 'webcomponents'` for Ignite UI for Web Components",
|
|
253
|
+
"- Use `platform: 'react'` for Ignite UI for React",
|
|
254
|
+
"- Use `platform: 'blazor'` for Ignite UI for Blazor",
|
|
255
|
+
"- Use `platform: 'generic'` for platform-agnostic output"
|
|
256
|
+
];
|
|
257
|
+
}
|
|
21
258
|
async function handleDetectPlatform(params) {
|
|
22
259
|
const packageJsonPath = params.packageJsonPath ?? "./package.json";
|
|
23
260
|
const resolvedPath = resolve(process.cwd(), packageJsonPath);
|
|
24
261
|
const projectRoot = dirname(resolvedPath);
|
|
25
262
|
let result;
|
|
263
|
+
let parsedDeps = {};
|
|
264
|
+
let parsedDevDeps = {};
|
|
26
265
|
try {
|
|
27
266
|
const packageJsonContent = await readFile(resolvedPath, "utf-8");
|
|
28
267
|
const parseResult = packageJsonSchema.safeParse(
|
|
@@ -37,9 +276,11 @@ async function handleDetectPlatform(params) {
|
|
|
37
276
|
};
|
|
38
277
|
} else {
|
|
39
278
|
const packageJson = parseResult.data;
|
|
279
|
+
parsedDeps = packageJson.dependencies ?? {};
|
|
280
|
+
parsedDevDeps = packageJson.devDependencies ?? {};
|
|
40
281
|
result = detectPlatformFromDependencies(
|
|
41
|
-
|
|
42
|
-
|
|
282
|
+
parsedDeps,
|
|
283
|
+
parsedDevDeps,
|
|
43
284
|
projectRoot
|
|
44
285
|
);
|
|
45
286
|
}
|
|
@@ -52,6 +293,8 @@ async function handleDetectPlatform(params) {
|
|
|
52
293
|
reason: `Could not read package.json: ${errorMessage}`
|
|
53
294
|
};
|
|
54
295
|
}
|
|
296
|
+
const allDeps = { ...parsedDeps, ...parsedDevDeps };
|
|
297
|
+
const hasThemingPackage = "igniteui-theming" in allDeps;
|
|
55
298
|
const response = {
|
|
56
299
|
platform: result.platform,
|
|
57
300
|
confidence: result.confidence,
|
|
@@ -75,96 +318,14 @@ async function handleDetectPlatform(params) {
|
|
|
75
318
|
description: metadata.description
|
|
76
319
|
};
|
|
77
320
|
}
|
|
78
|
-
|
|
79
|
-
if (result.ambiguous && result.alternatives) {
|
|
80
|
-
text = "## Platform Detection Result\n\n";
|
|
81
|
-
text += "**Status:** Ambiguous - Multiple platforms detected\n\n";
|
|
82
|
-
text += "The project appears to contain dependencies for multiple Ignite UI platforms. ";
|
|
83
|
-
text += "This might be a monorepo or a project transitioning between frameworks.\n\n";
|
|
84
|
-
text += "### Detected Platforms\n\n";
|
|
85
|
-
for (const alt of result.alternatives) {
|
|
86
|
-
const metadata = PLATFORM_METADATA[alt.platform];
|
|
87
|
-
text += `#### ${metadata.name}
|
|
88
|
-
`;
|
|
89
|
-
text += `- **Confidence:** ${alt.confidence}%
|
|
90
|
-
`;
|
|
91
|
-
text += `- **Signals:** ${alt.signals.map(formatSignal).join(", ")}
|
|
92
|
-
`;
|
|
93
|
-
text += `- **Theming module:** \`${metadata.themingModule}\`
|
|
94
|
-
|
|
95
|
-
`;
|
|
96
|
-
}
|
|
97
|
-
text += "### Action Required\n\n";
|
|
98
|
-
text += "Please specify the platform explicitly when calling theme generation tools:\n\n";
|
|
99
|
-
for (const alt of result.alternatives) {
|
|
100
|
-
const metadata = PLATFORM_METADATA[alt.platform];
|
|
101
|
-
text += `- Use \`platform: '${alt.platform}'\` for ${metadata.name}
|
|
102
|
-
`;
|
|
103
|
-
}
|
|
104
|
-
} else if (result.platform) {
|
|
105
|
-
const metadata = PLATFORM_METADATA[result.platform];
|
|
106
|
-
text = "## Platform Detection Result\n\n";
|
|
107
|
-
text += `**Detected Platform:** ${metadata.name}
|
|
108
|
-
`;
|
|
109
|
-
text += `**Confidence:** ${result.confidence}
|
|
110
|
-
`;
|
|
111
|
-
if (result.detectedPackage) {
|
|
112
|
-
text += `**Detected Package:** ${result.detectedPackage}
|
|
113
|
-
`;
|
|
114
|
-
const licensed = isLicensedPackage(result.detectedPackage);
|
|
115
|
-
if (result.platform === "angular") {
|
|
116
|
-
text += `**Package Type:** ${licensed ? "Licensed (@infragistics)" : "Open Source (npm)"}
|
|
117
|
-
`;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
if (result.signals && result.signals.length > 0) {
|
|
121
|
-
text += `**Detection Signals:** ${result.signals.map(formatSignal).join(", ")}
|
|
122
|
-
`;
|
|
123
|
-
}
|
|
124
|
-
const themingModule = result.platform === "angular" && response.licensed ? metadata.licensedThemingModule : metadata.themingModule;
|
|
125
|
-
text += `**Theming Module:** \`${themingModule}\`
|
|
126
|
-
|
|
127
|
-
`;
|
|
128
|
-
text += "### Usage\n\n";
|
|
129
|
-
text += `When generating theme code, use \`platform: '${result.platform}'\``;
|
|
130
|
-
if (result.platform === "angular" && response.licensed) {
|
|
131
|
-
text += " and `licensed: true`";
|
|
132
|
-
}
|
|
133
|
-
text += " to ensure the correct Sass syntax is generated for this platform.\n\n";
|
|
134
|
-
text += `${metadata.description}`;
|
|
135
|
-
if (result.confidence === "low") {
|
|
136
|
-
text += "\n\n### Note\n\n";
|
|
137
|
-
text += "Detection confidence is **low**. This means no Ignite UI package was found, ";
|
|
138
|
-
text += "only framework packages. Please verify this is the correct platform before generating themes.";
|
|
139
|
-
} else if (result.confidence === "medium") {
|
|
140
|
-
text += "\n\n### Note\n\n";
|
|
141
|
-
text += "Detection confidence is **medium**. Consider verifying the platform if the generated ";
|
|
142
|
-
text += `code doesn't work as expected.`;
|
|
143
|
-
}
|
|
144
|
-
} else {
|
|
145
|
-
text = "## Platform Detection Result\n\n";
|
|
146
|
-
text += "**Platform:** Not detected\n";
|
|
147
|
-
text += `**Reason:** ${result.reason}
|
|
148
|
-
|
|
149
|
-
`;
|
|
150
|
-
text += "### Recommendation\n\n";
|
|
151
|
-
text += "Please specify the platform explicitly when calling theme generation tools:\n\n";
|
|
152
|
-
text += `- Use \`platform: 'angular'\` for Ignite UI for Angular
|
|
153
|
-
`;
|
|
154
|
-
text += `- Use \`platform: 'webcomponents'\` for Ignite UI for Web Components
|
|
155
|
-
`;
|
|
156
|
-
text += `- Use \`platform: 'react'\` for Ignite UI for React
|
|
157
|
-
`;
|
|
158
|
-
text += `- Use \`platform: 'blazor'\` for Ignite UI for Blazor`;
|
|
159
|
-
}
|
|
321
|
+
const lines = result.ambiguous && result.alternatives ? buildAmbiguousResponse(result) : result.platform === "generic" ? buildGenericResponse(result, hasThemingPackage) : result.platform ? buildPlatformResponse(result, response.licensed) : buildNullPlatformResponse(result);
|
|
160
322
|
return {
|
|
161
323
|
content: [
|
|
162
324
|
{
|
|
163
325
|
type: "text",
|
|
164
|
-
text
|
|
326
|
+
text: lines.join("\n")
|
|
165
327
|
}
|
|
166
328
|
],
|
|
167
|
-
// Also include structured data for programmatic access
|
|
168
329
|
structuredData: response
|
|
169
330
|
};
|
|
170
331
|
}
|
|
@@ -68,6 +68,9 @@ async function handleCreateTheme(params) {
|
|
|
68
68
|
case "blazor":
|
|
69
69
|
platformNote = "Platform: Ignite UI for Blazor";
|
|
70
70
|
break;
|
|
71
|
+
case "generic":
|
|
72
|
+
platformNote = "Platform: Ignite UI Theming (Standalone)";
|
|
73
|
+
break;
|
|
71
74
|
default:
|
|
72
75
|
platformNote = "Platform: Not specified (generic output). Specify `platform` for optimized code.";
|
|
73
76
|
break;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { generateTypography } from "../../generators/sass.js";
|
|
2
|
+
import { PLATFORM_METADATA } from "../../knowledge/platforms/index.js";
|
|
2
3
|
function handleCreateTypography(params) {
|
|
3
4
|
const result = generateTypography({
|
|
4
5
|
platform: params.platform,
|
|
@@ -9,7 +10,7 @@ function handleCreateTypography(params) {
|
|
|
9
10
|
name: params.name
|
|
10
11
|
});
|
|
11
12
|
const responseParts = [result.description];
|
|
12
|
-
const platformNote = params.platform ? `Platform: ${params.platform
|
|
13
|
+
const platformNote = params.platform ? `Platform: ${PLATFORM_METADATA[params.platform]?.name ?? params.platform}` : "Platform: Not specified (generic output). Specify `platform` for optimized code.";
|
|
13
14
|
responseParts.push("");
|
|
14
15
|
responseParts.push(platformNote);
|
|
15
16
|
responseParts.push("");
|