mirror of
https://github.com/webislife/wc-wysiwyg.git
synced 2025-07-21 11:32:22 +00:00
0.9.34 fix for bug with el.fn, update dist folder
This commit is contained in:
2
dist/core/el.js
vendored
2
dist/core/el.js
vendored
@ -1 +1 @@
|
|||||||
export const el=(tagName,{classList,styles,props,attrs,options,append}={})=>{if(!tagName)throw new Error(`Undefined tag ${tagName}`);const element=document.createElement(tagName,options);if(classList)for(let i=0;i<classList.length;i++){const styleClass=classList[i];element.classList.add(styleClass)}if(styles){const stylesKeys=Object.keys(styles);for(let i=0;i<stylesKeys.length;i++){const key=stylesKeys[i];element.style[key]=styles[key]}}if(props){const propKeys=Object.keys(props);for(let i=0;i<propKeys.length;i++){const key=propKeys[i];element[key]=props[key]}}if(attrs){const attrsKeys=Object.keys(attrs);for(let i=0;i<attrsKeys.length;i++){const key=attrsKeys[i];attrs[key]&&element.setAttribute(key,attrs[key])}}if(append)for(let i=0;i<append.length;i++){const appendEl=append[i];element.append(appendEl)}return element};
|
export const el=(tagName,{classList,styles,props,attrs,options,append}={})=>{if(!tagName)throw new Error(`Undefined tag ${tagName}`);const element=document.createElement(tagName,options);if(classList)for(let i=0;i<classList.length;i++)classList[i]&&element.classList.add(classList[i]);if(styles&&Object.assign(element.style,styles),props){const propKeys=Object.keys(props);for(let i=0;i<propKeys.length;i++){const key=propKeys[i];element[key]=props[key]}}if(attrs){const attrsKeys=Object.keys(attrs);for(let i=0;i<attrsKeys.length;i++){const key=attrsKeys[i];attrs[key]&&element.setAttribute(key,attrs[key])}}return append&&element.append(...append),element};
|
2
dist/core/translates.js
vendored
2
dist/core/translates.js
vendored
File diff suppressed because one or more lines are too long
12
dist/sass/content.css
vendored
12
dist/sass/content.css
vendored
@ -75,19 +75,10 @@ h5 {
|
|||||||
h6 {
|
h6 {
|
||||||
font-size: 1em; }
|
font-size: 1em; }
|
||||||
|
|
||||||
/* h1[id]::before,
|
|
||||||
h2[id]::before,
|
|
||||||
h3[id]::before,
|
|
||||||
h4[id]::before,
|
|
||||||
h5[id]::before,
|
|
||||||
h6[id]::before {
|
|
||||||
content: '§';
|
|
||||||
color: var(--color-blue-gray-300);
|
|
||||||
margin-right: 0.5em;
|
|
||||||
} */
|
|
||||||
/* del\ins */
|
/* del\ins */
|
||||||
del {
|
del {
|
||||||
color: var(--color-red-900);
|
color: var(--color-red-900);
|
||||||
|
border-bottom: 1px solid var(--color-red-900);
|
||||||
background-color: var(--color-red-50);
|
background-color: var(--color-red-50);
|
||||||
text-decoration: none; }
|
text-decoration: none; }
|
||||||
|
|
||||||
@ -104,6 +95,7 @@ del:before {
|
|||||||
|
|
||||||
ins {
|
ins {
|
||||||
color: var(--color-green-900);
|
color: var(--color-green-900);
|
||||||
|
border-bottom: 1px solid var(--color-green-900);
|
||||||
background-color: var(--color-green-50);
|
background-color: var(--color-green-50);
|
||||||
text-decoration: none; }
|
text-decoration: none; }
|
||||||
|
|
||||||
|
2
dist/wc-wysiwyg.js
vendored
2
dist/wc-wysiwyg.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@webislife/wc-wysiwyg",
|
"name": "@webislife/wc-wysiwyg",
|
||||||
"version": "0.9.33",
|
"version": "0.9.34",
|
||||||
"description": "WYWSIWYG HTML5 Editor written in ts and designed by web-componennt, support all JS frameworks and browsers",
|
"description": "WYWSIWYG HTML5 Editor written in ts and designed by web-componennt, support all JS frameworks and browsers",
|
||||||
"main": "dist/wc-wysiwyg.js",
|
"main": "dist/wc-wysiwyg.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* Short for document.createElement
|
* Short for document.createElement
|
||||||
* @param tagName element tag name
|
* @param tagName element tag name
|
||||||
* @param params list of object params for document.createElements
|
* @param params list of object params for document.createElements
|
||||||
* @returns
|
* @returns HTMLElement\CustomElement
|
||||||
*/
|
*/
|
||||||
export const el = (tagName:keyof HTMLElementTagNameMap|string, {classList, styles, props, attrs, options, append}:{
|
export const el = (tagName:keyof HTMLElementTagNameMap|string, {classList, styles, props, attrs, options, append}:{
|
||||||
classList?: string[],
|
classList?: string[],
|
||||||
@ -21,8 +21,9 @@
|
|||||||
// element.classList
|
// element.classList
|
||||||
if(classList) {
|
if(classList) {
|
||||||
for (let i = 0; i < classList.length; i++) {
|
for (let i = 0; i < classList.length; i++) {
|
||||||
const styleClass = classList[i];
|
if(classList[i]){
|
||||||
element.classList.add(styleClass)
|
element.classList.add(classList[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// element.style[prop]
|
// element.style[prop]
|
||||||
@ -48,8 +49,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//append child elements
|
//append child elements
|
||||||
if(append.length) {
|
if(append) {
|
||||||
element.append(...append);
|
element.append(...append);
|
||||||
}
|
}
|
||||||
|
|
||||||
return element;
|
return element;
|
||||||
};
|
};
|
Reference in New Issue
Block a user