welcome-ui 7.0.0-alpha.6 → 7.0.0-alpha.7

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.
@@ -1 +1,3 @@
1
1
  export * from './use-copy-text';
2
+ export * from './throttle';
3
+ export * from './hex-to-rgba';
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),m=require("./_commonjsHelpers-DvH0V_XJ.js");var y=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],o=0;o<e.rangeCount;o++)r.push(e.getRangeAt(o));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(s){e.addRange(s)}),t&&t.focus()}},g=y,f={"text/plain":"Text","text/html":"Url",default:"Text"},b="Copy to clipboard: #{key}, Enter";function v(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function C(e,t){var r,o,s,n,l,a,i=!1;t||(t={}),r=t.debug||!1;try{s=g(),n=document.createRange(),l=document.getSelection(),a=document.createElement("span"),a.textContent=e,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(c){if(c.stopPropagation(),t.format)if(c.preventDefault(),typeof c.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var u=f[t.format]||f.default;window.clipboardData.setData(u,e)}else c.clipboardData.clearData(),c.clipboardData.setData(t.format,e);t.onCopy&&(c.preventDefault(),t.onCopy(c.clipboardData))}),document.body.appendChild(a),n.selectNodeContents(a),l.addRange(n);var p=document.execCommand("copy");if(!p)throw new Error("copy command was unsuccessful");i=!0}catch(c){r&&console.error("unable to copy using execCommand: ",c),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),i=!0}catch(u){r&&console.error("unable to copy using clipboardData: ",u),r&&console.error("falling back to prompt"),o=v("message"in t?t.message:b),window.prompt(o,e)}}finally{l&&(typeof l.removeRange=="function"?l.removeRange(n):l.removeAllRanges()),a&&document.body.removeChild(a),s()}return i}var w=C;const D=m.getDefaultExportFromCjs(w);function x(e,t){const[r,o]=d.useState();return[d.useCallback(()=>{let n;typeof e=="number"||typeof e=="string"?n=e.toString():e.current instanceof HTMLInputElement?n=e.current.value:e.current instanceof HTMLElement&&(n=e.current.textContent);const l=D(n);o(l),t&&setTimeout(o,t)},[e,t]),r]}exports.useCopyText=x;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),m=require("./_commonjsHelpers-DvH0V_XJ.js"),y=require("./throttle-BB1Y3bfD.js"),g=require("./hex-to-rgba-cCYXRc5D.js");var b=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],o=0;o<e.rangeCount;o++)r.push(e.getRangeAt(o));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(s){e.addRange(s)}),t&&t.focus()}},v=b,f={"text/plain":"Text","text/html":"Url",default:"Text"},C="Copy to clipboard: #{key}, Enter";function w(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function D(e,t){var r,o,s,n,l,a,i=!1;t||(t={}),r=t.debug||!1;try{s=v(),n=document.createRange(),l=document.getSelection(),a=document.createElement("span"),a.textContent=e,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(c){if(c.stopPropagation(),t.format)if(c.preventDefault(),typeof c.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var u=f[t.format]||f.default;window.clipboardData.setData(u,e)}else c.clipboardData.clearData(),c.clipboardData.setData(t.format,e);t.onCopy&&(c.preventDefault(),t.onCopy(c.clipboardData))}),document.body.appendChild(a),n.selectNodeContents(a),l.addRange(n);var p=document.execCommand("copy");if(!p)throw new Error("copy command was unsuccessful");i=!0}catch(c){r&&console.error("unable to copy using execCommand: ",c),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),i=!0}catch(u){r&&console.error("unable to copy using clipboardData: ",u),r&&console.error("falling back to prompt"),o=w("message"in t?t.message:C),window.prompt(o,e)}}finally{l&&(typeof l.removeRange=="function"?l.removeRange(n):l.removeAllRanges()),a&&document.body.removeChild(a),s()}return i}var x=D;const T=m.getDefaultExportFromCjs(x);function h(e,t){const[r,o]=d.useState();return[d.useCallback(()=>{let n;typeof e=="number"||typeof e=="string"?n=e.toString():e.current instanceof HTMLInputElement?n=e.current.value:e.current instanceof HTMLElement&&(n=e.current.textContent);const l=T(n);o(l),t&&setTimeout(o,t)},[e,t]),r]}exports.throttle=y.throttle;exports.hexToRGBA=g.hexToRGBA;exports.useCopyText=h;
package/dist/utils.mjs CHANGED
@@ -1,6 +1,8 @@
1
1
  "use client";
2
2
  import { useState as p, useCallback as m } from "react";
3
3
  import { g } from "./_commonjsHelpers-CXJ7dpIk.mjs";
4
+ import { t as k } from "./throttle-BDBzFeFj.mjs";
5
+ import { h as U } from "./hex-to-rgba-BIDK-3ab.mjs";
4
6
  var y = function() {
5
7
  var e = document.getSelection();
6
8
  if (!e.rangeCount)
@@ -63,7 +65,7 @@ function w(e, t) {
63
65
  }
64
66
  var D = w;
65
67
  const x = /* @__PURE__ */ g(D);
66
- function S(e, t) {
68
+ function T(e, t) {
67
69
  const [r, o] = p();
68
70
  return [m(() => {
69
71
  let n;
@@ -73,5 +75,7 @@ function S(e, t) {
73
75
  }, [e, t]), r];
74
76
  }
75
77
  export {
76
- S as useCopyText
78
+ U as hexToRGBA,
79
+ k as throttle,
80
+ T as useCopyText
77
81
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "welcome-ui",
3
- "version": "7.0.0-alpha.6",
3
+ "version": "7.0.0-alpha.7",
4
4
  "description": "Customizable design system with react • styled-components • styled-system and ariakit.",
5
5
  "files": [
6
6
  "dist"