@contentful/f36-utils
Advanced tools
Comparing version 4.14.0 to 4.15.0
# @contentful/f36-utils | ||
## 4.15.0 | ||
## 4.14.0 | ||
@@ -4,0 +6,0 @@ |
@@ -14,8 +14,8 @@ var $jeJr1$react = require("react"); | ||
function $b2f7c328a8bc89c1$export$602eac185826482c({ children: children , container: containerElement }) { | ||
const container = $jeJr1$react.useRef(containerElement); | ||
const portal = $jeJr1$react.useRef(document.createElement('div')); | ||
$jeJr1$react.useEffect(()=>{ | ||
const container = (0, $jeJr1$react.useRef)(containerElement); | ||
const portal = (0, $jeJr1$react.useRef)(document.createElement("div")); | ||
(0, $jeJr1$react.useEffect)(()=>{ | ||
if (!container.current) container.current = document.body; | ||
const portalContainer = portal.current; | ||
portalContainer.setAttribute('data-cf-ui-portal', ''); | ||
portalContainer.setAttribute("data-cf-ui-portal", ""); | ||
container.current.appendChild(portalContainer); | ||
@@ -26,3 +26,3 @@ return ()=>{ | ||
}, []); | ||
return portal.current ? /*#__PURE__*/ $jeJr1$reactdom.createPortal(children, portal.current) : null; | ||
return portal.current ? /*#__PURE__*/ (0, $jeJr1$reactdom.createPortal)(children, portal.current) : null; | ||
} | ||
@@ -33,5 +33,5 @@ | ||
const $7d270255de91b51a$export$8f71654801c2f7cd = (props)=>{ | ||
const { ref: ref , keys: keys , event: event = 'keydown' } = props; | ||
const { ref: ref , keys: keys , event: event = "keydown" } = props; | ||
let element = document; | ||
const handleKeyEvent = $jeJr1$react.useCallback((e)=>{ | ||
const handleKeyEvent = (0, $jeJr1$react.useCallback)((e)=>{ | ||
const isKey = Object.prototype.hasOwnProperty.call(keys, e.key); | ||
@@ -42,3 +42,3 @@ if (isKey) keys[e.key](e); | ||
]); | ||
$jeJr1$react.useEffect(()=>{ | ||
(0, $jeJr1$react.useEffect)(()=>{ | ||
if (ref && ref.current) element = ref.current; | ||
@@ -58,7 +58,7 @@ element.addEventListener(event, handleKeyEvent); | ||
const matchResult = { | ||
before: '', | ||
match: '', | ||
after: '' | ||
before: "", | ||
match: "", | ||
after: "" | ||
}; | ||
const regex = new RegExp(`(?<before>.*?)(?<match>${match})(?<after>.*)`, 'i'); | ||
const regex = new RegExp(`(?<before>.*?)(?<match>${match})(?<after>.*)`, "i"); | ||
const matches = base.match(regex); | ||
@@ -65,0 +65,0 @@ if (matches) { |
@@ -7,8 +7,8 @@ import {useRef as $6KSAN$useRef, useEffect as $6KSAN$useEffect, useCallback as $6KSAN$useCallback} from "react"; | ||
function $ff31c9f35937f52f$export$602eac185826482c({ children: children , container: containerElement }) { | ||
const container = $6KSAN$useRef(containerElement); | ||
const portal = $6KSAN$useRef(document.createElement('div')); | ||
$6KSAN$useEffect(()=>{ | ||
const container = (0, $6KSAN$useRef)(containerElement); | ||
const portal = (0, $6KSAN$useRef)(document.createElement("div")); | ||
(0, $6KSAN$useEffect)(()=>{ | ||
if (!container.current) container.current = document.body; | ||
const portalContainer = portal.current; | ||
portalContainer.setAttribute('data-cf-ui-portal', ''); | ||
portalContainer.setAttribute("data-cf-ui-portal", ""); | ||
container.current.appendChild(portalContainer); | ||
@@ -19,3 +19,3 @@ return ()=>{ | ||
}, []); | ||
return portal.current ? /*#__PURE__*/ $6KSAN$createPortal(children, portal.current) : null; | ||
return portal.current ? /*#__PURE__*/ (0, $6KSAN$createPortal)(children, portal.current) : null; | ||
} | ||
@@ -26,5 +26,5 @@ | ||
const $95440ece1fedb657$export$8f71654801c2f7cd = (props)=>{ | ||
const { ref: ref , keys: keys , event: event = 'keydown' } = props; | ||
const { ref: ref , keys: keys , event: event = "keydown" } = props; | ||
let element = document; | ||
const handleKeyEvent = $6KSAN$useCallback((e)=>{ | ||
const handleKeyEvent = (0, $6KSAN$useCallback)((e)=>{ | ||
const isKey = Object.prototype.hasOwnProperty.call(keys, e.key); | ||
@@ -35,3 +35,3 @@ if (isKey) keys[e.key](e); | ||
]); | ||
$6KSAN$useEffect(()=>{ | ||
(0, $6KSAN$useEffect)(()=>{ | ||
if (ref && ref.current) element = ref.current; | ||
@@ -51,7 +51,7 @@ element.addEventListener(event, handleKeyEvent); | ||
const matchResult = { | ||
before: '', | ||
match: '', | ||
after: '' | ||
before: "", | ||
match: "", | ||
after: "" | ||
}; | ||
const regex = new RegExp(`(?<before>.*?)(?<match>${match})(?<after>.*)`, 'i'); | ||
const regex = new RegExp(`(?<before>.*?)(?<match>${match})(?<after>.*)`, "i"); | ||
const matches = base.match(regex); | ||
@@ -58,0 +58,0 @@ if (matches) { |
{ | ||
"name": "@contentful/f36-utils", | ||
"version": "4.14.0", | ||
"version": "4.15.0", | ||
"description": "Forma 36: utils React Component", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
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
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
23534