@cundi/refine-xaf 1.0.4 → 1.0.5

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 CHANGED
@@ -11,6 +11,7 @@ This is an SDK integrating XAF backend with Refine frontend, including core logi
11
11
  - `LoginPage`: Standard login page.
12
12
  - `SmartList`, `RelatedList`: Highly encapsulated generic list and detail components. (**Note**: To use `defaultVisible` prop, import `@cundi/refine-xaf/dist/antd-column-ext` in your app entry)
13
13
  - `TiptapEditor`: Rich text editor with support for Images, Tables, Tasks, Math (LaTeX), YouTube, Emoji, Highlight, and Text Color.
14
+ - `DrawioEditor`: Draw.io diagram editor with i18n language sync support.
14
15
  - `ApplicationUser`: Complete user management (List, Create, Edit, Role Assignment).
15
16
  - `PermissionPolicyRole`: Complete role and permission management.
16
17
 
@@ -260,6 +261,32 @@ export const DemoObjectCreate = () => {
260
261
  };
261
262
  ```
262
263
 
264
+ ### DrawioEditor Usage
265
+
266
+ Use the `DrawioEditor` component for Draw.io diagram editing with automatic i18n language synchronization.
267
+
268
+ ```tsx
269
+ import { DrawioEditor } from "@cundi/refine-xaf";
270
+ import { Form } from "antd";
271
+
272
+ // Basic usage in a form
273
+ <Form.Item
274
+ label="Diagram"
275
+ name={["DiagramXml"]}
276
+ trigger="onChange"
277
+ getValueFromEvent={(value) => value}
278
+ >
279
+ <DrawioEditor height={600} />
280
+ </Form.Item>
281
+
282
+ // Props:
283
+ // - value?: string - XML format diagram data
284
+ // - onChange?: (xml) => void - Callback when content changes
285
+ // - disabled?: boolean - Read-only mode (hides save button)
286
+ // - height?: number|string - Editor height (default: 500)
287
+ // - autosave?: boolean - Enable autosave (default: true)
288
+ ```
289
+
263
290
  ## Development and Publishing
264
291
 
265
292
  1. **Install Dependencies**: `npm install`
@@ -299,7 +326,20 @@ console.log(claims.sub, claims.exp);
299
326
 
300
327
  ## Changelog
301
328
 
302
- ### v1.0.2 (Latest)
329
+ ### v1.0.5 (Latest)
330
+ - Added `DrawioEditor` component for Draw.io diagram editing
331
+ - DrawioEditor supports automatic i18n language synchronization
332
+ - Added `react-drawio` dependency
333
+
334
+ ### v1.0.4
335
+ - Fixed `refineXafTranslations` export (was missing from main index)
336
+ - Fixed i18n translations for dashboard page
337
+
338
+ ### v1.0.3
339
+ - Added Dashboard page translations
340
+ - Fixed internationalization in template
341
+
342
+ ### v1.0.2
303
343
  - Fixed `defaultVisible` type definition for `SmartList`. Consumers must add `import "@cundi/refine-xaf/dist/antd-column-ext";` to their entry file (e.g., `App.tsx`) to enable this feature.
304
344
 
305
345
  ### v1.0.1
package/dist/index.d.mts CHANGED
@@ -271,6 +271,9 @@ declare const refineXafTranslations: {
271
271
  youtube: string;
272
272
  enterYoutubeUrl: string;
273
273
  };
274
+ drawioEditor: {
275
+ loading: string;
276
+ };
274
277
  };
275
278
  common: {
276
279
  actions: {
@@ -285,6 +288,7 @@ declare const refineXafTranslations: {
285
288
  dashboard: string;
286
289
  dataTypeExamples: string;
287
290
  tiptapExamples: string;
291
+ drawioExamples: string;
288
292
  users: string;
289
293
  roles: string;
290
294
  settings: string;
@@ -366,6 +370,9 @@ declare const refineXafTranslations: {
366
370
  youtube: string;
367
371
  enterYoutubeUrl: string;
368
372
  };
373
+ drawioEditor: {
374
+ loading: string;
375
+ };
369
376
  };
370
377
  common: {
371
378
  actions: {
@@ -380,6 +387,7 @@ declare const refineXafTranslations: {
380
387
  dashboard: string;
381
388
  dataTypeExamples: string;
382
389
  tiptapExamples: string;
390
+ drawioExamples: string;
383
391
  users: string;
384
392
  roles: string;
385
393
  settings: string;
@@ -428,6 +436,20 @@ interface TiptapEditorProps {
428
436
  }
429
437
  declare const TiptapEditor: React.FC<TiptapEditorProps>;
430
438
 
439
+ interface DrawioEditorProps {
440
+ /** XML format diagram data */
441
+ value?: string;
442
+ /** Callback when diagram content changes */
443
+ onChange?: (value: string) => void;
444
+ /** Whether the editor is disabled (read-only mode) */
445
+ disabled?: boolean;
446
+ /** Height of the editor, default is 500 */
447
+ height?: number | string;
448
+ /** Enable autosave feature */
449
+ autosave?: boolean;
450
+ }
451
+ declare const DrawioEditor: React.FC<DrawioEditorProps>;
452
+
431
453
  declare const LoginPage: React.FC;
432
454
 
433
455
  declare const KeycloakLoginPage: React.FC;
@@ -468,4 +490,4 @@ interface IModelType {
468
490
  }
469
491
  declare const useModelTypes: () => _tanstack_react_query.UseQueryResult<IModelType[], Error>;
470
492
 
471
- export { ApplicationUserCreate, ApplicationUserEdit, ApplicationUserList, AuthCallback, Base64Upload, ColorModeContext, ColorModeContextProvider, Header, HttpError, type IApplicationUser, type IJwtClaims, type IModelType, type IPermissionPolicyRole, type IPermissionPolicyTypePermissionObject, type IXafEntity, KeycloakLoginPage, type KeycloakTokenResponse, LoginPage, RelatedList, type RequestOptions, RoleCreate, RoleEdit, RoleList, SecurityPermissionPolicy, SecurityPermissionState, SmartList, TOKEN_KEY, TiptapEditor, type TiptapEditorProps, authProvider, authService, dataProvider, generatePassword, getBaseUrl, httpClient, keycloakService, parseJwt, refineXafTranslations, useColorMode, useModelTypes, validatePasswordStrength };
493
+ export { ApplicationUserCreate, ApplicationUserEdit, ApplicationUserList, AuthCallback, Base64Upload, ColorModeContext, ColorModeContextProvider, DrawioEditor, type DrawioEditorProps, Header, HttpError, type IApplicationUser, type IJwtClaims, type IModelType, type IPermissionPolicyRole, type IPermissionPolicyTypePermissionObject, type IXafEntity, KeycloakLoginPage, type KeycloakTokenResponse, LoginPage, RelatedList, type RequestOptions, RoleCreate, RoleEdit, RoleList, SecurityPermissionPolicy, SecurityPermissionState, SmartList, TOKEN_KEY, TiptapEditor, type TiptapEditorProps, authProvider, authService, dataProvider, generatePassword, getBaseUrl, httpClient, keycloakService, parseJwt, refineXafTranslations, useColorMode, useModelTypes, validatePasswordStrength };
package/dist/index.d.ts CHANGED
@@ -271,6 +271,9 @@ declare const refineXafTranslations: {
271
271
  youtube: string;
272
272
  enterYoutubeUrl: string;
273
273
  };
274
+ drawioEditor: {
275
+ loading: string;
276
+ };
274
277
  };
275
278
  common: {
276
279
  actions: {
@@ -285,6 +288,7 @@ declare const refineXafTranslations: {
285
288
  dashboard: string;
286
289
  dataTypeExamples: string;
287
290
  tiptapExamples: string;
291
+ drawioExamples: string;
288
292
  users: string;
289
293
  roles: string;
290
294
  settings: string;
@@ -366,6 +370,9 @@ declare const refineXafTranslations: {
366
370
  youtube: string;
367
371
  enterYoutubeUrl: string;
368
372
  };
373
+ drawioEditor: {
374
+ loading: string;
375
+ };
369
376
  };
370
377
  common: {
371
378
  actions: {
@@ -380,6 +387,7 @@ declare const refineXafTranslations: {
380
387
  dashboard: string;
381
388
  dataTypeExamples: string;
382
389
  tiptapExamples: string;
390
+ drawioExamples: string;
383
391
  users: string;
384
392
  roles: string;
385
393
  settings: string;
@@ -428,6 +436,20 @@ interface TiptapEditorProps {
428
436
  }
429
437
  declare const TiptapEditor: React.FC<TiptapEditorProps>;
430
438
 
439
+ interface DrawioEditorProps {
440
+ /** XML format diagram data */
441
+ value?: string;
442
+ /** Callback when diagram content changes */
443
+ onChange?: (value: string) => void;
444
+ /** Whether the editor is disabled (read-only mode) */
445
+ disabled?: boolean;
446
+ /** Height of the editor, default is 500 */
447
+ height?: number | string;
448
+ /** Enable autosave feature */
449
+ autosave?: boolean;
450
+ }
451
+ declare const DrawioEditor: React.FC<DrawioEditorProps>;
452
+
431
453
  declare const LoginPage: React.FC;
432
454
 
433
455
  declare const KeycloakLoginPage: React.FC;
@@ -468,4 +490,4 @@ interface IModelType {
468
490
  }
469
491
  declare const useModelTypes: () => _tanstack_react_query.UseQueryResult<IModelType[], Error>;
470
492
 
471
- export { ApplicationUserCreate, ApplicationUserEdit, ApplicationUserList, AuthCallback, Base64Upload, ColorModeContext, ColorModeContextProvider, Header, HttpError, type IApplicationUser, type IJwtClaims, type IModelType, type IPermissionPolicyRole, type IPermissionPolicyTypePermissionObject, type IXafEntity, KeycloakLoginPage, type KeycloakTokenResponse, LoginPage, RelatedList, type RequestOptions, RoleCreate, RoleEdit, RoleList, SecurityPermissionPolicy, SecurityPermissionState, SmartList, TOKEN_KEY, TiptapEditor, type TiptapEditorProps, authProvider, authService, dataProvider, generatePassword, getBaseUrl, httpClient, keycloakService, parseJwt, refineXafTranslations, useColorMode, useModelTypes, validatePasswordStrength };
493
+ export { ApplicationUserCreate, ApplicationUserEdit, ApplicationUserList, AuthCallback, Base64Upload, ColorModeContext, ColorModeContextProvider, DrawioEditor, type DrawioEditorProps, Header, HttpError, type IApplicationUser, type IJwtClaims, type IModelType, type IPermissionPolicyRole, type IPermissionPolicyTypePermissionObject, type IXafEntity, KeycloakLoginPage, type KeycloakTokenResponse, LoginPage, RelatedList, type RequestOptions, RoleCreate, RoleEdit, RoleList, SecurityPermissionPolicy, SecurityPermissionState, SmartList, TOKEN_KEY, TiptapEditor, type TiptapEditorProps, authProvider, authService, dataProvider, generatePassword, getBaseUrl, httpClient, keycloakService, parseJwt, refineXafTranslations, useColorMode, useModelTypes, validatePasswordStrength };