@node-projects/web-component-designer 0.0.190 → 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.
- package/dist/elements/helper/ClipboardHelper.js +6 -0
- package/dist/elements/services/manifestParsers/WebcomponentManifestParserService.js +9 -1
- package/dist/elements/services/propertiesService/services/CssCurrentPropertiesService.js +10 -1
- package/dist/elements/services/propertiesService/services/CssPropertiesService.js +10 -1
- package/dist/elements/widgets/codeView/code-view-monaco.js +6 -2
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export async function copyTextToClipboard(text) {
|
|
2
2
|
copyToClipboard(['text/plain', text]);
|
|
3
3
|
}
|
|
4
|
+
//used, so you could copy internal if you have no clipboard access
|
|
5
|
+
let internalClipboard = null;
|
|
4
6
|
export async function copyToClipboard(items) {
|
|
5
7
|
if (navigator.clipboard) {
|
|
6
8
|
try {
|
|
@@ -12,10 +14,12 @@ export async function copyToClipboard(items) {
|
|
|
12
14
|
}
|
|
13
15
|
catch (err) {
|
|
14
16
|
await navigator.clipboard.writeText(items[0][1]);
|
|
17
|
+
internalClipboard = items[0][1];
|
|
15
18
|
}
|
|
16
19
|
console.info('Copy to clipboard successful');
|
|
17
20
|
}
|
|
18
21
|
else {
|
|
22
|
+
internalClipboard = items[0][1];
|
|
19
23
|
const textArea = document.createElement('textarea');
|
|
20
24
|
textArea.style.position = 'fixed';
|
|
21
25
|
textArea.style.top = '0';
|
|
@@ -69,6 +73,8 @@ export async function getTextFromClipboard() {
|
|
|
69
73
|
textArea.select();
|
|
70
74
|
document.execCommand('paste');
|
|
71
75
|
let value = textArea.value;
|
|
76
|
+
if (!value)
|
|
77
|
+
value = internalClipboard;
|
|
72
78
|
document.body.removeChild(textArea);
|
|
73
79
|
resolve(value);
|
|
74
80
|
});
|
|
@@ -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
|
-
|
|
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
|
-
|
|
168
|
+
this._monacoEditor.revealRangeInCenterIfOutsideViewport(new monaco.Range(point1.lineNumber, point1.column, point2.lineNumber, point2.column), 1);
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
171
|
}
|