@knocklabs/react 0.10.3 → 0.10.4
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/CHANGELOG.md +8 -0
- package/dist/cjs/modules/core/utils.js +1 -1
- package/dist/cjs/modules/core/utils.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackAuthButton/SlackAuthButton.js +1 -1
- package/dist/cjs/modules/slack/components/SlackAuthButton/SlackAuthButton.js.map +1 -1
- package/dist/esm/modules/core/utils.mjs +1 -1
- package/dist/esm/modules/core/utils.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs +45 -35
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackAuthButton/SlackAuthButton.mjs +44 -34
- package/dist/esm/modules/slack/components/SlackAuthButton/SlackAuthButton.mjs.map +1 -1
- package/dist/types/modules/core/utils.d.ts +1 -1
- package/dist/types/modules/core/utils.d.ts.map +1 -1
- package/dist/types/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.d.ts.map +1 -1
- package/dist/types/modules/slack/components/SlackAuthButton/SlackAuthButton.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f9aca69: fix: poll to check if OAuth connection succeeded in case popup communication fails during Slack and Microsoft Teams auth flows
|
|
8
|
+
- Updated dependencies [f9aca69]
|
|
9
|
+
- @knocklabs/react-core@0.12.4
|
|
10
|
+
|
|
3
11
|
## 0.10.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=e=>{const n=window.screenLeft??window.screenX,t=window.screenTop??window.screenY,o=window.innerWidth??document.documentElement.clientWidth??screen.width,i=window.innerHeight??document.documentElement.clientHeight??screen.height,c=o/2-600/2+n,d=`width=600,height=800,top=${i/2-800/2+t},left=${c}`;window.open(e,"_blank",d)},h=()=>{if(typeof window<"u")return window};exports.checkForWindow=h;exports.openPopupWindow=w;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=e=>{const n=window.screenLeft??window.screenX,t=window.screenTop??window.screenY,o=window.innerWidth??document.documentElement.clientWidth??screen.width,i=window.innerHeight??document.documentElement.clientHeight??screen.height,c=o/2-600/2+n,d=`width=600,height=800,top=${i/2-800/2+t},left=${c}`;return window.open(e,"_blank",d)},h=()=>{if(typeof window<"u")return window};exports.checkForWindow=h;exports.openPopupWindow=w;
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/modules/core/utils.ts"],"sourcesContent":["export const openPopupWindow = (url: string) => {\n const width = 600;\n const height = 800;\n // Calculate the position to center the window\n const screenLeft = window.screenLeft ?? window.screenX;\n const screenTop = window.screenTop ?? window.screenY;\n\n const innerWidth =\n window.innerWidth ?? document.documentElement.clientWidth ?? screen.width;\n const innerHeight =\n window.innerHeight ??\n document.documentElement.clientHeight ??\n screen.height;\n\n const left = innerWidth / 2 - width / 2 + screenLeft;\n const top = innerHeight / 2 - height / 2 + screenTop;\n\n // Window features\n const features = `width=${width},height=${height},top=${top},left=${left}`;\n\n window.open(url, \"_blank\", features);\n};\n\nexport const checkForWindow = () => {\n if (typeof window !== \"undefined\") {\n return window;\n }\n};\n"],"names":["openPopupWindow","url","screenLeft","window","screenX","screenTop","screenY","innerWidth","document","documentElement","clientWidth","screen","width","innerHeight","clientHeight","height","left","features","open","checkForWindow"],"mappings":"gFAAaA,MAAAA,EAAmBC,GAAgB,CAIxCC,MAAAA,EAAaC,OAAOD,YAAcC,OAAOC,QACzCC,EAAYF,OAAOE,WAAaF,OAAOG,QAEvCC,EACJJ,OAAOI,YAAcC,SAASC,gBAAgBC,aAAeC,OAAOC,MAChEC,EACJV,OAAOU,aACPL,SAASC,gBAAgBK,cACzBH,OAAOI,OAEHC,EAAOT,EAAa,EAAIK,IAAQ,EAAIV,EAIpCe,EAAW,4BAHLJ,EAAc,EAAIE,IAAS,EAAIV,CAGgB,SAASW,CAAI,
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/modules/core/utils.ts"],"sourcesContent":["export const openPopupWindow = (url: string) => {\n const width = 600;\n const height = 800;\n // Calculate the position to center the window\n const screenLeft = window.screenLeft ?? window.screenX;\n const screenTop = window.screenTop ?? window.screenY;\n\n const innerWidth =\n window.innerWidth ?? document.documentElement.clientWidth ?? screen.width;\n const innerHeight =\n window.innerHeight ??\n document.documentElement.clientHeight ??\n screen.height;\n\n const left = innerWidth / 2 - width / 2 + screenLeft;\n const top = innerHeight / 2 - height / 2 + screenTop;\n\n // Window features\n const features = `width=${width},height=${height},top=${top},left=${left}`;\n\n return window.open(url, \"_blank\", features);\n};\n\nexport const checkForWindow = () => {\n if (typeof window !== \"undefined\") {\n return window;\n }\n};\n"],"names":["openPopupWindow","url","screenLeft","window","screenX","screenTop","screenY","innerWidth","document","documentElement","clientWidth","screen","width","innerHeight","clientHeight","height","left","features","open","checkForWindow"],"mappings":"gFAAaA,MAAAA,EAAmBC,GAAgB,CAIxCC,MAAAA,EAAaC,OAAOD,YAAcC,OAAOC,QACzCC,EAAYF,OAAOE,WAAaF,OAAOG,QAEvCC,EACJJ,OAAOI,YAAcC,SAASC,gBAAgBC,aAAeC,OAAOC,MAChEC,EACJV,OAAOU,aACPL,SAASC,gBAAgBK,cACzBH,OAAOI,OAEHC,EAAOT,EAAa,EAAIK,IAAQ,EAAIV,EAIpCe,EAAW,4BAHLJ,EAAc,EAAIE,IAAS,EAAIV,CAGgB,SAASW,CAAI,GAExE,OAAOb,OAAOe,KAAKjB,EAAK,SAAUgB,CAAQ,CAC5C,EAEaE,EAAiBA,IAAM,CAC9B,GAAA,OAAOhB,OAAW,IACbA,OAAAA,MAEX"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),c=require("@knocklabs/react-core"),T=require("../../../core/utils.js");;/* empty css */const r=require("../MsTeamsIcon/MsTeamsIcon.js");;/* empty css */const I=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},e=I(b),x=({redirectUrl:t,onAuthenticationComplete:d,...l})=>{const f="graphApiClientId"in l?l.graphApiClientId:l.msTeamsBotId,{t:n}=c.useTranslations(),i=c.useKnockClient(),{setConnectionStatus:s,connectionStatus:o,setActionLabel:a,actionLabel:p,errorLabel:g,tenantId:h,knockMsTeamsChannelId:_,popupWindowRef:u}=c.useKnockMsTeamsClient(),{buildMsTeamsAuthUrl:k,disconnectFromMsTeams:C}=c.useMsTeamsAuth(f,t);c.useAuthPostMessageListener({knockHost:i.host,popupWindowRef:u,setConnectionStatus:s,onAuthenticationComplete:d}),c.useAuthPolling({popupWindowRef:u,setConnectionStatus:s,onAuthenticationComplete:d,authCheckFn:b.useCallback(async()=>i.msTeams.authCheck({tenant:h,knockChannelId:_}),[i.msTeams,h,_])});const M=n("msTeamsDisconnect")||null,E=n("msTeamsReconnect")||null;return o==="connecting"||o==="disconnecting"?e.default.createElement("div",{className:"rtk-connect__button rtk-connect__button--loading"},e.default.createElement(r.MsTeamsIcon,{height:"16px",width:"16px"}),e.default.createElement("span",null,n(o==="connecting"?"msTeamsConnecting":"msTeamsDisconnecting"))):o==="error"?e.default.createElement("button",{onClick:()=>{const m=T.openPopupWindow(k());u.current=m,s("connecting")},className:"rtk-connect__button rtk-connect__button--error",onMouseEnter:()=>a(E),onMouseLeave:()=>a(null)},e.default.createElement(r.MsTeamsIcon,{height:"16px",width:"16px"}),e.default.createElement("span",{className:"rtk-connect__button__text--error"},p||g||n("msTeamsError"))):o==="disconnected"?e.default.createElement("button",{onClick:()=>{const m=T.openPopupWindow(k());u.current=m,s("connecting")},className:"rtk-connect__button rtk-connect__button--disconnected"},e.default.createElement(r.MsTeamsIcon,{height:"16px",width:"16px"}),e.default.createElement("span",null,n("msTeamsConnect"))):e.default.createElement("button",{onClick:C,className:"rtk-connect__button rtk-connect__button--connected",onMouseEnter:()=>a(M),onMouseLeave:()=>a(null)},e.default.createElement(r.MsTeamsIcon,{height:"16px",width:"16px"}),e.default.createElement("span",{className:"rtk-connect__button__text--connected"},p||n("msTeamsConnected")))};exports.MsTeamsAuthButton=x;
|
|
2
2
|
//# sourceMappingURL=MsTeamsAuthButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MsTeamsAuthButton.js","sources":["../../../../../../src/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.tsx"],"sourcesContent":["import {\n useKnockClient,\n useKnockMsTeamsClient,\n useMsTeamsAuth,\n useTranslations,\n} from \"@knocklabs/react-core\";\nimport { FunctionComponent,
|
|
1
|
+
{"version":3,"file":"MsTeamsAuthButton.js","sources":["../../../../../../src/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.tsx"],"sourcesContent":["import {\n useAuthPolling,\n useAuthPostMessageListener,\n useKnockClient,\n useKnockMsTeamsClient,\n useMsTeamsAuth,\n useTranslations,\n} from \"@knocklabs/react-core\";\nimport { FunctionComponent, useCallback } from \"react\";\n\nimport { openPopupWindow } from \"../../../core/utils\";\nimport \"../../theme.css\";\nimport { MsTeamsIcon } from \"../MsTeamsIcon\";\n\nimport \"./styles.css\";\n\nexport type MsTeamsAuthButtonProps = {\n redirectUrl?: string;\n onAuthenticationComplete?: (authenticationResp: string) => void;\n} & (\n | {\n /**\n * The client ID of your Microsoft Graph API-enabled application registered with Microsoft Entra. This should\n * match the \"Graph API client ID\" setting of your Microsoft Teams channel in the Knock dashboard.\n */\n graphApiClientId: string;\n }\n | {\n /**\n * @deprecated Use `graphApiClientId` instead. This field will be removed in a future release.\n */\n msTeamsBotId: string;\n }\n);\n\nexport const MsTeamsAuthButton: FunctionComponent<MsTeamsAuthButtonProps> = ({\n redirectUrl,\n onAuthenticationComplete,\n ...props\n}) => {\n const graphApiClientId =\n \"graphApiClientId\" in props ? props.graphApiClientId : props.msTeamsBotId;\n\n const { t } = useTranslations();\n const knock = useKnockClient();\n\n const {\n setConnectionStatus,\n connectionStatus,\n setActionLabel,\n actionLabel,\n errorLabel,\n tenantId,\n knockMsTeamsChannelId,\n popupWindowRef,\n } = useKnockMsTeamsClient();\n\n const { buildMsTeamsAuthUrl, disconnectFromMsTeams } = useMsTeamsAuth(\n graphApiClientId,\n redirectUrl,\n );\n\n useAuthPostMessageListener({\n knockHost: knock.host,\n popupWindowRef,\n setConnectionStatus,\n onAuthenticationComplete,\n });\n\n useAuthPolling({\n popupWindowRef,\n setConnectionStatus,\n onAuthenticationComplete,\n authCheckFn: useCallback(async () => {\n return knock.msTeams.authCheck({\n tenant: tenantId,\n knockChannelId: knockMsTeamsChannelId,\n });\n }, [knock.msTeams, tenantId, knockMsTeamsChannelId]),\n });\n\n const disconnectLabel = t(\"msTeamsDisconnect\") || null;\n const reconnectLabel = t(\"msTeamsReconnect\") || null;\n\n // Loading states\n if (\n connectionStatus === \"connecting\" ||\n connectionStatus === \"disconnecting\"\n ) {\n return (\n <div className=\"rtk-connect__button rtk-connect__button--loading\">\n <MsTeamsIcon height=\"16px\" width=\"16px\" />\n <span>\n {connectionStatus === \"connecting\"\n ? t(\"msTeamsConnecting\")\n : t(\"msTeamsDisconnecting\")}\n </span>\n </div>\n );\n }\n\n // Error state\n if (connectionStatus === \"error\") {\n return (\n <button\n onClick={() => {\n const popup = openPopupWindow(buildMsTeamsAuthUrl());\n popupWindowRef.current = popup;\n setConnectionStatus(\"connecting\");\n }}\n className=\"rtk-connect__button rtk-connect__button--error\"\n onMouseEnter={() => setActionLabel(reconnectLabel)}\n onMouseLeave={() => setActionLabel(null)}\n >\n <MsTeamsIcon height=\"16px\" width=\"16px\" />\n <span className=\"rtk-connect__button__text--error\">\n {actionLabel || errorLabel || t(\"msTeamsError\")}\n </span>\n </button>\n );\n }\n\n // Disconnected state\n if (connectionStatus === \"disconnected\") {\n return (\n <button\n onClick={() => {\n const popup = openPopupWindow(buildMsTeamsAuthUrl());\n popupWindowRef.current = popup;\n setConnectionStatus(\"connecting\");\n }}\n className=\"rtk-connect__button rtk-connect__button--disconnected\"\n >\n <MsTeamsIcon height=\"16px\" width=\"16px\" />\n <span>{t(\"msTeamsConnect\")}</span>\n </button>\n );\n }\n\n // Connected state\n return (\n <button\n onClick={disconnectFromMsTeams}\n className=\"rtk-connect__button rtk-connect__button--connected\"\n onMouseEnter={() => setActionLabel(disconnectLabel)}\n onMouseLeave={() => setActionLabel(null)}\n >\n <MsTeamsIcon height=\"16px\" width=\"16px\" />\n <span className=\"rtk-connect__button__text--connected\">\n {actionLabel || t(\"msTeamsConnected\")}\n </span>\n </button>\n );\n};\n"],"names":["MsTeamsAuthButton","redirectUrl","onAuthenticationComplete","props","graphApiClientId","msTeamsBotId","t","useTranslations","knock","useKnockClient","setConnectionStatus","connectionStatus","setActionLabel","actionLabel","errorLabel","tenantId","knockMsTeamsChannelId","popupWindowRef","useKnockMsTeamsClient","buildMsTeamsAuthUrl","disconnectFromMsTeams","useMsTeamsAuth","useAuthPostMessageListener","knockHost","host","useAuthPolling","authCheckFn","useCallback","msTeams","authCheck","tenant","knockChannelId","disconnectLabel","reconnectLabel","React","MsTeamsIcon","popup","openPopupWindow","current"],"mappings":"+VAmCaA,EAA+DA,CAAC,CAC3EC,YAAAA,EACAC,yBAAAA,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A,cAACC,EAAY,YAAA,CAAA,OAAO,OAAO,MAAM,MAAM,CAAA,EACtCD,EAAAA,QAAA,cAAA,OAAA,CAAK,UAAU,kCAAA,EACbrB,GAAeC,GAAcR,EAAE,cAAc,CAChD,CACF,EAKAK,IAAqB,eAErBuB,EAAA,QAAA,cAAC,SACC,CAAA,QAAS,IAAM,CACPE,MAAAA,EAAQC,kBAAgBlB,GAAqB,EACnDF,EAAeqB,QAAUF,EACzB1B,EAAoB,YAAY,CAAA,EAElC,UAAU,uDAEV,EAAAwB,EAAA,QAAA,cAACC,eAAY,OAAO,OAAO,MAAM,OAAM,EACtCD,EAAA,QAAA,cAAA,OAAA,KAAM5B,EAAE,gBAAgB,CAAE,CAC7B,EAMD4B,EAAAA,QAAA,cAAA,SAAA,CACC,QAASd,EACT,UAAU,qDACV,aAAc,IAAMR,EAAeoB,CAAe,EAClD,aAAc,IAAMpB,EAAe,IAAI,GAEvCsB,EAAAA,QAAA,cAACC,EAAAA,YAAY,CAAA,OAAO,OAAO,MAAM,MAAM,CAAA,EACvCD,EAAA,QAAA,cAAC,OAAK,CAAA,UAAU,sCACbrB,EAAAA,GAAeP,EAAE,kBAAkB,CACtC,CACF,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),c=require("@knocklabs/react-core"),g=require("../../../core/utils.js");;/* empty css */const u=require("../SlackIcon/SlackIcon.js");;/* empty css */const w=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},e=w(k),A=({slackClientId:t,redirectUrl:S,onAuthenticationComplete:d,scopes:p,additionalScopes:_})=>{const{t:n}=c.useTranslations(),r=c.useKnockClient(),{setConnectionStatus:a,connectionStatus:o,setActionLabel:l,actionLabel:h,errorLabel:C,tenantId:b,knockSlackChannelId:f,popupWindowRef:s}=c.useKnockSlackClient(),E=k.useMemo(()=>({scopes:p,additionalScopes:_}),[p,_]),{buildSlackAuthUrl:m,disconnectFromSlack:x}=c.useSlackAuth(t,S,E);c.useAuthPostMessageListener({knockHost:r.host,popupWindowRef:s,setConnectionStatus:a,onAuthenticationComplete:d}),c.useAuthPolling({popupWindowRef:s,setConnectionStatus:a,onAuthenticationComplete:d,authCheckFn:k.useCallback(async()=>r.slack.authCheck({tenant:b,knockChannelId:f}),[r.slack,b,f])});const I=n("slackDisconnect")||null,L=n("slackReconnect")||null;return o==="connecting"||o==="disconnecting"?e.default.createElement("div",{className:"rsk-connect__button rsk-connect__button--loading"},e.default.createElement(u.SlackIcon,{height:"16px",width:"16px"}),e.default.createElement("span",null,n(o==="connecting"?"slackConnecting":"slackDisconnecting"))):o==="error"?e.default.createElement("button",{onClick:()=>{const i=g.openPopupWindow(m());s.current=i,a("connecting")},className:"rsk-connect__button rsk-connect__button--error",onMouseEnter:()=>l(L),onMouseLeave:()=>l(null)},e.default.createElement(u.SlackIcon,{height:"16px",width:"16px"}),e.default.createElement("span",{className:"rsk-connect__button__text--error"},h||C||n("slackError"))):o==="disconnected"?e.default.createElement("button",{onClick:()=>{const i=g.openPopupWindow(m());s.current=i,a("connecting")},className:"rsk-connect__button rsk-connect__button--disconnected"},e.default.createElement(u.SlackIcon,{height:"16px",width:"16px"}),e.default.createElement("span",null,n("slackConnect"))):e.default.createElement("button",{onClick:x,className:"rsk-connect__button rsk-connect__button--connected",onMouseEnter:()=>l(I),onMouseLeave:()=>l(null)},e.default.createElement(u.SlackIcon,{height:"16px",width:"16px"}),e.default.createElement("span",{className:"rsk-connect__button__text--connected"},h||n("slackConnected")))};exports.SlackAuthButton=A;
|
|
2
2
|
//# sourceMappingURL=SlackAuthButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlackAuthButton.js","sources":["../../../../../../src/modules/slack/components/SlackAuthButton/SlackAuthButton.tsx"],"sourcesContent":["import {\n useKnockClient,\n useKnockSlackClient,\n useSlackAuth,\n useTranslations,\n} from \"@knocklabs/react-core\";\nimport { FunctionComponent, useMemo } from \"react\";\
|
|
1
|
+
{"version":3,"file":"SlackAuthButton.js","sources":["../../../../../../src/modules/slack/components/SlackAuthButton/SlackAuthButton.tsx"],"sourcesContent":["import {\n useAuthPolling,\n useAuthPostMessageListener,\n useKnockClient,\n useKnockSlackClient,\n useSlackAuth,\n useTranslations,\n} from \"@knocklabs/react-core\";\nimport { FunctionComponent, useCallback, useMemo } from \"react\";\n\nimport { openPopupWindow } from \"../../../core/utils\";\nimport \"../../theme.css\";\nimport { SlackIcon } from \"../SlackIcon\";\n\nimport \"./styles.css\";\n\nexport interface SlackAuthButtonProps {\n slackClientId: string;\n redirectUrl?: string;\n onAuthenticationComplete?: (authenticationResp: string) => void;\n // When provided, the default scopes will be overridden with the provided scopes\n scopes?: string[];\n // Additional scopes to add to the default scopes\n additionalScopes?: string[];\n}\n\nexport const SlackAuthButton: FunctionComponent<SlackAuthButtonProps> = ({\n slackClientId,\n redirectUrl,\n onAuthenticationComplete,\n scopes,\n additionalScopes,\n}) => {\n const { t } = useTranslations();\n const knock = useKnockClient();\n\n const {\n setConnectionStatus,\n connectionStatus,\n setActionLabel,\n actionLabel,\n errorLabel,\n tenantId,\n knockSlackChannelId,\n popupWindowRef,\n } = useKnockSlackClient();\n\n const useSlackAuthOptions = useMemo(\n () => ({\n scopes,\n additionalScopes,\n }),\n [scopes, additionalScopes],\n );\n\n const { buildSlackAuthUrl, disconnectFromSlack } = useSlackAuth(\n slackClientId,\n redirectUrl,\n useSlackAuthOptions,\n );\n\n useAuthPostMessageListener({\n knockHost: knock.host,\n popupWindowRef,\n setConnectionStatus,\n onAuthenticationComplete,\n });\n\n useAuthPolling({\n popupWindowRef,\n setConnectionStatus,\n onAuthenticationComplete,\n authCheckFn: useCallback(async () => {\n return knock.slack.authCheck({\n tenant: tenantId,\n knockChannelId: knockSlackChannelId,\n });\n }, [knock.slack, tenantId, knockSlackChannelId]),\n });\n\n const disconnectLabel = t(\"slackDisconnect\") || null;\n const reconnectLabel = t(\"slackReconnect\") || null;\n\n // Loading states\n if (\n connectionStatus === \"connecting\" ||\n connectionStatus === \"disconnecting\"\n ) {\n return (\n <div className=\"rsk-connect__button rsk-connect__button--loading\">\n <SlackIcon height=\"16px\" width=\"16px\" />\n <span>\n {connectionStatus === \"connecting\"\n ? t(\"slackConnecting\")\n : t(\"slackDisconnecting\")}\n </span>\n </div>\n );\n }\n\n // Error state\n if (connectionStatus === \"error\") {\n return (\n <button\n onClick={() => {\n const popup = openPopupWindow(buildSlackAuthUrl());\n popupWindowRef.current = popup;\n setConnectionStatus(\"connecting\");\n }}\n className=\"rsk-connect__button rsk-connect__button--error\"\n onMouseEnter={() => setActionLabel(reconnectLabel)}\n onMouseLeave={() => setActionLabel(null)}\n >\n <SlackIcon height=\"16px\" width=\"16px\" />\n <span className=\"rsk-connect__button__text--error\">\n {actionLabel || errorLabel || t(\"slackError\")}\n </span>\n </button>\n );\n }\n\n // Disconnected state\n if (connectionStatus === \"disconnected\") {\n return (\n <button\n onClick={() => {\n const popup = openPopupWindow(buildSlackAuthUrl());\n popupWindowRef.current = popup;\n setConnectionStatus(\"connecting\");\n }}\n className=\"rsk-connect__button rsk-connect__button--disconnected\"\n >\n <SlackIcon height=\"16px\" width=\"16px\" />\n <span>{t(\"slackConnect\")}</span>\n </button>\n );\n }\n\n // Connected state\n return (\n <button\n onClick={disconnectFromSlack}\n className=\"rsk-connect__button rsk-connect__button--connected\"\n onMouseEnter={() => setActionLabel(disconnectLabel)}\n onMouseLeave={() => setActionLabel(null)}\n >\n <SlackIcon height=\"16px\" width=\"16px\" />\n <span className=\"rsk-connect__button__text--connected\">\n {actionLabel || t(\"slackConnected\")}\n </span>\n </button>\n );\n};\n"],"names":["SlackAuthButton","slackClientId","redirectUrl","onAuthenticationComplete","scopes","additionalScopes","t","useTranslations","knock","useKnockClient","setConnectionStatus","connectionStatus","setActionLabel","actionLabel","errorLabel","tenantId","knockSlackChannelId","popupWindowRef","useKnockSlackClient","useSlackAuthOptions","useMemo","buildSlackAuthUrl","disconnectFromSlack","useSlackAuth","useAuthPostMessageListener","knockHost","host","useAuthPolling","authCheckFn","useCallback","slack","authCheck","tenant","knockChannelId","disconnectLabel","reconnectLabel","React","SlackIcon","popup","openPopupWindow","current"],"mappings":"2VA0BaA,EAA2DA,CAAC,CACvEC,cAAAA,EACAC,YAAAA,EACAC,yBAAAA,EACAC,OAAAA,EACAC,iBAAAA,CACF,IAAM,CACE,KAAA,CAAEC,EAAAA,GAAMC,kBAAgB,EACxBC,EAAQC,EAAAA,eAAe,EAEvB,CACJC,oBAAAA,EACAC,iBAAAA,EACAC,eAAAA,EACAC,YAAAA,EACAC,WAAAA,EACAC,SAAAA,EACAC,oBAAAA,EACAC,eAAAA,GACEC,sBAAoB,EAElBC,EAAsBC,EAAAA,QAC1B,KAAO,CACLhB,OAAAA,EACAC,iBAAAA,CAAAA,GAEF,CAACD,EAAQC,CAAgB,CAC3B,EAEM,CAAEgB,kBAAAA,EAAmBC,oBAAAA,CAAwBC,EAAAA,eACjDtB,EACAC,EACAiB,CACF,EAE2BK,6BAAA,CACzBC,UAAWjB,EAAMkB,KACjBT,eAAAA,EACAP,oBAAAA,EACAP,yBAAAA,CAAAA,CACD,EAEcwB,iBAAA,CACbV,eAAAA,EACAP,oBAAAA,EACAP,yBAAAA,EACAyB,YAAaC,cAAY,SAChBrB,EAAMsB,MAAMC,UAAU,CAC3BC,OAAQjB,EACRkB,eAAgBjB,CAAAA,CACjB,EACA,CAACR,EAAMsB,MAAOf,EAAUC,CAAmB,CAAC,CAAA,CAChD,EAEKkB,MAAAA,EAAkB5B,EAAE,iBAAiB,GAAK,KAC1C6B,EAAiB7B,EAAE,gBAAgB,GAAK,KAI5CK,OAAAA,IAAqB,cACrBA,IAAqB,gBAGnByB,EAAA,QAAA,cAAC,OAAI,UAAU,kDAAA,0BACZC,EAAU,UAAA,CAAA,OAAO,OAAO,MAAM,MAAM,CAAA,EACpCD,EAAAA,QAAA,cAAA,OAAA,KAEK9B,EADHK,IAAqB,aAChB,kBACA,oBADiB,CAEzB,CACF,EAKAA,IAAqB,QAErByB,EAAA,QAAA,cAAC,SACC,CAAA,QAAS,IAAM,CACPE,MAAAA,EAAQC,kBAAgBlB,GAAmB,EACjDJ,EAAeuB,QAAUF,EACzB5B,EAAoB,YAAY,CAAA,EAElC,UAAU,iDACV,aAAc,IAAME,EAAeuB,CAAc,EACjD,aAAc,IAAMvB,EAAe,IAAI,CAEvC,EAAAwB,EAAA,QAAA,cAACC,EAAU,UAAA,CAAA,OAAO,OAAO,MAAM,MAAM,CAAA,EACpCD,EAAAA,QAAA,cAAA,OAAA,CAAK,UAAU,kCAAA,EACbvB,GAAeC,GAAcR,EAAE,YAAY,CAC9C,CACF,EAKAK,IAAqB,eAErByB,EAAA,QAAA,cAAC,SACC,CAAA,QAAS,IAAM,CACPE,MAAAA,EAAQC,kBAAgBlB,GAAmB,EACjDJ,EAAeuB,QAAUF,EACzB5B,EAAoB,YAAY,CAAA,EAElC,UAAU,uDAEV,EAAA0B,EAAA,QAAA,cAACC,aAAU,OAAO,OAAO,MAAM,OAAM,EACpCD,EAAA,QAAA,cAAA,OAAA,KAAM9B,EAAE,cAAc,CAAE,CAC3B,EAMD8B,EAAAA,QAAA,cAAA,SAAA,CACC,QAASd,EACT,UAAU,qDACV,aAAc,IAAMV,EAAesB,CAAe,EAClD,aAAc,IAAMtB,EAAe,IAAI,GAEvCwB,EAAAA,QAAA,cAACC,EAAAA,UAAU,CAAA,OAAO,OAAO,MAAM,MAAM,CAAA,EACrCD,EAAA,QAAA,cAAC,OAAK,CAAA,UAAU,sCACbvB,EAAAA,GAAeP,EAAE,gBAAgB,CACpC,CACF,CAEJ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const r = (e) => {
|
|
2
2
|
const n = window.screenLeft ?? window.screenX, t = window.screenTop ?? window.screenY, o = window.innerWidth ?? document.documentElement.clientWidth ?? screen.width, i = window.innerHeight ?? document.documentElement.clientHeight ?? screen.height, c = o / 2 - 600 / 2 + n, d = `width=600,height=800,top=${i / 2 - 800 / 2 + t},left=${c}`;
|
|
3
|
-
window.open(e, "_blank", d);
|
|
3
|
+
return window.open(e, "_blank", d);
|
|
4
4
|
}, p = () => {
|
|
5
5
|
if (typeof window < "u")
|
|
6
6
|
return window;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../../../src/modules/core/utils.ts"],"sourcesContent":["export const openPopupWindow = (url: string) => {\n const width = 600;\n const height = 800;\n // Calculate the position to center the window\n const screenLeft = window.screenLeft ?? window.screenX;\n const screenTop = window.screenTop ?? window.screenY;\n\n const innerWidth =\n window.innerWidth ?? document.documentElement.clientWidth ?? screen.width;\n const innerHeight =\n window.innerHeight ??\n document.documentElement.clientHeight ??\n screen.height;\n\n const left = innerWidth / 2 - width / 2 + screenLeft;\n const top = innerHeight / 2 - height / 2 + screenTop;\n\n // Window features\n const features = `width=${width},height=${height},top=${top},left=${left}`;\n\n window.open(url, \"_blank\", features);\n};\n\nexport const checkForWindow = () => {\n if (typeof window !== \"undefined\") {\n return window;\n }\n};\n"],"names":["openPopupWindow","url","screenLeft","window","screenX","screenTop","screenY","innerWidth","document","documentElement","clientWidth","screen","width","innerHeight","clientHeight","height","left","features","open","checkForWindow"],"mappings":"AAAaA,MAAAA,IAAkBA,CAACC,MAAgB;AAIxCC,QAAAA,IAAaC,OAAOD,cAAcC,OAAOC,SACzCC,IAAYF,OAAOE,aAAaF,OAAOG,SAEvCC,IACJJ,OAAOI,cAAcC,SAASC,gBAAgBC,eAAeC,OAAOC,OAChEC,IACJV,OAAOU,eACPL,SAASC,gBAAgBK,gBACzBH,OAAOI,QAEHC,IAAOT,IAAa,IAAIK,MAAQ,IAAIV,GAIpCe,IAAW,4BAHLJ,IAAc,IAAIE,MAAS,IAAIV,CAGgB,SAASW,CAAI;
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../../../src/modules/core/utils.ts"],"sourcesContent":["export const openPopupWindow = (url: string) => {\n const width = 600;\n const height = 800;\n // Calculate the position to center the window\n const screenLeft = window.screenLeft ?? window.screenX;\n const screenTop = window.screenTop ?? window.screenY;\n\n const innerWidth =\n window.innerWidth ?? document.documentElement.clientWidth ?? screen.width;\n const innerHeight =\n window.innerHeight ??\n document.documentElement.clientHeight ??\n screen.height;\n\n const left = innerWidth / 2 - width / 2 + screenLeft;\n const top = innerHeight / 2 - height / 2 + screenTop;\n\n // Window features\n const features = `width=${width},height=${height},top=${top},left=${left}`;\n\n return window.open(url, \"_blank\", features);\n};\n\nexport const checkForWindow = () => {\n if (typeof window !== \"undefined\") {\n return window;\n }\n};\n"],"names":["openPopupWindow","url","screenLeft","window","screenX","screenTop","screenY","innerWidth","document","documentElement","clientWidth","screen","width","innerHeight","clientHeight","height","left","features","open","checkForWindow"],"mappings":"AAAaA,MAAAA,IAAkBA,CAACC,MAAgB;AAIxCC,QAAAA,IAAaC,OAAOD,cAAcC,OAAOC,SACzCC,IAAYF,OAAOE,aAAaF,OAAOG,SAEvCC,IACJJ,OAAOI,cAAcC,SAASC,gBAAgBC,eAAeC,OAAOC,OAChEC,IACJV,OAAOU,eACPL,SAASC,gBAAgBK,gBACzBH,OAAOI,QAEHC,IAAOT,IAAa,IAAIK,MAAQ,IAAIV,GAIpCe,IAAW,4BAHLJ,IAAc,IAAIE,MAAS,IAAIV,CAGgB,SAASW,CAAI;AAExE,SAAOb,OAAOe,KAAKjB,GAAK,UAAUgB,CAAQ;AAC5C,GAEaE,IAAiBA,MAAM;AAC9B,MAAA,OAAOhB,SAAW;AACbA,WAAAA;AAEX;"}
|
|
@@ -1,43 +1,53 @@
|
|
|
1
|
-
import e, {
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { openPopupWindow as
|
|
1
|
+
import e, { useCallback as M } from "react";
|
|
2
|
+
import { useTranslations as x, useKnockClient as f, useKnockMsTeamsClient as A, useMsTeamsAuth as I, useAuthPostMessageListener as L, useAuthPolling as w } from "@knocklabs/react-core";
|
|
3
|
+
import { openPopupWindow as k } from "../../../core/utils.mjs";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { MsTeamsIcon as a } from "../MsTeamsIcon/MsTeamsIcon.mjs";
|
|
6
6
|
/* empty css */
|
|
7
|
-
const
|
|
8
|
-
redirectUrl:
|
|
9
|
-
onAuthenticationComplete:
|
|
10
|
-
...
|
|
7
|
+
const F = ({
|
|
8
|
+
redirectUrl: _,
|
|
9
|
+
onAuthenticationComplete: l,
|
|
10
|
+
...r
|
|
11
11
|
}) => {
|
|
12
|
-
const b = "graphApiClientId" in
|
|
13
|
-
t
|
|
14
|
-
} =
|
|
15
|
-
setConnectionStatus:
|
|
16
|
-
connectionStatus:
|
|
17
|
-
setActionLabel:
|
|
18
|
-
actionLabel:
|
|
19
|
-
errorLabel:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
12
|
+
const b = "graphApiClientId" in r ? r.graphApiClientId : r.msTeamsBotId, {
|
|
13
|
+
t: n
|
|
14
|
+
} = x(), m = f(), {
|
|
15
|
+
setConnectionStatus: c,
|
|
16
|
+
connectionStatus: t,
|
|
17
|
+
setActionLabel: o,
|
|
18
|
+
actionLabel: u,
|
|
19
|
+
errorLabel: T,
|
|
20
|
+
tenantId: p,
|
|
21
|
+
knockMsTeamsChannelId: d,
|
|
22
|
+
popupWindowRef: s
|
|
23
|
+
} = A(), {
|
|
24
|
+
buildMsTeamsAuthUrl: h,
|
|
25
|
+
disconnectFromMsTeams: g
|
|
26
|
+
} = I(b, _);
|
|
27
|
+
L({
|
|
28
|
+
knockHost: m.host,
|
|
29
|
+
popupWindowRef: s,
|
|
30
|
+
setConnectionStatus: c,
|
|
31
|
+
onAuthenticationComplete: l
|
|
32
|
+
}), w({
|
|
33
|
+
popupWindowRef: s,
|
|
34
|
+
setConnectionStatus: c,
|
|
35
|
+
onAuthenticationComplete: l,
|
|
36
|
+
authCheckFn: M(async () => m.msTeams.authCheck({
|
|
37
|
+
tenant: p,
|
|
38
|
+
knockChannelId: d
|
|
39
|
+
}), [m.msTeams, p, d])
|
|
40
|
+
});
|
|
41
|
+
const C = n("msTeamsDisconnect") || null, E = n("msTeamsReconnect") || null;
|
|
42
|
+
return t === "connecting" || t === "disconnecting" ? /* @__PURE__ */ e.createElement("div", { className: "rtk-connect__button rtk-connect__button--loading" }, /* @__PURE__ */ e.createElement(a, { height: "16px", width: "16px" }), /* @__PURE__ */ e.createElement("span", null, n(t === "connecting" ? "msTeamsConnecting" : "msTeamsDisconnecting"))) : t === "error" ? /* @__PURE__ */ e.createElement("button", { onClick: () => {
|
|
43
|
+
const i = k(h());
|
|
44
|
+
s.current = i, c("connecting");
|
|
45
|
+
}, className: "rtk-connect__button rtk-connect__button--error", onMouseEnter: () => o(E), onMouseLeave: () => o(null) }, /* @__PURE__ */ e.createElement(a, { height: "16px", width: "16px" }), /* @__PURE__ */ e.createElement("span", { className: "rtk-connect__button__text--error" }, u || T || n("msTeamsError"))) : t === "disconnected" ? /* @__PURE__ */ e.createElement("button", { onClick: () => {
|
|
46
|
+
const i = k(h());
|
|
47
|
+
s.current = i, c("connecting");
|
|
48
|
+
}, className: "rtk-connect__button rtk-connect__button--disconnected" }, /* @__PURE__ */ e.createElement(a, { height: "16px", width: "16px" }), /* @__PURE__ */ e.createElement("span", null, n("msTeamsConnect"))) : /* @__PURE__ */ e.createElement("button", { onClick: g, className: "rtk-connect__button rtk-connect__button--connected", onMouseEnter: () => o(C), onMouseLeave: () => o(null) }, /* @__PURE__ */ e.createElement(a, { height: "16px", width: "16px" }), /* @__PURE__ */ e.createElement("span", { className: "rtk-connect__button__text--connected" }, u || n("msTeamsConnected")));
|
|
39
49
|
};
|
|
40
50
|
export {
|
|
41
|
-
|
|
51
|
+
F as MsTeamsAuthButton
|
|
42
52
|
};
|
|
43
53
|
//# sourceMappingURL=MsTeamsAuthButton.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MsTeamsAuthButton.mjs","sources":["../../../../../../src/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.tsx"],"sourcesContent":["import {\n useKnockClient,\n useKnockMsTeamsClient,\n useMsTeamsAuth,\n useTranslations,\n} from \"@knocklabs/react-core\";\nimport { FunctionComponent,
|
|
1
|
+
{"version":3,"file":"MsTeamsAuthButton.mjs","sources":["../../../../../../src/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.tsx"],"sourcesContent":["import {\n useAuthPolling,\n useAuthPostMessageListener,\n useKnockClient,\n useKnockMsTeamsClient,\n useMsTeamsAuth,\n useTranslations,\n} from \"@knocklabs/react-core\";\nimport { FunctionComponent, useCallback } from \"react\";\n\nimport { openPopupWindow } from \"../../../core/utils\";\nimport \"../../theme.css\";\nimport { MsTeamsIcon } from \"../MsTeamsIcon\";\n\nimport \"./styles.css\";\n\nexport type MsTeamsAuthButtonProps = {\n redirectUrl?: string;\n onAuthenticationComplete?: (authenticationResp: string) => void;\n} & (\n | {\n /**\n * The client ID of your Microsoft Graph API-enabled application registered with Microsoft Entra. This should\n * match the \"Graph API client ID\" setting of your Microsoft Teams channel in the Knock dashboard.\n */\n graphApiClientId: string;\n }\n | {\n /**\n * @deprecated Use `graphApiClientId` instead. This field will be removed in a future release.\n */\n msTeamsBotId: string;\n }\n);\n\nexport const MsTeamsAuthButton: FunctionComponent<MsTeamsAuthButtonProps> = ({\n redirectUrl,\n onAuthenticationComplete,\n ...props\n}) => {\n const graphApiClientId =\n \"graphApiClientId\" in props ? props.graphApiClientId : props.msTeamsBotId;\n\n const { t } = useTranslations();\n const knock = useKnockClient();\n\n const {\n setConnectionStatus,\n connectionStatus,\n setActionLabel,\n actionLabel,\n errorLabel,\n tenantId,\n knockMsTeamsChannelId,\n popupWindowRef,\n } = useKnockMsTeamsClient();\n\n const { buildMsTeamsAuthUrl, disconnectFromMsTeams } = useMsTeamsAuth(\n graphApiClientId,\n redirectUrl,\n );\n\n useAuthPostMessageListener({\n knockHost: knock.host,\n popupWindowRef,\n setConnectionStatus,\n onAuthenticationComplete,\n });\n\n useAuthPolling({\n popupWindowRef,\n setConnectionStatus,\n onAuthenticationComplete,\n authCheckFn: useCallback(async () => {\n return knock.msTeams.authCheck({\n tenant: tenantId,\n knockChannelId: knockMsTeamsChannelId,\n });\n }, [knock.msTeams, tenantId, knockMsTeamsChannelId]),\n });\n\n const disconnectLabel = t(\"msTeamsDisconnect\") || null;\n const reconnectLabel = t(\"msTeamsReconnect\") || null;\n\n // Loading states\n if (\n connectionStatus === \"connecting\" ||\n connectionStatus === \"disconnecting\"\n ) {\n return (\n <div className=\"rtk-connect__button rtk-connect__button--loading\">\n <MsTeamsIcon height=\"16px\" width=\"16px\" />\n <span>\n {connectionStatus === \"connecting\"\n ? t(\"msTeamsConnecting\")\n : t(\"msTeamsDisconnecting\")}\n </span>\n </div>\n );\n }\n\n // Error state\n if (connectionStatus === \"error\") {\n return (\n <button\n onClick={() => {\n const popup = openPopupWindow(buildMsTeamsAuthUrl());\n popupWindowRef.current = popup;\n setConnectionStatus(\"connecting\");\n }}\n className=\"rtk-connect__button rtk-connect__button--error\"\n onMouseEnter={() => setActionLabel(reconnectLabel)}\n onMouseLeave={() => setActionLabel(null)}\n >\n <MsTeamsIcon height=\"16px\" width=\"16px\" />\n <span className=\"rtk-connect__button__text--error\">\n {actionLabel || errorLabel || t(\"msTeamsError\")}\n </span>\n </button>\n );\n }\n\n // Disconnected state\n if (connectionStatus === \"disconnected\") {\n return (\n <button\n onClick={() => {\n const popup = openPopupWindow(buildMsTeamsAuthUrl());\n popupWindowRef.current = popup;\n setConnectionStatus(\"connecting\");\n }}\n className=\"rtk-connect__button rtk-connect__button--disconnected\"\n >\n <MsTeamsIcon height=\"16px\" width=\"16px\" />\n <span>{t(\"msTeamsConnect\")}</span>\n </button>\n );\n }\n\n // Connected state\n return (\n <button\n onClick={disconnectFromMsTeams}\n className=\"rtk-connect__button rtk-connect__button--connected\"\n onMouseEnter={() => setActionLabel(disconnectLabel)}\n onMouseLeave={() => setActionLabel(null)}\n >\n <MsTeamsIcon height=\"16px\" width=\"16px\" />\n <span className=\"rtk-connect__button__text--connected\">\n {actionLabel || t(\"msTeamsConnected\")}\n </span>\n </button>\n );\n};\n"],"names":["MsTeamsAuthButton","redirectUrl","onAuthenticationComplete","props","graphApiClientId","msTeamsBotId","t","useTranslations","knock","useKnockClient","setConnectionStatus","connectionStatus","setActionLabel","actionLabel","errorLabel","tenantId","knockMsTeamsChannelId","popupWindowRef","useKnockMsTeamsClient","buildMsTeamsAuthUrl","disconnectFromMsTeams","useMsTeamsAuth","useAuthPostMessageListener","knockHost","host","useAuthPolling","authCheckFn","useCallback","msTeams","authCheck","tenant","knockChannelId","disconnectLabel","reconnectLabel","React","MsTeamsIcon","popup","openPopupWindow","current"],"mappings":";;;;;;AAmCO,MAAMA,IAA+DA,CAAC;AAAA,EAC3EC,aAAAA;AAAAA,EACAC,0BAAAA;AAAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IACJ,sBAAsBD,IAAQA,EAAMC,mBAAmBD,EAAME,cAEzD;AAAA,IAAEC,GAAAA;AAAAA,MAAMC,EAAgB,GACxBC,IAAQC,EAAe,GAEvB;AAAA,IACJC,qBAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,uBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,MACEC,EAAsB,GAEpB;AAAA,IAAEC,qBAAAA;AAAAA,IAAqBC,uBAAAA;AAAAA,EAAAA,IAA0BC,EACrDjB,GACAH,CACF;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AqB;AACnDF,IAAAA,EAAeqB,UAAUF,GACzB1B,EAAoB,YAAY;AAAA,EAAA,GAElC,WAAU,wDAEV,GAAAwB,gBAAAA,EAAA,cAACC,KAAY,QAAO,QAAO,OAAM,QAAM,GACtCD,gBAAAA,EAAA,cAAA,QAAA,MAAM5B,EAAE,gBAAgB,CAAE,CAC7B,IAMD4B,gBAAAA,EAAA,cAAA,UAAA,EACC,SAASd,GACT,WAAU,sDACV,cAAc,MAAMR,EAAeoB,CAAe,GAClD,cAAc,MAAMpB,EAAe,IAAI,KAEvCsB,gBAAAA,EAAA,cAACC,GAAY,EAAA,QAAO,QAAO,OAAM,OAAM,CAAA,GACvCD,gBAAAA,EAAA,cAAC,QAAK,EAAA,WAAU,uCACbrB,GAAAA,KAAeP,EAAE,kBAAkB,CACtC,CACF;AAEJ;"}
|
|
@@ -1,46 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useTranslations as
|
|
1
|
+
import n, { useMemo as L, useCallback as w } from "react";
|
|
2
|
+
import { useTranslations as A, useKnockClient as M, useKnockSlackClient as N, useSlackAuth as I, useAuthPostMessageListener as v, useAuthPolling as P } from "@knocklabs/react-core";
|
|
3
3
|
import { openPopupWindow as d } from "../../../core/utils.mjs";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { SlackIcon as
|
|
5
|
+
import { SlackIcon as r } from "../SlackIcon/SlackIcon.mjs";
|
|
6
6
|
/* empty css */
|
|
7
7
|
const B = ({
|
|
8
|
-
slackClientId:
|
|
9
|
-
redirectUrl:
|
|
10
|
-
onAuthenticationComplete:
|
|
11
|
-
scopes:
|
|
12
|
-
additionalScopes:
|
|
8
|
+
slackClientId: b,
|
|
9
|
+
redirectUrl: E,
|
|
10
|
+
onAuthenticationComplete: u,
|
|
11
|
+
scopes: i,
|
|
12
|
+
additionalScopes: k
|
|
13
13
|
}) => {
|
|
14
14
|
const {
|
|
15
|
-
t
|
|
16
|
-
} =
|
|
15
|
+
t: e
|
|
16
|
+
} = A(), a = M(), {
|
|
17
17
|
setConnectionStatus: c,
|
|
18
|
-
connectionStatus:
|
|
18
|
+
connectionStatus: t,
|
|
19
19
|
setActionLabel: o,
|
|
20
20
|
actionLabel: m,
|
|
21
|
-
errorLabel:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
21
|
+
errorLabel: g,
|
|
22
|
+
tenantId: p,
|
|
23
|
+
knockSlackChannelId: _,
|
|
24
|
+
popupWindowRef: s
|
|
25
|
+
} = N(), C = L(() => ({
|
|
26
|
+
scopes: i,
|
|
27
|
+
additionalScopes: k
|
|
28
|
+
}), [i, k]), {
|
|
29
|
+
buildSlackAuthUrl: h,
|
|
30
|
+
disconnectFromSlack: x
|
|
31
|
+
} = I(b, E, C);
|
|
32
|
+
v({
|
|
33
|
+
knockHost: a.host,
|
|
34
|
+
popupWindowRef: s,
|
|
35
|
+
setConnectionStatus: c,
|
|
36
|
+
onAuthenticationComplete: u
|
|
37
|
+
}), P({
|
|
38
|
+
popupWindowRef: s,
|
|
39
|
+
setConnectionStatus: c,
|
|
40
|
+
onAuthenticationComplete: u,
|
|
41
|
+
authCheckFn: w(async () => a.slack.authCheck({
|
|
42
|
+
tenant: p,
|
|
43
|
+
knockChannelId: _
|
|
44
|
+
}), [a.slack, p, _])
|
|
45
|
+
});
|
|
46
|
+
const f = e("slackDisconnect") || null, S = e("slackReconnect") || null;
|
|
47
|
+
return t === "connecting" || t === "disconnecting" ? /* @__PURE__ */ n.createElement("div", { className: "rsk-connect__button rsk-connect__button--loading" }, /* @__PURE__ */ n.createElement(r, { height: "16px", width: "16px" }), /* @__PURE__ */ n.createElement("span", null, e(t === "connecting" ? "slackConnecting" : "slackDisconnecting"))) : t === "error" ? /* @__PURE__ */ n.createElement("button", { onClick: () => {
|
|
48
|
+
const l = d(h());
|
|
49
|
+
s.current = l, c("connecting");
|
|
50
|
+
}, className: "rsk-connect__button rsk-connect__button--error", onMouseEnter: () => o(S), onMouseLeave: () => o(null) }, /* @__PURE__ */ n.createElement(r, { height: "16px", width: "16px" }), /* @__PURE__ */ n.createElement("span", { className: "rsk-connect__button__text--error" }, m || g || e("slackError"))) : t === "disconnected" ? /* @__PURE__ */ n.createElement("button", { onClick: () => {
|
|
51
|
+
const l = d(h());
|
|
52
|
+
s.current = l, c("connecting");
|
|
53
|
+
}, className: "rsk-connect__button rsk-connect__button--disconnected" }, /* @__PURE__ */ n.createElement(r, { height: "16px", width: "16px" }), /* @__PURE__ */ n.createElement("span", null, e("slackConnect"))) : /* @__PURE__ */ n.createElement("button", { onClick: x, className: "rsk-connect__button rsk-connect__button--connected", onMouseEnter: () => o(f), onMouseLeave: () => o(null) }, /* @__PURE__ */ n.createElement(r, { height: "16px", width: "16px" }), /* @__PURE__ */ n.createElement("span", { className: "rsk-connect__button__text--connected" }, m || e("slackConnected")));
|
|
44
54
|
};
|
|
45
55
|
export {
|
|
46
56
|
B as SlackAuthButton
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlackAuthButton.mjs","sources":["../../../../../../src/modules/slack/components/SlackAuthButton/SlackAuthButton.tsx"],"sourcesContent":["import {\n useKnockClient,\n useKnockSlackClient,\n useSlackAuth,\n useTranslations,\n} from \"@knocklabs/react-core\";\nimport { FunctionComponent, useMemo } from \"react\";\
|
|
1
|
+
{"version":3,"file":"SlackAuthButton.mjs","sources":["../../../../../../src/modules/slack/components/SlackAuthButton/SlackAuthButton.tsx"],"sourcesContent":["import {\n useAuthPolling,\n useAuthPostMessageListener,\n useKnockClient,\n useKnockSlackClient,\n useSlackAuth,\n useTranslations,\n} from \"@knocklabs/react-core\";\nimport { FunctionComponent, useCallback, useMemo } from \"react\";\n\nimport { openPopupWindow } from \"../../../core/utils\";\nimport \"../../theme.css\";\nimport { SlackIcon } from \"../SlackIcon\";\n\nimport \"./styles.css\";\n\nexport interface SlackAuthButtonProps {\n slackClientId: string;\n redirectUrl?: string;\n onAuthenticationComplete?: (authenticationResp: string) => void;\n // When provided, the default scopes will be overridden with the provided scopes\n scopes?: string[];\n // Additional scopes to add to the default scopes\n additionalScopes?: string[];\n}\n\nexport const SlackAuthButton: FunctionComponent<SlackAuthButtonProps> = ({\n slackClientId,\n redirectUrl,\n onAuthenticationComplete,\n scopes,\n additionalScopes,\n}) => {\n const { t } = useTranslations();\n const knock = useKnockClient();\n\n const {\n setConnectionStatus,\n connectionStatus,\n setActionLabel,\n actionLabel,\n errorLabel,\n tenantId,\n knockSlackChannelId,\n popupWindowRef,\n } = useKnockSlackClient();\n\n const useSlackAuthOptions = useMemo(\n () => ({\n scopes,\n additionalScopes,\n }),\n [scopes, additionalScopes],\n );\n\n const { buildSlackAuthUrl, disconnectFromSlack } = useSlackAuth(\n slackClientId,\n redirectUrl,\n useSlackAuthOptions,\n );\n\n useAuthPostMessageListener({\n knockHost: knock.host,\n popupWindowRef,\n setConnectionStatus,\n onAuthenticationComplete,\n });\n\n useAuthPolling({\n popupWindowRef,\n setConnectionStatus,\n onAuthenticationComplete,\n authCheckFn: useCallback(async () => {\n return knock.slack.authCheck({\n tenant: tenantId,\n knockChannelId: knockSlackChannelId,\n });\n }, [knock.slack, tenantId, knockSlackChannelId]),\n });\n\n const disconnectLabel = t(\"slackDisconnect\") || null;\n const reconnectLabel = t(\"slackReconnect\") || null;\n\n // Loading states\n if (\n connectionStatus === \"connecting\" ||\n connectionStatus === \"disconnecting\"\n ) {\n return (\n <div className=\"rsk-connect__button rsk-connect__button--loading\">\n <SlackIcon height=\"16px\" width=\"16px\" />\n <span>\n {connectionStatus === \"connecting\"\n ? t(\"slackConnecting\")\n : t(\"slackDisconnecting\")}\n </span>\n </div>\n );\n }\n\n // Error state\n if (connectionStatus === \"error\") {\n return (\n <button\n onClick={() => {\n const popup = openPopupWindow(buildSlackAuthUrl());\n popupWindowRef.current = popup;\n setConnectionStatus(\"connecting\");\n }}\n className=\"rsk-connect__button rsk-connect__button--error\"\n onMouseEnter={() => setActionLabel(reconnectLabel)}\n onMouseLeave={() => setActionLabel(null)}\n >\n <SlackIcon height=\"16px\" width=\"16px\" />\n <span className=\"rsk-connect__button__text--error\">\n {actionLabel || errorLabel || t(\"slackError\")}\n </span>\n </button>\n );\n }\n\n // Disconnected state\n if (connectionStatus === \"disconnected\") {\n return (\n <button\n onClick={() => {\n const popup = openPopupWindow(buildSlackAuthUrl());\n popupWindowRef.current = popup;\n setConnectionStatus(\"connecting\");\n }}\n className=\"rsk-connect__button rsk-connect__button--disconnected\"\n >\n <SlackIcon height=\"16px\" width=\"16px\" />\n <span>{t(\"slackConnect\")}</span>\n </button>\n );\n }\n\n // Connected state\n return (\n <button\n onClick={disconnectFromSlack}\n className=\"rsk-connect__button rsk-connect__button--connected\"\n onMouseEnter={() => setActionLabel(disconnectLabel)}\n onMouseLeave={() => setActionLabel(null)}\n >\n <SlackIcon height=\"16px\" width=\"16px\" />\n <span className=\"rsk-connect__button__text--connected\">\n {actionLabel || t(\"slackConnected\")}\n </span>\n </button>\n );\n};\n"],"names":["SlackAuthButton","slackClientId","redirectUrl","onAuthenticationComplete","scopes","additionalScopes","t","useTranslations","knock","useKnockClient","setConnectionStatus","connectionStatus","setActionLabel","actionLabel","errorLabel","tenantId","knockSlackChannelId","popupWindowRef","useKnockSlackClient","useSlackAuthOptions","useMemo","buildSlackAuthUrl","disconnectFromSlack","useSlackAuth","useAuthPostMessageListener","knockHost","host","useAuthPolling","authCheckFn","useCallback","slack","authCheck","tenant","knockChannelId","disconnectLabel","reconnectLabel","React","SlackIcon","popup","openPopupWindow","current"],"mappings":";;;;;;AA0BO,MAAMA,IAA2DA,CAAC;AAAA,EACvEC,eAAAA;AAAAA,EACAC,aAAA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
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/modules/core/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,kBAqB1C,CAAC;AAEF,eAAO,MAAM,cAAc,gDAI1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MsTeamsAuthButton.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MsTeamsAuthButton.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAe,MAAM,OAAO,CAAC;AAGvD,OAAO,iBAAiB,CAAC;AAGzB,OAAO,cAAc,CAAC;AAEtB,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,CAAC,kBAAkB,EAAE,MAAM,KAAK,IAAI,CAAC;CACjE,GAAG,CACA;IACE;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACD;IACE;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB,CACJ,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,CAsHvE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlackAuthButton.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/slack/components/SlackAuthButton/SlackAuthButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SlackAuthButton.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/slack/components/SlackAuthButton/SlackAuthButton.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAwB,MAAM,OAAO,CAAC;AAGhE,OAAO,iBAAiB,CAAC;AAGzB,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,CAAC,kBAAkB,EAAE,MAAM,KAAK,IAAI,CAAC;IAEhE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,CA8HnE,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@knocklabs/react",
|
|
3
3
|
"description": "A set of React components to build notification experiences powered by Knock",
|
|
4
4
|
"author": "@knocklabs",
|
|
5
|
-
"version": "0.10.
|
|
5
|
+
"version": "0.10.4",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/cjs/index.js",
|
|
8
8
|
"module": "dist/esm/index.mjs",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@knocklabs/client": "^0.20.3",
|
|
76
|
-
"@knocklabs/react-core": "^0.12.
|
|
76
|
+
"@knocklabs/react-core": "^0.12.4",
|
|
77
77
|
"@popperjs/core": "^2.11.8",
|
|
78
78
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
79
79
|
"@telegraph/combobox": "^0.1.16",
|