@contrail/documents 2.0.1-alpha.0 → 2.1.0-alpha.4325cd8
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/CHANGELOG.md +22 -0
- package/lib/containers/container-kind.d.ts +10 -0
- package/lib/containers/container-kind.js +7 -0
- package/lib/containers/document-container-index.d.ts +21 -0
- package/lib/containers/document-container-index.js +47 -0
- package/lib/containers/document-container.d.ts +22 -0
- package/lib/containers/document-container.js +38 -0
- package/lib/containers/document-container.service.d.ts +14 -0
- package/lib/containers/document-container.service.js +144 -0
- package/lib/document-element-constants.d.ts +3 -0
- package/lib/document-element-constants.js +22 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/lib/types/document-change.d.ts +1 -0
- package/package.json +7 -10
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,28 @@ All notable changes to `@contrail/documents` are documented here.
|
|
|
5
5
|
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
6
|
Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.1.0] - 2026-09-09
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `DocumentContainerService.buildIndex` and `DocumentContainerIndex` — which containers hold which
|
|
13
|
+
elements, for one document, resolved once and read back by lookup. A container is a frame or a
|
|
14
|
+
section, described by a `ContainerKind` carrying `elementType`, `nests` and `layer`. An element
|
|
15
|
+
belongs to the container whose box covers its measured centre and which is drawn below it.
|
|
16
|
+
Nesting gives a path with one container per depth, the later-drawn one winning where two cross.
|
|
17
|
+
A container is only ever content of a kind layered behind it, so a frame belongs to a section and
|
|
18
|
+
a section never to a frame. Shapes wider and taller than the container, and groups holding it,
|
|
19
|
+
are excluded.
|
|
20
|
+
- `SECTION_ELEMENT_TYPE`, `FRAME_ELEMENT_TYPE` and `SHAPE_ELEMENT_TYPES` in
|
|
21
|
+
`document-element-constants`, so the rule above has one definition rather than one per app.
|
|
22
|
+
|
|
23
|
+
## [1.17.0] - 2026-09-09
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- `DocumentChange.skipUndo?: boolean` — optional marker a producer sets on a forward
|
|
28
|
+
change definition to keep the action out of undo history.
|
|
29
|
+
|
|
8
30
|
## [1.16.0] - 2026-08-28
|
|
9
31
|
|
|
10
32
|
### Added
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FRAME_ELEMENT_TYPE, SECTION_ELEMENT_TYPE } from '../document-element-constants';
|
|
2
|
+
export type ContainerElementType = typeof FRAME_ELEMENT_TYPE | typeof SECTION_ELEMENT_TYPE;
|
|
3
|
+
export interface ContainerKind {
|
|
4
|
+
elementType: ContainerElementType;
|
|
5
|
+
nests: boolean;
|
|
6
|
+
layer: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const SECTION_KIND: ContainerKind;
|
|
9
|
+
export declare const FRAME_KIND: ContainerKind;
|
|
10
|
+
export declare const CONTAINER_KINDS: ContainerKind[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONTAINER_KINDS = exports.FRAME_KIND = exports.SECTION_KIND = void 0;
|
|
4
|
+
const document_element_constants_1 = require("../document-element-constants");
|
|
5
|
+
exports.SECTION_KIND = { elementType: document_element_constants_1.SECTION_ELEMENT_TYPE, nests: true, layer: 0 };
|
|
6
|
+
exports.FRAME_KIND = { elementType: document_element_constants_1.FRAME_ELEMENT_TYPE, nests: false, layer: 1 };
|
|
7
|
+
exports.CONTAINER_KINDS = [exports.SECTION_KIND, exports.FRAME_KIND];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PositionDefinition } from '../types';
|
|
2
|
+
import { ContainerElementType } from './container-kind';
|
|
3
|
+
import { DocumentContainer } from './document-container';
|
|
4
|
+
export declare class DocumentContainerIndex {
|
|
5
|
+
private readonly data;
|
|
6
|
+
constructor(data: {
|
|
7
|
+
containersById: Map<string, DocumentContainer>;
|
|
8
|
+
containerPathsByDocumentElementId: Map<string, Map<string, string[]>>;
|
|
9
|
+
memberIdsByContainerId: Map<string, string[]>;
|
|
10
|
+
containerIdsByElementType: Map<string, string[]>;
|
|
11
|
+
});
|
|
12
|
+
getContainer(containerId: string): DocumentContainer | null;
|
|
13
|
+
containersOf(documentElementId: string, elementType: ContainerElementType): DocumentContainer[];
|
|
14
|
+
containerIdsOf(documentElementId: string, elementType: ContainerElementType): string[];
|
|
15
|
+
innermostContainerIdOf(documentElementId: string, elementType: ContainerElementType): string | null;
|
|
16
|
+
memberIdsOf(containerId: string): string[];
|
|
17
|
+
containerPathAtPoint(point: PositionDefinition, elementType: ContainerElementType): string[];
|
|
18
|
+
maxDepth(elementType: ContainerElementType): number;
|
|
19
|
+
private containersOfType;
|
|
20
|
+
private containerPath;
|
|
21
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentContainerIndex = void 0;
|
|
4
|
+
const document_container_1 = require("./document-container");
|
|
5
|
+
class DocumentContainerIndex {
|
|
6
|
+
constructor(data) {
|
|
7
|
+
this.data = data;
|
|
8
|
+
}
|
|
9
|
+
getContainer(containerId) {
|
|
10
|
+
var _a;
|
|
11
|
+
return (_a = this.data.containersById.get(containerId)) !== null && _a !== void 0 ? _a : null;
|
|
12
|
+
}
|
|
13
|
+
containersOf(documentElementId, elementType) {
|
|
14
|
+
return this.containerIdsOf(documentElementId, elementType)
|
|
15
|
+
.map((containerId) => this.data.containersById.get(containerId))
|
|
16
|
+
.filter(Boolean);
|
|
17
|
+
}
|
|
18
|
+
containerIdsOf(documentElementId, elementType) {
|
|
19
|
+
return this.containerPath(documentElementId, elementType);
|
|
20
|
+
}
|
|
21
|
+
innermostContainerIdOf(documentElementId, elementType) {
|
|
22
|
+
const path = this.containerPath(documentElementId, elementType);
|
|
23
|
+
return path.length ? path[path.length - 1] : null;
|
|
24
|
+
}
|
|
25
|
+
memberIdsOf(containerId) {
|
|
26
|
+
var _a;
|
|
27
|
+
return (_a = this.data.memberIdsByContainerId.get(containerId)) !== null && _a !== void 0 ? _a : [];
|
|
28
|
+
}
|
|
29
|
+
containerPathAtPoint(point, elementType) {
|
|
30
|
+
const covering = this.containersOfType(elementType).filter((container) => (0, document_container_1.containsPoint)(container.box, point));
|
|
31
|
+
return (0, document_container_1.topmostPerDepth)(covering).map((container) => container.id);
|
|
32
|
+
}
|
|
33
|
+
maxDepth(elementType) {
|
|
34
|
+
return this.containersOfType(elementType).reduce((max, container) => Math.max(max, container.depth + 1), 0);
|
|
35
|
+
}
|
|
36
|
+
containersOfType(elementType) {
|
|
37
|
+
var _a;
|
|
38
|
+
return ((_a = this.data.containerIdsByElementType.get(elementType)) !== null && _a !== void 0 ? _a : [])
|
|
39
|
+
.map((containerId) => this.data.containersById.get(containerId))
|
|
40
|
+
.filter(Boolean);
|
|
41
|
+
}
|
|
42
|
+
containerPath(documentElementId, elementType) {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
return (_b = (_a = this.data.containerPathsByDocumentElementId.get(documentElementId)) === null || _a === void 0 ? void 0 : _a.get(elementType)) !== null && _b !== void 0 ? _b : [];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.DocumentContainerIndex = DocumentContainerIndex;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CoordinateBox, DocumentElement, PositionDefinition } from '../types';
|
|
2
|
+
import { ContainerKind } from './container-kind';
|
|
3
|
+
export interface DocumentContainer {
|
|
4
|
+
id: string;
|
|
5
|
+
kind: ContainerKind;
|
|
6
|
+
name: string;
|
|
7
|
+
documentElement: DocumentElement;
|
|
8
|
+
box: CoordinateBox;
|
|
9
|
+
depth: number;
|
|
10
|
+
drawOrder: number;
|
|
11
|
+
}
|
|
12
|
+
export interface MeasuredDocumentElement {
|
|
13
|
+
documentElement: DocumentElement;
|
|
14
|
+
box: CoordinateBox | null;
|
|
15
|
+
drawOrder: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function toCoordinateBox(x: number, y: number, width: number, height: number): CoordinateBox;
|
|
18
|
+
export declare function centerOf(box: CoordinateBox): PositionDefinition;
|
|
19
|
+
export declare function containsPoint(box: CoordinateBox, point: PositionDefinition): boolean;
|
|
20
|
+
export declare function encloses(outer: CoordinateBox, inner: CoordinateBox): boolean;
|
|
21
|
+
export declare function isWiderAndTallerThan(box: CoordinateBox, other: CoordinateBox): boolean;
|
|
22
|
+
export declare function topmostPerDepth(containers: DocumentContainer[]): DocumentContainer[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toCoordinateBox = toCoordinateBox;
|
|
4
|
+
exports.centerOf = centerOf;
|
|
5
|
+
exports.containsPoint = containsPoint;
|
|
6
|
+
exports.encloses = encloses;
|
|
7
|
+
exports.isWiderAndTallerThan = isWiderAndTallerThan;
|
|
8
|
+
exports.topmostPerDepth = topmostPerDepth;
|
|
9
|
+
function toCoordinateBox(x, y, width, height) {
|
|
10
|
+
return { x, y, width, height, left: x, right: x + width, top: y, bottom: y + height };
|
|
11
|
+
}
|
|
12
|
+
function centerOf(box) {
|
|
13
|
+
return { x: box.left + box.width / 2, y: box.top + box.height / 2 };
|
|
14
|
+
}
|
|
15
|
+
function containsPoint(box, point) {
|
|
16
|
+
return point.x >= box.left && point.x <= box.right && point.y >= box.top && point.y <= box.bottom;
|
|
17
|
+
}
|
|
18
|
+
function encloses(outer, inner) {
|
|
19
|
+
const covers = outer.left <= inner.left && outer.right >= inner.right && outer.top <= inner.top && outer.bottom >= inner.bottom;
|
|
20
|
+
const identical = outer.left === inner.left &&
|
|
21
|
+
outer.right === inner.right &&
|
|
22
|
+
outer.top === inner.top &&
|
|
23
|
+
outer.bottom === inner.bottom;
|
|
24
|
+
return covers && !identical;
|
|
25
|
+
}
|
|
26
|
+
function isWiderAndTallerThan(box, other) {
|
|
27
|
+
return box.width > other.width && box.height > other.height;
|
|
28
|
+
}
|
|
29
|
+
function topmostPerDepth(containers) {
|
|
30
|
+
const byDepth = [];
|
|
31
|
+
for (const container of containers) {
|
|
32
|
+
const existing = byDepth[container.depth];
|
|
33
|
+
if (!existing || container.drawOrder > existing.drawOrder) {
|
|
34
|
+
byDepth[container.depth] = container;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return byDepth.filter(Boolean);
|
|
38
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DocumentElement } from '../types';
|
|
2
|
+
import { ContainerKind } from './container-kind';
|
|
3
|
+
import { DocumentContainerIndex } from './document-container-index';
|
|
4
|
+
export declare class DocumentContainerService {
|
|
5
|
+
static buildIndex(documentElements: readonly DocumentElement[], kinds?: ContainerKind[]): DocumentContainerIndex;
|
|
6
|
+
static isContainer(documentElement: DocumentElement, kinds?: ContainerKind[]): boolean;
|
|
7
|
+
private static measureDocumentElements;
|
|
8
|
+
private static measure;
|
|
9
|
+
private static buildNesting;
|
|
10
|
+
private static resolveContainerPath;
|
|
11
|
+
private static resolveInnermostOnTop;
|
|
12
|
+
private static toContainerPath;
|
|
13
|
+
private static candidateContainers;
|
|
14
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentContainerService = void 0;
|
|
4
|
+
const document_element_factory_1 = require("../document-element-factory");
|
|
5
|
+
const document_element_constants_1 = require("../document-element-constants");
|
|
6
|
+
const container_kind_1 = require("./container-kind");
|
|
7
|
+
const document_container_index_1 = require("./document-container-index");
|
|
8
|
+
const document_container_1 = require("./document-container");
|
|
9
|
+
class DocumentContainerService {
|
|
10
|
+
static buildIndex(documentElements, kinds = container_kind_1.CONTAINER_KINDS) {
|
|
11
|
+
const measuredDocumentElements = this.measureDocumentElements(documentElements !== null && documentElements !== void 0 ? documentElements : []);
|
|
12
|
+
const nestingByElementType = new Map(kinds.map((kind) => [kind.elementType, this.buildNesting(measuredDocumentElements, kind)]));
|
|
13
|
+
const containersById = new Map();
|
|
14
|
+
const containerIdsByElementType = new Map();
|
|
15
|
+
nestingByElementType.forEach((nesting, elementType) => {
|
|
16
|
+
containerIdsByElementType.set(elementType, nesting.containers.map((container) => container.id));
|
|
17
|
+
nesting.containers.forEach((container) => containersById.set(container.id, container));
|
|
18
|
+
});
|
|
19
|
+
const containerPathsByDocumentElementId = new Map();
|
|
20
|
+
const memberIdsByContainerId = new Map();
|
|
21
|
+
for (const measured of measuredDocumentElements) {
|
|
22
|
+
const documentElementId = measured.documentElement.id;
|
|
23
|
+
const pathsByElementType = new Map();
|
|
24
|
+
for (const kind of kinds) {
|
|
25
|
+
const path = this.resolveContainerPath(measured, kind, kinds, nestingByElementType.get(kind.elementType));
|
|
26
|
+
pathsByElementType.set(kind.elementType, path);
|
|
27
|
+
for (const containerId of path) {
|
|
28
|
+
const members = memberIdsByContainerId.get(containerId);
|
|
29
|
+
if (members) {
|
|
30
|
+
members.push(documentElementId);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
memberIdsByContainerId.set(containerId, [documentElementId]);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
containerPathsByDocumentElementId.set(documentElementId, pathsByElementType);
|
|
38
|
+
}
|
|
39
|
+
return new document_container_index_1.DocumentContainerIndex({
|
|
40
|
+
containersById,
|
|
41
|
+
containerPathsByDocumentElementId,
|
|
42
|
+
memberIdsByContainerId,
|
|
43
|
+
containerIdsByElementType,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
static isContainer(documentElement, kinds = container_kind_1.CONTAINER_KINDS) {
|
|
47
|
+
return kinds.some((kind) => kind.elementType === (documentElement === null || documentElement === void 0 ? void 0 : documentElement.type));
|
|
48
|
+
}
|
|
49
|
+
static measureDocumentElements(documentElements) {
|
|
50
|
+
const documentElementsById = new Map(documentElements.map((documentElement) => [documentElement.id, documentElement]));
|
|
51
|
+
return documentElements.map((documentElement, drawOrder) => ({
|
|
52
|
+
documentElement,
|
|
53
|
+
drawOrder,
|
|
54
|
+
box: this.measure(documentElement, documentElementsById),
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
static measure(documentElement, documentElementsById) {
|
|
58
|
+
var _a, _b;
|
|
59
|
+
if (!(documentElement === null || documentElement === void 0 ? void 0 : documentElement.position)) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
const start = ((_a = documentElement.start) === null || _a === void 0 ? void 0 : _a.id) ? documentElementsById.get(documentElement.start.id) : undefined;
|
|
64
|
+
const end = ((_b = documentElement.end) === null || _b === void 0 ? void 0 : _b.id) ? documentElementsById.get(documentElement.end.id) : undefined;
|
|
65
|
+
const { x, y, width, height } = document_element_factory_1.DocumentElementFactory.getBoundingClientRect(documentElement, start, end);
|
|
66
|
+
return (0, document_container_1.toCoordinateBox)(x, y, width, height);
|
|
67
|
+
}
|
|
68
|
+
catch (_c) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
static buildNesting(measuredDocumentElements, kind) {
|
|
73
|
+
const containers = measuredDocumentElements
|
|
74
|
+
.filter((measured) => measured.documentElement.type === kind.elementType && measured.box)
|
|
75
|
+
.map((measured) => ({
|
|
76
|
+
id: measured.documentElement.id,
|
|
77
|
+
kind,
|
|
78
|
+
name: measured.documentElement.name,
|
|
79
|
+
documentElement: measured.documentElement,
|
|
80
|
+
box: measured.box,
|
|
81
|
+
depth: 0,
|
|
82
|
+
drawOrder: measured.drawOrder,
|
|
83
|
+
}));
|
|
84
|
+
const ancestorsById = new Map();
|
|
85
|
+
for (const container of containers) {
|
|
86
|
+
const ancestors = kind.nests
|
|
87
|
+
? containers.filter((other) => other !== container && (0, document_container_1.encloses)(other.box, container.box))
|
|
88
|
+
: [];
|
|
89
|
+
ancestorsById.set(container.id, ancestors);
|
|
90
|
+
container.depth = ancestors.length;
|
|
91
|
+
}
|
|
92
|
+
return { containers, ancestorsById };
|
|
93
|
+
}
|
|
94
|
+
static resolveContainerPath(measured, kind, kinds, nesting) {
|
|
95
|
+
var _a, _b;
|
|
96
|
+
if (!(nesting === null || nesting === void 0 ? void 0 : nesting.containers.length) || !measured.box) {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
const ownKind = kinds.find((candidate) => candidate.elementType === measured.documentElement.type);
|
|
100
|
+
if (ownKind) {
|
|
101
|
+
if (ownKind.elementType === kind.elementType) {
|
|
102
|
+
return kind.nests ? this.toContainerPath((_a = nesting.ancestorsById.get(measured.documentElement.id)) !== null && _a !== void 0 ? _a : []) : [];
|
|
103
|
+
}
|
|
104
|
+
if (kind.layer > ownKind.layer) {
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const candidates = this.candidateContainers(measured, nesting.containers);
|
|
109
|
+
if (!candidates.length) {
|
|
110
|
+
return [];
|
|
111
|
+
}
|
|
112
|
+
const innermostOnTop = this.resolveInnermostOnTop(candidates, nesting);
|
|
113
|
+
const candidateIds = new Set(candidates.map((container) => container.id));
|
|
114
|
+
const ancestors = ((_b = nesting.ancestorsById.get(innermostOnTop.id)) !== null && _b !== void 0 ? _b : []).filter((container) => candidateIds.has(container.id));
|
|
115
|
+
return this.toContainerPath([...ancestors, innermostOnTop]);
|
|
116
|
+
}
|
|
117
|
+
static resolveInnermostOnTop(candidates, nesting) {
|
|
118
|
+
const enclosingIds = new Set(candidates.flatMap((container) => { var _a; return (_a = nesting.ancestorsById.get(container.id)) !== null && _a !== void 0 ? _a : []; }).map((ancestor) => ancestor.id));
|
|
119
|
+
return candidates
|
|
120
|
+
.filter((container) => !enclosingIds.has(container.id))
|
|
121
|
+
.reduce((topmost, container) => (container.drawOrder > topmost.drawOrder ? container : topmost));
|
|
122
|
+
}
|
|
123
|
+
static toContainerPath(containers) {
|
|
124
|
+
return (0, document_container_1.topmostPerDepth)(containers).map((container) => container.id);
|
|
125
|
+
}
|
|
126
|
+
static candidateContainers(measured, containers) {
|
|
127
|
+
const center = (0, document_container_1.centerOf)(measured.box);
|
|
128
|
+
const isShape = document_element_constants_1.SHAPE_ELEMENT_TYPES.includes(measured.documentElement.type);
|
|
129
|
+
return containers.filter((container) => {
|
|
130
|
+
var _a;
|
|
131
|
+
if (container.id === measured.documentElement.id || measured.drawOrder <= container.drawOrder) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
if (!(0, document_container_1.containsPoint)(container.box, center)) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
if (isShape && (0, document_container_1.isWiderAndTallerThan)(measured.box, container.box)) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
return !((_a = measured.documentElement.elementIds) === null || _a === void 0 ? void 0 : _a.includes(container.id));
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.DocumentContainerService = DocumentContainerService;
|
|
@@ -3,3 +3,6 @@ export declare const ANNOTATION_PADDING_Y = 8;
|
|
|
3
3
|
export declare const COLOR_PADDING = 5;
|
|
4
4
|
export declare const COLOR_FONT_SIZE = 8;
|
|
5
5
|
export declare const COLOR_WIDTH = 140;
|
|
6
|
+
export declare const SECTION_ELEMENT_TYPE = "section";
|
|
7
|
+
export declare const FRAME_ELEMENT_TYPE = "frame";
|
|
8
|
+
export declare const SHAPE_ELEMENT_TYPES: string[];
|
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COLOR_WIDTH = exports.COLOR_FONT_SIZE = exports.COLOR_PADDING = exports.ANNOTATION_PADDING_Y = exports.ANNOTATION_IMG_SIZE = void 0;
|
|
3
|
+
exports.SHAPE_ELEMENT_TYPES = exports.FRAME_ELEMENT_TYPE = exports.SECTION_ELEMENT_TYPE = exports.COLOR_WIDTH = exports.COLOR_FONT_SIZE = exports.COLOR_PADDING = exports.ANNOTATION_PADDING_Y = exports.ANNOTATION_IMG_SIZE = void 0;
|
|
4
4
|
exports.ANNOTATION_IMG_SIZE = 15;
|
|
5
5
|
exports.ANNOTATION_PADDING_Y = 8;
|
|
6
6
|
exports.COLOR_PADDING = 5;
|
|
7
7
|
exports.COLOR_FONT_SIZE = 8;
|
|
8
8
|
exports.COLOR_WIDTH = 140;
|
|
9
|
+
exports.SECTION_ELEMENT_TYPE = 'section';
|
|
10
|
+
exports.FRAME_ELEMENT_TYPE = 'frame';
|
|
11
|
+
exports.SHAPE_ELEMENT_TYPES = [
|
|
12
|
+
'text',
|
|
13
|
+
'line',
|
|
14
|
+
'arrow',
|
|
15
|
+
'circle',
|
|
16
|
+
'rectangle',
|
|
17
|
+
'round_rectangle',
|
|
18
|
+
'triangle',
|
|
19
|
+
'diamond',
|
|
20
|
+
'star',
|
|
21
|
+
'heart',
|
|
22
|
+
'double_arrow',
|
|
23
|
+
'right_arrow',
|
|
24
|
+
'rhombus',
|
|
25
|
+
'cloud',
|
|
26
|
+
'callout',
|
|
27
|
+
'draw_frame',
|
|
28
|
+
'draw_section',
|
|
29
|
+
];
|
package/lib/index.d.ts
CHANGED
|
@@ -13,3 +13,7 @@ export * from './util/curved-line/point';
|
|
|
13
13
|
export * from './util/curved-line/curved-line';
|
|
14
14
|
export * from './util/callout/callout';
|
|
15
15
|
export * from './document-frame.service';
|
|
16
|
+
export * from './containers/container-kind';
|
|
17
|
+
export * from './containers/document-container';
|
|
18
|
+
export * from './containers/document-container-index';
|
|
19
|
+
export * from './containers/document-container.service';
|
package/lib/index.js
CHANGED
|
@@ -29,3 +29,7 @@ __exportStar(require("./util/curved-line/point"), exports);
|
|
|
29
29
|
__exportStar(require("./util/curved-line/curved-line"), exports);
|
|
30
30
|
__exportStar(require("./util/callout/callout"), exports);
|
|
31
31
|
__exportStar(require("./document-frame.service"), exports);
|
|
32
|
+
__exportStar(require("./containers/container-kind"), exports);
|
|
33
|
+
__exportStar(require("./containers/document-container"), exports);
|
|
34
|
+
__exportStar(require("./containers/document-container-index"), exports);
|
|
35
|
+
__exportStar(require("./containers/document-container.service"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrail/documents",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0-alpha.4325cd8",
|
|
4
4
|
"description": "Documents library for contrail platform",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"tslint": "^5.11.0",
|
|
23
23
|
"tslint-config-prettier": "^1.18.0",
|
|
24
24
|
"typescript": "^5.8.3",
|
|
25
|
-
"@contrail/telemetry": "^
|
|
25
|
+
"@contrail/telemetry": "^2.0.0"
|
|
26
26
|
},
|
|
27
27
|
"jest": {
|
|
28
28
|
"moduleFileExtensions": [
|
|
@@ -39,17 +39,14 @@
|
|
|
39
39
|
"testEnvironment": "node"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@contrail/actions": "^
|
|
43
|
-
"@contrail/document-table": "^2.
|
|
44
|
-
"@contrail/document-util": "^2.0
|
|
45
|
-
"@contrail/types": "^4.0
|
|
42
|
+
"@contrail/actions": "^1.0.18",
|
|
43
|
+
"@contrail/document-table": "^1.2.3",
|
|
44
|
+
"@contrail/document-util": "^1.2.0",
|
|
45
|
+
"@contrail/types": "^3.4.0",
|
|
46
46
|
"fractional-indexing": "^2.1.0",
|
|
47
47
|
"reflect-metadata": "^0.1.13"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@contrail/telemetry": "^
|
|
51
|
-
},
|
|
52
|
-
"engines": {
|
|
53
|
-
"node": ">=24"
|
|
50
|
+
"@contrail/telemetry": "^2.0.0"
|
|
54
51
|
}
|
|
55
52
|
}
|