@umbraco-cms/backoffice 15.0.0-rc4 → 15.0.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/packages/block/block/context/block-entry.context.js +3 -3
- package/dist-cms/packages/block/block/context/block-manager.context.d.ts +2 -1
- package/dist-cms/packages/block/block/context/block-manager.context.js +4 -2
- package/dist-cms/packages/block/block/workspace/block-workspace.context.js +5 -2
- package/dist-cms/packages/block/block-list/context/block-list-entries.context.js +1 -5
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/umbraco-package.json +1 -1
- package/package.json +1 -1
|
@@ -412,7 +412,6 @@ export class UmbBlockEntryContext extends UmbContextBase {
|
|
|
412
412
|
const variantId = this.#variantId.getValue();
|
|
413
413
|
if (!variantId || !this.#contentKey)
|
|
414
414
|
return;
|
|
415
|
-
// TODO: Handle variantId changes
|
|
416
415
|
this.observe(this._manager?.hasExposeOf(this.#contentKey, variantId), (hasExpose) => {
|
|
417
416
|
this.#hasExpose.setValue(hasExpose);
|
|
418
417
|
}, 'observeExpose');
|
|
@@ -445,8 +444,9 @@ export class UmbBlockEntryContext extends UmbContextBase {
|
|
|
445
444
|
this._entries.delete(contentKey);
|
|
446
445
|
}
|
|
447
446
|
expose() {
|
|
448
|
-
|
|
447
|
+
const variantId = this.#variantId.getValue();
|
|
448
|
+
if (!variantId || !this.#contentKey)
|
|
449
449
|
return;
|
|
450
|
-
this._manager?.setOneExpose(this.#contentKey);
|
|
450
|
+
this._manager?.setOneExpose(this.#contentKey, variantId);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
@@ -19,6 +19,7 @@ export declare abstract class UmbBlockManagerContext<BlockType extends UmbBlockT
|
|
|
19
19
|
setPropertyAlias(propertyAlias: string | undefined): void;
|
|
20
20
|
variantId: import("rxjs/internal/Observable").Observable<UmbVariantId | undefined>;
|
|
21
21
|
setVariantId(variantId: UmbVariantId | undefined): void;
|
|
22
|
+
getVariantId(): UmbVariantId | undefined;
|
|
22
23
|
readonly blockTypes: import("rxjs/internal/Observable").Observable<BlockType[]>;
|
|
23
24
|
protected _editorConfiguration: UmbClassState<UmbPropertyEditorConfigCollection | undefined>;
|
|
24
25
|
readonly editorConfiguration: import("rxjs/internal/Observable").Observable<UmbPropertyEditorConfigCollection | undefined>;
|
|
@@ -58,7 +59,7 @@ export declare abstract class UmbBlockManagerContext<BlockType extends UmbBlockT
|
|
|
58
59
|
setOneLayout(layoutData: BlockLayoutType, _originData?: BlockOriginDataType): void;
|
|
59
60
|
setOneContent(contentData: UmbBlockDataModel): void;
|
|
60
61
|
setOneSettings(settingsData: UmbBlockDataModel): void;
|
|
61
|
-
setOneExpose(contentKey: string): void;
|
|
62
|
+
setOneExpose(contentKey: string, variantId: UmbVariantId): void;
|
|
62
63
|
removeOneContent(contentKey: string): void;
|
|
63
64
|
removeOneSettings(settingsKey: string): void;
|
|
64
65
|
removeExposesOf(contentKey: string): void;
|
|
@@ -18,6 +18,9 @@ export class UmbBlockManagerContext extends UmbContextBase {
|
|
|
18
18
|
setVariantId(variantId) {
|
|
19
19
|
this.#variantId.setValue(variantId);
|
|
20
20
|
}
|
|
21
|
+
getVariantId() {
|
|
22
|
+
return this.#variantId.getValue();
|
|
23
|
+
}
|
|
21
24
|
#structures;
|
|
22
25
|
#blockTypes;
|
|
23
26
|
#contents;
|
|
@@ -170,8 +173,7 @@ export class UmbBlockManagerContext extends UmbContextBase {
|
|
|
170
173
|
setOneSettings(settingsData) {
|
|
171
174
|
this.#settings.appendOne(settingsData);
|
|
172
175
|
}
|
|
173
|
-
setOneExpose(contentKey) {
|
|
174
|
-
const variantId = this.#variantId.getValue();
|
|
176
|
+
setOneExpose(contentKey, variantId) {
|
|
175
177
|
if (!variantId)
|
|
176
178
|
return;
|
|
177
179
|
this.#exposes.appendOne({ contentKey, ...variantId.toObject() });
|
|
@@ -344,11 +344,14 @@ export class UmbBlockWorkspaceContext extends UmbSubmittableWorkspaceContextBase
|
|
|
344
344
|
expose() {
|
|
345
345
|
const contentKey = this.#layout.value?.contentKey;
|
|
346
346
|
if (!contentKey)
|
|
347
|
-
throw new Error('
|
|
347
|
+
throw new Error('Failed to expose block, missing content key.');
|
|
348
348
|
this.#expose(contentKey);
|
|
349
349
|
}
|
|
350
350
|
#expose(unique) {
|
|
351
|
-
this.#
|
|
351
|
+
const variantId = this.#variantId.getValue();
|
|
352
|
+
if (!variantId)
|
|
353
|
+
throw new Error('Failed to expose block, missing variant id.');
|
|
354
|
+
this.#blockManager?.setOneExpose(unique, variantId);
|
|
352
355
|
}
|
|
353
356
|
#modalRejected;
|
|
354
357
|
destroy() {
|
|
@@ -94,11 +94,7 @@ export class UmbBlockListEntriesContext extends UmbBlockEntriesContext {
|
|
|
94
94
|
// insert Block?
|
|
95
95
|
async insert(layoutEntry, content, settings, originData) {
|
|
96
96
|
await this._retrieveManager;
|
|
97
|
-
|
|
98
|
-
if (success) {
|
|
99
|
-
this._manager?.setOneExpose(layoutEntry.contentKey);
|
|
100
|
-
}
|
|
101
|
-
return success;
|
|
97
|
+
return this._manager?.insert(layoutEntry, content, settings, originData) ?? false;
|
|
102
98
|
}
|
|
103
99
|
// create Block?
|
|
104
100
|
async delete(contentKey) {
|