@cundi/refine-xaf 1.0.4 → 1.0.6

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,9 +288,61 @@ 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;
295
+ backgroundJobs: string;
296
+ };
297
+ backgroundJobs: {
298
+ title: string;
299
+ tabs: {
300
+ recurring: string;
301
+ succeeded: string;
302
+ failed: string;
303
+ processing: string;
304
+ };
305
+ columns: {
306
+ id: string;
307
+ jobId: string;
308
+ jobName: string;
309
+ cron: string;
310
+ queue: string;
311
+ nextExecution: string;
312
+ lastState: string;
313
+ succeededAt: string;
314
+ failedAt: string;
315
+ startedAt: string;
316
+ duration: string;
317
+ exception: string;
318
+ serverId: string;
319
+ actions: string;
320
+ };
321
+ status: {
322
+ succeeded: string;
323
+ failed: string;
324
+ processing: string;
325
+ scheduled: string;
326
+ unknown: string;
327
+ };
328
+ actions: {
329
+ trigger: string;
330
+ delete: string;
331
+ triggerSuccess: string;
332
+ deleteSuccess: string;
333
+ triggerError: string;
334
+ deleteError: string;
335
+ };
336
+ drawer: {
337
+ title: string;
338
+ jobName: string;
339
+ createdAt: string;
340
+ history: string;
341
+ state: string;
342
+ reason: string;
343
+ data: string;
344
+ noData: string;
345
+ };
291
346
  };
292
347
  };
293
348
  "zh-TW": {
@@ -366,6 +421,9 @@ declare const refineXafTranslations: {
366
421
  youtube: string;
367
422
  enterYoutubeUrl: string;
368
423
  };
424
+ drawioEditor: {
425
+ loading: string;
426
+ };
369
427
  };
370
428
  common: {
371
429
  actions: {
@@ -380,9 +438,61 @@ declare const refineXafTranslations: {
380
438
  dashboard: string;
381
439
  dataTypeExamples: string;
382
440
  tiptapExamples: string;
441
+ drawioExamples: string;
383
442
  users: string;
384
443
  roles: string;
385
444
  settings: string;
445
+ backgroundJobs: string;
446
+ };
447
+ backgroundJobs: {
448
+ title: string;
449
+ tabs: {
450
+ recurring: string;
451
+ succeeded: string;
452
+ failed: string;
453
+ processing: string;
454
+ };
455
+ columns: {
456
+ id: string;
457
+ jobId: string;
458
+ jobName: string;
459
+ cron: string;
460
+ queue: string;
461
+ nextExecution: string;
462
+ lastState: string;
463
+ succeededAt: string;
464
+ failedAt: string;
465
+ startedAt: string;
466
+ duration: string;
467
+ exception: string;
468
+ serverId: string;
469
+ actions: string;
470
+ };
471
+ status: {
472
+ succeeded: string;
473
+ failed: string;
474
+ processing: string;
475
+ scheduled: string;
476
+ unknown: string;
477
+ };
478
+ actions: {
479
+ trigger: string;
480
+ delete: string;
481
+ triggerSuccess: string;
482
+ deleteSuccess: string;
483
+ triggerError: string;
484
+ deleteError: string;
485
+ };
486
+ drawer: {
487
+ title: string;
488
+ jobName: string;
489
+ createdAt: string;
490
+ history: string;
491
+ state: string;
492
+ reason: string;
493
+ data: string;
494
+ noData: string;
495
+ };
386
496
  };
387
497
  };
388
498
  };
@@ -428,6 +538,20 @@ interface TiptapEditorProps {
428
538
  }
429
539
  declare const TiptapEditor: React.FC<TiptapEditorProps>;
430
540
 
541
+ interface DrawioEditorProps {
542
+ /** XML format diagram data */
543
+ value?: string;
544
+ /** Callback when diagram content changes */
545
+ onChange?: (value: string) => void;
546
+ /** Whether the editor is disabled (read-only mode) */
547
+ disabled?: boolean;
548
+ /** Height of the editor, default is 500 */
549
+ height?: number | string;
550
+ /** Enable autosave feature */
551
+ autosave?: boolean;
552
+ }
553
+ declare const DrawioEditor: React.FC<DrawioEditorProps>;
554
+
431
555
  declare const LoginPage: React.FC;
432
556
 
433
557
  declare const KeycloakLoginPage: React.FC;
@@ -450,6 +574,21 @@ declare const RoleCreate: React.FC<IResourceComponentsProps>;
450
574
 
451
575
  declare const RoleEdit: React.FC<IResourceComponentsProps>;
452
576
 
577
+ /**
578
+ * Props for the BackgroundJobList component.
579
+ */
580
+ interface BackgroundJobListProps {
581
+ /** Custom title for the list page */
582
+ title?: string;
583
+ /** Base API URL (defaults to useApiUrl() without /odata) */
584
+ apiUrl?: string;
585
+ }
586
+ /**
587
+ * A reusable component for managing Hangfire background jobs.
588
+ * Displays recurring jobs, succeeded jobs, failed jobs, and processing jobs.
589
+ */
590
+ declare const BackgroundJobList: React.FC<BackgroundJobListProps>;
591
+
453
592
  type ColorModeContextType = {
454
593
  mode: "light" | "dark";
455
594
  setMode: (mode: "light" | "dark") => void;
@@ -468,4 +607,4 @@ interface IModelType {
468
607
  }
469
608
  declare const useModelTypes: () => _tanstack_react_query.UseQueryResult<IModelType[], Error>;
470
609
 
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 };
610
+ export { ApplicationUserCreate, ApplicationUserEdit, ApplicationUserList, AuthCallback, BackgroundJobList, type BackgroundJobListProps, 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,9 +288,61 @@ 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;
295
+ backgroundJobs: string;
296
+ };
297
+ backgroundJobs: {
298
+ title: string;
299
+ tabs: {
300
+ recurring: string;
301
+ succeeded: string;
302
+ failed: string;
303
+ processing: string;
304
+ };
305
+ columns: {
306
+ id: string;
307
+ jobId: string;
308
+ jobName: string;
309
+ cron: string;
310
+ queue: string;
311
+ nextExecution: string;
312
+ lastState: string;
313
+ succeededAt: string;
314
+ failedAt: string;
315
+ startedAt: string;
316
+ duration: string;
317
+ exception: string;
318
+ serverId: string;
319
+ actions: string;
320
+ };
321
+ status: {
322
+ succeeded: string;
323
+ failed: string;
324
+ processing: string;
325
+ scheduled: string;
326
+ unknown: string;
327
+ };
328
+ actions: {
329
+ trigger: string;
330
+ delete: string;
331
+ triggerSuccess: string;
332
+ deleteSuccess: string;
333
+ triggerError: string;
334
+ deleteError: string;
335
+ };
336
+ drawer: {
337
+ title: string;
338
+ jobName: string;
339
+ createdAt: string;
340
+ history: string;
341
+ state: string;
342
+ reason: string;
343
+ data: string;
344
+ noData: string;
345
+ };
291
346
  };
292
347
  };
293
348
  "zh-TW": {
@@ -366,6 +421,9 @@ declare const refineXafTranslations: {
366
421
  youtube: string;
367
422
  enterYoutubeUrl: string;
368
423
  };
424
+ drawioEditor: {
425
+ loading: string;
426
+ };
369
427
  };
370
428
  common: {
371
429
  actions: {
@@ -380,9 +438,61 @@ declare const refineXafTranslations: {
380
438
  dashboard: string;
381
439
  dataTypeExamples: string;
382
440
  tiptapExamples: string;
441
+ drawioExamples: string;
383
442
  users: string;
384
443
  roles: string;
385
444
  settings: string;
445
+ backgroundJobs: string;
446
+ };
447
+ backgroundJobs: {
448
+ title: string;
449
+ tabs: {
450
+ recurring: string;
451
+ succeeded: string;
452
+ failed: string;
453
+ processing: string;
454
+ };
455
+ columns: {
456
+ id: string;
457
+ jobId: string;
458
+ jobName: string;
459
+ cron: string;
460
+ queue: string;
461
+ nextExecution: string;
462
+ lastState: string;
463
+ succeededAt: string;
464
+ failedAt: string;
465
+ startedAt: string;
466
+ duration: string;
467
+ exception: string;
468
+ serverId: string;
469
+ actions: string;
470
+ };
471
+ status: {
472
+ succeeded: string;
473
+ failed: string;
474
+ processing: string;
475
+ scheduled: string;
476
+ unknown: string;
477
+ };
478
+ actions: {
479
+ trigger: string;
480
+ delete: string;
481
+ triggerSuccess: string;
482
+ deleteSuccess: string;
483
+ triggerError: string;
484
+ deleteError: string;
485
+ };
486
+ drawer: {
487
+ title: string;
488
+ jobName: string;
489
+ createdAt: string;
490
+ history: string;
491
+ state: string;
492
+ reason: string;
493
+ data: string;
494
+ noData: string;
495
+ };
386
496
  };
387
497
  };
388
498
  };
@@ -428,6 +538,20 @@ interface TiptapEditorProps {
428
538
  }
429
539
  declare const TiptapEditor: React.FC<TiptapEditorProps>;
430
540
 
541
+ interface DrawioEditorProps {
542
+ /** XML format diagram data */
543
+ value?: string;
544
+ /** Callback when diagram content changes */
545
+ onChange?: (value: string) => void;
546
+ /** Whether the editor is disabled (read-only mode) */
547
+ disabled?: boolean;
548
+ /** Height of the editor, default is 500 */
549
+ height?: number | string;
550
+ /** Enable autosave feature */
551
+ autosave?: boolean;
552
+ }
553
+ declare const DrawioEditor: React.FC<DrawioEditorProps>;
554
+
431
555
  declare const LoginPage: React.FC;
432
556
 
433
557
  declare const KeycloakLoginPage: React.FC;
@@ -450,6 +574,21 @@ declare const RoleCreate: React.FC<IResourceComponentsProps>;
450
574
 
451
575
  declare const RoleEdit: React.FC<IResourceComponentsProps>;
452
576
 
577
+ /**
578
+ * Props for the BackgroundJobList component.
579
+ */
580
+ interface BackgroundJobListProps {
581
+ /** Custom title for the list page */
582
+ title?: string;
583
+ /** Base API URL (defaults to useApiUrl() without /odata) */
584
+ apiUrl?: string;
585
+ }
586
+ /**
587
+ * A reusable component for managing Hangfire background jobs.
588
+ * Displays recurring jobs, succeeded jobs, failed jobs, and processing jobs.
589
+ */
590
+ declare const BackgroundJobList: React.FC<BackgroundJobListProps>;
591
+
453
592
  type ColorModeContextType = {
454
593
  mode: "light" | "dark";
455
594
  setMode: (mode: "light" | "dark") => void;
@@ -468,4 +607,4 @@ interface IModelType {
468
607
  }
469
608
  declare const useModelTypes: () => _tanstack_react_query.UseQueryResult<IModelType[], Error>;
470
609
 
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 };
610
+ export { ApplicationUserCreate, ApplicationUserEdit, ApplicationUserList, AuthCallback, BackgroundJobList, type BackgroundJobListProps, 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 };