Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export function setSiteConfig(newSiteConfig: SiteConfig) {
}

interface MergeSiteConfigOptions {
limitAppMergeToConfig?: boolean,
limitAppMergeToConfig?: boolean;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion runtime/i18n/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export function mergeMessages(newMessages = {}) {
}

interface ConfigureI18nOptions {
messages: LocalizedMessages[] | LocalizedMessages,
messages: LocalizedMessages[] | LocalizedMessages;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions runtime/logging/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface LoggingService {
logError: (errorStringOrObject: string | Error, customAttributes: any) => void,
logInfo: (infoStringOrErrorObject: string | Error, customAttributes: any) => void,
logError: (errorStringOrObject: string | Error, customAttributes: any) => void;
logInfo: (infoStringOrErrorObject: string | Error, customAttributes: any) => void;
}
2 changes: 1 addition & 1 deletion runtime/react/CombinedAppProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { App, AppProvider } from '../../types';
import { getSiteConfig } from '../config';

interface CombinedAppProviderProps {
children: ReactNode,
children: ReactNode;
}

export default function CombinedAppProvider({ children }: CombinedAppProviderProps) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/react/CurrentAppContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { AppConfig } from '../../types';
* @memberof module:React
*/
const CurrentAppContext = createContext<{
appConfig: AppConfig,
appConfig: AppConfig;
}>({
appConfig: {},
});
Expand Down
4 changes: 2 additions & 2 deletions runtime/react/CurrentAppProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import CurrentAppContext from './CurrentAppContext';
import { useSiteEvent } from './hooks';

interface CurrentAppProviderProps {
appId: string,
children: ReactNode,
appId: string;
children: ReactNode;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions runtime/react/SiteContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import { getSiteConfig } from '../config';
* @memberof module:React
*/
const SiteContext = createContext<{
authenticatedUser: User | null,
siteConfig: SiteConfig,
locale: string,
authenticatedUser: User | null;
siteConfig: SiteConfig;
locale: string;
}>({
authenticatedUser: null,
siteConfig: getSiteConfig(),
Expand Down
2 changes: 1 addition & 1 deletion runtime/react/SiteProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import { themeActions } from './reducers';

interface SiteProviderProps {
children: ReactNode,
children: ReactNode;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions runtime/react/hooks/theme/useThemeVariants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ const useThemeVariants = ({
onComplete,
onDarkModeSystemPreferenceChange,
}: {
themeVariants: ThemeVariants | undefined,
currentThemeVariant: string,
onComplete: () => void,
onDarkModeSystemPreferenceChange: (prefersDarkMode: boolean) => void,
themeVariants: ThemeVariants | undefined;
currentThemeVariant: string;
onComplete: () => void;
onDarkModeSystemPreferenceChange: (prefersDarkMode: boolean) => void;
}) => {
const [isThemeVariantComplete, setIsThemeVariantComplete] = useState(false);

Expand Down
10 changes: 5 additions & 5 deletions runtime/slots/Slot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import SlotContext from './SlotContext';
import { useSlotContext } from './hooks';

interface SlotProps {
id: string,
idAliases?: string[],
children?: ReactNode,
layout?: ComponentType | ReactNode,
[key: string]: unknown,
id: string;
idAliases?: string[];
children?: ReactNode;
layout?: ComponentType | ReactNode;
[key: string]: unknown;
}

function SlotRenderer({ layout }: { layout: ComponentType | ReactNode }) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/slots/SlotContext.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext, ReactNode } from 'react';

const SlotContext = createContext<{ id: string, idAliases?: string[], children?: ReactNode, [key: string]: unknown }>({
const SlotContext = createContext<{ id: string; idAliases?: string[]; children?: ReactNode; [key: string]: unknown }>({
id: '',
children: null,
});
Expand Down
12 changes: 6 additions & 6 deletions runtime/slots/layout/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ export enum LayoutOperationTypes {
}

export interface BaseLayoutOperation extends BaseSlotOperation {
op: LayoutOperationTypes,
op: LayoutOperationTypes;
}

// Concrete UI Layout Operations

export type LayoutOptionsOperation = BaseLayoutOperation & {
op: LayoutOperationTypes.OPTIONS,
options: Record<string, unknown>,
op: LayoutOperationTypes.OPTIONS;
options: Record<string, unknown>;
};

export interface LayoutComponentProps {
component: React.ComponentType,
component: React.ComponentType;
}

export interface LayoutElementProps {
element: ReactNode,
element: ReactNode;
}

export type LayoutRendererProps = (
LayoutComponentProps | LayoutElementProps
);

export type LayoutReplaceOperation = BaseLayoutOperation & LayoutRendererProps & {
op: LayoutOperationTypes.REPLACE,
op: LayoutOperationTypes.REPLACE;
};

// Aggregate UI Layout Operations
Expand Down
12 changes: 6 additions & 6 deletions runtime/slots/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import { LayoutOperation } from './layout/types';
import { WidgetOperation } from './widget/types';

export interface SlotOperationCondition {
active?: string[],
inactive?: string[],
authenticated?: boolean,
callback?: () => boolean,
active?: string[];
inactive?: string[];
authenticated?: boolean;
callback?: () => boolean;
}

export interface BaseSlotOperation {
slotId: string,
condition?: SlotOperationCondition,
slotId: string;
condition?: SlotOperationCondition;
}

// Aggregate Slot Operations
Expand Down
2 changes: 1 addition & 1 deletion runtime/slots/widget/WidgetContext.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext } from 'react';

const WidgetContext = createContext<{ slotId: string, widgetId: string, role?: string }>({
const WidgetContext = createContext<{ slotId: string; widgetId: string; role?: string }>({
slotId: '',
widgetId: '',
role: undefined,
Expand Down
8 changes: 4 additions & 4 deletions runtime/slots/widget/WidgetProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { addActiveWidgetRole, removeActiveWidgetRole } from '../../config';
import WidgetContext from './WidgetContext';

interface WidgetProviderProps {
children: ReactNode,
slotId: string,
widgetId: string,
role?: string,
children: ReactNode;
slotId: string;
widgetId: string;
role?: string;
}

export default function WidgetProvider({ children, slotId, widgetId, role }: WidgetProviderProps) {
Expand Down
10 changes: 5 additions & 5 deletions runtime/slots/widget/iframe/IFrameContentWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ const ErrorFallbackDefault = () => {
};

interface IFrameContentWrapperProps {
children: ReactNode,
className?: string,
style?: Record<string, string>,
ready?: boolean,
errorFallbackComponent?: FunctionComponent,
children: ReactNode;
className?: string;
style?: Record<string, string>;
ready?: boolean;
errorFallbackComponent?: FunctionComponent;
}

export default function IFrameContentWrapper({
Expand Down
4 changes: 2 additions & 2 deletions runtime/slots/widget/iframe/IFrameWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { dispatchPluginEvent, useElementSize, usePluginEvent } from './hooks';
import { IFRAME_FEATURE_POLICY, IFRAME_MOUNTED, IFRAME_READY, IFRAME_RESIZE } from './constants';

interface IFrameWidgetProps {
url: string,
title: string,
url: string;
title: string;
}

export default function IFrameWidget({ url, title }: IFrameWidgetProps) {
Expand Down
14 changes: 7 additions & 7 deletions runtime/slots/widget/iframe/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function useMessageEvent(srcWindow: Window | null, type: string, callback
// useLayoutEffect is called before the browser repaints the screen
useLayoutEffect(() => {
// Create a listener callback function
const listener = (event: MessageEvent<{ type: string, payload: any }>) => {
const listener = (event: MessageEvent<{ type: string; payload: any }>) => {
// Filter messages to those from our source window.
// NOTE: the "srcWindow" is determined by the below useHostEvent and usePluginEvent functions
if (event.source === srcWindow) {
Expand Down Expand Up @@ -159,12 +159,12 @@ export function useElementSize() {
}, [element]);

return useMemo<{
ref: LegacyRef<HTMLIFrameElement>,
element: HTMLIFrameElement | undefined,
width: number,
height: number,
x: number,
y: number,
ref: LegacyRef<HTMLIFrameElement>;
element: HTMLIFrameElement | undefined;
width: number;
height: number;
x: number;
y: number;
}>(
() => ({
ref: measuredRef,
Expand Down
4 changes: 2 additions & 2 deletions runtime/slots/widget/iframe/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface MessageEventCallbackParams {
type: string,
payload: any,
type: string;
payload: any;
}

export type MessageEventCallback = ({ type, payload }: MessageEventCallbackParams) => void;
Expand Down
46 changes: 23 additions & 23 deletions runtime/slots/widget/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,62 +53,62 @@ export type AbsoluteWidgetOperationTypes = WidgetOperationTypes.APPEND | WidgetO
export type RelativeWidgetOperationTypes = WidgetOperationTypes.INSERT_AFTER | WidgetOperationTypes.INSERT_BEFORE | WidgetOperationTypes.REPLACE | WidgetOperationTypes.OPTIONS;

export interface BaseWidgetOperation extends BaseSlotOperation {
op: WidgetOperationTypes,
op: WidgetOperationTypes;
}

// Widget renderer props

export interface WidgetComponentProps {
component: React.ComponentType,
component: React.ComponentType;
}

export interface WidgetElementProps {
element: ReactNode,
element: ReactNode;
}

export interface WidgetIFrameProps {
url: string,
title: string,
url: string;
title: string;
}

export type WidgetRendererProps = (
WidgetComponentProps | WidgetElementProps | WidgetIFrameProps
);

export interface WidgetIdentityProps {
id: string,
role?: string,
id: string;
role?: string;
}

export interface WidgetRelationshipProps {
relatedId: string,
relatedId: string;
}

// Concrete UI Widget Operations

export type WidgetAppendOperation = BaseWidgetOperation & WidgetIdentityProps & WidgetRendererProps & {
op: WidgetOperationTypes.APPEND,
op: WidgetOperationTypes.APPEND;
};

export type WidgetPrependOperation = BaseWidgetOperation & WidgetIdentityProps & WidgetRendererProps & {
op: WidgetOperationTypes.PREPEND,
op: WidgetOperationTypes.PREPEND;
};

export type WidgetInsertAfterOperation = BaseWidgetOperation & WidgetIdentityProps & WidgetRendererProps & WidgetRelationshipProps & {
op: WidgetOperationTypes.INSERT_AFTER,
op: WidgetOperationTypes.INSERT_AFTER;
};

export type WidgetInsertBeforeOperation = BaseWidgetOperation & WidgetIdentityProps & WidgetRendererProps & WidgetRelationshipProps & {
op: WidgetOperationTypes.INSERT_BEFORE,
op: WidgetOperationTypes.INSERT_BEFORE;
};

export type WidgetRemoveOperation = BaseWidgetOperation & WidgetRelationshipProps & {
op: WidgetOperationTypes.REMOVE,
op: WidgetOperationTypes.REMOVE;
};

export type WidgetOptionsOperation = BaseWidgetOperation & WidgetRelationshipProps & {
op: WidgetOperationTypes.OPTIONS,
options: Record<string, unknown>,
op: WidgetOperationTypes.OPTIONS;
options: Record<string, unknown>;
};

export type WidgetReplaceOperation = BaseWidgetOperation & WidgetIdentityProps & WidgetRendererProps & WidgetRelationshipProps & { op: WidgetOperationTypes.REPLACE };
Expand All @@ -129,15 +129,15 @@ export type WidgetOperation = WidgetAbsoluteOperation | WidgetRelativeOperation;
* ID for relative widget operations.
*/
export interface IdentifiedWidget {
id: string,
role?: string,
node: ReactNode,
id: string;
role?: string;
node: ReactNode;
}

export interface WidgetList extends Array<ReactNode> {
identified: IdentifiedWidget[],
byId(id: string): ReactNode[],
withoutId(id: string): ReactNode[],
byRole(role: string): ReactNode[],
withoutRole(role: string): ReactNode[],
identified: IdentifiedWidget[];
byId(id: string): ReactNode[];
withoutId(id: string): ReactNode[];
byRole(role: string): ReactNode[];
withoutRole(role: string): ReactNode[];
}
4 changes: 2 additions & 2 deletions runtime/testing/initializeMockApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export default function initializeMockApp({
messages = mockMessages,
authenticatedUser = null,
}: {
messages?: LocalizedMessages,
authenticatedUser?: User | null,
messages?: LocalizedMessages;
authenticatedUser?: User | null;
} = {}) {
const config = siteConfig;
mergeSiteConfig(config);
Expand Down
4 changes: 2 additions & 2 deletions shell/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { getUrlByRouteRole } from '../runtime/routing';
import { homeRole } from './constants';

interface LogoProps {
imageUrl?: string,
destinationUrl?: string,
imageUrl?: string;
destinationUrl?: string;
}

export default function Logo({
Expand Down
4 changes: 2 additions & 2 deletions shell/dev/devHeader/BarContext.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createContext, Dispatch, SetStateAction } from 'react';

interface BarContextInterface {
bar: string,
setBar: Dispatch<SetStateAction<string>>,
bar: string;
setBar: Dispatch<SetStateAction<string>>;
};

const BarContext = createContext<BarContextInterface>({
Expand Down
Loading