@umbraco-cms/backoffice 14.1.0-rc2 → 14.1.1
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-cms/custom-elements.json +1 -1
- package/dist-cms/packages/block/block/workspace/block-workspace.context.js +46 -34
- package/dist-cms/packages/core/components/split-panel/split-panel.element.js +1 -1
- package/dist-cms/packages/property-editors/date-picker/property-editor-ui-date-picker.element.d.ts +1 -0
- package/dist-cms/packages/property-editors/date-picker/property-editor-ui-date-picker.element.js +39 -17
- package/dist-cms/packages/ufm/components/ufm-render/ufm-render.element.js +1 -0
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/umbraco-package.json +1 -1
- package/dist-cms/vscode-html-custom-data.json +1 -1
- package/package.json +1 -1
|
@@ -2810,7 +2810,7 @@
|
|
|
2810
2810
|
},
|
|
2811
2811
|
{
|
|
2812
2812
|
"name": "styles",
|
|
2813
|
-
"default": "\"css`\\n\\t\\t:host {\\n\\t\\t\\tdisplay: contents;\\n\\t\\t\\t--umb-split-panel-initial-position: 50%;\\n\\t\\t\\t--umb-split-panel-start-min-width: 0;\\n\\t\\t\\t--umb-split-panel-end-min-width: 0;\\n\\t\\t\\t--umb-split-panel-divider-touch-area-width: 20px;\\n\\t\\t\\t--umb-split-panel-divider-width: 1px;\\n\\t\\t\\t--umb-split-panel-divider-color: transparent;\\n\\t\\t\\t--umb-split-panel-slot-overflow: hidden;\\n\\t\\t}\\n\\t\\tslot {\\n\\t\\t\\toverflow: var(--umb-split-panel-slot-overflow);\\n\\t\\t\\tdisplay: block;\\n\\t\\t\\tmin-height: 0;\\n\\t\\t}\\n\\t\\t#main {\\n\\t\\t\\twidth: 100%;\\n\\t\\t\\theight: 100%;\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\tposition: relative;\\n\\t\\t\\tz-index: 0;\\n\\t\\t\\toverflow: hidden;\\n\\t\\t}\\n\\t\\t#divider {\\n\\t\\t\\theight: 100%;\\n\\t\\t\\tposition: relative;\\n\\t\\t\\tz-index: 999999;\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t\\t#divider-touch-area {\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 0;\\n\\t\\t\\tleft:
|
|
2813
|
+
"default": "\"css`\\n\\t\\t:host {\\n\\t\\t\\tdisplay: contents;\\n\\t\\t\\t--umb-split-panel-initial-position: 50%;\\n\\t\\t\\t--umb-split-panel-start-min-width: 0;\\n\\t\\t\\t--umb-split-panel-end-min-width: 0;\\n\\t\\t\\t--umb-split-panel-divider-touch-area-width: 20px;\\n\\t\\t\\t--umb-split-panel-divider-width: 1px;\\n\\t\\t\\t--umb-split-panel-divider-color: transparent;\\n\\t\\t\\t--umb-split-panel-slot-overflow: hidden;\\n\\t\\t}\\n\\t\\tslot {\\n\\t\\t\\toverflow: var(--umb-split-panel-slot-overflow);\\n\\t\\t\\tdisplay: block;\\n\\t\\t\\tmin-height: 0;\\n\\t\\t}\\n\\t\\t#main {\\n\\t\\t\\twidth: 100%;\\n\\t\\t\\theight: 100%;\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\tposition: relative;\\n\\t\\t\\tz-index: 0;\\n\\t\\t\\toverflow: hidden;\\n\\t\\t}\\n\\t\\t#divider {\\n\\t\\t\\theight: 100%;\\n\\t\\t\\tposition: relative;\\n\\t\\t\\tz-index: 999999;\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t\\t#divider-touch-area {\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 0;\\n\\t\\t\\tleft: 5px;\\n\\t\\t\\theight: 100%;\\n\\t\\t\\twidth: var(--umb-split-panel-divider-touch-area-width);\\n\\t\\t\\ttransform: translateX(-50%);\\n\\t\\t\\tcursor: col-resize;\\n\\t\\t}\\n\\t\\t/* Do we want a line that shows the divider? */\\n\\t\\t#divider::after {\\n\\t\\t\\tcontent: '';\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 0;\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\twidth: var(--umb-split-panel-divider-width);\\n\\t\\t\\theight: 100%;\\n\\t\\t\\ttransform: round(translateX(-50%));\\n\\t\\t\\tbackground-color: var(--umb-split-panel-divider-color);\\n\\t\\t\\tz-index: -1;\\n\\t\\t}\\n\\t`\""
|
|
2814
2814
|
}
|
|
2815
2815
|
],
|
|
2816
2816
|
"events": [
|
|
@@ -112,6 +112,52 @@ export class UmbBlockWorkspaceContext extends UmbSubmittableWorkspaceContextBase
|
|
|
112
112
|
this.#initialLayout ??= layoutData;
|
|
113
113
|
this.removeUmbControllerByAlias('observeLayoutInitially');
|
|
114
114
|
}, 'observeLayoutInitially');
|
|
115
|
+
this.#observeBlockData(unique);
|
|
116
|
+
if (this.#liveEditingMode) {
|
|
117
|
+
this.#establishLiveSync();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async create(contentElementTypeId) {
|
|
121
|
+
await this.#retrieveBlockEntries;
|
|
122
|
+
await this.#retrieveModalContext;
|
|
123
|
+
if (!this.#blockEntries) {
|
|
124
|
+
throw new Error('Block Entries not found');
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (!this.#modalContext) {
|
|
128
|
+
throw new Error('Modal Context not found');
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
// TODO: Missing some way to append more layout data... this could be part of modal data, (or context api?)
|
|
132
|
+
this.setIsNew(true);
|
|
133
|
+
const blockCreated = await this.#blockEntries.create(contentElementTypeId, {}, this.#modalContext.data);
|
|
134
|
+
if (!blockCreated) {
|
|
135
|
+
throw new Error('Block Entries could not create block');
|
|
136
|
+
}
|
|
137
|
+
// TODO: We should investigate if it makes sense to gather
|
|
138
|
+
if (!this.#liveEditingMode) {
|
|
139
|
+
this.#layout.setValue(blockCreated.layout);
|
|
140
|
+
this.content.setData(blockCreated.content);
|
|
141
|
+
if (blockCreated.settings) {
|
|
142
|
+
this.settings.setData(blockCreated.settings);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
// Insert already, cause we are in live editing mode:
|
|
147
|
+
const blockInserted = await this.#blockEntries.insert(blockCreated.layout, blockCreated.content, blockCreated.settings, this.#modalContext.data);
|
|
148
|
+
if (!blockInserted) {
|
|
149
|
+
throw new Error('Block Entries could not insert block');
|
|
150
|
+
}
|
|
151
|
+
const unique = blockCreated.layout.contentUdi;
|
|
152
|
+
this.#observeBlockData(unique);
|
|
153
|
+
this.#establishLiveSync();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
#observeBlockData(unique) {
|
|
157
|
+
if (!this.#blockEntries) {
|
|
158
|
+
throw new Error('Block Entries not found');
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
115
161
|
this.observe(this.#blockEntries.layoutOf(unique), (layoutData) => {
|
|
116
162
|
this.#layout.setValue(layoutData);
|
|
117
163
|
// Content:
|
|
@@ -142,40 +188,6 @@ export class UmbBlockWorkspaceContext extends UmbSubmittableWorkspaceContextBase
|
|
|
142
188
|
}
|
|
143
189
|
}
|
|
144
190
|
}, 'observeLayout');
|
|
145
|
-
if (this.#liveEditingMode) {
|
|
146
|
-
this.#establishLiveSync();
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
async create(contentElementTypeId) {
|
|
150
|
-
await this.#retrieveBlockEntries;
|
|
151
|
-
await this.#retrieveModalContext;
|
|
152
|
-
if (!this.#blockEntries) {
|
|
153
|
-
throw new Error('Block Entries not found');
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
if (!this.#modalContext) {
|
|
157
|
-
throw new Error('Modal Context not found');
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
// TODO: Missing some way to append more layout data... this could be part of modal data, (or context api?)
|
|
161
|
-
this.setIsNew(true);
|
|
162
|
-
const blockCreated = await this.#blockEntries.create(contentElementTypeId, {}, this.#modalContext.data);
|
|
163
|
-
if (!blockCreated) {
|
|
164
|
-
throw new Error('Block Entries could not create block');
|
|
165
|
-
}
|
|
166
|
-
this.#layout.setValue(blockCreated.layout);
|
|
167
|
-
this.content.setData(blockCreated.content);
|
|
168
|
-
if (blockCreated.settings) {
|
|
169
|
-
this.settings.setData(blockCreated.settings);
|
|
170
|
-
}
|
|
171
|
-
if (this.#liveEditingMode) {
|
|
172
|
-
// Insert already, cause we are in live editing mode:
|
|
173
|
-
const blockInserted = await this.#blockEntries.insert(blockCreated.layout, blockCreated.content, blockCreated.settings, this.#modalContext.data);
|
|
174
|
-
if (!blockInserted) {
|
|
175
|
-
throw new Error('Block Entries could not insert block');
|
|
176
|
-
}
|
|
177
|
-
this.#establishLiveSync();
|
|
178
|
-
}
|
|
179
191
|
}
|
|
180
192
|
#establishLiveSync() {
|
|
181
193
|
this.observe(this.layout, (layoutData) => {
|
|
@@ -242,7 +242,7 @@ let UmbSplitPanelElement = class UmbSplitPanelElement extends LitElement {
|
|
|
242
242
|
#divider-touch-area {
|
|
243
243
|
position: absolute;
|
|
244
244
|
top: 0;
|
|
245
|
-
left:
|
|
245
|
+
left: 5px;
|
|
246
246
|
height: 100%;
|
|
247
247
|
width: var(--umb-split-panel-divider-touch-area-width);
|
|
248
248
|
transform: translateX(-50%);
|
package/dist-cms/packages/property-editors/date-picker/property-editor-ui-date-picker.element.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export declare class UmbPropertyEditorUIDatePickerElement extends UmbLitElement
|
|
|
28
28
|
private _max?;
|
|
29
29
|
private _step?;
|
|
30
30
|
value?: string;
|
|
31
|
+
private _inputValue?;
|
|
31
32
|
set config(config: UmbPropertyEditorConfigCollection | undefined);
|
|
32
33
|
render(): import("lit-html").TemplateResult<1>;
|
|
33
34
|
}
|
package/dist-cms/packages/property-editors/date-picker/property-editor-ui-date-picker.element.js
CHANGED
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { UmbPropertyValueChangeEvent } from '../../core/property-editor/index.js';
|
|
8
|
-
import { html, customElement, property, state
|
|
8
|
+
import { html, customElement, property, state } from '../../../external/lit/index.js';
|
|
9
9
|
import { UmbLitElement } from '../../core/lit-element/index.js';
|
|
10
10
|
/**
|
|
11
11
|
* This property editor allows the user to pick a date, datetime-local, or time.
|
|
@@ -37,8 +37,8 @@ let UmbPropertyEditorUIDatePickerElement = class UmbPropertyEditorUIDatePickerEl
|
|
|
37
37
|
return;
|
|
38
38
|
// Format string prevalue/config
|
|
39
39
|
const format = config.getValueByAlias('format');
|
|
40
|
-
const hasTime = format?.includes('H') || format?.includes('m');
|
|
41
|
-
const hasSeconds = format?.includes('s');
|
|
40
|
+
const hasTime = (format?.includes('H') || format?.includes('m')) ?? false;
|
|
41
|
+
const hasSeconds = format?.includes('s') ?? false;
|
|
42
42
|
this._inputType = hasTime ? 'datetime-local' : 'date';
|
|
43
43
|
// Based on the type of format string change the UUI-input type
|
|
44
44
|
// Note: The format string is not validated, so it's possible to have an invalid format string,
|
|
@@ -56,28 +56,47 @@ let UmbPropertyEditorUIDatePickerElement = class UmbPropertyEditorUIDatePickerEl
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
#onChange(event) {
|
|
59
|
-
|
|
59
|
+
let value = event.target.value.toString();
|
|
60
|
+
switch (this._inputType) {
|
|
61
|
+
case 'time':
|
|
62
|
+
value = `0001-01-01 ${value}`;
|
|
63
|
+
break;
|
|
64
|
+
case 'date':
|
|
65
|
+
value = `${value} 00:00:00`;
|
|
66
|
+
break;
|
|
67
|
+
case 'datetime-local':
|
|
68
|
+
value = value.replace('T', ' ');
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
this.#syncValue(value);
|
|
60
72
|
}
|
|
61
73
|
/**
|
|
62
74
|
* Formats the value depending on the input type.
|
|
63
75
|
*/
|
|
64
76
|
#formatValue(value) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
console.warn('[Umbraco.DatePicker] The value is not a valid date.', value);
|
|
77
|
+
this._inputValue = undefined;
|
|
78
|
+
if (isNaN(new Date(value).getTime())) {
|
|
79
|
+
console.warn(`[UmbDatePicker] Invalid date: ${value}`);
|
|
69
80
|
return;
|
|
70
81
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
value = value.split(' ')[0];
|
|
82
|
+
const dateSplit = value.split(' ');
|
|
83
|
+
if (dateSplit.length !== 2) {
|
|
84
|
+
console.warn(`[UmbDatePicker] Invalid date: ${value}`);
|
|
85
|
+
return;
|
|
76
86
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
87
|
+
switch (this._inputType) {
|
|
88
|
+
case 'time':
|
|
89
|
+
this._inputValue = dateSplit[1];
|
|
90
|
+
break;
|
|
91
|
+
case 'date':
|
|
92
|
+
this._inputValue = dateSplit[0];
|
|
93
|
+
break;
|
|
94
|
+
default:
|
|
95
|
+
this._inputValue = dateSplit.join('T');
|
|
96
|
+
break;
|
|
80
97
|
}
|
|
98
|
+
}
|
|
99
|
+
#syncValue(value) {
|
|
81
100
|
const valueHasChanged = this.value !== value;
|
|
82
101
|
if (valueHasChanged) {
|
|
83
102
|
this.value = value;
|
|
@@ -87,7 +106,7 @@ let UmbPropertyEditorUIDatePickerElement = class UmbPropertyEditorUIDatePickerEl
|
|
|
87
106
|
render() {
|
|
88
107
|
return html `
|
|
89
108
|
<umb-input-date
|
|
90
|
-
value
|
|
109
|
+
.value=${this._inputValue}
|
|
91
110
|
.min=${this._min}
|
|
92
111
|
.max=${this._max}
|
|
93
112
|
.step=${this._step}
|
|
@@ -112,6 +131,9 @@ __decorate([
|
|
|
112
131
|
__decorate([
|
|
113
132
|
property()
|
|
114
133
|
], UmbPropertyEditorUIDatePickerElement.prototype, "value", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
state()
|
|
136
|
+
], UmbPropertyEditorUIDatePickerElement.prototype, "_inputValue", void 0);
|
|
115
137
|
UmbPropertyEditorUIDatePickerElement = __decorate([
|
|
116
138
|
customElement('umb-property-editor-ui-date-picker')
|
|
117
139
|
], UmbPropertyEditorUIDatePickerElement);
|