@typix-editor/extension-auto-link 1.0.0 → 2.0.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.
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +12 -3
- package/dist/index.js +1 -1
- package/package.json +9 -5
- package/dist/auto-link/index.d.ts +0 -12
- package/dist/auto-link/index.js +0 -2
- package/dist/auto-link/index.mjs +0 -2
- package/dist/chunk-JD47AT4Q.mjs +0 -2
- package/dist/chunk-VQKYYFPV.mjs +0 -2
- package/dist/index.d.mts +0 -3
- package/dist/index.mjs +0 -2
- package/dist/lib/index.d.mts +0 -4
- package/dist/lib/index.d.ts +0 -4
- package/dist/lib/index.js +0 -2
- package/dist/lib/index.mjs +0 -2
- package/src/index.ts +0 -2
- package/dist/{auto-link/index.d.mts → index.d.cts} +1 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
"use strict";var r=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var k=(t,o)=>{for(var e in o)r(t,e,{get:o[e],enumerable:!0})},f=(t,o,e,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of c(o))!d.call(t,n)&&n!==e&&r(t,n,{get:()=>o[n],enumerable:!(a=u(o,n))||a.enumerable});return t};var x=t=>f(r({},"__esModule",{value:!0}),t);var w={};k(w,{AutoLinkExtension:()=>s});module.exports=x(w);var h=require("@lexical/link"),i=require("@lexical/react/LexicalAutoLinkPlugin"),m=require("@lexical/react/LexicalComposerContext"),A=require("react");var p=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])/,E=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[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,}))/;var L=require("react/jsx-runtime"),l=[(0,i.createLinkMatcherWithRegExp)(p,t=>t.startsWith("http")?t:`https://${t}`),(0,i.createLinkMatcherWithRegExp)(E,t=>`mailto:${t}`)];function s({matchers:t=l,onChange:o}){let[e]=(0,m.useLexicalComposerContext)();return(0,A.useEffect)(()=>{if(!e.hasNodes([h.AutoLinkNode]))throw new Error("AutoLinkExtension: AutoLinkNode is not registered in the editor. Make sure to include AutoLinkNode in your extensionNodes array.")},[e]),(0,L.jsx)(i.AutoLinkPlugin,{matchers:t,onChange:o})}s.displayName="Typix.AutoLinkExtension";0&&(module.exports={AutoLinkExtension});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import 'react';
|
|
3
|
-
|
|
1
|
+
import { LinkMatcher, ChangeHandler } from '@lexical/react/LexicalAutoLinkPlugin';
|
|
2
|
+
import { JSX } from 'react';
|
|
3
|
+
|
|
4
|
+
declare function AutoLinkExtension({ matchers, onChange, }: {
|
|
5
|
+
matchers?: LinkMatcher[];
|
|
6
|
+
onChange?: ChangeHandler;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
declare namespace AutoLinkExtension {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { AutoLinkExtension };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
|
|
2
|
+
import{AutoLinkNode as a}from"@lexical/link";import{AutoLinkPlugin as p,createLinkMatcherWithRegExp as i}from"@lexical/react/LexicalAutoLinkPlugin";import{useLexicalComposerContext as E}from"@lexical/react/LexicalComposerContext";import{useEffect as h}from"react";var e=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])/,n=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[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,}))/;import{jsx as A}from"react/jsx-runtime";var m=[i(e,t=>t.startsWith("http")?t:`https://${t}`),i(n,t=>`mailto:${t}`)];function r({matchers:t=m,onChange:s}){let[o]=E();return h(()=>{if(!o.hasNodes([a]))throw new Error("AutoLinkExtension: AutoLinkNode is not registered in the editor. Make sure to include AutoLinkNode in your extensionNodes array.")},[o]),A(p,{matchers:t,onChange:s})}r.displayName="Typix.AutoLinkExtension";export{r as AutoLinkExtension};
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typix-editor/extension-auto-link",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Auto link extension for Typix",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Diyorbek Juraev <mrdiyorbekjuraev@gmail.com>",
|
|
7
7
|
"homepage": "https://typix.com",
|
|
8
8
|
"license": "MIT",
|
|
9
|
-
"
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "dist/index.cjs",
|
|
11
|
+
"module": "dist/index.js",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
10
13
|
"sideEffects": false,
|
|
11
14
|
"files": [
|
|
12
15
|
"dist"
|
|
@@ -27,16 +30,17 @@
|
|
|
27
30
|
},
|
|
28
31
|
"devDependencies": {
|
|
29
32
|
"@lexical/react": "^0.39.0",
|
|
33
|
+
"@lexical/link": "^0.39.0",
|
|
30
34
|
"@types/react": "^19.2.7",
|
|
31
35
|
"@types/react-dom": "^19.2.1",
|
|
32
36
|
"lexical": "^0.39.0",
|
|
33
37
|
"react": "^18.2.0 || ^19.0.0-0",
|
|
34
38
|
"react-dom": "^18.2.0 || ^19.0.0-0",
|
|
35
|
-
"@typix-editor/react": "
|
|
39
|
+
"@typix-editor/react": "2.0.0"
|
|
36
40
|
},
|
|
37
41
|
"scripts": {
|
|
38
|
-
"build": "tsup
|
|
39
|
-
"build:fast": "tsup
|
|
42
|
+
"build": "tsup",
|
|
43
|
+
"build:fast": "tsup",
|
|
40
44
|
"dev": "pnpm build:fast --watch",
|
|
41
45
|
"clean": "git clean -xdf .cache .turbo dist node_modules rm -rf dist",
|
|
42
46
|
"typecheck": "tsc --noEmit --emitDeclarationOnly false"
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
2
|
-
import { LinkMatcher, ChangeHandler } from '@lexical/react/LexicalAutoLinkPlugin';
|
|
3
|
-
|
|
4
|
-
declare function AutoLinkExtension({ matchers, onChange, }: {
|
|
5
|
-
matchers?: LinkMatcher[];
|
|
6
|
-
onChange?: ChangeHandler;
|
|
7
|
-
}): JSX.Element;
|
|
8
|
-
declare namespace AutoLinkExtension {
|
|
9
|
-
var displayName: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { AutoLinkExtension };
|
package/dist/auto-link/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
"use strict";var o=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var L=(t,n)=>{for(var a in n)o(t,a,{get:n[a],enumerable:!0})},R=(t,n,a,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of c(n))!m.call(t,e)&&e!==a&&o(t,e,{get:()=>n[e],enumerable:!(i=A(n,e))||i.enumerable});return t};var u=t=>R(o({},"__esModule",{value:!0}),t);var k={};L(k,{AutoLinkExtension:()=>s});module.exports=u(k);var r=require("@lexical/react/LexicalAutoLinkPlugin");var E=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])/,h=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[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,}))/;var p=require("react/jsx-runtime"),g=[(0,r.createLinkMatcherWithRegExp)(E,t=>t.startsWith("http")?t:`https://${t}`),(0,r.createLinkMatcherWithRegExp)(h,t=>`mailto:${t}`)];function s({matchers:t=g,onChange:n}){return(0,p.jsx)(r.AutoLinkPlugin,{matchers:t,onChange:n})}s.displayName="Typix.AutoLinkExtension";0&&(module.exports={AutoLinkExtension});
|
package/dist/auto-link/index.mjs
DELETED
package/dist/chunk-JD47AT4Q.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
var w=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])/,A=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[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,}))/;export{w as a,A as b};
|
package/dist/chunk-VQKYYFPV.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import{a as n,b as e}from"./chunk-JD47AT4Q.mjs";import{AutoLinkPlugin as o,createLinkMatcherWithRegExp as r}from"@lexical/react/LexicalAutoLinkPlugin";import{jsx as m}from"react/jsx-runtime";var a=[r(n,t=>t.startsWith("http")?t:`https://${t}`),r(e,t=>`mailto:${t}`)];function h({matchers:t=a,onChange:i}){return m(o,{matchers:t,onChange:i})}h.displayName="Typix.AutoLinkExtension";export{h as a};
|
package/dist/index.d.mts
DELETED
package/dist/index.mjs
DELETED
package/dist/lib/index.d.mts
DELETED
package/dist/lib/index.d.ts
DELETED
package/dist/lib/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
"use strict";var t=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var o=(A,w)=>{for(var s in w)t(A,s,{get:w[s],enumerable:!0})},R=(A,w,s,z)=>{if(w&&typeof w=="object"||typeof w=="function")for(let a of Z(w))!_.call(A,a)&&a!==s&&t(A,a,{get:()=>w[a],enumerable:!(z=E(w,a))||z.enumerable});return A};var c=A=>R(t({},"__esModule",{value:!0}),A);var G={};o(G,{EMAIL_REGEX:()=>p,URL_REGEX:()=>n});module.exports=c(G);var n=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])/,p=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[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,}))/;0&&(module.exports={EMAIL_REGEX,URL_REGEX});
|
package/dist/lib/index.mjs
DELETED
package/src/index.ts
DELETED