From e95e70efdf84fc70c95956138f6bf32382f69e44 Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:44:06 -0700 Subject: [PATCH] feat: helper-ui input-validator update (#202) * feat: helper-ui input-validator update the input validator now accepts the same urls as verified-fetch and provides more helpful information * fix: support native ipfs/ipns urls * fix: ux of input-validator help text * fix: regex support for more urls * fix: ux improvements to input-validator help text * fix: helper-ui input label * fix: preact import has no default * feat: helper-ui input allows CID only --- src/components/Form.tsx | 2 +- src/components/input-validator.tsx | 102 ++++++++++-------- src/lib/path-or-subdomain.ts | 5 +- src/lib/regex.ts | 30 ++++++ src/pages/redirects-interstitial.tsx | 2 +- test/README.md | 4 +- test/regex.spec.ts | 156 +++++++++++++++++++++++++++ 7 files changed, 246 insertions(+), 55 deletions(-) create mode 100644 src/lib/regex.ts create mode 100644 test/regex.spec.ts diff --git a/src/components/Form.tsx b/src/components/Form.tsx index 07fe250e..f8c2010b 100644 --- a/src/components/Form.tsx +++ b/src/components/Form.tsx @@ -2,7 +2,7 @@ import React from 'preact/compat' export default ({ handleSubmit, requestPath, setRequestPath }): React.JSX.Element => (