@limetech/lime-elements 37.19.1 → 37.21.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/lime-elements.cjs.js +1 -1
  3. package/dist/cjs/limel-markdown.cjs.entry.js +3 -1
  4. package/dist/cjs/limel-markdown.cjs.entry.js.map +1 -1
  5. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +16080 -0
  6. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js.map +1 -0
  7. package/dist/cjs/limel-text-editor.cjs.entry.js +13 -16048
  8. package/dist/cjs/limel-text-editor.cjs.entry.js.map +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/collection/collection-manifest.json +1 -0
  11. package/dist/collection/components/markdown/allowed-css-properties.js +2 -0
  12. package/dist/collection/components/markdown/allowed-css-properties.js.map +1 -1
  13. package/dist/collection/components/markdown/markdown-parser.js +1 -1
  14. package/dist/collection/components/markdown/markdown-parser.js.map +1 -1
  15. package/dist/collection/components/text-editor/prosemirror-adapter.css +699 -0
  16. package/dist/collection/components/text-editor/prosemirror-adapter.js +122 -0
  17. package/dist/collection/components/text-editor/prosemirror-adapter.js.map +1 -0
  18. package/dist/collection/components/text-editor/text-editor.css +0 -699
  19. package/dist/collection/components/text-editor/text-editor.js +133 -45
  20. package/dist/collection/components/text-editor/text-editor.js.map +1 -1
  21. package/dist/esm/lime-elements.js +1 -1
  22. package/dist/esm/limel-markdown.entry.js +3 -1
  23. package/dist/esm/limel-markdown.entry.js.map +1 -1
  24. package/dist/esm/limel-prosemirror-adapter.entry.js +16076 -0
  25. package/dist/esm/limel-prosemirror-adapter.entry.js.map +1 -0
  26. package/dist/esm/limel-text-editor.entry.js +14 -16049
  27. package/dist/esm/limel-text-editor.entry.js.map +1 -1
  28. package/dist/esm/loader.js +1 -1
  29. package/dist/lime-elements/lime-elements.esm.js +1 -1
  30. package/dist/lime-elements/lime-elements.esm.js.map +1 -1
  31. package/dist/lime-elements/{p-10edf8b8.entry.js → p-0f45a6cc.entry.js} +2 -2
  32. package/dist/lime-elements/p-0f45a6cc.entry.js.map +1 -0
  33. package/dist/lime-elements/p-210c09a6.entry.js +2 -0
  34. package/dist/lime-elements/p-210c09a6.entry.js.map +1 -0
  35. package/dist/lime-elements/{p-ad6b52f8.entry.js → p-a8b9ae53.entry.js} +2 -2
  36. package/dist/lime-elements/{p-ad6b52f8.entry.js.map → p-a8b9ae53.entry.js.map} +1 -1
  37. package/dist/types/components/text-editor/prosemirror-adapter.d.ts +32 -0
  38. package/dist/types/components/text-editor/text-editor.d.ts +52 -13
  39. package/dist/types/components.d.ts +137 -24
  40. package/package.json +1 -1
  41. package/dist/lime-elements/p-10edf8b8.entry.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{r as e,c as i,h as t}from"./p-443111b3.js";const s="";const n=class{constructor(t){e(this,t);this.change=i(this,"change",7);this.handleChange=()=>e=>{e.stopPropagation();this.change.emit(e.detail)};this.disabled=undefined;this.readonly=undefined;this.helperText=undefined;this.placeholder=undefined;this.label=undefined;this.invalid=undefined;this.value=undefined}render(){return t("limel-prosemirror-adapter",{onChange:this.handleChange,value:this.value})}};n.style=s;export{n as limel_text_editor};
2
+ //# sourceMappingURL=p-210c09a6.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["textEditorCss","TextEditor","this","handleChange","event","stopPropagation","change","emit","detail","render","h","onChange","value"],"sources":["./src/components/text-editor/text-editor.scss?tag=limel-text-editor&encapsulation=shadow","./src/components/text-editor/text-editor.tsx"],"sourcesContent":[null,"import { Component, Event, EventEmitter, Prop, h } from '@stencil/core';\nimport { FormComponent } from '../form/form.types';\n/**\n * A rich text editor that allows the user to input and format text\n * The `limel-text-editor` can be used as a form field\n *\n * @exampleComponent limel-example-text-editor-basic\n * @beta\n * @private\n */\n@Component({\n tag: 'limel-text-editor',\n shadow: true,\n styleUrl: 'text-editor.scss',\n})\nexport class TextEditor implements FormComponent<{ html: string }> {\n /**\n * Set to `true` to disable the field.\n * Use `disabled` to indicate that the field can normally be interacted\n * with, but is currently disabled. This tells the user that if certain\n * requirements are met, the field may become enabled again.\n */\n @Prop({ reflect: true })\n public disabled?: boolean;\n\n /**\n * Set to `true` to make the component read-only.\n * Use `readonly` when the field is only there to present the data it holds,\n * and will not become possible for the current user to edit.\n * :::note\n * Consider that it might be better to use `limel-markdown`\n * instead of `limel-text-editor` when the goal is visualizing data.\n * :::\n */\n @Prop({ reflect: true })\n public readonly?: boolean;\n\n /**\n * Optional helper text to display below the input field when it has focus\n */\n @Prop({ reflect: true })\n public helperText?: string;\n\n /**\n * The placeholder text shown inside the input field,\n * when the field is empty.\n */\n @Prop({ reflect: true })\n public placeholder?: string;\n\n /**\n * The label of the editor\n */\n @Prop({ reflect: true })\n public label?: string;\n\n /**\n * Set to `true` to indicate that the current value of the editor is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid?: boolean;\n\n /**\n * Description of the text inside the editor\n */\n @Prop({ reflect: true })\n public value: { html: string };\n\n /**\n * Dispatched when a change is made to the editor\n */\n @Event()\n public change: EventEmitter<{ html: string }>;\n\n public render() {\n return (\n <limel-prosemirror-adapter\n onChange={this.handleChange}\n value={this.value}\n />\n );\n }\n\n private handleChange = () => (event: CustomEvent<{ html: string }>) => {\n event.stopPropagation();\n this.change.emit(event.detail);\n };\n}\n"],"mappings":"kDAAA,MAAMA,EAAgB,G,MCeTC,EAAU,M,wDAqEXC,KAAAC,aAAe,IAAOC,IAC1BA,EAAMC,kBACNH,KAAKI,OAAOC,KAAKH,EAAMI,OAAO,E,sKAX3BC,SACH,OACIC,EAAA,6BACIC,SAAUT,KAAKC,aACfS,MAAOV,KAAKU,O"}
@@ -4,5 +4,5 @@ import{r as e,h as t}from"./p-443111b3.js";import{c as n,a as r,g as i}from"./p-
4
4
  * @version v0.2.1
5
5
  * @link http://github.com/noeldelgado/parse-css-color/
6
6
  * @license MIT
7
- */const sy=e=>{if(typeof e!=="string")return null;const t=qk.exec(e);if(t)return iy(t[0]);const n=jk.exec(e)||zk.exec(e);if(n)return oy(n);const r=Xk.exec(e)||Qk.exec(e)||Gk.exec(e)||Yk.exec(e);if(r)return ly(r);if(Jk.exec(e))return ly([null,0,0,0,0]);const i=Ck[e.toLowerCase()];if(i)return ly([null,i[0],i[1],i[2],1]);return null};const ay=["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"];function uy(e){if(e.tagName&&e.properties&&e.properties.style){e.properties.style=cy(e.properties.style)}}function cy(e){try{const t=Ak(e);const n=fy(t);return Object.entries(n).filter((([e])=>ay.includes(e))).map((([e,t])=>`${e}: ${t}`)).join("; ")}catch(t){console.error("Failed to parse style value",e,t);return""}}function fy(e){const t=Object.assign({},e);delete t.background;if("background"in e&&hy(e.background)){t["background-color"]=e.background}return t}function hy(e){return sy(e)!==null}async function dy(e,t){if(t===null||t===void 0?void 0:t.forceHardLineBreaks){e=e.replace(/([\n\r])/g," $1")}const n=await G().use(sr).use(Ba).use(Bi,{allowDangerousHtml:true}).use(Za,{target:"_blank"}).use(sk).use(vu,Object.assign(Object.assign({},ou),{attributes:Object.assign(Object.assign({},ou.attributes),{"*":["style"]})})).use((()=>e=>{Di(e,"element",uy)})).use(kf).process(e);return n.toString()}const py='@charset "UTF-8";code{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-size:0.8125rem;letter-spacing:-0.0125rem;color:rgb(var(--contrast-1300));-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;display:inline-block;border-radius:0.25rem;padding:0.03125rem 0.25rem;background-color:rgb(var(--contrast-600))}pre>code{display:block;margin:0.5rem 0;padding:0.5rem 0.75rem;overflow:auto;white-space:pre-wrap}h1{font-size:1.5rem}h2{font-size:1.25rem}h3{font-size:1.125rem}h4{font-size:1rem}h5{font-size:0.875rem}h6{font-size:0.75rem}h1,h2{margin-top:0.5rem;margin-bottom:0.5rem;letter-spacing:-0.03125rem;font-weight:500}h3,h4{margin-top:0.75rem;margin-bottom:0.25rem;font-weight:600}h5,h6{margin-top:0.5rem;margin-bottom:0.125rem;font-weight:600}h1,h2,h3,h4,h5,h6{word-break:break-word;hyphens:auto;-webkit-hyphens:auto}:not([contenteditable=true]) h1,:not([contenteditable=true]) h2,:not([contenteditable=true]) h3,:not([contenteditable=true]) h4,:not([contenteditable=true]) h5,:not([contenteditable=true]) h6{text-wrap:balance}[contenteditable=true] h1,[contenteditable=true] h2,[contenteditable=true] h3,[contenteditable=true] h4,[contenteditable=true] h5,[contenteditable=true] h6{text-wrap:initial}:host(limel-markdown.truncate-paragraphs) p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}p,li{font-size:0.875rem;word-break:break-word;hyphens:auto;-webkit-hyphens:auto}a{word-break:break-all}p{margin-top:0;margin-bottom:0.5rem}p:only-child{margin-bottom:0}a{transition:color 0.2s ease;color:var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));text-decoration:none}a:hover{color:var(--markdown-hyperlink-color--hovered, rgb(var(--color-blue-default)))}hr{margin:1.75rem 0 2rem 0;border-width:0;border-top:1px solid rgb(var(--contrast-500))}ul{list-style:none}ul li{position:relative;margin-left:0.75rem}ul li:before{content:"";position:absolute;left:-0.5rem;top:0.5rem;width:0.25rem;height:0.25rem;border-radius:50%;background-color:rgb(var(--contrast-700));display:block}ol{margin-top:0.25rem;padding-left:1rem}ul{margin-top:0.25rem;padding-left:0}ul ul,ul ol,ol ol,ol ul{margin-left:0}li{margin-bottom:0.25rem}:host(limel-markdown:not(.no-table-styles)) table{table-layout:auto;min-width:100%;border-collapse:collapse;border-spacing:0;background:transparent;margin:0.75rem 0;border:1px solid rgb(var(--contrast-400))}:host(limel-markdown:not(.no-table-styles)) th,:host(limel-markdown:not(.no-table-styles)) td{text-align:left;vertical-align:top;transition:background-color 0.2s ease;font-size:0.875rem}:host(limel-markdown:not(.no-table-styles)) td{padding:0.5rem 0.375rem 0.75rem 0.375rem}:host(limel-markdown:not(.no-table-styles)) tr th{background-color:rgb(var(--contrast-400));padding:0.25rem 0.375rem;font-weight:normal}:host(limel-markdown:not(.no-table-styles)) tr th:only-child{text-align:center}:host(limel-markdown:not(.no-table-styles)) tbody tr:nth-child(odd) td{background-color:rgb(var(--contrast-200))}:host(limel-markdown:not(.no-table-styles)) tbody tr:hover td{background-color:rgb(var(--contrast-300))}blockquote{position:relative;font-weight:100;font-size:0.875rem;max-width:100%;line-height:1.4;margin:0;padding:0.5rem 1.25rem;border-radius:0.05rem 0.75rem;background-color:rgb(var(--contrast-300))}blockquote:before,blockquote:after{position:absolute;font-size:2.75rem;opacity:0.4}blockquote:before{content:"“";left:0;top:-0.75rem}blockquote:after{content:"”";right:0;bottom:-2rem}dl{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;margin-bottom:2rem;border:1px solid rgb(var(--contrast-400));border-radius:0.375rem;background-color:rgb(var(--contrast-200))}dl dt,dl dd{padding:0.375rem 0.5rem;font-size:0.875rem;margin:0}dl dt:nth-of-type(even),dl dd:nth-of-type(even){background-color:rgb(var(--contrast-300))}dl dt:first-child{border-top-left-radius:0.375rem}dl dt:last-child{border-bottom-left-radius:0.375rem}dl dd:first-child{border-top-right-radius:0.375rem}dl dd:last-child{border-bottom-right-radius:0.375rem}hr{border-top:1px solid rgb(var(--contrast-700))}img{max-width:100%}';const gy=class{constructor(t){e(this,t);this.value=undefined}async textChanged(){try{const e=await dy(this.value,{forceHardLineBreaks:true});this.rootElement.innerHTML=e}catch(e){console.error(e)}}async componentDidLoad(){this.textChanged()}render(){return[t("div",{id:"markdown",ref:e=>this.rootElement=e})]}static get watchers(){return{value:["textChanged"]}}};gy.style=py;export{gy as limel_markdown};
8
- //# sourceMappingURL=p-ad6b52f8.entry.js.map
7
+ */const sy=e=>{if(typeof e!=="string")return null;const t=qk.exec(e);if(t)return iy(t[0]);const n=jk.exec(e)||zk.exec(e);if(n)return oy(n);const r=Xk.exec(e)||Qk.exec(e)||Gk.exec(e)||Yk.exec(e);if(r)return ly(r);if(Jk.exec(e))return ly([null,0,0,0,0]);const i=Ck[e.toLowerCase()];if(i)return ly([null,i[0],i[1],i[2],1]);return null};const ay=["background-color","color","font-style","font-weight","height","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-decoration","width"];function uy(e){if(e.tagName&&e.properties&&e.properties.style){e.properties.style=cy(e.properties.style)}}function cy(e){try{const t=Ak(e);const n=fy(t);return Object.entries(n).filter((([e])=>ay.includes(e))).map((([e,t])=>`${e}: ${t}`)).join("; ")}catch(t){console.error("Failed to parse style value",e,t);return""}}function fy(e){const t=Object.assign({},e);delete t.background;if("background"in e&&hy(e.background)){t["background-color"]=e.background}return t}function hy(e){return sy(e)!==null}async function dy(e,t){if(t===null||t===void 0?void 0:t.forceHardLineBreaks){e=e.replace(/([\n\r])/g," $1")}const n=await G().use(sr).use(Ba).use(Bi,{allowDangerousHtml:true}).use(Za,{target:"_blank"}).use(sk).use(vu,Object.assign(Object.assign({},ou),{attributes:Object.assign(Object.assign({},ou.attributes),{"*":["height","style","width"]})})).use((()=>e=>{Di(e,"element",uy)})).use(kf).process(e);return n.toString()}const py='@charset "UTF-8";code{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-size:0.8125rem;letter-spacing:-0.0125rem;color:rgb(var(--contrast-1300));-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;display:inline-block;border-radius:0.25rem;padding:0.03125rem 0.25rem;background-color:rgb(var(--contrast-600))}pre>code{display:block;margin:0.5rem 0;padding:0.5rem 0.75rem;overflow:auto;white-space:pre-wrap}h1{font-size:1.5rem}h2{font-size:1.25rem}h3{font-size:1.125rem}h4{font-size:1rem}h5{font-size:0.875rem}h6{font-size:0.75rem}h1,h2{margin-top:0.5rem;margin-bottom:0.5rem;letter-spacing:-0.03125rem;font-weight:500}h3,h4{margin-top:0.75rem;margin-bottom:0.25rem;font-weight:600}h5,h6{margin-top:0.5rem;margin-bottom:0.125rem;font-weight:600}h1,h2,h3,h4,h5,h6{word-break:break-word;hyphens:auto;-webkit-hyphens:auto}:not([contenteditable=true]) h1,:not([contenteditable=true]) h2,:not([contenteditable=true]) h3,:not([contenteditable=true]) h4,:not([contenteditable=true]) h5,:not([contenteditable=true]) h6{text-wrap:balance}[contenteditable=true] h1,[contenteditable=true] h2,[contenteditable=true] h3,[contenteditable=true] h4,[contenteditable=true] h5,[contenteditable=true] h6{text-wrap:initial}:host(limel-markdown.truncate-paragraphs) p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}p,li{font-size:0.875rem;word-break:break-word;hyphens:auto;-webkit-hyphens:auto}a{word-break:break-all}p{margin-top:0;margin-bottom:0.5rem}p:only-child{margin-bottom:0}a{transition:color 0.2s ease;color:var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));text-decoration:none}a:hover{color:var(--markdown-hyperlink-color--hovered, rgb(var(--color-blue-default)))}hr{margin:1.75rem 0 2rem 0;border-width:0;border-top:1px solid rgb(var(--contrast-500))}ul{list-style:none}ul li{position:relative;margin-left:0.75rem}ul li:before{content:"";position:absolute;left:-0.5rem;top:0.5rem;width:0.25rem;height:0.25rem;border-radius:50%;background-color:rgb(var(--contrast-700));display:block}ol{margin-top:0.25rem;padding-left:1rem}ul{margin-top:0.25rem;padding-left:0}ul ul,ul ol,ol ol,ol ul{margin-left:0}li{margin-bottom:0.25rem}:host(limel-markdown:not(.no-table-styles)) table{table-layout:auto;min-width:100%;border-collapse:collapse;border-spacing:0;background:transparent;margin:0.75rem 0;border:1px solid rgb(var(--contrast-400))}:host(limel-markdown:not(.no-table-styles)) th,:host(limel-markdown:not(.no-table-styles)) td{text-align:left;vertical-align:top;transition:background-color 0.2s ease;font-size:0.875rem}:host(limel-markdown:not(.no-table-styles)) td{padding:0.5rem 0.375rem 0.75rem 0.375rem}:host(limel-markdown:not(.no-table-styles)) tr th{background-color:rgb(var(--contrast-400));padding:0.25rem 0.375rem;font-weight:normal}:host(limel-markdown:not(.no-table-styles)) tr th:only-child{text-align:center}:host(limel-markdown:not(.no-table-styles)) tbody tr:nth-child(odd) td{background-color:rgb(var(--contrast-200))}:host(limel-markdown:not(.no-table-styles)) tbody tr:hover td{background-color:rgb(var(--contrast-300))}blockquote{position:relative;font-weight:100;font-size:0.875rem;max-width:100%;line-height:1.4;margin:0;padding:0.5rem 1.25rem;border-radius:0.05rem 0.75rem;background-color:rgb(var(--contrast-300))}blockquote:before,blockquote:after{position:absolute;font-size:2.75rem;opacity:0.4}blockquote:before{content:"“";left:0;top:-0.75rem}blockquote:after{content:"”";right:0;bottom:-2rem}dl{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;margin-bottom:2rem;border:1px solid rgb(var(--contrast-400));border-radius:0.375rem;background-color:rgb(var(--contrast-200))}dl dt,dl dd{padding:0.375rem 0.5rem;font-size:0.875rem;margin:0}dl dt:nth-of-type(even),dl dd:nth-of-type(even){background-color:rgb(var(--contrast-300))}dl dt:first-child{border-top-left-radius:0.375rem}dl dt:last-child{border-bottom-left-radius:0.375rem}dl dd:first-child{border-top-right-radius:0.375rem}dl dd:last-child{border-bottom-right-radius:0.375rem}hr{border-top:1px solid rgb(var(--contrast-700))}img{max-width:100%}';const gy=class{constructor(t){e(this,t);this.value=undefined}async textChanged(){try{const e=await dy(this.value,{forceHardLineBreaks:true});this.rootElement.innerHTML=e}catch(e){console.error(e)}}async componentDidLoad(){this.textChanged()}render(){return[t("div",{id:"markdown",ref:e=>this.rootElement=e})]}static get watchers(){return{value:["textChanged"]}}};gy.style=py;export{gy as limel_markdown};
8
+ //# sourceMappingURL=p-a8b9ae53.entry.js.map