@cundi/refine-xaf 1.0.3 → 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
@@ -194,6 +194,207 @@ declare const keycloakService: {
194
194
  logout: (idToken?: string) => void;
195
195
  };
196
196
 
197
+ declare const refineXafTranslations: {
198
+ en: {
199
+ pages: {
200
+ login: {
201
+ title: string;
202
+ buttons: {
203
+ submit: string;
204
+ };
205
+ };
206
+ };
207
+ buttons: {
208
+ create: string;
209
+ edit: string;
210
+ delete: string;
211
+ save: string;
212
+ cancel: string;
213
+ refresh: string;
214
+ list: string;
215
+ logout: string;
216
+ };
217
+ actions: {
218
+ create: string;
219
+ edit: string;
220
+ show: string;
221
+ list: string;
222
+ delete: string;
223
+ };
224
+ components: {
225
+ header: {
226
+ theme: {
227
+ light: string;
228
+ dark: string;
229
+ };
230
+ language: {
231
+ en: string;
232
+ "zh-TW": string;
233
+ };
234
+ menu: {
235
+ changePhoto: string;
236
+ manageAccount: string;
237
+ changePassword: string;
238
+ logout: string;
239
+ };
240
+ };
241
+ base64Upload: {
242
+ upload: string;
243
+ };
244
+ relatedList: {
245
+ addDetail: string;
246
+ actions: string;
247
+ manageDetail: string;
248
+ deleteConfirm: string;
249
+ };
250
+ smartList: {
251
+ search: string;
252
+ refresh: string;
253
+ columns: string;
254
+ selectColumns: string;
255
+ reset: string;
256
+ };
257
+ tiptapEditor: {
258
+ placeholder: string;
259
+ textColor: string;
260
+ highlight: string;
261
+ insertTable: string;
262
+ deleteTable: string;
263
+ emoji: string;
264
+ addRowBefore: string;
265
+ addRowAfter: string;
266
+ deleteRow: string;
267
+ addColumnBefore: string;
268
+ addColumnAfter: string;
269
+ deleteColumn: string;
270
+ math: string;
271
+ youtube: string;
272
+ enterYoutubeUrl: string;
273
+ };
274
+ drawioEditor: {
275
+ loading: string;
276
+ };
277
+ };
278
+ common: {
279
+ actions: {
280
+ create: string;
281
+ edit: string;
282
+ delete: string;
283
+ save: string;
284
+ cancel: string;
285
+ };
286
+ };
287
+ sider: {
288
+ dashboard: string;
289
+ dataTypeExamples: string;
290
+ tiptapExamples: string;
291
+ drawioExamples: string;
292
+ users: string;
293
+ roles: string;
294
+ settings: string;
295
+ };
296
+ };
297
+ "zh-TW": {
298
+ pages: {
299
+ login: {
300
+ title: string;
301
+ buttons: {
302
+ submit: string;
303
+ };
304
+ };
305
+ };
306
+ buttons: {
307
+ create: string;
308
+ edit: string;
309
+ delete: string;
310
+ save: string;
311
+ cancel: string;
312
+ refresh: string;
313
+ list: string;
314
+ logout: string;
315
+ };
316
+ actions: {
317
+ create: string;
318
+ edit: string;
319
+ show: string;
320
+ list: string;
321
+ delete: string;
322
+ };
323
+ components: {
324
+ header: {
325
+ theme: {
326
+ light: string;
327
+ dark: string;
328
+ };
329
+ language: {
330
+ en: string;
331
+ "zh-TW": string;
332
+ };
333
+ menu: {
334
+ changePhoto: string;
335
+ manageAccount: string;
336
+ changePassword: string;
337
+ logout: string;
338
+ };
339
+ };
340
+ base64Upload: {
341
+ upload: string;
342
+ };
343
+ relatedList: {
344
+ addDetail: string;
345
+ actions: string;
346
+ manageDetail: string;
347
+ deleteConfirm: string;
348
+ };
349
+ smartList: {
350
+ search: string;
351
+ refresh: string;
352
+ columns: string;
353
+ selectColumns: string;
354
+ reset: string;
355
+ };
356
+ tiptapEditor: {
357
+ placeholder: string;
358
+ textColor: string;
359
+ highlight: string;
360
+ insertTable: string;
361
+ deleteTable: string;
362
+ emoji: string;
363
+ addRowBefore: string;
364
+ addRowAfter: string;
365
+ deleteRow: string;
366
+ addColumnBefore: string;
367
+ addColumnAfter: string;
368
+ deleteColumn: string;
369
+ math: string;
370
+ youtube: string;
371
+ enterYoutubeUrl: string;
372
+ };
373
+ drawioEditor: {
374
+ loading: string;
375
+ };
376
+ };
377
+ common: {
378
+ actions: {
379
+ create: string;
380
+ edit: string;
381
+ delete: string;
382
+ save: string;
383
+ cancel: string;
384
+ };
385
+ };
386
+ sider: {
387
+ dashboard: string;
388
+ dataTypeExamples: string;
389
+ tiptapExamples: string;
390
+ drawioExamples: string;
391
+ users: string;
392
+ roles: string;
393
+ settings: string;
394
+ };
395
+ };
396
+ };
397
+
197
398
  declare const Header: React.FC;
198
399
 
199
400
  interface SmartListProps {
@@ -235,6 +436,20 @@ interface TiptapEditorProps {
235
436
  }
236
437
  declare const TiptapEditor: React.FC<TiptapEditorProps>;
237
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
+
238
453
  declare const LoginPage: React.FC;
239
454
 
240
455
  declare const KeycloakLoginPage: React.FC;
@@ -275,4 +490,4 @@ interface IModelType {
275
490
  }
276
491
  declare const useModelTypes: () => _tanstack_react_query.UseQueryResult<IModelType[], Error>;
277
492
 
278
- 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, 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
@@ -194,6 +194,207 @@ declare const keycloakService: {
194
194
  logout: (idToken?: string) => void;
195
195
  };
196
196
 
197
+ declare const refineXafTranslations: {
198
+ en: {
199
+ pages: {
200
+ login: {
201
+ title: string;
202
+ buttons: {
203
+ submit: string;
204
+ };
205
+ };
206
+ };
207
+ buttons: {
208
+ create: string;
209
+ edit: string;
210
+ delete: string;
211
+ save: string;
212
+ cancel: string;
213
+ refresh: string;
214
+ list: string;
215
+ logout: string;
216
+ };
217
+ actions: {
218
+ create: string;
219
+ edit: string;
220
+ show: string;
221
+ list: string;
222
+ delete: string;
223
+ };
224
+ components: {
225
+ header: {
226
+ theme: {
227
+ light: string;
228
+ dark: string;
229
+ };
230
+ language: {
231
+ en: string;
232
+ "zh-TW": string;
233
+ };
234
+ menu: {
235
+ changePhoto: string;
236
+ manageAccount: string;
237
+ changePassword: string;
238
+ logout: string;
239
+ };
240
+ };
241
+ base64Upload: {
242
+ upload: string;
243
+ };
244
+ relatedList: {
245
+ addDetail: string;
246
+ actions: string;
247
+ manageDetail: string;
248
+ deleteConfirm: string;
249
+ };
250
+ smartList: {
251
+ search: string;
252
+ refresh: string;
253
+ columns: string;
254
+ selectColumns: string;
255
+ reset: string;
256
+ };
257
+ tiptapEditor: {
258
+ placeholder: string;
259
+ textColor: string;
260
+ highlight: string;
261
+ insertTable: string;
262
+ deleteTable: string;
263
+ emoji: string;
264
+ addRowBefore: string;
265
+ addRowAfter: string;
266
+ deleteRow: string;
267
+ addColumnBefore: string;
268
+ addColumnAfter: string;
269
+ deleteColumn: string;
270
+ math: string;
271
+ youtube: string;
272
+ enterYoutubeUrl: string;
273
+ };
274
+ drawioEditor: {
275
+ loading: string;
276
+ };
277
+ };
278
+ common: {
279
+ actions: {
280
+ create: string;
281
+ edit: string;
282
+ delete: string;
283
+ save: string;
284
+ cancel: string;
285
+ };
286
+ };
287
+ sider: {
288
+ dashboard: string;
289
+ dataTypeExamples: string;
290
+ tiptapExamples: string;
291
+ drawioExamples: string;
292
+ users: string;
293
+ roles: string;
294
+ settings: string;
295
+ };
296
+ };
297
+ "zh-TW": {
298
+ pages: {
299
+ login: {
300
+ title: string;
301
+ buttons: {
302
+ submit: string;
303
+ };
304
+ };
305
+ };
306
+ buttons: {
307
+ create: string;
308
+ edit: string;
309
+ delete: string;
310
+ save: string;
311
+ cancel: string;
312
+ refresh: string;
313
+ list: string;
314
+ logout: string;
315
+ };
316
+ actions: {
317
+ create: string;
318
+ edit: string;
319
+ show: string;
320
+ list: string;
321
+ delete: string;
322
+ };
323
+ components: {
324
+ header: {
325
+ theme: {
326
+ light: string;
327
+ dark: string;
328
+ };
329
+ language: {
330
+ en: string;
331
+ "zh-TW": string;
332
+ };
333
+ menu: {
334
+ changePhoto: string;
335
+ manageAccount: string;
336
+ changePassword: string;
337
+ logout: string;
338
+ };
339
+ };
340
+ base64Upload: {
341
+ upload: string;
342
+ };
343
+ relatedList: {
344
+ addDetail: string;
345
+ actions: string;
346
+ manageDetail: string;
347
+ deleteConfirm: string;
348
+ };
349
+ smartList: {
350
+ search: string;
351
+ refresh: string;
352
+ columns: string;
353
+ selectColumns: string;
354
+ reset: string;
355
+ };
356
+ tiptapEditor: {
357
+ placeholder: string;
358
+ textColor: string;
359
+ highlight: string;
360
+ insertTable: string;
361
+ deleteTable: string;
362
+ emoji: string;
363
+ addRowBefore: string;
364
+ addRowAfter: string;
365
+ deleteRow: string;
366
+ addColumnBefore: string;
367
+ addColumnAfter: string;
368
+ deleteColumn: string;
369
+ math: string;
370
+ youtube: string;
371
+ enterYoutubeUrl: string;
372
+ };
373
+ drawioEditor: {
374
+ loading: string;
375
+ };
376
+ };
377
+ common: {
378
+ actions: {
379
+ create: string;
380
+ edit: string;
381
+ delete: string;
382
+ save: string;
383
+ cancel: string;
384
+ };
385
+ };
386
+ sider: {
387
+ dashboard: string;
388
+ dataTypeExamples: string;
389
+ tiptapExamples: string;
390
+ drawioExamples: string;
391
+ users: string;
392
+ roles: string;
393
+ settings: string;
394
+ };
395
+ };
396
+ };
397
+
197
398
  declare const Header: React.FC;
198
399
 
199
400
  interface SmartListProps {
@@ -235,6 +436,20 @@ interface TiptapEditorProps {
235
436
  }
236
437
  declare const TiptapEditor: React.FC<TiptapEditorProps>;
237
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
+
238
453
  declare const LoginPage: React.FC;
239
454
 
240
455
  declare const KeycloakLoginPage: React.FC;
@@ -275,4 +490,4 @@ interface IModelType {
275
490
  }
276
491
  declare const useModelTypes: () => _tanstack_react_query.UseQueryResult<IModelType[], Error>;
277
492
 
278
- 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, 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 };