@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.
Files changed (206) hide show
  1. package/dist/CrudService.bulk.js +1 -1
  2. package/dist/CrudService.bulkAcross.js +1 -1
  3. package/dist/CrudService.bulkReconciliation.js +1 -1
  4. package/dist/CrudService.cache.d.ts +8 -0
  5. package/dist/CrudService.cache.d.ts.map +1 -1
  6. package/dist/CrudService.cache.js +1 -1
  7. package/dist/CrudService.d.ts +7 -2
  8. package/dist/CrudService.d.ts.map +1 -1
  9. package/dist/CrudService.internal.js +2 -2
  10. package/dist/CrudService.js +1 -1
  11. package/dist/CrudService.mutations.js +1 -1
  12. package/dist/CrudService.optimistic.js +1 -1
  13. package/dist/CrudService.queries.js +1 -1
  14. package/dist/CrudService.subscriptions.js +1 -1
  15. package/dist/CrudService.writeRules.js +1 -1
  16. package/dist/CrudStore.js +1 -1
  17. package/dist/FieldRegistry.js +1 -1
  18. package/dist/adapters/FunctionsAdapter.js +1 -1
  19. package/dist/components/CrudButton.js +1 -1
  20. package/dist/components/CrudCard.js +1 -1
  21. package/dist/components/DateFilter.d.ts.map +1 -1
  22. package/dist/components/DateFilter.js +1 -1
  23. package/dist/components/DisplayFieldRenderer.js +1 -1
  24. package/dist/components/DisplayThumbnail.js +1 -1
  25. package/dist/components/EntityFilters.js +1 -1
  26. package/dist/components/FormFieldRenderer.js +1 -1
  27. package/dist/components/FormLayout.js +1 -1
  28. package/dist/components/SortableCardList.js +1 -1
  29. package/dist/components/YearFilter.js +1 -1
  30. package/dist/components/controlled/complex/ControlledAddressField.js +1 -1
  31. package/dist/components/controlled/complex/ControlledDateField.js +1 -1
  32. package/dist/components/controlled/complex/ControlledFieldArrayField.js +1 -1
  33. package/dist/components/controlled/complex/ControlledGeoPointField.js +1 -1
  34. package/dist/components/controlled/complex/ControlledMapField.js +1 -1
  35. package/dist/components/controlled/complex/ControlledMultiInputField.js +1 -1
  36. package/dist/components/controlled/complex/ControlledRichTextField.js +1 -1
  37. package/dist/components/controlled/complex/ControlledTimestampField.js +1 -1
  38. package/dist/components/controlled/complex/index.js +1 -1
  39. package/dist/components/controlled/fieldOptions.js +1 -1
  40. package/dist/components/controlled/file/ControlledDocumentField.js +1 -1
  41. package/dist/components/controlled/file/ControlledFileField.js +1 -1
  42. package/dist/components/controlled/file/ControlledImageField.js +1 -1
  43. package/dist/components/controlled/file/ControlledMultiDocumentField.js +1 -1
  44. package/dist/components/controlled/file/ControlledMultiFileField.js +1 -1
  45. package/dist/components/controlled/file/ControlledMultiImageField.js +1 -1
  46. package/dist/components/controlled/file/index.js +1 -1
  47. package/dist/components/controlled/index.js +1 -1
  48. package/dist/components/controlled/input/ControlledCheckboxField.js +1 -1
  49. package/dist/components/controlled/input/ControlledCurrencyField.js +1 -1
  50. package/dist/components/controlled/input/ControlledDurationField.js +1 -1
  51. package/dist/components/controlled/input/ControlledGdprConsentField.js +1 -1
  52. package/dist/components/controlled/input/ControlledNumberField.js +1 -1
  53. package/dist/components/controlled/input/ControlledPasswordField.js +1 -1
  54. package/dist/components/controlled/input/ControlledPhoneField.js +1 -1
  55. package/dist/components/controlled/input/ControlledPriceField.js +1 -1
  56. package/dist/components/controlled/input/ControlledRangeField.js +1 -1
  57. package/dist/components/controlled/input/ControlledRatingField.js +1 -1
  58. package/dist/components/controlled/input/ControlledSwitchField.js +1 -1
  59. package/dist/components/controlled/input/ControlledTextField.js +1 -1
  60. package/dist/components/controlled/input/ControlledTextareaField.js +1 -1
  61. package/dist/components/controlled/input/index.js +1 -1
  62. package/dist/components/controlled/select/ControlledComboboxField.js +1 -1
  63. package/dist/components/controlled/select/ControlledDropdownField.js +1 -1
  64. package/dist/components/controlled/select/ControlledMultiDropdownField.js +1 -1
  65. package/dist/components/controlled/select/ControlledRadioField.js +1 -1
  66. package/dist/components/controlled/select/ControlledReferenceField.js +1 -1
  67. package/dist/components/controlled/select/ControlledYearField.js +1 -1
  68. package/dist/components/controlled/select/index.js +1 -1
  69. package/dist/components/controlled/types.js +1 -1
  70. package/dist/components/fields/display/AvatarFieldDisplay.js +1 -1
  71. package/dist/components/fields/display/BadgeFieldDisplay.js +1 -1
  72. package/dist/components/fields/display/ButtonFieldDisplay.js +1 -1
  73. package/dist/components/fields/display/CheckboxFieldDisplay.js +1 -1
  74. package/dist/components/fields/display/DateFieldDisplay.js +1 -1
  75. package/dist/components/fields/display/DropdownDisplay.js +1 -1
  76. package/dist/components/fields/display/FileFieldDisplay.js +1 -1
  77. package/dist/components/fields/display/GeoPointFieldDisplay.js +1 -1
  78. package/dist/components/fields/display/HiddenFieldDisplay.js +1 -1
  79. package/dist/components/fields/display/ImageFieldDisplay.js +1 -1
  80. package/dist/components/fields/display/LinkFieldDisplay.js +1 -1
  81. package/dist/components/fields/display/MapFieldDisplay.js +1 -1
  82. package/dist/components/fields/display/MultiDropdownDisplay.js +1 -1
  83. package/dist/components/fields/display/MultiInputTextFieldDisplay.js +1 -1
  84. package/dist/components/fields/display/NumberFieldDisplay.js +1 -1
  85. package/dist/components/fields/display/PasswordFieldDisplay.js +1 -1
  86. package/dist/components/fields/display/PhoneNumberDisplay.js +1 -1
  87. package/dist/components/fields/display/RadioFieldDisplay.js +1 -1
  88. package/dist/components/fields/display/RangeFieldDisplay.js +1 -1
  89. package/dist/components/fields/display/ReferenceFieldDisplay.js +1 -1
  90. package/dist/components/fields/display/RichTextDisplay.js +2 -2
  91. package/dist/components/fields/display/TextAreaDisplay.js +1 -1
  92. package/dist/components/fields/display/TextFieldDisplay.js +1 -1
  93. package/dist/components/fields/display/TimestampFieldDisplay.js +1 -1
  94. package/dist/components/fields/display/index.js +1 -1
  95. package/dist/components/form/fields/AddressFieldComponent.js +1 -1
  96. package/dist/components/form/fields/AvatarFieldComponent.js +1 -1
  97. package/dist/components/form/fields/BadgeFieldComponent.js +1 -1
  98. package/dist/components/form/fields/ButtonFieldComponent.js +1 -1
  99. package/dist/components/form/fields/CheckboxFieldComponent.js +1 -1
  100. package/dist/components/form/fields/ComboboxComponent.js +1 -1
  101. package/dist/components/form/fields/CurrencyFieldComponent.js +1 -1
  102. package/dist/components/form/fields/DateFieldComponent.js +1 -1
  103. package/dist/components/form/fields/DocumentFieldComponent.js +1 -1
  104. package/dist/components/form/fields/DropdownComponent.js +1 -1
  105. package/dist/components/form/fields/DurationFieldComponent.js +1 -1
  106. package/dist/components/form/fields/FileFieldComponent.js +1 -1
  107. package/dist/components/form/fields/GdprConsentFieldComponent.js +1 -1
  108. package/dist/components/form/fields/GeoPointFieldComponent.js +1 -1
  109. package/dist/components/form/fields/HiddenFieldComponent.js +1 -1
  110. package/dist/components/form/fields/ImageFieldComponent.js +1 -1
  111. package/dist/components/form/fields/MapFieldComponent.js +1 -1
  112. package/dist/components/form/fields/MultiDropdownComponent.js +1 -1
  113. package/dist/components/form/fields/MultiInputTextFieldComponent.js +1 -1
  114. package/dist/components/form/fields/NumberFieldComponent.js +1 -1
  115. package/dist/components/form/fields/PasswordFieldComponent.js +1 -1
  116. package/dist/components/form/fields/PhoneNumberComponent.js +1 -1
  117. package/dist/components/form/fields/PriceFieldComponent.js +1 -1
  118. package/dist/components/form/fields/RadioFieldComponent.js +1 -1
  119. package/dist/components/form/fields/RangeFieldComponent.js +1 -1
  120. package/dist/components/form/fields/RatingFieldComponent.js +1 -1
  121. package/dist/components/form/fields/ReferenceFieldComponent.js +1 -1
  122. package/dist/components/form/fields/RichTextComponent.js +1 -1
  123. package/dist/components/form/fields/SwitchFieldComponent.js +1 -1
  124. package/dist/components/form/fields/TextAreaComponent.js +1 -1
  125. package/dist/components/form/fields/TextFieldComponent.js +1 -1
  126. package/dist/components/form/fields/TimestampFieldComponent.js +1 -1
  127. package/dist/components/form/fields/index.js +1 -1
  128. package/dist/components/form/fields/internal/InlineFieldRow.js +1 -1
  129. package/dist/components/form/fields/internal/TiptapEditor.js +2 -2
  130. package/dist/components/form/internal/ImageViewerDialog.js +1 -1
  131. package/dist/components/index.js +1 -1
  132. package/dist/contexts/UploadContext.js +1 -1
  133. package/dist/contexts/index.js +1 -1
  134. package/dist/fieldTypeRegistry.js +1 -1
  135. package/dist/fieldTypeRegistry.store.js +1 -1
  136. package/dist/forms/FormNavigation.js +1 -1
  137. package/dist/forms/childRows.js +1 -1
  138. package/dist/forms/extend.js +1 -1
  139. package/dist/forms/hooks/index.js +1 -1
  140. package/dist/forms/hooks/useController.js +1 -1
  141. package/dist/forms/hooks/useEntityField.js +1 -1
  142. package/dist/forms/hooks/useEntityForm.js +1 -1
  143. package/dist/forms/hooks/useFormDraftState.js +1 -1
  144. package/dist/forms/index.js +1 -1
  145. package/dist/forms/utils/buildInitialValues.js +1 -1
  146. package/dist/forms/utils/conditionAwareResolver.js +1 -1
  147. package/dist/forms/utils/emptyValue.js +1 -1
  148. package/dist/forms/utils/getFieldsForOperation.js +1 -1
  149. package/dist/forms/utils/index.js +1 -1
  150. package/dist/forms/utils/isFieldEditable.js +1 -1
  151. package/dist/forms/utils/translateFieldLabel.js +1 -1
  152. package/dist/forms/utils/validateEntity.js +1 -1
  153. package/dist/forms/utils/writableFields.js +1 -1
  154. package/dist/hooks/index.js +1 -1
  155. package/dist/hooks/useChildRows.js +1 -1
  156. package/dist/hooks/useCrudFilters.js +1 -1
  157. package/dist/hooks/useCrudPageSize.js +1 -1
  158. package/dist/hooks/useEntityFavorites.js +1 -1
  159. package/dist/hooks/useExtensionRows.js +1 -1
  160. package/dist/hooks/useFieldConditions.js +1 -1
  161. package/dist/hooks/useFileUpload.js +1 -1
  162. package/dist/hooks/useReferenceResolver.js +1 -1
  163. package/dist/hooks/useRelatedItems.js +1 -1
  164. package/dist/index.js +1 -1
  165. package/dist/registerBuiltinFieldTypes.js +1 -1
  166. package/dist/stores/FormStore.js +1 -1
  167. package/dist/stores/UploadStore.js +1 -1
  168. package/dist/stores/index.js +1 -1
  169. package/dist/stores/uploadStoreRef.js +1 -1
  170. package/dist/symbol-index.json +1 -1
  171. package/dist/tsconfig.tsbuildinfo +1 -1
  172. package/dist/types.d.ts +4 -2
  173. package/dist/types.d.ts.map +1 -1
  174. package/dist/types.js +1 -1
  175. package/dist/useBaseCrudList.js +1 -1
  176. package/dist/useCrud.js +1 -1
  177. package/dist/useCrudCardList.js +1 -1
  178. package/dist/useCrudDoc.d.ts +8 -1
  179. package/dist/useCrudDoc.d.ts.map +1 -1
  180. package/dist/useCrudDoc.js +1 -1
  181. package/dist/useCrudList.js +1 -1
  182. package/dist/useServerPrefetch.js +1 -1
  183. package/dist/utils/clientListProcessing.js +1 -1
  184. package/dist/utils/collections.js +1 -1
  185. package/dist/utils/fileStorage.js +1 -1
  186. package/dist/utils/filterUrl.js +1 -1
  187. package/dist/utils/imageProcessing.js +1 -1
  188. package/dist/utils/imageStorage.js +1 -1
  189. package/dist/utils/imageUtils.js +1 -1
  190. package/dist/utils/matchesFilter.js +1 -1
  191. package/dist/utils/mergeWithOptimistic.js +1 -1
  192. package/dist/utils/referenceEntity.js +1 -1
  193. package/dist/utils/routeRecord.d.ts +21 -0
  194. package/dist/utils/routeRecord.d.ts.map +1 -0
  195. package/dist/utils/routeRecord.js +1 -0
  196. package/dist/utils/sanitizeHtml.js +1 -1
  197. package/dist/utils/scopeUtils.js +1 -1
  198. package/dist/utils/uploadValidation.js +1 -1
  199. package/dist/utils/useRowTranslator.js +1 -1
  200. package/dist/workflows/WorkflowPersistence.js +1 -1
  201. package/dist/workflows/defineWorkflow.js +1 -1
  202. package/dist/workflows/index.js +1 -1
  203. package/dist/workflows/useEntityWorkflow.js +1 -1
  204. package/guidelines/COMPONENTS.md +1 -1
  205. package/guidelines/CRUD.md +3 -1
  206. 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): the document cache and every cached list holding it
258
- * take the row as stored, without a refetch.
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
  */
@@ -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,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC;AAEX,uFAAuF;AACvF,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,yCAAyC;AACzC,eAAO,MAAM,cAAc;;;IAGzB,0EAA0E;;;CAGlE,CAAC;AAEX,mFAAmF;AACnF,MAAM,MAAM,aAAa,GACvB,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,iEAAiE;IACjE,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAC9B,MAAM,EACN,MAAM,GAAG,MAAM,EAAE,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC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.js CHANGED
@@ -1 +1 @@
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};
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};
@@ -1 +1 @@
1
- import{useMemo as j,useCallback as ee,useRef as K,useState as te,useEffect as se}from"react";import{isClient as re,useQuery as oe}from"@donotdev/core";import{useCrudStore as ce}from"./CrudStore";import{CRUD_OPERATION as N}from"./types";import{useCrud as U,getCrudServiceInstance as ie,EMPTY_OPTIMISTIC as ne}from"./useCrud";import{useServerPrefetch as ae}from"./useServerPrefetch";import{mergeWithOptimistic as le}from"./utils/mergeWithOptimistic";import{injectScopeFilter as ue,getCurrentScopeValue as de}from"./utils/scopeUtils";import{useRowTranslator as me}from"./utils/useRowTranslator";const fe=1e3;function Ce(E,S,s,f={}){const b=f.enabled??!0,C=U("status"),a=C==="ready",k=U(E,f),{error:L,invalidate:M,_collection:d,_schemas:F,_cacheOptions:v,_scope:y}=k,q=ce(e=>e.collections[d]?.optimistic||ne),P=K(new Map([[1,null]])),O=K(0),[w,B]=te(!1),i=s?.mode==="auto"?w?"server":"client":s?.mode??"client",W=de(y),h=j(()=>{if(!a||!F)return null;const e=ie();if(!e)return null;const p=F.get,n=ue(f.queryOptions,y);if(!s)return e.getListQueryOptions(d,n,p,v,S);if(i==="client"){const c=s.mode==="auto"&&!n?.limit?{...n,limit:fe}:n;return e.getListQueryOptions(d,c,p,v,S)}const l=P.current,u=O.current,{page:m,pageSize:g}=s;let t,o;if(l.has(m))t=l.get(m)??void 0,o=g;else if(m>u&&l.has(u)){const c=m-u;t=l.get(u)??void 0,o=c*g}else t=void 0,o=m*g;return e.getListQueryOptions(d,{...n,limit:o,startAfter:t},p,v,S)},[a,d,v,F?"hasSchema":"noSchema",S,i,s?.page,s?.pageSize,f.queryOptions,y?.provider,W]),{data:r,isLoading:Y,isFetching:G,error:H,refetch:D}=oe({queryKey:h?.queryKey??["crud",d,"disabled"],queryFn:h?.queryFn??(()=>Promise.resolve({items:[]})),staleTime:h?.staleTime,enabled:b&&!!h});ae(h,b,y);const A=!re();se(()=>{s?.mode==="auto"&&!w&&r&&r.total!=null&&r.total>r.items.length&&B(!0)},[r,s?.mode,w]);const _=me(E,f),R=j(()=>{if(!r||!a)return{items:[],total:void 0};let e=r.items;if(i==="server"&&s&&e.length>0){const t=P.current,o=O.current,{page:c,pageSize:I}=s,X=e.length;if(Math.ceil(X/I)>1||c>o){const z=t.has(c)?c:o+1;for(let T=z;T<=c;T++){const V=(T-z+1)*I-1;if(V<e.length){const $=e[V];t.set(T+1,$.id)}}}r.lastVisible&&t.set(c+1,r.lastVisible),O.current=Math.max(o,c);const Q=t.has(c)?0:(c-o-1)*I,Z=Q+I;e=e.slice(Q,Z)}const p=le(e,q),n=new Set(e.map(t=>t.id));let l=0,u=0;for(const[t,o]of Object.entries(q))o.operation===N.ADD&&!n.has(t)?l++:o.operation===N.DELETE&&n.has(t)&&u++;const g=(r.total??e.length)+l-u;return{items:p.map(_),total:g}},[r,q,_,a,i,s?.page,s?.pageSize]),x=ee(async()=>{a&&(i==="server"&&(P.current=new Map([[1,null]]),O.current=0),await M(),await D())},[M,D,a,i]);if(!a){const e=async()=>{};return{status:C,data:{items:[],total:void 0},items:[],loading:!0,fetching:!1,error:L,mutate:e,refresh:e,isAvailable:!1,effectiveMode:i}}const J=R?.items??[];return{status:C,data:R,items:J,loading:A?b&&r===void 0:Y,fetching:A?!1:G,error:A?null:H??L,mutate:x,refresh:x,isAvailable:!0,effectiveMode:i}}export{Ce as useBaseCrudList};
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 Q,useMemo as F,useCallback as i}from"react";import{useFeatureConsent as V,AtomicBulkError as Z,FRAMEWORK_FEATURES as $,FEATURE_STATUS as v,handleError as H,isClient as J,createSchemas as X,DEGRADED_CRUD_API as O,getGlobalSingleton as K}from"@donotdev/core";import{getCrudService as N}from"./CrudService";import{useCrudStore as f}from"./CrudStore";import{injectScope as C,injectScopeFilter as ee}from"./utils/scopeUtils";const ie={},oe={};function U(){return K("crud-service",()=>({service:null,initPromise:null,errorNotified:!1}))}function o(){return A()}function A(){const u=U(),a=u.service??N();return a.attachProvider()?(u.service||(a.setStore(f),u.service=a),a):null}function ae(u,a={}){const S=V($.CRUD),x=f(e=>e.crudService),_=S&&!x&&!A(),g=S?_?v.INITIALIZING:v.READY:v.DEGRADED,h=u==="status",p=!h&&typeof u=="object"?u:a.entity,r=h?"__status__":typeof u=="string"?u:u.collection,d=p?.scope,D=a.noCache??!1,E=a.staleTime,m=F(()=>({noCache:D,staleTime:E}),[D,E]),c=F(()=>{if(!h){if(a.schema){const e=a.schema;return{create:e,draft:e,update:e,get:e,list:e,listCard:e,delete:e}}if(p)return X(p)}},[h,a.schema,p?.name,r]),M=f(e=>e.collections[r]?.loading||!1),y=f(e=>e.collections[r]?.error||null);Q(()=>{if(!J()||!S||!c)return;const{crudService:e}=f.getState(),s=A();if(s){e||f.getState().setCrudService(s);return}const t=U();e||t.service||t.initPromise||(t.initPromise=(async()=>{try{if(t.service||f.getState().crudService)return;const n=N();t.service=n,n.setStore(f),await n.initialize(),t.errorNotified=!1,f.getState().setCrudService(n)}catch(n){t.errorNotified||(H(n,{userMessage:"Failed to initialize CRUD service.",context:{collection:r},severity:"error"}),t.errorNotified=!0)}finally{t.initPromise=null}})())},[S,r,c?"hasSchema":"noSchema"]);const I=_||M,Y=g===v.READY,G=i(async e=>{const s=o();return!s||!c?null:s.get(r,e,c.get,m)},[r,c?"hasSchema":"noSchema",m]),l=c,j=i(async(e,s,t)=>{const n=o();if(!n||!l)return;const b=C(s,d);return n.set(r,e,b,l.create,{...t,readSchema:l.get})},[r,c?"hasSchema":"noSchema",d?.provider]),q=i(async(e,s,t)=>{const n=o();if(!(!n||!l))return n.update(r,e,s,l.update,{...t,readSchema:l.get})},[r,c]),z=i(async e=>{const s=o();!s||!l||await s.remove(r,e)},[r,c]),L=i(async(e,s)=>{const t=o();t&&await t.delete(r,e,s)},[r]),W=i(async(e,s)=>{const t=o();if(!t||!l)return"";const n=C(e,d);return t.add(r,n,l.create,{...s,readSchema:l.get})},[r,c?"hasSchema":"noSchema",d?.provider]),T=i(async(e,s)=>{const t=o();if(!t){if(s?.execution==="atomic")throw new Z("CRUD service is unavailable","not-committed");return{results:{}}}return t.bulkAcross(e,s)},[]),R=i(async(e,s)=>{const t=o();if(!t||!c)return{insertedIds:[],updatedIds:[],deletedIds:[],failed:[]};const n={inserts:e.inserts?.map(b=>C(b,d)),updates:e.updates,deletes:e.deletes};return t.bulk(r,n,{create:c.create,draft:c.draft,update:c.update},s)},[r,c?"hasSchema":"noSchema",d?.provider]),B=i(async e=>{const s=o();if(!s||!c)return[];const t=ee(e,d);return(await s.query(r,t,c.get,m)).items},[r,c?"hasSchema":"noSchema",m,d?.provider]),k=i((e,s)=>{const t=o();return!t||!c?()=>{}:t.subscribe(r,e,s,c.get)},[r,c?"hasSchema":"noSchema"]),P=i((e,s)=>{const t=o();return!t||!c?()=>{}:t.subscribeToCollection(r,e,s,c.get)},[r,c?"hasSchema":"noSchema"]),w=i(async()=>{const e=o();e&&await e.invalidateCollection(r)},[r]);return h?g:Y?{status:v.READY,loading:I,error:y,get:G,set:j,update:q,remove:z,delete:L,add:W,bulk:R,bulkAcross:T,query:B,subscribe:k,subscribeToCollection:P,invalidate:w,isAvailable:!0,_collection:r,_schemas:c,_cacheOptions:m,_scope:d}:{...O,status:g,loading:I,error:y,subscribe:k,subscribeToCollection:P,invalidate:w,bulk:R,bulkAcross:T,_collection:r,_schemas:c,_cacheOptions:m,_scope:d}}export{ie as EMPTY_DATA,oe as EMPTY_OPTIMISTIC,o as getCrudServiceInstance,ae as useCrud};
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};
@@ -1 +1 @@
1
- import{useMemo as f}from"react";import{useCrudFilters as o}from"./hooks/useCrudFilters";import{useBaseCrudList as h}from"./useBaseCrudList";import{applyFilters as y,applySearch as g,applySort as p}from"./utils/clientListProcessing";function Q(s,t={}){const i={enabled:t.enabled,queryOptions:t.queryOptions,schema:t.schema,entity:t.entity,staleTime:t.staleTime,noCache:t.noCache},e=h(s,"listCard",null,i),a=typeof s=="string"?null:s,c=typeof s=="string"?s:s.collection,{filters:l}=o({collection:c}),u=t.clientSort===null?null:t.clientSort??a?.defaultSort??null,{processed:m,filteredTotal:n}=f(()=>{let r=e.items;a&&Object.keys(l).length>0&&(r=y(r,l,a)),a&&t.searchQuery&&(r=g(r,t.searchQuery,a));const d=r.length;return u&&(r=p(r,u)),{processed:r,filteredTotal:d}},[e.items,l,t.searchQuery,u,a]);return{status:e.status,data:e.data?{items:e.data.items}:null,items:e.items,processed:m,filteredTotal:n,loading:e.loading,fetching:e.fetching,error:e.error,mutate:e.mutate,refresh:e.refresh,isAvailable:e.isAvailable}}export{Q as useCrudCardList};
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};
@@ -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
- /** True once the read settled and no document exists for `id` */
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;
@@ -1 +1 @@
1
- {"version":3,"file":"useCrudDoc.d.ts","sourceRoot":"","sources":["../src/useCrudDoc.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAM/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD;;;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,iEAAiE;IACjE,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,w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O,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"}
@@ -1 +1 @@
1
- import{useCallback as _,useMemo as E}from"react";import{FEATURE_STATUS as q,isClient as Q,useQuery as R,useQueryClient as w}from"@donotdev/core";import{cachedListRow as L}from"./CrudService.cache";import{useCrudStore as O}from"./CrudStore";import{useCrud as v,getCrudServiceInstance as U}from"./useCrud";import{useServerPrefetch as K}from"./useServerPrefetch";import{applyOptimisticToDoc as N}from"./utils/mergeWithOptimistic";import{useRowTranslator as P}from"./utils/useRowTranslator";function B(u,t,a={}){const r=a.enabled??!0,n=v("status"),c=n===q.READY,{_collection:o,_schemas:d,_cacheOptions:D,_scope:T}=v(u,a),m=O(S=>t?S.collections[o]?.optimistic[t]:void 0),f=c?U():null,e=f&&d&&t?f.getDocQueryOptions(o,t,d.get,D):null,b=w(),i=e&&t?L(b,o,t):void 0,{data:s,isLoading:C,isFetching:F,error:I,refetch:p}=R({queryKey:e?.queryKey??["crud",o,"get",null],queryFn:e?.queryFn??(()=>Promise.resolve(null)),staleTime:e?.staleTime,...i&&{initialData:i.data,initialDataUpdatedAt:i.updatedAt},enabled:r&&!!e});K(e,r,T);const y=P(u,a),h=E(()=>y(N(s??null,m)),[y,s,m]),l=!Q(),g=!!e,A=_(async()=>{g&&await p()},[p,g]);return c?{status:n,data:h,loading:l?r&&!!e&&s===void 0:C,fetching:l?!1:F,notFound:s!==void 0&&h===null,error:l?null:I,refresh:A,isAvailable:!0}:{status:n,data:null,loading:n===q.INITIALIZING&&r&&!!t,fetching:!1,notFound:!1,error:null,refresh:A,isAvailable:!1}}export{B as useCrudDoc};
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};
@@ -1 +1 @@
1
- import{useMemo as h}from"react";import{useCrudFilters as y}from"./hooks/useCrudFilters";import{useBaseCrudList as S}from"./useBaseCrudList";import{applyFilters as b,applySearch as T,applySort as Q}from"./utils/clientListProcessing";function M(r,e={}){const u=e.pagination??"auto",n=e.page??1,i=e.pageSize??10,m={mode:u,page:n,pageSize:i},o={enabled:e.enabled,queryOptions:e.queryOptions,schema:e.schema,entity:e.entity,staleTime:e.staleTime,noCache:e.noCache},a=S(r,"list",m,o),s=typeof r=="string"?null:r,f=typeof r=="string"?r:r.collection,{filters:l}=y({collection:f}),c=e.clientSort===null?null:e.clientSort??s?.defaultSort??null,{processed:d,filteredTotal:p}=h(()=>{let t=a.items;s&&Object.keys(l).length>0&&(t=b(t,l,s)),s&&e.searchQuery&&(t=T(t,e.searchQuery,s));const g=t.length;return c&&(t=Q(t,c)),{processed:t,filteredTotal:g}},[a.items,l,e.searchQuery,c,s]);return{...a,processed:d,filteredTotal:p}}export{M as useCrudList};
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 o,isClient as i,useAuthSessionSnapshot as c,useQueryClient as a}from"@donotdev/core";import{getCrudServiceInstance as d}from"./useCrud";function p(n,r,u){const t=a(),e=c();if(i()||!r||!n||u)return;const s=t.getQueryState(n.queryKey);if(!(s&&(s.data!==void 0||s.error)||!(!o("auth")||e?.user===null||e?.user&&e.accessToken&&d()?.bindRequestAccessToken(t,e.accessToken))))throw t.fetchQuery(n).then(()=>{},()=>{})}export{p as useServerPrefetch};
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 c}from"./matchesFilter";import"../fieldTypeRegistry.store";function h(t,n,l){const o=Object.entries(n);return o.length===0?t:t.filter(r=>o.every(([s,f])=>{const e=l.fields[s],i=e?.type||"text";return c(r[s],f,i,e?.filter)}))}function a(t){if(t.search?.fields&&t.search.fields.length>0)return t.search.fields;const n=[],{fields:l}=u(t);for(const[o,r]of Object.entries(l))r.visibleAt==="hidden"||r.visibleAt==="technical"||r.value.kind==="text"&&n.push(o);return n}function g(t,n,l){if(!n||n.trim()==="")return t;const o=n.toLowerCase(),r=a(l);return r.length===0?t.filter(s=>Object.values(s).some(f=>f==null?!1:String(f).toLowerCase().includes(o))):t.filter(s=>r.some(f=>{const e=s[f];return e==null?!1:typeof e=="object"&&"formatted_address"in e?String(e.formatted_address).toLowerCase().includes(o):String(e).toLowerCase().includes(o)}))}function y(t,n){if(typeof n=="function")return[...t].sort(n);const{field:l,direction:o="asc"}=n,r=o==="desc"?-1:1;return[...t].sort((s,f)=>{const e=s[l],i=f[l];return e==null&&i==null?0:e==null?1:i==null?-1:typeof e=="number"&&typeof i=="number"?(e-i)*r:typeof e=="object"&&"amount"in e&&typeof i=="object"&&"amount"in i?(e.amount-i.amount)*r:e instanceof Date&&i instanceof Date?(e.getTime()-i.getTime())*r:String(e).localeCompare(String(i))*r})}export{h as applyFilters,g as applySearch,y as applySort,a as getSearchableFields};
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 o}from"../CrudService";async function u(s,t){const e=o(),r=[],a=t.range?.start??1,n=t.range?.end??28;for(let c=a;c<=n;c++){const i=String(c),d=await e.get(t.path(s),i,t.schema);d&&r.push(d)}return r}async function m(s,t,e){const r=o();for(const a of e){const n=t.idOf(a);await r.set(t.path(s),n,a,t.schema)}}async function h(s,t,e){const r=o();if(t.idFrom){const a=t.idFrom(e);await r.set(t.path(s),a,e,t.schema);return}return r.add(t.path(s),e,t.schema)}export{h as appendToCollection,u as loadDeterministicRange,m as upsertDeterministic};
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 p}from"@donotdev/core";function x(e){return e.replace(/[^a-zA-Z0-9.-]/g,"_").replace(/_{2,}/g,"_").toLowerCase()}async function g(e,t={}){const{storagePath:r,filename:n,onProgress:s,signal:o}=t,i=Date.now(),c=x(e.name),a=n||`${i}_${c}`,l=r?`${r}/${a}`:a;try{return{url:(await p("storage").upload(e,{storagePath:r,filename:a,onProgress:s?f=>s({bytesTransferred:0,totalBytes:0,progress:f}):void 0,signal:o})).url,filename:e.name,size:e.size,mimeType:e.type,uploadedAt:new Date().toISOString()}}catch(u){throw d(u,{userMessage:"Failed to upload file",severity:"error",context:{filename:e.name,fileSize:e.size}})}}async function F(e,t={}){const r=[],n=e.reduce((o,i)=>o+i.size,0);let s=0;for(const o of e){if(t.signal?.aborted)throw new Error("Upload cancelled");const i=t.onProgress?a=>{const l=a.bytesTransferred/a.totalBytes*o.size;t.onProgress({bytesTransferred:s+l,totalBytes:n,progress:(s+l)/n*100})}:void 0,c=await g(o,{...t,onProgress:i});r.push(c),s+=o.size}return r}async function M(e){try{await p("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 P(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function h(e){const t=e.split(".");return t.length>1?t.pop().toLowerCase():""}function S(e,t){const r=t?h(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 E(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 m=["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"],w=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".html",".csv"];function B(){return[...m,...w].join(",")}export{w as DOCUMENT_EXTENSIONS,m as DOCUMENT_MIME_TYPES,M as deleteFile,E as formatFileSize,P as generateFileId,B as getDocumentAcceptString,h as getFileExtension,S as getFileIcon,g as uploadFile,F as uploadFiles};
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};
@@ -1 +1 @@
1
- import{getFilterType as m}from"../fieldTypeRegistry.store";const d=new Set(["select","multiselect","reference"]),l="f_";function u(t,i){const e=t.fields[i];return e?m(e.type):void 0}function g(t,i){if(!t.startsWith(l))return!1;const e=t.slice(l.length);if(e in i.fields)return u(i,e)!=="range";const r=/^(.+)_(min|max)$/.exec(e);return!!r&&u(i,r[1])==="range"}function p(t,i,e){[...new Set(t.keys())].filter(r=>g(r,e)).forEach(r=>t.delete(r));for(const[r,n]of Object.entries(i)){if(!(r in e.fields))continue;const s=`${l}${r}`;typeof n=="string"?n!==""&&t.append(s,n):Array.isArray(n)?n.forEach(f=>t.append(s,f)):(n.min&&t.set(`${s}_min`,n.min),n.max&&t.set(`${s}_max`,n.max))}}function P(t,i){const e=new URLSearchParams(t),r={};for(const n of Object.keys(i.fields)){const s=`${l}${n}`,f=u(i,n);if(f==="range"){const o=e.get(`${s}_min`),a=e.get(`${s}_max`);(o||a)&&(r[n]={...o?{min:o}:{},...a?{max:a}:{}});continue}const c=e.getAll(s).filter(o=>o!=="");c.length!==0&&(r[n]=f!==void 0&&d.has(f)||c.length>1?c:c[0])}return r}function _(t,i){const e=new URLSearchParams;return p(e,t,i),e.sort(),e.toString()}export{l as FILTER_PARAM_PREFIX,_ as encodeFilterParams,P as readFilterParams,p as writeFilterParams};
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)),z=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 n=t.image;if(n!==void 0)return e.parse(z,n)}const W=new WeakMap;function B(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 C(t,n={}){const r=B(n),h=W.get(t);if(h?.has(r))return h.get(r);const{maxWidth:l=1920,maxHeight:a=1440,thumbWidth:i=300,thumbHeight:s=225,aspectRatio:d=4/3,quality:g=.85,thumbQuality:w=.65,background:c="#FFFFFF",crop:o}=n;return new Promise((b,f)=>{const u=new Image,F=new FileReader;F.onload=m=>{u.src=m.target?.result},F.onerror=()=>f(new Error("Failed to read file")),u.onload=async()=>{try{const m=o?o.width:u.width,v=o?o.height:u.height,H=d==="original",p=H?m/v:d,{width:M,height:I}=O(m,v,l,a,p),R=await P(u,M,I,p,g,c,o),V=H?O(m,v,i,s,p):{width:i,height:s},q=await P(u,V.width,V.height,p,w,c,o),k={fullBlob:R,thumbBlob:q,width:M,height:I};let x=W.get(t);x||(x=new Map,W.set(t,x)),x.set(r,k),b(k)}catch(m){f(m)}},u.onerror=()=>f(new Error("Failed to load image")),F.readAsDataURL(t)})}function O(t,n,r,h,l){let a=t,i=n;a>r&&(i=r/a*i,a=r),i>h&&(a=h/i*a,i=h);const s=a/i;return Math.abs(s-l)>.01&&(s>l?i=a/l:a=i*l),{width:Math.round(a),height:Math.round(i)}}async function P(t,n,r,h,l,a,i){const s=document.createElement("canvas"),d=s.getContext("2d");if(!d)throw new Error("Failed to get canvas context");s.width=n,s.height=r,a!=="transparent"&&(d.fillStyle=a,d.fillRect(0,0,n,r));let g,w,c,o;if(i)g=i.x,w=i.y,c=i.width,o=i.height;else{const b=t.width/t.height;c=t.width,o=t.height,g=0,w=0,b>h?(c=t.height*h,g=(t.width-c)/2):b<h&&(o=t.width/h,w=(t.height-o)/2)}return d.drawImage(t,g,w,c,o,0,0,n,r),new Promise((b,f)=>{s.toBlob(u=>{u?b(u):f(new Error("Failed to convert canvas to blob"))},"image/webp",l)})}function D(t,n){return t.type.startsWith("image/")?n&&t.size>n?{valid:!1,error:`File size exceeds ${(n/1048576).toFixed(1)}MB limit`}:{valid:!0}:{valid:!1,error:"File must be an image"}}export{z as imageProcessingOptionsSchema,C as processImage,Q as readImageProcessingOptions,D as validateImageFile};
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 i}from"@donotdev/core";function P(e){return e.replace(/[^a-zA-Z0-9.-]/g,"_").replace(/_{2,}/g,"_").toLowerCase()}async function E(e,t,a,g={}){const{storagePath:l,filename:p,onProgress:o,signal:n}=g,y=Date.now(),r=(p||`${y}_${P(a)}`).replace(/\.[^/.]+$/,""),h=`${r}_full.webp`,b=`${r}_thumb.webp`,$=l?`${l}/${h}`:h,U=l?`${l}/${b}`:b;try{const u=new File([e],`${r}_full.webp`,{type:"image/webp"}),s=new File([t],`${r}_thumb.webp`,{type:"image/webp"});let f,d;const c=i("storage"),w=await c.upload(u,{storagePath:l,filename:`${r}_full.webp`,onProgress:o?m=>o({bytesTransferred:0,totalBytes:0,progress:m*.5}):void 0,signal:n});if(f=w.url,n?.aborted){try{await c.delete(w.url)}catch{}throw new Error("Upload cancelled")}return d=(await c.upload(s,{storagePath:l,filename:`${r}_thumb.webp`,onProgress:o?m=>o({bytesTransferred:0,totalBytes:0,progress:50+m*.5}):void 0,signal:n})).url,{fullUrl:f,thumbUrl:d}}catch(u){try{const s=i("storage");await s.delete($).catch(()=>{}),await s.delete(U).catch(()=>{})}catch{}throw u}}async function R(e){try{const t=i("storage"),a=[t.delete(e.fullUrl)];e.thumbUrl&&a.push(t.delete(e.thumbUrl)),await Promise.all(a)}catch(t){throw _(t,{userMessage:"Failed to delete image",severity:"error",context:{fullUrl:e.fullUrl,thumbUrl:e.thumbUrl}}),t}}export{R as deleteImage,E as uploadImage};
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};
@@ -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).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
+ 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 w}from"../fieldTypeRegistry.store";const T=new Set(["select","multiselect","reference"]);function h(n,t,r){if(n==null)return!1;const m=(Array.isArray(n)?n:[n]).map(String);if(r!==void 0&&m.includes(r))return!0;const b=new Set(t.map(String));return m.some(u=>b.has(u))}function I(n,t,r,m){if(!t)return!0;const b=m?.wildcard;if(Array.isArray(t)){if(t.length===0)return!0;const i=w(r);if(!(i==="range"&&(r==="date"||r==="datetime-local"||r==="timestamp")))return i&&T.has(i)?h(n,t,b):t.some(e=>{if(typeof e=="object"&&"date"in e){const s=e.date;if(n==null)return!1;const f=n instanceof Date?n:new Date(n);return isNaN(f.getTime())?!1:f.toISOString().split("T")[0]===s}return String(n)===String(e)});if(n==null)return!1;const c=n instanceof Date?n:new Date(n);if(isNaN(c.getTime()))return!1;const g=c.toISOString().split("T")[0];return t.some(e=>typeof e=="string"?g===e:typeof e=="object"&&"date"in e?g===e.date:!1)}if(typeof t=="object"&&"date"in t&&!("min"in t)&&!Array.isArray(t)){if(!(w(r)==="range"&&(r==="date"||r==="datetime-local"||r==="timestamp")))return!1;const c=t.date;if(!c)return!0;if(n==null)return!1;const g=n instanceof Date?n.toISOString().split("T")[0]:new Date(n).toISOString().split("T")[0];if((r==="datetime-local"||r==="timestamp")&&t.time){const e=n instanceof Date?n.toISOString().slice(11,16):new Date(n).toISOString().slice(11,16);return g===c&&e===t.time}return g===c}if(typeof t=="object"&&"min"in t){const i=w(r);if(!i)return!0;const N=i==="range"&&(r==="date"||r==="datetime-local"||r==="timestamp"),c=i==="range"&&!N,g=r==="price",e=g&&n!=null&&typeof n=="object"?Number(n.amount):c&&n!=null?typeof n=="number"?n:Number(n):NaN;if(c||g){if(typeof t.min=="object"&&t.min!==null&&"date"in t.min)return!1;const s=t,f=typeof s.min=="string"&&s.min!=="",p=typeof s.max=="string"&&s.max!=="";return f&&!p?n==null||isNaN(e)?!1:e>=Number(s.min):!f&&p?n==null?!0:isNaN(e)?!1:e<=Number(s.max):f&&p?n==null||isNaN(e)?!1:e>=Number(s.min)&&e<=Number(s.max):!0}if(N){if(typeof t.min=="object"&&t.min!==null&&"date"in t.min&&!("min"in t.min)){const o=t,D=o.min,a=o.max,x=D?.date&&D.date!=="",y=a?.date&&a.date!=="";if(x&&!y){if(n==null)return!1;const d=n instanceof Date?n:new Date(n);if(isNaN(d.getTime()))return!1;const S=new Date(D.date+(D.time?`T${D.time}:00`:"T00:00:00"));return d>=S}if(!x&&y&&a){if(n==null)return!0;const d=n instanceof Date?n:new Date(n);if(isNaN(d.getTime()))return!1;const S=new Date(a.date+(a.time?`T${a.time}:00`:"T23:59:59"));return d<=S}if(x&&y&&a){if(n==null)return!1;const d=n instanceof Date?n:new Date(n);if(isNaN(d.getTime()))return!1;const S=new Date(D.date+(D.time?`T${D.time}:00`:"T00:00:00")),O=new Date(a.date+(a.time?`T${a.time}:00`:"T23:59:59"));return d>=S&&d<=O}return!0}const s=t,f=typeof s.min=="string"&&s.min!=="",p=typeof s.max=="string"&&s.max!=="";if(f&&!p){if(n==null)return!1;const o=n instanceof Date?n:new Date(n);return isNaN(o.getTime())?!1:o>=new Date(s.min)}if(!f&&p){if(n==null)return!0;const o=n instanceof Date?n:new Date(n);return isNaN(o.getTime())?!1:o<=new Date(s.max)}if(f&&p){if(n==null)return!1;const o=n instanceof Date?n:new Date(n);return isNaN(o.getTime())?!1:o>=new Date(s.min)&&o<=new Date(s.max)}return!0}}if(typeof t=="string"&&w(r)==="rating"){if(n==null)return!1;const i=Number(t),N=typeof n=="number"?n:Number(n);return isNaN(i)||isNaN(N)?!1:N>=i}const u=w(r);return u?u==="address"?n==null?!1:typeof n=="object"&&"formatted_address"in n?String(n.formatted_address).toLowerCase().includes(String(t).toLowerCase()):!1:T.has(u)?h(n,[t],b):n==null?!1:String(n).toLowerCase().includes(String(t).toLowerCase()):!0}export{I as matchesFilter};
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 D(e,t){const o=[],r=new Set;for(const n of e){const i=t[n.id];i?.operation!==a.DELETE&&(i?.operation===a.UPDATE&&i.optimisticData?o.push(i.optimisticData):o.push(n),r.add(n.id))}for(const[n,i]of Object.entries(t))i.operation===a.ADD&&!r.has(n)&&i.optimisticData&&o.push(i.optimisticData);return o}function p(e,t){return t?t.operation===a.DELETE?null:t.operation===a.UPDATE&&t.optimisticData?e?{...e,...t.optimisticData}:t.optimisticData:t.operation===a.ADD&&!e&&t.optimisticData?t.optimisticData:e:e}export{p as applyOptimisticToDoc,D as mergeWithOptimistic};
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 o}from"@donotdev/core";const r=new Set;function i(n,t){const e=o(n);return e}export{i as resolveReferenceEntity};
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"],s=["href","target","rel","src","alt","width","height","class","colspan","rowspan"];function r(t){return a(t,{allowedTags:e,allowedAttributes:s})}export{r as sanitizeHtml};
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};
@@ -1 +1 @@
1
- import{getScopeValue as o,CRUD_OPERATORS as p}from"@donotdev/core";function c(t,e){if(!e)return t;const r=o(e.provider);if(!r)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{...t,[e.field]:r}}function l(t,e){const r=t??{};if(!e||typeof e.field!="string")return r;const i=o(e.provider);if(!i)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 n={field:e.field,operator:p.EQ,value:i};return{...r,where:r.where?[...r.where,n]:[n]}}function s(t){return t?o(t.provider):null}export{s as getCurrentScopeValue,c as injectScope,l as injectScopeFilter};
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 s(r){return!r||typeof r!="string"?!1:r.startsWith("https://")&&!r.startsWith("blob:")}function c(r){return!(!r||typeof r!="object"||!s(r.fullUrl)||r.thumbUrl&&!s(r.thumbUrl))}function u(r,o=""){const t=[];if(r==null)return t;if(typeof r=="string")return r.startsWith("blob:")&&t.push(o||"root"),t;if(typeof r!="object")return t;if(Array.isArray(r))r.forEach((e,n)=>{const l=o?`${o}[${n}]`:`[${n}]`;t.push(...u(e,l))});else{const e=r;if(e.fullUrl!==void 0&&e.thumbUrl!==void 0){const n=e.fullUrl,l=e.thumbUrl,f=typeof n=="string"&&!s(n),b=l&&typeof l=="string"&&!s(l);if(f||b){const i=o||"root";t.push(`${i}.fullUrl or ${i}.thumbUrl contains blob URL`)}}else Object.entries(e).forEach(([n,l])=>{const f=o?`${o}.${n}`:n;t.push(...u(l,f))})}return t}function h(r){return u(r).length>0}export{u as checkForBlobUrls,h as hasBlobUrls,s as isStorageUrl,c as validatePicture};
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 c,useMemo as u}from"react";import{getTranslatedFieldNames as f,translateRow as m,useTranslation as d}from"@donotdev/core";const g=t=>t;function b(t,a){const{language:o}=d(),l=a.translate??!0,n=(typeof t=="string"?a.entity:t)?.fields??null,s=u(()=>n?f(n):[],[n]),r=l&&s.length>0,i=c(e=>e&&typeof e=="object"?m(e,s,o):e,[s,o]);return r?i:g}export{b as useRowTranslator};
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 r="dndev-workflow-";function c(t,o){try{const e=`${r}${t}`;localStorage.setItem(e,JSON.stringify(o))}catch{}}function n(t){try{const o=`${r}${t}`,e=localStorage.getItem(o);return e?JSON.parse(e):null}catch{return null}}function a(t){try{const o=`${r}${t}`;localStorage.removeItem(o)}catch{}}export{a as clearWorkflowState,n as loadWorkflowState,c as saveWorkflowState};
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(e){return e}export{n as defineWorkflow};
1
+ function e(n){return n}export{e as defineWorkflow};
@@ -1 +1 @@
1
- import{defineWorkflow as e}from"./defineWorkflow";import{useEntityWorkflow as f}from"./useEntityWorkflow";import{saveWorkflowState as a,loadWorkflowState as k,clearWorkflowState as w}from"./WorkflowPersistence";export{w as clearWorkflowState,e as defineWorkflow,k as loadWorkflowState,a as saveWorkflowState,f as useEntityWorkflow};
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 b,useCallback as p,useMemo as I,useEffect as G,useRef as L}from"react";import{evaluateCondition as M}from"@donotdev/core";import{saveWorkflowState as K,loadWorkflowState as j,clearWorkflowState as O}from"./WorkflowPersistence";function B(e,D={}){const{onComplete:k,onStepChange:u,defaultValues:y}=D,w=L(k);w.current=k;const[l,v]=b(()=>{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,m]=b(()=>{if(e.persist){const t=j(e.persistKey??e.id);if(t)return t.currentStepIndex}return 0}),[x,h]=b(!1),d=I(()=>{const t={};for(const[r,o]of Object.entries(l))for(const[i,a]of Object.entries(o))t[i]=a,t[`${r}.${i}`]=a;return t},[l]),n=I(()=>e.steps.filter(t=>t.conditions?.visible?M(t.conditions.visible,d):!0),[e.steps,d]),W=n[s]??n[0],S=s===0,c=s===n.length-1;G(()=>{e.persist&&K(e.persistKey??e.id,{currentStepIndex:s,stepData:l,savedAt:Date.now()})},[e.persist,e.persistKey,e.id,s,l]);const F=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={...d,...t??{}};if(r.validation.validate(i)!==!0)return!1}if(r.after){const i={};await r.after({data:t??l[r.id]??{},allData:{...d,...t??{}},next:{prefill:a=>{const f=n[s+1];f&&(i[f.id]=a)}}}),Object.keys(i).length>0&&v(a=>{const f={...a};for(const[C,$]of Object.entries(i))f[C]={...f[C],...$};return f})}if(c){h(!0);try{const i={...d,...t??{}},a=w.current??e.onComplete;return a&&await a(i),e.persist&&O(e.persistKey??e.id),!0}catch{return!1}finally{h(!1)}}const o=s+1;return m(o),u?.(s,o),!0},[n,s,d,l,c,e,u]),N=p(()=>{if(S)return;const t=s-1;m(t),u?.(s,t)},[s,S,u]),A=p(()=>{if(!n[s]?.allowSkip||c)return;const r=s+1;m(r),u?.(s,r)},[n,s,c,u]),E=p(t=>{t>=0&&t<n.length&&(u?.(s,t),m(t))},[n.length,s,u]),P=p(()=>{e.persist&&K(e.persistKey??e.id,{currentStepIndex:s,stepData:l,savedAt:Date.now()})},[e,s,l]),R=p(()=>{O(e.persistKey??e.id)},[e]),V=p((t,r)=>{v(o=>({...o,[t]:{...o[t],...r}}))},[]);return{currentStep:W,currentStepIndex:s,visibleSteps:n,stepData:l,allData:d,goNext:F,goPrevious:N,skipStep:A,goToStep:E,isFirst:S,isLast:c,isSubmitting:x,canGoNext:!x,persistNow:P,clearPersisted:R,prefillStep:V}}export{B as useEntityWorkflow};
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};
@@ -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.
@@ -87,7 +87,7 @@ fields: {
87
87
 
88
88
  ### SEO (`seo`, since 0.2.3)
89
89
 
90
- `<Seo entity data>` 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:
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.1",
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.2",
60
- "@donotdev/core": "^0.3.1",
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": {