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

@contentful/f36-utils

Package Overview
Dependencies
Maintainers
105
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-9225.2415 to 4.0.1-next-v4-9248.2416

2

dist/main.js

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

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:i,cx:l}=require("emotion");function s(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(i({name:"t8ljbi",styles:"display:inherit;outline:0;"}),e)},n),t)}s(f,"Portal",(()=>p)),s(f,"TabFocusTrap",(()=>y)),s(f,"useArrowKeyNavigation",(()=>b)),s(f,"useKeyboard",(()=>v));const m={vertical:{prev:"ArrowUp",next:"ArrowDown"},horizontal:{prev:"ArrowLeft",next:"ArrowRight"}},b=({itemsContainerRef:e,itemsSelector:r,keyType:t="vertical",initialFocusedIndex:n=0})=>{const[u,a]=o(n),i=c((n=>{const o=e.current;if(!o)return;const c=o.querySelectorAll(r);if(0===c.length)return;const i=c.length-1,l={[m[t].next]:()=>{a(u===i?0:u+1)},[m[t].prev]:()=>{a(0===u?i:u-1)}}[n.key];l&&(n.preventDefault(),l())}),[u,r,e,t]);return{focusedIndex:u,handleArrowsKeyDown:i}},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]}})}));
var e=require("react"),r=d(e),{useRef:t,useEffect:n,useCallback:o,useState:c}=e,{createPortal:u}=require("react-dom"),a=d(require("@babel/runtime/helpers/extends")),{cx:i,css:l}=require("emotion");function s(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:i(l({name:"t8ljbi",styles:"display:inherit;outline:0;"}),e)},n),t)}s(f,"Portal",(()=>p)),s(f,"TabFocusTrap",(()=>y)),s(f,"useArrowKeyNavigation",(()=>b)),s(f,"useKeyboard",(()=>v));const m={vertical:{prev:"ArrowUp",next:"ArrowDown"},horizontal:{prev:"ArrowLeft",next:"ArrowRight"}},b=({itemsContainerRef:e,itemsSelector:r,keyType:t="vertical",initialFocusedIndex:n=0})=>{const[u,a]=c(n),i=o((n=>{const o=e.current;if(!o)return;const c=o.querySelectorAll(r);if(0===c.length)return;const i=c.length-1,l={[m[t].next]:()=>{a(u===i?0:u+1)},[m[t].prev]:()=>{a(0===u?i:u-1)}}[n.key];l&&(n.preventDefault(),l())}),[u,r,e,t]);return{focusedIndex:u,handleArrowsKeyDown:i}},v=e=>{const{ref:r,keys:t,event:c="keydown"}=e;let u=document;const a=o((e=>{Object.prototype.hasOwnProperty.call(t,e.key)&&t[e.key](e)}),[t]);n((()=>(r&&r.current&&(u=r.current),u.addEventListener(c,a),()=>{u.removeEventListener(c,a)})),[c,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,{useEffect as r,useRef 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{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=t(n),s=t(document.createElement("div"));return r((()=>{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",initialFocusedIndex:a=0})=>{const[s,c]=n(a),u=o((n=>{const o=e.current;if(!o)return;const a=o.querySelectorAll(r);if(0===a.length)return;const u=a.length-1,i={[p[t].next]:()=>{c(s===u?0:s+1)},[p[t].prev]:()=>{c(0===s?u:s-1)}}[n.key];i&&(n.preventDefault(),i())}),[s,r,e,t]);return{focusedIndex:s,handleArrowsKeyDown:u}},y=e=>{const{ref:t,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]);r((()=>(t&&t.current&&(s=t.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,useCallback as n,useState 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",initialFocusedIndex:a=0})=>{const[s,c]=o(a),u=n((n=>{const o=e.current;if(!o)return;const a=o.querySelectorAll(r);if(0===a.length)return;const u=a.length-1,i={[p[t].next]:()=>{c(s===u?0:s+1)},[p[t].prev]:()=>{c(0===s?u:s-1)}}[n.key];i&&(n.preventDefault(),i())}),[s,r,e,t]);return{focusedIndex:s,handleArrowsKeyDown:u}},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};
//# sourceMappingURL=module.js.map
{
"name": "@contentful/f36-utils",
"version": "4.0.1-next-v4-9225.2415+af2aee94",
"version": "4.0.1-next-v4-9248.2416+a72d2c90",
"description": "Forma 36: utils React Component",

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

},
"gitHead": "af2aee943c25112c4a2439c2da792f37ecff291b"
"gitHead": "a72d2c90eb3c8b217a0e538970415f5a42a00cb4"
}
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