@mushi-mushi/core 1.39.0 → 1.40.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.
package/dist/index.cjs CHANGED
@@ -2960,6 +2960,28 @@ var MUSHI_REPORTER_STATUS = {
2960
2960
  fixed: { fg: "#8FE3B0", bg: "rgba(80,200,130,0.12)", border: "rgba(80,200,130,0.22)" }
2961
2961
  }
2962
2962
  };
2963
+ var MUSHI_REPORT_TYPE_COLORS = {
2964
+ light: {
2965
+ bug: { solid: "#D92D20", ink: "#B42318" },
2966
+ slow: { solid: "#B54708", ink: "#93370D" },
2967
+ visual: { solid: "#7A3FE4", ink: "#6427C9" },
2968
+ confusing: { solid: "#2160E0", ink: "#1849A9" },
2969
+ idea: { solid: "#14803C", ink: "#0E6630" },
2970
+ other: { solid: "#667085", ink: "#475467" }
2971
+ },
2972
+ dark: {
2973
+ bug: { solid: "#F97066", ink: "#FDA29B" },
2974
+ slow: { solid: "#F79009", ink: "#FEC84B" },
2975
+ visual: { solid: "#A48AFB", ink: "#C9B8FD" },
2976
+ confusing: { solid: "#5B9BF8", ink: "#9EC5FC" },
2977
+ idea: { solid: "#3CCB7F", ink: "#8DE8B4" },
2978
+ other: { solid: "#98A2B3", ink: "#D0D5DD" }
2979
+ }
2980
+ };
2981
+ var MUSHI_REPORT_TYPE_WASH = {
2982
+ light: { wash: 0.08, strong: 0.14 },
2983
+ dark: { wash: 0.14, strong: 0.24 }
2984
+ };
2963
2985
  function mushiPalette(mode) {
2964
2986
  return mode === "dark" ? MUSHI_COLORS_DARK : MUSHI_COLORS_LIGHT;
2965
2987
  }
@@ -3134,28 +3156,6 @@ function parseIdentityToken(token) {
3134
3156
  }
3135
3157
 
3136
3158
  // src/favicon.ts
3137
- var MULTI_TENANT_PARENT_HOSTS = /* @__PURE__ */ new Set(["kensaur.us", "www.kensaur.us"]);
3138
- var SLUG_DOMAIN_HINTS = {
3139
- "glot-it": "glot.it",
3140
- glotit: "glot.it",
3141
- "solo-boss-cloud": "solo-boss.kensaur.us",
3142
- "mushi-mushi": "kensaur.us",
3143
- "how-to-talk-to-girls": "talk.kensaur.us",
3144
- htttg: "talk.kensaur.us",
3145
- tsumagoi: "tsumagoi.kensaur.us"
3146
- };
3147
- var SLUG_ICON_URL_HINTS = {
3148
- "mushi-mushi": "https://kensaur.us/mushi-mushi/admin/favicon.svg",
3149
- "solo-boss-cloud": "https://solo-boss.kensaur.us/favicon.svg",
3150
- "glot-it": "https://kensaur.us/glot-it/apple-touch-icon.png",
3151
- glotit: "https://kensaur.us/glot-it/apple-touch-icon.png",
3152
- "the-wanting-mind": "https://kensaur.us/the-wanting-mind/pwa-512x512.png",
3153
- "how-to-talk-to-girls": "https://talk.kensaur.us/pwa-192.png",
3154
- htttg: "https://talk.kensaur.us/pwa-192.png",
3155
- tsumagoi: "https://tsumagoi.kensaur.us/apple-touch-icon.png",
3156
- "help-her-take-photo": "https://kensaur.us/help-her-take-photo/assets/apple-touch-icon.png",
3157
- "yen-yen": "https://kensaur.us/yen-yen/icon.svg"
3158
- };
3159
3159
  var UNTRUSTED_FAVICON_HOSTS = [
3160
3160
  "www.google.com",
3161
3161
  "icons.duckduckgo.com",
@@ -3185,9 +3185,9 @@ function resolveProjectFaviconDomains(source) {
3185
3185
  out.push(n);
3186
3186
  };
3187
3187
  add(githubRepoDomainHint(source.repo_url));
3188
- add(SLUG_DOMAIN_HINTS[source.project_slug.toLowerCase()]);
3189
- const fromOrigin = source.sdk_origin ? originToDomain(source.sdk_origin) : null;
3190
- if (fromOrigin && !MULTI_TENANT_PARENT_HOSTS.has(fromOrigin)) {
3188
+ const fromOrigin = source.sdk_origin && !mountedUnderPath(source.sdk_origin) ? originToDomain(source.sdk_origin) : null;
3189
+ const shared = new Set((source.shared_hosts ?? []).map((h) => h.trim().toLowerCase()).filter(Boolean));
3190
+ if (fromOrigin && !shared.has(fromOrigin) && !shared.has(fromOrigin.replace(/^www\./, ""))) {
3191
3191
  add(fromOrigin);
3192
3192
  }
3193
3193
  return out;
@@ -3201,8 +3201,6 @@ function projectFaviconUrlCandidates(source, size = 32) {
3201
3201
  seen.add(url);
3202
3202
  urls.push(url);
3203
3203
  };
3204
- const slugHint = SLUG_ICON_URL_HINTS[source.project_slug.toLowerCase()];
3205
- if (slugHint) push(slugHint);
3206
3204
  for (const domain of resolveProjectFaviconDomains(source)) {
3207
3205
  for (const url of faviconUrlCandidates(domain, size)) {
3208
3206
  push(url);
@@ -3210,6 +3208,14 @@ function projectFaviconUrlCandidates(source, size = 32) {
3210
3208
  }
3211
3209
  return urls;
3212
3210
  }
3211
+ function mountedUnderPath(origin) {
3212
+ try {
3213
+ const url = new URL(origin.includes("://") ? origin : `https://${origin}`);
3214
+ return url.pathname.replace(/\/+$/, "") !== "";
3215
+ } catch {
3216
+ return false;
3217
+ }
3218
+ }
3213
3219
  function originToDomain(origin) {
3214
3220
  const trimmed = origin.trim();
3215
3221
  if (!trimmed) return null;
@@ -3359,6 +3365,8 @@ exports.MUSHI_OPACITY = MUSHI_OPACITY;
3359
3365
  exports.MUSHI_PROJECT_HEADER = MUSHI_PROJECT_HEADER;
3360
3366
  exports.MUSHI_RADIUS = MUSHI_RADIUS;
3361
3367
  exports.MUSHI_REPORTER_STATUS = MUSHI_REPORTER_STATUS;
3368
+ exports.MUSHI_REPORT_TYPE_COLORS = MUSHI_REPORT_TYPE_COLORS;
3369
+ exports.MUSHI_REPORT_TYPE_WASH = MUSHI_REPORT_TYPE_WASH;
3362
3370
  exports.MUSHI_SDK_PACKAGE_HEADER = MUSHI_SDK_PACKAGE_HEADER;
3363
3371
  exports.MUSHI_SDK_VERSION_HEADER = MUSHI_SDK_VERSION_HEADER;
3364
3372
  exports.MUSHI_SHADOW_INK = MUSHI_SHADOW_INK;