@squiz/dxp-page-content-types 1.4.0 → 1.5.0
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 +114 -0
- package/lib/VersionChangeSummary/VersionChangeSummary.js +18 -0
- package/lib/VersionChangeSummary/VersionChangeSummary.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.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"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Squiz Australia Pty Ltd. All Rights Reserved.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The action that was performed.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum TVersionChangeSummaryAction {
|
|
9
|
+
ADD = "add",
|
|
10
|
+
EDIT = "edit",
|
|
11
|
+
DELETE = "delete",
|
|
12
|
+
MOVE = "move"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A message describing a change in the version history of a page.
|
|
16
|
+
*/
|
|
17
|
+
export interface VersionChangeSummaryMessage {
|
|
18
|
+
/**
|
|
19
|
+
* The action that was performed.
|
|
20
|
+
* @type {TVersionChangeSummaryAction}
|
|
21
|
+
* @memberof VersionChangeSummaryMessage
|
|
22
|
+
*/
|
|
23
|
+
action: TVersionChangeSummaryAction;
|
|
24
|
+
/**
|
|
25
|
+
* The value of the change.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof VersionChangeSummaryMessage
|
|
28
|
+
*/
|
|
29
|
+
value: string;
|
|
30
|
+
/**
|
|
31
|
+
* The metadata of the change.
|
|
32
|
+
* @type {{path?: string, componentId?: string, toPosition?: number, fromPosition?: number, position?: number, section?: string, nodeId?: string}}
|
|
33
|
+
* @memberof VersionChangeSummaryMessage
|
|
34
|
+
*/
|
|
35
|
+
metadata: {
|
|
36
|
+
/**
|
|
37
|
+
* The path of the change.
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof VersionChangeSummaryMessage
|
|
40
|
+
*/
|
|
41
|
+
path?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The component id of the change.
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof VersionChangeSummaryMessage
|
|
46
|
+
*/
|
|
47
|
+
componentId?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The to position of the change.
|
|
50
|
+
* @type {number}
|
|
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}
|
|
65
|
+
* @memberof VersionChangeSummaryMessage
|
|
66
|
+
* @format double
|
|
67
|
+
*/
|
|
68
|
+
position?: number;
|
|
69
|
+
/**
|
|
70
|
+
* The section of the change.
|
|
71
|
+
* @type {string}
|
|
72
|
+
* @memberof VersionChangeSummaryMessage
|
|
73
|
+
*/
|
|
74
|
+
section?: string;
|
|
75
|
+
/**
|
|
76
|
+
* The node id of the change.
|
|
77
|
+
* @type {string}
|
|
78
|
+
* @memberof VersionChangeSummaryMessage
|
|
79
|
+
*/
|
|
80
|
+
nodeId?: string;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A summary of the changes in the version history of a page.
|
|
85
|
+
*/
|
|
86
|
+
export interface VersionChangeSummary {
|
|
87
|
+
/**
|
|
88
|
+
* The messages describing the changes in the version history of a page.
|
|
89
|
+
* @type {VersionChangeSummaryMessage[]}
|
|
90
|
+
* @memberof VersionChangeSummary
|
|
91
|
+
*/
|
|
92
|
+
messages: VersionChangeSummaryMessage[];
|
|
93
|
+
/**
|
|
94
|
+
* The versions that were compared to generate the summary.
|
|
95
|
+
* @type {{v2Id: string, v1Id: string}}
|
|
96
|
+
* @memberof VersionChangeSummary
|
|
97
|
+
*/
|
|
98
|
+
comparedVersions: {
|
|
99
|
+
v2Id: string;
|
|
100
|
+
v1Id: string;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* The format version of the summary.
|
|
104
|
+
* @type {string}
|
|
105
|
+
* @memberof VersionChangeSummary
|
|
106
|
+
*/
|
|
107
|
+
formatVersion: string;
|
|
108
|
+
/**
|
|
109
|
+
* The users that were affected by the changes.
|
|
110
|
+
* @type {string[]}
|
|
111
|
+
* @memberof VersionChangeSummary
|
|
112
|
+
*/
|
|
113
|
+
users: string[];
|
|
114
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Squiz Australia Pty Ltd. All Rights Reserved.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.TVersionChangeSummaryAction = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* The action that was performed.
|
|
10
|
+
*/
|
|
11
|
+
var TVersionChangeSummaryAction;
|
|
12
|
+
(function (TVersionChangeSummaryAction) {
|
|
13
|
+
TVersionChangeSummaryAction["ADD"] = "add";
|
|
14
|
+
TVersionChangeSummaryAction["EDIT"] = "edit";
|
|
15
|
+
TVersionChangeSummaryAction["DELETE"] = "delete";
|
|
16
|
+
TVersionChangeSummaryAction["MOVE"] = "move";
|
|
17
|
+
})(TVersionChangeSummaryAction || (exports.TVersionChangeSummaryAction = TVersionChangeSummaryAction = {}));
|
|
18
|
+
//# sourceMappingURL=VersionChangeSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VersionChangeSummary.js","sourceRoot":"","sources":["../../src/VersionChangeSummary/VersionChangeSummary.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,IAAY,2BAKX;AALD,WAAY,2BAA2B;IACrC,0CAAW,CAAA;IACX,4CAAa,CAAA;IACb,gDAAiB,CAAA;IACjB,4CAAa,CAAA;AACf,CAAC,EALW,2BAA2B,2CAA3B,2BAA2B,QAKtC"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -20,4 +20,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
__exportStar(require("./Nodes/Nodes"), exports);
|
|
22
22
|
__exportStar(require("./PageContent/PageContent"), exports);
|
|
23
|
+
__exportStar(require("./VersionChangeSummary/VersionChangeSummary"), exports);
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAEH,gDAA8B;AAC9B,4DAA0C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAEH,gDAA8B;AAC9B,4DAA0C;AAC1C,8EAA4D"}
|