Skip to content

Commit

Permalink
correct rte-entries context
Browse files Browse the repository at this point in the history
  • Loading branch information
nielslyngsoe committed Oct 16, 2024
1 parent 2f64fba commit 6a2b63b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/packages/block/block-rte/context/block-rte-entries.context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ export class UmbBlockRteEntriesContext extends UmbBlockEntriesContext<
{} as any,
);
if (created) {
this.insert(created.layout, created.content, created.settings);
this.insert(
created.layout,
created.content,
created.settings,
data.originData as UmbBlockRteWorkspaceOriginData,
);
} else {
throw new Error('Failed to create block');
}
Expand Down Expand Up @@ -122,9 +127,13 @@ export class UmbBlockRteEntriesContext extends UmbBlockEntriesContext<
this._manager?.setLayouts(layouts);
}

async create(contentElementTypeKey: string, partialLayoutEntry?: Omit<UmbBlockRteLayoutModel, 'contentKey'>) {
async create(
contentElementTypeKey: string,
partialLayoutEntry?: Omit<UmbBlockRteLayoutModel, 'contentKey'>,
originData?: UmbBlockRteWorkspaceOriginData,
) {
await this._retrieveManager;
return this._manager?.create(contentElementTypeKey, partialLayoutEntry);
return this._manager?.create(contentElementTypeKey, partialLayoutEntry, originData);
}

// insert Block?
Expand All @@ -133,9 +142,10 @@ export class UmbBlockRteEntriesContext extends UmbBlockEntriesContext<
layoutEntry: UmbBlockRteLayoutModel,
content: UmbBlockDataModel,
settings: UmbBlockDataModel | undefined,
originData: UmbBlockRteWorkspaceOriginData,
) {
await this._retrieveManager;
return this._manager?.insert(layoutEntry, content, settings) ?? false;
return this._manager?.insert(layoutEntry, content, settings, originData) ?? false;
}

// create Block?
Expand Down

0 comments on commit 6a2b63b

Please sign in to comment.