@payloadcms/plugin-stripe 3.0.0-canary.6041f49 → 3.0.0-canary.f1db24e

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,4 +1,5 @@
1
1
  'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider';
3
4
  // import CopyToClipboard from 'payload/dist/admin/components/elements/CopyToClipboard'
4
5
  import { useFormFields } from '@payloadcms/ui/forms/Form';
@@ -6,27 +7,37 @@ import React from 'react';
6
7
  export const LinkToDoc = ()=>{
7
8
  const { custom } = useFieldProps();
8
9
  const { isTestKey, nameOfIDField, stripeResourceType } = custom;
9
- const field = useFormFields(([fields])=>fields[nameOfIDField]);
10
+ const field = useFormFields(([fields])=>fields && fields?.[nameOfIDField] || null);
10
11
  const { value: stripeID } = field || {};
11
12
  const stripeEnv = isTestKey ? 'test/' : '';
12
13
  const href = `https://dashboard.stripe.com/${stripeEnv}${stripeResourceType}/${stripeID}`;
13
14
  if (stripeID) {
14
- return /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("span", {
15
- className: "label",
16
- style: {
17
- color: '#9A9A9A'
18
- }
19
- }, "View in Stripe")), /*#__PURE__*/ React.createElement("div", {
20
- style: {
21
- fontWeight: '600',
22
- overflow: 'hidden',
23
- textOverflow: 'ellipsis'
24
- }
25
- }, /*#__PURE__*/ React.createElement("a", {
26
- href: href,
27
- rel: "noreferrer noopener",
28
- target: "_blank"
29
- }, href)));
15
+ return /*#__PURE__*/ _jsxs("div", {
16
+ children: [
17
+ /*#__PURE__*/ _jsx("div", {
18
+ children: /*#__PURE__*/ _jsx("span", {
19
+ className: "label",
20
+ style: {
21
+ color: '#9A9A9A'
22
+ },
23
+ children: "View in Stripe"
24
+ })
25
+ }),
26
+ /*#__PURE__*/ _jsx("div", {
27
+ style: {
28
+ fontWeight: '600',
29
+ overflow: 'hidden',
30
+ textOverflow: 'ellipsis'
31
+ },
32
+ children: /*#__PURE__*/ _jsx("a", {
33
+ href: href,
34
+ rel: "noreferrer noopener",
35
+ target: "_blank",
36
+ children: href
37
+ })
38
+ })
39
+ ]
40
+ });
30
41
  }
31
42
  return null;
32
43
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/LinkToDoc.tsx"],"sourcesContent":["'use client'\nimport type { CustomComponent } from 'payload/config'\nimport type { UIField } from 'payload/types'\n\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\n// import CopyToClipboard from 'payload/dist/admin/components/elements/CopyToClipboard'\nimport { useFormFields } from '@payloadcms/ui/forms/Form'\nimport React from 'react'\n\nexport const LinkToDoc: CustomComponent<UIField> = () => {\n const { custom } = useFieldProps()\n const { isTestKey, nameOfIDField, stripeResourceType } = custom\n\n const field = useFormFields(([fields]) => fields[nameOfIDField])\n const { value: stripeID } = field || {}\n\n const stripeEnv = isTestKey ? 'test/' : ''\n const href = `https://dashboard.stripe.com/${stripeEnv}${stripeResourceType}/${stripeID}`\n\n if (stripeID) {\n return (\n <div>\n <div>\n <span\n className=\"label\"\n style={{\n color: '#9A9A9A',\n }}\n >\n View in Stripe\n </span>\n {/* <CopyToClipboard value={href} /> */}\n </div>\n <div\n style={{\n fontWeight: '600',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n <a href={href} rel=\"noreferrer noopener\" target=\"_blank\">\n {href}\n </a>\n </div>\n </div>\n )\n }\n\n return null\n}\n"],"names":["useFieldProps","useFormFields","React","LinkToDoc","custom","isTestKey","nameOfIDField","stripeResourceType","field","fields","value","stripeID","stripeEnv","href","div","span","className","style","color","fontWeight","overflow","textOverflow","a","rel","target"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,aAAa,QAAQ,0CAAyC;AACvE,uFAAuF;AACvF,SAASC,aAAa,QAAQ,4BAA2B;AACzD,OAAOC,WAAW,QAAO;AAEzB,OAAO,MAAMC,YAAsC;IACjD,MAAM,EAAEC,MAAM,EAAE,GAAGJ;IACnB,MAAM,EAAEK,SAAS,EAAEC,aAAa,EAAEC,kBAAkB,EAAE,GAAGH;IAEzD,MAAMI,QAAQP,cAAc,CAAC,CAACQ,OAAO,GAAKA,MAAM,CAACH,cAAc;IAC/D,MAAM,EAAEI,OAAOC,QAAQ,EAAE,GAAGH,SAAS,CAAC;IAEtC,MAAMI,YAAYP,YAAY,UAAU;IACxC,MAAMQ,OAAO,CAAC,6BAA6B,EAAED,UAAU,EAAEL,mBAAmB,CAAC,EAAEI,SAAS,CAAC;IAEzF,IAAIA,UAAU;QACZ,qBACE,oBAACG,2BACC,oBAACA,2BACC,oBAACC;YACCC,WAAU;YACVC,OAAO;gBACLC,OAAO;YACT;WACD,kCAKH,oBAACJ;YACCG,OAAO;gBACLE,YAAY;gBACZC,UAAU;gBACVC,cAAc;YAChB;yBAEA,oBAACC;YAAET,MAAMA;YAAMU,KAAI;YAAsBC,QAAO;WAC7CX;IAKX;IAEA,OAAO;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/ui/LinkToDoc.tsx"],"sourcesContent":["'use client'\nimport type { CustomComponent } from 'payload/config'\nimport type { UIField } from 'payload/types'\n\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\n// import CopyToClipboard from 'payload/dist/admin/components/elements/CopyToClipboard'\nimport { useFormFields } from '@payloadcms/ui/forms/Form'\nimport React from 'react'\n\nexport const LinkToDoc: CustomComponent<UIField> = () => {\n const { custom } = useFieldProps()\n const { isTestKey, nameOfIDField, stripeResourceType } = custom\n\n const field = useFormFields(([fields]) => (fields && fields?.[nameOfIDField]) || null)\n const { value: stripeID } = field || {}\n\n const stripeEnv = isTestKey ? 'test/' : ''\n const href = `https://dashboard.stripe.com/${stripeEnv}${stripeResourceType}/${stripeID}`\n\n if (stripeID) {\n return (\n <div>\n <div>\n <span\n className=\"label\"\n style={{\n color: '#9A9A9A',\n }}\n >\n View in Stripe\n </span>\n {/* <CopyToClipboard value={href} /> */}\n </div>\n <div\n style={{\n fontWeight: '600',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n <a href={href} rel=\"noreferrer noopener\" target=\"_blank\">\n {href}\n </a>\n </div>\n </div>\n )\n }\n\n return null\n}\n"],"names":["useFieldProps","useFormFields","React","LinkToDoc","custom","isTestKey","nameOfIDField","stripeResourceType","field","fields","value","stripeID","stripeEnv","href","div","span","className","style","color","fontWeight","overflow","textOverflow","a","rel","target"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAIA,SAASA,aAAa,QAAQ,0CAAyC;AACvE,uFAAuF;AACvF,SAASC,aAAa,QAAQ,4BAA2B;AACzD,OAAOC,WAAW,QAAO;AAEzB,OAAO,MAAMC,YAAsC;IACjD,MAAM,EAAEC,MAAM,EAAE,GAAGJ;IACnB,MAAM,EAAEK,SAAS,EAAEC,aAAa,EAAEC,kBAAkB,EAAE,GAAGH;IAEzD,MAAMI,QAAQP,cAAc,CAAC,CAACQ,OAAO,GAAK,AAACA,UAAUA,QAAQ,CAACH,cAAc,IAAK;IACjF,MAAM,EAAEI,OAAOC,QAAQ,EAAE,GAAGH,SAAS,CAAC;IAEtC,MAAMI,YAAYP,YAAY,UAAU;IACxC,MAAMQ,OAAO,CAAC,6BAA6B,EAAED,UAAU,EAAEL,mBAAmB,CAAC,EAAEI,SAAS,CAAC;IAEzF,IAAIA,UAAU;QACZ,qBACE,MAACG;;8BACC,KAACA;8BACC,cAAA,KAACC;wBACCC,WAAU;wBACVC,OAAO;4BACLC,OAAO;wBACT;kCACD;;;8BAKH,KAACJ;oBACCG,OAAO;wBACLE,YAAY;wBACZC,UAAU;wBACVC,cAAc;oBAChB;8BAEA,cAAA,KAACC;wBAAET,MAAMA;wBAAMU,KAAI;wBAAsBC,QAAO;kCAC7CX;;;;;IAKX;IAEA,OAAO;AACT,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-stripe",
3
- "version": "3.0.0-canary.6041f49",
3
+ "version": "3.0.0-canary.f1db24e",
4
4
  "description": "Stripe plugin for Payload",
5
5
  "keywords": [
6
6
  "payload",
@@ -42,28 +42,33 @@
42
42
  "lodash.get": "^4.4.2",
43
43
  "stripe": "^10.2.0",
44
44
  "uuid": "^9.0.0",
45
- "@payloadcms/ui": "3.0.0-canary.6041f49"
45
+ "@payloadcms/ui": "3.0.0-canary.f1db24e"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/express": "^4.17.9",
49
49
  "@types/lodash.get": "^4.4.7",
50
- "@types/react": "18.2.74",
50
+ "@types/react": "npm:types-react@19.0.0-beta.2",
51
+ "@types/react-dom": "npm:types-react-dom@19.0.0-beta.2",
51
52
  "@types/uuid": "^9.0.0",
52
- "@payloadcms/next": "3.0.0-canary.6041f49",
53
- "@payloadcms/translations": "3.0.0-canary.6041f49",
54
- "@payloadcms/ui": "3.0.0-canary.6041f49",
55
53
  "@payloadcms/eslint-config": "1.1.1",
56
- "payload": "3.0.0-canary.6041f49"
54
+ "@payloadcms/translations": "3.0.0-canary.f1db24e",
55
+ "@payloadcms/ui": "3.0.0-canary.f1db24e",
56
+ "@payloadcms/next": "3.0.0-canary.f1db24e",
57
+ "payload": "3.0.0-canary.f1db24e"
57
58
  },
58
59
  "peerDependencies": {
59
- "@payloadcms/translations": "3.0.0-canary.6041f49",
60
- "payload": "3.0.0-canary.6041f49",
61
- "@payloadcms/ui": "3.0.0-canary.6041f49"
60
+ "@payloadcms/translations": "3.0.0-canary.f1db24e",
61
+ "@payloadcms/ui": "3.0.0-canary.f1db24e",
62
+ "payload": "3.0.0-canary.f1db24e"
62
63
  },
63
64
  "publishConfig": {
64
65
  "registry": "https://registry.npmjs.org/"
65
66
  },
66
67
  "homepage:": "https://payloadcms.com",
68
+ "overrides": {
69
+ "@types/react": "npm:types-react@19.0.0-beta.2",
70
+ "@types/react-dom": "npm:types-react-dom@19.0.0-beta.2"
71
+ },
67
72
  "scripts": {
68
73
  "build": "pnpm copyfiles && pnpm build:swc && pnpm build:types",
69
74
  "build:swc": "swc ./src -d ./dist --config-file .swcrc",