Socket
Socket
Sign inDemoInstall

@hoory/embed

Package Overview
Dependencies
2
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.21 to 1.0.22

2

index.cjs.js

@@ -1,1 +0,1 @@

var b=Object.create,c=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var f=t=>c(t,"__esModule",{value:!0});var N=(t,o)=>{for(var e in o)c(t,e,{get:o[e],enumerable:!0})},R=(t,o,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of E(o))!D.call(t,i)&&i!=="default"&&c(t,i,{get:()=>o[i],enumerable:!(e=L(o,i))||e.enumerable});return t},P=t=>R(f(c(t!=null?b(z(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);f(exports);N(exports,{ENV_URLS:()=>H,useHoory:()=>U});var n=P(require("react")),H={DEV:"https://embed-dev.hoory.cloud/embed.js",PROD:"https://embed.hoory.com/embed.js"};function U(t,o={}){let e=(0,n.useRef)(""),[i,S]=(0,n.useState)(!1),[p,B]=(0,n.useState)(!1),s=o.env||"PROD",a=(...d)=>console.log(...d),I=(0,n.useCallback)(()=>{window.hoory.show()},[]),m=(0,n.useCallback)(()=>{window.hoory.hide()},[]),O=(0,n.useCallback)(()=>{window.hoory.openChat()},[]),v=(0,n.useCallback)(()=>{window.hoory.closeChat()},[]),g=(0,n.useCallback)(()=>{window.hoory.setUserInfo()},[]),l=(0,n.useCallback)(()=>{typeof o.onChatOpen=="function"&&o.onChatOpen(),a("Hoory:: onChatOpen called")},[o?.onChatOpen]),w=(0,n.useCallback)(()=>{typeof o.onChatClose=="function"&&o.onChatClose(),a("Hoory:: onChatClose called")},[o?.onChatClose]),C=(0,n.useCallback)(()=>{typeof o.onShowButton=="function"&&o.onShowButton(),a("Hoory:: onShowButton called")},[o?.onShowButton]),y=(0,n.useCallback)(()=>{typeof o.onHideButton=="function"&&o.onHideButton(),a("Hoory:: onHideButton called")},[o?.onHideButton]),u=(0,n.useCallback)(()=>{typeof o.onChatInit=="function"&&o.onChatInit(),a("Hoory:: onChatInit called")},[o?.onChatInit]),h=(0,n.useCallback)(()=>{typeof o.onScriptLoad=="function"&&o.onScriptLoad(),a("Hoory:: onScriptLoad called")},[o?.onScriptLoad]);return(0,n.useEffect)(()=>{window.hoory=window.hoory||{...o.user||{}},window.hoory.workspace=t,window.hoory.initializeHidden=o.initializeHidden,window.hoory.forceChatInit=o.forceChatInit;let d=document.getElementsByTagName("script")[0],r=document.createElement("script");r.id="HooryScript",r.async=!0,r.src=`${H[s]}${e.current}`,d.parentNode.insertBefore(r,d),r.onload=()=>{window.hoory.onOpen(()=>{l()}),window.hoory.onClose(()=>{w()}),window.hoory.onShow(()=>{C()}),window.hoory.onHide(()=>{y()}),window.hoory.onChatInit(()=>{u(),B(!0)}),h(),S(!0),window.hoory.init()}},[s,h]),{isScriptLoaded:i,isChatInitialized:p,showButton:I,hideButton:m,openChat:O,closeChat:v,setUserInfo:g,onChatOpen:l,onChatClose:w,onShowButton:C,onHideButton:y,onChatInit:u,onScriptLoad:h}}
var b=Object.create,c=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var f=t=>c(t,"__esModule",{value:!0});var N=(t,o)=>{for(var e in o)c(t,e,{get:o[e],enumerable:!0})},R=(t,o,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of E(o))!z.call(t,i)&&i!=="default"&&c(t,i,{get:()=>o[i],enumerable:!(e=L(o,i))||e.enumerable});return t},V=t=>R(f(c(t!=null?b(D(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);f(exports);N(exports,{ENV_URLS:()=>H,useHoory:()=>P});var n=V(require("react")),H={DEV:"https://embed-dev.hoory.cloud/embed.js",PROD:"https://embed.hoory.com/embed.js"};function P(t,o={}){let e=(0,n.useRef)(""),[i,S]=(0,n.useState)(!1),[p,B]=(0,n.useState)(!1),h=o.env||"PROD",a=(...d)=>h==="DEV"?console.log(...d):null,I=(0,n.useCallback)(()=>{window.hoory.show()},[]),m=(0,n.useCallback)(()=>{window.hoory.hide()},[]),O=(0,n.useCallback)(()=>{window.hoory.openChat()},[]),v=(0,n.useCallback)(()=>{window.hoory.closeChat()},[]),g=(0,n.useCallback)(()=>{window.hoory.setUserInfo()},[]),l=(0,n.useCallback)(()=>{typeof o.onChatOpen=="function"&&o.onChatOpen(),a("Hoory:: onChatOpen called")},[o?.onChatOpen]),w=(0,n.useCallback)(()=>{typeof o.onChatClose=="function"&&o.onChatClose(),a("Hoory:: onChatClose called")},[o?.onChatClose]),C=(0,n.useCallback)(()=>{typeof o.onShowButton=="function"&&o.onShowButton(),a("Hoory:: onShowButton called")},[o?.onShowButton]),y=(0,n.useCallback)(()=>{typeof o.onHideButton=="function"&&o.onHideButton(),a("Hoory:: onHideButton called")},[o?.onHideButton]),u=(0,n.useCallback)(()=>{typeof o.onChatInit=="function"&&o.onChatInit(),a("Hoory:: onChatInit called")},[o?.onChatInit]),s=(0,n.useCallback)(()=>{typeof o.onScriptLoad=="function"&&o.onScriptLoad(),a("Hoory:: onScriptLoad called")},[o?.onScriptLoad]);return(0,n.useEffect)(()=>{window.hoory=window.hoory||{...o.user||{}},window.hoory.workspace=t,window.hoory.initializeHidden=o.initializeHidden,window.hoory.forceChatInit=o.forceChatInit;let d=document.getElementsByTagName("script")[0],r=document.createElement("script");r.id="HooryScript",r.async=!0,r.src=`${H[h]}${e.current}`,d.parentNode.insertBefore(r,d),r.onload=()=>{window.hoory.onOpen(()=>{l()}),window.hoory.onClose(()=>{w()}),window.hoory.onShow(()=>{C()}),window.hoory.onHide(()=>{y()}),window.hoory.onChatInit(()=>{u(),B(!0)}),s(),S(!0),window.hoory.init()}},[h,s]),{isScriptLoaded:i,isChatInitialized:p,showButton:I,hideButton:m,openChat:O,closeChat:v,setUserInfo:g,onChatOpen:l,onChatClose:w,onShowButton:C,onHideButton:y,onChatInit:u,onScriptLoad:s}}

@@ -1,1 +0,1 @@

import{useCallback as n,useEffect as v,useRef as g,useState as w}from"react";var b={DEV:"https://embed-dev.hoory.cloud/embed.js",PROD:"https://embed.hoory.com/embed.js"};function E(C,o={}){let y=g(""),[u,f]=w(!1),[H,S]=w(!1),r=o.env||"PROD",t=(...i)=>console.log(...i),p=n(()=>{window.hoory.show()},[]),B=n(()=>{window.hoory.hide()},[]),I=n(()=>{window.hoory.openChat()},[]),m=n(()=>{window.hoory.closeChat()},[]),O=n(()=>{window.hoory.setUserInfo()},[]),d=n(()=>{typeof o.onChatOpen=="function"&&o.onChatOpen(),t("Hoory:: onChatOpen called")},[o?.onChatOpen]),c=n(()=>{typeof o.onChatClose=="function"&&o.onChatClose(),t("Hoory:: onChatClose called")},[o?.onChatClose]),h=n(()=>{typeof o.onShowButton=="function"&&o.onShowButton(),t("Hoory:: onShowButton called")},[o?.onShowButton]),s=n(()=>{typeof o.onHideButton=="function"&&o.onHideButton(),t("Hoory:: onHideButton called")},[o?.onHideButton]),l=n(()=>{typeof o.onChatInit=="function"&&o.onChatInit(),t("Hoory:: onChatInit called")},[o?.onChatInit]),a=n(()=>{typeof o.onScriptLoad=="function"&&o.onScriptLoad(),t("Hoory:: onScriptLoad called")},[o?.onScriptLoad]);return v(()=>{window.hoory=window.hoory||{...o.user||{}},window.hoory.workspace=C,window.hoory.initializeHidden=o.initializeHidden,window.hoory.forceChatInit=o.forceChatInit;let i=document.getElementsByTagName("script")[0],e=document.createElement("script");e.id="HooryScript",e.async=!0,e.src=`${b[r]}${y.current}`,i.parentNode.insertBefore(e,i),e.onload=()=>{window.hoory.onOpen(()=>{d()}),window.hoory.onClose(()=>{c()}),window.hoory.onShow(()=>{h()}),window.hoory.onHide(()=>{s()}),window.hoory.onChatInit(()=>{l(),S(!0)}),a(),f(!0),window.hoory.init()}},[r,a]),{isScriptLoaded:u,isChatInitialized:H,showButton:p,hideButton:B,openChat:I,closeChat:m,setUserInfo:O,onChatOpen:d,onChatClose:c,onShowButton:h,onHideButton:s,onChatInit:l,onScriptLoad:a}}export{b as ENV_URLS,E as useHoory};
import{useCallback as n,useEffect as v,useRef as g,useState as w}from"react";var b={DEV:"https://embed-dev.hoory.cloud/embed.js",PROD:"https://embed.hoory.com/embed.js"};function E(C,o={}){let y=g(""),[u,f]=w(!1),[H,S]=w(!1),a=o.env||"PROD",t=(...i)=>a==="DEV"?console.log(...i):null,p=n(()=>{window.hoory.show()},[]),B=n(()=>{window.hoory.hide()},[]),I=n(()=>{window.hoory.openChat()},[]),m=n(()=>{window.hoory.closeChat()},[]),O=n(()=>{window.hoory.setUserInfo()},[]),d=n(()=>{typeof o.onChatOpen=="function"&&o.onChatOpen(),t("Hoory:: onChatOpen called")},[o?.onChatOpen]),c=n(()=>{typeof o.onChatClose=="function"&&o.onChatClose(),t("Hoory:: onChatClose called")},[o?.onChatClose]),h=n(()=>{typeof o.onShowButton=="function"&&o.onShowButton(),t("Hoory:: onShowButton called")},[o?.onShowButton]),s=n(()=>{typeof o.onHideButton=="function"&&o.onHideButton(),t("Hoory:: onHideButton called")},[o?.onHideButton]),l=n(()=>{typeof o.onChatInit=="function"&&o.onChatInit(),t("Hoory:: onChatInit called")},[o?.onChatInit]),r=n(()=>{typeof o.onScriptLoad=="function"&&o.onScriptLoad(),t("Hoory:: onScriptLoad called")},[o?.onScriptLoad]);return v(()=>{window.hoory=window.hoory||{...o.user||{}},window.hoory.workspace=C,window.hoory.initializeHidden=o.initializeHidden,window.hoory.forceChatInit=o.forceChatInit;let i=document.getElementsByTagName("script")[0],e=document.createElement("script");e.id="HooryScript",e.async=!0,e.src=`${b[a]}${y.current}`,i.parentNode.insertBefore(e,i),e.onload=()=>{window.hoory.onOpen(()=>{d()}),window.hoory.onClose(()=>{c()}),window.hoory.onShow(()=>{h()}),window.hoory.onHide(()=>{s()}),window.hoory.onChatInit(()=>{l(),S(!0)}),r(),f(!0),window.hoory.init()}},[a,r]),{isScriptLoaded:u,isChatInitialized:H,showButton:p,hideButton:B,openChat:I,closeChat:m,setUserInfo:O,onChatOpen:d,onChatClose:c,onShowButton:h,onHideButton:s,onChatInit:l,onScriptLoad:r}}export{b as ENV_URLS,E as useHoory};

@@ -39,3 +39,3 @@ import { useCallback, useEffect, useRef, useState } from "react";

const env = options.env || "PROD";
const log = (...params) => console.log(...params);
const log = (...params) => (env === "DEV" ? console.log(...params) : null);

@@ -42,0 +42,0 @@ const showButton = useCallback(() => {

{
"name": "@hoory/embed",
"version": "1.0.21",
"version": "1.0.22",
"private": false,

@@ -5,0 +5,0 @@ "description": "Hoory script embedder",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc