Skip to content

Commit f913542

Browse files
committed
增加inject component方式注入component
1 parent 4c4894b commit f913542

File tree

5 files changed

+46
-25
lines changed

5 files changed

+46
-25
lines changed

CHANGELOG

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
order: 2
3+
title: 更新日志
4+
toc: false
5+
timeline: true
6+
---
7+
# Changelog
8+
All notable changes to this project will be documented in this file.
9+
10+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
11+
and this project adheres to [Semantic Versioning](http://semver.org/).
12+
13+
14+
## 0.0.1-alpha.05
15+
ADDED:
16+
- injectComponent 支持
17+
18+
## 0.0.1
19+
20+
### Main
21+
ADDED: 增加基础的sdk功能

package.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "WebIDE-Plugin-AccessUrl",
3-
"version": "0.0.1-alpha.04",
3+
"version": "0.0.1-alpha.05",
44
"description": "WebIDE-Plugin-AccessUrl for Coding WebIDE",
55
"repository": {
6-
"url": "https://github.com/blizzardzheng/WebIDE-Plugin-Env.git"
6+
"url": "git@github.com:Coding/WebIDE-Plugin-Env.git"
77
},
88
"license": "ISC",
99
"author": "candy <candy.zhengxq@gmail.com>",
@@ -15,14 +15,7 @@
1515
"name": "access-url",
1616
"displayName": "Access URL",
1717
"description": "WebIDE-Plugin-AccessUrl for Coding WebIDE",
18-
"type": "extension",
19-
"ui": {
20-
"position": "right",
21-
"label": {
22-
"text": "Access URL",
23-
"icon": "fa fa-external-link"
24-
}
25-
}
18+
"type": "extension"
2619
},
2720
"devDependencies": {
2821
"babel-cli": "^6.14.0",
@@ -34,7 +27,6 @@
3427
"babel-preset-react": "^6.23.0",
3528
"babel-preset-stage-0": "^6.22.0",
3629
"chai": "^3.5.0",
37-
"codingSDK": "https://git@github.com/blizzardzheng/WebIDE-Plugin-SDK.git",
3830
"css-loader": "^0.26.1",
3931
"enzyme": "^2.2.0",
4032
"eslint": "^3.6.0",
@@ -62,6 +54,7 @@
6254
"react": "^0.14.7 || ^15.0.0"
6355
},
6456
"dependencies": {
57+
"codingSDK": "https://github.com/Coding/WebIDE-Plugin-SDK.git#0.0.1-alpha.06",
6558
"babel-preset-env": "^1.1.8",
6659
"babel-runtime": "^6.11.6",
6760
"body-parser": "^1.15.2",

src/app.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ AccessUrl.propTypes = {
1212
};
1313
export const store = global.getStoreByReducer(reducer)
1414

15-
export default props => (
15+
const app = props => (
1616
<Provider store={store}>
1717
<AccessUrl {...props} />
1818
</Provider>
1919
);
20+
21+
export default React.createElement(app)

src/manager.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,21 @@ export const global = new APP({
66
pkgId: 'coding_web_ide_plugin',
77
});
88

9-
9+
const { injectComponent } = global;
1010
export default class {
1111
pluginWillMount() {
12-
console.log('this plugin will Mount');
12+
console.log('this plugin will Moun');
13+
injectComponent.addComToSideBar('right', {
14+
text: 'Access URL',
15+
icon: 'fa fa-external-link',
16+
key: 'access-url',
17+
onSidebarActive: () => {
18+
console.log('Access URL is active');
19+
},
20+
onSidebarDeactive: () => {
21+
console.log('Access URL is deactive');
22+
},
23+
}, extension => extension.app);
1324
}
1425
pluginOnActive() {
1526

yarn.lock

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,25 +1332,19 @@ code-point-at@^1.0.0:
13321332
version "1.1.0"
13331333
resolved "http://registry.npm.taobao.org/code-point-at/download/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
13341334

1335-
"codingSDK@https://git@github.com/blizzardzheng/WebIDE-Plugin-SDK.git":
1336-
version "0.0.1-alpha.3"
1337-
resolved "https://git@github.com/blizzardzheng/WebIDE-Plugin-SDK.git#19e8e38de406b47fc726a769e3dd5c4352d9f00d"
1335+
"codingSDK@https://github.com/Coding/WebIDE-Plugin-SDK.git#0.0.1-alpha.06":
1336+
version "0.0.1-alpha.6"
1337+
resolved "https://github.com/Coding/WebIDE-Plugin-SDK.git#ae14e5e46735d2fcb76c9a030d655514357a68c5"
13381338
dependencies:
13391339
babel-preset-env "^1.1.8"
13401340
babel-runtime "^6.11.6"
1341-
body-parser "^1.15.2"
1342-
classnames "^2.2.5"
13431341
cors "^2.8.1"
1344-
express "^4.14.0"
13451342
fs-promise "^1.0.0"
13461343
nodemon "^1.11.0"
1347-
react-redux "^4.4.6"
1348-
redux "^3.6.0"
1349-
redux-actions "^1.1.0"
1350-
redux-thunk "^2.1.0"
13511344
rimraf "^2.6.1"
1352-
socket.io "^1.7.3"
13531345
style-loader "^0.13.2"
1346+
webpack "^2.2.1"
1347+
webpack-cleanup-plugin "^0.4.1"
13541348

13551349
color-convert@^1.3.0:
13561350
version "1.9.0"

0 commit comments

Comments
 (0)