@dev-crew-berlin/enter-js-utils 0.94.0 → 0.95.1
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/generated/api-schema.d.ts +21 -1
- package/dist/lib/tokens.js +4 -1
- package/dist/models/attendee.js +1 -1
- package/dist/ui/guest-card.js +2 -1
- package/dist/ui/tag.d.ts +2 -0
- package/dist/ui/tag.js +14 -4
- package/package.json +1 -1
|
@@ -221,6 +221,7 @@ export type components = {
|
|
|
221
221
|
};
|
|
222
222
|
companions?: components["schemas"]["RootModel_Union_Companion__MainGuest__-Input"];
|
|
223
223
|
payment?: components["schemas"]["Payment"] | null;
|
|
224
|
+
partialPayment?: components["schemas"]["PartialPayment"];
|
|
224
225
|
/** Branches */
|
|
225
226
|
branches?: string[];
|
|
226
227
|
/** Deletedbranches */
|
|
@@ -1246,6 +1247,23 @@ export type components = {
|
|
|
1246
1247
|
*/
|
|
1247
1248
|
max: number;
|
|
1248
1249
|
};
|
|
1250
|
+
/** PartialPayment */
|
|
1251
|
+
PartialPayment: {
|
|
1252
|
+
/** Paid */
|
|
1253
|
+
paid?: boolean;
|
|
1254
|
+
/** Amount */
|
|
1255
|
+
amount?: number;
|
|
1256
|
+
/**
|
|
1257
|
+
* Provider
|
|
1258
|
+
* @enum {string}
|
|
1259
|
+
*/
|
|
1260
|
+
provider?: "manual" | "sepa" | "credit" | "bank_transfer" | "paypal" | "stripe";
|
|
1261
|
+
/**
|
|
1262
|
+
* Currency
|
|
1263
|
+
* @enum {string}
|
|
1264
|
+
*/
|
|
1265
|
+
currency?: "USD" | "EUR" | "CHF";
|
|
1266
|
+
};
|
|
1249
1267
|
/** Payment */
|
|
1250
1268
|
Payment: {
|
|
1251
1269
|
/** Paid */
|
|
@@ -1256,7 +1274,7 @@ export type components = {
|
|
|
1256
1274
|
* Provider
|
|
1257
1275
|
* @enum {string}
|
|
1258
1276
|
*/
|
|
1259
|
-
provider: "manual" | "sepa" | "
|
|
1277
|
+
provider: "manual" | "sepa" | "credit" | "bank_transfer" | "paypal" | "stripe";
|
|
1260
1278
|
/** Reference */
|
|
1261
1279
|
reference?: string | null;
|
|
1262
1280
|
/** Amount */
|
|
@@ -1292,6 +1310,8 @@ export type components = {
|
|
|
1292
1310
|
attendeeId: string;
|
|
1293
1311
|
/** Instancename */
|
|
1294
1312
|
instanceName: string;
|
|
1313
|
+
/** Provider */
|
|
1314
|
+
provider?: ("manual" | "sepa" | "credit" | "bank_transfer" | "paypal" | "stripe") | null;
|
|
1295
1315
|
};
|
|
1296
1316
|
/** PublicAttendee */
|
|
1297
1317
|
"PublicAttendee-Input": {
|
package/dist/lib/tokens.js
CHANGED
|
@@ -23,7 +23,10 @@ export function parseRegistrationToken(tokenString, options) {
|
|
|
23
23
|
return success({
|
|
24
24
|
attendeeId: payload.attendee_id,
|
|
25
25
|
sessionType: payload.session_type ?? 'register',
|
|
26
|
-
email: payload.email
|
|
26
|
+
email: payload.email ? {
|
|
27
|
+
name: payload.email.name,
|
|
28
|
+
mailingId: payload.email.mailing_id
|
|
29
|
+
} : undefined,
|
|
27
30
|
flags: payload.flags ?? {},
|
|
28
31
|
isExpired
|
|
29
32
|
});
|
package/dist/models/attendee.js
CHANGED
|
@@ -97,7 +97,7 @@ export class Attendee {
|
|
|
97
97
|
getResponse(branchName, counterName) {
|
|
98
98
|
const rsvp = this.rsvp.get(branchName) ?? null;
|
|
99
99
|
if (rsvp === null) return 'no-response';
|
|
100
|
-
if (!rsvp.checkinCounters.has(counterName)) 'no-response';
|
|
100
|
+
if (!rsvp.checkinCounters.has(counterName)) return 'no-response';
|
|
101
101
|
return rsvp.confirmed ? 'positive-response' : 'negative-response';
|
|
102
102
|
}
|
|
103
103
|
getCheckinsForBranch(branchName) {
|
package/dist/ui/guest-card.js
CHANGED
|
@@ -45,7 +45,8 @@ export const GuestCard = props => {
|
|
|
45
45
|
})), /*#__PURE__*/React.createElement("div", {
|
|
46
46
|
className: _JSXStyle.dynamic([["1739379681", [colors.enterGrey, colors.enterBackground, fonts.primary, props.dense ? '0.5em 0' : '1.5em 0']]]) + " " + 'tag-list'
|
|
47
47
|
}, tags.map(tag => /*#__PURE__*/React.createElement(Tag, {
|
|
48
|
-
key: tag
|
|
48
|
+
key: tag,
|
|
49
|
+
color: getTagColor(tag)
|
|
49
50
|
}, tag)), props.infoText && /*#__PURE__*/React.createElement("div", {
|
|
50
51
|
className: _JSXStyle.dynamic([["1739379681", [colors.enterGrey, colors.enterBackground, fonts.primary, props.dense ? '0.5em 0' : '1.5em 0']]]) + " " + 'info'
|
|
51
52
|
}, " ", props.infoText))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
package/dist/ui/tag.d.ts
CHANGED
package/dist/ui/tag.js
CHANGED
|
@@ -2,11 +2,21 @@ import _JSXStyle from "styled-jsx/style";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import 'styled-jsx';
|
|
4
4
|
import { colors, fonts } from '../lib/theme';
|
|
5
|
+
|
|
6
|
+
// Decide on text color based on contrast to background color
|
|
7
|
+
function getContrastYIQ(hexcolor) {
|
|
8
|
+
const r = parseInt(hexcolor.substring(1, 3), 16);
|
|
9
|
+
const g = parseInt(hexcolor.substring(3, 5), 16);
|
|
10
|
+
const b = parseInt(hexcolor.substring(5, 7), 16);
|
|
11
|
+
const yiq = (r * 299 + g * 587 + b * 114) / 1000;
|
|
12
|
+
return yiq >= 128 ? 'black' : 'white';
|
|
13
|
+
}
|
|
5
14
|
export const Tag = props => {
|
|
15
|
+
const textColor = getContrastYIQ(props.color ?? '#ffffff');
|
|
6
16
|
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
-
className: _JSXStyle.dynamic([["
|
|
17
|
+
className: _JSXStyle.dynamic([["2799826206", [fonts.primary, props.big ? '14px' : '0.8em', textColor === 'black' ? colors.enterDarkGrey : 'white', props.color ? props.color : 'transparent', colors.enterGrey, props.big ? '7px 10px 5px 0' : '0 0 0.5em 0.5em']]]) + " " + 'tag'
|
|
8
18
|
}, props.children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
9
|
-
id: "
|
|
10
|
-
dynamic: [fonts.primary, colors.enterDarkGrey, colors.enterGrey]
|
|
11
|
-
}, `.tag.__jsx-style-dynamic-selector{font-family:${fonts.primary};font-size:0.8em;color:${colors.enterDarkGrey};text-transform:uppercase;display:inline-block;background-color:transparent;border-radius:2px;border:1px solid ${colors.enterGrey};padding:2px 8px;margin:0 0 0.5em 0.5em;word-wrap:anywhere;}`));
|
|
19
|
+
id: "2799826206",
|
|
20
|
+
dynamic: [fonts.primary, props.big ? '14px' : '0.8em', textColor === 'black' ? colors.enterDarkGrey : 'white', props.color ? props.color : 'transparent', colors.enterGrey, props.big ? '7px 10px 5px 0' : '0 0 0.5em 0.5em']
|
|
21
|
+
}, `.tag.__jsx-style-dynamic-selector{font-family:${fonts.primary};font-size:${props.big ? '14px' : '0.8em'};color:${textColor === 'black' ? colors.enterDarkGrey : 'white'};text-transform:uppercase;display:inline-block;background-color:${props.color ? props.color : 'transparent'};border-radius:2px;border:1px solid ${colors.enterGrey};padding:2px 8px;margin:${props.big ? '7px 10px 5px 0' : '0 0 0.5em 0.5em'};word-wrap:anywhere;}`));
|
|
12
22
|
};
|