@necto-react/helpers 2.6.9 → 2.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.global.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var f=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var b=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},w=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of y(t))!P.call(e,o)&&o!==n&&f(e,o,{get:()=>t[o],enumerable:!(a=v(t,o))||a.enumerable});return e};var T=e=>w(f({},"__esModule",{value:!0}),e);var L={};b(L,{createEventHandler:()=>m,createSyntheticEvent:()=>x,filterDOMProps:()=>c,isKeyboardFocusEvent:()=>D,isVirtualClick:()=>g});module.exports=T(L);var M=new Set(["id"]);function c(e,t){let{allowLabelableProps:n=!1,allowLinkProps:a=!1,extraAllowedProps:o,allowedLabelableProps:l=new Set,allowedLinkProps:u=new Set}=t,s={};for(let r in e)Object.hasOwn(e,r)&&(M.has(r)||n&&l.has(r)||a&&u.has(r)||o?.has(r)||new RegExp(/^(data-.*)$/).test(r))&&(s[r]=e[r]);return s}var d=require("@necto/platform");function g(e){return e.mozInputSource===0&&e.isTrusted?!0:(0,d.isAndroid)()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}var E=require("std-env");function m(e){if(!e)return;let t=!0;return n=>{let a={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t&&E.isProduction?console.error("stopPropagation is now the default behavior for events in Necto. You can use continuePropagation() to revert this behavior."):t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(a),t&&n.stopPropagation()}}function x(e){let t=e;return Object.assign(t,{nativeEvent:e,isDefaultPrevented:()=>t.defaultPrevented,isPropagationStopped:()=>t.cancelBubble,persist:()=>{}}),t}var p=require("@necto/dom"),H=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),O={Tab:!0,Escape:!0};function D(e,t,n){if(!n||!("target"in n)||!n.target)return!1;let a=(0,p.getOwnerDocument)(n.target),o=(0,p.getOwnerWindow)(n.target);if(!a||!o)return!1;let l=typeof window<"u"?o.HTMLInputElement:HTMLInputElement,u=typeof window<"u"?o.HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?o.HTMLElement:HTMLElement,r=typeof window<"u"?o.KeyboardEvent:KeyboardEvent,i=a.activeElement;return e=e||i instanceof l&&!H.has(i.type)||i instanceof u||i instanceof s&&i.isContentEditable,!(e&&t==="keyboard"&&n instanceof r&&!O[n.key])}0&&(module.exports={createEventHandler,createSyntheticEvent,filterDOMProps,isKeyboardFocusEvent,isVirtualClick});
|
package/dist/index.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var Te=new Set(["id"]);function ve(e,t){let{allowLabelableProps:n=!1,allowLinkProps:o=!1,extraAllowedProps:l,allowedLabelableProps:A=new Set,allowedLinkProps:R=new Set}=t,m={};for(let r in e)Object.hasOwn(e,r)&&(Te.has(r)||n&&A.has(r)||o&&R.has(r)||l?.has(r)||new RegExp(/^(data-.*)$/).test(r))&&(m[r]=e[r]);return m}function Ae(e){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}var w=()=>Ae(/Android/i);function Je(e){return e.mozInputSource===0&&e.isTrusted?!0:w()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}var Ue={},T=Object.create(null),u=e=>globalThis.process?.env||Ue.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?T:globalThis),i=new Proxy(T,{get(e,t){return u()[t]??T[t]},has(e,t){let n=u();return t in n||t in T},set(e,t,n){let o=u(!0);return o[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=u(!0);return delete n[t],!0},ownKeys(){let e=u(!0);return Object.keys(e)}}),y=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",Re=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CLOUDFLARE_WORKERS","WORKERS_CI",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function Ie(){if(globalThis.process?.env)for(let e of Re){let t=e[1]||e[0];if(globalThis.process?.env[t])return{name:e[0].toLowerCase(),...e[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}var O=Ie(),tt=O.name;function s(e){return e?e!=="false":!1}var I=globalThis.process?.platform||"",C=s(i.CI)||O.ci!==!1,h=s(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);var nt=s(i.DEBUG),Se=y==="test"||s(i.TEST),P=y==="production";var ot=s(i.MINIMAL)||C||Se||!h,ge=/^win/i.test(I),rt=/^linux/i.test(I),at=/^darwin/i.test(I),it=!s(i.NO_COLOR)&&(s(i.FORCE_COLOR)||(h||ge)&&i.TERM!=="dumb"||C),Le=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null,st=Number(Le?.split(".")[0])||null,be=globalThis.process||Object.create(null),_={versions:{}},lt=new Proxy(be,{get(e,t){if(t==="env")return i;if(t in e)return e[t];if(t in _)return _[t]}}),we=globalThis.process?.release?.name==="node",_e=!!globalThis.Bun||!!globalThis.process?.versions?.bun,ye=!!globalThis.Deno,Oe=!!globalThis.fastly,Ce=!!globalThis.Netlify,he=!!globalThis.EdgeRuntime,Pe=globalThis.navigator?.userAgent==="Cloudflare-Workers",De=[[Ce,"netlify"],[he,"edge-light"],[Pe,"workerd"],[Oe,"fastly"],[ye,"deno"],[_e,"bun"],[we,"node"]];function Ne(){let e=De.find(t=>t[0]);if(e)return{name:e[1]}}var Me=Ne(),ct=Me?.name||"";function Be(e){if(!e)return;let t=!0;return n=>{let o={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t&&P?console.error("stopPropagation is now the default behavior for events in Necto. You can use continuePropagation() to revert this behavior."):t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(o),t&&n.stopPropagation()}}function mt(e){let t=e;return Object.assign(t,{nativeEvent:e,isDefaultPrevented:()=>t.defaultPrevented,isPropagationStopped:()=>t.cancelBubble,persist:()=>{}}),t}var He=Object.defineProperty,v=(e,t)=>{for(var n in t)He(e,n,{get:t[n],enumerable:!0})},c={};v(c,{ARIA_ATTRIBUTES:()=>D,HTML_TAGS:()=>M,PRIMITIVE_TAGS:()=>N,default:()=>xe});var D=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"],N=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],M=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"],xe={ARIA_ATTRIBUTES:D,PRIMITIVE_TAGS:N,HTML_TAGS:M},Ke={};v(Ke,{NUMERIC_DIGITS:()=>U,default:()=>Fe});var U=["1","2","3","4","5","6","7","8","9","0"],Fe={NUMERIC_DIGITS:U},Ge={};v(Ge,{AMPERSAND:()=>Y,ASTERISK:()=>Q,BACKSLASH:()=>re,BOM:()=>B,CARRIAGE_RETURN:()=>K,COLON:()=>q,COMMA:()=>Z,COMMERCIAL_AT:()=>ne,DOT:()=>X,DOUBLE_QUOTE:()=>V,EXCLAMATION:()=>G,GRAVE_ACCENT:()=>ie,GREATER_THAN:()=>ee,LEFT_CURLY_BRACKET:()=>se,LEFT_SQUARE_BRACKET:()=>oe,LINE_FEED:()=>x,MINUS:()=>$,PERCENT:()=>W,PLUS:()=>z,QUESTION:()=>te,RIGHT_CURLY_BRACKET:()=>ce,RIGHT_SQUARE_BRACKET:()=>ae,SHARP:()=>k,SINGLE_QUOTE:()=>j,SMALLER_THAN:()=>J,SPACE:()=>F,TAB:()=>H,VERTICAL_LINE:()=>le,default:()=>Ve});var B=65279,H=9,x=10,K=13,F=32,G=33,V=34,k=35,W=37,Y=38,j=39,Q=42,z=43,Z=44,$=45,X=46,q=58,J=60,ee=62,te=63,ne=64,oe=91,re=92,ae=93,ie=96,se=123,le=124,ce=125,Ve={BOM:B,TAB:H,LINE_FEED:x,CARRIAGE_RETURN:K,SPACE:F,EXCLAMATION:G,DOUBLE_QUOTE:V,SHARP:k,PERCENT:W,AMPERSAND:Y,SINGLE_QUOTE:j,ASTERISK:Q,PLUS:z,COMMA:Z,MINUS:$,DOT:X,COLON:q,SMALLER_THAN:J,GREATER_THAN:ee,QUESTION:te,COMMERCIAL_AT:ne,LEFT_SQUARE_BRACKET:oe,BACKSLASH:re,RIGHT_SQUARE_BRACKET:ae,GRAVE_ACCENT:ie,LEFT_CURLY_BRACKET:se,VERTICAL_LINE:le,RIGHT_CURLY_BRACKET:ce},ke={};v(ke,{CAPITALIZED:()=>de,LOWERCASE:()=>ue,VOWELS:()=>Ee,default:()=>We});var de=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ue=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],Ee=["A","E","I","O","U","a","e","i","o","u"],We={CAPITALIZED:de,LOWERCASE:ue,VOWELS:Ee};function L(e){if(e?.ownerDocument)return e.ownerDocument;if(typeof document<"u")return document;throw new Error("getOwnerDocument called in an environment without document")}function pe(e){return e&&"window"in e&&e.window===e?e:L(e).defaultView||(typeof window<"u"?window:void 0)}var E=new Map,fe=new Set;function Ye(e){if(!("propertyName"in e)||!e.target)return;let t=E.get(e.target);t||(t=new Set,E.set(e.target,t),e.target.addEventListener("transitioncancel",b,{once:!0})),t.add(e.propertyName)}function b(e){if(!("propertyName"in e)||!e.target)return;let t=E.get(e.target);if(t&&(t.delete(e.propertyName),t.size===0&&(e.target.removeEventListener("transitioncancel",b),E.delete(e.target)),E.size===0)){for(let n of fe)n();fe.clear()}}if(typeof window<"u"&&typeof document<"u"){let e=()=>{let t=document.body;t&&(t.addEventListener("transitionrun",Ye),t.addEventListener("transitionend",b))};document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e,{once:!0})}var a,S=()=>c.HTML_TAGS.reduce((e,t)=>{var n;return e[n=t,n.charAt(0).toUpperCase()+n.slice(1)]=t,e},{}),It=new Proxy({},{get:(e,t,n)=>(a||(a=S()),Reflect.get(a,t,n)),ownKeys:()=>(a||(a=S()),Reflect.ownKeys(a)),getOwnPropertyDescriptor:(e,t)=>(a||(a=S()),Object.getOwnPropertyDescriptor(a,t))});var f,g,me,p=()=>{f||(f=c.ARIA_ATTRIBUTES.reduce((e,t)=>(e[(n=>{let o=n.replace("aria-","");return o.charAt(0).toUpperCase()+o.slice(1)})(t)]=t,e),{}),g=c.ARIA_ATTRIBUTES,me=new Set(g))},Lt=new Proxy({},{get:(e,t,n)=>(p(),Reflect.get(f,t,n)),ownKeys:()=>(p(),Reflect.ownKeys(f)),getOwnPropertyDescriptor:(e,t)=>(p(),Object.getOwnPropertyDescriptor(f,t))}),bt=new Proxy([],{get:(e,t,n)=>(p(),Reflect.get(g,t,n))}),wt=new Proxy(new Set,{get:(e,t,n)=>(p(),Reflect.get(me,t,n))});var je=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),Qe={Tab:!0,Escape:!0};function Ot(e,t,n){if(!n||!("target"in n)||!n.target)return!1;let o=L(n.target),l=pe(n.target),A=typeof window<"u"?l.HTMLInputElement:HTMLInputElement,R=typeof window<"u"?l.HTMLTextAreaElement:HTMLTextAreaElement,m=typeof window<"u"?l.HTMLElement:HTMLElement,r=typeof window<"u"?l.KeyboardEvent:KeyboardEvent,d=o.activeElement;return e=e||d instanceof A&&!je.has(d.type)||d instanceof R||d instanceof m&&d.isContentEditable,!(e&&t==="keyboard"&&n instanceof r&&!Qe[n.key])}})();
|
|
1
|
+
"use strict";(()=>{var Te=new Set(["id"]);function ve(e,t){let{allowLabelableProps:n=!1,allowLinkProps:o=!1,extraAllowedProps:s,allowedLabelableProps:A=new Set,allowedLinkProps:R=new Set}=t,m={};for(let r in e)Object.hasOwn(e,r)&&(Te.has(r)||n&&A.has(r)||o&&R.has(r)||s?.has(r)||new RegExp(/^(data-.*)$/).test(r))&&(m[r]=e[r]);return m}function Ae(e){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}var w=()=>Ae(/Android/i);function Je(e){return e.mozInputSource===0&&e.isTrusted?!0:w()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}var Ue={},T=Object.create(null),u=e=>globalThis.process?.env||Ue.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?T:globalThis),i=new Proxy(T,{get(e,t){return u()[t]??T[t]},has(e,t){let n=u();return t in n||t in T},set(e,t,n){let o=u(!0);return o[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=u(!0);return delete n[t],!0},ownKeys(){let e=u(!0);return Object.keys(e)}}),y=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",Re=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CLOUDFLARE_WORKERS","WORKERS_CI",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function Ie(){if(globalThis.process?.env)for(let e of Re){let t=e[1]||e[0];if(globalThis.process?.env[t])return{name:e[0].toLowerCase(),...e[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}var C=Ie(),tt=C.name;function l(e){return e?e!=="false":!1}var I=globalThis.process?.platform||"",O=l(i.CI)||C.ci!==!1,h=l(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);var nt=l(i.DEBUG),Se=y==="test"||l(i.TEST),P=y==="production";var ot=l(i.MINIMAL)||O||Se||!h,ge=/^win/i.test(I),rt=/^linux/i.test(I),at=/^darwin/i.test(I),it=!l(i.NO_COLOR)&&(l(i.FORCE_COLOR)||(h||ge)&&i.TERM!=="dumb"||O),Le=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null,st=Number(Le?.split(".")[0])||null,be=globalThis.process||Object.create(null),_={versions:{}},lt=new Proxy(be,{get(e,t){if(t==="env")return i;if(t in e)return e[t];if(t in _)return _[t]}}),we=globalThis.process?.release?.name==="node",_e=!!globalThis.Bun||!!globalThis.process?.versions?.bun,ye=!!globalThis.Deno,Ce=!!globalThis.fastly,Oe=!!globalThis.Netlify,he=!!globalThis.EdgeRuntime,Pe=globalThis.navigator?.userAgent==="Cloudflare-Workers",De=[[Oe,"netlify"],[he,"edge-light"],[Pe,"workerd"],[Ce,"fastly"],[ye,"deno"],[_e,"bun"],[we,"node"]];function Ne(){let e=De.find(t=>t[0]);if(e)return{name:e[1]}}var Me=Ne(),ct=Me?.name||"";function Be(e){if(!e)return;let t=!0;return n=>{let o={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t&&P?console.error("stopPropagation is now the default behavior for events in Necto. You can use continuePropagation() to revert this behavior."):t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(o),t&&n.stopPropagation()}}function mt(e){let t=e;return Object.assign(t,{nativeEvent:e,isDefaultPrevented:()=>t.defaultPrevented,isPropagationStopped:()=>t.cancelBubble,persist:()=>{}}),t}var He=Object.defineProperty,v=(e,t)=>{for(var n in t)He(e,n,{get:t[n],enumerable:!0})},c={};v(c,{ARIA_ATTRIBUTES:()=>D,HTML_TAGS:()=>M,PRIMITIVE_TAGS:()=>N,default:()=>xe});var D=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"],N=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],M=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"],xe={ARIA_ATTRIBUTES:D,PRIMITIVE_TAGS:N,HTML_TAGS:M},Ke={};v(Ke,{NUMERIC_DIGITS:()=>U,default:()=>Ve});var U=["1","2","3","4","5","6","7","8","9","0"],Ve={NUMERIC_DIGITS:U},Fe={};v(Fe,{AMPERSAND:()=>Y,ASTERISK:()=>Q,BACKSLASH:()=>re,BOM:()=>B,CARRIAGE_RETURN:()=>K,COLON:()=>q,COMMA:()=>Z,COMMERCIAL_AT:()=>ne,DOT:()=>X,DOUBLE_QUOTE:()=>G,EXCLAMATION:()=>F,GRAVE_ACCENT:()=>ie,GREATER_THAN:()=>ee,LEFT_CURLY_BRACKET:()=>se,LEFT_SQUARE_BRACKET:()=>oe,LINE_FEED:()=>x,MINUS:()=>$,PERCENT:()=>W,PLUS:()=>z,QUESTION:()=>te,RIGHT_CURLY_BRACKET:()=>ce,RIGHT_SQUARE_BRACKET:()=>ae,SHARP:()=>k,SINGLE_QUOTE:()=>j,SMALLER_THAN:()=>J,SPACE:()=>V,TAB:()=>H,VERTICAL_LINE:()=>le,default:()=>Ge});var B=65279,H=9,x=10,K=13,V=32,F=33,G=34,k=35,W=37,Y=38,j=39,Q=42,z=43,Z=44,$=45,X=46,q=58,J=60,ee=62,te=63,ne=64,oe=91,re=92,ae=93,ie=96,se=123,le=124,ce=125,Ge={BOM:B,TAB:H,LINE_FEED:x,CARRIAGE_RETURN:K,SPACE:V,EXCLAMATION:F,DOUBLE_QUOTE:G,SHARP:k,PERCENT:W,AMPERSAND:Y,SINGLE_QUOTE:j,ASTERISK:Q,PLUS:z,COMMA:Z,MINUS:$,DOT:X,COLON:q,SMALLER_THAN:J,GREATER_THAN:ee,QUESTION:te,COMMERCIAL_AT:ne,LEFT_SQUARE_BRACKET:oe,BACKSLASH:re,RIGHT_SQUARE_BRACKET:ae,GRAVE_ACCENT:ie,LEFT_CURLY_BRACKET:se,VERTICAL_LINE:le,RIGHT_CURLY_BRACKET:ce},ke={};v(ke,{CAPITALIZED:()=>de,LOWERCASE:()=>ue,VOWELS:()=>Ee,default:()=>We});var de=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ue=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],Ee=["A","E","I","O","U","a","e","i","o","u"],We={CAPITALIZED:de,LOWERCASE:ue,VOWELS:Ee};function L(e){return e?.ownerDocument?e.ownerDocument:typeof document<"u"?document:void 0}function pe(e){if(e&&"window"in e&&e.window===e)return e;let t=L(e);return t?.defaultView?t.defaultView:typeof window<"u"?window:void 0}var E=new Map,fe=new Set;function Ye(e){if(!("propertyName"in e)||!e.target)return;let t=E.get(e.target);t||(t=new Set,E.set(e.target,t),e.target.addEventListener("transitioncancel",b,{once:!0})),t.add(e.propertyName)}function b(e){if(!("propertyName"in e)||!e.target)return;let t=E.get(e.target);if(t&&(t.delete(e.propertyName),t.size===0&&(e.target.removeEventListener("transitioncancel",b),E.delete(e.target)),E.size===0)){for(let n of fe)n();fe.clear()}}if(typeof window<"u"&&typeof document<"u"){let e=()=>{let t=document.body;t&&(t.addEventListener("transitionrun",Ye),t.addEventListener("transitionend",b))};document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e,{once:!0})}var a,S=()=>c.HTML_TAGS.reduce((e,t)=>{var n;return e[n=t,n.charAt(0).toUpperCase()+n.slice(1)]=t,e},{}),It=new Proxy({},{get:(e,t,n)=>(a||(a=S()),Reflect.get(a,t,n)),ownKeys:()=>(a||(a=S()),Reflect.ownKeys(a)),getOwnPropertyDescriptor:(e,t)=>(a||(a=S()),Object.getOwnPropertyDescriptor(a,t))});var f,g,me,p=()=>{f||(f=c.ARIA_ATTRIBUTES.reduce((e,t)=>(e[(n=>{let o=n.replace("aria-","");return o.charAt(0).toUpperCase()+o.slice(1)})(t)]=t,e),{}),g=c.ARIA_ATTRIBUTES,me=new Set(g))},Lt=new Proxy({},{get:(e,t,n)=>(p(),Reflect.get(f,t,n)),ownKeys:()=>(p(),Reflect.ownKeys(f)),getOwnPropertyDescriptor:(e,t)=>(p(),Object.getOwnPropertyDescriptor(f,t))}),bt=new Proxy([],{get:(e,t,n)=>(p(),Reflect.get(g,t,n))}),wt=new Proxy(new Set,{get:(e,t,n)=>(p(),Reflect.get(me,t,n))});var je=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),Qe={Tab:!0,Escape:!0};function Ct(e,t,n){if(!n||!("target"in n)||!n.target)return!1;let o=L(n.target),s=pe(n.target);if(!o||!s)return!1;let A=typeof window<"u"?s.HTMLInputElement:HTMLInputElement,R=typeof window<"u"?s.HTMLTextAreaElement:HTMLTextAreaElement,m=typeof window<"u"?s.HTMLElement:HTMLElement,r=typeof window<"u"?s.KeyboardEvent:KeyboardEvent,d=o.activeElement;return e=e||d instanceof A&&!je.has(d.type)||d instanceof R||d instanceof m&&d.isContentEditable,!(e&&t==="keyboard"&&n instanceof r&&!Qe[n.key])}})();
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=new Set(["id"]);function
|
|
1
|
+
var u=new Set(["id"]);function f(e,t){let{allowLabelableProps:n=!1,allowLinkProps:a=!1,extraAllowedProps:r,allowedLabelableProps:p=new Set,allowedLinkProps:l=new Set}=t,s={};for(let o in e)Object.hasOwn(e,o)&&(u.has(o)||n&&p.has(o)||a&&l.has(o)||r?.has(o)||new RegExp(/^(data-.*)$/).test(o))&&(s[o]=e[o]);return s}import{isAndroid as c}from"@necto/platform";function g(e){return e.mozInputSource===0&&e.isTrusted?!0:c()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}import{isProduction as d}from"std-env";function E(e){if(!e)return;let t=!0;return n=>{let a={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t&&d?console.error("stopPropagation is now the default behavior for events in Necto. You can use continuePropagation() to revert this behavior."):t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(a),t&&n.stopPropagation()}}function S(e){let t=e;return Object.assign(t,{nativeEvent:e,isDefaultPrevented:()=>t.defaultPrevented,isPropagationStopped:()=>t.cancelBubble,persist:()=>{}}),t}import{getOwnerDocument as m,getOwnerWindow as v}from"@necto/dom";var y=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),P={Tab:!0,Escape:!0};function F(e,t,n){if(!n||!("target"in n)||!n.target)return!1;let a=m(n.target),r=v(n.target);if(!a||!r)return!1;let p=typeof window<"u"?r.HTMLInputElement:HTMLInputElement,l=typeof window<"u"?r.HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?r.HTMLElement:HTMLElement,o=typeof window<"u"?r.KeyboardEvent:KeyboardEvent,i=a.activeElement;return e=e||i instanceof p&&!y.has(i.type)||i instanceof l||i instanceof s&&i.isContentEditable,!(e&&t==="keyboard"&&n instanceof o&&!P[n.key])}export{E as createEventHandler,S as createSyntheticEvent,f as filterDOMProps,F as isKeyboardFocusEvent,g as isVirtualClick};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@necto-react/helpers",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.10",
|
|
4
4
|
"description": "Necto's library for providing global helpers React applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"std-env": "^3.9.0",
|
|
36
36
|
"@necto-react/types": "2.4.1",
|
|
37
|
-
"@necto/
|
|
38
|
-
"@necto/
|
|
37
|
+
"@necto/platform": "1.5.1",
|
|
38
|
+
"@necto/dom": "1.6.10"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"test": "vitest",
|