@jumoo/usync 17.5.2 → 17.5.3-prerelease.16
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/api/client.gen.js +1 -2
- package/dist/api/index.d.ts +1 -1
- package/dist/api/sdk.gen.d.ts +2 -1
- package/dist/api/sdk.gen.js +7 -0
- package/dist/api/types.gen.d.ts +37 -0
- package/dist/components/usync-content-preview.d.ts +27 -0
- package/dist/components/usync-content-preview.js +532 -0
- package/dist/components/usync-content-type-preview.d.ts +25 -0
- package/dist/components/usync-content-type-preview.js +530 -0
- package/dist/components/usync-data-type-preview.d.ts +21 -0
- package/dist/components/usync-data-type-preview.js +295 -0
- package/dist/components/usync-results-view.js +13 -5
- package/dist/dialogs/details-modal-element.d.ts +15 -0
- package/dist/dialogs/details-modal-element.js +217 -9
- package/dist/dialogs/details-modal-token.d.ts +10 -1
- package/dist/exports.d.ts +1 -0
- package/dist/exports.js +1 -0
- package/dist/index.js +9 -1
- package/dist/lang/files/da-dk.d.ts +37 -0
- package/dist/lang/files/da-dk.js +37 -0
- package/dist/lang/files/de-de.d.ts +37 -0
- package/dist/lang/files/de-de.js +37 -0
- package/dist/lang/files/en-us.d.ts +50 -0
- package/dist/lang/files/en-us.js +50 -0
- package/dist/lang/files/es-es.d.ts +37 -0
- package/dist/lang/files/es-es.js +37 -0
- package/dist/lang/files/fr-fr.d.ts +37 -0
- package/dist/lang/files/fr-fr.js +37 -0
- package/dist/lang/files/nl-nl.d.ts +37 -0
- package/dist/lang/files/nl-nl.js +37 -0
- package/dist/manifests.js +2 -0
- package/dist/preview/index.d.ts +1 -0
- package/dist/preview/index.js +1 -0
- package/dist/preview/manifest.d.ts +2 -0
- package/dist/preview/manifest.js +22 -0
- package/dist/preview/types.d.ts +72 -0
- package/dist/preview/types.js +2 -0
- package/dist/repository/SyncAction.respositoy.d.ts +8 -0
- package/dist/repository/SyncAction.respositoy.js +6 -0
- package/dist/repository/sources/SyncAction.source.d.ts +5 -0
- package/dist/repository/sources/SyncAction.source.js +5 -0
- package/dist/utils/preview/content-type-diff.d.ts +18 -0
- package/dist/utils/preview/content-type-diff.js +72 -0
- package/dist/utils/preview/content-type-layout.d.ts +39 -0
- package/dist/utils/preview/content-type-layout.js +100 -0
- package/package.json +2 -2
- package/dist/hey-api.d.ts +0 -11
- package/dist/hey-api.js +0 -14
package/dist/api/client.gen.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
import { createClientConfig } from '../hey-api';
|
|
3
2
|
import { createClient, createConfig } from './client';
|
|
4
|
-
export const client = createClient(
|
|
3
|
+
export const client = createClient(createConfig({ baseUrl: 'http://localhost:16903', throwOnError: true }));
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { client, type CreateClientConfig } from './client.gen';
|
|
2
2
|
export { ActionsService, FoldersService, MigrationsService, type Options, SettingsService } from './sdk.gen';
|
|
3
|
-
export { ChangeDetailType, ChangeType, type CheckLegacyData, type CheckLegacyErrors, type CheckLegacyResponse, type CheckLegacyResponses, type ClientOptions, type CopyLegacyData, type CopyLegacyErrors, type CopyLegacyResponse, type CopyLegacyResponses, type DownloadData, type DownloadErrors, type DownloadResponse, type DownloadResponses, type GetActionsBySetData, type GetActionsBySetErrors, type GetActionsBySetResponse, type GetActionsBySetResponses, type GetActionsData, type GetActionsErrors, type GetActionsResponse, type GetActionsResponses, type GetAddOnsData, type GetAddOnsErrors, type GetAddonSplashData, type GetAddonSplashErrors, type GetAddonSplashResponse, type GetAddonSplashResponses, type GetAddOnsResponse, type GetAddOnsResponses, type GetHandlerSetSettingsData, type GetHandlerSetSettingsErrors, type GetHandlerSetSettingsResponse, type GetHandlerSetSettingsResponses, type GetSetsData, type GetSetsErrors, type GetSetsResponse, type GetSetsResponses, type GetSettingsData, type GetSettingsErrors, type GetSettingsResponse, type GetSettingsResponses, type GetSyncFileInfoData, type GetSyncFileInfoErrors, type GetSyncFileInfoResponse, type GetSyncFileInfoResponses, type HandlerSettings, HandlerStatus, type IgnoreLegacyData, type IgnoreLegacyErrors, type IgnoreLegacyResponse, type IgnoreLegacyResponses, type ImportSingleData, type ImportSingleErrors, type ImportSingleResponse, type ImportSingleResponses, type MergeExportFolderData, type MergeExportFolderErrors, type MergeExportFolderResponse, type MergeExportFolderResponses, type PerformActionData, type PerformActionErrors, type PerformActionRequest, type PerformActionResponse, type PerformActionResponse2, type PerformActionResponses, type ProcessUploadData, type ProcessUploadErrors, type ProcessUploadResponse, type ProcessUploadResponses, type RunningData, type RunningErrors, type RunningResponse, type RunningResponses, type StatusData, type StatusErrors, type StatusResponse, type StatusResponses, type SyncActionButton, type SyncActionGroup, type SyncFileVersionCheckResult, SyncFolderMode, type SyncHandlerSummary, type SyncLegacyCheckResponse, type SyncOperationStatusResponse, SyncProcessingMode, type SyncRunningOperationResponse, type SyncSelectableSet, type UploadImportResult, type USyncActionView, type USyncAddonInfo, type USyncAddonSplash, type USyncChange, type USyncHandlerSetSettings, type USyncOptions, type USyncSettings } from './types.gen';
|
|
3
|
+
export { ChangeDetailType, ChangeType, type CheckLegacyData, type CheckLegacyErrors, type CheckLegacyResponse, type CheckLegacyResponses, type ClientOptions, type CopyLegacyData, type CopyLegacyErrors, type CopyLegacyResponse, type CopyLegacyResponses, type DownloadData, type DownloadErrors, type DownloadResponse, type DownloadResponses, type GetActionsBySetData, type GetActionsBySetErrors, type GetActionsBySetResponse, type GetActionsBySetResponses, type GetActionsData, type GetActionsErrors, type GetActionsResponse, type GetActionsResponses, type GetAddOnsData, type GetAddOnsErrors, type GetAddonSplashData, type GetAddonSplashErrors, type GetAddonSplashResponse, type GetAddonSplashResponses, type GetAddOnsResponse, type GetAddOnsResponses, type GetHandlerSetSettingsData, type GetHandlerSetSettingsErrors, type GetHandlerSetSettingsResponse, type GetHandlerSetSettingsResponses, type GetPreviewData, type GetPreviewErrors, type GetPreviewResponse, type GetPreviewResponses, type GetSetsData, type GetSetsErrors, type GetSetsResponse, type GetSetsResponses, type GetSettingsData, type GetSettingsErrors, type GetSettingsResponse, type GetSettingsResponses, type GetSyncFileInfoData, type GetSyncFileInfoErrors, type GetSyncFileInfoResponse, type GetSyncFileInfoResponses, type HandlerSettings, HandlerStatus, type IgnoreLegacyData, type IgnoreLegacyErrors, type IgnoreLegacyResponse, type IgnoreLegacyResponses, type ImportSingleData, type ImportSingleErrors, type ImportSingleResponse, type ImportSingleResponses, type MergeExportFolderData, type MergeExportFolderErrors, type MergeExportFolderResponse, type MergeExportFolderResponses, type PerformActionData, type PerformActionErrors, type PerformActionRequest, type PerformActionResponse, type PerformActionResponse2, type PerformActionResponses, type ProcessUploadData, type ProcessUploadErrors, type ProcessUploadResponse, type ProcessUploadResponses, type RunningData, type RunningErrors, type RunningResponse, type RunningResponses, type StatusData, type StatusErrors, type StatusResponse, type StatusResponses, type SyncActionButton, type SyncActionGroup, type SyncFileVersionCheckResult, SyncFolderMode, type SyncHandlerSummary, type SyncItemPreviewResponse, type SyncLegacyCheckResponse, type SyncOperationStatusResponse, SyncProcessingMode, type SyncRunningOperationResponse, type SyncSelectableSet, type UploadImportResult, type USyncActionView, type USyncAddonInfo, type USyncAddonSplash, type USyncChange, type USyncHandlerSetSettings, type USyncOptions, type USyncSettings } from './types.gen';
|
package/dist/api/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client';
|
|
2
|
-
import type { CheckLegacyData, CheckLegacyErrors, CheckLegacyResponses, CopyLegacyData, CopyLegacyErrors, CopyLegacyResponses, DownloadData, DownloadErrors, DownloadResponses, GetActionsBySetData, GetActionsBySetErrors, GetActionsBySetResponses, GetActionsData, GetActionsErrors, GetActionsResponses, GetAddOnsData, GetAddOnsErrors, GetAddonSplashData, GetAddonSplashErrors, GetAddonSplashResponses, GetAddOnsResponses, GetHandlerSetSettingsData, GetHandlerSetSettingsErrors, GetHandlerSetSettingsResponses, GetSetsData, GetSetsErrors, GetSetsResponses, GetSettingsData, GetSettingsErrors, GetSettingsResponses, GetSyncFileInfoData, GetSyncFileInfoErrors, GetSyncFileInfoResponses, IgnoreLegacyData, IgnoreLegacyErrors, IgnoreLegacyResponses, ImportSingleData, ImportSingleErrors, ImportSingleResponses, MergeExportFolderData, MergeExportFolderErrors, MergeExportFolderResponses, PerformActionData, PerformActionErrors, PerformActionResponses, ProcessUploadData, ProcessUploadErrors, ProcessUploadResponses, RunningData, RunningErrors, RunningResponses, StatusData, StatusErrors, StatusResponses } from './types.gen';
|
|
2
|
+
import type { CheckLegacyData, CheckLegacyErrors, CheckLegacyResponses, CopyLegacyData, CopyLegacyErrors, CopyLegacyResponses, DownloadData, DownloadErrors, DownloadResponses, GetActionsBySetData, GetActionsBySetErrors, GetActionsBySetResponses, GetActionsData, GetActionsErrors, GetActionsResponses, GetAddOnsData, GetAddOnsErrors, GetAddonSplashData, GetAddonSplashErrors, GetAddonSplashResponses, GetAddOnsResponses, GetHandlerSetSettingsData, GetHandlerSetSettingsErrors, GetHandlerSetSettingsResponses, GetPreviewData, GetPreviewErrors, GetPreviewResponses, GetSetsData, GetSetsErrors, GetSetsResponses, GetSettingsData, GetSettingsErrors, GetSettingsResponses, GetSyncFileInfoData, GetSyncFileInfoErrors, GetSyncFileInfoResponses, IgnoreLegacyData, IgnoreLegacyErrors, IgnoreLegacyResponses, ImportSingleData, ImportSingleErrors, ImportSingleResponses, MergeExportFolderData, MergeExportFolderErrors, MergeExportFolderResponses, PerformActionData, PerformActionErrors, PerformActionResponses, ProcessUploadData, ProcessUploadErrors, ProcessUploadResponses, RunningData, RunningErrors, RunningResponses, StatusData, StatusErrors, StatusResponses } from './types.gen';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -23,6 +23,7 @@ export declare class ActionsService {
|
|
|
23
23
|
static getSyncFileInfo<ThrowOnError extends boolean = true>(options?: Options<GetSyncFileInfoData, ThrowOnError>): RequestResult<GetSyncFileInfoResponses, GetSyncFileInfoErrors, ThrowOnError>;
|
|
24
24
|
static importSingle<ThrowOnError extends boolean = true>(options?: Options<ImportSingleData, ThrowOnError>): RequestResult<ImportSingleResponses, ImportSingleErrors, ThrowOnError>;
|
|
25
25
|
static performAction<ThrowOnError extends boolean = true>(options?: Options<PerformActionData, ThrowOnError>): RequestResult<PerformActionResponses, PerformActionErrors, ThrowOnError>;
|
|
26
|
+
static getPreview<ThrowOnError extends boolean = true>(options?: Options<GetPreviewData, ThrowOnError>): RequestResult<GetPreviewResponses, GetPreviewErrors, ThrowOnError>;
|
|
26
27
|
static processUpload<ThrowOnError extends boolean = true>(options?: Options<ProcessUploadData, ThrowOnError>): RequestResult<ProcessUploadResponses, ProcessUploadErrors, ThrowOnError>;
|
|
27
28
|
static running<ThrowOnError extends boolean = true>(options?: Options<RunningData, ThrowOnError>): RequestResult<RunningResponses, RunningErrors, ThrowOnError>;
|
|
28
29
|
static status<ThrowOnError extends boolean = true>(options?: Options<StatusData, ThrowOnError>): RequestResult<StatusResponses, StatusErrors, ThrowOnError>;
|
package/dist/api/sdk.gen.js
CHANGED
|
@@ -54,6 +54,13 @@ export class ActionsService {
|
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
+
static getPreview(options) {
|
|
58
|
+
return (options?.client ?? client).get({
|
|
59
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
60
|
+
url: '/umbraco/usync/api/v1/Preview',
|
|
61
|
+
...options
|
|
62
|
+
});
|
|
63
|
+
}
|
|
57
64
|
static processUpload(options) {
|
|
58
65
|
return (options?.client ?? client).post({
|
|
59
66
|
security: [{ scheme: 'bearer', type: 'http' }],
|
package/dist/api/types.gen.d.ts
CHANGED
|
@@ -96,6 +96,17 @@ export type SyncHandlerSummary = {
|
|
|
96
96
|
changes: number;
|
|
97
97
|
inError: boolean;
|
|
98
98
|
};
|
|
99
|
+
export type SyncItemPreviewResponse = {
|
|
100
|
+
key: string;
|
|
101
|
+
handler: string;
|
|
102
|
+
itemType: string;
|
|
103
|
+
entityType: string;
|
|
104
|
+
isDelete: boolean;
|
|
105
|
+
success: boolean;
|
|
106
|
+
message?: string | null;
|
|
107
|
+
preview?: unknown;
|
|
108
|
+
details: Array<USyncChange>;
|
|
109
|
+
};
|
|
99
110
|
export type SyncLegacyCheckResponse = {
|
|
100
111
|
hasLegacy: boolean;
|
|
101
112
|
legacyFolder?: string | null;
|
|
@@ -331,6 +342,32 @@ export type PerformActionResponses = {
|
|
|
331
342
|
200: PerformActionResponse;
|
|
332
343
|
};
|
|
333
344
|
export type PerformActionResponse2 = PerformActionResponses[keyof PerformActionResponses];
|
|
345
|
+
export type GetPreviewData = {
|
|
346
|
+
body?: never;
|
|
347
|
+
path?: never;
|
|
348
|
+
query?: {
|
|
349
|
+
handler?: string;
|
|
350
|
+
key?: string;
|
|
351
|
+
};
|
|
352
|
+
url: '/umbraco/usync/api/v1/Preview';
|
|
353
|
+
};
|
|
354
|
+
export type GetPreviewErrors = {
|
|
355
|
+
/**
|
|
356
|
+
* The resource is protected and requires an authentication token
|
|
357
|
+
*/
|
|
358
|
+
401: unknown;
|
|
359
|
+
/**
|
|
360
|
+
* Not Found
|
|
361
|
+
*/
|
|
362
|
+
404: unknown;
|
|
363
|
+
};
|
|
364
|
+
export type GetPreviewResponses = {
|
|
365
|
+
/**
|
|
366
|
+
* OK
|
|
367
|
+
*/
|
|
368
|
+
200: SyncItemPreviewResponse;
|
|
369
|
+
};
|
|
370
|
+
export type GetPreviewResponse = GetPreviewResponses[keyof GetPreviewResponses];
|
|
334
371
|
export type ProcessUploadData = {
|
|
335
372
|
body?: never;
|
|
336
373
|
path?: never;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
|
2
|
+
import { type PropertyValues, nothing } from '@umbraco-cms/backoffice/external/lit';
|
|
3
|
+
import '@umbraco-cms/backoffice/components';
|
|
4
|
+
import type { SyncItemPreviewResponse } from '../api';
|
|
5
|
+
/**
|
|
6
|
+
* Shows the current and incoming versions of a content or media item side by
|
|
7
|
+
* side, laid out the way the backoffice editor shows them, with every value
|
|
8
|
+
* rendered by its real property editor. Values that change are highlighted.
|
|
9
|
+
*/
|
|
10
|
+
export declare class uSyncContentPreviewElement extends UmbLitElement {
|
|
11
|
+
#private;
|
|
12
|
+
preview?: SyncItemPreviewResponse;
|
|
13
|
+
/** the tab shown on both sides (by name) */
|
|
14
|
+
private _activeTab?;
|
|
15
|
+
/** the culture shown on both sides (undefined for invariant items) */
|
|
16
|
+
private _culture?;
|
|
17
|
+
private _onlyChanges;
|
|
18
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
19
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
20
|
+
static styles: import("lit").CSSResult;
|
|
21
|
+
}
|
|
22
|
+
export default uSyncContentPreviewElement;
|
|
23
|
+
declare global {
|
|
24
|
+
interface HTMLElementTagNameMap {
|
|
25
|
+
'usync-content-preview': uSyncContentPreviewElement;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
11
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12
|
+
};
|
|
13
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
14
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
15
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
16
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
17
|
+
};
|
|
18
|
+
var _uSyncContentPreviewElement_instances, _uSyncContentPreviewElement_current, _uSyncContentPreviewElement_incoming, _uSyncContentPreviewElement_type, _uSyncContentPreviewElement_compositions, _uSyncContentPreviewElement_dataTypes, _uSyncContentPreviewElement_cultures, _uSyncContentPreviewElement_renderToolbar, _uSyncContentPreviewElement_renderSide, _uSyncContentPreviewElement_missingMessage, _uSyncContentPreviewElement_renderInfo, _uSyncContentPreviewElement_renderPublished, _uSyncContentPreviewElement_name, _uSyncContentPreviewElement_renderTabButton, _uSyncContentPreviewElement_renderTab, _uSyncContentPreviewElement_renderProperties, _uSyncContentPreviewElement_visibleTabs, _uSyncContentPreviewElement_tabProperties, _uSyncContentPreviewElement_datasetValue, _uSyncContentPreviewElement_value, _uSyncContentPreviewElement_valueStatus;
|
|
19
|
+
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
|
20
|
+
import { classMap, css, customElement, html, nothing, property, repeat, state, } from '@umbraco-cms/backoffice/external/lit';
|
|
21
|
+
import '@umbraco-cms/backoffice/components';
|
|
22
|
+
import { getPreviewModel, } from '../preview/types.js';
|
|
23
|
+
import { buildContentTypeLayout, } from '../utils/preview/content-type-layout.js';
|
|
24
|
+
import { deepEqual } from '../utils/diff/deep-equal.js';
|
|
25
|
+
/**
|
|
26
|
+
* Shows the current and incoming versions of a content or media item side by
|
|
27
|
+
* side, laid out the way the backoffice editor shows them, with every value
|
|
28
|
+
* rendered by its real property editor. Values that change are highlighted.
|
|
29
|
+
*/
|
|
30
|
+
let uSyncContentPreviewElement = class uSyncContentPreviewElement extends UmbLitElement {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments);
|
|
33
|
+
_uSyncContentPreviewElement_instances.add(this);
|
|
34
|
+
this._onlyChanges = false;
|
|
35
|
+
_uSyncContentPreviewElement_current.set(this, {});
|
|
36
|
+
_uSyncContentPreviewElement_incoming.set(this, {});
|
|
37
|
+
_uSyncContentPreviewElement_type.set(this, void 0);
|
|
38
|
+
_uSyncContentPreviewElement_compositions.set(this, new Map());
|
|
39
|
+
_uSyncContentPreviewElement_dataTypes.set(this, new Map());
|
|
40
|
+
_uSyncContentPreviewElement_cultures.set(this, []);
|
|
41
|
+
}
|
|
42
|
+
willUpdate(changed) {
|
|
43
|
+
if (!changed.has('preview') || !this.preview)
|
|
44
|
+
return;
|
|
45
|
+
const model = getPreviewModel(this.preview);
|
|
46
|
+
__classPrivateFieldSet(this, _uSyncContentPreviewElement_current, { item: model?.current ?? undefined, info: model?.currentInfo }, "f");
|
|
47
|
+
__classPrivateFieldSet(this, _uSyncContentPreviewElement_incoming, { item: model?.incoming ?? undefined, info: model?.incomingInfo }, "f");
|
|
48
|
+
__classPrivateFieldSet(this, _uSyncContentPreviewElement_type, model?.contentType ?? undefined, "f");
|
|
49
|
+
const compositions = model?.compositions ?? [];
|
|
50
|
+
__classPrivateFieldSet(this, _uSyncContentPreviewElement_compositions, new Map(compositions.map((c) => [c.id, c])), "f");
|
|
51
|
+
__classPrivateFieldSet(this, _uSyncContentPreviewElement_dataTypes, new Map((model?.dataTypes ?? []).map((d) => [d.id, d])), "f");
|
|
52
|
+
__classPrivateFieldSet(this, _uSyncContentPreviewElement_cultures, [
|
|
53
|
+
...new Set([__classPrivateFieldGet(this, _uSyncContentPreviewElement_current, "f").item, __classPrivateFieldGet(this, _uSyncContentPreviewElement_incoming, "f").item]
|
|
54
|
+
.flatMap((item) => item?.variants ?? [])
|
|
55
|
+
.map((v) => v.culture)
|
|
56
|
+
.filter((c) => !!c)),
|
|
57
|
+
].sort(), "f");
|
|
58
|
+
this._culture = __classPrivateFieldGet(this, _uSyncContentPreviewElement_cultures, "f")[0];
|
|
59
|
+
this._activeTab = undefined;
|
|
60
|
+
}
|
|
61
|
+
render() {
|
|
62
|
+
if (!this.preview)
|
|
63
|
+
return nothing;
|
|
64
|
+
const tabs = __classPrivateFieldGet(this, _uSyncContentPreviewElement_type, "f")
|
|
65
|
+
? __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_visibleTabs).call(this, buildContentTypeLayout(__classPrivateFieldGet(this, _uSyncContentPreviewElement_type, "f"), __classPrivateFieldGet(this, _uSyncContentPreviewElement_compositions, "f")))
|
|
66
|
+
: [];
|
|
67
|
+
// until a tab is picked, open on the first one with changes.
|
|
68
|
+
const active = tabs.find((t) => t.name === this._activeTab) ??
|
|
69
|
+
tabs.find((t) => __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_tabProperties).call(this, t).some((p) => __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_valueStatus).call(this, p.property))) ??
|
|
70
|
+
tabs[0];
|
|
71
|
+
return html `
|
|
72
|
+
<div class="sides">
|
|
73
|
+
${__classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_renderToolbar).call(this)}
|
|
74
|
+
${__classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_renderSide).call(this, 'current', __classPrivateFieldGet(this, _uSyncContentPreviewElement_current, "f"), tabs, active)}
|
|
75
|
+
${__classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_renderSide).call(this, 'incoming', __classPrivateFieldGet(this, _uSyncContentPreviewElement_incoming, "f"), tabs, active)}
|
|
76
|
+
</div>
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
_uSyncContentPreviewElement_current = new WeakMap();
|
|
81
|
+
_uSyncContentPreviewElement_incoming = new WeakMap();
|
|
82
|
+
_uSyncContentPreviewElement_type = new WeakMap();
|
|
83
|
+
_uSyncContentPreviewElement_compositions = new WeakMap();
|
|
84
|
+
_uSyncContentPreviewElement_dataTypes = new WeakMap();
|
|
85
|
+
_uSyncContentPreviewElement_cultures = new WeakMap();
|
|
86
|
+
_uSyncContentPreviewElement_instances = new WeakSet();
|
|
87
|
+
_uSyncContentPreviewElement_renderToolbar = function _uSyncContentPreviewElement_renderToolbar() {
|
|
88
|
+
if (__classPrivateFieldGet(this, _uSyncContentPreviewElement_cultures, "f").length < 2 && !(__classPrivateFieldGet(this, _uSyncContentPreviewElement_current, "f").item && __classPrivateFieldGet(this, _uSyncContentPreviewElement_incoming, "f").item))
|
|
89
|
+
return nothing;
|
|
90
|
+
return html `<div class="toolbar">
|
|
91
|
+
${__classPrivateFieldGet(this, _uSyncContentPreviewElement_cultures, "f").length > 1
|
|
92
|
+
? html `<uui-button-group
|
|
93
|
+
aria-label=${this.localize.termOrDefault('uSync_previewCulture', 'Language')}>
|
|
94
|
+
${__classPrivateFieldGet(this, _uSyncContentPreviewElement_cultures, "f").map((culture) => html `<uui-button
|
|
95
|
+
look=${culture === this._culture ? 'primary' : 'secondary'}
|
|
96
|
+
compact
|
|
97
|
+
label=${culture}
|
|
98
|
+
@click=${() => (this._culture = culture)}></uui-button>`)}
|
|
99
|
+
</uui-button-group>`
|
|
100
|
+
: nothing}
|
|
101
|
+
${
|
|
102
|
+
// there is only something to compare when the item is on both sides.
|
|
103
|
+
__classPrivateFieldGet(this, _uSyncContentPreviewElement_current, "f").item && __classPrivateFieldGet(this, _uSyncContentPreviewElement_incoming, "f").item
|
|
104
|
+
? html `<uui-toggle
|
|
105
|
+
label=${this.localize.termOrDefault('uSync_previewOnlyChanges', 'Only show changes')}
|
|
106
|
+
?checked=${this._onlyChanges}
|
|
107
|
+
@change=${(e) => (this._onlyChanges = e.target.checked)}></uui-toggle>`
|
|
108
|
+
: nothing}
|
|
109
|
+
</div>`;
|
|
110
|
+
};
|
|
111
|
+
_uSyncContentPreviewElement_renderSide = function _uSyncContentPreviewElement_renderSide(side, data, tabs, active) {
|
|
112
|
+
const headline = side === 'current'
|
|
113
|
+
? this.localize.termOrDefault('uSync_previewCurrent', 'Current (this site)')
|
|
114
|
+
: this.localize.termOrDefault('uSync_previewIncoming', 'Incoming (uSync files)');
|
|
115
|
+
if (!data.item) {
|
|
116
|
+
return html `<div class="side ${side}">
|
|
117
|
+
<h4 class="side-headline">${headline}</h4>
|
|
118
|
+
<uui-box class="info"><p class="empty">${__classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_missingMessage).call(this, side)}</p></uui-box>
|
|
119
|
+
</div>`;
|
|
120
|
+
}
|
|
121
|
+
return html `
|
|
122
|
+
<div class="side ${side}">
|
|
123
|
+
<h4 class="side-headline">${headline}</h4>
|
|
124
|
+
${__classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_renderInfo).call(this, data)}
|
|
125
|
+
${tabs.length > 1 || (tabs.length === 1 && tabs[0].name)
|
|
126
|
+
? html `<uui-tab-group>
|
|
127
|
+
${tabs.map((tab) => __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_renderTabButton).call(this, tab, tab === active))}
|
|
128
|
+
</uui-tab-group>`
|
|
129
|
+
: html `<div></div>`}
|
|
130
|
+
${active
|
|
131
|
+
? __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_renderTab).call(this, data.item, active)
|
|
132
|
+
: html `<uui-box>
|
|
133
|
+
<p class="empty">
|
|
134
|
+
${this._onlyChanges
|
|
135
|
+
? this.localize.termOrDefault('uSync_previewNoValueChanges', 'No values change')
|
|
136
|
+
: this.localize.termOrDefault('uSync_previewNoProperties', 'No properties')}
|
|
137
|
+
</p>
|
|
138
|
+
</uui-box>`}
|
|
139
|
+
</div>
|
|
140
|
+
`;
|
|
141
|
+
};
|
|
142
|
+
_uSyncContentPreviewElement_missingMessage = function _uSyncContentPreviewElement_missingMessage(side) {
|
|
143
|
+
if (side === 'current') {
|
|
144
|
+
return this.localize.termOrDefault('uSync_previewNotInSite', 'This item does not exist in the site yet');
|
|
145
|
+
}
|
|
146
|
+
return this.preview?.isDelete
|
|
147
|
+
? this.localize.termOrDefault('uSync_previewDeleted', 'This item will be deleted or renamed by the import')
|
|
148
|
+
: this.localize.termOrDefault('uSync_previewFailed', 'The incoming item could not be built for the preview');
|
|
149
|
+
};
|
|
150
|
+
_uSyncContentPreviewElement_renderInfo = function _uSyncContentPreviewElement_renderInfo(data) {
|
|
151
|
+
const item = data.item;
|
|
152
|
+
const info = data.info;
|
|
153
|
+
const other = data === __classPrivateFieldGet(this, _uSyncContentPreviewElement_current, "f") ? __classPrivateFieldGet(this, _uSyncContentPreviewElement_incoming, "f") : __classPrivateFieldGet(this, _uSyncContentPreviewElement_current, "f");
|
|
154
|
+
const both = !!other.item;
|
|
155
|
+
const changed = (field) => {
|
|
156
|
+
if (!both)
|
|
157
|
+
return { changed: false };
|
|
158
|
+
const mine = field === 'name' ? __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_name).call(this, item) : info?.[field];
|
|
159
|
+
const theirs = field === 'name' ? __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_name).call(this, other.item) : other.info?.[field];
|
|
160
|
+
return { changed: !deepEqual(mine, theirs) };
|
|
161
|
+
};
|
|
162
|
+
const icon = 'documentType' in item ? item.documentType.icon : item.mediaType.icon;
|
|
163
|
+
return html `
|
|
164
|
+
<uui-box class="info">
|
|
165
|
+
<div slot="headline" class="headline">
|
|
166
|
+
<umb-icon name=${icon}></umb-icon>
|
|
167
|
+
<span class=${classMap(changed('name'))}>${__classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_name).call(this, item)}</span>
|
|
168
|
+
</div>
|
|
169
|
+
<dl class="meta">
|
|
170
|
+
<dt>${this.localize.termOrDefault('uSync_previewParent', 'Parent')}</dt>
|
|
171
|
+
<dd>
|
|
172
|
+
<span class=${classMap(changed('parent'))}
|
|
173
|
+
>${info?.parent ?? this.localize.termOrDefault('uSync_previewRoot', '(root)')}</span
|
|
174
|
+
>
|
|
175
|
+
</dd>
|
|
176
|
+
${info?.template !== undefined && this.preview?.entityType === 'document'
|
|
177
|
+
? html `<dt>
|
|
178
|
+
${this.localize.termOrDefault('uSync_previewTemplate', 'Template')}
|
|
179
|
+
</dt>
|
|
180
|
+
<dd>
|
|
181
|
+
<span class=${classMap(changed('template'))}
|
|
182
|
+
>${info?.template ?? '-'}</span
|
|
183
|
+
>
|
|
184
|
+
</dd>`
|
|
185
|
+
: nothing}
|
|
186
|
+
<dt>${this.localize.termOrDefault('uSync_previewSortOrder', 'Sort order')}</dt>
|
|
187
|
+
<dd>
|
|
188
|
+
<span class=${classMap(changed('sortOrder'))}>${info?.sortOrder ?? '-'}</span>
|
|
189
|
+
</dd>
|
|
190
|
+
${info?.published.length
|
|
191
|
+
? html `<dt>
|
|
192
|
+
${this.localize.termOrDefault('uSync_previewPublished', 'Published')}
|
|
193
|
+
</dt>
|
|
194
|
+
<dd>
|
|
195
|
+
<span class=${classMap({ tags: true, ...changed('published') })}>
|
|
196
|
+
${info.published.map((p) => __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_renderPublished).call(this, p.culture, p.published))}
|
|
197
|
+
</span>
|
|
198
|
+
</dd>`
|
|
199
|
+
: nothing}
|
|
200
|
+
</dl>
|
|
201
|
+
${info?.trashed
|
|
202
|
+
? html `<uui-tag color="danger" look="secondary"
|
|
203
|
+
>${this.localize.termOrDefault('uSync_previewTrashed', 'In the recycle bin')}</uui-tag
|
|
204
|
+
>`
|
|
205
|
+
: nothing}
|
|
206
|
+
</uui-box>
|
|
207
|
+
`;
|
|
208
|
+
};
|
|
209
|
+
_uSyncContentPreviewElement_renderPublished = function _uSyncContentPreviewElement_renderPublished(culture, published) {
|
|
210
|
+
const label = published
|
|
211
|
+
? this.localize.termOrDefault('uSync_previewPublished', 'Published')
|
|
212
|
+
: this.localize.termOrDefault('uSync_previewNotPublished', 'Not published');
|
|
213
|
+
return html `<uui-tag
|
|
214
|
+
size="s"
|
|
215
|
+
look=${published ? 'primary' : 'secondary'}
|
|
216
|
+
color=${published ? 'positive' : 'default'}
|
|
217
|
+
>${culture ? `${culture}: ` : ''}${label}</uui-tag
|
|
218
|
+
>`;
|
|
219
|
+
};
|
|
220
|
+
_uSyncContentPreviewElement_name = function _uSyncContentPreviewElement_name(item) {
|
|
221
|
+
const variant = item.variants.find((v) => (v.culture ?? undefined) === this._culture) ??
|
|
222
|
+
item.variants[0];
|
|
223
|
+
return variant?.name ?? '';
|
|
224
|
+
};
|
|
225
|
+
_uSyncContentPreviewElement_renderTabButton = function _uSyncContentPreviewElement_renderTabButton(tab, active) {
|
|
226
|
+
const changed = __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_tabProperties).call(this, tab).some((p) => __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_valueStatus).call(this, p.property));
|
|
227
|
+
const label = tab.name || this.localize.termOrDefault('uSync_previewGenericTab', 'Generic');
|
|
228
|
+
return html `<uui-tab
|
|
229
|
+
label=${label}
|
|
230
|
+
?active=${active}
|
|
231
|
+
@click=${() => (this._activeTab = tab.name)}>
|
|
232
|
+
<span class="tab-label">
|
|
233
|
+
${label} ${changed ? html `<span class="dot changed"></span>` : nothing}
|
|
234
|
+
</span>
|
|
235
|
+
</uui-tab>`;
|
|
236
|
+
};
|
|
237
|
+
_uSyncContentPreviewElement_renderTab = function _uSyncContentPreviewElement_renderTab(item, tab) {
|
|
238
|
+
// inert rather than readonly: editors are shown as an editor would see them,
|
|
239
|
+
// but nothing in the preview can be changed.
|
|
240
|
+
return html `
|
|
241
|
+
<umb-property-dataset .value=${__classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_datasetValue).call(this, item)} inert>
|
|
242
|
+
${tab.properties.length ? html `<uui-box>${__classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_renderProperties).call(this, tab.properties)}</uui-box>` : nothing}
|
|
243
|
+
${repeat(tab.groups, (group) => group.name, (group) => html `<uui-box headline=${group.name}
|
|
244
|
+
>${__classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_renderProperties).call(this, group.properties)}</uui-box
|
|
245
|
+
>`)}
|
|
246
|
+
</umb-property-dataset>
|
|
247
|
+
`;
|
|
248
|
+
};
|
|
249
|
+
_uSyncContentPreviewElement_renderProperties = function _uSyncContentPreviewElement_renderProperties(properties) {
|
|
250
|
+
return repeat(properties, (entry) => entry.property.id, ({ property: p }) => {
|
|
251
|
+
const dataType = __classPrivateFieldGet(this, _uSyncContentPreviewElement_dataTypes, "f").get(p.dataType.id);
|
|
252
|
+
const status = __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_valueStatus).call(this, p);
|
|
253
|
+
return html `<div class="property ${status ?? ''}">
|
|
254
|
+
${dataType
|
|
255
|
+
? html `<umb-property
|
|
256
|
+
.alias=${p.alias}
|
|
257
|
+
.label=${p.name}
|
|
258
|
+
.description=${p.description ?? ''}
|
|
259
|
+
.propertyEditorUiAlias=${dataType.editorUiAlias}
|
|
260
|
+
.config=${dataType.values}
|
|
261
|
+
.appearance=${p.appearance}></umb-property>`
|
|
262
|
+
: html `<p class="empty">${p.name}</p>`}
|
|
263
|
+
</div>`;
|
|
264
|
+
});
|
|
265
|
+
};
|
|
266
|
+
_uSyncContentPreviewElement_visibleTabs = function _uSyncContentPreviewElement_visibleTabs(tabs) {
|
|
267
|
+
if (!this._onlyChanges)
|
|
268
|
+
return tabs;
|
|
269
|
+
const keep = (properties) => properties.filter((p) => __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_valueStatus).call(this, p.property));
|
|
270
|
+
return tabs
|
|
271
|
+
.map((tab) => ({
|
|
272
|
+
...tab,
|
|
273
|
+
properties: keep(tab.properties),
|
|
274
|
+
groups: tab.groups
|
|
275
|
+
.map((group) => ({ ...group, properties: keep(group.properties) }))
|
|
276
|
+
.filter((group) => group.properties.length > 0),
|
|
277
|
+
}))
|
|
278
|
+
.filter((tab) => tab.properties.length > 0 || tab.groups.length > 0);
|
|
279
|
+
};
|
|
280
|
+
_uSyncContentPreviewElement_tabProperties = function _uSyncContentPreviewElement_tabProperties(tab) {
|
|
281
|
+
return [...tab.properties, ...tab.groups.flatMap((g) => g.properties)];
|
|
282
|
+
};
|
|
283
|
+
_uSyncContentPreviewElement_datasetValue = function _uSyncContentPreviewElement_datasetValue(item) {
|
|
284
|
+
return item.values
|
|
285
|
+
.filter((v) => !v.segment && (!v.culture || v.culture === this._culture))
|
|
286
|
+
.map((v) => ({ alias: v.alias, value: v.value }));
|
|
287
|
+
};
|
|
288
|
+
_uSyncContentPreviewElement_value = function _uSyncContentPreviewElement_value(item, p) {
|
|
289
|
+
const culture = p.variesByCulture ? this._culture : undefined;
|
|
290
|
+
return item?.values.find((v) => v.alias === p.alias && !v.segment && (v.culture ?? undefined) === culture)?.value;
|
|
291
|
+
};
|
|
292
|
+
_uSyncContentPreviewElement_valueStatus = function _uSyncContentPreviewElement_valueStatus(p) {
|
|
293
|
+
const current = __classPrivateFieldGet(this, _uSyncContentPreviewElement_current, "f").item;
|
|
294
|
+
const incoming = __classPrivateFieldGet(this, _uSyncContentPreviewElement_incoming, "f").item;
|
|
295
|
+
if (!current || !incoming)
|
|
296
|
+
return undefined;
|
|
297
|
+
const before = __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_value).call(this, current, p);
|
|
298
|
+
const after = __classPrivateFieldGet(this, _uSyncContentPreviewElement_instances, "m", _uSyncContentPreviewElement_value).call(this, incoming, p);
|
|
299
|
+
if (deepEqual(normalise(before), normalise(after)))
|
|
300
|
+
return undefined;
|
|
301
|
+
if (isEmpty(before))
|
|
302
|
+
return 'added';
|
|
303
|
+
if (isEmpty(after))
|
|
304
|
+
return 'removed';
|
|
305
|
+
return 'changed';
|
|
306
|
+
};
|
|
307
|
+
uSyncContentPreviewElement.styles = css `
|
|
308
|
+
:host {
|
|
309
|
+
display: block;
|
|
310
|
+
container-type: inline-size;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/* the toolbar shares the headline row with the incoming side, on the right. */
|
|
314
|
+
.toolbar {
|
|
315
|
+
grid-column: 2;
|
|
316
|
+
grid-row: 1;
|
|
317
|
+
justify-self: end;
|
|
318
|
+
align-self: center;
|
|
319
|
+
z-index: 1;
|
|
320
|
+
display: flex;
|
|
321
|
+
flex-wrap: wrap;
|
|
322
|
+
align-items: center;
|
|
323
|
+
gap: var(--uui-size-space-4);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/* the two sides share rows (headline, info, tabs, content), so the
|
|
327
|
+
tab bars and properties line up even when the info boxes differ. */
|
|
328
|
+
.sides {
|
|
329
|
+
display: grid;
|
|
330
|
+
grid-template-columns: 1fr 1fr;
|
|
331
|
+
grid-template-rows: auto auto auto 1fr;
|
|
332
|
+
gap: var(--uui-size-space-4) var(--uui-size-space-5);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.side {
|
|
336
|
+
display: grid;
|
|
337
|
+
grid-row: span 4;
|
|
338
|
+
grid-template-rows: subgrid;
|
|
339
|
+
align-items: start;
|
|
340
|
+
min-width: 0;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.side.current {
|
|
344
|
+
grid-column: 1;
|
|
345
|
+
grid-row: 1 / span 4;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.side.incoming {
|
|
349
|
+
grid-column: 2;
|
|
350
|
+
grid-row: 1 / span 4;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.side > .info:not(:last-child) {
|
|
354
|
+
align-self: stretch;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
@container (max-width: 760px) {
|
|
358
|
+
.sides {
|
|
359
|
+
grid-template-columns: 1fr;
|
|
360
|
+
grid-template-rows: none;
|
|
361
|
+
row-gap: var(--uui-size-layout-1);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.side,
|
|
365
|
+
.side.current,
|
|
366
|
+
.side.incoming,
|
|
367
|
+
.toolbar {
|
|
368
|
+
grid-column: 1;
|
|
369
|
+
grid-row: auto;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.side {
|
|
373
|
+
display: flex;
|
|
374
|
+
flex-direction: column;
|
|
375
|
+
align-items: stretch;
|
|
376
|
+
gap: var(--uui-size-space-4);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.side > .side-headline {
|
|
380
|
+
align-self: auto;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
umb-property-dataset {
|
|
385
|
+
display: flex;
|
|
386
|
+
flex-direction: column;
|
|
387
|
+
gap: var(--uui-size-space-4);
|
|
388
|
+
min-width: 0;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.side-headline {
|
|
392
|
+
align-self: center;
|
|
393
|
+
margin: 0;
|
|
394
|
+
font-size: var(--uui-type-small-size);
|
|
395
|
+
text-transform: uppercase;
|
|
396
|
+
letter-spacing: 0.04em;
|
|
397
|
+
color: var(--uui-color-text-alt);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.headline {
|
|
401
|
+
display: flex;
|
|
402
|
+
align-items: center;
|
|
403
|
+
gap: var(--uui-size-space-3);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.meta {
|
|
407
|
+
display: grid;
|
|
408
|
+
grid-template-columns: max-content 1fr;
|
|
409
|
+
align-items: center;
|
|
410
|
+
gap: var(--uui-size-space-2) var(--uui-size-space-5);
|
|
411
|
+
margin: 0 0 var(--uui-size-space-2);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.meta dt {
|
|
415
|
+
font-weight: 700;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.tags {
|
|
419
|
+
display: inline-flex;
|
|
420
|
+
flex-wrap: wrap;
|
|
421
|
+
gap: var(--uui-size-space-2);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.meta dd {
|
|
425
|
+
display: flex;
|
|
426
|
+
flex-wrap: wrap;
|
|
427
|
+
gap: var(--uui-size-space-2);
|
|
428
|
+
margin: 0;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/* a changed field gets a soft highlight, spread with a shadow so the text doesn't move. */
|
|
432
|
+
.changed:not(.property):not(.dot) {
|
|
433
|
+
background: color-mix(in srgb, var(--uui-color-warning) 35%, transparent);
|
|
434
|
+
border-radius: var(--uui-border-radius);
|
|
435
|
+
box-shadow: 0 0 0 var(--uui-size-space-1)
|
|
436
|
+
color-mix(in srgb, var(--uui-color-warning) 35%, transparent);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
uui-tab-group {
|
|
440
|
+
--uui-tab-divider: var(--uui-color-border);
|
|
441
|
+
border-bottom: 1px solid var(--uui-color-border);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.tab-label {
|
|
445
|
+
display: inline-flex;
|
|
446
|
+
align-items: center;
|
|
447
|
+
gap: var(--uui-size-space-2);
|
|
448
|
+
white-space: nowrap;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.dot {
|
|
452
|
+
display: inline-block;
|
|
453
|
+
width: 8px;
|
|
454
|
+
height: 8px;
|
|
455
|
+
border-radius: 50%;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.dot.changed {
|
|
459
|
+
background: var(--uui-color-warning);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/* marked with an inset bar rather than a border, so the content doesn't shift. */
|
|
463
|
+
.property.added {
|
|
464
|
+
box-shadow: inset 3px 0 0 var(--uui-color-positive);
|
|
465
|
+
background: color-mix(in srgb, var(--uui-color-positive) 6%, transparent);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.property.removed {
|
|
469
|
+
box-shadow: inset 3px 0 0 var(--uui-color-danger);
|
|
470
|
+
background: color-mix(in srgb, var(--uui-color-danger) 6%, transparent);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.property.changed {
|
|
474
|
+
box-shadow: inset 3px 0 0 var(--uui-color-warning);
|
|
475
|
+
background: color-mix(in srgb, var(--uui-color-warning) 10%, transparent);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/* properties run edge to edge in their box, like the backoffice editor. */
|
|
479
|
+
.property {
|
|
480
|
+
padding: 0 var(--uui-size-space-5);
|
|
481
|
+
margin: 0 calc(-1 * var(--uui-size-space-5));
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.property:first-child {
|
|
485
|
+
margin-top: calc(-1 * var(--uui-size-space-5));
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.property:last-child {
|
|
489
|
+
margin-bottom: calc(-1 * var(--uui-size-space-5));
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.property + .property {
|
|
493
|
+
border-top: 1px solid var(--uui-color-divider);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/* umb-property pads itself for a full workspace, tighten it up here. */
|
|
497
|
+
umb-property {
|
|
498
|
+
--uui-size-layout-1: var(--uui-size-space-4);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.empty {
|
|
502
|
+
margin: 0;
|
|
503
|
+
color: var(--uui-color-text-alt);
|
|
504
|
+
}
|
|
505
|
+
`;
|
|
506
|
+
__decorate([
|
|
507
|
+
property({ type: Object })
|
|
508
|
+
], uSyncContentPreviewElement.prototype, "preview", void 0);
|
|
509
|
+
__decorate([
|
|
510
|
+
state()
|
|
511
|
+
], uSyncContentPreviewElement.prototype, "_activeTab", void 0);
|
|
512
|
+
__decorate([
|
|
513
|
+
state()
|
|
514
|
+
], uSyncContentPreviewElement.prototype, "_culture", void 0);
|
|
515
|
+
__decorate([
|
|
516
|
+
state()
|
|
517
|
+
], uSyncContentPreviewElement.prototype, "_onlyChanges", void 0);
|
|
518
|
+
uSyncContentPreviewElement = __decorate([
|
|
519
|
+
customElement('usync-content-preview')
|
|
520
|
+
], uSyncContentPreviewElement);
|
|
521
|
+
export { uSyncContentPreviewElement };
|
|
522
|
+
/** values that mean "nothing set" compare as equal */
|
|
523
|
+
function normalise(value) {
|
|
524
|
+
return isEmpty(value) ? undefined : value;
|
|
525
|
+
}
|
|
526
|
+
function isEmpty(value) {
|
|
527
|
+
return (value === undefined ||
|
|
528
|
+
value === null ||
|
|
529
|
+
value === '' ||
|
|
530
|
+
(Array.isArray(value) && value.length === 0));
|
|
531
|
+
}
|
|
532
|
+
export default uSyncContentPreviewElement;
|