@ng-forge/dynamic-form-mcp 1.1.0-next.3 → 1.1.0-next.4

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.
@@ -8933,7 +8933,36 @@ validators: [{
8933
8933
  }]
8934
8934
  \`\`\`
8935
8935
 
8936
- **Built-in Kinds:** required, email, min, max, minlength, maxlength, pattern`
8936
+ **Built-in Kinds:** required, email, min, max, minlength, maxlength, pattern
8937
+
8938
+ ## Template parameters
8939
+
8940
+ String messages interpolate error params with \`{{param}}\`:
8941
+
8942
+ \`\`\`typescript
8943
+ validationMessages: {
8944
+ minLength: 'Must be at least {{requiredLength}} characters',
8945
+ min: 'Must be at least {{min}}',
8946
+ max: 'Must be at most {{max}}',
8947
+ pattern: 'Does not match {{requiredPattern}}',
8948
+ }
8949
+ \`\`\`
8950
+
8951
+ ## Error-aware message functions (TypeScript configs only)
8952
+
8953
+ Any \`validationMessages\` or \`defaultValidationMessages\` value can be a function \`(error: ValidationError) => DynamicText\` instead of a string. The function receives the validation error (its \`kind\` plus params such as \`maxLength\`), so an i18n layer gets the interpolation params natively:
8954
+
8955
+ \`\`\`typescript
8956
+ validationMessages: {
8957
+ maxLength: (error) => transloco.selectTranslate('validation.maxLength', {
8958
+ requiredLength: 'maxLength' in error ? error.maxLength : undefined,
8959
+ }),
8960
+ }
8961
+ \`\`\`
8962
+
8963
+ A resolver may return static text, an \`Observable\`, or a \`Signal\`, and those stay reactive. Returning a plain string after synchronously reading a signal severs reactivity \u2014 return the \`Signal\`/\`Observable\` itself instead.
8964
+
8965
+ **\u26A0\uFE0F Not JSON-serializable.** Function messages only work in TypeScript-authored configs. JSON-driven configs (and MCP-generated output) MUST use string templates with \`{{param}}\` interpolation.`
8937
8966
  },
8938
8967
  buttons: {
8939
8968
  brief: `**submit:** \`{ type: 'submit', key: 'submit', label: 'Submit' }\`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-forge/dynamic-form-mcp",
3
- "version": "1.1.0-next.3",
3
+ "version": "1.1.0-next.4",
4
4
  "description": "MCP server for ng-forge dynamic forms - AI-assisted form schema generation",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -54,11 +54,11 @@
54
54
  "zod-to-json-schema": "^3.23.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@ng-forge/dynamic-forms": "^1.1.0-next.3",
58
- "@ng-forge/dynamic-forms-bootstrap": "^1.1.0-next.3",
59
- "@ng-forge/dynamic-forms-ionic": "^1.1.0-next.3",
60
- "@ng-forge/dynamic-forms-material": "^1.1.0-next.3",
61
- "@ng-forge/dynamic-forms-primeng": "^1.1.0-next.3",
57
+ "@ng-forge/dynamic-forms": "^1.1.0-next.4",
58
+ "@ng-forge/dynamic-forms-bootstrap": "^1.1.0-next.4",
59
+ "@ng-forge/dynamic-forms-ionic": "^1.1.0-next.4",
60
+ "@ng-forge/dynamic-forms-material": "^1.1.0-next.4",
61
+ "@ng-forge/dynamic-forms-primeng": "^1.1.0-next.4",
62
62
  "tsx": "^4.19.0"
63
63
  }
64
64
  }
package/src/index.js CHANGED
@@ -9010,7 +9010,36 @@ validators: [{
9010
9010
  }]
9011
9011
  \`\`\`
9012
9012
 
9013
- **Built-in Kinds:** required, email, min, max, minlength, maxlength, pattern`
9013
+ **Built-in Kinds:** required, email, min, max, minlength, maxlength, pattern
9014
+
9015
+ ## Template parameters
9016
+
9017
+ String messages interpolate error params with \`{{param}}\`:
9018
+
9019
+ \`\`\`typescript
9020
+ validationMessages: {
9021
+ minLength: 'Must be at least {{requiredLength}} characters',
9022
+ min: 'Must be at least {{min}}',
9023
+ max: 'Must be at most {{max}}',
9024
+ pattern: 'Does not match {{requiredPattern}}',
9025
+ }
9026
+ \`\`\`
9027
+
9028
+ ## Error-aware message functions (TypeScript configs only)
9029
+
9030
+ Any \`validationMessages\` or \`defaultValidationMessages\` value can be a function \`(error: ValidationError) => DynamicText\` instead of a string. The function receives the validation error (its \`kind\` plus params such as \`maxLength\`), so an i18n layer gets the interpolation params natively:
9031
+
9032
+ \`\`\`typescript
9033
+ validationMessages: {
9034
+ maxLength: (error) => transloco.selectTranslate('validation.maxLength', {
9035
+ requiredLength: 'maxLength' in error ? error.maxLength : undefined,
9036
+ }),
9037
+ }
9038
+ \`\`\`
9039
+
9040
+ A resolver may return static text, an \`Observable\`, or a \`Signal\`, and those stay reactive. Returning a plain string after synchronously reading a signal severs reactivity \u2014 return the \`Signal\`/\`Observable\` itself instead.
9041
+
9042
+ **\u26A0\uFE0F Not JSON-serializable.** Function messages only work in TypeScript-authored configs. JSON-driven configs (and MCP-generated output) MUST use string templates with \`{{param}}\` interpolation.`
9014
9043
  },
9015
9044
  buttons: {
9016
9045
  brief: `**submit:** \`{ type: 'submit', key: 'submit', label: 'Submit' }\`
@@ -1 +1 @@
1
- {"version":3,"file":"lookup-topics.d.ts","sourceRoot":"","sources":["../../../../../../packages/dynamic-form-mcp/src/tools/data/lookup-topics.ts"],"names":[],"mappings":"AAAA,yBAAyB;AAEzB,4CAA4C;AAC5C,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAy/ElE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAiDrD,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAuJhD,CAAC"}
1
+ {"version":3,"file":"lookup-topics.d.ts","sourceRoot":"","sources":["../../../../../../packages/dynamic-form-mcp/src/tools/data/lookup-topics.ts"],"names":[],"mappings":"AAAA,yBAAyB;AAEzB,4CAA4C;AAC5C,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAshFlE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAiDrD,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAuJhD,CAAC"}