Skip to content

Commit

Permalink
Fix #58 (#59)
Browse files Browse the repository at this point in the history
* refactor

* remove unused statement

* refactor

* extract router

* move to props

* injectable

* move logic

* move directive installer

* change layout

* remove local vue

* use package

* fix pkg

* fix markup
  • Loading branch information
sterashima78 authored Feb 12, 2021
1 parent 8a499ed commit 18747f6
Show file tree
Hide file tree
Showing 14 changed files with 447 additions and 468 deletions.
521 changes: 345 additions & 176 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
"build:all": "npm-run-all -s build build:docs"
},
"dependencies": {
"@sterashima/vue-component-render": "^0.0.1-alpha.5",
"@sterashima/vue-component-sandbox": "^0.0.1-alpha.6",
"@vue/composition-api": "^1.0.0-rc.1",
"core-js": "^3.6.4",
"downloadjs": "^1.4.7",
"ejs": "^3.0.1",
"fp-ts": "^2.5.1",
"klona": "^2.0.4",
"lodash.clonedeep": "^4.5.0",
"lodash.merge": "^4.6.2",
"lodash.throttle": "^4.1.1",
Expand All @@ -27,7 +28,6 @@
"uuid": "^7.0.3",
"vue": "^2.6.12",
"vue-gtag": "^1.6.2",
"vue-iframe-sandbox": "^0.1.4",
"vue-router": "^3.1.5",
"vuetify": "^2.2.11"
},
Expand Down
19 changes: 6 additions & 13 deletions src/components/PageMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
:key="route"
:style="{ background: currentRoute === route ? '#eee' : '' }"
:disabled="currentRoute === route"
@click="routing.push({ path: route })"
@click="emit('update:route', route)"
>
<v-list-item-content>
<v-list-item-title v-text="route" />
Expand Down Expand Up @@ -56,19 +56,12 @@ import { AliasDaoInjectionKey } from "@/domain/alias";
export default defineComponent({
props: {
addRoute: {
type: Function,
default: () => console.log("not init")
},
currentRoute: {
type: String
},
routing: {
type: Object as PropType<{ push: (option: { path: string }) => void }>,
default: () => ({ push: (opt: any) => console.log(opt) })
type: String as PropType<string>,
default: ""
}
},
setup(props: { addRoute: (path: string) => void }) {
setup(_, { emit }) {
const nodeDao = inject(NodeDaoInjectionKey);
const aliasDao = inject(AliasDaoInjectionKey);
if (!nodeDao || !aliasDao) {
Expand All @@ -78,14 +71,14 @@ export default defineComponent({
const newPath = ref("");
const createRoute = () => {
addNewPath(newPath.value);
props.addRoute(newPath.value);
newPath.value = "";
};
return {
newPath,
addNewPath,
allRoute,
createRoute
createRoute,
emit
};
}
});
Expand Down
27 changes: 0 additions & 27 deletions src/components/VueCanvas.vue

This file was deleted.

6 changes: 0 additions & 6 deletions src/compositions/useLocalVue/cloneObject.worker.ts

This file was deleted.

98 changes: 0 additions & 98 deletions src/compositions/useLocalVue/createInstance.ts

This file was deleted.

106 changes: 0 additions & 106 deletions src/compositions/useLocalVue/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NodeData } from "@/types";
import { EleNode, NodeTree } from "@sterashima/vue-component-render";
import { EleNode, NodeTree } from "@sterashima/vue-component-sandbox";

export type NodeDataToNodeTree = (node: NodeData) => NodeTree;
export const toNodeTree: NodeDataToNodeTree = node => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NodeTree, NodeData, RouteNodeTreeData, RouteNodeTree } from "@/types";
import clone from "lodash.clonedeep";
import { klona as clone } from "klona/json";
const toNodeData = (hoverNodeId: string, dropNodeId: string) => (
tree: NodeTree
): NodeData => {
Expand All @@ -19,11 +19,6 @@ const toNodeData = (hoverNodeId: string, dropNodeId: string) => (
id,
draggable: true
},
directives: [
{
name: "web-builder"
}
],
props: attributes,
style: styles,
class: classes,
Expand Down
Loading

0 comments on commit 18747f6

Please sign in to comment.