randmarcomps 1.225.0 → 1.226.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/README.md +1 -5
- package/dist/randmarcomps.d.ts +2 -0
- package/dist/randmarcomps.js +32 -30
- package/dist/randmarcomps.umd.cjs +15 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,16 +37,12 @@ If you're using a different path structure, adjust the path accordingly. The pat
|
|
|
37
37
|
|
|
38
38
|
### React Router
|
|
39
39
|
|
|
40
|
-
Several components
|
|
40
|
+
Several components require React Router:
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
43
|
npm install react-router-dom@^7.3.0
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
Components that use React Router include:
|
|
47
|
-
- Navbar (uses useParams, Link)
|
|
48
|
-
- Topbar (uses useNavigate, useParams)
|
|
49
|
-
|
|
50
46
|
## Usage
|
|
51
47
|
|
|
52
48
|
### 1. Import the CSS
|
package/dist/randmarcomps.d.ts
CHANGED
|
@@ -388,6 +388,7 @@ export declare const Layout: ForwardRefExoticComponent<LayoutProps & RefAttribut
|
|
|
388
388
|
|
|
389
389
|
declare interface LayoutProps {
|
|
390
390
|
children: React.ReactNode;
|
|
391
|
+
appID: string;
|
|
391
392
|
rightMenu?: React.ReactNode;
|
|
392
393
|
footer: React.ReactNode;
|
|
393
394
|
routes: NavRoute[];
|
|
@@ -443,6 +444,7 @@ export declare const Navbar: default_2.ForwardRefExoticComponent<NavbarProps & d
|
|
|
443
444
|
|
|
444
445
|
export declare interface NavbarProps {
|
|
445
446
|
routes: NavRoute[];
|
|
447
|
+
appID: string;
|
|
446
448
|
dashboardTitle?: string;
|
|
447
449
|
footer: default_2.ReactNode;
|
|
448
450
|
withRandmarAssistant?: boolean;
|
package/dist/randmarcomps.js
CHANGED
|
@@ -10,7 +10,7 @@ import * as React from "react";
|
|
|
10
10
|
import React__default, { forwardRef, createElement, useState, useLayoutEffect, useEffect, createContext, useRef, useContext, useCallback, useDebugValue, useMemo, isValidElement, Children, PureComponent, useImperativeHandle, cloneElement, Component, Fragment as Fragment$1 } from "react";
|
|
11
11
|
import * as ReactDOM from "react-dom";
|
|
12
12
|
import ReactDOM__default from "react-dom";
|
|
13
|
-
import { Link, useLocation,
|
|
13
|
+
import { Link, useLocation, useBlocker } from "react-router-dom";
|
|
14
14
|
var Bt = Object.defineProperty, At = Object.defineProperties, kt = Object.getOwnPropertyDescriptors, Y$2 = Object.getOwnPropertySymbols, gt = Object.prototype.hasOwnProperty, Et = Object.prototype.propertyIsEnumerable, vt = (e, t, n) => t in e ? Bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, St = (e, t) => {
|
|
15
15
|
for (var n in t || (t = {})) gt.call(t, n) && vt(e, n, t[n]);
|
|
16
16
|
if (Y$2) for (var n of Y$2(t)) Et.call(t, n) && vt(e, n, t[n]);
|
|
@@ -62828,9 +62828,9 @@ function GeneralDocumentCard({ document: e, loading: t = !1 }) {
|
|
|
62828
62828
|
] });
|
|
62829
62829
|
}
|
|
62830
62830
|
const Navbar = forwardRef(
|
|
62831
|
-
({ routes: e, footer: t, dashboardTitle: n, withRandmarAssistant: o, chatUserName: l, chatApiKey: d },
|
|
62832
|
-
const
|
|
62833
|
-
return useImperativeHandle(
|
|
62831
|
+
({ routes: e, footer: t, dashboardTitle: n, withRandmarAssistant: o, chatUserName: l, chatApiKey: d, appID: f }, g) => {
|
|
62832
|
+
const b = e.filter((E) => E.showInNav), _ = useRef(null), S = useRef(null), C = useRef(null);
|
|
62833
|
+
return useImperativeHandle(g, () => ({
|
|
62834
62834
|
setActiveChatAndSendMessage: (E, R) => {
|
|
62835
62835
|
var M;
|
|
62836
62836
|
return (M = C.current) == null || M.click(), setTimeout(() => {
|
|
@@ -62851,7 +62851,7 @@ const Navbar = forwardRef(
|
|
|
62851
62851
|
/* @__PURE__ */ jsx("span", { className: "font-semibold text-lg", children: n })
|
|
62852
62852
|
] }) }),
|
|
62853
62853
|
/* @__PURE__ */ jsx(SidebarContent, { className: "py-4 bg-sidebar text-sidebar-foreground", children: /* @__PURE__ */ jsx(SidebarMenu, { children: b.map((E) => {
|
|
62854
|
-
const R = E.icon, M = `/${E.path
|
|
62854
|
+
const R = E.icon, M = `/${E.path}`;
|
|
62855
62855
|
return /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, { asChild: !0, children: /* @__PURE__ */ jsxs(Link, { to: M, className: "transition-colors hover:bg-muted px-6", children: [
|
|
62856
62856
|
R && /* @__PURE__ */ jsx(R, { className: "h-4 w-4" }),
|
|
62857
62857
|
/* @__PURE__ */ jsx("span", { children: E.label })
|
|
@@ -62875,7 +62875,7 @@ const Navbar = forwardRef(
|
|
|
62875
62875
|
]
|
|
62876
62876
|
}
|
|
62877
62877
|
) }),
|
|
62878
|
-
/* @__PURE__ */ jsx(DialogContent, { className: "max-w-[85vw] p-0 data-[state=open]:visible data-[state=closed]:invisible", forceMount: !0, animateExit: !1, children: /* @__PURE__ */ jsx(ChatLayout, { ref: S, inputRef: _, userId:
|
|
62878
|
+
/* @__PURE__ */ jsx(DialogContent, { className: "max-w-[85vw] p-0 data-[state=open]:visible data-[state=closed]:invisible", forceMount: !0, animateExit: !1, children: /* @__PURE__ */ jsx(ChatLayout, { ref: S, inputRef: _, userId: f, userName: l ?? "Unknown user", apiKey: d ?? "" }) })
|
|
62879
62879
|
] }),
|
|
62880
62880
|
t
|
|
62881
62881
|
] })
|
|
@@ -62883,39 +62883,41 @@ const Navbar = forwardRef(
|
|
|
62883
62883
|
}
|
|
62884
62884
|
), Layout = forwardRef(({
|
|
62885
62885
|
children: e,
|
|
62886
|
-
|
|
62887
|
-
|
|
62888
|
-
|
|
62889
|
-
|
|
62890
|
-
|
|
62891
|
-
|
|
62892
|
-
|
|
62893
|
-
|
|
62894
|
-
|
|
62895
|
-
|
|
62896
|
-
|
|
62897
|
-
|
|
62886
|
+
appID: t,
|
|
62887
|
+
rightMenu: n,
|
|
62888
|
+
routes: o,
|
|
62889
|
+
footer: l,
|
|
62890
|
+
handleValidSearch: d,
|
|
62891
|
+
dashboardTitle: f,
|
|
62892
|
+
onSignOut: g,
|
|
62893
|
+
searchPlaceholder: b,
|
|
62894
|
+
withRandmarAssistant: _,
|
|
62895
|
+
chatUserName: S,
|
|
62896
|
+
chatApiKey: C,
|
|
62897
|
+
chatRef: E
|
|
62898
|
+
}, R) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(SidebarProvider, { children: /* @__PURE__ */ jsxs("div", { className: "flex grow", children: [
|
|
62898
62899
|
/* @__PURE__ */ jsx(
|
|
62899
62900
|
Navbar,
|
|
62900
62901
|
{
|
|
62901
|
-
|
|
62902
|
-
|
|
62903
|
-
|
|
62904
|
-
|
|
62905
|
-
|
|
62906
|
-
|
|
62907
|
-
|
|
62902
|
+
appID: t,
|
|
62903
|
+
routes: o,
|
|
62904
|
+
footer: l,
|
|
62905
|
+
dashboardTitle: f,
|
|
62906
|
+
withRandmarAssistant: _,
|
|
62907
|
+
chatUserName: S,
|
|
62908
|
+
chatApiKey: C,
|
|
62909
|
+
ref: E
|
|
62908
62910
|
}
|
|
62909
62911
|
),
|
|
62910
62912
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
62911
62913
|
/* @__PURE__ */ jsx(
|
|
62912
62914
|
Topbar,
|
|
62913
62915
|
{
|
|
62914
|
-
ref:
|
|
62915
|
-
onSignOut:
|
|
62916
|
-
rightMenu:
|
|
62917
|
-
handleValidSearch:
|
|
62918
|
-
searchPlaceholder:
|
|
62916
|
+
ref: R,
|
|
62917
|
+
onSignOut: g,
|
|
62918
|
+
rightMenu: n,
|
|
62919
|
+
handleValidSearch: d,
|
|
62920
|
+
searchPlaceholder: b
|
|
62919
62921
|
}
|
|
62920
62922
|
),
|
|
62921
62923
|
/* @__PURE__ */ jsx("main", { className: "flex-1 overflow-auto mt-16", children: e }),
|