jamdesk 1.1.134 → 1.1.135

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamdesk",
3
- "version": "1.1.134",
3
+ "version": "1.1.135",
4
4
  "description": "CLI for Jamdesk — build, preview, and deploy documentation sites from MDX. Dev server with hot reload, 50+ components, OpenAPI support, AI search, and Mintlify migration",
5
5
  "keywords": [
6
6
  "jamdesk",
@@ -129,12 +129,12 @@ export function Widget({
129
129
 
130
130
  if (trigger) return null;
131
131
 
132
- return (
132
+ const buttonEl = (
133
133
  <button
134
134
  type="button"
135
135
  id={buttonId}
136
136
  className={
137
- 'jd-widget-trigger my-4 inline-flex cursor-pointer items-center gap-2 rounded-lg ' +
137
+ 'jd-widget-trigger inline-flex cursor-pointer items-center gap-2 rounded-lg ' +
138
138
  'border border-gray-200 bg-white px-4 py-2 text-sm font-medium ' +
139
139
  'text-gray-900 shadow-sm transition hover:shadow-md ' +
140
140
  'dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100' +
@@ -145,4 +145,23 @@ export function Widget({
145
145
  {label}
146
146
  </button>
147
147
  );
148
+
149
+ // No slug → the trigger can't bind (see the effect above), which is the
150
+ // normal state in local `jamdesk dev`. Render a visible caption beside the
151
+ // button so a clicked-but-inert button doesn't read as broken — the console
152
+ // hint alone is invisible to anyone without devtools open. Never renders in
153
+ // the deployed build, where the slug is always set and the button works.
154
+ if (!resolvedBase) {
155
+ return (
156
+ <span className="jd-widget-preview my-4 flex flex-col items-start gap-1.5">
157
+ {buttonEl}
158
+ <span className="text-xs text-gray-500 dark:text-gray-400">
159
+ Live preview — opens on your deployed docs site, not in local{' '}
160
+ <code className="rounded bg-gray-100 px-1 py-0.5 dark:bg-gray-800">jamdesk dev</code>.
161
+ </span>
162
+ </span>
163
+ );
164
+ }
165
+
166
+ return <span className="jd-widget my-4 inline-flex">{buttonEl}</span>;
148
167
  }