@limetech/lime-elements 38.36.0 → 38.37.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/CHANGELOG.md +16 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-button.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-markdown.cjs.entry.js +8 -2
- package/dist/cjs/limel-markdown.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{markdown-parser-1dfc4556.js → markdown-parser-932d9b41.js} +106 -7
- package/dist/cjs/{markdown-parser-1dfc4556.js.map → markdown-parser-932d9b41.js.map} +1 -1
- package/dist/collection/components/button/button.css +7 -7
- package/dist/collection/components/input-field/input-field.js +1 -1
- package/dist/collection/components/input-field/input-field.js.map +1 -1
- package/dist/collection/components/markdown/markdown-parser.js +2 -0
- package/dist/collection/components/markdown/markdown-parser.js.map +1 -1
- package/dist/collection/components/markdown/markdown.js +29 -2
- package/dist/collection/components/markdown/markdown.js.map +1 -1
- package/dist/collection/components/markdown/remove-empty-paragraphs-plugin.js +98 -0
- package/dist/collection/components/markdown/remove-empty-paragraphs-plugin.js.map +1 -0
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-breadcrumbs_7.entry.js.map +1 -1
- package/dist/esm/limel-button.entry.js +1 -1
- package/dist/esm/limel-button.entry.js.map +1 -1
- package/dist/esm/limel-markdown.entry.js +8 -2
- package/dist/esm/limel-markdown.entry.js.map +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{markdown-parser-bd7fcc7f.js → markdown-parser-b2d5dad4.js} +106 -7
- package/dist/esm/markdown-parser-b2d5dad4.js.map +1 -0
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js.map +1 -1
- package/dist/lime-elements/{p-c6aaf532.entry.js → p-4a9a6e16.entry.js} +2 -2
- package/dist/lime-elements/{p-c6aaf532.entry.js.map → p-4a9a6e16.entry.js.map} +1 -1
- package/dist/lime-elements/p-668e583c.entry.js.map +1 -1
- package/dist/lime-elements/{p-f2206d1b.js → p-7192af6b.js} +2 -2
- package/dist/lime-elements/p-7192af6b.js.map +1 -0
- package/dist/lime-elements/{p-5eaa6f69.entry.js → p-b80a7353.entry.js} +2 -2
- package/dist/lime-elements/{p-9fc23e05.entry.js → p-c2f922ba.entry.js} +2 -2
- package/dist/lime-elements/p-c2f922ba.entry.js.map +1 -0
- package/dist/types/components/input-field/input-field.d.ts +4 -1
- package/dist/types/components/markdown/markdown-parser.d.ts +1 -0
- package/dist/types/components/markdown/markdown.d.ts +10 -1
- package/dist/types/components/markdown/remove-empty-paragraphs-plugin.d.ts +3 -0
- package/dist/types/components.d.ts +18 -6
- package/package.json +1 -1
- package/dist/esm/markdown-parser-bd7fcc7f.js.map +0 -1
- package/dist/lime-elements/p-9fc23e05.entry.js.map +0 -1
- package/dist/lime-elements/p-f2206d1b.js.map +0 -1
- /package/dist/lime-elements/{p-5eaa6f69.entry.js.map → p-b80a7353.entry.js.map} +0 -0
|
@@ -4,5 +4,5 @@ import{c as e,a as t,d as n}from"./p-4e9b4087.js";function i(e,t){if(r(e)){retur
|
|
|
4
4
|
* @version v0.2.1
|
|
5
5
|
* @link http://github.com/noeldelgado/parse-css-color/
|
|
6
6
|
* @license MIT
|
|
7
|
-
*/const ex=e=>{if(typeof e!=="string")return null;const t=DS.exec(e);if(t)return QS(t[0]);const n=MS.exec(e)||NS.exec(e);if(n)return ZS(n);const i=zS.exec(e)||GS.exec(e)||qS.exec(e)||FS.exec(e);if(i)return JS(i);if(YS.exec(e))return JS([null,0,0,0,0]);const r=wS[e.toLowerCase()];if(r)return JS([null,r[0],r[1],r[2],1]);return null};const tx=["background-color","color","font-style","font-weight","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-decoration","width","height","min-width","min-height"];function nx(e){var t;if(e.tagName&&((t=e.properties)===null||t===void 0?void 0:t.style)){e.properties.style=ix(e.properties.style)}}function ix(e){try{const t=yS(e);const n=rx(t);return Object.entries(n).filter((([e])=>tx.includes(e))).map((([e,t])=>`${e}: ${t}`)).join("; ")}catch(t){console.error("Failed to parse style value",e,t);return""}}function rx(e){const t=Object.assign({},e);delete t.background;if("background"in e&&sx(e.background)){t["background-color"]=e.background}return t}function sx(e){return ex(e)!==null}function ox(e=false){return()=>{if(!e){return e=>e}return e=>{Xr(e,"element",(e=>{if(e.tagName==="img"){e.properties=e.properties||{};e.properties.loading="lazy";if(e.properties.src){e.properties["data-src"]=e.properties.src;e.properties.src=undefined}}}));return e}}}function ax(){return()=>e=>{Xr(e,"element",(e=>{var t,n;if(e.tagName==="a"){const r=(t=e.properties)===null||t===void 0?void 0:t.href;const s=(n=e.properties)===null||n===void 0?void 0:n.title;if(!r){return}const o=i(r,s);e.properties.target=o.target;e.properties.rel=o.rel;e.properties.referrerpolicy=o.referrerpolicy}}));return e}}async function
|
|
8
|
-
//# sourceMappingURL=p-
|
|
7
|
+
*/const ex=e=>{if(typeof e!=="string")return null;const t=DS.exec(e);if(t)return QS(t[0]);const n=MS.exec(e)||NS.exec(e);if(n)return ZS(n);const i=zS.exec(e)||GS.exec(e)||qS.exec(e)||FS.exec(e);if(i)return JS(i);if(YS.exec(e))return JS([null,0,0,0,0]);const r=wS[e.toLowerCase()];if(r)return JS([null,r[0],r[1],r[2],1]);return null};const tx=["background-color","color","font-style","font-weight","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-decoration","width","height","min-width","min-height"];function nx(e){var t;if(e.tagName&&((t=e.properties)===null||t===void 0?void 0:t.style)){e.properties.style=ix(e.properties.style)}}function ix(e){try{const t=yS(e);const n=rx(t);return Object.entries(n).filter((([e])=>tx.includes(e))).map((([e,t])=>`${e}: ${t}`)).join("; ")}catch(t){console.error("Failed to parse style value",e,t);return""}}function rx(e){const t=Object.assign({},e);delete t.background;if("background"in e&&sx(e.background)){t["background-color"]=e.background}return t}function sx(e){return ex(e)!==null}function ox(e=false){return()=>{if(!e){return e=>e}return e=>{Xr(e,"element",(e=>{if(e.tagName==="img"){e.properties=e.properties||{};e.properties.loading="lazy";if(e.properties.src){e.properties["data-src"]=e.properties.src;e.properties.src=undefined}}}));return e}}}function ax(){return()=>e=>{Xr(e,"element",(e=>{var t,n;if(e.tagName==="a"){const r=(t=e.properties)===null||t===void 0?void 0:t.href;const s=(n=e.properties)===null||n===void 0?void 0:n.title;if(!r){return}const o=i(r,s);e.properties.target=o.target;e.properties.rel=o.rel;e.properties.referrerpolicy=o.referrerpolicy}}));return e}}const lx=(e=false)=>()=>{if(!e){return e=>e}return e=>{px(e,null);return e}};const cx=/\u00A0/g;const ux=["200B","200C","200D","FEFF"];const fx=new Set(["audio","canvas","embed","iframe","img","input","object","svg","video"]);const hx=new Set(["br"]);const dx=e=>{let t=e;for(const e of ux){const n=String.fromCodePoint(Number.parseInt(e,16));t=t.split(n).join("")}return t};const px=(e,t)=>{if(!e||typeof e!=="object"){return}if(e.type==="element"&&e.tagName==="p"&&t&&mx(e)&&Array.isArray(t.children)){const n=t.children.indexOf(e);if(n!==-1){t.children.splice(n,1);return}}if(!Array.isArray(e.children)||e.children.length===0){return}for(let t=e.children.length-1;t>=0;t--){px(e.children[t],e)}};const mx=e=>{if(!Array.isArray(e.children)||e.children.length===0){return true}return e.children.every((e=>gx(e)))};const gx=e=>{if(!e){return true}if(e.type==="text"){return bx(typeof e.value==="string"?e.value:"")}if(e.type==="comment"){return true}if(e.type==="element"){const t=e;const n=t.tagName;if(typeof n!=="string"){return true}if(fx.has(n)){return false}if(hx.has(n)){return true}if(!Array.isArray(t.children)||t.children.length===0){return true}return t.children.every((e=>gx(e)))}return true};const bx=e=>{if(!e){return true}const t=dx(e.replaceAll(cx," "));return t.trim()===""};async function kx(e,t){var n;if(t===null||t===void 0?void 0:t.forceHardLineBreaks){e=e.replaceAll(/(?<!\\)([\n\r])/g," $1")}const i=await fe().use(Ci).use(rc).use(rs,{allowDangerousHtml:true}).use(eS).use(ax()).use(Em,Object.assign({},wx((n=t===null||t===void 0?void 0:t.whitelist)!==null&&n!==void 0?n:[]))).use((()=>e=>{Xr(e,"element",nx)})).use(lx(t===null||t===void 0?void 0:t.removeEmptyParagraphs)).use(ox(t===null||t===void 0?void 0:t.lazyLoadImages)).use(bb).process(e);return i.toString()}async function yx(e,t){const n=await fe().use(Jp).use(Em,Object.assign({},wx(t!==null&&t!==void 0?t:[]))).use((()=>e=>{Xr(e,"element",nx)})).use(bb).process(e);return n.toString()}function wx(e){var t,n,i;const r=[...(t=sm.attributes["*"])!==null&&t!==void 0?t:[]];const s=r.filter((e=>e!=="height"));s.push("style");const o=Object.assign(Object.assign({},sm),{tagNames:[...sm.tagNames||[],...e.map((e=>e.tagName))],attributes:Object.assign(Object.assign({},sm.attributes),{p:[...(n=sm.attributes.p)!==null&&n!==void 0?n:[],["className","MsoNormal"]],a:[...(i=sm.attributes.a)!==null&&i!==void 0?i:[],"referrerpolicy"],"*":s})});for(const t of e){o.attributes[t.tagName]=t.attributes}return o}export{S as d,i as g,kx as m,yx as s};
|
|
8
|
+
//# sourceMappingURL=p-7192af6b.js.map
|