@astryxdesign/richtext 0.7.14 → 0.7.15-canary.g79b95eb
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/dist/linkUtils.d.ts +6 -1
- package/dist/linkUtils.d.ts.map +1 -1
- package/dist/linkUtils.js +7 -2
- package/package.json +5 -5
- package/src/linkUtils.ts +7 -2
package/dist/linkUtils.d.ts
CHANGED
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
* Intentionally permissive on path/query so real-world URLs linkify.
|
|
4
4
|
*/
|
|
5
5
|
export declare const URL_MATCHER: RegExp;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Matches a bare email address for AutoLink (rendered as a `mailto:` link).
|
|
8
|
+
* An unquoted local part starts only at the text start, after whitespace, or
|
|
9
|
+
* after one of `<>()[]\,;:@"`. A quoted local part ends at the next quote or
|
|
10
|
+
* line break. Each run is read once, so matching time stays linear.
|
|
11
|
+
*/
|
|
7
12
|
export declare const EMAIL_MATCHER: RegExp;
|
|
8
13
|
/**
|
|
9
14
|
* Return a safe href for `url`, or `'about:blank'` if it can't be parsed or uses
|
package/dist/linkUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkUtils.d.ts","sourceRoot":"","sources":["../src/linkUtils.ts"],"names":[],"mappings":"AAoCA;;;GAGG;AACH,eAAO,MAAM,WAAW,QAC0F,CAAC;AAEnH
|
|
1
|
+
{"version":3,"file":"linkUtils.d.ts","sourceRoot":"","sources":["../src/linkUtils.ts"],"names":[],"mappings":"AAoCA;;;GAGG;AACH,eAAO,MAAM,WAAW,QAC0F,CAAC;AAEnH;;;;;GAKG;AACH,eAAO,MAAM,aAAa,QACyJ,CAAC;AAOpL;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAc/C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAWhD"}
|
package/dist/linkUtils.js
CHANGED
|
@@ -40,8 +40,13 @@ const HAS_SCHEME = /^[a-z][a-z0-9+.-]*:/i;
|
|
|
40
40
|
*/
|
|
41
41
|
export const URL_MATCHER = /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/;
|
|
42
42
|
|
|
43
|
-
/**
|
|
44
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Matches a bare email address for AutoLink (rendered as a `mailto:` link).
|
|
45
|
+
* An unquoted local part starts only at the text start, after whitespace, or
|
|
46
|
+
* after one of `<>()[]\,;:@"`. A quoted local part ends at the next quote or
|
|
47
|
+
* line break. Each run is read once, so matching time stays linear.
|
|
48
|
+
*/
|
|
49
|
+
export const EMAIL_MATCHER = /((?<![^<>()[\]\\,;:\s@"])[^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*|("[^"\r\n]+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
|
|
45
50
|
|
|
46
51
|
/** Prepend a default `https://` scheme to a bare host so it parses as absolute. */
|
|
47
52
|
function withDefaultScheme(url) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/richtext",
|
|
3
3
|
"displayName": "Rich Text",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.15-canary.g79b95eb",
|
|
5
5
|
"description": "Astryx rich text — a Lexical-based rich text editor and viewer, styled with Astryx design tokens.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
7
7
|
"license": "MIT",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@stylexjs/stylex": ">=0.10.0",
|
|
69
|
-
"@astryxdesign/core": "0.7.
|
|
69
|
+
"@astryxdesign/core": "0.7.15-canary.g79b95eb",
|
|
70
70
|
"react": ">=19.0.0",
|
|
71
71
|
"react-dom": ">=19.0.0",
|
|
72
72
|
"lexical": "^0.52.0",
|
|
@@ -125,6 +125,8 @@
|
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
"devDependencies": {
|
|
128
|
+
"@astryxdesign/a11y-spec": "0.7.15-canary.g79b95eb",
|
|
129
|
+
"@astryxdesign/cli": "0.7.15-canary.g79b95eb",
|
|
128
130
|
"@babel/cli": "^7.29.7",
|
|
129
131
|
"@babel/core": "^7.29.7",
|
|
130
132
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -143,9 +145,7 @@
|
|
|
143
145
|
"@lexical/utils": "^0.52.0",
|
|
144
146
|
"@stylexjs/babel-plugin": "^0.19.1",
|
|
145
147
|
"@testing-library/react": "^16.3.3",
|
|
146
|
-
"lexical": "^0.52.0"
|
|
147
|
-
"@astryxdesign/a11y-spec": "0.0.0",
|
|
148
|
-
"@astryxdesign/cli": "0.7.14"
|
|
148
|
+
"lexical": "^0.52.0"
|
|
149
149
|
},
|
|
150
150
|
"scripts": {
|
|
151
151
|
"build": "node ../../scripts/clean-dist.mjs && pnpm build:esm && tsc --project tsconfig.build.json && node ../../scripts/add-declaration-extensions.mjs && pnpm build:css && node ../../scripts/check-no-dev-jsx.mjs && node ../../scripts/check-fully-specified.mjs",
|
package/src/linkUtils.ts
CHANGED
|
@@ -41,9 +41,14 @@ const HAS_SCHEME = /^[a-z][a-z0-9+.-]*:/i;
|
|
|
41
41
|
export const URL_MATCHER =
|
|
42
42
|
/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/;
|
|
43
43
|
|
|
44
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Matches a bare email address for AutoLink (rendered as a `mailto:` link).
|
|
46
|
+
* An unquoted local part starts only at the text start, after whitespace, or
|
|
47
|
+
* after one of `<>()[]\,;:@"`. A quoted local part ends at the next quote or
|
|
48
|
+
* line break. Each run is read once, so matching time stays linear.
|
|
49
|
+
*/
|
|
45
50
|
export const EMAIL_MATCHER =
|
|
46
|
-
/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)
|
|
51
|
+
/((?<![^<>()[\]\\,;:\s@"])[^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*|("[^"\r\n]+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
|
|
47
52
|
|
|
48
53
|
/** Prepend a default `https://` scheme to a bare host so it parses as absolute. */
|
|
49
54
|
function withDefaultScheme(url: string): string {
|