Skip to content

Commit

Permalink
mini modification for spacing plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
gugakatsi committed May 21, 2023
1 parent 7e706b1 commit 09a7d92
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
src/
.babelrc
webpack.config.js
yarn.lock
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@editorjs/warning",
"version": "1.3.0",
"name": "editorjs-spacing",
"version": "1.0.1",
"keywords": [
"codex editor",
"tool",
Expand All @@ -9,17 +9,17 @@
"editor.js",
"editor"
],
"description": "Warning Tool for Editor.js",
"description": "Spacing Tool for Editor.js",
"license": "MIT",
"repository": "https://github.com/editor-js/warning",
"main": "./dist/bundle.js",
"repository": "https://github.com/symbo-ls/editorjs-spacing.git",
"main": "./src/index.js",
"scripts": {
"build": "webpack --mode production",
"build:dev": "webpack --mode development --watch"
},
"author": {
"name": "CodeX Team",
"email": "[email protected]"
"name": "Symbols",
"email": "[email protected]"
},
"devDependencies": {
"@babel/core": "^7.3.4",
Expand Down
26 changes: 14 additions & 12 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class Warning {
static get toolbox() {
return {
icon: IconWarning,
title: 'Warning',
title: 'Spacing',
};
}

Expand All @@ -63,7 +63,7 @@ export default class Warning {
* @returns {string}
*/
static get DEFAULT_TITLE_PLACEHOLDER() {
return 'Title';
return 'Spacing in px';
}

/**
Expand Down Expand Up @@ -123,16 +123,16 @@ export default class Warning {
contentEditable: !this.readOnly,
innerHTML: this.data.title,
});
const message = this._make('div', [this.CSS.input, this.CSS.message], {
contentEditable: !this.readOnly,
innerHTML: this.data.message,
});
// const message = this._make('div', [this.CSS.input, this.CSS.message], {
// contentEditable: !this.readOnly,
// innerHTML: this.data.message,
// });

title.dataset.placeholder = this.titlePlaceholder;
message.dataset.placeholder = this.messagePlaceholder;
// message.dataset.placeholder = this.messagePlaceholder;

container.appendChild(title);
container.appendChild(message);
// container.appendChild(message);

return container;
}
Expand All @@ -145,11 +145,12 @@ export default class Warning {
*/
save(warningElement) {
const title = warningElement.querySelector(`.${this.CSS.title}`);
const message = warningElement.querySelector(`.${this.CSS.message}`);
// const message = warningElement.querySelector(`.${this.CSS.message}`);

return Object.assign(this.data, {
title: title.innerHTML,
message: message.innerHTML,
space: title.innerHTML,
spacingType: 'px', // TODO add dropdown
// message: message.innerHTML,
});
}

Expand Down Expand Up @@ -184,7 +185,8 @@ export default class Warning {
*/
static get sanitize() {
return {
title: {},
space: {},
spacingType: {},
message: {},
};
}
Expand Down

0 comments on commit 09a7d92

Please sign in to comment.