Skip to content

Commit

Permalink
fixed path interaction for esc key
Browse files Browse the repository at this point in the history
  • Loading branch information
easylogic committed Mar 10, 2021
1 parent 8e336ba commit db442ab
Show file tree
Hide file tree
Showing 108 changed files with 394 additions and 51 deletions.
2 changes: 1 addition & 1 deletion dist/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html> <html> <head> <meta http-equiv=Pragma content=no-cache> <meta http-equiv=Expires content=-1> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-139740394-1"></script> <link rel=icon href=icon.png sizes=128x128> <script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-139740394-1")</script> <script>!function(e,n,a,t){e.dmndata=[],e.jenniferFront=function(e){window.dmndata.push(e)},e.dmnaid=t,e.dmnatime=new Date,e.dmnanocookie=!1,e.dmnajennifer="JENNIFER_FRONT@INTG";var d=6e4*Math.floor((new Date).getTime()/6e4),c=n.createElement(a);c.src="https://d-collect.jennifersoft.com/"+t+"/demian.js?"+d,c.async=!0,n.getElementsByTagName(a)[0].parentNode.appendChild(c)}(window,document,"script","cc474308-b29c-af41-7393-409d285dca6e")</script> <meta charset=utf-8 /> <title>Fantastic Web Design Tool</title> <meta name=viewport content="width=device-width,initial-scale=1,user-scalable=no"/> <meta name=description content="You can make simply web with Web editor. "/> <meta name=keywords content=html5,css,svg,editor> <meta name=author content=easylogic> <meta property=og:title content="Fantastic Web Design Tool"/> <meta property=og:type content=website /> <meta property=og:description content="You can make simply web with Web editor. "/> <meta property=og:url content=https://www.easylogic.studio /> <meta property=og:image content=https://www.easylogic.studio/images/editor.png /> <meta property=twitter:card content=summary_large_image> <meta property=twitter:url content=https://www.easylogic.studio> <meta property=twitter:title content="Fantastic Web Design Tool"> <meta property=twitter:description content="You can make simply web with Web editor. "> <meta property=twitter:image content=https://www.easylogic.studio/images/editor.png> <meta name="apple-mobile-web-app-title" content="EasyLogic Studio" /><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="apple-mobile-web-app-status-bar-style" content="black" /><link rel="manifest" href="manifest.d340e7a054029504e2ef48b504944d74.json" crossorigin="use-credentials" /><link href="main.css?d86ea32273d6a61499fb" rel="stylesheet"></head> <body> <div id=app></div> <script type="text/javascript" src="vendors~main.js?d1e9460fdff256ebbdac"></script><script type="text/javascript" src="main.js?33e6d2d194f359b37dc4"></script></body> </html>
<!doctype html> <html> <head> <meta http-equiv=Pragma content=no-cache> <meta http-equiv=Expires content=-1> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-139740394-1"></script> <link rel=icon href=icon.png sizes=128x128> <script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-139740394-1")</script> <script>!function(e,n,a,t){e.dmndata=[],e.jenniferFront=function(e){window.dmndata.push(e)},e.dmnaid=t,e.dmnatime=new Date,e.dmnanocookie=!1,e.dmnajennifer="JENNIFER_FRONT@INTG";var d=6e4*Math.floor((new Date).getTime()/6e4),c=n.createElement(a);c.src="https://d-collect.jennifersoft.com/"+t+"/demian.js?"+d,c.async=!0,n.getElementsByTagName(a)[0].parentNode.appendChild(c)}(window,document,"script","cc474308-b29c-af41-7393-409d285dca6e")</script> <meta charset=utf-8 /> <title>Fantastic Web Design Tool</title> <meta name=viewport content="width=device-width,initial-scale=1,user-scalable=no"/> <meta name=description content="You can make simply web with Web editor. "/> <meta name=keywords content=html5,css,svg,editor> <meta name=author content=easylogic> <meta property=og:title content="Fantastic Web Design Tool"/> <meta property=og:type content=website /> <meta property=og:description content="You can make simply web with Web editor. "/> <meta property=og:url content=https://www.easylogic.studio /> <meta property=og:image content=https://www.easylogic.studio/images/editor.png /> <meta property=twitter:card content=summary_large_image> <meta property=twitter:url content=https://www.easylogic.studio> <meta property=twitter:title content="Fantastic Web Design Tool"> <meta property=twitter:description content="You can make simply web with Web editor. "> <meta property=twitter:image content=https://www.easylogic.studio/images/editor.png> <meta name="apple-mobile-web-app-title" content="EasyLogic Studio" /><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="apple-mobile-web-app-status-bar-style" content="black" /><link rel="manifest" href="manifest.d340e7a054029504e2ef48b504944d74.json" crossorigin="use-credentials" /><link href="main.css?96c6db095fe7b905cc8d" rel="stylesheet"></head> <body> <div id=app></div> <script type="text/javascript" src="vendors~main.js?d1e9460fdff256ebbdac"></script><script type="text/javascript" src="main.js?5a9535b50ca58bd710e6"></script></body> </html>
2 changes: 1 addition & 1 deletion docs/main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/service-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@easylogic/editor",
"version": "0.10.5",
"version": "0.10.6",
"description": "Fantastic Web Design Tool ",
"main": "./dist/editor.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion src/assets/extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 2,
"version": "0.10.5",
"version": "0.10.6",
"name": "EasyLogic Studio",
"description": "Fantastic Web Design Tool ",
"author": "easylogic",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/whale/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 2,
"version": "0.10.5",
"version": "0.10.6",
"name": "EasyLogic Studio",
"description": "Fantastic Web Design Tool, Web 디자인 툴 ",
"author": "easylogic",
Expand Down
3 changes: 2 additions & 1 deletion src/core/EventMachine.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import { uuid } from "./functions/math";
import DomEventHandler from "./handler/DomEventHandler";
import BindHandler from "./handler/BindHandler";
import { retriveElement } from "./registerElement";

const REFERENCE_PROPERTY = "ref";
const TEMP_DIV = Dom.create("div");
Expand Down Expand Up @@ -337,7 +338,7 @@ export default class EventMachine {
}

getEventMachineComponent (refClassName) {
var EventMachineComponent = this.childComponents[refClassName];
var EventMachineComponent = retriveElement(refClassName) || this.childComponents[refClassName];

return EventMachineComponent;
}
Expand Down
10 changes: 10 additions & 0 deletions src/core/registerElement.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const map = {};


export function registElement(classes = {}) {
Object.assign(map, classes)
}

export function retriveElement(className) {
return map[className];
}
19 changes: 8 additions & 11 deletions src/designeditor/DesignEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import { DRAGOVER, DROP, PREVENT, TRANSITIONEND, KEYDOWN, KEYUP, IF, POINTERSTAR
import icon from "@icon/icon";
import { Length } from "@unit/Length";

import TimelineProperty from "@ui/control/TimelineProperty";
import Inspector from "@ui/control/Inspector";
import ObjectList from "@ui/control/ObjectList";

import popup from "@ui/popup";
import "@ui/popup";
import "@ui/window-list";
import "@ui/control";

import CanvasView from "@ui/view/CanvasView";
import ToolMenu from "@ui/view/ToolMenu";
Expand All @@ -20,12 +18,14 @@ import StatusBar from "@ui/view/StatusBar";
import PreviewToolMenu from "@ui/view/PreviewToolMenu";
import NotificationView from "@ui/view/NotificationView";
import PageSubEditor from "@ui/view-items/PageSubEditor";
import windowList from "@ui/window-list";

import HorizontalRuler from "@ui/view/HorizontalRuler";
import VerticalRuler from "@ui/view/VerticalRuler";
import { registElement } from "@core/registerElement";


const formElements = ['TEXTAREA', 'INPUT', 'SELECT']

export default class DesignEditor extends UIElement {

initialize () {
Expand Down Expand Up @@ -229,17 +229,12 @@ export default class DesignEditor extends UIElement {

components() {
return {
...windowList,
...popup,
ObjectList,
Inspector,
ToolMenu,
PageSubEditor,
CanvasView,
LogoView,
ExternalToolMenu,
StatusBar,
TimelineProperty,
PreviewToolMenu,
NotificationView,
HorizontalRuler,
Expand Down Expand Up @@ -365,3 +360,5 @@ export default class DesignEditor extends UIElement {
this.emit('keymap.keyup', e);
}
}

registElement({ DesignEditor })
4 changes: 0 additions & 4 deletions src/designeditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ import items from '@items';
import parse from '@parser';
import { Length } from "@unit/Length";


export default {
createDesignEditor(opts = { type: "white" }) {
return App.start({
components: {
DesignEditor
},
className: 'designeditor',
container: document.getElementById('app'),
template: /*html*/`
Expand Down
4 changes: 3 additions & 1 deletion src/pwa.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import EasyLogic from "./designeditor/index";
function startEditor() {

// 시작 지점을 고쳐보자.
var app = new EasyLogic.createDesignEditor();
var app = new EasyLogic.createDesignEditor({
version: '@@VERSION@@'
});
// app.commands.registerCommand('sample.ok', () => {
// alert('샘플 ok');
// })
Expand Down
5 changes: 5 additions & 0 deletions src/scss/designeditor/status-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
}
}

.version-view {
background-color: transparent !important;
text-align: center;
}


.status-selector {
display: inline-grid;
Expand Down
3 changes: 3 additions & 0 deletions src/ui/control/ArtboardItems.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import UIElement, { EVENT } from "@core/UIElement";
import { CLICK, DRAGSTART, LOAD } from "@core/Event";
import icon from "@icon/icon";
import { registElement } from "@core/registerElement";

export default class ArtboardItems extends UIElement {
template() {
Expand Down Expand Up @@ -62,3 +63,5 @@ export default class ArtboardItems extends UIElement {
this.emit('savePNG', 'afterSaveArtboard')
}
}

registElement({ ArtboardItems })
3 changes: 3 additions & 0 deletions src/ui/control/ComponentItems.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import UIElement from "@core/UIElement";
import menuItems from "../menu-items";
import { CLICK } from "@core/Event";
import { registElement } from "@core/registerElement";

export default class ComponentItems extends UIElement {

Expand Down Expand Up @@ -61,3 +62,5 @@ export default class ComponentItems extends UIElement {
}

}

registElement({ ComponentItems })
3 changes: 3 additions & 0 deletions src/ui/control/Inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import UIElement from "@core/UIElement";
import { CLICK } from "@core/Event";
import property from "../property/index";
import icon from "@icon/icon";
import { registElement } from "@core/registerElement";

export default class Inspector extends UIElement {

Expand Down Expand Up @@ -145,3 +146,5 @@ export default class Inspector extends UIElement {

}
}

registElement({ Inspector })
3 changes: 3 additions & 0 deletions src/ui/control/LayerTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import PreviewToolMenu from "../view/PreviewToolMenu";
import ShortCutItems from "./ShortCutItems";
import property from "../property";
import ArtboardItems from "./ArtboardItems";
import { registElement } from "@core/registerElement";


export default class LayerTab extends UIElement {
Expand Down Expand Up @@ -99,3 +100,5 @@ export default class LayerTab extends UIElement {
this.setState({ selectedIndex }, false);
}
}

registElement({ LayerTab })
20 changes: 11 additions & 9 deletions src/ui/control/LibraryItems.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import UIElement from "@core/UIElement";
import { CLICK } from "@core/Event";
import clipArt from "../clip-art";
import { registElement } from "@core/registerElement";

export default class LibraryItems extends UIElement {
components() {
Expand All @@ -23,17 +24,18 @@ export default class LibraryItems extends UIElement {
`;
}

[CLICK('$el .path-item')] (e) {
var $el = e.$dt;
var $svg = $el.$('svg');
var $path = $svg.$('path');
[CLICK('$el .path-item')] (e) {
var $el = e.$dt;
var $svg = $el.$('svg');
var $path = $svg.$('path');

var [x, y, width, height] = $svg.attr('viewBox').split(' ');
var [x, y, width, height] = $svg.attr('viewBox').split(' ');

var pathString = $path.attr('d');
var rect = {x: +x, y: +y, width: +width, height: +height}
var pathString = $path.attr('d');
var rect = {x: +x, y: +y, width: +width, height: +height}

this.emit('convertPath', pathString, rect);
this.emit('convertPath', pathString, rect);
}
}

}
registElement({ LibraryItems })
3 changes: 3 additions & 0 deletions src/ui/control/ObjectItems.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { registElement } from "@core/registerElement";
import UIElement from "@core/UIElement";
import LayerTreeProperty from "../property/LayerTreeProperty";

Expand All @@ -19,3 +20,5 @@ export default class ObjectItems extends UIElement {
}

}

registElement({ ObjectItems })
3 changes: 3 additions & 0 deletions src/ui/control/ObjectList.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { registElement } from "@core/registerElement";
import UIElement from "@core/UIElement";
import LayerTab from "./LayerTab";

Expand All @@ -16,3 +17,5 @@ export default class ObjectList extends UIElement {
}

}

registElement( { ObjectList })
3 changes: 3 additions & 0 deletions src/ui/control/ShortCutItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import UIElement from "@core/UIElement";
import { LOAD } from "@core/Event";
import shortcuts from "../../shortcuts";
import { os } from "@core/functions/detect";
import { registElement } from "@core/registerElement";

const keyUnitCode = {
'option': '⌥',
Expand Down Expand Up @@ -50,3 +51,5 @@ export default class ShortCutItems extends UIElement {
}

}

registElement({ ShortCutItems })
3 changes: 3 additions & 0 deletions src/ui/control/TimelineProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import TimelineValueEditor from "./timeline/TimelineValueEditor";
import { EVENT } from "@core/UIElement";
import TimelinePlayControl from "./timeline/TimelinePlayControl";
import TimelineAnimationProperty from "../property/TimelineAnimationProperty";
import { registElement } from "@core/registerElement";

export default class TimelineProperty extends BaseProperty {

Expand Down Expand Up @@ -107,3 +108,5 @@ export default class TimelineProperty extends BaseProperty {
}

}

registElement({ TimelineProperty })
21 changes: 21 additions & 0 deletions src/ui/control/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import ArtboardItems from "./ArtboardItems"
import ComponentItems from "./ComponentItems"
import Inspector from "./Inspector"
import LayerTab from "./LayerTab"
import LibraryItems from "./LibraryItems"
import ObjectItems from "./ObjectItems"
import ObjectList from "./ObjectList"
import ShortCutItems from "./ShortCutItems"
import TimelineProperty from "./TimelineProperty"

export default {
ArtboardItems,
ComponentItems,
Inspector,
LayerTab,
LibraryItems,
ObjectItems,
ObjectList,
ShortCutItems,
TimelineProperty,
}
3 changes: 3 additions & 0 deletions src/ui/control/timeline/KeyframeTimeControl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import UIElement, { EVENT } from "@core/UIElement";
import { THROTTLE, IF, PREVENT, KEYDOWN, KEYUP, ENTER, CLICK } from "@core/Event";
import icon from "@icon/icon";
import { registElement } from "@core/registerElement";

export default class KeyframeTimeControl extends UIElement {
template () {
Expand Down Expand Up @@ -161,3 +162,5 @@ export default class KeyframeTimeControl extends UIElement {
this.emit('moveTimeline');
}
}

registElement({ KeyframeTimeControl })
3 changes: 3 additions & 0 deletions src/ui/control/timeline/KeyframeTimeGridView.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import UIElement, { EVENT } from "@core/UIElement";
import { RESIZE, DEBOUNCE, THROTTLE } from "@core/Event";
import { registElement } from "@core/registerElement";

export default class KeyframeTimeGridView extends UIElement {
template () {
Expand Down Expand Up @@ -64,3 +65,5 @@ export default class KeyframeTimeGridView extends UIElement {
this.refresh();
}
}

registElement({ KeyframeTimeGridView })
3 changes: 3 additions & 0 deletions src/ui/control/timeline/KeyframeTimeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import UIElement, { EVENT } from "@core/UIElement";
import { RESIZE, DEBOUNCE, POINTERSTART, MOVE, THROTTLE, IF, END } from "@core/Event";
import { Length } from "@unit/Length";
import { second, framesToTimecode } from "@core/functions/time";
import { registElement } from "@core/registerElement";

const PADDING = 20

Expand Down Expand Up @@ -266,3 +267,5 @@ export default class KeyframeTimeView extends UIElement {
this.refresh();
}
}

registElement({ KeyframeTimeView })
5 changes: 4 additions & 1 deletion src/ui/control/timeline/TimelineKeyframeList.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { timecode, second } from "@core/functions/time";
import Dom from "@core/Dom";
import makeInterpolateOffset from "@interpolate/interpolate-functions/offset-path/makeInterpolateOffset";
import PathParser from "@parser/PathParser";
import { registElement } from "@core/registerElement";

const PADDING = 20

Expand Down Expand Up @@ -481,4 +482,6 @@ export default class TimelineKeyframeList extends UIElement {
[EVENT('resize.window') + DEBOUNCE(100)] () {
this.refresh();
}
}
}

registElement({ TimelineKeyframeList })
Loading

0 comments on commit db442ab

Please sign in to comment.