Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,022 changes: 132 additions & 5,890 deletions app/assets/javascripts/locomotive/editor.js

Large diffs are not rendered by default.

249 changes: 116 additions & 133 deletions app/assets/stylesheets/locomotive/editor.css

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions app/javascript/src/locomotive/editor/styles/_list.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$editor-list-item-height: 4rem;

.editor-list-item {
display: flex;
align-items: center;
Expand All @@ -6,19 +8,19 @@
margin: 1rem 0rem;
background: #f7f7f7;
box-shadow: 0 0 0 1px rgba(63, 63, 68, 0.05), 0 1px 3px 0 rgba(63, 63, 68, 0.15);
min-height: 4rem;
min-height: $editor-list-item-height;
user-select: none;

&.with-separator {
margin-top: 4rem;
margin-top: $editor-list-item-height;
}

&--icon, &--image {
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
background: #D7D7D7;
width: 4rem;
height: 4rem;
width: $editor-list-item-height;
height: $editor-list-item-height;
}

&--icon {
Expand All @@ -34,20 +36,20 @@
}

&--label {
margin-left: 2rem;
padding-left: 2rem;
font-size: 1.2rem;
font-weight: bold;
text-transform: uppercase;
a {
color: #555;
&:hover {
text-decoration: none;
}
height: $editor-list-item-height;
width: 100%;
display: flex;
align-items: center;
&:hover {
text-decoration: none;
}
}

&--actions {
margin-left: auto;
margin-right: 2rem;
display: flex;
justify-content: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ const Block = ({ image, text, handleComponent, editPath, ...props }) => {

return (
<div className="editor-list-item">
{image && (
<div className="editor-list-item--image" style={{ backgroundImage: `url("${image}")` }}>
</div>
)}
<div className="editor-list-item--label">
<SlideLeftLink to={editPath}>
{truncate(text || props.blockDefinition.name, { length: 32 })}
</SlideLeftLink>
</div>
<SlideLeftLink to={editPath}>
{image && (
<div className="editor-list-item--image" style={{ backgroundImage: `url("${image}")` }}>
</div>
)}
</SlideLeftLink>
<SlideLeftLink to={editPath} className="editor-list-item--label">
{truncate(text || props.blockDefinition.name, { length: 32 })}
</SlideLeftLink>
<div className="editor-list-item--actions">
<Handle />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ const Section = ({ image, text, ...props }) => {

return (
<div className="editor-list-item editor-dropzone-section">
{image && (
<div className="editor-list-item--image" style={{ backgroundImage: `url("${image}")` }}>
</div>
)}
{!image && (
<div className="editor-list-item--icon">
{Icon && <Icon />}
</div>
)}
<div className="editor-list-item--label">
<SlideLeftLink to={props.editPath}>
{truncate(text || props.section.label || props.section.name || props.definition.name, { length: 32 })}
</SlideLeftLink>
</div>
<SlideLeftLink to={props.editPath}>
{image && (
<div className="editor-list-item--image" style={{ backgroundImage: `url("${image}")` }}>
</div>
)}
{!image && (
<div className="editor-list-item--icon">
{Icon && <Icon />}
</div>
)}
</SlideLeftLink>
<SlideLeftLink to={props.editPath} className="editor-list-item--label">
{truncate(text || props.section.label || props.section.name || props.definition.name, { length: 32 })}
</SlideLeftLink>
<div className="editor-list-item--actions">
<Handle />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ const Section = ({ image, text, section, definition, translate, separator, ...pr

return (
<div className={classnames('editor-list-item', separator ? 'with-separator' : null)}>
{image && (
<div className="editor-list-item--image" style={{ backgroundImage: `url("${image}")` }}>
</div>
)}
{!image && (
<div className="editor-list-item--icon">
{Icon && <Icon />}
</div>
)}
<div className="editor-list-item--label">
<SlideLeftLink to={props.editPath}>
{truncate(text || section.label || translate(definition.name), { length: 32 })}
</SlideLeftLink>
</div>
<SlideLeftLink to={props.editPath}>
{image && (
<div className="editor-list-item--image" style={{ backgroundImage: `url("${image}")` }}>
</div>
)}
{!image && (
<div className="editor-list-item--icon">
{Icon && <Icon />}
</div>
)}
</SlideLeftLink>
<SlideLeftLink to={props.editPath} className="editor-list-item--label">>
{truncate(text || section.label || translate(definition.name), { length: 32 })}
</SlideLeftLink>
<div className="editor-list-item--actions">
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion config/webpack/production.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const config = require('./development.js');

config.target = 'node'
config.target = 'web'
config.mode = 'production';
config.optimization = { minimize: true };

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"fstream": "^1.0.12",
"hoek": "^4.1.2",
"identity-obj-proxy": "^3.0.0",
"js-yaml": "^3.13.0",
"jest": "^24.8.0",
"js-yaml": "^3.13.0",
"jsdom": "^12.0.0",
"macaddress": "^0.2.9",
"mini-css-extract-plugin": "^0.4.0",
Expand All @@ -46,13 +46,14 @@
"postcss-loader": "^3.0.0",
"regenerator-runtime": "^0.11.1",
"sass-loader": "^7.0.1",
"tar": "^2.2.2",
"style-loader": "^0.21.0",
"tar": "^2.2.2",
"webpack": "4.19.0",
"webpack-cli": "^3.3.5"
},
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.3.0",
"autoprefixer": "^9.6.1",
"classnames": "^2.2.5",
"client-compress": "^2.1.2",
"draft-js": "^0.10.5",
Expand Down
49 changes: 49 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,19 @@ atob@^2.1.1:
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==

autoprefixer@^9.6.1:
version "9.6.1"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.6.1.tgz#51967a02d2d2300bb01866c1611ec8348d355a47"
integrity sha512-aVo5WxR3VyvyJxcJC3h4FKfwCQvQWb1tSI5VHNibddCVWrcD1NvlxEweg3TSgiPztMnWfjpy2FURKA2kvDE+Tw==
dependencies:
browserslist "^4.6.3"
caniuse-lite "^1.0.30000980"
chalk "^2.4.2"
normalize-range "^0.1.2"
num2fraction "^1.2.2"
postcss "^7.0.17"
postcss-value-parser "^4.0.0"

aws-sign2@~0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
Expand Down Expand Up @@ -1838,6 +1851,15 @@ browserslist@^4.3.4:
electron-to-chromium "^1.3.103"
node-releases "^1.1.3"

browserslist@^4.6.3:
version "4.6.4"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.4.tgz#fd0638b3f8867fec2c604ed0ed9300379f8ec7c2"
integrity sha512-ErJT8qGfRt/VWHSr1HeqZzz50DvxHtr1fVL1m5wf20aGrG8e1ce8fpZ2EjZEfs09DDZYSvtRaDlMpWslBf8Low==
dependencies:
caniuse-lite "^1.0.30000981"
electron-to-chromium "^1.3.188"
node-releases "^1.1.25"

bser@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719"
Expand Down Expand Up @@ -1970,6 +1992,11 @@ caniuse-lite@^1.0.30000929:
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000930.tgz#c238bab82bedb462bcbdc61d0334932dcc084d8a"
integrity sha512-KD+pw9DderBLB8CGqBzYyFWpnrPVOEjsjargU/CvkNyg60od3cxSPTcTeMPhxJhDbkQPWvOz5BAyBzNl/St9vg==

caniuse-lite@^1.0.30000980, caniuse-lite@^1.0.30000981:
version "1.0.30000983"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000983.tgz#ab3c70061ca2a3467182a10ac75109b199b647f8"
integrity sha512-/llD1bZ6qwNkt41AsvjsmwNOoA4ZB+8iqmf5LVyeSXuBODT/hAMFNVOh84NdUzoiYiSKqo5vQ3ZzeYHSi/olDQ==

capture-exit@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4"
Expand Down Expand Up @@ -2805,6 +2832,11 @@ electron-to-chromium@^1.3.103:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.106.tgz#672183160e783cb546cff83d9a98d5f69cd91874"
integrity sha512-eXX45p4q9CRxG0G8D3ZBZYSdN3DnrcZfrFvt6VUr1u7aKITEtRY/xwWzJ/UZcWXa7DMqPu/pYwuZ6Nm+bl0GmA==

electron-to-chromium@^1.3.188:
version "1.3.190"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.190.tgz#5bf599519983bfffd9d4387817039a3ed7ca085f"
integrity sha512-cs9WnTnGBGnYYVFMCtLmr9jXNTOkdp95RLz5VhwzDn7dErg1Lnt9o4d01gEH69XlmRKWUr91Yu1hA+Hi8qW0PA==

elliptic@^6.0.0:
version "6.4.1"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a"
Expand Down Expand Up @@ -5653,6 +5685,13 @@ node-pre-gyp@^0.12.0:
semver "^5.3.0"
tar "^4"

node-releases@^1.1.25:
version "1.1.25"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.25.tgz#0c2d7dbc7fed30fbe02a9ee3007b8c90bf0133d3"
integrity sha512-fI5BXuk83lKEoZDdH3gRhtsNgh05/wZacuXkgbiYkceE7+QIMXOg98n9ZV7mz27B+kFHnqHcUpscZZlGRSmTpQ==
dependencies:
semver "^5.3.0"

node-releases@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.3.tgz#aad9ce0dcb98129c753f772c0aa01360fb90fbd2"
Expand Down Expand Up @@ -5725,6 +5764,11 @@ normalize-path@^3.0.0:
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==

normalize-range@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942"
integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=

npm-bundled@^1.0.1:
version "1.0.5"
resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979"
Expand Down Expand Up @@ -5762,6 +5806,11 @@ nth-check@^1.0.2, nth-check@~1.0.1:
dependencies:
boolbase "~1.0.0"

num2fraction@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede"
integrity sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=

number-is-nan@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
Expand Down