@planningcenter/organization-avatars 1.0.1 → 1.1.0
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/dist/index.cjs +1 -1
- package/dist/index.js +83 -87
- package/dist/organization_avatar.d.ts +1 -1
- package/dist/organization_avatars.d.ts +1 -1
- package/dist/types.d.ts +0 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),R=require("react-dom"),B=require("@planningcenter/url"),C=require("@planningcenter/tapestry"),A=require("@planningcenter/icons/paths/general"),D=require("@planningcenter/icons/paths/services"),L=require("react-dropzone");function z(a){var o,r,t="";if(typeof a=="string"||typeof a=="number")t+=a;else if(typeof a=="object")if(Array.isArray(a)){var c=a.length;for(o=0;o<c;o++)a[o]&&(r=z(a[o]))&&(t&&(t+=" "),t+=r)}else for(r in a)a[r]&&(t&&(t+=" "),t+=r);return t}function P(){for(var a,o,r=0,t="",c=arguments.length;r<c;r++)(a=arguments[r])&&(o=z(a))&&(t&&(t+=" "),t+=o);return t}const $=a=>a==="dark_mode_avatar"?"dark":"light";function k({avatarUrl:a,organization:o,mode:r,pcoEnv:t,csrfToken:c,onAvatarUpdate:f}){const[n,m]=i.useState(null),[d,v]=i.useState(a),[l,g]=i.useState(!1),[j,u]=i.useState(""),x=i.useId(),U=i.useRef(null),_=$(r),S=h=>{const[s]=h;s&&m(Object.assign(s,{preview:URL.createObjectURL(s)}))};i.useEffect(()=>{v(a)},[a]),i.useEffect(()=>()=>{n?.preview&&(URL.revokeObjectURL(n.preview),u(""))},[n]);const N=async h=>{const s=await fetch(B.pcoApiUrl("accounts",{env:t}),{method:"PATCH",headers:{"Content-Type":"application/json","X-CSRF-Token":c,Accept:"application/json"},body:JSON.stringify({data:{attributes:h}})}),p=await s.json();if(!s.ok)throw p;return p},F=async h=>{if(h.preventDefault(),!(!n||l)){g(!0);try{const s=new FileReader,p=await new Promise((y,w)=>{s.onloadend=()=>y(s.result),s.onerror=w,s.readAsDataURL(n)}),b=await N({[r]:p,[`${r}_cache`]:""});v(b.data.attributes[r].url),m(null),f(r,b.data.attributes[r].url),U.current?.close()}catch{u("We were unable to save your avatar.")}finally{g(!1)}}},q=async()=>{if(!l){g(!0);try{await N({[`remove_${r}`]:"1"}),v(""),f(r,""),U.current?.close()}catch{u("We were unable to delete your avatar.")}finally{g(!1)}}},M=()=>{m(null),u("")};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"pco-org-avatar",children:[e.jsx("button",{type:"button",commandfor:x,command:"show-modal",className:`pco-org-avatar__button pco-org-avatar__button--${_}`,children:d?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:d,alt:`Church logo for ${o}`}),e.jsx("span",{children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:A.pencil})})})]}):e.jsx("svg",{width:"48",height:"48",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:D.image})})}),e.jsxs("div",{className:"pco-org-avatar__label",children:[_," mode"]})]}),R.createPortal(e.jsx("dialog",{id:x,ref:U,className:"dialog",onClose:M,children:e.jsxs("form",{onSubmit:F,children:[e.jsxs("div",{className:"dialog__header",children:[e.jsxs("h1",{className:"dialog__title",children:["Church logo — ",_," mode"]}),e.jsx("button",{type:"button",commandfor:x,command:"close",className:"dialog__close","aria-label":"Close modal",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:A.smallX})})})]}),e.jsxs("div",{className:"dialog__body",children:[j&&e.jsxs("div",{role:"alert",className:"alert alert--danger mb-2",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",className:"symbol","aria-hidden":"true",children:e.jsx("path",{d:A.exclamationTriangle})}),e.jsx("div",{className:"alert__content",children:e.jsx("p",{children:j})})]}),e.jsx(L,{accept:{"image/*":[".jpg",".jpeg",".png"]},multiple:!1,onDropAccepted:S,children:({getRootProps:h,getInputProps:s,isFocused:p,isDragAccept:b,isDragReject:y,isDragActive:w})=>{const O=P("pco-org-avatar__dropzone",`pco-org-avatar__dropzone--${_}`,{"pco-org-avatar__dropzone--image":n||d,"pco-org-avatar__dropzone--focused":p,"pco-org-avatar__dropzone--accepted":b,"pco-org-avatar__dropzone--rejected":w&&y});return e.jsxs("div",{...h({className:O}),children:[e.jsx("input",{...s()}),n?e.jsx("img",{src:n.preview,alt:`Church logo for ${o}`}):d?e.jsx("img",{src:d,alt:`Church logo for ${o}`}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{width:"64",height:"64",viewBox:"0 0 16 16","aria-hidden":"true",children:e.jsx("path",{d:A.toCloudArrow})}),w&&y?e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:"Wrong file type"}),e.jsx("p",{children:"Please upload a PNG or JPG file."})]}):e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:"Add church logo"}),e.jsx("p",{children:"Use a high-quality image (up to 20mb) with a transparent background."})]})]})]})}})]}),e.jsxs("div",{className:"dialog__actions",children:[d&&e.jsx(C.Button,{label:"Delete logo",kind:"delete",onClick:q,loading:l,disabled:l,className:"mr-a"}),e.jsx(C.Button,{type:"button",label:"Cancel",commandfor:x,command:"close",disabled:l}),e.jsx(C.Button,{type:"submit",label:"Update logo",kind:"primary",loading:l,disabled:!n||l})]})]})}),document.body)]})}function T({avatarUrl:a,darkModeAvatarUrl:o,orgName:r,pcoEnv:t,csrfToken:c,showDarkModeAvatar:f=!1}){const[n,m]=i.useState(a),[d,v]=i.useState(o),l=(j,u)=>{j==="avatar"?m(u):j==="dark_mode_avatar"&&v(u)},g=d||n;return e.jsxs("div",{className:"d-f g-1",children:[e.jsx(k,{avatarUrl:n,organization:r,mode:"avatar",pcoEnv:t,csrfToken:c,onAvatarUpdate:l}),f&&e.jsx(k,{avatarUrl:g,organization:r,mode:"dark_mode_avatar",pcoEnv:t,csrfToken:c,onAvatarUpdate:l})]})}exports.OrganizationAvatars=T;
|
package/dist/index.js
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
import { jsxs as o, Fragment as b, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useState as m, useId as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { pcoApiUrl as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { pencil as
|
|
7
|
-
import { image as
|
|
8
|
-
import
|
|
9
|
-
function
|
|
2
|
+
import { useState as m, useId as B, useRef as P, useEffect as x } from "react";
|
|
3
|
+
import { createPortal as S } from "react-dom";
|
|
4
|
+
import { pcoApiUrl as I } from "@planningcenter/url";
|
|
5
|
+
import { Button as z } from "@planningcenter/tapestry";
|
|
6
|
+
import { pencil as T, smallX as W, exclamationTriangle as G, toCloudArrow as J } from "@planningcenter/icons/paths/general";
|
|
7
|
+
import { image as X } from "@planningcenter/icons/paths/services";
|
|
8
|
+
import q from "react-dropzone";
|
|
9
|
+
function D(a) {
|
|
10
10
|
var l, r, t = "";
|
|
11
11
|
if (typeof a == "string" || typeof a == "number") t += a;
|
|
12
12
|
else if (typeof a == "object") if (Array.isArray(a)) {
|
|
13
|
-
var
|
|
14
|
-
for (l = 0; l <
|
|
13
|
+
var d = a.length;
|
|
14
|
+
for (l = 0; l < d; l++) a[l] && (r = D(a[l])) && (t && (t += " "), t += r);
|
|
15
15
|
} else for (r in a) a[r] && (t && (t += " "), t += r);
|
|
16
16
|
return t;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
for (var a, l, r = 0, t = "",
|
|
18
|
+
function E() {
|
|
19
|
+
for (var a, l, r = 0, t = "", d = arguments.length; r < d; r++) (a = arguments[r]) && (l = D(a)) && (t && (t += " "), t += l);
|
|
20
20
|
return t;
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
function
|
|
22
|
+
const H = (a) => a === "dark_mode_avatar" ? "dark" : "light";
|
|
23
|
+
function M({
|
|
24
24
|
avatarUrl: a,
|
|
25
25
|
organization: l,
|
|
26
26
|
mode: r,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
onAvatarUpdate: w
|
|
27
|
+
pcoEnv: t,
|
|
28
|
+
csrfToken: d,
|
|
29
|
+
onAvatarUpdate: y
|
|
31
30
|
}) {
|
|
32
|
-
const [i, g] = m(null), [s, f] = m(a), [
|
|
31
|
+
const [i, g] = m(null), [s, f] = m(a), [c, v] = m(!1), [_, h] = m(""), w = B(), N = P(null), U = H(r), R = (u) => {
|
|
33
32
|
const [n] = u;
|
|
34
33
|
n && g(
|
|
35
34
|
Object.assign(n, {
|
|
@@ -37,17 +36,17 @@ function D({
|
|
|
37
36
|
})
|
|
38
37
|
);
|
|
39
38
|
};
|
|
40
|
-
|
|
39
|
+
x(() => {
|
|
41
40
|
f(a);
|
|
42
|
-
}, [a]),
|
|
41
|
+
}, [a]), x(() => () => {
|
|
43
42
|
i?.preview && (URL.revokeObjectURL(i.preview), h(""));
|
|
44
43
|
}, [i]);
|
|
45
|
-
const
|
|
46
|
-
const n = await fetch(
|
|
44
|
+
const j = async (u) => {
|
|
45
|
+
const n = await fetch(I("accounts", { env: t }), {
|
|
47
46
|
method: "PATCH",
|
|
48
47
|
headers: {
|
|
49
48
|
"Content-Type": "application/json",
|
|
50
|
-
"X-CSRF-Token":
|
|
49
|
+
"X-CSRF-Token": d,
|
|
51
50
|
Accept: "application/json"
|
|
52
51
|
},
|
|
53
52
|
body: JSON.stringify({
|
|
@@ -58,37 +57,37 @@ function D({
|
|
|
58
57
|
}), p = await n.json();
|
|
59
58
|
if (!n.ok) throw p;
|
|
60
59
|
return p;
|
|
61
|
-
},
|
|
62
|
-
if (u.preventDefault(), !(!i ||
|
|
60
|
+
}, F = async (u) => {
|
|
61
|
+
if (u.preventDefault(), !(!i || c)) {
|
|
63
62
|
v(!0);
|
|
64
63
|
try {
|
|
65
|
-
const n = new FileReader(), p = await new Promise((
|
|
66
|
-
n.onloadend = () =>
|
|
67
|
-
}), A = await
|
|
64
|
+
const n = new FileReader(), p = await new Promise((C, k) => {
|
|
65
|
+
n.onloadend = () => C(n.result), n.onerror = k, n.readAsDataURL(i);
|
|
66
|
+
}), A = await j({
|
|
68
67
|
[r]: p,
|
|
69
68
|
[`${r}_cache`]: ""
|
|
70
69
|
});
|
|
71
|
-
f(A.data.attributes[r].url), g(null),
|
|
70
|
+
f(A.data.attributes[r].url), g(null), y(r, A.data.attributes[r].url), N.current?.close();
|
|
72
71
|
} catch {
|
|
73
72
|
h("We were unable to save your avatar.");
|
|
74
73
|
} finally {
|
|
75
74
|
v(!1);
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
|
-
},
|
|
79
|
-
if (!
|
|
77
|
+
}, L = async () => {
|
|
78
|
+
if (!c) {
|
|
80
79
|
v(!0);
|
|
81
80
|
try {
|
|
82
|
-
await
|
|
81
|
+
await j({
|
|
83
82
|
[`remove_${r}`]: "1"
|
|
84
|
-
}), f(""),
|
|
83
|
+
}), f(""), y(r, ""), N.current?.close();
|
|
85
84
|
} catch {
|
|
86
85
|
h("We were unable to delete your avatar.");
|
|
87
86
|
} finally {
|
|
88
87
|
v(!1);
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
|
-
},
|
|
90
|
+
}, O = () => {
|
|
92
91
|
g(null), h("");
|
|
93
92
|
};
|
|
94
93
|
return /* @__PURE__ */ o(b, { children: [
|
|
@@ -97,9 +96,9 @@ function D({
|
|
|
97
96
|
"button",
|
|
98
97
|
{
|
|
99
98
|
type: "button",
|
|
100
|
-
commandfor:
|
|
99
|
+
commandfor: w,
|
|
101
100
|
command: "show-modal",
|
|
102
|
-
className: `pco-org-avatar__button pco-org-avatar__button--${
|
|
101
|
+
className: `pco-org-avatar__button pco-org-avatar__button--${U}`,
|
|
103
102
|
children: s ? /* @__PURE__ */ o(b, { children: [
|
|
104
103
|
/* @__PURE__ */ e("img", { src: s, alt: `Church logo for ${l}` }),
|
|
105
104
|
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
@@ -110,7 +109,7 @@ function D({
|
|
|
110
109
|
viewBox: "0 0 16 16",
|
|
111
110
|
fill: "currentColor",
|
|
112
111
|
"aria-hidden": "true",
|
|
113
|
-
children: /* @__PURE__ */ e("path", { d:
|
|
112
|
+
children: /* @__PURE__ */ e("path", { d: T })
|
|
114
113
|
}
|
|
115
114
|
) })
|
|
116
115
|
] }) : /* @__PURE__ */ e(
|
|
@@ -121,36 +120,36 @@ function D({
|
|
|
121
120
|
viewBox: "0 0 16 16",
|
|
122
121
|
fill: "currentColor",
|
|
123
122
|
"aria-hidden": "true",
|
|
124
|
-
children: /* @__PURE__ */ e("path", { d:
|
|
123
|
+
children: /* @__PURE__ */ e("path", { d: X })
|
|
125
124
|
}
|
|
126
125
|
)
|
|
127
126
|
}
|
|
128
127
|
),
|
|
129
128
|
/* @__PURE__ */ o("div", { className: "pco-org-avatar__label", children: [
|
|
130
|
-
|
|
129
|
+
U,
|
|
131
130
|
" mode"
|
|
132
131
|
] })
|
|
133
132
|
] }),
|
|
134
|
-
|
|
133
|
+
S(
|
|
135
134
|
/* @__PURE__ */ e(
|
|
136
135
|
"dialog",
|
|
137
136
|
{
|
|
138
|
-
id:
|
|
139
|
-
ref:
|
|
137
|
+
id: w,
|
|
138
|
+
ref: N,
|
|
140
139
|
className: "dialog",
|
|
141
|
-
onClose:
|
|
142
|
-
children: /* @__PURE__ */ o("form", { onSubmit:
|
|
140
|
+
onClose: O,
|
|
141
|
+
children: /* @__PURE__ */ o("form", { onSubmit: F, children: [
|
|
143
142
|
/* @__PURE__ */ o("div", { className: "dialog__header", children: [
|
|
144
143
|
/* @__PURE__ */ o("h1", { className: "dialog__title", children: [
|
|
145
144
|
"Church logo — ",
|
|
146
|
-
|
|
145
|
+
U,
|
|
147
146
|
" mode"
|
|
148
147
|
] }),
|
|
149
148
|
/* @__PURE__ */ e(
|
|
150
149
|
"button",
|
|
151
150
|
{
|
|
152
151
|
type: "button",
|
|
153
|
-
commandfor:
|
|
152
|
+
commandfor: w,
|
|
154
153
|
command: "close",
|
|
155
154
|
className: "dialog__close",
|
|
156
155
|
"aria-label": "Close modal",
|
|
@@ -162,7 +161,7 @@ function D({
|
|
|
162
161
|
viewBox: "0 0 16 16",
|
|
163
162
|
fill: "currentColor",
|
|
164
163
|
"aria-hidden": "true",
|
|
165
|
-
children: /* @__PURE__ */ e("path", { d:
|
|
164
|
+
children: /* @__PURE__ */ e("path", { d: W })
|
|
166
165
|
}
|
|
167
166
|
)
|
|
168
167
|
}
|
|
@@ -178,36 +177,36 @@ function D({
|
|
|
178
177
|
viewBox: "0 0 16 16",
|
|
179
178
|
className: "symbol",
|
|
180
179
|
"aria-hidden": "true",
|
|
181
|
-
children: /* @__PURE__ */ e("path", { d:
|
|
180
|
+
children: /* @__PURE__ */ e("path", { d: G })
|
|
182
181
|
}
|
|
183
182
|
),
|
|
184
183
|
/* @__PURE__ */ e("div", { className: "alert__content", children: /* @__PURE__ */ e("p", { children: _ }) })
|
|
185
184
|
] }),
|
|
186
185
|
/* @__PURE__ */ e(
|
|
187
|
-
|
|
186
|
+
q,
|
|
188
187
|
{
|
|
189
188
|
accept: { "image/*": [".jpg", ".jpeg", ".png"] },
|
|
190
189
|
multiple: !1,
|
|
191
|
-
onDropAccepted:
|
|
190
|
+
onDropAccepted: R,
|
|
192
191
|
children: ({
|
|
193
192
|
getRootProps: u,
|
|
194
193
|
getInputProps: n,
|
|
195
194
|
isFocused: p,
|
|
196
195
|
isDragAccept: A,
|
|
197
|
-
isDragReject:
|
|
198
|
-
isDragActive:
|
|
196
|
+
isDragReject: C,
|
|
197
|
+
isDragActive: k
|
|
199
198
|
}) => {
|
|
200
|
-
const
|
|
199
|
+
const $ = E(
|
|
201
200
|
"pco-org-avatar__dropzone",
|
|
202
|
-
`pco-org-avatar__dropzone--${
|
|
201
|
+
`pco-org-avatar__dropzone--${U}`,
|
|
203
202
|
{
|
|
204
203
|
"pco-org-avatar__dropzone--image": i || s,
|
|
205
204
|
"pco-org-avatar__dropzone--focused": p,
|
|
206
205
|
"pco-org-avatar__dropzone--accepted": A,
|
|
207
|
-
"pco-org-avatar__dropzone--rejected":
|
|
206
|
+
"pco-org-avatar__dropzone--rejected": k && C
|
|
208
207
|
}
|
|
209
208
|
);
|
|
210
|
-
return /* @__PURE__ */ o("div", { ...u({ className:
|
|
209
|
+
return /* @__PURE__ */ o("div", { ...u({ className: $ }), children: [
|
|
211
210
|
/* @__PURE__ */ e("input", { ...n() }),
|
|
212
211
|
i ? /* @__PURE__ */ e(
|
|
213
212
|
"img",
|
|
@@ -229,10 +228,10 @@ function D({
|
|
|
229
228
|
height: "64",
|
|
230
229
|
viewBox: "0 0 16 16",
|
|
231
230
|
"aria-hidden": "true",
|
|
232
|
-
children: /* @__PURE__ */ e("path", { d:
|
|
231
|
+
children: /* @__PURE__ */ e("path", { d: J })
|
|
233
232
|
}
|
|
234
233
|
),
|
|
235
|
-
|
|
234
|
+
k && C ? /* @__PURE__ */ o(b, { children: [
|
|
236
235
|
/* @__PURE__ */ e("h2", { children: "Wrong file type" }),
|
|
237
236
|
/* @__PURE__ */ e("p", { children: "Please upload a PNG or JPG file." })
|
|
238
237
|
] }) : /* @__PURE__ */ o(b, { children: [
|
|
@@ -247,34 +246,34 @@ function D({
|
|
|
247
246
|
] }),
|
|
248
247
|
/* @__PURE__ */ o("div", { className: "dialog__actions", children: [
|
|
249
248
|
s && /* @__PURE__ */ e(
|
|
250
|
-
|
|
249
|
+
z,
|
|
251
250
|
{
|
|
252
251
|
label: "Delete logo",
|
|
253
252
|
kind: "delete",
|
|
254
|
-
onClick:
|
|
255
|
-
loading:
|
|
256
|
-
disabled:
|
|
253
|
+
onClick: L,
|
|
254
|
+
loading: c,
|
|
255
|
+
disabled: c,
|
|
257
256
|
className: "mr-a"
|
|
258
257
|
}
|
|
259
258
|
),
|
|
260
259
|
/* @__PURE__ */ e(
|
|
261
|
-
|
|
260
|
+
z,
|
|
262
261
|
{
|
|
263
262
|
type: "button",
|
|
264
263
|
label: "Cancel",
|
|
265
|
-
commandfor:
|
|
264
|
+
commandfor: w,
|
|
266
265
|
command: "close",
|
|
267
|
-
disabled:
|
|
266
|
+
disabled: c
|
|
268
267
|
}
|
|
269
268
|
),
|
|
270
269
|
/* @__PURE__ */ e(
|
|
271
|
-
|
|
270
|
+
z,
|
|
272
271
|
{
|
|
273
272
|
type: "submit",
|
|
274
273
|
label: "Update logo",
|
|
275
274
|
kind: "primary",
|
|
276
|
-
loading:
|
|
277
|
-
disabled: !i ||
|
|
275
|
+
loading: c,
|
|
276
|
+
disabled: !i || c
|
|
278
277
|
}
|
|
279
278
|
)
|
|
280
279
|
] })
|
|
@@ -285,47 +284,44 @@ function D({
|
|
|
285
284
|
)
|
|
286
285
|
] });
|
|
287
286
|
}
|
|
288
|
-
function
|
|
287
|
+
function te({
|
|
289
288
|
avatarUrl: a,
|
|
290
289
|
darkModeAvatarUrl: l,
|
|
291
290
|
orgName: r,
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
showDarkModeAvatar: w = !1
|
|
291
|
+
pcoEnv: t,
|
|
292
|
+
csrfToken: d,
|
|
293
|
+
showDarkModeAvatar: y = !1
|
|
296
294
|
}) {
|
|
297
295
|
const [i, g] = m(a), [s, f] = m(
|
|
298
296
|
l
|
|
299
|
-
),
|
|
297
|
+
), c = (_, h) => {
|
|
300
298
|
_ === "avatar" ? g(h) : _ === "dark_mode_avatar" && f(h);
|
|
301
299
|
};
|
|
302
300
|
return /* @__PURE__ */ o("div", { className: "d-f g-1", children: [
|
|
303
301
|
/* @__PURE__ */ e(
|
|
304
|
-
|
|
302
|
+
M,
|
|
305
303
|
{
|
|
306
304
|
avatarUrl: i,
|
|
307
305
|
organization: r,
|
|
308
306
|
mode: "avatar",
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
onAvatarUpdate: d
|
|
307
|
+
pcoEnv: t,
|
|
308
|
+
csrfToken: d,
|
|
309
|
+
onAvatarUpdate: c
|
|
313
310
|
}
|
|
314
311
|
),
|
|
315
|
-
|
|
316
|
-
|
|
312
|
+
y && /* @__PURE__ */ e(
|
|
313
|
+
M,
|
|
317
314
|
{
|
|
318
315
|
avatarUrl: s || i,
|
|
319
316
|
organization: r,
|
|
320
317
|
mode: "dark_mode_avatar",
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
onAvatarUpdate: d
|
|
318
|
+
pcoEnv: t,
|
|
319
|
+
csrfToken: d,
|
|
320
|
+
onAvatarUpdate: c
|
|
325
321
|
}
|
|
326
322
|
)
|
|
327
323
|
] });
|
|
328
324
|
}
|
|
329
325
|
export {
|
|
330
|
-
|
|
326
|
+
te as OrganizationAvatars
|
|
331
327
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { OrganizationAvatarProps } from "./types";
|
|
2
|
-
export declare function OrganizationAvatar({ avatarUrl, organization, mode,
|
|
2
|
+
export declare function OrganizationAvatar({ avatarUrl, organization, mode, pcoEnv, csrfToken, onAvatarUpdate, }: OrganizationAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { OrganizationAvatarsProps } from "./types";
|
|
2
|
-
export declare function OrganizationAvatars({ avatarUrl: initialAvatarUrl, darkModeAvatarUrl: initialDarkModeAvatarUrl, orgName,
|
|
2
|
+
export declare function OrganizationAvatars({ avatarUrl: initialAvatarUrl, darkModeAvatarUrl: initialDarkModeAvatarUrl, orgName, pcoEnv, csrfToken, showDarkModeAvatar, }: OrganizationAvatarsProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/types.d.ts
CHANGED