@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 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
- export { AutoLinkExtension } from './auto-link/index.js';
2
- import 'react';
3
- import '@lexical/react/LexicalAutoLinkPlugin';
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
- "use strict";var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var c=(t,n)=>{for(var e in n)a(t,e,{get:n[e],enumerable:!0})},u=(t,n,e,E)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of A(n))!L.call(t,o)&&o!==e&&a(t,o,{get:()=>n[o],enumerable:!(E=m(n,o))||E.enumerable});return t};var R=t=>u(a({},"__esModule",{value:!0}),t);var g={};c(g,{AutoLinkExtension:()=>i});module.exports=R(g);var r=require("@lexical/react/LexicalAutoLinkPlugin");var h=/((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,}))/;var s=require("react/jsx-runtime"),k=[(0,r.createLinkMatcherWithRegExp)(h,t=>t.startsWith("http")?t:`https://${t}`),(0,r.createLinkMatcherWithRegExp)(p,t=>`mailto:${t}`)];function i({matchers:t=k,onChange:n}){return(0,s.jsx)(r.AutoLinkPlugin,{matchers:t,onChange:n})}i.displayName="Typix.AutoLinkExtension";0&&(module.exports={AutoLinkExtension});
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": "1.0.0",
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
- "main": "src/index.ts",
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": "1.0.0"
39
+ "@typix-editor/react": "2.0.0"
36
40
  },
37
41
  "scripts": {
38
- "build": "tsup src --dts",
39
- "build:fast": "tsup src",
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 };
@@ -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});
@@ -1,2 +0,0 @@
1
- 'use client'
2
- import{a}from"../chunk-VQKYYFPV.mjs";import"../chunk-JD47AT4Q.mjs";export{a as AutoLinkExtension};
@@ -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};
@@ -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
@@ -1,3 +0,0 @@
1
- export { AutoLinkExtension } from './auto-link/index.mjs';
2
- import 'react';
3
- import '@lexical/react/LexicalAutoLinkPlugin';
package/dist/index.mjs DELETED
@@ -1,2 +0,0 @@
1
- 'use client'
2
- import{a as o}from"./chunk-VQKYYFPV.mjs";import"./chunk-JD47AT4Q.mjs";export{o as AutoLinkExtension};
@@ -1,4 +0,0 @@
1
- declare const URL_REGEX: RegExp;
2
- declare const EMAIL_REGEX: RegExp;
3
-
4
- export { EMAIL_REGEX, URL_REGEX };
@@ -1,4 +0,0 @@
1
- declare const URL_REGEX: RegExp;
2
- declare const EMAIL_REGEX: RegExp;
3
-
4
- export { EMAIL_REGEX, URL_REGEX };
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});
@@ -1,2 +0,0 @@
1
- 'use client'
2
- import{a,b}from"../chunk-JD47AT4Q.mjs";export{b as EMAIL_REGEX,a as URL_REGEX};
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- import { AutoLinkExtension } from "./auto-link";
2
- export { AutoLinkExtension };
@@ -1,5 +1,5 @@
1
- import { JSX } from 'react';
2
1
  import { LinkMatcher, ChangeHandler } from '@lexical/react/LexicalAutoLinkPlugin';
2
+ import { JSX } from 'react';
3
3
 
4
4
  declare function AutoLinkExtension({ matchers, onChange, }: {
5
5
  matchers?: LinkMatcher[];