@node-projects/web-component-designer 0.0.191 → 0.0.192

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.
@@ -21,7 +21,15 @@ export class WebcomponentManifestParserService extends AbstractPropertiesService
21
21
  this._importPrefix = importPrefix;
22
22
  if (typeof fileOrObject === 'string') {
23
23
  this._importPrefix = this._importPrefix ?? fileOrObject.split('/').slice(0, -1).join('/');
24
- import(fileOrObject, { assert: { type: 'json' } }).then(module => {
24
+ let importOfFile;
25
+ //@ts-ignore
26
+ if (window.importShim)
27
+ //@ts-ignore
28
+ importOfFile = importShim(fileOrObject, { assert: { type: 'json' } });
29
+ else
30
+ //@ts-ignore
31
+ importOfFile = import(fileOrObject, { assert: { type: 'json' } });
32
+ importOfFile.then(module => {
25
33
  this._packageData = module.default;
26
34
  this._parseManifest();
27
35
  }).catch(err => {
@@ -1,9 +1,18 @@
1
1
  import { PropertyType } from '../PropertyType.js';
2
2
  import { RefreshMode } from '../IPropertiesService.js';
3
3
  import { CommonPropertiesService } from './CommonPropertiesService.js';
4
- import cssProperties from './CssProperties.json' assert { type: 'json' };
5
4
  import { ValueType } from '../ValueType.js';
6
5
  import { NodeType } from '../../../item/NodeType.js';
6
+ let cssProperties;
7
+ //@ts-ignore
8
+ if (window.importShim) {
9
+ const cssPropertiesUrl = import.meta.resolve('./CssProperties.json');
10
+ //@ts-ignore
11
+ cssProperties = await importShim(cssPropertiesUrl, { assert: { type: 'json' } });
12
+ }
13
+ else
14
+ //@ts-ignore
15
+ cssProperties = await import("./CssProperties.json", { assert: { type: 'json' } });
7
16
  const localName = '<local>';
8
17
  export class CssCurrentPropertiesService extends CommonPropertiesService {
9
18
  getRefreshMode(designItem) {
@@ -2,8 +2,17 @@ import { BindingTarget } from '../../../item/BindingTarget.js';
2
2
  import { PropertyType } from '../PropertyType.js';
3
3
  import { CommonPropertiesService } from './CommonPropertiesService.js';
4
4
  import { RefreshMode } from '../IPropertiesService.js';
5
- import cssProperties from './CssProperties.json' assert { type: 'json' };
6
5
  import { PropertiesHelper } from './PropertiesHelper.js';
6
+ let cssProperties;
7
+ //@ts-ignore
8
+ if (window.importShim) {
9
+ const cssPropertiesUrl = import.meta.resolve('./CssProperties.json');
10
+ //@ts-ignore
11
+ cssProperties = await importShim(cssPropertiesUrl, { assert: { type: 'json' } });
12
+ }
13
+ else
14
+ //@ts-ignore
15
+ cssProperties = await import("./CssProperties.json", { assert: { type: 'json' } });
7
16
  export class CssPropertiesService extends CommonPropertiesService {
8
17
  getRefreshMode(designItem) {
9
18
  return RefreshMode.none;
@@ -18,9 +18,13 @@ export class CodeViewMonaco extends BaseCustomWebComponentLazyAppend {
18
18
  height: 100%;
19
19
  width: 100%;
20
20
  }
21
+
22
+ .monaco-editor .overflow-guard {
23
+ overflow: visible;
24
+ }
21
25
  `;
22
26
  static template = html `
23
- <div id="container" style="width: 100%; height: 100%; position: absolute;"></div>
27
+ <div id="container" style="overflow: hidden; width: 100%; height: 100%; position: absolute;"></div>
24
28
  `;
25
29
  executeCommand(command) {
26
30
  switch (command.type) {
@@ -161,7 +165,7 @@ export class CodeViewMonaco extends BaseCustomWebComponentLazyAppend {
161
165
  let point2 = model.getPositionAt(position.start + position.length);
162
166
  this._monacoEditor.setSelection({ startLineNumber: point1.lineNumber, startColumn: point1.column, endLineNumber: point2.lineNumber, endColumn: point2.column });
163
167
  //@ts-ignore
164
- setTimeout(() => this._monacoEditor.revealRangeInCenter(new monaco.Range(point1.lineNumber, point1.column, point2.lineNumber, point2.column), 1));
168
+ this._monacoEditor.revealRangeInCenterIfOutsideViewport(new monaco.Range(point1.lineNumber, point1.column, point2.lineNumber, point2.column), 1);
165
169
  }
166
170
  }
167
171
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "description": "A UI designer for Polymer apps",
3
3
  "name": "@node-projects/web-component-designer",
4
- "version": "0.0.191",
4
+ "version": "0.0.192",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "",