@twilio-paste/uid-library
Advanced tools
Comparing version 0.2.3 to 0.2.4
# Change Log | ||
## 0.2.4 | ||
### Patch Changes | ||
- [`73c596919`](https://github.com/twilio-labs/paste/commit/73c5969191c04b4721a059c9dee329126afc1a8e) [#2269](https://github.com/twilio-labs/paste/pull/2269) Thanks [@SiTaggart](https://github.com/SiTaggart)! - Fixed a regression with the compilation script that caused incompatible ESM module importing of JSON files. | ||
## 0.2.3 | ||
@@ -4,0 +10,0 @@ |
@@ -1,18 +0,1 @@ | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __reExport = (target, module, copyDefault, desc) => { | ||
if (module && typeof module === "object" || typeof module === "function") { | ||
for (let key of __getOwnPropNames(module)) | ||
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default")) | ||
__defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable }); | ||
} | ||
return target; | ||
}; | ||
// ../../../node_modules/react-uid/dist/es2015/uid.js | ||
@@ -36,12 +19,7 @@ var generateUID = function() { | ||
// esm-externals:react | ||
var react_exports = {}; | ||
__export(react_exports, { | ||
default: () => default2 | ||
}); | ||
__reExport(react_exports, react_star); | ||
import * as default2 from "react"; | ||
import * as react_star from "react"; | ||
// ../../../node_modules/react-uid/dist/es2015/Control.js | ||
import * as React3 from "react"; | ||
// ../../../node_modules/react-uid/dist/es2015/context.js | ||
import * as React from "react"; | ||
var createSource = function(prefix) { | ||
@@ -58,3 +36,3 @@ if (prefix === void 0) { | ||
var counter = createSource(); | ||
var source = react_exports.createContext(createSource()); | ||
var source = React.createContext(createSource()); | ||
var getId = function(source2) { | ||
@@ -87,2 +65,3 @@ return source2.value++; | ||
// ../../../node_modules/react-uid/dist/es2015/UIDComponent.js | ||
import * as React2 from "react"; | ||
var prefixId = function(id, prefix, name) { | ||
@@ -112,3 +91,3 @@ var uid2 = prefix + id; | ||
return UID2; | ||
}(react_exports.Component); | ||
}(React2.Component); | ||
@@ -118,4 +97,4 @@ // ../../../node_modules/react-uid/dist/es2015/Control.js | ||
var children = _a.children, _b = _a.prefix, prefix = _b === void 0 ? "" : _b; | ||
return react_exports.createElement(UIDConsumer, null, function(id) { | ||
return react_exports.createElement(source.Provider, { value: createSource(id + "-" + prefix) }, children); | ||
return React3.createElement(UIDConsumer, null, function(id) { | ||
return React3.createElement(source.Provider, { value: createSource(id + "-" + prefix) }, children); | ||
}); | ||
@@ -125,4 +104,4 @@ }; | ||
var name = _a.name, children = _a.children; | ||
return react_exports.createElement(source.Consumer, null, function(value) { | ||
return react_exports.createElement(UID, { name, idSource: value, children }); | ||
return React3.createElement(source.Consumer, null, function(value) { | ||
return React3.createElement(UID, { name, idSource: value, children }); | ||
}); | ||
@@ -132,2 +111,3 @@ }; | ||
// ../../../node_modules/react-uid/dist/es2015/hooks.js | ||
import * as React4 from "react"; | ||
var generateUID2 = function(context) { | ||
@@ -145,7 +125,7 @@ var quartz = context || counter; | ||
if (false) { | ||
if (!("useContext" in react_exports)) { | ||
if (!("useContext" in React4)) { | ||
throw new Error("Hooks API requires React 16.8+"); | ||
} | ||
} | ||
return react_exports.useState(generateUID2(react_exports.useContext(source))); | ||
return React4.useState(generateUID2(React4.useContext(source))); | ||
}; | ||
@@ -152,0 +132,0 @@ var useUID = function() { |
@@ -1,2 +0,2 @@ | ||
var m=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var E=(e,r)=>{for(var t in r)m(e,t,{get:r[t],enumerable:!0})},v=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of U(r))!j.call(e,i)&&(t||i!=="default")&&m(e,i,{get:()=>r[i],enumerable:!(n=P(r,i))||n.enumerable});return e};var c=function(){var e=1,r=new WeakMap,t=function(n,i){return typeof n=="number"||typeof n=="string"?i?"idx-"+i:"val-"+n:r.has(n)?"uid"+r.get(n):(r.set(n,e++),t(n))};return t},h=c();var o={};E(o,{default:()=>x});v(o,F);import*as x from"react";import*as F from"react";var l=function(e){return e===void 0&&(e=""),{value:1,prefix:e,uid:c()}},u=l(),a=o.createContext(l()),s=function(e){return e.value++},p=function(e){return e?e.prefix:""};var d=function(e,r){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},d(e,r)};function _(e,r){d(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var b=function(e,r,t){var n=r+e;return String(t?t(n):n)},w=function(e){_(r,e);function r(){var t=e!==null&&e.apply(this,arguments)||this;return t.state={quartz:t.props.idSource||u,prefix:p(t.props.idSource),id:s(t.props.idSource||u)},t.uid=function(n){return b(t.state.id+"-"+t.state.quartz.uid(n),t.state.prefix,t.props.name)},t}return r.prototype.render=function(){var t=this.props,n=t.children,i=t.name,f=this.state,y=f.id,R=f.prefix;return n(b(y,R,i),this.uid)},r}(o.Component);var g=function(e){var r=e.children,t=e.prefix,n=t===void 0?"":t;return o.createElement(I,null,function(i){return o.createElement(a.Provider,{value:l(i+"-"+n)},r)})},I=function(e){var r=e.name,t=e.children;return o.createElement(a.Consumer,null,function(n){return o.createElement(w,{name:r,idSource:n,children:t})})};var C=function(e){var r=e||u,t=p(r),n=s(r),i=t+n,f=function(y){return i+r.uid(y)};return{uid:i,gen:f}},S=function(){return o.useState(C(o.useContext(a)))},O=function(){var e=S()[0].uid;return e},D=function(){var e=S()[0].gen;return e};export{g as UIDFork,h as uid,O as useUID,D as useUIDSeed}; | ||
var c=function(){var e=1,n=new WeakMap,t=function(r,o){return typeof r=="number"||typeof r=="string"?o?"idx-"+o:"val-"+r:n.has(r)?"uid"+n.get(r):(n.set(r,e++),t(r))};return t},h=c();import*as a from"react";import*as m from"react";var l=function(e){return e===void 0&&(e=""),{value:1,prefix:e,uid:c()}},i=l(),u=m.createContext(l()),s=function(e){return e.value++},p=function(e){return e?e.prefix:""};var d=function(e,n){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])},d(e,n)};function x(e,n){d(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}import*as _ from"react";var b=function(e,n,t){var r=n+e;return String(t?t(r):r)},w=function(e){x(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.state={quartz:t.props.idSource||i,prefix:p(t.props.idSource),id:s(t.props.idSource||i)},t.uid=function(r){return b(t.state.id+"-"+t.state.quartz.uid(r),t.state.prefix,t.props.name)},t}return n.prototype.render=function(){var t=this.props,r=t.children,o=t.name,f=this.state,v=f.id,R=f.prefix;return r(b(v,R,o),this.uid)},n}(_.Component);var g=function(e){var n=e.children,t=e.prefix,r=t===void 0?"":t;return a.createElement(I,null,function(o){return a.createElement(u.Provider,{value:l(o+"-"+r)},n)})},I=function(e){var n=e.name,t=e.children;return a.createElement(u.Consumer,null,function(r){return a.createElement(w,{name:n,idSource:r,children:t})})};import*as y from"react";var P=function(e){var n=e||i,t=p(n),r=s(n),o=t+r,f=function(v){return o+n.uid(v)};return{uid:o,gen:f}},S=function(){return y.useState(P(y.useContext(u)))},O=function(){var e=S()[0].uid;return e},D=function(){var e=S()[0].gen;return e};export{g as UIDFork,h as uid,O as useUID,D as useUIDSeed}; | ||
/*! ***************************************************************************** | ||
@@ -3,0 +3,0 @@ Copyright (c) Microsoft Corporation. All rights reserved. |
{ | ||
"name": "@twilio-paste/uid-library", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"category": "library", | ||
@@ -5,0 +5,0 @@ "status": "production", |
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
362927
366