@jumoo/usync 0.0.0-stage → 17.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENCE +373 -0
- package/README.md +10 -3
- package/dist/api/client/client.gen.d.ts +2 -0
- package/dist/api/client/client.gen.js +216 -0
- package/dist/api/client/index.d.ts +10 -0
- package/dist/api/client/index.js +6 -0
- package/dist/api/client/types.gen.d.ts +120 -0
- package/dist/api/client/types.gen.js +2 -0
- package/dist/api/client/utils.gen.d.ts +37 -0
- package/dist/api/client/utils.gen.js +230 -0
- package/dist/api/client.gen.d.ts +12 -0
- package/dist/api/client.gen.js +4 -0
- package/dist/api/core/auth.gen.d.ts +25 -0
- package/dist/api/core/auth.gen.js +14 -0
- package/dist/api/core/bodySerializer.gen.d.ts +25 -0
- package/dist/api/core/bodySerializer.gen.js +57 -0
- package/dist/api/core/params.gen.d.ts +43 -0
- package/dist/api/core/params.gen.js +109 -0
- package/dist/api/core/pathSerializer.gen.d.ts +33 -0
- package/dist/api/core/pathSerializer.gen.js +106 -0
- package/dist/api/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/api/core/queryKeySerializer.gen.js +92 -0
- package/dist/api/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/api/core/serverSentEvents.gen.js +132 -0
- package/dist/api/core/types.gen.d.ts +83 -0
- package/dist/api/core/types.gen.js +2 -0
- package/dist/api/core/utils.gen.d.ts +19 -0
- package/dist/api/core/utils.gen.js +87 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +4 -0
- package/dist/api/sdk.gen.d.ts +44 -0
- package/dist/api/sdk.gen.js +147 -0
- package/dist/api/types.gen.d.ts +567 -0
- package/dist/api/types.gen.js +47 -0
- package/dist/components/events.d.ts +11 -0
- package/dist/components/events.js +11 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +9 -0
- package/dist/components/usync-action-box.d.ts +22 -0
- package/dist/components/usync-action-box.js +119 -0
- package/dist/components/usync-change-detail.d.ts +31 -0
- package/dist/components/usync-change-detail.js +709 -0
- package/dist/components/usync-change-view.d.ts +22 -0
- package/dist/components/usync-change-view.js +125 -0
- package/dist/components/usync-progress-box.d.ts +20 -0
- package/dist/components/usync-progress-box.js +223 -0
- package/dist/components/usync-result-row.d.ts +15 -0
- package/dist/components/usync-result-row.js +133 -0
- package/dist/components/usync-results-group-view.d.ts +19 -0
- package/dist/components/usync-results-group-view.js +110 -0
- package/dist/components/usync-results-view.d.ts +17 -0
- package/dist/components/usync-results-view.js +176 -0
- package/dist/components/usync-sync-file-info-view.d.ts +15 -0
- package/dist/components/usync-sync-file-info-view.js +62 -0
- package/dist/conditions/constants.d.ts +1 -0
- package/dist/conditions/constants.js +1 -0
- package/dist/conditions/index.d.ts +2 -0
- package/dist/conditions/index.js +2 -0
- package/dist/conditions/legacy-files.condition.d.ts +10 -0
- package/dist/conditions/legacy-files.condition.js +16 -0
- package/dist/conditions/manifest.d.ts +1 -0
- package/dist/conditions/manifest.js +18 -0
- package/dist/conditions/new-section.condition.d.ts +8 -0
- package/dist/conditions/new-section.condition.js +48 -0
- package/dist/constants.d.ts +30 -0
- package/dist/constants.js +38 -0
- package/dist/dialogs/details-modal-element.d.ts +18 -0
- package/dist/dialogs/details-modal-element.js +98 -0
- package/dist/dialogs/details-modal-token.d.ts +10 -0
- package/dist/dialogs/details-modal-token.js +7 -0
- package/dist/dialogs/error-modal-element.d.ts +7 -0
- package/dist/dialogs/error-modal-element.js +54 -0
- package/dist/dialogs/error-modal-token.d.ts +9 -0
- package/dist/dialogs/error-modal-token.js +6 -0
- package/dist/dialogs/index.d.ts +6 -0
- package/dist/dialogs/index.js +6 -0
- package/dist/dialogs/legacy-modal-element.d.ts +13 -0
- package/dist/dialogs/legacy-modal-element.js +78 -0
- package/dist/dialogs/manifest.d.ts +1 -0
- package/dist/dialogs/manifest.js +25 -0
- package/dist/dialogs/single-import-modal.element.d.ts +13 -0
- package/dist/dialogs/single-import-modal.element.js +105 -0
- package/dist/dialogs/single-import-modal.token.d.ts +9 -0
- package/dist/dialogs/single-import-modal.token.js +6 -0
- package/dist/exports.d.ts +10 -0
- package/dist/exports.js +10 -0
- package/dist/external/signalr/index.d.ts +1 -0
- package/dist/external/signalr/index.js +1 -0
- package/dist/hey-api.d.ts +11 -0
- package/dist/hey-api.js +14 -0
- package/dist/icons/icons.d.ts +5 -0
- package/dist/icons/icons.js +6 -0
- package/dist/icons/manifest.d.ts +1 -0
- package/dist/icons/manifest.js +7 -0
- package/dist/icons/svg/logo.d.ts +2 -0
- package/dist/icons/svg/logo.js +21 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +11 -0
- package/dist/lang/files/da-dk.d.ts +130 -0
- package/dist/lang/files/da-dk.js +141 -0
- package/dist/lang/files/de-de.d.ts +130 -0
- package/dist/lang/files/de-de.js +141 -0
- package/dist/lang/files/en-us.d.ts +161 -0
- package/dist/lang/files/en-us.js +172 -0
- package/dist/lang/files/es-es.d.ts +130 -0
- package/dist/lang/files/es-es.js +141 -0
- package/dist/lang/files/fr-fr.d.ts +130 -0
- package/dist/lang/files/fr-fr.js +141 -0
- package/dist/lang/files/nl-nl.d.ts +130 -0
- package/dist/lang/files/nl-nl.js +141 -0
- package/dist/lang/manifest.d.ts +1 -0
- package/dist/lang/manifest.js +63 -0
- package/dist/manifests.d.ts +1 -0
- package/dist/manifests.js +14 -0
- package/dist/repository/SyncAction.respositoy.d.ts +101 -0
- package/dist/repository/SyncAction.respositoy.js +125 -0
- package/dist/repository/index.d.ts +4 -0
- package/dist/repository/index.js +4 -0
- package/dist/repository/sources/SyncAction.source.d.ts +37 -0
- package/dist/repository/sources/SyncAction.source.js +57 -0
- package/dist/repository/sources/SyncMigration.source.d.ts +13 -0
- package/dist/repository/sources/SyncMigration.source.js +30 -0
- package/dist/repository/sources/SyncSettings.source.d.ts +23 -0
- package/dist/repository/sources/SyncSettings.source.js +33 -0
- package/dist/signalr/index.d.ts +3 -0
- package/dist/signalr/index.js +3 -0
- package/dist/signalr/signalr-reconnect-policy.d.ts +11 -0
- package/dist/signalr/signalr-reconnect-policy.js +14 -0
- package/dist/signalr/signalr.context.d.ts +34 -0
- package/dist/signalr/signalr.context.js +110 -0
- package/dist/signalr/signalr.context.token.d.ts +3 -0
- package/dist/signalr/signalr.context.token.js +2 -0
- package/dist/signalr/types.d.ts +21 -0
- package/dist/signalr/types.js +1 -0
- package/dist/tree/constants.d.ts +1 -0
- package/dist/tree/constants.js +1 -0
- package/dist/tree/index.d.ts +2 -0
- package/dist/tree/index.js +2 -0
- package/dist/tree/manifest.d.ts +1 -0
- package/dist/tree/manifest.js +92 -0
- package/dist/tree/types.d.ts +14 -0
- package/dist/tree/types.js +1 -0
- package/dist/tree/usync.menu-element.d.ts +13 -0
- package/dist/tree/usync.menu-element.js +74 -0
- package/dist/utils/diff/change-name.d.ts +13 -0
- package/dist/utils/diff/change-name.js +30 -0
- package/dist/utils/diff/classify-change.d.ts +21 -0
- package/dist/utils/diff/classify-change.js +111 -0
- package/dist/utils/diff/deep-equal.d.ts +13 -0
- package/dist/utils/diff/deep-equal.js +57 -0
- package/dist/utils/diff/format-value.d.ts +36 -0
- package/dist/utils/diff/format-value.js +88 -0
- package/dist/utils/diff/index.d.ts +7 -0
- package/dist/utils/diff/index.js +7 -0
- package/dist/utils/diff/json-diff.d.ts +34 -0
- package/dist/utils/diff/json-diff.js +300 -0
- package/dist/utils/diff/line-diff.d.ts +16 -0
- package/dist/utils/diff/line-diff.js +199 -0
- package/dist/utils/diff/types.d.ts +62 -0
- package/dist/utils/diff/types.js +12 -0
- package/dist/workspace/components/events.d.ts +31 -0
- package/dist/workspace/components/events.js +54 -0
- package/dist/workspace/components/index.d.ts +3 -0
- package/dist/workspace/components/index.js +3 -0
- package/dist/workspace/components/usync-action-button.d.ts +19 -0
- package/dist/workspace/components/usync-action-button.js +113 -0
- package/dist/workspace/components/usync-file-picker.element.d.ts +23 -0
- package/dist/workspace/components/usync-file-picker.element.js +106 -0
- package/dist/workspace/components/usync-file-upload.element.d.ts +21 -0
- package/dist/workspace/components/usync-file-upload.element.js +121 -0
- package/dist/workspace/dialogs/import-modal.element.d.ts +11 -0
- package/dist/workspace/dialogs/import-modal.element.js +75 -0
- package/dist/workspace/dialogs/import-modal.token.d.ts +6 -0
- package/dist/workspace/dialogs/import-modal.token.js +6 -0
- package/dist/workspace/dialogs/index.d.ts +2 -0
- package/dist/workspace/dialogs/index.js +2 -0
- package/dist/workspace/dialogs/manifest.d.ts +1 -0
- package/dist/workspace/dialogs/manifest.js +7 -0
- package/dist/workspace/index.d.ts +3 -0
- package/dist/workspace/index.js +3 -0
- package/dist/workspace/manifest.d.ts +3 -0
- package/dist/workspace/manifest.js +112 -0
- package/dist/workspace/types.d.ts +12 -0
- package/dist/workspace/types.js +1 -0
- package/dist/workspace/views/addons/addons.element.d.ts +7 -0
- package/dist/workspace/views/addons/addons.element.js +117 -0
- package/dist/workspace/views/default/default.element.d.ts +31 -0
- package/dist/workspace/views/default/default.element.js +466 -0
- package/dist/workspace/views/legacy/legacy.element.d.ts +14 -0
- package/dist/workspace/views/legacy/legacy.element.js +187 -0
- package/dist/workspace/views/settings/components/usyncSettingItem.element.d.ts +15 -0
- package/dist/workspace/views/settings/components/usyncSettingItem.element.js +96 -0
- package/dist/workspace/views/settings/settings.element.d.ts +17 -0
- package/dist/workspace/views/settings/settings.element.js +174 -0
- package/dist/workspace/workspace.context.d.ts +74 -0
- package/dist/workspace/workspace.context.js +448 -0
- package/dist/workspace/workspace.element.d.ts +17 -0
- package/dist/workspace/workspace.element.js +69 -0
- package/package.json +70 -6
|
@@ -0,0 +1,176 @@
|
|
|
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 _uSyncResultsView_instances, _uSyncResultsView_modalContext, _uSyncResultsView_toggleShowAll, _uSyncResultsView_showDetail;
|
|
19
|
+
import { LitElement, html, customElement, property, css, state, nothing, } from '@umbraco-cms/backoffice/external/lit';
|
|
20
|
+
import { ChangeType } from '@jumoo/uSync';
|
|
21
|
+
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
|
|
22
|
+
import { UMB_MODAL_MANAGER_CONTEXT, } from '@umbraco-cms/backoffice/modal';
|
|
23
|
+
import { USYNC_DETAILS_MODAL } from '@jumoo/uSync';
|
|
24
|
+
let uSyncResultsView = class uSyncResultsView extends UmbElementMixin(LitElement) {
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
_uSyncResultsView_instances.add(this);
|
|
28
|
+
_uSyncResultsView_modalContext.set(this, void 0);
|
|
29
|
+
this.results = [];
|
|
30
|
+
this.hideResultBar = false;
|
|
31
|
+
this.hideActions = false;
|
|
32
|
+
this.showAll = false;
|
|
33
|
+
this.changeCount = 0;
|
|
34
|
+
this.consumeContext(UMB_MODAL_MANAGER_CONTEXT, (_instance) => {
|
|
35
|
+
__classPrivateFieldSet(this, _uSyncResultsView_modalContext, _instance, "f");
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
groupBy(arr, fn) {
|
|
39
|
+
return arr.reduce((prev, curr) => {
|
|
40
|
+
const groupKey = fn(curr);
|
|
41
|
+
const group = prev[groupKey] || [];
|
|
42
|
+
group.push(curr);
|
|
43
|
+
return { ...prev, [groupKey]: group };
|
|
44
|
+
}, {});
|
|
45
|
+
}
|
|
46
|
+
render() {
|
|
47
|
+
this.changeCount =
|
|
48
|
+
this.results?.filter((r) => r.change !== ChangeType.NO_CHANGE).length ?? 0;
|
|
49
|
+
const groups = this.groupBy(this.results || [], (result) => result.itemType);
|
|
50
|
+
const groupsHtml = [];
|
|
51
|
+
for (const key in groups) {
|
|
52
|
+
const groupChanges = groups[key].filter((r) => r.change !== ChangeType.NO_CHANGE).length ?? 0;
|
|
53
|
+
if (groupChanges === 0 && !this.showAll)
|
|
54
|
+
continue;
|
|
55
|
+
const groupHtml = html `<usync-result-group
|
|
56
|
+
.groupName=${key}
|
|
57
|
+
.results=${groups[key]}
|
|
58
|
+
.showAll=${this.showAll}
|
|
59
|
+
@show-detail=${__classPrivateFieldGet(this, _uSyncResultsView_instances, "m", _uSyncResultsView_showDetail)}></usync-result-group> `;
|
|
60
|
+
groupsHtml.push(groupHtml);
|
|
61
|
+
}
|
|
62
|
+
return this.changeCount == 0 && !this.showAll
|
|
63
|
+
? html `
|
|
64
|
+
${this.renderResultBar(this.results?.length || 0, this.changeCount)}
|
|
65
|
+
<div class="empty">
|
|
66
|
+
<umb-localize key="uSync_noChange"></umb-localize>
|
|
67
|
+
</div>
|
|
68
|
+
`
|
|
69
|
+
: html `<div id="result-box">
|
|
70
|
+
${this.renderResultBar(this.results?.length || 0, this.changeCount)}
|
|
71
|
+
${groupsHtml}
|
|
72
|
+
</div>`;
|
|
73
|
+
}
|
|
74
|
+
renderResultBar(count, changes) {
|
|
75
|
+
if (this.hideResultBar)
|
|
76
|
+
return nothing;
|
|
77
|
+
const localKey = changes === 0 ? 'uSync_noChangeCount' : 'uSync_changeCount';
|
|
78
|
+
return html `<div class="result-header">
|
|
79
|
+
<uui-toggle
|
|
80
|
+
.label=${this.localize.termOrDefault('uSync_showAll', 'Show all items')}
|
|
81
|
+
?checked=${this.showAll}
|
|
82
|
+
@change=${__classPrivateFieldGet(this, _uSyncResultsView_instances, "m", _uSyncResultsView_toggleShowAll)}></uui-toggle>
|
|
83
|
+
<umb-localize .key=${localKey} .args=${[count, changes]}
|
|
84
|
+
>${changes}/${count} items</umb-localize
|
|
85
|
+
>
|
|
86
|
+
</div>`;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
_uSyncResultsView_modalContext = new WeakMap();
|
|
90
|
+
_uSyncResultsView_instances = new WeakSet();
|
|
91
|
+
_uSyncResultsView_toggleShowAll = function _uSyncResultsView_toggleShowAll() {
|
|
92
|
+
this.showAll = !this.showAll;
|
|
93
|
+
};
|
|
94
|
+
_uSyncResultsView_showDetail = async function _uSyncResultsView_showDetail(e) {
|
|
95
|
+
console.debug('Showing detail for action:', e.action);
|
|
96
|
+
if (e.action.change == ChangeType.EXPORT)
|
|
97
|
+
return;
|
|
98
|
+
const detailsModal = __classPrivateFieldGet(this, _uSyncResultsView_modalContext, "f")?.open(this, USYNC_DETAILS_MODAL, {
|
|
99
|
+
data: {
|
|
100
|
+
item: e.action,
|
|
101
|
+
showActions: !this.hideActions &&
|
|
102
|
+
(e.action.change == ChangeType.CREATE ||
|
|
103
|
+
e.action.change == ChangeType.UPDATE ||
|
|
104
|
+
e.action.change == ChangeType.IMPORT),
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
const data = await detailsModal?.onSubmit().catch(() => {
|
|
108
|
+
return;
|
|
109
|
+
});
|
|
110
|
+
if (!data)
|
|
111
|
+
return;
|
|
112
|
+
};
|
|
113
|
+
uSyncResultsView.styles = css `
|
|
114
|
+
:host {
|
|
115
|
+
display: block;
|
|
116
|
+
margin: var(--uui-size-space-4) 0;
|
|
117
|
+
display: flex;
|
|
118
|
+
flex-direction: column;
|
|
119
|
+
gap: var(--uui-size-space-4);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
#result-box {
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
gap: var(--uui-size-space-4);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
uui-table {
|
|
129
|
+
position: relative;
|
|
130
|
+
z-index: 100;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.result-header {
|
|
134
|
+
display: flex;
|
|
135
|
+
justify-content: space-between;
|
|
136
|
+
padding: var(--uui-size-space-4);
|
|
137
|
+
border: 1px solid var(--uui-color-border);
|
|
138
|
+
padding: var(--uui-size-space-4);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.result-header h3 {
|
|
142
|
+
margin: 0;
|
|
143
|
+
padding: 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.empty {
|
|
147
|
+
padding: var(--uui-size-20);
|
|
148
|
+
font-size: var(--uui-type-h5-size);
|
|
149
|
+
text-align: center;
|
|
150
|
+
font-weight: 900;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.error {
|
|
154
|
+
background-color: #fce4ec;
|
|
155
|
+
}
|
|
156
|
+
`;
|
|
157
|
+
__decorate([
|
|
158
|
+
property({ type: Array })
|
|
159
|
+
], uSyncResultsView.prototype, "results", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
property({ type: Boolean })
|
|
162
|
+
], uSyncResultsView.prototype, "hideResultBar", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
property({ type: Boolean })
|
|
165
|
+
], uSyncResultsView.prototype, "hideActions", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
state()
|
|
168
|
+
], uSyncResultsView.prototype, "showAll", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
state()
|
|
171
|
+
], uSyncResultsView.prototype, "changeCount", void 0);
|
|
172
|
+
uSyncResultsView = __decorate([
|
|
173
|
+
customElement('usync-results')
|
|
174
|
+
], uSyncResultsView);
|
|
175
|
+
export { uSyncResultsView };
|
|
176
|
+
export default uSyncResultsView;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
|
2
|
+
import { SyncFileVersionCheckResult } from '../api';
|
|
3
|
+
import { nothing } from '@umbraco-cms/backoffice/external/lit';
|
|
4
|
+
export declare class uSyncSyncFileInfoView extends UmbLitElement {
|
|
5
|
+
#private;
|
|
6
|
+
_syncFileInfo?: SyncFileVersionCheckResult;
|
|
7
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
8
|
+
static styles?: import("lit").CSSResult[] | undefined;
|
|
9
|
+
}
|
|
10
|
+
export default uSyncSyncFileInfoView;
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
'usync-sync-file-info': uSyncSyncFileInfoView;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
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");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _uSyncSyncFileInfoView_instances, _uSyncSyncFileInfoView_renderHmacMismatch, _uSyncSyncFileInfoView_renderFormatMismatch;
|
|
13
|
+
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
|
14
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
15
|
+
import { css, html, nothing } from '@umbraco-cms/backoffice/external/lit';
|
|
16
|
+
let uSyncSyncFileInfoView = class uSyncSyncFileInfoView extends UmbLitElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
_uSyncSyncFileInfoView_instances.add(this);
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
if (!this._syncFileInfo)
|
|
23
|
+
return nothing;
|
|
24
|
+
return html `${__classPrivateFieldGet(this, _uSyncSyncFileInfoView_instances, "m", _uSyncSyncFileInfoView_renderHmacMismatch).call(this)} ${__classPrivateFieldGet(this, _uSyncSyncFileInfoView_instances, "m", _uSyncSyncFileInfoView_renderFormatMismatch).call(this)}`;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
_uSyncSyncFileInfoView_instances = new WeakSet();
|
|
28
|
+
_uSyncSyncFileInfoView_renderHmacMismatch = function _uSyncSyncFileInfoView_renderHmacMismatch() {
|
|
29
|
+
if (!this._syncFileInfo)
|
|
30
|
+
return nothing;
|
|
31
|
+
if (this._syncFileInfo.hmacMatch)
|
|
32
|
+
return nothing;
|
|
33
|
+
return html `<div class="banner">
|
|
34
|
+
<umb-localize key="uSync_hmacMismatch"></umb-localize>
|
|
35
|
+
</div>`;
|
|
36
|
+
};
|
|
37
|
+
_uSyncSyncFileInfoView_renderFormatMismatch = function _uSyncSyncFileInfoView_renderFormatMismatch() {
|
|
38
|
+
if (!this._syncFileInfo)
|
|
39
|
+
return nothing;
|
|
40
|
+
if (this._syncFileInfo.isCurrent)
|
|
41
|
+
return nothing;
|
|
42
|
+
return html `<div class="banner">
|
|
43
|
+
<umb-localize key="uSync_formatMismatch"></umb-localize>
|
|
44
|
+
</div>`;
|
|
45
|
+
};
|
|
46
|
+
uSyncSyncFileInfoView.styles = [
|
|
47
|
+
css `
|
|
48
|
+
.banner {
|
|
49
|
+
padding: var(--uui-size-space-2) var(--uui-size-space-4);
|
|
50
|
+
margin: 0 0 var(--uui-size-space-4);
|
|
51
|
+
background-color: var(--uui-color-surface);
|
|
52
|
+
}
|
|
53
|
+
`,
|
|
54
|
+
];
|
|
55
|
+
__decorate([
|
|
56
|
+
property({ type: Object })
|
|
57
|
+
], uSyncSyncFileInfoView.prototype, "_syncFileInfo", void 0);
|
|
58
|
+
uSyncSyncFileInfoView = __decorate([
|
|
59
|
+
customElement('usync-sync-file-info')
|
|
60
|
+
], uSyncSyncFileInfoView);
|
|
61
|
+
export { uSyncSyncFileInfoView };
|
|
62
|
+
export default uSyncSyncFileInfoView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const USYNC_CONDITION_NEW_SECTION = "usync.condition.new-section";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const USYNC_CONDITION_NEW_SECTION = 'usync.condition.new-section';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
|
2
|
+
import { UmbConditionConfigBase, UmbConditionControllerArguments } from '@umbraco-cms/backoffice/extension-api';
|
|
3
|
+
import { UmbConditionBase } from '@umbraco-cms/backoffice/extension-registry';
|
|
4
|
+
export type SyncLegacyFilesConditionConfig = UmbConditionConfigBase & {
|
|
5
|
+
hasLegacyFiles: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare class SyncLegacyFilesCondition extends UmbConditionBase<SyncLegacyFilesConditionConfig> {
|
|
8
|
+
config: SyncLegacyFilesConditionConfig;
|
|
9
|
+
constructor(host: UmbControllerHost, args: UmbConditionControllerArguments<SyncLegacyFilesConditionConfig>);
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { UmbConditionBase } from '@umbraco-cms/backoffice/extension-registry';
|
|
2
|
+
import { USYNC_CORE_CONTEXT_TOKEN } from '@jumoo/uSync';
|
|
3
|
+
export class SyncLegacyFilesCondition extends UmbConditionBase {
|
|
4
|
+
constructor(host, args) {
|
|
5
|
+
super(host, args);
|
|
6
|
+
this.config = args.config;
|
|
7
|
+
this.consumeContext(USYNC_CORE_CONTEXT_TOKEN, (_instance) => {
|
|
8
|
+
if (!_instance)
|
|
9
|
+
return;
|
|
10
|
+
// consuming the context means it only happens when the context exists.
|
|
11
|
+
_instance.checkLegacy().then((response) => {
|
|
12
|
+
this.permitted = response?.hasLegacy ?? false;
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const manifests: UmbExtensionManifest[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SyncLegacyFilesCondition } from '@jumoo/uSync';
|
|
2
|
+
import { uSyncConstants } from '@jumoo/uSync';
|
|
3
|
+
import { USYNC_CONDITION_NEW_SECTION } from './constants';
|
|
4
|
+
import { SyncNewSectionCondition } from './new-section.condition';
|
|
5
|
+
export const manifests = [
|
|
6
|
+
{
|
|
7
|
+
type: 'condition',
|
|
8
|
+
alias: uSyncConstants.conditions.legacy,
|
|
9
|
+
name: 'uSync Legacy Files Condition',
|
|
10
|
+
api: SyncLegacyFilesCondition,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
type: 'condition',
|
|
14
|
+
alias: USYNC_CONDITION_NEW_SECTION,
|
|
15
|
+
name: 'uSync New Section Condition',
|
|
16
|
+
api: SyncNewSectionCondition,
|
|
17
|
+
},
|
|
18
|
+
];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
|
2
|
+
import { UmbConditionConfigBase, UmbConditionControllerArguments } from '@umbraco-cms/backoffice/extension-api';
|
|
3
|
+
import { UmbConditionBase } from '@umbraco-cms/backoffice/extension-registry';
|
|
4
|
+
export type SyncNewSectionConditionConfig = UmbConditionConfigBase & {};
|
|
5
|
+
export declare class SyncNewSectionCondition extends UmbConditionBase<SyncNewSectionConditionConfig> {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(host: UmbControllerHost, args: UmbConditionControllerArguments<SyncNewSectionConditionConfig>);
|
|
8
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
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");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
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");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _SyncNewSectionCondition_instances, _SyncNewSectionCondition_currentSection, _SyncNewSectionCondition_allSections, _SyncNewSectionCondition_checkPermission;
|
|
13
|
+
import { UmbExtensionsManifestInitializer, } from '@umbraco-cms/backoffice/extension-api';
|
|
14
|
+
import { UmbConditionBase, umbExtensionsRegistry, } from '@umbraco-cms/backoffice/extension-registry';
|
|
15
|
+
import { UMB_SECTION_CONTEXT } from '@umbraco-cms/backoffice/section';
|
|
16
|
+
import { USYNC_SECTION_ALIAS } from '../tree/constants';
|
|
17
|
+
export class SyncNewSectionCondition extends UmbConditionBase {
|
|
18
|
+
constructor(host, args) {
|
|
19
|
+
super(host, args);
|
|
20
|
+
_SyncNewSectionCondition_instances.add(this);
|
|
21
|
+
_SyncNewSectionCondition_currentSection.set(this, void 0);
|
|
22
|
+
_SyncNewSectionCondition_allSections.set(this, void 0);
|
|
23
|
+
new UmbExtensionsManifestInitializer(this, umbExtensionsRegistry, 'section', () => true, async (sections) => {
|
|
24
|
+
__classPrivateFieldSet(this, _SyncNewSectionCondition_allSections, sections.map((section) => section.alias), "f");
|
|
25
|
+
this.permitted = __classPrivateFieldGet(this, _SyncNewSectionCondition_instances, "m", _SyncNewSectionCondition_checkPermission).call(this);
|
|
26
|
+
}, 'uSyncAllSectionsManifestFilter');
|
|
27
|
+
this.consumeContext(UMB_SECTION_CONTEXT, (_context) => {
|
|
28
|
+
if (!_context)
|
|
29
|
+
return;
|
|
30
|
+
this.observe(_context.alias, (_alias) => {
|
|
31
|
+
__classPrivateFieldSet(this, _SyncNewSectionCondition_currentSection, _alias, "f");
|
|
32
|
+
this.permitted = __classPrivateFieldGet(this, _SyncNewSectionCondition_instances, "m", _SyncNewSectionCondition_checkPermission).call(this);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
_SyncNewSectionCondition_currentSection = new WeakMap(), _SyncNewSectionCondition_allSections = new WeakMap(), _SyncNewSectionCondition_instances = new WeakSet(), _SyncNewSectionCondition_checkPermission = function _SyncNewSectionCondition_checkPermission() {
|
|
38
|
+
if (!__classPrivateFieldGet(this, _SyncNewSectionCondition_currentSection, "f"))
|
|
39
|
+
return false;
|
|
40
|
+
if (!__classPrivateFieldGet(this, _SyncNewSectionCondition_allSections, "f"))
|
|
41
|
+
return false;
|
|
42
|
+
// if the new section isn't defined, this will still show in settings.
|
|
43
|
+
if (!__classPrivateFieldGet(this, _SyncNewSectionCondition_allSections, "f").includes(USYNC_SECTION_ALIAS))
|
|
44
|
+
return true;
|
|
45
|
+
if (__classPrivateFieldGet(this, _SyncNewSectionCondition_currentSection, "f") === USYNC_SECTION_ALIAS)
|
|
46
|
+
return true;
|
|
47
|
+
return false;
|
|
48
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const uSyncConstants: {
|
|
2
|
+
name: string;
|
|
3
|
+
path: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
menuName: string;
|
|
6
|
+
menuAlias: string;
|
|
7
|
+
version: string;
|
|
8
|
+
conditions: {
|
|
9
|
+
legacy: string;
|
|
10
|
+
};
|
|
11
|
+
workspace: {
|
|
12
|
+
alias: string;
|
|
13
|
+
rootElement: string;
|
|
14
|
+
elementName: string;
|
|
15
|
+
contextAlias: string;
|
|
16
|
+
defaultView: {
|
|
17
|
+
alias: string;
|
|
18
|
+
};
|
|
19
|
+
settingView: {
|
|
20
|
+
alias: string;
|
|
21
|
+
};
|
|
22
|
+
addOnView: {
|
|
23
|
+
alias: string;
|
|
24
|
+
};
|
|
25
|
+
legacyView: {
|
|
26
|
+
alias: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare const uSyncTimeFormatOptions: Intl.DateTimeFormatOptions;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const _constants = {
|
|
2
|
+
name: 'uSync',
|
|
3
|
+
path: 'usync',
|
|
4
|
+
icon: 'icon-infinity',
|
|
5
|
+
menuName: 'Syncronisation',
|
|
6
|
+
menuAlias: 'usync.menu',
|
|
7
|
+
version: '17.x',
|
|
8
|
+
conditions: {
|
|
9
|
+
legacy: 'usync.legacy.condition',
|
|
10
|
+
},
|
|
11
|
+
workspace: {
|
|
12
|
+
alias: 'usync.workspace',
|
|
13
|
+
rootElement: 'usync-root',
|
|
14
|
+
elementName: 'usync-workspace-root',
|
|
15
|
+
contextAlias: 'usync.workspace.context',
|
|
16
|
+
defaultView: {
|
|
17
|
+
alias: 'usync.workspace.default',
|
|
18
|
+
},
|
|
19
|
+
settingView: {
|
|
20
|
+
alias: 'usync.workspace.settings',
|
|
21
|
+
},
|
|
22
|
+
addOnView: {
|
|
23
|
+
alias: 'usync.workspace.addons',
|
|
24
|
+
},
|
|
25
|
+
legacyView: {
|
|
26
|
+
alias: 'usync.workspace.legacy',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export const uSyncConstants = _constants;
|
|
31
|
+
export const uSyncTimeFormatOptions = {
|
|
32
|
+
year: 'numeric',
|
|
33
|
+
month: 'short',
|
|
34
|
+
day: 'numeric',
|
|
35
|
+
hour: 'numeric',
|
|
36
|
+
minute: 'numeric',
|
|
37
|
+
second: 'numeric',
|
|
38
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';
|
|
2
|
+
import { nothing } from '@umbraco-cms/backoffice/external/lit';
|
|
3
|
+
import { uSyncDetailsModalData, uSyncDetailsModalValue } from '@jumoo/uSync';
|
|
4
|
+
import { UUIButtonState } from '@umbraco-cms/backoffice/external/uui';
|
|
5
|
+
export declare class uSyncDetailsModalElement extends UmbModalBaseElement<uSyncDetailsModalData, uSyncDetailsModalValue> {
|
|
6
|
+
#private;
|
|
7
|
+
importState: UUIButtonState;
|
|
8
|
+
constructor();
|
|
9
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
10
|
+
renderActions(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
11
|
+
static styles: import("lit").CSSResult;
|
|
12
|
+
}
|
|
13
|
+
export default uSyncDetailsModalElement;
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
'usync-details-modal': uSyncDetailsModalElement;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
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 __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
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");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _uSyncDetailsModalElement_instances, _uSyncDetailsModalElement_onImport, _uSyncDetailsModalElement_onClose;
|
|
13
|
+
import { UMB_MODAL_MANAGER_CONTEXT, UmbModalBaseElement, } from '@umbraco-cms/backoffice/modal';
|
|
14
|
+
import { css, customElement, html, nothing, state, } from '@umbraco-cms/backoffice/external/lit';
|
|
15
|
+
import { USYNC_IMPORT_SINGLE_MODAL, } from '@jumoo/uSync';
|
|
16
|
+
let uSyncDetailsModalElement = class uSyncDetailsModalElement extends UmbModalBaseElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
_uSyncDetailsModalElement_instances.add(this);
|
|
20
|
+
// this.consumeContext(USYNC_CORE_CONTEXT_TOKEN, (_instance) => {
|
|
21
|
+
// if (!_instance) return;
|
|
22
|
+
// this.#actionContext = _instance;
|
|
23
|
+
// });
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
return html `
|
|
27
|
+
<umb-body-layout headline="Changes : ${this.data?.item.name ?? ''}">
|
|
28
|
+
<div class="layout">
|
|
29
|
+
<uui-box style="--uui-box-default-padding: 0;">
|
|
30
|
+
<div slot="header" id="header">
|
|
31
|
+
<h3><umb-localize key="uSync_detailHeadline"></umb-localize></h3>
|
|
32
|
+
<umb-localize key="uSync_detailHeader"></umb-localize>
|
|
33
|
+
</div>
|
|
34
|
+
<div slot="header-actions">${this.renderActions()}</div>
|
|
35
|
+
</uui-box>
|
|
36
|
+
<uui-box style="--uui-box-default-padding: 0;">
|
|
37
|
+
<usync-change-view .item=${this.data?.item}></usync-change-view>
|
|
38
|
+
</uui-box>
|
|
39
|
+
</div>
|
|
40
|
+
<div slot="actions">
|
|
41
|
+
<uui-button
|
|
42
|
+
id="cancel"
|
|
43
|
+
.label=${this.localize.term('general_close')}
|
|
44
|
+
@click="${__classPrivateFieldGet(this, _uSyncDetailsModalElement_instances, "m", _uSyncDetailsModalElement_onClose)}"></uui-button>
|
|
45
|
+
</div>
|
|
46
|
+
</umb-body-layout>
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
renderActions() {
|
|
50
|
+
if (!this.data?.showActions)
|
|
51
|
+
return nothing;
|
|
52
|
+
return html ` <uui-button
|
|
53
|
+
id="import"
|
|
54
|
+
type="button"
|
|
55
|
+
look="outline"
|
|
56
|
+
.state=${this.importState}
|
|
57
|
+
.label=${this.localize.termOrDefault('uSync_importSingle', 'Import')}
|
|
58
|
+
@click="${__classPrivateFieldGet(this, _uSyncDetailsModalElement_instances, "m", _uSyncDetailsModalElement_onImport)}"></uui-button>`;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
_uSyncDetailsModalElement_instances = new WeakSet();
|
|
62
|
+
_uSyncDetailsModalElement_onImport = async function _uSyncDetailsModalElement_onImport(e) {
|
|
63
|
+
e.stopPropagation();
|
|
64
|
+
if (!this.data?.item)
|
|
65
|
+
return;
|
|
66
|
+
const modalContext = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);
|
|
67
|
+
if (!modalContext)
|
|
68
|
+
return;
|
|
69
|
+
const modal = modalContext.open(this, USYNC_IMPORT_SINGLE_MODAL, {
|
|
70
|
+
data: { action: this.data?.item },
|
|
71
|
+
});
|
|
72
|
+
const data = await modal?.onSubmit().catch(() => {
|
|
73
|
+
return;
|
|
74
|
+
});
|
|
75
|
+
return data;
|
|
76
|
+
};
|
|
77
|
+
_uSyncDetailsModalElement_onClose = function _uSyncDetailsModalElement_onClose() {
|
|
78
|
+
this.modalContext?.reject();
|
|
79
|
+
};
|
|
80
|
+
uSyncDetailsModalElement.styles = css `
|
|
81
|
+
.layout {
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
gap: var(--uui-size-space-4);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#header h3 {
|
|
88
|
+
margin: 0;
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
__decorate([
|
|
92
|
+
state()
|
|
93
|
+
], uSyncDetailsModalElement.prototype, "importState", void 0);
|
|
94
|
+
uSyncDetailsModalElement = __decorate([
|
|
95
|
+
customElement('usync-details-modal')
|
|
96
|
+
], uSyncDetailsModalElement);
|
|
97
|
+
export { uSyncDetailsModalElement };
|
|
98
|
+
export default uSyncDetailsModalElement;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UmbModalToken } from '@umbraco-cms/backoffice/modal';
|
|
2
|
+
import { USyncActionView } from '@jumoo/uSync';
|
|
3
|
+
export interface uSyncDetailsModalData {
|
|
4
|
+
item: USyncActionView;
|
|
5
|
+
showActions?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface uSyncDetailsModalValue {
|
|
8
|
+
result: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const USYNC_DETAILS_MODAL: UmbModalToken<uSyncDetailsModalData, uSyncDetailsModalValue>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';
|
|
2
|
+
import { uSyncErrorModalData, uSyncErrorModalValue } from './error-modal-token';
|
|
3
|
+
export default class uSyncErrorModalElement extends UmbModalBaseElement<uSyncErrorModalData, uSyncErrorModalValue> {
|
|
4
|
+
#private;
|
|
5
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
6
|
+
static styles: import("lit").CSSResult;
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
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");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _uSyncErrorModalElement_instances, _uSyncErrorModalElement_onClose;
|
|
13
|
+
import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';
|
|
14
|
+
import { css, customElement, html } from '@umbraco-cms/backoffice/external/lit';
|
|
15
|
+
let uSyncErrorModalElement = class uSyncErrorModalElement extends UmbModalBaseElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
_uSyncErrorModalElement_instances.add(this);
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
const headline = `Error: ${this.data?.action.name ?? ''} [${this.data?.action.itemType}]`;
|
|
22
|
+
return html `<umb-body-layout .headline=${headline}>
|
|
23
|
+
<strong>
|
|
24
|
+
<umb-localize key="uSync_errorHeader"></umb-localize>
|
|
25
|
+
</strong>
|
|
26
|
+
<div class="error">${this.data?.action.message}</div>
|
|
27
|
+
<div slot="actions">
|
|
28
|
+
<uui-button
|
|
29
|
+
id="cancel"
|
|
30
|
+
.label=${this.localize.term('general_close')}
|
|
31
|
+
@click="${__classPrivateFieldGet(this, _uSyncErrorModalElement_instances, "m", _uSyncErrorModalElement_onClose)}"></uui-button>
|
|
32
|
+
</div>
|
|
33
|
+
</umb-body-layout>`;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
_uSyncErrorModalElement_instances = new WeakSet();
|
|
37
|
+
_uSyncErrorModalElement_onClose = function _uSyncErrorModalElement_onClose() {
|
|
38
|
+
this.modalContext?.reject();
|
|
39
|
+
};
|
|
40
|
+
uSyncErrorModalElement.styles = css `
|
|
41
|
+
umb-body-layout {
|
|
42
|
+
max-width: 450px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.error {
|
|
46
|
+
padding: 10px;
|
|
47
|
+
font-family: monospace;
|
|
48
|
+
color: red;
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
uSyncErrorModalElement = __decorate([
|
|
52
|
+
customElement('usync-error-modal')
|
|
53
|
+
], uSyncErrorModalElement);
|
|
54
|
+
export default uSyncErrorModalElement;
|