react-notify-sdk 1.0.57 → 1.0.59
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/FeatureMessage.js
CHANGED
|
@@ -92,8 +92,8 @@ const FeatureMessage = ({ message, onDismiss }) => {
|
|
|
92
92
|
height: "100%", // h-full
|
|
93
93
|
display: "flex", // flex flex-col
|
|
94
94
|
flexDirection: "column",
|
|
95
|
-
borderRightWidth: "1px",
|
|
96
|
-
borderRightColor: message?.click_action === "view only" ? '' :
|
|
95
|
+
//borderRightWidth: "1px", // border-r
|
|
96
|
+
borderRightColor: message?.click_action === "view only" ? 'none' : `1px solid ${message?.textColor}`
|
|
97
97
|
}, children: [_jsxs("div", { style: {
|
|
98
98
|
position: "relative", // relative
|
|
99
99
|
width: "100%", // w-full
|
|
@@ -6,8 +6,8 @@ import { getSupabaseClient } from './supabase/supabaseClient';
|
|
|
6
6
|
import useDeviceDetection from './useDeviceDetection';
|
|
7
7
|
import FadeWrapper from './FadeWrapper';
|
|
8
8
|
// Wildcard route matching utility
|
|
9
|
-
const routeMatches = (pattern, path) => {
|
|
10
|
-
if (pattern === path)
|
|
9
|
+
const routeMatches = (pattern, path, baseUrl) => {
|
|
10
|
+
if (pattern === path && baseUrl === window.location.origin)
|
|
11
11
|
return true;
|
|
12
12
|
const escapeRegex = (str) => str.replace(/([.+^=!:${}()|[\]/\\])/g, "\\$1");
|
|
13
13
|
const regexPattern = "^" + pattern.split("*").map(escapeRegex).join(".*") + "$";
|
|
@@ -95,7 +95,7 @@ export const FeatureMessageProvider = ({ projectKey, }) => {
|
|
|
95
95
|
.eq('route', pathname)
|
|
96
96
|
.eq('is_active', true)
|
|
97
97
|
.order('created_at', { ascending: false });
|
|
98
|
-
const match = data?.find((msg) => routeMatches(msg.route, pathname));
|
|
98
|
+
const match = data?.find((msg) => routeMatches(msg.route, pathname, msg.url));
|
|
99
99
|
if (match && !isDismissed(match)) {
|
|
100
100
|
if (fadeOutTimer)
|
|
101
101
|
clearTimeout(fadeOutTimer); // Clear any pending timeout
|
|
@@ -117,7 +117,7 @@ export const FeatureMessageProvider = ({ projectKey, }) => {
|
|
|
117
117
|
table: 'feature_messages',
|
|
118
118
|
}, (payload) => {
|
|
119
119
|
const msg = payload.new;
|
|
120
|
-
if (msg.project_key === projectKey && msg.is_active && routeMatches(msg.route, pathname)) {
|
|
120
|
+
if (msg.project_key === projectKey && msg.is_active && routeMatches(msg.route, pathname, msg.url)) {
|
|
121
121
|
if (fadeOutTimer)
|
|
122
122
|
clearTimeout(fadeOutTimer); // Clear any pending timeout
|
|
123
123
|
setMessage(msg);
|
package/dist/types.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type FeatureMessages = {
|
|
|
18
18
|
type?: 'Information' | 'Warning' | 'Error';
|
|
19
19
|
click_action?: 'view only' | 'navigate' | 'external' | 'dismiss';
|
|
20
20
|
click_url?: string;
|
|
21
|
+
url: string;
|
|
21
22
|
};
|
|
22
23
|
export type FeatureMessageProviderProps = {
|
|
23
24
|
projectKey: string;
|