@typix-editor/extension-auto-link 1.0.1 → 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 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
+ "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.cts CHANGED
@@ -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[];
package/dist/index.d.ts CHANGED
@@ -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[];
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client'
2
- import{AutoLinkPlugin as i,createLinkMatcherWithRegExp as r}from"@lexical/react/LexicalAutoLinkPlugin";var n=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])/,o=/(([^<>()[\]\\.,;:\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 h}from"react/jsx-runtime";var E=[r(n,t=>t.startsWith("http")?t:`https://${t}`),r(o,t=>`mailto:${t}`)];function e({matchers:t=E,onChange:a}){return h(i,{matchers:t,onChange:a})}e.displayName="Typix.AutoLinkExtension";export{e as 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@typix-editor/extension-auto-link",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "description": "Auto link extension for Typix",
5
5
  "keywords": [],
6
6
  "author": "Diyorbek Juraev <mrdiyorbekjuraev@gmail.com>",
@@ -30,12 +30,13 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@lexical/react": "^0.39.0",
33
+ "@lexical/link": "^0.39.0",
33
34
  "@types/react": "^19.2.7",
34
35
  "@types/react-dom": "^19.2.1",
35
36
  "lexical": "^0.39.0",
36
37
  "react": "^18.2.0 || ^19.0.0-0",
37
38
  "react-dom": "^18.2.0 || ^19.0.0-0",
38
- "@typix-editor/react": "2.0.1"
39
+ "@typix-editor/react": "2.0.0"
39
40
  },
40
41
  "scripts": {
41
42
  "build": "tsup",