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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CompressOutlined, LeftOutlined, RightOutlined, WarningOutlined } from '@ant-design/icons';
import { Button, Modal, Typography, message, notification } from 'antd';
import { App, Button, Typography, message, notification } from 'antd';
import clsx from 'clsx';
import equal from 'fast-deep-equal';
import React, { type MutableRefObject, forwardRef, useImperativeHandle, useMemo, useRef, useState } from 'react';
Expand Down Expand Up @@ -91,6 +91,7 @@ export const Graph = forwardRef<GraphRef, GraphProps>(function GraphInner({ reac
const graphActions = useDecisionGraphActions();
const graphReferences = useDecisionGraphReferences((s) => s);
const { onReactFlowInit } = useDecisionGraphListeners(({ onReactFlowInit }) => ({ onReactFlowInit }));
const { modal } = App.useApp();
const { disabled, hasInputNode, components, customNodes, id } = useDecisionGraphState(
({ id, disabled, components, customNodes, decisionGraph }) => ({
id,
Expand Down Expand Up @@ -403,7 +404,7 @@ export const Graph = forwardRef<GraphRef, GraphProps>(function GraphInner({ reac
if (selectedNodes.length > 0) {
const length = selectedNodes.length;
const text = length > 1 ? 'nodes' : 'node';
Modal.confirm({
modal.confirm({
icon: null,
title: `Delete ${text}`,
content: (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BookOutlined } from '@ant-design/icons';
import type { MenuProps } from 'antd';
import { Button, Modal, Typography } from 'antd';
import { App, Button, Typography } from 'antd';
import clsx from 'clsx';
import React from 'react';
import type { HandleProps } from 'reactflow';
Expand Down Expand Up @@ -47,6 +47,7 @@ export const GraphNode = React.forwardRef<HTMLDivElement, GraphNodeProps>(
const [currentDetails, setCurrentDetails] = usePersistentState<Details>(`node:details:${id}`, Details.Settings);
const [detailsOpen, setDetailsOpen] = usePersistentState<boolean>(`node:detailsOpen:${id}`, false);
const graphActions = useDecisionGraphActions();
const { modal } = App.useApp();
const { nodeError, nodeTrace, disabled, compactMode } = useDecisionGraphState(
({ simulate, disabled, compactMode }) => ({
disabled,
Expand Down Expand Up @@ -91,7 +92,7 @@ export const GraphNode = React.forwardRef<HTMLDivElement, GraphNodeProps>(
label: <SpacedText left='Delete' right={platform.shortcut('Backspace')} />,
disabled,
onClick: () =>
Modal.confirm({
modal.confirm({
icon: null,
title: 'Delete node',
content: (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BookOutlined, DeleteOutlined } from '@ant-design/icons';
import { Button, Modal, Typography } from 'antd';
import { App, Button, Typography } from 'antd';
import { produce } from 'immer';
import _ from 'lodash';
import { ArrowRightToLineIcon } from 'lucide-react';
Expand Down Expand Up @@ -40,6 +40,7 @@ export const inputSpecification: NodeSpecification<NodeInputData> = {
const { disabled } = useDecisionGraphState(({ disabled }) => ({
disabled,
}));
const { modal } = App.useApp();

return (
<GraphNode
Expand Down Expand Up @@ -67,7 +68,7 @@ export const inputSpecification: NodeSpecification<NodeInputData> = {
label: <SpacedText left='Delete' right={platform.shortcut('Backspace')} />,
disabled,
onClick: () =>
Modal.confirm({
modal.confirm({
icon: null,
title: 'Delete node',
content: (
Expand Down
8 changes: 5 additions & 3 deletions packages/jdm-editor/src/theme.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ThemeConfig as AntThemeConfig } from 'antd';
import { ConfigProvider, theme as antTheme, theme } from 'antd';
import { App, ConfigProvider, theme as antTheme, theme } from 'antd';
import React, { useContext, useMemo } from 'react';

import { useWasmReady } from './helpers/wasm';
Expand Down Expand Up @@ -55,8 +55,10 @@ export const JdmConfigProvider: React.FC<JdmConfigProviderProps> = ({
return (
<ConfigProvider prefixCls={prefixCls} theme={{ ...restTheme, algorithm, token: { ...token, mode, motion: false } }}>
<DictionaryContext.Provider value={dicts}>
<GlobalCssVariables mode={mode} />
{children}
<App style={{ height: '100%' }}>
<GlobalCssVariables mode={mode} />
{children}
</App>
</DictionaryContext.Provider>
</ConfigProvider>
);
Expand Down
Loading