From 8f9809dae7ce730fc931040bc577aefc3b47ba00 Mon Sep 17 00:00:00 2001 From: Murod Khaydarov Date: Sat, 25 Nov 2017 13:58:29 +0300 Subject: [PATCH] New Tools module --- codex-editor.js | 392 +++++++++++++++++++++++++++++++++++++++++++ codex-editor.js.map | 1 + example/example.html | 34 +++- src/codex.js | 38 +---- src/modules/core.js | 4 +- src/modules/tools.js | 121 ++++++++++++- 6 files changed, 540 insertions(+), 50 deletions(-) create mode 100644 codex-editor.js create mode 100644 codex-editor.js.map diff --git a/codex-editor.js b/codex-editor.js new file mode 100644 index 00000000..601ed0fa --- /dev/null +++ b/codex-editor.js @@ -0,0 +1,392 @@ +var CodexEditor = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + /** + * Codex Editor + * + * + * + * + * @author CodeX Team + */ + + /** + * @typedef {CodexEditor} CodexEditor - editor class + */ + + /** + * @typedef {Object} EditorConfig + * @property {String} holderId - Element to append Editor + * ... + */ + + /** + * All Editor components + */ + var modules = [__webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"./src/modules/dom\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())), __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"./src/modules/core\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())), __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"./src/modules/ui\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())), __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"./src/modules/tools\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()))]; + + /** + * @class + * + * @classdesc CodeX Editor base class + * + * @property this.config - all settings + * @property this.moduleInstances - constructed editor components + * + * @type {CodexEditor} + */ + module.exports = function () { + _createClass(CodexEditor, null, [{ + key: 'version', + + + /** Editor version */ + get: function get() { + + return ("2.0.0"); + } + + /** + * @param {EditorConfig} config - user configuration + * + */ + + }]); + + function CodexEditor(config) { + + 'use strict'; + + /** + * Configuration object + */ + + var _this = this; + + _classCallCheck(this, CodexEditor); + + this.config = {}; + + /** + * Editor Components + */ + this.moduleInstances = {}; + + Promise.resolve().then(function () { + + _this.configuration = config; + }).then(function () { + return _this.init(); + }).then(function () { + return _this.start(); + }).then(function () { + + console.log('CodeX Editor is ready'); + }).catch(function (error) { + + console.log('CodeX Editor does not ready beecause of %o', error); + }); + } + + /** + * Setting for configuration + * @param {object} config + */ + + + _createClass(CodexEditor, [{ + key: 'init', + + + /** + * Initializes modules: + * - make and save instances + * - configure + */ + value: function init() { + + /** + * Make modules instances and save it to the @property this.moduleInstances + */ + this.constructModules(); + + /** + * Modules configuration + */ + this.configureModules(); + } + + /** + * Make modules instances and save it to the @property this.moduleInstances + */ + + }, { + key: 'constructModules', + value: function constructModules() { + var _this2 = this; + + modules.forEach(function (Module) { + + _this2.moduleInstances[Module.name] = new Module({ + config: _this2.configuration + }); + }); + } + + /** + * Modules instances configuration: + * - pass other modules to the 'state' property + * - ... + */ + + }, { + key: 'configureModules', + value: function configureModules() { + + for (var name in this.moduleInstances) { + + /** + * Module does not need self-instance + */ + this.moduleInstances[name].state = this.getModulesDiff(name); + } + } + + /** + * Return modules without passed name + */ + + }, { + key: 'getModulesDiff', + value: function getModulesDiff(name) { + + var modules = {}; + + for (var moduleName in this.moduleInstances) { + + /** + * Skip module with passed name + */ + if (moduleName == name) { + + continue; + } + modules[moduleName] = this.moduleInstances[moduleName]; + } + + return modules; + } + + /** + * Start Editor! + * + * @return {Promise} + */ + + }, { + key: 'start', + value: function start() { + + var prepareDecorator = function prepareDecorator(module) { + return module.prepare(); + }; + + return Promise.resolve().then(prepareDecorator(this.moduleInstances['core'])).then(prepareDecorator(this.moduleInstances['ui'])).then(prepareDecorator(this.moduleInstances['tools'])).catch(function (error) { + + console.log('Error occured', error); + }); + } + }, { + key: 'configuration', + set: function set() { + var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + + this.config.holderId = config.holderId; + this.config.placeholder = config.placeholder || 'write your story...'; + this.config.sanitizer = config.sanitizer || { + p: true, + b: true, + a: true + }; + + this.config.hideToolbar = config.hideToolbar ? config.hideToolbar : false; + } + + /** + * Returns private property + * @returns {{}|*} + */ + , + get: function get() { + + return this.config; + } + }]); + + return CodexEditor; + }(); + + // module.exports = (function (editor) { + // + // 'use strict'; + // + // editor.version = VERSION; + // editor.scriptPrefix = 'cdx-script-'; + // + // var init = function () { + // + // editor.core = require('./modules/core'); + // editor.tools = require('./modules/tools'); + // editor.ui = require('./modules/ui'); + // editor.transport = require('./modules/transport'); + // editor.renderer = require('./modules/renderer'); + // editor.saver = require('./modules/saver'); + // editor.content = require('./modules/content'); + // editor.toolbar = require('./modules/toolbar/toolbar'); + // editor.callback = require('./modules/callbacks'); + // editor.draw = require('./modules/draw'); + // editor.caret = require('./modules/caret'); + // editor.notifications = require('./modules/notifications'); + // editor.parser = require('./modules/parser'); + // editor.sanitizer = require('./modules/sanitizer'); + // editor.listeners = require('./modules/listeners'); + // editor.destroyer = require('./modules/destroyer'); + // editor.paste = require('./modules/paste'); + // + // }; + // + // /** + // * @public + // * holds initial settings + // */ + // editor.settings = { + // tools : ['paragraph', 'header', 'picture', 'list', 'quote', 'code', 'twitter', 'instagram', 'smile'], + // holderId : 'codex-editor', + // + // // Type of block showing on empty editor + // initialBlockPlugin: 'paragraph' + // }; + // + // /** + // * public + // * + // * Static nodes + // */ + // editor.nodes = { + // holder : null, + // wrapper : null, + // toolbar : null, + // inlineToolbar : { + // wrapper : null, + // buttons : null, + // actions : null + // }, + // toolbox : null, + // notifications : null, + // plusButton : null, + // showSettingsButton: null, + // showTrashButton : null, + // blockSettings : null, + // pluginSettings : null, + // defaultSettings : null, + // toolbarButtons : {}, // { type : DomEl, ... } + // redactor : null + // }; + // + // /** + // * @public + // * + // * Output state + // */ + // editor.state = { + // jsonOutput : [], + // blocks : [], + // inputs : [] + // }; + // + // /** + // * @public + // * Editor plugins + // */ + // editor.tools = {}; + // + // editor.start = function (userSettings) { + // + // init(); + // + // editor.core.prepare(userSettings) + // + // // If all ok, make UI, bind events and parse initial-content + // .then(editor.ui.prepare) + // .then(editor.tools.prepare) + // .then(editor.sanitizer.prepare) + // .then(editor.paste.prepare) + // .then(editor.transport.prepare) + // .then(editor.renderer.makeBlocksFromData) + // .then(editor.ui.saveInputs) + // .catch(function (error) { + // + // editor.core.log('Initialization failed with error: %o', 'warn', error); + // + // }); + // + // }; + // + // return editor; + // + // })({}); + +/***/ }) +/******/ ]); +//# sourceMappingURL=codex-editor.js.map \ No newline at end of file diff --git a/codex-editor.js.map b/codex-editor.js.map new file mode 100644 index 00000000..7b599ad5 --- /dev/null +++ b/codex-editor.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap 5fc2d6f1c1d34aecf6ab","webpack:///./src/codex.js"],"names":["modules","require","module","exports","config","moduleInstances","Promise","resolve","then","configuration","init","start","console","log","catch","error","constructModules","configureModules","forEach","Module","name","state","getModulesDiff","moduleName","prepareDecorator","prepare","holderId","placeholder","sanitizer","p","b","a","hideToolbar"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACtCA;;;;;;;;;AASA;;;;AAIA;;;;;;AAMA;;;AAGA,KAAMA,UAAU,CACZ,mBAAAC,CAAQ,6IAAR,CADY,EAEZ,mBAAAA,CAAQ,8IAAR,CAFY,EAGZ,mBAAAA,CAAQ,4IAAR,CAHY,EAIZ,mBAAAA,CAAQ,+IAAR,CAJY,CAAhB;;AAOA;;;;;;;;;;AAUAC,QAAOC,OAAP;AAAA;AAAA;;;AAEI;AAFJ,6BAGyB;;AAEjB,oBAAO,SAAP;AAEH;;AAED;;;;;AATJ;;AAaI,0BAAYC,MAAZ,EAAoB;;AAEhB;;AAEA;;;;AAJgB;;AAAA;;AAOhB,cAAKA,MAAL,GAAc,EAAd;;AAEA;;;AAGA,cAAKC,eAAL,GAAuB,EAAvB;;AAEAC,iBAAQC,OAAR,GACKC,IADL,CACU,YAAM;;AAER,mBAAKC,aAAL,GAAqBL,MAArB;AAEH,UALL,EAMKI,IANL,CAMU;AAAA,oBAAM,MAAKE,IAAL,EAAN;AAAA,UANV,EAOKF,IAPL,CAOU;AAAA,oBAAM,MA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,W","file":"codex-editor.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 5fc2d6f1c1d34aecf6ab","/**\n * Codex Editor\n *\n *\n *\n *\n * @author CodeX Team\n */\n\n/**\n * @typedef {CodexEditor} CodexEditor - editor class\n */\n\n/**\n * @typedef {Object} EditorConfig\n * @property {String} holderId - Element to append Editor\n * ...\n */\n\n/**\n * All Editor components\n */\nconst modules = [\n require('./src/modules/dom'),\n require('./src/modules/core'),\n require('./src/modules/ui'),\n require('./src/modules/tools')\n];\n\n/**\n * @class\n *\n * @classdesc CodeX Editor base class\n *\n * @property this.config - all settings\n * @property this.moduleInstances - constructed editor components\n *\n * @type {CodexEditor}\n */\nmodule.exports = class CodexEditor {\n\n /** Editor version */\n static get version() {\n\n return VERSION;\n\n }\n\n /**\n * @param {EditorConfig} config - user configuration\n *\n */\n constructor(config) {\n\n 'use strict';\n\n /**\n * Configuration object\n */\n this.config = {};\n\n /**\n * Editor Components\n */\n this.moduleInstances = {};\n\n Promise.resolve()\n .then(() => {\n\n this.configuration = config;\n\n })\n .then(() => this.init())\n .then(() => this.start())\n .then(() => {\n\n console.log('CodeX Editor is ready');\n\n })\n .catch(error => {\n\n console.log('CodeX Editor does not ready beecause of %o', error);\n\n });\n\n }\n\n /**\n * Setting for configuration\n * @param {object} config\n */\n set configuration(config = {}) {\n\n this.config.holderId = config.holderId;\n this.config.placeholder = config.placeholder || 'write your story...';\n this.config.sanitizer = config.sanitizer || {\n p: true,\n b: true,\n a: true\n };\n\n this.config.hideToolbar = config.hideToolbar ? config.hideToolbar : false;\n\n }\n\n /**\n * Returns private property\n * @returns {{}|*}\n */\n get configuration() {\n\n return this.config;\n\n }\n\n /**\n * Initializes modules:\n * - make and save instances\n * - configure\n */\n init() {\n\n /**\n * Make modules instances and save it to the @property this.moduleInstances\n */\n this.constructModules();\n\n /**\n * Modules configuration\n */\n this.configureModules();\n\n }\n\n /**\n * Make modules instances and save it to the @property this.moduleInstances\n */\n constructModules() {\n\n modules.forEach( Module => {\n\n this.moduleInstances[Module.name] = new Module({\n config : this.configuration\n });\n\n });\n\n }\n\n /**\n * Modules instances configuration:\n * - pass other modules to the 'state' property\n * - ...\n */\n configureModules() {\n\n for(let name in this.moduleInstances) {\n\n /**\n * Module does not need self-instance\n */\n this.moduleInstances[name].state = this.getModulesDiff( name );\n\n }\n\n }\n\n /**\n * Return modules without passed name\n */\n getModulesDiff( name ) {\n\n let modules = {};\n\n for(let moduleName in this.moduleInstances) {\n\n /**\n * Skip module with passed name\n */\n if (moduleName == name) {\n\n continue;\n\n }\n modules[moduleName] = this.moduleInstances[moduleName];\n\n }\n\n return modules;\n\n }\n\n /**\n * Start Editor!\n *\n * @return {Promise}\n */\n start() {\n\n let prepareDecorator = module => module.prepare();\n\n return Promise.resolve()\n .then(prepareDecorator(this.moduleInstances['core']))\n .then(prepareDecorator(this.moduleInstances['ui']))\n .then(prepareDecorator(this.moduleInstances['tools']))\n .catch(function (error) {\n\n console.log('Error occured', error);\n\n });\n }\n\n};\n\n// module.exports = (function (editor) {\n//\n// 'use strict';\n//\n// editor.version = VERSION;\n// editor.scriptPrefix = 'cdx-script-';\n//\n// var init = function () {\n//\n// editor.core = require('./modules/core');\n// editor.tools = require('./modules/tools');\n// editor.ui = require('./modules/ui');\n// editor.transport = require('./modules/transport');\n// editor.renderer = require('./modules/renderer');\n// editor.saver = require('./modules/saver');\n// editor.content = require('./modules/content');\n// editor.toolbar = require('./modules/toolbar/toolbar');\n// editor.callback = require('./modules/callbacks');\n// editor.draw = require('./modules/draw');\n// editor.caret = require('./modules/caret');\n// editor.notifications = require('./modules/notifications');\n// editor.parser = require('./modules/parser');\n// editor.sanitizer = require('./modules/sanitizer');\n// editor.listeners = require('./modules/listeners');\n// editor.destroyer = require('./modules/destroyer');\n// editor.paste = require('./modules/paste');\n//\n// };\n//\n// /**\n// * @public\n// * holds initial settings\n// */\n// editor.settings = {\n// tools : ['paragraph', 'header', 'picture', 'list', 'quote', 'code', 'twitter', 'instagram', 'smile'],\n// holderId : 'codex-editor',\n//\n// // Type of block showing on empty editor\n// initialBlockPlugin: 'paragraph'\n// };\n//\n// /**\n// * public\n// *\n// * Static nodes\n// */\n// editor.nodes = {\n// holder : null,\n// wrapper : null,\n// toolbar : null,\n// inlineToolbar : {\n// wrapper : null,\n// buttons : null,\n// actions : null\n// },\n// toolbox : null,\n// notifications : null,\n// plusButton : null,\n// showSettingsButton: null,\n// showTrashButton : null,\n// blockSettings : null,\n// pluginSettings : null,\n// defaultSettings : null,\n// toolbarButtons : {}, // { type : DomEl, ... }\n// redactor : null\n// };\n//\n// /**\n// * @public\n// *\n// * Output state\n// */\n// editor.state = {\n// jsonOutput : [],\n// blocks : [],\n// inputs : []\n// };\n//\n// /**\n// * @public\n// * Editor plugins\n// */\n// editor.tools = {};\n//\n// editor.start = function (userSettings) {\n//\n// init();\n//\n// editor.core.prepare(userSettings)\n//\n// // If all ok, make UI, bind events and parse initial-content\n// .then(editor.ui.prepare)\n// .then(editor.tools.prepare)\n// .then(editor.sanitizer.prepare)\n// .then(editor.paste.prepare)\n// .then(editor.transport.prepare)\n// .then(editor.renderer.makeBlocksFromData)\n// .then(editor.ui.saveInputs)\n// .catch(function (error) {\n//\n// editor.core.log('Initialization failed with error: %o', 'warn', error);\n//\n// });\n//\n// };\n//\n// return editor;\n//\n// })({});\n\n\n\n// WEBPACK FOOTER //\n// ./src/codex.js"],"sourceRoot":""} \ No newline at end of file diff --git a/example/example.html b/example/example.html index a50eabdb..b6374c34 100644 --- a/example/example.html +++ b/example/example.html @@ -53,21 +53,39 @@ - - + +