@agora-sdk/social-react-native 0.6.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.
Files changed (45) hide show
  1. package/LICENSE +202 -0
  2. package/dist/cjs/components/CommunityWeather.d.ts +24 -0
  3. package/dist/cjs/components/CommunityWeather.js +128 -0
  4. package/dist/cjs/components/CommunityWeather.js.map +1 -0
  5. package/dist/cjs/components/Constellation.d.ts +24 -0
  6. package/dist/cjs/components/Constellation.js +97 -0
  7. package/dist/cjs/components/Constellation.js.map +1 -0
  8. package/dist/cjs/components/Neighborhood.d.ts +24 -0
  9. package/dist/cjs/components/Neighborhood.js +131 -0
  10. package/dist/cjs/components/Neighborhood.js.map +1 -0
  11. package/dist/cjs/components/SocialTransparency.d.ts +21 -0
  12. package/dist/cjs/components/SocialTransparency.js +43 -0
  13. package/dist/cjs/components/SocialTransparency.js.map +1 -0
  14. package/dist/cjs/index.d.ts +11 -0
  15. package/dist/cjs/index.js +40 -0
  16. package/dist/cjs/index.js.map +1 -0
  17. package/dist/cjs/layout.d.ts +25 -0
  18. package/dist/cjs/layout.js +54 -0
  19. package/dist/cjs/layout.js.map +1 -0
  20. package/dist/cjs/package.json +1 -0
  21. package/dist/cjs/palette.d.ts +58 -0
  22. package/dist/cjs/palette.js +65 -0
  23. package/dist/cjs/palette.js.map +1 -0
  24. package/dist/esm/components/CommunityWeather.d.ts +24 -0
  25. package/dist/esm/components/CommunityWeather.js +89 -0
  26. package/dist/esm/components/CommunityWeather.js.map +1 -0
  27. package/dist/esm/components/Constellation.d.ts +24 -0
  28. package/dist/esm/components/Constellation.js +61 -0
  29. package/dist/esm/components/Constellation.js.map +1 -0
  30. package/dist/esm/components/Neighborhood.d.ts +24 -0
  31. package/dist/esm/components/Neighborhood.js +92 -0
  32. package/dist/esm/components/Neighborhood.js.map +1 -0
  33. package/dist/esm/components/SocialTransparency.d.ts +21 -0
  34. package/dist/esm/components/SocialTransparency.js +40 -0
  35. package/dist/esm/components/SocialTransparency.js.map +1 -0
  36. package/dist/esm/index.d.ts +11 -0
  37. package/dist/esm/index.js +16 -0
  38. package/dist/esm/index.js.map +1 -0
  39. package/dist/esm/layout.d.ts +25 -0
  40. package/dist/esm/layout.js +50 -0
  41. package/dist/esm/layout.js.map +1 -0
  42. package/dist/esm/palette.d.ts +58 -0
  43. package/dist/esm/palette.js +60 -0
  44. package/dist/esm/palette.js.map +1 -0
  45. package/package.json +53 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Neighborhood.js","sourceRoot":"","sources":["../../../src/components/Neighborhood.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+GA,oCAwBC;;AAvID,2FAA2F;AAC3F,EAAE;AACF,mGAAmG;AACnG,uGAAuG;AACvG,qGAAqG;AACrG,sGAAsG;AACtG,qCAAqC;AACrC,EAAE;AACF,yGAAyG;AACzG,qGAAqG;AAErG,kDAA0B;AAC1B,+CAAiF;AACjF,qEAAyE;AACzE,wDAA+D;AAE/D,8CAAoD;AAUpD,+DAA+D;AAC/D,MAAM,cAAc,GAAwC;IAC1D,MAAM,EAAE,GAAG;IACX,UAAU,EAAE,GAAG;IACf,WAAW,EAAE,GAAG;CACjB,CAAC;AAEF,4FAA4F;AAC5F,SAAS,WAAW,CAAC,GAAoB;IACvC,OAAO,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,QAAQ,IAAI,SAAS,CAAC;AAC/C,CAAC;AAED,2CAA2C;AAC3C,SAAS,OAAO,CAAC,GAAoB;IACnC,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAClD,CAAC;AAED,0FAA0F;AAC1F,SAAS,OAAO,CAAC,EAAE,GAAG,EAAE,UAAU,EAAgD;IAChF,MAAM,CAAC,GAAG,IAAA,gCAAmB,EAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC9C,gGAAgG;IAChG,2E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AAE,UAAU,EAAE,KAAK,EAAE;IACzC,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE;IACvC,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;CACzC,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ /** Props for {@link SocialTransparency}. */
3
+ export interface SocialTransparencyProps {
4
+ /** Optional style for the root element. */
5
+ style?: object;
6
+ }
7
+ /**
8
+ * Render the social-graph transparency panel.
9
+ *
10
+ * Self-contained: reads {@link useSocialTransparency} from the provider. Lists the enabled lenses and
11
+ * the tuning that shapes them, in member-safe terms.
12
+ *
13
+ * @param props - {@link SocialTransparencyProps}.
14
+ * @returns The disclosure panel, or `null` until the config has resolved.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <SocialTransparency />
19
+ * ```
20
+ */
21
+ export declare function SocialTransparency({ style, }: SocialTransparencyProps): React.ReactElement | null;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SocialTransparency = SocialTransparency;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_native_1 = require("react-native");
6
+ const social_core_1 = require("@agora-sdk/social-core");
7
+ /** One labeled row in the disclosure panel. */
8
+ function Row({ label, value }) {
9
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.row, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.rowLabel, children: label }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.rowValue, children: value })] }));
10
+ }
11
+ /**
12
+ * Render the social-graph transparency panel.
13
+ *
14
+ * Self-contained: reads {@link useSocialTransparency} from the provider. Lists the enabled lenses and
15
+ * the tuning that shapes them, in member-safe terms.
16
+ *
17
+ * @param props - {@link SocialTransparencyProps}.
18
+ * @returns The disclosure panel, or `null` until the config has resolved.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * <SocialTransparency />
23
+ * ```
24
+ */
25
+ function SocialTransparency({ style, }) {
26
+ const { config } = (0, social_core_1.useSocialTransparency)();
27
+ if (!config)
28
+ return null;
29
+ const lenses = [
30
+ config.weatherEnabled && "Weather",
31
+ config.constellationEnabled && "Constellation",
32
+ config.neighborhoodEnabled && "Neighborhood",
33
+ ].filter(Boolean);
34
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: style, accessibilityLabel: "How the social graph works", children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.heading, children: "How your community graph works" }), (0, jsx_runtime_1.jsx)(Row, { label: "Active lenses", value: lenses.length ? lenses.join(", ") : "None" }), (0, jsx_runtime_1.jsx)(Row, { label: "Warmth memory", value: `~${config.warmthHalfLifeDays}-day half-life` }), (0, jsx_runtime_1.jsx)(Row, { label: "Friction memory", value: `~${config.frictionHalfLifeDays}-day half-life` }), (0, jsx_runtime_1.jsx)(Row, { label: "Smallest visible cluster", value: `${config.constellationKFloor}+ members` }), (0, jsx_runtime_1.jsx)(Row, { label: "Neighborhood includes interactions", value: config.neighborhoodIncludeInteractions ? "By default" : "Only if you opt in" }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.footnote, children: "Warmth fades gently over time, so the graph reflects how things are now \u2014 not a permanent score. Clusters smaller than the floor are never shown. Your Neighborhood is yours alone." })] }));
35
+ }
36
+ const styles = react_native_1.StyleSheet.create({
37
+ heading: { fontSize: 14, fontWeight: "600", marginBottom: 8 },
38
+ row: { flexDirection: "row", justifyContent: "space-between", gap: 16, paddingVertical: 4 },
39
+ rowLabel: { fontSize: 13, color: "#9ca3af" },
40
+ rowValue: { fontSize: 13, fontWeight: "600" },
41
+ footnote: { fontSize: 12, color: "#9ca3af", marginTop: 10, lineHeight: 18 },
42
+ });
43
+ //# sourceMappingURL=SocialTransparency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SocialTransparency.js","sourceRoot":"","sources":["../../../src/components/Social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AAK,EAAE,IAAI,MAAM,CAAC,oBAAoB,gBAAgB,GAAI,EACvF,uBAAC,GAAG,IAAC,KAAK,EAAC,0BAA0B,EAAC,KAAK,EAAE,GAAG,MAAM,CAAC,mBAAmB,WAAW,GAAI,EACzF,uBAAC,GAAG,IACF,KAAK,EAAC,oCAAoC,EAC1C,KAAK,EAAE,MAAM,CAAC,+BAA+B,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,oBAAoB,GACnF,EACF,uBAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,yMAGrB,IACF,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE;IAC7D,GAAG,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC,EAAE;IAC3F,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;IAC5C,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;IAC7C,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;CAC5E,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export * from "@agora-sdk/social-core";
2
+ export { CommunityWeather } from "./components/CommunityWeather.js";
3
+ export type { CommunityWeatherProps } from "./components/CommunityWeather.js";
4
+ export { Constellation } from "./components/Constellation.js";
5
+ export type { ConstellationProps } from "./components/Constellation.js";
6
+ export { Neighborhood } from "./components/Neighborhood.js";
7
+ export type { NeighborhoodProps } from "./components/Neighborhood.js";
8
+ export { SocialTransparency } from "./components/SocialTransparency.js";
9
+ export type { SocialTransparencyProps } from "./components/SocialTransparency.js";
10
+ export { bandPalette, bandColors, brightnessTreatment } from "./palette.js";
11
+ export type { BandColors, BrightnessTreatment } from "./palette.js";
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ // @agora-sdk/social-react-native — bare React Native bindings for the Agora social graph.
3
+ //
4
+ // Re-exports the platform-agnostic core (provider + four feature-gated hooks + transport + wire types)
5
+ // and adds the NATIVE visual components for the three lenses plus the transparency disclosure, drawn on
6
+ // React Native primitives + react-native-svg. Use this package (not core directly) in a bare RN app so
7
+ // the components ship. The shared climate palette is exported too, so host apps can match the SDK's
8
+ // warmth vocabulary in their own chrome. The data layer is pure REST — no platform crypto involved.
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.brightnessTreatment = exports.bandColors = exports.bandPalette = exports.SocialTransparency = exports.Neighborhood = exports.Constellation = exports.CommunityWeather = void 0;
25
+ __exportStar(require("@agora-sdk/social-core"), exports);
26
+ // ── components ────────────────────────────────────────────────────────────────
27
+ var CommunityWeather_js_1 = require("./components/CommunityWeather.js");
28
+ Object.defineProperty(exports, "CommunityWeather", { enumerable: true, get: function () { return CommunityWeather_js_1.CommunityWeather; } });
29
+ var Constellation_js_1 = require("./components/Constellation.js");
30
+ Object.defineProperty(exports, "Constellation", { enumerable: true, get: function () { return Constellation_js_1.Constellation; } });
31
+ var Neighborhood_js_1 = require("./components/Neighborhood.js");
32
+ Object.defineProperty(exports, "Neighborhood", { enumerable: true, get: function () { return Neighborhood_js_1.Neighborhood; } });
33
+ var SocialTransparency_js_1 = require("./components/SocialTransparency.js");
34
+ Object.defineProperty(exports, "SocialTransparency", { enumerable: true, get: function () { return SocialTransparency_js_1.SocialTransparency; } });
35
+ // ── shared visual vocabulary (palette + brightness mapping) ───────────────────
36
+ var palette_js_1 = require("./palette.js");
37
+ Object.defineProperty(exports, "bandPalette", { enumerable: true, get: function () { return palette_js_1.bandPalette; } });
38
+ Object.defineProperty(exports, "bandColors", { enumerable: true, get: function () { return palette_js_1.bandColors; } });
39
+ Object.defineProperty(exports, "brightnessTreatment", { enumerable: true, get: function () { return palette_js_1.brightnessTreatment; } });
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,0FAA0F;AAC1F,EAAE;AACF,uGAAuG;AACvG,wGAAwG;AACxG,uGAAuG;AACvG,oGAAoG;AACpG,oGAAoG;;;;;;;;;;;;;;;;;AAEpG,yDAAuC;AAEvC,iFAAiF;AACjF,wEAAoE;AAA3D,uHAAA,gBAAgB,OAAA;AAEzB,kEAA8D;AAArD,iHAAA,aAAa,OAAA;AAEtB,gEAA4D;AAAnD,+GAAA,YAAY,OAAA;AAErB,4EAAwE;AAA/D,2HAAA,kBAAkB,OAAA;AAG3B,iFAAiF;AACjF,2CAA4E;AAAnE,yGAAA,WAAW,OAAA;AAAE,wGAAA,UAAU,OAAA;AAAE,iHAAA,mBAAmB,OAAA"}
@@ -0,0 +1,25 @@
1
+ import { type SimulationNodeDatum } from "d3-force";
2
+ import type { BlobSizeBucket, ConstellationBlob, WeatherBand } from "@agora-sdk/social-core";
3
+ /**
4
+ * Fixed bucket → blob radius (px). Deliberately coarse: the bucket IS the privacy protection, so the
5
+ * visual never encodes more precision than the bucket itself (SOCIAL.md §6).
6
+ */
7
+ export declare const BUCKET_RADIUS: Record<BlobSizeBucket, number>;
8
+ /** A blob with a force-resolved position. d3-force mutates `x`/`y` in place during simulation. */
9
+ export interface BlobNode extends SimulationNodeDatum {
10
+ /** Blob radius in px (from {@link BUCKET_RADIUS}). */
11
+ r: number;
12
+ /** Warmth band that tints the blob. */
13
+ warmth: WeatherBand;
14
+ }
15
+ /**
16
+ * Lay out blobs with fresh random positions resolved by a synchronous force pass. Re-randomization is
17
+ * a privacy requirement, so this runs from scratch each time it is called — never memoized to a stable
18
+ * layout. Uses `Math.random()` only for visual placement (no security relevance).
19
+ *
20
+ * @param blobs - The constellation blobs to place.
21
+ * @param width - Canvas width in px.
22
+ * @param height - Canvas height in px.
23
+ * @returns One {@link BlobNode} per blob, with settled, non-overlapping `x`/`y`.
24
+ */
25
+ export declare function computePositions(blobs: ConstellationBlob[], width: number, height: number): BlobNode[];
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ // Constellation layout — the d3-force blob placement, shared verbatim with the web sibling.
3
+ //
4
+ // d3-force is pure JS (no DOM), so the exact same synchronous force pass the web `<Constellation />`
5
+ // uses ports to native untouched. The SOCIAL.md §6 privacy rules are baked in here:
6
+ // • Size by BUCKET, never an exact count — radius comes from a fixed bucket→px map.
7
+ // • No stable layout — positions are seeded with a fresh `Math.random()` every call, so no cluster
8
+ // has a "home" a viewer could track across mounts. `Math.random()` is layout-only (no security
9
+ // relevance); the simulation then resolves overlaps with collision + center gravity.
10
+ //
11
+ // No `react-native` import here on purpose: this stays pure logic so it unit-tests under plain vitest.
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.BUCKET_RADIUS = void 0;
14
+ exports.computePositions = computePositions;
15
+ const d3_force_1 = require("d3-force");
16
+ /**
17
+ * Fixed bucket → blob radius (px). Deliberately coarse: the bucket IS the privacy protection, so the
18
+ * visual never encodes more precision than the bucket itself (SOCIAL.md §6).
19
+ */
20
+ exports.BUCKET_RADIUS = {
21
+ "5–9": 20,
22
+ "10–19": 28,
23
+ "20–49": 38,
24
+ "50–99": 50,
25
+ "100+": 65,
26
+ };
27
+ /**
28
+ * Lay out blobs with fresh random positions resolved by a synchronous force pass. Re-randomization is
29
+ * a privacy requirement, so this runs from scratch each time it is called — never memoized to a stable
30
+ * layout. Uses `Math.random()` only for visual placement (no security relevance).
31
+ *
32
+ * @param blobs - The constellation blobs to place.
33
+ * @param width - Canvas width in px.
34
+ * @param height - Canvas height in px.
35
+ * @returns One {@link BlobNode} per blob, with settled, non-overlapping `x`/`y`.
36
+ */
37
+ function computePositions(blobs, width, height) {
38
+ const nodes = blobs.map((b) => ({
39
+ r: exports.BUCKET_RADIUS[b.size] ?? 28,
40
+ warmth: b.warmth,
41
+ // Random seed placement near the center; the simulation spreads them without overlap.
42
+ x: width / 2 + (Math.random() - 0.5) * width * 0.6,
43
+ y: height / 2 + (Math.random() - 0.5) * height * 0.6,
44
+ }));
45
+ // Build a simulation, immediately stop its internal timer, and tick it synchronously so we get a
46
+ // settled, non-overlapping layout in one render with no animation loop or async state.
47
+ const simulation = (0, d3_force_1.forceSimulation)(nodes)
48
+ .force("collide", (0, d3_force_1.forceCollide)((d) => d.r + 8))
49
+ .force("center", (0, d3_force_1.forceCenter)(width / 2, height / 2))
50
+ .stop();
51
+ simulation.tick(300);
52
+ return nodes;
53
+ }
54
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/layout.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,EAAE;AACF,qGAAqG;AACrG,oFAAoF;AACpF,sFAAsF;AACtF,qGAAqG;AACrG,mGAAmG;AACnG,yFAAyF;AACzF,EAAE;AACF,uGAAuG;;;AAwCvG,4CAsBC;AA5DD,uCAKkB;AAGlB;;;GAGG;AACU,QAAA,aAAa,GAAmC;IAC3D,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,EAAE;CACX,CAAC;AAUF;;;;;;;;;GASG;AACH,SAAgB,gBAAgB,CAC9B,KAA0B,EAC1B,KAAa,EACb,MAAc;IAEd,MAAM,KAAK,GAAe,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1C,CAAC,EAAE,qBAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE;QAC9B,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,sFAAsF;QACtF,CAAC,EAAE,KAAK,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG;QAClD,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,MAAM,GAAG,GAAG;KACrD,CAAC,CAAC,CAAC;IAEJ,iGAAiG;IACjG,uFAAuF;IACvF,MAAM,UAAU,GAAG,IAAA,0BAAe,EAAC,KAAK,CAAC;SACtC,KAAK,CAAC,SAAS,EAAE,IAAA,uBAAY,EAAW,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SACxD,KAAK,CAAC,QAAQ,EAAE,IAAA,sBAAW,EAAC,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;SACnD,IAAI,EAAE,CAAC;IACV,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAErB,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,58 @@
1
+ import type { WeatherBand } from "@agora-sdk/social-core";
2
+ /** A band's rendering colors: a `core` fill/ink and a softer `glow` for shadows/auras. */
3
+ export interface BandColors {
4
+ /** The primary fill or text color for this band. */
5
+ core: string;
6
+ /** A translucent glow/aura color (for shadows, radial-gradient edges). */
7
+ glow: string;
8
+ }
9
+ /**
10
+ * Maps each {@link WeatherBand} to its calm climate colors. Kept deliberately in the amber/slate/grey
11
+ * register — **no red anywhere** — so low warmth never reads as an alarm (SOCIAL.md §5). These are the
12
+ * exact same hex/rgba constants as the web palette, so a native and a web client tint warmth identically.
13
+ *
14
+ * - `quiet` — soft grey-blue, "still forming" (the no-data sentinel)
15
+ * - `stormy` — muted slate-blue (low warmth, NOT danger)
16
+ * - `overcast` — cool grey (below average)
17
+ * - `fine` — warm amber-gold (above average)
18
+ * - `sunny` — bright golden-yellow (high warmth)
19
+ */
20
+ export declare const bandPalette: Record<WeatherBand, BandColors>;
21
+ /**
22
+ * Resolve the climate colors for a band, defaulting to `quiet` for any unexpected value (fail-soft to
23
+ * the neutral "forming" look rather than throwing on malformed server data).
24
+ *
25
+ * @param band - The weather/warmth band to color.
26
+ * @returns The {@link BandColors} for that band.
27
+ */
28
+ export declare function bandColors(band: WeatherBand): BandColors;
29
+ /**
30
+ * A tie's brightness expressed as React Native visual WEIGHT — shadow glow, elevation, and scale —
31
+ * never as a number. The shadow *color* is chosen by the component (amber for sprouts, golden
32
+ * otherwise); this carries only the magnitude props plus the sprout flag.
33
+ */
34
+ export interface BrightnessTreatment {
35
+ /** iOS `shadowRadius` in px (higher = warmer, closer). */
36
+ shadowRadius: number;
37
+ /** iOS `shadowOpacity` in `[0, 1]`. */
38
+ shadowOpacity: number;
39
+ /** Android `elevation` (a coarse glow proxy, since Android has no tunable shadow blur). */
40
+ elevation: number;
41
+ /** Node scale multiplier (brighter ties read slightly larger). */
42
+ scale: number;
43
+ /**
44
+ * True for ties at the floor band (`[0.15, 0.24]`): render the warm, hopeful "sprout" treatment, not
45
+ * a grey absence. New ≠ lonely ≠ deficient (SOCIAL.md §6).
46
+ */
47
+ isSprout: boolean;
48
+ }
49
+ /**
50
+ * Map a dyadic `brightness` in `[0.15, 1.0]` to an RN visual treatment — shadow glow, elevation, scale,
51
+ * and the sprout flag. The brightness number itself is **never** returned for display; it is a rendering
52
+ * input only. The clamp floor and the `isSprout` threshold are identical to the web palette so the
53
+ * privacy semantics never diverge across platforms.
54
+ *
55
+ * @param brightness - Dyadic brightness in `[0.15, 1.0]` (values outside are clamped).
56
+ * @returns The {@link BrightnessTreatment} for that tie.
57
+ */
58
+ export declare function brightnessTreatment(brightness: number): BrightnessTreatment;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ // Climate palette + brightness mapping for native — the privacy-critical visual vocabulary.
3
+ //
4
+ // This is the React Native PORT of the web sibling (`@agora-sdk/social-react-js`'s `palette.ts`). It
5
+ // keeps the SAME SOCIAL.md §5 band colors and the SAME §6 brightness thresholds (the `isSprout`
6
+ // floor at 0.24, the `[0.15, 1.0]` clamp) — those are privacy-critical and must not drift between
7
+ // platforms — but `brightnessTreatment` returns RN shadow/elevation props instead of values tuned for
8
+ // a CSS `box-shadow` string. The rule still holds on every surface: a sky/climate register, **never
9
+ // red** for low warmth, and the floor band rendered as a hopeful sprout glow, never a grey absence.
10
+ //
11
+ // No `react-native` import here on purpose: this module is pure logic so it unit-tests under plain
12
+ // vitest (node env) without an RN renderer.
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.bandPalette = void 0;
15
+ exports.bandColors = bandColors;
16
+ exports.brightnessTreatment = brightnessTreatment;
17
+ /**
18
+ * Maps each {@link WeatherBand} to its calm climate colors. Kept deliberately in the amber/slate/grey
19
+ * register — **no red anywhere** — so low warmth never reads as an alarm (SOCIAL.md §5). These are the
20
+ * exact same hex/rgba constants as the web palette, so a native and a web client tint warmth identically.
21
+ *
22
+ * - `quiet` — soft grey-blue, "still forming" (the no-data sentinel)
23
+ * - `stormy` — muted slate-blue (low warmth, NOT danger)
24
+ * - `overcast` — cool grey (below average)
25
+ * - `fine` — warm amber-gold (above average)
26
+ * - `sunny` — bright golden-yellow (high warmth)
27
+ */
28
+ exports.bandPalette = {
29
+ quiet: { core: "#8a94a6", glow: "rgba(138, 148, 166, 0.35)" },
30
+ stormy: { core: "#5b6b86", glow: "rgba(91, 107, 134, 0.40)" },
31
+ overcast: { core: "#8d96a3", glow: "rgba(141, 150, 163, 0.40)" },
32
+ fine: { core: "#e0a955", glow: "rgba(224, 169, 85, 0.55)" },
33
+ sunny: { core: "#f4c64a", glow: "rgba(244, 198, 74, 0.70)" },
34
+ };
35
+ /**
36
+ * Resolve the climate colors for a band, defaulting to `quiet` for any unexpected value (fail-soft to
37
+ * the neutral "forming" look rather than throwing on malformed server data).
38
+ *
39
+ * @param band - The weather/warmth band to color.
40
+ * @returns The {@link BandColors} for that band.
41
+ */
42
+ function bandColors(band) {
43
+ return exports.bandPalette[band] ?? exports.bandPalette.quiet;
44
+ }
45
+ /**
46
+ * Map a dyadic `brightness` in `[0.15, 1.0]` to an RN visual treatment — shadow glow, elevation, scale,
47
+ * and the sprout flag. The brightness number itself is **never** returned for display; it is a rendering
48
+ * input only. The clamp floor and the `isSprout` threshold are identical to the web palette so the
49
+ * privacy semantics never diverge across platforms.
50
+ *
51
+ * @param brightness - Dyadic brightness in `[0.15, 1.0]` (values outside are clamped).
52
+ * @returns The {@link BrightnessTreatment} for that tie.
53
+ */
54
+ function brightnessTreatment(brightness) {
55
+ const b = Math.min(1, Math.max(0.15, brightness));
56
+ // Same curve as the web sibling: a linear glow within the meaningful range, with the floor band
57
+ // special-cased as the sprout state. Mapped onto RN shadow/elevation props instead of a box-shadow.
58
+ const shadowRadius = 6 + Math.round(b * 22); // ~9px at floor → 28px at full glow
59
+ const shadowOpacity = 0.25 + b * 0.55; // ~0.33 at floor → 0.8 at full glow
60
+ const elevation = 2 + Math.round(b * 10); // Android proxy: ~4 at floor → 12 at full glow
61
+ const scale = 0.94 + b * 0.12; // subtle: brighter ties read slightly larger
62
+ const isSprout = b <= 0.24;
63
+ return { shadowRadius, shadowOpacity, elevation, scale, isSprout };
64
+ }
65
+ //# sourceMappingURL=palette.js.map
@@ -0,0 +1 @@
1
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,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,+CAA+C;IACzF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,6CAA6C;IAC5E,MAAM,QAAQ,GAAG,CAAC,IAAI,IAAI,CAAC;IAC3B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACrE,CAAC"}
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ /** Props for {@link CommunityWeather}. */
3
+ export interface CommunityWeatherProps {
4
+ /** Optional style for the root chip (for host-app layout/spacing). */
5
+ style?: object;
6
+ }
7
+ /**
8
+ * Render the Community Weather as an ambient climate chip.
9
+ *
10
+ * Self-contained: reads {@link useSocialWeather} internally and gates on the feature config. Shows a
11
+ * band-tinted glowing orb plus a soft trend arrow when history is available. The warmth `value` is
12
+ * never displayed.
13
+ *
14
+ * @param props - {@link CommunityWeatherProps}.
15
+ * @returns The weather chip, or `null` when the lens is disabled or still loading.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <SocialProvider projectId={id} accessToken={token}>
20
+ * <CommunityWeather />
21
+ * </SocialProvider>
22
+ * ```
23
+ */
24
+ export declare function CommunityWeather({ style }: CommunityWeatherProps): React.ReactElement | null;
@@ -0,0 +1,89 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // <CommunityWeather /> — the Weather lens as an ambient climate indicator (React Native).
3
+ //
4
+ // Native port of the web component: the aggregate community warmth as a calm sky/climate chip
5
+ // (SOCIAL.md §5) — a band-tinted orb with a soft glow, a subtle trend cue (warming/cooling, never
6
+ // alarming text), and a "still forming" treatment for the `quiet` no-data sentinel. The raw `value`
7
+ // number is NEVER shown — warmth is communicated only as color/glow. Returns `null` when the lens is
8
+ // disabled or still loading, so a host can drop it in unconditionally and have it disappear when off.
9
+ //
10
+ // The orb's radial gradient is drawn with react-native-svg (the only cross-platform way to get a soft
11
+ // gradient orb in RN); the ambient glow is an RN View shadow/elevation around it.
12
+ import React from "react";
13
+ import { View, Text, StyleSheet } from "react-native";
14
+ import Svg, { Defs, RadialGradient, Stop, Circle } from "react-native-svg";
15
+ import { useSocialWeather } from "@agora-sdk/social-core";
16
+ import { bandColors } from "../palette.js";
17
+ /** Human-readable, non-alarming captions per band. `stormy` stays gentle by design (SOCIAL.md §5). */
18
+ const BAND_CAPTION = {
19
+ quiet: "Still forming",
20
+ stormy: "Could use more warmth",
21
+ overcast: "Settling in",
22
+ fine: "Warm",
23
+ sunny: "Glowing",
24
+ };
25
+ const ORB = 22;
26
+ /**
27
+ * Render the Community Weather as an ambient climate chip.
28
+ *
29
+ * Self-contained: reads {@link useSocialWeather} internally and gates on the feature config. Shows a
30
+ * band-tinted glowing orb plus a soft trend arrow when history is available. The warmth `value` is
31
+ * never displayed.
32
+ *
33
+ * @param props - {@link CommunityWeatherProps}.
34
+ * @returns The weather chip, or `null` when the lens is disabled or still loading.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * <SocialProvider projectId={id} accessToken={token}>
39
+ * <CommunityWeather />
40
+ * </SocialProvider>
41
+ * ```
42
+ */
43
+ export function CommunityWeather({ style }) {
44
+ const { weather } = useSocialWeather();
45
+ // react-native-svg references gradients by id; strip the colons React.useId emits so `url(#id)` is valid.
46
+ const gid = `cw-${React.useId().replace(/:/g, "")}`;
47
+ if (!weather)
48
+ return null;
49
+ const colors = bandColors(weather.band);
50
+ const caption = BAND_CAPTION[weather.band] ?? "Still forming";
51
+ const forming = weather.band === "quiet" || weather.value === null;
52
+ // Trend → a subtle directional cue, never alarming text. Tiny magnitudes are treated as steady.
53
+ const trendArrow = weather.trend === null || Math.abs(weather.trend) < 0.005
54
+ ? null
55
+ : weather.trend > 0
56
+ ? "↗"
57
+ : "↘";
58
+ return (_jsxs(View, { style: [styles.chip, style], accessibilityRole: "image", accessibilityLabel: `Community weather: ${caption.toLowerCase()}`, children: [_jsx(View, { style: [
59
+ styles.orbWrap,
60
+ {
61
+ shadowColor: colors.glow,
62
+ shadowRadius: forming ? 10 : 18,
63
+ elevation: forming ? 4 : 8,
64
+ opacity: forming ? 0.8 : 1,
65
+ },
66
+ ], children: _jsxs(Svg, { width: ORB, height: ORB, children: [_jsx(Defs, { children: _jsxs(RadialGradient, { id: gid, cx: "35%", cy: "30%", r: "70%", children: [_jsx(Stop, { offset: "0%", stopColor: colors.core, stopOpacity: 1 }), _jsx(Stop, { offset: "100%", stopColor: colors.core, stopOpacity: 0.2 })] }) }), _jsx(Circle, { cx: ORB / 2, cy: ORB / 2, r: ORB / 2, fill: `url(#${gid})` })] }) }), _jsx(Text, { style: [styles.caption, { color: colors.core }], children: caption }), trendArrow && (_jsx(Text, { style: [styles.trend, { color: colors.core }], accessibilityElementsHidden: true, children: trendArrow }))] }));
67
+ }
68
+ const styles = StyleSheet.create({
69
+ chip: {
70
+ flexDirection: "row",
71
+ alignItems: "center",
72
+ alignSelf: "flex-start",
73
+ gap: 10,
74
+ paddingVertical: 8,
75
+ paddingHorizontal: 14,
76
+ borderRadius: 999,
77
+ backgroundColor: "rgba(15, 15, 24, 0.04)",
78
+ },
79
+ // iOS shadow needs a non-transparent shadowOpacity; the color already carries its own alpha.
80
+ orbWrap: {
81
+ width: ORB,
82
+ height: ORB,
83
+ shadowOpacity: 1,
84
+ shadowOffset: { width: 0, height: 0 },
85
+ },
86
+ caption: { fontSize: 13, fontWeight: "600" },
87
+ trend: { fontSize: 13, opacity: 0.7 },
88
+ });
89
+ //# sourceMappingURL=CommunityWeather.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommunityWeather.js","sourceRoot":"","sources":["../../../src/components/CommunityWeather.tsx"],"names":[],"mappings":";AAAA,0FAA0F;AAC1F,EAAE;AACF,8FAA8F;AAC9F,kGAAkG;AAClG,oGAAoG;AACpG,qGAAqG;AACrG,sGAAsG;AACtG,EAAE;AACF,sGAAsG;AACtG,kFAAkF;AAElF,OA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C,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,YAAG,OAAO,GAAQ,EACtE,UAAU,IAAI,CACb,KAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,2BAA2B,kBAC7E,UAAU,GACN,CACR,IACI,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,YAAY;QACvB,GAAG,EAAE,EAAE;QACP,eAAe,EAAE,CAAC;QAClB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,GAAG;QACjB,eAAe,EAAE,wBAAwB;KAC1C;IACD,6FAA6F;IAC7F,OAAO,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,aAAa,EAAE,CAAC;QAChB,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;KACtC;IACD,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;IAC5C,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;CACtC,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ /** Props for {@link Constellation}. */
3
+ export interface ConstellationProps {
4
+ /** Canvas width in px. Defaults to 360. */
5
+ width?: number;
6
+ /** Canvas height in px. Defaults to 240. */
7
+ height?: number;
8
+ }
9
+ /**
10
+ * Render the Constellation as a randomized field of warm blobs.
11
+ *
12
+ * Self-contained: reads {@link useSocialConstellation} and gates on the feature config. Returns `null`
13
+ * when disabled, a nebula when the snapshot is still forming (`asOf === null`), and otherwise a
14
+ * re-randomized SVG blob field. Blobs are sized by bucket and tinted by warmth only.
15
+ *
16
+ * @param props - {@link ConstellationProps}.
17
+ * @returns The blob canvas, a nebula, or `null`.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * <Constellation width={420} height={280} />
22
+ * ```
23
+ */
24
+ export declare function Constellation({ width, height, }: ConstellationProps): React.ReactElement | null;
@@ -0,0 +1,61 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // <Constellation /> — the anonymous community "shape" as a field of warm, glowing blobs (React Native).
3
+ //
4
+ // Native port of the web component, drawn with react-native-svg. The privacy rules from SOCIAL.md §6
5
+ // are enforced structurally, identically to web:
6
+ // • No stable layout — positions are re-randomized on every mount / whenever the blob data changes
7
+ // (see `computePositions` in ../layout), so no cluster has a "home" a viewer could track.
8
+ // • Size by BUCKET, never an exact count — radius comes from a fixed bucket→px map.
9
+ // • Warmth-only tint — blobs use the same calm climate palette as Weather; friction never renders.
10
+ // • `asOf === null` is the valid "still forming" state — a wispy nebula, not an error or empty list.
11
+ //
12
+ // Each blob is an SVG <Circle> filled by a per-band radial gradient that fades to transparent at the
13
+ // edge, giving the soft "glow" look without an SVG blur filter (feGaussianBlur is not reliably
14
+ // supported on react-native-svg across platforms).
15
+ import React, { useEffect, useMemo, useState } from "react";
16
+ import Svg, { Defs, RadialGradient, Stop, Circle, Rect } from "react-native-svg";
17
+ import { useSocialConstellation } from "@agora-sdk/social-core";
18
+ import { bandColors } from "../palette.js";
19
+ import { computePositions } from "../layout.js";
20
+ /**
21
+ * Render the Constellation as a randomized field of warm blobs.
22
+ *
23
+ * Self-contained: reads {@link useSocialConstellation} and gates on the feature config. Returns `null`
24
+ * when disabled, a nebula when the snapshot is still forming (`asOf === null`), and otherwise a
25
+ * re-randomized SVG blob field. Blobs are sized by bucket and tinted by warmth only.
26
+ *
27
+ * @param props - {@link ConstellationProps}.
28
+ * @returns The blob canvas, a nebula, or `null`.
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * <Constellation width={420} height={280} />
33
+ * ```
34
+ */
35
+ export function Constellation({ width = 360, height = 240, }) {
36
+ const { constellation } = useSocialConstellation();
37
+ // react-native-svg references gradients by id; strip the colons React.useId emits so `url(#id)` is valid.
38
+ const gid = `cn-${React.useId().replace(/:/g, "")}`;
39
+ const blobs = constellation?.blobs ?? null;
40
+ // Positions live in state, seeded once per blob-set and re-seeded whenever the blobs change (or the
41
+ // canvas resizes). NOT recomputed on every render — only when the data/size actually changes — but
42
+ // also never a *stable* layout across mounts, since each fresh mount re-runs computePositions.
43
+ const [nodes, setNodes] = useState(() => blobs ? computePositions(blobs, width, height) : []);
44
+ useEffect(() => {
45
+ if (blobs)
46
+ setNodes(computePositions(blobs, width, height));
47
+ }, [blobs, width, height]);
48
+ // One gradient per band actually present — referenced by the circles below.
49
+ const bandsPresent = useMemo(() => Array.from(new Set((blobs ?? []).map((b) => b.warmth))), [blobs]);
50
+ if (!constellation)
51
+ return null;
52
+ // Still-forming: a gentle nebula, never an error or empty state.
53
+ if (constellation.asOf === null) {
54
+ return (_jsxs(Svg, { width: width, height: height, accessibilityRole: "image", accessibilityLabel: "Community constellation: still forming", children: [_jsx(Defs, { children: _jsxs(RadialGradient, { id: `${gid}-nebula`, cx: "50%", cy: "50%", r: "60%", children: [_jsx(Stop, { offset: "0%", stopColor: "#8a94a6", stopOpacity: 0.3 }), _jsx(Stop, { offset: "100%", stopColor: "#8a94a6", stopOpacity: 0 })] }) }), _jsx(Rect, { x: 0, y: 0, width: width, height: height, fill: `url(#${gid}-nebula)` })] }));
55
+ }
56
+ return (_jsxs(Svg, { width: width, height: height, accessibilityRole: "image", accessibilityLabel: "Community constellation", children: [_jsx(Defs, { children: bandsPresent.map((band) => {
57
+ const colors = bandColors(band);
58
+ return (_jsxs(RadialGradient, { id: `${gid}-${band}`, cx: "50%", cy: "50%", r: "50%", children: [_jsx(Stop, { offset: "0%", stopColor: colors.core, stopOpacity: 0.9 }), _jsx(Stop, { offset: "100%", stopColor: colors.core, stopOpacity: 0 })] }, band));
59
+ }) }), nodes.map((n, i) => (_jsx(Circle, { cx: n.x, cy: n.y, r: n.r, fill: `url(#${gid}-${n.warmth})` }, i)))] }));
60
+ }
61
+ //# sourceMappingURL=Constellation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Constellation.js","sourceRoot":"","sources":["../../../src/components/Constellation.tsx"],"names":[],"mappings":";AAAA,wGAAwG;AACxG,EAAE;AACF,qGAAqG;AACrG,iDAAiD;AACjD,qGAAqG;AACrG,8FAA8F;AAC9F,sFAAsF;AACtF,qGAAqG;AACrG,uGAAuG;AACvG,EAAE;AACF,qGAAqG;AACrG,+FAA+F;AAC/F,mDAAmD;AAEnD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,GAAG,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAiB,MAAM,cAAc,CAAC;AAU/D;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,KAAK,GAAG,GAAG,EACX,MAAM,GAAG,GAAG,GACO;IACnB,MAAM,EAAE,aAAa,EAAE,GAAG,sBAAsB,EAAE,CAAC;IACnD,0GAA0G;IAC1G,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;IAEpD,MAAM,KAAK,GAAG,aAAa,EAAE,KAAK,IAAI,IAAI,CAAC;IAE3C,oGAAoG;IACpG,mGAAmG;IACnG,+FAA+F;IAC/F,MAAM,CAAC,KAAK,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Props for {@link Neighborhood}. */
3
+ export interface NeighborhoodProps {
4
+ /** Render the "include interactions" toggle (wires to the hook's setter). Defaults to `false`. */
5
+ showInteractionsToggle?: boolean;
6
+ /** Optional style for the root element. */
7
+ style?: object;
8
+ }
9
+ /**
10
+ * Render the caller's Neighborhood — their named ties, lit by dyadic brightness.
11
+ *
12
+ * Self-contained: reads {@link useSocialNeighborhood} and gates on the feature config. Ties render in
13
+ * the server's brightest-first order; brightness becomes glow/scale, never a number. Optionally shows
14
+ * the interactions toggle.
15
+ *
16
+ * @param props - {@link NeighborhoodProps}.
17
+ * @returns The tie list, or `null` when the lens is disabled or still loading.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * <Neighborhood showInteractionsToggle />
22
+ * ```
23
+ */
24
+ export declare function Neighborhood({ showInteractionsToggle, style, }: NeighborhoodProps): React.ReactElement | null;