@sap/ux-specification 1.96.27 → 1.96.29
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/dist/documentation/runDocu-min.js +5 -5
- package/dist/documentation/runDocu-min.js.map +2 -2
- package/dist/documentation/styleDocu.css +30 -4
- package/dist/documentation/v2/v2-AnalyticalListPage.html +4 -3
- package/dist/documentation/v2/v2-ApplicationV2.html +6 -4
- package/dist/documentation/v2/v2-ListReport.html +4 -3
- package/dist/documentation/v2/v2-ObjectPage.html +4 -3
- package/dist/documentation/v2/v2-OverviewPage.html +4 -3
- package/dist/documentation/v4/v4-ApplicationV4.html +6 -4
- package/dist/documentation/v4/v4-BuildingBlocks.html +61 -0
- package/dist/documentation/v4/v4-FreestylePage.html +4 -3
- package/dist/documentation/v4/v4-ListReport.html +4 -3
- package/dist/documentation/v4/v4-ObjectPage.html +4 -3
- package/dist/index-min.js +271 -187
- package/dist/index-min.js.map +3 -3
- package/dist/package.json +114 -0
- package/dist/schemas/v2/AnalyticalListPageConfig.json +4 -20
- package/dist/schemas/v2/ListReportConfig.json +4 -20
- package/dist/schemas/v2/ObjectPageConfig.json +4 -20
- package/dist/schemas/v4/BuildingBlocksConfig.json +750 -0
- package/dist/schemas/v4/ListReportConfig.json +1 -0
- package/dist/schemas/v4/ObjectPageConfig.json +185 -9
- package/dist/scripts/extractDocu.js +12 -6
- package/dist/scripts/extractDocu.js.map +1 -1
- package/dist/scripts/macros/api.d.ts +9 -0
- package/dist/scripts/macros/api.d.ts.map +1 -0
- package/dist/scripts/macros/api.js +161 -0
- package/dist/scripts/macros/api.js.map +1 -0
- package/dist/scripts/macros/cmd.d.ts +7 -0
- package/dist/scripts/macros/cmd.d.ts.map +1 -0
- package/dist/scripts/macros/cmd.js +49 -0
- package/dist/scripts/macros/cmd.js.map +1 -0
- package/dist/scripts/macros/corrections.d.ts +18 -0
- package/dist/scripts/macros/corrections.d.ts.map +1 -0
- package/dist/scripts/macros/corrections.js +188 -0
- package/dist/scripts/macros/corrections.js.map +1 -0
- package/dist/scripts/macros/index.d.ts +2 -0
- package/dist/scripts/macros/index.d.ts.map +1 -0
- package/dist/scripts/macros/index.js +8 -0
- package/dist/scripts/macros/index.js.map +1 -0
- package/dist/scripts/macros/schema.d.ts +9 -0
- package/dist/scripts/macros/schema.d.ts.map +1 -0
- package/dist/scripts/macros/schema.js +201 -0
- package/dist/scripts/macros/schema.js.map +1 -0
- package/dist/scripts/macros/types.d.ts +77 -0
- package/dist/scripts/macros/types.d.ts.map +1 -0
- package/dist/scripts/macros/types.js +14 -0
- package/dist/scripts/macros/types.js.map +1 -0
- package/dist/scripts/runDocu.js +12 -10
- package/dist/scripts/runDocu.js.map +1 -1
- package/dist/src/api.d.ts.map +1 -1
- package/dist/src/api.js +8 -1
- package/dist/src/api.js.map +1 -1
- package/dist/src/project.d.ts +1 -0
- package/dist/src/project.d.ts.map +1 -1
- package/dist/src/project.js +6 -4
- package/dist/src/project.js.map +1 -1
- package/dist/src/specification/schemaAccess.d.ts.map +1 -1
- package/dist/src/specification/schemaAccess.js +16 -3
- package/dist/src/specification/schemaAccess.js.map +1 -1
- package/dist/src/sync/common/appProvider.d.ts +12 -0
- package/dist/src/sync/common/appProvider.d.ts.map +1 -1
- package/dist/src/sync/common/appProvider.js +51 -18
- package/dist/src/sync/common/appProvider.js.map +1 -1
- package/dist/src/sync/common/generate/objectPage.d.ts.map +1 -1
- package/dist/src/sync/common/generate/objectPage.js +2 -1
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts +7 -7
- package/dist/src/sync/common/generate/utils.d.ts.map +1 -1
- package/dist/src/sync/common/generate/utils.js +13 -33
- package/dist/src/sync/common/generate/utils.js.map +1 -1
- package/dist/src/sync/common/i18n.json +2 -1
- package/dist/src/sync/common/importProject.d.ts.map +1 -1
- package/dist/src/sync/common/importProject.js +67 -31
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/types.d.ts +6 -0
- package/dist/src/sync/common/types.d.ts.map +1 -0
- package/dist/src/sync/common/types.js +3 -0
- package/dist/src/sync/common/types.js.map +1 -0
- package/dist/src/sync/common/utils.d.ts +26 -5
- package/dist/src/sync/common/utils.d.ts.map +1 -1
- package/dist/src/sync/common/utils.js +44 -7
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +1 -4
- package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js +4 -25
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Table.d.ts +3 -6
- package/dist/src/sync/v2/export/controls/Table.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/Table.js +20 -28
- package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.js +1 -0
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/listReport.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/listReport.js +1 -0
- package/dist/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.js +1 -0
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageFooter.d.ts +5 -1
- package/dist/src/sync/v4/export/controls/ObjectPageFooter.d.ts.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageFooter.js +4 -1
- package/dist/src/sync/v4/export/controls/ObjectPageFooter.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageFooterAction.d.ts +14 -0
- package/dist/src/sync/v4/export/controls/ObjectPageFooterAction.d.ts.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageFooterAction.js +83 -1
- package/dist/src/sync/v4/export/controls/ObjectPageFooterAction.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageHeader.d.ts +5 -1
- package/dist/src/sync/v4/export/controls/ObjectPageHeader.d.ts.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageHeader.js +4 -1
- package/dist/src/sync/v4/export/controls/ObjectPageHeader.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderAction.d.ts +14 -0
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderAction.d.ts.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderAction.js +83 -1
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderAction.js.map +1 -1
- package/dist/src/sync/v4/export/export.d.ts +1 -0
- package/dist/src/sync/v4/export/export.d.ts.map +1 -1
- package/dist/src/sync/v4/export/export.js +11 -6
- package/dist/src/sync/v4/export/export.js.map +1 -1
- package/dist/src/sync/v4/export/fpmCustomPage.d.ts +11 -0
- package/dist/src/sync/v4/export/fpmCustomPage.d.ts.map +1 -0
- package/dist/src/sync/v4/export/fpmCustomPage.js +131 -0
- package/dist/src/sync/v4/export/fpmCustomPage.js.map +1 -0
- package/dist/src/sync/v4/generate/fpmCustomPage.d.ts +10 -0
- package/dist/src/sync/v4/generate/fpmCustomPage.d.ts.map +1 -0
- package/dist/src/sync/v4/generate/fpmCustomPage.js +266 -0
- package/dist/src/sync/v4/generate/fpmCustomPage.js.map +1 -0
- package/dist/src/sync/v4/generate/generate.d.ts +13 -1
- package/dist/src/sync/v4/generate/generate.d.ts.map +1 -1
- package/dist/src/sync/v4/generate/generate.js +22 -1
- package/dist/src/sync/v4/generate/generate.js.map +1 -1
- package/dist/src/sync/v4/generate/index.d.ts +2 -1
- package/dist/src/sync/v4/generate/index.d.ts.map +1 -1
- package/dist/src/sync/v4/generate/index.js +4 -1
- package/dist/src/sync/v4/generate/index.js.map +1 -1
- package/dist/src/sync/v4/generate/objectPage.d.ts.map +1 -1
- package/dist/src/sync/v4/generate/objectPage.js +45 -12
- package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/app/appProvider.d.ts +2 -1
- package/dist/src/sync/v4/import/app/appProvider.d.ts.map +1 -1
- package/dist/src/sync/v4/import/app/appProvider.js +2 -2
- package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v4/import/app/baseAppProvider.d.ts +7 -2
- package/dist/src/sync/v4/import/app/baseAppProvider.d.ts.map +1 -1
- package/dist/src/sync/v4/import/app/baseAppProvider.js +26 -6
- package/dist/src/sync/v4/import/app/baseAppProvider.js.map +1 -1
- package/dist/src/sync/v4/import/app/freestyleProvider.d.ts +2 -1
- package/dist/src/sync/v4/import/app/freestyleProvider.d.ts.map +1 -1
- package/dist/src/sync/v4/import/app/freestyleProvider.js +2 -2
- package/dist/src/sync/v4/import/app/freestyleProvider.js.map +1 -1
- package/dist/src/sync/v4/import/index.d.ts +1 -0
- package/dist/src/sync/v4/import/index.d.ts.map +1 -1
- package/dist/src/sync/v4/import/index.js +1 -0
- package/dist/src/sync/v4/import/index.js.map +1 -1
- package/dist/src/sync/v4/import/pages/fpmCustomPage.d.ts +9 -0
- package/dist/src/sync/v4/import/pages/fpmCustomPage.d.ts.map +1 -0
- package/dist/src/sync/v4/import/pages/fpmCustomPage.js +102 -0
- package/dist/src/sync/v4/import/pages/fpmCustomPage.js.map +1 -0
- package/dist/src/sync/v4/import/pages/objectPage.js +1 -1
- package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v4/utils/macros.d.ts +29 -0
- package/dist/src/sync/v4/utils/macros.d.ts.map +1 -0
- package/dist/src/sync/v4/utils/macros.js +113 -0
- package/dist/src/sync/v4/utils/macros.js.map +1 -0
- package/dist/src/sync/v4/utils/utils.d.ts +11 -1
- package/dist/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/src/sync/v4/utils/utils.js +88 -1
- package/dist/src/sync/v4/utils/utils.js.map +1 -1
- package/package.json +17 -8
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyCorrections = exports.macrosCorrection = void 0;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
exports.macrosCorrection = {
|
|
6
|
+
'sap.fe.macros.Table': {
|
|
7
|
+
aggregations: [
|
|
8
|
+
{
|
|
9
|
+
name: 'actions',
|
|
10
|
+
singularName: 'action',
|
|
11
|
+
type: 'sap.fe.macros.table.Action',
|
|
12
|
+
cardinality: '0..n',
|
|
13
|
+
visibility: types_1.UI5Visibility.public,
|
|
14
|
+
description: 'Table actions',
|
|
15
|
+
methods: [],
|
|
16
|
+
linkEnabled: true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'columns',
|
|
20
|
+
singularName: 'column',
|
|
21
|
+
type: 'sap.fe.macros.table.Column',
|
|
22
|
+
cardinality: '0..n',
|
|
23
|
+
visibility: types_1.UI5Visibility.public,
|
|
24
|
+
description: 'Table columns',
|
|
25
|
+
methods: [],
|
|
26
|
+
linkEnabled: true
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
properties: [
|
|
30
|
+
{
|
|
31
|
+
name: 'title',
|
|
32
|
+
description: 'The text that will be displayed for table title',
|
|
33
|
+
group: 'Misc',
|
|
34
|
+
methods: [],
|
|
35
|
+
visibility: types_1.UI5Visibility.public,
|
|
36
|
+
types: [
|
|
37
|
+
{
|
|
38
|
+
value: 'string'
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
bindable: true,
|
|
42
|
+
defaultValue: ''
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
'sap.fe.macros.ActionGroup': {
|
|
47
|
+
aggregations: [
|
|
48
|
+
{
|
|
49
|
+
name: 'actions',
|
|
50
|
+
singularName: 'action',
|
|
51
|
+
type: 'sap.fe.macros.table.Action',
|
|
52
|
+
cardinality: '0..n',
|
|
53
|
+
visibility: types_1.UI5Visibility.public,
|
|
54
|
+
description: 'Table actions',
|
|
55
|
+
methods: [],
|
|
56
|
+
linkEnabled: true
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
properties: [
|
|
60
|
+
{
|
|
61
|
+
defaultValue: '',
|
|
62
|
+
description: 'The text that will be displayed for this action group',
|
|
63
|
+
group: 'Misc',
|
|
64
|
+
methods: [],
|
|
65
|
+
name: 'text',
|
|
66
|
+
types: [
|
|
67
|
+
{
|
|
68
|
+
value: 'string'
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
visibility: types_1.UI5Visibility.public
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
defaultValue: '',
|
|
75
|
+
description: 'Defines where this action group should be placed relative to the defined anchor',
|
|
76
|
+
group: 'Misc',
|
|
77
|
+
methods: [],
|
|
78
|
+
name: 'placement',
|
|
79
|
+
types: [
|
|
80
|
+
{
|
|
81
|
+
value: 'string'
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
visibility: types_1.UI5Visibility.public
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
defaultValue: '',
|
|
88
|
+
description: 'Reference to the key of another action or action group already displayed in the toolbar to properly place this one',
|
|
89
|
+
group: 'Misc',
|
|
90
|
+
methods: [],
|
|
91
|
+
name: 'anchor',
|
|
92
|
+
types: [
|
|
93
|
+
{
|
|
94
|
+
value: 'string'
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
visibility: types_1.UI5Visibility.public
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
metadata: {
|
|
101
|
+
kind: types_1.SYMBOL_KIND_CLASS,
|
|
102
|
+
name: 'sap.fe.macros.ActionGroup',
|
|
103
|
+
basename: 'ActionGroup',
|
|
104
|
+
resource: '',
|
|
105
|
+
module: '',
|
|
106
|
+
static: true,
|
|
107
|
+
visibility: types_1.UI5Visibility.public,
|
|
108
|
+
description: 'Definition of a actions group to be used inside the table toolbar',
|
|
109
|
+
displayName: 'sap.fe.macros.ActionGroup',
|
|
110
|
+
title: 'class sap.fe.macros.ActionGroup',
|
|
111
|
+
subTitle: ''
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Method returns node with "properties" and "aggregation" for passed symbol.
|
|
117
|
+
* If node does not contains "properties" or "aggregation", then it prepares empty objects.
|
|
118
|
+
* @param {ClassSymbol | TypedefSymbol} symbol Symbol from SAPUI5 api.
|
|
119
|
+
* @returns {APICorrection} Correction object which contains "properties" and "aggregation" properties.
|
|
120
|
+
*/
|
|
121
|
+
function getNode(symbol) {
|
|
122
|
+
let node;
|
|
123
|
+
if (symbol.kind === types_1.SYMBOL_KIND_CLASS) {
|
|
124
|
+
if (!symbol[types_1.CLASS_SYMBOL_METADATA_PROPERTY]) {
|
|
125
|
+
symbol[types_1.CLASS_SYMBOL_METADATA_PROPERTY] = {
|
|
126
|
+
aggregations: [],
|
|
127
|
+
properties: [],
|
|
128
|
+
stereotype: ''
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
node = symbol[types_1.CLASS_SYMBOL_METADATA_PROPERTY];
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
node = symbol;
|
|
135
|
+
}
|
|
136
|
+
if (!node.aggregations) {
|
|
137
|
+
node.aggregations = [];
|
|
138
|
+
}
|
|
139
|
+
if (!node.properties) {
|
|
140
|
+
node.properties = [];
|
|
141
|
+
}
|
|
142
|
+
return node;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Method applies correction for passed node.
|
|
146
|
+
* @param {APICorrection} node Original node to update with corrections.
|
|
147
|
+
* @param {APICorrection} correction Correction to apply - "properties" and "aggregation" are applied.
|
|
148
|
+
*/
|
|
149
|
+
function applyCorrectionForNode(node, correction) {
|
|
150
|
+
for (const aggregation of correction.aggregations || []) {
|
|
151
|
+
if (!node.aggregations.some((existingAggregation) => existingAggregation.name === aggregation.name)) {
|
|
152
|
+
node.aggregations.push(aggregation);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
for (const property of correction.properties || []) {
|
|
156
|
+
if (!node.properties.some((existingProperty) => existingProperty.name === property.name)) {
|
|
157
|
+
node.properties.push(property);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Method applies missing aggregations and properties for "sap.fe.macros" api object.
|
|
163
|
+
* We notice that api object of "sap.fe.macros" is missing some aggregation and properties information
|
|
164
|
+
* - in result we apply missing data on top of received api object.
|
|
165
|
+
* @param {MacrosAPI} api "sap.fe.macros" api object.
|
|
166
|
+
*/
|
|
167
|
+
function applyCorrections(api) {
|
|
168
|
+
// Apply missing classes
|
|
169
|
+
for (const name in exports.macrosCorrection) {
|
|
170
|
+
const symbol = api.symbols.find((apiSymbol) => apiSymbol.name === name);
|
|
171
|
+
if (!symbol && exports.macrosCorrection[name].metadata) {
|
|
172
|
+
api.symbols.push({
|
|
173
|
+
...exports.macrosCorrection[name].metadata
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// Apply missing aggregation and properties
|
|
178
|
+
for (const symbol of api.symbols) {
|
|
179
|
+
const correction = exports.macrosCorrection[symbol.name];
|
|
180
|
+
if (!correction || symbol.kind === types_1.SYMBOL_KIND_NAMESPACE) {
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
const node = getNode(symbol);
|
|
184
|
+
applyCorrectionForNode(node, correction);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.applyCorrections = applyCorrections;
|
|
188
|
+
//# sourceMappingURL=corrections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corrections.js","sourceRoot":"","sources":["../../../scripts/macros/corrections.ts"],"names":[],"mappings":";;;AAAA,mCAAkH;AASrG,QAAA,gBAAgB,GAAqC;IAC9D,qBAAqB,EAAE;QACnB,YAAY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CAAC,IAAI,CAAC;gBACb,GAAG,wBAAgB,CAAC,IAAI,CAAC,CAAC,QAAQ;aACrC,CAAC,CAAC;SACN;KACJ;IACD,2CAA2C;IAC3C,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE;QAC9B,MAAM,UAAU,GAAG,wBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,KAAK,6BAAqB,EAAE;YACtD,SAAS;SACZ;QACD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7B,sBAAsB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;KAC5C;AACL,CAAC;AAnBD,4CAmBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../scripts/macros/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../scripts/macros/index.ts"],"names":[],"mappings":";;AAAA,+BAA4B;AAE5B;;GAEG;AACH,SAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SchemaDefinition } from '@sap/ux-specification-types';
|
|
2
|
+
import type { MacrosAPI } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Method generates generic schema for passed "sap.fe.macros" api.
|
|
5
|
+
* @param {MacrosAPI} api SAPUI5 "sap.fe.macros" api.
|
|
6
|
+
* @returns {SchemaDefinition} JSON schema for "sap.fe.macros" api.
|
|
7
|
+
*/
|
|
8
|
+
export declare function generateSchema(api: MacrosAPI): SchemaDefinition;
|
|
9
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../scripts/macros/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,KAAK,EACR,SAAS,EAQZ,MAAM,SAAS,CAAC;AAyKjB;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,GAAG,gBAAgB,CAsC/D"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateSchema = void 0;
|
|
4
|
+
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
5
|
+
const types_1 = require("./types");
|
|
6
|
+
const corrections_1 = require("./corrections");
|
|
7
|
+
/**
|
|
8
|
+
* Method checks if passed type is atomic type like 'boolean', 'string', 'number', etc.
|
|
9
|
+
* @param {string} type Type to check.
|
|
10
|
+
* @returns {boolean} Is atomic type.
|
|
11
|
+
*/
|
|
12
|
+
function isAtomicType(type) {
|
|
13
|
+
return ['string', 'number', 'integer', 'boolean', 'object', 'array', 'null', 'any'].includes(type);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Method returns base/skeleton schema.
|
|
17
|
+
* @returns {SchemaDefinition} JSON schema.
|
|
18
|
+
*/
|
|
19
|
+
function getRootSchema() {
|
|
20
|
+
const hiddenProperty = { type: 'string', hidden: true };
|
|
21
|
+
return {
|
|
22
|
+
type: 'object',
|
|
23
|
+
properties: {
|
|
24
|
+
$filePath: hiddenProperty,
|
|
25
|
+
$schema: hiddenProperty
|
|
26
|
+
},
|
|
27
|
+
additionalProperties: false,
|
|
28
|
+
definitions: {},
|
|
29
|
+
$schema: 'http://json-schema.org/draft-07/schema#'
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Method formats description text before storing it into schema.
|
|
34
|
+
* Currently method removes HTML markup from text.
|
|
35
|
+
* @param {string} [description] Description to format.
|
|
36
|
+
* @returns {string} Formatted description.
|
|
37
|
+
*/
|
|
38
|
+
function formatDescription(description) {
|
|
39
|
+
return description ? description.replace(/<\/?[^>]+(>|$)/g, '') : '';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Method prepares schema definition object.
|
|
43
|
+
* @param {MacrosPropertyType} metadataType Metadata property type.
|
|
44
|
+
* @param {string} [description] Description of definition.
|
|
45
|
+
* @returns {SchemaDefinition} JSON schema for definition.
|
|
46
|
+
*/
|
|
47
|
+
function prepareDefinition(metadataType, description) {
|
|
48
|
+
if (description) {
|
|
49
|
+
// Remove html markup from description
|
|
50
|
+
description = formatDescription(description);
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
description,
|
|
54
|
+
isViewNode: true,
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: {},
|
|
57
|
+
additionalProperties: false,
|
|
58
|
+
metadata: {
|
|
59
|
+
path: [],
|
|
60
|
+
type: metadataType
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Method prepares schema object for passed type.
|
|
66
|
+
* @param {string} type Type of target property or object.
|
|
67
|
+
* @returns {SchemaDefinition} JSON schema.
|
|
68
|
+
*/
|
|
69
|
+
function getSchemaForType(type) {
|
|
70
|
+
const schema = {};
|
|
71
|
+
if (isAtomicType(type)) {
|
|
72
|
+
schema.type = type;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
schema.$ref = `#/definitions/${type}`;
|
|
76
|
+
}
|
|
77
|
+
return schema;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Method prepares schema object for passed types.
|
|
81
|
+
* @param {string} [type] Type of target property or object.
|
|
82
|
+
* @param {UI5PropertyType[]} [types] Types of target property or object.
|
|
83
|
+
* @returns {SchemaDefinition} JSON schema.
|
|
84
|
+
*/
|
|
85
|
+
function getTypes(type, types) {
|
|
86
|
+
let result = [];
|
|
87
|
+
if (type) {
|
|
88
|
+
result = type.split('|');
|
|
89
|
+
}
|
|
90
|
+
else if (types) {
|
|
91
|
+
result = types.map((propertyType) => propertyType.value);
|
|
92
|
+
}
|
|
93
|
+
return result.map((propertyType) => {
|
|
94
|
+
return getSchemaForType(propertyType);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Method prepares schema property object for passed generic property.
|
|
99
|
+
* @param {UI5Property} property SAPUI5 property.
|
|
100
|
+
* @param {MacrosPropertyType} metadataType Metadata property type.
|
|
101
|
+
* @param {string} [type] Type of target property or object.
|
|
102
|
+
* @param {UI5PropertyType[]} [types] Types of target property or object.
|
|
103
|
+
* @returns {SchemaDefinition} JSON schema.
|
|
104
|
+
*/
|
|
105
|
+
function prepareSchemaProperty(property, metadataType, type, types) {
|
|
106
|
+
const schemaTypes = getTypes(type, types);
|
|
107
|
+
const isViewNode = schemaTypes.some((schemaType) => !!schemaType.$ref);
|
|
108
|
+
// Define result
|
|
109
|
+
const propertySchema = schemaTypes.length === 1
|
|
110
|
+
? { ...schemaTypes[0] }
|
|
111
|
+
: {
|
|
112
|
+
anyOf: schemaTypes
|
|
113
|
+
};
|
|
114
|
+
propertySchema.description = formatDescription(property.description);
|
|
115
|
+
if (isViewNode) {
|
|
116
|
+
propertySchema.description = property.name;
|
|
117
|
+
propertySchema.isViewNode = true;
|
|
118
|
+
}
|
|
119
|
+
propertySchema.metadata = {
|
|
120
|
+
type: metadataType
|
|
121
|
+
};
|
|
122
|
+
return propertySchema;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Method prepares schema object for passed SAPUI5 property.
|
|
126
|
+
* @param {UI5Property} property SAPUI5 property.
|
|
127
|
+
* @returns {SchemaDefinition} JSON schema.
|
|
128
|
+
*/
|
|
129
|
+
function prepareProperty(property) {
|
|
130
|
+
return prepareSchemaProperty(property, ux_specification_types_1.MacrosPropertyType.Property, property.type, property.types);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Method prepares schema object for passed SAPUI5 event.
|
|
134
|
+
* @param {UI5Property} property SAPUI5 event.
|
|
135
|
+
* @returns {SchemaDefinition} JSON schema.
|
|
136
|
+
*/
|
|
137
|
+
function prepareEvent(property) {
|
|
138
|
+
return prepareSchemaProperty(property, ux_specification_types_1.MacrosPropertyType.Event, 'string');
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Method prepares schema object for passed SAPUI5 aggregation.
|
|
142
|
+
* @param {UI5Property} property SAPUI5 aggregation.
|
|
143
|
+
* @returns {SchemaDefinition} JSON schema.
|
|
144
|
+
*/
|
|
145
|
+
function prepareAggregations(aggregation) {
|
|
146
|
+
const schemaTypes = getTypes(aggregation.type);
|
|
147
|
+
return {
|
|
148
|
+
description: aggregation.name,
|
|
149
|
+
type: 'object',
|
|
150
|
+
additionalProperties: schemaTypes.length ? schemaTypes[0] : { anyOf: schemaTypes },
|
|
151
|
+
isViewNode: true,
|
|
152
|
+
metadata: {
|
|
153
|
+
path: [],
|
|
154
|
+
type: ux_specification_types_1.MacrosPropertyType.Aggregation
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Method generates generic schema for passed "sap.fe.macros" api.
|
|
160
|
+
* @param {MacrosAPI} api SAPUI5 "sap.fe.macros" api.
|
|
161
|
+
* @returns {SchemaDefinition} JSON schema for "sap.fe.macros" api.
|
|
162
|
+
*/
|
|
163
|
+
function generateSchema(api) {
|
|
164
|
+
// Apply corrections for macros API - there is some missing information in api.json
|
|
165
|
+
corrections_1.applyCorrections(api);
|
|
166
|
+
const schema = getRootSchema();
|
|
167
|
+
const { definitions } = schema;
|
|
168
|
+
// Handle classes
|
|
169
|
+
const classSymbols = api.symbols.filter((symbol) => symbol.kind === types_1.SYMBOL_KIND_CLASS);
|
|
170
|
+
for (const symbol of classSymbols) {
|
|
171
|
+
const definition = prepareDefinition(ux_specification_types_1.MacrosPropertyType.Control, symbol.description);
|
|
172
|
+
definitions[symbol.name] = definition;
|
|
173
|
+
const events = symbol.events || [];
|
|
174
|
+
const { properties = [], aggregations = [] } = symbol[types_1.CLASS_SYMBOL_METADATA_PROPERTY] || {};
|
|
175
|
+
// Handle properties
|
|
176
|
+
for (const property of properties) {
|
|
177
|
+
definition.properties[property.name] = prepareProperty(property);
|
|
178
|
+
}
|
|
179
|
+
// Handle aggregations
|
|
180
|
+
for (const aggregation of aggregations) {
|
|
181
|
+
definition.properties[aggregation.name] = prepareAggregations(aggregation);
|
|
182
|
+
}
|
|
183
|
+
// Handle events
|
|
184
|
+
for (const event of events) {
|
|
185
|
+
definition.properties[event.name] = prepareEvent(event);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// Handle typedefs
|
|
189
|
+
const typedefSymbols = api.symbols.filter((symbol) => symbol.kind === types_1.SYMBOL_KIND_TYPEDEF);
|
|
190
|
+
for (const symbol of typedefSymbols) {
|
|
191
|
+
const definition = prepareDefinition(ux_specification_types_1.MacrosPropertyType.Control, symbol.description);
|
|
192
|
+
definitions[symbol.name] = definition;
|
|
193
|
+
const properties = symbol.properties || [];
|
|
194
|
+
for (const property of properties) {
|
|
195
|
+
definition.properties[property.name] = prepareProperty(property);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return schema;
|
|
199
|
+
}
|
|
200
|
+
exports.generateSchema = generateSchema;
|
|
201
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../scripts/macros/schema.ts"],"names":[],"mappings":";;;AACA,wEAAiE;AAWjE,mCAAiG;AACjG,+CAAiD;AAEjD;;;;GAIG;AACH,SAAS,YAAY,CAAC,IAAY;IAC9B,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CA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AAC;SACpE;KACJ;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAtCD,wCAsCC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export declare const SYMBOL_KIND_NAMESPACE = "namespace";
|
|
2
|
+
export declare const SYMBOL_KIND_CLASS = "class";
|
|
3
|
+
export declare const SYMBOL_KIND_TYPEDEF = "typedef";
|
|
4
|
+
export declare const CLASS_SYMBOL_METADATA_PROPERTY = "ui5-metadata";
|
|
5
|
+
export declare type SYMBOL_KIND = typeof SYMBOL_KIND_NAMESPACE | typeof SYMBOL_KIND_CLASS | typeof SYMBOL_KIND_TYPEDEF;
|
|
6
|
+
export interface MacrosAPI {
|
|
7
|
+
symbols: UI5Symbol[];
|
|
8
|
+
}
|
|
9
|
+
export declare enum UI5Visibility {
|
|
10
|
+
public = "public",
|
|
11
|
+
restricted = "restricted",
|
|
12
|
+
hidden = "hidden"
|
|
13
|
+
}
|
|
14
|
+
export interface BaseSymbol {
|
|
15
|
+
name: string;
|
|
16
|
+
basename: string;
|
|
17
|
+
resource: string;
|
|
18
|
+
module: string;
|
|
19
|
+
static: boolean;
|
|
20
|
+
visibility: UI5Visibility;
|
|
21
|
+
description: string;
|
|
22
|
+
displayName: string;
|
|
23
|
+
title: string;
|
|
24
|
+
subTitle: string;
|
|
25
|
+
}
|
|
26
|
+
export declare type UI5Symbol = NamespaceSymbol | ClassSymbol | TypedefSymbol;
|
|
27
|
+
export interface NamespaceSymbol extends BaseSymbol {
|
|
28
|
+
kind: typeof SYMBOL_KIND_NAMESPACE;
|
|
29
|
+
export: string;
|
|
30
|
+
nodes: [];
|
|
31
|
+
}
|
|
32
|
+
export interface ClassSymbol extends BaseSymbol {
|
|
33
|
+
kind: typeof SYMBOL_KIND_CLASS;
|
|
34
|
+
since?: string;
|
|
35
|
+
events?: UI5Event[];
|
|
36
|
+
[CLASS_SYMBOL_METADATA_PROPERTY]?: SymbolMetadata;
|
|
37
|
+
}
|
|
38
|
+
export interface TypedefSymbol extends BaseSymbol {
|
|
39
|
+
kind: typeof SYMBOL_KIND_TYPEDEF;
|
|
40
|
+
properties: UI5Property[];
|
|
41
|
+
aggregations?: UI5Aggregation[];
|
|
42
|
+
}
|
|
43
|
+
export interface SymbolMetadata {
|
|
44
|
+
stereotype: string;
|
|
45
|
+
properties: UI5Property[];
|
|
46
|
+
aggregations: UI5Aggregation[];
|
|
47
|
+
}
|
|
48
|
+
export interface UI5PropertyGeneric {
|
|
49
|
+
name: string;
|
|
50
|
+
description: string;
|
|
51
|
+
visibility: UI5Visibility;
|
|
52
|
+
}
|
|
53
|
+
export interface UI5PropertyCore extends UI5PropertyGeneric {
|
|
54
|
+
methods: string[];
|
|
55
|
+
}
|
|
56
|
+
export interface UI5Event {
|
|
57
|
+
name: string;
|
|
58
|
+
description: string;
|
|
59
|
+
visibility: UI5Visibility;
|
|
60
|
+
}
|
|
61
|
+
export interface UI5PropertyType {
|
|
62
|
+
value: string;
|
|
63
|
+
}
|
|
64
|
+
export interface UI5Property extends UI5PropertyCore {
|
|
65
|
+
bindable?: boolean;
|
|
66
|
+
group: string;
|
|
67
|
+
defaultValue: unknown;
|
|
68
|
+
type?: string;
|
|
69
|
+
types?: UI5PropertyType[];
|
|
70
|
+
}
|
|
71
|
+
export interface UI5Aggregation extends UI5PropertyCore {
|
|
72
|
+
singularName: string;
|
|
73
|
+
cardinality: string;
|
|
74
|
+
linkEnabled: true;
|
|
75
|
+
type: string;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../scripts/macros/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,cAAc,CAAC;AACjD,eAAO,MAAM,iBAAiB,UAAU,CAAC;AACzC,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C,eAAO,MAAM,8BAA8B,iBAAiB,CAAC;AAE7D,oBAAY,WAAW,GAAG,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AE,CAAC;CAClC;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,aAAa,CAAC;CAC7B;AAED,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACvD,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,aAAa,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAY,SAAQ,eAAe;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,cAAe,SAAQ,eAAe;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UI5Visibility = exports.CLASS_SYMBOL_METADATA_PROPERTY = exports.SYMBOL_KIND_TYPEDEF = exports.SYMBOL_KIND_CLASS = exports.SYMBOL_KIND_NAMESPACE = void 0;
|
|
4
|
+
exports.SYMBOL_KIND_NAMESPACE = 'namespace';
|
|
5
|
+
exports.SYMBOL_KIND_CLASS = 'class';
|
|
6
|
+
exports.SYMBOL_KIND_TYPEDEF = 'typedef';
|
|
7
|
+
exports.CLASS_SYMBOL_METADATA_PROPERTY = 'ui5-metadata';
|
|
8
|
+
var UI5Visibility;
|
|
9
|
+
(function (UI5Visibility) {
|
|
10
|
+
UI5Visibility["public"] = "public";
|
|
11
|
+
UI5Visibility["restricted"] = "restricted";
|
|
12
|
+
UI5Visibility["hidden"] = "hidden";
|
|
13
|
+
})(UI5Visibility = exports.UI5Visibility || (exports.UI5Visibility = {}));
|
|
14
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../scripts/macros/types.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,WAAW,CAAC;AACpC,QAAA,iBAAiB,GAAG,OAAO,CAAC;AAC5B,QAAA,mBAAmB,GAAG,SAAS,CAAC;AAEhC,QAAA,8BAA8B,GAAG,cAAc,CAAC;AAQ7D,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,kCAAiB,CAAA;IACjB,0CAAyB,CAAA;IACzB,kCAAiB,CAAA;AACrB,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB"}
|
package/dist/scripts/runDocu.js
CHANGED
|
@@ -12,7 +12,7 @@ const closeIcon = `<svg id="close-icon" width="16" height="16" viewBox="0 0 16 1
|
|
|
12
12
|
fill-rule="evenodd"
|
|
13
13
|
clip-rule="evenodd"
|
|
14
14
|
d="M3.71313 3L3.00699 3.7049L6.79636 7.497L3 11.2941L3.70714 12L7.5025 8.20391L11.2939 11.996L12 11.2901L8.20863 7.497L11.994 3.71089L11.2869 3.00499L7.5025 6.7901L3.71313 3Z"
|
|
15
|
-
fill="
|
|
15
|
+
fill="var(--vscode-icon-foreground)"
|
|
16
16
|
/>
|
|
17
17
|
</g>
|
|
18
18
|
</svg>`;
|
|
@@ -310,10 +310,12 @@ function update(source) {
|
|
|
310
310
|
if (d.data.children.length > 0)
|
|
311
311
|
return d.data.children;
|
|
312
312
|
});
|
|
313
|
+
const nodeCircle = nodeWithChildren.append('g').attr('class', 'node-circle-g');
|
|
314
|
+
const nodeRect = nodeWithChildren.append('g').attr('class', 'node-rect-g');
|
|
313
315
|
// add element with amount of children to nodes
|
|
314
|
-
|
|
316
|
+
nodeRect
|
|
315
317
|
.append('text')
|
|
316
|
-
.attr('class', 'node-
|
|
318
|
+
.attr('class', 'node-rect-text')
|
|
317
319
|
.attr('x', function (d) {
|
|
318
320
|
return d.bbox.x + d.bbox.width + 20;
|
|
319
321
|
})
|
|
@@ -322,7 +324,7 @@ function update(source) {
|
|
|
322
324
|
return d.data.children.length;
|
|
323
325
|
})
|
|
324
326
|
.call(getBB);
|
|
325
|
-
|
|
327
|
+
nodeRect
|
|
326
328
|
.insert('rect', 'text')
|
|
327
329
|
.attr('class', 'node-child')
|
|
328
330
|
.attr('x', function (d) {
|
|
@@ -339,7 +341,7 @@ function update(source) {
|
|
|
339
341
|
})
|
|
340
342
|
.attr('ry', '8');
|
|
341
343
|
// add clickable circle element to nodes with children
|
|
342
|
-
|
|
344
|
+
nodeCircle
|
|
343
345
|
.append('text')
|
|
344
346
|
.attr('class', 'node-circle-text')
|
|
345
347
|
.attr('x', function (d) {
|
|
@@ -350,7 +352,7 @@ function update(source) {
|
|
|
350
352
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
351
353
|
.on('click', click)
|
|
352
354
|
.call(getBB);
|
|
353
|
-
|
|
355
|
+
nodeCircle
|
|
354
356
|
.insert('circle', 'text')
|
|
355
357
|
.attr('class', 'node-circle')
|
|
356
358
|
.attr('r', function (d) {
|
|
@@ -374,6 +376,9 @@ function update(source) {
|
|
|
374
376
|
return 'translate(' + d.y + ',' + d.x + ')';
|
|
375
377
|
});
|
|
376
378
|
// change style of node elements on update
|
|
379
|
+
nodeUpdate.select('.node-circle-g').attr('class', function (d) {
|
|
380
|
+
return d._children ? 'node-circle-g collapsed' : 'node-circle-g expanded';
|
|
381
|
+
});
|
|
377
382
|
nodeUpdate
|
|
378
383
|
.select('rect')
|
|
379
384
|
.style('fill', function (d) {
|
|
@@ -385,10 +390,7 @@ function update(source) {
|
|
|
385
390
|
.style('stroke-width', function (d) {
|
|
386
391
|
return d._children ? 'none' : '1px solid';
|
|
387
392
|
});
|
|
388
|
-
nodeUpdate.select('
|
|
389
|
-
return d._children ? 'var(--vscode-button-background)' : 'var(--vscode-button-secondaryBackground)';
|
|
390
|
-
});
|
|
391
|
-
nodeUpdate.select('.node-child-text').style('fill', function (d) {
|
|
393
|
+
nodeUpdate.select('.node-rect-text').style('fill', function (d) {
|
|
392
394
|
return d._children ? 'var( --vscode-editor-background)' : 'var(--vscode-foreground)';
|
|
393
395
|
});
|
|
394
396
|
nodeUpdate.select('.node-circle-text').text(function (d) {
|