@streamplace/components 0.8.5 → 0.8.6
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/dist/components/ui/index.js +2 -0
- package/dist/hooks/useLivestreamInfo.js +1 -1
- package/dist/streamplace-store/stream.js +11 -9
- package/node-compile-cache/v22.15.0-x64-efe9a9df-0/37be0eec +0 -0
- package/package.json +2 -2
- package/src/components/ui/index.ts +2 -0
- package/src/hooks/useLivestreamInfo.ts +1 -1
- package/src/streamplace-store/stream.tsx +16 -10
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -9,6 +9,7 @@ tslib_1.__exportStar(require("./primitives/modal"), exports);
|
|
|
9
9
|
tslib_1.__exportStar(require("./primitives/text"), exports);
|
|
10
10
|
// Export styled components
|
|
11
11
|
tslib_1.__exportStar(require("./button"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./checkbox"), exports);
|
|
12
13
|
tslib_1.__exportStar(require("./dialog"), exports);
|
|
13
14
|
tslib_1.__exportStar(require("./dropdown"), exports);
|
|
14
15
|
tslib_1.__exportStar(require("./icons"), exports);
|
|
@@ -21,6 +22,7 @@ tslib_1.__exportStar(require("./slider"), exports);
|
|
|
21
22
|
tslib_1.__exportStar(require("./text"), exports);
|
|
22
23
|
tslib_1.__exportStar(require("./textarea"), exports);
|
|
23
24
|
tslib_1.__exportStar(require("./toast"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./tooltip"), exports);
|
|
24
26
|
tslib_1.__exportStar(require("./view"), exports);
|
|
25
27
|
// Component collections for easy importing
|
|
26
28
|
var button_1 = require("./primitives/button");
|
|
@@ -96,21 +96,16 @@ function useCreateStreamRecord() {
|
|
|
96
96
|
let agent = (0, xrpc_1.usePDSAgent)();
|
|
97
97
|
let url = (0, streamplace_store_1.useUrl)();
|
|
98
98
|
const uploadThumbnail = useUploadThumbnail();
|
|
99
|
-
return async ({ title, customThumbnail, submitPost,
|
|
100
|
-
if (
|
|
99
|
+
return async ({ title, customThumbnail, submitPost, canonicalUrl, notificationSettings, }) => {
|
|
100
|
+
if (typeof submitPost !== "boolean") {
|
|
101
101
|
submitPost = true;
|
|
102
102
|
}
|
|
103
|
-
if (!customUrl) {
|
|
104
|
-
customUrl = null;
|
|
105
|
-
}
|
|
106
103
|
if (!agent) {
|
|
107
104
|
throw new Error("No PDS agent found");
|
|
108
105
|
}
|
|
109
106
|
if (!agent.did) {
|
|
110
107
|
throw new Error("No user DID found, assuming not logged in");
|
|
111
108
|
}
|
|
112
|
-
// Use customUrl if provided, otherwise fall back to the store URL
|
|
113
|
-
const finalUrl = customUrl || url;
|
|
114
109
|
const u = new URL(url);
|
|
115
110
|
let thumbnail = undefined;
|
|
116
111
|
if (customThumbnail) {
|
|
@@ -178,19 +173,26 @@ function useCreateStreamRecord() {
|
|
|
178
173
|
window.navigator) {
|
|
179
174
|
platVersion = (0, browser_1.getBrowserName)(window.navigator.userAgent);
|
|
180
175
|
}
|
|
176
|
+
const thisUrl = `${url}/${profile.data.handle}`;
|
|
177
|
+
if (!canonicalUrl) {
|
|
178
|
+
canonicalUrl = thisUrl;
|
|
179
|
+
}
|
|
181
180
|
const record = {
|
|
182
181
|
$type: "place.stream.livestream",
|
|
183
182
|
title: title,
|
|
184
|
-
url:
|
|
183
|
+
url: thisUrl,
|
|
185
184
|
createdAt: new Date().toISOString(),
|
|
186
185
|
// would match up with e.g. https://stream.place/iame.li
|
|
187
|
-
canonicalUrl:
|
|
186
|
+
canonicalUrl: canonicalUrl,
|
|
188
187
|
// user agent style string
|
|
189
188
|
// e.g. `@streamplace/components/0.1.0 (ios, 32.0)`
|
|
190
189
|
agent: `@streamplace/components/${package_json_1.default.version} (${platform}, ${platVersion})`,
|
|
191
190
|
post: newPost,
|
|
192
191
|
thumb: thumbnail,
|
|
193
192
|
};
|
|
193
|
+
if (notificationSettings) {
|
|
194
|
+
record.notificationSettings = notificationSettings;
|
|
195
|
+
}
|
|
194
196
|
await agent.com.atproto.repo.createRecord({
|
|
195
197
|
repo: agent.did,
|
|
196
198
|
collection: "place.stream.livestream",
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamplace/components",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.6",
|
|
4
4
|
"description": "Streamplace React (Native) Components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "src/index.tsx",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"start": "tsc --watch --preserveWatchOutput",
|
|
57
57
|
"prepare": "tsc"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "a40860f005ba4da989cfe1a5c39d29fa3564fea6"
|
|
60
60
|
}
|
|
@@ -6,6 +6,7 @@ export * from "./primitives/text";
|
|
|
6
6
|
|
|
7
7
|
// Export styled components
|
|
8
8
|
export * from "./button";
|
|
9
|
+
export * from "./checkbox";
|
|
9
10
|
export * from "./dialog";
|
|
10
11
|
export * from "./dropdown";
|
|
11
12
|
export * from "./icons";
|
|
@@ -18,6 +19,7 @@ export * from "./slider";
|
|
|
18
19
|
export * from "./text";
|
|
19
20
|
export * from "./textarea";
|
|
20
21
|
export * from "./toast";
|
|
22
|
+
export * from "./tooltip";
|
|
21
23
|
export * from "./view";
|
|
22
24
|
|
|
23
25
|
// Component collections for easy importing
|
|
@@ -131,19 +131,18 @@ export function useCreateStreamRecord() {
|
|
|
131
131
|
title,
|
|
132
132
|
customThumbnail,
|
|
133
133
|
submitPost,
|
|
134
|
-
|
|
134
|
+
canonicalUrl,
|
|
135
|
+
notificationSettings,
|
|
135
136
|
}: {
|
|
136
137
|
title: string;
|
|
137
138
|
customThumbnail?: Blob;
|
|
138
139
|
submitPost?: boolean;
|
|
139
|
-
|
|
140
|
+
canonicalUrl?: string;
|
|
141
|
+
notificationSettings?: PlaceStreamLivestream.NotificationSettings;
|
|
140
142
|
}) => {
|
|
141
|
-
if (
|
|
143
|
+
if (typeof submitPost !== "boolean") {
|
|
142
144
|
submitPost = true;
|
|
143
145
|
}
|
|
144
|
-
if (!customUrl) {
|
|
145
|
-
customUrl = null;
|
|
146
|
-
}
|
|
147
146
|
if (!agent) {
|
|
148
147
|
throw new Error("No PDS agent found");
|
|
149
148
|
}
|
|
@@ -152,8 +151,6 @@ export function useCreateStreamRecord() {
|
|
|
152
151
|
throw new Error("No user DID found, assuming not logged in");
|
|
153
152
|
}
|
|
154
153
|
|
|
155
|
-
// Use customUrl if provided, otherwise fall back to the store URL
|
|
156
|
-
const finalUrl = customUrl || url;
|
|
157
154
|
const u = new URL(url);
|
|
158
155
|
|
|
159
156
|
let thumbnail: BlobRef | undefined = undefined;
|
|
@@ -247,13 +244,18 @@ export function useCreateStreamRecord() {
|
|
|
247
244
|
platVersion = getBrowserName(window.navigator.userAgent);
|
|
248
245
|
}
|
|
249
246
|
|
|
247
|
+
const thisUrl = `${url}/${profile.data.handle}`;
|
|
248
|
+
if (!canonicalUrl) {
|
|
249
|
+
canonicalUrl = thisUrl;
|
|
250
|
+
}
|
|
251
|
+
|
|
250
252
|
const record: PlaceStreamLivestream.Record = {
|
|
251
253
|
$type: "place.stream.livestream",
|
|
252
254
|
title: title,
|
|
253
|
-
url:
|
|
255
|
+
url: thisUrl,
|
|
254
256
|
createdAt: new Date().toISOString(),
|
|
255
257
|
// would match up with e.g. https://stream.place/iame.li
|
|
256
|
-
canonicalUrl:
|
|
258
|
+
canonicalUrl: canonicalUrl,
|
|
257
259
|
// user agent style string
|
|
258
260
|
// e.g. `@streamplace/components/0.1.0 (ios, 32.0)`
|
|
259
261
|
agent: `@streamplace/components/${PackageJson.version} (${platform}, ${platVersion})`,
|
|
@@ -261,6 +263,10 @@ export function useCreateStreamRecord() {
|
|
|
261
263
|
thumb: thumbnail,
|
|
262
264
|
};
|
|
263
265
|
|
|
266
|
+
if (notificationSettings) {
|
|
267
|
+
record.notificationSettings = notificationSettings;
|
|
268
|
+
}
|
|
269
|
+
|
|
264
270
|
await agent.com.atproto.repo.createRecord({
|
|
265
271
|
repo: agent.did,
|
|
266
272
|
collection: "place.stream.livestream",
|