@foris/avocado-not-front 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avocado-not-front/src/components/breadcrumbs/Breadcrumbs.d.ts +2 -5
- package/dist/avocado-not-front/src/components/breadcrumbs/Breadcrumbs.test.d.ts +1 -0
- package/dist/avocado-not-front/src/components/header-navigation/HeaderNavigation.d.ts +10 -0
- package/dist/avocado-not-front/src/components/header-navigation/HeaderNavigation.test.d.ts +1 -0
- package/dist/avocado-not-front/src/components/header-navigation/useHeaderNavigationActions.d.ts +6 -0
- package/dist/avocado-not-front/src/components/header-navigation/useHeaderNavigationActions.test.d.ts +1 -0
- package/dist/avocado-not-front/src/components/index.d.ts +2 -1
- package/dist/avocado-not-front/src/hooks/builder/useBuildComponentsList.test.d.ts +1 -0
- package/dist/avocado-not-front/src/hooks/useAction.d.ts +15 -0
- package/dist/avocado-not-front/src/hooks/useNotFrontBreadcrumbActionRunner.d.ts +6 -0
- package/dist/avocado-not-front/src/hooks/useNotFrontBreadcrumbActionRunner.test.d.ts +1 -0
- package/dist/avocado-not-front/src/hooks/useNotFrontButtonActionRunner.d.ts +2 -5
- package/dist/avocado-not-front/src/types/builder.type.d.ts +4 -2
- package/dist/avocado-not-front/src/types/components.type.d.ts +39 -2
- package/dist/avocado-not-front/src/types/componentsCore.type.d.ts +3 -1
- package/dist/avocado-not-front.es.js +1856 -1788
- package/dist/avocado-not-front.umd.js +3 -3
- package/package.json +7 -7
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { BreadcrumbsNotFrontProps } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Extended props for NotFront Breadcrumbs component.
|
|
4
|
-
* Includes context identifiers for the userFlow and pageId.
|
|
5
|
-
*/
|
|
1
|
+
import type { BreadcrumbsNotFrontProps } from '../../types';
|
|
2
|
+
/** Includes context identifiers for the NotFront action pipeline. */
|
|
6
3
|
interface BreadcrumbsNotFrontExtendedProps extends BreadcrumbsNotFrontProps {
|
|
7
4
|
userFlow: string;
|
|
8
5
|
pageId: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { HeaderNavigationNotFrontProps, ResolveComponentPropsMap } from '../../types';
|
|
3
|
+
export interface HeaderNavigationNotFrontExtendedProps extends HeaderNavigationNotFrontProps {
|
|
4
|
+
userFlow: string;
|
|
5
|
+
pageId: string;
|
|
6
|
+
onResolveComponentProps?: ResolveComponentPropsMap;
|
|
7
|
+
}
|
|
8
|
+
/** JSON adapter for both the page slot and nested component lists. */
|
|
9
|
+
declare const HeaderNavigationNotFront: FC<HeaderNavigationNotFrontExtendedProps>;
|
|
10
|
+
export default HeaderNavigationNotFront;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/avocado-not-front/src/components/header-navigation/useHeaderNavigationActions.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HeaderNavigationNotFrontProps } from '../../types';
|
|
2
|
+
/** Adapts header navigation without retaining stale page or action configuration. */
|
|
3
|
+
export declare const useHeaderNavigationActions: (userFlow: string, pageId: string, responseKey: string, breadcrumbsItems: NonNullable<HeaderNavigationNotFrontProps['breadcrumbsItems']>, menuItems: NonNullable<HeaderNavigationNotFrontProps['menuItems']>) => {
|
|
4
|
+
breadcrumbs: BreadcrumbItem[];
|
|
5
|
+
menu: MenuItem[];
|
|
6
|
+
};
|
package/dist/avocado-not-front/src/components/header-navigation/useHeaderNavigationActions.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -21,6 +21,7 @@ import Divider from './divider/Divider';
|
|
|
21
21
|
import Drawer from './drawer/Drawer';
|
|
22
22
|
import DropdownButtonNotFront from './dropdown-button/DropdownButton';
|
|
23
23
|
import Header from './header/Header';
|
|
24
|
+
import HeaderNavigation from './header-navigation/HeaderNavigation';
|
|
24
25
|
import Link from './link/Link';
|
|
25
26
|
import MenuNotFront from './menu/Menu';
|
|
26
27
|
import Modal from './modal/Modal';
|
|
@@ -40,4 +41,4 @@ import Toast from './toast/Toast';
|
|
|
40
41
|
import Tooltip from './tooltip/Tooltip';
|
|
41
42
|
import { NotFrontPage } from './not-front-page/NotFrontPage';
|
|
42
43
|
import { RenderNotFront, renderNotFront, extractNotFrontComponents } from './render-not-front';
|
|
43
|
-
export { Accordion, AIChatPanel, AIPromptCodeEditor, AISummaryCard, Body, Box, RadioGroupNotFront, StepperNotFront, ProgressBarNotFront, Breadcrumbs, Button, CardAccordion, CardNotFront, CardNotification, Chart, Checkbox, CodeEditor, ContentWrapper, DataCard, Divider, Drawer, DropdownButtonNotFront, Header, Link, MenuNotFront, Modal, NotFrontPage, OverlayRenderer, RenderNotFront, renderNotFront, extractNotFrontComponents, Pill, PreviewerMarkdown, RoundButton, Row, Select, Spacing, Switch, Table, Tabs, Textarea, TextField, Toast, Tooltip, };
|
|
44
|
+
export { Accordion, AIChatPanel, AIPromptCodeEditor, AISummaryCard, Body, Box, RadioGroupNotFront, StepperNotFront, ProgressBarNotFront, Breadcrumbs, Button, CardAccordion, CardNotFront, CardNotification, Chart, Checkbox, CodeEditor, ContentWrapper, DataCard, Divider, Drawer, DropdownButtonNotFront, Header, HeaderNavigation, Link, MenuNotFront, Modal, NotFrontPage, OverlayRenderer, RenderNotFront, renderNotFront, extractNotFrontComponents, Pill, PreviewerMarkdown, RoundButton, Row, Select, Spacing, Switch, Table, Tabs, Textarea, TextField, Toast, Tooltip, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { NotFrontDataSource } from '../types/componentsCore.type';
|
|
3
3
|
import { NextUIResponseData } from '../types/builder.type';
|
|
4
|
+
type GetNextUIFn = (userFlow: string, pageHash: string, entries: Record<string, unknown>, responseKey: string, showLoading?: boolean) => Promise<AxiosResponse<NextUIResponseData> | undefined>;
|
|
5
|
+
type FetchDataSourceFn = (dataSource: NotFrontDataSource, userFlow: string, showLoading?: boolean) => Promise<{
|
|
6
|
+
status?: number;
|
|
7
|
+
data?: unknown;
|
|
8
|
+
} | undefined>;
|
|
9
|
+
/**
|
|
10
|
+
* Runs the GET_DATA_SOURCE pipeline: next-ui fetch config, external request,
|
|
11
|
+
* session update, then next-ui re-render.
|
|
12
|
+
*
|
|
13
|
+
* Fetch results are stored under ``content.responseKey`` from the backend
|
|
14
|
+
* when present; otherwise the triggering component key is used.
|
|
15
|
+
*/
|
|
16
|
+
export declare function runGetDataSourceFlow(userFlow: string, pageHash: string, triggerKey: string, entries: Record<string, unknown>, getNextUI: GetNextUIFn, fetchDataSource: FetchDataSourceFn): Promise<void>;
|
|
4
17
|
/**
|
|
5
18
|
* Custom hook that encapsulates actions related to navigation and data fetching for dynamic UI flows.
|
|
6
19
|
*/
|
|
@@ -11,4 +24,6 @@ export declare const useAction: () => {
|
|
|
11
24
|
data: {};
|
|
12
25
|
} | undefined>;
|
|
13
26
|
fetchAndGetNextUI: (userFlow: string, pageHash: string, entries: any, responseKey: string, dataSource: NotFrontDataSource) => Promise<AxiosResponse<NextUIResponseData, any> | undefined>;
|
|
27
|
+
runGetDataSource: (userFlow: string, pageHash: string, triggerKey: string, entries: Record<string, unknown>) => Promise<void>;
|
|
14
28
|
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface BreadcrumbActionFields {
|
|
2
|
+
hashCode: string;
|
|
3
|
+
responseKey?: string;
|
|
4
|
+
}
|
|
5
|
+
/** Runs the shared next-UI pipeline for an interactive breadcrumb. */
|
|
6
|
+
export declare const useNotFrontBreadcrumbActionRunner: (userFlow: string, fallbackResponseKey: string) => ({ hashCode, responseKey }: BreadcrumbActionFields) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type ButtonActionFields
|
|
3
|
-
dataSource?: ButtonNotFrontProps['dataSource'];
|
|
4
|
-
redirectUrl?: string;
|
|
5
|
-
};
|
|
1
|
+
import type { ButtonActionFields } from '../types';
|
|
2
|
+
export type { ButtonActionFields } from '../types';
|
|
6
3
|
/**
|
|
7
4
|
* Runs the same NotFront action pipeline as {@link ButtonNotFront} for a
|
|
8
5
|
* single action bundle (e.g. one menu or dropdown row).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NotFrontComponent } from './components.type';
|
|
2
|
-
import { NotFrontDataSource } from './componentsCore.type';
|
|
1
|
+
import type { HeaderNavigationNotFrontProps, NotFrontComponent } from './components.type';
|
|
2
|
+
import type { NotFrontDataSource } from './componentsCore.type';
|
|
3
3
|
/**
|
|
4
4
|
* Interface for the configuration required to interact with the API.
|
|
5
5
|
* This interface includes the necessary details for the API connection.
|
|
@@ -60,6 +60,8 @@ export interface ObjectNotFront {
|
|
|
60
60
|
*/
|
|
61
61
|
export type PageContent = {
|
|
62
62
|
type: 'page';
|
|
63
|
+
/** Full-width navigation banner, rendered after an explicit legacy header and before the body. */
|
|
64
|
+
headerNavigation?: HeaderNavigationNotFrontProps | null;
|
|
63
65
|
/**
|
|
64
66
|
* A collection of components to be rendered in the page.
|
|
65
67
|
* These components make up the structure of the page content.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccordionProps, ButtonProps, CardAccordionProps, CardNotificationProps, CheckboxProps, DataCardPaletteIndex, DataCardV2HeaderStyle, DataCardV2Status, DividerProps, DrawerProps, HeadingProps, LinkProps, ModalProps, PillProps, PreviewerMarkdownProps, RoundButtonProps, SelectProps, SwitchProps, TableColumn, TableProps, TabsProps, TextareaProps, TextFieldProps, TextProps } from '../../../avocado-suite';
|
|
1
|
+
import type { AccordionProps, ButtonProps, CardAccordionProps, CardNotificationProps, CheckboxProps, DataCardPaletteIndex, DataCardV2HeaderStyle, DataCardV2Status, DividerProps, DrawerProps, HeadingProps, HeaderNavigationVisual, LinkProps, ModalProps, PillProps, PreviewerMarkdownProps, RoundButtonProps, SelectProps, SwitchProps, TableColumn, TableProps, TabsProps, TextareaProps, TextFieldProps, TextProps } from '../../../avocado-suite';
|
|
2
2
|
import type { AiAgentTheme, ChatPanelTranslations, SuggestionType, SupportedLocale } from '../../../ai-agent';
|
|
3
3
|
import type { TooltipCoverageConfig } from '../components/chart/chart.types';
|
|
4
4
|
import type { ChartSeriesConfig, ChartYAxisConfig } from '../components/chart/chart.types';
|
|
@@ -11,6 +11,42 @@ export interface BoxNotFrontProps extends NotFrontBaseProps {
|
|
|
11
11
|
component: 'box';
|
|
12
12
|
content: NotFrontComponent[];
|
|
13
13
|
}
|
|
14
|
+
/** Navigation action using the existing breadcrumb field names. */
|
|
15
|
+
export type HeaderNavigationBreadcrumbNotFront = Pick<BreadcrumbsItemNotFront, 'title'> & ({
|
|
16
|
+
actionType?: never;
|
|
17
|
+
} | {
|
|
18
|
+
actionType: 'REDIRECT';
|
|
19
|
+
redirectUrl: string;
|
|
20
|
+
} | {
|
|
21
|
+
actionType: 'GO_TO_NEXT_UI';
|
|
22
|
+
hashCode: string;
|
|
23
|
+
responseKey?: string;
|
|
24
|
+
});
|
|
25
|
+
/** Serializable menu row, executed by the standard not-front button pipeline. */
|
|
26
|
+
export type ButtonActionFields = Pick<ButtonNotFrontProps, 'responseKey' | 'actionType' | 'dependencies'> & {
|
|
27
|
+
dataSource?: ButtonNotFrontProps['dataSource'];
|
|
28
|
+
redirectUrl?: string;
|
|
29
|
+
};
|
|
30
|
+
export interface HeaderNavigationMenuItemNotFront extends Omit<ButtonActionFields, 'actionType'>, Pick<ButtonNotFrontProps, 'content' | 'leftIcon'> {
|
|
31
|
+
label?: string;
|
|
32
|
+
actionType: Exclude<NotFrontActionType, 'GO_TO_NEXT_UI_WITHOUT_LOADING' | 'AUTOCLOSE_AND_REDIRECT'>;
|
|
33
|
+
}
|
|
34
|
+
/** Independent page banner; also usable inside component lists. */
|
|
35
|
+
export interface HeaderNavigationNotFrontProps extends NotFrontBaseProps {
|
|
36
|
+
component: 'headerNavigation';
|
|
37
|
+
title: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
background?: 'default' | 'brand';
|
|
40
|
+
leadingVisual?: HeaderNavigationVisual;
|
|
41
|
+
pattern?: boolean | string;
|
|
42
|
+
menuLabel?: string;
|
|
43
|
+
menuDisabled?: boolean;
|
|
44
|
+
className?: string;
|
|
45
|
+
breadcrumbsItems?: HeaderNavigationBreadcrumbNotFront[];
|
|
46
|
+
menuItems?: HeaderNavigationMenuItemNotFront[];
|
|
47
|
+
/** Additional content such as a stepper. */
|
|
48
|
+
components?: NotFrontComponent[];
|
|
49
|
+
}
|
|
14
50
|
/**
|
|
15
51
|
* Interface for the props used in the ChartNotFront component.
|
|
16
52
|
*/
|
|
@@ -1302,7 +1338,7 @@ export interface AIPromptCodeEditorNotFrontProps extends NotFrontBaseProps {
|
|
|
1302
1338
|
/**
|
|
1303
1339
|
* Union type representing all possible NotFront component prop types.
|
|
1304
1340
|
*/
|
|
1305
|
-
export type NotFrontComponent = AccordionNotFrontProps | AIChatPanelNotFrontProps | AIPromptCodeEditorNotFrontProps | AISummaryCardNotFrontProps | BoxNotFrontProps | BreadcrumbsNotFrontProps | ButtonNotFrontProps | CardAccordionNotFrontProps | CardNotFrontProps | CardNotificationNotFrontProps | ChartNotFrontProps | CheckboxNotFrontProps | CodeEditorNotFrontProps | DataCardNotFrontProps | DividerNotFrontProps | DrawerNotFrontProps | DropdownButtonNotFrontProps | HeadingNotFrontProps | LinkNotFrontProps | MenuNotFrontProps | ModalNotFrontProps | PillNotFrontProps | PreviewerMarkdownNotFrontProps | RadioGroupNotFrontProps | RoundButtonNotFrontProps | RowNotFrontProps | SelectNotFrontProps | SpacingNotFrontProps | StepperNotFrontProps | ProgressBarNotFrontProps | SwitchNotFrontProps | TableNotFrontProps | TabsNotFrontProps | TextareaNotFrontProps | TextFieldNotFrontProps | TextNotFrontProps | ToastNotFrontProps | TooltipNotFrontProps;
|
|
1341
|
+
export type NotFrontComponent = HeaderNavigationNotFrontProps | AccordionNotFrontProps | AIChatPanelNotFrontProps | AIPromptCodeEditorNotFrontProps | AISummaryCardNotFrontProps | BoxNotFrontProps | BreadcrumbsNotFrontProps | ButtonNotFrontProps | CardAccordionNotFrontProps | CardNotFrontProps | CardNotificationNotFrontProps | ChartNotFrontProps | CheckboxNotFrontProps | CodeEditorNotFrontProps | DataCardNotFrontProps | DividerNotFrontProps | DrawerNotFrontProps | DropdownButtonNotFrontProps | HeadingNotFrontProps | LinkNotFrontProps | MenuNotFrontProps | ModalNotFrontProps | PillNotFrontProps | PreviewerMarkdownNotFrontProps | RadioGroupNotFrontProps | RoundButtonNotFrontProps | RowNotFrontProps | SelectNotFrontProps | SpacingNotFrontProps | StepperNotFrontProps | ProgressBarNotFrontProps | SwitchNotFrontProps | TableNotFrontProps | TabsNotFrontProps | TextareaNotFrontProps | TextFieldNotFrontProps | TextNotFrontProps | ToastNotFrontProps | TooltipNotFrontProps;
|
|
1306
1342
|
/**
|
|
1307
1343
|
* Resolved props for ChatPanel when delegated via onResolveComponentProps.
|
|
1308
1344
|
* These are the props that the consumer receives to render ChatPanel externally.
|
|
@@ -1353,6 +1389,7 @@ export type ResolveComponentPropsMap = {
|
|
|
1353
1389
|
* Mapping of component identifiers (as strings) to their corresponding prop types.
|
|
1354
1390
|
*/
|
|
1355
1391
|
export type NotFrontComponentTypeMap = {
|
|
1392
|
+
headerNavigation: HeaderNavigationNotFrontProps;
|
|
1356
1393
|
accordion: AccordionNotFrontProps;
|
|
1357
1394
|
aiChatPanel: AIChatPanelNotFrontProps;
|
|
1358
1395
|
aiPromptCodeEditor: AIPromptCodeEditorNotFrontProps;
|
|
@@ -9,7 +9,9 @@ export interface NotFrontBaseProps {
|
|
|
9
9
|
* - `FETCH_AND_GO_TO_NEXT_UI`: fetches the component's `dataSource`, then
|
|
10
10
|
* requests the next UI and re-renders the page.
|
|
11
11
|
* - `GET_DATA_SOURCE`: asks the backend for a fetch instruction via next-ui,
|
|
12
|
-
* executes it,
|
|
12
|
+
* executes it, stores the result under the fetch payload's `responseKey`
|
|
13
|
+
* (falling back to the triggering component key), then re-renders with the
|
|
14
|
+
* resulting next UI.
|
|
13
15
|
* - `FETCH_DATA_SOURCE`: side-effect only — fetches the component's
|
|
14
16
|
* `dataSource` and stores the result in entries as `{ status, content }`
|
|
15
17
|
* under the component's `responseKey`. No next-ui call, the current page
|