@squiz/dxp-page-content-types 1.4.1 → 1.5.1
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/Nodes/Nodes.d.ts +11 -1
- package/lib/Nodes/Nodes.js +10 -0
- package/lib/Nodes/Nodes.js.map +1 -1
- package/lib/VersionChangeSummary/VersionChangeSummary.d.ts +38 -22
- package/lib/VersionChangeSummary/VersionChangeSummary.js +24 -0
- package/lib/VersionChangeSummary/VersionChangeSummary.js.map +1 -1
- package/package.json +1 -1
package/lib/Nodes/Nodes.d.ts
CHANGED
|
@@ -4,11 +4,21 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { FORMATTED_TEXT_MODELS } from '@squiz/dx-json-schema-lib';
|
|
6
6
|
import { Conditions } from '../PageContent/PageContent';
|
|
7
|
+
/**
|
|
8
|
+
* Content node helper constants.
|
|
9
|
+
*/
|
|
10
|
+
export declare const NODE_TYPE: {
|
|
11
|
+
component: "component";
|
|
12
|
+
fragment: "fragment";
|
|
13
|
+
layout: "layout";
|
|
14
|
+
variation: "variation";
|
|
15
|
+
};
|
|
16
|
+
export type NODE_TYPE = (typeof NODE_TYPE)[keyof typeof NODE_TYPE];
|
|
7
17
|
/**
|
|
8
18
|
* Semi-resolved (referenced content items, not resolved Matrix references) formatted nodes union type.
|
|
9
19
|
*/
|
|
10
20
|
export type LayoutContentNodes = (Exclude<FORMATTED_TEXT_MODELS.v1.FormattedNodes, {
|
|
11
|
-
type:
|
|
21
|
+
type: NODE_TYPE;
|
|
12
22
|
}> | FormattedTextFragmentNode | ComponentNode | VariationNode | LayoutNode) & {
|
|
13
23
|
nodeId?: string;
|
|
14
24
|
};
|
package/lib/Nodes/Nodes.js
CHANGED
|
@@ -4,4 +4,14 @@
|
|
|
4
4
|
* Copyright Squiz Australia Pty Ltd. All Rights Reserved.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.NODE_TYPE = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Content node helper constants.
|
|
10
|
+
*/
|
|
11
|
+
exports.NODE_TYPE = {
|
|
12
|
+
component: 'component',
|
|
13
|
+
fragment: 'fragment',
|
|
14
|
+
layout: 'layout',
|
|
15
|
+
variation: 'variation',
|
|
16
|
+
};
|
|
7
17
|
//# sourceMappingURL=Nodes.js.map
|
package/lib/Nodes/Nodes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Nodes.js","sourceRoot":"","sources":["../../src/Nodes/Nodes.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
1
|
+
{"version":3,"file":"Nodes.js","sourceRoot":"","sources":["../../src/Nodes/Nodes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH;;GAEG;AAEU,QAAA,SAAS,GAAG;IACvB,SAAS,EAAE,WAAoB;IAC/B,QAAQ,EAAE,UAAmB;IAC7B,MAAM,EAAE,QAAiB;IACzB,SAAS,EAAE,WAAoB;CAChC,CAAC"}
|
|
@@ -6,10 +6,34 @@
|
|
|
6
6
|
* The action that was performed.
|
|
7
7
|
*/
|
|
8
8
|
export declare enum TVersionChangeSummaryAction {
|
|
9
|
+
/**
|
|
10
|
+
* When an item is add to the page.
|
|
11
|
+
*/
|
|
9
12
|
ADD = "add",
|
|
13
|
+
/**
|
|
14
|
+
* When a template or A/B test is changed.
|
|
15
|
+
*/
|
|
16
|
+
CHANGE = "change",
|
|
17
|
+
/**
|
|
18
|
+
* When an item is edited that is not part of a change.
|
|
19
|
+
*/
|
|
10
20
|
EDIT = "edit",
|
|
21
|
+
/**
|
|
22
|
+
* When an item is deleted from the page.
|
|
23
|
+
*/
|
|
11
24
|
DELETE = "delete",
|
|
12
|
-
|
|
25
|
+
/**
|
|
26
|
+
* When something is changed in a layout.
|
|
27
|
+
*/
|
|
28
|
+
LAYOUT_CHANGE = "layout-change",
|
|
29
|
+
/**
|
|
30
|
+
* When an item is moved within a layout or page.
|
|
31
|
+
*/
|
|
32
|
+
MOVE = "move",
|
|
33
|
+
/**
|
|
34
|
+
* When a component is upgraded to a new version.
|
|
35
|
+
*/
|
|
36
|
+
UPGRADE = "upgrade"
|
|
13
37
|
}
|
|
14
38
|
/**
|
|
15
39
|
* A message describing a change in the version history of a page.
|
|
@@ -27,6 +51,13 @@ export interface VersionChangeSummaryMessage {
|
|
|
27
51
|
* @memberof VersionChangeSummaryMessage
|
|
28
52
|
*/
|
|
29
53
|
value: string;
|
|
54
|
+
/**
|
|
55
|
+
* The children of the change.
|
|
56
|
+
* The nested changes part of a layout change.
|
|
57
|
+
* @type {VersionChangeSummaryMessage[]}
|
|
58
|
+
* @memberof VersionChangeSummaryMessage
|
|
59
|
+
*/
|
|
60
|
+
children?: VersionChangeSummaryMessage[];
|
|
30
61
|
/**
|
|
31
62
|
* The metadata of the change.
|
|
32
63
|
* @type {{path?: string, componentId?: string, toPosition?: number, fromPosition?: number, position?: number, section?: string, nodeId?: string}}
|
|
@@ -40,32 +71,17 @@ export interface VersionChangeSummaryMessage {
|
|
|
40
71
|
*/
|
|
41
72
|
path?: string;
|
|
42
73
|
/**
|
|
43
|
-
* The
|
|
44
|
-
* @type {string}
|
|
74
|
+
* The parent layout path of the change.
|
|
75
|
+
* @type {string[]}
|
|
45
76
|
* @memberof VersionChangeSummaryMessage
|
|
46
77
|
*/
|
|
47
|
-
|
|
78
|
+
parentLayoutPath?: string[];
|
|
48
79
|
/**
|
|
49
|
-
* The
|
|
50
|
-
* @type {
|
|
51
|
-
* @memberof VersionChangeSummaryMessage
|
|
52
|
-
* @format double
|
|
53
|
-
*/
|
|
54
|
-
toPosition?: number;
|
|
55
|
-
/**
|
|
56
|
-
* The from position of the change.
|
|
57
|
-
* @type {number}
|
|
58
|
-
* @memberof VersionChangeSummaryMessage
|
|
59
|
-
* @format double
|
|
60
|
-
*/
|
|
61
|
-
fromPosition?: number;
|
|
62
|
-
/**
|
|
63
|
-
* The position of the change.
|
|
64
|
-
* @type {number}
|
|
80
|
+
* The component id of the change.
|
|
81
|
+
* @type {string}
|
|
65
82
|
* @memberof VersionChangeSummaryMessage
|
|
66
|
-
* @format double
|
|
67
83
|
*/
|
|
68
|
-
|
|
84
|
+
componentId?: string;
|
|
69
85
|
/**
|
|
70
86
|
* The section of the change.
|
|
71
87
|
* @type {string}
|
|
@@ -10,9 +10,33 @@ exports.TVersionChangeSummaryAction = void 0;
|
|
|
10
10
|
*/
|
|
11
11
|
var TVersionChangeSummaryAction;
|
|
12
12
|
(function (TVersionChangeSummaryAction) {
|
|
13
|
+
/**
|
|
14
|
+
* When an item is add to the page.
|
|
15
|
+
*/
|
|
13
16
|
TVersionChangeSummaryAction["ADD"] = "add";
|
|
17
|
+
/**
|
|
18
|
+
* When a template or A/B test is changed.
|
|
19
|
+
*/
|
|
20
|
+
TVersionChangeSummaryAction["CHANGE"] = "change";
|
|
21
|
+
/**
|
|
22
|
+
* When an item is edited that is not part of a change.
|
|
23
|
+
*/
|
|
14
24
|
TVersionChangeSummaryAction["EDIT"] = "edit";
|
|
25
|
+
/**
|
|
26
|
+
* When an item is deleted from the page.
|
|
27
|
+
*/
|
|
15
28
|
TVersionChangeSummaryAction["DELETE"] = "delete";
|
|
29
|
+
/**
|
|
30
|
+
* When something is changed in a layout.
|
|
31
|
+
*/
|
|
32
|
+
TVersionChangeSummaryAction["LAYOUT_CHANGE"] = "layout-change";
|
|
33
|
+
/**
|
|
34
|
+
* When an item is moved within a layout or page.
|
|
35
|
+
*/
|
|
16
36
|
TVersionChangeSummaryAction["MOVE"] = "move";
|
|
37
|
+
/**
|
|
38
|
+
* When a component is upgraded to a new version.
|
|
39
|
+
*/
|
|
40
|
+
TVersionChangeSummaryAction["UPGRADE"] = "upgrade";
|
|
17
41
|
})(TVersionChangeSummaryAction || (exports.TVersionChangeSummaryAction = TVersionChangeSummaryAction = {}));
|
|
18
42
|
//# sourceMappingURL=VersionChangeSummary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionChangeSummary.js","sourceRoot":"","sources":["../../src/VersionChangeSummary/VersionChangeSummary.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"VersionChangeSummary.js","sourceRoot":"","sources":["../../src/VersionChangeSummary/VersionChangeSummary.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,IAAY,2BA6BX;AA7BD,WAAY,2BAA2B;IACrC;;OAEG;IACH,0CAAW,CAAA;IACX;;OAEG;IACH,gDAAiB,CAAA;IACjB;;OAEG;IACH,4CAAa,CAAA;IACb;;OAEG;IACH,gDAAiB,CAAA;IACjB;;OAEG;IACH,8DAA+B,CAAA;IAC/B;;OAEG;IACH,4CAAa,CAAA;IACb;;OAEG;IACH,kDAAmB,CAAA;AACrB,CAAC,EA7BW,2BAA2B,2CAA3B,2BAA2B,QA6BtC"}
|