@yoopta/link 4.6.2 → 4.6.3-rc.1

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.js CHANGED
@@ -1 +1 @@
1
- import{useYooptaReadOnly as e,YooptaPlugin as t,generateId as r}from"@yoopta/editor";import{jsx as n}from"react/jsx-runtime";"function"==typeof SuppressedError&&SuppressedError;const o=["_blank","_self","_parent","_top","framename"],l=new t({type:"LinkPlugin",elements:{link:{render:t=>{const r=t.HTMLAttributes||{},{className:l=""}=r,i=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(r,["className"]),{url:a,target:p="",rel:s}=t.element.props||{},d=e(),c={rel:s,target:p};return o.includes(p)||delete c.target,"string"==typeof s&&0!==(null==s?void 0:s.length)||delete c.rel,n("a",Object.assign({draggable:!1,href:a||"",onClick:e=>{d||e.preventDefault()},className:`yoopta-link ${l}`},c,i,t.attributes,{children:t.children}))},props:{url:null,target:"_blank",rel:"noopener noreferrer",nodeType:"inline",title:null}}},options:{display:{title:"Link",description:"Create link"}},parsers:{html:{serialize:(e,t)=>{const{url:r,target:n,rel:o,title:l}=e.props;return`<a href="${r}" target="${n}" rel="${o}">${l||t}</a>`},deserialize:{nodeNames:["A"],parse:e=>{if("A"===e.nodeName){const t=e.getAttribute("href"),n=e.getAttribute("target")||"",o=e.getAttribute("rel")||"",l=e.textContent||"",i={url:t,target:n,rel:o,title:l,nodeType:"inline"};return{id:r(),type:"link",props:i,children:[{text:l}]}}}}}}});!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".yoopta-link{--tw-text-opacity:1;color:rgb(0 122 255/var(--tw-text-opacity));text-decoration-line:underline;text-underline-offset:4px}.yoopta-link:hover{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}");export{l as default};
1
+ import{useYooptaReadOnly as e,YooptaPlugin as t,generateId as r}from"@yoopta/editor";import{jsx as n}from"react/jsx-runtime";function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}"function"==typeof SuppressedError&&SuppressedError;const l=["_blank","_self","_parent","_top","framename"],i=new t({type:"LinkPlugin",elements:{link:{render:t=>{var{extendRender:r}=t,i=o(t,["extendRender"]);const a=i.HTMLAttributes||{},{className:p=""}=a,s=o(a,["className"]),{url:d,target:c="",rel:u}=i.element.props||{},f=e(),y={rel:u,target:c};return l.includes(c)||delete y.target,"string"==typeof u&&0!==(null==u?void 0:u.length)||delete y.rel,r?r(i):n("a",Object.assign({draggable:!1,href:d||"",onClick:e=>{f||e.preventDefault()},className:`yoopta-link ${p}`},y,s,i.attributes,{children:i.children}))},props:{url:null,target:"_blank",rel:"noopener noreferrer",nodeType:"inline",title:null}}},options:{display:{title:"Link",description:"Create link"}},parsers:{html:{serialize:(e,t)=>{const{url:r,target:n,rel:o,title:l}=e.props;return`<a href="${r}" target="${n}" rel="${o}">${l||t}</a>`},deserialize:{nodeNames:["A"],parse:e=>{if("A"===e.nodeName){const t=e.getAttribute("href")||"",n=e.getAttribute("target")||"",o=e.getAttribute("rel")||"",l=e.textContent||"",i={url:t,target:n,rel:o,title:l,nodeType:"inline"};return{id:r(),type:"link",props:i,children:[{text:l}]}}}}}}});!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".yoopta-link{--tw-text-opacity:1;color:rgb(0 122 255/var(--tw-text-opacity));text-decoration-line:underline;text-underline-offset:4px}.yoopta-link:hover{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}");export{i as default};
@@ -1,4 +1,5 @@
1
+ /// <reference types="react" />
1
2
  import { PluginElementRenderProps } from '@yoopta/editor';
2
- declare const LinkRender: (props: PluginElementRenderProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const LinkRender: ({ extendRender, ...props }: PluginElementRenderProps) => JSX.Element;
3
4
  export { LinkRender };
4
5
  //# sourceMappingURL=LinkRender.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkRender.d.ts","sourceRoot":"","sources":["../../src/ui/LinkRender.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAqB,MAAM,gBAAgB,CAAC;AAK7E,QAAA,MAAM,UAAU,UAAW,wBAAwB,4CAqClD,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"LinkRender.d.ts","sourceRoot":"","sources":["../../src/ui/LinkRender.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,wBAAwB,EAAqB,MAAM,gBAAgB,CAAC;AAK7E,QAAA,MAAM,UAAU,+BAAgC,wBAAwB,gBAyCvE,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/link",
3
- "version": "4.6.2",
3
+ "version": "4.6.3-rc.1",
4
4
  "description": "Link plugin for Yoopta Editor",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
@@ -34,5 +34,5 @@
34
34
  "bugs": {
35
35
  "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
36
36
  },
37
- "gitHead": "95ce282cea3b2a2d9b8fbb405c4495ac4e04fef8"
37
+ "gitHead": "fef97806a8b05525ba1eaa76524f322fb638ee14"
38
38
  }