@sharadox/form-web-library 0.7.0 → 0.7.1-changelog.25
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/CHANGELOG.md +15 -0
- package/distribution/bot-field/index.js +6 -6
- package/distribution/bot-field/index.js.map +1 -1
- package/llms.txt +1 -4
- package/package.json +3 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
What changed in each version of `@sharadox/form-web-library`, newest first.
|
|
4
|
+
|
|
5
|
+
## 0.6.1
|
|
6
|
+
|
|
7
|
+
Llms.txt summary names the phone field
|
|
8
|
+
|
|
9
|
+
## 0.5.1
|
|
10
|
+
|
|
11
|
+
README's example passes a real EmailDesign
|
|
12
|
+
|
|
13
|
+
## 0.5.0
|
|
14
|
+
|
|
15
|
+
CreateContactAction takes `design` (email-web-library ^0.4.0 EmailDesign; plainDesign(company) by default) instead of `theme`, and lays out both emails with emailLayout; the notice has a button to answer the visitor (labels.reply "Reply to" + first name, or labels.call "Call" when only a phone was left); an acknowledgement may carry a `button`; with a design signature, the reply leaves out its line to the site; contact-email (brandedEmailHtml) is removed: use email-web-library's emailLayout
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect,
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
4
|
/** Out of sight but still in the form, so robots that fill every field give themselves away. */
|
|
5
5
|
const HIDDEN = { position: "absolute", left: "-9999px", width: 1, height: 1, overflow: "hidden" };
|
|
6
6
|
/**
|
|
@@ -12,10 +12,10 @@ const HIDDEN = { position: "absolute", left: "-9999px", width: 1, height: 1, ove
|
|
|
12
12
|
* <form action={send}><BotFields />…</form>
|
|
13
13
|
*/
|
|
14
14
|
export function BotFields({ honeypotField = "website", startedAtField = "started-at", honeypotLabel = "Website", }) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return (_jsxs(_Fragment, { children: [_jsx("input", {
|
|
15
|
+
// Held in state, not written into the field: React puts a hidden field back to its default whenever the form renders
|
|
16
|
+
// again, which would silently turn the fill-time check off.
|
|
17
|
+
const [startedAt, setStartedAt] = useState(0);
|
|
18
|
+
useEffect(() => setStartedAt(Date.now()), []);
|
|
19
|
+
return (_jsxs(_Fragment, { children: [_jsx("input", { type: "hidden", name: startedAtField, value: startedAt, readOnly: true }), _jsx("div", { style: HIDDEN, "aria-hidden": true, children: _jsxs("label", { children: [honeypotLabel, _jsx("input", { name: honeypotField, tabIndex: -1, autoComplete: "off" })] }) })] }));
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/bot-field/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/bot-field/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG5C,gGAAgG;AAChG,MAAM,MAAM,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAW,CAAC;AAE3G;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,aAAa,GAAG,SAAS,EACzB,cAAc,GAAG,YAAY,EAC7B,aAAa,GAAG,SAAS,GACL;IACpB,qHAAqH;IACrH,4DAA4D;IAC5D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9C,SAAS,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9C,OAAO,CACL,8BACE,gBAAO,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,SAAG,EACxE,cAAK,KAAK,EAAE,MAAM,iCAChB,4BACG,aAAa,EACd,gBAAO,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,YAAY,EAAC,KAAK,GAAG,IACzD,GACJ,IACL,CACJ,CAAC;AACJ,CAAC"}
|
package/llms.txt
CHANGED
|
@@ -10,10 +10,7 @@
|
|
|
10
10
|
- /parse-contact: parseContact(form, { choices, choiceField='need', reach, requireMessage, minimumMessageLength, requireChoice, fields, now }) → value { name, email, phone, company, message, locale, choices, fields }
|
|
11
11
|
- /contact-check isEmail(text), isPhone(text) (browser-safe, same rules as the server); /bot-check isLikelyBot; /rate-limit createRateLimiter({ window, maximum }); /field readField(form, name, max)
|
|
12
12
|
- Env: EMAIL_SERVER_HOST/PORT/USERNAME/PASSWORD, EMAIL_SENDER_ADDRESS. License: Sharadox Open Source License 0.1.0
|
|
13
|
-
- 0.5.0: createContactAction takes `design` (email-web-library ^0.4.0 EmailDesign; plainDesign(company) by default) instead of `theme`, and lays out both emails with emailLayout; the notice has a button to answer the visitor (labels.reply "Reply to" + first name, or labels.call "Call" when only a phone was left); an acknowledgement may carry a `button`; with a design signature, the reply leaves out its line to the site; contact-email (brandedEmailHtml) is removed: use email-web-library's emailLayout
|
|
14
|
-
- 0.5.1: README's example passes a real EmailDesign
|
|
15
13
|
- phone-field (client, React): PhoneField({ name, locale, defaultCountry?="PT", labels?={country,search}, inputProps?, className?, inputClassName? }); flag+calling-code button opens searchable listbox (Intl.DisplayNames names, default country first, arrows/Enter/Escape, outside press closes); number box digits only (max 15), "+"/"00" paste picks country; hidden input `name` = "+<code> <digits>" or ""; CSS vars --phone-field-line/-accent/-surface/-popover/-radius/-gap; flags lazy-loaded from @sharadox/icon-web-library/flag
|
|
16
14
|
- calling-code: CALLING_CODES (ISO alpha-2 → digits, 245 countries, from libphonenumber metadata, Apache 2.0), MAIN_CALLING_COUNTRY (shared code → main country), type CallingCountry
|
|
17
15
|
- phone-number: readPhone(text, current) → { country, digits }; fullPhone(country, digits) → "+351 912345678" | ""
|
|
18
|
-
|
|
19
|
-
- 0.6.1: llms.txt summary names the phone field
|
|
16
|
+
- Changes by version: CHANGELOG.md (in the package)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sharadox/form-web-library",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1-changelog.25",
|
|
4
4
|
"description": "Forms: a phone field with every country's flag and calling code, and on the server field reading, honeypot and fill-time bot checks, rate limiting and a contact form action that emails messages with the visitor as reply-to.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "SEE LICENSE IN LICENCA.md",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"LICENCA.md",
|
|
26
26
|
"LICENSE.md",
|
|
27
27
|
"NOTICE.md",
|
|
28
|
-
"llms.txt"
|
|
28
|
+
"llms.txt",
|
|
29
|
+
"CHANGELOG.md"
|
|
29
30
|
],
|
|
30
31
|
"sideEffects": [
|
|
31
32
|
"**/*.css"
|