@builder6/rooms 0.10.8 → 0.11.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/emails/UnreadMention.d.ts +9 -0
- package/dist/emails/UnreadMention.js +54 -0
- package/dist/emails/UnreadMention.js.map +1 -0
- package/dist/emails/UnreadReplies.d.ts +9 -0
- package/dist/emails/UnreadReplies.js +68 -0
- package/dist/emails/UnreadReplies.js.map +1 -0
- package/dist/emails/_components/comment.d.ts +1 -0
- package/dist/emails/_components/comment.js +32 -0
- package/dist/emails/_components/comment.js.map +1 -0
- package/dist/emails/_components/header.d.ts +2 -0
- package/dist/emails/_components/header.js +15 -0
- package/dist/emails/_components/header.js.map +1 -0
- package/dist/emails/_components/headline.d.ts +5 -0
- package/dist/emails/_components/headline.js +17 -0
- package/dist/emails/_components/headline.js.map +1 -0
- package/dist/emails/_components/layout.d.ts +5 -0
- package/dist/emails/_components/layout.js +24 -0
- package/dist/emails/_components/layout.js.map +1 -0
- package/dist/emails/_lib/types.d.ts +9 -0
- package/dist/emails/_lib/types.js +3 -0
- package/dist/emails/_lib/types.js.map +1 -0
- package/dist/emails/_styles/colors.d.ts +2 -0
- package/dist/emails/_styles/colors.js +7 -0
- package/dist/emails/_styles/colors.js.map +1 -0
- package/dist/emails/_utils/cn.d.ts +2 -0
- package/dist/emails/_utils/cn.js +10 -0
- package/dist/emails/_utils/cn.js.map +1 -0
- package/dist/emails/_utils/comments.d.ts +7 -0
- package/dist/emails/_utils/comments.js +29 -0
- package/dist/emails/_utils/comments.js.map +1 -0
- package/dist/emails/_utils/getProps.d.ts +1 -0
- package/dist/emails/_utils/getProps.js +11 -0
- package/dist/emails/_utils/getProps.js.map +1 -0
- package/dist/rooms/app.controller.d.ts +3 -1
- package/dist/rooms/app.controller.js +61 -46
- package/dist/rooms/app.controller.js.map +1 -1
- package/dist/rooms/emailNotification.service.d.ts +17 -0
- package/dist/rooms/emailNotification.service.js +113 -0
- package/dist/rooms/emailNotification.service.js.map +1 -0
- package/dist/rooms/emails/comment-body.d.ts +44 -0
- package/dist/rooms/emails/comment-body.js +138 -0
- package/dist/rooms/emails/comment-body.js.map +1 -0
- package/dist/rooms/emails/comment-with-body.d.ts +6 -0
- package/dist/rooms/emails/comment-with-body.js +17 -0
- package/dist/rooms/emails/comment-with-body.js.map +1 -0
- package/dist/rooms/emails/index.d.ts +4 -0
- package/dist/rooms/emails/index.js +7 -0
- package/dist/rooms/emails/index.js.map +1 -0
- package/dist/rooms/emails/lib/batch-users-resolver.d.ts +9 -0
- package/dist/rooms/emails/lib/batch-users-resolver.js +67 -0
- package/dist/rooms/emails/lib/batch-users-resolver.js.map +1 -0
- package/dist/rooms/emails/lib/css-properties.d.ts +3 -0
- package/dist/rooms/emails/lib/css-properties.js +96 -0
- package/dist/rooms/emails/lib/css-properties.js.map +1 -0
- package/dist/rooms/emails/lib/warning.d.ts +1 -0
- package/dist/rooms/emails/lib/warning.js +20 -0
- package/dist/rooms/emails/lib/warning.js.map +1 -0
- package/dist/rooms/emails/thread-notification.d.ts +90 -0
- package/dist/rooms/emails/thread-notification.js +297 -0
- package/dist/rooms/emails/thread-notification.js.map +1 -0
- package/dist/rooms/globals/augmentation.d.ts +0 -5
- package/dist/rooms/lib/utils.js +21 -10
- package/dist/rooms/lib/utils.js.map +1 -1
- package/dist/rooms/liveblocks.service.d.ts +16 -0
- package/dist/rooms/liveblocks.service.js +54 -0
- package/dist/rooms/liveblocks.service.js.map +1 -0
- package/dist/rooms/notifications.service.d.ts +4 -0
- package/dist/rooms/notifications.service.js +107 -80
- package/dist/rooms/notifications.service.js.map +1 -1
- package/dist/rooms/rooms.controller.d.ts +5 -3
- package/dist/rooms/rooms.controller.js +321 -243
- package/dist/rooms/rooms.controller.js.map +1 -1
- package/dist/rooms/rooms.gateway.js +132 -109
- package/dist/rooms/rooms.gateway.js.map +1 -1
- package/dist/rooms/rooms.guard.js +31 -19
- package/dist/rooms/rooms.guard.js.map +1 -1
- package/dist/rooms/rooms.module.js +10 -1
- package/dist/rooms/rooms.module.js.map +1 -1
- package/dist/rooms/rooms.moleculer.js +85 -66
- package/dist/rooms/rooms.moleculer.js.map +1 -1
- package/dist/rooms/rooms.service.d.ts +17 -4
- package/dist/rooms/rooms.service.js +408 -340
- package/dist/rooms/rooms.service.js.map +1 -1
- package/package.json +18 -7
- package/src/emails/UnreadMention.tsx +76 -0
- package/src/emails/UnreadReplies.tsx +106 -0
- package/src/emails/_components/comment.tsx +70 -0
- package/src/emails/_components/header.tsx +27 -0
- package/src/emails/_components/headline.tsx +20 -0
- package/src/emails/_components/layout.tsx +45 -0
- package/src/emails/_lib/types.ts +10 -0
- package/src/emails/_styles/colors.ts +7 -0
- package/src/emails/_utils/cn.ts +6 -0
- package/src/emails/_utils/comments.ts +61 -0
- package/src/emails/_utils/getProps.ts +7 -0
- package/src/rooms/app.controller.ts +7 -2
- package/src/rooms/emailNotification.service.tsx +152 -0
- package/src/rooms/emails/comment-body.tsx +342 -0
- package/src/rooms/emails/comment-with-body.ts +24 -0
- package/src/rooms/emails/index.ts +25 -0
- package/src/rooms/emails/lib/batch-users-resolver.ts +120 -0
- package/src/rooms/emails/lib/css-properties.ts +123 -0
- package/src/rooms/emails/lib/warning.ts +25 -0
- package/src/rooms/emails/thread-notification.tsx +583 -0
- package/src/rooms/globals/augmentation.ts +8 -8
- package/src/rooms/liveblocks.service.ts +25 -0
- package/src/rooms/notifications.service.ts +22 -10
- package/src/rooms/rooms.controller.ts +22 -4
- package/src/rooms/rooms.module.ts +10 -1
- package/src/rooms/rooms.service.ts +35 -20
- package/tsconfig.json +2 -0
- package/yarn-error.log +17218 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { Properties } from "csstype";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CSS properties object.
|
|
5
|
+
* Type alias for DX purposes.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export type CSSProperties = Properties;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Vendors
|
|
12
|
+
*/
|
|
13
|
+
const VENDORS_PREFIXES = new RegExp(/^(webkit|moz|ms|o)-/);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* CSS properties which accept numbers but are not in units of "px".
|
|
17
|
+
* Based on: https://github.com/facebook/react/blob/bfe91fbecf183f85fc1c4f909e12a6833a247319/packages/react-dom-bindings/src/shared/isUnitlessNumber.js
|
|
18
|
+
*/
|
|
19
|
+
const UNITLESS_PROPERTIES = [
|
|
20
|
+
"animationIterationCount",
|
|
21
|
+
"aspectRatio",
|
|
22
|
+
"borderImageOutset",
|
|
23
|
+
"borderImageSlice",
|
|
24
|
+
"borderImageWidth",
|
|
25
|
+
"boxFlex",
|
|
26
|
+
"boxFlexGroup",
|
|
27
|
+
"boxOrdinalGroup",
|
|
28
|
+
"columnCount",
|
|
29
|
+
"columns",
|
|
30
|
+
"flex",
|
|
31
|
+
"flexGrow",
|
|
32
|
+
"flexPositive",
|
|
33
|
+
"flexShrink",
|
|
34
|
+
"flexNegative",
|
|
35
|
+
"flexOrder",
|
|
36
|
+
"gridArea",
|
|
37
|
+
"gridRow",
|
|
38
|
+
"gridRowEnd",
|
|
39
|
+
"gridRowSpan",
|
|
40
|
+
"gridRowStart",
|
|
41
|
+
"gridColumn",
|
|
42
|
+
"gridColumnEnd",
|
|
43
|
+
"gridColumnSpan",
|
|
44
|
+
"gridColumnStart",
|
|
45
|
+
"fontWeight",
|
|
46
|
+
"lineClamp",
|
|
47
|
+
"lineHeight",
|
|
48
|
+
"opacity",
|
|
49
|
+
"order",
|
|
50
|
+
"orphans",
|
|
51
|
+
"scale",
|
|
52
|
+
"tabSize",
|
|
53
|
+
"widows",
|
|
54
|
+
"zIndex",
|
|
55
|
+
"zoom",
|
|
56
|
+
"fillOpacity",
|
|
57
|
+
"floodOpacity",
|
|
58
|
+
"stopOpacity",
|
|
59
|
+
"strokeDasharray",
|
|
60
|
+
"strokeDashoffset",
|
|
61
|
+
"strokeMiterlimit",
|
|
62
|
+
"strokeOpacity",
|
|
63
|
+
"strokeWidth",
|
|
64
|
+
"MozAnimationIterationCount",
|
|
65
|
+
"MozBoxFlex",
|
|
66
|
+
"MozBoxFlexGroup",
|
|
67
|
+
"MozLineClamp",
|
|
68
|
+
"msAnimationIterationCount",
|
|
69
|
+
"msFlex",
|
|
70
|
+
"msZoom",
|
|
71
|
+
"msFlexPositive",
|
|
72
|
+
"msGridColumns",
|
|
73
|
+
"msGridRows",
|
|
74
|
+
"WebkitAnimationIterationCount",
|
|
75
|
+
"WebkitBoxFlex",
|
|
76
|
+
"WebKitBoxFlexGroup",
|
|
77
|
+
"WebkitBoxOrdinalGroup",
|
|
78
|
+
"WebkitColumnCount",
|
|
79
|
+
"WebkitColumns",
|
|
80
|
+
"WebkitFlex",
|
|
81
|
+
"WebkitFlexGrow",
|
|
82
|
+
"WebkitFlexPositive",
|
|
83
|
+
"WebkitFlexShrink",
|
|
84
|
+
"WebkitLineClamp",
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Convert a `CSSProperties` style object into a inline CSS string.
|
|
89
|
+
*/
|
|
90
|
+
export function toInlineCSSString(styles: CSSProperties): string {
|
|
91
|
+
const entries = Object.entries(styles);
|
|
92
|
+
const inline = entries
|
|
93
|
+
.map(([key, value]): string | null => {
|
|
94
|
+
// Return an empty string if `value` is not acceptable
|
|
95
|
+
if (
|
|
96
|
+
value === null ||
|
|
97
|
+
typeof value === "boolean" ||
|
|
98
|
+
value === "" ||
|
|
99
|
+
typeof value === "undefined"
|
|
100
|
+
) {
|
|
101
|
+
return "";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Convert key from camelCase to kebab-case
|
|
105
|
+
let property = key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
106
|
+
|
|
107
|
+
// Manage vendors prefixes
|
|
108
|
+
if (VENDORS_PREFIXES.test(property)) {
|
|
109
|
+
property = `-${property}`;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Add `px` if needed for properties which aren't unitless
|
|
113
|
+
if (typeof value === "number" && !UNITLESS_PROPERTIES.includes(key)) {
|
|
114
|
+
return `${property}:${value}px;`;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return `${property}:${String(value).trim()};`;
|
|
118
|
+
})
|
|
119
|
+
.filter(Boolean)
|
|
120
|
+
.join("");
|
|
121
|
+
|
|
122
|
+
return inline;
|
|
123
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Emit a warning only once if a condition is met, in development only.
|
|
4
|
+
*/
|
|
5
|
+
export const createDevelopmentWarning = (
|
|
6
|
+
condition: boolean | (() => boolean),
|
|
7
|
+
...args: Parameters<typeof console.warn>
|
|
8
|
+
) => {
|
|
9
|
+
let hasWarned = false;
|
|
10
|
+
|
|
11
|
+
if (process.env.NODE_ENV !== "production") {
|
|
12
|
+
return () => {
|
|
13
|
+
if (
|
|
14
|
+
!hasWarned &&
|
|
15
|
+
(typeof condition === "function" ? condition() : condition)
|
|
16
|
+
) {
|
|
17
|
+
console.warn(...args);
|
|
18
|
+
|
|
19
|
+
hasWarned = true;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
} else {
|
|
23
|
+
return () => {};
|
|
24
|
+
}
|
|
25
|
+
};
|