@twilio-paste/uid-library
Advanced tools
Comparing version 0.2.6 to 1.0.0
@@ -1,2 +0,5 @@ | ||
export { UIDFork, useUID, useUIDSeed, uid } from 'react-uid'; | ||
import { UIDFork, uid } from 'react-uid'; | ||
declare const useUID: () => string; | ||
declare const useUIDSeed: () => (seed: string) => string; | ||
export { useUIDSeed, UIDFork, uid, useUID }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -18,3 +18,6 @@ var __create = Object.create; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
@@ -421,2 +424,5 @@ // ../../../node_modules/react-uid/node_modules/tslib/tslib.js | ||
// src/index.tsx | ||
import React5 from "react"; | ||
// ../../../node_modules/react-uid/dist/es2015/uid.js | ||
@@ -562,7 +568,16 @@ var generateUID = function() { | ||
}; | ||
// src/index.tsx | ||
var useId = "useId"; | ||
var maybeReactUseId = React5[useId]; | ||
var useUID2 = maybeReactUseId !== void 0 ? maybeReactUseId : useUID; | ||
var useUIDSeed2 = maybeReactUseId !== void 0 ? () => { | ||
const id = maybeReactUseId(); | ||
return (seed) => `${id}-${seed}`; | ||
} : useUIDSeed; | ||
export { | ||
UIDFork, | ||
uid, | ||
useUID, | ||
useUIDSeed | ||
useUID2 as useUID, | ||
useUIDSeed2 as useUIDSeed | ||
}; | ||
@@ -569,0 +584,0 @@ /*! ***************************************************************************** |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __create = Object.create; | ||
@@ -22,3 +23,6 @@ var __defProp = Object.defineProperty; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -431,6 +435,7 @@ | ||
uid: () => uid, | ||
useUID: () => useUID, | ||
useUIDSeed: () => useUIDSeed | ||
useUID: () => useUID2, | ||
useUIDSeed: () => useUIDSeed2 | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
var import_react = __toESM(require("react")); | ||
@@ -577,2 +582,11 @@ // ../../../node_modules/react-uid/dist/es2015/uid.js | ||
}; | ||
// src/index.tsx | ||
var useId = "useId"; | ||
var maybeReactUseId = import_react.default[useId]; | ||
var useUID2 = maybeReactUseId !== void 0 ? maybeReactUseId : useUID; | ||
var useUIDSeed2 = maybeReactUseId !== void 0 ? () => { | ||
const id = maybeReactUseId(); | ||
return (seed) => `${id}-${seed}`; | ||
} : useUIDSeed; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -579,0 +593,0 @@ 0 && (module.exports = { |
@@ -1,2 +0,2 @@ | ||
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));var require_tslib=__commonJS({"../../../node_modules/react-uid/node_modules/tslib/tslib.js"(exports,module){var __extends2,__assign2,__rest2,__decorate2,__param2,__metadata2,__awaiter2,__generator2,__exportStar2,__values2,__read2,__spread2,__spreadArrays2,__await2,__asyncGenerator2,__asyncDelegator2,__asyncValues2,__makeTemplateObject2,__importStar2,__importDefault2,__classPrivateFieldGet2,__classPrivateFieldSet2,__createBinding2;(function(factory){var root=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(exports2){factory(createExporter(root,createExporter(exports2)))}):typeof module=="object"&&typeof module.exports=="object"?factory(createExporter(root,createExporter(module.exports))):factory(createExporter(root));function createExporter(exports2,previous){return exports2!==root&&(typeof Object.create=="function"?Object.defineProperty(exports2,"__esModule",{value:!0}):exports2.__esModule=!0),function(id,v){return exports2[id]=previous?previous(id,v):v}}})(function(exporter){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])};__extends2=function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)},__assign2=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__rest2=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t},__decorate2=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r},__param2=function(paramIndex,decorator){return function(target,key){decorator(target,key,paramIndex)}},__metadata2=function(metadataKey,metadataValue){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(metadataKey,metadataValue)},__awaiter2=function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator2=function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=op[0]&2?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[op[0]&2,t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(t=_.trys,!(t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}},__createBinding2=function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]},__exportStar2=function(m,exports2){for(var p in m)p!=="default"&&!exports2.hasOwnProperty(p)&&(exports2[p]=m[p])},__values2=function(o){var s=typeof Symbol=="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},__read2=function(o,n){var m=typeof Symbol=="function"&&o[Symbol.iterator];if(!m)return o;var i=m.call(o),r,ar=[],e;try{for(;(n===void 0||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},__spread2=function(){for(var ar=[],i=0;i<arguments.length;i++)ar=ar.concat(__read2(arguments[i]));return ar},__spreadArrays2=function(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;for(var r=Array(s),k=0,i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r},__await2=function(v){return this instanceof __await2?(this.v=v,this):new __await2(v)},__asyncGenerator2=function(thisArg,_arguments,generator){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g=generator.apply(thisArg,_arguments||[]),i,q=[];return i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i;function verb(n){g[n]&&(i[n]=function(v){return new Promise(function(a,b){q.push([n,v,a,b])>1||resume(n,v)})})}function resume(n,v){try{step(g[n](v))}catch(e){settle(q[0][3],e)}}function step(r){r.value instanceof __await2?Promise.resolve(r.value.v).then(fulfill,reject):settle(q[0][2],r)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f,v){f(v),q.shift(),q.length&&resume(q[0][0],q[0][1])}},__asyncDelegator2=function(o){var i,p;return i={},verb("next"),verb("throw",function(e){throw e}),verb("return"),i[Symbol.iterator]=function(){return this},i;function verb(n,f){i[n]=o[n]?function(v){return(p=!p)?{value:__await2(o[n](v)),done:n==="return"}:f?f(v):v}:f}},__asyncValues2=function(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var m=o[Symbol.asyncIterator],i;return m?m.call(o):(o=typeof __values2=="function"?__values2(o):o[Symbol.iterator](),i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i);function verb(n){i[n]=o[n]&&function(v){return new Promise(function(resolve,reject){v=o[n](v),settle(resolve,reject,v.done,v.value)})}}function settle(resolve,reject,d,v){Promise.resolve(v).then(function(v2){resolve({value:v2,done:d})},reject)}},__makeTemplateObject2=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},__importStar2=function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)Object.hasOwnProperty.call(mod,k)&&(result[k]=mod[k]);return result.default=mod,result},__importDefault2=function(mod){return mod&&mod.__esModule?mod:{default:mod}},__classPrivateFieldGet2=function(receiver,privateMap){if(!privateMap.has(receiver))throw new TypeError("attempted to get private field on non-instance");return privateMap.get(receiver)},__classPrivateFieldSet2=function(receiver,privateMap,value){if(!privateMap.has(receiver))throw new TypeError("attempted to set private field on non-instance");return privateMap.set(receiver,value),value},exporter("__extends",__extends2),exporter("__assign",__assign2),exporter("__rest",__rest2),exporter("__decorate",__decorate2),exporter("__param",__param2),exporter("__metadata",__metadata2),exporter("__awaiter",__awaiter2),exporter("__generator",__generator2),exporter("__exportStar",__exportStar2),exporter("__createBinding",__createBinding2),exporter("__values",__values2),exporter("__read",__read2),exporter("__spread",__spread2),exporter("__spreadArrays",__spreadArrays2),exporter("__await",__await2),exporter("__asyncGenerator",__asyncGenerator2),exporter("__asyncDelegator",__asyncDelegator2),exporter("__asyncValues",__asyncValues2),exporter("__makeTemplateObject",__makeTemplateObject2),exporter("__importStar",__importStar2),exporter("__importDefault",__importDefault2),exporter("__classPrivateFieldGet",__classPrivateFieldGet2),exporter("__classPrivateFieldSet",__classPrivateFieldSet2)})}});var generateUID=function(){var counter2=1,map=new WeakMap,uid2=function(item,index){return typeof item=="number"||typeof item=="string"?index?"idx-"+index:"val-"+item:map.has(item)?"uid"+map.get(item):(map.set(item,counter2++),uid2(item))};return uid2},uid=generateUID();import*as React3 from"react";import*as React from"react";var createSource=function(prefix){return prefix===void 0&&(prefix=""),{value:1,prefix,uid:generateUID()}},counter=createSource(),source=React.createContext(createSource()),getId=function(source2){return source2.value++},getPrefix=function(source2){return source2?source2.prefix:""};var import_tslib=__toESM(require_tslib(),1),{__extends,__assign,__rest,__decorate,__param,__metadata,__awaiter,__generator,__exportStar,__createBinding,__values,__read,__spread,__spreadArrays,__await,__asyncGenerator,__asyncDelegator,__asyncValues,__makeTemplateObject,__importStar,__importDefault,__classPrivateFieldGet,__classPrivateFieldSet}=import_tslib.default;import*as React2 from"react";var prefixId=function(id,prefix,name){var uid2=prefix+id;return String(name?name(uid2):uid2)},UID=function(_super){__extends(UID2,_super);function UID2(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this.state={quartz:_this.props.idSource||counter,prefix:getPrefix(_this.props.idSource),id:getId(_this.props.idSource||counter)},_this.uid=function(item){return prefixId(_this.state.id+"-"+_this.state.quartz.uid(item),_this.state.prefix,_this.props.name)},_this}return UID2.prototype.render=function(){var _a=this.props,children=_a.children,name=_a.name,_b=this.state,id=_b.id,prefix=_b.prefix;return children(prefixId(id,prefix,name),this.uid)},UID2}(React2.Component);var UIDFork=function(_a){var children=_a.children,_b=_a.prefix,prefix=_b===void 0?"":_b;return React3.createElement(UIDConsumer,null,function(id){return React3.createElement(source.Provider,{value:createSource(id+"-"+prefix)},children)})},UIDConsumer=function(_a){var name=_a.name,children=_a.children;return React3.createElement(source.Consumer,null,function(value){return React3.createElement(UID,{name,idSource:value,children})})};import*as React4 from"react";var generateUID2=function(context){var quartz=context||counter,prefix=getPrefix(quartz),id=getId(quartz),uid2=prefix+id,gen=function(item){return uid2+quartz.uid(item)};return{uid:uid2,gen}},useUIDState=function(){return React4.useState(generateUID2(React4.useContext(source)))},useUID=function(){var uid2=useUIDState()[0].uid;return uid2},useUIDSeed=function(){var gen=useUIDState()[0].gen;return gen};export{UIDFork,uid,useUID,useUIDSeed}; | ||
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));var require_tslib=__commonJS({"../../../node_modules/react-uid/node_modules/tslib/tslib.js"(exports,module){var __extends2,__assign2,__rest2,__decorate2,__param2,__metadata2,__awaiter2,__generator2,__exportStar2,__values2,__read2,__spread2,__spreadArrays2,__await2,__asyncGenerator2,__asyncDelegator2,__asyncValues2,__makeTemplateObject2,__importStar2,__importDefault2,__classPrivateFieldGet2,__classPrivateFieldSet2,__createBinding2;(function(factory){var root=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(exports2){factory(createExporter(root,createExporter(exports2)))}):typeof module=="object"&&typeof module.exports=="object"?factory(createExporter(root,createExporter(module.exports))):factory(createExporter(root));function createExporter(exports2,previous){return exports2!==root&&(typeof Object.create=="function"?Object.defineProperty(exports2,"__esModule",{value:!0}):exports2.__esModule=!0),function(id,v){return exports2[id]=previous?previous(id,v):v}}})(function(exporter){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])};__extends2=function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)},__assign2=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__rest2=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t},__decorate2=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r},__param2=function(paramIndex,decorator){return function(target,key){decorator(target,key,paramIndex)}},__metadata2=function(metadataKey,metadataValue){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(metadataKey,metadataValue)},__awaiter2=function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator2=function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=op[0]&2?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[op[0]&2,t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(t=_.trys,!(t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}},__createBinding2=function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]},__exportStar2=function(m,exports2){for(var p in m)p!=="default"&&!exports2.hasOwnProperty(p)&&(exports2[p]=m[p])},__values2=function(o){var s=typeof Symbol=="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},__read2=function(o,n){var m=typeof Symbol=="function"&&o[Symbol.iterator];if(!m)return o;var i=m.call(o),r,ar=[],e;try{for(;(n===void 0||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},__spread2=function(){for(var ar=[],i=0;i<arguments.length;i++)ar=ar.concat(__read2(arguments[i]));return ar},__spreadArrays2=function(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;for(var r=Array(s),k=0,i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r},__await2=function(v){return this instanceof __await2?(this.v=v,this):new __await2(v)},__asyncGenerator2=function(thisArg,_arguments,generator){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g=generator.apply(thisArg,_arguments||[]),i,q=[];return i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i;function verb(n){g[n]&&(i[n]=function(v){return new Promise(function(a,b){q.push([n,v,a,b])>1||resume(n,v)})})}function resume(n,v){try{step(g[n](v))}catch(e){settle(q[0][3],e)}}function step(r){r.value instanceof __await2?Promise.resolve(r.value.v).then(fulfill,reject):settle(q[0][2],r)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f,v){f(v),q.shift(),q.length&&resume(q[0][0],q[0][1])}},__asyncDelegator2=function(o){var i,p;return i={},verb("next"),verb("throw",function(e){throw e}),verb("return"),i[Symbol.iterator]=function(){return this},i;function verb(n,f){i[n]=o[n]?function(v){return(p=!p)?{value:__await2(o[n](v)),done:n==="return"}:f?f(v):v}:f}},__asyncValues2=function(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var m=o[Symbol.asyncIterator],i;return m?m.call(o):(o=typeof __values2=="function"?__values2(o):o[Symbol.iterator](),i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i);function verb(n){i[n]=o[n]&&function(v){return new Promise(function(resolve,reject){v=o[n](v),settle(resolve,reject,v.done,v.value)})}}function settle(resolve,reject,d,v){Promise.resolve(v).then(function(v2){resolve({value:v2,done:d})},reject)}},__makeTemplateObject2=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},__importStar2=function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)Object.hasOwnProperty.call(mod,k)&&(result[k]=mod[k]);return result.default=mod,result},__importDefault2=function(mod){return mod&&mod.__esModule?mod:{default:mod}},__classPrivateFieldGet2=function(receiver,privateMap){if(!privateMap.has(receiver))throw new TypeError("attempted to get private field on non-instance");return privateMap.get(receiver)},__classPrivateFieldSet2=function(receiver,privateMap,value){if(!privateMap.has(receiver))throw new TypeError("attempted to set private field on non-instance");return privateMap.set(receiver,value),value},exporter("__extends",__extends2),exporter("__assign",__assign2),exporter("__rest",__rest2),exporter("__decorate",__decorate2),exporter("__param",__param2),exporter("__metadata",__metadata2),exporter("__awaiter",__awaiter2),exporter("__generator",__generator2),exporter("__exportStar",__exportStar2),exporter("__createBinding",__createBinding2),exporter("__values",__values2),exporter("__read",__read2),exporter("__spread",__spread2),exporter("__spreadArrays",__spreadArrays2),exporter("__await",__await2),exporter("__asyncGenerator",__asyncGenerator2),exporter("__asyncDelegator",__asyncDelegator2),exporter("__asyncValues",__asyncValues2),exporter("__makeTemplateObject",__makeTemplateObject2),exporter("__importStar",__importStar2),exporter("__importDefault",__importDefault2),exporter("__classPrivateFieldGet",__classPrivateFieldGet2),exporter("__classPrivateFieldSet",__classPrivateFieldSet2)})}});import React5 from"react";var generateUID=function(){var counter2=1,map=new WeakMap,uid2=function(item,index){return typeof item=="number"||typeof item=="string"?index?"idx-"+index:"val-"+item:map.has(item)?"uid"+map.get(item):(map.set(item,counter2++),uid2(item))};return uid2},uid=generateUID();import*as React3 from"react";import*as React from"react";var createSource=function(prefix){return prefix===void 0&&(prefix=""),{value:1,prefix,uid:generateUID()}},counter=createSource(),source=React.createContext(createSource()),getId=function(source2){return source2.value++},getPrefix=function(source2){return source2?source2.prefix:""};var import_tslib=__toESM(require_tslib(),1),{__extends,__assign,__rest,__decorate,__param,__metadata,__awaiter,__generator,__exportStar,__createBinding,__values,__read,__spread,__spreadArrays,__await,__asyncGenerator,__asyncDelegator,__asyncValues,__makeTemplateObject,__importStar,__importDefault,__classPrivateFieldGet,__classPrivateFieldSet}=import_tslib.default;import*as React2 from"react";var prefixId=function(id,prefix,name){var uid2=prefix+id;return String(name?name(uid2):uid2)},UID=function(_super){__extends(UID2,_super);function UID2(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this.state={quartz:_this.props.idSource||counter,prefix:getPrefix(_this.props.idSource),id:getId(_this.props.idSource||counter)},_this.uid=function(item){return prefixId(_this.state.id+"-"+_this.state.quartz.uid(item),_this.state.prefix,_this.props.name)},_this}return UID2.prototype.render=function(){var _a=this.props,children=_a.children,name=_a.name,_b=this.state,id=_b.id,prefix=_b.prefix;return children(prefixId(id,prefix,name),this.uid)},UID2}(React2.Component);var UIDFork=function(_a){var children=_a.children,_b=_a.prefix,prefix=_b===void 0?"":_b;return React3.createElement(UIDConsumer,null,function(id){return React3.createElement(source.Provider,{value:createSource(id+"-"+prefix)},children)})},UIDConsumer=function(_a){var name=_a.name,children=_a.children;return React3.createElement(source.Consumer,null,function(value){return React3.createElement(UID,{name,idSource:value,children})})};import*as React4 from"react";var generateUID2=function(context){var quartz=context||counter,prefix=getPrefix(quartz),id=getId(quartz),uid2=prefix+id,gen=function(item){return uid2+quartz.uid(item)};return{uid:uid2,gen}},useUIDState=function(){return React4.useState(generateUID2(React4.useContext(source)))},useUID=function(){var uid2=useUIDState()[0].uid;return uid2},useUIDSeed=function(){var gen=useUIDState()[0].gen;return gen};var useId="useId",maybeReactUseId=React5[useId],useUID2=maybeReactUseId!==void 0?maybeReactUseId:useUID,useUIDSeed2=maybeReactUseId!==void 0?()=>{let id=maybeReactUseId();return seed=>`${id}-${seed}`}:useUIDSeed;export{UIDFork,uid,useUID2 as useUID,useUIDSeed2 as useUIDSeed}; | ||
/*! ***************************************************************************** | ||
@@ -3,0 +3,0 @@ Copyright (c) Microsoft Corporation. |
@@ -1,2 +0,2 @@ | ||
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var require_tslib=__commonJS({"../../../node_modules/react-uid/node_modules/tslib/tslib.js"(exports,module2){var __extends2,__assign2,__rest2,__decorate2,__param2,__metadata2,__awaiter2,__generator2,__exportStar2,__values2,__read2,__spread2,__spreadArrays2,__await2,__asyncGenerator2,__asyncDelegator2,__asyncValues2,__makeTemplateObject2,__importStar2,__importDefault2,__classPrivateFieldGet2,__classPrivateFieldSet2,__createBinding2;(function(factory){var root=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(exports2){factory(createExporter(root,createExporter(exports2)))}):typeof module2=="object"&&typeof module2.exports=="object"?factory(createExporter(root,createExporter(module2.exports))):factory(createExporter(root));function createExporter(exports2,previous){return exports2!==root&&(typeof Object.create=="function"?Object.defineProperty(exports2,"__esModule",{value:!0}):exports2.__esModule=!0),function(id,v){return exports2[id]=previous?previous(id,v):v}}})(function(exporter){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])};__extends2=function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)},__assign2=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__rest2=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t},__decorate2=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r},__param2=function(paramIndex,decorator){return function(target,key){decorator(target,key,paramIndex)}},__metadata2=function(metadataKey,metadataValue){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(metadataKey,metadataValue)},__awaiter2=function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator2=function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=op[0]&2?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[op[0]&2,t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(t=_.trys,!(t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}},__createBinding2=function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]},__exportStar2=function(m,exports2){for(var p in m)p!=="default"&&!exports2.hasOwnProperty(p)&&(exports2[p]=m[p])},__values2=function(o){var s=typeof Symbol=="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},__read2=function(o,n){var m=typeof Symbol=="function"&&o[Symbol.iterator];if(!m)return o;var i=m.call(o),r,ar=[],e;try{for(;(n===void 0||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},__spread2=function(){for(var ar=[],i=0;i<arguments.length;i++)ar=ar.concat(__read2(arguments[i]));return ar},__spreadArrays2=function(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;for(var r=Array(s),k=0,i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r},__await2=function(v){return this instanceof __await2?(this.v=v,this):new __await2(v)},__asyncGenerator2=function(thisArg,_arguments,generator){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g=generator.apply(thisArg,_arguments||[]),i,q=[];return i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i;function verb(n){g[n]&&(i[n]=function(v){return new Promise(function(a,b){q.push([n,v,a,b])>1||resume(n,v)})})}function resume(n,v){try{step(g[n](v))}catch(e){settle(q[0][3],e)}}function step(r){r.value instanceof __await2?Promise.resolve(r.value.v).then(fulfill,reject):settle(q[0][2],r)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f,v){f(v),q.shift(),q.length&&resume(q[0][0],q[0][1])}},__asyncDelegator2=function(o){var i,p;return i={},verb("next"),verb("throw",function(e){throw e}),verb("return"),i[Symbol.iterator]=function(){return this},i;function verb(n,f){i[n]=o[n]?function(v){return(p=!p)?{value:__await2(o[n](v)),done:n==="return"}:f?f(v):v}:f}},__asyncValues2=function(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var m=o[Symbol.asyncIterator],i;return m?m.call(o):(o=typeof __values2=="function"?__values2(o):o[Symbol.iterator](),i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i);function verb(n){i[n]=o[n]&&function(v){return new Promise(function(resolve,reject){v=o[n](v),settle(resolve,reject,v.done,v.value)})}}function settle(resolve,reject,d,v){Promise.resolve(v).then(function(v2){resolve({value:v2,done:d})},reject)}},__makeTemplateObject2=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},__importStar2=function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)Object.hasOwnProperty.call(mod,k)&&(result[k]=mod[k]);return result.default=mod,result},__importDefault2=function(mod){return mod&&mod.__esModule?mod:{default:mod}},__classPrivateFieldGet2=function(receiver,privateMap){if(!privateMap.has(receiver))throw new TypeError("attempted to get private field on non-instance");return privateMap.get(receiver)},__classPrivateFieldSet2=function(receiver,privateMap,value){if(!privateMap.has(receiver))throw new TypeError("attempted to set private field on non-instance");return privateMap.set(receiver,value),value},exporter("__extends",__extends2),exporter("__assign",__assign2),exporter("__rest",__rest2),exporter("__decorate",__decorate2),exporter("__param",__param2),exporter("__metadata",__metadata2),exporter("__awaiter",__awaiter2),exporter("__generator",__generator2),exporter("__exportStar",__exportStar2),exporter("__createBinding",__createBinding2),exporter("__values",__values2),exporter("__read",__read2),exporter("__spread",__spread2),exporter("__spreadArrays",__spreadArrays2),exporter("__await",__await2),exporter("__asyncGenerator",__asyncGenerator2),exporter("__asyncDelegator",__asyncDelegator2),exporter("__asyncValues",__asyncValues2),exporter("__makeTemplateObject",__makeTemplateObject2),exporter("__importStar",__importStar2),exporter("__importDefault",__importDefault2),exporter("__classPrivateFieldGet",__classPrivateFieldGet2),exporter("__classPrivateFieldSet",__classPrivateFieldSet2)})}});var src_exports={};__export(src_exports,{UIDFork:()=>UIDFork,uid:()=>uid,useUID:()=>useUID,useUIDSeed:()=>useUIDSeed});module.exports=__toCommonJS(src_exports);var generateUID=function(){var counter2=1,map=new WeakMap,uid2=function(item,index){return typeof item=="number"||typeof item=="string"?index?"idx-"+index:"val-"+item:map.has(item)?"uid"+map.get(item):(map.set(item,counter2++),uid2(item))};return uid2},uid=generateUID();var React3=__toESM(require("react"));var React=__toESM(require("react"));var createSource=function(prefix){return prefix===void 0&&(prefix=""),{value:1,prefix,uid:generateUID()}},counter=createSource(),source=React.createContext(createSource()),getId=function(source2){return source2.value++},getPrefix=function(source2){return source2?source2.prefix:""};var import_tslib=__toESM(require_tslib(),1),{__extends,__assign,__rest,__decorate,__param,__metadata,__awaiter,__generator,__exportStar,__createBinding,__values,__read,__spread,__spreadArrays,__await,__asyncGenerator,__asyncDelegator,__asyncValues,__makeTemplateObject,__importStar,__importDefault,__classPrivateFieldGet,__classPrivateFieldSet}=import_tslib.default;var React2=__toESM(require("react"));var prefixId=function(id,prefix,name){var uid2=prefix+id;return String(name?name(uid2):uid2)},UID=function(_super){__extends(UID2,_super);function UID2(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this.state={quartz:_this.props.idSource||counter,prefix:getPrefix(_this.props.idSource),id:getId(_this.props.idSource||counter)},_this.uid=function(item){return prefixId(_this.state.id+"-"+_this.state.quartz.uid(item),_this.state.prefix,_this.props.name)},_this}return UID2.prototype.render=function(){var _a=this.props,children=_a.children,name=_a.name,_b=this.state,id=_b.id,prefix=_b.prefix;return children(prefixId(id,prefix,name),this.uid)},UID2}(React2.Component);var UIDFork=function(_a){var children=_a.children,_b=_a.prefix,prefix=_b===void 0?"":_b;return React3.createElement(UIDConsumer,null,function(id){return React3.createElement(source.Provider,{value:createSource(id+"-"+prefix)},children)})},UIDConsumer=function(_a){var name=_a.name,children=_a.children;return React3.createElement(source.Consumer,null,function(value){return React3.createElement(UID,{name,idSource:value,children})})};var React4=__toESM(require("react"));var generateUID2=function(context){var quartz=context||counter,prefix=getPrefix(quartz),id=getId(quartz),uid2=prefix+id,gen=function(item){return uid2+quartz.uid(item)};return{uid:uid2,gen}},useUIDState=function(){return React4.useState(generateUID2(React4.useContext(source)))},useUID=function(){var uid2=useUIDState()[0].uid;return uid2},useUIDSeed=function(){var gen=useUIDState()[0].gen;return gen};0&&(module.exports={UIDFork,uid,useUID,useUIDSeed}); | ||
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var require_tslib=__commonJS({"../../../node_modules/react-uid/node_modules/tslib/tslib.js"(exports,module2){var __extends2,__assign2,__rest2,__decorate2,__param2,__metadata2,__awaiter2,__generator2,__exportStar2,__values2,__read2,__spread2,__spreadArrays2,__await2,__asyncGenerator2,__asyncDelegator2,__asyncValues2,__makeTemplateObject2,__importStar2,__importDefault2,__classPrivateFieldGet2,__classPrivateFieldSet2,__createBinding2;(function(factory){var root=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(exports2){factory(createExporter(root,createExporter(exports2)))}):typeof module2=="object"&&typeof module2.exports=="object"?factory(createExporter(root,createExporter(module2.exports))):factory(createExporter(root));function createExporter(exports2,previous){return exports2!==root&&(typeof Object.create=="function"?Object.defineProperty(exports2,"__esModule",{value:!0}):exports2.__esModule=!0),function(id,v){return exports2[id]=previous?previous(id,v):v}}})(function(exporter){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])};__extends2=function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)},__assign2=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__rest2=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t},__decorate2=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r},__param2=function(paramIndex,decorator){return function(target,key){decorator(target,key,paramIndex)}},__metadata2=function(metadataKey,metadataValue){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(metadataKey,metadataValue)},__awaiter2=function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator2=function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=op[0]&2?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[op[0]&2,t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(t=_.trys,!(t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}},__createBinding2=function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]},__exportStar2=function(m,exports2){for(var p in m)p!=="default"&&!exports2.hasOwnProperty(p)&&(exports2[p]=m[p])},__values2=function(o){var s=typeof Symbol=="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},__read2=function(o,n){var m=typeof Symbol=="function"&&o[Symbol.iterator];if(!m)return o;var i=m.call(o),r,ar=[],e;try{for(;(n===void 0||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},__spread2=function(){for(var ar=[],i=0;i<arguments.length;i++)ar=ar.concat(__read2(arguments[i]));return ar},__spreadArrays2=function(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;for(var r=Array(s),k=0,i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r},__await2=function(v){return this instanceof __await2?(this.v=v,this):new __await2(v)},__asyncGenerator2=function(thisArg,_arguments,generator){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g=generator.apply(thisArg,_arguments||[]),i,q=[];return i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i;function verb(n){g[n]&&(i[n]=function(v){return new Promise(function(a,b){q.push([n,v,a,b])>1||resume(n,v)})})}function resume(n,v){try{step(g[n](v))}catch(e){settle(q[0][3],e)}}function step(r){r.value instanceof __await2?Promise.resolve(r.value.v).then(fulfill,reject):settle(q[0][2],r)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f,v){f(v),q.shift(),q.length&&resume(q[0][0],q[0][1])}},__asyncDelegator2=function(o){var i,p;return i={},verb("next"),verb("throw",function(e){throw e}),verb("return"),i[Symbol.iterator]=function(){return this},i;function verb(n,f){i[n]=o[n]?function(v){return(p=!p)?{value:__await2(o[n](v)),done:n==="return"}:f?f(v):v}:f}},__asyncValues2=function(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var m=o[Symbol.asyncIterator],i;return m?m.call(o):(o=typeof __values2=="function"?__values2(o):o[Symbol.iterator](),i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i);function verb(n){i[n]=o[n]&&function(v){return new Promise(function(resolve,reject){v=o[n](v),settle(resolve,reject,v.done,v.value)})}}function settle(resolve,reject,d,v){Promise.resolve(v).then(function(v2){resolve({value:v2,done:d})},reject)}},__makeTemplateObject2=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},__importStar2=function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)Object.hasOwnProperty.call(mod,k)&&(result[k]=mod[k]);return result.default=mod,result},__importDefault2=function(mod){return mod&&mod.__esModule?mod:{default:mod}},__classPrivateFieldGet2=function(receiver,privateMap){if(!privateMap.has(receiver))throw new TypeError("attempted to get private field on non-instance");return privateMap.get(receiver)},__classPrivateFieldSet2=function(receiver,privateMap,value){if(!privateMap.has(receiver))throw new TypeError("attempted to set private field on non-instance");return privateMap.set(receiver,value),value},exporter("__extends",__extends2),exporter("__assign",__assign2),exporter("__rest",__rest2),exporter("__decorate",__decorate2),exporter("__param",__param2),exporter("__metadata",__metadata2),exporter("__awaiter",__awaiter2),exporter("__generator",__generator2),exporter("__exportStar",__exportStar2),exporter("__createBinding",__createBinding2),exporter("__values",__values2),exporter("__read",__read2),exporter("__spread",__spread2),exporter("__spreadArrays",__spreadArrays2),exporter("__await",__await2),exporter("__asyncGenerator",__asyncGenerator2),exporter("__asyncDelegator",__asyncDelegator2),exporter("__asyncValues",__asyncValues2),exporter("__makeTemplateObject",__makeTemplateObject2),exporter("__importStar",__importStar2),exporter("__importDefault",__importDefault2),exporter("__classPrivateFieldGet",__classPrivateFieldGet2),exporter("__classPrivateFieldSet",__classPrivateFieldSet2)})}});var src_exports={};__export(src_exports,{UIDFork:()=>UIDFork,uid:()=>uid,useUID:()=>useUID2,useUIDSeed:()=>useUIDSeed2});module.exports=__toCommonJS(src_exports);var import_react=__toESM(require("react"));var generateUID=function(){var counter2=1,map=new WeakMap,uid2=function(item,index){return typeof item=="number"||typeof item=="string"?index?"idx-"+index:"val-"+item:map.has(item)?"uid"+map.get(item):(map.set(item,counter2++),uid2(item))};return uid2},uid=generateUID();var React3=__toESM(require("react"));var React=__toESM(require("react"));var createSource=function(prefix){return prefix===void 0&&(prefix=""),{value:1,prefix,uid:generateUID()}},counter=createSource(),source=React.createContext(createSource()),getId=function(source2){return source2.value++},getPrefix=function(source2){return source2?source2.prefix:""};var import_tslib=__toESM(require_tslib(),1),{__extends,__assign,__rest,__decorate,__param,__metadata,__awaiter,__generator,__exportStar,__createBinding,__values,__read,__spread,__spreadArrays,__await,__asyncGenerator,__asyncDelegator,__asyncValues,__makeTemplateObject,__importStar,__importDefault,__classPrivateFieldGet,__classPrivateFieldSet}=import_tslib.default;var React2=__toESM(require("react"));var prefixId=function(id,prefix,name){var uid2=prefix+id;return String(name?name(uid2):uid2)},UID=function(_super){__extends(UID2,_super);function UID2(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this.state={quartz:_this.props.idSource||counter,prefix:getPrefix(_this.props.idSource),id:getId(_this.props.idSource||counter)},_this.uid=function(item){return prefixId(_this.state.id+"-"+_this.state.quartz.uid(item),_this.state.prefix,_this.props.name)},_this}return UID2.prototype.render=function(){var _a=this.props,children=_a.children,name=_a.name,_b=this.state,id=_b.id,prefix=_b.prefix;return children(prefixId(id,prefix,name),this.uid)},UID2}(React2.Component);var UIDFork=function(_a){var children=_a.children,_b=_a.prefix,prefix=_b===void 0?"":_b;return React3.createElement(UIDConsumer,null,function(id){return React3.createElement(source.Provider,{value:createSource(id+"-"+prefix)},children)})},UIDConsumer=function(_a){var name=_a.name,children=_a.children;return React3.createElement(source.Consumer,null,function(value){return React3.createElement(UID,{name,idSource:value,children})})};var React4=__toESM(require("react"));var generateUID2=function(context){var quartz=context||counter,prefix=getPrefix(quartz),id=getId(quartz),uid2=prefix+id,gen=function(item){return uid2+quartz.uid(item)};return{uid:uid2,gen}},useUIDState=function(){return React4.useState(generateUID2(React4.useContext(source)))},useUID=function(){var uid2=useUIDState()[0].uid;return uid2},useUIDSeed=function(){var gen=useUIDState()[0].gen;return gen};var useId="useId",maybeReactUseId=import_react.default[useId],useUID2=maybeReactUseId!==void 0?maybeReactUseId:useUID,useUIDSeed2=maybeReactUseId!==void 0?()=>{let id=maybeReactUseId();return seed=>`${id}-${seed}`}:useUIDSeed;0&&(module.exports={UIDFork,uid,useUID,useUIDSeed}); | ||
/*! ***************************************************************************** | ||
@@ -3,0 +3,0 @@ Copyright (c) Microsoft Corporation. |
{ | ||
"name": "@twilio-paste/uid-library", | ||
"version": "0.2.6", | ||
"version": "1.0.0", | ||
"category": "library", | ||
@@ -31,9 +31,9 @@ "status": "production", | ||
"peerDependencies": { | ||
"react": "^16.8.6 || ^17.0.2", | ||
"react-dom": "^16.8.6 || ^17.0.2" | ||
"react": "^16.8.6 || ^17.0.2 || ^18.0.0", | ||
"react-dom": "^16.8.6 || ^17.0.2 || ^18.0.0" | ||
}, | ||
"devDependencies": { | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2" | ||
"react": "^18.0.0", | ||
"react-dom": "^18.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
145385
1305
2