@jant/core 0.4.0 → 0.4.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.
Files changed (35) hide show
  1. package/dist/{app-B9XQDSoB.js → app-DQgkp6yV.js} +46 -63
  2. package/dist/app-DYJLFZaM.js +6 -0
  3. package/dist/client/.vite/manifest.json +3 -3
  4. package/dist/client/_assets/client-BbJ0FhON.css +2 -0
  5. package/dist/client/_assets/client-DqsPJKiP.js +272 -0
  6. package/dist/client/_assets/{client-auth-DFDajqqT.js → client-auth-N6fiJcOg.js} +82 -82
  7. package/dist/{export-ZBlfKSKm.js → export-DwH3ga3Y.js} +2 -2
  8. package/dist/{github-sync-C593r22F.js → github-sync-D2FO19Re.js} +2 -2
  9. package/dist/{github-sync-bL1hnx3Q.js → github-sync-eHOTYZGO.js} +1 -1
  10. package/dist/index.js +3 -3
  11. package/dist/node.js +4 -4
  12. package/package.json +1 -1
  13. package/src/client/__tests__/compose-shortcuts.test.ts +1 -4
  14. package/src/client/components/__tests__/jant-compose-dialog.test.ts +1 -1
  15. package/src/client/components/__tests__/jant-media-lightbox.test.ts +89 -0
  16. package/src/client/components/compose-types.ts +6 -1
  17. package/src/client/components/jant-compose-dialog.ts +2 -0
  18. package/src/client/components/jant-compose-editor.ts +2 -1
  19. package/src/client/components/jant-media-lightbox.ts +33 -10
  20. package/src/client/compose-bridge.ts +83 -25
  21. package/src/client/compose-launch.ts +0 -13
  22. package/src/client/thread-context.ts +1 -140
  23. package/src/client/upload-session.ts +77 -31
  24. package/src/i18n/locales/public/en.po +0 -4
  25. package/src/i18n/locales/public/zh-Hans.po +0 -4
  26. package/src/i18n/locales/public/zh-Hant.po +0 -4
  27. package/src/services/export-theme/assets/client-site.js +1 -1
  28. package/src/styles/tokens.css +0 -1
  29. package/src/styles/ui.css +0 -71
  30. package/src/ui/feed/ThreadPreview.tsx +34 -65
  31. package/src/ui/feed/__tests__/thread-preview.test.ts +64 -58
  32. package/src/ui/feed/thread-preview-state.ts +0 -48
  33. package/dist/app-CHW6VVQt.js +0 -6
  34. package/dist/client/_assets/client-BoUn7xBo.css +0 -2
  35. package/dist/client/_assets/client-dSfWfMe9.js +0 -272
@@ -1,7 +1,7 @@
1
1
  import { a as getSitePathPrefix, c as normalizePath, d as sanitizeUrl, f as slugify, g as toPublicPath, h as toPublicHref, i as getSiteOrigin, m as toAbsoluteSiteUrl, n as extractDisplayDomain, o as isFullUrl, p as stripSitePathPrefix, r as extractDomain, s as isSafeInternalRedirect, t as buildSiteUrl, u as normalizeSiteUrl, v as __exportAll } from "./url-umUptr5z.js";
2
- import { A as JANT_POSITIVE_LOGO_PNG_FILENAME, B as getJantLogoHref, C as formatYearMonth, D as HOME_BRANDING_LINK_LABEL, E as toISOString, F as getJantBundledAsset, G as base64ToUint8Array, H as JANT_LOGO_PATH_DATA, I as getJantIconFilename, L as getJantIconHref, M as getDefaultJantAppleTouchIconBytes, N as getDefaultJantFaviconIcoBytes, O as HOME_BRANDING_PREFIX, P as getJantBrandPackHref, R as getJantLogoFilename, S as formatTime, U as JANT_LOGO_VIEW_BOX, V as getJantPositiveLogoPngHref, W as arrayBufferToBase64, _ as getMediaUrl, b as formatRelativeAge, d as extractSummaryHtml, f as renderTiptapDocument, g as getImageUrl, h as escapeHtml, i as tiptapJsonToMarkdown, j as JANT_REPO_URL, k as JANT_BRAND_PACK_FILENAME, l as extractBodyText, m as trimTiptapBody, o as render, p as renderTiptapJson, s as toPlainText, t as createExportService, u as extractSummary, v as getPublicUrlForProvider, w as now, x as formatRelativeTime, y as formatDate, z as getJantLogoFills } from "./export-ZBlfKSKm.js";
2
+ import { A as JANT_POSITIVE_LOGO_PNG_FILENAME, B as getJantLogoHref, C as formatYearMonth, D as HOME_BRANDING_LINK_LABEL, E as toISOString, F as getJantBundledAsset, G as base64ToUint8Array, H as JANT_LOGO_PATH_DATA, I as getJantIconFilename, L as getJantIconHref, M as getDefaultJantAppleTouchIconBytes, N as getDefaultJantFaviconIcoBytes, O as HOME_BRANDING_PREFIX, P as getJantBrandPackHref, R as getJantLogoFilename, S as formatTime, U as JANT_LOGO_VIEW_BOX, V as getJantPositiveLogoPngHref, W as arrayBufferToBase64, _ as getMediaUrl, b as formatRelativeAge, d as extractSummaryHtml, f as renderTiptapDocument, g as getImageUrl, h as escapeHtml, i as tiptapJsonToMarkdown, j as JANT_REPO_URL, k as JANT_BRAND_PACK_FILENAME, l as extractBodyText, m as trimTiptapBody, o as render, p as renderTiptapJson, s as toPlainText, t as createExportService, u as extractSummary, v as getPublicUrlForProvider, w as now, x as formatRelativeTime, y as formatDate, z as getJantLogoFills } from "./export-DwH3ga3Y.js";
3
3
  import { C as coalesceDisplayText, S as shouldUseSecureCookies, _ as getInternalAdminToken, a as getConfiguredSingleSiteUrl, b as getSiteResolutionMode, c as getDevApiToken, d as getHostedControlPlaneBaseUrl, f as getHostedControlPlaneDomainCheckSecret, g as getHostedControlPlaneSsoSecret, h as getHostedControlPlaneProviderLabel$1, i as getConfiguredSingleSitePathPrefix, l as getEnvString, m as getHostedControlPlaneInternalToken, n as getAuthSecret, o as getConfiguredStorageDriver, p as getHostedControlPlaneInternalBaseUrl, r as getConfiguredSingleSiteOrigin, s as getCorsOrigins, u as getGitHubAppConfig, v as getLocalStoragePath } from "./env-CgaH9Mut.js";
4
- import { l as markdownToTiptapJson, o as createGitHubSyncService } from "./github-sync-bL1hnx3Q.js";
4
+ import { l as markdownToTiptapJson, o as createGitHubSyncService } from "./github-sync-eHOTYZGO.js";
5
5
  import { a as listInstallationReposPage, n as getInstallation, o as searchInstallationRepos, t as buildInstallUrl } from "./github-app-D0GvNnqp.js";
6
6
  import { r as parseRepoSlug, t as createGitHubClient } from "./github-api-Bh0PH3zr.js";
7
7
  import { I18n } from "@lingui/core";
@@ -3418,10 +3418,10 @@ function normalizeThemeColorForMeta(color) {
3418
3418
  * internal paths (e.g. `/_assets/client-HASH.js`) embedded by the Worker build
3419
3419
  * from the Vite client manifest. Used only in production (IS_VITE_DEV=false).
3420
3420
  */ var IS_VITE_DEV = typeof __JANT_DEV__ !== "undefined" && __JANT_DEV__ === true;
3421
- var CORE_VERSION = "0.4.0-aa2a43928b7884a5";
3422
- var CLIENT_JS_FILE = "/_assets/client-dSfWfMe9.js";
3423
- var CLIENT_AUTH_JS_FILE = "/_assets/client-auth-DFDajqqT.js";
3424
- var CLIENT_CSS_FILE = "/_assets/client-BoUn7xBo.css";
3421
+ var CORE_VERSION = "0.4.1-ec7ca04d562a5649";
3422
+ var CLIENT_JS_FILE = "/_assets/client-DqsPJKiP.js";
3423
+ var CLIENT_AUTH_JS_FILE = "/_assets/client-auth-N6fiJcOg.js";
3424
+ var CLIENT_CSS_FILE = "/_assets/client-BbJ0FhON.css";
3425
3425
  var CLIENT_CJK_CSS_FILE = "/_assets/client-cjk-B7Z0snDu.css";
3426
3426
  var CLIENT_CJK_TC_CSS_FILE = "/_assets/client-cjk-tc-BesJYrb2.css";
3427
3427
  var CLIENT_CJK_JP_CSS_FILE = "/_assets/client-cjk-jp-DZwrTzQC.css";
@@ -3739,7 +3739,7 @@ var IconSprite = () => {
3739
3739
  const cjkSerifFont = appConfig?.cjkSerifFont ?? "off";
3740
3740
  const cjkStylesheetPath = cjkSerifFont === "zh-Hans" ? IS_VITE_DEV ? assetPath("/src/style-cjk.css") : toPublicAssetPath(CLIENT_CJK_CSS_FILE, assetBasePath) : cjkSerifFont === "zh-Hant" ? IS_VITE_DEV ? assetPath("/src/style-cjk-tc.css") : toPublicAssetPath(CLIENT_CJK_TC_CSS_FILE, assetBasePath) : cjkSerifFont === "ja" ? IS_VITE_DEV ? assetPath("/src/style-cjk-jp.css") : toPublicAssetPath(CLIENT_CJK_JP_CSS_FILE, assetBasePath) : cjkSerifFont === "ko" ? IS_VITE_DEV ? assetPath("/src/style-cjk-kr.css") : toPublicAssetPath(CLIENT_CJK_KR_CSS_FILE, assetBasePath) : null;
3741
3741
  const clientScriptPath = IS_VITE_DEV ? resolvedClientBundle === "full" ? assetPath("/src/client-auth.ts") : assetPath("/src/client.ts") : toPublicAssetPath(resolvedClientBundle === "full" ? CLIENT_AUTH_JS_FILE : CLIENT_JS_FILE, assetBasePath);
3742
- const faviconAssetVersion = resolvedFaviconVersion || "0.4.0-aa2a43928b7884a5";
3742
+ const faviconAssetVersion = resolvedFaviconVersion || "0.4.1-ec7ca04d562a5649";
3743
3743
  const resolvedFaviconHref = faviconHref ?? (faviconAssetVersion ? toPublicPath(`/favicon.ico?v=${faviconAssetVersion}`, sitePathPrefix) : toPublicPath("/favicon.ico", sitePathPrefix));
3744
3744
  const resolvedAppleTouchHref = appleTouchHref ?? (faviconAssetVersion ? toPublicPath(`/apple-touch-icon.png?v=${faviconAssetVersion}`, sitePathPrefix) : toPublicPath("/apple-touch-icon.png", sitePathPrefix));
3745
3745
  const socialImageHref = resolvedSocialImagePath && (isFullUrl(resolvedSocialImagePath) || resolvedSocialImagePath.startsWith("//") ? resolvedSocialImagePath : toAbsoluteSiteUrl(resolvedSocialImagePath, appConfig?.siteUrl || "", sitePathPrefix));
@@ -9896,7 +9896,7 @@ function getThreadPreviewState({ secondReply, penultimateReply, latestReply, tot
9896
9896
  /**
9897
9897
  * Thread Preview
9898
9898
  *
9899
- * Shows latest reply as the hero post with faded ancestor context above.
9899
+ * Shows latest reply as the hero post with ancestor context above.
9900
9900
  * Thread line connects all posts via `.thread-group` / `.thread-item`.
9901
9901
  */ var ROOT_CONTEXT_DISPLAY = { footer: { hideReply: true } };
9902
9902
  var CONTEXT_DISPLAY = {
@@ -9906,8 +9906,6 @@ var CONTEXT_DISPLAY = {
9906
9906
  var HERO_DISPLAY = {};
9907
9907
  var ThreadPreview = ({ rootPost, secondReply, penultimateReply, latestReply, totalReplyCount }) => {
9908
9908
  const { i18n } = useLingui();
9909
- const showMoreLabel = i18n._({ id: "fMPkxb" });
9910
- const showLessLabel = i18n._({ id: "6lGV3K" });
9911
9909
  const { hiddenCount } = getThreadPreviewState({
9912
9910
  secondReply,
9913
9911
  penultimateReply,
@@ -9917,56 +9915,41 @@ var ThreadPreview = ({ rootPost, secondReply, penultimateReply, latestReply, tot
9917
9915
  const hiddenPostsLabel = i18n._({ id: "oO0hKx" }, { count: hiddenCount });
9918
9916
  const renderedSecondReply = secondReply && secondReply.id !== latestReply.id ? secondReply : void 0;
9919
9917
  const renderedPenultimateReply = penultimateReply && penultimateReply.id !== latestReply.id && penultimateReply.id !== secondReply?.id ? penultimateReply : void 0;
9918
+ const gapHref = renderedSecondReply?.permalink ?? latestReply.permalink;
9920
9919
  return /* @__PURE__ */ jsxDEV$1("div", {
9921
9920
  class: "thread-group thread-group-preview",
9922
9921
  children: [
9923
9922
  /* @__PURE__ */ jsxDEV$1("div", {
9924
- class: "thread-context-shell thread-context-collapsed",
9925
- "data-thread-context": true,
9926
- children: [
9927
- /* @__PURE__ */ jsxDEV$1("div", {
9928
- class: "thread-item thread-item-context",
9929
- children: /* @__PURE__ */ jsxDEV$1(TimelineItemFromPost, {
9930
- post: rootPost,
9931
- mode: "feed",
9932
- display: ROOT_CONTEXT_DISPLAY
9933
- })
9934
- }),
9935
- renderedSecondReply && /* @__PURE__ */ jsxDEV$1("div", {
9936
- class: "thread-item thread-item-context",
9937
- children: /* @__PURE__ */ jsxDEV$1(TimelineItemFromPost, {
9938
- post: renderedSecondReply,
9939
- mode: "feed",
9940
- display: CONTEXT_DISPLAY
9941
- })
9942
- }),
9943
- hiddenCount > 0 && /* @__PURE__ */ jsxDEV$1("div", {
9944
- class: "thread-item thread-item-gap",
9945
- children: /* @__PURE__ */ jsxDEV$1("a", {
9946
- href: latestReply.permalink,
9947
- class: "thread-gap-link",
9948
- children: hiddenPostsLabel
9949
- })
9950
- }),
9951
- renderedPenultimateReply && /* @__PURE__ */ jsxDEV$1("div", {
9952
- class: "thread-item thread-item-context",
9953
- children: /* @__PURE__ */ jsxDEV$1(TimelineItemFromPost, {
9954
- post: renderedPenultimateReply,
9955
- mode: "feed",
9956
- display: CONTEXT_DISPLAY
9957
- })
9958
- }),
9959
- /* @__PURE__ */ jsxDEV$1("div", { class: "thread-context-fade" })
9960
- ]
9923
+ class: "thread-item thread-item-context",
9924
+ children: /* @__PURE__ */ jsxDEV$1(TimelineItemFromPost, {
9925
+ post: rootPost,
9926
+ mode: "feed",
9927
+ display: ROOT_CONTEXT_DISPLAY
9928
+ })
9961
9929
  }),
9962
- /* @__PURE__ */ jsxDEV$1("button", {
9963
- type: "button",
9964
- class: "thread-context-toggle text-muted-foreground hover:text-foreground hidden",
9965
- "data-thread-context-toggle": true,
9966
- "data-label-more": showMoreLabel,
9967
- "data-label-less": showLessLabel,
9968
- "aria-expanded": "false",
9969
- children: showMoreLabel
9930
+ renderedSecondReply && /* @__PURE__ */ jsxDEV$1("div", {
9931
+ class: "thread-item thread-item-context",
9932
+ children: /* @__PURE__ */ jsxDEV$1(TimelineItemFromPost, {
9933
+ post: renderedSecondReply,
9934
+ mode: "feed",
9935
+ display: CONTEXT_DISPLAY
9936
+ })
9937
+ }),
9938
+ hiddenCount > 0 && /* @__PURE__ */ jsxDEV$1("div", {
9939
+ class: "thread-item thread-item-gap",
9940
+ children: /* @__PURE__ */ jsxDEV$1("a", {
9941
+ href: gapHref,
9942
+ class: "thread-gap-link",
9943
+ children: hiddenPostsLabel
9944
+ })
9945
+ }),
9946
+ renderedPenultimateReply && /* @__PURE__ */ jsxDEV$1("div", {
9947
+ class: "thread-item thread-item-context",
9948
+ children: /* @__PURE__ */ jsxDEV$1(TimelineItemFromPost, {
9949
+ post: renderedPenultimateReply,
9950
+ mode: "feed",
9951
+ display: CONTEXT_DISPLAY
9952
+ })
9970
9953
  }),
9971
9954
  /* @__PURE__ */ jsxDEV$1("div", {
9972
9955
  class: "thread-item thread-item-hero",
@@ -20194,7 +20177,7 @@ async function syncHostedControlPlaneSiteAvatar(input) {
20194
20177
  return;
20195
20178
  }
20196
20179
  await markSyncPending(settings);
20197
- const { createGitHubSyncService } = await import("./github-sync-C593r22F.js");
20180
+ const { createGitHubSyncService } = await import("./github-sync-D2FO19Re.js");
20198
20181
  const { getGitHubAppConfig } = await import("./env-CgaH9Mut.js").then((n) => n.t);
20199
20182
  const run = runBackgroundSync(settings, createGitHubSyncService(c.var.services, c.var.currentSite.id, await buildSyncSiteConfig(c), {
20200
20183
  storage: c.var.storage,
@@ -20981,7 +20964,7 @@ settingsRoutes.post("/github-sync/connect", async (c) => {
20981
20964
  await c.var.services.settings.set("GITHUB_SYNC_AUTH_MODE", "pat");
20982
20965
  await c.var.services.settings.set("GITHUB_SYNC_APP_INSTALLATION_ID", "");
20983
20966
  await c.var.services.settings.set("GITHUB_SYNC_ENABLED", "true");
20984
- const { createGitHubSyncService } = await import("./github-sync-C593r22F.js");
20967
+ const { createGitHubSyncService } = await import("./github-sync-D2FO19Re.js");
20985
20968
  const syncService = createGitHubSyncService(c.var.services, c.var.currentSite.id, await buildSyncSiteConfig(c), {
20986
20969
  storage: c.var.storage,
20987
20970
  githubApp: getGitHubAppConfig(c.env)
@@ -21000,7 +20983,7 @@ settingsRoutes.post("/github-sync/connect", async (c) => {
21000
20983
  return dsRedirect(publicPath(c, "/settings/github-sync"));
21001
20984
  });
21002
20985
  settingsRoutes.post("/github-sync/push", async (c) => {
21003
- const { createGitHubSyncService } = await import("./github-sync-C593r22F.js");
20986
+ const { createGitHubSyncService } = await import("./github-sync-D2FO19Re.js");
21004
20987
  const syncService = createGitHubSyncService(c.var.services, c.var.currentSite.id, await buildSyncSiteConfig(c), {
21005
20988
  storage: c.var.storage,
21006
20989
  githubApp: getGitHubAppConfig(c.env)
@@ -21020,7 +21003,7 @@ settingsRoutes.post("/github-sync/push", async (c) => {
21020
21003
  });
21021
21004
  });
21022
21005
  settingsRoutes.post("/github-sync/disconnect", async (c) => {
21023
- const { createGitHubSyncService } = await import("./github-sync-C593r22F.js");
21006
+ const { createGitHubSyncService } = await import("./github-sync-D2FO19Re.js");
21024
21007
  await createGitHubSyncService(c.var.services, c.var.currentSite.id, await buildSyncSiteConfig(c), { githubApp: getGitHubAppConfig(c.env) }).teardownWebhook();
21025
21008
  return dsRedirect(publicPath(c, "/settings/github-sync"));
21026
21009
  });
@@ -21211,7 +21194,7 @@ function buildRepoPickerLabels(c) {
21211
21194
  const { parseRepoSlug, createGitHubClient } = await import("./github-api-Bh0PH3zr.js").then((n) => n.n);
21212
21195
  const parsed = parseRepoSlug(repo);
21213
21196
  if (!parsed) return wantsJson ? c.json({ error: "Invalid repository format." }, 400) : c.text("Invalid repository format.", 400);
21214
- const { classifyRepoForSync } = await import("./github-sync-C593r22F.js");
21197
+ const { classifyRepoForSync } = await import("./github-sync-D2FO19Re.js");
21215
21198
  const ghClient = createGitHubClient(() => getInstallationTokenFromApp(app, installationId));
21216
21199
  let classification;
21217
21200
  try {
@@ -21241,7 +21224,7 @@ function buildRepoPickerLabels(c) {
21241
21224
  await c.var.services.settings.set("GITHUB_SYNC_REPO", repo);
21242
21225
  await c.var.services.settings.set("GITHUB_SYNC_TOKEN", "");
21243
21226
  await c.var.services.settings.set("GITHUB_SYNC_ENABLED", "true");
21244
- const { createGitHubSyncService } = await import("./github-sync-C593r22F.js");
21227
+ const { createGitHubSyncService } = await import("./github-sync-D2FO19Re.js");
21245
21228
  const syncService = createGitHubSyncService(c.var.services, c.var.currentSite.id, await buildSyncSiteConfig(c), {
21246
21229
  storage: c.var.storage,
21247
21230
  githubApp: app
@@ -21357,7 +21340,7 @@ function requireGitHubApp(c) {
21357
21340
  const { parseRepoSlug, createGitHubClient } = await import("./github-api-Bh0PH3zr.js").then((n) => n.n);
21358
21341
  const parsed = parseRepoSlug(repo);
21359
21342
  if (!parsed) return c.json({ error: "Invalid repository format." }, 400);
21360
- const { classifyRepoForSync } = await import("./github-sync-C593r22F.js");
21343
+ const { classifyRepoForSync } = await import("./github-sync-D2FO19Re.js");
21361
21344
  const client = createGitHubClient(() => getInstallationTokenFromApp(app, installationId));
21362
21345
  try {
21363
21346
  const classification = await classifyRepoForSync(client, parsed.owner, parsed.repo, c.var.currentSite.id);
@@ -30814,7 +30797,7 @@ function createSiteAdminService(db, databaseSchema = sqliteSchemaBundle, databas
30814
30797
  const themeCss = buildThemeStyle(activeTheme, appConfig.themeMode, fontOverrides);
30815
30798
  const navItemList = await navItems.list();
30816
30799
  const appleTouchKey = allSettings[SETTINGS_KEYS.SITE_FAVICON_APPLE_TOUCH];
30817
- const { createExportService } = await import("./export-ZBlfKSKm.js").then((n) => n.n);
30800
+ const { createExportService } = await import("./export-DwH3ga3Y.js").then((n) => n.n);
30818
30801
  const exportService = createExportService({
30819
30802
  collections,
30820
30803
  media: mediaService,
@@ -0,0 +1,6 @@
1
+ import "./url-umUptr5z.js";
2
+ import { t as createApp } from "./app-DQgkp6yV.js";
3
+ import "./export-DwH3ga3Y.js";
4
+ import "./env-CgaH9Mut.js";
5
+ import "./github-sync-eHOTYZGO.js";
6
+ export { createApp };
@@ -146,7 +146,7 @@
146
146
  "name": "url"
147
147
  },
148
148
  "src/client-auth.ts": {
149
- "file": "_assets/client-auth-DFDajqqT.js",
149
+ "file": "_assets/client-auth-N6fiJcOg.js",
150
150
  "name": "client-auth",
151
151
  "src": "src/client-auth.ts",
152
152
  "isEntry": true,
@@ -163,7 +163,7 @@
163
163
  ]
164
164
  },
165
165
  "src/client.ts": {
166
- "file": "_assets/client-dSfWfMe9.js",
166
+ "file": "_assets/client-DqsPJKiP.js",
167
167
  "name": "client",
168
168
  "src": "src/client.ts",
169
169
  "isEntry": true,
@@ -858,7 +858,7 @@
858
858
  ]
859
859
  },
860
860
  "src/style.css": {
861
- "file": "_assets/client-BoUn7xBo.css",
861
+ "file": "_assets/client-BbJ0FhON.css",
862
862
  "name": "style",
863
863
  "names": [
864
864
  "style.css"