@uniformdev/context-remix
Advanced tools
Comparing version 16.0.0 to 16.0.1-alpha.128
@@ -20,3 +20,3 @@ import { CookieTransitionDataStoreOptions, CookieTransitionDataStore, Context } from '@uniformdev/context'; | ||
*/ | ||
declare const RemixUniformContext: React__default.FC<Omit<UniformContextProps, 'trackRouteOnRender' | 'context'>>; | ||
declare const RemixUniformContext: React__default.FC<React__default.PropsWithChildren<Omit<UniformContextProps, 'trackRouteOnRender' | 'context'>>>; | ||
@@ -23,0 +23,0 @@ /** |
@@ -1,1 +0,1 @@ | ||
import{parse as x}from"cookie";import{CookieTransitionDataStore as p,UNIFORM_DEFAULT_COOKIE_NAME as d}from"@uniformdev/context";var c=class extends p{constructor({request:r,...o}){var e,n;super({...o,serverCookieValue:r?x((e=r.headers.get("cookie"))!=null?e:"")[(n=o.cookieName)!=null?n:d]:void 0})}};import{UniformContext as C}from"@uniformdev/context-react";import{useLocation as R}from"@remix-run/react";import{parse as l}from"cookie";import U from"react";import{useEffect as k}from"react";import*as i from"react";var f=i.createContext(null),D=f.Provider;function u(){let t=i.useContext(f);if(t===null)throw new Error("useRemixUniformProvider must be used within a RemixUniformProvider");return t}var _=({children:t,...r})=>{let o=u(),e=R();return k(()=>{var a;if(typeof document=="undefined")return;let n=new URL(`${document.location.protocol}//${document.location.host}${e.pathname}${e.search}`);o.update({url:n,cookies:l((a=document.cookie)!=null?a:"")})},[e,o]),U.createElement(C,{...r,context:o,trackRouteOnRender:!1},t)};export{c as RemixCookieTransitionDataStore,_ as RemixUniformContext,D as RemixUniformContextProvider,u as useRemixUniformProvider}; | ||
import{parse as f}from"cookie";import{CookieTransitionDataStore as p,UNIFORM_DEFAULT_COOKIE_NAME as u}from"@uniformdev/context";var s=class extends p{constructor({request:r,...o}){var e,n;super({...o,serverCookieValue:r?f((e=r.headers.get("cookie"))!=null?e:"")[(n=o.cookieName)!=null?n:u]:void 0})}};import{UniformContext as x}from"@uniformdev/context-react";import{useLocation as d}from"@remix-run/react";import{parse as C}from"cookie";import R from"react";import{useEffect as l}from"react";import*as i from"react";var a=i.createContext(null),v=a.Provider;function c(){let t=i.useContext(a);if(t===null)throw new Error("useRemixUniformProvider must be used within a RemixUniformProvider");return t}var L=({children:t,...r})=>{let o=c(),e=d();return l(()=>{var m;if(typeof document=="undefined")return;let n=new URL(`${document.location.protocol}//${document.location.host}${e.pathname}${e.search}`);o.update({url:n,cookies:C((m=document.cookie)!=null?m:"")})},[e,o]),R.createElement(x,{...r,context:o,trackRouteOnRender:!1},t)};export{s as RemixCookieTransitionDataStore,L as RemixUniformContext,v as RemixUniformContextProvider,c as useRemixUniformProvider}; |
@@ -1,1 +0,1 @@ | ||
var v=Object.create;var i=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var T=(o,e)=>{for(var t in e)i(o,t,{get:e[t],enumerable:!0})},x=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of h(e))!E.call(o,r)&&r!==t&&i(o,r,{get:()=>e[r],enumerable:!(n=P(e,r))||n.enumerable});return o};var p=(o,e,t)=>(t=o!=null?v(D(o)):{},x(e||!o||!o.__esModule?i(t,"default",{value:o,enumerable:!0}):t,o)),w=o=>x(i({},"__esModule",{value:!0}),o);var F={};T(F,{RemixCookieTransitionDataStore:()=>a,RemixUniformContext:()=>$,RemixUniformContextProvider:()=>S,useRemixUniformProvider:()=>f});module.exports=w(F);var d=require("cookie"),m=require("@uniformdev/context"),a=class extends m.CookieTransitionDataStore{constructor({request:e,...t}){var n,r;super({...t,serverCookieValue:e?(0,d.parse)((n=e.headers.get("cookie"))!=null?n:"")[(r=t.cookieName)!=null?r:m.UNIFORM_DEFAULT_COOKIE_NAME]:void 0})}};var R=require("@uniformdev/context-react"),l=require("@remix-run/react"),U=require("cookie"),k=p(require("react")),O=require("react");var s=p(require("react")),C=s.createContext(null),S=C.Provider;function f(){let o=s.useContext(C);if(o===null)throw new Error("useRemixUniformProvider must be used within a RemixUniformProvider");return o}var $=({children:o,...e})=>{let t=f(),n=(0,l.useLocation)();return(0,O.useEffect)(()=>{var u;if(typeof document=="undefined")return;let r=new URL(`${document.location.protocol}//${document.location.host}${n.pathname}${n.search}`);t.update({url:r,cookies:(0,U.parse)((u=document.cookie)!=null?u:"")})},[n,t]),k.default.createElement(R.UniformContext,{...e,context:t,trackRouteOnRender:!1},o)};0&&(module.exports={RemixCookieTransitionDataStore,RemixUniformContext,RemixUniformContextProvider,useRemixUniformProvider}); | ||
var O=Object.create;var i=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var E=(o,e)=>{for(var t in e)i(o,t,{get:e[t],enumerable:!0})},p=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of v(e))!D.call(o,r)&&r!==t&&i(o,r,{get:()=>e[r],enumerable:!(n=P(e,r))||n.enumerable});return o};var u=(o,e,t)=>(t=o!=null?O(h(o)):{},p(e||!o||!o.__esModule?i(t,"default",{value:o,enumerable:!0}):t,o)),T=o=>p(i({},"__esModule",{value:!0}),o);var $={};E($,{RemixCookieTransitionDataStore:()=>a,RemixUniformContext:()=>S,RemixUniformContextProvider:()=>w,useRemixUniformProvider:()=>c});module.exports=T($);var x=require("cookie"),m=require("@uniformdev/context"),a=class extends m.CookieTransitionDataStore{constructor({request:e,...t}){var n,r;super({...t,serverCookieValue:e?(0,x.parse)((n=e.headers.get("cookie"))!=null?n:"")[(r=t.cookieName)!=null?r:m.UNIFORM_DEFAULT_COOKIE_NAME]:void 0})}};var C=require("@uniformdev/context-react"),R=require("@remix-run/react"),l=require("cookie"),U=u(require("react")),k=require("react");var s=u(require("react")),d=s.createContext(null),w=d.Provider;function c(){let o=s.useContext(d);if(o===null)throw new Error("useRemixUniformProvider must be used within a RemixUniformProvider");return o}var S=({children:o,...e})=>{let t=c(),n=(0,R.useLocation)();return(0,k.useEffect)(()=>{var f;if(typeof document=="undefined")return;let r=new URL(`${document.location.protocol}//${document.location.host}${n.pathname}${n.search}`);t.update({url:r,cookies:(0,l.parse)((f=document.cookie)!=null?f:"")})},[n,t]),U.default.createElement(C.UniformContext,{...e,context:t,trackRouteOnRender:!1},o)};0&&(module.exports={RemixCookieTransitionDataStore,RemixUniformContext,RemixUniformContextProvider,useRemixUniformProvider}); |
{ | ||
"name": "@uniformdev/context-remix", | ||
"version": "16.0.0", | ||
"version": "16.0.1-alpha.128+6cdb4ff33", | ||
"description": "Uniform Context Remix integration package", | ||
@@ -26,11 +26,11 @@ "license": "SEE LICENSE IN LICENSE.txt", | ||
"devDependencies": { | ||
"@remix-run/react": "1.4.1", | ||
"@types/cookie": "0.5.0", | ||
"@types/react": "17.0.44", | ||
"react": "17.0.2", | ||
"react-dom": "17.0.2" | ||
"@remix-run/react": "1.5.1", | ||
"@types/cookie": "0.5.1", | ||
"@types/react": "18.0.12", | ||
"react": "18.1.0", | ||
"react-dom": "18.1.0" | ||
}, | ||
"dependencies": { | ||
"@uniformdev/context": "^16.0.0", | ||
"@uniformdev/context-react": "^16.0.0", | ||
"@uniformdev/context": "^16.0.1-alpha.128+6cdb4ff33", | ||
"@uniformdev/context-react": "^16.0.1-alpha.128+6cdb4ff33", | ||
"cookie": "0.5.0" | ||
@@ -49,3 +49,3 @@ }, | ||
}, | ||
"gitHead": "72f1d98e96004c4ebf4bea49bf27aa4ecc036e33" | ||
"gitHead": "6cdb4ff331d6d0d9d5c154b7b342e7703067bfc3" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7224
3
1