From 81bbc82c535fd37f83888ec6f568fefe30233869 Mon Sep 17 00:00:00 2001 From: Christian Westgaard Date: Tue, 10 Dec 2024 13:46:45 +0100 Subject: [PATCH] Adapt to refactor in react-components --- src/main/resources/react4xp/entries/App.tsx | 4 ++-- src/main/resources/react4xp/layouts/TwoColumnsLayout.tsx | 8 ++++---- src/main/resources/react4xp/pages/DefaultPage.tsx | 8 ++++---- src/main/resources/react4xp/parts/ExamplePart.tsx | 8 ++++---- .../resources/site/content-types/baseShortcutProcessor.ts | 6 ------ src/main/resources/site/controllers/component.ts | 2 +- 6 files changed, 15 insertions(+), 21 deletions(-) diff --git a/src/main/resources/react4xp/entries/App.tsx b/src/main/resources/react4xp/entries/App.tsx index a7d85ff7..ccbd64b4 100644 --- a/src/main/resources/react4xp/entries/App.tsx +++ b/src/main/resources/react4xp/entries/App.tsx @@ -1,12 +1,12 @@ import type { AppProps } from '/types/AppProps'; import * as React from 'react'; -import {XpComponent} from '@enonic/react-components'; +import {BaseComponent} from '@enonic/react-components'; import {componentRegistry} from '../componentRegistry'; const App: React.FC = (props) => { return ( - + ); } diff --git a/src/main/resources/react4xp/layouts/TwoColumnsLayout.tsx b/src/main/resources/react4xp/layouts/TwoColumnsLayout.tsx index cb787457..e58f78bb 100644 --- a/src/main/resources/react4xp/layouts/TwoColumnsLayout.tsx +++ b/src/main/resources/react4xp/layouts/TwoColumnsLayout.tsx @@ -3,7 +3,7 @@ import type {ComponentRegistry} from '@enonic/react-components'; // import { toStr } from '@enonic/js-utils/value/toStr'; -import {XpLayout} from '@enonic/react-components'; +import {Layout} from '@enonic/react-components'; import * as React from 'react'; export interface TwoColumnsLayoutProps { @@ -16,8 +16,8 @@ export function TwoColumnsLayout (props: TwoColumnsLayoutProps) { // console.debug('TwoColumnsLayout props:', toStr(props)); return ( // @ts-expect-error regions not compatible - - + ); } diff --git a/src/main/resources/react4xp/pages/DefaultPage.tsx b/src/main/resources/react4xp/pages/DefaultPage.tsx index 938d193b..f1c9d47a 100644 --- a/src/main/resources/react4xp/pages/DefaultPage.tsx +++ b/src/main/resources/react4xp/pages/DefaultPage.tsx @@ -6,7 +6,7 @@ import './default.sass'; // Create Error reference failed // import { toStr } from '@enonic/js-utils/value/toStr'; import { ComponentRegistry, - XpPage + Page } from '@enonic/react-components'; // import dayjs from 'dayjs'; import * as React from 'react'; @@ -23,8 +23,8 @@ export function DefaultPage(props: DefaultPageProps) { // console.info('DefaultPage props:', toStr(props)); return ( // @ts-expect-error regions not compatible - Page: {dayjs().format()} */} - + ); } diff --git a/src/main/resources/react4xp/parts/ExamplePart.tsx b/src/main/resources/react4xp/parts/ExamplePart.tsx index 3c5f6c64..3391c82d 100644 --- a/src/main/resources/react4xp/parts/ExamplePart.tsx +++ b/src/main/resources/react4xp/parts/ExamplePart.tsx @@ -7,7 +7,7 @@ import './example.sass'; import * as React from 'react'; import { RichText, - XpPart, + Part, } from '@enonic/react-components'; export interface ExampleProps { @@ -31,8 +31,8 @@ export function ExamplePart(props: ExampleProps) { return
Example Part: Please fill in the htmlArea.
; } return ( - - + ); } diff --git a/src/main/resources/site/content-types/baseShortcutProcessor.ts b/src/main/resources/site/content-types/baseShortcutProcessor.ts index 017c461b..dbbd929d 100644 --- a/src/main/resources/site/content-types/baseShortcutProcessor.ts +++ b/src/main/resources/site/content-types/baseShortcutProcessor.ts @@ -17,12 +17,6 @@ type BaseShortcutContent = Content<{ target: string; }, 'base:shortcut'>; -// declare global { -// interface XpContent { -// 'base:shortcut': BaseShortcutContent; -// } -// } - export const baseShortcutProcessorWrapper = (dataFetcher): ContentTypeProcessorFunction => (params) => { // log.info('baseShortcutProcessor params:%s', toStr(params)); const { diff --git a/src/main/resources/site/controllers/component.ts b/src/main/resources/site/controllers/component.ts index bec660ab..7ce3f3e0 100644 --- a/src/main/resources/site/controllers/component.ts +++ b/src/main/resources/site/controllers/component.ts @@ -104,7 +104,7 @@ export function get(request: Request) { } log.info('ComponentUrl component:%s', toStr(component)); - // Props for XpComponent + // Props for BaseComponent const props: Record = {}; // if (type === 'text') { // props.component = component;