@flowuent-org/diagramming-core 1.0.5 → 1.0.7

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.
Files changed (28) hide show
  1. package/TRANSLATION_FIX_SUMMARY.md +118 -0
  2. package/apps/diagramming/src/DiagramTabs.tsx +205 -205
  3. package/apps/diagramming/src/sample-workflow-content.ts +55 -54
  4. package/package.json +116 -116
  5. package/packages/diagrams/I18N_SETUP.md +126 -0
  6. package/packages/diagrams/NODE_DATA_UPDATE_API.md +430 -430
  7. package/packages/diagrams/README.md +443 -3
  8. package/packages/diagrams/UNDO_REDO_API.md +306 -306
  9. package/packages/diagrams/locales/en/translation.json +713 -0
  10. package/packages/diagrams/package.json +5 -23
  11. package/packages/diagrams/pnpm-lock.yaml +2606 -0
  12. package/packages/diagrams/project.json +42 -38
  13. package/packages/diagrams/rollup.config.js +5 -10
  14. package/packages/diagrams/src/index.ts +116 -113
  15. package/packages/diagrams/src/lib/atoms/CardEditableTitle.tsx +76 -76
  16. package/packages/diagrams/src/lib/components/automation/AutomationApiNode.tsx +24 -3
  17. package/packages/diagrams/src/lib/components/automation/AutomationEndNode.tsx +23 -2
  18. package/packages/diagrams/src/lib/components/automation/AutomationFormattingNode.tsx +24 -3
  19. package/packages/diagrams/src/lib/components/automation/AutomationStartNode.tsx +24 -3
  20. package/packages/diagrams/src/lib/contexts/onWorkflowNodeDelete.ts +1 -1
  21. package/packages/diagrams/src/lib/i18n.ts +42 -0
  22. package/packages/diagrams/src/lib/organisms/CustomEdge/useCreateBendPoint.tsx +121 -119
  23. package/packages/diagrams/src/lib/organisms/WorkFlowNode/NodeActionButtons.tsx +1 -1
  24. package/packages/diagrams/src/lib/templates/node-forms/CallForm.tsx +370 -370
  25. package/packages/diagrams/src/lib/types/node-types.ts +29 -29
  26. package/packages/diagrams/src/lib/utils/AutomationExecutionEngine.ts +1168 -1162
  27. package/packages/diagrams/tsconfig.lib.json +1 -3
  28. package/tsconfig.base.json +1 -1
package/package.json CHANGED
@@ -1,116 +1,116 @@
1
- {
2
- "name": "@flowuent-org/diagramming-core",
3
- "version": "1.0.5",
4
- "license": "MIT",
5
- "publishConfig": {
6
- "access": "public"
7
- },
8
- "scripts": {
9
- "dev-diagramming": "nx serve diagramming",
10
- "build-diagrams": "nx build diagrams"
11
- },
12
- "dependencies": {
13
- "@dnd-kit/core": "^6.2.0",
14
- "@dnd-kit/modifiers": "^8.0.0",
15
- "@dnd-kit/sortable": "^9.0.0",
16
- "@dnd-kit/utilities": "^3.2.2",
17
- "@emotion/react": "^11.13.5",
18
- "@emotion/styled": "^11.13.5",
19
- "@fontsource/roboto": "^5.1.0",
20
- "@hookform/resolvers": "^3.9.1",
21
- "@mui/base": "5.0.0-beta.62",
22
- "@mui/icons-material": "^6.1.8",
23
- "@mui/material": "^6.1.8",
24
- "@mui/types": "^7.2.19",
25
- "@mui/x-data-grid": "^7.22.3",
26
- "@tabler/icons-react": "^3.22.0",
27
- "@welldone-software/why-did-you-render": "^8.0.3",
28
- "@xyflow/react": "^12.3.5",
29
- "axios": "^1.7.8",
30
- "elkjs": "^0.9.3",
31
- "file-saver": "^2.0.5",
32
- "formik": "^2.4.6",
33
- "framer-motion": "^11.11.17",
34
- "gapi-script": "^1.2.0",
35
- "html-to-image": "^1.11.11",
36
- "i18next": "^24.0.2",
37
- "immer": "^10.1.1",
38
- "jotai": "^2.10.3",
39
- "js-beautify": "^1.15.1",
40
- "lodash": "^4.17.21",
41
- "nanoid": "^5.0.9",
42
- "react": "19.0.0",
43
- "react-color": "^2.19.3",
44
- "react-dnd": "^16.0.1",
45
- "react-dom": "19.0.0",
46
- "react-from-json": "^0.8.0",
47
- "react-hook-form": "^7.53.2",
48
- "react-i18next": "^15.1.2",
49
- "react-icons": "^5.3.0",
50
- "react-json-view": "^1.21.3",
51
- "react-rnd": "^10.4.13",
52
- "react-router-dom": "^7.0.1",
53
- "react-syntax-highlighter": "^15.6.1",
54
- "reactflow": "^11.11.4",
55
- "tslib": "^2.8.1",
56
- "use-undo": "^1.1.1",
57
- "uuid": "^11.1.0",
58
- "xlsx": "^0.18.5",
59
- "yup": "^1.4.0",
60
- "zustand": "^5.0.1"
61
- },
62
- "devDependencies": {
63
- "@babel/core": "^7.26.0",
64
- "@babel/preset-react": "^7.25.9",
65
- "@nx/cypress": "20.6.4",
66
- "@nx/eslint": "20.6.4",
67
- "@nx/eslint-plugin": "20.6.4",
68
- "@nx/js": "20.6.4",
69
- "@nx/react": "20.6.4",
70
- "@nx/rollup": "20.6.4",
71
- "@nx/vite": "20.6.4",
72
- "@nx/web": "20.6.4",
73
- "@nx/webpack": "20.6.4",
74
- "@nx/workspace": "20.6.4",
75
- "@rollup/plugin-typescript": "^12.1.1",
76
- "@rollup/plugin-url": "^8.0.2",
77
- "@svgr/rollup": "^8.1.0",
78
- "@svgr/webpack": "^8.1.0",
79
- "@swc-node/register": "~1.10.9",
80
- "@swc/cli": "~0.5.1",
81
- "@swc/core": "~1.9.3",
82
- "@swc/helpers": "~0.5.15",
83
- "@testing-library/react": "16.1.0",
84
- "@types/file-saver": "^2.0.7",
85
- "@types/jest": "^29.5.14",
86
- "@types/js-beautify": "^1.14.3",
87
- "@types/lodash": "^4.17.13",
88
- "@types/node": "22.10.0",
89
- "@types/react": "18.3.12",
90
- "@types/react-color": "^3.0.12",
91
- "@types/react-dom": "18.3.1",
92
- "@types/uuid": "^10.0.0",
93
- "@typescript-eslint/eslint-plugin": "^8.16.0",
94
- "@typescript-eslint/parser": "^8.16.0",
95
- "@vitejs/plugin-react": "^4.3.4",
96
- "@vitest/coverage-v8": "^2.1.6",
97
- "@vitest/ui": "^2.1.6",
98
- "eslint": "~9.15.0",
99
- "eslint-config-prettier": "^9.1.0",
100
- "eslint-plugin-cypress": "^4.1.0",
101
- "eslint-plugin-import": "2.31.0",
102
- "eslint-plugin-jsx-a11y": "6.10.2",
103
- "eslint-plugin-react": "7.37.2",
104
- "eslint-plugin-react-hooks": "5.0.0",
105
- "eslint-plugin-react-refresh": "^0.4.14",
106
- "jsdom": "~25.0.1",
107
- "nx": "20.6.4",
108
- "prettier": "^3.4.1",
109
- "rollup-preserve-directives": "^1.1.3",
110
- "swc-loader": "0.1.15",
111
- "typescript": "~5.7.2",
112
- "vite": "^6.3.6",
113
- "vitest": "^2.1.6",
114
- "webpack-cli": "^5.1.4"
115
- }
116
- }
1
+ {
2
+ "name": "@flowuent-org/diagramming-core",
3
+ "version": "1.0.7",
4
+ "license": "MIT",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "scripts": {
9
+ "dev-diagramming": "nx serve diagramming",
10
+ "build-diagrams": "nx build diagrams"
11
+ },
12
+ "dependencies": {
13
+ "@dnd-kit/core": "^6.2.0",
14
+ "@dnd-kit/modifiers": "^8.0.0",
15
+ "@dnd-kit/sortable": "^9.0.0",
16
+ "@dnd-kit/utilities": "^3.2.2",
17
+ "@emotion/react": "^11.13.5",
18
+ "@emotion/styled": "^11.13.5",
19
+ "@fontsource/roboto": "^5.1.0",
20
+ "@hookform/resolvers": "^3.9.1",
21
+ "@mui/base": "5.0.0-beta.62",
22
+ "@mui/icons-material": "^6.1.8",
23
+ "@mui/material": "^6.1.8",
24
+ "@mui/types": "^7.2.19",
25
+ "@mui/x-data-grid": "^7.22.3",
26
+ "@tabler/icons-react": "^3.22.0",
27
+ "@welldone-software/why-did-you-render": "^8.0.3",
28
+ "@xyflow/react": "^12.3.5",
29
+ "axios": "^1.7.8",
30
+ "elkjs": "^0.9.3",
31
+ "file-saver": "^2.0.5",
32
+ "formik": "^2.4.6",
33
+ "framer-motion": "^11.11.17",
34
+ "gapi-script": "^1.2.0",
35
+ "html-to-image": "^1.11.11",
36
+ "i18next": "^24.0.2",
37
+ "immer": "^10.1.1",
38
+ "jotai": "^2.10.3",
39
+ "js-beautify": "^1.15.1",
40
+ "lodash": "^4.17.21",
41
+ "nanoid": "^5.0.9",
42
+ "react": "19.0.0",
43
+ "react-color": "^2.19.3",
44
+ "react-dnd": "^16.0.1",
45
+ "react-dom": "19.0.0",
46
+ "react-from-json": "^0.8.0",
47
+ "react-hook-form": "^7.53.2",
48
+ "react-i18next": "^15.1.2",
49
+ "react-icons": "^5.3.0",
50
+ "react-json-view": "^1.21.3",
51
+ "react-rnd": "^10.4.13",
52
+ "react-router-dom": "^7.0.1",
53
+ "react-syntax-highlighter": "^15.6.1",
54
+ "reactflow": "^11.11.4",
55
+ "tslib": "^2.8.1",
56
+ "use-undo": "^1.1.1",
57
+ "uuid": "^11.1.0",
58
+ "xlsx": "^0.18.5",
59
+ "yup": "^1.4.0",
60
+ "zustand": "^5.0.1"
61
+ },
62
+ "devDependencies": {
63
+ "@babel/core": "^7.26.0",
64
+ "@babel/preset-react": "^7.25.9",
65
+ "@nx/cypress": "20.6.4",
66
+ "@nx/eslint": "20.6.4",
67
+ "@nx/eslint-plugin": "20.6.4",
68
+ "@nx/js": "20.6.4",
69
+ "@nx/react": "20.6.4",
70
+ "@nx/rollup": "20.6.4",
71
+ "@nx/vite": "20.6.4",
72
+ "@nx/web": "20.6.4",
73
+ "@nx/webpack": "20.6.4",
74
+ "@nx/workspace": "20.6.4",
75
+ "@rollup/plugin-typescript": "^12.1.1",
76
+ "@rollup/plugin-url": "^8.0.2",
77
+ "@svgr/rollup": "^8.1.0",
78
+ "@svgr/webpack": "^8.1.0",
79
+ "@swc-node/register": "~1.10.9",
80
+ "@swc/cli": "~0.5.1",
81
+ "@swc/core": "~1.9.3",
82
+ "@swc/helpers": "~0.5.15",
83
+ "@testing-library/react": "16.1.0",
84
+ "@types/file-saver": "^2.0.7",
85
+ "@types/jest": "^29.5.14",
86
+ "@types/js-beautify": "^1.14.3",
87
+ "@types/lodash": "^4.17.13",
88
+ "@types/node": "22.10.0",
89
+ "@types/react": "18.3.12",
90
+ "@types/react-color": "^3.0.12",
91
+ "@types/react-dom": "18.3.1",
92
+ "@types/uuid": "^10.0.0",
93
+ "@typescript-eslint/eslint-plugin": "^8.16.0",
94
+ "@typescript-eslint/parser": "^8.16.0",
95
+ "@vitejs/plugin-react": "^4.3.4",
96
+ "@vitest/coverage-v8": "^2.1.6",
97
+ "@vitest/ui": "^2.1.6",
98
+ "eslint": "~9.15.0",
99
+ "eslint-config-prettier": "^9.1.0",
100
+ "eslint-plugin-cypress": "^4.1.0",
101
+ "eslint-plugin-import": "2.31.0",
102
+ "eslint-plugin-jsx-a11y": "6.10.2",
103
+ "eslint-plugin-react": "7.37.2",
104
+ "eslint-plugin-react-hooks": "5.0.0",
105
+ "eslint-plugin-react-refresh": "^0.4.14",
106
+ "jsdom": "~25.0.1",
107
+ "nx": "20.6.4",
108
+ "prettier": "^3.4.1",
109
+ "rollup-preserve-directives": "^1.1.3",
110
+ "swc-loader": "0.1.15",
111
+ "typescript": "~5.7.2",
112
+ "vite": "^6.3.6",
113
+ "vitest": "^2.1.6",
114
+ "webpack-cli": "^5.1.4"
115
+ }
116
+ }
@@ -0,0 +1,126 @@
1
+ # Internationalization (i18n) Setup
2
+
3
+ The `@flowuent-labs/diagrams` library includes built-in translation support using i18next. To ensure translations work correctly in your application, you need to initialize i18n before using the library components.
4
+
5
+ ## Quick Start
6
+
7
+ ### Option 1: Use Built-in Initialization (Recommended)
8
+
9
+ Import and call the `initDiagramsI18n` function before rendering any diagram components:
10
+
11
+ ```typescript
12
+ import { initDiagramsI18n } from '@flowuent-labs/diagrams';
13
+
14
+ // Initialize i18n with default translations
15
+ initDiagramsI18n();
16
+
17
+ // Now you can use any diagram components
18
+ function App() {
19
+ return <YourDiagramComponent />;
20
+ }
21
+ ```
22
+
23
+ ### Option 2: Manual Initialization with Custom Translations
24
+
25
+ If you want to customize or extend the translations:
26
+
27
+ ```typescript
28
+ import { initDiagramsI18n, translationEN } from '@flowuent-labs/diagrams';
29
+
30
+ // Initialize with custom translations
31
+ initDiagramsI18n({
32
+ en: {
33
+ translation: {
34
+ ...translationEN,
35
+ // Add your custom translations or overrides here
36
+ customKey: 'Custom value',
37
+ },
38
+ },
39
+ // Add other languages
40
+ es: {
41
+ translation: {
42
+ // Spanish translations
43
+ },
44
+ },
45
+ });
46
+ ```
47
+
48
+ ### Option 3: Use Existing i18next Instance
49
+
50
+ If your app already uses i18next, you can add the library's translations to your existing configuration:
51
+
52
+ ```typescript
53
+ import i18n from 'i18next';
54
+ import { initReactI18next } from 'react-i18next';
55
+ import { translationEN } from '@flowuent-labs/diagrams';
56
+
57
+ i18n
58
+ .use(initReactI18next)
59
+ .init({
60
+ resources: {
61
+ en: {
62
+ translation: {
63
+ // Your app translations
64
+ ...yourAppTranslations,
65
+ // Library translations
66
+ ...translationEN,
67
+ },
68
+ },
69
+ },
70
+ fallbackLng: 'en',
71
+ interpolation: {
72
+ escapeValue: false,
73
+ },
74
+ });
75
+ ```
76
+
77
+ ## Available Translations
78
+
79
+ The library currently includes:
80
+ - English (en) - `translationEN`
81
+
82
+ ## Common Issues
83
+
84
+ ### Translation Keys Showing Instead of Text
85
+
86
+ If you see translation keys (e.g., `tooltip.clear`, `button.save`) instead of actual text, it means i18n is not initialized. Make sure to call `initDiagramsI18n()` before rendering any components.
87
+
88
+ ### Translations Not Working in Production
89
+
90
+ Ensure your build process includes the `locales` folder from the library. The translation files are automatically included in the npm package.
91
+
92
+ ## API Reference
93
+
94
+ ### `initDiagramsI18n(customResources?: any): i18n`
95
+
96
+ Initializes or updates the i18next instance with diagram translations.
97
+
98
+ **Parameters:**
99
+ - `customResources` (optional): Custom translation resources object
100
+
101
+ **Returns:**
102
+ - The i18next instance
103
+
104
+ ### `translationEN`
105
+
106
+ The default English translation resource object. Can be imported for customization or extension.
107
+
108
+ ## Example: Complete Setup
109
+
110
+ ```typescript
111
+ // main.tsx or index.tsx
112
+ import React from 'react';
113
+ import ReactDOM from 'react-dom/client';
114
+ import { initDiagramsI18n } from '@flowuent-labs/diagrams';
115
+ import App from './App';
116
+
117
+ // Initialize i18n before rendering
118
+ initDiagramsI18n();
119
+
120
+ ReactDOM.createRoot(document.getElementById('root')!).render(
121
+ <React.StrictMode>
122
+ <App />
123
+ </React.StrictMode>
124
+ );
125
+ ```
126
+