@samline/forms 2.7.1 → 2.7.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 +3 -3
- package/dist/browser/global.global.js +19 -10
- package/dist/browser/global.global.js.map +1 -1
- package/docs/browser.md +4 -4
- package/docs/getting-started.md +1 -1
- package/package.json +3 -3
package/docs/browser.md
CHANGED
|
@@ -11,10 +11,10 @@ For every other case (modern apps, bundlers, TypeScript projects), use the main
|
|
|
11
11
|
## Script tag
|
|
12
12
|
|
|
13
13
|
```html
|
|
14
|
-
<script src="https://unpkg.com/@samline/forms@2.7.
|
|
14
|
+
<script src="https://unpkg.com/@samline/forms@2.7.2/dist/browser/global.global.js"></script>
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
> Pin the version in production. Replace `2.7.
|
|
17
|
+
> Pin the version in production. Replace `2.7.2` with the version you ship.
|
|
18
18
|
|
|
19
19
|
The bundle is a single IIFE that registers a global object.
|
|
20
20
|
|
|
@@ -49,7 +49,7 @@ The factory returns a `FormController` with the same signatures, semantics, and
|
|
|
49
49
|
<button type="submit">Send</button>
|
|
50
50
|
</form>
|
|
51
51
|
|
|
52
|
-
<script src="https://unpkg.com/@samline/forms@2.7.
|
|
52
|
+
<script src="https://unpkg.com/@samline/forms@2.7.2/dist/browser/global.global.js"></script>
|
|
53
53
|
<script>
|
|
54
54
|
const contactForm = window.Forms.newForm({
|
|
55
55
|
id: 'contact-form',
|
|
@@ -126,7 +126,7 @@ window.Forms.destroyForm('contact-form')
|
|
|
126
126
|
|
|
127
127
|
## Common pitfalls
|
|
128
128
|
|
|
129
|
-
- **Pin the version.** The CDN URL above is `2.7.
|
|
129
|
+
- **Pin the version.** The CDN URL above is `2.7.2`. Replace it whenever you upgrade.
|
|
130
130
|
- **The script must be loaded before any code that uses `window.Forms`.** Place the `<script>` tag in `<head>` with `defer`, or before the user script in `<body>`.
|
|
131
131
|
- **No bundler means no tree-shaking.** The global browser bundle includes the controller and formatter peer. Inspect the published artifact when bundle size is a constraint.
|
|
132
132
|
- **CSP:** if your site uses a strict Content Security Policy, allow `unpkg.com` in `script-src` (or self-host the file).
|
package/docs/getting-started.md
CHANGED
|
@@ -8,7 +8,7 @@ This page explains what `@samline/forms` is, how the controller is wired, and wh
|
|
|
8
8
|
|
|
9
9
|
Use the main `@samline/forms` entrypoint for native HTML forms. The package also provides `@samline/forms/browser` as an ESM/CJS browser module and `@samline/forms/browser/global` as the global IIFE distribution.
|
|
10
10
|
|
|
11
|
-
> Note: the latest version is `2.7.
|
|
11
|
+
> Note: the latest version is `2.7.2` — see [Releases](https://github.com/samline/forms/releases) for the changelog.
|
|
12
12
|
|
|
13
13
|
If you want a `<script>`-only setup without a bundler, see [docs/browser.md](browser.md).
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@samline/forms",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"description": "TypeScript-first, framework-free form controller with validation, reactive state, serialization, auto-submit, and input formatting.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"forms",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"prepublishOnly": "npm run clean && npm run build && npm run typecheck && npm test && npm run test:package && npm run pack:check"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@samline/formatter": "^2.0.
|
|
80
|
+
"@samline/formatter": "^2.0.3"
|
|
81
81
|
},
|
|
82
82
|
"peerDependenciesMeta": {
|
|
83
83
|
"@samline/formatter": {
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"vite": "^8.0.0"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
|
-
"@samline/formatter": "^2.0.
|
|
94
|
+
"@samline/formatter": "^2.0.3",
|
|
95
95
|
"@types/node": "^26.6.2",
|
|
96
96
|
"@vitest/coverage-v8": "^5.0.1",
|
|
97
97
|
"jsdom": "^30.1.0",
|