diff --git a/components/molecules/VRoadizLink/VRoadizLink.vue b/components/molecules/VRoadizLink/VRoadizLink.vue index 41533e62..935ed515 100644 --- a/components/molecules/VRoadizLink/VRoadizLink.vue +++ b/components/molecules/VRoadizLink/VRoadizLink.vue @@ -1,13 +1,12 @@ + + diff --git a/components/organisms/VMainMenu/Toggle.stories.vue b/components/organisms/VMainMenu/Toggle.stories.vue new file mode 100644 index 00000000..3a55dd95 --- /dev/null +++ b/components/organisms/VMainMenu/Toggle.stories.vue @@ -0,0 +1,105 @@ + + + diff --git a/components/organisms/VMainMenu/VMainMenu.vue b/components/organisms/VMainMenu/VMainMenu.vue new file mode 100644 index 00000000..2b1bc02e --- /dev/null +++ b/components/organisms/VMainMenu/VMainMenu.vue @@ -0,0 +1,56 @@ + + + + + + diff --git a/types/api.d.ts b/types/api.d.ts index bfb824c7..d8a6a04c 100644 --- a/types/api.d.ts +++ b/types/api.d.ts @@ -5,8 +5,9 @@ import type { RoadizNodesSourcesHead, RoadizWebResponse, } from '@roadiz/types' -import type { MenuNodeType } from '~/types/app' -import type { RoadizWalkerKnown } from '~/utils/types' + +import type { RoadizWalkerKnown } from '~/utils/roadiz/types' +import type { NSMenu, NSMenuLink } from '~/types/roadiz' interface HydraError { '@context': string @@ -38,7 +39,7 @@ type CommonContentMenuKey = 'mainMenuWalker' | string interface CommonContent { home?: RoadizNodesSources head?: RoadizNodesSourcesHead - menus?: Record> + menus?: Record> errorPage?: RoadizWalkerKnown } diff --git a/types/app.d.ts b/types/app.d.ts deleted file mode 100644 index ce07e063..00000000 --- a/types/app.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { RoadizNodesSources } from '@roadiz/types' -import type { UnionToIntersection } from '~/utils/types' - -export type MenuNodeType = RoadizNodesSources -export type MenuNodeKeyMerged = Partial> - -export type ReachableItem = RoadizNodesSources -export type ReachableItemMerged = Partial> diff --git a/types/json-schema.d.ts b/types/json-schema.d.ts index ec10875f..16a90cf3 100644 --- a/types/json-schema.d.ts +++ b/types/json-schema.d.ts @@ -2,7 +2,6 @@ import type { JSONSchema4 } from 'json-schema' export interface JsonSchemaExtended extends JSONSchema4 { widget?: string - enum_titles?: string[] attr?: Record } diff --git a/types/roadiz.d.ts b/types/roadiz.d.ts index f5756699..4f0b9f8a 100644 --- a/types/roadiz.d.ts +++ b/types/roadiz.d.ts @@ -1,11 +1,21 @@ /* - * This is an automated Roadiz interface declaration file. + * This file content should be replaced entirely with new types definitions exported from Roadiz. + * * RoadizNodesSources, RoadizDocument and other mentioned types are part of - * roadiz/abstract-api-client package which must be installed in your project. + * @roadiz/types package which must be installed in your project. * - * @see https://github.com/roadiz/abstract-api-client + * @see https://github.com/roadiz/types#readme * * Roadiz CMS node-types interfaces * * @see https://docs.roadiz.io/en/latest/developer/nodes-system/intro.html#what-is-a-node-type */ + +import type { RoadizNodesSources } from '@roadiz/types' + +export type NSMenu = RoadizNodesSources + +export interface NSMenuLink extends RoadizNodesSources { + linkExternalUrl?: string + linkInternalReference?: Array +} diff --git a/utils/roadiz/entity.ts b/utils/roadiz/entity.ts index 8ff2a802..e23d6239 100644 --- a/utils/roadiz/entity.ts +++ b/utils/roadiz/entity.ts @@ -41,6 +41,14 @@ export function isBlogListingEntity(entity: JsonLdObject): boolean { return isEntityType(entity, 'BlogPostContainer') } +export function isMenuLinkEntity(entity: JsonLdObject): boolean { + return isEntityType(entity, 'MenuLink') +} + +export function isMenuEntity(entity: JsonLdObject): boolean { + return isEntityType(entity, 'Menu') +} + // BLOCKS export function isContentBlock(entity: JsonLdObject): boolean { return isEntityType(entity, 'ContentBlock') diff --git a/utils/roadiz/types.ts b/utils/roadiz/types.ts new file mode 100644 index 00000000..76cfda69 --- /dev/null +++ b/utils/roadiz/types.ts @@ -0,0 +1,6 @@ +import type { JsonLdObject, RoadizNodesSources } from '@roadiz/types' + +export interface RoadizWalkerKnown extends JsonLdObject { + item: Item + children: RoadizWalkerKnown[] +} diff --git a/utils/types.ts b/utils/types.ts index 32be2107..c4454681 100644 --- a/utils/types.ts +++ b/utils/types.ts @@ -1,12 +1,5 @@ -// ROADIZ -import type { RoadizNodesSources, JsonLdObject } from '@roadiz/types' - -export interface RoadizWalkerKnown extends JsonLdObject { - item: T - children: RoadizWalkerKnown[] -} - -// COMMONS export type Writeable = { -readonly [P in keyof T]: T[P] } + export type UnionToIntersection = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never + export type ValueOf = T extends unknown[] ? T[number] : T[keyof T]