@huawei-ide/codearts 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +2 -2
  2. package/index.js +4 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -34,8 +34,8 @@
34
34
  7. 获取当前文件最新内容,返回 Promise:
35
35
  `await ide.getContent();`
36
36
 
37
- 8. 设置 Token
38
- `ide.setToken();`
37
+ 8. 设置 DomainId 及 UserId
38
+ `ide.setUserId(domainId: string, userId: string);`
39
39
 
40
40
  9. 监听当前文件变化
41
41
 
package/index.js CHANGED
@@ -3,7 +3,7 @@ import { EventEmitter } from './util'
3
3
  const hcOrigin = 'https://res.hc-cdn.com';
4
4
  const iframe = document.createElement('iframe');
5
5
  iframe.id = 'codeartside';
6
- iframe.src = hcOrigin + '/codearts-core-web-static/1.0.17/resources/server/gitcode.html';
6
+ iframe.src = hcOrigin + '/codearts-core-web-static/1.0.19/resources/server/gitcode.html';
7
7
  iframe.width = '1px';
8
8
  iframe.height = '1px';
9
9
  iframe.style.opacity = 0;
@@ -103,10 +103,10 @@ export function getContent() {
103
103
  return ideContent();
104
104
  }
105
105
 
106
- export function setToken(token) {
106
+ export function setUserId(domainId, userId) {
107
107
  const message = {
108
- type: 'setToken',
109
- data: token
108
+ type: 'setUserId',
109
+ data: { domainId, userId }
110
110
  };
111
111
  postMessage(message);
112
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huawei-ide/codearts",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {