@huawei-ide/codearts 1.0.60 → 1.0.62

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 (2) hide show
  1. package/index.js +4 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,10 +1,12 @@
1
1
  import { EventEmitter, getOS } from './util'
2
2
 
3
3
  let hcOrigin = '';
4
- const OriginSuffix = window.location.origin.match(/(\.[a-zA-Z0-9.-]+)$/);
4
+ const OriginSuffix = window.location.origin.match(/(?:\w+\.)*?gitcode((?:\.\w+)+)$/);
5
5
  if (OriginSuffix) {
6
6
  const suffix = OriginSuffix[1];
7
- hcOrigin = `https://idea.gitcode${suffix}`;
7
+ hcOrigin = `https://idea.gitcode${suffix}`; // Adapter for gitcode multiple domains
8
+ } else {
9
+ hcOrigin = 'https://idea.gitcode.com'; // Adapter for cangjie playground
8
10
  }
9
11
  const iframe = document.createElement('iframe');
10
12
  iframe.id = 'codeartside';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huawei-ide/codearts",
3
- "version": "1.0.60",
3
+ "version": "1.0.62",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {