@node-projects/web-component-designer 0.0.251 → 0.0.253
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/item/DesignItem.d.ts +2 -0
- package/dist/elements/item/DesignItem.js +14 -3
- package/dist/elements/item/IDesignItem.d.ts +2 -0
- package/dist/elements/services/DefaultServiceBootstrap.js +12 -9
- package/dist/elements/services/dragDropService/DragDropService.js +6 -6
- package/dist/elements/services/placementService/DefaultPlacementService.d.ts +1 -1
- package/dist/elements/services/placementService/DefaultPlacementService.js +4 -6
- package/dist/elements/services/placementService/FlexBoxPlacementService.d.ts +4 -2
- package/dist/elements/services/placementService/FlexBoxPlacementService.js +8 -4
- package/dist/elements/services/placementService/GridPlacementService.d.ts +4 -2
- package/dist/elements/services/placementService/GridPlacementService.js +8 -4
- package/dist/elements/services/placementService/IPlacementService.d.ts +1 -1
- package/dist/elements/services/propertiesService/PropertyTabsService.js +1 -0
- package/dist/elements/services/propertiesService/services/CssProperties.json +39 -6
- package/dist/elements/services/propertiesService/services/CssPropertiesService.d.ts +2 -1
- package/dist/elements/services/propertiesService/services/CssPropertiesService.js +9 -0
- package/dist/elements/widgets/designerView/extensions/EditText/EditTextExtension.js +1 -0
- package/dist/elements/widgets/designerView/extensions/ExtensionManager.js +9 -1
- package/dist/elements/widgets/designerView/extensions/ExtensionType.d.ts +10 -3
- package/dist/elements/widgets/designerView/extensions/ExtensionType.js +9 -2
- package/dist/elements/widgets/designerView/tools/DrawEllipsisTool.js +4 -0
- package/dist/elements/widgets/designerView/tools/DrawLineTool.js +4 -0
- package/dist/elements/widgets/designerView/tools/DrawPathTool.js +4 -0
- package/dist/elements/widgets/designerView/tools/DrawRectTool.js +4 -0
- package/dist/elements/widgets/designerView/tools/PointerTool.js +5 -5
- package/dist/index.d.ts +0 -1
- package/package.json +4 -4
- package/dist/elements/services/dragDropService/ExternalDragDropService copy.d.ts +0 -6
- package/dist/elements/services/dragDropService/ExternalDragDropService copy.js +0 -28
- package/dist/elements/services/dragDropService/IExternalDragDropService copy.d.ts +0 -5
- package/dist/elements/services/dragDropService/IExternalDragDropService copy.js +0 -1
- package/dist/elements/services/htmlParserService/AbstractClassElementParserService.d.ts +0 -9
- package/dist/elements/services/htmlParserService/AbstractClassElementParserService.js +0 -46
- package/dist/elements/services/htmlParserService/BaseCustomWebcomponentParserService copy.d.ts +0 -11
- package/dist/elements/services/htmlParserService/BaseCustomWebcomponentParserService copy.js +0 -90
- package/dist/elements/services/propertiesService/DefaultEditorTypesService copy.d.ts +0 -6
- package/dist/elements/services/propertiesService/DefaultEditorTypesService copy.js +0 -64
- package/dist/elements/services/propertiesService/GridEditorTypesService.d.ts +0 -6
- package/dist/elements/services/propertiesService/GridEditorTypesService.js +0 -64
- package/dist/elements/services/propertiesService/propertyEditors/GridCellPropertyEditor.d.ts +0 -9
- package/dist/elements/services/propertiesService/propertyEditors/GridCellPropertyEditor.js +0 -16
- package/dist/elements/services/propertiesService/propertyEditors/JsonPropertyEditor copy.d.ts +0 -9
- package/dist/elements/services/propertiesService/propertyEditors/JsonPropertyEditor copy.js +0 -21
- package/dist/elements/services/undoService/transactionItems/AttributeChangeAction copy.d.ts +0 -15
- package/dist/elements/services/undoService/transactionItems/AttributeChangeAction copy.js +0 -70
- package/dist/elements/services/undoService/transactionItems/ContentChangeAction.d.ts +0 -13
- package/dist/elements/services/undoService/transactionItems/ContentChangeAction.js +0 -38
- package/dist/elements/services/undoService/transactionItems/CssStyleChangeAction copy.d.ts +0 -14
- package/dist/elements/services/undoService/transactionItems/CssStyleChangeAction copy.js +0 -44
- package/dist/elements/services/undoService/transactionItems/InsertChildAction copy.d.ts +0 -16
- package/dist/elements/services/undoService/transactionItems/InsertChildAction copy.js +0 -37
- package/dist/elements/services/undoService/transactionItems/StylesheetStyleChangeAction.d.ts +0 -17
- package/dist/elements/services/undoService/transactionItems/StylesheetStyleChangeAction.js +0 -28
- package/dist/elements/widgets/codeView/code-view-ace copy.d.ts +0 -24
- package/dist/elements/widgets/codeView/code-view-ace copy.js +0 -133
- package/dist/elements/widgets/codeView/code-view-code-mirror copy.d.ts +0 -25
- package/dist/elements/widgets/codeView/code-view-code-mirror copy.js +0 -106
- package/dist/elements/widgets/codeView/code-view-code-mirror-6.d.ts +0 -25
- package/dist/elements/widgets/codeView/code-view-code-mirror-6.js +0 -102
- package/dist/elements/widgets/codeView/code-view-jar.d.ts +0 -23
- package/dist/elements/widgets/codeView/code-view-jar.js +0 -121
- package/dist/elements/widgets/designerView/extensions/GridExtension.d.ts +0 -51
- package/dist/elements/widgets/designerView/extensions/GridExtension.js +0 -346
- package/dist/elements/widgets/designerView/extensions/GridExtensionProvider.d.ts +0 -11
- package/dist/elements/widgets/designerView/extensions/GridExtensionProvider.js +0 -22
- package/dist/elements/widgets/designerView/extensions/grid/EditGridExtension copy 2.d.ts +0 -51
- package/dist/elements/widgets/designerView/extensions/grid/EditGridExtension copy 2.js +0 -346
- package/dist/elements/widgets/designerView/extensions/grid/EditGridExtension copy.d.ts +0 -51
- package/dist/elements/widgets/designerView/extensions/grid/EditGridExtension copy.js +0 -346
- package/dist/elements/widgets/designerView/extensions/grid/EditGridExtension.d.ts +0 -16
- package/dist/elements/widgets/designerView/extensions/grid/EditGridExtension.js +0 -71
- package/dist/elements/widgets/designerView/extensions/grid/EditGridExtensionProvider copy.d.ts +0 -10
- package/dist/elements/widgets/designerView/extensions/grid/EditGridExtensionProvider copy.js +0 -22
- package/dist/elements/widgets/designerView/extensions/grid/EditGridExtensionProvider.d.ts +0 -10
- package/dist/elements/widgets/designerView/extensions/grid/EditGridExtensionProvider.js +0 -18
- package/dist/elements/widgets/designerView/extensions/grid/GridExtension copy.d.ts +0 -51
- package/dist/elements/widgets/designerView/extensions/grid/GridExtension copy.js +0 -346
- package/dist/elements/widgets/designerView/extensions/grid/GridExtension.d.ts +0 -51
- package/dist/elements/widgets/designerView/extensions/grid/GridExtension.js +0 -346
- package/dist/elements/widgets/designerView/extensions/grid/GridExtensionProvider copy.d.ts +0 -11
- package/dist/elements/widgets/designerView/extensions/grid/GridExtensionProvider copy.js +0 -22
- package/dist/elements/widgets/designerView/extensions/grid/GridExtensionProvider.d.ts +0 -11
- package/dist/elements/widgets/designerView/extensions/grid/GridExtensionProvider.js +0 -22
- package/dist/elements/widgets/designerView/extensions/grid/NewEditGridExtensionProvider.d.ts +0 -10
- package/dist/elements/widgets/designerView/extensions/grid/NewEditGridExtensionProvider.js +0 -22
- package/dist/elements/widgets/designerView/extensions/grid/OldEditGridExtension.d.ts +0 -51
- package/dist/elements/widgets/designerView/extensions/grid/OldEditGridExtension.js +0 -346
- package/dist/elements/widgets/designerView/extensions/grid/OldEditGridExtensionProvider.d.ts +0 -10
- package/dist/elements/widgets/designerView/extensions/grid/OldEditGridExtensionProvider.js +0 -22
- package/dist/elements/widgets/designerView/extensions/logic/ApplyFirstExtensionProvider.d.ts +0 -12
- package/dist/elements/widgets/designerView/extensions/logic/ApplyFirstExtensionProvider.js +0 -17
- package/dist/elements/widgets/designerView/extensions/logic/DisplayGridExtensionProvider.d.ts +0 -11
- package/dist/elements/widgets/designerView/extensions/logic/DisplayGridExtensionProvider.js +0 -23
- package/dist/elements/widgets/designerView/extensions/logic/OrCombineContainerProvider.d.ts +0 -12
- package/dist/elements/widgets/designerView/extensions/logic/OrCombineContainerProvider.js +0 -17
- package/dist/interfaces/ICommandHandler.d.ts +0 -5
- package/dist/interfaces/ICommandHandler.js +0 -1
- package/dist/polyfill/mobileDragDrop.d.ts +0 -2
- package/dist/polyfill/mobileDragDrop.js +0 -32
package/dist/index.d.ts
CHANGED
|
@@ -260,7 +260,6 @@ export type { IDisposable } from "./interfaces/IDisposable.js";
|
|
|
260
260
|
export type { IPoint } from "./interfaces/IPoint.js";
|
|
261
261
|
export type { IRect } from "./interfaces/IRect.js";
|
|
262
262
|
export type { ISize } from "./interfaces/ISize.js";
|
|
263
|
-
export type { ICommandHandler } from "./interfaces/ICommandHandler.js";
|
|
264
263
|
export * from "./commandHandling/CommandType.js";
|
|
265
264
|
export type { IUiCommand } from "./commandHandling/IUiCommand.js";
|
|
266
265
|
export type { IUiCommandHandler } from "./commandHandling/IUiCommandHandler.js";
|
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.
|
|
4
|
+
"version": "0.0.253",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"author": "",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@node-projects/base-custom-webcomponent": "^0.13.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@adobe/css-tools": "4.3.0
|
|
19
|
+
"@adobe/css-tools": "4.3.0",
|
|
20
20
|
"@node-projects/lean-he-esm": "^3.3.0",
|
|
21
21
|
"@node-projects/node-html-parser-esm": "^6.1.5",
|
|
22
22
|
"@papyrs/stylo": "^0.0.45",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@types/css-tree": "^2.3.1",
|
|
25
25
|
"@types/jquery": "^3.5.16",
|
|
26
26
|
"@types/jquery.fancytree": "0.0.7",
|
|
27
|
-
"@types/node": "^20.4.
|
|
27
|
+
"@types/node": "^20.4.8",
|
|
28
28
|
"ace-builds": "^1.23.4",
|
|
29
29
|
"codemirror": "^5.0.0",
|
|
30
30
|
"css-tree": "^2.3.1",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"jquery": "^3.7.0",
|
|
35
35
|
"jquery.fancytree": "^2.38.3",
|
|
36
36
|
"mdn-data": "^2.0.32",
|
|
37
|
-
"monaco-editor": "^0.
|
|
37
|
+
"monaco-editor": "^0.41.0",
|
|
38
38
|
"ts-jest": "^29.1.1",
|
|
39
39
|
"typescript": "^5.1.6",
|
|
40
40
|
"typescript-lit-html-plugin": "^0.9.0"
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { IDesignerCanvas } from "../../widgets/designerView/IDesignerCanvas.js";
|
|
2
|
-
import { IExternalDragDropService } from "./IExternalDragDropService.js";
|
|
3
|
-
export declare class ExternalDragDropService implements IExternalDragDropService {
|
|
4
|
-
dragOver(event: DragEvent): 'none' | 'copy' | 'link' | 'move';
|
|
5
|
-
drop(designerView: IDesignerCanvas, event: DragEvent): void;
|
|
6
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { DesignItem } from '../../item/DesignItem.js';
|
|
2
|
-
import { InsertAction } from "../undoService/transactionItems/InsertAction.js";
|
|
3
|
-
export class ExternalDragDropService {
|
|
4
|
-
dragOver(event) {
|
|
5
|
-
if (event.dataTransfer.items[0].type.startsWith('image/'))
|
|
6
|
-
return 'copy';
|
|
7
|
-
return 'none';
|
|
8
|
-
}
|
|
9
|
-
drop(designerView, event) {
|
|
10
|
-
if (event.dataTransfer.files[0].type.startsWith('image/')) {
|
|
11
|
-
let reader = new FileReader();
|
|
12
|
-
reader.onloadend = () => {
|
|
13
|
-
const img = document.createElement('img');
|
|
14
|
-
img.src = reader.result;
|
|
15
|
-
const di = DesignItem.createDesignItemFromInstance(img, designerView.serviceContainer, designerView.instanceServiceContainer);
|
|
16
|
-
let grp = di.openGroup("Insert of <img>");
|
|
17
|
-
di.setStyle('position', 'absolute');
|
|
18
|
-
const targetRect = event.target.getBoundingClientRect();
|
|
19
|
-
di.setStyle('top', event.offsetY + targetRect.top - designerView.containerBoundingRect.y + 'px');
|
|
20
|
-
di.setStyle('left', event.offsetX + targetRect.left - designerView.containerBoundingRect.x + 'px');
|
|
21
|
-
designerView.instanceServiceContainer.undoService.execute(new InsertAction(designerView.rootDesignItem, designerView.rootDesignItem.childCount, di));
|
|
22
|
-
grp.commit();
|
|
23
|
-
requestAnimationFrame(() => designerView.instanceServiceContainer.selectionService.setSelectedElements([di]));
|
|
24
|
-
};
|
|
25
|
-
reader.readAsDataURL(event.dataTransfer.files[0]);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { InstanceServiceContainer } from '../InstanceServiceContainer.js';
|
|
2
|
-
import { ServiceContainer } from '../ServiceContainer.js';
|
|
3
|
-
import { IHtmlParserService } from './IHtmlParserService.js';
|
|
4
|
-
import { IDesignItem } from '../../item/IDesignItem.js';
|
|
5
|
-
export declare class AbstractClassElementParserService implements IHtmlParserService {
|
|
6
|
-
private htmlParser;
|
|
7
|
-
constructor(htmlParser: IHtmlParserService);
|
|
8
|
-
parse(code: string, serviceContainer: ServiceContainer, instanceServiceContainer: InstanceServiceContainer, parseSnippet: boolean): Promise<IDesignItem[]>;
|
|
9
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
function* findAllNodesOfKind(node, kind) {
|
|
2
|
-
if (node.kind == kind)
|
|
3
|
-
yield node;
|
|
4
|
-
for (const c of node.getChildren())
|
|
5
|
-
yield* findAllNodesOfKind(c, kind);
|
|
6
|
-
}
|
|
7
|
-
export class AbstractClassElementParserService {
|
|
8
|
-
htmlParser;
|
|
9
|
-
constructor(htmlParser) {
|
|
10
|
-
this.htmlParser = htmlParser;
|
|
11
|
-
}
|
|
12
|
-
async parse(code, serviceContainer, instanceServiceContainer, parseSnippet) {
|
|
13
|
-
const compilerHost /*: ts.CompilerHost*/ = {
|
|
14
|
-
fileExists: () => true,
|
|
15
|
-
getCanonicalFileName: filename => filename,
|
|
16
|
-
getCurrentDirectory: () => '',
|
|
17
|
-
getDefaultLibFileName: () => 'lib.d.ts',
|
|
18
|
-
getNewLine: () => '\n',
|
|
19
|
-
getSourceFile: filename => {
|
|
20
|
-
//@ts-ignore
|
|
21
|
-
return ts.createSourceFile(filename, code, ts.ScriptTarget.Latest, true);
|
|
22
|
-
},
|
|
23
|
-
readFile: () => null,
|
|
24
|
-
useCaseSensitiveFileNames: () => true,
|
|
25
|
-
writeFile: () => null,
|
|
26
|
-
};
|
|
27
|
-
const filename = 'aa.ts';
|
|
28
|
-
//@ts-ignore
|
|
29
|
-
const program = ts.createProgram([filename], {
|
|
30
|
-
noResolve: true,
|
|
31
|
-
//@ts-ignore
|
|
32
|
-
target: ts.ScriptTarget.Latest,
|
|
33
|
-
}, compilerHost);
|
|
34
|
-
const sourceFile = program.getSourceFile(filename);
|
|
35
|
-
let htmlCode = "";
|
|
36
|
-
let cssStyle = "";
|
|
37
|
-
const nodes = findAllNodesOfKind(sourceFile, 212);
|
|
38
|
-
for (let nd of nodes) {
|
|
39
|
-
if (nd.tag.escapedText == 'html' && nd.parent.name.escapedText == "template")
|
|
40
|
-
htmlCode = nd.template.rawText;
|
|
41
|
-
if (nd.tag.escapedText == 'css' && nd.parent.name.escapedText == "style")
|
|
42
|
-
cssStyle = nd.template.rawText;
|
|
43
|
-
}
|
|
44
|
-
return this.htmlParser.parse(htmlCode, serviceContainer, instanceServiceContainer, parseSnippet);
|
|
45
|
-
}
|
|
46
|
-
}
|
package/dist/elements/services/htmlParserService/BaseCustomWebcomponentParserService copy.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { InstanceServiceContainer } from '../InstanceServiceContainer.js';
|
|
2
|
-
import { ServiceContainer } from '../ServiceContainer.js';
|
|
3
|
-
import { IHtmlParserService } from './IHtmlParserService.js';
|
|
4
|
-
import { IDesignItem } from '../../item/IDesignItem.js';
|
|
5
|
-
export declare class BaseCustomWebcomponentParserService implements IHtmlParserService {
|
|
6
|
-
private htmlParser;
|
|
7
|
-
constructor(htmlParser: IHtmlParserService);
|
|
8
|
-
parse(code: string, serviceContainer: ServiceContainer, instanceServiceContainer: InstanceServiceContainer, parseSnippet: boolean): Promise<IDesignItem[]>;
|
|
9
|
-
writeBack(code: string, html: string, css: string, newLineCrLf: boolean): string;
|
|
10
|
-
private parseTypescriptFile;
|
|
11
|
-
}
|
package/dist/elements/services/htmlParserService/BaseCustomWebcomponentParserService copy.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
function* findAllNodesOfKind(node, kind) {
|
|
2
|
-
if (node.kind == kind)
|
|
3
|
-
yield node;
|
|
4
|
-
for (const c of node.getChildren())
|
|
5
|
-
yield* findAllNodesOfKind(c, kind);
|
|
6
|
-
}
|
|
7
|
-
export class BaseCustomWebcomponentParserService {
|
|
8
|
-
htmlParser;
|
|
9
|
-
constructor(htmlParser) {
|
|
10
|
-
this.htmlParser = htmlParser;
|
|
11
|
-
}
|
|
12
|
-
async parse(code, serviceContainer, instanceServiceContainer, parseSnippet) {
|
|
13
|
-
const sourceFile = this.parseTypescriptFile(code);
|
|
14
|
-
let htmlCode = "";
|
|
15
|
-
let cssStyle = "";
|
|
16
|
-
//@ts-ignore
|
|
17
|
-
const nodes = findAllNodesOfKind(sourceFile, ts.SyntaxKind.TaggedTemplateExpression);
|
|
18
|
-
for (let nd of nodes) {
|
|
19
|
-
if (nd.tag.escapedText == 'html' && nd.parent.name.escapedText == "template")
|
|
20
|
-
htmlCode = nd.template.rawText;
|
|
21
|
-
if (nd.tag.escapedText == 'css' && nd.parent.name.escapedText == "style")
|
|
22
|
-
cssStyle = nd.template.rawText;
|
|
23
|
-
}
|
|
24
|
-
if (cssStyle)
|
|
25
|
-
instanceServiceContainer.stylesheetService.setStylesheets([{ name: 'css', content: cssStyle }]);
|
|
26
|
-
return this.htmlParser.parse(htmlCode, serviceContainer, instanceServiceContainer, parseSnippet);
|
|
27
|
-
}
|
|
28
|
-
writeBack(code, html, css, newLineCrLf) {
|
|
29
|
-
const sourceFile = this.parseTypescriptFile(code);
|
|
30
|
-
const transformTemplateLiterals = (context) => (rootNode) => {
|
|
31
|
-
function visit(node) {
|
|
32
|
-
//@ts-ignore
|
|
33
|
-
if (ts.isTemplateLiteral(node) &&
|
|
34
|
-
//@ts-ignore
|
|
35
|
-
ts.isTaggedTemplateExpression(node.parent) &&
|
|
36
|
-
node.parent.tag.escapedText == 'html' &&
|
|
37
|
-
node.parent.parent.name.escapedText == "template") {
|
|
38
|
-
//@ts-ignore
|
|
39
|
-
return ts.factory.createNoSubstitutionTemplateLiteral(html.replaceAll('\n', '\r\n'), html.replaceAll('\n', '\r\n'));
|
|
40
|
-
}
|
|
41
|
-
else if (css &&
|
|
42
|
-
//@ts-ignore
|
|
43
|
-
ts.isTemplateLiteral(node) &&
|
|
44
|
-
//@ts-ignore
|
|
45
|
-
ts.isTaggedTemplateExpression(node.parent) &&
|
|
46
|
-
node.parent.tag.escapedText == 'css' &&
|
|
47
|
-
node.parent.parent.name.escapedText == "style") {
|
|
48
|
-
//@ts-ignore
|
|
49
|
-
return ts.factory.createNoSubstitutionTemplateLiteral(css.replaceAll('\n', '\r\n'), css.replaceAll('\n', '\r\n'));
|
|
50
|
-
}
|
|
51
|
-
//@ts-ignore
|
|
52
|
-
return ts.visitEachChild(node, visit, context);
|
|
53
|
-
}
|
|
54
|
-
//@ts-ignore
|
|
55
|
-
return ts.visitNode(rootNode, visit);
|
|
56
|
-
};
|
|
57
|
-
//@ts-ignore
|
|
58
|
-
let transformed = ts.transform(sourceFile, [transformTemplateLiterals]).transformed[0];
|
|
59
|
-
//@ts-ignore
|
|
60
|
-
const printer = ts.createPrinter({ newLine: newLineCrLf ? ts.NewLineKind.CarriageReturnLineFeed : ts.NewLineKind.LineFeed });
|
|
61
|
-
//@ts-ignore
|
|
62
|
-
const result = printer.printNode(ts.EmitHint.Unspecified, transformed, transformed);
|
|
63
|
-
return result;
|
|
64
|
-
}
|
|
65
|
-
parseTypescriptFile(code) {
|
|
66
|
-
const compilerHost = {
|
|
67
|
-
fileExists: () => true,
|
|
68
|
-
getCanonicalFileName: filename => filename,
|
|
69
|
-
getCurrentDirectory: () => '',
|
|
70
|
-
getDefaultLibFileName: () => 'lib.d.ts',
|
|
71
|
-
getNewLine: () => '\n',
|
|
72
|
-
getSourceFile: filename => {
|
|
73
|
-
//@ts-ignore
|
|
74
|
-
return ts.createSourceFile(filename, code, ts.ScriptTarget.Latest, true);
|
|
75
|
-
},
|
|
76
|
-
readFile: () => null,
|
|
77
|
-
useCaseSensitiveFileNames: () => true,
|
|
78
|
-
writeFile: () => null,
|
|
79
|
-
};
|
|
80
|
-
const filename = 'aa.ts';
|
|
81
|
-
//@ts-ignore
|
|
82
|
-
const program = ts.createProgram([filename], {
|
|
83
|
-
noResolve: true,
|
|
84
|
-
//@ts-ignore
|
|
85
|
-
target: ts.ScriptTarget.Latest,
|
|
86
|
-
}, compilerHost);
|
|
87
|
-
const sourceFile = program.getSourceFile(filename);
|
|
88
|
-
return sourceFile;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { IEditorTypesService } from './IEditorTypesService.js';
|
|
2
|
-
import { IProperty } from './IProperty.js';
|
|
3
|
-
import { IPropertyEditor } from './IPropertyEditor.js';
|
|
4
|
-
export declare class DefaultEditorTypesService implements IEditorTypesService {
|
|
5
|
-
getEditorForProperty(property: IProperty): IPropertyEditor;
|
|
6
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ColorPropertyEditor } from './propertyEditors/ColorPropertyEditor.js';
|
|
2
|
-
import { DatePropertyEditor } from './propertyEditors/DatePropertyEditor.js';
|
|
3
|
-
import { JsonPropertyEditor } from './propertyEditors/JsonPropertyEditor.js';
|
|
4
|
-
import { NumberPropertyEditor } from './propertyEditors/NumberPropertyEditor.js';
|
|
5
|
-
import { SelectPropertyEditor } from './propertyEditors/SelectPropertyEditor.js';
|
|
6
|
-
import { TextPropertyEditor } from './propertyEditors/TextPropertyEditor.js';
|
|
7
|
-
import { BooleanPropertyEditor } from './propertyEditors/BooleanPropertyEditor.js';
|
|
8
|
-
import { ImageButtonListPropertyEditor } from './propertyEditors/ImageButtonListPropertyEditor.js';
|
|
9
|
-
import { ThicknessPropertyEditor } from "./propertyEditors/ThicknessPropertyEditor.js";
|
|
10
|
-
import { MetricsPropertyEditor } from './propertyEditors/MetricsPropertyEditor.js';
|
|
11
|
-
export class DefaultEditorTypesService {
|
|
12
|
-
getEditorForProperty(property) {
|
|
13
|
-
if (property.createEditor)
|
|
14
|
-
return property.createEditor(property);
|
|
15
|
-
switch (property.type) {
|
|
16
|
-
case "json":
|
|
17
|
-
{
|
|
18
|
-
return new JsonPropertyEditor(property);
|
|
19
|
-
}
|
|
20
|
-
case "color":
|
|
21
|
-
{
|
|
22
|
-
return new ColorPropertyEditor(property);
|
|
23
|
-
}
|
|
24
|
-
case "date":
|
|
25
|
-
{
|
|
26
|
-
return new DatePropertyEditor(property);
|
|
27
|
-
}
|
|
28
|
-
case "number":
|
|
29
|
-
{
|
|
30
|
-
return new NumberPropertyEditor(property);
|
|
31
|
-
}
|
|
32
|
-
case "list":
|
|
33
|
-
{
|
|
34
|
-
return new SelectPropertyEditor(property);
|
|
35
|
-
}
|
|
36
|
-
case "enum":
|
|
37
|
-
{
|
|
38
|
-
return new SelectPropertyEditor(property);
|
|
39
|
-
}
|
|
40
|
-
case "boolean":
|
|
41
|
-
{
|
|
42
|
-
return new BooleanPropertyEditor(property);
|
|
43
|
-
}
|
|
44
|
-
case "img-list":
|
|
45
|
-
{
|
|
46
|
-
return new ImageButtonListPropertyEditor(property);
|
|
47
|
-
}
|
|
48
|
-
case "thickness":
|
|
49
|
-
{
|
|
50
|
-
return new ThicknessPropertyEditor(property);
|
|
51
|
-
}
|
|
52
|
-
case "metrics":
|
|
53
|
-
{
|
|
54
|
-
return new MetricsPropertyEditor(property);
|
|
55
|
-
}
|
|
56
|
-
case "css-length":
|
|
57
|
-
case "string":
|
|
58
|
-
default:
|
|
59
|
-
{
|
|
60
|
-
return new TextPropertyEditor(property);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { IEditorTypesService } from './IEditorTypesService.js';
|
|
2
|
-
import { IProperty } from './IProperty.js';
|
|
3
|
-
import { IPropertyEditor } from './IPropertyEditor.js';
|
|
4
|
-
export declare class DefaultEditorTypesService implements IEditorTypesService {
|
|
5
|
-
getEditorForProperty(property: IProperty): IPropertyEditor;
|
|
6
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ColorPropertyEditor } from './propertyEditors/ColorPropertyEditor.js';
|
|
2
|
-
import { DatePropertyEditor } from './propertyEditors/DatePropertyEditor.js';
|
|
3
|
-
import { JsonPropertyEditor } from './propertyEditors/JsonPropertyEditor.js';
|
|
4
|
-
import { NumberPropertyEditor } from './propertyEditors/NumberPropertyEditor.js';
|
|
5
|
-
import { SelectPropertyEditor } from './propertyEditors/SelectPropertyEditor.js';
|
|
6
|
-
import { TextPropertyEditor } from './propertyEditors/TextPropertyEditor.js';
|
|
7
|
-
import { BooleanPropertyEditor } from './propertyEditors/BooleanPropertyEditor.js';
|
|
8
|
-
import { ImageButtonListPropertyEditor } from './propertyEditors/ImageButtonListPropertyEditor.js';
|
|
9
|
-
import { ThicknessPropertyEditor } from "./propertyEditors/ThicknessPropertyEditor.js";
|
|
10
|
-
import { MetricsPropertyEditor } from './propertyEditors/MetricsPropertyEditor.js';
|
|
11
|
-
export class DefaultEditorTypesService {
|
|
12
|
-
getEditorForProperty(property) {
|
|
13
|
-
if (property.createEditor)
|
|
14
|
-
return property.createEditor(property);
|
|
15
|
-
switch (property.type) {
|
|
16
|
-
case "json":
|
|
17
|
-
{
|
|
18
|
-
return new JsonPropertyEditor(property);
|
|
19
|
-
}
|
|
20
|
-
case "color":
|
|
21
|
-
{
|
|
22
|
-
return new ColorPropertyEditor(property);
|
|
23
|
-
}
|
|
24
|
-
case "date":
|
|
25
|
-
{
|
|
26
|
-
return new DatePropertyEditor(property);
|
|
27
|
-
}
|
|
28
|
-
case "number":
|
|
29
|
-
{
|
|
30
|
-
return new NumberPropertyEditor(property);
|
|
31
|
-
}
|
|
32
|
-
case "list":
|
|
33
|
-
{
|
|
34
|
-
return new SelectPropertyEditor(property);
|
|
35
|
-
}
|
|
36
|
-
case "enum":
|
|
37
|
-
{
|
|
38
|
-
return new SelectPropertyEditor(property);
|
|
39
|
-
}
|
|
40
|
-
case "boolean":
|
|
41
|
-
{
|
|
42
|
-
return new BooleanPropertyEditor(property);
|
|
43
|
-
}
|
|
44
|
-
case "img-list":
|
|
45
|
-
{
|
|
46
|
-
return new ImageButtonListPropertyEditor(property);
|
|
47
|
-
}
|
|
48
|
-
case "thickness":
|
|
49
|
-
{
|
|
50
|
-
return new ThicknessPropertyEditor(property);
|
|
51
|
-
}
|
|
52
|
-
case "metrics":
|
|
53
|
-
{
|
|
54
|
-
return new MetricsPropertyEditor(property);
|
|
55
|
-
}
|
|
56
|
-
case "css-length":
|
|
57
|
-
case "string":
|
|
58
|
-
default:
|
|
59
|
-
{
|
|
60
|
-
return new TextPropertyEditor(property);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
package/dist/elements/services/propertiesService/propertyEditors/GridCellPropertyEditor.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IProperty } from '../IProperty.js';
|
|
2
|
-
import { BasePropertyEditor } from './BasePropertyEditor.js';
|
|
3
|
-
import { ValueType } from '../ValueType.js';
|
|
4
|
-
export declare class GridCellPropertyEditor extends BasePropertyEditor<HTMLDivElement> {
|
|
5
|
-
static template: HTMLTemplateElement;
|
|
6
|
-
_input: HTMLInputElement;
|
|
7
|
-
constructor(property: IProperty);
|
|
8
|
-
refreshValue(valueType: ValueType, value: any): void;
|
|
9
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BasePropertyEditor } from './BasePropertyEditor.js';
|
|
2
|
-
import { html } from '@node-projects/base-custom-webcomponent';
|
|
3
|
-
export class GridCellPropertyEditor extends BasePropertyEditor {
|
|
4
|
-
static template = html `
|
|
5
|
-
<div style="display: flex;">
|
|
6
|
-
|
|
7
|
-
</div>
|
|
8
|
-
`;
|
|
9
|
-
_input;
|
|
10
|
-
constructor(property) {
|
|
11
|
-
super(property);
|
|
12
|
-
}
|
|
13
|
-
refreshValue(valueType, value) {
|
|
14
|
-
debugger;
|
|
15
|
-
}
|
|
16
|
-
}
|
package/dist/elements/services/propertiesService/propertyEditors/JsonPropertyEditor copy.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IProperty } from '../IProperty.js';
|
|
2
|
-
import { BasePropertyEditor } from './BasePropertyEditor.js';
|
|
3
|
-
import { ValueType } from '../ValueType.js';
|
|
4
|
-
export declare class JsonPropertyEditor extends BasePropertyEditor<HTMLDivElement> {
|
|
5
|
-
static template: HTMLTemplateElement;
|
|
6
|
-
_input: HTMLInputElement;
|
|
7
|
-
constructor(property: IProperty);
|
|
8
|
-
refreshValue(valueType: ValueType, value: any): void;
|
|
9
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BasePropertyEditor } from './BasePropertyEditor.js';
|
|
2
|
-
import { html } from '@node-projects/base-custom-webcomponent';
|
|
3
|
-
export class JsonPropertyEditor extends BasePropertyEditor {
|
|
4
|
-
static template = html `
|
|
5
|
-
<div style="display: flex;">
|
|
6
|
-
<input id="input" type="text">
|
|
7
|
-
<button style="width: 30px;">...</button>
|
|
8
|
-
</div>
|
|
9
|
-
`;
|
|
10
|
-
_input;
|
|
11
|
-
constructor(property) {
|
|
12
|
-
super(property);
|
|
13
|
-
let el = JsonPropertyEditor.template.content.cloneNode(true);
|
|
14
|
-
this._input = el.getElementById('input');
|
|
15
|
-
this._input.onchange = (e) => this._valueChanged(this._input.value);
|
|
16
|
-
this.element = el;
|
|
17
|
-
}
|
|
18
|
-
refreshValue(valueType, value) {
|
|
19
|
-
this._input.value = value;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ITransactionItem } from '../ITransactionItem.js';
|
|
2
|
-
import { IDesignItem } from '../../../item/IDesignItem.js';
|
|
3
|
-
import { IBinding } from '../../../item/IBinding.js';
|
|
4
|
-
export declare class AttributeChangeAction implements ITransactionItem {
|
|
5
|
-
constructor(designItem: IDesignItem, name: string, newValue: string | IBinding | null, oldValue: string | IBinding | null);
|
|
6
|
-
title?: string;
|
|
7
|
-
get affectedItems(): IDesignItem[];
|
|
8
|
-
undo(): void;
|
|
9
|
-
do(): void;
|
|
10
|
-
designItem: IDesignItem;
|
|
11
|
-
name: string;
|
|
12
|
-
newValue: any;
|
|
13
|
-
oldValue: any;
|
|
14
|
-
mergeWith(other: ITransactionItem): boolean;
|
|
15
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
export class AttributeChangeAction {
|
|
2
|
-
constructor(designItem, name, newValue, oldValue) {
|
|
3
|
-
this.title = "Change Attribute " + name + " of <" + designItem.name + ">";
|
|
4
|
-
this.designItem = designItem;
|
|
5
|
-
this.name = name;
|
|
6
|
-
this.newValue = newValue;
|
|
7
|
-
this.oldValue = oldValue;
|
|
8
|
-
}
|
|
9
|
-
title;
|
|
10
|
-
get affectedItems() {
|
|
11
|
-
return [this.designItem];
|
|
12
|
-
}
|
|
13
|
-
undo() {
|
|
14
|
-
if (this.oldValue == null) {
|
|
15
|
-
this.designItem._withoutUndoRemoveAttribute(this.name);
|
|
16
|
-
try {
|
|
17
|
-
this.designItem.element.removeAttribute(this.name);
|
|
18
|
-
}
|
|
19
|
-
catch (e) {
|
|
20
|
-
console.warn(e);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
this.designItem._withoutUndoSetAttribute(this.name, this.oldValue);
|
|
25
|
-
if (this.name != "draggable") {
|
|
26
|
-
try {
|
|
27
|
-
if (typeof this.oldValue === 'string')
|
|
28
|
-
this.designItem.element.setAttribute(this.name, this.oldValue);
|
|
29
|
-
}
|
|
30
|
-
catch (e) {
|
|
31
|
-
console.warn(e);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
do() {
|
|
37
|
-
if (this.newValue == null) {
|
|
38
|
-
this.designItem._withoutUndoRemoveAttribute(this.name);
|
|
39
|
-
try {
|
|
40
|
-
this.designItem.element.removeAttribute(this.name);
|
|
41
|
-
}
|
|
42
|
-
catch (e) {
|
|
43
|
-
console.warn(e);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
this.designItem._withoutUndoSetAttribute(this.name, this.newValue);
|
|
48
|
-
if (this.name != "draggable") {
|
|
49
|
-
try {
|
|
50
|
-
if (typeof this.newValue === 'string')
|
|
51
|
-
this.designItem.element.setAttribute(this.name, this.newValue);
|
|
52
|
-
}
|
|
53
|
-
catch (e) {
|
|
54
|
-
console.warn(e);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
designItem;
|
|
60
|
-
name;
|
|
61
|
-
newValue;
|
|
62
|
-
oldValue;
|
|
63
|
-
mergeWith(other) {
|
|
64
|
-
if (other instanceof AttributeChangeAction && this.designItem === other.designItem && this.name === other.name) {
|
|
65
|
-
this.newValue = other.newValue;
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ITransactionItem } from '../ITransactionItem.js';
|
|
2
|
-
import { IDesignItem } from '../../../item/IDesignItem.js';
|
|
3
|
-
export declare class ContentChangeAction implements ITransactionItem {
|
|
4
|
-
constructor(designItem: IDesignItem, newValue: string);
|
|
5
|
-
title?: string;
|
|
6
|
-
get affectedItems(): IDesignItem[];
|
|
7
|
-
undo(): void;
|
|
8
|
-
do(): void;
|
|
9
|
-
designItem: IDesignItem;
|
|
10
|
-
newValue: any;
|
|
11
|
-
oldValue: any;
|
|
12
|
-
mergeWith(other: ITransactionItem): boolean;
|
|
13
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { NodeType } from '../../../item/NodeType.js';
|
|
2
|
-
export class ContentChangeAction {
|
|
3
|
-
constructor(designItem, newValue) {
|
|
4
|
-
this.title = "Change Content of " + designItem.name + " to " + newValue;
|
|
5
|
-
this.designItem = designItem;
|
|
6
|
-
this.newValue = newValue;
|
|
7
|
-
}
|
|
8
|
-
title;
|
|
9
|
-
get affectedItems() {
|
|
10
|
-
return [this.designItem];
|
|
11
|
-
}
|
|
12
|
-
undo() {
|
|
13
|
-
if (this.designItem.nodeType == NodeType.TextNode || this.designItem.nodeType == NodeType.Comment) {
|
|
14
|
-
this.designItem.element.textContent = this.oldValue;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
this.designItem.element.innerHTML = this.oldValue;
|
|
18
|
-
}
|
|
19
|
-
this.affectedItems[0].instanceServiceContainer.contentService.onContentChanged.emit({ changeType: 'edited', designItems: [this.designItem] });
|
|
20
|
-
}
|
|
21
|
-
do() {
|
|
22
|
-
if (this.designItem.nodeType == NodeType.TextNode || this.designItem.nodeType == NodeType.Comment) {
|
|
23
|
-
this.oldValue = this.designItem.element.textContent;
|
|
24
|
-
this.designItem.element.textContent = this.newValue;
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
this.oldValue = this.designItem.element.innerHTML;
|
|
28
|
-
this.designItem.element.innerHTML = this.newValue;
|
|
29
|
-
}
|
|
30
|
-
this.affectedItems[0].instanceServiceContainer.contentService.onContentChanged.emit({ changeType: 'edited', designItems: [this.designItem] });
|
|
31
|
-
}
|
|
32
|
-
designItem;
|
|
33
|
-
newValue;
|
|
34
|
-
oldValue;
|
|
35
|
-
mergeWith(other) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ITransactionItem } from '../ITransactionItem.js';
|
|
2
|
-
import { IDesignItem } from '../../../item/IDesignItem.js';
|
|
3
|
-
export declare class CssStyleChangeAction implements ITransactionItem {
|
|
4
|
-
constructor(designItem: IDesignItem, name: string, newValue: any, oldValue: any);
|
|
5
|
-
title?: string;
|
|
6
|
-
get affectedItems(): IDesignItem[];
|
|
7
|
-
undo(): void;
|
|
8
|
-
do(): void;
|
|
9
|
-
designItem: IDesignItem;
|
|
10
|
-
name: string;
|
|
11
|
-
newValue: any;
|
|
12
|
-
oldValue: any;
|
|
13
|
-
mergeWith(other: ITransactionItem): boolean;
|
|
14
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export class CssStyleChangeAction {
|
|
2
|
-
constructor(designItem, name, newValue, oldValue) {
|
|
3
|
-
this.title = "Change Css Style " + name + " of <" + designItem.name + ">";
|
|
4
|
-
this.designItem = designItem;
|
|
5
|
-
this.name = name;
|
|
6
|
-
this.newValue = newValue;
|
|
7
|
-
this.oldValue = oldValue;
|
|
8
|
-
}
|
|
9
|
-
title;
|
|
10
|
-
get affectedItems() {
|
|
11
|
-
return [this.designItem];
|
|
12
|
-
}
|
|
13
|
-
undo() {
|
|
14
|
-
if (this.oldValue === '' || this.oldValue == null) {
|
|
15
|
-
this.designItem._withoutUndoRemoveStyle(this.name);
|
|
16
|
-
this.designItem.element.style[this.name] = '';
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
this.designItem._withoutUndoSetStyle(this.name, this.oldValue);
|
|
20
|
-
this.designItem.element.style[this.name] = this.oldValue;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
do() {
|
|
24
|
-
if (this.newValue === '' || this.newValue == null) {
|
|
25
|
-
this.designItem._withoutUndoRemoveStyle(this.name);
|
|
26
|
-
this.designItem.element.style[this.name] = '';
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
this.designItem._withoutUndoSetStyle(this.name, this.newValue);
|
|
30
|
-
this.designItem.element.style[this.name] = this.newValue;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
designItem;
|
|
34
|
-
name;
|
|
35
|
-
newValue;
|
|
36
|
-
oldValue;
|
|
37
|
-
mergeWith(other) {
|
|
38
|
-
if (other instanceof CssStyleChangeAction && this.designItem === other.designItem && this.name === other.name) {
|
|
39
|
-
this.newValue = other.newValue;
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
}
|