@umbraco-cms/backoffice 14.1.0-rc2 → 14.1.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/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/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/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%);
|