@mediansh/widget 0.2.0 → 0.3.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.
package/README.md CHANGED
@@ -28,6 +28,18 @@ import { MedianSupport } from "@mediansh/widget";
28
28
  Mount it once, anywhere in your tree. The `median_pk_` id is derived from
29
29
  your server's `MEDIAN_KEY`; the docs show the one line helper.
30
30
 
31
+ On an app with auth, serve `medianIdentity` from a route and pass that
32
+ instead. The key comes down with the signed in user, so the conversation
33
+ follows the person rather than the browser:
34
+
35
+ ```tsx
36
+ <MedianSupport identity="/api/median/identity" />;
37
+ ```
38
+
39
+ It costs your first paint 93KB of JavaScript and 12KB of CSS, gzipped. The
40
+ markdown renderer is another 199KB and loads when somebody reaches for the
41
+ panel, so wrapping this in `dynamic()` only delays the launcher.
42
+
31
43
  ## Without React
32
44
 
33
45
  ```ts
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import {
3
+ clsx,
4
+ twMerge
5
+ } from "./chunk-W6NPKKCE.js";
6
+
7
+ // ../../apps/web/src/lib/utils.ts
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
11
+
12
+ export {
13
+ cn
14
+ };
15
+ //# sourceMappingURL=chunk-3KEM4W7J.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../apps/web/src/lib/utils.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;;;;;AAGO,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;","names":[]}