@rlse/widget 0.1.3 → 0.1.4

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 CHANGED
@@ -3,7 +3,7 @@
3
3
  React component for embedding [rlse.dev](https://rlse.dev) release notes directly in your application.
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@rlse/widget)](https://www.npmjs.com/package/@rlse/widget)
6
- [![Socket Badge](https://badge.socket.dev/npm/package/@rlse/widget/latest)](https://badge.socket.dev/npm/package/@rlse/widget/latest)
6
+ [![Socket Badge](https://badge.socket.dev/npm/package/@rlse/widget/latest)](https://socket.dev/npm/package/@rlse/widget)
7
7
 
8
8
  ## Features
9
9
 
@@ -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 = config.appSlug
114
- ? `${config.baseUrl}/${config.orgSlug}/${config.appSlug}`
115
- : `${config.baseUrl}/${config.orgSlug}`;
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 API (optional, defaults to https://rlse.dev) */
26
+ /** Base URL for the server (optional, defaults to https://rlse.dev) */
27
27
  baseUrl?: string;
28
28
  }
29
29
  export interface Change {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rlse/widget",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "React release notes widget for rlse.dev",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",