@contrail/documents 1.0.116 → 1.0.118
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.
|
@@ -218,6 +218,144 @@ export declare const ITEM_VIEW_TEMPLATE_V3: {
|
|
|
218
218
|
};
|
|
219
219
|
})[];
|
|
220
220
|
};
|
|
221
|
+
export declare const COLOR_PADDING = 5;
|
|
222
|
+
export declare const COLOR_FONT_SIZE = 8;
|
|
223
|
+
export declare const COLOR_WIDTH = 140;
|
|
224
|
+
export declare const COLOR_VIEW_TEMPLATE: {
|
|
225
|
+
elements: ({
|
|
226
|
+
type: string;
|
|
227
|
+
position: {
|
|
228
|
+
x: number;
|
|
229
|
+
y: number;
|
|
230
|
+
};
|
|
231
|
+
size: {
|
|
232
|
+
width: number;
|
|
233
|
+
height: number;
|
|
234
|
+
};
|
|
235
|
+
style: {
|
|
236
|
+
backgroundColor: string;
|
|
237
|
+
border: {
|
|
238
|
+
width: number;
|
|
239
|
+
color: string;
|
|
240
|
+
radius: number;
|
|
241
|
+
};
|
|
242
|
+
font?: undefined;
|
|
243
|
+
};
|
|
244
|
+
propertyBindings?: undefined;
|
|
245
|
+
} | {
|
|
246
|
+
type: string;
|
|
247
|
+
position: {
|
|
248
|
+
x: number;
|
|
249
|
+
y: number;
|
|
250
|
+
};
|
|
251
|
+
size: {
|
|
252
|
+
height: number;
|
|
253
|
+
width: number;
|
|
254
|
+
};
|
|
255
|
+
style: {
|
|
256
|
+
border: {
|
|
257
|
+
width: number;
|
|
258
|
+
color: string;
|
|
259
|
+
radius?: undefined;
|
|
260
|
+
};
|
|
261
|
+
backgroundColor?: undefined;
|
|
262
|
+
font?: undefined;
|
|
263
|
+
};
|
|
264
|
+
propertyBindings: {
|
|
265
|
+
'style.backgroundColor': string;
|
|
266
|
+
text?: undefined;
|
|
267
|
+
};
|
|
268
|
+
} | {
|
|
269
|
+
type: string;
|
|
270
|
+
position: {
|
|
271
|
+
x: number;
|
|
272
|
+
y: number;
|
|
273
|
+
};
|
|
274
|
+
size: {
|
|
275
|
+
height: number;
|
|
276
|
+
width: number;
|
|
277
|
+
};
|
|
278
|
+
style: {
|
|
279
|
+
font: {
|
|
280
|
+
size: number;
|
|
281
|
+
};
|
|
282
|
+
backgroundColor?: undefined;
|
|
283
|
+
border?: undefined;
|
|
284
|
+
};
|
|
285
|
+
propertyBindings: {
|
|
286
|
+
text: string;
|
|
287
|
+
'style.backgroundColor'?: undefined;
|
|
288
|
+
};
|
|
289
|
+
})[];
|
|
290
|
+
};
|
|
291
|
+
export declare const PATTERN_VIEW_TEMPLATE: {
|
|
292
|
+
elements: ({
|
|
293
|
+
type: string;
|
|
294
|
+
position: {
|
|
295
|
+
x: number;
|
|
296
|
+
y: number;
|
|
297
|
+
};
|
|
298
|
+
size: {
|
|
299
|
+
width: number;
|
|
300
|
+
height: number;
|
|
301
|
+
};
|
|
302
|
+
style: {
|
|
303
|
+
backgroundColor: string;
|
|
304
|
+
border: {
|
|
305
|
+
width: number;
|
|
306
|
+
color: string;
|
|
307
|
+
radius: number;
|
|
308
|
+
};
|
|
309
|
+
background?: undefined;
|
|
310
|
+
font?: undefined;
|
|
311
|
+
};
|
|
312
|
+
propertyBindings?: undefined;
|
|
313
|
+
} | {
|
|
314
|
+
type: string;
|
|
315
|
+
position: {
|
|
316
|
+
x: number;
|
|
317
|
+
y: number;
|
|
318
|
+
};
|
|
319
|
+
size: {
|
|
320
|
+
height: number;
|
|
321
|
+
width: number;
|
|
322
|
+
};
|
|
323
|
+
style: {
|
|
324
|
+
background: {
|
|
325
|
+
size: BackgroundSizeType;
|
|
326
|
+
};
|
|
327
|
+
backgroundColor?: undefined;
|
|
328
|
+
border?: undefined;
|
|
329
|
+
font?: undefined;
|
|
330
|
+
};
|
|
331
|
+
propertyBindings: {
|
|
332
|
+
url: string;
|
|
333
|
+
text?: undefined;
|
|
334
|
+
};
|
|
335
|
+
} | {
|
|
336
|
+
type: string;
|
|
337
|
+
position: {
|
|
338
|
+
x: number;
|
|
339
|
+
y: number;
|
|
340
|
+
};
|
|
341
|
+
size: {
|
|
342
|
+
height: number;
|
|
343
|
+
width: number;
|
|
344
|
+
};
|
|
345
|
+
style: {
|
|
346
|
+
font: {
|
|
347
|
+
size: number;
|
|
348
|
+
};
|
|
349
|
+
backgroundColor?: undefined;
|
|
350
|
+
border?: undefined;
|
|
351
|
+
background?: undefined;
|
|
352
|
+
};
|
|
353
|
+
propertyBindings: {
|
|
354
|
+
text: string;
|
|
355
|
+
url?: undefined;
|
|
356
|
+
};
|
|
357
|
+
})[];
|
|
358
|
+
};
|
|
221
359
|
export declare const ITEM_VIEW: {
|
|
222
360
|
slug: string;
|
|
223
361
|
defaultTemplate: {
|
|
@@ -441,6 +579,147 @@ export declare const ITEM_VIEW_V3: {
|
|
|
441
579
|
})[];
|
|
442
580
|
};
|
|
443
581
|
};
|
|
582
|
+
export declare const COLOR_VIEW: {
|
|
583
|
+
slug: string;
|
|
584
|
+
defaultTemplate: {
|
|
585
|
+
elements: ({
|
|
586
|
+
type: string;
|
|
587
|
+
position: {
|
|
588
|
+
x: number;
|
|
589
|
+
y: number;
|
|
590
|
+
};
|
|
591
|
+
size: {
|
|
592
|
+
width: number;
|
|
593
|
+
height: number;
|
|
594
|
+
};
|
|
595
|
+
style: {
|
|
596
|
+
backgroundColor: string;
|
|
597
|
+
border: {
|
|
598
|
+
width: number;
|
|
599
|
+
color: string;
|
|
600
|
+
radius: number;
|
|
601
|
+
};
|
|
602
|
+
font?: undefined;
|
|
603
|
+
};
|
|
604
|
+
propertyBindings?: undefined;
|
|
605
|
+
} | {
|
|
606
|
+
type: string;
|
|
607
|
+
position: {
|
|
608
|
+
x: number;
|
|
609
|
+
y: number;
|
|
610
|
+
};
|
|
611
|
+
size: {
|
|
612
|
+
height: number;
|
|
613
|
+
width: number;
|
|
614
|
+
};
|
|
615
|
+
style: {
|
|
616
|
+
border: {
|
|
617
|
+
width: number;
|
|
618
|
+
color: string;
|
|
619
|
+
radius?: undefined;
|
|
620
|
+
};
|
|
621
|
+
backgroundColor?: undefined;
|
|
622
|
+
font?: undefined;
|
|
623
|
+
};
|
|
624
|
+
propertyBindings: {
|
|
625
|
+
'style.backgroundColor': string;
|
|
626
|
+
text?: undefined;
|
|
627
|
+
};
|
|
628
|
+
} | {
|
|
629
|
+
type: string;
|
|
630
|
+
position: {
|
|
631
|
+
x: number;
|
|
632
|
+
y: number;
|
|
633
|
+
};
|
|
634
|
+
size: {
|
|
635
|
+
height: number;
|
|
636
|
+
width: number;
|
|
637
|
+
};
|
|
638
|
+
style: {
|
|
639
|
+
font: {
|
|
640
|
+
size: number;
|
|
641
|
+
};
|
|
642
|
+
backgroundColor?: undefined;
|
|
643
|
+
border?: undefined;
|
|
644
|
+
};
|
|
645
|
+
propertyBindings: {
|
|
646
|
+
text: string;
|
|
647
|
+
'style.backgroundColor'?: undefined;
|
|
648
|
+
};
|
|
649
|
+
})[];
|
|
650
|
+
};
|
|
651
|
+
};
|
|
652
|
+
export declare const PATTERN_VIEW: {
|
|
653
|
+
slug: string;
|
|
654
|
+
defaultTemplate: {
|
|
655
|
+
elements: ({
|
|
656
|
+
type: string;
|
|
657
|
+
position: {
|
|
658
|
+
x: number;
|
|
659
|
+
y: number;
|
|
660
|
+
};
|
|
661
|
+
size: {
|
|
662
|
+
width: number;
|
|
663
|
+
height: number;
|
|
664
|
+
};
|
|
665
|
+
style: {
|
|
666
|
+
backgroundColor: string;
|
|
667
|
+
border: {
|
|
668
|
+
width: number;
|
|
669
|
+
color: string;
|
|
670
|
+
radius: number;
|
|
671
|
+
};
|
|
672
|
+
background?: undefined;
|
|
673
|
+
font?: undefined;
|
|
674
|
+
};
|
|
675
|
+
propertyBindings?: undefined;
|
|
676
|
+
} | {
|
|
677
|
+
type: string;
|
|
678
|
+
position: {
|
|
679
|
+
x: number;
|
|
680
|
+
y: number;
|
|
681
|
+
};
|
|
682
|
+
size: {
|
|
683
|
+
height: number;
|
|
684
|
+
width: number;
|
|
685
|
+
};
|
|
686
|
+
style: {
|
|
687
|
+
background: {
|
|
688
|
+
size: BackgroundSizeType;
|
|
689
|
+
};
|
|
690
|
+
backgroundColor?: undefined;
|
|
691
|
+
border?: undefined;
|
|
692
|
+
font?: undefined;
|
|
693
|
+
};
|
|
694
|
+
propertyBindings: {
|
|
695
|
+
url: string;
|
|
696
|
+
text?: undefined;
|
|
697
|
+
};
|
|
698
|
+
} | {
|
|
699
|
+
type: string;
|
|
700
|
+
position: {
|
|
701
|
+
x: number;
|
|
702
|
+
y: number;
|
|
703
|
+
};
|
|
704
|
+
size: {
|
|
705
|
+
height: number;
|
|
706
|
+
width: number;
|
|
707
|
+
};
|
|
708
|
+
style: {
|
|
709
|
+
font: {
|
|
710
|
+
size: number;
|
|
711
|
+
};
|
|
712
|
+
backgroundColor?: undefined;
|
|
713
|
+
border?: undefined;
|
|
714
|
+
background?: undefined;
|
|
715
|
+
};
|
|
716
|
+
propertyBindings: {
|
|
717
|
+
text: string;
|
|
718
|
+
url?: undefined;
|
|
719
|
+
};
|
|
720
|
+
})[];
|
|
721
|
+
};
|
|
722
|
+
};
|
|
444
723
|
export declare class ComponentRegistry {
|
|
445
724
|
private static componentDefinitionMap;
|
|
446
725
|
static getComponentDefinition(slug: string): ComponentDefinition;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ComponentRegistry = exports.ITEM_VIEW_V3 = exports.ITEM_VIEW_V2 = exports.ITEM_VIEW = exports.ITEM_VIEW_TEMPLATE_V3 = exports.ITEM_VIEW_TEMPLATE_V2 = exports.ITEM_VIEW_TEMPLATE = void 0;
|
|
3
|
+
exports.ComponentRegistry = exports.PATTERN_VIEW = exports.COLOR_VIEW = exports.ITEM_VIEW_V3 = exports.ITEM_VIEW_V2 = exports.ITEM_VIEW = exports.PATTERN_VIEW_TEMPLATE = exports.COLOR_VIEW_TEMPLATE = exports.COLOR_WIDTH = exports.COLOR_FONT_SIZE = exports.COLOR_PADDING = exports.ITEM_VIEW_TEMPLATE_V3 = exports.ITEM_VIEW_TEMPLATE_V2 = exports.ITEM_VIEW_TEMPLATE = void 0;
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
exports.ITEM_VIEW_TEMPLATE = {
|
|
6
6
|
elements: [
|
|
@@ -114,6 +114,96 @@ exports.ITEM_VIEW_TEMPLATE_V3 = {
|
|
|
114
114
|
},
|
|
115
115
|
],
|
|
116
116
|
};
|
|
117
|
+
exports.COLOR_PADDING = 5;
|
|
118
|
+
exports.COLOR_FONT_SIZE = 8;
|
|
119
|
+
exports.COLOR_WIDTH = 140;
|
|
120
|
+
exports.COLOR_VIEW_TEMPLATE = {
|
|
121
|
+
elements: [
|
|
122
|
+
{
|
|
123
|
+
type: 'rectangle',
|
|
124
|
+
position: { x: 0, y: 0 },
|
|
125
|
+
size: {
|
|
126
|
+
width: exports.COLOR_WIDTH + exports.COLOR_PADDING * 2,
|
|
127
|
+
height: exports.COLOR_WIDTH + exports.COLOR_FONT_SIZE + exports.COLOR_PADDING * 4,
|
|
128
|
+
},
|
|
129
|
+
style: {
|
|
130
|
+
backgroundColor: '#FFFFFF',
|
|
131
|
+
border: {
|
|
132
|
+
width: 0,
|
|
133
|
+
color: 'rgba(0,0,0,.1)',
|
|
134
|
+
radius: 5,
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: 'rectangle',
|
|
140
|
+
position: { x: exports.COLOR_PADDING, y: exports.COLOR_PADDING },
|
|
141
|
+
size: { height: exports.COLOR_WIDTH, width: exports.COLOR_WIDTH },
|
|
142
|
+
style: {
|
|
143
|
+
border: {
|
|
144
|
+
width: 0,
|
|
145
|
+
color: '#FFFFFF',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
propertyBindings: { 'style.backgroundColor': 'color.hexCode' },
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
type: 'text',
|
|
152
|
+
position: { x: exports.COLOR_PADDING, y: exports.COLOR_WIDTH + exports.COLOR_PADDING * 2 },
|
|
153
|
+
size: {
|
|
154
|
+
height: exports.COLOR_FONT_SIZE + exports.COLOR_PADDING,
|
|
155
|
+
width: exports.COLOR_WIDTH,
|
|
156
|
+
},
|
|
157
|
+
style: {
|
|
158
|
+
font: {
|
|
159
|
+
size: exports.COLOR_FONT_SIZE,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
propertyBindings: { text: 'color.name' },
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
};
|
|
166
|
+
exports.PATTERN_VIEW_TEMPLATE = {
|
|
167
|
+
elements: [
|
|
168
|
+
{
|
|
169
|
+
type: 'rectangle',
|
|
170
|
+
position: { x: 0, y: 0 },
|
|
171
|
+
size: {
|
|
172
|
+
width: exports.COLOR_WIDTH + exports.COLOR_PADDING * 2,
|
|
173
|
+
height: exports.COLOR_WIDTH + exports.COLOR_FONT_SIZE + exports.COLOR_PADDING * 4,
|
|
174
|
+
},
|
|
175
|
+
style: {
|
|
176
|
+
backgroundColor: '#FFFFFF',
|
|
177
|
+
border: {
|
|
178
|
+
width: 0,
|
|
179
|
+
color: 'rgba(0,0,0,.1)',
|
|
180
|
+
radius: 5,
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: 'image',
|
|
186
|
+
position: { x: exports.COLOR_PADDING, y: exports.COLOR_PADDING },
|
|
187
|
+
size: { height: exports.COLOR_WIDTH, width: exports.COLOR_WIDTH },
|
|
188
|
+
style: { background: { size: types_1.BackgroundSizeType.CONTAIN } },
|
|
189
|
+
propertyBindings: { url: 'color.mediumViewableDownloadUrl' },
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
type: 'text',
|
|
193
|
+
position: { x: exports.COLOR_PADDING, y: exports.COLOR_WIDTH + exports.COLOR_PADDING * 2 },
|
|
194
|
+
size: {
|
|
195
|
+
height: exports.COLOR_FONT_SIZE + exports.COLOR_PADDING,
|
|
196
|
+
width: exports.COLOR_WIDTH,
|
|
197
|
+
},
|
|
198
|
+
style: {
|
|
199
|
+
font: {
|
|
200
|
+
size: exports.COLOR_FONT_SIZE,
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
propertyBindings: { text: 'color.name' },
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
};
|
|
117
207
|
exports.ITEM_VIEW = {
|
|
118
208
|
slug: 'item-view',
|
|
119
209
|
defaultTemplate: exports.ITEM_VIEW_TEMPLATE,
|
|
@@ -126,6 +216,14 @@ exports.ITEM_VIEW_V3 = {
|
|
|
126
216
|
slug: 'item-view-v3',
|
|
127
217
|
defaultTemplate: exports.ITEM_VIEW_TEMPLATE_V3,
|
|
128
218
|
};
|
|
219
|
+
exports.COLOR_VIEW = {
|
|
220
|
+
slug: 'color-view',
|
|
221
|
+
defaultTemplate: exports.COLOR_VIEW_TEMPLATE,
|
|
222
|
+
};
|
|
223
|
+
exports.PATTERN_VIEW = {
|
|
224
|
+
slug: 'pattern-view',
|
|
225
|
+
defaultTemplate: exports.PATTERN_VIEW_TEMPLATE,
|
|
226
|
+
};
|
|
129
227
|
class ComponentRegistry {
|
|
130
228
|
static getComponentDefinition(slug) {
|
|
131
229
|
if (!this.componentDefinitionMap) {
|
|
@@ -138,6 +236,8 @@ class ComponentRegistry {
|
|
|
138
236
|
this.componentDefinitionMap.set('item-view', exports.ITEM_VIEW);
|
|
139
237
|
this.componentDefinitionMap.set('item-view-v2', exports.ITEM_VIEW_V2);
|
|
140
238
|
this.componentDefinitionMap.set('item-view-v3', exports.ITEM_VIEW_V3);
|
|
239
|
+
this.componentDefinitionMap.set('color-view', exports.COLOR_VIEW);
|
|
240
|
+
this.componentDefinitionMap.set('pattern-view', exports.PATTERN_VIEW);
|
|
141
241
|
}
|
|
142
242
|
}
|
|
143
243
|
exports.ComponentRegistry = ComponentRegistry;
|
|
@@ -6,6 +6,11 @@ export interface AlternateUrls {
|
|
|
6
6
|
lowResolution?: string;
|
|
7
7
|
originalFile?: string;
|
|
8
8
|
}
|
|
9
|
+
export interface LinkedEdgeDefinition {
|
|
10
|
+
id?: string;
|
|
11
|
+
position?: PositionDefinition;
|
|
12
|
+
location?: 'auto' | 'top' | 'bottom' | 'left' | 'right';
|
|
13
|
+
}
|
|
9
14
|
export interface DocumentElement extends Document {
|
|
10
15
|
id?: string;
|
|
11
16
|
specifiedId?: string;
|
|
@@ -37,6 +42,8 @@ export interface DocumentElement extends Document {
|
|
|
37
42
|
tableId?: string;
|
|
38
43
|
colspan?: number;
|
|
39
44
|
rowspan?: number;
|
|
45
|
+
start?: LinkedEdgeDefinition;
|
|
46
|
+
end?: LinkedEdgeDefinition;
|
|
40
47
|
propertyBindingsMetaData?: {
|
|
41
48
|
displayFunction: string;
|
|
42
49
|
propertyType: string;
|