@streamplace/components 0.7.13 → 0.7.15

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 (122) hide show
  1. package/package.json +13 -16
  2. package/src/components/mobile-player/fullscreen.native.tsx +15 -20
  3. package/src/components/mobile-player/fullscreen.tsx +10 -2
  4. package/src/components/mobile-player/player.tsx +7 -1
  5. package/src/components/mobile-player/props.tsx +2 -0
  6. package/src/components/mobile-player/video.native.tsx +28 -11
  7. package/src/components/mobile-player/video.tsx +14 -3
  8. package/src/hooks/useLivestreamInfo.ts +6 -2
  9. package/src/lib/browser.ts +27 -0
  10. package/src/livestream-store/stream-key.tsx +1 -28
  11. package/src/streamplace-store/stream.tsx +51 -13
  12. package/dist/assets/emoji-data.json +0 -19371
  13. package/dist/components/chat/chat-box.js +0 -314
  14. package/dist/components/chat/chat-message.js +0 -87
  15. package/dist/components/chat/chat.js +0 -149
  16. package/dist/components/chat/emoji-suggestions.js +0 -35
  17. package/dist/components/chat/mention-suggestions.js +0 -42
  18. package/dist/components/chat/mod-view.js +0 -94
  19. package/dist/components/chat/system-message.js +0 -19
  20. package/dist/components/dashboard/chat-panel.js +0 -38
  21. package/dist/components/dashboard/header.js +0 -80
  22. package/dist/components/dashboard/index.js +0 -14
  23. package/dist/components/dashboard/information-widget.js +0 -234
  24. package/dist/components/dashboard/mod-actions.js +0 -71
  25. package/dist/components/dashboard/problems.js +0 -74
  26. package/dist/components/icons/bluesky-icon.js +0 -9
  27. package/dist/components/keep-awake.js +0 -7
  28. package/dist/components/keep-awake.native.js +0 -16
  29. package/dist/components/mobile-player/fullscreen.js +0 -74
  30. package/dist/components/mobile-player/fullscreen.native.js +0 -155
  31. package/dist/components/mobile-player/player.js +0 -94
  32. package/dist/components/mobile-player/props.js +0 -2
  33. package/dist/components/mobile-player/shared.js +0 -54
  34. package/dist/components/mobile-player/ui/countdown.js +0 -83
  35. package/dist/components/mobile-player/ui/index.js +0 -11
  36. package/dist/components/mobile-player/ui/input.js +0 -42
  37. package/dist/components/mobile-player/ui/metrics.js +0 -44
  38. package/dist/components/mobile-player/ui/report-modal.js +0 -90
  39. package/dist/components/mobile-player/ui/streamer-context-menu.js +0 -7
  40. package/dist/components/mobile-player/ui/streamer-loading-overlay.js +0 -104
  41. package/dist/components/mobile-player/ui/viewer-context-menu.js +0 -51
  42. package/dist/components/mobile-player/ui/viewer-loading-overlay.js +0 -49
  43. package/dist/components/mobile-player/ui/viewers.js +0 -23
  44. package/dist/components/mobile-player/use-webrtc.js +0 -243
  45. package/dist/components/mobile-player/video-retry.js +0 -29
  46. package/dist/components/mobile-player/video.js +0 -460
  47. package/dist/components/mobile-player/video.native.js +0 -276
  48. package/dist/components/mobile-player/webrtc-diagnostics.js +0 -110
  49. package/dist/components/mobile-player/webrtc-primitives.js +0 -27
  50. package/dist/components/mobile-player/webrtc-primitives.native.js +0 -8
  51. package/dist/components/share/sharesheet.js +0 -91
  52. package/dist/components/ui/button.js +0 -223
  53. package/dist/components/ui/dialog.js +0 -206
  54. package/dist/components/ui/dropdown.js +0 -172
  55. package/dist/components/ui/icons.js +0 -25
  56. package/dist/components/ui/index.js +0 -34
  57. package/dist/components/ui/info-box.js +0 -31
  58. package/dist/components/ui/info-row.js +0 -23
  59. package/dist/components/ui/input.js +0 -205
  60. package/dist/components/ui/loader.js +0 -10
  61. package/dist/components/ui/primitives/button.js +0 -125
  62. package/dist/components/ui/primitives/input.js +0 -206
  63. package/dist/components/ui/primitives/modal.js +0 -206
  64. package/dist/components/ui/primitives/text.js +0 -292
  65. package/dist/components/ui/resizeable.js +0 -121
  66. package/dist/components/ui/slider.js +0 -5
  67. package/dist/components/ui/text.js +0 -177
  68. package/dist/components/ui/textarea.js +0 -19
  69. package/dist/components/ui/toast.js +0 -175
  70. package/dist/components/ui/view.js +0 -252
  71. package/dist/hooks/index.js +0 -14
  72. package/dist/hooks/useAvatars.js +0 -35
  73. package/dist/hooks/useCameraToggle.js +0 -12
  74. package/dist/hooks/useKeyboard.js +0 -36
  75. package/dist/hooks/useKeyboardSlide.js +0 -14
  76. package/dist/hooks/useLivestreamInfo.js +0 -65
  77. package/dist/hooks/useOuterAndInnerDimensions.js +0 -30
  78. package/dist/hooks/usePlayerDimensions.js +0 -22
  79. package/dist/hooks/usePointerDevice.js +0 -71
  80. package/dist/hooks/useSegmentDimensions.js +0 -17
  81. package/dist/hooks/useSegmentTiming.js +0 -65
  82. package/dist/index.js +0 -34
  83. package/dist/lib/facet.js +0 -92
  84. package/dist/lib/system-messages.js +0 -101
  85. package/dist/lib/theme/atoms.js +0 -646
  86. package/dist/lib/theme/atoms.types.js +0 -6
  87. package/dist/lib/theme/index.js +0 -35
  88. package/dist/lib/theme/theme.js +0 -256
  89. package/dist/lib/theme/tokens.js +0 -659
  90. package/dist/lib/utils.js +0 -105
  91. package/dist/livestream-provider/index.js +0 -30
  92. package/dist/livestream-provider/websocket.js +0 -45
  93. package/dist/livestream-store/chat.js +0 -286
  94. package/dist/livestream-store/context.js +0 -5
  95. package/dist/livestream-store/index.js +0 -7
  96. package/dist/livestream-store/livestream-state.js +0 -2
  97. package/dist/livestream-store/livestream-store.js +0 -58
  98. package/dist/livestream-store/problems.js +0 -76
  99. package/dist/livestream-store/stream-key.js +0 -119
  100. package/dist/livestream-store/websocket-consumer.js +0 -94
  101. package/dist/player-store/context.js +0 -5
  102. package/dist/player-store/index.js +0 -9
  103. package/dist/player-store/player-provider.js +0 -57
  104. package/dist/player-store/player-state.js +0 -25
  105. package/dist/player-store/player-store.js +0 -199
  106. package/dist/player-store/single-player-provider.js +0 -121
  107. package/dist/streamplace-provider/context.js +0 -5
  108. package/dist/streamplace-provider/index.js +0 -20
  109. package/dist/streamplace-provider/poller.js +0 -49
  110. package/dist/streamplace-provider/xrpc.js +0 -0
  111. package/dist/streamplace-store/block.js +0 -65
  112. package/dist/streamplace-store/index.js +0 -6
  113. package/dist/streamplace-store/stream.js +0 -218
  114. package/dist/streamplace-store/streamplace-store.js +0 -47
  115. package/dist/streamplace-store/user.js +0 -52
  116. package/dist/streamplace-store/xrpc.js +0 -15
  117. package/dist/ui/index.js +0 -79
  118. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/37be0eec +0 -0
  119. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/56540125 +0 -0
  120. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/67b1eb60 +0 -0
  121. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/7c275f90 +0 -0
  122. package/tsconfig.tsbuildinfo +0 -1
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = Poller;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const streamplace_1 = require("streamplace");
7
- const streamplace_store_1 = require("../streamplace-store");
8
- const xrpc_1 = require("../streamplace-store/xrpc");
9
- function Poller({ children }) {
10
- const url = (0, streamplace_store_1.useStreamplaceStore)((state) => state.url);
11
- const setLiveUsers = (0, streamplace_store_1.useStreamplaceStore)((state) => state.setLiveUsers);
12
- const did = (0, streamplace_store_1.useDID)();
13
- const pdsAgent = (0, xrpc_1.usePDSAgent)();
14
- const getChatProfile = (0, streamplace_store_1.useGetChatProfile)();
15
- const getBskyProfile = (0, streamplace_store_1.useGetBskyProfile)();
16
- const liveUserRefresh = (0, streamplace_store_1.useStreamplaceStore)((state) => state.liveUsersRefresh);
17
- (0, react_1.useEffect)(() => {
18
- if (pdsAgent && did) {
19
- getChatProfile();
20
- getBskyProfile();
21
- }
22
- }, [pdsAgent, did]);
23
- (0, react_1.useEffect)(() => {
24
- const agent = new streamplace_1.StreamplaceAgent(url);
25
- const go = async () => {
26
- setLiveUsers({
27
- liveUsersLoading: true,
28
- });
29
- try {
30
- const res = await agent.place.stream.live.getLiveUsers();
31
- setLiveUsers({
32
- liveUsers: res.data.streams || [],
33
- liveUsersLoading: false,
34
- liveUsersError: null,
35
- });
36
- }
37
- catch (e) {
38
- setLiveUsers({
39
- liveUsersLoading: false,
40
- liveUsersError: e.message,
41
- });
42
- }
43
- };
44
- go();
45
- const handle = setInterval(go, 3000);
46
- return () => clearInterval(handle);
47
- }, [url, liveUserRefresh]);
48
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
49
- }
File without changes
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCreateBlockRecord = useCreateBlockRecord;
4
- exports.useCreateHideChatRecord = useCreateHideChatRecord;
5
- const react_1 = require("react");
6
- const xrpc_1 = require("./xrpc");
7
- function useCreateBlockRecord() {
8
- let agent = (0, xrpc_1.usePDSAgent)();
9
- const [isLoading, setIsLoading] = (0, react_1.useState)(false);
10
- const createBlock = async (subjectDID) => {
11
- if (!agent) {
12
- throw new Error("No PDS agent found");
13
- }
14
- if (!agent.did) {
15
- throw new Error("No user DID found, assuming not logged in");
16
- }
17
- setIsLoading(true);
18
- try {
19
- const record = {
20
- $type: "app.bsky.graph.block",
21
- subject: subjectDID,
22
- createdAt: new Date().toISOString(),
23
- };
24
- const result = await agent.com.atproto.repo.createRecord({
25
- repo: agent.did,
26
- collection: "app.bsky.graph.block",
27
- record,
28
- });
29
- return result;
30
- }
31
- finally {
32
- setIsLoading(false);
33
- }
34
- };
35
- return { createBlock, isLoading };
36
- }
37
- function useCreateHideChatRecord() {
38
- let agent = (0, xrpc_1.usePDSAgent)();
39
- const [isLoading, setIsLoading] = (0, react_1.useState)(false);
40
- const createHideChat = async (chatMessageUri) => {
41
- if (!agent) {
42
- throw new Error("No PDS agent found");
43
- }
44
- if (!agent.did) {
45
- throw new Error("No user DID found, assuming not logged in");
46
- }
47
- setIsLoading(true);
48
- try {
49
- const record = {
50
- $type: "place.stream.chat.gate",
51
- hiddenMessage: chatMessageUri,
52
- };
53
- const result = await agent.com.atproto.repo.createRecord({
54
- repo: agent.did,
55
- collection: "place.stream.chat.gate",
56
- record,
57
- });
58
- return result;
59
- }
60
- finally {
61
- setIsLoading(false);
62
- }
63
- };
64
- return { createHideChat, isLoading };
65
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./stream"), exports);
5
- tslib_1.__exportStar(require("./streamplace-store"), exports);
6
- tslib_1.__exportStar(require("./user"), exports);
@@ -1,218 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCreateStreamRecord = useCreateStreamRecord;
4
- exports.useUpdateStreamRecord = useUpdateStreamRecord;
5
- const api_1 = require("@atproto/api");
6
- const streamplace_store_1 = require("./streamplace-store");
7
- const xrpc_1 = require("./xrpc");
8
- const react_1 = require("react");
9
- const useUploadThumbnail = () => {
10
- const abortRef = (0, react_1.useRef)(null);
11
- (0, react_1.useEffect)(() => {
12
- return () => {
13
- // On unmount, abort any ongoing upload
14
- abortRef.current?.abort();
15
- };
16
- }, []);
17
- const uploadThumbnail = async (pdsAgent, customThumbnail) => {
18
- if (!customThumbnail)
19
- return undefined;
20
- abortRef.current = new AbortController();
21
- const { signal } = abortRef.current;
22
- const maxTries = 3;
23
- let lastError = null;
24
- for (let tries = 0; tries < maxTries; tries++) {
25
- try {
26
- const thumbnail = await pdsAgent.uploadBlob(customThumbnail, {
27
- signal,
28
- });
29
- if (thumbnail.success &&
30
- thumbnail.data.blob.size === customThumbnail.size) {
31
- console.log("Successfully uploaded thumbnail");
32
- return thumbnail.data.blob;
33
- }
34
- else {
35
- console.warn(`Blob size mismatch (attempt ${tries + 1}): received ${thumbnail.data.blob.size}, expected ${customThumbnail.size}`);
36
- }
37
- }
38
- catch (e) {
39
- if (signal.aborted) {
40
- console.warn("Upload aborted");
41
- return undefined;
42
- }
43
- lastError = e;
44
- console.warn(`Error uploading thumbnail (attempt ${tries + 1}): ${e}`);
45
- }
46
- }
47
- throw new Error(`Could not successfully upload blob after ${maxTries} attempts. Last error: ${lastError}`);
48
- };
49
- return uploadThumbnail;
50
- };
51
- async function createNewPost(agent, record) {
52
- try {
53
- const post = await agent.post(record);
54
- return { uri: post.uri, cid: post.cid };
55
- }
56
- catch (error) {
57
- console.error("Error creating new post:", error);
58
- throw error;
59
- }
60
- }
61
- async function buildGoLivePost(text, url, profile, params, thumbnail, agent) {
62
- const now = new Date();
63
- const linkUrl = `${url.protocol}//${url.host}/${profile.handle}?${params.toString()}`;
64
- const prefix = `🔴 LIVE `;
65
- const textUrl = `${url.protocol}//${url.host}/${profile.handle}`;
66
- const suffix = ` ${text}`;
67
- const content = prefix + textUrl + suffix;
68
- const rt = new api_1.RichText({ text: content });
69
- await rt.detectFacets(agent);
70
- const record = {
71
- $type: "app.bsky.feed.post",
72
- text: content,
73
- "place.stream.livestream": {
74
- url: linkUrl,
75
- title: text,
76
- },
77
- facets: rt.facets,
78
- createdAt: now.toISOString(),
79
- };
80
- record.embed = {
81
- $type: "app.bsky.embed.external",
82
- external: {
83
- description: text,
84
- thumb: thumbnail,
85
- title: `@${profile.handle} is 🔴LIVE on ${url.host}!`,
86
- uri: linkUrl,
87
- },
88
- };
89
- return record;
90
- }
91
- function useCreateStreamRecord() {
92
- let agent = (0, xrpc_1.usePDSAgent)();
93
- let url = (0, streamplace_store_1.useUrl)();
94
- const uploadThumbnail = useUploadThumbnail();
95
- return async (title, customThumbnail, submitPost = true) => {
96
- if (!agent) {
97
- throw new Error("No PDS agent found");
98
- }
99
- if (!agent.did) {
100
- throw new Error("No user DID found, assuming not logged in");
101
- }
102
- let thumbnail = undefined;
103
- const u = new URL(url);
104
- if (customThumbnail) {
105
- try {
106
- thumbnail = await uploadThumbnail(agent, customThumbnail);
107
- }
108
- catch (e) {
109
- throw new Error(`Custom thumbnail upload failed ${e}`);
110
- }
111
- }
112
- else {
113
- // No custom thumbnail: fetch the server-side image and upload it
114
- // try thrice lel
115
- let tries = 0;
116
- try {
117
- for (; tries < 3; tries++) {
118
- try {
119
- console.log(`Fetching thumbnail from ${u.protocol}//${u.host}/api/playback/${agent.did}/stream.png`);
120
- const thumbnailRes = await fetch(`${u.protocol}//${u.host}/api/playback/${agent.did}/stream.png`);
121
- if (!thumbnailRes.ok) {
122
- throw new Error(`Failed to fetch thumbnail: ${thumbnailRes.status})`);
123
- }
124
- const thumbnailBlob = await thumbnailRes.blob();
125
- console.log(thumbnailBlob);
126
- thumbnail = await uploadThumbnail(agent, thumbnailBlob);
127
- }
128
- catch (e) {
129
- console.warn(`Failed to fetch thumbnail, retrying (${tries + 1}/3): ${e}`);
130
- // Wait 1 second before retrying
131
- await new Promise((resolve) => setTimeout(resolve, 2000));
132
- if (tries === 2) {
133
- throw new Error(`Failed to fetch thumbnail after 3 tries: ${e}`);
134
- }
135
- }
136
- }
137
- }
138
- catch (e) {
139
- throw new Error(`Thumbnail upload failed ${e}`);
140
- }
141
- }
142
- let newPost = undefined;
143
- if (submitPost) {
144
- const did = agent.did;
145
- const profile = await agent.getProfile({ actor: did });
146
- if (!profile) {
147
- throw new Error("No profile found for the user DID");
148
- }
149
- const params = new URLSearchParams({
150
- did: did,
151
- time: new Date().toISOString(),
152
- });
153
- let post = await buildGoLivePost(title, u, profile.data, params, thumbnail, agent);
154
- newPost = await createNewPost(agent, post);
155
- if (!newPost.uri || !newPost.cid) {
156
- throw new Error("Cannot read properties of undefined (reading 'uri' or 'cid')");
157
- }
158
- }
159
- const record = {
160
- title: title,
161
- url: url,
162
- createdAt: new Date().toISOString(),
163
- post: newPost,
164
- thumb: thumbnail,
165
- };
166
- await agent.com.atproto.repo.createRecord({
167
- repo: agent.did,
168
- collection: "place.stream.livestream",
169
- record,
170
- });
171
- return record;
172
- };
173
- }
174
- function useUpdateStreamRecord() {
175
- let agent = (0, xrpc_1.usePDSAgent)();
176
- let url = (0, streamplace_store_1.useUrl)();
177
- const uploadThumbnail = useUploadThumbnail();
178
- return async (title, livestream, customThumbnail) => {
179
- if (!agent) {
180
- throw new Error("No PDS agent found");
181
- }
182
- if (!agent.did) {
183
- throw new Error("No user DID found, assuming not logged in");
184
- }
185
- if (!livestream) {
186
- throw new Error("No latest record");
187
- }
188
- let rkey = livestream.uri.split("/").pop();
189
- let oldRecordValue = livestream.record;
190
- if (!rkey) {
191
- throw new Error("No rkey?");
192
- }
193
- let thumbnail = oldRecordValue.thumb;
194
- // update thumbnail if a new one is provided
195
- if (customThumbnail) {
196
- try {
197
- thumbnail = await uploadThumbnail(agent, customThumbnail);
198
- }
199
- catch (e) {
200
- throw new Error(`Custom thumbnail upload failed ${e}`);
201
- }
202
- }
203
- const record = {
204
- title: title,
205
- url: url,
206
- createdAt: new Date().toISOString(),
207
- post: oldRecordValue.post,
208
- thumb: thumbnail,
209
- };
210
- await agent.com.atproto.repo.putRecord({
211
- repo: agent.did,
212
- collection: "place.stream.livestream",
213
- rkey,
214
- record,
215
- });
216
- return record;
217
- };
218
- }
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useSetHandle = exports.useHandle = exports.useDID = exports.useUrl = exports.makeStreamplaceStore = void 0;
4
- exports.getStreamplaceStoreFromContext = getStreamplaceStoreFromContext;
5
- exports.useStreamplaceStore = useStreamplaceStore;
6
- const react_1 = require("react");
7
- const zustand_1 = require("zustand");
8
- const context_1 = require("../streamplace-provider/context");
9
- const makeStreamplaceStore = ({ url, }) => {
10
- return (0, zustand_1.createStore)()((set) => ({
11
- url,
12
- liveUsers: null,
13
- setLiveUsers: (opts) => {
14
- set({
15
- ...opts,
16
- });
17
- },
18
- liveUsersRefresh: 0,
19
- liveUsersLoading: true,
20
- liveUsersError: null,
21
- oauthSession: null,
22
- handle: null,
23
- chatProfile: null,
24
- }));
25
- };
26
- exports.makeStreamplaceStore = makeStreamplaceStore;
27
- function getStreamplaceStoreFromContext() {
28
- const context = (0, react_1.useContext)(context_1.StreamplaceContext);
29
- if (!context) {
30
- throw new Error("useStreamplaceStore must be used within a StreamplaceProvider");
31
- }
32
- return context.store;
33
- }
34
- function useStreamplaceStore(selector) {
35
- return (0, zustand_1.useStore)(getStreamplaceStoreFromContext(), selector);
36
- }
37
- const useUrl = () => useStreamplaceStore((x) => x.url);
38
- exports.useUrl = useUrl;
39
- const useDID = () => useStreamplaceStore((x) => x.oauthSession?.did);
40
- exports.useDID = useDID;
41
- const useHandle = () => useStreamplaceStore((x) => x.handle);
42
- exports.useHandle = useHandle;
43
- const useSetHandle = () => {
44
- const store = getStreamplaceStoreFromContext();
45
- return (handle) => store.setState({ handle });
46
- };
47
- exports.useSetHandle = useSetHandle;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useGetChatProfile = useGetChatProfile;
4
- exports.useGetBskyProfile = useGetBskyProfile;
5
- exports.useChatProfile = useChatProfile;
6
- const streamplace_1 = require("streamplace");
7
- const streamplace_store_1 = require("./streamplace-store");
8
- const xrpc_1 = require("./xrpc");
9
- function useGetChatProfile() {
10
- const did = (0, streamplace_store_1.useDID)();
11
- const pdsAgent = (0, xrpc_1.usePDSAgent)();
12
- const store = (0, streamplace_store_1.getStreamplaceStoreFromContext)();
13
- return async () => {
14
- if (!did || !pdsAgent) {
15
- throw new Error("No DID or PDS agent");
16
- }
17
- const res = await pdsAgent.com.atproto.repo.getRecord({
18
- repo: did,
19
- collection: "place.stream.chat.profile",
20
- rkey: "self",
21
- });
22
- if (!res.success) {
23
- throw new Error("Failed to get chat profile record");
24
- }
25
- if (streamplace_1.PlaceStreamChatProfile.isRecord(res.data.value)) {
26
- store.setState({ chatProfile: res.data.value });
27
- }
28
- else {
29
- console.log("not a record", res.data.value);
30
- }
31
- };
32
- }
33
- function useGetBskyProfile() {
34
- const did = (0, streamplace_store_1.useDID)();
35
- const pdsAgent = (0, xrpc_1.usePDSAgent)();
36
- const store = (0, streamplace_store_1.getStreamplaceStoreFromContext)();
37
- return async () => {
38
- if (!did || !pdsAgent) {
39
- throw new Error("No DID or PDS agent");
40
- }
41
- const res = await pdsAgent.app.bsky.actor.getProfile({
42
- actor: did,
43
- });
44
- if (!res.success) {
45
- throw new Error("Failed to get chat profile record");
46
- }
47
- store.setState({ handle: res.data.handle });
48
- };
49
- }
50
- function useChatProfile() {
51
- return (0, streamplace_store_1.useStreamplaceStore)((x) => x.chatProfile);
52
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.usePDSAgent = usePDSAgent;
4
- const react_1 = require("react");
5
- const streamplace_1 = require("streamplace");
6
- const _1 = require(".");
7
- function usePDSAgent() {
8
- const oauthSession = (0, _1.useStreamplaceStore)((state) => state.oauthSession);
9
- return (0, react_1.useMemo)(() => {
10
- if (!oauthSession) {
11
- return null;
12
- }
13
- return new streamplace_1.StreamplaceAgent(oauthSession);
14
- }, [oauthSession]);
15
- }
package/dist/ui/index.js DELETED
@@ -1,79 +0,0 @@
1
- "use strict";
2
- /**
3
- * @streamplace/components/ui - Streamplace ZeroCSS
4
- *
5
- * Clean export path for ZeroCSS styling utilities, design tokens, and atomic styles.
6
- * ZeroCSS provides a zero-config, atomic styling system optimized for React Native.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.atomsNS = exports.theme = exports.useTheme = exports.usePlatformTypography = exports.lightTheme = exports.darkTheme = exports.createThemedStyles = exports.createThemeStyles = exports.createThemeIcons = exports.createThemeColors = exports.ThemeProvider = exports.responsiveValue = exports.platformStyle = exports.mergeStyles = exports.debounce = exports.typography = exports.spacing = exports.shadows = exports.colors = exports.breakpoints = exports.borderRadius = exports.w = exports.top = exports.text = exports.right = exports.r = exports.py = exports.px = exports.pt = exports.pr = exports.position = exports.pl = exports.pb = exports.p = exports.my = exports.mx = exports.mt = exports.mr = exports.ml = exports.mb = exports.m = exports.left = exports.layout = exports.h = exports.gap = exports.flex = exports.bottom = exports.borders = exports.bg = exports.atoms = void 0;
10
- exports.utils = exports.tokens = void 0;
11
- const tslib_1 = require("tslib");
12
- // Export the most commonly used ZeroCSS utilities
13
- var atoms_1 = require("../lib/theme/atoms");
14
- // Core atoms object
15
- Object.defineProperty(exports, "atoms", { enumerable: true, get: function () { return atoms_1.atoms; } });
16
- // Common shorthand utilities
17
- Object.defineProperty(exports, "bg", { enumerable: true, get: function () { return atoms_1.bg; } });
18
- // Border utilities
19
- Object.defineProperty(exports, "borders", { enumerable: true, get: function () { return atoms_1.borders; } });
20
- Object.defineProperty(exports, "bottom", { enumerable: true, get: function () { return atoms_1.bottom; } });
21
- // Flex utilities
22
- Object.defineProperty(exports, "flex", { enumerable: true, get: function () { return atoms_1.flex; } });
23
- // Gap utilities (React Native 0.71+)
24
- Object.defineProperty(exports, "gap", { enumerable: true, get: function () { return atoms_1.gap; } });
25
- Object.defineProperty(exports, "h", { enumerable: true, get: function () { return atoms_1.h; } });
26
- // Layout utilities
27
- Object.defineProperty(exports, "layout", { enumerable: true, get: function () { return atoms_1.layout; } });
28
- Object.defineProperty(exports, "left", { enumerable: true, get: function () { return atoms_1.left; } });
29
- Object.defineProperty(exports, "m", { enumerable: true, get: function () { return atoms_1.m; } });
30
- Object.defineProperty(exports, "mb", { enumerable: true, get: function () { return atoms_1.mb; } });
31
- Object.defineProperty(exports, "ml", { enumerable: true, get: function () { return atoms_1.ml; } });
32
- Object.defineProperty(exports, "mr", { enumerable: true, get: function () { return atoms_1.mr; } });
33
- Object.defineProperty(exports, "mt", { enumerable: true, get: function () { return atoms_1.mt; } });
34
- Object.defineProperty(exports, "mx", { enumerable: true, get: function () { return atoms_1.mx; } });
35
- Object.defineProperty(exports, "my", { enumerable: true, get: function () { return atoms_1.my; } });
36
- Object.defineProperty(exports, "p", { enumerable: true, get: function () { return atoms_1.p; } });
37
- Object.defineProperty(exports, "pb", { enumerable: true, get: function () { return atoms_1.pb; } });
38
- Object.defineProperty(exports, "pl", { enumerable: true, get: function () { return atoms_1.pl; } });
39
- // Position utilities
40
- Object.defineProperty(exports, "position", { enumerable: true, get: function () { return atoms_1.position; } });
41
- Object.defineProperty(exports, "pr", { enumerable: true, get: function () { return atoms_1.pr; } });
42
- Object.defineProperty(exports, "pt", { enumerable: true, get: function () { return atoms_1.pt; } });
43
- Object.defineProperty(exports, "px", { enumerable: true, get: function () { return atoms_1.px; } });
44
- Object.defineProperty(exports, "py", { enumerable: true, get: function () { return atoms_1.py; } });
45
- Object.defineProperty(exports, "r", { enumerable: true, get: function () { return atoms_1.r; } });
46
- Object.defineProperty(exports, "right", { enumerable: true, get: function () { return atoms_1.right; } });
47
- Object.defineProperty(exports, "text", { enumerable: true, get: function () { return atoms_1.text; } });
48
- Object.defineProperty(exports, "top", { enumerable: true, get: function () { return atoms_1.top; } });
49
- Object.defineProperty(exports, "w", { enumerable: true, get: function () { return atoms_1.w; } });
50
- // Export ZeroCSS design tokens
51
- var tokens_1 = require("../lib/theme/tokens");
52
- Object.defineProperty(exports, "borderRadius", { enumerable: true, get: function () { return tokens_1.borderRadius; } });
53
- Object.defineProperty(exports, "breakpoints", { enumerable: true, get: function () { return tokens_1.breakpoints; } });
54
- Object.defineProperty(exports, "colors", { enumerable: true, get: function () { return tokens_1.colors; } });
55
- Object.defineProperty(exports, "shadows", { enumerable: true, get: function () { return tokens_1.shadows; } });
56
- Object.defineProperty(exports, "spacing", { enumerable: true, get: function () { return tokens_1.spacing; } });
57
- Object.defineProperty(exports, "typography", { enumerable: true, get: function () { return tokens_1.typography; } });
58
- // Export ZeroCSS utility functions
59
- var utils_1 = require("../lib/utils");
60
- Object.defineProperty(exports, "debounce", { enumerable: true, get: function () { return utils_1.debounce; } });
61
- Object.defineProperty(exports, "mergeStyles", { enumerable: true, get: function () { return utils_1.mergeStyles; } });
62
- Object.defineProperty(exports, "platformStyle", { enumerable: true, get: function () { return utils_1.platformStyle; } });
63
- Object.defineProperty(exports, "responsiveValue", { enumerable: true, get: function () { return utils_1.responsiveValue; } });
64
- // Export ZeroCSS theme system
65
- var theme_1 = require("../lib/theme/theme");
66
- Object.defineProperty(exports, "ThemeProvider", { enumerable: true, get: function () { return theme_1.ThemeProvider; } });
67
- Object.defineProperty(exports, "createThemeColors", { enumerable: true, get: function () { return theme_1.createThemeColors; } });
68
- Object.defineProperty(exports, "createThemeIcons", { enumerable: true, get: function () { return theme_1.createThemeIcons; } });
69
- Object.defineProperty(exports, "createThemeStyles", { enumerable: true, get: function () { return theme_1.createThemeStyles; } });
70
- Object.defineProperty(exports, "createThemedStyles", { enumerable: true, get: function () { return theme_1.createThemedStyles; } });
71
- Object.defineProperty(exports, "darkTheme", { enumerable: true, get: function () { return theme_1.darkTheme; } });
72
- Object.defineProperty(exports, "lightTheme", { enumerable: true, get: function () { return theme_1.lightTheme; } });
73
- Object.defineProperty(exports, "usePlatformTypography", { enumerable: true, get: function () { return theme_1.usePlatformTypography; } });
74
- Object.defineProperty(exports, "useTheme", { enumerable: true, get: function () { return theme_1.useTheme; } });
75
- // Namespace exports for power users
76
- exports.theme = tslib_1.__importStar(require("../lib/theme"));
77
- exports.atomsNS = tslib_1.__importStar(require("../lib/theme/atoms"));
78
- exports.tokens = tslib_1.__importStar(require("../lib/theme/tokens"));
79
- exports.utils = tslib_1.__importStar(require("../lib/utils"));