@rlse/widget 0.1.3 → 0.1.5
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/README.md +2 -2
- package/dist/ChangesModal.js +13 -4
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# @rlse/widget
|
|
2
2
|
|
|
3
|
-
React component for embedding [rlse.dev](https://rlse.dev) release notes directly in your application.
|
|
3
|
+
React component for embedding [ rlse.dev](https://rlse.dev) release notes directly in your application.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@rlse/widget)
|
|
6
|
-
[](https://
|
|
6
|
+
[](https://socket.dev/npm/package/@rlse/widget)
|
|
7
7
|
|
|
8
8
|
## Features
|
|
9
9
|
|
package/dist/ChangesModal.js
CHANGED
|
@@ -24,7 +24,7 @@ function simpleMarkdownToHtml(markdown) {
|
|
|
24
24
|
// Helper to sanitize URLs - only allow safe protocols
|
|
25
25
|
const isSafeUrl = (url) => {
|
|
26
26
|
try {
|
|
27
|
-
const parsed = new URL(url
|
|
27
|
+
const parsed = new URL(url);
|
|
28
28
|
const protocol = parsed.protocol.replace(':', '');
|
|
29
29
|
return ['http', 'https', 'mailto', 'tel'].includes(protocol);
|
|
30
30
|
}
|
|
@@ -110,9 +110,18 @@ export function ChangesModal({ config, changes, isLoading, isOpen, onClose, onMa
|
|
|
110
110
|
}, [isOpen, onClose]);
|
|
111
111
|
if (!isOpen)
|
|
112
112
|
return null;
|
|
113
|
-
const releaseNotesUrl =
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
const releaseNotesUrl = (() => {
|
|
114
|
+
try {
|
|
115
|
+
const parsed = new URL(config.baseUrl);
|
|
116
|
+
const base = `${parsed.protocol}//${config.orgSlug}.${parsed.host}`;
|
|
117
|
+
return config.appSlug ? `${base}/${config.appSlug}` : base;
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
return config.appSlug
|
|
121
|
+
? `${config.baseUrl}/${config.orgSlug}/${config.appSlug}`
|
|
122
|
+
: `${config.baseUrl}/${config.orgSlug}`;
|
|
123
|
+
}
|
|
124
|
+
})();
|
|
116
125
|
const unreadCount = getUnreadCount(config.orgSlug, changes);
|
|
117
126
|
return (_jsx("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": "rlse-widget-title", onClick: (e) => {
|
|
118
127
|
if (e.target === e.currentTarget) {
|
package/dist/types.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface WidgetConfig {
|
|
|
23
23
|
triggerLabel?: string;
|
|
24
24
|
/** Modal title */
|
|
25
25
|
modalTitle?: string;
|
|
26
|
-
/** Base URL for
|
|
26
|
+
/** Base URL for the server (optional, defaults to https://rlse.dev) */
|
|
27
27
|
baseUrl?: string;
|
|
28
28
|
}
|
|
29
29
|
export interface Change {
|