Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contentful/f36-utils

Package Overview
Dependencies
Maintainers
106
Versions
282
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/f36-utils - npm Package Compare versions

Comparing version 4.0.1-next-v4-9468.2425 to 4.0.1-next-v4-9473.2426

2

dist/main.js

@@ -1,2 +0,2 @@

var e=require("react"),r=d(e),{useEffect:t,useRef:n,useState:o,useCallback:c}=e,{createPortal:u}=require("react-dom"),a=d(require("@babel/runtime/helpers/extends")),{css:s,cx:l}=require("emotion");function i(e,r,t,n){Object.defineProperty(e,r,{get:t,set:n,enumerable:!0,configurable:!0})}function d(e){return e&&e.__esModule?e.default:e}var f={};function p({children:e,container:r}){const o=n(r),c=n(document.createElement("div"));return t((()=>{o.current||(o.current=document.body);const e=c.current;return e.setAttribute("data-cf-ui-portal",""),o.current.appendChild(e),()=>{o.current&&o.current.removeChild(e)}}),[]),c.current?u(e,c.current):null}function y({className:e,children:t,...n}){return r.createElement("span",a({tabIndex:-1,className:l(s({name:"t8ljbi",styles:"display:inherit;outline:0;"}),e)},n),t)}i(f,"Portal",(()=>p)),i(f,"TabFocusTrap",(()=>y)),i(f,"useArrowKeyNavigation",(()=>b)),i(f,"useKeyboard",(()=>v));const m={vertical:{prev:"ArrowUp",next:"ArrowDown"},horizontal:{prev:"ArrowLeft",next:"ArrowRight"}},b=({itemsContainerRef:e,itemsSelector:r,keyType:t="vertical"})=>{const[n,u]=o(0),a=c((o=>{const c=e.current;if(!c)return;const a=c.querySelectorAll(r);if(0===a.length)return;const s=a.length-1,l={[m[t].next]:()=>{u(n===s?0:n+1)},[m[t].prev]:()=>{u(0===n?s:n-1)}}[o.key];l&&(o.preventDefault(),l())}),[n,r,e,t]);return{focusedIndex:n,handleArrowsKeyDown:a,setFocusedIndex:u}},v=e=>{const{ref:r,keys:n,event:o="keydown"}=e;let u=document;const a=c((e=>{Object.prototype.hasOwnProperty.call(n,e.key)&&n[e.key](e)}),[n]);t((()=>(r&&r.current&&(u=r.current),u.addEventListener(o,a),()=>{u.removeEventListener(o,a)})),[o,a])};var h,w;h=module.exports,w=f,Object.keys(w).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(h,e,{enumerable:!0,get:function(){return w[e]}})}));
var e=require("react"),r=d(e),{useRef:t,useEffect:n,useState:o,useCallback:c}=e,{createPortal:u}=require("react-dom"),a=d(require("@babel/runtime/helpers/extends")),{css:s,cx:l}=require("emotion");function i(e,r,t,n){Object.defineProperty(e,r,{get:t,set:n,enumerable:!0,configurable:!0})}function d(e){return e&&e.__esModule?e.default:e}var f={};function p({children:e,container:r}){const o=t(r),c=t(document.createElement("div"));return n((()=>{o.current||(o.current=document.body);const e=c.current;return e.setAttribute("data-cf-ui-portal",""),o.current.appendChild(e),()=>{o.current&&o.current.removeChild(e)}}),[]),c.current?u(e,c.current):null}function y({className:e,children:t,...n}){return r.createElement("span",a({tabIndex:-1,className:l(s({name:"t8ljbi",styles:"display:inherit;outline:0;"}),e)},n),t)}i(f,"Portal",(()=>p)),i(f,"TabFocusTrap",(()=>y)),i(f,"useArrowKeyNavigation",(()=>b)),i(f,"useKeyboard",(()=>v));const m={vertical:{prev:"ArrowUp",next:"ArrowDown"},horizontal:{prev:"ArrowLeft",next:"ArrowRight"}},b=({itemsContainerRef:e,itemsSelector:r,keyType:t="vertical"})=>{const[n,u]=o(0),a=c((o=>{const c=e.current;if(!c)return;const a=c.querySelectorAll(r);if(0===a.length)return;const s=a.length-1,l={[m[t].next]:()=>{u(n===s?0:n+1)},[m[t].prev]:()=>{u(0===n?s:n-1)}}[o.key];l&&(o.preventDefault(),l())}),[n,r,e,t]);return{focusedIndex:n,handleArrowsKeyDown:a,setFocusedIndex:u}},v=e=>{const{ref:r,keys:t,event:o="keydown"}=e;let u=document;const a=c((e=>{Object.prototype.hasOwnProperty.call(t,e.key)&&t[e.key](e)}),[t]);n((()=>(r&&r.current&&(u=r.current),u.addEventListener(o,a),()=>{u.removeEventListener(o,a)})),[o,a])};var h,w;h=module.exports,w=f,Object.keys(w).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(h,e,{enumerable:!0,get:function(){return w[e]}})}));
//# sourceMappingURL=main.js.map

@@ -1,2 +0,2 @@

import e,{useRef as r,useEffect as t,useCallback as n,useState as o}from"react";import{createPortal as a}from"react-dom";import s from"@babel/runtime/helpers/esm/extends";import{css as c,cx as u}from"emotion";function i(e,r,t,n){Object.defineProperty(e,r,{get:t,set:n,enumerable:!0,configurable:!0})}var l={};function d({children:e,container:n}){const o=r(n),s=r(document.createElement("div"));return t((()=>{o.current||(o.current=document.body);const e=s.current;return e.setAttribute("data-cf-ui-portal",""),o.current.appendChild(e),()=>{o.current&&o.current.removeChild(e)}}),[]),s.current?a(e,s.current):null}function m({className:r,children:t,...n}){return e.createElement("span",s({tabIndex:-1,className:u(c({name:"t8ljbi",styles:"display:inherit;outline:0;"}),r)},n),t)}i(l,"Portal",(()=>d)),i(l,"TabFocusTrap",(()=>m)),i(l,"useArrowKeyNavigation",(()=>f)),i(l,"useKeyboard",(()=>y));const p={vertical:{prev:"ArrowUp",next:"ArrowDown"},horizontal:{prev:"ArrowLeft",next:"ArrowRight"}},f=({itemsContainerRef:e,itemsSelector:r,keyType:t="vertical"})=>{const[a,s]=o(0),c=n((n=>{const o=e.current;if(!o)return;const c=o.querySelectorAll(r);if(0===c.length)return;const u=c.length-1,i={[p[t].next]:()=>{s(a===u?0:a+1)},[p[t].prev]:()=>{s(0===a?u:a-1)}}[n.key];i&&(n.preventDefault(),i())}),[a,r,e,t]);return{focusedIndex:a,handleArrowsKeyDown:c,setFocusedIndex:s}},y=e=>{const{ref:r,keys:o,event:a="keydown"}=e;let s=document;const c=n((e=>{Object.prototype.hasOwnProperty.call(o,e.key)&&o[e.key](e)}),[o]);t((()=>(r&&r.current&&(s=r.current),s.addEventListener(a,c),()=>{s.removeEventListener(a,c)})),[a,c])};export{d as Portal,m as TabFocusTrap,f as useArrowKeyNavigation,y as useKeyboard};
import e,{useRef as r,useEffect as t,useState as n,useCallback as o}from"react";import{createPortal as a}from"react-dom";import s from"@babel/runtime/helpers/esm/extends";import{cx as c,css as u}from"emotion";function i(e,r,t,n){Object.defineProperty(e,r,{get:t,set:n,enumerable:!0,configurable:!0})}var l={};function d({children:e,container:n}){const o=r(n),s=r(document.createElement("div"));return t((()=>{o.current||(o.current=document.body);const e=s.current;return e.setAttribute("data-cf-ui-portal",""),o.current.appendChild(e),()=>{o.current&&o.current.removeChild(e)}}),[]),s.current?a(e,s.current):null}function m({className:r,children:t,...n}){return e.createElement("span",s({tabIndex:-1,className:c(u({name:"t8ljbi",styles:"display:inherit;outline:0;"}),r)},n),t)}i(l,"Portal",(()=>d)),i(l,"TabFocusTrap",(()=>m)),i(l,"useArrowKeyNavigation",(()=>f)),i(l,"useKeyboard",(()=>y));const p={vertical:{prev:"ArrowUp",next:"ArrowDown"},horizontal:{prev:"ArrowLeft",next:"ArrowRight"}},f=({itemsContainerRef:e,itemsSelector:r,keyType:t="vertical"})=>{const[a,s]=n(0),c=o((n=>{const o=e.current;if(!o)return;const c=o.querySelectorAll(r);if(0===c.length)return;const u=c.length-1,i={[p[t].next]:()=>{s(a===u?0:a+1)},[p[t].prev]:()=>{s(0===a?u:a-1)}}[n.key];i&&(n.preventDefault(),i())}),[a,r,e,t]);return{focusedIndex:a,handleArrowsKeyDown:c,setFocusedIndex:s}},y=e=>{const{ref:r,keys:n,event:a="keydown"}=e;let s=document;const c=o((e=>{Object.prototype.hasOwnProperty.call(n,e.key)&&n[e.key](e)}),[n]);t((()=>(r&&r.current&&(s=r.current),s.addEventListener(a,c),()=>{s.removeEventListener(a,c)})),[a,c])};export{d as Portal,m as TabFocusTrap,f as useArrowKeyNavigation,y as useKeyboard};
//# sourceMappingURL=module.js.map
{
"name": "@contentful/f36-utils",
"version": "4.0.1-next-v4-9468.2425+39bfca25",
"version": "4.0.1-next-v4-9473.2426+52a7aa67",
"description": "Forma 36: utils React Component",

@@ -34,3 +34,3 @@ "license": "MIT",

},
"gitHead": "39bfca25341f1521c81391e651fe3bec3368e126"
"gitHead": "52a7aa67ed9211cb4016eb8b3fc16de06adf305c"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc