From 262c1614ed1e8e4367bf90ddafc1a4886a345baf Mon Sep 17 00:00:00 2001 From: Peter Savchenko Date: Sat, 20 Oct 2018 17:54:15 +0300 Subject: [PATCH] New tools added + code highlighting (#12) --- package.json | 35 +- public/dist/code-styling.bundle.js | 1 + public/dist/code-styling.css | 1 + public/dist/editor.bundle.js | 871 +++++----- public/dist/main.bundle.js | 4 +- public/dist/main.css | 2 +- src/frontend/js/app.js | 2 + src/frontend/js/classes/codeStyler.js | 46 + src/frontend/js/classes/editor.js | 17 + src/frontend/js/modules/page.js | 36 + src/frontend/styles/components/page.pcss | 29 + src/views/pages/blocks/code.twig | 1 + src/views/pages/blocks/list.twig | 12 + src/views/pages/page.twig | 4 +- yarn.lock | 1957 ++++++++++------------ 15 files changed, 1510 insertions(+), 1508 deletions(-) create mode 100644 public/dist/code-styling.bundle.js create mode 100644 public/dist/code-styling.css create mode 100644 src/frontend/js/classes/codeStyler.js create mode 100644 src/frontend/js/modules/page.js create mode 100644 src/views/pages/blocks/code.twig create mode 100644 src/views/pages/blocks/list.twig diff --git a/package.json b/package.json index 42c65e6..c7f7e9e 100644 --- a/package.json +++ b/package.json @@ -13,19 +13,19 @@ "dependencies": { "@babel/polyfill": "^7.0.0", "body-parser": "latest", - "codex.editor": "^2.0.11", + "codex.editor": "^2.1.3", "codex.editor.header": "^2.0.5", "cookie-parser": "~1.4.3", - "debug": "~2.6.9", + "debug": "~4.1.0", "express": "~4.16.0", - "http-errors": "~1.6.2", + "http-errors": "~1.7.1", "module-dispatcher": "^1.0.2", "morgan": "~1.9.0", "multer": "^1.3.1", "nedb": "^1.8.0", "nodemon": "^1.18.3", "normalize.css": "^8.0.0", - "twig": "~0.10.3", + "twig": "~1.12.0", "uuid4": "^1.0.0" }, "devDependencies": { @@ -38,32 +38,37 @@ "babel-loader": "^8.0.2", "chai": "^4.1.2", "chai-http": "^4.0.0", + "codex.editor.code": "^2.0.0", + "codex.editor.inline-code": "^1.0.1", + "codex.editor.list": "^1.0.2", + "codex.editor.marker": "^1.0.1", "cross-env": "^5.2.0", "css-loader": "^1.0.0", "cssnano": "^4.1.0", "eslint": "^5.3.0", "eslint-config-codex": "github:codex-team/eslint-config", "eslint-plugin-chai-friendly": "^0.4.1", - "husky": "^0.14.3", + "highlight.js": "^9.13.1", + "husky": "^1.1.2", "mini-css-extract-plugin": "^0.4.3", "mocha": "^5.2.0", "mocha-sinon": "^2.1.0", - "nyc": "^12.0.2", + "nyc": "^13.1.0", "postcss": "^7.0.2", "postcss-apply": "^0.11.0", - "postcss-color-hex-alpha": "^3.0.0", - "postcss-color-mod-function": "^2.4.3", - "postcss-custom-media": "^6.0.0", - "postcss-custom-properties": "^7.0.0", - "postcss-custom-selectors": "^4.0.1", + "postcss-color-hex-alpha": "^5.0.2", + "postcss-color-mod-function": "^3.0.3", + "postcss-custom-media": "^7.0.7", + "postcss-custom-properties": "^8.0.8", + "postcss-custom-selectors": "^5.1.2", "postcss-font-family-system-ui": "^4.1.0", "postcss-loader": "^3.0.0", - "postcss-media-minmax": "^3.0.0", - "postcss-nested": "^3.0.0", + "postcss-media-minmax": "^4.0.0", + "postcss-nested": "^4.1.0", "postcss-nested-ancestors": "^2.0.0", - "postcss-nesting": "^6.0.0", + "postcss-nesting": "^7.0.0", "postcss-smart-import": "^0.7.6", - "sinon": "^6.3.5", + "sinon": "^7.0.0", "webpack": "^4.17.1", "webpack-cli": "^3.1.0" } diff --git a/public/dist/code-styling.bundle.js b/public/dist/code-styling.bundle.js new file mode 100644 index 0000000..c20d36c --- /dev/null +++ b/public/dist/code-styling.bundle.js @@ -0,0 +1 @@ +(window.webpackJsonpDocs=window.webpackJsonpDocs||[]).push([[2],Array(50).concat([function(e,n){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,n,t){var r=t(56),a=t(50);e.exports=function(e){return r(a(e))}},function(e,n,t){var r=t(30)("keys"),a=t(18);e.exports=function(e){return r[e]||(r[e]=a(e))}},function(e,n,t){var r=t(50);e.exports=function(e){return Object(r(e))}},function(e,n,t){"use strict";var r=t(19),a=t(12),i=t(14),o=t(11),s=t(13),c=t(66),u=t(29),l=t(72),f=t(1)("iterator"),g=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,n,t,p,v,E,h){c(t,n,p);var b,m,y,_=function(e){if(!g&&e in O)return O[e];switch(e){case"keys":case"values":return function(){return new t(this,e)}}return function(){return new t(this,e)}},R=n+" Iterator",w="values"==v,N=!1,O=e.prototype,x=O[f]||O["@@iterator"]||v&&O[v],M=x||_(v),S=v?w?_("entries"):M:void 0,A="Array"==n&&O.entries||x;if(A&&(y=l(A.call(new e)))!==Object.prototype&&y.next&&(u(y,R,!0),r||"function"==typeof y[f]||o(y,f,d)),w&&x&&"values"!==x.name&&(N=!0,M=function(){return x.call(this)}),r&&!h||!g&&!N&&O[f]||o(O,f,M),s[n]=M,s[R]=d,v)if(b={values:w?M:_("values"),keys:E?M:_("keys"),entries:S},h)for(m in b)m in O||i(O,m,b[m]);else a(a.P+a.F*(g||N),n,b);return b}},function(e,n,t){var r=t(69),a=t(57);e.exports=Object.keys||function(e){return r(e,a)}},function(e,n,t){var r=t(10);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,n){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},,,,,,,function(e,n,t){"use strict";var r=t(65)(!0);t(54)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,n=this._t,t=this._i;return t>=n.length?{value:void 0,done:!0}:(e=r(n,t),this._i+=e.length,{value:e,done:!1})})},function(e,n,t){var r=t(28),a=t(50);e.exports=function(e){return function(n,t){var i,o,s=String(a(n)),c=r(t),u=s.length;return c<0||c>=u?e?"":void 0:(i=s.charCodeAt(c))<55296||i>56319||c+1===u||(o=s.charCodeAt(c+1))<56320||o>57343?e?s.charAt(c):i:e?s.slice(c,c+2):o-56320+(i-55296<<10)+65536}}},function(e,n,t){"use strict";var r=t(67),a=t(27),i=t(29),o={};t(11)(o,t(1)("iterator"),function(){return this}),e.exports=function(e,n,t){e.prototype=r(o,{next:a(1,t)}),i(e,n+" Iterator")}},function(e,n,t){var r=t(2),a=t(68),i=t(57),o=t(52)("IE_PROTO"),s=function(){},c=function(){var e,n=t(17)("iframe"),r=i.length;for(n.style.display="none",t(34).appendChild(n),n.src="javascript:",(e=n.contentWindow.document).open(),e.write("