@donotdev/crud 0.0.30 → 0.1.0

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 (94) hide show
  1. package/LICENSE.md +3 -3
  2. package/dist/CrudService.d.ts +4 -4
  3. package/dist/CrudStore.d.ts +1 -1
  4. package/dist/FieldRegistry.d.ts +1 -1
  5. package/dist/FieldRegistry.d.ts.map +1 -1
  6. package/dist/adapters/FunctionsAdapter.d.ts +3 -3
  7. package/dist/adapters/FunctionsAdapter.d.ts.map +1 -1
  8. package/dist/adapters/index.d.ts +1 -1
  9. package/dist/builtinFieldTypes.d.ts +1 -1
  10. package/dist/components/CrudCard.d.ts.map +1 -1
  11. package/dist/components/CrudCard.js +1 -1
  12. package/dist/components/DisplayFieldRenderer.d.ts +1 -1
  13. package/dist/components/DisplayThumbnail.d.ts +1 -1
  14. package/dist/components/FormLayout.d.ts +1 -1
  15. package/dist/components/fields/display/AvatarFieldDisplay.d.ts +1 -1
  16. package/dist/components/fields/display/BadgeFieldDisplay.d.ts +1 -1
  17. package/dist/components/fields/display/ButtonFieldDisplay.d.ts +2 -2
  18. package/dist/components/fields/display/CheckboxFieldDisplay.d.ts +1 -1
  19. package/dist/components/fields/display/DateFieldDisplay.d.ts +1 -1
  20. package/dist/components/fields/display/DropdownDisplay.d.ts +1 -1
  21. package/dist/components/fields/display/FileFieldDisplay.d.ts +1 -1
  22. package/dist/components/fields/display/GeoPointFieldDisplay.d.ts +1 -1
  23. package/dist/components/fields/display/HiddenFieldDisplay.d.ts +2 -2
  24. package/dist/components/fields/display/ImageFieldDisplay.d.ts +1 -1
  25. package/dist/components/fields/display/LinkFieldDisplay.d.ts +1 -1
  26. package/dist/components/fields/display/MapFieldDisplay.d.ts +1 -1
  27. package/dist/components/fields/display/MultiDropdownDisplay.d.ts +1 -1
  28. package/dist/components/fields/display/MultiInputTextFieldDisplay.d.ts +1 -1
  29. package/dist/components/fields/display/NumberFieldDisplay.d.ts +1 -1
  30. package/dist/components/fields/display/PasswordFieldDisplay.d.ts +1 -1
  31. package/dist/components/fields/display/PhoneNumberDisplay.d.ts +1 -1
  32. package/dist/components/fields/display/RadioFieldDisplay.d.ts +1 -1
  33. package/dist/components/fields/display/RangeFieldDisplay.d.ts +1 -1
  34. package/dist/components/fields/display/ReferenceFieldDisplay.d.ts +1 -1
  35. package/dist/components/fields/display/RichTextDisplay.d.ts +1 -1
  36. package/dist/components/fields/display/TextAreaDisplay.d.ts +1 -1
  37. package/dist/components/fields/display/TextFieldDisplay.d.ts +1 -1
  38. package/dist/components/fields/display/TimestampFieldDisplay.d.ts +1 -1
  39. package/dist/components/fields/display/index.d.ts +1 -1
  40. package/dist/components/form/fields/AvatarFieldComponent.d.ts +2 -2
  41. package/dist/components/form/fields/BadgeFieldComponent.d.ts +2 -2
  42. package/dist/components/form/fields/CheckboxFieldComponent.d.ts +1 -1
  43. package/dist/components/form/fields/ComboboxComponent.d.ts +1 -1
  44. package/dist/components/form/fields/CurrencyFieldComponent.d.ts +1 -1
  45. package/dist/components/form/fields/DateFieldComponent.d.ts +1 -1
  46. package/dist/components/form/fields/DropdownComponent.d.ts +1 -1
  47. package/dist/components/form/fields/GdprConsentFieldComponent.d.ts +1 -1
  48. package/dist/components/form/fields/GeoPointFieldComponent.d.ts +1 -1
  49. package/dist/components/form/fields/HiddenFieldComponent.d.ts +1 -1
  50. package/dist/components/form/fields/MultiDropdownComponent.d.ts +1 -1
  51. package/dist/components/form/fields/NumberFieldComponent.d.ts +1 -1
  52. package/dist/components/form/fields/PasswordFieldComponent.d.ts +1 -1
  53. package/dist/components/form/fields/PhoneNumberComponent.d.ts +1 -1
  54. package/dist/components/form/fields/RangeFieldComponent.d.ts +1 -1
  55. package/dist/components/form/fields/RatingFieldComponent.d.ts +1 -1
  56. package/dist/components/form/fields/RichTextComponent.d.ts +1 -1
  57. package/dist/components/form/fields/SwitchFieldComponent.d.ts +1 -1
  58. package/dist/components/form/fields/TextAreaComponent.d.ts +1 -1
  59. package/dist/components/form/fields/TextFieldComponent.d.ts +2 -2
  60. package/dist/components/form/fields/index.d.ts +1 -1
  61. package/dist/components/form/fields/internal/TiptapEditor.d.ts +1 -1
  62. package/dist/components/form/fields/types.d.ts +1 -1
  63. package/dist/components/form/index.d.ts +1 -1
  64. package/dist/components/index.d.ts +1 -1
  65. package/dist/fieldTypeRegistry.d.ts.map +1 -1
  66. package/dist/fieldTypeRegistry.types.d.ts.map +1 -1
  67. package/dist/forms/hooks/index.d.ts +1 -1
  68. package/dist/forms/hooks/useEntityField.d.ts +1 -1
  69. package/dist/forms/hooks/useEntityForm.d.ts.map +1 -1
  70. package/dist/forms/index.d.ts +1 -1
  71. package/dist/forms/types.d.ts +7 -7
  72. package/dist/forms/utils/getFieldsForOperation.d.ts +2 -2
  73. package/dist/forms/utils/index.d.ts +1 -1
  74. package/dist/forms/utils/isFieldEditable.d.ts +1 -1
  75. package/dist/forms/utils/translateFieldLabel.d.ts +3 -3
  76. package/dist/forms/utils/validateEntity.d.ts +1 -1
  77. package/dist/index.d.ts +1 -1
  78. package/dist/stores/index.d.ts +1 -1
  79. package/dist/tsconfig.tsbuildinfo +1 -1
  80. package/dist/types.d.ts +4 -4
  81. package/dist/utils/clientListProcessing.d.ts +1 -1
  82. package/dist/utils/collections.d.ts +6 -6
  83. package/dist/utils/imageProcessing.d.ts +1 -1
  84. package/dist/utils/imageUtils.d.ts +1 -1
  85. package/dist/utils/imageUtils.js +1 -1
  86. package/dist/utils/matchesFilter.d.ts.map +1 -1
  87. package/dist/utils/sanitizeHtml.d.ts +0 -5
  88. package/dist/utils/sanitizeHtml.d.ts.map +1 -1
  89. package/dist/utils/sanitizeHtml.js +1 -1
  90. package/dist/utils/uploadValidation.d.ts +1 -1
  91. package/dist/workflows/WorkflowPersistence.d.ts +1 -1
  92. package/dist/workflows/defineWorkflow.d.ts +1 -1
  93. package/dist/workflows/index.d.ts +1 -1
  94. package/package.json +3 -3
package/dist/types.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * - CrudStore = only tracks optimistic metadata (optimisticData + originalData)
8
8
  * - mergeWithOptimistic merges TanStack cache with optimistic data for display
9
9
  *
10
- * @version 0.0.1
10
+ * @version 0.1.0
11
11
  * @since 0.0.1
12
12
  * @author AMBROISE PARK Consulting
13
13
  */
@@ -65,7 +65,7 @@ export interface CollectionUIState {
65
65
  * CRUD store state interface
66
66
  * Note: No data field - TanStack Query owns data, CrudStore only tracks optimistic ops
67
67
  *
68
- * @version 0.0.3
68
+ * @version 0.1.0
69
69
  * @since 0.0.1
70
70
  * @author AMBROISE PARK Consulting
71
71
  */
@@ -87,7 +87,7 @@ export interface CrudState {
87
87
  * CRUD store actions interface
88
88
  * Note: No setData/getData - TanStack Query owns data, CrudStore only tracks optimistic ops
89
89
  *
90
- * @version 0.0.3
90
+ * @version 0.1.0
91
91
  * @since 0.0.1
92
92
  * @author AMBROISE PARK Consulting
93
93
  */
@@ -162,7 +162,7 @@ export interface MutationOptions {
162
162
  * CRUD Service Interface
163
163
  * Complete interface for CRUD operations with caching and optimistic updates
164
164
  *
165
- * @version 0.0.4
165
+ * @version 0.1.0
166
166
  * @since 0.0.1
167
167
  * @author AMBROISE PARK Consulting
168
168
  */
@@ -3,7 +3,7 @@
3
3
  * @description Pure functions for filtering, searching, and sorting entity items.
4
4
  * Used by useCrudList/useCrudCardList hooks and UI components.
5
5
  *
6
- * @version 0.0.1
6
+ * @version 0.1.0
7
7
  * @since 0.0.1
8
8
  * @author AMBROISE PARK Consulting
9
9
  */
@@ -2,7 +2,7 @@
2
2
  * @fileoverview Collection utilities
3
3
  * @description Utilities for working with collections and subcollections
4
4
  *
5
- * @version 0.0.1
5
+ * @version 0.1.0
6
6
  * @since 0.0.1
7
7
  * @author AMBROISE PARK Consulting
8
8
  */
@@ -10,7 +10,7 @@ import type { dndevSchema } from '@donotdev/core';
10
10
  /**
11
11
  * Deterministic subcollection configuration
12
12
  *
13
- * @version 0.0.1
13
+ * @version 0.1.0
14
14
  * @since 0.0.1
15
15
  * @author AMBROISE PARK Consulting
16
16
  */
@@ -26,7 +26,7 @@ export interface DeterministicSubcollectionConfig<T> {
26
26
  /**
27
27
  * Append subcollection configuration
28
28
  *
29
- * @version 0.0.1
29
+ * @version 0.1.0
30
30
  * @since 0.0.1
31
31
  * @author AMBROISE PARK Consulting
32
32
  */
@@ -38,7 +38,7 @@ export interface AppendSubcollectionConfig<T> {
38
38
  /**
39
39
  * Load a deterministic range of items from a subcollection
40
40
  *
41
- * @version 0.0.1
41
+ * @version 0.1.0
42
42
  * @since 0.0.1
43
43
  * @author AMBROISE PARK Consulting
44
44
  */
@@ -46,7 +46,7 @@ export declare function loadDeterministicRange<T>(userId: string, config: Determ
46
46
  /**
47
47
  * Upsert a deterministic range of items in a subcollection
48
48
  *
49
- * @version 0.0.1
49
+ * @version 0.1.0
50
50
  * @since 0.0.1
51
51
  * @author AMBROISE PARK Consulting
52
52
  */
@@ -54,7 +54,7 @@ export declare function upsertDeterministic<T>(userId: string, config: Determini
54
54
  /**
55
55
  * Append an item to a subcollection
56
56
  *
57
- * @version 0.0.1
57
+ * @version 0.1.0
58
58
  * @since 0.0.1
59
59
  * @author AMBROISE PARK Consulting
60
60
  */
@@ -2,7 +2,7 @@
2
2
  * @fileoverview Image Processing Utilities
3
3
  * @description Client-side image processing for WebP conversion, resizing, and thumbnail generation
4
4
  *
5
- * @version 0.0.1
5
+ * @version 0.1.0
6
6
  * @since 0.0.1
7
7
  * @author AMBROISE PARK Consulting
8
8
  */
@@ -2,7 +2,7 @@
2
2
  * @fileoverview Image Utility Functions
3
3
  * @description Hash generation, FLIP rotation, deduplication, and local preview management
4
4
  *
5
- * @version 0.0.1
5
+ * @version 0.1.0
6
6
  * @since 0.0.1
7
7
  * @author AMBROISE PARK Consulting
8
8
  */
@@ -1 +1 @@
1
- async function d(e){const t=await e.arrayBuffer(),r=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(r)).map(o=>o.toString(16).padStart(2,"0")).join("")}function h(e){return URL.createObjectURL(e)}function u(e){e.startsWith("blob:")&&URL.revokeObjectURL(e)}async function l(e){return new Promise((t,r)=>{const a=new Image,o=new FileReader;o.onload=n=>{if(!n.target?.result){r(new Error("Failed to read file"));return}a.src=n.target.result},o.onerror=()=>r(new Error("Failed to read file")),a.onload=()=>{const n=document.createElement("canvas"),i=n.getContext("2d");if(!i){r(new Error("Failed to get canvas context"));return}n.width=a.height,n.height=a.width,i.translate(n.width/2,n.height/2),i.rotate(Math.PI/2),i.drawImage(a,-a.width/2,-a.height/2),n.toBlob(s=>{if(s){const c=new File([s],e.name,{type:e.type,lastModified:Date.now()});t(c)}else r(new Error("Failed to create blob from canvas"))},e.type,.95)},a.onerror=()=>r(new Error("Failed to load image")),o.readAsDataURL(e)})}class f{undoStack=[];redoStack=[];maxStackSize=50;push(t){this.undoStack.push(t),this.undoStack.length>this.maxStackSize&&this.undoStack.shift(),this.redoStack=[]}undo(){const t=this.undoStack.pop();return t?(this.redoStack.push(t),t):null}redo(){const t=this.redoStack.pop();return t?(this.undoStack.push(t),t):null}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}clear(){this.undoStack=[],this.redoStack=[]}}function g(e,t){return e.filter(r=>r.hash===t)}function p(){return`img_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}export{f as UndoRedoManager,h as createPreviewURL,g as findDuplicatesByHash,d as generateFileHash,p as generateImageId,u as revokePreviewURL,l as rotateImage90};
1
+ async function d(e){const t=await e.arrayBuffer(),r=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(r)).map(o=>o.toString(16).padStart(2,"0")).join("")}function h(e){return URL.createObjectURL(e)}function u(e){e.startsWith("blob:")&&URL.revokeObjectURL(e)}async function l(e){return new Promise((t,r)=>{const a=new Image,o=new FileReader;o.onload=n=>{if(!n.target?.result){r(new Error("Failed to read file"));return}a.src=n.target.result},o.onerror=()=>r(new Error("Failed to read file")),a.onload=()=>{const n=document.createElement("canvas"),i=n.getContext("2d");if(!i){r(new Error("Failed to get canvas context"));return}n.width=a.height,n.height=a.width,i.translate(n.width/2,n.height/2),i.rotate(Math.PI/2),i.drawImage(a,-a.width/2,-a.height/2),n.toBlob(s=>{if(s){const c=new File([s],e.name,{type:e.type,lastModified:Date.now()});t(c)}else r(new Error("Failed to create blob from canvas"))},e.type,.95)},a.onerror=()=>r(new Error("Failed to load image")),o.readAsDataURL(e)})}class f{undoStack=[];redoStack=[];maxStackSize=50;push(t){this.undoStack.push(t),this.undoStack.length>this.maxStackSize&&this.undoStack.shift(),this.redoStack=[]}undo(){const t=this.undoStack.pop();return t?(this.redoStack.push(t),t):null}redo(){const t=this.redoStack.pop();return t?(this.undoStack.push(t),t):null}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}clear(){this.undoStack=[],this.redoStack=[]}}function g(e,t){return e.filter(r=>r.hash===t)}function p(){return`img_${Date.now()}_${Math.random().toString(36).slice(2,11)}`}export{f as UndoRedoManager,h as createPreviewURL,g as findDuplicatesByHash,d as generateFileHash,p as generateImageId,u as revokePreviewURL,l as rotateImage90};
@@ -1 +1 @@
1
- {"version":3,"file":"matchesFilter.d.ts","sourceRoot":"","sources":["../../src/utils/matchesFilter.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,GAAG,EAEd,WAAW,EACP,MAAM,GACN;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9B,MAAM,EAAE,GACR;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/B;IACE,GAAG,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,GAAG,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACvC,GACD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EAErC,SAAS,EAAE,MAAM,GAChB,OAAO,CA+VT"}
1
+ {"version":3,"file":"matchesFilter.d.ts","sourceRoot":"","sources":["../../src/utils/matchesFilter.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,GAAG,EAEd,WAAW,EACP,MAAM,GACN;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9B,MAAM,EAAE,GACR;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/B;IACE,GAAG,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,GAAG,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACvC,GACD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EAErC,SAAS,EAAE,MAAM,GAChB,OAAO,CA8VT"}
@@ -1,7 +1,2 @@
1
- /**
2
- * Sanitize HTML using DOMPurify — handles all known XSS vectors including
3
- * malformed tags, event handlers, javascript: URIs, data: URIs, SVG payloads,
4
- * CSS injection, and HTML entity encoding bypasses.
5
- */
6
1
  export declare function sanitizeHtml(html: string): string;
7
2
  //# sourceMappingURL=sanitizeHtml.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sanitizeHtml.d.ts","sourceRoot":"","sources":["../../src/utils/sanitizeHtml.ts"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD"}
1
+ {"version":3,"file":"sanitizeHtml.d.ts","sourceRoot":"","sources":["../../src/utils/sanitizeHtml.ts"],"names":[],"mappings":"AA6DA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGjD"}
@@ -1 +1 @@
1
- import t from"dompurify";function n(i){return t.sanitize(i)}export{n as sanitizeHtml};
1
+ import e from"dompurify";const r=["p","h1","h2","h3","h4","h5","h6","blockquote","pre","hr","ul","ol","li","a","strong","b","em","i","u","s","code","br","span","sub","sup","mark","table","thead","tbody","tr","th","td","img","div","figure","figcaption","details","summary"],i=["href","target","rel","src","alt","width","height","class","colspan","rowspan"],a=/<\/?(?:embed|source|track|area|wbr)[^>]*>/gi;function n(t){return e.sanitize(t,{ALLOWED_TAGS:r,ALLOWED_ATTR:i}).replace(a,"")}export{n as sanitizeHtml};
@@ -3,7 +3,7 @@
3
3
  * @description Type-safe validation utilities to ensure no blob URLs reach the database.
4
4
  * Provides security checks for Picture objects and form data validation.
5
5
  *
6
- * @version 0.0.1
6
+ * @version 0.1.0
7
7
  * @since 0.0.1
8
8
  * @author AMBROISE PARK Consulting
9
9
  */
@@ -2,7 +2,7 @@
2
2
  * @fileoverview Workflow persistence adapter
3
3
  * @description Saves and restores workflow progress to/from localStorage.
4
4
  *
5
- * @version 0.0.1
5
+ * @version 0.1.0
6
6
  * @since 0.0.1
7
7
  * @author AMBROISE PARK Consulting
8
8
  */
@@ -18,7 +18,7 @@
18
18
  * });
19
19
  * ```
20
20
  *
21
- * @version 0.0.1
21
+ * @version 0.1.0
22
22
  * @since 0.0.1
23
23
  * @author AMBROISE PARK Consulting
24
24
  */
@@ -2,7 +2,7 @@
2
2
  * @fileoverview Workflow engine exports
3
3
  * @description Multi-step entity workflow: defineWorkflow, useEntityWorkflow, persistence.
4
4
  *
5
- * @version 0.0.1
5
+ * @version 0.1.0
6
6
  * @since 0.0.1
7
7
  * @author AMBROISE PARK Consulting
8
8
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/crud",
3
- "version": "0.0.30",
3
+ "version": "0.1.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -53,8 +53,8 @@
53
53
  "@dnd-kit/core": "^6.3.1",
54
54
  "@dnd-kit/sortable": "^10.0.0",
55
55
  "@dnd-kit/utilities": "^3.2.2",
56
- "@donotdev/components": "^0.0.32",
57
- "@donotdev/core": "^0.0.44",
56
+ "@donotdev/components": "^0.1.0",
57
+ "@donotdev/core": "^0.1.0",
58
58
  "@hookform/resolvers": "^5.2.2",
59
59
  "dompurify": "^3.3.2",
60
60
  "react-easy-crop": "^5.5.6"