@mrrocket/sdk 0.8.0 → 0.10.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +35 -1
  3. package/dist/api-client.d.ts +221 -0
  4. package/dist/api-client.js +79 -0
  5. package/dist/api-client.js.map +1 -0
  6. package/dist/api.d.ts +2 -122
  7. package/dist/api.js +2 -61
  8. package/dist/api.js.map +1 -1
  9. package/dist/browser/mrrocket-messenger.js +348 -0
  10. package/dist/browser/mrrocket-replay.js +3 -3
  11. package/dist/browser/mrrocket.js +1 -1
  12. package/dist/browser.d.ts +2 -1
  13. package/dist/browser.js +3 -0
  14. package/dist/browser.js.map +1 -1
  15. package/dist/capture.d.ts +1 -13
  16. package/dist/capture.js +1 -22
  17. package/dist/capture.js.map +1 -1
  18. package/dist/core.d.ts +1 -1
  19. package/dist/core.js +1 -1
  20. package/dist/core.js.map +1 -1
  21. package/dist/feedback.js +132 -24
  22. package/dist/feedback.js.map +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +4 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/messenger-ui.d.ts +49 -0
  27. package/dist/messenger-ui.js +619 -0
  28. package/dist/messenger-ui.js.map +1 -0
  29. package/dist/messenger.d.ts +37 -0
  30. package/dist/messenger.js +69 -0
  31. package/dist/messenger.js.map +1 -0
  32. package/dist/rage.d.ts +14 -0
  33. package/dist/rage.js +27 -0
  34. package/dist/rage.js.map +1 -0
  35. package/dist/react-native/index.d.cts +349 -4
  36. package/dist/react-native/index.d.ts +349 -4
  37. package/dist/react-native/index.js +1345 -31
  38. package/dist/react-native/index.js.map +1 -1
  39. package/dist/styles-css.d.ts +6 -0
  40. package/dist/styles-css.js +362 -0
  41. package/dist/styles-css.js.map +1 -0
  42. package/dist/styles.d.ts +1 -2
  43. package/dist/styles.js +3 -237
  44. package/dist/styles.js.map +1 -1
  45. package/package.json +17 -5
package/dist/feedback.js CHANGED
@@ -148,11 +148,34 @@ var IdentityFields = ({ name, email, setName, setEmail }) => {
148
148
  /* @__PURE__ */ jsxs("div", { className: "ckw-pair", children: [
149
149
  /* @__PURE__ */ jsxs("div", { className: "ckw-field", children: [
150
150
  /* @__PURE__ */ jsx("label", { className: "ckw-label", htmlFor: `${id}-n`, children: "Your name" }),
151
- /* @__PURE__ */ jsx("input", { id: `${id}-n`, className: "ckw-input", value: name, maxLength: 80, required: true, autoComplete: "name", onChange: (e) => setName(e.target.value) })
151
+ /* @__PURE__ */ jsx(
152
+ "input",
153
+ {
154
+ id: `${id}-n`,
155
+ className: "ckw-input",
156
+ value: name,
157
+ maxLength: 80,
158
+ required: true,
159
+ autoComplete: "name",
160
+ onChange: (e) => setName(e.target.value)
161
+ }
162
+ )
152
163
  ] }),
153
164
  /* @__PURE__ */ jsxs("div", { className: "ckw-field", children: [
154
165
  /* @__PURE__ */ jsx("label", { className: "ckw-label", htmlFor: `${id}-e`, children: "Email" }),
155
- /* @__PURE__ */ jsx("input", { id: `${id}-e`, className: "ckw-input", type: "email", value: email, maxLength: 200, required: true, autoComplete: "email", onChange: (e) => setEmail(e.target.value) })
166
+ /* @__PURE__ */ jsx(
167
+ "input",
168
+ {
169
+ id: `${id}-e`,
170
+ className: "ckw-input",
171
+ type: "email",
172
+ value: email,
173
+ maxLength: 200,
174
+ required: true,
175
+ autoComplete: "email",
176
+ onChange: (e) => setEmail(e.target.value)
177
+ }
178
+ )
156
179
  ] })
157
180
  ] }),
158
181
  /* @__PURE__ */ jsx("p", { className: "ckw-fine", children: "Others see your first name and last initial. Your email is only for updates on what you posted or voted for." })
@@ -227,7 +250,19 @@ var SubmitForm = ({
227
250
  return /* @__PURE__ */ jsxs("form", { className: bare ? "ckw-modal-body" : "ckw-form", onSubmit: submit, children: [
228
251
  /* @__PURE__ */ jsxs("div", { className: "ckw-field", children: [
229
252
  /* @__PURE__ */ jsx("label", { className: "ckw-label", htmlFor: `${id}-t`, children: "Title" }),
230
- /* @__PURE__ */ jsx("input", { id: `${id}-t`, className: "ckw-input", value: title, maxLength: 120, required: true, autoFocus: true, onChange: (e) => setTitle(e.target.value), placeholder: "Short, specific summary" })
253
+ /* @__PURE__ */ jsx(
254
+ "input",
255
+ {
256
+ id: `${id}-t`,
257
+ className: "ckw-input",
258
+ value: title,
259
+ maxLength: 120,
260
+ required: true,
261
+ autoFocus: true,
262
+ onChange: (e) => setTitle(e.target.value),
263
+ placeholder: "Short, specific summary"
264
+ }
265
+ )
231
266
  ] }),
232
267
  dupes.length > 0 && /* @__PURE__ */ jsxs("div", { className: "ckw-dupes", role: "status", children: [
233
268
  /* @__PURE__ */ jsx("p", { children: "Similar requests. Vote instead of adding a duplicate:" }),
@@ -241,7 +276,17 @@ var SubmitForm = ({
241
276
  "Details ",
242
277
  /* @__PURE__ */ jsx("span", { className: "ckw-opt-l", children: "optional" })
243
278
  ] }),
244
- /* @__PURE__ */ jsx("textarea", { id: `${id}-b`, className: "ckw-textarea", value: body, maxLength: 2e3, onChange: (e) => setBody(e.target.value), placeholder: "What are you trying to do? What gets in the way?" })
279
+ /* @__PURE__ */ jsx(
280
+ "textarea",
281
+ {
282
+ id: `${id}-b`,
283
+ className: "ckw-textarea",
284
+ value: body,
285
+ maxLength: 2e3,
286
+ onChange: (e) => setBody(e.target.value),
287
+ placeholder: "What are you trying to do? What gets in the way?"
288
+ }
289
+ )
245
290
  ] }),
246
291
  boards.length > 1 && /* @__PURE__ */ jsxs("div", { className: "ckw-field", children: [
247
292
  /* @__PURE__ */ jsx("span", { className: "ckw-label", id: `${id}-c`, children: "Type" }),
@@ -255,7 +300,12 @@ var SubmitForm = ({
255
300
  ] })
256
301
  ] });
257
302
  };
258
- var PostCard = ({ post, boards, onOpen, onVote }) => /* @__PURE__ */ jsxs("li", { className: "ckw-post", children: [
303
+ var PostCard = ({
304
+ post,
305
+ boards,
306
+ onOpen,
307
+ onVote
308
+ }) => /* @__PURE__ */ jsxs("li", { className: "ckw-post", children: [
259
309
  /* @__PURE__ */ jsx(VoteButton, { post, onVote }),
260
310
  /* @__PURE__ */ jsxs("div", { className: "ckw-main", children: [
261
311
  /* @__PURE__ */ jsx("button", { type: "button", className: "ckw-link ckw-stretch", onClick: () => onOpen(post), children: post.title }),
@@ -292,13 +342,17 @@ var Requests = ({
292
342
  boards.map((b) => /* @__PURE__ */ jsx("button", { type: "button", className: "ckw-chip", "aria-pressed": board === b.id, onClick: () => setBoard(b.id), children: b.label }, b.id))
293
343
  ] })
294
344
  ] }),
295
- /* @__PURE__ */ jsx("div", { "aria-live": "polite", "aria-busy": list.loading, children: list.loading && posts.length === 0 ? /* @__PURE__ */ jsx(Skeleton, {}) : posts.length === 0 && !list.error ? /* @__PURE__ */ jsxs("div", { className: "ckw-empty", children: [
296
- /* @__PURE__ */ jsx("p", { children: q ? "No request matches your search." : board ? "Nothing of this type yet." : "No requests yet." }),
297
- !q && /* @__PURE__ */ jsxs("button", { type: "button", className: "ckw-btn ckw-btn-primary", onClick: onNew, children: [
298
- /* @__PURE__ */ jsx(Plus, {}),
299
- " Suggest the first one"
345
+ /* @__PURE__ */ jsx("div", { "aria-live": "polite", "aria-busy": list.loading, children: list.loading && posts.length === 0 ? /* @__PURE__ */ jsx(Skeleton, {}) : posts.length === 0 && !list.error ? (
346
+ // Things' empty look (owner, 2026-10-21): a large faint glyph, one line and the one next step, no frame.
347
+ /* @__PURE__ */ jsxs("div", { className: "ckw-empty", children: [
348
+ /* @__PURE__ */ jsx(EmptyGlyph, {}),
349
+ /* @__PURE__ */ jsx("p", { children: q ? "No request matches your search." : board ? "Nothing of this type yet." : "No requests yet." }),
350
+ !q && /* @__PURE__ */ jsxs("button", { type: "button", className: "ckw-btn ckw-btn-primary", onClick: onNew, children: [
351
+ /* @__PURE__ */ jsx(Plus, {}),
352
+ " Suggest the first one"
353
+ ] })
300
354
  ] })
301
- ] }) : /* @__PURE__ */ jsx("ul", { className: "ckw-posts", children: posts.map((p) => /* @__PURE__ */ jsx(PostCard, { post: p, boards, onOpen, onVote }, p.id)) }) })
355
+ ) : /* @__PURE__ */ jsx("ul", { className: "ckw-posts", children: posts.map((p) => /* @__PURE__ */ jsx(PostCard, { post: p, boards, onOpen, onVote }, p.id)) }) })
302
356
  ] }) });
303
357
  };
304
358
  var PostDetail = ({
@@ -365,7 +419,17 @@ var PostDetail = ({
365
419
  ] }),
366
420
  /* @__PURE__ */ jsxs("form", { className: "ckw-composer", onSubmit: send, children: [
367
421
  /* @__PURE__ */ jsx("label", { className: "ckw-sr", htmlFor: id, children: "Leave a comment" }),
368
- /* @__PURE__ */ jsx("textarea", { id, className: "ckw-textarea", value: text, maxLength: 1e3, placeholder: "Leave a comment", onChange: (e) => setText(e.target.value) }),
422
+ /* @__PURE__ */ jsx(
423
+ "textarea",
424
+ {
425
+ id,
426
+ className: "ckw-textarea",
427
+ value: text,
428
+ maxLength: 1e3,
429
+ placeholder: "Leave a comment",
430
+ onChange: (e) => setText(e.target.value)
431
+ }
432
+ ),
369
433
  /* @__PURE__ */ jsxs("div", { className: "ckw-actions", children: [
370
434
  identity.known && identity.name && /* @__PURE__ */ jsxs("span", { className: "ckw-fine ckw-as", children: [
371
435
  "Commenting as ",
@@ -435,7 +499,12 @@ var matchesQ = (q, ...texts) => {
435
499
  const t = q.trim().toLowerCase();
436
500
  return !t || texts.some((x) => x.toLowerCase().includes(t));
437
501
  };
438
- var RoadmapCard = ({ post, boards, onOpen, onVote }) => /* @__PURE__ */ jsxs("li", { className: "ckw-card", children: [
502
+ var RoadmapCard = ({
503
+ post,
504
+ boards,
505
+ onOpen,
506
+ onVote
507
+ }) => /* @__PURE__ */ jsxs("li", { className: "ckw-card", children: [
439
508
  /* @__PURE__ */ jsx(TypeChip, { board: post.board, boards }),
440
509
  /* @__PURE__ */ jsx("button", { type: "button", className: "ckw-link ckw-stretch", onClick: () => onOpen(post), children: post.title }),
441
510
  post.body && /* @__PURE__ */ jsx("p", { className: "ckw-excerpt", children: post.body }),
@@ -465,7 +534,8 @@ var Roadmap = ({
465
534
  const patch = (id, fn) => setData((d) => {
466
535
  if (!d) return d;
467
536
  const columns = { ...d.columns };
468
- for (const k of Object.keys(columns)) columns[k] = columns[k]?.map((p) => p.id === id ? fn(p) : p);
537
+ for (const k of Object.keys(columns))
538
+ columns[k] = columns[k]?.map((p) => p.id === id ? fn(p) : p);
469
539
  return { columns };
470
540
  });
471
541
  const vote = (post) => voteRef(post, (r) => {
@@ -532,6 +602,7 @@ var writeUrl = (tab, post, push) => {
532
602
  };
533
603
  var THEME_KEY = "ckw-theme";
534
604
  var systemDark = () => typeof window !== "undefined" && !!window.matchMedia?.("(prefers-color-scheme: dark)").matches;
605
+ var EmptyGlyph = () => /* @__PURE__ */ jsx("svg", { className: "ckw-empty-icon", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M12 2.5c-5.25 0-9.5 3.73-9.5 8.33 0 2.47 1.23 4.69 3.18 6.21-.17 1.33-.73 2.6-1.63 3.63a.6.6 0 0 0 .5 1c2.13-.12 4-.86 5.38-1.92.67.13 1.36.2 2.07.2 5.25 0 9.5-3.73 9.5-8.33S17.25 2.5 12 2.5Zm.9 4.2-.6 3.3h2.2a.5.5 0 0 1 .4.8l-3.5 4.5a.4.4 0 0 1-.7-.35l.6-3.15H9.1a.5.5 0 0 1-.4-.8l3.5-4.65a.4.4 0 0 1 .7.35Z" }) });
535
606
  var FeedbackBoard = ({
536
607
  title = "Feedback",
537
608
  subtitle = "Tell us what to build next and vote on what matters to you.",
@@ -633,16 +704,19 @@ var FeedbackBoard = ({
633
704
  go(TABS[(n + TABS.length) % TABS.length][0]);
634
705
  };
635
706
  const product = list.product;
636
- const logo = product?.logo ? product.logo.startsWith("/") ? `${host}${product.logo}` : product.logo : null;
707
+ const abs = (u) => u ? u.startsWith("/") ? `${host}${u}` : u : null;
708
+ const marks = [abs(product?.logo), abs(product?.logoFallback)].filter((u, i, a) => !!u && a.indexOf(u) === i);
709
+ const [failed, setFailed] = useState(0);
710
+ const logo = marks[failed] ?? null;
637
711
  const name = product?.name ?? title;
638
712
  const newPost = () => (setThanks(false), setCreating(true));
639
713
  const searchLabel = tab === "roadmap" ? "Search roadmap" : tab === "changelog" ? "Search updates" : "Search requests";
640
- return /* @__PURE__ */ jsxs(Root, { theme: header ? dark ? "dark" : "light" : theme, accent, className: `ckw-board${fullPage ? " ckw-full" : ""}`, children: [
714
+ return /* @__PURE__ */ jsxs(Root, { theme: header ? dark ? "dark" : "light" : theme, accent, className: `ckw-board${fullPage ? "ckw-full" : ""}`, children: [
641
715
  header ? /* @__PURE__ */ jsx("header", { className: "ckw-top", children: /* @__PURE__ */ jsxs("div", { className: "ckw-top-row", children: [
642
716
  /* @__PURE__ */ jsxs("button", { type: "button", className: "ckw-brand", onClick: () => go("requests"), children: [
643
717
  logo ? (
644
718
  // eslint-disable-next-line @next/next/no-img-element
645
- /* @__PURE__ */ jsx("img", { src: logo, alt: "", width: 28, height: 28 })
719
+ /* @__PURE__ */ jsx("img", { src: logo, alt: "", width: 28, height: 28, onError: () => setFailed((n) => n + 1) }, logo)
646
720
  ) : /* @__PURE__ */ jsx("span", { className: "ckw-brand-mark", "aria-hidden": "true", children: name.slice(0, 1).toUpperCase() }),
647
721
  /* @__PURE__ */ jsx("span", { children: name })
648
722
  ] }),
@@ -693,7 +767,16 @@ var FeedbackBoard = ({
693
767
  }
694
768
  )
695
769
  ] }),
696
- /* @__PURE__ */ jsx("button", { type: "button", className: "ckw-icon-btn", onClick: flipTheme, "aria-label": dark ? "Switch to light mode" : "Switch to dark mode", children: dark ? /* @__PURE__ */ jsx(Sun, {}) : /* @__PURE__ */ jsx(Moon, {}) }),
770
+ /* @__PURE__ */ jsx(
771
+ "button",
772
+ {
773
+ type: "button",
774
+ className: "ckw-icon-btn",
775
+ onClick: flipTheme,
776
+ "aria-label": dark ? "Switch to light mode" : "Switch to dark mode",
777
+ children: dark ? /* @__PURE__ */ jsx(Sun, {}) : /* @__PURE__ */ jsx(Moon, {})
778
+ }
779
+ ),
697
780
  /* @__PURE__ */ jsxs("button", { type: "button", className: "ckw-btn ckw-btn-primary ckw-submit", "aria-label": "Submit feedback", onClick: newPost, children: [
698
781
  /* @__PURE__ */ jsx(Plus, {}),
699
782
  " ",
@@ -711,7 +794,20 @@ var FeedbackBoard = ({
711
794
  " Request a feature"
712
795
  ] })
713
796
  ] }),
714
- /* @__PURE__ */ jsx("div", { className: "ckw-tabs", role: "tablist", "aria-label": "Feedback sections", onKeyDown: onTabKey, children: TABS.map(([k, label]) => /* @__PURE__ */ jsx("button", { type: "button", role: "tab", id: `ckw-tab-${k}`, "aria-selected": tab === k, tabIndex: tab === k ? 0 : -1, className: "ckw-tab", onClick: () => go(k), children: k === "requests" ? "Requests" : label }, k)) }),
797
+ /* @__PURE__ */ jsx("div", { className: "ckw-tabs", role: "tablist", "aria-label": "Feedback sections", onKeyDown: onTabKey, children: TABS.map(([k, label]) => /* @__PURE__ */ jsx(
798
+ "button",
799
+ {
800
+ type: "button",
801
+ role: "tab",
802
+ id: `ckw-tab-${k}`,
803
+ "aria-selected": tab === k,
804
+ tabIndex: tab === k ? 0 : -1,
805
+ className: "ckw-tab",
806
+ onClick: () => go(k),
807
+ children: k === "requests" ? "Requests" : label
808
+ },
809
+ k
810
+ )) }),
715
811
  /* @__PURE__ */ jsx(
716
812
  "input",
717
813
  {
@@ -905,11 +1001,23 @@ var FeedbackWidget = ({ position = "bottom-right", label = "Feedback", boardUrl,
905
1001
  else if (!e.shiftKey && document.activeElement === last) e.preventDefault(), first.focus();
906
1002
  };
907
1003
  return /* @__PURE__ */ jsxs(Root, { theme, accent, children: [
908
- /* @__PURE__ */ jsxs("button", { ref: fab, type: "button", className: "ckw-fab", "data-pos": position, "aria-haspopup": "dialog", "aria-expanded": open, onClick: () => open ? close() : setWidgetOpen(true), children: [
909
- /* @__PURE__ */ jsx(Chat, {}),
910
- " ",
911
- label
912
- ] }),
1004
+ /* @__PURE__ */ jsxs(
1005
+ "button",
1006
+ {
1007
+ ref: fab,
1008
+ type: "button",
1009
+ className: "ckw-fab",
1010
+ "data-pos": position,
1011
+ "aria-haspopup": "dialog",
1012
+ "aria-expanded": open,
1013
+ onClick: () => open ? close() : setWidgetOpen(true),
1014
+ children: [
1015
+ /* @__PURE__ */ jsx(Chat, {}),
1016
+ " ",
1017
+ label
1018
+ ]
1019
+ }
1020
+ ),
913
1021
  open && /* @__PURE__ */ jsx("div", { ref: pop, className: "ckw-pop", "data-pos": position, role: "dialog", "aria-label": "Feedback", onKeyDown: trap, children: /* @__PURE__ */ jsx(WidgetPanel, { boardUrl, onClose: close }) })
914
1022
  ] });
915
1023
  };