Skip to content

Commit

Permalink
Merge pull request #2527 from umbraco/v15/feature/block-area-component
Browse files Browse the repository at this point in the history
V15/feature/block area component
  • Loading branch information
nielslyngsoe authored Nov 8, 2024
2 parents 9934d11 + c0f2f8a commit 443c83b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { UMB_BLOCK_GRID_ENTRIES_CONTEXT } from '../../context/block-grid-entries.context-token.js';
import { UmbBlockGridEntriesElement } from '../block-grid-entries/index.js';
import { customElement } from '@umbraco-cms/backoffice/external/lit';

/**
* @description
* This element is used to render a single block grid area.
*/
@customElement('umb-block-grid-area')
export class UmbBlockGridAreasContainerElement extends UmbBlockGridEntriesElement {
//
constructor() {
super();

this.consumeContext(UMB_BLOCK_GRID_ENTRIES_CONTEXT, (context) => {
this.observe(
context.layoutColumns,
(layoutColumns) => {
this.layoutColumns = layoutColumns;
},
'observeParentEntriesLayoutColumns',
);
}).skipHost();
}

override connectedCallback(): void {
super.connectedCallback();
// eslint-disable-next-line wc/no-self-class
this.classList.add('umb-block-grid__area');
}
}

export default UmbBlockGridAreasContainerElement;

declare global {
interface HTMLElementTagNameMap {
'umb-block-grid-area': UmbBlockGridAreasContainerElement;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './block-grid-area.element.js';
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { css, customElement, html, repeat, state } from '@umbraco-cms/backoffice

import '../block-grid-entries/index.js';
/**
* @element umb-block-grid-areas-container
* @description
* This element is used to render the block grid areas.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ const apiArgsCreator: UmbApiConstructorArgumentsMethodType<unknown> = (manifest:
return [{ manifest }];
};

/**
* @element umb-block-grid-block-inline
*/
@customElement('umb-block-grid-block-inline')
export class UmbBlockGridBlockInlineElement extends UmbLitElement {
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import '@umbraco-cms/backoffice/ufm';
import '../block-grid-areas-container/index.js';
import '../ref-grid-block/index.js';

/**
* @element umb-block-grid-block
*/
@customElement('umb-block-grid-block')
export class UmbBlockGridBlockElement extends UmbLitElement {
//
Expand Down

0 comments on commit 443c83b

Please sign in to comment.