randmarcomps 1.620.0 → 1.622.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.
@@ -957,6 +957,10 @@ export declare interface RichTextEditorProps extends Omit<default_2.InputHTMLAtt
957
957
  placeholder?: string;
958
958
  }
959
959
 
960
+ export declare function RmBodyZone({ className, children, ...props }: RmBodyZoneProps): JSX.Element;
961
+
962
+ export declare type RmBodyZoneProps = React_2.ComponentProps<"section">;
963
+
960
964
  export declare function RmPageHeader({ title, subtitle, breadcrumbs, rightTopActions, rightBottomActions, secondaryRow, sticky, stickyClassName, className, cardClassName, contentClassName, }: RmPageHeaderProps): JSX.Element;
961
965
 
962
966
  export declare interface RmPageHeaderBreadcrumbItem {
@@ -57373,13 +57373,14 @@ function CheckboxCardList({
57373
57373
  ),
57374
57374
  children: [
57375
57375
  /* @__PURE__ */ jsx(
57376
- Checkbox,
57376
+ "span",
57377
57377
  {
57378
- checked: at,
57379
- disabled: st,
57380
- tabIndex: -1,
57381
57378
  "aria-hidden": "true",
57382
- className: "pointer-events-none mt-0.5"
57379
+ className: cn(
57380
+ "mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-primary shadow-sm",
57381
+ at ? "bg-primary text-primary-foreground" : "bg-background text-transparent"
57382
+ ),
57383
+ children: /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5" })
57383
57384
  }
57384
57385
  ),
57385
57386
  /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: f ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
@@ -58447,7 +58448,7 @@ const DebugMessageDisplay = ({ debugMessages: e }) => {
58447
58448
  };
58448
58449
  const a = t.slice(0, o).trim() || "Portal", s = t.slice(o + n.length).trim() || "SOP";
58449
58450
  return { portalName: a, sopName: s };
58450
- }, normalizeCompare = (e) => e.trim().toLocaleLowerCase(), toSopMarkdownFilename = (e) => {
58451
+ }, normalizeCompare = (e) => e.trim().toLocaleLowerCase(), areStringArraysEqual = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]), toSopMarkdownFilename = (e) => {
58451
58452
  const n = (e.trim() || "sop").replace(/[\\/:*?"<>|]/g, " ").replace(/\s+/g, " ").trim().replace(/[^a-zA-Z0-9._ -]/g, "").replace(/\s+/g, "_") || "sop";
58452
58453
  return n.toLowerCase().endsWith(".md") ? n : `${n}.md`;
58453
58454
  }, AIChatLayout = memo$1(forwardRef(
@@ -58532,7 +58533,10 @@ ${br}`;
58532
58533
  wr.current = !0, Ut(ir);
58533
58534
  }, []);
58534
58535
  useEffect(() => {
58535
- Ut((ir) => ir.filter((mr) => Fr.some((br) => br.id === mr)));
58536
+ Ut((ir) => {
58537
+ const mr = ir.filter((br) => Fr.some((_r) => _r.id === br));
58538
+ return areStringArraysEqual(ir, mr) ? ir : mr;
58539
+ });
58536
58540
  }, [Fr]), useEffect(() => {
58537
58541
  if (Sr.current) return;
58538
58542
  if (wr.current) {
@@ -58546,7 +58550,7 @@ ${br}`;
58546
58550
  return;
58547
58551
  }
58548
58552
  const mr = Fr.filter((br) => normalizeCompare(br.sopName) === ir).map((br) => br.id);
58549
- Ut(mr), Sr.current = !0;
58553
+ Ut((br) => areStringArraysEqual(br, mr) ? br : mr), Sr.current = !0;
58550
58554
  }, [it?.Role, mn, Fr]);
58551
58555
  const _n = useCallback((ir) => !ir || typeof ir != "object" || !("status" in ir) || ir.status !== "PARSING_ERROR" || !("originalStatus" in ir) || ir.originalStatus !== 200 ? null : ir.data ?? null, []), tn = useCallback(async (ir) => {
58552
58556
  if (!e || !ir) throw new Error("Missing user or SOP id.");
@@ -62076,23 +62080,7 @@ function DataRefreshAssistantCluster({
62076
62080
  }, [t, a, e, n]);
62077
62081
  return /* @__PURE__ */ jsx(RefreshCluster, { ...o, onAssistantClick: s });
62078
62082
  }
62079
- const roundToPixel = (e) => Math.round(e * 100) / 100;
62080
- function getMainContentRegion(e) {
62081
- return e.closest("main, [data-rm-main-content-region]");
62082
- }
62083
- function getRegionBounds(e) {
62084
- if (e) {
62085
- const t = e.getBoundingClientRect();
62086
- return {
62087
- left: t.left,
62088
- right: t.right
62089
- };
62090
- }
62091
- return {
62092
- left: 0,
62093
- right: document.documentElement.clientWidth
62094
- };
62095
- }
62083
+ const fullBleedClassName = "w-screen max-w-none -ml-[calc(50vw-50%)] -mr-[calc(50vw-50%)]";
62096
62084
  function RmPageHeaderBreadcrumbLink({
62097
62085
  item: e,
62098
62086
  isCurrent: t
@@ -62146,42 +62134,21 @@ function RmPageHeader({
62146
62134
  cardClassName: f,
62147
62135
  contentClassName: S
62148
62136
  }) {
62149
- const R = React.useRef(null);
62150
- React.useEffect(() => {
62151
- if (typeof window > "u") return;
62152
- const rt = R.current;
62153
- if (!rt) return;
62154
- const ot = getMainContentRegion(rt);
62155
- let it = null;
62156
- const at = () => {
62157
- const ut = rt.getBoundingClientRect(), ct = getRegionBounds(ot), dt = roundToPixel(ct.left - ut.left), pt = roundToPixel(ut.right - ct.right);
62158
- rt.style.marginLeft = `${dt}px`, rt.style.marginRight = `${pt}px`;
62159
- }, st = () => {
62160
- it !== null && window.cancelAnimationFrame(it), it = window.requestAnimationFrame(() => {
62161
- at(), it = null;
62162
- });
62163
- };
62164
- st();
62165
- const lt = typeof ResizeObserver < "u" ? new ResizeObserver(st) : null;
62166
- return lt && (lt.observe(rt), lt.observe(document.documentElement), ot && lt.observe(ot)), window.addEventListener("resize", st), window.addEventListener("orientationchange", st), () => {
62167
- it !== null && window.cancelAnimationFrame(it), lt?.disconnect(), window.removeEventListener("resize", st), window.removeEventListener("orientationchange", st), rt.style.marginLeft = "", rt.style.marginRight = "";
62168
- };
62169
- }, []);
62170
- const te = !!(o || a), A = /* @__PURE__ */ jsxs("header", { className: cn("w-full border-b border-border bg-background", d), children: [
62137
+ const R = !!(o || a), te = /* @__PURE__ */ jsxs("header", { className: cn("w-full border-b border-border bg-background", d), children: [
62171
62138
  /* @__PURE__ */ jsx("div", { className: cn("px-4 py-6 sm:px-6", f), children: /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between", S), children: [
62172
62139
  /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
62173
62140
  n?.length ? /* @__PURE__ */ jsx(RmPageHeaderBreadcrumbs, { items: n }) : null,
62174
62141
  /* @__PURE__ */ jsx("h1", { className: "text-2xl font-semibold leading-tight tracking-tight text-foreground", children: e }),
62175
62142
  t ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t }) : null
62176
62143
  ] }),
62177
- te ? /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col items-start gap-2 lg:w-auto lg:min-w-[16rem] lg:items-end", children: [
62144
+ R ? /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col items-start gap-2 lg:w-auto lg:min-w-[16rem] lg:items-end", children: [
62178
62145
  o ? /* @__PURE__ */ jsx("div", { className: "flex w-full flex-wrap items-center justify-start gap-2 lg:justify-end", children: o }) : null,
62179
62146
  a ? /* @__PURE__ */ jsx("div", { className: "flex w-full flex-wrap items-center justify-start gap-2 lg:justify-end", children: a }) : null
62180
62147
  ] }) : null
62181
62148
  ] }) }),
62182
62149
  s ? /* @__PURE__ */ jsx("div", { className: "border-t border-border bg-muted/40", children: /* @__PURE__ */ jsx("div", { className: "px-4 py-4 sm:px-6", children: s }) }) : null
62183
62150
  ] });
62184
- return l ? /* @__PURE__ */ jsx("div", { ref: R, children: /* @__PURE__ */ jsx("div", { className: cn("sticky top-0 z-20", c), children: A }) }) : /* @__PURE__ */ jsx("div", { ref: R, children: A });
62151
+ return l ? /* @__PURE__ */ jsx("div", { className: fullBleedClassName, children: /* @__PURE__ */ jsx("div", { className: cn("sticky top-0 z-20", c), children: te }) }) : /* @__PURE__ */ jsx("div", { className: fullBleedClassName, children: te });
62185
62152
  }
62186
62153
  function PageHeader({ title: e, children: t, className: n }) {
62187
62154
  return /* @__PURE__ */ jsx(
@@ -62193,6 +62160,9 @@ function PageHeader({ title: e, children: t, className: n }) {
62193
62160
  }
62194
62161
  );
62195
62162
  }
62163
+ function RmBodyZone({ className: e, children: t, ...n }) {
62164
+ return /* @__PURE__ */ jsx("section", { className: cn("px-4 py-4 sm:px-6 sm:py-6", e), ...n, children: t });
62165
+ }
62196
62166
  function OrderedMap(e) {
62197
62167
  this.content = e;
62198
62168
  }
@@ -84102,6 +84072,7 @@ export {
84102
84072
  ResellerQualificationsCard,
84103
84073
  ReturnsTable,
84104
84074
  RichTextEditor,
84075
+ RmBodyZone,
84105
84076
  RmPageHeader,
84106
84077
  SalesChart,
84107
84078
  SalesOverviewCard,