@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.
- package/LICENSE.md +3 -3
- package/dist/CrudService.d.ts +4 -4
- package/dist/CrudStore.d.ts +1 -1
- package/dist/FieldRegistry.d.ts +1 -1
- package/dist/FieldRegistry.d.ts.map +1 -1
- package/dist/adapters/FunctionsAdapter.d.ts +3 -3
- package/dist/adapters/FunctionsAdapter.d.ts.map +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/builtinFieldTypes.d.ts +1 -1
- package/dist/components/CrudCard.d.ts.map +1 -1
- package/dist/components/CrudCard.js +1 -1
- package/dist/components/DisplayFieldRenderer.d.ts +1 -1
- package/dist/components/DisplayThumbnail.d.ts +1 -1
- package/dist/components/FormLayout.d.ts +1 -1
- package/dist/components/fields/display/AvatarFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/BadgeFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/ButtonFieldDisplay.d.ts +2 -2
- package/dist/components/fields/display/CheckboxFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/DateFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/DropdownDisplay.d.ts +1 -1
- package/dist/components/fields/display/FileFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/GeoPointFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/HiddenFieldDisplay.d.ts +2 -2
- package/dist/components/fields/display/ImageFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/LinkFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/MapFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/MultiDropdownDisplay.d.ts +1 -1
- package/dist/components/fields/display/MultiInputTextFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/NumberFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/PasswordFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/PhoneNumberDisplay.d.ts +1 -1
- package/dist/components/fields/display/RadioFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/RangeFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/ReferenceFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/RichTextDisplay.d.ts +1 -1
- package/dist/components/fields/display/TextAreaDisplay.d.ts +1 -1
- package/dist/components/fields/display/TextFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/TimestampFieldDisplay.d.ts +1 -1
- package/dist/components/fields/display/index.d.ts +1 -1
- package/dist/components/form/fields/AvatarFieldComponent.d.ts +2 -2
- package/dist/components/form/fields/BadgeFieldComponent.d.ts +2 -2
- package/dist/components/form/fields/CheckboxFieldComponent.d.ts +1 -1
- package/dist/components/form/fields/ComboboxComponent.d.ts +1 -1
- package/dist/components/form/fields/CurrencyFieldComponent.d.ts +1 -1
- package/dist/components/form/fields/DateFieldComponent.d.ts +1 -1
- package/dist/components/form/fields/DropdownComponent.d.ts +1 -1
- package/dist/components/form/fields/GdprConsentFieldComponent.d.ts +1 -1
- package/dist/components/form/fields/GeoPointFieldComponent.d.ts +1 -1
- package/dist/components/form/fields/HiddenFieldComponent.d.ts +1 -1
- package/dist/components/form/fields/MultiDropdownComponent.d.ts +1 -1
- package/dist/components/form/fields/NumberFieldComponent.d.ts +1 -1
- package/dist/components/form/fields/PasswordFieldComponent.d.ts +1 -1
- package/dist/components/form/fields/PhoneNumberComponent.d.ts +1 -1
- package/dist/components/form/fields/RangeFieldComponent.d.ts +1 -1
- package/dist/components/form/fields/RatingFieldComponent.d.ts +1 -1
- package/dist/components/form/fields/RichTextComponent.d.ts +1 -1
- package/dist/components/form/fields/SwitchFieldComponent.d.ts +1 -1
- package/dist/components/form/fields/TextAreaComponent.d.ts +1 -1
- package/dist/components/form/fields/TextFieldComponent.d.ts +2 -2
- package/dist/components/form/fields/index.d.ts +1 -1
- package/dist/components/form/fields/internal/TiptapEditor.d.ts +1 -1
- package/dist/components/form/fields/types.d.ts +1 -1
- package/dist/components/form/index.d.ts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/fieldTypeRegistry.d.ts.map +1 -1
- package/dist/fieldTypeRegistry.types.d.ts.map +1 -1
- package/dist/forms/hooks/index.d.ts +1 -1
- package/dist/forms/hooks/useEntityField.d.ts +1 -1
- package/dist/forms/hooks/useEntityForm.d.ts.map +1 -1
- package/dist/forms/index.d.ts +1 -1
- package/dist/forms/types.d.ts +7 -7
- package/dist/forms/utils/getFieldsForOperation.d.ts +2 -2
- package/dist/forms/utils/index.d.ts +1 -1
- package/dist/forms/utils/isFieldEditable.d.ts +1 -1
- package/dist/forms/utils/translateFieldLabel.d.ts +3 -3
- package/dist/forms/utils/validateEntity.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/stores/index.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/utils/clientListProcessing.d.ts +1 -1
- package/dist/utils/collections.d.ts +6 -6
- package/dist/utils/imageProcessing.d.ts +1 -1
- package/dist/utils/imageUtils.d.ts +1 -1
- package/dist/utils/imageUtils.js +1 -1
- package/dist/utils/matchesFilter.d.ts.map +1 -1
- package/dist/utils/sanitizeHtml.d.ts +0 -5
- package/dist/utils/sanitizeHtml.d.ts.map +1 -1
- package/dist/utils/sanitizeHtml.js +1 -1
- package/dist/utils/uploadValidation.d.ts +1 -1
- package/dist/workflows/WorkflowPersistence.d.ts +1 -1
- package/dist/workflows/defineWorkflow.d.ts +1 -1
- package/dist/workflows/index.d.ts +1 -1
- 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
|
|
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
|
|
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
|
|
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
|
|
165
|
+
* @version 0.1.0
|
|
166
166
|
* @since 0.0.1
|
|
167
167
|
* @author AMBROISE PARK Consulting
|
|
168
168
|
*/
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
57
|
+
* @version 0.1.0
|
|
58
58
|
* @since 0.0.1
|
|
59
59
|
* @author AMBROISE PARK Consulting
|
|
60
60
|
*/
|
package/dist/utils/imageUtils.js
CHANGED
|
@@ -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).
|
|
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,
|
|
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":"
|
|
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
|
|
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};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@donotdev/crud",
|
|
3
|
-
"version": "0.0
|
|
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
|
|
57
|
-
"@donotdev/core": "^0.0
|
|
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"
|