@almadar/ui 2.18.0 → 2.19.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/components/index.cjs +10 -6
- package/dist/components/index.js +10 -6
- package/dist/components/organisms/game/three/index.cjs +2 -4
- package/dist/components/organisms/game/three/index.js +2 -4
- package/dist/docs/index.cjs +33 -33
- package/dist/docs/index.js +11 -11
- package/dist/hooks/index.cjs +2 -4
- package/dist/hooks/index.js +1 -3
- package/dist/marketing/index.cjs +34 -28
- package/dist/marketing/index.js +21 -15
- package/dist/providers/EventBusProvider.d.ts +14 -4
- package/dist/providers/index.cjs +5 -6
- package/dist/providers/index.js +4 -5
- package/dist/runtime/OrbPreview.d.ts +39 -0
- package/dist/runtime/index.cjs +139 -2
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +138 -2
- package/package.json +1 -1
- package/dist/internals/event-bus-context.d.ts +0 -15
|
@@ -4,6 +4,7 @@ var React86 = require('react');
|
|
|
4
4
|
var clsx = require('clsx');
|
|
5
5
|
var tailwindMerge = require('tailwind-merge');
|
|
6
6
|
var LucideIcons = require('lucide-react');
|
|
7
|
+
var providers = require('@almadar/ui/providers');
|
|
7
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
9
|
var evaluator = require('@almadar/evaluator');
|
|
9
10
|
var reactDom = require('react-dom');
|
|
@@ -57,9 +58,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
57
58
|
function cn(...inputs) {
|
|
58
59
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
59
60
|
}
|
|
60
|
-
var EventBusContext = React86.createContext(null);
|
|
61
|
-
|
|
62
|
-
// hooks/useEventBus.ts
|
|
63
61
|
function getGlobalEventBus() {
|
|
64
62
|
if (typeof window !== "undefined") {
|
|
65
63
|
return window.__kflowEventBus ?? null;
|
|
@@ -127,7 +125,7 @@ var fallbackEventBus = {
|
|
|
127
125
|
}
|
|
128
126
|
};
|
|
129
127
|
function useEventBus() {
|
|
130
|
-
const context = React86.useContext(EventBusContext);
|
|
128
|
+
const context = React86.useContext(providers.EventBusContext);
|
|
131
129
|
return context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
132
130
|
}
|
|
133
131
|
function useEventListener(event, handler) {
|
|
@@ -14907,8 +14905,14 @@ var HeroSection = ({
|
|
|
14907
14905
|
),
|
|
14908
14906
|
installCommand && /* @__PURE__ */ jsxRuntime.jsx(InstallBox, { command: installCommand }),
|
|
14909
14907
|
(primaryAction || secondaryAction) && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", align: "center", children: [
|
|
14910
|
-
primaryAction && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", size: "lg",
|
|
14911
|
-
|
|
14908
|
+
primaryAction && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", size: "lg", onClick: () => {
|
|
14909
|
+
const external = primaryAction.href.startsWith("http");
|
|
14910
|
+
window.open(primaryAction.href, external ? "_blank" : "_self");
|
|
14911
|
+
}, children: primaryAction.label }),
|
|
14912
|
+
secondaryAction && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", size: "lg", onClick: () => {
|
|
14913
|
+
const external = secondaryAction.href.startsWith("http");
|
|
14914
|
+
window.open(secondaryAction.href, external ? "_blank" : "_self");
|
|
14915
|
+
}, children: secondaryAction.label })
|
|
14912
14916
|
] }),
|
|
14913
14917
|
children
|
|
14914
14918
|
]
|
package/dist/components/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React86 from 'react';
|
|
2
|
-
import React86__default, {
|
|
2
|
+
import React86__default, { useCallback, createContext, useState, useRef, useLayoutEffect, useEffect, lazy, useContext, useMemo, useId, Suspense, useSyncExternalStore } from 'react';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import * as LucideIcons from 'lucide-react';
|
|
6
6
|
import { Loader2, ChevronDown, X, ArrowRight, TrendingDown, TrendingUp, Check, Copy, AlertCircle, User, Sun, Moon, FileQuestion, Inbox, Search, Info, XCircle, CheckCircle, AlertTriangle, ChevronRight, Filter, Plus, ChevronLeft, HelpCircle, ChevronUp, Zap, Sword, Move, Heart, Shield, Minus, Star, FileWarning, Upload, MoreHorizontal, ArrowLeft, Menu as Menu$1, ArrowUp, ArrowDown, MoreVertical, Package, Trash2, List as List$1, Printer, Play, RotateCcw, Send, Wrench, Bug, Pause, SkipForward, Code, FileText, WrapText, Settings, Bell, LogOut, ZoomOut, ZoomIn, Download, Image as Image$1, Eraser, Circle, Clock, CheckCircle2, Calendar, Pencil, Eye, Tag, DollarSign } from 'lucide-react';
|
|
7
|
+
import { EventBusContext } from '@almadar/ui/providers';
|
|
7
8
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
8
9
|
import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
9
10
|
import { createPortal } from 'react-dom';
|
|
@@ -27,9 +28,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
27
28
|
function cn(...inputs) {
|
|
28
29
|
return twMerge(clsx(inputs));
|
|
29
30
|
}
|
|
30
|
-
var EventBusContext = createContext(null);
|
|
31
|
-
|
|
32
|
-
// hooks/useEventBus.ts
|
|
33
31
|
function getGlobalEventBus() {
|
|
34
32
|
if (typeof window !== "undefined") {
|
|
35
33
|
return window.__kflowEventBus ?? null;
|
|
@@ -14877,8 +14875,14 @@ var HeroSection = ({
|
|
|
14877
14875
|
),
|
|
14878
14876
|
installCommand && /* @__PURE__ */ jsx(InstallBox, { command: installCommand }),
|
|
14879
14877
|
(primaryAction || secondaryAction) && /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "center", children: [
|
|
14880
|
-
primaryAction && /* @__PURE__ */ jsx(Button, { variant: "primary", size: "lg",
|
|
14881
|
-
|
|
14878
|
+
primaryAction && /* @__PURE__ */ jsx(Button, { variant: "primary", size: "lg", onClick: () => {
|
|
14879
|
+
const external = primaryAction.href.startsWith("http");
|
|
14880
|
+
window.open(primaryAction.href, external ? "_blank" : "_self");
|
|
14881
|
+
}, children: primaryAction.label }),
|
|
14882
|
+
secondaryAction && /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "lg", onClick: () => {
|
|
14883
|
+
const external = secondaryAction.href.startsWith("http");
|
|
14884
|
+
window.open(secondaryAction.href, external ? "_blank" : "_self");
|
|
14885
|
+
}, children: secondaryAction.label })
|
|
14882
14886
|
] }),
|
|
14883
14887
|
children
|
|
14884
14888
|
]
|
|
@@ -9,6 +9,7 @@ var GLTFLoader = require('three/examples/jsm/loaders/GLTFLoader');
|
|
|
9
9
|
var OrbitControls_js = require('three/examples/jsm/controls/OrbitControls.js');
|
|
10
10
|
var GLTFLoader_js = require('three/examples/jsm/loaders/GLTFLoader.js');
|
|
11
11
|
var OBJLoader_js = require('three/examples/jsm/loaders/OBJLoader.js');
|
|
12
|
+
var providers = require('@almadar/ui/providers');
|
|
12
13
|
var clsx = require('clsx');
|
|
13
14
|
var tailwindMerge = require('tailwind-merge');
|
|
14
15
|
|
|
@@ -1373,9 +1374,6 @@ function useRaycaster(options) {
|
|
|
1373
1374
|
isWithinCanvas
|
|
1374
1375
|
};
|
|
1375
1376
|
}
|
|
1376
|
-
var EventBusContext = React7.createContext(null);
|
|
1377
|
-
|
|
1378
|
-
// hooks/useEventBus.ts
|
|
1379
1377
|
function getGlobalEventBus() {
|
|
1380
1378
|
if (typeof window !== "undefined") {
|
|
1381
1379
|
return window.__kflowEventBus ?? null;
|
|
@@ -1443,7 +1441,7 @@ var fallbackEventBus = {
|
|
|
1443
1441
|
}
|
|
1444
1442
|
};
|
|
1445
1443
|
function useEventBus() {
|
|
1446
|
-
const context = React7.useContext(EventBusContext);
|
|
1444
|
+
const context = React7.useContext(providers.EventBusContext);
|
|
1447
1445
|
return context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
1448
1446
|
}
|
|
1449
1447
|
function useEmitEvent() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React7, { forwardRef, useRef, useEffect, useImperativeHandle,
|
|
1
|
+
import React7, { forwardRef, useRef, useEffect, useImperativeHandle, useState, useMemo, useCallback, Component, useContext } from 'react';
|
|
2
2
|
import { useThree, useFrame, Canvas } from '@react-three/fiber';
|
|
3
3
|
import * as THREE6 from 'three';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -7,6 +7,7 @@ import { GLTFLoader as GLTFLoader$1 } from 'three/examples/jsm/loaders/GLTFLoade
|
|
|
7
7
|
import { OrbitControls as OrbitControls$1 } from 'three/examples/jsm/controls/OrbitControls.js';
|
|
8
8
|
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
9
9
|
import { OBJLoader } from 'three/examples/jsm/loaders/OBJLoader.js';
|
|
10
|
+
import { EventBusContext } from '@almadar/ui/providers';
|
|
10
11
|
import { clsx } from 'clsx';
|
|
11
12
|
import { twMerge } from 'tailwind-merge';
|
|
12
13
|
|
|
@@ -1348,9 +1349,6 @@ function useRaycaster(options) {
|
|
|
1348
1349
|
isWithinCanvas
|
|
1349
1350
|
};
|
|
1350
1351
|
}
|
|
1351
|
-
var EventBusContext = createContext(null);
|
|
1352
|
-
|
|
1353
|
-
// hooks/useEventBus.ts
|
|
1354
1352
|
function getGlobalEventBus() {
|
|
1355
1353
|
if (typeof window !== "undefined") {
|
|
1356
1354
|
return window.__kflowEventBus ?? null;
|
package/dist/docs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React4 = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var LucideIcons = require('lucide-react');
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ function _interopNamespace(e) {
|
|
|
24
24
|
return Object.freeze(n);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var React4__default = /*#__PURE__*/_interopDefault(React4);
|
|
28
28
|
var LucideIcons__namespace = /*#__PURE__*/_interopNamespace(LucideIcons);
|
|
29
29
|
|
|
30
30
|
// node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
@@ -2506,7 +2506,7 @@ var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
|
2506
2506
|
function cn(...inputs) {
|
|
2507
2507
|
return twMerge(clsx(inputs));
|
|
2508
2508
|
}
|
|
2509
|
-
var EventBusContext =
|
|
2509
|
+
var EventBusContext = React4.createContext(null);
|
|
2510
2510
|
|
|
2511
2511
|
// hooks/useEventBus.ts
|
|
2512
2512
|
function getGlobalEventBus() {
|
|
@@ -2576,7 +2576,7 @@ var fallbackEventBus = {
|
|
|
2576
2576
|
}
|
|
2577
2577
|
};
|
|
2578
2578
|
function useEventBus() {
|
|
2579
|
-
const context =
|
|
2579
|
+
const context = React4.useContext(EventBusContext);
|
|
2580
2580
|
return context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
2581
2581
|
}
|
|
2582
2582
|
var paddingStyles = {
|
|
@@ -2681,7 +2681,7 @@ var positionStyles = {
|
|
|
2681
2681
|
fixed: "fixed",
|
|
2682
2682
|
sticky: "sticky"
|
|
2683
2683
|
};
|
|
2684
|
-
var Box =
|
|
2684
|
+
var Box = React4__default.default.forwardRef(
|
|
2685
2685
|
({
|
|
2686
2686
|
padding,
|
|
2687
2687
|
paddingX,
|
|
@@ -2710,20 +2710,20 @@ var Box = React3__default.default.forwardRef(
|
|
|
2710
2710
|
...rest
|
|
2711
2711
|
}, ref) => {
|
|
2712
2712
|
const eventBus = useEventBus();
|
|
2713
|
-
const handleClick =
|
|
2713
|
+
const handleClick = React4.useCallback((e) => {
|
|
2714
2714
|
if (action) {
|
|
2715
2715
|
e.stopPropagation();
|
|
2716
2716
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
2717
2717
|
}
|
|
2718
2718
|
onClick?.(e);
|
|
2719
2719
|
}, [action, actionPayload, eventBus, onClick]);
|
|
2720
|
-
const handleMouseEnter =
|
|
2720
|
+
const handleMouseEnter = React4.useCallback((e) => {
|
|
2721
2721
|
if (hoverEvent) {
|
|
2722
2722
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
2723
2723
|
}
|
|
2724
2724
|
onMouseEnter?.(e);
|
|
2725
2725
|
}, [hoverEvent, eventBus, onMouseEnter]);
|
|
2726
|
-
const handleMouseLeave =
|
|
2726
|
+
const handleMouseLeave = React4.useCallback((e) => {
|
|
2727
2727
|
if (hoverEvent) {
|
|
2728
2728
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
2729
2729
|
}
|
|
@@ -3107,7 +3107,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3107
3107
|
const IconComp = value;
|
|
3108
3108
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
3109
3109
|
}
|
|
3110
|
-
if (
|
|
3110
|
+
if (React4__default.default.isValidElement(value)) {
|
|
3111
3111
|
return value;
|
|
3112
3112
|
}
|
|
3113
3113
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -3116,7 +3116,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3116
3116
|
}
|
|
3117
3117
|
return value;
|
|
3118
3118
|
}
|
|
3119
|
-
var Button =
|
|
3119
|
+
var Button = React4__default.default.forwardRef(
|
|
3120
3120
|
({
|
|
3121
3121
|
className,
|
|
3122
3122
|
variant = "primary",
|
|
@@ -3216,7 +3216,7 @@ var shadowStyles2 = {
|
|
|
3216
3216
|
md: "shadow-[var(--shadow-main)]",
|
|
3217
3217
|
lg: "shadow-[var(--shadow-lg)]"
|
|
3218
3218
|
};
|
|
3219
|
-
var Card =
|
|
3219
|
+
var Card = React4__default.default.forwardRef(
|
|
3220
3220
|
({
|
|
3221
3221
|
className,
|
|
3222
3222
|
variant = "bordered",
|
|
@@ -3252,9 +3252,9 @@ var Card = React3__default.default.forwardRef(
|
|
|
3252
3252
|
}
|
|
3253
3253
|
);
|
|
3254
3254
|
Card.displayName = "Card";
|
|
3255
|
-
var CardHeader =
|
|
3255
|
+
var CardHeader = React4__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3256
3256
|
CardHeader.displayName = "CardHeader";
|
|
3257
|
-
var CardTitle =
|
|
3257
|
+
var CardTitle = React4__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3258
3258
|
"h3",
|
|
3259
3259
|
{
|
|
3260
3260
|
ref,
|
|
@@ -3267,11 +3267,11 @@ var CardTitle = React3__default.default.forwardRef(({ className, ...props }, ref
|
|
|
3267
3267
|
}
|
|
3268
3268
|
));
|
|
3269
3269
|
CardTitle.displayName = "CardTitle";
|
|
3270
|
-
var CardContent =
|
|
3270
|
+
var CardContent = React4__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
|
|
3271
3271
|
CardContent.displayName = "CardContent";
|
|
3272
3272
|
var CardBody = CardContent;
|
|
3273
3273
|
CardBody.displayName = "CardBody";
|
|
3274
|
-
var CardFooter =
|
|
3274
|
+
var CardFooter = React4__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3275
3275
|
"div",
|
|
3276
3276
|
{
|
|
3277
3277
|
ref,
|
|
@@ -3350,7 +3350,7 @@ var Divider = ({
|
|
|
3350
3350
|
);
|
|
3351
3351
|
};
|
|
3352
3352
|
Divider.displayName = "Divider";
|
|
3353
|
-
var Input =
|
|
3353
|
+
var Input = React4__default.default.forwardRef(
|
|
3354
3354
|
({
|
|
3355
3355
|
className,
|
|
3356
3356
|
inputType,
|
|
@@ -3463,7 +3463,7 @@ var Input = React3__default.default.forwardRef(
|
|
|
3463
3463
|
);
|
|
3464
3464
|
Input.displayName = "Input";
|
|
3465
3465
|
var DocSidebarCategory = ({ item, depth }) => {
|
|
3466
|
-
const [expanded, setExpanded] =
|
|
3466
|
+
const [expanded, setExpanded] = React4.useState(
|
|
3467
3467
|
() => item.items?.some(function hasActive(child) {
|
|
3468
3468
|
if (child.active) return true;
|
|
3469
3469
|
return child.items?.some(hasActive) ?? false;
|
|
@@ -3618,7 +3618,7 @@ var DocBreadcrumb = ({
|
|
|
3618
3618
|
"aria-label": "Breadcrumb",
|
|
3619
3619
|
children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
3620
3620
|
const isLast = idx === items.length - 1;
|
|
3621
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3621
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React4__default.default.Fragment, { children: [
|
|
3622
3622
|
idx > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3623
3623
|
Icon,
|
|
3624
3624
|
{
|
|
@@ -3670,8 +3670,8 @@ function DocCodeBlock({
|
|
|
3670
3670
|
showLineNumbers = false,
|
|
3671
3671
|
className
|
|
3672
3672
|
}) {
|
|
3673
|
-
const [copied, setCopied] =
|
|
3674
|
-
const handleCopy =
|
|
3673
|
+
const [copied, setCopied] = React4.useState(false);
|
|
3674
|
+
const handleCopy = React4.useCallback(() => {
|
|
3675
3675
|
void navigator.clipboard.writeText(code).then(() => {
|
|
3676
3676
|
setCopied(true);
|
|
3677
3677
|
setTimeout(() => setCopied(false), 2e3);
|
|
@@ -3836,13 +3836,13 @@ function DocSearch({
|
|
|
3836
3836
|
onSearch,
|
|
3837
3837
|
className
|
|
3838
3838
|
}) {
|
|
3839
|
-
const [query, setQuery] =
|
|
3840
|
-
const [results, setResults] =
|
|
3841
|
-
const [isOpen, setIsOpen] =
|
|
3842
|
-
const [activeIndex, setActiveIndex] =
|
|
3843
|
-
const containerRef =
|
|
3844
|
-
const debounceRef =
|
|
3845
|
-
|
|
3839
|
+
const [query, setQuery] = React4.useState("");
|
|
3840
|
+
const [results, setResults] = React4.useState([]);
|
|
3841
|
+
const [isOpen, setIsOpen] = React4.useState(false);
|
|
3842
|
+
const [activeIndex, setActiveIndex] = React4.useState(-1);
|
|
3843
|
+
const containerRef = React4.useRef(null);
|
|
3844
|
+
const debounceRef = React4.useRef(void 0);
|
|
3845
|
+
React4.useEffect(() => {
|
|
3846
3846
|
function handleClickOutside(e) {
|
|
3847
3847
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
3848
3848
|
setIsOpen(false);
|
|
@@ -3851,7 +3851,7 @@ function DocSearch({
|
|
|
3851
3851
|
document.addEventListener("mousedown", handleClickOutside);
|
|
3852
3852
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
3853
3853
|
}, []);
|
|
3854
|
-
const performSearch =
|
|
3854
|
+
const performSearch = React4.useCallback(
|
|
3855
3855
|
(value) => {
|
|
3856
3856
|
if (!onSearch || !value.trim()) {
|
|
3857
3857
|
setResults([]);
|
|
@@ -3873,7 +3873,7 @@ function DocSearch({
|
|
|
3873
3873
|
},
|
|
3874
3874
|
[onSearch]
|
|
3875
3875
|
);
|
|
3876
|
-
const handleChange =
|
|
3876
|
+
const handleChange = React4.useCallback(
|
|
3877
3877
|
(e) => {
|
|
3878
3878
|
const value = e.target.value;
|
|
3879
3879
|
setQuery(value);
|
|
@@ -3886,18 +3886,18 @@ function DocSearch({
|
|
|
3886
3886
|
},
|
|
3887
3887
|
[performSearch]
|
|
3888
3888
|
);
|
|
3889
|
-
const handleFocus =
|
|
3889
|
+
const handleFocus = React4.useCallback(() => {
|
|
3890
3890
|
if (results.length > 0) {
|
|
3891
3891
|
setIsOpen(true);
|
|
3892
3892
|
}
|
|
3893
3893
|
}, [results]);
|
|
3894
|
-
const navigateTo =
|
|
3894
|
+
const navigateTo = React4.useCallback((href) => {
|
|
3895
3895
|
setIsOpen(false);
|
|
3896
3896
|
setQuery("");
|
|
3897
3897
|
setResults([]);
|
|
3898
3898
|
window.location.href = href;
|
|
3899
3899
|
}, []);
|
|
3900
|
-
const handleKeyDown =
|
|
3900
|
+
const handleKeyDown = React4.useCallback(
|
|
3901
3901
|
(e) => {
|
|
3902
3902
|
if (e.key === "Escape") {
|
|
3903
3903
|
setIsOpen(false);
|
|
@@ -3924,7 +3924,7 @@ function DocSearch({
|
|
|
3924
3924
|
},
|
|
3925
3925
|
[isOpen, results, activeIndex, navigateTo]
|
|
3926
3926
|
);
|
|
3927
|
-
|
|
3927
|
+
React4.useEffect(() => {
|
|
3928
3928
|
return () => {
|
|
3929
3929
|
if (debounceRef.current) {
|
|
3930
3930
|
clearTimeout(debounceRef.current);
|
package/dist/docs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React4, { createContext, useCallback, useContext, useState, useRef, useEffect } from 'react';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import * as LucideIcons from 'lucide-react';
|
|
4
4
|
import { Loader2, ChevronDown, X } from 'lucide-react';
|
|
@@ -2657,7 +2657,7 @@ var positionStyles = {
|
|
|
2657
2657
|
fixed: "fixed",
|
|
2658
2658
|
sticky: "sticky"
|
|
2659
2659
|
};
|
|
2660
|
-
var Box =
|
|
2660
|
+
var Box = React4.forwardRef(
|
|
2661
2661
|
({
|
|
2662
2662
|
padding,
|
|
2663
2663
|
paddingX,
|
|
@@ -3083,7 +3083,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3083
3083
|
const IconComp = value;
|
|
3084
3084
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
3085
3085
|
}
|
|
3086
|
-
if (
|
|
3086
|
+
if (React4.isValidElement(value)) {
|
|
3087
3087
|
return value;
|
|
3088
3088
|
}
|
|
3089
3089
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -3092,7 +3092,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3092
3092
|
}
|
|
3093
3093
|
return value;
|
|
3094
3094
|
}
|
|
3095
|
-
var Button =
|
|
3095
|
+
var Button = React4.forwardRef(
|
|
3096
3096
|
({
|
|
3097
3097
|
className,
|
|
3098
3098
|
variant = "primary",
|
|
@@ -3192,7 +3192,7 @@ var shadowStyles2 = {
|
|
|
3192
3192
|
md: "shadow-[var(--shadow-main)]",
|
|
3193
3193
|
lg: "shadow-[var(--shadow-lg)]"
|
|
3194
3194
|
};
|
|
3195
|
-
var Card =
|
|
3195
|
+
var Card = React4.forwardRef(
|
|
3196
3196
|
({
|
|
3197
3197
|
className,
|
|
3198
3198
|
variant = "bordered",
|
|
@@ -3228,9 +3228,9 @@ var Card = React3.forwardRef(
|
|
|
3228
3228
|
}
|
|
3229
3229
|
);
|
|
3230
3230
|
Card.displayName = "Card";
|
|
3231
|
-
var CardHeader =
|
|
3231
|
+
var CardHeader = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3232
3232
|
CardHeader.displayName = "CardHeader";
|
|
3233
|
-
var CardTitle =
|
|
3233
|
+
var CardTitle = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3234
3234
|
"h3",
|
|
3235
3235
|
{
|
|
3236
3236
|
ref,
|
|
@@ -3243,11 +3243,11 @@ var CardTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
3243
3243
|
}
|
|
3244
3244
|
));
|
|
3245
3245
|
CardTitle.displayName = "CardTitle";
|
|
3246
|
-
var CardContent =
|
|
3246
|
+
var CardContent = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3247
3247
|
CardContent.displayName = "CardContent";
|
|
3248
3248
|
var CardBody = CardContent;
|
|
3249
3249
|
CardBody.displayName = "CardBody";
|
|
3250
|
-
var CardFooter =
|
|
3250
|
+
var CardFooter = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3251
3251
|
"div",
|
|
3252
3252
|
{
|
|
3253
3253
|
ref,
|
|
@@ -3326,7 +3326,7 @@ var Divider = ({
|
|
|
3326
3326
|
);
|
|
3327
3327
|
};
|
|
3328
3328
|
Divider.displayName = "Divider";
|
|
3329
|
-
var Input =
|
|
3329
|
+
var Input = React4.forwardRef(
|
|
3330
3330
|
({
|
|
3331
3331
|
className,
|
|
3332
3332
|
inputType,
|
|
@@ -3594,7 +3594,7 @@ var DocBreadcrumb = ({
|
|
|
3594
3594
|
"aria-label": "Breadcrumb",
|
|
3595
3595
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
3596
3596
|
const isLast = idx === items.length - 1;
|
|
3597
|
-
return /* @__PURE__ */ jsxs(
|
|
3597
|
+
return /* @__PURE__ */ jsxs(React4.Fragment, { children: [
|
|
3598
3598
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
3599
3599
|
Icon,
|
|
3600
3600
|
{
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React2 = require('react');
|
|
4
|
+
var providers = require('@almadar/ui/providers');
|
|
4
5
|
require('react/jsx-runtime');
|
|
5
6
|
var reactQuery = require('@tanstack/react-query');
|
|
6
7
|
|
|
@@ -871,9 +872,6 @@ function useDeepAgentGeneration() {
|
|
|
871
872
|
submitInterruptDecisions
|
|
872
873
|
};
|
|
873
874
|
}
|
|
874
|
-
var EventBusContext = React2.createContext(null);
|
|
875
|
-
|
|
876
|
-
// hooks/useEventBus.ts
|
|
877
875
|
function getGlobalEventBus() {
|
|
878
876
|
if (typeof window !== "undefined") {
|
|
879
877
|
return window.__kflowEventBus ?? null;
|
|
@@ -941,7 +939,7 @@ var fallbackEventBus = {
|
|
|
941
939
|
}
|
|
942
940
|
};
|
|
943
941
|
function useEventBus() {
|
|
944
|
-
const context = React2.useContext(EventBusContext);
|
|
942
|
+
const context = React2.useContext(providers.EventBusContext);
|
|
945
943
|
return context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
946
944
|
}
|
|
947
945
|
function useEventListener(event, handler) {
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React2, { createContext, useCallback, useState, useEffect, useMemo, useContext, useRef, useSyncExternalStore } from 'react';
|
|
2
|
+
import { EventBusContext } from '@almadar/ui/providers';
|
|
2
3
|
import 'react/jsx-runtime';
|
|
3
4
|
import { useQueryClient, useMutation, useQuery } from '@tanstack/react-query';
|
|
4
5
|
|
|
@@ -865,9 +866,6 @@ function useDeepAgentGeneration() {
|
|
|
865
866
|
submitInterruptDecisions
|
|
866
867
|
};
|
|
867
868
|
}
|
|
868
|
-
var EventBusContext = createContext(null);
|
|
869
|
-
|
|
870
|
-
// hooks/useEventBus.ts
|
|
871
869
|
function getGlobalEventBus() {
|
|
872
870
|
if (typeof window !== "undefined") {
|
|
873
871
|
return window.__kflowEventBus ?? null;
|