diff --git a/src/api/mosaic-item/content-types/mosaic-item/schema.json b/src/api/mosaic-item/content-types/mosaic-item/schema.json index 9d50830..d446058 100644 --- a/src/api/mosaic-item/content-types/mosaic-item/schema.json +++ b/src/api/mosaic-item/content-types/mosaic-item/schema.json @@ -36,6 +36,11 @@ "global.copy", "global.media" ] + }, + "image_attribution": { + "type": "component", + "component": "global.link", + "repeatable": false } } } diff --git a/src/components/global/link.json b/src/components/global/link.json new file mode 100644 index 0000000..6433fc7 --- /dev/null +++ b/src/components/global/link.json @@ -0,0 +1,18 @@ +{ + "collectionName": "components_global_links", + "info": { + "displayName": "Link", + "icon": "exit" + }, + "options": {}, + "attributes": { + "text": { + "type": "string" + }, + "url": { + "type": "string", + "regex": "https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)" + } + }, + "config": {} +} diff --git a/types/generated/components.d.ts b/types/generated/components.d.ts index b18b5a8..c20ab36 100644 --- a/types/generated/components.d.ts +++ b/types/generated/components.d.ts @@ -23,6 +23,18 @@ export interface GlobalDescriptiveList extends Struct.ComponentSchema { }; } +export interface GlobalLink extends Struct.ComponentSchema { + collectionName: 'components_global_links'; + info: { + displayName: 'Link'; + icon: 'exit'; + }; + attributes: { + text: Schema.Attribute.String; + url: Schema.Attribute.String; + }; +} + export interface GlobalMedia extends Struct.ComponentSchema { collectionName: 'components_global_media'; info: { @@ -53,6 +65,7 @@ declare module '@strapi/strapi' { export interface ComponentSchemas { 'global.copy': GlobalCopy; 'global.descriptive-list': GlobalDescriptiveList; + 'global.link': GlobalLink; 'global.media': GlobalMedia; 'global.seo': GlobalSeo; } diff --git a/types/generated/contentTypes.d.ts b/types/generated/contentTypes.d.ts index 3cf8703..b11f3c4 100644 --- a/types/generated/contentTypes.d.ts +++ b/types/generated/contentTypes.d.ts @@ -491,6 +491,7 @@ export interface ApiMosaicItemMosaicItem extends Struct.CollectionTypeSchema { Schema.Attribute.Private; dl: Schema.Attribute.Component<'global.descriptive-list', true>; image: Schema.Attribute.Media<'images'>; + image_attribution: Schema.Attribute.Component<'global.link', false>; locale: Schema.Attribute.String & Schema.Attribute.Private; localizations: Schema.Attribute.Relation< 'oneToMany',