@goodhood-web/nebenan-base 4.4.2-development.3 → 4.5.0-development.10
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/index.js +104 -101
- package/index.mjs +25727 -24684
- package/lib/Authentication/Registration/RegistrationForm/Steps/Email.d.ts +3 -0
- package/lib/ContentCreator/ContentCreator.d.ts +8 -2
- package/lib/ContentCreator/ContentCreatorForm.d.ts +3 -0
- package/lib/ContentCreator/{ContentCreator.types.d.ts → ContentCreatorForm.types.d.ts} +17 -4
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/ContentCreatorFieldsWrapper.d.ts +2 -2
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentFieldsSheet/ContentFieldsSheet.d.ts +3 -3
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentFieldsSheet/ContentFieldsSheet.types.d.ts +7 -0
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentTypeField/ContentTypeField.d.ts +1 -1
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentTypeField/ContentTypeField.types.d.ts +1 -0
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/EventFields/EventFields.d.ts +1 -1
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/EventFields/EventFields.types.d.ts +2 -0
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/CategoryModalField.d.ts +1 -1
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/FormModalFields/FormCategory.d.ts +5 -2
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/FormModalFields/FormLocation.d.ts +5 -2
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/ListModalField.types.d.ts +5 -0
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/LocationModalField.d.ts +1 -1
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/MarketplaceFields/MarketplaceFields.d.ts +1 -1
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/MarketplaceFields/MarketplaceFields.types.d.ts +2 -0
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/PostFields/FormRichTextArea.d.ts +10 -5
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ReachTypeField/ReachTypeField.d.ts +1 -1
- package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ReachTypeField/ReachTypeFields.types.d.ts +4 -1
- package/lib/ContentCreator/constants.d.ts +20 -0
- package/lib/ContentCreator/mockedData.d.ts +4 -0
- package/lib/ContentCreator/network.d.ts +2 -2
- package/lib/ContentCreator/utils/general.d.ts +3 -1
- package/lib/ContentCreator/utils/payloadGenerators.d.ts +4 -4
- package/lib/ContentCreator/validationSchemas/commonSchemas.d.ts +1 -1
- package/lib/ContentCreator/validationSchemas/dynamicValidationSchema.d.ts +50 -17
- package/lib/ContentCreator/validationSchemas/eventSchema.d.ts +3 -3
- package/lib/ContentCreator/validationSchemas/marketplaceSchema.d.ts +38 -5
- package/lib/ContentCreator/validationSchemas/postSchema.d.ts +9 -9
- package/lib/Feed/FeedItem/Marketplace/MarketplaceBody/MarketplaceBody.d.ts +1 -1
- package/lib/Feed/FeedItem/Marketplace/MarketplaceBody/MarketplaceBody.types.d.ts +4 -0
- package/lib/Feed/FeedItem/Marketplace/MarketplaceDetailPage/MarketplaceDetailPage.d.ts +3 -1
- package/lib/Feed/FeedItem/Marketplace/MarketplaceDetailPage/MarketplaceDetailPage.types.d.ts +6 -0
- package/lib/Feed/FeedItem/Replies/ReplySection/network.d.ts +1 -0
- package/lib/Feed/FeedItem/Replies/ReplySection/utils.d.ts +1 -0
- package/lib/Feed/utils.d.ts +2 -1
- package/lib/Forms/Fields/FormPremiumFeatureSelector.d.ts +8 -0
- package/lib/Forms/Fields/PasswordField/PasswordField.d.ts +1 -1
- package/lib/Forms/Fields/PasswordField/PasswordField.types.d.ts +1 -0
- package/lib/Forms/Fields/PasswordField/utils.d.ts +1 -1
- package/lib/Forms/Fields/utils.d.ts +2 -0
- package/lib/PremiumFeaturePanel/PremiumFeaturePanel.d.ts +3 -0
- package/lib/PremiumFeaturePanel/PremiumFeaturePanel.types.d.ts +9 -0
- package/lib/PremiumFeaturePanel/components/PaymentChargebeeModal/PaymentChargebeeModal.d.ts +9 -0
- package/lib/PremiumFeaturePanel/components/PaymentModal/PaymentModal.d.ts +7 -0
- package/lib/PremiumFeaturePanel/components/PremiumFeatureSelector/PremiumFeatureSelector.d.ts +3 -0
- package/lib/PremiumFeaturePanel/components/PremiumFeatureSelector/PremiumFeatureSelector.types.d.ts +48 -0
- package/lib/PremiumFeaturePanel/components/PremiumFeatureSelector/components/InfoModal/InfoModal.d.ts +5 -0
- package/lib/PremiumFeaturePanel/components/PremiumFeatureSelector/components/InfoModal/InfoModal.types.d.ts +15 -0
- package/lib/PremiumFeaturePanel/components/PremiumFeatureSelector/network.d.ts +19 -0
- package/lib/PremiumFeaturePanel/components/PremiumFeatureSelector/utils.d.ts +3 -0
- package/lib/RichTextArea/RichTextArea.types.d.ts +3 -0
- package/lib/utils/client.d.ts +16 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/server.d.ts +3 -1
- package/lib/utils/usePremiumFeatureCheckout.d.ts +7 -0
- package/lib/utils/usePremiumFeatureCheckoutCompletion.d.ts +8 -0
- package/package.json +3 -2
- package/style.css +1 -1
|
@@ -97,8 +97,21 @@ export declare const marketplaceValidationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
97
97
|
signedId?: string | undefined;
|
|
98
98
|
}>, "atleastone">;
|
|
99
99
|
marketplace_item_type: z.ZodString;
|
|
100
|
+
premium_feature: z.ZodObject<{
|
|
101
|
+
id: z.ZodString;
|
|
102
|
+
pill: z.ZodOptional<z.ZodString>;
|
|
103
|
+
value: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
id: string;
|
|
106
|
+
value?: string | undefined;
|
|
107
|
+
pill?: string | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
id: string;
|
|
110
|
+
value?: string | undefined;
|
|
111
|
+
pill?: string | undefined;
|
|
112
|
+
}>;
|
|
100
113
|
price: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
101
|
-
reach: z.ZodEnum<["profile", "hood", "extended", "public"]>;
|
|
114
|
+
reach: z.ZodEnum<["profile", "hood", "extended", "public", "group"]>;
|
|
102
115
|
subject: z.ZodString;
|
|
103
116
|
}, "strip", z.ZodTypeAny, {
|
|
104
117
|
content: {
|
|
@@ -131,8 +144,13 @@ export declare const marketplaceValidationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
131
144
|
signedId?: string | undefined;
|
|
132
145
|
}[]];
|
|
133
146
|
subject: string;
|
|
134
|
-
reach: "profile" | "public" | "hood" | "extended";
|
|
147
|
+
reach: "group" | "profile" | "public" | "hood" | "extended";
|
|
135
148
|
marketplace_item_type: string;
|
|
149
|
+
premium_feature: {
|
|
150
|
+
id: string;
|
|
151
|
+
value?: string | undefined;
|
|
152
|
+
pill?: string | undefined;
|
|
153
|
+
};
|
|
136
154
|
price?: string | null | undefined;
|
|
137
155
|
}, {
|
|
138
156
|
content: {
|
|
@@ -165,8 +183,13 @@ export declare const marketplaceValidationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
165
183
|
signedId?: string | undefined;
|
|
166
184
|
}[]];
|
|
167
185
|
subject: string;
|
|
168
|
-
reach: "profile" | "public" | "hood" | "extended";
|
|
186
|
+
reach: "group" | "profile" | "public" | "hood" | "extended";
|
|
169
187
|
marketplace_item_type: string;
|
|
188
|
+
premium_feature: {
|
|
189
|
+
id: string;
|
|
190
|
+
value?: string | undefined;
|
|
191
|
+
pill?: string | undefined;
|
|
192
|
+
};
|
|
170
193
|
price?: string | null | undefined;
|
|
171
194
|
}>, {
|
|
172
195
|
content: {
|
|
@@ -199,8 +222,13 @@ export declare const marketplaceValidationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
199
222
|
signedId?: string | undefined;
|
|
200
223
|
}[]];
|
|
201
224
|
subject: string;
|
|
202
|
-
reach: "profile" | "public" | "hood" | "extended";
|
|
225
|
+
reach: "group" | "profile" | "public" | "hood" | "extended";
|
|
203
226
|
marketplace_item_type: string;
|
|
227
|
+
premium_feature: {
|
|
228
|
+
id: string;
|
|
229
|
+
value?: string | undefined;
|
|
230
|
+
pill?: string | undefined;
|
|
231
|
+
};
|
|
204
232
|
price?: string | null | undefined;
|
|
205
233
|
}, {
|
|
206
234
|
content: {
|
|
@@ -233,7 +261,12 @@ export declare const marketplaceValidationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
233
261
|
signedId?: string | undefined;
|
|
234
262
|
}[]];
|
|
235
263
|
subject: string;
|
|
236
|
-
reach: "profile" | "public" | "hood" | "extended";
|
|
264
|
+
reach: "group" | "profile" | "public" | "hood" | "extended";
|
|
237
265
|
marketplace_item_type: string;
|
|
266
|
+
premium_feature: {
|
|
267
|
+
id: string;
|
|
268
|
+
value?: string | undefined;
|
|
269
|
+
pill?: string | undefined;
|
|
270
|
+
};
|
|
238
271
|
price?: string | null | undefined;
|
|
239
272
|
}>;
|
|
@@ -79,7 +79,7 @@ export declare const postValidationSchema: z.ZodObject<{
|
|
|
79
79
|
} | undefined;
|
|
80
80
|
}>;
|
|
81
81
|
content_type: z.ZodLiteral<"post">;
|
|
82
|
-
reach: z.ZodEnum<["profile", "hood", "extended", "public"]>;
|
|
82
|
+
reach: z.ZodEnum<["profile", "hood", "extended", "public", "group"]>;
|
|
83
83
|
subject: z.ZodString;
|
|
84
84
|
}, "strip", z.ZodTypeAny, {
|
|
85
85
|
content: {
|
|
@@ -100,7 +100,7 @@ export declare const postValidationSchema: z.ZodObject<{
|
|
|
100
100
|
};
|
|
101
101
|
content_type: "post";
|
|
102
102
|
subject: string;
|
|
103
|
-
reach: "profile" | "public" | "hood" | "extended";
|
|
103
|
+
reach: "group" | "profile" | "public" | "hood" | "extended";
|
|
104
104
|
}, {
|
|
105
105
|
content: {
|
|
106
106
|
body: string;
|
|
@@ -120,7 +120,7 @@ export declare const postValidationSchema: z.ZodObject<{
|
|
|
120
120
|
};
|
|
121
121
|
content_type: "post";
|
|
122
122
|
subject: string;
|
|
123
|
-
reach: "profile" | "public" | "hood" | "extended";
|
|
123
|
+
reach: "group" | "profile" | "public" | "hood" | "extended";
|
|
124
124
|
}>;
|
|
125
125
|
export declare const searchValidationSchema: z.ZodObject<{
|
|
126
126
|
content: z.ZodObject<{
|
|
@@ -202,7 +202,7 @@ export declare const searchValidationSchema: z.ZodObject<{
|
|
|
202
202
|
} | undefined;
|
|
203
203
|
}>;
|
|
204
204
|
content_type: z.ZodLiteral<"search">;
|
|
205
|
-
reach: z.ZodEnum<["profile", "hood", "extended", "public"]>;
|
|
205
|
+
reach: z.ZodEnum<["profile", "hood", "extended", "public", "group"]>;
|
|
206
206
|
subject: z.ZodString;
|
|
207
207
|
}, "strip", z.ZodTypeAny, {
|
|
208
208
|
content: {
|
|
@@ -223,7 +223,7 @@ export declare const searchValidationSchema: z.ZodObject<{
|
|
|
223
223
|
};
|
|
224
224
|
content_type: "search";
|
|
225
225
|
subject: string;
|
|
226
|
-
reach: "profile" | "public" | "hood" | "extended";
|
|
226
|
+
reach: "group" | "profile" | "public" | "hood" | "extended";
|
|
227
227
|
}, {
|
|
228
228
|
content: {
|
|
229
229
|
body: string;
|
|
@@ -243,7 +243,7 @@ export declare const searchValidationSchema: z.ZodObject<{
|
|
|
243
243
|
};
|
|
244
244
|
content_type: "search";
|
|
245
245
|
subject: string;
|
|
246
|
-
reach: "profile" | "public" | "hood" | "extended";
|
|
246
|
+
reach: "group" | "profile" | "public" | "hood" | "extended";
|
|
247
247
|
}>;
|
|
248
248
|
export declare const recommendationValidationSchema: z.ZodObject<{
|
|
249
249
|
content: z.ZodObject<{
|
|
@@ -325,7 +325,7 @@ export declare const recommendationValidationSchema: z.ZodObject<{
|
|
|
325
325
|
} | undefined;
|
|
326
326
|
}>;
|
|
327
327
|
content_type: z.ZodLiteral<"recommendation">;
|
|
328
|
-
reach: z.ZodEnum<["profile", "hood", "extended", "public"]>;
|
|
328
|
+
reach: z.ZodEnum<["profile", "hood", "extended", "public", "group"]>;
|
|
329
329
|
subject: z.ZodString;
|
|
330
330
|
}, "strip", z.ZodTypeAny, {
|
|
331
331
|
content: {
|
|
@@ -346,7 +346,7 @@ export declare const recommendationValidationSchema: z.ZodObject<{
|
|
|
346
346
|
};
|
|
347
347
|
content_type: "recommendation";
|
|
348
348
|
subject: string;
|
|
349
|
-
reach: "profile" | "public" | "hood" | "extended";
|
|
349
|
+
reach: "group" | "profile" | "public" | "hood" | "extended";
|
|
350
350
|
}, {
|
|
351
351
|
content: {
|
|
352
352
|
body: string;
|
|
@@ -366,5 +366,5 @@ export declare const recommendationValidationSchema: z.ZodObject<{
|
|
|
366
366
|
};
|
|
367
367
|
content_type: "recommendation";
|
|
368
368
|
subject: string;
|
|
369
|
-
reach: "profile" | "public" | "hood" | "extended";
|
|
369
|
+
reach: "group" | "profile" | "public" | "hood" | "extended";
|
|
370
370
|
}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MarketplaceBodyTypes } from './MarketplaceBody.types';
|
|
2
|
-
declare const MarketplaceBody: ({ feedItem, isAuthenticated, isMine, }: MarketplaceBodyTypes) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const MarketplaceBody: ({ chargebeeProviderConfig, disablePremiumFeature, feedItem, isAuthenticated, isMine, }: MarketplaceBodyTypes) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default MarketplaceBody;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { components } from '../../../../../../../api/src/lib/core/generated_types';
|
|
2
2
|
export interface MarketplaceBodyTypes {
|
|
3
|
+
chargebeeProviderConfig: {
|
|
4
|
+
site: string;
|
|
5
|
+
};
|
|
6
|
+
disablePremiumFeature?: boolean;
|
|
3
7
|
feedItem: components['schemas']['Core_V3_HoodMessage'];
|
|
4
8
|
isAuthenticated?: boolean;
|
|
5
9
|
isMine?: boolean;
|
|
@@ -14,8 +14,10 @@ import { MarketplaceDetailPageProps } from './MarketplaceDetailPage.types';
|
|
|
14
14
|
* @param {Object} props.feedItem - The marketplace item data from API
|
|
15
15
|
* @param {boolean} props.isBookmarked - Whether the item is bookmarked by current user
|
|
16
16
|
* @param {Array} props.relatedSections - Related posts sections to display
|
|
17
|
+
* @param {Object} props.config.chargebee - Chargebee-specific config
|
|
18
|
+
* @param {boolean} [props.disablePremiumFeature] - Optional flag to disable premium features
|
|
17
19
|
*
|
|
18
20
|
* @returns {Promise<JSX.Element>} The rendered marketplace detail page
|
|
19
21
|
*/
|
|
20
|
-
export declare function MarketplaceDetailPage({ ads, feedItem, isAuthenticated, relatedSections, renderAdSlot, }: MarketplaceDetailPageProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
22
|
+
export declare function MarketplaceDetailPage({ ads, config, disablePremiumFeature, feedItem, isAuthenticated, relatedSections, renderAdSlot, }: MarketplaceDetailPageProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
21
23
|
export default MarketplaceDetailPage;
|
package/lib/Feed/FeedItem/Marketplace/MarketplaceDetailPage/MarketplaceDetailPage.types.d.ts
CHANGED
|
@@ -12,6 +12,12 @@ export interface ProfileData {
|
|
|
12
12
|
}
|
|
13
13
|
export interface MarketplaceDetailPageProps {
|
|
14
14
|
ads?: AdSlot[];
|
|
15
|
+
config: {
|
|
16
|
+
chargebee: {
|
|
17
|
+
site: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
disablePremiumFeature?: boolean;
|
|
15
21
|
feedItem: components['schemas']['Core_V3_HoodMessage'];
|
|
16
22
|
isAuthenticated?: boolean;
|
|
17
23
|
relatedSections?: components['schemas']['Core_V3_RelatedSection'][];
|
|
@@ -5,6 +5,7 @@ type PostReplyProps = {
|
|
|
5
5
|
};
|
|
6
6
|
export declare const postReply: ({ postId, reply }: PostReplyProps) => Promise<{
|
|
7
7
|
id: number;
|
|
8
|
+
parent_hood_message_id: number;
|
|
8
9
|
body: string;
|
|
9
10
|
author_details?: import('../../../../../../../api/src/lib/core').components["schemas"]["Core_V3_AuthorDetails"] | null;
|
|
10
11
|
created_at: string;
|
|
@@ -9,6 +9,7 @@ type SlicedRepliesProps = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const slicedReplies: ({ expanded, limit, replies }: SlicedRepliesProps) => {
|
|
11
11
|
id: number;
|
|
12
|
+
parent_hood_message_id: number;
|
|
12
13
|
body: string;
|
|
13
14
|
author_details?: components["schemas"]["Core_V3_AuthorDetails"] | null;
|
|
14
15
|
created_at: string;
|
package/lib/Feed/utils.d.ts
CHANGED
|
@@ -4,11 +4,12 @@ export declare const isBookmarked: (id: number, list: number[]) => boolean;
|
|
|
4
4
|
export declare const getRelatedItemThumbnail: (item: HoodMessage) => string;
|
|
5
5
|
export declare const isPublic: (item: HoodMessage) => boolean;
|
|
6
6
|
export declare const getElapsedTime: (timestamp: string) => string | null;
|
|
7
|
-
export declare const getFormattedDate: (date: string | null | undefined) => {
|
|
7
|
+
export declare const getFormattedDate: (date: string | null | undefined, dateFormat?: "dd.MM.yyyy" | "dd.MM") => {
|
|
8
8
|
date: string;
|
|
9
9
|
time: string;
|
|
10
10
|
} | null;
|
|
11
11
|
export declare const getFeatureByIdentifier: (features: components["schemas"]["Core_V3_FeatureAddon_List"], identifier: string) => components["schemas"]["Core_V3_FeatureAddon"] | undefined;
|
|
12
|
+
export declare const hasActivePremiumFeature: (features: components["schemas"]["Core_V3_FeatureAddon_List"], identifiers?: string[]) => boolean;
|
|
12
13
|
export declare const getPrice: (item: HoodMessage) => string;
|
|
13
14
|
export declare const isReserved: (item: HoodMessage) => boolean;
|
|
14
15
|
export declare const isReservedV2: (value: number | null) => value is 2;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UseControllerProps } from 'react-hook-form';
|
|
2
|
+
import { NameAbbreviationProps } from './NameAbbreviation/NameAbbreviation.types';
|
|
3
|
+
export type FormNameAbbreviationProps = UseControllerProps & Partial<NameAbbreviationProps> & {
|
|
4
|
+
defaultChecked?: boolean;
|
|
5
|
+
postId?: number | string;
|
|
6
|
+
};
|
|
7
|
+
export declare const FormPremiumFeatureSelector: ({ defaultChecked, name, postId, rules, }: FormNameAbbreviationProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default FormPremiumFeatureSelector;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PasswordFieldProps } from './PasswordField.types';
|
|
2
|
-
declare const PasswordField: ({ colorScheme, error, errorText, id, label, name, onBlur, onChange, passwordHint, progressBar, size, value, }: PasswordFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const PasswordField: ({ colorScheme, error, errorText, id, label, name, onBlur, onChange, passwordHint, progressBar, score, size, value, }: PasswordFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default PasswordField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getProgressBarProgress: (
|
|
1
|
+
export declare const getProgressBarProgress: (score?: number | null) => number;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PremiumFeaturePanelProps } from './PremiumFeaturePanel.types';
|
|
2
|
+
declare const PremiumFeaturePanel: ({ chargebeeProviderConfig, featureAddons, isMine, postId, }: PremiumFeaturePanelProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
export default PremiumFeaturePanel;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { components } from '../../../../api/src/lib/core';
|
|
2
|
+
export interface PremiumFeaturePanelProps {
|
|
3
|
+
chargebeeProviderConfig: {
|
|
4
|
+
site: string;
|
|
5
|
+
};
|
|
6
|
+
featureAddons: components['schemas']['Core_V3_HoodMessage']['feature_addons'];
|
|
7
|
+
isMine: boolean;
|
|
8
|
+
postId: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface PaymentChargebeeModalProps {
|
|
2
|
+
isLoading: boolean;
|
|
3
|
+
onCheckout: () => void;
|
|
4
|
+
onDismiss: () => void;
|
|
5
|
+
open: boolean;
|
|
6
|
+
paymentInterrupted: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const PaymentChargebeeModal: ({ isLoading, onCheckout, onDismiss, open, paymentInterrupted, }: PaymentChargebeeModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default PaymentChargebeeModal;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PremiumFeatureSelectorProps } from './PremiumFeatureSelector.types';
|
|
2
|
+
declare const PremiumFeatureSelector: ({ defaultValue, hasPremiumFeature, includeNoneOption, onChange, onDismiss, postId, }: PremiumFeatureSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default PremiumFeatureSelector;
|
package/lib/PremiumFeaturePanel/components/PremiumFeatureSelector/PremiumFeatureSelector.types.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { InfoModal } from './components/InfoModal/InfoModal.types';
|
|
2
|
+
export type PremiumOptionSlug = 'boost-highlight' | 'boost' | 'highlight';
|
|
3
|
+
export interface PremiumFeatureSticker {
|
|
4
|
+
color: 'darkGrey' | 'lavender';
|
|
5
|
+
icon: 'star_filled' | 'sparkle_filled' | 'cross_circle' | 'arrow_up_filled';
|
|
6
|
+
iconSize: '16' | '24';
|
|
7
|
+
size: 'tiny' | 'small' | 'medium' | 'large';
|
|
8
|
+
}
|
|
9
|
+
export interface PremiumFeatureOption {
|
|
10
|
+
id: string;
|
|
11
|
+
info?: InfoModal | null;
|
|
12
|
+
isDefault?: boolean;
|
|
13
|
+
label?: string;
|
|
14
|
+
order: number;
|
|
15
|
+
pill: string;
|
|
16
|
+
selectedUntil: string;
|
|
17
|
+
slug: PremiumOptionSlug | 'none';
|
|
18
|
+
sticker: PremiumFeatureSticker;
|
|
19
|
+
text: string;
|
|
20
|
+
title: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}
|
|
23
|
+
export interface SelectedPremiumFeature {
|
|
24
|
+
id: string;
|
|
25
|
+
pill: string;
|
|
26
|
+
value: string;
|
|
27
|
+
}
|
|
28
|
+
export declare enum PremiumFeatureOptions {
|
|
29
|
+
MARKETPLACE_BOOST = "push",
|
|
30
|
+
MARKETPLACE_BOOST_HIGHLIGHT = "best_offer",
|
|
31
|
+
MARKETPLACE_HIGHLIGHT = "highlight"
|
|
32
|
+
}
|
|
33
|
+
export type IconKeys = 'bundle' | 'feature';
|
|
34
|
+
export type PremiumFeatureSelectorProps = {
|
|
35
|
+
defaultValue?: SelectedPremiumFeature;
|
|
36
|
+
hasPremiumFeature: boolean;
|
|
37
|
+
includeNoneOption?: boolean;
|
|
38
|
+
onChange?: (option: SelectedPremiumFeature) => void;
|
|
39
|
+
onDismiss?: () => void;
|
|
40
|
+
postId?: number | string;
|
|
41
|
+
} | {
|
|
42
|
+
defaultValue?: SelectedPremiumFeature;
|
|
43
|
+
hasPremiumFeature?: boolean;
|
|
44
|
+
includeNoneOption?: boolean;
|
|
45
|
+
onChange: (option: SelectedPremiumFeature) => void;
|
|
46
|
+
onDismiss?: () => void;
|
|
47
|
+
postId?: number | string;
|
|
48
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { InfoModalProps } from './InfoModal.types';
|
|
2
|
+
export declare const InfoModalHeader: ({ onDismiss }: {
|
|
3
|
+
onDismiss: () => void;
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const InfoModalContent: ({ defaultValue, modals, onDismiss, onSelect, }: InfoModalProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface InfoModal {
|
|
2
|
+
alt: string;
|
|
3
|
+
cta: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
text: string;
|
|
6
|
+
title: string;
|
|
7
|
+
url: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
export type InfoModalProps = {
|
|
11
|
+
defaultValue: string;
|
|
12
|
+
modals: InfoModal[];
|
|
13
|
+
onDismiss: () => void;
|
|
14
|
+
onSelect?: (id: string) => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const fetchPremiumFeatureProducts: (postId?: number | string) => Promise<{
|
|
2
|
+
id: string;
|
|
3
|
+
gid: string;
|
|
4
|
+
identifier: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
icon?: "feature" | "bundle";
|
|
8
|
+
price_cents: number;
|
|
9
|
+
tax_rate: number;
|
|
10
|
+
duration_days?: number | null;
|
|
11
|
+
purchasable_for: string;
|
|
12
|
+
apple_store_sku?: string | null;
|
|
13
|
+
google_play_sku?: string | null;
|
|
14
|
+
chargebee_sku?: string | null;
|
|
15
|
+
created_at: string;
|
|
16
|
+
updated_at: string;
|
|
17
|
+
available: boolean;
|
|
18
|
+
available_after?: string | null;
|
|
19
|
+
}[] | null | undefined>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { components } from '../../../../../../api/src/lib/core';
|
|
2
|
+
import { PremiumFeatureOption } from './PremiumFeatureSelector.types';
|
|
3
|
+
export declare const getFormattedPremiumFeatureOptions: (options: components["schemas"]["Core_V3_Product_List"] | undefined, includeNoneOption: boolean, postId?: number | string) => PremiumFeatureOption[];
|
package/lib/utils/client.d.ts
CHANGED
|
@@ -5,3 +5,19 @@ export declare const useIsBreakpointMatch: (tabletScreenBreakpoint?: number) =>
|
|
|
5
5
|
* Returns 0 if extraction fails or result is not a number.
|
|
6
6
|
*/
|
|
7
7
|
export declare const extractUserId: (gid: string | undefined | null) => number;
|
|
8
|
+
export declare const formatCurrency: (cents: number, locale?: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the URL string of an imported image.
|
|
11
|
+
*
|
|
12
|
+
* Next.js image imports can return an object with metadata (src, height, width, blurDataURL, etc.).
|
|
13
|
+
* In some environments (like Jest tests or Storybook), the import may resolve to a plain string.
|
|
14
|
+
* This function ensures we always get a usable string URL for <img> or <Image> components.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getImageSrc: (img: string | {
|
|
17
|
+
blurDataURL?: string;
|
|
18
|
+
blurHeight?: number;
|
|
19
|
+
blurWidth?: number;
|
|
20
|
+
height: number;
|
|
21
|
+
src: string;
|
|
22
|
+
width: number;
|
|
23
|
+
}) => string;
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/server.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare const getLang: <T>(lang: Record<string, T>, selectedLang?: string) => T;
|
|
2
|
-
|
|
2
|
+
type Replacements = string | Record<string, string>;
|
|
3
|
+
export declare const interpolate: (template: string, keyOrReplacements: Replacements, value?: string) => string;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to handle Premium Feature checkout with Chargebee.
|
|
3
|
+
*/
|
|
4
|
+
export declare const usePremiumFeatureCheckout: () => {
|
|
5
|
+
PremiumFeatureCheckoutModal: import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
startCheckout: (postId: string, productId: string) => Promise<void>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to handle completion of Premium Feature checkout after redirect.
|
|
3
|
+
* @param postId - ID of the post associated with the checkout
|
|
4
|
+
*/
|
|
5
|
+
export declare const usePremiumFeatureCheckoutCompletion: (postId: string) => {
|
|
6
|
+
PremiumFeatureCompletionModal: import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodhood-web/nebenan-base",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0-development.10",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"repository": "https://github.com/good-hood-gmbh/goodhood-web",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"react-dom": "^18.2.0",
|
|
21
21
|
"@hookform/resolvers": "^3.10.0",
|
|
22
22
|
"lodash": "^4.17.21",
|
|
23
|
-
"@tanstack/react-query": ">=4.36.1"
|
|
23
|
+
"@tanstack/react-query": ">=4.36.1",
|
|
24
|
+
"@zxcvbn-ts/core": "^3.0.4"
|
|
24
25
|
}
|
|
25
26
|
}
|