-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor core-editor as npm package: @luban-h5/core-editor
- Loading branch information
Showing
21 changed files
with
12,046 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@luban-h5/core-editor", | ||
"private": false, | ||
"version": "0.0.2", | ||
"description": "luban-h5 core-editor", | ||
"main": "dist/core-editor.umd.min.js", | ||
"author": "ly525", | ||
"license": "GPL-3.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* @Author: ly525 | ||
* @Date: 2020-10-11 10:13:51 | ||
* @LastEditors: ly525 | ||
* @LastEditTime: 2020-10-11 11:16:37 | ||
* @FilePath: /luban-h5/front-end/h5/src/components/core/store/index.js | ||
* @Github: https://github.com/ly525/luban-h5 | ||
* @Description: Do not edit | ||
* @Copyright 2018 - 2019 luban-h5. All Rights Reserved | ||
*/ | ||
import Vue from 'vue' | ||
import Vuex from 'vuex' | ||
import undoRedoPlugin from './plugins/undo-redo/index' | ||
import editor from './modules/editor' | ||
import user from './modules/user' | ||
import loading from './modules/loading' | ||
import i18n from './modules/i18n' | ||
|
||
Vue.use(Vuex) | ||
|
||
export default new Vuex.Store({ | ||
state: { | ||
|
||
}, | ||
mutations: { | ||
|
||
}, | ||
actions: { | ||
|
||
}, | ||
modules: { | ||
editor, | ||
user, | ||
loading, | ||
i18n | ||
}, | ||
plugins: [undoRedoPlugin] | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// initial state | ||
import Work from 'core/models/work' | ||
import { actions as pageActions, mutations as pageMutations } from './page' | ||
import { actions as elementActions, mutations as elementMutations } from './element' | ||
import { actions as workActions, mutations as workMutations } from './work' | ||
|
||
const state = { | ||
works: [], | ||
work: new Work(), | ||
editingPage: { elements: [] }, | ||
editingElement: null, | ||
formDetailOfWork: { | ||
uuidMap2Name: {}, | ||
formRecords: [] | ||
}, | ||
workTemplates: [] | ||
} | ||
|
||
// getters | ||
const getters = {} | ||
|
||
// actions | ||
const actions = { | ||
...elementActions, | ||
...pageActions, | ||
...workActions | ||
} | ||
|
||
// mutations | ||
const mutations = { | ||
...elementMutations, | ||
...pageMutations, | ||
...workMutations | ||
} | ||
|
||
export default { | ||
namespaced: true, | ||
state, | ||
getters, | ||
actions, | ||
mutations | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { loadLanguageAsync } from '@/locales' | ||
|
||
const i18n = { | ||
namespaced: true, | ||
state: { | ||
lang: 'zh-CN' | ||
}, | ||
mutations: { | ||
SET_LANG: (state, lang) => { | ||
state.lang = lang | ||
} | ||
}, | ||
actions: { | ||
// 设置界面语言 | ||
SetLang ({ commit }, lang) { | ||
return new Promise(resolve => { | ||
commit('SET_LANG', lang) | ||
loadLanguageAsync(lang) | ||
resolve() | ||
}) | ||
} | ||
} | ||
} | ||
|
||
export default i18n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* @Author: ly525 | ||
* @Date: 2019-11-24 18:51:58 | ||
* @LastEditors: ly525 | ||
* @LastEditTime: 2019-12-08 17:21:48 | ||
* @FilePath: /luban-h5/front-end/h5/src/store/modules/loading.js | ||
* @Github: https://github.com/ly525/luban-h5 | ||
* @Description: loading module | ||
* @Copyright 2018 - 2020 luban-h5. All Rights Reserved | ||
*/ | ||
// initial state | ||
const state = { | ||
saveWork_loading: false, | ||
previewWork_loading: false, | ||
fetchWorks_loading: false, | ||
setWorkAsTemplate_loading: false, | ||
fetchWorkTemplates_loading: false, | ||
useTemplate_loading: false, | ||
uploadWorkCover_loading: false | ||
} | ||
|
||
// getters | ||
const getters = { | ||
|
||
} | ||
|
||
// actions | ||
const actions = { | ||
update ({ commit }, payload) { | ||
commit('update', payload) | ||
} | ||
} | ||
|
||
// mutations | ||
const mutations = { | ||
update (state, { type, payload }) { | ||
state[type] = payload | ||
} | ||
} | ||
|
||
export default { | ||
namespaced: true, | ||
state, | ||
getters, | ||
actions, | ||
mutations | ||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.