@funcd-dev/ui 0.0.0-bootstrap.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/Readme.md +10 -0
- package/dist/atoms/index.d.ts +1 -0
- package/dist/atoms/logo/cnd.d.ts +6 -0
- package/dist/atoms/logo/index.d.ts +1 -0
- package/dist/auth/auth.context.d.ts +3 -0
- package/dist/auth/auth.guard.d.ts +7 -0
- package/dist/auth/auth.hooks.d.ts +3 -0
- package/dist/auth/auth.provider.d.ts +10 -0
- package/dist/auth/index.d.ts +4 -0
- package/dist/favicon.svg +1 -0
- package/dist/hm-flow/components/canvas-form/canvas-form.d.ts +10 -0
- package/dist/hm-flow/components/canvas-form/index.d.ts +1 -0
- package/dist/hm-flow/components/header-status/header-status.d.ts +11 -0
- package/dist/hm-flow/components/header-status/header-status.types.d.ts +13 -0
- package/dist/hm-flow/components/header-status/index.d.ts +2 -0
- package/dist/hm-flow/components/hm-flow-bottom/hm-flow-bottom.d.ts +7 -0
- package/dist/hm-flow/components/hm-flow-bottom/hm-flow-bottom.type.d.ts +5 -0
- package/dist/hm-flow/components/hm-flow-bottom/index.d.ts +3 -0
- package/dist/hm-flow/components/hm-flow-header/hm-flow-header.d.ts +7 -0
- package/dist/hm-flow/components/hm-flow-header/hm-flow-header.type.d.ts +5 -0
- package/dist/hm-flow/components/hm-flow-header/index.d.ts +3 -0
- package/dist/hm-flow/components/hm-flow-modal/hm-flow-modal.d.ts +11 -0
- package/dist/hm-flow/components/hm-flow-modal/hm-flow-modal.type.d.ts +13 -0
- package/dist/hm-flow/components/hm-flow-modal/index.d.ts +3 -0
- package/dist/hm-flow/components/hm-flow-sidebar/hm-flow-sidebar.d.ts +11 -0
- package/dist/hm-flow/components/hm-flow-sidebar/hm-flow-sidebar.type.d.ts +5 -0
- package/dist/hm-flow/components/hm-flow-sidebar/index.d.ts +3 -0
- package/dist/hm-flow/components/index.d.ts +9 -0
- package/dist/hm-flow/components/node-editor/index.d.ts +1 -0
- package/dist/hm-flow/components/node-editor/node-editor.d.ts +7 -0
- package/dist/hm-flow/components/node-search/index.d.ts +2 -0
- package/dist/hm-flow/components/node-search/nodes-item.d.ts +8 -0
- package/dist/hm-flow/components/node-search/nodes-search.d.ts +8 -0
- package/dist/hm-flow/components/toolbar/index.d.ts +1 -0
- package/dist/hm-flow/components/toolbar/toolbar.d.ts +7 -0
- package/dist/hm-flow/components/toolbar/toolbar.types.d.ts +17 -0
- package/dist/hm-flow/hm-flow-base.d.ts +18 -0
- package/dist/hm-flow/hm-flow-base.types.d.ts +61 -0
- package/dist/hm-flow/hm-flow.d.ts +18 -0
- package/dist/hm-flow/hm-flow.types.d.ts +60 -0
- package/dist/hm-flow/hooks/index.d.ts +7 -0
- package/dist/hm-flow/hooks/use-hm-flow-children-deps.d.ts +2 -0
- package/dist/hm-flow/hooks/use-hm-flow-interactions.d.ts +28 -0
- package/dist/hm-flow/hooks/use-hm-flow-service.d.ts +19 -0
- package/dist/hm-flow/hooks/use-hm-flow.d.ts +2 -0
- package/dist/hm-flow/hooks/use-nodes-edges-handlers.d.ts +21 -0
- package/dist/hm-flow/hooks/use-nodes-service.d.ts +11 -0
- package/dist/hm-flow/index.d.ts +9 -0
- package/dist/hm-flow/node/index.d.ts +4 -0
- package/dist/hm-flow/node/node-wrapper.d.ts +9 -0
- package/dist/hm-flow/node/node.d.ts +5 -0
- package/dist/hm-flow/node/types.d.ts +35 -0
- package/dist/hm-flow/node/utils.d.ts +3 -0
- package/dist/hm-flow/provider/hm-flow-children-deps-context.d.ts +5 -0
- package/dist/hm-flow/provider/hm-flow-children-deps-provider.d.ts +8 -0
- package/dist/hm-flow/provider/hm-flow-context.d.ts +5 -0
- package/dist/hm-flow/provider/hm-flow-provider.d.ts +8 -0
- package/dist/hm-flow/provider/index.d.ts +5 -0
- package/dist/hm-flow/utils.d.ts +5 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.es.js +6905 -0
- package/dist/index.umd.js +1 -0
- package/dist/layouts/app-layout/app-layout.d.ts +15 -0
- package/dist/layouts/app-layout/index.d.ts +1 -0
- package/dist/layouts/bottom-bar/bottom-bar-button.d.ts +12 -0
- package/dist/layouts/bottom-bar/bottom-bar.d.ts +8 -0
- package/dist/layouts/bottom-bar/index.d.ts +1 -0
- package/dist/layouts/header/header.d.ts +8 -0
- package/dist/layouts/header/index.d.ts +1 -0
- package/dist/layouts/index.d.ts +5 -0
- package/dist/layouts/sidebar/index.d.ts +1 -0
- package/dist/layouts/sidebar/navbar-button.d.ts +11 -0
- package/dist/layouts/sidebar/sidebar.d.ts +7 -0
- package/dist/layouts/types/common.d.ts +10 -0
- package/dist/layouts/types/index.d.ts +1 -0
- package/dist/mantine.theme.d.ts +6 -0
- package/dist/molecules/data-grid/data-grid.d.ts +5 -0
- package/dist/molecules/data-grid/hm/data-grid-container.d.ts +8 -0
- package/dist/molecules/data-grid/hm/hm-data-grid.util.d.ts +7 -0
- package/dist/molecules/data-grid/hm/render-checkbox.d.ts +3 -0
- package/dist/molecules/data-grid/hm/render-row.d.ts +7 -0
- package/dist/molecules/data-grid/hm/types.d.ts +171 -0
- package/dist/molecules/data-grid/hm/use-data-gri-parser.hook.d.ts +359 -0
- package/dist/molecules/data-grid/hm/use-render-row.hook.d.ts +3 -0
- package/dist/molecules/data-grid/hm-data-grid.d.ts +4 -0
- package/dist/molecules/data-grid/index.d.ts +2 -0
- package/dist/molecules/flow-card/card.d.ts +14 -0
- package/dist/molecules/flow-card/index.d.ts +1 -0
- package/dist/molecules/hm-chart/hm-chart.util.d.ts +113 -0
- package/dist/molecules/hm-chart/index.d.ts +21 -0
- package/dist/molecules/hm-drawer.d.ts +5 -0
- package/dist/molecules/index.d.ts +9 -0
- package/dist/molecules/nav-bar-link.d.ts +7 -0
- package/dist/molecules/search-bar/index.d.ts +4 -0
- package/dist/molecules/stats-ring/index.d.ts +10 -0
- package/dist/molecules/table/HmTableAction.d.ts +8 -0
- package/dist/molecules/table/HmTableHead.d.ts +7 -0
- package/dist/molecules/table/HmTableRow.d.ts +8 -0
- package/dist/molecules/table/index.d.ts +9 -0
- package/dist/molecules/table/types.d.ts +15 -0
- package/dist/molecules/toggle-theme-mode/index.d.ts +4 -0
- package/dist/reactive-chart/chart-builder.d.ts +15 -0
- package/dist/reactive-chart/dashboard/chart-group.d.ts +9 -0
- package/dist/reactive-chart/dashboard/dynamic-chart.d.ts +12 -0
- package/dist/reactive-chart/dashboard/index.d.ts +3 -0
- package/dist/reactive-chart/dashboard/reactive-dashboard.d.ts +13 -0
- package/dist/reactive-chart/dashboard/types.d.ts +58 -0
- package/dist/reactive-chart/dashboard-layout/layout-grid-item.d.ts +10 -0
- package/dist/reactive-chart/dashboard-layout/layout-grid.d.ts +8 -0
- package/dist/reactive-chart/index.d.ts +3 -0
- package/dist/reactive-chart/reactive-charts/index.d.ts +5 -0
- package/dist/reactive-chart/reactive-charts/reactive-bar-chart/index.d.ts +2 -0
- package/dist/reactive-chart/reactive-charts/reactive-bar-chart/reactive-bar-chart.d.ts +5 -0
- package/dist/reactive-chart/reactive-charts/reactive-bar-chart/types.d.ts +11 -0
- package/dist/reactive-chart/reactive-charts/reactive-line-chart/index.d.ts +2 -0
- package/dist/reactive-chart/reactive-charts/reactive-line-chart/reactive-line-chart.d.ts +5 -0
- package/dist/reactive-chart/reactive-charts/reactive-line-chart/types.d.ts +11 -0
- package/dist/reactive-chart/reactive-charts/reactive-pie-chart/index.d.ts +2 -0
- package/dist/reactive-chart/reactive-charts/reactive-pie-chart/reactive-pie-chart.d.ts +5 -0
- package/dist/reactive-chart/reactive-charts/reactive-pie-chart/types.d.ts +12 -0
- package/dist/reactive-chart/reactive-charts/types/chart-custom-meta.d.ts +13 -0
- package/dist/reactive-chart/reactive-charts/types/chart-custom-props.d.ts +10 -0
- package/dist/reactive-chart/reactive-charts/types/index.d.ts +3 -0
- package/dist/reactive-chart/reactive-charts/types/reactive-chart-base.d.ts +37 -0
- package/dist/reactive-chart/reactive-charts/utils/chart-container.d.ts +13 -0
- package/dist/reactive-chart/reactive-charts/utils/chart-option.util.d.ts +9 -0
- package/dist/reactive-chart/reactive-charts/utils/index.d.ts +3 -0
- package/dist/reactive-chart/reactive-charts/utils/use-chart-rows.d.ts +10 -0
- package/dist/reactive-form/form/dynamic-field.d.ts +10 -0
- package/dist/reactive-form/form/form-group.d.ts +9 -0
- package/dist/reactive-form/form/index.d.ts +3 -0
- package/dist/reactive-form/form/reactive-form.d.ts +8 -0
- package/dist/reactive-form/form/types.d.ts +25 -0
- package/dist/reactive-form/form-builder.d.ts +16 -0
- package/dist/reactive-form/form-layout/layout-flex.d.ts +5 -0
- package/dist/reactive-form/index.d.ts +3 -0
- package/dist/reactive-form/reactive-fields/index.d.ts +14 -0
- package/dist/reactive-form/reactive-fields/reactive-autocomplete/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-autocomplete/reactive-autocomplete.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-autocomplete/types.d.ts +12 -0
- package/dist/reactive-form/reactive-fields/reactive-checkbox/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-checkbox/reactive-checkbox.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-checkbox/types.d.ts +4 -0
- package/dist/reactive-form/reactive-fields/reactive-list/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-list/reactive-list-field.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-list/types.d.ts +10 -0
- package/dist/reactive-form/reactive-fields/reactive-multi-select/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-multi-select/reactive-multi-select.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-multi-select/types.d.ts +12 -0
- package/dist/reactive-form/reactive-fields/reactive-number-field/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-number-field/number-field.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-number-field/types.d.ts +6 -0
- package/dist/reactive-form/reactive-fields/reactive-password-field/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-password-field/reactive-password-field.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-password-field/types.d.ts +11 -0
- package/dist/reactive-form/reactive-fields/reactive-radio/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-radio/reactive-radio.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-radio/types.d.ts +9 -0
- package/dist/reactive-form/reactive-fields/reactive-range/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-range/reactive-range.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-range/types.d.ts +18 -0
- package/dist/reactive-form/reactive-fields/reactive-select/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-select/reactive-select.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-select/types.d.ts +6 -0
- package/dist/reactive-form/reactive-fields/reactive-switch/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-switch/reactive-switch.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-switch/types.d.ts +4 -0
- package/dist/reactive-form/reactive-fields/reactive-text-field/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-text-field/reactive-text-field.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-text-field/types.d.ts +4 -0
- package/dist/reactive-form/reactive-fields/reactive-textarea-field/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-textarea-field/reactive-textarea-field.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-textarea-field/types.d.ts +6 -0
- package/dist/reactive-form/reactive-fields/types/field-custom-meta.d.ts +22 -0
- package/dist/reactive-form/reactive-fields/types/field-custom-props.d.ts +29 -0
- package/dist/reactive-form/reactive-fields/types/field-filter-key.d.ts +6 -0
- package/dist/reactive-form/reactive-fields/types/index.d.ts +4 -0
- package/dist/reactive-form/reactive-fields/types/reactive-field-base.d.ts +35 -0
- package/dist/reactive-form/reactive-fields/utils/field-error-interceptor.d.ts +4 -0
- package/dist/reactive-form/reactive-fields/utils/index.d.ts +1 -0
- package/dist/template/create-node-form/create-node-form.d.ts +8 -0
- package/dist/template/create-node-form/index.d.ts +3 -0
- package/dist/template/create-node-form/parameter-block.d.ts +16 -0
- package/dist/template/create-node-form/useCreateNodeForm.d.ts +27 -0
- package/dist/template/index.d.ts +1 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/theme.context.d.ts +10 -0
- package/dist/theme/theme.provider.d.ts +8 -0
- package/dist/types/common.d.ts +1 -0
- package/dist/types/form.d.ts +2 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/nested-props.d.ts +60 -0
- package/dist/types/object-utils.d.ts +43 -0
- package/dist/types/path-value.d.ts +10 -0
- package/dist/ui.css +2 -0
- package/dist/utils/async-response-parser.util.d.ts +31 -0
- package/dist/utils/data-utils.d.ts +3 -0
- package/dist/utils/field-regex.util.d.ts +6 -0
- package/dist/utils/index.d.ts +3 -0
- package/package.json +115 -0
package/Readme.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Blog
|
|
2
|
+
|
|
3
|
+
- React Component Library with Vite and Deploy in NPM : https://articles.wesionary.team/react-component-library-with-vite-and-deploy-in-npm-579c2880d6ff
|
|
4
|
+
|
|
5
|
+
- Create a React component library with Vite and Typescript : https://dev.to/nicolaserny/create-a-react-component-library-with-vite-and-typescript-1ih9
|
|
6
|
+
|
|
7
|
+
# Storybook
|
|
8
|
+
|
|
9
|
+
- configure storybook with mantine : https://mantine.dev/guides/storybook/
|
|
10
|
+
- Supporting Vitest : https://github.com/storybookjs/storybook/issues/17326
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './logo';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CNDIcon } from './cnd';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import Keycloak from 'keycloak-js';
|
|
3
|
+
export interface IKeycloakProviderProps {
|
|
4
|
+
keycloak: Keycloak;
|
|
5
|
+
onLoad?: 'check-sso' | 'login-required';
|
|
6
|
+
}
|
|
7
|
+
declare const KeycloakProvider: FC<IKeycloakProviderProps & {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}>;
|
|
10
|
+
export default KeycloakProvider;
|
package/dist/favicon.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IReactiveFieldMeta } from '@/reactive-form';
|
|
2
|
+
import { DefaultValues } from 'react-hook-form';
|
|
3
|
+
interface ICanvasForm<T extends Record<string, any>> {
|
|
4
|
+
submitButtonText: string;
|
|
5
|
+
meta: IReactiveFieldMeta<T>[];
|
|
6
|
+
defaultValues: DefaultValues<T>;
|
|
7
|
+
onSubmit: (submitedData: T) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const CanvasForm: <T extends Record<string, any>>(props: ICanvasForm<T>) => import("react").JSX.Element;
|
|
10
|
+
export default CanvasForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CanvasForm } from './canvas-form';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { IHeaderAction } from './header-status.types';
|
|
3
|
+
export type HmFlowHeaderStatus = 'green' | 'red' | 'yellow' | 'purple' | 'orange';
|
|
4
|
+
interface IHmFlowHeader {
|
|
5
|
+
title: string;
|
|
6
|
+
textStatus: string;
|
|
7
|
+
color?: HmFlowHeaderStatus;
|
|
8
|
+
actions: IHeaderAction[];
|
|
9
|
+
}
|
|
10
|
+
declare const HeaderStatus: FC<IHmFlowHeader>;
|
|
11
|
+
export default HeaderStatus;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ActionHandlerDepsType } from '@/hm-flow/node';
|
|
2
|
+
import { JSX } from 'react';
|
|
3
|
+
export interface IHeaderActionsHandlersParams {
|
|
4
|
+
deps: ActionHandlerDepsType;
|
|
5
|
+
}
|
|
6
|
+
export type HeaderActionHandlerType = (params: IHeaderActionsHandlersParams) => void;
|
|
7
|
+
export type HeaderActionType = 'edit';
|
|
8
|
+
export interface IHeaderAction {
|
|
9
|
+
name: string;
|
|
10
|
+
type: HeaderActionType;
|
|
11
|
+
icon: JSX.Element;
|
|
12
|
+
onClick: (params: IHeaderActionsHandlersParams) => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC, SetStateAction } from 'react';
|
|
2
|
+
import { IHmFlowModalItem } from './hm-flow-modal.type';
|
|
3
|
+
export interface IHmFlowModalProps {
|
|
4
|
+
items: IHmFlowModalItem[];
|
|
5
|
+
modalOpened: boolean;
|
|
6
|
+
currentModalTab: string | null;
|
|
7
|
+
testMode?: boolean;
|
|
8
|
+
setModalOpened: (value: SetStateAction<boolean>) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const HmFlowModal: FC<IHmFlowModalProps>;
|
|
11
|
+
export default HmFlowModal;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Node } from '@xyflow/react';
|
|
2
|
+
import { ComponentType, Dispatch, SetStateAction } from 'react';
|
|
3
|
+
export interface IHmFlowModalItemProps {
|
|
4
|
+
nodes: Node[];
|
|
5
|
+
currentNode: any;
|
|
6
|
+
setNodes: React.Dispatch<React.SetStateAction<Node[]>>;
|
|
7
|
+
setCurrentNode: Dispatch<SetStateAction<any>>;
|
|
8
|
+
onUpdateNode: (node: Node) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface IHmFlowModalItem {
|
|
11
|
+
name: string;
|
|
12
|
+
component: ComponentType<any>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { IHmFlowSideBarItem } from './hm-flow-sidebar.type';
|
|
3
|
+
export interface IHmFlowSideBarProps {
|
|
4
|
+
items: IHmFlowSideBarItem[];
|
|
5
|
+
drawerOpened: boolean;
|
|
6
|
+
onDrawerClose: () => void;
|
|
7
|
+
currentTab: string | null;
|
|
8
|
+
testMode?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const HmFlowSideBar: FC<IHmFlowSideBarProps>;
|
|
11
|
+
export default HmFlowSideBar;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './header-status';
|
|
2
|
+
export * from './hm-flow-bottom';
|
|
3
|
+
export * from './hm-flow-header';
|
|
4
|
+
export * from './hm-flow-modal';
|
|
5
|
+
export * from './hm-flow-sidebar';
|
|
6
|
+
export * from './node-editor';
|
|
7
|
+
export * from './node-search';
|
|
8
|
+
export * from './canvas-form';
|
|
9
|
+
export * from './toolbar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NodeEditor } from './node-editor';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Toolbar } from './toolbar';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ActionHandlerDepsType } from '@/hm-flow/node/types';
|
|
2
|
+
import { JSX } from 'react';
|
|
3
|
+
export type ToolbarActionType = 'save' | 'layout' | 'run' | 'deleteFlow';
|
|
4
|
+
export type ToolbarPosition = 'main' | 'left' | 'right';
|
|
5
|
+
export interface ToolbarActionsHandlersParams {
|
|
6
|
+
deps: ActionHandlerDepsType;
|
|
7
|
+
}
|
|
8
|
+
export type ToolbarActionHandlerType = (params: ToolbarActionsHandlersParams) => void;
|
|
9
|
+
export interface IToolbarAction {
|
|
10
|
+
name: string;
|
|
11
|
+
variant?: string;
|
|
12
|
+
type: ToolbarActionType;
|
|
13
|
+
icon: JSX.Element;
|
|
14
|
+
position?: ToolbarPosition;
|
|
15
|
+
color?: 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
|
|
16
|
+
onClick: (params: ToolbarActionsHandlersParams) => void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import type { NodeBase } from '@xyflow/system';
|
|
3
|
+
import { IHmFlowModalProps, IHmFlowSideBarProps } from './components';
|
|
4
|
+
import { IInitialNodeData, ICanvasConfigs } from './hm-flow.types';
|
|
5
|
+
import { ActionHandlerDepsType, PyNodeDataWithActionType } from './node';
|
|
6
|
+
export interface IHmFlowBase {
|
|
7
|
+
initialData?: IInitialNodeData;
|
|
8
|
+
canvasConfig?: ICanvasConfigs;
|
|
9
|
+
sideBarComponent: (params: Omit<IHmFlowSideBarProps, 'items'>) => ReactNode;
|
|
10
|
+
modalComponent: (params: Omit<IHmFlowModalProps, 'items'>) => ReactNode;
|
|
11
|
+
bottomComponent: () => ReactNode;
|
|
12
|
+
headerComponent: () => ReactNode;
|
|
13
|
+
onCanvasDoubleClick: (deps: ActionHandlerDepsType) => void;
|
|
14
|
+
onCanvasDoubleClicked?: (deps: ActionHandlerDepsType) => void;
|
|
15
|
+
onNodeDoubleClick: (event: React.MouseEvent, node: NodeBase<PyNodeDataWithActionType>, deps: ActionHandlerDepsType) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const HmFlowBase: FC<IHmFlowBase>;
|
|
18
|
+
export default HmFlowBase;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Edge, Node, ReactFlowJsonObject, XYPosition } from '@xyflow/react';
|
|
2
|
+
import { SetViewport } from '@xyflow/system';
|
|
3
|
+
import { Dispatch, RefObject, SetStateAction } from 'react';
|
|
4
|
+
import { PyNodeDataWithActionType } from './node';
|
|
5
|
+
export interface ICanvasDoubleClickParams {
|
|
6
|
+
reactFlowWrapper: RefObject<HTMLDivElement>;
|
|
7
|
+
screenToFlowPosition: (clientPosition: XYPosition, options?: {
|
|
8
|
+
snapToGrid: boolean;
|
|
9
|
+
}) => XYPosition;
|
|
10
|
+
setCurrentTab: Dispatch<SetStateAction<string | null>>;
|
|
11
|
+
setClickedPosition: Dispatch<SetStateAction<{
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
} | null>>;
|
|
15
|
+
setDrawerOpened: Dispatch<SetStateAction<boolean>>;
|
|
16
|
+
}
|
|
17
|
+
export interface IOnNodeDoubleClick {
|
|
18
|
+
setCurrentModalTab: Dispatch<SetStateAction<string | null>>;
|
|
19
|
+
setModalOpened: Dispatch<SetStateAction<boolean>>;
|
|
20
|
+
setCurrentNode: Dispatch<SetStateAction<any>>;
|
|
21
|
+
}
|
|
22
|
+
export interface ICanvasDeps {
|
|
23
|
+
clickedPosition: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
} | null;
|
|
27
|
+
setClickedPosition: Dispatch<SetStateAction<{
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
} | null>>;
|
|
31
|
+
reactFlowWrapper: RefObject<HTMLDivElement>;
|
|
32
|
+
}
|
|
33
|
+
export interface IDrawerDeps {
|
|
34
|
+
setDrawerOpened: Dispatch<SetStateAction<boolean>>;
|
|
35
|
+
setCurrentTab: Dispatch<SetStateAction<string | null>>;
|
|
36
|
+
}
|
|
37
|
+
export interface IModalDeps {
|
|
38
|
+
setCurrentModalTab: Dispatch<SetStateAction<string | null>>;
|
|
39
|
+
setModalOpened: Dispatch<SetStateAction<boolean>>;
|
|
40
|
+
}
|
|
41
|
+
export interface INodeDeps {
|
|
42
|
+
nodes: Node[];
|
|
43
|
+
edges: Edge[];
|
|
44
|
+
stateJoinsNode: boolean;
|
|
45
|
+
setStateJoinsNode: Dispatch<SetStateAction<boolean>>;
|
|
46
|
+
currentNode: Node | null;
|
|
47
|
+
setCurrentNode: Dispatch<SetStateAction<any>>;
|
|
48
|
+
nodeCounters: Record<string, number>;
|
|
49
|
+
setNodes: Dispatch<SetStateAction<Node[]>>;
|
|
50
|
+
setEdges: Dispatch<SetStateAction<Edge[]>>;
|
|
51
|
+
setNodeCounters: Dispatch<SetStateAction<Record<string, number>>>;
|
|
52
|
+
}
|
|
53
|
+
export interface IReactFlowDeps {
|
|
54
|
+
screenToFlowPosition: (clientPosition: XYPosition, options?: {
|
|
55
|
+
snapToGrid: boolean;
|
|
56
|
+
}) => XYPosition;
|
|
57
|
+
toObject: () => ReactFlowJsonObject<Node<PyNodeDataWithActionType>, Edge>;
|
|
58
|
+
setViewport: SetViewport;
|
|
59
|
+
onLayout: (direction: string) => void;
|
|
60
|
+
}
|
|
61
|
+
export type HmFlowChildrenDepsType = IDrawerDeps & IModalDeps & INodeDeps & ICanvasDeps & IReactFlowDeps;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { HmFlowHeaderStatus } from './components';
|
|
3
|
+
import { ICanvasConfigs, IHmFlowData } from './hm-flow.types';
|
|
4
|
+
import { ActionHandlerDepsType, INodeAction, IPyNode } from './node';
|
|
5
|
+
export interface IHmFlow {
|
|
6
|
+
searchItems: IPyNode[];
|
|
7
|
+
defaultHmFlowData: IHmFlowData;
|
|
8
|
+
canvasConfig?: ICanvasConfigs;
|
|
9
|
+
color?: HmFlowHeaderStatus;
|
|
10
|
+
textStatus: string;
|
|
11
|
+
onCanvasDoubleClicked?: (deps: ActionHandlerDepsType) => void;
|
|
12
|
+
onHmflowSave?: (flow: IHmFlowData) => void;
|
|
13
|
+
onHmflowRun?: (flow: IHmFlowData) => void;
|
|
14
|
+
onHmflowDelete?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const defaultActions: INodeAction[];
|
|
17
|
+
declare const HmFlow: FC<IHmFlow>;
|
|
18
|
+
export default HmFlow;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { BackgroundVariant, ColorMode, Edge, Node, NodeTypes, PanelPosition, Viewport } from '@xyflow/react';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
import { ActionHandlerDepsType, PyNodeDataWithActionType } from './node';
|
|
4
|
+
export type IInitialNodeData = {
|
|
5
|
+
nodes?: Node[];
|
|
6
|
+
edges?: Edge[];
|
|
7
|
+
};
|
|
8
|
+
export type HmFlowSpacingType = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
9
|
+
export interface IHmFlowActionsHandlersParams {
|
|
10
|
+
deps: ActionHandlerDepsType;
|
|
11
|
+
}
|
|
12
|
+
export type HmFlowNodeTypes = NodeTypes;
|
|
13
|
+
export declare const HmFlowBackgroundVariant: {
|
|
14
|
+
readonly dots: BackgroundVariant.Dots;
|
|
15
|
+
readonly cross: BackgroundVariant.Cross;
|
|
16
|
+
readonly lines: BackgroundVariant.Lines;
|
|
17
|
+
};
|
|
18
|
+
export type HmFlowBackgroundVariantType = keyof typeof HmFlowBackgroundVariant;
|
|
19
|
+
export interface ICanvasConfigs {
|
|
20
|
+
miniMap?: boolean;
|
|
21
|
+
mapAttr?: {
|
|
22
|
+
nodeColor?: string;
|
|
23
|
+
nodeStrokeColor?: string;
|
|
24
|
+
nodeBorderRadius?: number;
|
|
25
|
+
nodeStrokeWidth?: number;
|
|
26
|
+
position?: PanelPosition;
|
|
27
|
+
zoomable?: boolean;
|
|
28
|
+
pannable?: boolean;
|
|
29
|
+
};
|
|
30
|
+
controls?: boolean;
|
|
31
|
+
ctlAttr?: {
|
|
32
|
+
showZoom?: boolean;
|
|
33
|
+
showFitView?: boolean;
|
|
34
|
+
showInteractive?: boolean;
|
|
35
|
+
position?: PanelPosition;
|
|
36
|
+
orientation?: 'horizontal' | 'vertical';
|
|
37
|
+
};
|
|
38
|
+
background?: boolean;
|
|
39
|
+
bgAttr?: {
|
|
40
|
+
bgColor?: string;
|
|
41
|
+
color?: string;
|
|
42
|
+
style?: CSSProperties;
|
|
43
|
+
gap?: number | [number, number];
|
|
44
|
+
size?: number;
|
|
45
|
+
offset?: number;
|
|
46
|
+
variant?: HmFlowBackgroundVariantType;
|
|
47
|
+
};
|
|
48
|
+
colorMode?: ColorMode;
|
|
49
|
+
}
|
|
50
|
+
export interface IHmFlowMetadata {
|
|
51
|
+
name: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
version?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface IHmFlowData {
|
|
56
|
+
metadata: IHmFlowMetadata;
|
|
57
|
+
nodes: Node<PyNodeDataWithActionType>[];
|
|
58
|
+
edges: Edge[];
|
|
59
|
+
viewport: Viewport;
|
|
60
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { useHmFlowInteractions } from './use-hm-flow-interactions';
|
|
2
|
+
export { useNodesService } from './use-nodes-service';
|
|
3
|
+
export { useHmFlowService } from './use-hm-flow-service';
|
|
4
|
+
export { useNodeAndEdgeHandlers } from './use-nodes-edges-handlers';
|
|
5
|
+
export { default as useHmFlow } from './use-hm-flow';
|
|
6
|
+
export { default as useHmFlowChildrenDeps } from './use-hm-flow-children-deps';
|
|
7
|
+
export type { HmFlowJsonObject } from './use-hm-flow-service';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Node } from '@xyflow/react';
|
|
2
|
+
import { Dispatch, RefObject, SetStateAction } from 'react';
|
|
3
|
+
import { PyNodeDataWithActionType } from '../node';
|
|
4
|
+
interface IUseHMFlowInteractions {
|
|
5
|
+
reactFlowWrapper: RefObject<HTMLDivElement>;
|
|
6
|
+
setDrawerOpened: Dispatch<SetStateAction<boolean>>;
|
|
7
|
+
setCurrentTab: Dispatch<SetStateAction<string | null>>;
|
|
8
|
+
}
|
|
9
|
+
export declare const useHmFlowInteractions: (params: IUseHMFlowInteractions) => {
|
|
10
|
+
clickedPosition: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
} | null;
|
|
14
|
+
reactFlowWrapper: RefObject<HTMLDivElement>;
|
|
15
|
+
setClickedPosition: Dispatch<SetStateAction<{
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
} | null>>;
|
|
19
|
+
setDrawerOpened: Dispatch<SetStateAction<boolean>>;
|
|
20
|
+
setCurrentTab: Dispatch<SetStateAction<string | null>>;
|
|
21
|
+
screenToFlowPosition: (clientPosition: import("@xyflow/system").XYPosition, options?: {
|
|
22
|
+
snapToGrid?: boolean;
|
|
23
|
+
snapGrid?: import("@xyflow/system").SnapGrid;
|
|
24
|
+
}) => import("@xyflow/system").XYPosition;
|
|
25
|
+
toObject: () => import("@xyflow/react").ReactFlowJsonObject<Node<PyNodeDataWithActionType>, import("@xyflow/react").Edge>;
|
|
26
|
+
setViewport: import("@xyflow/system").SetViewport;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Edge, Node, ReactFlowJsonObject } from '@xyflow/react';
|
|
2
|
+
import { IHeaderAction } from '../components/header-status/header-status.types';
|
|
3
|
+
import { IToolbarAction } from '../components/toolbar/toolbar.types';
|
|
4
|
+
import { IHmFlowData, IHmFlowMetadata } from '../hm-flow.types';
|
|
5
|
+
import { PyNodeDataWithActionType } from '../node';
|
|
6
|
+
export type HmFlowJsonObject = ReactFlowJsonObject<Node<PyNodeDataWithActionType>, Edge>;
|
|
7
|
+
export interface IUseHmFlowService {
|
|
8
|
+
bottomActions?: IToolbarAction[];
|
|
9
|
+
headerActions?: IHeaderAction[];
|
|
10
|
+
onHmflowSave?: (flow: IHmFlowData) => void;
|
|
11
|
+
onHmflowRun?: (flow: IHmFlowData) => void;
|
|
12
|
+
onHmflowDelete?: () => void;
|
|
13
|
+
defaultHmFlowMetadata?: IHmFlowMetadata;
|
|
14
|
+
}
|
|
15
|
+
export declare const useHmFlowService: (params: IUseHmFlowService) => {
|
|
16
|
+
hmflowData: import("react").RefObject<IHmFlowData>;
|
|
17
|
+
bottomAction: IToolbarAction[];
|
|
18
|
+
headerAction: IHeaderAction[];
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Edge, Node } from '@xyflow/react';
|
|
2
|
+
import { IInitialNodeData } from '../hm-flow.types';
|
|
3
|
+
interface IUseNodeAndEdgeHandlers {
|
|
4
|
+
initialData?: IInitialNodeData;
|
|
5
|
+
}
|
|
6
|
+
export declare const useNodeAndEdgeHandlers: (params: IUseNodeAndEdgeHandlers) => {
|
|
7
|
+
nodes: any[];
|
|
8
|
+
setNodes: import("react").Dispatch<import("react").SetStateAction<any[]>>;
|
|
9
|
+
selectedNodes: string[];
|
|
10
|
+
setSelectedNodes: import("react").Dispatch<import("react").SetStateAction<string[]>>;
|
|
11
|
+
currentNode: Node | null;
|
|
12
|
+
setCurrentNode: import("react").Dispatch<import("react").SetStateAction<Node | null>>;
|
|
13
|
+
edges: Edge[];
|
|
14
|
+
setEdges: import("react").Dispatch<import("react").SetStateAction<Edge[]>>;
|
|
15
|
+
selectedEdges: string[];
|
|
16
|
+
onNodesChange: import("@xyflow/react").OnNodesChange<any>;
|
|
17
|
+
onEdgesChange: import("@xyflow/react").OnEdgesChange<Edge>;
|
|
18
|
+
onConnect: (params: any) => void;
|
|
19
|
+
onLayout: (direction: string | undefined) => void;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Node } from '@xyflow/react';
|
|
2
|
+
import { ActionHandlerDepsType, IActionsHandlersParams, INodeAction, PyNodeDataWithActionType } from '../node';
|
|
3
|
+
export interface IUseNodesServiceParams {
|
|
4
|
+
defaultActions: INodeAction[];
|
|
5
|
+
}
|
|
6
|
+
export declare const useNodesService: (params: IUseNodesServiceParams) => {
|
|
7
|
+
actions: INodeAction[];
|
|
8
|
+
onNodeDoubleClick: (event: React.MouseEvent, node: Node<PyNodeDataWithActionType>, deps: ActionHandlerDepsType) => void;
|
|
9
|
+
onUpdateNode: (params: IActionsHandlersParams) => void;
|
|
10
|
+
searchNode: (deps: ActionHandlerDepsType) => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as HmFlowBase } from './hm-flow-base';
|
|
2
|
+
export type { IHmFlowBase } from './hm-flow-base';
|
|
3
|
+
export { default as HmFlowProvider } from './provider/hm-flow-provider';
|
|
4
|
+
export { default as HmFlow } from './hm-flow';
|
|
5
|
+
export * from './node';
|
|
6
|
+
export * from './hm-flow.types';
|
|
7
|
+
export * from './hm-flow';
|
|
8
|
+
export * from './hooks';
|
|
9
|
+
import '@xyflow/react/dist/style.css';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Node, NodeProps } from '@xyflow/react';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
import { INodeAction } from './types';
|
|
4
|
+
interface INodeWrapper<TPyNodeProps extends Node> extends NodeProps<TPyNodeProps> {
|
|
5
|
+
NodeType: ComponentType<NodeProps<TPyNodeProps>>;
|
|
6
|
+
actions?: INodeAction[];
|
|
7
|
+
}
|
|
8
|
+
declare const NodeWrapper: <TPyNodeProps extends Node>(props: INodeWrapper<TPyNodeProps>) => import("react").JSX.Element;
|
|
9
|
+
export default NodeWrapper;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Node, NodeProps } from '@xyflow/react';
|
|
2
|
+
import { HmFlowChildrenDepsType } from '../hm-flow-base.types';
|
|
3
|
+
import { MantineSize } from '@mantine/core';
|
|
4
|
+
import { JSX } from 'react';
|
|
5
|
+
export type ActionHandlerDepsType = HmFlowChildrenDepsType;
|
|
6
|
+
export interface IActionsHandlersParams {
|
|
7
|
+
node: NodeProps<PyNodeType>;
|
|
8
|
+
deps: ActionHandlerDepsType;
|
|
9
|
+
}
|
|
10
|
+
export type ActionHandlerType = (params: IActionsHandlersParams) => void;
|
|
11
|
+
export interface INodeAction {
|
|
12
|
+
label: string;
|
|
13
|
+
type: NodeActionType;
|
|
14
|
+
icon: JSX.Element;
|
|
15
|
+
onClick: (params: IActionsHandlersParams) => void;
|
|
16
|
+
variant?: string;
|
|
17
|
+
color?: string;
|
|
18
|
+
}
|
|
19
|
+
export type NodeActionType = 'edit' | 'delete' | 'duplicate' | 'add' | 'selectSearchItem';
|
|
20
|
+
export interface IPyNode {
|
|
21
|
+
id: string;
|
|
22
|
+
type: 'pyNode';
|
|
23
|
+
data: PyNodeDataWithActionType;
|
|
24
|
+
}
|
|
25
|
+
export type PyNodeDataWithActionType = {
|
|
26
|
+
label: string;
|
|
27
|
+
icon: string;
|
|
28
|
+
name: string;
|
|
29
|
+
color: string;
|
|
30
|
+
image: string;
|
|
31
|
+
parameters?: {} | null;
|
|
32
|
+
actionSize?: MantineSize;
|
|
33
|
+
actions: INodeAction[];
|
|
34
|
+
};
|
|
35
|
+
export type PyNodeType = Node<PyNodeDataWithActionType, 'pyNode'>;
|