@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.
Files changed (112) hide show
  1. package/dist/emails/UnreadMention.d.ts +9 -0
  2. package/dist/emails/UnreadMention.js +54 -0
  3. package/dist/emails/UnreadMention.js.map +1 -0
  4. package/dist/emails/UnreadReplies.d.ts +9 -0
  5. package/dist/emails/UnreadReplies.js +68 -0
  6. package/dist/emails/UnreadReplies.js.map +1 -0
  7. package/dist/emails/_components/comment.d.ts +1 -0
  8. package/dist/emails/_components/comment.js +32 -0
  9. package/dist/emails/_components/comment.js.map +1 -0
  10. package/dist/emails/_components/header.d.ts +2 -0
  11. package/dist/emails/_components/header.js +15 -0
  12. package/dist/emails/_components/header.js.map +1 -0
  13. package/dist/emails/_components/headline.d.ts +5 -0
  14. package/dist/emails/_components/headline.js +17 -0
  15. package/dist/emails/_components/headline.js.map +1 -0
  16. package/dist/emails/_components/layout.d.ts +5 -0
  17. package/dist/emails/_components/layout.js +24 -0
  18. package/dist/emails/_components/layout.js.map +1 -0
  19. package/dist/emails/_lib/types.d.ts +9 -0
  20. package/dist/emails/_lib/types.js +3 -0
  21. package/dist/emails/_lib/types.js.map +1 -0
  22. package/dist/emails/_styles/colors.d.ts +2 -0
  23. package/dist/emails/_styles/colors.js +7 -0
  24. package/dist/emails/_styles/colors.js.map +1 -0
  25. package/dist/emails/_utils/cn.d.ts +2 -0
  26. package/dist/emails/_utils/cn.js +10 -0
  27. package/dist/emails/_utils/cn.js.map +1 -0
  28. package/dist/emails/_utils/comments.d.ts +7 -0
  29. package/dist/emails/_utils/comments.js +29 -0
  30. package/dist/emails/_utils/comments.js.map +1 -0
  31. package/dist/emails/_utils/getProps.d.ts +1 -0
  32. package/dist/emails/_utils/getProps.js +11 -0
  33. package/dist/emails/_utils/getProps.js.map +1 -0
  34. package/dist/rooms/app.controller.d.ts +3 -1
  35. package/dist/rooms/app.controller.js +61 -46
  36. package/dist/rooms/app.controller.js.map +1 -1
  37. package/dist/rooms/emailNotification.service.d.ts +17 -0
  38. package/dist/rooms/emailNotification.service.js +113 -0
  39. package/dist/rooms/emailNotification.service.js.map +1 -0
  40. package/dist/rooms/emails/comment-body.d.ts +44 -0
  41. package/dist/rooms/emails/comment-body.js +138 -0
  42. package/dist/rooms/emails/comment-body.js.map +1 -0
  43. package/dist/rooms/emails/comment-with-body.d.ts +6 -0
  44. package/dist/rooms/emails/comment-with-body.js +17 -0
  45. package/dist/rooms/emails/comment-with-body.js.map +1 -0
  46. package/dist/rooms/emails/index.d.ts +4 -0
  47. package/dist/rooms/emails/index.js +7 -0
  48. package/dist/rooms/emails/index.js.map +1 -0
  49. package/dist/rooms/emails/lib/batch-users-resolver.d.ts +9 -0
  50. package/dist/rooms/emails/lib/batch-users-resolver.js +67 -0
  51. package/dist/rooms/emails/lib/batch-users-resolver.js.map +1 -0
  52. package/dist/rooms/emails/lib/css-properties.d.ts +3 -0
  53. package/dist/rooms/emails/lib/css-properties.js +96 -0
  54. package/dist/rooms/emails/lib/css-properties.js.map +1 -0
  55. package/dist/rooms/emails/lib/warning.d.ts +1 -0
  56. package/dist/rooms/emails/lib/warning.js +20 -0
  57. package/dist/rooms/emails/lib/warning.js.map +1 -0
  58. package/dist/rooms/emails/thread-notification.d.ts +90 -0
  59. package/dist/rooms/emails/thread-notification.js +297 -0
  60. package/dist/rooms/emails/thread-notification.js.map +1 -0
  61. package/dist/rooms/globals/augmentation.d.ts +0 -5
  62. package/dist/rooms/lib/utils.js +21 -10
  63. package/dist/rooms/lib/utils.js.map +1 -1
  64. package/dist/rooms/liveblocks.service.d.ts +16 -0
  65. package/dist/rooms/liveblocks.service.js +54 -0
  66. package/dist/rooms/liveblocks.service.js.map +1 -0
  67. package/dist/rooms/notifications.service.d.ts +4 -0
  68. package/dist/rooms/notifications.service.js +107 -80
  69. package/dist/rooms/notifications.service.js.map +1 -1
  70. package/dist/rooms/rooms.controller.d.ts +5 -3
  71. package/dist/rooms/rooms.controller.js +321 -243
  72. package/dist/rooms/rooms.controller.js.map +1 -1
  73. package/dist/rooms/rooms.gateway.js +132 -109
  74. package/dist/rooms/rooms.gateway.js.map +1 -1
  75. package/dist/rooms/rooms.guard.js +31 -19
  76. package/dist/rooms/rooms.guard.js.map +1 -1
  77. package/dist/rooms/rooms.module.js +10 -1
  78. package/dist/rooms/rooms.module.js.map +1 -1
  79. package/dist/rooms/rooms.moleculer.js +85 -66
  80. package/dist/rooms/rooms.moleculer.js.map +1 -1
  81. package/dist/rooms/rooms.service.d.ts +17 -4
  82. package/dist/rooms/rooms.service.js +408 -340
  83. package/dist/rooms/rooms.service.js.map +1 -1
  84. package/package.json +18 -7
  85. package/src/emails/UnreadMention.tsx +76 -0
  86. package/src/emails/UnreadReplies.tsx +106 -0
  87. package/src/emails/_components/comment.tsx +70 -0
  88. package/src/emails/_components/header.tsx +27 -0
  89. package/src/emails/_components/headline.tsx +20 -0
  90. package/src/emails/_components/layout.tsx +45 -0
  91. package/src/emails/_lib/types.ts +10 -0
  92. package/src/emails/_styles/colors.ts +7 -0
  93. package/src/emails/_utils/cn.ts +6 -0
  94. package/src/emails/_utils/comments.ts +61 -0
  95. package/src/emails/_utils/getProps.ts +7 -0
  96. package/src/rooms/app.controller.ts +7 -2
  97. package/src/rooms/emailNotification.service.tsx +152 -0
  98. package/src/rooms/emails/comment-body.tsx +342 -0
  99. package/src/rooms/emails/comment-with-body.ts +24 -0
  100. package/src/rooms/emails/index.ts +25 -0
  101. package/src/rooms/emails/lib/batch-users-resolver.ts +120 -0
  102. package/src/rooms/emails/lib/css-properties.ts +123 -0
  103. package/src/rooms/emails/lib/warning.ts +25 -0
  104. package/src/rooms/emails/thread-notification.tsx +583 -0
  105. package/src/rooms/globals/augmentation.ts +8 -8
  106. package/src/rooms/liveblocks.service.ts +25 -0
  107. package/src/rooms/notifications.service.ts +22 -10
  108. package/src/rooms/rooms.controller.ts +22 -4
  109. package/src/rooms/rooms.module.ts +10 -1
  110. package/src/rooms/rooms.service.ts +35 -20
  111. package/tsconfig.json +2 -0
  112. 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
+ };