g-comments 0.0.0-stage → 0.1.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/CHANGELOG.md +31 -0
- package/LICENSE +21 -0
- package/README.md +354 -2
- package/dist/chunk-6E3M3PQN.js +3056 -0
- package/dist/chunk-6E3M3PQN.js.map +1 -0
- package/dist/chunk-X6RAR374.cjs +3077 -0
- package/dist/chunk-X6RAR374.cjs.map +1 -0
- package/dist/element.d.ts +770 -0
- package/dist/element.js +1226 -0
- package/dist/element.js.map +1 -0
- package/dist/index.cjs +68 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +37 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/messages-BlBkT6Kr.d.cts +649 -0
- package/dist/messages-BlBkT6Kr.d.ts +649 -0
- package/dist/react.cjs +2557 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +320 -0
- package/dist/react.d.ts +320 -0
- package/dist/react.js +2549 -0
- package/dist/react.js.map +1 -0
- package/package.json +89 -3
- package/styles/styles.css +1145 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkX6RAR374_cjs = require('./chunk-X6RAR374.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "CommentsError", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkX6RAR374_cjs.CommentsError; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "PACKAGE_NAME", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkX6RAR374_cjs.PACKAGE_NAME; }
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "clientRegistry", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return chunkX6RAR374_cjs.clientRegistry; }
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "createClient", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return chunkX6RAR374_cjs.createClient; }
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "createClientRegistry", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return chunkX6RAR374_cjs.createClientRegistry; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "createComposerTimer", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return chunkX6RAR374_cjs.createComposerTimer; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "createTranslator", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return chunkX6RAR374_cjs.createTranslator; }
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, "en", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return chunkX6RAR374_cjs.en; }
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "encodeRef", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return chunkX6RAR374_cjs.encodeRef; }
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "isCommentsError", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () { return chunkX6RAR374_cjs.isCommentsError; }
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(exports, "isVirtualThread", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () { return chunkX6RAR374_cjs.isVirtualThread; }
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports, "locales", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () { return chunkX6RAR374_cjs.locales; }
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, "memoryStorage", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () { return chunkX6RAR374_cjs.memoryStorage; }
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(exports, "ptBR", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
get: function () { return chunkX6RAR374_cjs.ptBR; }
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(exports, "resolveLocale", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function () { return chunkX6RAR374_cjs.resolveLocale; }
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=index.cjs.map
|
|
68
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { C as CreateClientOptions, a as CommentsClient, b as CountRef } from './messages-BlBkT6Kr.cjs';
|
|
2
|
+
export { A as AnyThread, c as AuthProvider, d as AuthState, e as AuthStatus, B as BranchState, f as ChildrenPageResponse, g as Comment, h as CommentAuthor, i as CommentContext, j as CommentContextResponse, k as CommentLikes, l as CommentPermissions, m as CommentReplyTo, n as CommentResponse, o as Commenter, p as CommentsAuth, q as CommentsByIdsResponse, r as CommentsError, s as CommentsErrorType, t as ComposerTimer, u as ComposerTiming, v as Config, w as ConnectionMode, x as Counts, y as CountsResponse, z as CreateCommentResponse, E as ErrorResponse, D as ExchangeResponse, F as Features, G as FetchLike, H as FlagOptions, I as FlagType, J as ForumInfo, L as Limits, M as MentionsResponse, K as MessageKey, N as MessageValue, O as MessageVars, P as Messages, Q as OpenThreadOptions, R as Pending, S as PinsResponse, T as PluralMessage, U as PostOptions, V as PostResult, W as PreviewResponse, X as RawResponse, Y as RootsPageResponse, Z as SignInOptions, _ as Sort, $ as StorageLike, a0 as StoredAuth, a1 as SupportedLocale, a2 as Thread, a3 as ThreadCreation, a4 as ThreadEvent, a5 as ThreadHandle, a6 as ThreadResponse, a7 as ThreadSnapshot, a8 as ThreadStatus, a9 as Translator, aa as Upload, ab as UploadOptions, ac as VirtualThread, ad as createClient, ae as createComposerTimer, af as createTranslator, ag as en, ah as isCommentsError, ai as isVirtualThread, aj as locales, ak as memoryStorage, al as ptBR, am as resolveLocale } from './messages-BlBkT6Kr.cjs';
|
|
3
|
+
|
|
4
|
+
/** The published package name. Renaming the package changes this line and package.json only. */
|
|
5
|
+
declare const PACKAGE_NAME = "g-comments";
|
|
6
|
+
|
|
7
|
+
type RealtimeStatus = "idle" | "connecting" | "connected" | "failed";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Shares one client per forum per page, so every widget, count and hook that
|
|
11
|
+
* names the same forum reuses one auth state, config cache, counts batcher and
|
|
12
|
+
* realtime connection.
|
|
13
|
+
*/
|
|
14
|
+
interface ClientRegistry {
|
|
15
|
+
/**
|
|
16
|
+
* The shared client for `options.forum`, created from `options` on first use.
|
|
17
|
+
* Forum URLs are compared after normalization (`https://f.example/` equals
|
|
18
|
+
* `https://F.example`); options passed after the first call are ignored.
|
|
19
|
+
*/
|
|
20
|
+
acquire(options: CreateClientOptions): CommentsClient;
|
|
21
|
+
/** The shared client for `forum`, if one has been created. */
|
|
22
|
+
get(forum: string): CommentsClient | undefined;
|
|
23
|
+
/** Disposes and forgets the client for `forum`, or every client when omitted. */
|
|
24
|
+
clear(forum?: string): void;
|
|
25
|
+
}
|
|
26
|
+
declare function createClientRegistry(create?: (options: CreateClientOptions) => CommentsClient): ClientRegistry;
|
|
27
|
+
/** The page-wide registry used by the React components. */
|
|
28
|
+
declare const clientRegistry: ClientRegistry;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Encodes a ref the way `GET /comments/counts` keys it: `url:<url>`,
|
|
32
|
+
* `id:<host>/<identifier>` (host defaults to the current page's host) or
|
|
33
|
+
* `t:<topic_id>`.
|
|
34
|
+
*/
|
|
35
|
+
declare function encodeRef(ref: CountRef): string;
|
|
36
|
+
|
|
37
|
+
export { type ClientRegistry, CommentsClient, CountRef, CreateClientOptions, PACKAGE_NAME, type RealtimeStatus, clientRegistry, createClientRegistry, encodeRef };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { C as CreateClientOptions, a as CommentsClient, b as CountRef } from './messages-BlBkT6Kr.js';
|
|
2
|
+
export { A as AnyThread, c as AuthProvider, d as AuthState, e as AuthStatus, B as BranchState, f as ChildrenPageResponse, g as Comment, h as CommentAuthor, i as CommentContext, j as CommentContextResponse, k as CommentLikes, l as CommentPermissions, m as CommentReplyTo, n as CommentResponse, o as Commenter, p as CommentsAuth, q as CommentsByIdsResponse, r as CommentsError, s as CommentsErrorType, t as ComposerTimer, u as ComposerTiming, v as Config, w as ConnectionMode, x as Counts, y as CountsResponse, z as CreateCommentResponse, E as ErrorResponse, D as ExchangeResponse, F as Features, G as FetchLike, H as FlagOptions, I as FlagType, J as ForumInfo, L as Limits, M as MentionsResponse, K as MessageKey, N as MessageValue, O as MessageVars, P as Messages, Q as OpenThreadOptions, R as Pending, S as PinsResponse, T as PluralMessage, U as PostOptions, V as PostResult, W as PreviewResponse, X as RawResponse, Y as RootsPageResponse, Z as SignInOptions, _ as Sort, $ as StorageLike, a0 as StoredAuth, a1 as SupportedLocale, a2 as Thread, a3 as ThreadCreation, a4 as ThreadEvent, a5 as ThreadHandle, a6 as ThreadResponse, a7 as ThreadSnapshot, a8 as ThreadStatus, a9 as Translator, aa as Upload, ab as UploadOptions, ac as VirtualThread, ad as createClient, ae as createComposerTimer, af as createTranslator, ag as en, ah as isCommentsError, ai as isVirtualThread, aj as locales, ak as memoryStorage, al as ptBR, am as resolveLocale } from './messages-BlBkT6Kr.js';
|
|
3
|
+
|
|
4
|
+
/** The published package name. Renaming the package changes this line and package.json only. */
|
|
5
|
+
declare const PACKAGE_NAME = "g-comments";
|
|
6
|
+
|
|
7
|
+
type RealtimeStatus = "idle" | "connecting" | "connected" | "failed";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Shares one client per forum per page, so every widget, count and hook that
|
|
11
|
+
* names the same forum reuses one auth state, config cache, counts batcher and
|
|
12
|
+
* realtime connection.
|
|
13
|
+
*/
|
|
14
|
+
interface ClientRegistry {
|
|
15
|
+
/**
|
|
16
|
+
* The shared client for `options.forum`, created from `options` on first use.
|
|
17
|
+
* Forum URLs are compared after normalization (`https://f.example/` equals
|
|
18
|
+
* `https://F.example`); options passed after the first call are ignored.
|
|
19
|
+
*/
|
|
20
|
+
acquire(options: CreateClientOptions): CommentsClient;
|
|
21
|
+
/** The shared client for `forum`, if one has been created. */
|
|
22
|
+
get(forum: string): CommentsClient | undefined;
|
|
23
|
+
/** Disposes and forgets the client for `forum`, or every client when omitted. */
|
|
24
|
+
clear(forum?: string): void;
|
|
25
|
+
}
|
|
26
|
+
declare function createClientRegistry(create?: (options: CreateClientOptions) => CommentsClient): ClientRegistry;
|
|
27
|
+
/** The page-wide registry used by the React components. */
|
|
28
|
+
declare const clientRegistry: ClientRegistry;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Encodes a ref the way `GET /comments/counts` keys it: `url:<url>`,
|
|
32
|
+
* `id:<host>/<identifier>` (host defaults to the current page's host) or
|
|
33
|
+
* `t:<topic_id>`.
|
|
34
|
+
*/
|
|
35
|
+
declare function encodeRef(ref: CountRef): string;
|
|
36
|
+
|
|
37
|
+
export { type ClientRegistry, CommentsClient, CountRef, CreateClientOptions, PACKAGE_NAME, type RealtimeStatus, clientRegistry, createClientRegistry, encodeRef };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { CommentsError, PACKAGE_NAME, clientRegistry, createClient, createClientRegistry, createComposerTimer, createTranslator, en, encodeRef, isCommentsError, isVirtualThread, locales, memoryStorage, ptBR, resolveLocale } from './chunk-6E3M3PQN.js';
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|