@contrail/documents 1.0.14 → 1.0.15
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/lib/components/components.d.ts +128 -20
- package/lib/components/components.js +91 -91
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +13 -13
- package/lib/document-action.d.ts +7 -7
- package/lib/document-action.js +10 -10
- package/lib/document-element-factory.d.ts +9 -9
- package/lib/document-element-factory.js +54 -54
- package/lib/document-element-property-binding-handler.d.ts +5 -5
- package/lib/document-element-property-binding-handler.js +28 -28
- package/lib/index.d.ts +5 -5
- package/lib/index.js +17 -17
- package/lib/types/common.d.ts +45 -45
- package/lib/types/common.js +2 -2
- package/lib/types/data-object.d.ts +6 -6
- package/lib/types/data-object.js +2 -2
- package/lib/types/document-change.d.ts +12 -12
- package/lib/types/document-change.js +9 -9
- package/lib/types/document-element-event.d.ts +11 -11
- package/lib/types/document-element-event.js +2 -2
- package/lib/types/document-element-holder.d.ts +8 -8
- package/lib/types/document-element-holder.js +2 -2
- package/lib/types/document-element.d.ts +11 -11
- package/lib/types/document-element.js +2 -2
- package/lib/types/document.d.ts +17 -17
- package/lib/types/document.js +2 -2
- package/lib/types/element-transformation.d.ts +12 -12
- package/lib/types/element-transformation.js +2 -2
- package/lib/types/index.d.ts +8 -8
- package/lib/types/index.js +20 -20
- package/package.json +44 -47
|
@@ -1,20 +1,128 @@
|
|
|
1
|
-
import { Document } from '../types/document';
|
|
2
|
-
export interface ComponentDefinition {
|
|
3
|
-
slug: string;
|
|
4
|
-
defaultTemplate: Document;
|
|
5
|
-
}
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { Document } from '../types/document';
|
|
2
|
+
export interface ComponentDefinition {
|
|
3
|
+
slug: string;
|
|
4
|
+
defaultTemplate: Document;
|
|
5
|
+
}
|
|
6
|
+
export declare const ITEM_VIEW_TEMPLATE: {
|
|
7
|
+
elements: ({
|
|
8
|
+
type: string;
|
|
9
|
+
size: {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
propertyBindings: {
|
|
14
|
+
url: string;
|
|
15
|
+
text?: undefined;
|
|
16
|
+
};
|
|
17
|
+
position?: undefined;
|
|
18
|
+
style?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
type: string;
|
|
21
|
+
position: {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
};
|
|
25
|
+
size: {
|
|
26
|
+
height: number;
|
|
27
|
+
width: number;
|
|
28
|
+
};
|
|
29
|
+
style: {
|
|
30
|
+
font: {
|
|
31
|
+
size: number;
|
|
32
|
+
};
|
|
33
|
+
color?: undefined;
|
|
34
|
+
};
|
|
35
|
+
propertyBindings: {
|
|
36
|
+
text: string;
|
|
37
|
+
url?: undefined;
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
40
|
+
type: string;
|
|
41
|
+
position: {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
};
|
|
45
|
+
size: {
|
|
46
|
+
height: number;
|
|
47
|
+
width: number;
|
|
48
|
+
};
|
|
49
|
+
style: {
|
|
50
|
+
font: {
|
|
51
|
+
size: number;
|
|
52
|
+
};
|
|
53
|
+
color: string;
|
|
54
|
+
};
|
|
55
|
+
propertyBindings: {
|
|
56
|
+
text: string;
|
|
57
|
+
url?: undefined;
|
|
58
|
+
};
|
|
59
|
+
})[];
|
|
60
|
+
};
|
|
61
|
+
export declare const ITEM_COLOR_VIEW_STATIC_THUMBNAIL_TEMPLATE: Document;
|
|
62
|
+
export declare const ITEM_VIEW: {
|
|
63
|
+
slug: string;
|
|
64
|
+
defaultTemplate: {
|
|
65
|
+
elements: ({
|
|
66
|
+
type: string;
|
|
67
|
+
size: {
|
|
68
|
+
width: number;
|
|
69
|
+
height: number;
|
|
70
|
+
};
|
|
71
|
+
propertyBindings: {
|
|
72
|
+
url: string;
|
|
73
|
+
text?: undefined;
|
|
74
|
+
};
|
|
75
|
+
position?: undefined;
|
|
76
|
+
style?: undefined;
|
|
77
|
+
} | {
|
|
78
|
+
type: string;
|
|
79
|
+
position: {
|
|
80
|
+
x: number;
|
|
81
|
+
y: number;
|
|
82
|
+
};
|
|
83
|
+
size: {
|
|
84
|
+
height: number;
|
|
85
|
+
width: number;
|
|
86
|
+
};
|
|
87
|
+
style: {
|
|
88
|
+
font: {
|
|
89
|
+
size: number;
|
|
90
|
+
};
|
|
91
|
+
color?: undefined;
|
|
92
|
+
};
|
|
93
|
+
propertyBindings: {
|
|
94
|
+
text: string;
|
|
95
|
+
url?: undefined;
|
|
96
|
+
};
|
|
97
|
+
} | {
|
|
98
|
+
type: string;
|
|
99
|
+
position: {
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
};
|
|
103
|
+
size: {
|
|
104
|
+
height: number;
|
|
105
|
+
width: number;
|
|
106
|
+
};
|
|
107
|
+
style: {
|
|
108
|
+
font: {
|
|
109
|
+
size: number;
|
|
110
|
+
};
|
|
111
|
+
color: string;
|
|
112
|
+
};
|
|
113
|
+
propertyBindings: {
|
|
114
|
+
text: string;
|
|
115
|
+
url?: undefined;
|
|
116
|
+
};
|
|
117
|
+
})[];
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
export declare const ITEM_COLOR_STATIC_THUMBNAIL_VIEW: {
|
|
121
|
+
slug: string;
|
|
122
|
+
defaultTemplate: Document;
|
|
123
|
+
};
|
|
124
|
+
export declare class ComponentRegistry {
|
|
125
|
+
private static componentDefinitionMap;
|
|
126
|
+
static getComponentDefinition(slug: string): ComponentDefinition;
|
|
127
|
+
private static initMap;
|
|
128
|
+
}
|
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ComponentRegistry = exports.ITEM_COLOR_STATIC_THUMBNAIL_VIEW = exports.
|
|
4
|
-
exports.
|
|
5
|
-
elements: [{
|
|
6
|
-
type: "image",
|
|
7
|
-
size: { width: 125, height: 125 },
|
|
8
|
-
propertyBindings: { url: 'thumbnail.downloadUrl' }
|
|
9
|
-
}, {
|
|
10
|
-
type: "text",
|
|
11
|
-
position: { x: 0, y: 126 },
|
|
12
|
-
size: { height: 25, width: 125 },
|
|
13
|
-
style: {
|
|
14
|
-
font: {
|
|
15
|
-
size: 8,
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
propertyBindings: { text: '
|
|
19
|
-
}, {
|
|
20
|
-
type: "text",
|
|
21
|
-
position: { x: 0, y: 151 },
|
|
22
|
-
size: { height: 25, width: 125 },
|
|
23
|
-
style: {
|
|
24
|
-
font: {
|
|
25
|
-
size: 8,
|
|
26
|
-
},
|
|
27
|
-
color: 'rgba(0,0,0,.5)',
|
|
28
|
-
},
|
|
29
|
-
propertyBindings: { text: '
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
};
|
|
33
|
-
exports.ITEM_COLOR_VIEW_STATIC_THUMBNAIL_TEMPLATE = {
|
|
34
|
-
elements: [{
|
|
35
|
-
type: "image",
|
|
36
|
-
size: { width: 125, height: 125 },
|
|
37
|
-
propertyBindings: { url: 'itemColor.thumbnail' }
|
|
38
|
-
}, {
|
|
39
|
-
type: "text",
|
|
40
|
-
position: { x: 0, y: 126 },
|
|
41
|
-
style: {
|
|
42
|
-
font: {
|
|
43
|
-
size: 8,
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
propertyBindings: { text: 'itemColor.item.name' }
|
|
47
|
-
}, {
|
|
48
|
-
type: "text",
|
|
49
|
-
position: { x: 0, y: 137 },
|
|
50
|
-
style: {
|
|
51
|
-
font: {
|
|
52
|
-
size: 8,
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
propertyBindings: { text: 'itemColor.item.styleNumber' }
|
|
56
|
-
}, {
|
|
57
|
-
type: "text",
|
|
58
|
-
position: { x: 0, y: 148 },
|
|
59
|
-
size: { height: 25, width: 125 },
|
|
60
|
-
style: {
|
|
61
|
-
font: {
|
|
62
|
-
size: 8,
|
|
63
|
-
},
|
|
64
|
-
color: 'rgba(0,0,0,.5)',
|
|
65
|
-
},
|
|
66
|
-
propertyBindings: { text: 'itemColor.name' }
|
|
67
|
-
}
|
|
68
|
-
]
|
|
69
|
-
};
|
|
70
|
-
exports.
|
|
71
|
-
slug: 'item-
|
|
72
|
-
defaultTemplate: exports.
|
|
73
|
-
};
|
|
74
|
-
exports.ITEM_COLOR_STATIC_THUMBNAIL_VIEW = {
|
|
75
|
-
slug: 'item-color-static-thumbnail-view',
|
|
76
|
-
defaultTemplate: exports.ITEM_COLOR_VIEW_STATIC_THUMBNAIL_TEMPLATE,
|
|
77
|
-
};
|
|
78
|
-
class ComponentRegistry {
|
|
79
|
-
static getComponentDefinition(slug) {
|
|
80
|
-
if (!this.componentDefinitionMap) {
|
|
81
|
-
this.initMap();
|
|
82
|
-
}
|
|
83
|
-
return this.componentDefinitionMap.get(slug);
|
|
84
|
-
}
|
|
85
|
-
static initMap() {
|
|
86
|
-
this.componentDefinitionMap = new Map();
|
|
87
|
-
this.componentDefinitionMap.set('item-
|
|
88
|
-
this.componentDefinitionMap.set('item-color-static-thumbnail-view', exports.ITEM_COLOR_STATIC_THUMBNAIL_VIEW);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.ComponentRegistry = ComponentRegistry;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentRegistry = exports.ITEM_COLOR_STATIC_THUMBNAIL_VIEW = exports.ITEM_VIEW = exports.ITEM_COLOR_VIEW_STATIC_THUMBNAIL_TEMPLATE = exports.ITEM_VIEW_TEMPLATE = void 0;
|
|
4
|
+
exports.ITEM_VIEW_TEMPLATE = {
|
|
5
|
+
elements: [{
|
|
6
|
+
type: "image",
|
|
7
|
+
size: { width: 125, height: 125 },
|
|
8
|
+
propertyBindings: { url: 'thumbnail.downloadUrl' }
|
|
9
|
+
}, {
|
|
10
|
+
type: "text",
|
|
11
|
+
position: { x: 0, y: 126 },
|
|
12
|
+
size: { height: 25, width: 125 },
|
|
13
|
+
style: {
|
|
14
|
+
font: {
|
|
15
|
+
size: 8,
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
propertyBindings: { text: 'item.name' }
|
|
19
|
+
}, {
|
|
20
|
+
type: "text",
|
|
21
|
+
position: { x: 0, y: 151 },
|
|
22
|
+
size: { height: 25, width: 125 },
|
|
23
|
+
style: {
|
|
24
|
+
font: {
|
|
25
|
+
size: 8,
|
|
26
|
+
},
|
|
27
|
+
color: 'rgba(0,0,0,.5)',
|
|
28
|
+
},
|
|
29
|
+
propertyBindings: { text: 'item.optionName' }
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
exports.ITEM_COLOR_VIEW_STATIC_THUMBNAIL_TEMPLATE = {
|
|
34
|
+
elements: [{
|
|
35
|
+
type: "image",
|
|
36
|
+
size: { width: 125, height: 125 },
|
|
37
|
+
propertyBindings: { url: 'itemColor.thumbnail' }
|
|
38
|
+
}, {
|
|
39
|
+
type: "text",
|
|
40
|
+
position: { x: 0, y: 126 },
|
|
41
|
+
style: {
|
|
42
|
+
font: {
|
|
43
|
+
size: 8,
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
propertyBindings: { text: 'itemColor.item.name' }
|
|
47
|
+
}, {
|
|
48
|
+
type: "text",
|
|
49
|
+
position: { x: 0, y: 137 },
|
|
50
|
+
style: {
|
|
51
|
+
font: {
|
|
52
|
+
size: 8,
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
propertyBindings: { text: 'itemColor.item.styleNumber' }
|
|
56
|
+
}, {
|
|
57
|
+
type: "text",
|
|
58
|
+
position: { x: 0, y: 148 },
|
|
59
|
+
size: { height: 25, width: 125 },
|
|
60
|
+
style: {
|
|
61
|
+
font: {
|
|
62
|
+
size: 8,
|
|
63
|
+
},
|
|
64
|
+
color: 'rgba(0,0,0,.5)',
|
|
65
|
+
},
|
|
66
|
+
propertyBindings: { text: 'itemColor.name' }
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
};
|
|
70
|
+
exports.ITEM_VIEW = {
|
|
71
|
+
slug: 'item-view',
|
|
72
|
+
defaultTemplate: exports.ITEM_VIEW_TEMPLATE,
|
|
73
|
+
};
|
|
74
|
+
exports.ITEM_COLOR_STATIC_THUMBNAIL_VIEW = {
|
|
75
|
+
slug: 'item-color-static-thumbnail-view',
|
|
76
|
+
defaultTemplate: exports.ITEM_COLOR_VIEW_STATIC_THUMBNAIL_TEMPLATE,
|
|
77
|
+
};
|
|
78
|
+
class ComponentRegistry {
|
|
79
|
+
static getComponentDefinition(slug) {
|
|
80
|
+
if (!this.componentDefinitionMap) {
|
|
81
|
+
this.initMap();
|
|
82
|
+
}
|
|
83
|
+
return this.componentDefinitionMap.get(slug);
|
|
84
|
+
}
|
|
85
|
+
static initMap() {
|
|
86
|
+
this.componentDefinitionMap = new Map();
|
|
87
|
+
this.componentDefinitionMap.set('item-view', exports.ITEM_VIEW);
|
|
88
|
+
this.componentDefinitionMap.set('item-color-static-thumbnail-view', exports.ITEM_COLOR_STATIC_THUMBNAIL_VIEW);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.ComponentRegistry = ComponentRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './components';
|
|
1
|
+
export * from './components';
|
package/lib/components/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./components"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./components"), exports);
|
package/lib/document-action.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Action } from '@contrail/actions';
|
|
2
|
-
import { DocumentChange } from './types';
|
|
3
|
-
export declare class DocumentAction extends Action {
|
|
4
|
-
changeDefinition: DocumentChange;
|
|
5
|
-
undoChangeDefinition: DocumentChange;
|
|
6
|
-
constructor(change: any, undoChange?: any);
|
|
7
|
-
}
|
|
1
|
+
import { Action } from '@contrail/actions';
|
|
2
|
+
import { DocumentChange } from './types';
|
|
3
|
+
export declare class DocumentAction extends Action {
|
|
4
|
+
changeDefinition: DocumentChange;
|
|
5
|
+
undoChangeDefinition: DocumentChange;
|
|
6
|
+
constructor(change: any, undoChange?: any);
|
|
7
|
+
}
|
package/lib/document-action.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DocumentAction = void 0;
|
|
4
|
-
const actions_1 = require("@contrail/actions");
|
|
5
|
-
class DocumentAction extends actions_1.Action {
|
|
6
|
-
constructor(change, undoChange = null) {
|
|
7
|
-
super('document', change, undoChange);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.DocumentAction = DocumentAction;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentAction = void 0;
|
|
4
|
+
const actions_1 = require("@contrail/actions");
|
|
5
|
+
class DocumentAction extends actions_1.Action {
|
|
6
|
+
constructor(change, undoChange = null) {
|
|
7
|
+
super('document', change, undoChange);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.DocumentAction = DocumentAction;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DocumentElement } from './types/document-element';
|
|
2
|
-
export declare class DocumentElementFactory {
|
|
3
|
-
private static initNewElement;
|
|
4
|
-
static createTextElement(text: string, options?: DocumentElement): DocumentElement;
|
|
5
|
-
static createShapeElement(type: string, options?: DocumentElement): DocumentElement;
|
|
6
|
-
static createElement(type: string, options?: DocumentElement): DocumentElement;
|
|
7
|
-
static createImageElement(options: DocumentElement): DocumentElement;
|
|
8
|
-
static createComponent(componentType: string, model: any, modelBindings: any, options?: DocumentElement): DocumentElement;
|
|
9
|
-
}
|
|
1
|
+
import { DocumentElement } from './types/document-element';
|
|
2
|
+
export declare class DocumentElementFactory {
|
|
3
|
+
private static initNewElement;
|
|
4
|
+
static createTextElement(text: string, options?: DocumentElement): DocumentElement;
|
|
5
|
+
static createShapeElement(type: string, options?: DocumentElement): DocumentElement;
|
|
6
|
+
static createElement(type: string, options?: DocumentElement): DocumentElement;
|
|
7
|
+
static createImageElement(options: DocumentElement): DocumentElement;
|
|
8
|
+
static createComponent(componentType: string, model: any, modelBindings: any, options?: DocumentElement): DocumentElement;
|
|
9
|
+
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DocumentElementFactory = void 0;
|
|
4
|
-
const uuid_1 = require("uuid");
|
|
5
|
-
const components_1 = require("./components/components");
|
|
6
|
-
const document_element_property_binding_handler_1 = require("./document-element-property-binding-handler");
|
|
7
|
-
class DocumentElementFactory {
|
|
8
|
-
static initNewElement(type) {
|
|
9
|
-
const element = {
|
|
10
|
-
id: uuid_1.v4(),
|
|
11
|
-
position: { x: 300, y: 300 },
|
|
12
|
-
type,
|
|
13
|
-
};
|
|
14
|
-
return element;
|
|
15
|
-
}
|
|
16
|
-
static createTextElement(text, options = {}) {
|
|
17
|
-
let element = this.initNewElement('text');
|
|
18
|
-
element.text = text;
|
|
19
|
-
element.size = { width: 65, height: 20 };
|
|
20
|
-
element.style = {
|
|
21
|
-
color: '#000000'
|
|
22
|
-
};
|
|
23
|
-
element = Object.assign(element, options);
|
|
24
|
-
return element;
|
|
25
|
-
}
|
|
26
|
-
static createShapeElement(type, options = {}) {
|
|
27
|
-
let element = this.initNewElement(type);
|
|
28
|
-
element = Object.assign(element, options);
|
|
29
|
-
return element;
|
|
30
|
-
}
|
|
31
|
-
static createElement(type, options = {}) {
|
|
32
|
-
let element = this.initNewElement(type);
|
|
33
|
-
element = Object.assign(element, options);
|
|
34
|
-
return element;
|
|
35
|
-
}
|
|
36
|
-
static createImageElement(options) {
|
|
37
|
-
let element = this.initNewElement('image');
|
|
38
|
-
element = Object.assign(element, options);
|
|
39
|
-
return element;
|
|
40
|
-
}
|
|
41
|
-
static createComponent(componentType, model, modelBindings, options) {
|
|
42
|
-
let element = this.initNewElement('component');
|
|
43
|
-
if (options) {
|
|
44
|
-
element = Object.assign(element, options);
|
|
45
|
-
}
|
|
46
|
-
const componentDefinition = components_1.ComponentRegistry.getComponentDefinition(componentType);
|
|
47
|
-
const elements = JSON.parse(JSON.stringify(componentDefinition.defaultTemplate.elements));
|
|
48
|
-
document_element_property_binding_handler_1.DocumentElementPropertyBindingHandler.bindPropertiesToElements(elements, model);
|
|
49
|
-
element.elements = elements;
|
|
50
|
-
element.modelBindings = modelBindings;
|
|
51
|
-
return element;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.DocumentElementFactory = DocumentElementFactory;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentElementFactory = void 0;
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
5
|
+
const components_1 = require("./components/components");
|
|
6
|
+
const document_element_property_binding_handler_1 = require("./document-element-property-binding-handler");
|
|
7
|
+
class DocumentElementFactory {
|
|
8
|
+
static initNewElement(type) {
|
|
9
|
+
const element = {
|
|
10
|
+
id: uuid_1.v4(),
|
|
11
|
+
position: { x: 300, y: 300 },
|
|
12
|
+
type,
|
|
13
|
+
};
|
|
14
|
+
return element;
|
|
15
|
+
}
|
|
16
|
+
static createTextElement(text, options = {}) {
|
|
17
|
+
let element = this.initNewElement('text');
|
|
18
|
+
element.text = text;
|
|
19
|
+
element.size = { width: 65, height: 20 };
|
|
20
|
+
element.style = {
|
|
21
|
+
color: '#000000'
|
|
22
|
+
};
|
|
23
|
+
element = Object.assign(element, options);
|
|
24
|
+
return element;
|
|
25
|
+
}
|
|
26
|
+
static createShapeElement(type, options = {}) {
|
|
27
|
+
let element = this.initNewElement(type);
|
|
28
|
+
element = Object.assign(element, options);
|
|
29
|
+
return element;
|
|
30
|
+
}
|
|
31
|
+
static createElement(type, options = {}) {
|
|
32
|
+
let element = this.initNewElement(type);
|
|
33
|
+
element = Object.assign(element, options);
|
|
34
|
+
return element;
|
|
35
|
+
}
|
|
36
|
+
static createImageElement(options) {
|
|
37
|
+
let element = this.initNewElement('image');
|
|
38
|
+
element = Object.assign(element, options);
|
|
39
|
+
return element;
|
|
40
|
+
}
|
|
41
|
+
static createComponent(componentType, model, modelBindings, options) {
|
|
42
|
+
let element = this.initNewElement('component');
|
|
43
|
+
if (options) {
|
|
44
|
+
element = Object.assign(element, options);
|
|
45
|
+
}
|
|
46
|
+
const componentDefinition = components_1.ComponentRegistry.getComponentDefinition(componentType);
|
|
47
|
+
const elements = JSON.parse(JSON.stringify(componentDefinition.defaultTemplate.elements));
|
|
48
|
+
document_element_property_binding_handler_1.DocumentElementPropertyBindingHandler.bindPropertiesToElements(elements, model);
|
|
49
|
+
element.elements = elements;
|
|
50
|
+
element.modelBindings = modelBindings;
|
|
51
|
+
return element;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.DocumentElementFactory = DocumentElementFactory;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DocumentElement } from './types/document-element';
|
|
2
|
-
export declare class DocumentElementPropertyBindingHandler {
|
|
3
|
-
static bindPropertiesToElements(elements: Array<DocumentElement>, model: any): void;
|
|
4
|
-
static bindPropertiesToElement(element: DocumentElement, model: any): void;
|
|
5
|
-
}
|
|
1
|
+
import { DocumentElement } from './types/document-element';
|
|
2
|
+
export declare class DocumentElementPropertyBindingHandler {
|
|
3
|
+
static bindPropertiesToElements(elements: Array<DocumentElement>, model: any): void;
|
|
4
|
+
static bindPropertiesToElement(element: DocumentElement, model: any): void;
|
|
5
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DocumentElementPropertyBindingHandler = void 0;
|
|
4
|
-
const util_1 = require("@contrail/util");
|
|
5
|
-
class DocumentElementPropertyBindingHandler {
|
|
6
|
-
static bindPropertiesToElements(elements, model) {
|
|
7
|
-
elements.map(el => {
|
|
8
|
-
this.bindPropertiesToElement(el, model);
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
static bindPropertiesToElement(element, model) {
|
|
12
|
-
const localModel = Object.assign({}, model);
|
|
13
|
-
if (!element.propertyBindings) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
if (element.modelBindings) {
|
|
17
|
-
}
|
|
18
|
-
for (const propertyKey of Object.keys(element.propertyBindings)) {
|
|
19
|
-
const modelIndex = element.propertyBindings[propertyKey];
|
|
20
|
-
const propertyValue = util_1.ObjectUtil.getByPath(localModel, modelIndex) || '';
|
|
21
|
-
element[propertyKey] = propertyValue;
|
|
22
|
-
}
|
|
23
|
-
if (element.elements) {
|
|
24
|
-
this.bindPropertiesToElements(element.elements, localModel);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.DocumentElementPropertyBindingHandler = DocumentElementPropertyBindingHandler;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentElementPropertyBindingHandler = void 0;
|
|
4
|
+
const util_1 = require("@contrail/util");
|
|
5
|
+
class DocumentElementPropertyBindingHandler {
|
|
6
|
+
static bindPropertiesToElements(elements, model) {
|
|
7
|
+
elements.map(el => {
|
|
8
|
+
this.bindPropertiesToElement(el, model);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
static bindPropertiesToElement(element, model) {
|
|
12
|
+
const localModel = Object.assign({}, model);
|
|
13
|
+
if (!element.propertyBindings) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (element.modelBindings) {
|
|
17
|
+
}
|
|
18
|
+
for (const propertyKey of Object.keys(element.propertyBindings)) {
|
|
19
|
+
const modelIndex = element.propertyBindings[propertyKey];
|
|
20
|
+
const propertyValue = util_1.ObjectUtil.getByPath(localModel, modelIndex) || '';
|
|
21
|
+
element[propertyKey] = propertyValue;
|
|
22
|
+
}
|
|
23
|
+
if (element.elements) {
|
|
24
|
+
this.bindPropertiesToElements(element.elements, localModel);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.DocumentElementPropertyBindingHandler = DocumentElementPropertyBindingHandler;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './components';
|
|
3
|
-
export * from './document-element-factory';
|
|
4
|
-
export * from './document-element-property-binding-handler';
|
|
5
|
-
export * from './document-action';
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './components';
|
|
3
|
+
export * from './document-element-factory';
|
|
4
|
+
export * from './document-element-property-binding-handler';
|
|
5
|
+
export * from './document-action';
|
package/lib/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./types"), exports);
|
|
14
|
-
__exportStar(require("./components"), exports);
|
|
15
|
-
__exportStar(require("./document-element-factory"), exports);
|
|
16
|
-
__exportStar(require("./document-element-property-binding-handler"), exports);
|
|
17
|
-
__exportStar(require("./document-action"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./types"), exports);
|
|
14
|
+
__exportStar(require("./components"), exports);
|
|
15
|
+
__exportStar(require("./document-element-factory"), exports);
|
|
16
|
+
__exportStar(require("./document-element-property-binding-handler"), exports);
|
|
17
|
+
__exportStar(require("./document-action"), exports);
|
package/lib/types/common.d.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
export interface TextStyleDefinition {
|
|
2
|
-
valign?: string;
|
|
3
|
-
align?: string;
|
|
4
|
-
decoration?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface FontStyleDefinition {
|
|
7
|
-
family?: string;
|
|
8
|
-
size?: number;
|
|
9
|
-
weight?: string;
|
|
10
|
-
style?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface BorderStyleDefinition {
|
|
13
|
-
style?: string;
|
|
14
|
-
color?: string;
|
|
15
|
-
width?: string;
|
|
16
|
-
radius?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface BackgroundStyleDefinition {
|
|
19
|
-
color?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface StyleDefinition {
|
|
22
|
-
background?: BackgroundStyleDefinition;
|
|
23
|
-
text?: TextStyleDefinition;
|
|
24
|
-
font?: FontStyleDefinition;
|
|
25
|
-
border?: BorderStyleDefinition;
|
|
26
|
-
color?: string;
|
|
27
|
-
backgroundColor?: string;
|
|
28
|
-
borderColor?: string;
|
|
29
|
-
borderSize?: number;
|
|
30
|
-
}
|
|
31
|
-
export interface SizeDefinition {
|
|
32
|
-
width?: number;
|
|
33
|
-
height?: number;
|
|
34
|
-
}
|
|
35
|
-
export interface PositionDefinition {
|
|
36
|
-
x?: number;
|
|
37
|
-
y?: number;
|
|
38
|
-
z?: number;
|
|
39
|
-
}
|
|
40
|
-
export interface LineDefinition {
|
|
41
|
-
x1?: number;
|
|
42
|
-
x2?: number;
|
|
43
|
-
y1?: number;
|
|
44
|
-
y2?: number;
|
|
45
|
-
}
|
|
1
|
+
export interface TextStyleDefinition {
|
|
2
|
+
valign?: string;
|
|
3
|
+
align?: string;
|
|
4
|
+
decoration?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface FontStyleDefinition {
|
|
7
|
+
family?: string;
|
|
8
|
+
size?: number;
|
|
9
|
+
weight?: string;
|
|
10
|
+
style?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface BorderStyleDefinition {
|
|
13
|
+
style?: string;
|
|
14
|
+
color?: string;
|
|
15
|
+
width?: string;
|
|
16
|
+
radius?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface BackgroundStyleDefinition {
|
|
19
|
+
color?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface StyleDefinition {
|
|
22
|
+
background?: BackgroundStyleDefinition;
|
|
23
|
+
text?: TextStyleDefinition;
|
|
24
|
+
font?: FontStyleDefinition;
|
|
25
|
+
border?: BorderStyleDefinition;
|
|
26
|
+
color?: string;
|
|
27
|
+
backgroundColor?: string;
|
|
28
|
+
borderColor?: string;
|
|
29
|
+
borderSize?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface SizeDefinition {
|
|
32
|
+
width?: number;
|
|
33
|
+
height?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface PositionDefinition {
|
|
36
|
+
x?: number;
|
|
37
|
+
y?: number;
|
|
38
|
+
z?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface LineDefinition {
|
|
41
|
+
x1?: number;
|
|
42
|
+
x2?: number;
|
|
43
|
+
y1?: number;
|
|
44
|
+
y2?: number;
|
|
45
|
+
}
|
package/lib/types/common.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface DataObject {
|
|
2
|
-
entityRef?: string;
|
|
3
|
-
entity?: any;
|
|
4
|
-
viewDefinitionRef?: string;
|
|
5
|
-
viewDefinition?: any;
|
|
6
|
-
}
|
|
1
|
+
export interface DataObject {
|
|
2
|
+
entityRef?: string;
|
|
3
|
+
entity?: any;
|
|
4
|
+
viewDefinitionRef?: string;
|
|
5
|
+
viewDefinition?: any;
|
|
6
|
+
}
|
package/lib/types/data-object.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { DocumentElement } from './document-element';
|
|
2
|
-
export declare enum DocumentChangeType {
|
|
3
|
-
ADD_ELEMENT = "ADD_ELEMENT",
|
|
4
|
-
DELETE_ELEMENT = "DELETE_ELEMENT",
|
|
5
|
-
MODIFY_ELEMENT = "MODIFY_ELEMENT"
|
|
6
|
-
}
|
|
7
|
-
export interface DocumentChange {
|
|
8
|
-
changeType: DocumentChangeType;
|
|
9
|
-
documentId?: string;
|
|
10
|
-
elementData?: DocumentElement;
|
|
11
|
-
elementId?: string;
|
|
12
|
-
}
|
|
1
|
+
import { DocumentElement } from './document-element';
|
|
2
|
+
export declare enum DocumentChangeType {
|
|
3
|
+
ADD_ELEMENT = "ADD_ELEMENT",
|
|
4
|
+
DELETE_ELEMENT = "DELETE_ELEMENT",
|
|
5
|
+
MODIFY_ELEMENT = "MODIFY_ELEMENT"
|
|
6
|
+
}
|
|
7
|
+
export interface DocumentChange {
|
|
8
|
+
changeType: DocumentChangeType;
|
|
9
|
+
documentId?: string;
|
|
10
|
+
elementData?: DocumentElement;
|
|
11
|
+
elementId?: string;
|
|
12
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DocumentChangeType = void 0;
|
|
4
|
-
var DocumentChangeType;
|
|
5
|
-
(function (DocumentChangeType) {
|
|
6
|
-
DocumentChangeType["ADD_ELEMENT"] = "ADD_ELEMENT";
|
|
7
|
-
DocumentChangeType["DELETE_ELEMENT"] = "DELETE_ELEMENT";
|
|
8
|
-
DocumentChangeType["MODIFY_ELEMENT"] = "MODIFY_ELEMENT";
|
|
9
|
-
})(DocumentChangeType = exports.DocumentChangeType || (exports.DocumentChangeType = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentChangeType = void 0;
|
|
4
|
+
var DocumentChangeType;
|
|
5
|
+
(function (DocumentChangeType) {
|
|
6
|
+
DocumentChangeType["ADD_ELEMENT"] = "ADD_ELEMENT";
|
|
7
|
+
DocumentChangeType["DELETE_ELEMENT"] = "DELETE_ELEMENT";
|
|
8
|
+
DocumentChangeType["MODIFY_ELEMENT"] = "MODIFY_ELEMENT";
|
|
9
|
+
})(DocumentChangeType = exports.DocumentChangeType || (exports.DocumentChangeType = {}));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { PositionDefinition, SizeDefinition } from "./common";
|
|
2
|
-
import { DocumentElement } from "./document-element";
|
|
3
|
-
export interface DocumentElementEvent {
|
|
4
|
-
element: DocumentElement;
|
|
5
|
-
selectedElements?: Array<DocumentElement>;
|
|
6
|
-
renderedElementPosition?: PositionDefinition;
|
|
7
|
-
renderedElementSize?: SizeDefinition;
|
|
8
|
-
eventType?: string;
|
|
9
|
-
sourceMouseEvent?: MouseEvent;
|
|
10
|
-
relativeMousePosition?: PositionDefinition;
|
|
11
|
-
}
|
|
1
|
+
import { PositionDefinition, SizeDefinition } from "./common";
|
|
2
|
+
import { DocumentElement } from "./document-element";
|
|
3
|
+
export interface DocumentElementEvent {
|
|
4
|
+
element: DocumentElement;
|
|
5
|
+
selectedElements?: Array<DocumentElement>;
|
|
6
|
+
renderedElementPosition?: PositionDefinition;
|
|
7
|
+
renderedElementSize?: SizeDefinition;
|
|
8
|
+
eventType?: string;
|
|
9
|
+
sourceMouseEvent?: MouseEvent;
|
|
10
|
+
relativeMousePosition?: PositionDefinition;
|
|
11
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DocumentElement } from './document-element';
|
|
2
|
-
interface AddElement {
|
|
3
|
-
(elements: Array<DocumentElement>): Promise<any>;
|
|
4
|
-
}
|
|
5
|
-
export interface DocumentElementHolder {
|
|
6
|
-
addElements: AddElement;
|
|
7
|
-
}
|
|
8
|
-
export {};
|
|
1
|
+
import { DocumentElement } from './document-element';
|
|
2
|
+
interface AddElement {
|
|
3
|
+
(elements: Array<DocumentElement>): Promise<any>;
|
|
4
|
+
}
|
|
5
|
+
export interface DocumentElementHolder {
|
|
6
|
+
addElements: AddElement;
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LineDefinition, PositionDefinition } from './common';
|
|
2
|
-
import { Document } from './document';
|
|
3
|
-
export interface DocumentElement extends Document {
|
|
4
|
-
id?: string;
|
|
5
|
-
type?: string;
|
|
6
|
-
position?: PositionDefinition;
|
|
7
|
-
text?: string;
|
|
8
|
-
url?: string;
|
|
9
|
-
propertyBindings?: any;
|
|
10
|
-
lineDefinition?: LineDefinition;
|
|
11
|
-
}
|
|
1
|
+
import { LineDefinition, PositionDefinition } from './common';
|
|
2
|
+
import { Document } from './document';
|
|
3
|
+
export interface DocumentElement extends Document {
|
|
4
|
+
id?: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
position?: PositionDefinition;
|
|
7
|
+
text?: string;
|
|
8
|
+
url?: string;
|
|
9
|
+
propertyBindings?: any;
|
|
10
|
+
lineDefinition?: LineDefinition;
|
|
11
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/types/document.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { SizeDefinition, StyleDefinition } from "./common";
|
|
2
|
-
import { DocumentElement } from "./document-element";
|
|
3
|
-
export interface ImportReferenceDetail {
|
|
4
|
-
importedSlideReference?: string;
|
|
5
|
-
importedFileReference?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface Document {
|
|
8
|
-
id?: string;
|
|
9
|
-
name?: string;
|
|
10
|
-
elements?: Array<DocumentElement>;
|
|
11
|
-
size?: SizeDefinition;
|
|
12
|
-
style?: StyleDefinition;
|
|
13
|
-
model?: any;
|
|
14
|
-
modelBindings?: any;
|
|
15
|
-
background?: Array<DocumentElement>;
|
|
16
|
-
importedFrom?: ImportReferenceDetail;
|
|
17
|
-
}
|
|
1
|
+
import { SizeDefinition, StyleDefinition } from "./common";
|
|
2
|
+
import { DocumentElement } from "./document-element";
|
|
3
|
+
export interface ImportReferenceDetail {
|
|
4
|
+
importedSlideReference?: string;
|
|
5
|
+
importedFileReference?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Document {
|
|
8
|
+
id?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
elements?: Array<DocumentElement>;
|
|
11
|
+
size?: SizeDefinition;
|
|
12
|
+
style?: StyleDefinition;
|
|
13
|
+
model?: any;
|
|
14
|
+
modelBindings?: any;
|
|
15
|
+
background?: Array<DocumentElement>;
|
|
16
|
+
importedFrom?: ImportReferenceDetail;
|
|
17
|
+
}
|
package/lib/types/document.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export interface ScaleTransformation {
|
|
2
|
-
x?: number;
|
|
3
|
-
y?: number;
|
|
4
|
-
}
|
|
5
|
-
export interface TranslateTransformation {
|
|
6
|
-
x?: number;
|
|
7
|
-
y?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface ElementTransformation {
|
|
10
|
-
translate?: TranslateTransformation;
|
|
11
|
-
scale?: ScaleTransformation;
|
|
12
|
-
}
|
|
1
|
+
export interface ScaleTransformation {
|
|
2
|
+
x?: number;
|
|
3
|
+
y?: number;
|
|
4
|
+
}
|
|
5
|
+
export interface TranslateTransformation {
|
|
6
|
+
x?: number;
|
|
7
|
+
y?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ElementTransformation {
|
|
10
|
+
translate?: TranslateTransformation;
|
|
11
|
+
scale?: ScaleTransformation;
|
|
12
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './common';
|
|
2
|
-
export * from './data-object';
|
|
3
|
-
export * from './document-change';
|
|
4
|
-
export * from './document-element-event';
|
|
5
|
-
export * from './document-element-holder';
|
|
6
|
-
export * from './document-element';
|
|
7
|
-
export * from './document';
|
|
8
|
-
export * from './element-transformation';
|
|
1
|
+
export * from './common';
|
|
2
|
+
export * from './data-object';
|
|
3
|
+
export * from './document-change';
|
|
4
|
+
export * from './document-element-event';
|
|
5
|
+
export * from './document-element-holder';
|
|
6
|
+
export * from './document-element';
|
|
7
|
+
export * from './document';
|
|
8
|
+
export * from './element-transformation';
|
package/lib/types/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./common"), exports);
|
|
14
|
-
__exportStar(require("./data-object"), exports);
|
|
15
|
-
__exportStar(require("./document-change"), exports);
|
|
16
|
-
__exportStar(require("./document-element-event"), exports);
|
|
17
|
-
__exportStar(require("./document-element-holder"), exports);
|
|
18
|
-
__exportStar(require("./document-element"), exports);
|
|
19
|
-
__exportStar(require("./document"), exports);
|
|
20
|
-
__exportStar(require("./element-transformation"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./common"), exports);
|
|
14
|
+
__exportStar(require("./data-object"), exports);
|
|
15
|
+
__exportStar(require("./document-change"), exports);
|
|
16
|
+
__exportStar(require("./document-element-event"), exports);
|
|
17
|
+
__exportStar(require("./document-element-holder"), exports);
|
|
18
|
+
__exportStar(require("./document-element"), exports);
|
|
19
|
+
__exportStar(require("./document"), exports);
|
|
20
|
+
__exportStar(require("./element-transformation"), exports);
|
package/package.json
CHANGED
|
@@ -1,47 +1,44 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@contrail/documents",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Documents library for contrail platform",
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"types": "lib/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc",
|
|
9
|
-
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
|
10
|
-
"lint": "tslint -p tsconfig.json",
|
|
11
|
-
"test": "jest"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [],
|
|
14
|
-
"author": "",
|
|
15
|
-
"license": "ISC",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"prettier": "^1.
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"reflect-metadata": "^0.1.13"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@contrail/documents",
|
|
3
|
+
"version": "1.0.15",
|
|
4
|
+
"description": "Documents library for contrail platform",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
|
10
|
+
"lint": "tslint -p tsconfig.json",
|
|
11
|
+
"test": "jest"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/jest": "^23.3.14",
|
|
18
|
+
"jest": "^23.6.0",
|
|
19
|
+
"prettier": "^1.19.1",
|
|
20
|
+
"ts-jest": "^23.10.5",
|
|
21
|
+
"tslint": "^5.11.0",
|
|
22
|
+
"tslint-config-prettier": "^1.18.0",
|
|
23
|
+
"typescript": "^3.0.1"
|
|
24
|
+
},
|
|
25
|
+
"jest": {
|
|
26
|
+
"moduleFileExtensions": [
|
|
27
|
+
"js",
|
|
28
|
+
"json",
|
|
29
|
+
"ts"
|
|
30
|
+
],
|
|
31
|
+
"rootDir": "src",
|
|
32
|
+
"testRegex": ".spec.ts$",
|
|
33
|
+
"transform": {
|
|
34
|
+
"^.+\\.(t|j)s$": "ts-jest"
|
|
35
|
+
},
|
|
36
|
+
"coverageDirectory": "../coverage",
|
|
37
|
+
"testEnvironment": "node"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@contrail/actions": "^1.0.14",
|
|
41
|
+
"@contrail/util": "^1.0.9",
|
|
42
|
+
"reflect-metadata": "^0.1.13"
|
|
43
|
+
}
|
|
44
|
+
}
|