@donotdev/expo 0.0.1 → 0.0.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/__tests__/components/atomic.test.js +1 -0
- package/dist/__tests__/providers/ExpoAppProviders.test.js +1 -0
- package/dist/__tests__/setup.js +1 -0
- package/dist/__tests__/test-utils.js +1 -0
- package/dist/atomic/Accordion/index.js +1 -0
- package/dist/atomic/Alert/index.js +1 -0
- package/dist/atomic/AlertDialog/index.js +1 -0
- package/dist/atomic/Avatar/index.js +1 -0
- package/dist/atomic/Badge/index.js +1 -0
- package/dist/atomic/Blockquote/index.js +1 -0
- package/dist/atomic/Button/index.js +1 -0
- package/dist/atomic/Calendar/index.js +1 -0
- package/dist/atomic/CallToAction/index.js +1 -0
- package/dist/atomic/Card/index.js +1 -0
- package/dist/atomic/Checkbox/index.js +1 -0
- package/dist/atomic/Collapsible/index.js +1 -0
- package/dist/atomic/Combobox/index.js +1 -0
- package/dist/atomic/Command/index.js +1 -0
- package/dist/atomic/CommandDialog/index.js +1 -0
- package/dist/atomic/ContextMenu/index.js +1 -0
- package/dist/atomic/CopyToClipboard/index.js +1 -0
- package/dist/atomic/DescriptionList/index.js +1 -0
- package/dist/atomic/Dialog/index.js +1 -0
- package/dist/atomic/DropdownMenu/index.js +1 -0
- package/dist/atomic/DualCard/index.js +1 -0
- package/dist/atomic/FeatureFallback/index.js +1 -0
- package/dist/atomic/FileButton/index.js +1 -0
- package/dist/atomic/Grid/index.js +1 -0
- package/dist/atomic/HeroSection/index.js +1 -0
- package/dist/atomic/HoverCard/index.js +1 -0
- package/dist/atomic/Icons/index.js +1 -0
- package/dist/atomic/InfiniteScroll/index.js +1 -0
- package/dist/atomic/Input/index.js +1 -0
- package/dist/atomic/Label/index.js +1 -0
- package/dist/atomic/List/index.js +1 -0
- package/dist/atomic/NavigationMenu/index.js +1 -0
- package/dist/atomic/Pagination/index.js +1 -0
- package/dist/atomic/PasswordInput/index.js +1 -0
- package/dist/atomic/Popover/index.js +1 -0
- package/dist/atomic/Portal/index.js +1 -0
- package/dist/atomic/PortalButton/index.js +1 -0
- package/dist/atomic/Progress/index.js +1 -0
- package/dist/atomic/RadioGroup/index.js +1 -0
- package/dist/atomic/RangeInput/index.js +1 -0
- package/dist/atomic/Rating/index.js +1 -0
- package/dist/atomic/ScrollArea/index.js +1 -0
- package/dist/atomic/Section/index.js +1 -0
- package/dist/atomic/Select/index.js +1 -0
- package/dist/atomic/Separator/index.js +1 -0
- package/dist/atomic/Sheet/index.js +1 -0
- package/dist/atomic/Skeleton/index.js +1 -0
- package/dist/atomic/Slider/index.js +1 -0
- package/dist/atomic/Slot/index.js +1 -0
- package/dist/atomic/Spinner/index.js +1 -0
- package/dist/atomic/Stack/index.js +1 -0
- package/dist/atomic/Stepper/index.js +1 -0
- package/dist/atomic/Switch/index.js +1 -0
- package/dist/atomic/Table/index.js +1 -0
- package/dist/atomic/Tabs/index.js +1 -0
- package/dist/atomic/Tag/index.js +1 -0
- package/dist/atomic/Text/index.js +1 -0
- package/dist/atomic/Textarea/index.js +1 -0
- package/dist/atomic/Toaster/index.js +1 -0
- package/dist/atomic/Toggle/index.js +1 -0
- package/dist/atomic/ToggleGroup/index.js +1 -0
- package/dist/atomic/Tooltip/index.js +1 -0
- package/dist/atomic/VideoPlayer/index.js +1 -0
- package/dist/atomic/VisuallyHidden/index.js +1 -0
- package/dist/atomic/index.js +1 -0
- package/dist/crud/components/DateFilter.js +1 -0
- package/dist/crud/components/DisplayFieldRenderer.js +1 -0
- package/dist/crud/components/EntityCardList.d.ts.map +1 -1
- package/dist/crud/components/EntityCardList.js +1 -0
- package/dist/crud/components/EntityDisplayRenderer.js +1 -0
- package/dist/crud/components/EntityFilters.js +1 -0
- package/dist/crud/components/EntityFormRenderer.d.ts +1 -3
- package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityFormRenderer.js +1 -0
- package/dist/crud/components/EntityList.d.ts.map +1 -1
- package/dist/crud/components/EntityList.js +1 -0
- package/dist/crud/components/FormFieldRenderer.js +1 -0
- package/dist/crud/components/FormLayout.js +1 -0
- package/dist/crud/components/index.js +1 -0
- package/dist/crud/contexts/UploadContext.js +1 -0
- package/dist/crud/forms/hooks/useEntityForm.js +1 -0
- package/dist/crud/hooks/useUnsavedChangesWarning.d.ts +7 -14
- package/dist/crud/hooks/useUnsavedChangesWarning.d.ts.map +1 -1
- package/dist/crud/hooks/useUnsavedChangesWarning.js +1 -0
- package/dist/crud/index.d.ts +1 -1
- package/dist/crud/index.d.ts.map +1 -1
- package/dist/crud/index.js +1 -0
- package/dist/crud/stores/index.js +1 -0
- package/dist/features/auth/components/AuthPartnerButton.js +1 -0
- package/dist/features/auth/components/ConfirmDeleteDialog.js +1 -0
- package/dist/features/auth/components/FeatureGuard.js +1 -0
- package/dist/features/auth/components/GoogleOneTap.js +1 -0
- package/dist/features/auth/components/LoginModal.js +1 -0
- package/dist/features/auth/components/MultipleAuthProviders.js +1 -0
- package/dist/features/auth/components/ReauthDialog.js +1 -0
- package/dist/features/auth/components/index.js +1 -0
- package/dist/features/auth/hooks/index.js +1 -0
- package/dist/features/auth/hooks/useAuthState.js +1 -0
- package/dist/features/auth/hooks/useCanAccess.js +1 -0
- package/dist/features/auth/hooks/useHasRole.js +1 -0
- package/dist/features/auth/hooks/useUserRole.js +1 -0
- package/dist/features/auth/index.js +1 -0
- package/dist/features/billing/components/ProductCard.js +1 -0
- package/dist/features/billing/components/SecurityNotice.js +1 -0
- package/dist/features/billing/components/StripeCheckoutButton.js +1 -0
- package/dist/features/billing/components/SubscriptionManager.js +1 -0
- package/dist/features/billing/components/index.js +1 -0
- package/dist/features/billing/index.js +1 -0
- package/dist/features/index.js +1 -0
- package/dist/features/oauth/components/MultipleOAuthProviders.js +1 -0
- package/dist/features/oauth/components/OAuthConnectionModal.js +1 -0
- package/dist/features/oauth/components/OAuthFallback.js +1 -0
- package/dist/features/oauth/components/OAuthPartnerButton.js +1 -0
- package/dist/features/oauth/components/index.js +1 -0
- package/dist/features/oauth/index.js +1 -0
- package/dist/firebase/authPersistence.js +1 -0
- package/dist/firebase/index.js +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/providers/ExpoAppProviders.js +1 -0
- package/dist/routing/components.js +1 -0
- package/dist/routing/hooks.d.ts +1 -1
- package/dist/routing/hooks.d.ts.map +1 -1
- package/dist/routing/hooks.js +1 -0
- package/dist/routing/index.js +1 -0
- package/dist/routing/utils/useFormStoreSafe.d.ts +5 -5
- package/dist/routing/utils/useFormStoreSafe.d.ts.map +1 -1
- package/dist/routing/utils/useFormStoreSafe.js +1 -0
- package/dist/storage/AsyncStorageStrategy.js +1 -0
- package/dist/storage/zustandAsyncStorage.js +1 -0
- package/dist/theme/ThemeProvider.js +1 -0
- package/dist/theme/index.js +1 -0
- package/dist/theme/tokens.js +1 -0
- package/dist/utils/constants.js +1 -0
- package/dist/utils/helpers.js +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/theme-helpers.js +1 -0
- package/dist/utils/useAuthSafe.js +1 -0
- package/dist/utils/variants.js +1 -0
- package/package.json +20 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityFormRenderer.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityFormRenderer.tsx"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AASH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAU7C,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,WAAW,uBAAuB,CACtC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAE3D,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,2BAA2B;IAC3B,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;IAC/D,uBAAuB;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0BAA0B;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,4BAA4B;IAC5B,aAAa,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IACzE,4BAA4B;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,+BAA+B;IAC/B,sBAAsB,CAAC,EACnB,SAAS,GACT,aAAa,GACb,SAAS,GACT,OAAO,GACP,MAAM,CAAC;IACX,0CAA0C;IAC1C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,4BAA4B;IAC5B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC9B,uBAAuB;IACvB,
|
|
1
|
+
{"version":3,"file":"EntityFormRenderer.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityFormRenderer.tsx"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AASH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAU7C,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,WAAW,uBAAuB,CACtC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAE3D,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,2BAA2B;IAC3B,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;IAC/D,uBAAuB;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0BAA0B;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,4BAA4B;IAC5B,aAAa,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IACzE,4BAA4B;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,+BAA+B;IAC/B,sBAAsB,CAAC,EACnB,SAAS,GACT,aAAa,GACb,SAAS,GACT,OAAO,GACP,MAAM,CAAC;IACX,0CAA0C;IAC1C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,4BAA4B;IAC5B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC9B,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,8CAA8C;IAC9C,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,yCAAyC;IACzC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,sCAAsC;IACtC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EACtE,MAAM,EACN,QAAQ,EACR,CAAC,EACD,KAAK,EACL,UAAU,EACV,OAAe,EACf,aAAa,EACb,aAAyB,EACzB,mBAAmB,EACnB,sBAAkC,EAClC,iBAAiB,EACjB,UAAU,EAAE,cAAc,EAC1B,SAA2D,EAC3D,MAAM,EAAE,cAAc,EACtB,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,oBAA2B,EAC3B,qBAAqB,EACrB,kBAA0B,EAC1B,MAAM,GACP,EAAE,uBAAuB,CAAC,CAAC,CAAC,2CAuJ5B;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o,jsxs as E}from"react/jsx-runtime";import{useEffect as I,useId as P,useCallback as $}from"react";import{Alert as T}from"react-native";import{FormProvider as rr}from"react-hook-form";import{Stack as l,Spinner as er,Button as u}from"../../atomic";import{useTranslation as x}from"@donotdev/core";import{useNavigate as or}from"../../routing";import"./DisplayFieldRenderer";import{FormFieldRenderer as tr}from"./FormFieldRenderer";import{UploadProvider as ir}from"../contexts/UploadContext";import{useEntityForm as nr}from"../forms/hooks/useEntityForm";import{useUnsavedChangesWarning as sr}from"../hooks/useUnsavedChangesWarning";import{useFormStore as ar}from"../stores";import{useAuthSafe as mr}from"../../utils/useAuthSafe";function fr({entity:a,onSubmit:C,t:U,style:c,submitText:V,loading:A=!1,defaultValues:p,submitVariant:B="primary",secondaryButtonText:g,secondaryButtonVariant:D="outline",onSecondarySubmit:v,viewerRole:_,operation:F=p!==void 0?"edit":"create",formId:N,cancelText:m,cancelPath:t,successPath:h,onCancel:n,warnOnUnsavedChanges:W=!0,unsavedChangesMessage:q,hideVisibilityInfo:dr=!1,testID:r}){const e=or(),z=mr("userRole"),y=_??z,G=P(),s=N??`entity-form-${a.name}-${G}`,{t:H}=x([a.namespace,"crud"]),{t:f}=x("crud"),b=U||H,S=nr(a,{formId:s,operation:F,defaultValues:p,viewerRole:y,t:b}),{control:J,handleSubmit:R,formState:{errors:K},fields:L,formStatus:M,uploadProgress:lr,cleanup:k,isDirty:O,hasUserInteracted:Q,resetForm:w}=S,d=O&&Q;I(()=>{s&&ar.getState().setIsDirty(s,d)},[s,d]),I(()=>k,[k]);const X=$(()=>{e(t||"back")},[e,t]);sr(W&&d,q,X);const Y=$(()=>{w(),n?n():e(t||"back")},[w,n,t,e]),Z=async i=>{try{await C(i)}catch(j){T.alert("Error",j instanceof Error?j.message:"Something went wrong");return}e(h||"back")};return A?o(l,{style:c,testID:r,children:o(er,{overlay:!0})}):o(ir,{children:o(rr,{...S,children:E(l,{gap:16,style:c,testID:r,children:[L.map(i=>o(tr,{name:i.name,config:i.config,control:J,errors:K,t:b,viewerRole:y},i.name)),E(l,{direction:"row",gap:8,justify:"flex-end",children:[m!==null&&(m||t||n)&&o(u,{variant:"outline",onPress:Y,testID:r?`${r}-cancel`:void 0,children:m||f("form.cancel",{defaultValue:"Cancel"})}),g&&v&&o(u,{variant:D,onPress:R(i=>{v(i)}),testID:r?`${r}-secondary`:void 0,children:g}),o(u,{variant:B,onPress:R(Z),loading:M==="submitting",testID:r?`${r}-submit`:void 0,children:V||(F==="create"?f("form.create",{defaultValue:"Create"}):f("form.save",{defaultValue:"Save"}))})]})]})})})}var Ir=fr;export{fr as EntityFormRenderer,Ir as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityList.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityList.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"EntityList.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityList.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAoBH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,QAAkB,EAClB,QAAQ,EACR,OAAO,EACP,WAAmB,EACnB,UAAqB,EACrB,QAAQ,EAAE,YAAY,EACtB,YAAY,EACZ,UAAiB,GAClB,EAAE,eAAe,2CAkOjB;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as s,jsxs as f}from"react/jsx-runtime";import{useMemo as P,useCallback as d,useState as x}from"react";import"react-native";import{DataTable as H,Button as p,Stack as m,Section as j,Input as K}from"../../atomic";import{useTranslation as D}from"@donotdev/core";import{useNavigate as Q}from"../../routing";import{translateFieldLabel as U,useCrud as W,useCrudList as X,useCrudFilters as Y}from"@donotdev/crud";import{EntityFilters as Z,matchesFilter as J}from"./EntityFilters";import{formatValue as ee}from"./DisplayFieldRenderer";function L({entity:a,userRole:g="guest",basePath:R,onClick:h,hideFilters:T=!1,pagination:y="client",pageSize:S,queryOptions:V,exportable:ae=!0}){const n=Q(),r=R??`/${a.collection}`,[q,ie]=x(1),[z,le]=x(S),{data:B,loading:F,mutate:$}=X(a,{pagination:y,...V&&{queryOptions:V},...y==="server"&&{page:q,pageSize:z}}),{delete:k}=W(a),{t:i}=D("crud"),b=B?.items||[],{t:v}=D([a.namespace,"crud"]),{filters:w}=Y({collection:a.collection}),[u,E]=x(""),N=d(async()=>{await $()},[$]),I=d(e=>{n(`${r}/${e}`)},[r,n]),A=d(e=>{h?h(e):n(`${r}/${e}`)},[r,n,h]),M=d(()=>{n(`${r}/new`)},[r,n]),O=d(async e=>{await k(e)},[k]),_=P(()=>{let e=b;if(u){const l=u.toLowerCase();e=e.filter(t=>Object.values(t).some(o=>o==null?!1:String(o).toLowerCase().includes(l)))}return Object.keys(w).length>0&&(e=e.filter(l=>Object.entries(w).every(([t,o])=>{const c=l[t],C=a.fields[t]?.type||"text";return J(c,o,C)}))),e},[b,u,w,a.fields]),G=P(()=>{const e=(a.listFields||Object.keys(a.fields)).map(l=>{const t=a.fields[l];if(!t)return null;const o=U(l,t,v),c=t.type||"text";return{key:l,title:o,dataIndex:l,sortable:!0,filterable:!0,align:c==="number"||c==="range"?"end":"start",render:(C,se)=>ee(C,t,v,{compact:!0})}}).filter(Boolean);return g==="admin"&&e.push({key:"_actions",title:i("actions.label",{defaultValue:"Actions"}),dataIndex:void 0,sortable:!1,width:120,align:"center",render:(l,t)=>f(m,{gap:8,direction:"row",align:"center",justify:"center",children:[s(p,{variant:"outline",onPress:()=>I(t.id),testID:`edit-${t.id}`,children:i("edit",{defaultValue:"Edit"})}),s(p,{variant:"destructive",onPress:()=>O(t.id),testID:`delete-${t.id}`,children:i("delete",{defaultValue:"Delete"})})]})}),e},[a.fields,a.listFields,v,i,g,I,O]);return f(m,{gap:16,children:[!T&&s(j,{title:i("filters.title",{defaultValue:"Filters"}),collapsible:!0,defaultCollapsed:!1,children:f(m,{gap:16,children:[s(K,{placeholder:i("search.placeholder",{defaultValue:"Search..."}),value:u,onChangeText:E}),s(Z,{entity:a,data:b})]})}),s(j,{title:i("results.title",{defaultValue:"Results"}),actions:f(m,{direction:"row",gap:8,children:[s(p,{variant:"outline",onPress:N,loading:F,children:i("refresh",{defaultValue:"Refresh"})}),g==="admin"&&s(p,{variant:"primary",onPress:M,children:i("create",{defaultValue:"Create New"})})]}),children:s(H,{data:_,columns:G,loading:F,pagination:y!==void 0,pageSize:S,onRowPress:e=>A(e.id),testID:"entity-list-table"})})]})}var te=L;export{L as EntityList,te as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o,Fragment as c}from"react/jsx-runtime";import{handleError as f}from"@donotdev/core";import{getFieldRegistry as x}from"@donotdev/crud";const l=x();function g({name:t,config:e,t:r,viewerRole:w,...n}){const m="control"in n&&n.control,u=e.type==="submit"||e.type==="reset";if(m&&!u){const{control:p,errors:s}=n,a=e.options?.fieldSpecific?.placeholder,d=l.getControlledComponent(e.type);if(d)return o(d,{control:p,errors:s,fieldConfig:{...e,label:e.label||t},t:r,placeholder:a});f(new Error(`Unregistered field type: ${e.type}`),{userMessage:r("errors.unsupportedFieldType",{type:e.type}),context:{fieldName:t,fieldType:e.type},severity:"warning"});const y=l.getControlledComponent("text");return y?o(y,{control:p,errors:s,fieldConfig:{...e,type:"text"},t:r,placeholder:a}):o(c,{})}const{value:C,onChange:h,error:v}=n,i=l.getUncontrolledComponent(e.type);return i?o(i,{name:t,config:e,value:C,onChange:h,error:v,t:r}):(f(new Error(`Unregistered field type: ${e.type}`),{userMessage:r("errors.unsupportedFieldType",{type:e.type}),context:{fieldName:t,fieldType:e.type},severity:"warning"}),o(c,{}))}var F=g;export{g as FormFieldRenderer,F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useState as C}from"react";import{FormProvider as D}from"react-hook-form";import{Button as m,Spinner as I,Stack as n,Text as o}from"../../atomic";import{useTranslation as P}from"@donotdev/core";const T=({title:u,onSubmit:h,children:f,formMethods:s,loading:a=!1,submitText:g,cancelText:p,showCancel:b=!1,onCancel:v,variant:F="default",columns:L=1,description:d,style:y,testID:t})=>{const{t:r}=P("dndev"),[i,c]=C(!1),x=g||r("form.submit","Submit"),S=p||r("form.cancel","Cancel"),w=s.handleSubmit(async j=>{c(!0);try{await h(j)}finally{c(!1)}});return e(D,{...s,children:l(n,{gap:24,style:y,testID:t,children:[l(n,{gap:8,children:[e(o,{level:"h2",children:u}),d&&e(o,{level:"body",variant:"muted",children:d})]}),e(n,{gap:16,children:f}),l(n,{direction:"row",align:"center",justify:"flex-end",gap:8,children:[b&&e(m,{variant:"outline",onPress:v,disabled:a||i,testID:t?`${t}-cancel`:void 0,children:S}),e(m,{onPress:w,disabled:a||i,loading:a||i,testID:t?`${t}-submit`:void 0,children:a||i?l(n,{direction:"row",gap:8,align:"center",children:[e(I,{}),e(o,{level:"body",children:i?r("form.submitting","Submitting..."):r("form.loading","Loading...")})]}):x})]})]})})};var $=T;export{$ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{EntityFormRenderer as r}from"./EntityFormRenderer";import{EntityDisplayRenderer as t}from"./EntityDisplayRenderer";import{EntityList as e}from"./EntityList";import{EntityCardList as a}from"./EntityCardList";import{EntityFilters as i,matchesFilter as s}from"./EntityFilters";import{FormFieldRenderer as m}from"./FormFieldRenderer";import{DisplayFieldRenderer as o,formatValue as n}from"./DisplayFieldRenderer";import{DateFilter as l}from"./DateFilter";import{default as y}from"./FormLayout";export{l as DateFilter,o as DisplayFieldRenderer,a as EntityCardList,t as EntityDisplayRenderer,i as EntityFilters,r as EntityFormRenderer,e as EntityList,m as FormFieldRenderer,y as FormLayout,n as formatValue,s as matchesFilter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{createContext as n,useContext as a}from"react";const r=n(void 0);function d({formId:o,children:e}){return t(r.Provider,{value:o,children:e})}function i(){return a(r)}export{d as UploadProvider,i as useUploadContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEntityForm as t}from"@donotdev/crud";export{t as useEntityForm};
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Unsaved changes warning
|
|
3
|
-
* @description
|
|
2
|
+
* @fileoverview Unsaved changes warning hook (Expo/React Native)
|
|
3
|
+
* @description Intercepts the hardware back button to warn about unsaved changes.
|
|
4
|
+
* Auto-save ensures drafts are persisted — SPA navigation is never blocked.
|
|
5
|
+
* This hook only handles the Android hardware back press (equivalent of beforeunload).
|
|
4
6
|
*
|
|
5
|
-
* @version 0.0.
|
|
7
|
+
* @version 0.0.3
|
|
6
8
|
* @since 0.0.1
|
|
7
9
|
* @author AMBROISE PARK Consulting
|
|
8
10
|
*/
|
|
9
11
|
/**
|
|
10
|
-
* Hook to warn about unsaved changes.
|
|
11
|
-
*
|
|
12
|
-
* On "Discard", calls `onDiscard` to navigate back (falls back to router.back
|
|
13
|
-
* via Expo Router if no callback provided).
|
|
12
|
+
* Hook to warn about unsaved changes on hardware back press only.
|
|
13
|
+
* Auto-save handles SPA navigation — this is for the Android back button.
|
|
14
14
|
*/
|
|
15
15
|
export declare function useUnsavedChangesWarning(isDirty: boolean, message?: string, onDiscard?: () => void): void;
|
|
16
|
-
/**
|
|
17
|
-
* Hook to confirm navigation with a callback.
|
|
18
|
-
* Shows a native Alert dialog; calls onConfirm if user chooses to discard.
|
|
19
|
-
*/
|
|
20
|
-
export declare function useConfirmNavigation(isDirty: boolean, onConfirm: () => void): {
|
|
21
|
-
showConfirmation: () => void;
|
|
22
|
-
};
|
|
23
16
|
//# sourceMappingURL=useUnsavedChangesWarning.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUnsavedChangesWarning.d.ts","sourceRoot":"","sources":["../../../src/crud/hooks/useUnsavedChangesWarning.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"useUnsavedChangesWarning.d.ts","sourceRoot":"","sources":["../../../src/crud/hooks/useUnsavedChangesWarning.ts"],"names":[],"mappings":"AACA;;;;;;;;;GASG;AAQH;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,IAAI,QAiCvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as a}from"react";import{Alert as s,BackHandler as o}from"react-native";const u="You have unsaved changes. Are you sure you want to go back?";function d(t,r,e){a(()=>{if(!t)return;const n=o.addEventListener("hardwareBackPress",()=>(s.alert("Unsaved Changes",r||u,[{text:"Stay",style:"cancel",onPress:()=>{}},{text:"Discard",style:"destructive",onPress:()=>{e&&e()}}],{cancelable:!0}),!0));return()=>{n.remove()}},[t,r,e])}export{d as useUnsavedChangesWarning};
|
package/dist/crud/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
export * from './components';
|
|
10
10
|
export { UploadProvider, useUploadContext } from './contexts/UploadContext';
|
|
11
11
|
export type { UploadProviderProps } from './contexts/UploadContext';
|
|
12
|
-
export { useUnsavedChangesWarning
|
|
12
|
+
export { useUnsavedChangesWarning } from './hooks/useUnsavedChangesWarning';
|
|
13
13
|
export * from './stores';
|
|
14
14
|
export * from './forms/hooks/useEntityForm';
|
|
15
15
|
export { useCrud, useCrudList, useCrudCardList, getCrudService, useCrudStore, useCrudFilters, useEntityForm as useEntityFormBase, useEntityField, useController, isFieldEditable, getFieldsForOperation, validateEntity, translateFieldLabel, translateLabel, registerFieldType, getFieldRegistry, registerBuiltinFieldTypes, useFileUpload, useEntityFavorites, useRelatedItems, } from '@donotdev/crud';
|
package/dist/crud/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/crud/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAGH,cAAc,cAAc,CAAC;AAG7B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5E,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGpE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/crud/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAGH,cAAc,cAAc,CAAC;AAG7B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5E,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAG5E,cAAc,UAAU,CAAC;AAGzB,cAAc,6BAA6B,CAAC;AAG5C,OAAO,EACL,OAAO,EACP,WAAW,EACX,eAAe,EACf,cAAc,EACd,YAAY,EACZ,cAAc,EACd,aAAa,IAAI,iBAAiB,EAClC,cAAc,EACd,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,kBAAkB,EAClB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,oBAAoB,EACpB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,4BAA4B,EAC5B,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./components";import{UploadProvider as s,useUploadContext as i}from"./contexts/UploadContext";import{useUnsavedChangesWarning as d}from"./hooks/useUnsavedChangesWarning";export*from"./stores";export*from"./forms/hooks/useEntityForm";import{useCrud as n,useCrudList as F,useCrudCardList as p,getCrudService as C,useCrudStore as m,useCrudFilters as g,useEntityForm as y,useEntityField as x,useController as f,isFieldEditable as E,getFieldsForOperation as v,validateEntity as L,translateFieldLabel as U,translateLabel as b,registerFieldType as B,getFieldRegistry as R,registerBuiltinFieldTypes as S,useFileUpload as T,useEntityFavorites as c,useRelatedItems as h}from"@donotdev/crud";export{s as UploadProvider,C as getCrudService,R as getFieldRegistry,v as getFieldsForOperation,E as isFieldEditable,S as registerBuiltinFieldTypes,B as registerFieldType,U as translateFieldLabel,b as translateLabel,f as useController,n as useCrud,p as useCrudCardList,g as useCrudFilters,F as useCrudList,m as useCrudStore,c as useEntityFavorites,x as useEntityField,y as useEntityFormBase,T as useFileUpload,h as useRelatedItems,d as useUnsavedChangesWarning,i as useUploadContext,L as validateEntity};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useFormStore as s,useFormStatus as a,useFormLoading as r,useUploadProgress as o,useFormError as e,useFormIsDirty as u,useHasDirtyForms as t}from"@donotdev/crud";import{useUploadStore as m,useTotalProgress as F,useIsUploading as i,useFieldProgress as l,useFieldUploadStatus as d}from"@donotdev/crud";export{l as useFieldProgress,d as useFieldUploadStatus,e as useFormError,u as useFormIsDirty,r as useFormLoading,a as useFormStatus,s as useFormStore,t as useHasDirtyForms,i as useIsUploading,F as useTotalProgress,o as useUploadProgress,m as useUploadStore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as f}from"react/jsx-runtime";import{useState as S,useMemo as x}from"react";import"react-native";import{Button as h}from"../../../atomic";import{AUTH_PARTNERS as P,useTranslation as A}from"@donotdev/core";import{useAuth as e}from"@donotdev/auth";function T({partnerId:t,method:D,onSuccess:b,onError:l,children:u,disabled:i=!1,style:d,testID:m,...g}){const{t:a}=A("auth"),y=e("user"),E=e("signInWithPartner"),w=e("linkWithPartner"),p=e("isAvailable"),[n,c]=S(!1),r=x(()=>P[t],[t]);if(t==="password")return f(h,{variant:"outline",onPress:()=>{l?.(new Error("Email/password form not implemented for Expo"))},disabled:i,style:d,testID:m,children:u||a("signInWithEmail","Sign in with Email")});if(!r)return null;const v=!0,I=async()=>{if(!(!p||i||n)){c(!0);try{y&&v?await w(t):await E(t),b?.(null)}catch(s){l?.(s instanceof Error?s:new Error(String(s)))}finally{c(!1)}}},o=r?.name;return f(h,{variant:"outline",onPress:I,disabled:i||n||!p,loading:n,style:d,testID:m,...g,children:u||(n?a("buttons.signingIn",{partner:o,defaultValue:`Signing in with ${o}...`}):r?.button?.textKey?a(r.button.textKey):`Sign in with ${o}`)})}var k=T;export{k as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as s}from"react/jsx-runtime";import{Dialog as E,Button as d,Stack as u,Text as f,Input as T}from"../../../atomic";import{useTranslation as x}from"@donotdev/core";import{useDeleteAccount as y}from"@donotdev/auth";import{useState as w}from"react";function A({open:p,isLoading:a,error:i,onConfirm:L,onCancel:b,onOpenChange:n,onSuccess:m,onError:h}){const{t}=x("auth"),{confirmDelete:g,isDeleting:v}=y(),[o,D]=w(""),c=a!==void 0?a:v,l=i!==void 0?i:null,C=async()=>{if(o.toLowerCase()==="delete")try{await g(),m?.(),n?.(!1)}catch(r){h?.(r instanceof Error?r:new Error(String(r)))}};return e(E,{open:p,onOpenChange:n,title:t("deleteAccount","Delete Account"),description:t("deleteAccountWarning","This action cannot be undone"),children:s(u,{gap:16,children:[l&&e(f,{level:"body",variant:"destructive",testID:"delete-error",children:l}),e(f,{level:"body",children:t("deleteAccountConfirm",'Type "DELETE" to confirm')}),e(T,{value:o,onChangeText:D,placeholder:"DELETE",testID:"delete-confirm-input"}),s(u,{direction:"row",gap:8,justify:"flex-end",children:[e(d,{variant:"outline",onPress:()=>n?.(!1),testID:"delete-cancel",children:t("cancel","Cancel")}),e(d,{variant:"destructive",onPress:C,disabled:o.toLowerCase()!=="delete"||c,loading:c,testID:"delete-confirm",children:t("delete","Delete")})]})]})})}var I=A;export{I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as T}from"react/jsx-runtime";import{View as n}from"react-native";import{Text as h}from"../../../atomic";import{hasTierAccess as v}from"@donotdev/core";import{useAuth as c}from"@donotdev/auth";function b({children:r,role:l,tier:i,subscription:a,validate:m,fallback:s,style:o,testID:d}){const y=c("user"),u=c("userRole"),t=c("userTier");if(!c("isAvailable"))return e(n,{style:o,children:r});if(!y)return s?e(s,{requiredRole:l,requiredTier:i,requiresSubscription:a}):e(n,{style:o,testID:d,children:e(h,{level:"body",variant:"muted",children:"Please sign in to access this feature"})});if(l){const f=Array.isArray(l)?l:[l];if(!u||!f.includes(u))return s?e(s,{requiredRole:l,userRole:u,userTier:t}):e(n,{style:o,testID:d,children:e(h,{level:"body",variant:"muted",children:"This feature requires a different role"})})}return i&&(!t||!v(t,i))?s?e(s,{requiredTier:i,userRole:u,userTier:t}):e(n,{style:o,testID:d,children:T(h,{level:"body",variant:"muted",children:["This feature requires ",i," tier"]})}):a&&!t?s?e(s,{requiresSubscription:!0,userRole:u,userTier:t}):e(n,{style:o,testID:d,children:e(h,{level:"body",variant:"muted",children:"This feature requires an active subscription"})}):m&&(!u||!t||!m(u,t))?s?e(s,{userRole:u,userTier:t}):e(n,{style:o,testID:d,children:e(h,{level:"body",variant:"muted",children:"Access denied"})}):e(n,{style:o,children:r})}function p(r){const l=c("user"),i=c("userRole"),a=c("userTier");return!(!l&&(r.role||r.tier||r.subscription)||r.role&&!(Array.isArray(r.role)?r.role:[r.role]).some(m=>i===m)||r.tier&&(!a||!v(a,r.tier))||r.subscription&&!a||r.validate&&(!i||!a||!r.validate(i,a)))}var q=b;export{q as default,p as useCanAccessFeature};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"react-native";import"../../../atomic";function t({style:r,testID:o}){return null}var e=t;export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{Dialog as e}from"../../../atomic";import{useTranslation as r}from"@donotdev/core";import i from"./MultipleAuthProviders";function s({open:t,onOpenChange:a}){const{t:o}=r("auth");return n(e,{open:t,onOpenChange:a,title:o("signIn","Sign In"),description:o("choosePlatform","Choose a platform to sign in with"),children:n(i,{layout:"vertical",showLabels:!0,method:"popup"})})}var p=s;export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Stack as h}from"../../../atomic";import{AUTH_PARTNERS as s,useTranslation as f}from"@donotdev/core";import v from"./AuthPartnerButton";function S({providers:n,enabledPartners:a,layout:i="vertical",showLabels:l=!0,method:c="popup",fullWidth:I,onSuccess:d,onError:m,style:p,testID:o}){const{t:T}=f("auth"),u=n||a||Object.keys(s);return e(h,{direction:i==="horizontal"?"row":"column",gap:12,style:p,testID:o,children:u.map(r=>{const t=s[r];return t?e(v,{partnerId:r,method:c,onSuccess:d,onError:m,testID:o?`${o}-${r}`:void 0,children:l?t.name||r:void 0},r):null})})}var y=S;export{y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as c}from"react/jsx-runtime";import{Dialog as u,Button as l,Stack as h,Text as p}from"../../../atomic";import{useTranslation as d}from"@donotdev/core";import m from"./MultipleAuthProviders";function g({open:o,isLoading:v,error:t,onReauth:x,onCancel:a,onOpenChange:r,onSuccess:i,onError:s}){const{t:n}=d("auth");return e(u,{open:o,onOpenChange:r,title:n("reauth","Re-authentication Required"),description:n("reauthDescription","Please sign in again to continue"),children:c(h,{gap:16,children:[t&&e(p,{level:"body",variant:"destructive",testID:"reauth-error",children:t}),e(m,{layout:"vertical",showLabels:!0,method:"popup",onSuccess:i,onError:s}),a&&e(l,{variant:"outline",onPress:a,testID:"reauth-cancel",children:n("cancel","Cancel")})]})})}var f=g;export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as a}from"./AuthPartnerButton";import{default as e}from"./LoginModal";import{default as t}from"./MultipleAuthProviders";import{default as r,useCanAccessFeature as o}from"./FeatureGuard";import{default as s}from"./GoogleOneTap";import{default as u}from"./ReauthDialog";import{default as f}from"./ConfirmDeleteDialog";export{a as AuthPartnerButton,f as ConfirmDeleteDialog,r as FeatureGuard,s as GoogleOneTap,e as LoginModal,t as MultipleAuthProviders,u as ReauthDialog,o as useCanAccessFeature};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useUserRole as s}from"./useUserRole";import{useHasRole as e}from"./useHasRole";import{useAuthState as a}from"./useAuthState";import{useCanAccess as r}from"./useCanAccess";import{useCanAccessFeature as o}from"../components/FeatureGuard";export{a as useAuthState,r as useCanAccess,o as useCanAccessFeature,e as useHasRole,s as useUserRole};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useAuth as r}from"@donotdev/auth";import{SUBSCRIPTION_TIERS as i}from"@donotdev/core";function e(){const t=r("user"),o=r("userSubscription"),u=r("loading");return{authenticated:!!t,role:t?.role,tier:o?.tier||i.FREE,loading:u,userId:t?.id}}var a=e;export{a as default,e as useAuthState};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useAuth as t}from"@donotdev/auth";function a(e){return t("can").navigate(e)}var s=a;export{s as default,a as useCanAccess};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useAuth as o}from"@donotdev/auth";import"@donotdev/core";function r(e){return o("userRole")===e}var s=r;export{s as default,r as useHasRole};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useAuth as e}from"@donotdev/auth";import{USER_ROLES as o}from"@donotdev/core";function r(){return e("userRole")||o.GUEST}var s=r;export{s as default,r as useUserRole};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useAuth as s}from"@donotdev/auth";import{useDeleteAccount as e}from"@donotdev/auth";import{getAuthState as a,subscribeToAuth as t}from"@donotdev/auth";import{useUserRole as u,useHasRole as o,useAuthState as r,useCanAccess as c,useCanAccessFeature as A}from"./hooks";export*from"./components";export{a as getAuthState,t as subscribeToAuth,s as useAuth,r as useAuthState,c as useCanAccess,A as useCanAccessFeature,e as useDeleteAccount,o as useHasRole,u as useUserRole};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{StyleSheet as B}from"react-native";import{Card as K,Badge as y,Stack as t,Text as i}from"../../../atomic";import{useTranslation as O,maybeTranslate as c,translateArray as j}from"@donotdev/core";import{StripeCheckoutButton as F}from"./StripeCheckoutButton";function g({namespace:b="billing",configKey:v,id:R,name:f,price:m,currency:J,description:w,features:l,popular:s=!1,limitedTime:I=!1,mode:o,priceId:C,allowPromotionCodes:P=!0,metadata:T={},successUrl:D="/billing/success",cancelUrl:S="/purchase",style:U,testID:r}){const{t:a}=O([b,"billing"]),k=m==="Free"?"Free":m,p=o==="subscription"?"/month":"",x=c(a,f),h=c(a,w),u=Array.isArray(l)?l.map(d=>c(a,d)):l?j(a,l,10):[],A=B.flatten([U,s&&{shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:.3,shadowRadius:8,elevation:8}].filter(Boolean));return e(K,{variant:s?"primary":"default",style:A,testID:r,children:n(t,{gap:16,children:[n(t,{gap:8,children:[s&&e(y,{variant:"primary",testID:r?`${r}-popular-badge`:void 0,children:a("popular","Popular")}),I&&e(y,{variant:"warning",testID:r?`${r}-limited-badge`:void 0,children:a("limitedTime","Limited Time")}),e(i,{level:"h3",children:x}),n(t,{direction:"row",align:"baseline",gap:4,children:[e(i,{level:"h2",children:k}),p&&e(i,{level:"body",variant:"muted",children:p})]}),h&&e(i,{level:"body",variant:"muted",children:h})]}),u.length>0&&e(t,{gap:8,children:u.map((d,$)=>n(t,{direction:"row",gap:8,align:"center",children:[e(i,{level:"body",children:"\u2713"}),e(i,{level:"body",children:d})]},$))}),e(F,{configKey:v,priceId:C,mode:o,allowPromotionCodes:P,metadata:T,successUrl:D,cancelUrl:S,variant:s?"primary":"outline",testID:r?`${r}-checkout`:void 0,children:o==="subscription"?a("subscribe","Subscribe"):a("purchase","Purchase")})]})})}var L=g;export{g as ProductCard,L as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{Alert as n}from"../../../atomic";import{useTranslation as a}from"@donotdev/core";function e({dismissible:m,show:s=!0,onDismiss:u,style:i,testID:r}){const{t}=a("billing");return s?o(n,{variant:"info",title:t("security.title","Secure Payment"),description:t("security.description","Your payment is processed securely by Stripe. We never store your payment information."),style:i,testID:r}):null}var l=e;export{e as SecurityNotice,l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as T}from"react/jsx-runtime";import{Linking as n}from"react-native";import{Button as C}from"../../../atomic";import{useTranslation as R,FEATURE_STATUS as S}from"@donotdev/core";import{useStripeBilling as s}from"@donotdev/billing";function i({configKey:t,priceId:a,mode:c,successUrl:l,cancelUrl:d,metadata:m={},allowPromotionCodes:p=!0,variant:u="primary",disabled:e,loadingText:f,children:g,onError:U,style:h,testID:w,...I}){const{t:y}=R("billing"),E=s("checkout"),r=s("status")===S.INITIALIZING,L=f||y("components.buttons.processing","Processing...");return T(C,{variant:u,onPress:async()=>{if(!(e||r))try{const o=(await E({priceId:a,mode:c,successUrl:l,cancelUrl:d,metadata:{...t&&{billingConfigKey:t},...m},allowPromotionCodes:p}))?.sessionUrl;if(!o)throw new Error("Checkout session did not return a URL");if(await n.canOpenURL(o))await n.openURL(o);else throw new Error("Cannot open checkout URL on this device")}catch(o){U?.(o instanceof Error?o:new Error(String(o)))}},disabled:e||r,loading:r,style:h,testID:w,...I,children:r?L:g})}var b=i;export{i as StripeCheckoutButton,b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t,jsxs as s}from"react/jsx-runtime";import{Stack as i,Text as n,Button as b,Card as l}from"../../../atomic";import{useTranslation as m}from"@donotdev/core";import{useStripeBilling as h}from"@donotdev/billing";import{useAuth as S}from"@donotdev/auth";function c({availablePlans:v,allowPlanChange:f=!0,style:o,testID:r}){const{t:e}=m("billing"),u=S("userSubscription"),p=h("openCustomerPortal"),a=u,d=async()=>{try{await p()}catch{__DEV__}};return a?t(l,{style:o,testID:r,children:s(i,{gap:16,children:[t(n,{level:"h3",children:e("subscription","Subscription")}),s(i,{gap:8,children:[s(n,{level:"body",children:[e("status","Status"),": ",a.status]}),a.subscriptionEnd&&s(n,{level:"body",variant:"muted",children:[e("renewsOn","Renews on"),":"," ",new Date(a.subscriptionEnd).toLocaleDateString()]})]}),t(b,{variant:"outline",onPress:d,testID:r?`${r}-manage`:void 0,children:e("manageSubscription","Manage Subscription")})]})}):t(l,{style:o,testID:r,children:s(i,{gap:16,children:[t(n,{level:"h3",children:e("noSubscription","No Active Subscription")}),t(n,{level:"body",variant:"muted",children:e("subscribeToAccess","Subscribe to access premium features")})]})})}var g=c;export{c as SubscriptionManager,g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ProductCard as t}from"./ProductCard";import{StripeCheckoutButton as r}from"./StripeCheckoutButton";import{SecurityNotice as o}from"./SecurityNotice";import{SubscriptionManager as i}from"./SubscriptionManager";export{t as ProductCard,o as SecurityNotice,r as StripeCheckoutButton,i as SubscriptionManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useStripeBilling as i}from"@donotdev/billing";export*from"./components";export{i as useStripeBilling};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./auth";export*from"./billing";export*from"./oauth";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Stack as m}from"../../../atomic";import{getEnabledOAuthPartners as u}from"@donotdev/core";import d from"./OAuthPartnerButton";function f({providers:e,purpose:a,variant:b,layout:s="vertical",showLabels:n=!0,ariaLabel:v,fullWidth:w,onSuccess:i,onError:l,style:p,testID:r}){const c=e||u();return t(m,{direction:s==="horizontal"?"row":"column",gap:12,style:p,testID:r,children:c.map(o=>t(d,{partnerId:o,purpose:a,showLabel:n,onSuccess:i,onError:l,testID:r?`${r}-${o}`:void 0},o))})}var h=f;export{h as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Dialog as i}from"../../../atomic";import{useTranslation as p}from"@donotdev/core";import s from"./MultipleOAuthProviders";function u({open:e,onOpenChange:n,purpose:r,title:a,description:c}){const{t:o}=p("oauth");return t(i,{open:e,onOpenChange:n,title:a||o("connectAccount","Connect Account"),description:c||o("chooseProvider","Choose a provider to connect your account"),children:t(s,{layout:"vertical",showLabels:!0,purpose:r})})}var l=u;export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{View as r}from"react-native";import{Text as l,Button as c}from"../../../atomic";function a({message:s,showConnectButton:n=!1,style:o,testID:t}){return i(r,{style:o,testID:t,children:[e(l,{level:"body",variant:"muted",children:s||"OAuth is not available"}),n&&e(c,{variant:"outline",testID:t?`${t}-connect`:void 0,children:"Connect Account"})]})}var u=a;export{a as OAuthFallback,u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import{Button as h}from"../../../atomic";import"@donotdev/core";import{useOAuth as e}from"@donotdev/oauth";function g({partnerId:i,providerId:s,purpose:I,showLabel:a=!0,children:o,disabled:c,onSuccess:u,onError:d,style:l,testID:p}){const f=e("connect"),t=e("status")==="initializing",r=i||s;return m(h,{variant:"outline",onPress:async()=>{if(r)try{await f(r),u?.()}catch(n){d?.(n instanceof Error?n:new Error(String(n)))}},disabled:c||t,loading:t,style:l,testID:p,children:(()=>{if(o)return o;if(a)return t?`Connecting to ${r}...`:`Connect ${r}`})()})}var y=g;export{y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as a}from"./MultipleOAuthProviders";import{default as t}from"./OAuthConnectionModal";import{OAuthFallback as o}from"./OAuthFallback";import{default as r}from"./OAuthPartnerButton";export{a as MultipleOAuthProviders,t as OAuthConnectionModal,o as OAuthFallback,r as OAuthPartnerButton};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useOAuth as e}from"@donotdev/oauth";export*from"./components";export{e as useOAuth};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getAuth as i,initializeAuth as r,getReactNativePersistence as a}from"firebase/auth";import o from"@react-native-async-storage/async-storage";import{getApp as s}from"firebase/app";function e(){const t=s();try{return i(t)}catch{return r(t,{persistence:a(o)})}}var n=e;export{n as default,e as initializeExpoAuth};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{initializeExpoAuth as i}from"./authPersistence";export{i as initializeExpoAuth};
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
export * from './atomic';
|
|
9
9
|
export * from './utils';
|
|
10
10
|
export * from './crud';
|
|
11
|
-
export * from './features';
|
|
12
11
|
export { AsyncStorageStrategy } from './storage/AsyncStorageStrategy';
|
|
13
12
|
export { zustandAsyncStorage } from './storage/zustandAsyncStorage';
|
|
14
13
|
export { ExpoAppProviders, getZustandAsyncStorage, } from './providers/ExpoAppProviders';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAGH,cAAc,UAAU,CAAC;AAGzB,cAAc,SAAS,CAAC;AAGxB,cAAc,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAGH,cAAc,UAAU,CAAC;AAGzB,cAAc,SAAS,CAAC;AAGxB,cAAc,QAAQ,CAAC;AAOvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGpE,OAAO,EACL,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AAGtC,cAAc,WAAW,CAAC;AAG1B,cAAc,YAAY,CAAC;AAG3B,cAAc,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./atomic";export*from"./utils";export*from"./crud";import{AsyncStorageStrategy as r}from"./storage/AsyncStorageStrategy";import{zustandAsyncStorage as o}from"./storage/zustandAsyncStorage";import{ExpoAppProviders as t,getZustandAsyncStorage as s}from"./providers/ExpoAppProviders";export*from"./routing";export*from"./firebase";export*from"./theme";export{r as AsyncStorageStrategy,t as ExpoAppProviders,s as getZustandAsyncStorage,o as zustandAsyncStorage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{useEffect as l}from"react";import{SafeAreaProvider as m}from"react-native-safe-area-context";import{QueryClient as u,QueryClientProvider as p}from"@tanstack/react-query";import{getStorageManager as f,initializePlatformDetection as c}from"@donotdev/core";import{AsyncStorageStrategy as d}from"../storage/AsyncStorageStrategy";import{zustandAsyncStorage as g}from"../storage/zustandAsyncStorage";import{ThemeProvider as _}from"../theme";let o=null;function y(){return o||(o=new u({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1e3*60*30}}})),o}function a({children:s,userId:e}){return l(()=>{if(typeof globalThis<"u"){const t=globalThis._DNDEV_CONFIG_;globalThis._DNDEV_CONFIG_={...t,platform:"expo",context:"client",mode:__DEV__?"development":"production",version:t?.version||"0.0.0",timestamp:t?.timestamp||Date.now()}}c();const i=f(),n=new d(e||null);return i.setStrategy(n),e&&i.updateUser(e,!1),()=>{n.setUserId(null)}},[e]),r(m,{children:r(_,{children:r(p,{client:y(),children:s})})})}function h(){return g}var v=a;export{a as ExpoAppProviders,v as default,h as getZustandAsyncStorage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{Link as o}from"expo-router";import{TouchableOpacity as t}from"react-native";function c({to:r,children:a,replace:e,...n}){return i(o,{href:r,replace:e,asChild:!0,children:i(t,{...n,children:a})})}function l({to:r}){return null}export{c as Link,l as Navigate};
|
package/dist/routing/hooks.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import type { RedirectGuardOptions, RedirectGuardResult } from '@donotdev/ui';
|
|
|
12
12
|
/**
|
|
13
13
|
* Navigation hook for Expo Router
|
|
14
14
|
*/
|
|
15
|
-
export declare function useNavigate(): (to: string, options?: NavigateOptions) =>
|
|
15
|
+
export declare function useNavigate(): (to: string, options?: NavigateOptions) => void;
|
|
16
16
|
/**
|
|
17
17
|
* Go back hook
|
|
18
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/routing/hooks.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAYH,OAAO,KAAK,EAIV,eAAe,EAChB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/routing/hooks.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAYH,OAAO,KAAK,EAIV,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE9E;;GAEG;AACH,wBAAgB,WAAW,SAKlB,MAAM,YAAY,eAAe,UAiBzC;AAED;;GAEG;AACH,wBAAgB,OAAO,eAGtB;AAED;;GAEG;AACH,wBAAgB,UAAU,eAKzB;AAED;;GAEG;AACH,wBAAgB,WAAW,eAI1B;AAED;;GAEG;AACH,wBAAgB,WAAW;;;;;;EAqB1B;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAEzE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI7D;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,eAAe,CAWjD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAYjD;AAED;;;;GAIG;AACH,wBAAgB,cAAc;;oBAMpB,MAAM,SAAS,MAAM;uBAcrB,MAAM;;EAwBf;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CAoGrB;AAED,iDAAiD;AACjD,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B;AAQD;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,EAAE,CAsBrD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAG3E;AAGD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useCallback as l,useMemo as f}from"react";import{useRouter as d,useLocalSearchParams as p,usePathname as S}from"expo-router";import{useOverlayStore as A,FEATURE_STATUS as x,useNavigationStore as y,USER_ROLES as P}from"@donotdev/core";import{useAuthConfig as w}from"@donotdev/core";import{useAuthSafe as m}from"../utils/useAuthSafe";function v(){const t=d(),e=A(r=>r.closeAll);return l((r,s)=>{if(r==="back"){e(),t.back();return}e(),s?.replace?t.replace(r):t.push(r)},[t,e])}function I(){const t=d();return l(()=>t.back(),[t])}function N(){return l(()=>{},[])}function O(){return l(()=>{},[])}function R(){const t=S(),e=p(),r=new URLSearchParams;return Object.entries(e).forEach(([s,a])=>{Array.isArray(a)?a.forEach(n=>r.append(s,String(n))):r.set(s,String(a))}),{pathname:t||"/",search:r.toString(),hash:"",state:null,key:t||"default"}}function j(){return p()}function Q(t){const r=p()[t];return Array.isArray(r)?r[0]:r}function T(){const t=p(),e=new URLSearchParams;return Object.entries(t).forEach(([r,s])=>{Array.isArray(s)?s.forEach(a=>e.append(r,String(a))):e.set(r,String(s))}),e}function F(t){const e=S();return f(()=>{const s=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/:\w+/g,"[^/]+").replace(/\*/g,".*");return new RegExp("^"+s+"$")},[t]).test(e||"")}function G(){const t=d(),e=T(),r=R(),s=l((c,i)=>{const u=new URLSearchParams(e.toString());u.set(c,i);const h=u.toString(),g=`${r.pathname||"/"}${h?`?${h}`:""}`;t.push(g)},[e,t,r.pathname]),a=l(c=>{const i=new URLSearchParams(e.toString());i.delete(c);const u=i.toString(),o=`${r.pathname||"/"}${u?`?${u}`:""}`;t.push(o)},[e,t,r.pathname]),n=l(()=>{const c=r.pathname||"/";t.push(c)},[t,r.pathname]);return{query:e,setQuery:s,removeQuery:a,clearQueries:n}}function q(t={}){const{auth:e,redirectTo:r,condition:s}=t,a=R(),n=w(),c=m("user"),i=m("can"),u=m("status");return f(()=>{if(u===x.INITIALIZING)return{shouldRedirect:!1,redirectTo:null,isChecking:!0};if(s){const o=s(c,u);return{shouldRedirect:o,redirectTo:o&&r||null,isChecking:!1}}if(e!==!1&&e!==void 0){if(!i)return{shouldRedirect:!1,redirectTo:null,isChecking:!1};if(!i.navigate(e)){let o=null;return typeof e=="object"&&e.required&&!c?a.search.includes("code=")||a.search.includes("state=")||a.search.includes("error=")?o=`${n.authRoute}${a.search}`:o=n.authRoute:typeof e=="object"&&e.role?o=n.roleRoute:typeof e=="object"&&e.tier?o=n.tierRoute:o=n.roleRoute,{shouldRedirect:!0,redirectTo:r||o,isChecking:!1}}}return{shouldRedirect:!1,redirectTo:null,isChecking:!1}},[e,u,c,i,s,r,a.search,n.authRoute,n.roleRoute,n.tierRoute])}function b(t,e){return t==="/"?e==="/":e===t?!0:e.startsWith(t+"/")}function $(){const t=R(),e=m("user"),r=!!e,s=e?.role||P.GUEST,a=y(n=>!n||typeof n.getFilteredRoutes!="function"?[]:n.getFilteredRoutes({authenticated:r,role:s}));return f(()=>Array.isArray(a)?a.map(n=>({...n,isActive:b(n.path,t.pathname),hasChildren:!1,children:void 0})).sort((n,c)=>n.label.localeCompare(c.label)):[],[a,t.pathname])}function M(t){const e=$();return f(()=>e.find(r=>r.path===t),[e,t])}export{I as useBack,R as useLocation,F as useMatch,v as useNavigate,$ as useNavigationItems,M as useNavigationRoute,j as useParams,O as usePrefetch,G as useQueryParams,q as useRedirectGuard,N as useRefresh,Q as useRouteParam,T as useSearchParams};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./hooks";export*from"./components";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Form store safe navigation check
|
|
3
|
-
* @description
|
|
3
|
+
* @description Auto-save is always active — navigation is never blocked.
|
|
4
|
+
* Drafts are persisted to localStorage, so navigating away is safe.
|
|
4
5
|
*
|
|
5
|
-
* @version 0.0.
|
|
6
|
+
* @version 0.0.2
|
|
6
7
|
* @since 0.0.1
|
|
7
8
|
* @author AMBROISE PARK Consulting
|
|
8
9
|
*/
|
|
9
10
|
/**
|
|
10
|
-
* Check if navigation is safe
|
|
11
|
-
*
|
|
12
|
-
* Safe to call even if @donotdev/crud is not installed.
|
|
11
|
+
* Check if navigation is safe.
|
|
12
|
+
* Auto-save is always active — always returns true.
|
|
13
13
|
*/
|
|
14
14
|
export declare function checkFormNavigationSafe(): Promise<boolean>;
|
|
15
15
|
//# sourceMappingURL=useFormStoreSafe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormStoreSafe.d.ts","sourceRoot":"","sources":["../../../src/routing/utils/useFormStoreSafe.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"useFormStoreSafe.d.ts","sourceRoot":"","sources":["../../../src/routing/utils/useFormStoreSafe.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,OAAO,CAAC,CAEhE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function e(){return!0}export{e as checkFormNavigationSafe};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"@react-native-async-storage/async-storage";import{BaseStorageStrategy as y,handleError as l}from"@donotdev/core";class d extends y{userId=null;constructor(t=null){super(),this.userId=t}setUserId(t){this.userId=t}async get(t,r={}){const{scope:s="user",encryption:e=!1}=r,a=this.buildKey(t,s,this.userId,!0);if(!a)return null;let u;try{u=await o.getItem(a)}catch(c){throw l(c,{userMessage:"Failed to read from storage",context:{key:t,options:r}})}if(!u)return null;let n;try{n=JSON.parse(u)}catch{return await o.removeItem(a).catch(()=>{}),null}if(n.expiresAt&&new Date(n.expiresAt)<new Date)return await this.remove(t),null;const i=n.value;if(e)throw new Error("AsyncStorageStrategy: encryption is not yet supported. Data would be stored in plaintext \u2014 refusing to proceed.");return i}async set(t,r,s={}){const{scope:e="user",encryption:a=!1,expiry:u=0}=s,n=this.buildKey(t,e,this.userId,!0);if(n)try{if(a)throw new Error("AsyncStorageStrategy: encryption is not yet supported. Data would be stored in plaintext \u2014 refusing to proceed.");const i=u>0?new Date(Date.now()+u*1e3).toISOString():null,c=JSON.stringify({value:r,expiresAt:i});await o.setItem(n,c)}catch(i){const c=i instanceof Error&&/quota/i.test(i.message)?"Storage quota exceeded. Please free up space or login to sync to cloud.":"Failed to store data in storage";throw l(i,{userMessage:c,context:{key:t,options:s}})}}async remove(t){const r=["user","global","session"];for(const s of r)try{const e=this.buildKey(t,s,this.userId,!0);if(!e)continue;await o.removeItem(e)}catch{}}async clear(t){if(!t){const e=(await o.getAllKeys()).filter(a=>a.startsWith("dndev:"));await o.multiRemove(e);return}const r=t==="user"&&this.userId?`dndev:user:${this.userId}:`:`dndev:${t}:`,s=(await o.getAllKeys()).filter(e=>e.startsWith(r));await o.multiRemove(s)}}var p=d;export{d as AsyncStorageStrategy,p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a from"@react-native-async-storage/async-storage";const e={getItem:async t=>{try{return await a.getItem(t)}catch{return __DEV__,null}},setItem:async(t,r)=>{try{await a.setItem(t,r)}catch(_){throw __DEV__,_}},removeItem:async t=>{try{await a.removeItem(t)}catch{__DEV__}}};var c=e;export{c as default,e as zustandAsyncStorage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as d}from"react/jsx-runtime";import{createContext as l,useContext as f,useState as T}from"react";import{useColorScheme as p}from"react-native";import{lightTheme as v,darkTheme as x}from"./tokens";const t=l(void 0);function C({children:e,initialTheme:m="auto",followSystem:a=!0}){const i=p(),[o,n]=T(m),r=o==="dark"||o==="auto"&&a&&i==="dark",h=r?x:v,u=c=>{n(c)};return d(t.Provider,{value:{theme:h,isDark:r,setTheme:u,themeMode:o},children:e})}function s(){const e=f(t);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function k(){const{theme:e}=s();return e.colors}export{C as ThemeProvider,s as useTheme,k as useThemeColors};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./tokens";export*from"./ThemeProvider";import{useTheme as e,useThemeColors as o}from"./ThemeProvider";export{e as useTheme,o as useThemeColors};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r={none:0,sm:8,md:16,lg:32},f={none:0,md:12,full:9999,interactive:0,surface:12,floating:0},o={fontSize:{xs:12,sm:14,base:16,lg:20,xl:25,"2xl":31,"3xl":39},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{base:1.25}},e={touchTarget:48,iconMd:24,iconTouch:32},d={header:100,sidebar:90,footer:1,overlay:40,breadcrumbs:10,dropdown:50,modal:1e3,tooltip:1100,toast:1200},a={subtle:.3,muted:.6,strong:.9},n={fast:150,normal:300,slow:500,heavy:700,hero:1e3},t={background:"#ffffff",foreground:"#000000",textColor:"#000000",primary:"#00bcd4",primaryForeground:"#000000",secondary:"#047857",secondaryForeground:"#ffffff",accent:"#ff9800",accentForeground:"#000000",destructive:"#dc2626",destructiveForeground:"#ffffff",success:"#047857",successForeground:"#ffffff",warning:"#f59e0b",warningForeground:"#000000",muted:"#f3f4f6",mutedForeground:"#4b5563",border:"#e5e7eb",input:"#f3f4f6",ring:"#00bcd4",card:"#ffffff",cardForeground:"#000000",popover:"#ffffff",popoverForeground:"#000000"},s={background:"#000000",foreground:"#ffffff",textColor:"#ffffff",primary:"#00bcd4",primaryForeground:"#000000",secondary:"#10b981",secondaryForeground:"#ffffff",accent:"#ff9800",accentForeground:"#ffffff",destructive:"#ef4444",destructiveForeground:"#ffffff",success:"#10b981",successForeground:"#ffffff",warning:"#f59e0b",warningForeground:"#000000",muted:"#1f2937",mutedForeground:"#d1d5db",border:"#374151",input:"#1f2937",ring:"#00bcd4",card:"#111827",cardForeground:"#ffffff",popover:"#111827",popoverForeground:"#ffffff"},c={colors:t,spacing:r,radius:f,typography:o,interactive:e,zIndex:d,opacity:a,duration:n},u={colors:s,spacing:r,radius:f,typography:o,interactive:e,zIndex:d,opacity:a,duration:n},i=c;export{s as colorsDark,t as colorsLight,u as darkTheme,i as defaultTheme,n as duration,e as interactive,c as lightTheme,a as opacity,f as radius,r as spacing,o as typography,d as zIndex};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const A={DEFAULT:"default",MUTED:"muted",PRIMARY:"primary",SECONDARY:"secondary",ACCENT:"accent",SUCCESS:"success",WARNING:"warning",DESTRUCTIVE:"destructive"},T={...A,OUTLINE:"outline",GLASS:"glass"},s=T,E=A;export{E as CONTROL_VARIANT,s as FLOATING_VARIANT,T as SURFACE_VARIANT,A as THEME_VARIANT};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(...a){return Object.assign({},...a.filter(Boolean))}function e(a){const n={};return a.variant!=null&&(n["data-variant"]=a.variant),a.size!=null&&(n["data-size"]=a.size),n}export{e as getVariantDataAttrs,t as mergeStyles};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./helpers";export*from"./constants";export*from"./variants";import{useAuthSafe as a,isAuthAvailable as e}from"./useAuthSafe";export{e as isAuthAvailable,a as useAuthSafe};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function c(r,e){const o={default:"foreground",primary:"primary",secondary:"secondary",accent:"accent",success:"success",warning:"warning",destructive:"destructive",muted:"muted"};return r.colors[o[e]||"foreground"]}function s(r,e){const o={default:"foreground",primary:"primaryForeground",secondary:"secondaryForeground",accent:"accentForeground",success:"successForeground",warning:"warningForeground",destructive:"destructiveForeground",muted:"mutedForeground"};return r.colors[o[e]||"foreground"]}function u(r){const e=r.colors.background;if(e.startsWith("#")){const o=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),t=parseInt(e.slice(5,7),16);return`rgba(${o}, ${n}, ${t}, 0.5)`}return e}function a(r){return r.colors.foreground}function d(r){return r.opacity.subtle}export{u as getOverlayBackground,a as getShadowColor,d as getShadowOpacity,c as getVariantColor,s as getVariantForegroundColor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DEGRADED_AUTH_API as s}from"@donotdev/core";import*as e from"@donotdev/auth";const t=e?.useAuth;function n(o){return s[o]}const r=t??n,u=typeof t=="function";export{u as isAuthAvailable,r as useAuthSafe};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"react-native";import"./constants";function c(o){const{colors:r,radius:n}=o;return{default:{backgroundColor:r.muted},primary:{backgroundColor:r.primary},secondary:{backgroundColor:r.secondary},accent:{backgroundColor:r.accent},success:{backgroundColor:r.success},warning:{backgroundColor:r.warning},destructive:{backgroundColor:r.destructive},muted:{backgroundColor:r.muted},ghost:{backgroundColor:"transparent"},outline:{backgroundColor:"transparent",borderWidth:1,borderColor:r.border},link:{backgroundColor:"transparent"}}}function e(o){const{colors:r}=o;return{default:{color:r.foreground},primary:{color:r.primaryForeground},secondary:{color:r.secondaryForeground},accent:{color:r.accentForeground},success:{color:r.successForeground},warning:{color:r.warningForeground},destructive:{color:r.destructiveForeground},muted:{color:r.mutedForeground},ghost:{color:r.foreground},outline:{color:r.foreground},link:{color:r.primary,textDecorationLine:"underline"}}}function a(o){const{colors:r,radius:n}=o;return{default:{backgroundColor:r.card},primary:{backgroundColor:r.primary+"1A"},secondary:{backgroundColor:r.secondary+"1A"},accent:{backgroundColor:r.accent+"1A"},success:{backgroundColor:r.success+"1A"},warning:{backgroundColor:r.warning+"1A"},destructive:{backgroundColor:r.destructive+"1A"},muted:{backgroundColor:r.muted},outline:{backgroundColor:"transparent",borderWidth:1,borderColor:r.border},glass:{backgroundColor:r.card+"CC"}}}export{e as getButtonTextVariants,c as getButtonVariants,a as getSurfaceVariants};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@donotdev/expo",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "React Native/Expo UI components for DoNotDev framework",
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.js",
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./features": {
|
|
15
|
+
"types": "./dist/features/index.d.ts",
|
|
16
|
+
"import": "./dist/features/index.js",
|
|
17
|
+
"default": "./dist/features/index.js"
|
|
13
18
|
}
|
|
14
19
|
},
|
|
15
20
|
"files": [
|
|
@@ -40,14 +45,14 @@
|
|
|
40
45
|
"scripts": {
|
|
41
46
|
"dev": "tsc --noEmit --watch --listFiles false --listEmittedFiles false",
|
|
42
47
|
"clean": "rimraf dist tsconfig.tsbuildinfo",
|
|
43
|
-
"type-check": "tsc --noEmit",
|
|
48
|
+
"type-check": "bunx tsc --noEmit",
|
|
44
49
|
"test": "jest --forceExit",
|
|
45
50
|
"test:watch": "jest --watch",
|
|
46
51
|
"test:coverage": "jest --coverage"
|
|
47
52
|
},
|
|
48
53
|
"dependencies": {
|
|
49
|
-
"@donotdev/core": "^0.0.
|
|
50
|
-
"@donotdev/crud": "^0.0.
|
|
54
|
+
"@donotdev/core": "^0.0.25",
|
|
55
|
+
"@donotdev/crud": "^0.0.16",
|
|
51
56
|
"@expo/vector-icons": "^15.0.0",
|
|
52
57
|
"@hookform/resolvers": "^5.2.2",
|
|
53
58
|
"@react-native-async-storage/async-storage": "^2.1.0",
|
|
@@ -61,12 +66,15 @@
|
|
|
61
66
|
"react-native-safe-area-context": "^5.0.0"
|
|
62
67
|
},
|
|
63
68
|
"peerDependencies": {
|
|
64
|
-
"@donotdev/auth": "^0.0.
|
|
65
|
-
"@donotdev/billing": "^0.0.
|
|
66
|
-
"@donotdev/oauth": "^0.0.
|
|
67
|
-
"@donotdev/ui": "^0.0.
|
|
69
|
+
"@donotdev/auth": "^0.0.9",
|
|
70
|
+
"@donotdev/billing": "^0.0.8",
|
|
71
|
+
"@donotdev/oauth": "^0.0.8",
|
|
72
|
+
"@donotdev/ui": "^0.0.15",
|
|
73
|
+
"@tanstack/react-query": "^5.0.0",
|
|
74
|
+
"firebase": "^11.0.0",
|
|
68
75
|
"react": "^19.2.4",
|
|
69
|
-
"react-native": "^0.84.0"
|
|
76
|
+
"react-native": "^0.84.0",
|
|
77
|
+
"zustand": "^5.0.0"
|
|
70
78
|
},
|
|
71
79
|
"peerDependenciesMeta": {
|
|
72
80
|
"@donotdev/auth": {
|
|
@@ -80,6 +88,9 @@
|
|
|
80
88
|
},
|
|
81
89
|
"@donotdev/ui": {
|
|
82
90
|
"optional": true
|
|
91
|
+
},
|
|
92
|
+
"firebase": {
|
|
93
|
+
"optional": true
|
|
83
94
|
}
|
|
84
95
|
}
|
|
85
96
|
}
|