@donotdev/crud 0.3.1 → 0.3.2
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/dist/CrudService.bulk.js +1 -1
- package/dist/CrudService.bulkAcross.js +1 -1
- package/dist/CrudService.bulkReconciliation.js +1 -1
- package/dist/CrudService.cache.d.ts +8 -0
- package/dist/CrudService.cache.d.ts.map +1 -1
- package/dist/CrudService.cache.js +1 -1
- package/dist/CrudService.d.ts +7 -2
- package/dist/CrudService.d.ts.map +1 -1
- package/dist/CrudService.internal.js +2 -2
- package/dist/CrudService.js +1 -1
- package/dist/CrudService.mutations.js +1 -1
- package/dist/CrudService.optimistic.js +1 -1
- package/dist/CrudService.queries.js +1 -1
- package/dist/CrudService.subscriptions.js +1 -1
- package/dist/CrudService.writeRules.js +1 -1
- package/dist/CrudStore.js +1 -1
- package/dist/FieldRegistry.js +1 -1
- package/dist/adapters/FunctionsAdapter.js +1 -1
- package/dist/components/CrudButton.js +1 -1
- package/dist/components/CrudCard.js +1 -1
- package/dist/components/DateFilter.d.ts.map +1 -1
- package/dist/components/DateFilter.js +1 -1
- package/dist/components/DisplayFieldRenderer.js +1 -1
- package/dist/components/DisplayThumbnail.js +1 -1
- package/dist/components/EntityFilters.js +1 -1
- package/dist/components/FormFieldRenderer.js +1 -1
- package/dist/components/FormLayout.js +1 -1
- package/dist/components/SortableCardList.js +1 -1
- package/dist/components/YearFilter.js +1 -1
- package/dist/components/controlled/complex/ControlledAddressField.js +1 -1
- package/dist/components/controlled/complex/ControlledDateField.js +1 -1
- package/dist/components/controlled/complex/ControlledFieldArrayField.js +1 -1
- package/dist/components/controlled/complex/ControlledGeoPointField.js +1 -1
- package/dist/components/controlled/complex/ControlledMapField.js +1 -1
- package/dist/components/controlled/complex/ControlledMultiInputField.js +1 -1
- package/dist/components/controlled/complex/ControlledRichTextField.js +1 -1
- package/dist/components/controlled/complex/ControlledTimestampField.js +1 -1
- package/dist/components/controlled/complex/index.js +1 -1
- package/dist/components/controlled/fieldOptions.js +1 -1
- package/dist/components/controlled/file/ControlledDocumentField.js +1 -1
- package/dist/components/controlled/file/ControlledFileField.js +1 -1
- package/dist/components/controlled/file/ControlledImageField.js +1 -1
- package/dist/components/controlled/file/ControlledMultiDocumentField.js +1 -1
- package/dist/components/controlled/file/ControlledMultiFileField.js +1 -1
- package/dist/components/controlled/file/ControlledMultiImageField.js +1 -1
- package/dist/components/controlled/file/index.js +1 -1
- package/dist/components/controlled/index.js +1 -1
- package/dist/components/controlled/input/ControlledCheckboxField.js +1 -1
- package/dist/components/controlled/input/ControlledCurrencyField.js +1 -1
- package/dist/components/controlled/input/ControlledDurationField.js +1 -1
- package/dist/components/controlled/input/ControlledGdprConsentField.js +1 -1
- package/dist/components/controlled/input/ControlledNumberField.js +1 -1
- package/dist/components/controlled/input/ControlledPasswordField.js +1 -1
- package/dist/components/controlled/input/ControlledPhoneField.js +1 -1
- package/dist/components/controlled/input/ControlledPriceField.js +1 -1
- package/dist/components/controlled/input/ControlledRangeField.js +1 -1
- package/dist/components/controlled/input/ControlledRatingField.js +1 -1
- package/dist/components/controlled/input/ControlledSwitchField.js +1 -1
- package/dist/components/controlled/input/ControlledTextField.js +1 -1
- package/dist/components/controlled/input/ControlledTextareaField.js +1 -1
- package/dist/components/controlled/input/index.js +1 -1
- package/dist/components/controlled/select/ControlledComboboxField.js +1 -1
- package/dist/components/controlled/select/ControlledDropdownField.js +1 -1
- package/dist/components/controlled/select/ControlledMultiDropdownField.js +1 -1
- package/dist/components/controlled/select/ControlledRadioField.js +1 -1
- package/dist/components/controlled/select/ControlledReferenceField.js +1 -1
- package/dist/components/controlled/select/ControlledYearField.js +1 -1
- package/dist/components/controlled/select/index.js +1 -1
- package/dist/components/controlled/types.js +1 -1
- package/dist/components/fields/display/AvatarFieldDisplay.js +1 -1
- package/dist/components/fields/display/BadgeFieldDisplay.js +1 -1
- package/dist/components/fields/display/ButtonFieldDisplay.js +1 -1
- package/dist/components/fields/display/CheckboxFieldDisplay.js +1 -1
- package/dist/components/fields/display/DateFieldDisplay.js +1 -1
- package/dist/components/fields/display/DropdownDisplay.js +1 -1
- package/dist/components/fields/display/FileFieldDisplay.js +1 -1
- package/dist/components/fields/display/GeoPointFieldDisplay.js +1 -1
- package/dist/components/fields/display/HiddenFieldDisplay.js +1 -1
- package/dist/components/fields/display/ImageFieldDisplay.js +1 -1
- package/dist/components/fields/display/LinkFieldDisplay.js +1 -1
- package/dist/components/fields/display/MapFieldDisplay.js +1 -1
- package/dist/components/fields/display/MultiDropdownDisplay.js +1 -1
- package/dist/components/fields/display/MultiInputTextFieldDisplay.js +1 -1
- package/dist/components/fields/display/NumberFieldDisplay.js +1 -1
- package/dist/components/fields/display/PasswordFieldDisplay.js +1 -1
- package/dist/components/fields/display/PhoneNumberDisplay.js +1 -1
- package/dist/components/fields/display/RadioFieldDisplay.js +1 -1
- package/dist/components/fields/display/RangeFieldDisplay.js +1 -1
- package/dist/components/fields/display/ReferenceFieldDisplay.js +1 -1
- package/dist/components/fields/display/RichTextDisplay.js +2 -2
- package/dist/components/fields/display/TextAreaDisplay.js +1 -1
- package/dist/components/fields/display/TextFieldDisplay.js +1 -1
- package/dist/components/fields/display/TimestampFieldDisplay.js +1 -1
- package/dist/components/fields/display/index.js +1 -1
- package/dist/components/form/fields/AddressFieldComponent.js +1 -1
- package/dist/components/form/fields/AvatarFieldComponent.js +1 -1
- package/dist/components/form/fields/BadgeFieldComponent.js +1 -1
- package/dist/components/form/fields/ButtonFieldComponent.js +1 -1
- package/dist/components/form/fields/CheckboxFieldComponent.js +1 -1
- package/dist/components/form/fields/ComboboxComponent.js +1 -1
- package/dist/components/form/fields/CurrencyFieldComponent.js +1 -1
- package/dist/components/form/fields/DateFieldComponent.js +1 -1
- package/dist/components/form/fields/DocumentFieldComponent.js +1 -1
- package/dist/components/form/fields/DropdownComponent.js +1 -1
- package/dist/components/form/fields/DurationFieldComponent.js +1 -1
- package/dist/components/form/fields/FileFieldComponent.js +1 -1
- package/dist/components/form/fields/GdprConsentFieldComponent.js +1 -1
- package/dist/components/form/fields/GeoPointFieldComponent.js +1 -1
- package/dist/components/form/fields/HiddenFieldComponent.js +1 -1
- package/dist/components/form/fields/ImageFieldComponent.js +1 -1
- package/dist/components/form/fields/MapFieldComponent.js +1 -1
- package/dist/components/form/fields/MultiDropdownComponent.js +1 -1
- package/dist/components/form/fields/MultiInputTextFieldComponent.js +1 -1
- package/dist/components/form/fields/NumberFieldComponent.js +1 -1
- package/dist/components/form/fields/PasswordFieldComponent.js +1 -1
- package/dist/components/form/fields/PhoneNumberComponent.js +1 -1
- package/dist/components/form/fields/PriceFieldComponent.js +1 -1
- package/dist/components/form/fields/RadioFieldComponent.js +1 -1
- package/dist/components/form/fields/RangeFieldComponent.js +1 -1
- package/dist/components/form/fields/RatingFieldComponent.js +1 -1
- package/dist/components/form/fields/ReferenceFieldComponent.js +1 -1
- package/dist/components/form/fields/RichTextComponent.js +1 -1
- package/dist/components/form/fields/SwitchFieldComponent.js +1 -1
- package/dist/components/form/fields/TextAreaComponent.js +1 -1
- package/dist/components/form/fields/TextFieldComponent.js +1 -1
- package/dist/components/form/fields/TimestampFieldComponent.js +1 -1
- package/dist/components/form/fields/index.js +1 -1
- package/dist/components/form/fields/internal/InlineFieldRow.js +1 -1
- package/dist/components/form/fields/internal/TiptapEditor.js +2 -2
- package/dist/components/form/internal/ImageViewerDialog.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/contexts/UploadContext.js +1 -1
- package/dist/contexts/index.js +1 -1
- package/dist/fieldTypeRegistry.js +1 -1
- package/dist/fieldTypeRegistry.store.js +1 -1
- package/dist/forms/FormNavigation.js +1 -1
- package/dist/forms/childRows.js +1 -1
- package/dist/forms/extend.js +1 -1
- package/dist/forms/hooks/index.js +1 -1
- package/dist/forms/hooks/useController.js +1 -1
- package/dist/forms/hooks/useEntityField.js +1 -1
- package/dist/forms/hooks/useEntityForm.js +1 -1
- package/dist/forms/hooks/useFormDraftState.js +1 -1
- package/dist/forms/index.js +1 -1
- package/dist/forms/utils/buildInitialValues.js +1 -1
- package/dist/forms/utils/conditionAwareResolver.js +1 -1
- package/dist/forms/utils/emptyValue.js +1 -1
- package/dist/forms/utils/getFieldsForOperation.js +1 -1
- package/dist/forms/utils/index.js +1 -1
- package/dist/forms/utils/isFieldEditable.js +1 -1
- package/dist/forms/utils/translateFieldLabel.js +1 -1
- package/dist/forms/utils/validateEntity.js +1 -1
- package/dist/forms/utils/writableFields.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useChildRows.js +1 -1
- package/dist/hooks/useCrudFilters.js +1 -1
- package/dist/hooks/useCrudPageSize.js +1 -1
- package/dist/hooks/useEntityFavorites.js +1 -1
- package/dist/hooks/useExtensionRows.js +1 -1
- package/dist/hooks/useFieldConditions.js +1 -1
- package/dist/hooks/useFileUpload.js +1 -1
- package/dist/hooks/useReferenceResolver.js +1 -1
- package/dist/hooks/useRelatedItems.js +1 -1
- package/dist/index.js +1 -1
- package/dist/registerBuiltinFieldTypes.js +1 -1
- package/dist/stores/FormStore.js +1 -1
- package/dist/stores/UploadStore.js +1 -1
- package/dist/stores/index.js +1 -1
- package/dist/stores/uploadStoreRef.js +1 -1
- package/dist/symbol-index.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +4 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/useBaseCrudList.js +1 -1
- package/dist/useCrud.js +1 -1
- package/dist/useCrudCardList.js +1 -1
- package/dist/useCrudDoc.d.ts +8 -1
- package/dist/useCrudDoc.d.ts.map +1 -1
- package/dist/useCrudDoc.js +1 -1
- package/dist/useCrudList.js +1 -1
- package/dist/useServerPrefetch.js +1 -1
- package/dist/utils/clientListProcessing.js +1 -1
- package/dist/utils/collections.js +1 -1
- package/dist/utils/fileStorage.js +1 -1
- package/dist/utils/filterUrl.js +1 -1
- package/dist/utils/imageProcessing.js +1 -1
- package/dist/utils/imageStorage.js +1 -1
- package/dist/utils/imageUtils.js +1 -1
- package/dist/utils/matchesFilter.js +1 -1
- package/dist/utils/mergeWithOptimistic.js +1 -1
- package/dist/utils/referenceEntity.js +1 -1
- package/dist/utils/routeRecord.d.ts +21 -0
- package/dist/utils/routeRecord.d.ts.map +1 -0
- package/dist/utils/routeRecord.js +1 -0
- package/dist/utils/sanitizeHtml.js +1 -1
- package/dist/utils/scopeUtils.js +1 -1
- package/dist/utils/uploadValidation.js +1 -1
- package/dist/utils/useRowTranslator.js +1 -1
- package/dist/workflows/WorkflowPersistence.js +1 -1
- package/dist/workflows/defineWorkflow.js +1 -1
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/useEntityWorkflow.js +1 -1
- package/guidelines/COMPONENTS.md +1 -1
- package/guidelines/CRUD.md +3 -1
- package/package.json +3 -3
package/dist/types.d.ts
CHANGED
|
@@ -254,8 +254,10 @@ export interface CrudServiceInterface {
|
|
|
254
254
|
invalidateCollection(collection: string): Promise<void>;
|
|
255
255
|
/**
|
|
256
256
|
* Cache a row stored by a write that did not go through this service (an app
|
|
257
|
-
* RPC, a server function)
|
|
258
|
-
*
|
|
257
|
+
* RPC, a server function), without a refetch. A row already in a cache of the
|
|
258
|
+
* collection (document cache non-null, or a cached list) replaces it there; a row
|
|
259
|
+
* no cache knows is an insert: document cache set, row appended to every cached
|
|
260
|
+
* list of the collection (`total` bumped), as `add` does.
|
|
259
261
|
* @param row - The full row as the backend returned it, read-filtered for the requester
|
|
260
262
|
* @since 0.3.0
|
|
261
263
|
*/
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,WAAW,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;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;IACjC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;CACnD"}
|
package/dist/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const E={PENDING:"pending",CONFIRMED:"confirmed",FAILED:"failed"},e={ADD:"add",UPDATE:"update",SET:"set",DELETE:"delete"};export{e as CRUD_OPERATION,E as OPTIMISTIC_STATUSES};
|
package/dist/useBaseCrudList.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as j,useCallback as
|
|
1
|
+
import{useMemo as j,useCallback as $,useRef as x,useState as ee,useEffect as te}from"react";import{isClient as se,useQuery as re}from"@donotdev/core";import{useCrudStore as ie}from"./CrudStore";import{CRUD_OPERATION as K}from"./types";import{useCrud as k,getCrudServiceInstance as oe,EMPTY_OPTIMISTIC as ae}from"./useCrud";import{useServerPrefetch as ne}from"./useServerPrefetch";import{mergeWithOptimistic as le}from"./utils/mergeWithOptimistic";import{injectScopeFilter as ce,getCurrentScopeValue as ue}from"./utils/scopeUtils";import{useRowTranslator as me}from"./utils/useRowTranslator";const pe=1e3;function de(A,v,t,f={}){const C=f.enabled??!0,M=k("status"),c=M==="ready",B=k(A,f),{error:I,invalidate:P,_collection:d,_schemas:T,_cacheOptions:S,_scope:y}=B,q=ie(e=>e.collections[d]?.optimistic||ae),w=x(new Map([[1,null]])),O=x(0),[E,N]=ee(!1),a=t?.mode==="auto"?E?"server":"client":t?.mode??"client",U=ue(y),g=j(()=>{if(!c||!T)return null;const e=oe();if(!e)return null;const h=T.get,n=ce(f.queryOptions,y);if(!t)return e.getListQueryOptions(d,n,h,S,v);if(a==="client"){const l=t.mode==="auto"&&!n?.limit?{...n,limit:pe}:n;return e.getListQueryOptions(d,l,h,S,v)}const u=w.current,m=O.current,{page:p,pageSize:s}=t;let o,r;if(u.has(p))o=u.get(p)??void 0,r=s;else if(p>m&&u.has(m)){const l=p-m;o=u.get(m)??void 0,r=l*s}else o=void 0,r=p*s;return e.getListQueryOptions(d,{...n,limit:r,startAfter:o},h,S,v)},[c,d,S,T?"hasSchema":"noSchema",v,a,t?.page,t?.pageSize,f.queryOptions,y?.provider,U]),{data:i,isLoading:W,isFetching:Y,error:G,refetch:z}=re({queryKey:g?.queryKey??["crud",d,"disabled"],queryFn:g?.queryFn??(()=>Promise.resolve({items:[]})),staleTime:g?.staleTime,enabled:C&&!!g});ne(g,C,y);const L=!se();te(()=>{t?.mode==="auto"&&!E&&i&&i.total!=null&&i.total>i.items.length&&N(!0)},[i,t?.mode,E]);const D=me(A,f),F=j(()=>{if(!i||!c)return{items:[],total:void 0};let e=i.items;if(a==="server"&&t&&e.length>0){const s=w.current,o=O.current,{page:r,pageSize:l}=t,J=e.length;if(Math.ceil(J/l)>1||r>o){const _=s.has(r)?r:o+1;for(let b=_;b<=r;b++){const V=(b-_+1)*l-1;if(V<e.length){const Z=e[V];s.set(b+1,Z.id)}}}i.lastVisible&&s.set(r+1,i.lastVisible),O.current=Math.max(o,r);const R=s.has(r)?0:(r-o-1)*l,X=R+l;e=e.slice(R,X)}const h=le(e,q),n=new Set(e.map(s=>s.id));let u=0,m=0;for(const[s,o]of Object.entries(q))o.operation===K.ADD&&!n.has(s)?u++:o.operation===K.DELETE&&n.has(s)&&m++;const p=(i.total??e.length)+u-m;return{items:h.map(D),total:p}},[i,q,D,c,a,t?.page,t?.pageSize]),Q=$(async()=>{c&&(a==="server"&&(w.current=new Map([[1,null]]),O.current=0),await P(),await z())},[P,z,c,a]);if(!c){const e=async()=>{};return{status:M,data:{items:[],total:void 0},items:[],loading:!0,fetching:!1,error:I,mutate:e,refresh:e,isAvailable:!1,effectiveMode:a}}const H=F?.items??[];return{status:M,data:F,items:H,loading:L?C&&i===void 0:W,fetching:L?!1:Y,error:L?null:G??I,mutate:Q,refresh:Q,isAvailable:!0,effectiveMode:a}}export{de as useBaseCrudList};
|
package/dist/useCrud.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useEffect as
|
|
1
|
+
"use client";import{useEffect as L,useMemo as U,useCallback as n}from"react";import{useFeatureConsent as W,AtomicBulkError as Z,FRAMEWORK_FEATURES as H,FEATURE_STATUS as f,handleError as J,isClient as Q,createSchemas as V,DEGRADED_CRUD_API as X,getGlobalSingleton as $}from"@donotdev/core";import{getCrudService as F}from"./CrudService";import{useCrudStore as m}from"./CrudStore";import{injectScope as C,injectScopeFilter as ee}from"./utils/scopeUtils";const te={},re={};function M(){return $("crud-service",()=>({service:null,initPromise:null,errorNotified:!1}))}function i(){return y()}function y(){const u=M(),o=u.service??F();return o.attachProvider()?(u.service||(o.setStore(m),u.service=o),o):null}function se(u,o={}){const v=W(H.CRUD),N=m(e=>e.crudService),A=v&&!N&&!y(),b=v?A?f.INITIALIZING:f.READY:f.DEGRADED,S=u==="status",p=!S&&typeof u=="object"?u:o.entity,r=S?"__status__":typeof u=="string"?u:u.collection,l=p?.scope,_=o.noCache??!1,E=o.staleTime,h=U(()=>({noCache:_,staleTime:E}),[_,E]),c=U(()=>{if(!S){if(o.schema){const e=o.schema;return{create:e,draft:e,update:e,get:e,list:e,listCard:e,delete:e}}if(p)return V(p)}},[S,o.schema,p?.name,r]),Y=m(e=>e.collections[r]?.loading||!1),T=m(e=>e.collections[r]?.error||null);L(()=>{if(!Q()||!v||!c)return;const{crudService:e}=m.getState(),s=y();if(s){e||m.getState().setCrudService(s);return}const t=M();e||t.service||t.initPromise||(t.initPromise=(async()=>{try{if(t.service||m.getState().crudService)return;const a=F();t.service=a,a.setStore(m),await a.initialize(),t.errorNotified=!1,m.getState().setCrudService(a)}catch(a){t.errorNotified||(J(a,{userMessage:"Failed to initialize CRUD service.",context:{collection:r},severity:"error"}),t.errorNotified=!0)}finally{t.initPromise=null}})())},[v,r,c?"hasSchema":"noSchema"]);const D=A||Y,G=b===f.READY,O=n(async e=>{const s=i();return!s||!c?null:s.get(r,e,c.get,h)},[r,c?"hasSchema":"noSchema",h]),d=c,j=n(async(e,s,t)=>{const a=i();if(!a||!d)return;const g=C(s,l);return a.set(r,e,g,d.create,{...t,readSchema:d.get})},[r,c?"hasSchema":"noSchema",l?.provider]),x=n(async(e,s,t)=>{const a=i();if(!(!a||!d))return a.update(r,e,s,d.update,{...t,readSchema:d.get})},[r,c]),q=n(async e=>{const s=i();!s||!d||await s.remove(r,e)},[r,c]),z=n(async(e,s)=>{const t=i();t&&await t.delete(r,e,s)},[r]),B=n(async(e,s)=>{const t=i();if(!t||!d)return"";const a=C(e,l);return t.add(r,a,d.create,{...s,readSchema:d.get})},[r,c?"hasSchema":"noSchema",l?.provider]),I=n(async(e,s)=>{const t=i();if(!t){if(s?.execution==="atomic")throw new Z("CRUD service is unavailable","not-committed");return{results:{}}}return t.bulkAcross(e,s)},[]),R=n(async(e,s)=>{const t=i();if(!t||!c)return{insertedIds:[],updatedIds:[],deletedIds:[],failed:[]};const a={inserts:e.inserts?.map(g=>C(g,l)),updates:e.updates,deletes:e.deletes};return t.bulk(r,a,{create:c.create,draft:c.draft,update:c.update},s)},[r,c?"hasSchema":"noSchema",l?.provider]),K=n(async e=>{const s=i();if(!s||!c)return[];const t=ee(e,l);return(await s.query(r,t,c.get,h)).items},[r,c?"hasSchema":"noSchema",h,l?.provider]),P=n((e,s)=>{const t=i();return!t||!c?()=>{}:t.subscribe(r,e,s,c.get)},[r,c?"hasSchema":"noSchema"]),k=n((e,s)=>{const t=i();return!t||!c?()=>{}:t.subscribeToCollection(r,e,s,c.get)},[r,c?"hasSchema":"noSchema"]),w=n(async()=>{const e=i();e&&await e.invalidateCollection(r)},[r]);return S?b:G?{status:f.READY,loading:D,error:T,get:O,set:j,update:x,remove:q,delete:z,add:B,bulk:R,bulkAcross:I,query:K,subscribe:P,subscribeToCollection:k,invalidate:w,isAvailable:!0,_collection:r,_schemas:c,_cacheOptions:h,_scope:l}:{...X,status:b,loading:D,error:T,subscribe:P,subscribeToCollection:k,invalidate:w,bulk:R,bulkAcross:I,_collection:r,_schemas:c,_cacheOptions:h,_scope:l}}export{te as EMPTY_DATA,re as EMPTY_OPTIMISTIC,i as getCrudServiceInstance,se as useCrud};
|
package/dist/useCrudCardList.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as
|
|
1
|
+
import{useMemo as d}from"react";import{useCrudFilters as p}from"./hooks/useCrudFilters";import{useBaseCrudList as f}from"./useBaseCrudList";import{applyFilters as h,applySearch as y,applySort as g}from"./utils/clientListProcessing";function C(s,e={}){const o={enabled:e.enabled,queryOptions:e.queryOptions,schema:e.schema,entity:e.entity,staleTime:e.staleTime,noCache:e.noCache,translate:e.translate},t=f(s,"listCard",null,o),l=typeof s=="string"?null:s,n=typeof s=="string"?s:s.collection,{filters:a}=p({collection:n}),i=e.clientSort===null?null:e.clientSort??l?.defaultSort??null,{processed:u,filteredTotal:c}=d(()=>{let r=t.items;l&&Object.keys(a).length>0&&(r=h(r,a,l)),l&&e.searchQuery&&(r=y(r,e.searchQuery,l));const m=r.length;return i&&(r=g(r,i)),{processed:r,filteredTotal:m}},[t.items,a,e.searchQuery,i,l]);return{status:t.status,data:t.data?{items:t.data.items}:null,items:t.items,processed:u,filteredTotal:c,loading:t.loading,fetching:t.fetching,error:t.error,mutate:t.mutate,refresh:t.refresh,isAvailable:t.isAvailable}}export{C as useCrudCardList};
|
package/dist/useCrudDoc.d.ts
CHANGED
|
@@ -20,7 +20,14 @@ export interface UseCrudDocReturn<T> {
|
|
|
20
20
|
loading: boolean;
|
|
21
21
|
/** True during a background refetch (show a subtle indicator) */
|
|
22
22
|
fetching: boolean;
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* True once the read settled and no document exists for `id`. On Vite (client-rendered),
|
|
25
|
+
* when this is the record the URL names (the current route declares the entity in its
|
|
26
|
+
* PageMeta and its `:param` is `id`), the page then carries
|
|
27
|
+
* `<meta name="robots" content="noindex">` until a document shows up or the component
|
|
28
|
+
* unmounts; a secondary read on the page never does. On Next, entity pages answer a
|
|
29
|
+
* missing record with a 404.
|
|
30
|
+
*/
|
|
24
31
|
notFound: boolean;
|
|
25
32
|
/** Read error (access denied, network, adapter) */
|
|
26
33
|
error: Error | null;
|
package/dist/useCrudDoc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCrudDoc.d.ts","sourceRoot":"","sources":["../src/useCrudDoc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCrudDoc.d.ts","sourceRoot":"","sources":["../src/useCrudDoc.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAM/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAMhD;;;GAGG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,CAAE,SAAQ,IAAI,CAChD,cAAc,CAAC,CAAC,CAAC,EACjB,SAAS,CACV;IACC,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,kDAAkD;AAClD,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,MAAM,EAAE,aAAa,CAAC;IACtB;;;OAGG;IACH,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACf,oFAAoF;IACpF,OAAO,EAAE,OAAO,CAAC;IACjB,iEAAiE;IACjE,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;;;OAOG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,mDAAmD;IACnD,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,8FAA8F;IAC9F,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,SAAS,EAC5C,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7B,OAAO,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAC7C,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,wBAAgB,UAAU,CACxB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAE3D,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7B,OAAO,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC7B,gBAAgB,CAAC,CAAC,CAAC,CAAC;AACvB,wBAAgB,UAAU,CACxB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAE3D,kBAAkB,EAAE,SAAS,GAAG,MAAM,EACtC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7B,OAAO,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC7B,gBAAgB,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/useCrudDoc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
import{useCallback as q,useEffect as w,useMemo as x}from"react";import{FEATURE_STATUS as b,isClient as L,isNextJs as N,useQuery as O,useQueryClient as Q}from"@donotdev/core";import{cachedListRow as U}from"./CrudService.cache";import{useCrudStore as K}from"./CrudStore";import{useCrud as D,getCrudServiceInstance as P}from"./useCrud";import{useServerPrefetch as k}from"./useServerPrefetch";import{applyOptimisticToDoc as G}from"./utils/mergeWithOptimistic";import{isRouteRecord as J}from"./utils/routeRecord";import{useRowTranslator as M}from"./utils/useRowTranslator";function Y(d,e,u={}){const r=u.enabled??!0,s=D("status"),l=s===b.READY,{_collection:a,_schemas:m,_cacheOptions:F,_scope:I}=D(d,u),p=K(o=>e?o.collections[a]?.optimistic[e]:void 0),f=l?P():null,t=f&&m&&e?f.getDocQueryOptions(a,e,m.get,F):null,R=Q(),c=t&&e?U(R,a,e):void 0,{data:i,isLoading:E,isFetching:S,error:_,refetch:h}=O({queryKey:t?.queryKey??["crud",a,"get",null],queryFn:t?.queryFn??(()=>Promise.resolve(null)),staleTime:t?.staleTime,...c&&{initialData:c.data,initialDataUpdatedAt:c.updatedAt},enabled:r&&!!t});k(t,r,I);const y=M(d,u),g=x(()=>y(G(i??null,p)),[y,i,p]),n=!L(),v=!!t,A=q(async()=>{v&&await h()},[h,v]),T=i!==void 0&&g===null,C=l&&T&&!n&&!N()&&!!e&&J(a,e);return w(()=>{if(!C)return;const o=document.createElement("meta");return o.name="robots",o.content="noindex",document.head.append(o),()=>o.remove()},[C]),l?{status:s,data:g,loading:n?r&&!!t&&i===void 0:E,fetching:n?!1:S,notFound:T,error:n?null:_,refresh:A,isAvailable:!0}:{status:s,data:null,loading:s===b.INITIALIZING&&r&&!!e,fetching:!1,notFound:!1,error:null,refresh:A,isAvailable:!1}}export{Y as useCrudDoc};
|
package/dist/useCrudList.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as h}from"react";import{useCrudFilters as
|
|
1
|
+
import{useMemo as h}from"react";import{useCrudFilters as g}from"./hooks/useCrudFilters";import{useBaseCrudList as S}from"./useBaseCrudList";import{applyFilters as C,applySearch as T,applySort as b}from"./utils/clientListProcessing";function Q(r,e={}){const i=e.pagination??"auto",n=e.page??1,p=e.pageSize??10,c={mode:i,page:n,pageSize:p},u={enabled:e.enabled,queryOptions:e.queryOptions,schema:e.schema,entity:e.entity,staleTime:e.staleTime,noCache:e.noCache,translate:e.translate},l=S(r,"list",c,u),a=typeof r=="string"?null:r,m=typeof r=="string"?r:r.collection,{filters:o}=g({collection:m}),s=e.clientSort===null?null:e.clientSort??a?.defaultSort??null,{processed:d,filteredTotal:y}=h(()=>{let t=l.items;a&&Object.keys(o).length>0&&(t=C(t,o,a)),a&&e.searchQuery&&(t=T(t,e.searchQuery,a));const f=t.length;return s&&(t=b(t,s)),{processed:t,filteredTotal:f}},[l.items,o,e.searchQuery,s,a]);return{...l,processed:d,filteredTotal:y}}export{Q as useCrudList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasProvider as
|
|
1
|
+
import{hasProvider as u,isClient as a,useAuthSessionSnapshot as c,useQueryClient as i}from"@donotdev/core";import{getCrudServiceInstance as h}from"./useCrud";function f(s,n,o){const t=i(),e=c();if(a()||!n||!s||o)return;const r=t.getQueryState(s.queryKey);if(!(r&&(r.data!==void 0||r.error)||!(!u("auth")||e?.user===null||e?.user&&e.accessToken&&h()?.bindRequestAccessToken(t,e.accessToken))))throw t.fetchQuery(s).then(()=>{},()=>{})}export{f as useServerPrefetch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{describeEntity as u}from"@donotdev/core";import{matchesFilter as
|
|
1
|
+
import{describeEntity as u}from"@donotdev/core";import{matchesFilter as f}from"./matchesFilter";import"../fieldTypeRegistry.store";function d(t,n,s){const i=Object.entries(n);return i.length===0?t:t.filter(r=>i.every(([l,a])=>{const e=s.fields[l],o=e?.type||"text";return f(r[l],a,o,e?.filter)}))}function c(t){if(t.search?.fields&&t.search.fields.length>0)return t.search.fields;const n=[],{fields:s}=u(t);for(const[i,r]of Object.entries(s))r.visibleAt==="hidden"||r.visibleAt==="technical"||r.value.kind==="text"&&n.push(i);return n}function m(t,n,s){if(!n||n.trim()==="")return t;const i=n.toLowerCase(),r=c(s);return r.length===0?t.filter(l=>Object.values(l).some(a=>a==null?!1:String(a).toLowerCase().includes(i))):t.filter(l=>r.some(a=>{const e=l[a];return e==null?!1:typeof e=="object"&&"formatted_address"in e?String(e.formatted_address).toLowerCase().includes(i):String(e).toLowerCase().includes(i)}))}function p(t,n){if(typeof n=="function")return[...t].sort(n);const{field:s,direction:i="asc"}=n,r=i==="desc"?-1:1;return[...t].sort((l,a)=>{const e=l[s],o=a[s];return e==null&&o==null?0:e==null?1:o==null?-1:typeof e=="number"&&typeof o=="number"?(e-o)*r:typeof e=="object"&&"amount"in e&&typeof o=="object"&&"amount"in o?(e.amount-o.amount)*r:e instanceof Date&&o instanceof Date?(e.getTime()-o.getTime())*r:String(e).localeCompare(String(o))*r})}export{d as applyFilters,m as applySearch,p as applySort,c as getSearchableFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCrudService as
|
|
1
|
+
import{getCrudService as c}from"../CrudService";async function p(t,n){const s=c(),a=[],e=n.range?.start??1,o=n.range?.end??28;for(let r=e;r<=o;r++){const m=String(r),i=await s.get(n.path(t),m,n.schema);i&&a.push(i)}return a}async function d(t,n,s){const a=c();for(const e of s){const o=n.idOf(e);await a.set(n.path(t),o,e,n.schema)}}async function h(t,n,s){const a=c();if(n.idFrom){const e=n.idFrom(s);await a.set(n.path(t),e,s,n.schema);return}return a.add(n.path(t),s,n.schema)}export{h as appendToCollection,p as loadDeterministicRange,d as upsertDeterministic};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{handleError as d,getProvider as
|
|
1
|
+
"use client";import{handleError as d,getProvider as u}from"@donotdev/core";function h(e){return e.replace(/[^a-zA-Z0-9.-]/g,"_").replace(/_{2,}/g,"_").toLowerCase()}async function f(e,t={}){const{storagePath:r,filename:n,onProgress:o,signal:s}=t,i=Date.now(),c=h(e.name),a=n||`${i}_${c}`,l=r?`${r}/${a}`:a;try{return{url:(await u("storage").upload(e,{storagePath:r,filename:a,onProgress:o?p=>o({bytesTransferred:0,totalBytes:0,progress:p}):void 0,signal:s})).url,filename:e.name,size:e.size,mimeType:e.type,uploadedAt:new Date().toISOString()}}catch(p){throw d(p,{userMessage:"Failed to upload file",severity:"error",context:{filename:e.name,fileSize:e.size}})}}async function w(e,t={}){const r=[],n=e.reduce((s,i)=>s+i.size,0);let o=0;for(const s of e){if(t.signal?.aborted)throw new Error("Upload cancelled");const i=t.onProgress?a=>{const l=a.bytesTransferred/a.totalBytes*s.size;t.onProgress({bytesTransferred:o+l,totalBytes:n,progress:(o+l)/n*100})}:void 0,c=await f(s,{...t,onProgress:i});r.push(c),o+=s.size}return r}async function v(e){try{await u("storage").delete(e.url)}catch(t){throw d(t,{userMessage:"Failed to delete file",severity:"error",context:{url:e.url,filename:e.filename}}),t}}function y(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function m(e){const t=e.split(".");return t.length>1?t.pop().toLowerCase():""}function M(e,t){const r=t?m(t):"";if(e){if(e.startsWith("image/"))return"image";if(e.startsWith("video/"))return"video";if(e.startsWith("audio/"))return"audio";if(e==="application/pdf")return"pdf";if(e.includes("word")||e.includes("document"))return"doc";if(e.includes("excel")||e.includes("spreadsheet"))return"xls";if(e.includes("powerpoint")||e.includes("presentation"))return"ppt"}switch(r){case"pdf":return"pdf";case"doc":case"docx":return"doc";case"xls":case"xlsx":case"csv":return"xls";case"ppt":case"pptx":return"ppt";case"md":case"txt":return"text";case"html":case"htm":return"html";case"zip":case"rar":case"7z":return"archive";default:return"file"}}function z(e){if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,n)).toFixed(1))} ${r[n]}`}const g=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","text/plain","text/markdown","text/html","text/csv"],x=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".html",".csv"];function F(){return[...g,...x].join(",")}export{x as DOCUMENT_EXTENSIONS,g as DOCUMENT_MIME_TYPES,v as deleteFile,z as formatFileSize,y as generateFileId,F as getDocumentAcceptString,m as getFileExtension,M as getFileIcon,f as uploadFile,w as uploadFiles};
|
package/dist/utils/filterUrl.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFilterType as
|
|
1
|
+
import{getFilterType as g}from"../fieldTypeRegistry.store";const d=new Set(["select","multiselect","reference"]),c="f_";function m(n,s){const e=n.fields[s];return e?g(e.type):void 0}function h(n,s){if(!n.startsWith(c))return!1;const e=n.slice(c.length);if(e in s.fields)return m(s,e)!=="range";const r=/^(.+)_(min|max)$/.exec(e);return!!r&&m(s,r[1])==="range"}function u(n,s,e){[...new Set(n.keys())].filter(r=>h(r,e)).forEach(r=>n.delete(r));for(const[r,t]of Object.entries(s)){if(!(r in e.fields))continue;const i=`${c}${r}`;typeof t=="string"?t!==""&&n.append(i,t):Array.isArray(t)?t.forEach(a=>n.append(i,a)):(t.min&&n.set(`${i}_min`,t.min),t.max&&n.set(`${i}_max`,t.max))}}function p(n,s){const e=new URLSearchParams(n),r={};for(const t of Object.keys(s.fields)){const i=`${c}${t}`,a=m(s,t);if(a==="range"){const o=e.get(`${i}_min`),l=e.get(`${i}_max`);(o||l)&&(r[t]={...o?{min:o}:{},...l?{max:l}:{}});continue}const f=e.getAll(i).filter(o=>o!=="");f.length!==0&&(r[t]=a!==void 0&&d.has(a)||f.length>1?f:f[0])}return r}function _(n,s){const e=new URLSearchParams;return u(e,n,s),e.sort(),e.toString()}export{c as FILTER_PARAM_PREFIX,_ as encodeFilterParams,p as readFilterParams,u as writeFilterParams};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"valibot";const E=e.pipe(e.number(),e.minValue(.1),e.maxValue(1)),y=e.pipe(e.number(),e.integer(),e.minValue(16),e.maxValue(8192)),
|
|
1
|
+
import*as e from"valibot";const E=e.pipe(e.number(),e.minValue(.1),e.maxValue(1)),y=e.pipe(e.number(),e.integer(),e.minValue(16),e.maxValue(8192)),I=e.strictObject({maxWidth:e.optional(y),maxHeight:e.optional(y),thumbWidth:e.optional(y),thumbHeight:e.optional(y),aspectRatio:e.optional(e.union([e.literal("original"),e.pipe(e.number(),e.minValue(.1),e.maxValue(10))])),quality:e.optional(E),thumbQuality:e.optional(E),background:e.optional(e.pipe(e.string(),e.minLength(1)))});function Q(t){if(typeof t!="object"||t===null)return;const a=t.image;if(a!==void 0)return e.parse(I,a)}const v=new WeakMap;function S(t){return JSON.stringify({maxWidth:t.maxWidth,maxHeight:t.maxHeight,thumbWidth:t.thumbWidth,thumbHeight:t.thumbHeight,aspectRatio:t.aspectRatio,quality:t.quality,thumbQuality:t.thumbQuality,background:t.background,crop:t.crop})}async function j(t,a={}){const r=S(a),h=v.get(t);if(h?.has(r))return h.get(r);const{maxWidth:u=1920,maxHeight:o=1440,thumbWidth:i=300,thumbHeight:l=225,aspectRatio:g=4/3,quality:d=.85,thumbQuality:p=.65,background:m="#FFFFFF",crop:n}=a;return new Promise((b,w)=>{const s=new Image,F=new FileReader;F.onload=c=>{s.src=c.target?.result},F.onerror=()=>w(new Error("Failed to read file")),s.onload=async()=>{try{const c=n?n.width:s.width,W=n?n.height:s.height,H=g==="original",f=H?c/W:g,{width:R,height:M}=q(c,W,u,o,f),O=await B(s,R,M,f,d,m,n),V=H?q(c,W,i,l,f):{width:i,height:l},P=await B(s,V.width,V.height,f,p,m,n),k={fullBlob:O,thumbBlob:P,width:R,height:M};let x=v.get(t);x||(x=new Map,v.set(t,x)),x.set(r,k),b(k)}catch(c){w(c)}},s.onerror=()=>w(new Error("Failed to load image")),F.readAsDataURL(t)})}function q(t,a,r,h,u){let o=t,i=a;o>r&&(i=r/o*i,o=r),i>h&&(o=h/i*o,i=h);const l=o/i;return Math.abs(l-u)>.01&&(l>u?i=o/u:o=i*u),{width:Math.round(o),height:Math.round(i)}}async function B(t,a,r,h,u,o,i){const l=document.createElement("canvas"),g=l.getContext("2d");if(!g)throw new Error("Failed to get canvas context");l.width=a,l.height=r,o!=="transparent"&&(g.fillStyle=o,g.fillRect(0,0,a,r));let d,p,m,n;if(i)d=i.x,p=i.y,m=i.width,n=i.height;else{const b=t.width/t.height;m=t.width,n=t.height,d=0,p=0,b>h?(m=t.height*h,d=(t.width-m)/2):b<h&&(n=t.width/h,p=(t.height-n)/2)}return g.drawImage(t,d,p,m,n,0,0,a,r),new Promise((b,w)=>{l.toBlob(s=>{s?b(s):w(new Error("Failed to convert canvas to blob"))},"image/webp",u)})}function z(t,a){return t.type.startsWith("image/")?a&&t.size>a?{valid:!1,error:`File size exceeds ${(a/1048576).toFixed(1)}MB limit`}:{valid:!0}:{valid:!1,error:"File must be an image"}}export{I as imageProcessingOptionsSchema,j as processImage,Q as readImageProcessingOptions,z as validateImageFile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{handleError as _,getProvider as
|
|
1
|
+
import{handleError as _,getProvider as g}from"@donotdev/core";function P(e){return e.replace(/[^a-zA-Z0-9.-]/g,"_").replace(/_{2,}/g,"_").toLowerCase()}async function v(e,t,l,m={}){const{storagePath:r,filename:f,onProgress:o,signal:n}=m,y=Date.now(),a=(f||`${y}_${P(l)}`).replace(/\.[^/.]+$/,""),h=`${a}_full.webp`,p=`${a}_thumb.webp`,$=r?`${r}/${h}`:h,U=r?`${r}/${p}`:p;try{const u=new File([e],`${a}_full.webp`,{type:"image/webp"}),s=new File([t],`${a}_thumb.webp`,{type:"image/webp"});let w,d;const c=g("storage"),b=await c.upload(u,{storagePath:r,filename:`${a}_full.webp`,onProgress:o?i=>o({bytesTransferred:0,totalBytes:0,progress:i*.5}):void 0,signal:n});if(w=b.url,n?.aborted){try{await c.delete(b.url)}catch{}throw new Error("Upload cancelled")}return d=(await c.upload(s,{storagePath:r,filename:`${a}_thumb.webp`,onProgress:o?i=>o({bytesTransferred:0,totalBytes:0,progress:50+i*.5}):void 0,signal:n})).url,{fullUrl:w,thumbUrl:d}}catch(u){try{const s=g("storage");await s.delete($).catch(()=>{}),await s.delete(U).catch(()=>{})}catch{}throw u}}async function E(e){try{const t=g("storage"),l=[t.delete(e.fullUrl)];e.thumbUrl&&l.push(t.delete(e.thumbUrl)),await Promise.all(l)}catch(t){throw _(t,{userMessage:"Failed to delete image",severity:"error",context:{fullUrl:e.fullUrl,thumbUrl:e.thumbUrl}}),t}}export{E as deleteImage,v as uploadImage};
|
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(
|
|
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(a=>a.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,i=new FileReader;i.onload=n=>{if(!n.target?.result){r(new Error("Failed to read file"));return}a.src=n.target.result},i.onerror=()=>r(new Error("Failed to read file")),a.onload=()=>{const n=document.createElement("canvas"),o=n.getContext("2d");if(!o){r(new Error("Failed to get canvas context"));return}n.width=a.height,n.height=a.width,o.translate(n.width/2,n.height/2),o.rotate(Math.PI/2),o.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")),i.readAsDataURL(e)})}class g{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 S(e,t){return e.filter(r=>r.hash===t)}function w(){return`img_${Date.now()}_${Math.random().toString(36).slice(2,11)}`}export{g as UndoRedoManager,h as createPreviewURL,S as findDuplicatesByHash,d as generateFileHash,w as generateImageId,u as revokePreviewURL,l as rotateImage90};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFilterType as
|
|
1
|
+
import{getFilterType as D}from"../fieldTypeRegistry.store";const b=new Set(["select","multiselect","reference"]);function x(e,t,n){if(e==null)return!1;const w=(Array.isArray(e)?e:[e]).map(String);if(n!==void 0&&w.includes(n))return!0;const y=new Set(t.map(String));return w.some(N=>y.has(N))}function I(e,t,n,w){if(!t)return!0;const y=w?.wildcard;if(Array.isArray(t)){if(t.length===0)return!0;const r=D(n);if(!(r==="range"&&(n==="date"||n==="datetime-local"||n==="timestamp")))return r&&b.has(r)?x(e,t,y):t.some(a=>{if(typeof a=="object"&&"date"in a){const u=a.date;if(e==null)return!1;const i=e instanceof Date?e:new Date(e);return isNaN(i.getTime())?!1:i.toISOString().split("T")[0]===u}return String(e)===String(a)});if(e==null)return!1;const o=e instanceof Date?e:new Date(e);if(isNaN(o.getTime()))return!1;const l=o.toISOString().split("T")[0];return t.some(a=>typeof a=="string"?l===a:typeof a=="object"&&"date"in a?l===a.date:!1)}if(typeof t=="object"&&"date"in t&&!("min"in t)&&!Array.isArray(t)){if(!(D(n)==="range"&&(n==="date"||n==="datetime-local"||n==="timestamp")))return!1;const r=t.date;if(!r)return!0;if(e==null)return!1;const o=e instanceof Date?e.toISOString().split("T")[0]:new Date(e).toISOString().split("T")[0];if((n==="datetime-local"||n==="timestamp")&&t.time){const l=e instanceof Date?e.toISOString().slice(11,16):new Date(e).toISOString().slice(11,16);return o===r&&l===t.time}return o===r}if(typeof t=="object"&&"min"in t){const r=D(n);if(!r)return!0;const o=r==="range"&&(n==="date"||n==="datetime-local"||n==="timestamp"),l=r==="range"&&!o,a=n==="price",u=a&&e!=null&&typeof e=="object"?Number(e.amount):l&&e!=null?typeof e=="number"?e:Number(e):NaN;if(l||a){if(typeof t.min=="object"&&t.min!==null&&"date"in t.min)return!1;const i=t,d=typeof i.min=="string"&&i.min!=="",g=typeof i.max=="string"&&i.max!=="";return d&&!g?e==null||isNaN(u)?!1:u>=Number(i.min):!d&&g?e==null?!0:isNaN(u)?!1:u<=Number(i.max):d&&g?e==null||isNaN(u)?!1:u>=Number(i.min)&&u<=Number(i.max):!0}if(o){if(typeof t.min=="object"&&t.min!==null&&"date"in t.min&&!("min"in t.min)){const s=t,c=s.min,m=s.max,S=c?.date&&c.date!=="",T=m?.date&&m.date!=="";if(S&&!T){if(e==null)return!1;const f=e instanceof Date?e:new Date(e);if(isNaN(f.getTime()))return!1;const p=new Date(c.date+(c.time?`T${c.time}:00`:"T00:00:00"));return f>=p}if(!S&&T&&m){if(e==null)return!0;const f=e instanceof Date?e:new Date(e);if(isNaN(f.getTime()))return!1;const p=new Date(m.date+(m.time?`T${m.time}:00`:"T23:59:59"));return f<=p}if(S&&T&&m){if(e==null)return!1;const f=e instanceof Date?e:new Date(e);if(isNaN(f.getTime()))return!1;const p=new Date(c.date+(c.time?`T${c.time}:00`:"T00:00:00")),j=new Date(m.date+(m.time?`T${m.time}:00`:"T23:59:59"));return f>=p&&f<=j}return!0}const i=t,d=typeof i.min=="string"&&i.min!=="",g=typeof i.max=="string"&&i.max!=="";if(d&&!g){if(e==null)return!1;const s=e instanceof Date?e:new Date(e);return isNaN(s.getTime())?!1:s>=new Date(i.min)}if(!d&&g){if(e==null)return!0;const s=e instanceof Date?e:new Date(e);return isNaN(s.getTime())?!1:s<=new Date(i.max)}if(d&&g){if(e==null)return!1;const s=e instanceof Date?e:new Date(e);return isNaN(s.getTime())?!1:s>=new Date(i.min)&&s<=new Date(i.max)}return!0}}if(typeof t=="string"&&D(n)==="rating"){if(e==null)return!1;const r=Number(t),o=typeof e=="number"?e:Number(e);return isNaN(r)||isNaN(o)?!1:o>=r}const N=D(n);return N?N==="address"?e==null?!1:typeof e=="object"&&"formatted_address"in e?String(e.formatted_address).toLowerCase().includes(String(t).toLowerCase()):!1:b.has(N)?x(e,[t],y):e==null?!1:String(e).toLowerCase().includes(String(t).toLowerCase()):!0}export{I as matchesFilter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CRUD_OPERATION as a}from"../types";function
|
|
1
|
+
import{CRUD_OPERATION as a}from"../types";function n(o,i){const s=[],c=new Set;for(const p of o){const t=i[p.id];t?.operation!==a.DELETE&&(t?.operation===a.UPDATE&&t.optimisticData?s.push(t.optimisticData):s.push(p),c.add(p.id))}for(const[p,t]of Object.entries(i))t.operation===a.ADD&&!c.has(p)&&t.optimisticData&&s.push(t.optimisticData);return s}function D(o,i){return i?i.operation===a.DELETE?null:i.operation===a.UPDATE&&i.optimisticData?o?{...o,...i.optimisticData}:i.optimisticData:i.operation===a.ADD&&!o&&i.optimisticData?i.optimisticData:o:o}export{D as applyOptimisticToDoc,n as mergeWithOptimistic};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getEntityByCollection as
|
|
1
|
+
import{getEntityByCollection as t}from"@donotdev/core";const c=new Set;function n(e,o){return t(e)}export{n as resolveReferenceEntity};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the current URL is the page of document `id` of `collection`: the route the URL
|
|
3
|
+
* matches (`matchRoute`: exact path first, else the most specific `:param` route, as
|
|
4
|
+
* AutoMetaTags resolves it) declares that entity (`meta.entity === collection`) and one
|
|
5
|
+
* of its params holds `id`. Browser only (reads `window.location`).
|
|
6
|
+
*
|
|
7
|
+
* @param collection - Collection of the document read
|
|
8
|
+
* @param id - Document id read
|
|
9
|
+
* @returns true when the URL names this record on a route declaring its entity
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // Route `/produits/:id` with PageMeta `entity: productEntity`, URL /en/produits/abc
|
|
13
|
+
* isRouteRecord('products', 'abc'); // true
|
|
14
|
+
* isRouteRecord('brands', 'xyz'); // false: a secondary read on the page
|
|
15
|
+
*
|
|
16
|
+
* @version 0.2.0
|
|
17
|
+
* @since 0.3.2
|
|
18
|
+
* @author AMBROISE PARK Consulting
|
|
19
|
+
*/
|
|
20
|
+
export declare function isRouteRecord(collection: string, id: string): boolean;
|
|
21
|
+
//# sourceMappingURL=routeRecord.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routeRecord.d.ts","sourceRoot":"","sources":["../../src/utils/routeRecord.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAWrE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getDndevConfig as r,getLanguageRouting as s,matchRoute as i,splitLanguagePath as u}from"@donotdev/core";function c(e,n){const a=r()?.routes?.mapping;if(!Array.isArray(a))return!1;const o=u(window.location.pathname,s()).path,t=i(a,o);return!t||t.route.meta?.entity!==e?!1:Object.values(t.params).includes(n)}export{c as isRouteRecord};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sanitizeHtml as a}from"@donotdev/components";const e=["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"],
|
|
1
|
+
import{sanitizeHtml as a}from"@donotdev/components";const e=["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"],r=["href","target","rel","src","alt","width","height","class","colspan","rowspan"];function s(t){return a(t,{allowedTags:e,allowedAttributes:r})}export{s as sanitizeHtml};
|
package/dist/utils/scopeUtils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getScopeValue as
|
|
1
|
+
import{getScopeValue as t,CRUD_OPERATORS as c}from"@donotdev/core";function s(r,e){if(!e)return r;const o=t(e.provider);if(!o)throw new Error(`[CRUD] Scope provider "${e.provider}" returned null. Cannot write scoped entity without a scope value. Ensure a scope is selected before creating scoped entities.`);return{...r,[e.field]:o}}function p(r,e){const o=r??{};if(!e||typeof e.field!="string")return o;const n=t(e.provider);if(!n)throw new Error(`[CRUD] Scope provider "${e.provider}" returned null. Cannot query scoped entity without a scope value. Ensure a scope is selected before querying scoped entities.`);const i={field:e.field,operator:c.EQ,value:n};return{...o,where:o.where?[...o.where,i]:[i]}}function u(r){return r?t(r.provider):null}export{u as getCurrentScopeValue,s as injectScope,p as injectScopeFilter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";function
|
|
1
|
+
"use client";function u(t){return!t||typeof t!="string"?!1:t.startsWith("https://")&&!t.startsWith("blob:")}function h(t){return!(!t||typeof t!="object"||!u(t.fullUrl)||t.thumbUrl&&!u(t.thumbUrl))}function i(t,e=""){const s=[];if(t==null)return s;if(typeof t=="string")return t.startsWith("blob:")&&s.push(e||"root"),s;if(typeof t!="object")return s;if(Array.isArray(t))t.forEach((r,o)=>{const n=e?`${e}[${o}]`:`[${o}]`;s.push(...i(r,n))});else{const r=t;if(r.fullUrl!==void 0&&r.thumbUrl!==void 0){const o=r.fullUrl,n=r.thumbUrl,l=typeof o=="string"&&!u(o),c=n&&typeof n=="string"&&!u(n);if(l||c){const f=e||"root";s.push(`${f}.fullUrl or ${f}.thumbUrl contains blob URL`)}}else Object.entries(r).forEach(([o,n])=>{const l=e?`${e}.${o}`:o;s.push(...i(n,l))})}return s}function b(t){return i(t).length>0}export{i as checkForBlobUrls,b as hasBlobUrls,u as isStorageUrl,h as validatePicture};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
import{useCallback as u,useMemo as f}from"react";import{getTranslatedFieldNames as m,translateRow as c,useTranslation as g}from"@donotdev/core";const p=a=>a;function d(a,o){const{language:n}=g(),r=o.translate??!0,e=(typeof a=="string"?o.entity:a)?.fields??null,t=f(()=>e?m(e):[],[e]),l=r&&t.length>0,i=u(s=>s&&typeof s=="object"?c(s,t,n):s,[t,n]);return l?i:p}export{d as useRowTranslator};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a="dndev-workflow-";function r(t,o){try{const e=`${a}${t}`;localStorage.setItem(e,JSON.stringify(o))}catch{}}function c(t){try{const o=`${a}${t}`,e=localStorage.getItem(o);return e?JSON.parse(e):null}catch{return null}}function n(t){try{const o=`${a}${t}`;localStorage.removeItem(o)}catch{}}export{n as clearWorkflowState,c as loadWorkflowState,r as saveWorkflowState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n
|
|
1
|
+
function e(n){return n}export{e as defineWorkflow};
|
package/dist/workflows/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineWorkflow as
|
|
1
|
+
import{defineWorkflow as o}from"./defineWorkflow";import{useEntityWorkflow as a}from"./useEntityWorkflow";import{saveWorkflowState as t,loadWorkflowState as r,clearWorkflowState as e}from"./WorkflowPersistence";export{e as clearWorkflowState,o as defineWorkflow,r as loadWorkflowState,t as saveWorkflowState,a as useEntityWorkflow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useState as
|
|
1
|
+
"use client";import{useState as g,useCallback as p,useMemo as h,useEffect as L,useRef as M}from"react";import{evaluateCondition as R}from"@donotdev/core";import{saveWorkflowState as K,loadWorkflowState as j,clearWorkflowState as C}from"./WorkflowPersistence";function V(e,O={}){const{onComplete:m,onStepChange:f,defaultValues:y}=O,w=M(m);w.current=m;const[a,v]=g(()=>{if(e.persist){const t=j(e.persistKey??e.id);if(t)return t.stepData}if(y){const t={};for(const r of e.steps)if(r.entity&&r.fields){const o={};for(const i of r.fields)i in y&&(o[i]=y[i]);Object.keys(o).length>0&&(t[r.id]=o)}return t}return{}}),[s,S]=g(()=>{if(e.persist){const t=j(e.persistKey??e.id);if(t)return t.currentStepIndex}return 0}),[k,x]=g(!1),l=h(()=>{const t={};for(const[r,o]of Object.entries(a))for(const[i,c]of Object.entries(o))t[i]=c,t[`${r}.${i}`]=c;return t},[a]),n=h(()=>e.steps.filter(t=>t.conditions?.visible?R(t.conditions.visible,l):!0),[e.steps,l]),W=n[s]??n[0],b=s===0,d=s===n.length-1;L(()=>{e.persist&&K(e.persistKey??e.id,{currentStepIndex:s,stepData:a,savedAt:Date.now()})},[e.persist,e.persistKey,e.id,s,a]);const I=p(async t=>{const r=n[s];if(!r)return!1;if(t&&v(i=>({...i,[r.id]:{...i[r.id],...t}})),r.validation?.validate){const i={...l,...t??{}};if(r.validation.validate(i)!==!0)return!1}if(r.after){const i={};await r.after({data:t??a[r.id]??{},allData:{...l,...t??{}},next:{prefill:c=>{const u=n[s+1];u&&(i[u.id]=c)}}}),Object.keys(i).length>0&&v(c=>{const u={...c};for(const[D,G]of Object.entries(i))u[D]={...u[D],...G};return u})}if(d){x(!0);try{const i={...l,...t??{}},c=w.current??e.onComplete;return c&&await c(i),e.persist&&C(e.persistKey??e.id),!0}catch{return!1}finally{x(!1)}}const o=s+1;return S(o),f?.(s,o),!0},[n,s,l,a,d,e,f]),N=p(()=>{if(b)return;const t=s-1;S(t),f?.(s,t)},[s,b,f]),A=p(()=>{if(!n[s]?.allowSkip||d)return;const t=s+1;S(t),f?.(s,t)},[n,s,d,f]),E=p(t=>{t>=0&&t<n.length&&(f?.(s,t),S(t))},[n.length,s,f]),P=p(()=>{e.persist&&K(e.persistKey??e.id,{currentStepIndex:s,stepData:a,savedAt:Date.now()})},[e,s,a]),$=p(()=>{C(e.persistKey??e.id)},[e]),F=p((t,r)=>{v(o=>({...o,[t]:{...o[t],...r}}))},[]);return{currentStep:W,currentStepIndex:s,visibleSteps:n,stepData:a,allData:l,goNext:I,goPrevious:N,skipStep:A,goToStep:E,isFirst:b,isLast:d,isSubmitting:k,canGoNext:!k,persistNow:P,clearPersisted:$,prefillStep:F}}export{V as useEntityWorkflow};
|
package/guidelines/COMPONENTS.md
CHANGED
|
@@ -107,7 +107,7 @@ Card grid for entity collection.
|
|
|
107
107
|
<EntityCardList entity={productEntity} renderCardOverlay={(item) => item.featured ? <Badge>…</Badge> : null} />
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
Cards are `CrudCard`s laid out by the entity's `listCardFields` (title / subtitle / content / footer slots); there is no `renderCard` prop. A fully custom card: `useCrudCardList` (+ `EntityFilters`) and your own grid.
|
|
110
|
+
Cards are `CrudCard`s laid out by the entity's `listCardFields` (title / subtitle / content / footer slots); there is no `renderCard` prop. Opt-in feed: `pageSize={12}` renders the first 12 cards (server HTML included), then 12 more each time the end of the grid nears the viewport, until every card is shown. Without `pageSize`, every card renders at once. Data is still fetched in one go, so this only trims rendering and hydration, and cards past the first page are not in the server HTML. A fully custom card: `useCrudCardList` (+ `EntityFilters`) and your own grid.
|
|
111
111
|
|
|
112
112
|
### SortableCardList
|
|
113
113
|
Cards in a grid the user re-orders before saving (routine steps, ranked selections). Drag the whole card (mouse; touch after a 200 ms hold); the card's own buttons and links stay clicks. With `handleOnly` (cards that are links or buttons), only the grip drags. Keyboard: Space/Enter on the grip, arrows, Space/Enter (Escape cancels). Each card's bar: grip, move-before / move-after, and a remove (X) button at the end with `onRemove`. Screen readers get translated instructions and pick-up / move / drop announcements. Stateless: the caller owns `items` (unique ids) and saves the order received in `onReorder`. Labels come from the `crud` namespace (`sortable.*`); `itemLabel` names each item for them.
|
package/guidelines/CRUD.md
CHANGED
|
@@ -87,7 +87,7 @@ fields: {
|
|
|
87
87
|
|
|
88
88
|
### SEO (`seo`, since 0.2.3)
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
The Next entity page metadata (generated for a public single-param page declaring `entity: productEntity` in its PageMeta, see ui `SEO.md`) and llms.txt title/describe a record with the card's text (`listCardFields`, formatted like the card: same `formatFieldText` from `@donotdev/core`). Override per entity:
|
|
91
91
|
|
|
92
92
|
```typescript
|
|
93
93
|
seo: {
|
|
@@ -401,6 +401,8 @@ const { get } = useCrud(productEntity);
|
|
|
401
401
|
useEffect(() => { get(id).then(setProduct); }, [id, get]);
|
|
402
402
|
```
|
|
403
403
|
|
|
404
|
+
**Missing record on Vite.** While `notFound` is true for the record the URL names, `useCrudDoc` adds `<meta name="robots" content="noindex">` to the document head (removed when the record shows up or the component unmounts): a client-rendered app answers every URL with HTTP 200, so crawlers must not index the not-found state. The record the URL names: the current route (route manifest, language prefix stripped, matched by `matchRoute` from `@donotdev/core`, the AutoMetaTags matcher: a static route of the same path wins) declares the entity in its PageMeta (`entity: productEntity` → `meta.entity`, the collection read) and one of its `:param` values is the `id` read (`/produits/:id`, `useCrudDoc(productEntity, id)`). A secondary read on the page (a missing brand on a valid product page, any read on a route without `entity`) never adds it. Next adds nothing: its entity pages answer a missing record with a real 404 (`notFound()`, see ui `SEO.md`).
|
|
405
|
+
|
|
404
406
|
**Next: who the server read is for.** The generated per-request layout (visitors with an auth cookie) passes the request's cookies to
|
|
405
407
|
`NextJsAppProviders` (CLI template), so server reads run as the visitor (their access token) and
|
|
406
408
|
the first paint is final. Nothing to do in pages.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@donotdev/crud",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"@dnd-kit/core": "^6.3.1",
|
|
57
57
|
"@dnd-kit/sortable": "^10.0.0",
|
|
58
58
|
"@dnd-kit/utilities": "^3.2.2",
|
|
59
|
-
"@donotdev/components": "^0.3.
|
|
60
|
-
"@donotdev/core": "^0.3.
|
|
59
|
+
"@donotdev/components": "^0.3.3",
|
|
60
|
+
"@donotdev/core": "^0.3.2",
|
|
61
61
|
"react-easy-crop": "^5.5.7"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|