payload-zitadel-plugin 0.1.3 → 0.1.5

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/README.md CHANGED
@@ -10,7 +10,7 @@ uses [NextAuth.js](https://next-auth.js.org) under the hood.
10
10
  ## Install
11
11
 
12
12
  ```shell
13
- pnpm add payload-zitadel-plugin@0.1.0
13
+ pnpm add payload-zitadel-plugin@0.1.5
14
14
  ```
15
15
 
16
16
  ## Configuration
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- export declare const Avatar: (props: {
1
+ import { CustomComponent } from 'payload';
2
+ export declare const Avatar: CustomComponent<{
3
3
  active: boolean;
4
- }) => React.JSX.Element;
4
+ }>;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,eAAO,MAAM,MAAM,UAAW;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,sBAWhD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;AAGvC,eAAO,MAAM,MAAM,EAAE,eAAe,CAAC;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAgCvD,CAAA"}
@@ -1,19 +1,33 @@
1
1
  'use client';
2
2
  import * as React from 'react';
3
- import Image from 'next/image.js';
4
- import { DefaultAccountIcon } from '@payloadcms/ui/graphics/Account/Default';
3
+ // https://github.com/vercel/next.js/issues/46078
4
+ // import Image from 'next/image.js'
5
5
  import { useSession } from 'next-auth/react';
6
- export const Avatar = (props)=>{
6
+ import { DefaultAccountIcon } from '@payloadcms/ui/graphics/Account/Default';
7
+ export const Avatar = ({ active })=>{
7
8
  const session = useSession();
8
9
  const imageUrl = session?.data?.user?.image;
9
- return imageUrl ? /*#__PURE__*/ React.createElement("div", {
10
+ return imageUrl ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("style", null, `
11
+ .avatar {
12
+ height: 2rem;
13
+ width: 2rem;
14
+ }
15
+
16
+ .avatar:hover {
17
+ filter: brightness(.8);
18
+ }
19
+
20
+ .avatar img {
21
+ object-fit: fill;
22
+ border-radius: 100%;
23
+ }
24
+ `), /*#__PURE__*/ React.createElement("div", {
10
25
  className: "avatar"
11
- }, /*#__PURE__*/ React.createElement(Image.default, {
26
+ }, /*#__PURE__*/ React.createElement("img", {
12
27
  src: imageUrl,
13
- alt: "Profile Picture",
14
- fill: true
15
- })) : /*#__PURE__*/ React.createElement(DefaultAccountIcon, {
16
- active: props.active
28
+ alt: "Profile Picture"
29
+ }))) : /*#__PURE__*/ React.createElement(DefaultAccountIcon, {
30
+ active: active
17
31
  });
18
32
  };
19
33
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Avatar/index.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport Image from 'next/image.js'\nimport {DefaultAccountIcon} from '@payloadcms/ui/graphics/Account/Default'\nimport {useSession} from 'next-auth/react'\n\n\nexport const Avatar = (props: { active: boolean }) => {\n\n const session = useSession()\n\n const imageUrl = session?.data?.user?.image\n\n return imageUrl ? (\n <div className=\"avatar\">\n <Image.default src={imageUrl} alt=\"Profile Picture\" fill/>\n </div>\n ) : <DefaultAccountIcon active={props.active}/>\n}"],"names":["React","Image","DefaultAccountIcon","useSession","Avatar","props","session","imageUrl","data","user","image","div","className","default","src","alt","fill","active"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,YAAYA,WAAW,QAAO;AAC9B,OAAOC,WAAW,gBAAe;AACjC,SAAQC,kBAAkB,QAAO,0CAAyC;AAC1E,SAAQC,UAAU,QAAO,kBAAiB;AAG1C,OAAO,MAAMC,SAAS,CAACC;IAEnB,MAAMC,UAAUH;IAEhB,MAAMI,WAAWD,SAASE,MAAMC,MAAMC;IAEtC,OAAOH,yBACH,oBAACI;QAAIC,WAAU;qBACX,oBAACX,MAAMY,OAAO;QAACC,KAAKP;QAAUQ,KAAI;QAAkBC,MAAAA;wBAExD,oBAACd;QAAmBe,QAAQZ,MAAMY,MAAM;;AAChD,EAAC"}
1
+ {"version":3,"sources":["../../../src/components/Avatar/index.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\n// https://github.com/vercel/next.js/issues/46078\n// import Image from 'next/image.js'\nimport {useSession} from 'next-auth/react'\nimport {DefaultAccountIcon} from '@payloadcms/ui/graphics/Account/Default'\nimport {CustomComponent} from 'payload'\n\n\nexport const Avatar: CustomComponent<{ active: boolean }> = ({active}) => {\n\n const session = useSession()\n\n const imageUrl = session?.data?.user?.image\n\n return (imageUrl ?\n <>\n <style>\n {`\n .avatar {\n height: 2rem;\n width: 2rem;\n }\n \n .avatar:hover {\n filter: brightness(.8);\n }\n \n .avatar img {\n object-fit: fill;\n border-radius: 100%;\n }\n `}\n </style>\n <div className=\"avatar\">\n {/*<Image src={imageUrl} alt=\"Profile Picture\" fill/>*/}\n {<img src={imageUrl} alt=\"Profile Picture\"/>}\n </div>\n </> :\n <DefaultAccountIcon active={active}/>\n )\n}"],"names":["React","useSession","DefaultAccountIcon","Avatar","active","session","imageUrl","data","user","image","style","div","className","img","src","alt"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,YAAYA,WAAW,QAAO;AAC9B,iDAAiD;AACjD,oCAAoC;AACpC,SAAQC,UAAU,QAAO,kBAAiB;AAC1C,SAAQC,kBAAkB,QAAO,0CAAyC;AAI1E,OAAO,MAAMC,SAA+C,CAAC,EAACC,MAAM,EAAC;IAEjE,MAAMC,UAAUJ;IAEhB,MAAMK,WAAWD,SAASE,MAAMC,MAAMC;IAEtC,OAAQH,yBACA,wDACI,oBAACI,eACI,CAAC;;;;;;;;;;;;;;wBAcE,CAAC,iBAET,oBAACC;QAAIC,WAAU;qBAEV,oBAACC;QAAIC,KAAKR;QAAUS,KAAI;yBAGjC,oBAACb;QAAmBE,QAAQA;;AAExC,EAAC"}
@@ -1,3 +1,6 @@
1
1
  import { CustomComponent } from 'payload';
2
- export declare const _LoginButton: CustomComponent;
2
+ export declare const _LoginButton: CustomComponent<{
3
+ internalProviderName: string;
4
+ externalProviderName: string;
5
+ }>;
3
6
  //# sourceMappingURL=button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/LoginButton/button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;AAMvC,eAAO,MAAM,YAAY,EAAE,eAe1B,CAAA"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/LoginButton/button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;AAKvC,eAAO,MAAM,YAAY,EAAE,eAAe,CAAC;IACvC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAA;CAC/B,CAUA,CAAA"}
@@ -1,13 +1,9 @@
1
1
  'use client';
2
2
  import React from 'react';
3
3
  import { signIn } from 'next-auth/react';
4
- //import {NestedKeysStripped} from '@payloadcms/translations'
5
- import { Button } from '@payloadcms/ui/client';
6
- //import {useTranslation} from '@payloadcms/ui/providers/Translation'
7
- //import {translations} from '../../translations.js'
4
+ import { Button, useTranslation } from '@payloadcms/ui';
8
5
  export const _LoginButton = ({ internalProviderName, externalProviderName })=>{
9
- //currently not working
10
- //const {t} = useTranslation<typeof translations.en, NestedKeysStripped<typeof translations.en>>()
6
+ const { t } = useTranslation();
11
7
  return /*#__PURE__*/ React.createElement("div", {
12
8
  style: {
13
9
  display: 'flex',
@@ -15,7 +11,9 @@ export const _LoginButton = ({ internalProviderName, externalProviderName })=>{
15
11
  }
16
12
  }, /*#__PURE__*/ React.createElement(Button, {
17
13
  onClick: ()=>signIn(internalProviderName)
18
- }, externalProviderName));
14
+ }, t('zitadelPlugin:signIn', {
15
+ externalProviderName
16
+ })));
19
17
  };
20
18
 
21
19
  //# sourceMappingURL=button.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/LoginButton/button.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\nimport {signIn} from 'next-auth/react'\nimport {CustomComponent} from 'payload'\n//import {NestedKeysStripped} from '@payloadcms/translations'\nimport {Button} from '@payloadcms/ui/client'\n//import {useTranslation} from '@payloadcms/ui/providers/Translation'\n//import {translations} from '../../translations.js'\n\nexport const _LoginButton: CustomComponent = ({internalProviderName, externalProviderName}: {\n internalProviderName: string,\n externalProviderName: string\n}) => {\n //currently not working\n //const {t} = useTranslation<typeof translations.en, NestedKeysStripped<typeof translations.en>>()\n\n return (\n <div style={{display: 'flex', justifyContent: 'center'}}>\n <Button onClick={() => signIn(internalProviderName)}>\n {/*t('zitadelPlugin:signIn', {externalProviderName})*/}\n {externalProviderName}\n </Button>\n </div>\n )\n}"],"names":["React","signIn","Button","_LoginButton","internalProviderName","externalProviderName","div","style","display","justifyContent","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,WAAW,QAAO;AACzB,SAAQC,MAAM,QAAO,kBAAiB;AAEtC,6DAA6D;AAC7D,SAAQC,MAAM,QAAO,wBAAuB;AAC5C,qEAAqE;AACrE,oDAAoD;AAEpD,OAAO,MAAMC,eAAgC,CAAC,EAACC,oBAAoB,EAAEC,oBAAoB,EAGxF;IACG,uBAAuB;IACvB,kGAAkG;IAElG,qBACI,oBAACC;QAAIC,OAAO;YAACC,SAAS;YAAQC,gBAAgB;QAAQ;qBAClD,oBAACP;QAAOQ,SAAS,IAAMT,OAAOG;OAEzBC;AAIjB,EAAC"}
1
+ {"version":3,"sources":["../../../src/components/LoginButton/button.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\nimport {signIn} from 'next-auth/react'\nimport {CustomComponent} from 'payload'\nimport {NestedKeysStripped} from '@payloadcms/translations'\nimport {Button, useTranslation} from '@payloadcms/ui'\nimport {translations} from '../../translations.js'\n\nexport const _LoginButton: CustomComponent<{\n internalProviderName: string,\n externalProviderName: string\n}> = ({internalProviderName, externalProviderName}) => {\n const {t} = useTranslation<typeof translations.en, NestedKeysStripped<typeof translations.en>>()\n\n return (\n <div style={{display: 'flex', justifyContent: 'center'}}>\n <Button onClick={() => signIn(internalProviderName)}>\n {t('zitadelPlugin:signIn', {externalProviderName})}\n </Button>\n </div>\n )\n}"],"names":["React","signIn","Button","useTranslation","_LoginButton","internalProviderName","externalProviderName","t","div","style","display","justifyContent","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,WAAW,QAAO;AACzB,SAAQC,MAAM,QAAO,kBAAiB;AAGtC,SAAQC,MAAM,EAAEC,cAAc,QAAO,iBAAgB;AAGrD,OAAO,MAAMC,eAGR,CAAC,EAACC,oBAAoB,EAAEC,oBAAoB,EAAC;IAC9C,MAAM,EAACC,CAAC,EAAC,GAAGJ;IAEZ,qBACI,oBAACK;QAAIC,OAAO;YAACC,SAAS;YAAQC,gBAAgB;QAAQ;qBAClD,oBAACT;QAAOU,SAAS,IAAMX,OAAOI;OACzBE,EAAE,wBAAwB;QAACD;IAAoB;AAIhE,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload-zitadel-plugin",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "plugin for Payload CMS, which enables authentication via Zitadel IdP",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -36,24 +36,24 @@
36
36
  "dist"
37
37
  ],
38
38
  "dependencies": {
39
- "@payloadcms/translations": "3.0.0-beta.52",
40
- "@payloadcms/ui": "3.0.0-beta.52",
39
+ "@payloadcms/translations": "3.0.0-beta.53",
40
+ "@payloadcms/ui": "3.0.0-beta.53",
41
41
  "jsonwebtoken": "^9.0.2",
42
42
  "next": "^15.0.0-rc.0",
43
43
  "next-auth": "^4.24.7",
44
- "payload": "3.0.0-beta.52",
45
- "react": "^19.0.0-rc-1434af3d22-20240618",
46
- "react-dom": "^19.0.0-rc-1434af3d22-20240618"
44
+ "payload": "3.0.0-beta.53",
45
+ "react": "rc",
46
+ "react-dom": "rc"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@swc/cli": "^0.3.12",
50
- "@swc/core": "^1.6.1",
50
+ "@swc/core": "^1.6.3",
51
51
  "@types/jsonwebtoken": "^9.0.6",
52
- "@types/node": "^20.14.5",
52
+ "@types/node": "^20.14.6",
53
53
  "@types/react": "^18.3.3",
54
54
  "@types/react-dom": "^18.3.0",
55
55
  "rimraf": "^5.0.7",
56
- "typescript": "^5.6.0-dev.20240618"
56
+ "typescript": "^5.5.1-rc"
57
57
  },
58
58
  "engines": {
59
59
  "node": "^22.3.0"