@jumoo/usync 17.6.1-prerelease.19 → 17.6.1-prerelease.21
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/components/preview-side.d.ts +16 -0
- package/dist/components/preview-side.js +38 -0
- package/dist/components/usync-content-preview.d.ts +3 -1
- package/dist/components/usync-content-preview.js +161 -173
- package/dist/components/usync-content-type-preview.d.ts +3 -1
- package/dist/components/usync-content-type-preview.js +218 -222
- package/dist/components/usync-data-type-preview.d.ts +3 -1
- package/dist/components/usync-data-type-preview.js +122 -126
- package/dist/components/usync-results-view.d.ts +5 -1
- package/dist/components/usync-results-view.js +4 -0
- package/dist/dialogs/details-modal-element.js +1 -1
- package/dist/dialogs/details-modal-token.d.ts +6 -1
- package/dist/preview/types.d.ts +10 -0
- package/package.json +1 -1
|
@@ -13,7 +13,8 @@ var _uSyncDataTypePreviewElement_instances, _uSyncDataTypePreviewElement_renderS
|
|
|
13
13
|
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
|
14
14
|
import { classMap, css, customElement, html, nothing, property, } from '@umbraco-cms/backoffice/external/lit';
|
|
15
15
|
import '@umbraco-cms/backoffice/components';
|
|
16
|
-
import {
|
|
16
|
+
import { previewSideStyles, renderPreviewHeadline, } from './preview-side.js';
|
|
17
|
+
import { getPreviewModel, } from '../preview/types.js';
|
|
17
18
|
import { deepEqual, prettyJson } from '../utils/diff/index.js';
|
|
18
19
|
/**
|
|
19
20
|
* Shows the current and incoming versions of a data type side by side,
|
|
@@ -33,20 +34,17 @@ let uSyncDataTypePreviewElement = class uSyncDataTypePreviewElement extends UmbL
|
|
|
33
34
|
const incoming = model?.incoming ?? undefined;
|
|
34
35
|
return html `
|
|
35
36
|
<div class="sides">
|
|
36
|
-
${__classPrivateFieldGet(this, _uSyncDataTypePreviewElement_instances, "m", _uSyncDataTypePreviewElement_renderSide).call(this, 'current', current, incoming)}
|
|
37
37
|
${__classPrivateFieldGet(this, _uSyncDataTypePreviewElement_instances, "m", _uSyncDataTypePreviewElement_renderSide).call(this, 'incoming', incoming, current)}
|
|
38
|
+
${__classPrivateFieldGet(this, _uSyncDataTypePreviewElement_instances, "m", _uSyncDataTypePreviewElement_renderSide).call(this, 'current', current, incoming)}
|
|
38
39
|
</div>
|
|
39
40
|
`;
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
43
|
_uSyncDataTypePreviewElement_instances = new WeakSet();
|
|
43
44
|
_uSyncDataTypePreviewElement_renderSide = function _uSyncDataTypePreviewElement_renderSide(side, dataType, other) {
|
|
44
|
-
const headline = side === 'current'
|
|
45
|
-
? this.localize.termOrDefault('uSync_previewCurrent', 'Current (this site)')
|
|
46
|
-
: this.localize.termOrDefault('uSync_previewIncoming', 'Incoming (uSync files)');
|
|
47
45
|
return html `
|
|
48
|
-
<div class="side">
|
|
49
|
-
|
|
46
|
+
<div class="side ${side}">
|
|
47
|
+
${renderPreviewHeadline(this, side, this.labels)}
|
|
50
48
|
${dataType
|
|
51
49
|
? html `
|
|
52
50
|
${__classPrivateFieldGet(this, _uSyncDataTypePreviewElement_instances, "m", _uSyncDataTypePreviewElement_renderInfo).call(this, dataType, other)} ${__classPrivateFieldGet(this, _uSyncDataTypePreviewElement_instances, "m", _uSyncDataTypePreviewElement_renderEditor).call(this, dataType)}
|
|
@@ -127,151 +125,149 @@ _uSyncDataTypePreviewElement_renderConfig = function _uSyncDataTypePreviewElemen
|
|
|
127
125
|
</uui-box>
|
|
128
126
|
`;
|
|
129
127
|
};
|
|
130
|
-
uSyncDataTypePreviewElement.styles =
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
boxes line up across the sides. */
|
|
138
|
-
.sides {
|
|
139
|
-
display: grid;
|
|
140
|
-
grid-template-columns: 1fr 1fr;
|
|
141
|
-
grid-template-rows: auto auto auto 1fr;
|
|
142
|
-
gap: var(--uui-size-space-4) var(--uui-size-space-5);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.side {
|
|
146
|
-
display: grid;
|
|
147
|
-
grid-row: span 4;
|
|
148
|
-
grid-template-rows: subgrid;
|
|
149
|
-
min-width: 0;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.side > :last-child {
|
|
153
|
-
align-self: start;
|
|
154
|
-
}
|
|
128
|
+
uSyncDataTypePreviewElement.styles = [
|
|
129
|
+
previewSideStyles,
|
|
130
|
+
css `
|
|
131
|
+
:host {
|
|
132
|
+
display: block;
|
|
133
|
+
container-type: inline-size;
|
|
134
|
+
}
|
|
155
135
|
|
|
156
|
-
|
|
136
|
+
/* the two sides share rows (headline, info, editor, config), so the
|
|
137
|
+
boxes line up across the sides. */
|
|
157
138
|
.sides {
|
|
158
|
-
|
|
159
|
-
grid-template-
|
|
160
|
-
|
|
139
|
+
display: grid;
|
|
140
|
+
grid-template-columns: 1fr 1fr;
|
|
141
|
+
grid-template-rows: auto auto auto 1fr;
|
|
142
|
+
gap: var(--uui-size-space-4) var(--uui-size-space-5);
|
|
161
143
|
}
|
|
162
144
|
|
|
163
145
|
.side {
|
|
164
|
-
display:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
146
|
+
display: grid;
|
|
147
|
+
grid-row: span 4;
|
|
148
|
+
grid-template-rows: subgrid;
|
|
149
|
+
min-width: 0;
|
|
168
150
|
}
|
|
169
|
-
}
|
|
170
151
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
text-transform: uppercase;
|
|
175
|
-
letter-spacing: 0.04em;
|
|
176
|
-
color: var(--uui-color-text-alt);
|
|
177
|
-
}
|
|
152
|
+
.side > :last-child {
|
|
153
|
+
align-self: start;
|
|
154
|
+
}
|
|
178
155
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
156
|
+
@container (max-width: 760px) {
|
|
157
|
+
.sides {
|
|
158
|
+
grid-template-columns: 1fr;
|
|
159
|
+
grid-template-rows: none;
|
|
160
|
+
row-gap: var(--uui-size-layout-1);
|
|
161
|
+
}
|
|
184
162
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
163
|
+
.side {
|
|
164
|
+
display: flex;
|
|
165
|
+
flex-direction: column;
|
|
166
|
+
gap: var(--uui-size-space-4);
|
|
167
|
+
grid-row: auto;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.headline {
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
gap: var(--uui-size-space-3);
|
|
175
|
+
}
|
|
192
176
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
177
|
+
.meta {
|
|
178
|
+
display: grid;
|
|
179
|
+
grid-template-columns: max-content 1fr;
|
|
180
|
+
align-items: baseline;
|
|
181
|
+
gap: var(--uui-size-space-3) var(--uui-size-space-5);
|
|
182
|
+
margin: 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.meta dt {
|
|
186
|
+
font-weight: 700;
|
|
187
|
+
}
|
|
196
188
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
189
|
+
.meta dd {
|
|
190
|
+
margin: 0;
|
|
191
|
+
overflow-wrap: anywhere;
|
|
192
|
+
}
|
|
201
193
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
194
|
+
/* a changed field gets a soft highlight, spread with a shadow so the text doesn't move. */
|
|
195
|
+
.changed {
|
|
196
|
+
background: color-mix(in srgb, var(--usync-preview-change) 35%, transparent);
|
|
197
|
+
border-radius: var(--uui-border-radius);
|
|
198
|
+
box-shadow: 0 0 0 var(--uui-size-space-1)
|
|
199
|
+
color-mix(in srgb, var(--usync-preview-change) 35%, transparent);
|
|
200
|
+
}
|
|
209
201
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
202
|
+
/* umb-property pads itself for a full workspace, tighten it up here. */
|
|
203
|
+
umb-property {
|
|
204
|
+
--uui-size-layout-1: var(--uui-size-space-2);
|
|
205
|
+
}
|
|
214
206
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
207
|
+
table {
|
|
208
|
+
width: 100%;
|
|
209
|
+
border-collapse: collapse;
|
|
210
|
+
margin: calc(-1 * var(--uui-size-space-2)) 0;
|
|
211
|
+
}
|
|
220
212
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
213
|
+
tr + tr {
|
|
214
|
+
border-top: 1px solid var(--uui-color-divider);
|
|
215
|
+
}
|
|
224
216
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
217
|
+
th,
|
|
218
|
+
td {
|
|
219
|
+
text-align: left;
|
|
220
|
+
vertical-align: baseline;
|
|
221
|
+
padding: var(--uui-size-space-3) var(--uui-size-space-3);
|
|
222
|
+
}
|
|
231
223
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
224
|
+
/* the alias column is as wide as the longest alias (up to 40%), so values sit beside their names. */
|
|
225
|
+
th {
|
|
226
|
+
width: 1%;
|
|
227
|
+
max-width: 40%;
|
|
228
|
+
white-space: nowrap;
|
|
229
|
+
font-weight: 700;
|
|
230
|
+
}
|
|
239
231
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
232
|
+
th code,
|
|
233
|
+
td pre {
|
|
234
|
+
font-size: var(--uui-type-small-size);
|
|
235
|
+
}
|
|
244
236
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
237
|
+
td pre {
|
|
238
|
+
margin: 0;
|
|
239
|
+
white-space: pre-wrap;
|
|
240
|
+
word-break: break-word;
|
|
241
|
+
}
|
|
250
242
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
243
|
+
/* marked with an inset bar rather than a border, so the content doesn't shift. */
|
|
244
|
+
tr.row-changed {
|
|
245
|
+
box-shadow: inset 3px 0 0 var(--usync-preview-change);
|
|
246
|
+
background: color-mix(in srgb, var(--usync-preview-change) 10%, transparent);
|
|
247
|
+
}
|
|
256
248
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
249
|
+
tr.row-added {
|
|
250
|
+
box-shadow: inset 3px 0 0 var(--uui-color-positive);
|
|
251
|
+
background: color-mix(in srgb, var(--uui-color-positive) 6%, transparent);
|
|
252
|
+
}
|
|
261
253
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
254
|
+
tr.row-removed {
|
|
255
|
+
box-shadow: inset 3px 0 0 var(--uui-color-danger);
|
|
256
|
+
background: color-mix(in srgb, var(--uui-color-danger) 6%, transparent);
|
|
257
|
+
}
|
|
266
258
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
259
|
+
.empty {
|
|
260
|
+
margin: 0;
|
|
261
|
+
color: var(--uui-color-text-alt);
|
|
262
|
+
}
|
|
263
|
+
`,
|
|
264
|
+
];
|
|
272
265
|
__decorate([
|
|
273
266
|
property({ type: Object })
|
|
274
267
|
], uSyncDataTypePreviewElement.prototype, "preview", void 0);
|
|
268
|
+
__decorate([
|
|
269
|
+
property({ type: Object })
|
|
270
|
+
], uSyncDataTypePreviewElement.prototype, "labels", void 0);
|
|
275
271
|
uSyncDataTypePreviewElement = __decorate([
|
|
276
272
|
customElement('usync-data-type-preview')
|
|
277
273
|
], uSyncDataTypePreviewElement);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement, nothing } from '@umbraco-cms/backoffice/external/lit';
|
|
2
2
|
import { USyncActionView } from '@jumoo/uSync';
|
|
3
|
-
import { uSyncPreviewSource } from '@jumoo/uSync';
|
|
3
|
+
import { uSyncPreviewLabels, uSyncPreviewSource } from '@jumoo/uSync';
|
|
4
4
|
declare const uSyncResultsView_base: import("@umbraco-cms/backoffice/extension-api").HTMLElementConstructor<import("@umbraco-cms/backoffice/element-api").UmbElement> & typeof LitElement;
|
|
5
5
|
export declare class uSyncResultsView extends uSyncResultsView_base {
|
|
6
6
|
#private;
|
|
@@ -13,6 +13,10 @@ export declare class uSyncResultsView extends uSyncResultsView_base {
|
|
|
13
13
|
* items from this site's uSync folders (see uSyncDetailsModalData).
|
|
14
14
|
*/
|
|
15
15
|
previewSource?: uSyncPreviewSource;
|
|
16
|
+
/**
|
|
17
|
+
* the headlines over the two sides of the preview (see uSyncDetailsModalData).
|
|
18
|
+
*/
|
|
19
|
+
previewLabels?: uSyncPreviewLabels;
|
|
16
20
|
showAll: boolean;
|
|
17
21
|
changeCount: number;
|
|
18
22
|
groupBy<T>(arr: T[], fn: (item: T) => any): Record<string, T[]>;
|
|
@@ -100,6 +100,7 @@ _uSyncResultsView_showDetail = async function _uSyncResultsView_showDetail(e) {
|
|
|
100
100
|
item: e.action,
|
|
101
101
|
items: __classPrivateFieldGet(this, _uSyncResultsView_instances, "m", _uSyncResultsView_visibleItems).call(this),
|
|
102
102
|
previewSource: this.previewSource,
|
|
103
|
+
previewLabels: this.previewLabels,
|
|
103
104
|
showActions: (item) => !this.hideActions &&
|
|
104
105
|
(item.change == ChangeType.CREATE ||
|
|
105
106
|
item.change == ChangeType.UPDATE ||
|
|
@@ -175,6 +176,9 @@ __decorate([
|
|
|
175
176
|
__decorate([
|
|
176
177
|
property({ attribute: false })
|
|
177
178
|
], uSyncResultsView.prototype, "previewSource", void 0);
|
|
179
|
+
__decorate([
|
|
180
|
+
property({ attribute: false })
|
|
181
|
+
], uSyncResultsView.prototype, "previewLabels", void 0);
|
|
178
182
|
__decorate([
|
|
179
183
|
state()
|
|
180
184
|
], uSyncResultsView.prototype, "showAll", void 0);
|
|
@@ -198,7 +198,7 @@ _uSyncDetailsModalElement_loadPreview = async function _uSyncDetailsModalElement
|
|
|
198
198
|
if (data?.entityType) {
|
|
199
199
|
const entityType = data.entityType;
|
|
200
200
|
__classPrivateFieldSet(this, _uSyncDetailsModalElement_previewFilter, (manifest) => manifest.forEntityTypes.includes(entityType), "f");
|
|
201
|
-
__classPrivateFieldSet(this, _uSyncDetailsModalElement_previewProps, { preview: data }, "f");
|
|
201
|
+
__classPrivateFieldSet(this, _uSyncDetailsModalElement_previewProps, { preview: data, labels: this.data?.previewLabels }, "f");
|
|
202
202
|
this._preview = data;
|
|
203
203
|
}
|
|
204
204
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UmbModalToken } from '@umbraco-cms/backoffice/modal';
|
|
2
|
-
import { SyncItemPreviewResponse, USyncActionView } from '@jumoo/uSync';
|
|
2
|
+
import { SyncItemPreviewResponse, USyncActionView, uSyncPreviewLabels } from '@jumoo/uSync';
|
|
3
3
|
/**
|
|
4
4
|
* where the details dialog gets the preview of an item from.
|
|
5
5
|
*
|
|
@@ -25,6 +25,11 @@ export interface uSyncDetailsModalData {
|
|
|
25
25
|
* the item from this site's uSync folders.
|
|
26
26
|
*/
|
|
27
27
|
previewSource?: uSyncPreviewSource;
|
|
28
|
+
/**
|
|
29
|
+
* the headlines over the two sides of the preview, for a previewSource whose
|
|
30
|
+
* items don't come from this site's uSync folders.
|
|
31
|
+
*/
|
|
32
|
+
previewLabels?: uSyncPreviewLabels;
|
|
28
33
|
}
|
|
29
34
|
export interface uSyncDetailsModalValue {
|
|
30
35
|
result: boolean;
|
package/dist/preview/types.d.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import type { ManifestElement } from '@umbraco-cms/backoffice/extension-api';
|
|
2
2
|
import type { DataTypeResponseModel, DocumentResponseModel, DocumentTypeResponseModel, MediaResponseModel, MediaTypeResponseModel, MemberTypeResponseModel } from '@umbraco-cms/backoffice/external/backend-api';
|
|
3
3
|
import type { SyncItemPreviewResponse } from '../api';
|
|
4
|
+
/**
|
|
5
|
+
* the headlines over the two sides of a preview, for callers whose items don't
|
|
6
|
+
* come from this site's uSync folders (e.g. 'Target site' and 'This site').
|
|
7
|
+
*/
|
|
8
|
+
export interface uSyncPreviewLabels {
|
|
9
|
+
current?: string;
|
|
10
|
+
incoming?: string;
|
|
11
|
+
}
|
|
4
12
|
/**
|
|
5
13
|
* An element that shows the preview of an import for one or more entity types.
|
|
6
14
|
*/
|
|
7
15
|
export interface uSyncItemPreviewElement extends HTMLElement {
|
|
8
16
|
preview?: SyncItemPreviewResponse;
|
|
17
|
+
/** headlines for the two sides, when not set the element uses its own. */
|
|
18
|
+
labels?: uSyncPreviewLabels;
|
|
9
19
|
}
|
|
10
20
|
/**
|
|
11
21
|
* Shows the preview for items of the given entity types in the details dialog.
|
package/package.json
CHANGED