@ng-forge/dynamic-form-mcp 0.10.0-next.4 → 1.0.0-rc.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/bin/ng-forge-mcp.js +80 -80
- package/package.json +6 -6
- package/src/index.d.ts +2 -2
- package/src/index.js +85 -85
- package/src/registry/addons.d.ts +12 -12
- package/src/registry/index.d.ts +8 -8
package/bin/ng-forge-mcp.js
CHANGED
|
@@ -1132,7 +1132,7 @@ var UI_ADAPTERS = [
|
|
|
1132
1132
|
fieldTypes: [
|
|
1133
1133
|
{
|
|
1134
1134
|
type: "input",
|
|
1135
|
-
componentName: "
|
|
1135
|
+
componentName: "BsInputFieldComponent",
|
|
1136
1136
|
additionalProps: {
|
|
1137
1137
|
size: {
|
|
1138
1138
|
name: "size",
|
|
@@ -1151,7 +1151,7 @@ var UI_ADAPTERS = [
|
|
|
1151
1151
|
},
|
|
1152
1152
|
{
|
|
1153
1153
|
type: "select",
|
|
1154
|
-
componentName: "
|
|
1154
|
+
componentName: "BsSelectFieldComponent",
|
|
1155
1155
|
additionalProps: {
|
|
1156
1156
|
size: {
|
|
1157
1157
|
name: "size",
|
|
@@ -1170,7 +1170,7 @@ var UI_ADAPTERS = [
|
|
|
1170
1170
|
fieldTypes: [
|
|
1171
1171
|
{
|
|
1172
1172
|
type: "input",
|
|
1173
|
-
componentName: "
|
|
1173
|
+
componentName: "PrimeInputFieldComponent",
|
|
1174
1174
|
additionalProps: {
|
|
1175
1175
|
variant: {
|
|
1176
1176
|
name: "variant",
|
|
@@ -1183,7 +1183,7 @@ var UI_ADAPTERS = [
|
|
|
1183
1183
|
},
|
|
1184
1184
|
{
|
|
1185
1185
|
type: "select",
|
|
1186
|
-
componentName: "
|
|
1186
|
+
componentName: "PrimeSelectFieldComponent",
|
|
1187
1187
|
additionalProps: {
|
|
1188
1188
|
filter: {
|
|
1189
1189
|
name: "filter",
|
|
@@ -1203,7 +1203,7 @@ var UI_ADAPTERS = [
|
|
|
1203
1203
|
},
|
|
1204
1204
|
{
|
|
1205
1205
|
type: "datepicker",
|
|
1206
|
-
componentName: "
|
|
1206
|
+
componentName: "PrimeDatepickerFieldComponent",
|
|
1207
1207
|
additionalProps: {
|
|
1208
1208
|
showIcon: {
|
|
1209
1209
|
name: "showIcon",
|
|
@@ -1230,7 +1230,7 @@ var UI_ADAPTERS = [
|
|
|
1230
1230
|
fieldTypes: [
|
|
1231
1231
|
{
|
|
1232
1232
|
type: "input",
|
|
1233
|
-
componentName: "
|
|
1233
|
+
componentName: "IonicInputFieldComponent",
|
|
1234
1234
|
additionalProps: {
|
|
1235
1235
|
fill: {
|
|
1236
1236
|
name: "fill",
|
|
@@ -1250,7 +1250,7 @@ var UI_ADAPTERS = [
|
|
|
1250
1250
|
},
|
|
1251
1251
|
{
|
|
1252
1252
|
type: "select",
|
|
1253
|
-
componentName: "
|
|
1253
|
+
componentName: "IonicSelectFieldComponent",
|
|
1254
1254
|
additionalProps: {
|
|
1255
1255
|
interface: {
|
|
1256
1256
|
name: "interface",
|
|
@@ -1263,7 +1263,7 @@ var UI_ADAPTERS = [
|
|
|
1263
1263
|
},
|
|
1264
1264
|
{
|
|
1265
1265
|
type: "toggle",
|
|
1266
|
-
componentName: "
|
|
1266
|
+
componentName: "IonicToggleFieldComponent",
|
|
1267
1267
|
additionalProps: {
|
|
1268
1268
|
enableOnOffLabels: {
|
|
1269
1269
|
name: "enableOnOffLabels",
|
|
@@ -1577,14 +1577,14 @@ var UNIVERSAL_BASE_PROPS = {
|
|
|
1577
1577
|
disabled: {
|
|
1578
1578
|
name: "disabled",
|
|
1579
1579
|
type: "boolean | Signal<boolean> | Observable<boolean>",
|
|
1580
|
-
description: "Reactive disabled state \u2014 primarily relevant for interactive
|
|
1580
|
+
description: "Reactive disabled state \u2014 primarily relevant for interactive types.",
|
|
1581
1581
|
required: false
|
|
1582
1582
|
}
|
|
1583
1583
|
};
|
|
1584
|
-
var
|
|
1585
|
-
// ─── Core-shipped universal
|
|
1584
|
+
var ADDON_TYPES = [
|
|
1585
|
+
// ─── Core-shipped universal types ────────────────────────────────────────
|
|
1586
1586
|
{
|
|
1587
|
-
|
|
1587
|
+
type: "text",
|
|
1588
1588
|
category: "core",
|
|
1589
1589
|
package: "@ng-forge/dynamic-forms",
|
|
1590
1590
|
adapter: null,
|
|
@@ -1599,11 +1599,11 @@ var ADDON_KINDS = [
|
|
|
1599
1599
|
required: true
|
|
1600
1600
|
}
|
|
1601
1601
|
},
|
|
1602
|
-
example: `{ slot: 'prefix',
|
|
1603
|
-
minimalExample: `{ slot: 'prefix',
|
|
1602
|
+
example: `{ slot: 'prefix', type: 'text', text: '$' }`,
|
|
1603
|
+
minimalExample: `{ slot: 'prefix', type: 'text', text: '$' }`
|
|
1604
1604
|
},
|
|
1605
1605
|
{
|
|
1606
|
-
|
|
1606
|
+
type: "template",
|
|
1607
1607
|
category: "core",
|
|
1608
1608
|
package: "@ng-forge/dynamic-forms",
|
|
1609
1609
|
adapter: null,
|
|
@@ -1618,15 +1618,15 @@ var ADDON_KINDS = [
|
|
|
1618
1618
|
required: true
|
|
1619
1619
|
}
|
|
1620
1620
|
},
|
|
1621
|
-
example: `{ slot: 'suffix',
|
|
1622
|
-
minimalExample: `{ slot: 'suffix',
|
|
1621
|
+
example: `{ slot: 'suffix', type: 'template', templateKey: 'searchIcon' }`,
|
|
1622
|
+
minimalExample: `{ slot: 'suffix', type: 'template', templateKey: 'mySlot' }`
|
|
1623
1623
|
},
|
|
1624
1624
|
{
|
|
1625
|
-
|
|
1625
|
+
type: "component",
|
|
1626
1626
|
category: "core",
|
|
1627
1627
|
package: "@ng-forge/dynamic-forms",
|
|
1628
1628
|
adapter: null,
|
|
1629
|
-
description: "Renders an arbitrary Angular component. The `component` loader is a function; this
|
|
1629
|
+
description: "Renders an arbitrary Angular component. The `component` loader is a function; this type is dropped from JSON-derived configs by the validator.",
|
|
1630
1630
|
jsonSafe: false,
|
|
1631
1631
|
props: {
|
|
1632
1632
|
...UNIVERSAL_BASE_PROPS,
|
|
@@ -1645,15 +1645,15 @@ var ADDON_KINDS = [
|
|
|
1645
1645
|
},
|
|
1646
1646
|
example: `{
|
|
1647
1647
|
slot: 'prefix',
|
|
1648
|
-
|
|
1648
|
+
type: 'component',
|
|
1649
1649
|
component: () => import('./my-component').then(m => m.MyComponent),
|
|
1650
1650
|
inputs: { foo: 'bar' },
|
|
1651
1651
|
}`,
|
|
1652
|
-
minimalExample: `{ slot: 'prefix',
|
|
1652
|
+
minimalExample: `{ slot: 'prefix', type: 'component', component: () => import('./x') }`
|
|
1653
1653
|
},
|
|
1654
|
-
// ─── PrimeNG-shipped
|
|
1654
|
+
// ─── PrimeNG-shipped types ───────────────────────────────────────────────
|
|
1655
1655
|
{
|
|
1656
|
-
|
|
1656
|
+
type: "prime-icon",
|
|
1657
1657
|
category: "adapter",
|
|
1658
1658
|
package: "@ng-forge/dynamic-forms-primeng",
|
|
1659
1659
|
adapter: "primeng",
|
|
@@ -1674,11 +1674,11 @@ var ADDON_KINDS = [
|
|
|
1674
1674
|
required: false
|
|
1675
1675
|
}
|
|
1676
1676
|
},
|
|
1677
|
-
example: `{ slot: 'prefix',
|
|
1678
|
-
minimalExample: `{ slot: 'prefix',
|
|
1677
|
+
example: `{ slot: 'prefix', type: 'prime-icon', icon: 'search', ariaLabel: 'Search' }`,
|
|
1678
|
+
minimalExample: `{ slot: 'prefix', type: 'prime-icon', icon: 'search' }`
|
|
1679
1679
|
},
|
|
1680
1680
|
{
|
|
1681
|
-
|
|
1681
|
+
type: "prime-button",
|
|
1682
1682
|
category: "adapter",
|
|
1683
1683
|
package: "@ng-forge/dynamic-forms-primeng",
|
|
1684
1684
|
adapter: "primeng",
|
|
@@ -1715,7 +1715,7 @@ var ADDON_KINDS = [
|
|
|
1715
1715
|
actionRef: {
|
|
1716
1716
|
name: "actionRef",
|
|
1717
1717
|
type: "string",
|
|
1718
|
-
description: "Typed string handle to a handler registered via `
|
|
1718
|
+
description: "Typed string handle to a handler registered via `withAddonActions(...)`. Mutually exclusive with `preset` and `action`. JSON-safe.",
|
|
1719
1719
|
required: false
|
|
1720
1720
|
},
|
|
1721
1721
|
action: {
|
|
@@ -1725,12 +1725,12 @@ var ADDON_KINDS = [
|
|
|
1725
1725
|
required: false
|
|
1726
1726
|
}
|
|
1727
1727
|
},
|
|
1728
|
-
example: `{ slot: 'suffix',
|
|
1729
|
-
minimalExample: `{ slot: 'suffix',
|
|
1728
|
+
example: `{ slot: 'suffix', type: 'prime-button', icon: 'times', ariaLabel: 'Clear', preset: 'clear' }`,
|
|
1729
|
+
minimalExample: `{ slot: 'suffix', type: 'prime-button', icon: 'times', ariaLabel: 'Clear', preset: 'clear' }`
|
|
1730
1730
|
},
|
|
1731
|
-
// ─── Material-shipped
|
|
1731
|
+
// ─── Material-shipped types ──────────────────────────────────────────────
|
|
1732
1732
|
{
|
|
1733
|
-
|
|
1733
|
+
type: "mat-icon",
|
|
1734
1734
|
category: "adapter",
|
|
1735
1735
|
package: "@ng-forge/dynamic-forms-material",
|
|
1736
1736
|
adapter: "material",
|
|
@@ -1751,11 +1751,11 @@ var ADDON_KINDS = [
|
|
|
1751
1751
|
required: false
|
|
1752
1752
|
}
|
|
1753
1753
|
},
|
|
1754
|
-
example: `{ slot: 'prefix',
|
|
1755
|
-
minimalExample: `{ slot: 'prefix',
|
|
1754
|
+
example: `{ slot: 'prefix', type: 'mat-icon', icon: 'search', ariaLabel: 'Search' }`,
|
|
1755
|
+
minimalExample: `{ slot: 'prefix', type: 'mat-icon', icon: 'search' }`
|
|
1756
1756
|
},
|
|
1757
1757
|
{
|
|
1758
|
-
|
|
1758
|
+
type: "mat-button",
|
|
1759
1759
|
category: "adapter",
|
|
1760
1760
|
package: "@ng-forge/dynamic-forms-material",
|
|
1761
1761
|
adapter: "material",
|
|
@@ -1792,7 +1792,7 @@ var ADDON_KINDS = [
|
|
|
1792
1792
|
actionRef: {
|
|
1793
1793
|
name: "actionRef",
|
|
1794
1794
|
type: "string",
|
|
1795
|
-
description: "Typed handle to a handler registered via `
|
|
1795
|
+
description: "Typed handle to a handler registered via `withAddonActions(...)`. JSON-safe.",
|
|
1796
1796
|
required: false
|
|
1797
1797
|
},
|
|
1798
1798
|
action: {
|
|
@@ -1802,12 +1802,12 @@ var ADDON_KINDS = [
|
|
|
1802
1802
|
required: false
|
|
1803
1803
|
}
|
|
1804
1804
|
},
|
|
1805
|
-
example: `{ slot: 'suffix',
|
|
1806
|
-
minimalExample: `{ slot: 'suffix',
|
|
1805
|
+
example: `{ slot: 'suffix', type: 'mat-button', icon: 'close', ariaLabel: 'Clear', preset: 'clear' }`,
|
|
1806
|
+
minimalExample: `{ slot: 'suffix', type: 'mat-button', icon: 'close', ariaLabel: 'Clear', preset: 'clear' }`
|
|
1807
1807
|
},
|
|
1808
|
-
// ─── Bootstrap-shipped
|
|
1808
|
+
// ─── Bootstrap-shipped types ─────────────────────────────────────────────
|
|
1809
1809
|
{
|
|
1810
|
-
|
|
1810
|
+
type: "bs-icon",
|
|
1811
1811
|
category: "adapter",
|
|
1812
1812
|
package: "@ng-forge/dynamic-forms-bootstrap",
|
|
1813
1813
|
adapter: "bootstrap",
|
|
@@ -1828,11 +1828,11 @@ var ADDON_KINDS = [
|
|
|
1828
1828
|
required: false
|
|
1829
1829
|
}
|
|
1830
1830
|
},
|
|
1831
|
-
example: `{ slot: 'prefix',
|
|
1832
|
-
minimalExample: `{ slot: 'prefix',
|
|
1831
|
+
example: `{ slot: 'prefix', type: 'bs-icon', icon: 'search', ariaLabel: 'Search' }`,
|
|
1832
|
+
minimalExample: `{ slot: 'prefix', type: 'bs-icon', icon: 'search' }`
|
|
1833
1833
|
},
|
|
1834
1834
|
{
|
|
1835
|
-
|
|
1835
|
+
type: "bs-button",
|
|
1836
1836
|
category: "adapter",
|
|
1837
1837
|
package: "@ng-forge/dynamic-forms-bootstrap",
|
|
1838
1838
|
adapter: "bootstrap",
|
|
@@ -1869,7 +1869,7 @@ var ADDON_KINDS = [
|
|
|
1869
1869
|
actionRef: {
|
|
1870
1870
|
name: "actionRef",
|
|
1871
1871
|
type: "string",
|
|
1872
|
-
description: "Typed handle to a handler registered via `
|
|
1872
|
+
description: "Typed handle to a handler registered via `withAddonActions(...)`. JSON-safe.",
|
|
1873
1873
|
required: false
|
|
1874
1874
|
},
|
|
1875
1875
|
action: {
|
|
@@ -1879,12 +1879,12 @@ var ADDON_KINDS = [
|
|
|
1879
1879
|
required: false
|
|
1880
1880
|
}
|
|
1881
1881
|
},
|
|
1882
|
-
example: `{ slot: 'suffix',
|
|
1883
|
-
minimalExample: `{ slot: 'suffix',
|
|
1882
|
+
example: `{ slot: 'suffix', type: 'bs-button', icon: 'x', ariaLabel: 'Clear', preset: 'clear' }`,
|
|
1883
|
+
minimalExample: `{ slot: 'suffix', type: 'bs-button', icon: 'x', ariaLabel: 'Clear', preset: 'clear' }`
|
|
1884
1884
|
},
|
|
1885
|
-
// ─── Ionic-shipped
|
|
1885
|
+
// ─── Ionic-shipped types ─────────────────────────────────────────────────
|
|
1886
1886
|
{
|
|
1887
|
-
|
|
1887
|
+
type: "ion-icon",
|
|
1888
1888
|
category: "adapter",
|
|
1889
1889
|
package: "@ng-forge/dynamic-forms-ionic",
|
|
1890
1890
|
adapter: "ionic",
|
|
@@ -1905,11 +1905,11 @@ var ADDON_KINDS = [
|
|
|
1905
1905
|
required: false
|
|
1906
1906
|
}
|
|
1907
1907
|
},
|
|
1908
|
-
example: `{ slot: 'prefix',
|
|
1909
|
-
minimalExample: `{ slot: 'prefix',
|
|
1908
|
+
example: `{ slot: 'prefix', type: 'ion-icon', icon: 'search-outline', ariaLabel: 'Search' }`,
|
|
1909
|
+
minimalExample: `{ slot: 'prefix', type: 'ion-icon', icon: 'search-outline' }`
|
|
1910
1910
|
},
|
|
1911
1911
|
{
|
|
1912
|
-
|
|
1912
|
+
type: "ion-button",
|
|
1913
1913
|
category: "adapter",
|
|
1914
1914
|
package: "@ng-forge/dynamic-forms-ionic",
|
|
1915
1915
|
adapter: "ionic",
|
|
@@ -1952,7 +1952,7 @@ var ADDON_KINDS = [
|
|
|
1952
1952
|
actionRef: {
|
|
1953
1953
|
name: "actionRef",
|
|
1954
1954
|
type: "string",
|
|
1955
|
-
description: "Typed handle to a handler registered via `
|
|
1955
|
+
description: "Typed handle to a handler registered via `withAddonActions(...)`. JSON-safe.",
|
|
1956
1956
|
required: false
|
|
1957
1957
|
},
|
|
1958
1958
|
action: {
|
|
@@ -1962,8 +1962,8 @@ var ADDON_KINDS = [
|
|
|
1962
1962
|
required: false
|
|
1963
1963
|
}
|
|
1964
1964
|
},
|
|
1965
|
-
example: `{ slot: 'suffix',
|
|
1966
|
-
minimalExample: `{ slot: 'suffix',
|
|
1965
|
+
example: `{ slot: 'suffix', type: 'ion-button', icon: 'close-outline', ariaLabel: 'Clear', preset: 'clear' }`,
|
|
1966
|
+
minimalExample: `{ slot: 'suffix', type: 'ion-button', icon: 'close-outline', ariaLabel: 'Clear', preset: 'clear' }`
|
|
1967
1967
|
}
|
|
1968
1968
|
];
|
|
1969
1969
|
|
|
@@ -2010,11 +2010,11 @@ function getDocPage(id) {
|
|
|
2010
2010
|
function getDocPagesByCategory(category) {
|
|
2011
2011
|
return DOCUMENTATION.filter((d) => d.category === category);
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
2014
|
-
return
|
|
2013
|
+
function getAddonTypes() {
|
|
2014
|
+
return ADDON_TYPES;
|
|
2015
2015
|
}
|
|
2016
|
-
function
|
|
2017
|
-
return
|
|
2016
|
+
function getAddonType(type) {
|
|
2017
|
+
return ADDON_TYPES.find((k) => k.type === type);
|
|
2018
2018
|
}
|
|
2019
2019
|
|
|
2020
2020
|
// packages/dynamic-form-mcp/src/resources/field-types.resource.ts
|
|
@@ -9861,7 +9861,7 @@ function getTopicList() {
|
|
|
9861
9861
|
const fieldTypes = ["input", "select", "slider", "radio", "checkbox", "textarea", "datepicker", "toggle", "text", "hidden"];
|
|
9862
9862
|
const containers = ["group", "row", "array", "simplified-array", "page"];
|
|
9863
9863
|
const wrappers = ["wrappers", ...getWrappers().map((w) => w.type)];
|
|
9864
|
-
const addons = ["addons", ...
|
|
9864
|
+
const addons = ["addons", ...getAddonTypes().map((k) => k.type)];
|
|
9865
9865
|
const concepts = [
|
|
9866
9866
|
"validation",
|
|
9867
9867
|
"validation-messages",
|
|
@@ -10074,7 +10074,7 @@ const config = {
|
|
|
10074
10074
|
function formatAddonInfo(addon, depth) {
|
|
10075
10075
|
if (depth === "brief") {
|
|
10076
10076
|
return [
|
|
10077
|
-
`# ${addon.
|
|
10077
|
+
`# ${addon.type} addon`,
|
|
10078
10078
|
"",
|
|
10079
10079
|
`${addon.description.split(".")[0]}.`,
|
|
10080
10080
|
"",
|
|
@@ -10085,7 +10085,7 @@ function formatAddonInfo(addon, depth) {
|
|
|
10085
10085
|
].filter(Boolean).join("\n");
|
|
10086
10086
|
}
|
|
10087
10087
|
const lines = [];
|
|
10088
|
-
lines.push(`# ${addon.
|
|
10088
|
+
lines.push(`# ${addon.type} addon`);
|
|
10089
10089
|
lines.push("");
|
|
10090
10090
|
lines.push(`**Category:** ${addon.category}`);
|
|
10091
10091
|
lines.push(`**Package:** \`${addon.package}\``);
|
|
@@ -10113,7 +10113,7 @@ function formatAddonInfo(addon, depth) {
|
|
|
10113
10113
|
return lines.join("\n");
|
|
10114
10114
|
}
|
|
10115
10115
|
function formatAddonsOverview() {
|
|
10116
|
-
const
|
|
10116
|
+
const types = getAddonTypes();
|
|
10117
10117
|
const lines = [];
|
|
10118
10118
|
lines.push("# Addons");
|
|
10119
10119
|
lines.push("");
|
|
@@ -10129,58 +10129,58 @@ function formatAddonsOverview() {
|
|
|
10129
10129
|
type: 'input',
|
|
10130
10130
|
label: 'Search',
|
|
10131
10131
|
addons: [
|
|
10132
|
-
{ slot: 'prefix',
|
|
10133
|
-
{ slot: 'suffix',
|
|
10132
|
+
{ slot: 'prefix', type: 'mat-icon', icon: 'search', ariaLabel: 'Search' },
|
|
10133
|
+
{ slot: 'suffix', type: 'mat-button', icon: 'close', ariaLabel: 'Clear', preset: 'clear' },
|
|
10134
10134
|
],
|
|
10135
10135
|
}`);
|
|
10136
10136
|
lines.push("```");
|
|
10137
10137
|
lines.push("");
|
|
10138
|
-
lines.push("## Registered
|
|
10138
|
+
lines.push("## Registered Types");
|
|
10139
10139
|
lines.push("");
|
|
10140
|
-
const core =
|
|
10141
|
-
const adapter =
|
|
10140
|
+
const core = types.filter((k) => k.category === "core");
|
|
10141
|
+
const adapter = types.filter((k) => k.category === "adapter");
|
|
10142
10142
|
if (core.length > 0) {
|
|
10143
10143
|
lines.push("### Core (universal \u2014 ship from `@ng-forge/dynamic-forms`)");
|
|
10144
10144
|
for (const k of core) {
|
|
10145
10145
|
const json = k.jsonSafe ? "" : " _(code-only)_";
|
|
10146
|
-
lines.push(`- **${k.
|
|
10146
|
+
lines.push(`- **${k.type}**${json} \u2014 ${k.description.split(".")[0]}.`);
|
|
10147
10147
|
}
|
|
10148
10148
|
lines.push("");
|
|
10149
10149
|
}
|
|
10150
10150
|
if (adapter.length > 0) {
|
|
10151
10151
|
lines.push("### Adapter (provided by UI integration packages)");
|
|
10152
10152
|
for (const k of adapter) {
|
|
10153
|
-
lines.push(`- **${k.
|
|
10153
|
+
lines.push(`- **${k.type}** (${k.adapter}, \`${k.package}\`) \u2014 ${k.description.split(".")[0]}.`);
|
|
10154
10154
|
}
|
|
10155
10155
|
lines.push("");
|
|
10156
10156
|
}
|
|
10157
|
-
lines.push('Use `ngforge_lookup topic="<
|
|
10157
|
+
lines.push('Use `ngforge_lookup topic="<type>"` (e.g., `mat-button`, `pi-icon`) for full details on any individual addon type.');
|
|
10158
10158
|
lines.push("");
|
|
10159
10159
|
lines.push("## Click variants (mutually exclusive on button-like addons)");
|
|
10160
10160
|
lines.push("");
|
|
10161
10161
|
lines.push("- `preset`: built-in semantics \u2014 `clear` / `reset` / `paste` / `copy` / `toggle-password-visibility`.");
|
|
10162
|
-
lines.push("- `actionRef`: named handler resolved via `
|
|
10162
|
+
lines.push("- `actionRef`: named handler resolved via `withAddonActions({ ... })`.");
|
|
10163
10163
|
lines.push("- `action`: inline function (code-only, dropped by JSON validator).");
|
|
10164
10164
|
lines.push("");
|
|
10165
10165
|
lines.push("Setting more than one logs a warning and applies the first (precedence: `preset` > `actionRef` > `action`).");
|
|
10166
10166
|
return lines.join("\n");
|
|
10167
10167
|
}
|
|
10168
10168
|
async function resolveTopicContent(resolvedTopic, depth, uiIntegration) {
|
|
10169
|
-
if (resolvedTopic === "addons" || resolvedTopic === "addon" || resolvedTopic === "addon-
|
|
10169
|
+
if (resolvedTopic === "addons" || resolvedTopic === "addon" || resolvedTopic === "addon-types") {
|
|
10170
10170
|
if (depth === "brief") {
|
|
10171
|
-
const
|
|
10171
|
+
const types = getAddonTypes();
|
|
10172
10172
|
return [
|
|
10173
10173
|
"**Addons** render inside a field slot (prefix / suffix / adapter-specific): icons, buttons, inline text, templates, components.",
|
|
10174
10174
|
"",
|
|
10175
|
-
"Registered
|
|
10176
|
-
...
|
|
10175
|
+
"Registered types:",
|
|
10176
|
+
...types.map((k) => `- \`${k.type}\` (${k.category}${k.adapter ? `, ${k.adapter}` : ""})${k.jsonSafe ? "" : " \u2014 code-only"}`),
|
|
10177
10177
|
"",
|
|
10178
|
-
'Use `addons: [{ slot: "suffix",
|
|
10178
|
+
'Use `addons: [{ slot: "suffix", type: "<type>", ... }]` on an addon-supporting field. See `ngforge_lookup topic="addons"` for full docs.'
|
|
10179
10179
|
].join("\n");
|
|
10180
10180
|
}
|
|
10181
10181
|
return formatAddonsOverview();
|
|
10182
10182
|
}
|
|
10183
|
-
const addonInfo =
|
|
10183
|
+
const addonInfo = getAddonType(resolvedTopic);
|
|
10184
10184
|
const collidesWithFieldOrWrapper = resolvedTopic === "text" || !!getWrapper(resolvedTopic);
|
|
10185
10185
|
if (addonInfo && !collidesWithFieldOrWrapper) {
|
|
10186
10186
|
return formatAddonInfo(addonInfo, depth);
|
|
@@ -13826,16 +13826,16 @@ function buildIndex() {
|
|
|
13826
13826
|
toolCall: `ngforge_lookup topic="${wrapper.type}"`
|
|
13827
13827
|
});
|
|
13828
13828
|
}
|
|
13829
|
-
for (const addon of
|
|
13829
|
+
for (const addon of getAddonTypes()) {
|
|
13830
13830
|
const subcategory = addon.adapter ? `Addon (${addon.adapter})` : `Addon (${addon.category})`;
|
|
13831
13831
|
entries.push({
|
|
13832
|
-
id: addon.
|
|
13832
|
+
id: addon.type,
|
|
13833
13833
|
category: "addon",
|
|
13834
13834
|
subcategory,
|
|
13835
13835
|
description: addon.description,
|
|
13836
13836
|
aliases: [],
|
|
13837
|
-
content: `${addon.
|
|
13838
|
-
toolCall: `ngforge_lookup topic="${addon.
|
|
13837
|
+
content: `${addon.type} addon ${addon.description} ${addon.package}`.toLowerCase(),
|
|
13838
|
+
toolCall: `ngforge_lookup topic="${addon.type}"`
|
|
13839
13839
|
});
|
|
13840
13840
|
}
|
|
13841
13841
|
searchIndex = entries;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-forge/dynamic-form-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-rc.2",
|
|
4
4
|
"description": "MCP server for ng-forge dynamic forms - AI-assisted form schema generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"zod": "^3.25.76"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@ng-forge/dynamic-forms": "^0.
|
|
55
|
-
"@ng-forge/dynamic-forms-bootstrap": "^0.
|
|
56
|
-
"@ng-forge/dynamic-forms-ionic": "^0.
|
|
57
|
-
"@ng-forge/dynamic-forms-material": "^0.
|
|
58
|
-
"@ng-forge/dynamic-forms-primeng": "^0.
|
|
54
|
+
"@ng-forge/dynamic-forms": "^1.0.0-rc.2",
|
|
55
|
+
"@ng-forge/dynamic-forms-bootstrap": "^1.0.0-rc.2",
|
|
56
|
+
"@ng-forge/dynamic-forms-ionic": "^1.0.0-rc.2",
|
|
57
|
+
"@ng-forge/dynamic-forms-material": "^1.0.0-rc.2",
|
|
58
|
+
"@ng-forge/dynamic-forms-primeng": "^1.0.0-rc.2",
|
|
59
59
|
"tsx": "^4.19.0"
|
|
60
60
|
}
|
|
61
61
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
7
|
export { createServer, runStdioServer, SERVER_NAME, SERVER_VERSION } from './server.js';
|
|
8
|
-
export type { FieldTypeInfo, ValidatorInfo, UIAdapterInfo, UIAdapterFieldType, PropertyInfo,
|
|
9
|
-
export { getFieldTypes, getFieldType, getFieldTypesByCategory, getValidators, getValidator, getValidatorsByCategory, getUIAdapters, getUIAdapter, getUIAdapterFieldType,
|
|
8
|
+
export type { FieldTypeInfo, ValidatorInfo, UIAdapterInfo, UIAdapterFieldType, PropertyInfo, AddonTypeInfo, FieldAddonSupportInfo, } from './registry/index.js';
|
|
9
|
+
export { getFieldTypes, getFieldType, getFieldTypesByCategory, getValidators, getValidator, getValidatorsByCategory, getUIAdapters, getUIAdapter, getUIAdapterFieldType, getAddonTypes, getAddonType, getAddonTypesByCategory, getFieldAddonSupport, } from './registry/index.js';
|
|
10
10
|
export type { ValidationResult, FormattedValidationError, UiIntegration } from '@ng-forge/dynamic-forms-zod/mcp';
|
|
11
11
|
export { validateFormConfig, isValidFormConfig } from '@ng-forge/dynamic-forms-zod/mcp';
|
|
12
12
|
export { getFormConfigJsonSchema, getLeafFieldJsonSchema } from '@ng-forge/dynamic-forms-zod/mcp';
|
package/src/index.js
CHANGED
|
@@ -1130,7 +1130,7 @@ var UI_ADAPTERS = [
|
|
|
1130
1130
|
fieldTypes: [
|
|
1131
1131
|
{
|
|
1132
1132
|
type: "input",
|
|
1133
|
-
componentName: "
|
|
1133
|
+
componentName: "BsInputFieldComponent",
|
|
1134
1134
|
additionalProps: {
|
|
1135
1135
|
size: {
|
|
1136
1136
|
name: "size",
|
|
@@ -1149,7 +1149,7 @@ var UI_ADAPTERS = [
|
|
|
1149
1149
|
},
|
|
1150
1150
|
{
|
|
1151
1151
|
type: "select",
|
|
1152
|
-
componentName: "
|
|
1152
|
+
componentName: "BsSelectFieldComponent",
|
|
1153
1153
|
additionalProps: {
|
|
1154
1154
|
size: {
|
|
1155
1155
|
name: "size",
|
|
@@ -1168,7 +1168,7 @@ var UI_ADAPTERS = [
|
|
|
1168
1168
|
fieldTypes: [
|
|
1169
1169
|
{
|
|
1170
1170
|
type: "input",
|
|
1171
|
-
componentName: "
|
|
1171
|
+
componentName: "PrimeInputFieldComponent",
|
|
1172
1172
|
additionalProps: {
|
|
1173
1173
|
variant: {
|
|
1174
1174
|
name: "variant",
|
|
@@ -1181,7 +1181,7 @@ var UI_ADAPTERS = [
|
|
|
1181
1181
|
},
|
|
1182
1182
|
{
|
|
1183
1183
|
type: "select",
|
|
1184
|
-
componentName: "
|
|
1184
|
+
componentName: "PrimeSelectFieldComponent",
|
|
1185
1185
|
additionalProps: {
|
|
1186
1186
|
filter: {
|
|
1187
1187
|
name: "filter",
|
|
@@ -1201,7 +1201,7 @@ var UI_ADAPTERS = [
|
|
|
1201
1201
|
},
|
|
1202
1202
|
{
|
|
1203
1203
|
type: "datepicker",
|
|
1204
|
-
componentName: "
|
|
1204
|
+
componentName: "PrimeDatepickerFieldComponent",
|
|
1205
1205
|
additionalProps: {
|
|
1206
1206
|
showIcon: {
|
|
1207
1207
|
name: "showIcon",
|
|
@@ -1228,7 +1228,7 @@ var UI_ADAPTERS = [
|
|
|
1228
1228
|
fieldTypes: [
|
|
1229
1229
|
{
|
|
1230
1230
|
type: "input",
|
|
1231
|
-
componentName: "
|
|
1231
|
+
componentName: "IonicInputFieldComponent",
|
|
1232
1232
|
additionalProps: {
|
|
1233
1233
|
fill: {
|
|
1234
1234
|
name: "fill",
|
|
@@ -1248,7 +1248,7 @@ var UI_ADAPTERS = [
|
|
|
1248
1248
|
},
|
|
1249
1249
|
{
|
|
1250
1250
|
type: "select",
|
|
1251
|
-
componentName: "
|
|
1251
|
+
componentName: "IonicSelectFieldComponent",
|
|
1252
1252
|
additionalProps: {
|
|
1253
1253
|
interface: {
|
|
1254
1254
|
name: "interface",
|
|
@@ -1261,7 +1261,7 @@ var UI_ADAPTERS = [
|
|
|
1261
1261
|
},
|
|
1262
1262
|
{
|
|
1263
1263
|
type: "toggle",
|
|
1264
|
-
componentName: "
|
|
1264
|
+
componentName: "IonicToggleFieldComponent",
|
|
1265
1265
|
additionalProps: {
|
|
1266
1266
|
enableOnOffLabels: {
|
|
1267
1267
|
name: "enableOnOffLabels",
|
|
@@ -1575,14 +1575,14 @@ var UNIVERSAL_BASE_PROPS = {
|
|
|
1575
1575
|
disabled: {
|
|
1576
1576
|
name: "disabled",
|
|
1577
1577
|
type: "boolean | Signal<boolean> | Observable<boolean>",
|
|
1578
|
-
description: "Reactive disabled state \u2014 primarily relevant for interactive
|
|
1578
|
+
description: "Reactive disabled state \u2014 primarily relevant for interactive types.",
|
|
1579
1579
|
required: false
|
|
1580
1580
|
}
|
|
1581
1581
|
};
|
|
1582
|
-
var
|
|
1583
|
-
// ─── Core-shipped universal
|
|
1582
|
+
var ADDON_TYPES = [
|
|
1583
|
+
// ─── Core-shipped universal types ────────────────────────────────────────
|
|
1584
1584
|
{
|
|
1585
|
-
|
|
1585
|
+
type: "text",
|
|
1586
1586
|
category: "core",
|
|
1587
1587
|
package: "@ng-forge/dynamic-forms",
|
|
1588
1588
|
adapter: null,
|
|
@@ -1597,11 +1597,11 @@ var ADDON_KINDS = [
|
|
|
1597
1597
|
required: true
|
|
1598
1598
|
}
|
|
1599
1599
|
},
|
|
1600
|
-
example: `{ slot: 'prefix',
|
|
1601
|
-
minimalExample: `{ slot: 'prefix',
|
|
1600
|
+
example: `{ slot: 'prefix', type: 'text', text: '$' }`,
|
|
1601
|
+
minimalExample: `{ slot: 'prefix', type: 'text', text: '$' }`
|
|
1602
1602
|
},
|
|
1603
1603
|
{
|
|
1604
|
-
|
|
1604
|
+
type: "template",
|
|
1605
1605
|
category: "core",
|
|
1606
1606
|
package: "@ng-forge/dynamic-forms",
|
|
1607
1607
|
adapter: null,
|
|
@@ -1616,15 +1616,15 @@ var ADDON_KINDS = [
|
|
|
1616
1616
|
required: true
|
|
1617
1617
|
}
|
|
1618
1618
|
},
|
|
1619
|
-
example: `{ slot: 'suffix',
|
|
1620
|
-
minimalExample: `{ slot: 'suffix',
|
|
1619
|
+
example: `{ slot: 'suffix', type: 'template', templateKey: 'searchIcon' }`,
|
|
1620
|
+
minimalExample: `{ slot: 'suffix', type: 'template', templateKey: 'mySlot' }`
|
|
1621
1621
|
},
|
|
1622
1622
|
{
|
|
1623
|
-
|
|
1623
|
+
type: "component",
|
|
1624
1624
|
category: "core",
|
|
1625
1625
|
package: "@ng-forge/dynamic-forms",
|
|
1626
1626
|
adapter: null,
|
|
1627
|
-
description: "Renders an arbitrary Angular component. The `component` loader is a function; this
|
|
1627
|
+
description: "Renders an arbitrary Angular component. The `component` loader is a function; this type is dropped from JSON-derived configs by the validator.",
|
|
1628
1628
|
jsonSafe: false,
|
|
1629
1629
|
props: {
|
|
1630
1630
|
...UNIVERSAL_BASE_PROPS,
|
|
@@ -1643,15 +1643,15 @@ var ADDON_KINDS = [
|
|
|
1643
1643
|
},
|
|
1644
1644
|
example: `{
|
|
1645
1645
|
slot: 'prefix',
|
|
1646
|
-
|
|
1646
|
+
type: 'component',
|
|
1647
1647
|
component: () => import('./my-component').then(m => m.MyComponent),
|
|
1648
1648
|
inputs: { foo: 'bar' },
|
|
1649
1649
|
}`,
|
|
1650
|
-
minimalExample: `{ slot: 'prefix',
|
|
1650
|
+
minimalExample: `{ slot: 'prefix', type: 'component', component: () => import('./x') }`
|
|
1651
1651
|
},
|
|
1652
|
-
// ─── PrimeNG-shipped
|
|
1652
|
+
// ─── PrimeNG-shipped types ───────────────────────────────────────────────
|
|
1653
1653
|
{
|
|
1654
|
-
|
|
1654
|
+
type: "prime-icon",
|
|
1655
1655
|
category: "adapter",
|
|
1656
1656
|
package: "@ng-forge/dynamic-forms-primeng",
|
|
1657
1657
|
adapter: "primeng",
|
|
@@ -1672,11 +1672,11 @@ var ADDON_KINDS = [
|
|
|
1672
1672
|
required: false
|
|
1673
1673
|
}
|
|
1674
1674
|
},
|
|
1675
|
-
example: `{ slot: 'prefix',
|
|
1676
|
-
minimalExample: `{ slot: 'prefix',
|
|
1675
|
+
example: `{ slot: 'prefix', type: 'prime-icon', icon: 'search', ariaLabel: 'Search' }`,
|
|
1676
|
+
minimalExample: `{ slot: 'prefix', type: 'prime-icon', icon: 'search' }`
|
|
1677
1677
|
},
|
|
1678
1678
|
{
|
|
1679
|
-
|
|
1679
|
+
type: "prime-button",
|
|
1680
1680
|
category: "adapter",
|
|
1681
1681
|
package: "@ng-forge/dynamic-forms-primeng",
|
|
1682
1682
|
adapter: "primeng",
|
|
@@ -1713,7 +1713,7 @@ var ADDON_KINDS = [
|
|
|
1713
1713
|
actionRef: {
|
|
1714
1714
|
name: "actionRef",
|
|
1715
1715
|
type: "string",
|
|
1716
|
-
description: "Typed string handle to a handler registered via `
|
|
1716
|
+
description: "Typed string handle to a handler registered via `withAddonActions(...)`. Mutually exclusive with `preset` and `action`. JSON-safe.",
|
|
1717
1717
|
required: false
|
|
1718
1718
|
},
|
|
1719
1719
|
action: {
|
|
@@ -1723,12 +1723,12 @@ var ADDON_KINDS = [
|
|
|
1723
1723
|
required: false
|
|
1724
1724
|
}
|
|
1725
1725
|
},
|
|
1726
|
-
example: `{ slot: 'suffix',
|
|
1727
|
-
minimalExample: `{ slot: 'suffix',
|
|
1726
|
+
example: `{ slot: 'suffix', type: 'prime-button', icon: 'times', ariaLabel: 'Clear', preset: 'clear' }`,
|
|
1727
|
+
minimalExample: `{ slot: 'suffix', type: 'prime-button', icon: 'times', ariaLabel: 'Clear', preset: 'clear' }`
|
|
1728
1728
|
},
|
|
1729
|
-
// ─── Material-shipped
|
|
1729
|
+
// ─── Material-shipped types ──────────────────────────────────────────────
|
|
1730
1730
|
{
|
|
1731
|
-
|
|
1731
|
+
type: "mat-icon",
|
|
1732
1732
|
category: "adapter",
|
|
1733
1733
|
package: "@ng-forge/dynamic-forms-material",
|
|
1734
1734
|
adapter: "material",
|
|
@@ -1749,11 +1749,11 @@ var ADDON_KINDS = [
|
|
|
1749
1749
|
required: false
|
|
1750
1750
|
}
|
|
1751
1751
|
},
|
|
1752
|
-
example: `{ slot: 'prefix',
|
|
1753
|
-
minimalExample: `{ slot: 'prefix',
|
|
1752
|
+
example: `{ slot: 'prefix', type: 'mat-icon', icon: 'search', ariaLabel: 'Search' }`,
|
|
1753
|
+
minimalExample: `{ slot: 'prefix', type: 'mat-icon', icon: 'search' }`
|
|
1754
1754
|
},
|
|
1755
1755
|
{
|
|
1756
|
-
|
|
1756
|
+
type: "mat-button",
|
|
1757
1757
|
category: "adapter",
|
|
1758
1758
|
package: "@ng-forge/dynamic-forms-material",
|
|
1759
1759
|
adapter: "material",
|
|
@@ -1790,7 +1790,7 @@ var ADDON_KINDS = [
|
|
|
1790
1790
|
actionRef: {
|
|
1791
1791
|
name: "actionRef",
|
|
1792
1792
|
type: "string",
|
|
1793
|
-
description: "Typed handle to a handler registered via `
|
|
1793
|
+
description: "Typed handle to a handler registered via `withAddonActions(...)`. JSON-safe.",
|
|
1794
1794
|
required: false
|
|
1795
1795
|
},
|
|
1796
1796
|
action: {
|
|
@@ -1800,12 +1800,12 @@ var ADDON_KINDS = [
|
|
|
1800
1800
|
required: false
|
|
1801
1801
|
}
|
|
1802
1802
|
},
|
|
1803
|
-
example: `{ slot: 'suffix',
|
|
1804
|
-
minimalExample: `{ slot: 'suffix',
|
|
1803
|
+
example: `{ slot: 'suffix', type: 'mat-button', icon: 'close', ariaLabel: 'Clear', preset: 'clear' }`,
|
|
1804
|
+
minimalExample: `{ slot: 'suffix', type: 'mat-button', icon: 'close', ariaLabel: 'Clear', preset: 'clear' }`
|
|
1805
1805
|
},
|
|
1806
|
-
// ─── Bootstrap-shipped
|
|
1806
|
+
// ─── Bootstrap-shipped types ─────────────────────────────────────────────
|
|
1807
1807
|
{
|
|
1808
|
-
|
|
1808
|
+
type: "bs-icon",
|
|
1809
1809
|
category: "adapter",
|
|
1810
1810
|
package: "@ng-forge/dynamic-forms-bootstrap",
|
|
1811
1811
|
adapter: "bootstrap",
|
|
@@ -1826,11 +1826,11 @@ var ADDON_KINDS = [
|
|
|
1826
1826
|
required: false
|
|
1827
1827
|
}
|
|
1828
1828
|
},
|
|
1829
|
-
example: `{ slot: 'prefix',
|
|
1830
|
-
minimalExample: `{ slot: 'prefix',
|
|
1829
|
+
example: `{ slot: 'prefix', type: 'bs-icon', icon: 'search', ariaLabel: 'Search' }`,
|
|
1830
|
+
minimalExample: `{ slot: 'prefix', type: 'bs-icon', icon: 'search' }`
|
|
1831
1831
|
},
|
|
1832
1832
|
{
|
|
1833
|
-
|
|
1833
|
+
type: "bs-button",
|
|
1834
1834
|
category: "adapter",
|
|
1835
1835
|
package: "@ng-forge/dynamic-forms-bootstrap",
|
|
1836
1836
|
adapter: "bootstrap",
|
|
@@ -1867,7 +1867,7 @@ var ADDON_KINDS = [
|
|
|
1867
1867
|
actionRef: {
|
|
1868
1868
|
name: "actionRef",
|
|
1869
1869
|
type: "string",
|
|
1870
|
-
description: "Typed handle to a handler registered via `
|
|
1870
|
+
description: "Typed handle to a handler registered via `withAddonActions(...)`. JSON-safe.",
|
|
1871
1871
|
required: false
|
|
1872
1872
|
},
|
|
1873
1873
|
action: {
|
|
@@ -1877,12 +1877,12 @@ var ADDON_KINDS = [
|
|
|
1877
1877
|
required: false
|
|
1878
1878
|
}
|
|
1879
1879
|
},
|
|
1880
|
-
example: `{ slot: 'suffix',
|
|
1881
|
-
minimalExample: `{ slot: 'suffix',
|
|
1880
|
+
example: `{ slot: 'suffix', type: 'bs-button', icon: 'x', ariaLabel: 'Clear', preset: 'clear' }`,
|
|
1881
|
+
minimalExample: `{ slot: 'suffix', type: 'bs-button', icon: 'x', ariaLabel: 'Clear', preset: 'clear' }`
|
|
1882
1882
|
},
|
|
1883
|
-
// ─── Ionic-shipped
|
|
1883
|
+
// ─── Ionic-shipped types ─────────────────────────────────────────────────
|
|
1884
1884
|
{
|
|
1885
|
-
|
|
1885
|
+
type: "ion-icon",
|
|
1886
1886
|
category: "adapter",
|
|
1887
1887
|
package: "@ng-forge/dynamic-forms-ionic",
|
|
1888
1888
|
adapter: "ionic",
|
|
@@ -1903,11 +1903,11 @@ var ADDON_KINDS = [
|
|
|
1903
1903
|
required: false
|
|
1904
1904
|
}
|
|
1905
1905
|
},
|
|
1906
|
-
example: `{ slot: 'prefix',
|
|
1907
|
-
minimalExample: `{ slot: 'prefix',
|
|
1906
|
+
example: `{ slot: 'prefix', type: 'ion-icon', icon: 'search-outline', ariaLabel: 'Search' }`,
|
|
1907
|
+
minimalExample: `{ slot: 'prefix', type: 'ion-icon', icon: 'search-outline' }`
|
|
1908
1908
|
},
|
|
1909
1909
|
{
|
|
1910
|
-
|
|
1910
|
+
type: "ion-button",
|
|
1911
1911
|
category: "adapter",
|
|
1912
1912
|
package: "@ng-forge/dynamic-forms-ionic",
|
|
1913
1913
|
adapter: "ionic",
|
|
@@ -1950,7 +1950,7 @@ var ADDON_KINDS = [
|
|
|
1950
1950
|
actionRef: {
|
|
1951
1951
|
name: "actionRef",
|
|
1952
1952
|
type: "string",
|
|
1953
|
-
description: "Typed handle to a handler registered via `
|
|
1953
|
+
description: "Typed handle to a handler registered via `withAddonActions(...)`. JSON-safe.",
|
|
1954
1954
|
required: false
|
|
1955
1955
|
},
|
|
1956
1956
|
action: {
|
|
@@ -1960,8 +1960,8 @@ var ADDON_KINDS = [
|
|
|
1960
1960
|
required: false
|
|
1961
1961
|
}
|
|
1962
1962
|
},
|
|
1963
|
-
example: `{ slot: 'suffix',
|
|
1964
|
-
minimalExample: `{ slot: 'suffix',
|
|
1963
|
+
example: `{ slot: 'suffix', type: 'ion-button', icon: 'close-outline', ariaLabel: 'Clear', preset: 'clear' }`,
|
|
1964
|
+
minimalExample: `{ slot: 'suffix', type: 'ion-button', icon: 'close-outline', ariaLabel: 'Clear', preset: 'clear' }`
|
|
1965
1965
|
}
|
|
1966
1966
|
];
|
|
1967
1967
|
var FIELD_ADDON_SUPPORT = [
|
|
@@ -2034,14 +2034,14 @@ function getDocPage(id) {
|
|
|
2034
2034
|
function getDocPagesByCategory(category) {
|
|
2035
2035
|
return DOCUMENTATION.filter((d) => d.category === category);
|
|
2036
2036
|
}
|
|
2037
|
-
function
|
|
2038
|
-
return
|
|
2037
|
+
function getAddonTypes() {
|
|
2038
|
+
return ADDON_TYPES;
|
|
2039
2039
|
}
|
|
2040
|
-
function
|
|
2041
|
-
return
|
|
2040
|
+
function getAddonType(type) {
|
|
2041
|
+
return ADDON_TYPES.find((k) => k.type === type);
|
|
2042
2042
|
}
|
|
2043
|
-
function
|
|
2044
|
-
return
|
|
2043
|
+
function getAddonTypesByCategory(category) {
|
|
2044
|
+
return ADDON_TYPES.filter((k) => k.category === category);
|
|
2045
2045
|
}
|
|
2046
2046
|
function getFieldAddonSupport() {
|
|
2047
2047
|
return FIELD_ADDON_SUPPORT;
|
|
@@ -9938,7 +9938,7 @@ function getTopicList() {
|
|
|
9938
9938
|
const fieldTypes = ["input", "select", "slider", "radio", "checkbox", "textarea", "datepicker", "toggle", "text", "hidden"];
|
|
9939
9939
|
const containers = ["group", "row", "array", "simplified-array", "page"];
|
|
9940
9940
|
const wrappers = ["wrappers", ...getWrappers().map((w) => w.type)];
|
|
9941
|
-
const addons = ["addons", ...
|
|
9941
|
+
const addons = ["addons", ...getAddonTypes().map((k) => k.type)];
|
|
9942
9942
|
const concepts = [
|
|
9943
9943
|
"validation",
|
|
9944
9944
|
"validation-messages",
|
|
@@ -10151,7 +10151,7 @@ const config = {
|
|
|
10151
10151
|
function formatAddonInfo(addon, depth) {
|
|
10152
10152
|
if (depth === "brief") {
|
|
10153
10153
|
return [
|
|
10154
|
-
`# ${addon.
|
|
10154
|
+
`# ${addon.type} addon`,
|
|
10155
10155
|
"",
|
|
10156
10156
|
`${addon.description.split(".")[0]}.`,
|
|
10157
10157
|
"",
|
|
@@ -10162,7 +10162,7 @@ function formatAddonInfo(addon, depth) {
|
|
|
10162
10162
|
].filter(Boolean).join("\n");
|
|
10163
10163
|
}
|
|
10164
10164
|
const lines = [];
|
|
10165
|
-
lines.push(`# ${addon.
|
|
10165
|
+
lines.push(`# ${addon.type} addon`);
|
|
10166
10166
|
lines.push("");
|
|
10167
10167
|
lines.push(`**Category:** ${addon.category}`);
|
|
10168
10168
|
lines.push(`**Package:** \`${addon.package}\``);
|
|
@@ -10190,7 +10190,7 @@ function formatAddonInfo(addon, depth) {
|
|
|
10190
10190
|
return lines.join("\n");
|
|
10191
10191
|
}
|
|
10192
10192
|
function formatAddonsOverview() {
|
|
10193
|
-
const
|
|
10193
|
+
const types = getAddonTypes();
|
|
10194
10194
|
const lines = [];
|
|
10195
10195
|
lines.push("# Addons");
|
|
10196
10196
|
lines.push("");
|
|
@@ -10206,58 +10206,58 @@ function formatAddonsOverview() {
|
|
|
10206
10206
|
type: 'input',
|
|
10207
10207
|
label: 'Search',
|
|
10208
10208
|
addons: [
|
|
10209
|
-
{ slot: 'prefix',
|
|
10210
|
-
{ slot: 'suffix',
|
|
10209
|
+
{ slot: 'prefix', type: 'mat-icon', icon: 'search', ariaLabel: 'Search' },
|
|
10210
|
+
{ slot: 'suffix', type: 'mat-button', icon: 'close', ariaLabel: 'Clear', preset: 'clear' },
|
|
10211
10211
|
],
|
|
10212
10212
|
}`);
|
|
10213
10213
|
lines.push("```");
|
|
10214
10214
|
lines.push("");
|
|
10215
|
-
lines.push("## Registered
|
|
10215
|
+
lines.push("## Registered Types");
|
|
10216
10216
|
lines.push("");
|
|
10217
|
-
const core =
|
|
10218
|
-
const adapter =
|
|
10217
|
+
const core = types.filter((k) => k.category === "core");
|
|
10218
|
+
const adapter = types.filter((k) => k.category === "adapter");
|
|
10219
10219
|
if (core.length > 0) {
|
|
10220
10220
|
lines.push("### Core (universal \u2014 ship from `@ng-forge/dynamic-forms`)");
|
|
10221
10221
|
for (const k of core) {
|
|
10222
10222
|
const json = k.jsonSafe ? "" : " _(code-only)_";
|
|
10223
|
-
lines.push(`- **${k.
|
|
10223
|
+
lines.push(`- **${k.type}**${json} \u2014 ${k.description.split(".")[0]}.`);
|
|
10224
10224
|
}
|
|
10225
10225
|
lines.push("");
|
|
10226
10226
|
}
|
|
10227
10227
|
if (adapter.length > 0) {
|
|
10228
10228
|
lines.push("### Adapter (provided by UI integration packages)");
|
|
10229
10229
|
for (const k of adapter) {
|
|
10230
|
-
lines.push(`- **${k.
|
|
10230
|
+
lines.push(`- **${k.type}** (${k.adapter}, \`${k.package}\`) \u2014 ${k.description.split(".")[0]}.`);
|
|
10231
10231
|
}
|
|
10232
10232
|
lines.push("");
|
|
10233
10233
|
}
|
|
10234
|
-
lines.push('Use `ngforge_lookup topic="<
|
|
10234
|
+
lines.push('Use `ngforge_lookup topic="<type>"` (e.g., `mat-button`, `pi-icon`) for full details on any individual addon type.');
|
|
10235
10235
|
lines.push("");
|
|
10236
10236
|
lines.push("## Click variants (mutually exclusive on button-like addons)");
|
|
10237
10237
|
lines.push("");
|
|
10238
10238
|
lines.push("- `preset`: built-in semantics \u2014 `clear` / `reset` / `paste` / `copy` / `toggle-password-visibility`.");
|
|
10239
|
-
lines.push("- `actionRef`: named handler resolved via `
|
|
10239
|
+
lines.push("- `actionRef`: named handler resolved via `withAddonActions({ ... })`.");
|
|
10240
10240
|
lines.push("- `action`: inline function (code-only, dropped by JSON validator).");
|
|
10241
10241
|
lines.push("");
|
|
10242
10242
|
lines.push("Setting more than one logs a warning and applies the first (precedence: `preset` > `actionRef` > `action`).");
|
|
10243
10243
|
return lines.join("\n");
|
|
10244
10244
|
}
|
|
10245
10245
|
async function resolveTopicContent(resolvedTopic, depth, uiIntegration) {
|
|
10246
|
-
if (resolvedTopic === "addons" || resolvedTopic === "addon" || resolvedTopic === "addon-
|
|
10246
|
+
if (resolvedTopic === "addons" || resolvedTopic === "addon" || resolvedTopic === "addon-types") {
|
|
10247
10247
|
if (depth === "brief") {
|
|
10248
|
-
const
|
|
10248
|
+
const types = getAddonTypes();
|
|
10249
10249
|
return [
|
|
10250
10250
|
"**Addons** render inside a field slot (prefix / suffix / adapter-specific): icons, buttons, inline text, templates, components.",
|
|
10251
10251
|
"",
|
|
10252
|
-
"Registered
|
|
10253
|
-
...
|
|
10252
|
+
"Registered types:",
|
|
10253
|
+
...types.map((k) => `- \`${k.type}\` (${k.category}${k.adapter ? `, ${k.adapter}` : ""})${k.jsonSafe ? "" : " \u2014 code-only"}`),
|
|
10254
10254
|
"",
|
|
10255
|
-
'Use `addons: [{ slot: "suffix",
|
|
10255
|
+
'Use `addons: [{ slot: "suffix", type: "<type>", ... }]` on an addon-supporting field. See `ngforge_lookup topic="addons"` for full docs.'
|
|
10256
10256
|
].join("\n");
|
|
10257
10257
|
}
|
|
10258
10258
|
return formatAddonsOverview();
|
|
10259
10259
|
}
|
|
10260
|
-
const addonInfo =
|
|
10260
|
+
const addonInfo = getAddonType(resolvedTopic);
|
|
10261
10261
|
const collidesWithFieldOrWrapper = resolvedTopic === "text" || !!getWrapper(resolvedTopic);
|
|
10262
10262
|
if (addonInfo && !collidesWithFieldOrWrapper) {
|
|
10263
10263
|
return formatAddonInfo(addonInfo, depth);
|
|
@@ -13903,16 +13903,16 @@ function buildIndex() {
|
|
|
13903
13903
|
toolCall: `ngforge_lookup topic="${wrapper.type}"`
|
|
13904
13904
|
});
|
|
13905
13905
|
}
|
|
13906
|
-
for (const addon of
|
|
13906
|
+
for (const addon of getAddonTypes()) {
|
|
13907
13907
|
const subcategory = addon.adapter ? `Addon (${addon.adapter})` : `Addon (${addon.category})`;
|
|
13908
13908
|
entries.push({
|
|
13909
|
-
id: addon.
|
|
13909
|
+
id: addon.type,
|
|
13910
13910
|
category: "addon",
|
|
13911
13911
|
subcategory,
|
|
13912
13912
|
description: addon.description,
|
|
13913
13913
|
aliases: [],
|
|
13914
|
-
content: `${addon.
|
|
13915
|
-
toolCall: `ngforge_lookup topic="${addon.
|
|
13914
|
+
content: `${addon.type} addon ${addon.description} ${addon.package}`.toLowerCase(),
|
|
13915
|
+
toolCall: `ngforge_lookup topic="${addon.type}"`
|
|
13916
13916
|
});
|
|
13917
13917
|
}
|
|
13918
13918
|
searchIndex = entries;
|
|
@@ -14039,9 +14039,9 @@ export {
|
|
|
14039
14039
|
SERVER_NAME,
|
|
14040
14040
|
SERVER_VERSION,
|
|
14041
14041
|
createServer,
|
|
14042
|
-
|
|
14043
|
-
|
|
14044
|
-
|
|
14042
|
+
getAddonType,
|
|
14043
|
+
getAddonTypes,
|
|
14044
|
+
getAddonTypesByCategory,
|
|
14045
14045
|
getFieldAddonSupport,
|
|
14046
14046
|
getFieldType,
|
|
14047
14047
|
getFieldTypes,
|
package/src/registry/addons.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
/** Addon Registry Data */
|
|
2
2
|
import type { PropertyInfo } from './index.js';
|
|
3
|
-
export interface
|
|
4
|
-
/** Discriminant matching `addon.
|
|
5
|
-
|
|
3
|
+
export interface AddonTypeInfo {
|
|
4
|
+
/** Discriminant matching `addon.type` in form configs. */
|
|
5
|
+
type: string;
|
|
6
6
|
/** Source category — core ships from the library, adapter from a UI-integration package. */
|
|
7
7
|
category: 'core' | 'adapter';
|
|
8
8
|
/** Provider package; `'core'` means @ng-forge/dynamic-forms. */
|
|
9
9
|
package: string;
|
|
10
|
-
/** Adapter that ships this
|
|
10
|
+
/** Adapter that ships this type, or `null` for core types. */
|
|
11
11
|
adapter: 'material' | 'primeng' | 'bootstrap' | 'ionic' | null;
|
|
12
|
-
/** One-line description of what this
|
|
12
|
+
/** One-line description of what this type renders. */
|
|
13
13
|
description: string;
|
|
14
14
|
/**
|
|
15
|
-
* Whether the
|
|
16
|
-
* be referenced from server-driven configs; code-only
|
|
15
|
+
* Whether the type survives `JSON.stringify`/`parse`. JSON-safe types may
|
|
16
|
+
* be referenced from server-driven configs; code-only types are dropped by
|
|
17
17
|
* the lenient validator when the config came from JSON.
|
|
18
18
|
*/
|
|
19
19
|
jsonSafe: boolean;
|
|
20
|
-
/** Per-
|
|
20
|
+
/** Per-type config props (excludes universal `slot`, `className`, `hidden`, `disabled`). */
|
|
21
21
|
props: Record<string, PropertyInfo>;
|
|
22
22
|
/** Full inline example for documentation. */
|
|
23
23
|
example: string;
|
|
24
24
|
/** Minimal valid config (just required props). */
|
|
25
25
|
minimalExample: string;
|
|
26
26
|
}
|
|
27
|
-
export declare const
|
|
27
|
+
export declare const ADDON_TYPES: AddonTypeInfo[];
|
|
28
28
|
/**
|
|
29
|
-
* Per-field-type addon support metadata. Records which slots and
|
|
29
|
+
* Per-field-type addon support metadata. Records which slots and types a
|
|
30
30
|
* field type accepts at runtime — feeds the validator's allowed-list checks.
|
|
31
31
|
*/
|
|
32
32
|
export interface FieldAddonSupportInfo {
|
|
@@ -36,8 +36,8 @@ export interface FieldAddonSupportInfo {
|
|
|
36
36
|
adapter: 'material' | 'primeng' | 'bootstrap' | 'ionic' | null;
|
|
37
37
|
/** Slots this field accepts. */
|
|
38
38
|
slots: ('prefix' | 'suffix' | string)[];
|
|
39
|
-
/** Whitelist of allowed
|
|
40
|
-
|
|
39
|
+
/** Whitelist of allowed types (omitted = any registered type). */
|
|
40
|
+
allowedTypes?: string[];
|
|
41
41
|
}
|
|
42
42
|
export declare const FIELD_ADDON_SUPPORT: FieldAddonSupportInfo[];
|
|
43
43
|
//# sourceMappingURL=addons.d.ts.map
|
package/src/registry/index.d.ts
CHANGED
|
@@ -106,14 +106,14 @@ export declare function getDocPages(): DocPage[];
|
|
|
106
106
|
export declare function getDocPage(id: string): DocPage | undefined;
|
|
107
107
|
/** Get documentation pages by category */
|
|
108
108
|
export declare function getDocPagesByCategory(category: string): DocPage[];
|
|
109
|
-
import {
|
|
110
|
-
export type {
|
|
111
|
-
/** Get every registered addon
|
|
112
|
-
export declare function
|
|
113
|
-
/** Look up a single addon
|
|
114
|
-
export declare function
|
|
115
|
-
/** Filter addon
|
|
116
|
-
export declare function
|
|
109
|
+
import { AddonTypeInfo, FieldAddonSupportInfo } from './addons.js';
|
|
110
|
+
export type { AddonTypeInfo, FieldAddonSupportInfo };
|
|
111
|
+
/** Get every registered addon type. */
|
|
112
|
+
export declare function getAddonTypes(): AddonTypeInfo[];
|
|
113
|
+
/** Look up a single addon type by its discriminant. */
|
|
114
|
+
export declare function getAddonType(type: string): AddonTypeInfo | undefined;
|
|
115
|
+
/** Filter addon types by source (`'core'` / `'adapter'`). */
|
|
116
|
+
export declare function getAddonTypesByCategory(category: 'core' | 'adapter'): AddonTypeInfo[];
|
|
117
117
|
/** Get the per-field-type addon support map. */
|
|
118
118
|
export declare function getFieldAddonSupport(): FieldAddonSupportInfo[];
|
|
119
119
|
/** Look up addon support for a specific field type. */
|