g-comments 0.1.0 → 0.2.1

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.
@@ -2658,6 +2658,7 @@ function createClientWithInternals(options, internals) {
2658
2658
  const realtime = internals.realtime ?? new MessageBusPoller({ base: forum.base, fetch: http.fetch, log });
2659
2659
  const batcher = new CountsBatcher(http);
2660
2660
  let configGeneration = 0;
2661
+ let themePromise = null;
2661
2662
  let degradedRecheck;
2662
2663
  let degradedChecks = 0;
2663
2664
  function config() {
@@ -2776,6 +2777,16 @@ function createClientWithInternals(options, internals) {
2776
2777
  }
2777
2778
  return http.request("POST", `${threadPath(threadId)}/attachments`, { form });
2778
2779
  }
2780
+ function theme() {
2781
+ if (lifetime.signal.aborted) {
2782
+ return Promise.reject(disposedError());
2783
+ }
2784
+ themePromise ??= http.request("GET", "/theme").catch((error) => {
2785
+ themePromise = null;
2786
+ throw error;
2787
+ });
2788
+ return themePromise;
2789
+ }
2779
2790
  const client = {
2780
2791
  forum: forum.base,
2781
2792
  forumOrigin: forum.origin,
@@ -2784,6 +2795,7 @@ function createClientWithInternals(options, internals) {
2784
2795
  threads: { open },
2785
2796
  attachments: { upload },
2786
2797
  config,
2798
+ theme,
2787
2799
  counts: (refs) => batcher.request(refs),
2788
2800
  count: async (ref) => (await batcher.request([ref]))[encodeRef(ref)] ?? 0,
2789
2801
  preview: async (body) => (await http.request("POST", "/preview", { json: { raw: body } })).html,
@@ -3052,5 +3064,5 @@ function createTranslator(locale, overrides = {}) {
3052
3064
  }
3053
3065
 
3054
3066
  export { CommentsError, PACKAGE_NAME, STORAGE_PREFIX, clientRegistry, createClient, createClientRegistry, createComposerTimer, createTranslator, currentUrlWithoutHash, defaultPageUrl, en, encodeRef, findComment, isCommentsError, isVirtualThread, locales, memoryStorage, normalizeForum, ptBR, resolveLocale };
3055
- //# sourceMappingURL=chunk-6E3M3PQN.js.map
3056
- //# sourceMappingURL=chunk-6E3M3PQN.js.map
3067
+ //# sourceMappingURL=chunk-WACVXJHD.js.map
3068
+ //# sourceMappingURL=chunk-WACVXJHD.js.map