@react-perfscope/ui 0.5.0 → 0.6.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/dist/index.cjs CHANGED
@@ -179,7 +179,8 @@ var en = {
179
179
  processingTime: "processing",
180
180
  presentation: "presentation",
181
181
  interactionThresholdHint: "Only interactions \u226540ms are shown \u2014 INP surfaces the slow ones; fast clicks are omitted.",
182
- layoutShiftHint: "Every layout shift, including ones triggered by your interactions. The CLS metric excludes input-driven shifts, so this is not a CLS score."
182
+ layoutShiftHint: "Every layout shift, including ones triggered by your interactions. The CLS metric excludes input-driven shifts, so this is not a CLS score.",
183
+ unsupportedInBrowser: (kinds) => `Not measurable in this browser (the API is missing, not that nothing happened): ${kinds}.`
183
184
  };
184
185
  var KIND_LABELS_KO = {
185
186
  render: "\uB80C\uB354",
@@ -273,7 +274,8 @@ var ko = {
273
274
  processingTime: "\uCC98\uB9AC",
274
275
  presentation: "\uD654\uBA74 \uBC18\uC601",
275
276
  interactionThresholdHint: "40ms \uC774\uC0C1 \uAC78\uB9B0 \uC0C1\uD638\uC791\uC6A9\uB9CC \uD45C\uC2DC\uB3FC\uC694 \u2014 \uB290\uB9B0 \uAC83\uB9CC INP\uB85C \uC7A1\uACE0, \uBE60\uB978 \uD074\uB9AD\uC740 \uC0DD\uB7B5\uD574\uC694.",
276
- layoutShiftHint: "\uC0AC\uC6A9\uC790 \uC778\uD130\uB799\uC158\uC73C\uB85C \uC0DD\uAE34 \uAC83\uAE4C\uC9C0 \uD3EC\uD568\uD55C \uBAA8\uB4E0 \uB808\uC774\uC544\uC6C3 \uC2DC\uD504\uD2B8\uC608\uC694. CLS \uC9C0\uD45C\uB294 \uC785\uB825\uC73C\uB85C \uC778\uD55C \uC2DC\uD504\uD2B8\uB97C \uC81C\uC678\uD558\uBBC0\uB85C, \uC774\uAC74 CLS \uC810\uC218\uAC00 \uC544\uB2C8\uC5D0\uC694."
277
+ layoutShiftHint: "\uC0AC\uC6A9\uC790 \uC778\uD130\uB799\uC158\uC73C\uB85C \uC0DD\uAE34 \uAC83\uAE4C\uC9C0 \uD3EC\uD568\uD55C \uBAA8\uB4E0 \uB808\uC774\uC544\uC6C3 \uC2DC\uD504\uD2B8\uC608\uC694. CLS \uC9C0\uD45C\uB294 \uC785\uB825\uC73C\uB85C \uC778\uD55C \uC2DC\uD504\uD2B8\uB97C \uC81C\uC678\uD558\uBBC0\uB85C, \uC774\uAC74 CLS \uC810\uC218\uAC00 \uC544\uB2C8\uC5D0\uC694.",
278
+ unsupportedInBrowser: (kinds) => `\uC774 \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC120 \uCE21\uC815\uD560 \uC218 \uC5C6\uC5B4\uC694 (\uC544\uBB34 \uC77C\uB3C4 \uC5C6\uB358 \uAC8C \uC544\uB2C8\uB77C API\uAC00 \uC5C6\uC74C): ${kinds}.`
277
279
  };
278
280
  var STRINGS = { en, ko };
279
281
  function isLang(v) {
@@ -383,6 +385,7 @@ function Widget(props) {
383
385
 
384
386
  // src/panel.tsx
385
387
  var import_hooks3 = require("preact/hooks");
388
+ var import_core4 = require("@react-perfscope/core");
386
389
 
387
390
  // src/overlay.ts
388
391
  var OVERLAY_MARKER = "data-perfscope-overlay";
@@ -2861,6 +2864,7 @@ function Panel(props) {
2861
2864
  const { t } = useI18n();
2862
2865
  const grouped = (0, import_hooks3.useMemo)(() => groupByKind(result.signals), [result.signals]);
2863
2866
  const kindsPresent = KIND_ORDER.filter((k) => grouped[k].length > 0);
2867
+ const unsupported = (0, import_hooks3.useMemo)(() => (0, import_core4.unsupportedKinds)(), []);
2864
2868
  const hasTimelineSignals = result.signals.some((s) => s.kind !== "web-vital") || (result.heapSamples?.length ?? 0) > 0 || (result.frames?.length ?? 0) > 0;
2865
2869
  const [activeTab, setActiveTab] = (0, import_hooks3.useState)(
2866
2870
  kindsPresent[0] ?? "forced-reflow"
@@ -2962,6 +2966,21 @@ function Panel(props) {
2962
2966
  )
2963
2967
  ] })
2964
2968
  ] }),
2969
+ unsupported.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2970
+ "div",
2971
+ {
2972
+ style: {
2973
+ padding: "6px 8px",
2974
+ marginBottom: "8px",
2975
+ fontSize: "11px",
2976
+ color: "#888",
2977
+ background: "#141414",
2978
+ border: "1px solid #1f1f1f",
2979
+ borderRadius: "6px"
2980
+ },
2981
+ children: t.unsupportedInBrowser(unsupported.map((k) => t.kindLabel(k)).join(", "))
2982
+ }
2983
+ ),
2965
2984
  kindsPresent.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { color: "#888" }, children: t.noSignals }),
2966
2985
  kindsPresent.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
2967
2986
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(