@messenger-box/property-ext-browser 0.0.1-alpha.187 → 0.0.1-alpha.192
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/CHANGELOG.md +11 -0
- package/lib/components/InboxMessage/MessageWidgets/MessageAlert.d.ts +8 -0
- package/lib/components/InboxMessage/MessageWidgets/MessageAlert.d.ts.map +1 -0
- package/lib/components/InboxMessage/MessageWidgets/MessageAlert.js +16 -0
- package/lib/components/InboxMessage/MessageWidgets/MessageAlert.js.map +1 -0
- package/lib/components/InboxMessage/MessageWidgets/MessageCard.d.ts +8 -0
- package/lib/components/InboxMessage/MessageWidgets/MessageCard.d.ts.map +1 -0
- package/lib/components/InboxMessage/MessageWidgets/MessageCard.js +44 -0
- package/lib/components/InboxMessage/MessageWidgets/MessageCard.js.map +1 -0
- package/lib/components/InboxMessage/MessageWidgets/index.d.ts +3 -0
- package/lib/components/InboxMessage/MessageWidgets/index.d.ts.map +1 -0
- package/lib/components/InboxMessage/index.d.ts +2 -0
- package/lib/components/InboxMessage/index.d.ts.map +1 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/interfaces/index.d.ts +2 -0
- package/lib/interfaces/index.d.ts.map +1 -0
- package/lib/interfaces/message-widgets.interface.d.ts +13 -0
- package/lib/interfaces/message-widgets.interface.d.ts.map +1 -0
- package/lib/module.d.ts +3 -0
- package/lib/module.d.ts.map +1 -0
- package/lib/module.js +12 -0
- package/lib/module.js.map +1 -0
- package/lib/slot-fill/index.d.ts +3 -0
- package/lib/slot-fill/index.d.ts.map +1 -0
- package/lib/slot-fill/message-alert-fill.d.ts +3 -0
- package/lib/slot-fill/message-alert-fill.d.ts.map +1 -0
- package/lib/slot-fill/message-alert-fill.js +8 -0
- package/lib/slot-fill/message-alert-fill.js.map +1 -0
- package/lib/slot-fill/message-card-fill.d.ts +3 -0
- package/lib/slot-fill/message-card-fill.d.ts.map +1 -0
- package/lib/slot-fill/message-card-fill.js +8 -0
- package/lib/slot-fill/message-card-fill.js.map +1 -0
- package/package.json +6 -4
- package/src/components/InboxMessage/MessageWidgets/MessageAlert.tsx +52 -0
- package/src/components/InboxMessage/MessageWidgets/MessageCard.tsx +140 -0
- package/src/components/InboxMessage/MessageWidgets/index.ts +2 -0
- package/src/components/InboxMessage/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/interfaces/index.ts +1 -0
- package/src/interfaces/message-widgets.interface.ts +14 -0
- package/src/module.ts +16 -0
- package/src/slot-fill/index.ts +2 -0
- package/src/slot-fill/message-alert-fill.tsx +20 -0
- package/src/slot-fill/message-card-fill.tsx +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.0.1-alpha.192](https://github.com/cdmbase/messenger-box/compare/v0.0.1-alpha.191...v0.0.1-alpha.192) (2022-07-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add proeprty ext module with fills based on property types ([9728317](https://github.com/cdmbase/messenger-box/commit/97283176059dca7e4bd78ad4de7bc26ae0492387))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [0.0.1-alpha.187](https://github.com/cdmbase/messenger-box/compare/v0.0.1-alpha.186...v0.0.1-alpha.187) (2022-07-05)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @messenger-box/property-ext-browser
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IPost } from '@messenger-box/core';
|
|
3
|
+
export interface IPropertyMessageWidgetProps {
|
|
4
|
+
message: IPost;
|
|
5
|
+
index: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const MessageAlert: (props: IPropertyMessageWidgetProps) => JSX.Element;
|
|
8
|
+
//# sourceMappingURL=MessageAlert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageAlert.d.ts","sourceRoot":"","sources":["../../../../src/components/InboxMessage/MessageWidgets/MessageAlert.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,MAAM,WAAW,2BAA2B;IACxC,OAAO,EAAE,KAAK,CAAA;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,UAAW,2BAA2B,gBAuC9D,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from'react';import*as Icons from'@chakra-ui/icons';import parse from'html-react-parser';import {useColorModeValue,Stack,Text,Link}from'@chakra-ui/react';const MessageAlert = (props) => {
|
|
2
|
+
const { message, index } = props;
|
|
3
|
+
const { attachment } = message.propsConfiguration.contents;
|
|
4
|
+
const Icon = Icons[attachment.icon];
|
|
5
|
+
const color = useColorModeValue('white', 'gray.800');
|
|
6
|
+
const bgColor = useColorModeValue('gray.800', 'white');
|
|
7
|
+
return (React.createElement(Stack, { key: `${index}`, mt: "4", mb: "10", bgColor: bgColor, padding: 3, margin: 2, opacity: 0.7, borderRadius: 20, direction: ['column', 'row'] },
|
|
8
|
+
React.createElement(Icon, { w: 6, h: 6, color: color }),
|
|
9
|
+
React.createElement(Text, { fontSize: "14px", mt: "5px", mb: "5px", whiteSpace: 'pre-line', color: color }, attachment.isTitleHtml ? parse(attachment.title) : attachment === null || attachment === void 0 ? void 0 : attachment.title),
|
|
10
|
+
attachment.callToAction && (React.createElement(Link, { color: color, mr: "2", style: {
|
|
11
|
+
textDecoration: 'underline'
|
|
12
|
+
}, href: attachment.callToAction.link, isExternal: true },
|
|
13
|
+
attachment.callToAction.title,
|
|
14
|
+
" ",
|
|
15
|
+
React.createElement(Icons.ExternalLinkIcon, { mx: "2px" })))));
|
|
16
|
+
};export{MessageAlert};//# sourceMappingURL=MessageAlert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageAlert.js","sources":["../../../../src/components/InboxMessage/MessageWidgets/MessageAlert.tsx"],"sourcesContent":[null],"names":[],"mappings":"sKAYa,MAAA,YAAY,GAAG,CAAC,KAAkC,KAAI;AAC/D,IAAA,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,QAA4D,CAAC;IAC/G,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACvD,QACI,oBAAC,KAAK,EAAA,EACF,GAAG,EAAE,CAAA,EAAG,KAAK,CAAE,CAAA,EACf,EAAE,EAAC,GAAG,EACN,EAAE,EAAC,IAAI,EACP,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,CAAC,EACV,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,GAAG,EACZ,YAAY,EAAE,EAAE,EAChB,SAAS,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAA;AAE5B,QAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAG,CAAA;QACjC,KAAC,CAAA,aAAA,CAAA,IAAI,IAAC,QAAQ,EAAC,MAAM,EAAC,EAAE,EAAC,KAAK,EAAC,EAAE,EAAC,KAAK,EAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAA,EACvE,UAAU,CAAC,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,UAAU,KAAV,IAAA,IAAA,UAAU,uBAAV,UAAU,CAAE,KAAK,CAClE;AAEH,QAAA,UAAU,CAAC,YAAY,KACnB,KAAA,CAAA,aAAA,CAAC,IAAI,EACD,EAAA,KAAK,EAAE,KAAK,EACZ,EAAE,EAAC,GAAG,EACN,KAAK,EAAE;AACH,gBAAA,cAAc,EAAE,WAAW;aAC9B,EACD,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,EAClC,UAAU,EAAA,IAAA,EAAA;YAET,UAAU,CAAC,YAAY,CAAC,KAAK;;AAAE,YAAA,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAgB,EAAA,EAAC,EAAE,EAAC,KAAK,EAAA,CAAE,CAC/D,CACV,CAED,EACX;AACL"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IPost } from '@messenger-box/core';
|
|
3
|
+
export interface IPropertyCardProps {
|
|
4
|
+
message: IPost;
|
|
5
|
+
index: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const MessageCard: (props: IPropertyCardProps) => JSX.Element;
|
|
8
|
+
//# sourceMappingURL=MessageCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageCard.d.ts","sourceRoot":"","sources":["../../../../src/components/InboxMessage/MessageWidgets/MessageCard.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,KAAK,CAAA;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,WAAW,UAAW,kBAAkB,gBA8HpD,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from'react';import {startCase}from'lodash';import parse from'html-react-parser';import {useColorModeValue,Box,Image,Heading,Badge,Spacer,Text,Link}from'@chakra-ui/react';import {StarIcon,ExternalLinkIcon}from'@chakra-ui/icons';const MessageCard = (props) => {
|
|
2
|
+
var _a;
|
|
3
|
+
const { message, index } = props;
|
|
4
|
+
const color = useColorModeValue('gray.800', 'white');
|
|
5
|
+
const { attachment, } = (_a = message.propsConfiguration) === null || _a === void 0 ? void 0 : _a.contents;
|
|
6
|
+
const { property } = attachment;
|
|
7
|
+
return (React.createElement(Box, { _hover: {
|
|
8
|
+
cursor: 'pointer'
|
|
9
|
+
}, margin: 5, maxW: "xs", borderWidth: "1px", borderRadius: "lg", overflow: "hidden", key: `${index}` },
|
|
10
|
+
React.createElement(Image, { width: "100%", src: attachment.image, alt: attachment.title }),
|
|
11
|
+
React.createElement(Box, { marginTop: 4, margin: 2, m: "3" },
|
|
12
|
+
React.createElement(Box, { mt: "3", lineHeight: "tight", noOfLines: 1 },
|
|
13
|
+
React.createElement(Heading, { color: color, fontSize: "14px", fontWeight: "semibold", as: "h3" }, attachment.isTitleHtml ? parse(attachment.title) : attachment.title)),
|
|
14
|
+
property && (React.createElement(Box, { mt: "3", display: "flex" },
|
|
15
|
+
(property === null || property === void 0 ? void 0 : property.type) && (React.createElement(Box, null,
|
|
16
|
+
React.createElement(Badge, { borderRadius: "full", px: "2", colorScheme: "teal" }, startCase(property.type)))),
|
|
17
|
+
React.createElement(Spacer, null),
|
|
18
|
+
(property === null || property === void 0 ? void 0 : property.maxPeople) && (React.createElement(Box, { color: "gray.500", fontWeight: "semibold", letterSpacing: "wide", fontSize: "xs", textTransform: "uppercase", ml: "2" },
|
|
19
|
+
property.maxPeople,
|
|
20
|
+
" Max People")))),
|
|
21
|
+
React.createElement(Box, { display: "flex", mt: "4", mb: "3", alignItems: "center" }, attachment.isDescriptionHtml ? parse(attachment.description) : (React.createElement(Text, null, attachment.description))),
|
|
22
|
+
property && (React.createElement(Box, { display: "flex", mb: "4" },
|
|
23
|
+
(property === null || property === void 0 ? void 0 : property.price) && (React.createElement(Box, { mt: 2 },
|
|
24
|
+
property.price,
|
|
25
|
+
React.createElement(Box, { as: "span", color: "gray.600", fontSize: "sm" },
|
|
26
|
+
"\u00A0/ ",
|
|
27
|
+
startCase(property.priceType)))),
|
|
28
|
+
React.createElement(Spacer, null),
|
|
29
|
+
React.createElement(Box, { mt: "2", alignItems: "center" },
|
|
30
|
+
(property === null || property === void 0 ? void 0 : property.totalReview) && (React.createElement(Box, { as: "span", ml: "2", color: "gray.600", fontSize: "sm", mr: "2" },
|
|
31
|
+
property.totalReview,
|
|
32
|
+
" reviews")),
|
|
33
|
+
(property === null || property === void 0 ? void 0 : property.totalStar) && Array(5)
|
|
34
|
+
.fill('')
|
|
35
|
+
.map((_, i) => (React.createElement(StarIcon, { key: i, color: i < property.totalStar ? 'teal.500' : 'gray.300' })))))),
|
|
36
|
+
attachment.callToAction && (React.createElement(Link, { href: attachment.callToAction.link, style: {
|
|
37
|
+
cursor: 'pointer'
|
|
38
|
+
}, _hover: {
|
|
39
|
+
cursor: 'pointer'
|
|
40
|
+
}, isExternal: true },
|
|
41
|
+
attachment.callToAction.title,
|
|
42
|
+
" ",
|
|
43
|
+
React.createElement(ExternalLinkIcon, { mx: "2px" }))))));
|
|
44
|
+
};export{MessageCard};//# sourceMappingURL=MessageCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageCard.js","sources":["../../../../src/components/InboxMessage/MessageWidgets/MessageCard.tsx"],"sourcesContent":[null],"names":[],"mappings":"gPAaa,MAAA,WAAW,GAAG,CAAC,KAAyB,KAAI;;AACrD,IAAA,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,KAAK,GAAG,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACrD,MAAM,EACF,UAAU,GACb,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,kBAAkB,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAA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AC,YAAY,CAAC,IAAI,EAClC,KAAK,EAAE;AACH,oBAAA,MAAM,EAAE,SAAS;AACpB,iBAAA,EACD,MAAM,EAAE;AACJ,oBAAA,MAAM,EAAE,SAAS;AACpB,iBAAA,EACD,UAAU,EAAA,IAAA,EAAA;gBAET,UAAU,CAAC,YAAY,CAAC,KAAK;;gBAAE,KAAC,CAAA,aAAA,CAAA,gBAAgB,EAAC,EAAA,EAAE,EAAC,KAAK,EAAE,CAAA,CACzD,CACV,CAEH,CACJ,EACT;AACL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/InboxMessage/MessageWidgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/InboxMessage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,UAAU,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{feature as default}from'./module.js';//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CardMessageAttachmentsInterface as BaseCardMessageAttachmentsInterface } from '@messenger-box/chakra-ui-inbox';
|
|
2
|
+
export { AlertMessageAttachmentsInterface } from '@messenger-box/chakra-ui-inbox';
|
|
3
|
+
export interface CardMessageAttachmentsInterface extends BaseCardMessageAttachmentsInterface {
|
|
4
|
+
property: {
|
|
5
|
+
price: number;
|
|
6
|
+
priceType: string;
|
|
7
|
+
type: string;
|
|
8
|
+
totalStar: number;
|
|
9
|
+
maxPeople: number;
|
|
10
|
+
totalReview: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=message-widgets.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-widgets.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/message-widgets.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,IAAI,mCAAmC,EAAE,MAAM,gCAAgC,CAAC;AAExH,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAElF,MAAM,WAAW,+BAAgC,SAAQ,mCAAmC;IACxF,QAAQ,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;KACvB,CAAC;CACL"}
|
package/lib/module.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAIrD,eAAO,MAAM,OAAO,SAWlB,CAAC"}
|
package/lib/module.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {Feature}from'@common-stack/client-react';import {IPostTypeEnum}from'@messenger-box/property-ext-core';import {MessageAlertFill}from'./slot-fill/message-alert-fill.js';import {MessageCardFill}from'./slot-fill/message-card-fill.js';const feature = new Feature({
|
|
2
|
+
componentFillPlugins: [
|
|
3
|
+
{
|
|
4
|
+
name: IPostTypeEnum.ALERT.toLowerCase(),
|
|
5
|
+
render: MessageAlertFill,
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: IPostTypeEnum.CARD.toLowerCase(),
|
|
9
|
+
render: MessageCardFill,
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
});export{feature};//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../src/module.ts"],"sourcesContent":[null],"names":[],"mappings":"8OAIa,MAAA,OAAO,GAAG,IAAI,OAAO,CAAC;AAC/B,IAAA,oBAAoB,EAAE;AAClB,QAAA;AACI,YAAA,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,EAAE;AACvC,YAAA,MAAM,EAAE,gBAAgB;AAC3B,SAAA;AACD,QAAA;AACI,YAAA,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE;AACtC,YAAA,MAAM,EAAE,eAAe;AAC1B,SAAA;AACJ,KAAA;AACJ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slot-fill/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-alert-fill.d.ts","sourceRoot":"","sources":["../../src/slot-fill/message-alert-fill.tsx"],"names":[],"mappings":";AAMA,eAAO,MAAM,gBAAgB,mBAa5B,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from'react';import {Fill}from'@common-stack/components-pro';import {IPostTypeEnum}from'@messenger-box/property-ext-core';import'lodash';import'html-react-parser';import'@chakra-ui/react';import'@chakra-ui/icons';import {MessageAlert}from'../components/InboxMessage/MessageWidgets/MessageAlert.js';const MessageAlertFill = () => {
|
|
2
|
+
return (React.createElement(Fill, { name: IPostTypeEnum.ALERT.toLowerCase() }, (props) => {
|
|
3
|
+
if (props.active) {
|
|
4
|
+
return (React.createElement(MessageAlert, Object.assign({}, props)));
|
|
5
|
+
}
|
|
6
|
+
return null;
|
|
7
|
+
}));
|
|
8
|
+
};export{MessageAlertFill};//# sourceMappingURL=message-alert-fill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-alert-fill.js","sources":["../../src/slot-fill/message-alert-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"sTAMO,MAAM,gBAAgB,GAAG,MAAK;AACjC,IAAA,QACI,KAAC,CAAA,aAAA,CAAA,IAAI,EAAC,EAAA,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,EAAE,EAAA,EAErC,CAAC,KAAwD,KAAI;QACzD,IAAI,KAAK,CAAC,MAAM,EAAE;AACd,YAAA,QAAQ,KAAC,CAAA,aAAA,CAAA,YAAY,oBAAK,KAAK,CAAA,CAAG,EAAE;AACvC,SAAA;AACD,QAAA,OAAO,IAAI,CAAC;KACf,CAEF,EACV;AACL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-card-fill.d.ts","sourceRoot":"","sources":["../../src/slot-fill/message-card-fill.tsx"],"names":[],"mappings":";AAMA,eAAO,MAAM,eAAe,mBAa3B,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from'react';import {Fill}from'@common-stack/components-pro';import {MessageCard}from'../components/InboxMessage/MessageWidgets/MessageCard.js';import'@chakra-ui/icons';import'html-react-parser';import'@chakra-ui/react';import {IPostTypeEnum}from'@messenger-box/property-ext-core';const MessageCardFill = () => {
|
|
2
|
+
return (React.createElement(Fill, { name: IPostTypeEnum.CARD.toLowerCase() }, (props) => {
|
|
3
|
+
if (props.active) {
|
|
4
|
+
return (React.createElement(MessageCard, Object.assign({}, props)));
|
|
5
|
+
}
|
|
6
|
+
return null;
|
|
7
|
+
}));
|
|
8
|
+
};export{MessageCardFill};//# sourceMappingURL=message-card-fill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-card-fill.js","sources":["../../src/slot-fill/message-card-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"qSAMO,MAAM,eAAe,GAAG,MAAK;AAChC,IAAA,QACI,KAAC,CAAA,aAAA,CAAA,IAAI,EAAC,EAAA,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,EAAA,EAEpC,CAAC,KAA+C,KAAI;QAChD,IAAI,KAAK,CAAC,MAAM,EAAE;AACd,YAAA,QAAQ,KAAC,CAAA,aAAA,CAAA,WAAW,oBAAK,KAAK,CAAA,CAAG,EAAE;AACtC,SAAA;AACD,QAAA,OAAO,IAAI,CAAC;KACf,CAEF,EACV;AACL"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@messenger-box/property-ext-browser",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.192",
|
|
4
4
|
"description": "Extention to Messenger to support property on browser",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -41,11 +41,13 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@emotion/react": "^11",
|
|
43
43
|
"@emotion/styled": "^11",
|
|
44
|
-
"@messenger-box/
|
|
45
|
-
"@messenger-box/
|
|
44
|
+
"@messenger-box/chakra-ui-inbox": "0.0.1-alpha.192",
|
|
45
|
+
"@messenger-box/core": "0.0.1-alpha.192",
|
|
46
|
+
"@messenger-box/property-ext-core": "0.0.1-alpha.192",
|
|
46
47
|
"date-fns": "^2.28.0",
|
|
47
48
|
"date-fns-tz": "^1.3.3",
|
|
48
49
|
"emoji-mart": "^3.0.1",
|
|
50
|
+
"html-react-parser": "^3.0.1",
|
|
49
51
|
"javascript-time-ago": "^2.3.13",
|
|
50
52
|
"react-icons": "~4.3.1"
|
|
51
53
|
},
|
|
@@ -74,5 +76,5 @@
|
|
|
74
76
|
"typescript": {
|
|
75
77
|
"definition": "lib/index.d.ts"
|
|
76
78
|
},
|
|
77
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "15646216bcda0a4fbe9b33f72ca1a50ce9a6da15"
|
|
78
80
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as Icons from '@chakra-ui/icons';
|
|
3
|
+
import parse from 'html-react-parser';
|
|
4
|
+
import { Link, Stack, Text, useColorModeValue } from '@chakra-ui/react';
|
|
5
|
+
import { IPost } from '@messenger-box/core';
|
|
6
|
+
import { AlertMessageAttachmentsInterface } from '../../../interfaces';
|
|
7
|
+
|
|
8
|
+
export interface IPropertyMessageWidgetProps {
|
|
9
|
+
message: IPost
|
|
10
|
+
index: number,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const MessageAlert = (props: IPropertyMessageWidgetProps) => {
|
|
14
|
+
const { message, index } = props;
|
|
15
|
+
const { attachment } = message.propsConfiguration.contents as { attachment: AlertMessageAttachmentsInterface };
|
|
16
|
+
const Icon = Icons[attachment.icon];
|
|
17
|
+
const color = useColorModeValue('white', 'gray.800');
|
|
18
|
+
const bgColor = useColorModeValue('gray.800', 'white');
|
|
19
|
+
return (
|
|
20
|
+
<Stack
|
|
21
|
+
key={`${index}`}
|
|
22
|
+
mt="4"
|
|
23
|
+
mb="10"
|
|
24
|
+
bgColor={bgColor}
|
|
25
|
+
padding={3}
|
|
26
|
+
margin={2}
|
|
27
|
+
opacity={0.7}
|
|
28
|
+
borderRadius={20}
|
|
29
|
+
direction={['column', 'row']}
|
|
30
|
+
>
|
|
31
|
+
<Icon w={6} h={6} color={color}/>
|
|
32
|
+
<Text fontSize="14px" mt="5px" mb="5px" whiteSpace={'pre-line'} color={color}>
|
|
33
|
+
{attachment.isTitleHtml ? parse(attachment.title) : attachment?.title}
|
|
34
|
+
</Text>
|
|
35
|
+
{
|
|
36
|
+
attachment.callToAction && (
|
|
37
|
+
<Link
|
|
38
|
+
color={color}
|
|
39
|
+
mr="2"
|
|
40
|
+
style={{
|
|
41
|
+
textDecoration: 'underline'
|
|
42
|
+
}}
|
|
43
|
+
href={attachment.callToAction.link}
|
|
44
|
+
isExternal
|
|
45
|
+
>
|
|
46
|
+
{attachment.callToAction.title} <Icons.ExternalLinkIcon mx="2px"/>
|
|
47
|
+
</Link>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
</Stack>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { startCase } from 'lodash';
|
|
3
|
+
import parse from 'html-react-parser';
|
|
4
|
+
import { Badge, Box, Heading, Image, Link, Spacer, Text, useColorModeValue } from '@chakra-ui/react';
|
|
5
|
+
import { ExternalLinkIcon, StarIcon } from '@chakra-ui/icons'
|
|
6
|
+
import { IPost } from '@messenger-box/core';
|
|
7
|
+
import { CardMessageAttachmentsInterface } from '../../../interfaces';
|
|
8
|
+
|
|
9
|
+
export interface IPropertyCardProps {
|
|
10
|
+
message: IPost
|
|
11
|
+
index: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const MessageCard = (props: IPropertyCardProps) => {
|
|
15
|
+
const { message, index } = props;
|
|
16
|
+
const color = useColorModeValue('gray.800', 'white');
|
|
17
|
+
const {
|
|
18
|
+
attachment,
|
|
19
|
+
} = message.propsConfiguration?.contents as { attachment: CardMessageAttachmentsInterface, refId: string };
|
|
20
|
+
const { property } = attachment;
|
|
21
|
+
return (
|
|
22
|
+
<Box
|
|
23
|
+
_hover={{
|
|
24
|
+
cursor: 'pointer'
|
|
25
|
+
}}
|
|
26
|
+
margin={5}
|
|
27
|
+
maxW="xs"
|
|
28
|
+
borderWidth="1px"
|
|
29
|
+
borderRadius="lg"
|
|
30
|
+
overflow="hidden"
|
|
31
|
+
key={`${index}`}
|
|
32
|
+
>
|
|
33
|
+
<Image
|
|
34
|
+
width="100%"
|
|
35
|
+
src={attachment.image}
|
|
36
|
+
alt={attachment.title}
|
|
37
|
+
/>
|
|
38
|
+
<Box marginTop={4} margin={2} m="3">
|
|
39
|
+
<Box
|
|
40
|
+
mt="3"
|
|
41
|
+
lineHeight="tight"
|
|
42
|
+
noOfLines={1}
|
|
43
|
+
>
|
|
44
|
+
<Heading
|
|
45
|
+
color={color}
|
|
46
|
+
fontSize="14px"
|
|
47
|
+
fontWeight="semibold"
|
|
48
|
+
as="h3"
|
|
49
|
+
>
|
|
50
|
+
{attachment.isTitleHtml ? parse(attachment.title) : attachment.title}
|
|
51
|
+
</Heading>
|
|
52
|
+
</Box>
|
|
53
|
+
{
|
|
54
|
+
property && (
|
|
55
|
+
<Box mt="3" display="flex">
|
|
56
|
+
{
|
|
57
|
+
property?.type && (
|
|
58
|
+
<Box>
|
|
59
|
+
<Badge borderRadius="full" px="2" colorScheme="teal">
|
|
60
|
+
{startCase(property.type)}
|
|
61
|
+
</Badge>
|
|
62
|
+
</Box>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
<Spacer/>
|
|
66
|
+
{
|
|
67
|
+
property?.maxPeople && (
|
|
68
|
+
<Box
|
|
69
|
+
color="gray.500"
|
|
70
|
+
fontWeight="semibold"
|
|
71
|
+
letterSpacing="wide"
|
|
72
|
+
fontSize="xs"
|
|
73
|
+
textTransform="uppercase"
|
|
74
|
+
ml="2"
|
|
75
|
+
>
|
|
76
|
+
{property.maxPeople} Max People
|
|
77
|
+
</Box>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
</Box>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
<Box display="flex" mt="4" mb="3" alignItems="center">
|
|
84
|
+
{attachment.isDescriptionHtml ? parse(attachment.description) : (
|
|
85
|
+
<Text>{attachment.description}</Text>)}
|
|
86
|
+
</Box>
|
|
87
|
+
{
|
|
88
|
+
property && (
|
|
89
|
+
<Box display="flex" mb="4">
|
|
90
|
+
{
|
|
91
|
+
property?.price && (
|
|
92
|
+
<Box mt={2}>
|
|
93
|
+
{property.price}
|
|
94
|
+
<Box as="span" color="gray.600" fontSize="sm">
|
|
95
|
+
/ {startCase(property.priceType)}
|
|
96
|
+
</Box>
|
|
97
|
+
</Box>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
<Spacer/>
|
|
101
|
+
<Box mt="2" alignItems="center">
|
|
102
|
+
{
|
|
103
|
+
property?.totalReview && (
|
|
104
|
+
<Box as="span" ml="2" color="gray.600" fontSize="sm" mr="2">
|
|
105
|
+
{property.totalReview} reviews
|
|
106
|
+
</Box>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
{property?.totalStar && Array(5)
|
|
110
|
+
.fill('')
|
|
111
|
+
.map((_, i) => (
|
|
112
|
+
<StarIcon
|
|
113
|
+
key={i}
|
|
114
|
+
color={i < property.totalStar ? 'teal.500' : 'gray.300'}
|
|
115
|
+
/>
|
|
116
|
+
))}
|
|
117
|
+
</Box>
|
|
118
|
+
</Box>
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
{
|
|
122
|
+
attachment.callToAction && (
|
|
123
|
+
<Link
|
|
124
|
+
href={attachment.callToAction.link}
|
|
125
|
+
style={{
|
|
126
|
+
cursor: 'pointer'
|
|
127
|
+
}}
|
|
128
|
+
_hover={{
|
|
129
|
+
cursor: 'pointer'
|
|
130
|
+
}}
|
|
131
|
+
isExternal
|
|
132
|
+
>
|
|
133
|
+
{attachment.callToAction.title} <ExternalLinkIcon mx="2px"/>
|
|
134
|
+
</Link>
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
</Box>
|
|
138
|
+
</Box>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MessageAlert, MessageCard } from './MessageWidgets';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MessageCard, MessageAlert } from './InboxMessage';
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { feature as default } from './module';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CardMessageAttachmentsInterface, AlertMessageAttachmentsInterface } from './message-widgets.interface';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CardMessageAttachmentsInterface as BaseCardMessageAttachmentsInterface } from '@messenger-box/chakra-ui-inbox';
|
|
2
|
+
|
|
3
|
+
export { AlertMessageAttachmentsInterface } from '@messenger-box/chakra-ui-inbox';
|
|
4
|
+
|
|
5
|
+
export interface CardMessageAttachmentsInterface extends BaseCardMessageAttachmentsInterface {
|
|
6
|
+
property: {
|
|
7
|
+
price: number;
|
|
8
|
+
priceType: string;
|
|
9
|
+
type: string;
|
|
10
|
+
totalStar: number;
|
|
11
|
+
maxPeople: number;
|
|
12
|
+
totalReview: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
package/src/module.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Feature } from '@common-stack/client-react';
|
|
2
|
+
import { IPostTypeEnum } from '@messenger-box/property-ext-core';
|
|
3
|
+
import { MessageAlertFill, MessageCardFill } from './slot-fill';
|
|
4
|
+
|
|
5
|
+
export const feature = new Feature({
|
|
6
|
+
componentFillPlugins: [
|
|
7
|
+
{
|
|
8
|
+
name: IPostTypeEnum.ALERT.toLowerCase(),
|
|
9
|
+
render: MessageAlertFill,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: IPostTypeEnum.CARD.toLowerCase(),
|
|
13
|
+
render: MessageCardFill,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Fill } from '@common-stack/components-pro';
|
|
3
|
+
import { IPostTypeEnum } from '@messenger-box/property-ext-core';
|
|
4
|
+
import { MessageAlert } from '../components';
|
|
5
|
+
import { IPropertyMessageWidgetProps } from '../components/InboxMessage/MessageWidgets/MessageAlert';
|
|
6
|
+
|
|
7
|
+
export const MessageAlertFill = () => {
|
|
8
|
+
return (
|
|
9
|
+
<Fill name={IPostTypeEnum.ALERT.toLowerCase()}>
|
|
10
|
+
{
|
|
11
|
+
(props: IPropertyMessageWidgetProps & { active: boolean }) => {
|
|
12
|
+
if (props.active) {
|
|
13
|
+
return (<MessageAlert {...props}/>);
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
</Fill>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Fill } from '@common-stack/components-pro';
|
|
3
|
+
import { MessageCard } from '../components';
|
|
4
|
+
import { IPropertyCardProps } from '../components/InboxMessage/MessageWidgets/MessageCard';
|
|
5
|
+
import { IPostTypeEnum } from '@messenger-box/property-ext-core';
|
|
6
|
+
|
|
7
|
+
export const MessageCardFill = () => {
|
|
8
|
+
return (
|
|
9
|
+
<Fill name={IPostTypeEnum.CARD.toLowerCase()}>
|
|
10
|
+
{
|
|
11
|
+
(props: IPropertyCardProps & { active: boolean }) => {
|
|
12
|
+
if (props.active) {
|
|
13
|
+
return (<MessageCard {...props}/>);
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
</Fill>
|
|
19
|
+
)
|
|
20
|
+
}
|