@punica/form-mcp 0.6.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":"0.6.1"}
1
+ {"version":"0.7.0"}
@@ -44,7 +44,10 @@ export type KitItem<E> = FormItem<E> & Rules & {
44
44
  help?: string;
45
45
  /** Shown while the field is empty. */
46
46
  placeholder?: string;
47
- /** The type of a text field, `text` by default. */
47
+ /**
48
+ * The type of a text field, `text` by default. `email` and `url` are
49
+ * checked as the browser checks them, unless the field has a `pattern`.
50
+ */
48
51
  inputType?: 'text' | 'email' | 'password' | 'tel' | 'url' | 'date';
49
52
  /**
50
53
  * What the browser may fill a text or password field in with, as the
@@ -91,6 +94,10 @@ export type Messages = {
91
94
  maxFileSize: (label: string, bytes: number) => string;
92
95
  date: (label: string) => string;
93
96
  accept: (label: string) => string;
97
+ /** A text field with `inputType: 'email'` and no `pattern` (since 0.7). */
98
+ email: (label: string) => string;
99
+ /** A text field with `inputType: 'url'` and no `pattern` (since 0.7). */
100
+ url: (label: string) => string;
94
101
  };
95
102
  /** A validation of an item. */
96
103
  export type Validation = NonNullable<FieldProps['validation']>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punica/form-mcp",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
4
4
  "description": "MCP server for Punica Form: look up the exact API of its packages, read the rules and check code that uses them.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -43,7 +43,7 @@
43
43
  "@punica/form": "^2.3.0",
44
44
  "@punica/form-service": "^2.3.0",
45
45
  "@punica/form-react": "^0.2.0",
46
- "@punica/form-kit": "^0.6.1",
46
+ "@punica/form-kit": "^0.7.0",
47
47
  "@punica/form-schema": "^0.1.0"
48
48
  },
49
49
  "scripts": {
package/src/guide.md CHANGED
@@ -62,7 +62,9 @@ is `yyyy-mm-dd`), `PasswordField`, `FileField` and `ArrayField` (a list of
62
62
  rows: `@ArrayField({ label, row: () => new LineForm() })`, the kit renders a
63
63
  form for every row) with the rules `required`, `minLength`, `maxLength`,
64
64
  `pattern`, `min`, `max`, `minDate`, `maxDate`, `minItems`, `maxItems` and
65
- `maxFileSize`; `options` may be a function that loads the choices. And from `@punica/form-kit/react` the component
65
+ `maxFileSize`; `inputType: 'email'` or `'url'` on a `TextField` checks the
66
+ address too (since form-kit 0.7; a `pattern` of the field decides instead);
67
+ `options` may be a function that loads the choices. And from `@punica/form-kit/react` the component
66
68
  `<KitForm entity={() => new UserForm()} onSubmit={…} />`, which renders the
67
69
  form with `@punica/components`, shows what `onSubmit` throws above the
68
70
  fields and reports it to `onError`. Use it when the project has it installed;