Merge branch 'release/15.1' into v15/dev
This commit is contained in:
@@ -2469,7 +2469,10 @@ public static class PublishedContentExtensions
|
||||
{
|
||||
if (orSelf)
|
||||
{
|
||||
yield return content;
|
||||
if (contentTypeAlias is null || content.ContentType.Alias == contentTypeAlias)
|
||||
{
|
||||
yield return content;
|
||||
}
|
||||
}
|
||||
|
||||
var nodeExists = contentTypeAlias is null
|
||||
@@ -2501,7 +2504,10 @@ public static class PublishedContentExtensions
|
||||
{
|
||||
if (orSelf)
|
||||
{
|
||||
yield return content;
|
||||
if (contentTypeAlias is null || content.ContentType.Alias == contentTypeAlias)
|
||||
{
|
||||
yield return content;
|
||||
}
|
||||
}
|
||||
|
||||
var nodeExists = contentTypeAlias is null
|
||||
|
||||
934
src/Umbraco.Web.UI.Client/package-lock.json
generated
934
src/Umbraco.Web.UI.Client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -212,7 +212,7 @@
|
||||
"@tiptap/pm": "^2.10.2",
|
||||
"@tiptap/starter-kit": "^2.10.2",
|
||||
"@types/diff": "^6.0.0",
|
||||
"@umbraco-ui/uui": "^1.12.1",
|
||||
"@umbraco-ui/uui": "^1.12.2",
|
||||
"@umbraco-ui/uui-css": "^1.12.1",
|
||||
"base64-js": "^1.5.1",
|
||||
"diff": "^7.0.0",
|
||||
@@ -292,4 +292,4 @@
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,4 +337,12 @@ export class UmbDefaultCollectionContext<
|
||||
public getManifest() {
|
||||
return this._manifest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the items in the collection.
|
||||
* @returns {Array<CollectionItemType>} - The items in the collection.
|
||||
*/
|
||||
public getItems() {
|
||||
return this._items.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,16 +170,6 @@ export class UmbTableElement extends LitElement {
|
||||
this.dispatchEvent(new UmbTableDeselectedEvent());
|
||||
}
|
||||
|
||||
#onClickRow(key: string) {
|
||||
if (this._selectionMode) {
|
||||
if (this._isSelected(key)) {
|
||||
this._deselectRow(key);
|
||||
} else {
|
||||
this._selectRow(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override render() {
|
||||
return html`
|
||||
<uui-table class="uui-text">
|
||||
@@ -244,8 +234,7 @@ export class UmbTableElement extends LitElement {
|
||||
?select-only=${this._selectionMode}
|
||||
?selected=${this._isSelected(item.id)}
|
||||
@selected=${() => this._selectRow(item.id)}
|
||||
@deselected=${() => this._deselectRow(item.id)}
|
||||
@click=${() => this.#onClickRow(item.id)}>
|
||||
@deselected=${() => this._deselectRow(item.id)}>
|
||||
${this._renderRowCheckboxCell(item)} ${this.columns.map((column) => this._renderRowCell(column, item))}
|
||||
</uui-table-row>
|
||||
`;
|
||||
|
||||
@@ -73,6 +73,9 @@ export class UmbDocumentTableCollectionViewElement extends UmbLitElement {
|
||||
collectionContext.workspacePathBuilder,
|
||||
(builder) => {
|
||||
this._workspacePathBuilder = builder;
|
||||
if (this.#collectionContext) {
|
||||
this.#createTableItems(this.#collectionContext.getItems());
|
||||
}
|
||||
},
|
||||
'observePath',
|
||||
);
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { UmbUfmElementBase } from '../ufm-element-base.js';
|
||||
import { UMB_UFM_RENDER_CONTEXT } from '../ufm-render/ufm-render.context.js';
|
||||
import { customElement, property } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbDocumentItemRepository } from '@umbraco-cms/backoffice/document';
|
||||
import { UmbMediaItemRepository } from '@umbraco-cms/backoffice/media';
|
||||
import { UmbMemberItemRepository } from '@umbraco-cms/backoffice/member';
|
||||
import { UmbDocumentItemRepository, UMB_DOCUMENT_ENTITY_TYPE } from '@umbraco-cms/backoffice/document';
|
||||
import { UmbId } from '@umbraco-cms/backoffice/id';
|
||||
import { UmbMediaItemRepository, UMB_MEDIA_ENTITY_TYPE } from '@umbraco-cms/backoffice/media';
|
||||
import { UmbMemberItemRepository, UMB_MEMBER_ENTITY_TYPE } from '@umbraco-cms/backoffice/member';
|
||||
|
||||
const elementName = 'ufm-content-name';
|
||||
|
||||
@@ -25,39 +26,64 @@ export class UmbUfmContentNameElement extends UmbUfmElementBase {
|
||||
async (value) => {
|
||||
const temp =
|
||||
this.alias && typeof value === 'object'
|
||||
? ((value as Record<string, unknown>)[this.alias] as string)
|
||||
: (value as string);
|
||||
? (value as Record<string, unknown>)[this.alias]
|
||||
: (value as unknown);
|
||||
|
||||
const entityType = Array.isArray(temp) && temp.length > 0 ? temp[0].type : null;
|
||||
const uniques = Array.isArray(temp) ? temp.map((x) => x.unique) : temp ? [temp] : [];
|
||||
if (!temp) return;
|
||||
|
||||
if (uniques?.length) {
|
||||
const repository = this.#getRepository(entityType);
|
||||
if (repository) {
|
||||
const { data } = await repository.requestItems(uniques);
|
||||
this.value = data ? data.map((item) => item.name).join(', ') : '';
|
||||
return;
|
||||
}
|
||||
}
|
||||
const entityType = this.#getEntityType(temp);
|
||||
const uniques = this.#getUniques(temp);
|
||||
|
||||
this.value = '';
|
||||
this.value = await this.#getNames(entityType, uniques);
|
||||
},
|
||||
'observeValue',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#getEntityType(value: unknown) {
|
||||
if (Array.isArray(value) && value.length > 0) {
|
||||
const item = value[0];
|
||||
if (item.type) return item.type;
|
||||
if (item.mediaKey) return UMB_MEDIA_ENTITY_TYPE;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
#getUniques(value: unknown) {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map((x) => x.unique ?? x.mediaKey ?? x).filter((x) => UmbId.validate(x));
|
||||
}
|
||||
|
||||
return typeof value === 'string' && UmbId.validate(value) ? [value] : [];
|
||||
}
|
||||
|
||||
async #getNames(entityType: string, uniques?: Array<string>) {
|
||||
if (uniques?.length) {
|
||||
const repository = this.#getRepository(entityType);
|
||||
if (repository) {
|
||||
const { data } = await repository.requestItems(uniques);
|
||||
if (Array.isArray(data) && data.length > 0) {
|
||||
return data.map((item) => item.name).join(', ');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
#getRepository(entityType?: string | null) {
|
||||
switch (entityType) {
|
||||
case 'media':
|
||||
case UMB_MEDIA_ENTITY_TYPE:
|
||||
if (!this.#mediaRepository) this.#mediaRepository = new UmbMediaItemRepository(this);
|
||||
return this.#mediaRepository;
|
||||
|
||||
case 'member':
|
||||
case UMB_MEMBER_ENTITY_TYPE:
|
||||
if (!this.#memberRepository) this.#memberRepository = new UmbMemberItemRepository(this);
|
||||
return this.#memberRepository;
|
||||
|
||||
case 'document':
|
||||
case UMB_DOCUMENT_ENTITY_TYPE:
|
||||
default:
|
||||
if (!this.#documentRepository) this.#documentRepository = new UmbDocumentItemRepository(this);
|
||||
return this.#documentRepository;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import type { UfmToken } from '../../plugins/marked-ufm.plugin.js';
|
||||
import { UmbUfmComponentBase } from '../ufm-component-base.js';
|
||||
|
||||
import './link.element.js';
|
||||
|
||||
export class UmbUfmLinkComponent extends UmbUfmComponentBase {
|
||||
render(token: UfmToken) {
|
||||
if (!token.text) return;
|
||||
|
||||
const attributes = super.getAttributes(token.text);
|
||||
return `<ufm-link ${attributes}></ufm-link>`;
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbUfmLinkComponent as api };
|
||||
@@ -0,0 +1,84 @@
|
||||
import { UmbUfmElementBase } from '../ufm-element-base.js';
|
||||
import { UMB_UFM_RENDER_CONTEXT } from '../ufm-render/ufm-render.context.js';
|
||||
import { customElement, property } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbDocumentItemRepository, UMB_DOCUMENT_ENTITY_TYPE } from '@umbraco-cms/backoffice/document';
|
||||
import { UmbMediaItemRepository, UMB_MEDIA_ENTITY_TYPE } from '@umbraco-cms/backoffice/media';
|
||||
import type { UmbLinkPickerLink } from '@umbraco-cms/backoffice/multi-url-picker';
|
||||
|
||||
const elementName = 'ufm-link';
|
||||
|
||||
@customElement(elementName)
|
||||
export class UmbUfmLinkElement extends UmbUfmElementBase {
|
||||
@property()
|
||||
alias?: string;
|
||||
|
||||
#documentRepository?: UmbDocumentItemRepository;
|
||||
#mediaRepository?: UmbMediaItemRepository;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.consumeContext(UMB_UFM_RENDER_CONTEXT, (context) => {
|
||||
this.observe(
|
||||
context.value,
|
||||
async (value) => {
|
||||
const temp =
|
||||
this.alias && typeof value === 'object'
|
||||
? (value as Record<string, unknown>)[this.alias]
|
||||
: (value as unknown);
|
||||
|
||||
if (!temp) return;
|
||||
|
||||
const items = Array.isArray(temp) ? temp : [temp];
|
||||
const names = await Promise.all(items.map(async (item) => await this.#getName(item)));
|
||||
this.value = names.filter((x) => x).join(', ');
|
||||
},
|
||||
'observeValue',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
async #getName(item?: unknown) {
|
||||
const link = item as UmbLinkPickerLink;
|
||||
|
||||
if (link.name) {
|
||||
return link.name;
|
||||
}
|
||||
|
||||
const entityType = link.type;
|
||||
const unique = link.unique;
|
||||
|
||||
if (unique) {
|
||||
const repository = this.#getRepository(entityType);
|
||||
if (repository) {
|
||||
const { data } = await repository.requestItems([unique]);
|
||||
if (Array.isArray(data) && data.length > 0) {
|
||||
return data.map((item) => item.name).join(', ');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
#getRepository(entityType?: string | null) {
|
||||
switch (entityType) {
|
||||
case UMB_MEDIA_ENTITY_TYPE:
|
||||
if (!this.#mediaRepository) this.#mediaRepository = new UmbMediaItemRepository(this);
|
||||
return this.#mediaRepository;
|
||||
|
||||
case UMB_DOCUMENT_ENTITY_TYPE:
|
||||
default:
|
||||
if (!this.#documentRepository) this.#documentRepository = new UmbDocumentItemRepository(this);
|
||||
return this.#documentRepository;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbUfmLinkElement as element };
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
[elementName]: UmbUfmLinkElement;
|
||||
}
|
||||
}
|
||||
@@ -22,4 +22,11 @@ export const manifests: Array<ManifestUfmComponent> = [
|
||||
api: () => import('./content-name/content-name.component.js'),
|
||||
meta: { alias: 'umbContentName', marker: '~' },
|
||||
},
|
||||
{
|
||||
type: 'ufmComponent',
|
||||
alias: 'Umb.Markdown.Link',
|
||||
name: 'Link UFM Component',
|
||||
api: () => import('./link/link.component.js'),
|
||||
meta: { alias: 'umbLink' },
|
||||
},
|
||||
];
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
"cases": [
|
||||
{
|
||||
"condition": "(UmbracoRelease == 'Latest')",
|
||||
"value": "*"
|
||||
"value": "15.1.0-rc"
|
||||
},
|
||||
{
|
||||
"condition": "(UmbracoRelease == 'LTS')",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
|
||||
"version": "15.1.0-rc1",
|
||||
"version": "15.1.0-rc",
|
||||
"assemblyVersion": {
|
||||
"precision": "build"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user