@norskvideo/norsk-studio 1.27.0-2025-05-21-b03b48ea → 1.27.0-2025-05-26-a443eb84
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/lib/client/cpu.js +1 -11
- package/lib/client/cpu.js.map +1 -1
- package/lib/client/creator.d.ts +0 -2
- package/lib/client/creator.js +3 -3
- package/lib/client/creator.js.map +1 -1
- package/lib/client/jsx/components/node.js +5 -4
- package/lib/client/jsx/components/node.js.map +1 -1
- package/lib/client/jsx/components/studio-sidebar-footer.d.ts +2 -0
- package/lib/client/jsx/components/studio-sidebar-footer.js +14 -0
- package/lib/client/jsx/components/studio-sidebar-footer.js.map +1 -0
- package/lib/client/jsx/components/studio-sidebar-header.d.ts +10 -0
- package/lib/client/jsx/components/studio-sidebar-header.js +37 -0
- package/lib/client/jsx/components/studio-sidebar-header.js.map +1 -0
- package/lib/client/jsx/components/studio-sidebar.d.ts +16 -0
- package/lib/client/jsx/components/studio-sidebar.js +200 -0
- package/lib/client/jsx/components/studio-sidebar.js.map +1 -0
- package/lib/client/jsx/components/toolbox.d.ts +12 -0
- package/lib/client/jsx/components/toolbox.js +94 -0
- package/lib/client/jsx/components/toolbox.js.map +1 -0
- package/lib/client/jsx/connection-editor.d.ts +2 -8
- package/lib/client/jsx/connection-editor.js +19 -17
- package/lib/client/jsx/connection-editor.js.map +1 -1
- package/lib/client/jsx/context/sidebar.d.ts +44 -0
- package/lib/client/jsx/context/sidebar.js +15 -0
- package/lib/client/jsx/context/sidebar.js.map +1 -0
- package/lib/client/jsx/global-configuration.d.ts +11 -0
- package/lib/client/jsx/global-configuration.js +18 -0
- package/lib/client/jsx/global-configuration.js.map +1 -0
- package/lib/client/jsx/hooks/alerts.d.ts +9 -0
- package/lib/client/jsx/hooks/alerts.js +22 -0
- package/lib/client/jsx/hooks/alerts.js.map +1 -0
- package/lib/client/jsx/hooks/toolbox.d.ts +6 -0
- package/lib/client/jsx/hooks/toolbox.js +238 -0
- package/lib/client/jsx/hooks/toolbox.js.map +1 -0
- package/lib/client/jsx/node-editor.d.ts +20 -21
- package/lib/client/jsx/node-editor.js +30 -33
- package/lib/client/jsx/node-editor.js.map +1 -1
- package/lib/client/jsx/selected-connection.d.ts +0 -2
- package/lib/client/jsx/selected-connection.js +4 -4
- package/lib/client/jsx/selected-connection.js.map +1 -1
- package/lib/client/jsx/selected-node.d.ts +0 -2
- package/lib/client/jsx/selected-node.js +54 -75
- package/lib/client/jsx/selected-node.js.map +1 -1
- package/lib/client/jsx/selected.d.ts +4 -13
- package/lib/client/jsx/selected.js +9 -5
- package/lib/client/jsx/selected.js.map +1 -1
- package/lib/client/jsx/shadcn-ui/accordion.d.ts +8 -0
- package/lib/client/jsx/shadcn-ui/accordion.js +50 -0
- package/lib/client/jsx/shadcn-ui/accordion.js.map +1 -0
- package/lib/client/jsx/shadcn-ui/command.d.ts +2 -1
- package/lib/client/jsx/shadcn-ui/command.js +31 -1
- package/lib/client/jsx/shadcn-ui/command.js.map +1 -1
- package/lib/client/jsx/shadcn-ui/separator.d.ts +4 -0
- package/lib/client/jsx/shadcn-ui/separator.js +34 -0
- package/lib/client/jsx/shadcn-ui/separator.js.map +1 -0
- package/lib/client/jsx/shadcn-ui/sidebar.d.ts +66 -0
- package/lib/client/jsx/shadcn-ui/sidebar.js +233 -0
- package/lib/client/jsx/shadcn-ui/sidebar.js.map +1 -0
- package/lib/client/jsx/shadcn-ui/skeleton.d.ts +2 -0
- package/lib/client/jsx/shadcn-ui/skeleton.js +9 -0
- package/lib/client/jsx/shadcn-ui/skeleton.js.map +1 -0
- package/lib/client/jsx/shadcn-ui/sonner.d.ts +3 -0
- package/lib/client/jsx/shadcn-ui/sonner.js +16 -0
- package/lib/client/jsx/shadcn-ui/sonner.js.map +1 -0
- package/lib/client/jsx/types/toolbox.d.ts +58 -0
- package/lib/client/jsx/types/toolbox.js +3 -0
- package/lib/client/jsx/types/toolbox.js.map +1 -0
- package/lib/client/navbar-right.js +12 -28
- package/lib/client/navbar-right.js.map +1 -1
- package/lib/client/rete/node.d.ts +10 -2
- package/lib/client/session-view.js +9 -6
- package/lib/client/session-view.js.map +1 -1
- package/lib/client/session.d.ts +5 -4
- package/lib/client/session.js +9 -7
- package/lib/client/session.js.map +1 -1
- package/lib/client/studio-layout.js +9 -3
- package/lib/client/studio-layout.js.map +1 -1
- package/lib/client/tools.d.ts +4 -6
- package/lib/client/tools.js +7 -312
- package/lib/client/tools.js.map +1 -1
- package/lib/extension/client-types.d.ts +3 -0
- package/lib/extension/client-types.js.map +1 -1
- package/lib/extension/runtime-types.d.ts +4 -1
- package/lib/extension/runtime-types.js +391 -3
- package/lib/extension/runtime-types.js.map +1 -1
- package/lib/runtime/execution.d.ts +2 -0
- package/lib/runtime/execution.js +43 -2
- package/lib/runtime/execution.js.map +1 -1
- package/lib/runtime/stream-registration.d.ts +5 -1
- package/lib/runtime/stream-registration.js +10 -0
- package/lib/runtime/stream-registration.js.map +1 -1
- package/lib/server/index.js +11 -0
- package/lib/server/index.js.map +1 -1
- package/lib/server/runner.js +3 -0
- package/lib/server/runner.js.map +1 -1
- package/lib/server/session.d.ts +7 -1
- package/lib/server/session.js +6 -0
- package/lib/server/session.js.map +1 -1
- package/lib/shared/names.d.ts +1 -0
- package/lib/shared/names.js +2 -1
- package/lib/shared/names.js.map +1 -1
- package/lib/shared/server-msg.d.ts +6 -5
- package/lib/test/_util/driver.js +11 -0
- package/lib/test/_util/driver.js.map +1 -1
- package/lib/test/_util/manual-driver.js +2 -1
- package/lib/test/_util/manual-driver.js.map +1 -1
- package/lib/test/_util/runtime.js +2 -2
- package/lib/test/_util/sinks.d.ts +2 -0
- package/lib/test/_util/sinks.js.map +1 -1
- package/lib/test/client-liveview.js +11 -11
- package/lib/test/client-liveview.js.map +1 -1
- package/lib/test/preview-endpoints.d.ts +1 -0
- package/lib/test/preview-endpoints.js +423 -0
- package/lib/test/preview-endpoints.js.map +1 -0
- package/lib/types/base.yml +15 -0
- package/lib/types/stream-mapping.yaml +12 -0
- package/lib/types.d.ts +14 -0
- package/lib/types.yaml +17 -0
- package/package.json +9 -7
- package/static/style.css +918 -3992
- package/static/tailwind.css +6 -2
- package/tailwind-theme.js +19 -2
- package/tailwind.config.js +0 -6
- package/ui/index.html +7 -9
- package/ui/index.js +22922 -30519
- package/lib/client/jsx/modal.d.ts +0 -30
- package/lib/client/jsx/modal.js +0 -71
- package/lib/client/jsx/modal.js.map +0 -1
- package/lib/client/jsx/toolbox.d.ts +0 -14
- package/lib/client/jsx/toolbox.js +0 -42
- package/lib/client/jsx/toolbox.js.map +0 -1
- package/lib/client/jsx/upstream/Accordion.d.ts +0 -30
- package/lib/client/jsx/upstream/Accordion.js +0 -65
- package/lib/client/jsx/upstream/Accordion.js.map +0 -1
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import { Root } from "react-dom/client";
|
|
3
|
-
export type OkOpts = {
|
|
4
|
-
cancel: () => void;
|
|
5
|
-
};
|
|
6
|
-
export default class ModalInterface {
|
|
7
|
-
static root: Root;
|
|
8
|
-
static setDisabled: (disabled: boolean) => void;
|
|
9
|
-
constructor();
|
|
10
|
-
show(opts: {
|
|
11
|
-
title: string;
|
|
12
|
-
okText: string;
|
|
13
|
-
cancelText: string;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
children: ReactNode;
|
|
16
|
-
onOk: (opts: OkOpts) => void;
|
|
17
|
-
}): void;
|
|
18
|
-
set disabled(disabled: boolean);
|
|
19
|
-
static hide(): void;
|
|
20
|
-
hide(): void;
|
|
21
|
-
}
|
|
22
|
-
export declare function ModalComponent(opts: {
|
|
23
|
-
title: string;
|
|
24
|
-
okText: string;
|
|
25
|
-
cancelText: string;
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
children: ReactNode;
|
|
28
|
-
onOk: (opts: OkOpts) => void;
|
|
29
|
-
onClose: () => void;
|
|
30
|
-
}): import("react/jsx-runtime").JSX.Element;
|
package/lib/client/jsx/modal.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ModalComponent = ModalComponent;
|
|
27
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
-
const FC = __importStar(require("flowbite-react"));
|
|
29
|
-
const react_1 = require("react");
|
|
30
|
-
const client_1 = require("react-dom/client");
|
|
31
|
-
class ModalInterface {
|
|
32
|
-
static root;
|
|
33
|
-
static setDisabled = () => { };
|
|
34
|
-
constructor() {
|
|
35
|
-
if (!ModalInterface.root)
|
|
36
|
-
ModalInterface.root = (0, client_1.createRoot)(document.getElementById("modal-react-root"));
|
|
37
|
-
}
|
|
38
|
-
show(opts) {
|
|
39
|
-
ModalInterface.root.render((0, react_1.createElement)(ModalComponent, {
|
|
40
|
-
...opts,
|
|
41
|
-
onClose: this.hide.bind(this),
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
set disabled(disabled) {
|
|
45
|
-
ModalInterface.setDisabled(disabled);
|
|
46
|
-
}
|
|
47
|
-
static hide() {
|
|
48
|
-
ModalInterface.root.render(undefined);
|
|
49
|
-
}
|
|
50
|
-
hide() {
|
|
51
|
-
ModalInterface.hide();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.default = ModalInterface;
|
|
55
|
-
function ModalComponent(opts) {
|
|
56
|
-
const [disabled, setDisabled] = (0, react_1.useState)(opts.disabled ?? false);
|
|
57
|
-
ModalInterface.setDisabled = setDisabled;
|
|
58
|
-
const ok = (event) => {
|
|
59
|
-
opts.onOk({
|
|
60
|
-
cancel: () => {
|
|
61
|
-
event.stopPropagation();
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
ModalInterface.hide();
|
|
65
|
-
};
|
|
66
|
-
const cancel = () => {
|
|
67
|
-
ModalInterface.hide();
|
|
68
|
-
};
|
|
69
|
-
return (0, jsx_runtime_1.jsxs)(FC.Modal, { show: true, dismissible: true, onClose: cancel, children: [(0, jsx_runtime_1.jsx)(FC.Modal.Header, { children: opts.title }), (0, jsx_runtime_1.jsx)(FC.Modal.Body, { children: opts.children }), (0, jsx_runtime_1.jsxs)(FC.Modal.Footer, { children: [(0, jsx_runtime_1.jsx)(FC.Button, { color: "blue", onClick: ok, disabled: disabled, children: opts.okText }), (0, jsx_runtime_1.jsx)(FC.Button, { color: "gray", onClick: cancel, children: opts.cancelText })] })] });
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=modal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../../src/client/jsx/modal.tsx"],"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I,EAAE,CAAC;IACxB,CAAC,CAAC;IACF,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,cAAc,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC,CAAC;IAIF,OAAO,wBAAC,EAAE,CAAC,KAAK,IAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAC7D,uBAAC,EAAE,CAAC,KAAK,CAAC,MAAM,cAAE,IAAI,CAAC,KAAK,GAAmB,EAC/C,uBAAC,EAAE,CAAC,KAAK,CAAC,IAAI,cACX,IAAI,CAAC,QAAQ,GACA,EAChB,wBAAC,EAAE,CAAC,KAAK,CAAC,MAAM,eACd,uBAAC,EAAE,CAAC,MAAM,IAAC,KAAK,EAAC,MAAM,EAAC,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,YAAG,IAAI,CAAC,MAAM,GAAa,EAClF,uBAAC,EAAE,CAAC,MAAM,IAAC,KAAK,EAAC,MAAM,EAAC,OAAO,EAAE,MAAM,YAAG,IAAI,CAAC,UAAU,GAAa,IACtD,IACT,CAAC;AACd,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type Tool = {
|
|
2
|
-
name: string;
|
|
3
|
-
type: string;
|
|
4
|
-
icon?: React.ComponentType;
|
|
5
|
-
};
|
|
6
|
-
export type ToolGroup = {
|
|
7
|
-
title: string;
|
|
8
|
-
tools: Tool[];
|
|
9
|
-
};
|
|
10
|
-
export default Toolbox;
|
|
11
|
-
export declare function Toolbox(props: {
|
|
12
|
-
toolGroups: ToolGroup[];
|
|
13
|
-
onDragStart: (tool: Tool) => void;
|
|
14
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Toolbox = Toolbox;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const lucide_react_1 = require("lucide-react");
|
|
6
|
-
const names_1 = require("../../shared/names");
|
|
7
|
-
const Accordion_1 = require("./upstream/Accordion");
|
|
8
|
-
const tailwind_merge_1 = require("tailwind-merge");
|
|
9
|
-
exports.default = Toolbox;
|
|
10
|
-
function Toolbox(props) {
|
|
11
|
-
const classNamesRoot = "-mt-4";
|
|
12
|
-
const themeTitle = { open: { on: "text-gray-800 dark:text-white", off: "text-gray-800 dark:text-white" } };
|
|
13
|
-
const themeContent = { base: "bg-transparent" };
|
|
14
|
-
return (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { flush: true, id: names_1.toolboxId, alwaysOpen: true, className: classNamesRoot, children: props.toolGroups.map((toolGroup, _idx) => {
|
|
15
|
-
return (0, jsx_runtime_1.jsxs)(Accordion_1.Accordion.Panel, { isOpen: true, children: [(0, jsx_runtime_1.jsx)(Accordion_1.Accordion.Title, { theme: themeTitle, children: toolGroup.title }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion.Content, { theme: themeContent, children: (0, jsx_runtime_1.jsx)("div", { className: "pl-4 pr-6 py-5 border-none border-gray-200 dark:border-gray-700 grid grid-cols-2 gap-3", children: toolGroup.tools.map((tool) => (0, jsx_runtime_1.jsx)(ToolboxItem, { variant: toolGroup.title == "Inputs" ? "blue" : toolGroup.title == "Processors" ? "yellow" : "green", name: tool.name, tool: tool, onDragStart: props.onDragStart }, tool.type)) }) })] }, toolGroup.title);
|
|
16
|
-
}) });
|
|
17
|
-
}
|
|
18
|
-
function ToolboxItem({ name, tool, onDragStart, variant }) {
|
|
19
|
-
const cardClasses = "bg-gray-50 hover:bg-gray-100 border-gray-200 dark:border-gray-600 dark:hover:bg-gray-600/10 dark:bg-transparent";
|
|
20
|
-
let iconClasses = "group-hover:bg-blue-500 border-gray-200 dark:border-gray-600";
|
|
21
|
-
switch (variant) {
|
|
22
|
-
case "green":
|
|
23
|
-
iconClasses = "bg-green-100 group-hover:bg-green-400 border-green-400/50 dark:bg-green-500/50 dark:border-green-600/50";
|
|
24
|
-
break;
|
|
25
|
-
case "blue":
|
|
26
|
-
iconClasses = "bg-blue-100 group-hover:bg-blue-400 border-blue-400/50 dark:bg-blue-500/50 dark:border-blue-600/50";
|
|
27
|
-
break;
|
|
28
|
-
case "yellow":
|
|
29
|
-
iconClasses = "bg-yellow-100 group-hover:bg-yellow-400 border-yellow-400/50 dark:bg-yellow-500/50 dark:border-yellow-400/50";
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
return (0, jsx_runtime_1.jsxs)("div", { className: (0, tailwind_merge_1.twMerge)("p-2 w-full h-20 flex flex-col items-center rounded-lg border group transition-all cursor-grab active:cursor-grabbing hover:scale-[103%] duration-200 drop-shadow hover:drop-shadow-md", cardClasses), draggable: "true", onDragStart: onItemDragStart(tool, onDragStart), children: [(0, jsx_runtime_1.jsx)("div", { className: (0, tailwind_merge_1.twMerge)("flex justify-center items-center h-8 w-8 p-1 border transition-all rounded", iconClasses), children: tool.icon ?
|
|
33
|
-
(0, jsx_runtime_1.jsx)(tool.icon, {})
|
|
34
|
-
:
|
|
35
|
-
(0, jsx_runtime_1.jsx)(lucide_react_1.SquareDashed, { size: 48, className: "text-black group-hover:text-white transition-colors dark:text-white" }) }), (0, jsx_runtime_1.jsx)("div", { className: "font-bold text-center text-xs my-auto text-gray-500 dark:text-gray-50", children: name })] });
|
|
36
|
-
}
|
|
37
|
-
function onItemDragStart(tool, cb) {
|
|
38
|
-
return () => {
|
|
39
|
-
cb(tool);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=toolbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toolbox.js","sourceRoot":"","sources":["../../../src/client/jsx/toolbox.tsx"],"names":[],"mappings":";;AAgBA,0BAkBC;;AAlCD,+CAA4C;AAC5C,8CAA+C;AAC/C,oDAAiD;AACjD,mDAAyC;AAWzC,kBAAe,OAAO,CAAC;AAEvB,SAAgB,OAAO,CAAC,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ACtI,IAAI,WAAW,GAAG,8DAA8D,CAAC;IACjF,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO;YACV,WAAW,GAAG,yGAAyG,CAAC;YACxH,MAAM;QACR,KAAK,MAAM;YACT,WAAW,GAAG,oGAAoG,CAAC;YACnH,MAAM;QACR,KAAK,QAAQ;YACX,WAAW,GAAG,8GAA8G,CAAC;YAC7H,MAAM;IACV,CAAC;IAGD,OAAO,iCAAK,SAAS,EAAE,IAAA,wBAAO,EAAC,wLAAwL,EAAE,WAAW,CAAC,EAAE,SAAS,EAAC,MAAM,EAAC,WAAW,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,aACrS,gCAAK,SAAS,EAAE,IAAA,wBAAO,EAAC,4EAA4E,EAAE,WAAW,CAAC,YAC/G,IAAI,CAAC,IAAI,CAAC,CAAC;oBACV,uBAAC,IAAI,CAAC,IAAI,KAAG;oBACb,CAAC;wBACD,uBAAC,2BAAY,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,qEAAqE,GAAG,GAExG,EACN,gCAAK,SAAS,EAAC,uEAAuE,YAAE,IAAI,GAAO,IAC/F,CAAA;AACR,CAAC;AAED,SAAS,eAAe,CAAC,IAAU,EAAE,EAAwB;IAC3D,OAAO,GAAG,EAAE;QACV,EAAE,CAAC,IAAI,CAAC,CAAC;IACX,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, FC, ReactElement } from "react";
|
|
2
|
-
import { FlowbiteBoolean, FlowbiteAccordionComponentTheme, AccordionPanelProps, FlowbiteAccordionTitleTheme } from "flowbite-react";
|
|
3
|
-
export interface FlowbiteAccordionTheme {
|
|
4
|
-
root: FlowbiteAccordionRootTheme;
|
|
5
|
-
content: FlowbiteAccordionComponentTheme;
|
|
6
|
-
title: FlowbiteAccordionTitleTheme;
|
|
7
|
-
}
|
|
8
|
-
export interface FlowbiteAccordionRootTheme {
|
|
9
|
-
base: string;
|
|
10
|
-
flush: FlowbiteBoolean;
|
|
11
|
-
}
|
|
12
|
-
export interface AccordionProps extends ComponentProps<"div"> {
|
|
13
|
-
alwaysOpen?: boolean;
|
|
14
|
-
arrowIcon?: FC<ComponentProps<"svg">>;
|
|
15
|
-
children: ReactElement<AccordionPanelProps> | ReactElement<AccordionPanelProps>[];
|
|
16
|
-
flush?: boolean;
|
|
17
|
-
collapseAll?: boolean;
|
|
18
|
-
theme?: DeepPartial<FlowbiteAccordionTheme>;
|
|
19
|
-
}
|
|
20
|
-
export declare const Accordion: FC<AccordionProps> & {
|
|
21
|
-
Panel: FC<AccordionPanelProps>;
|
|
22
|
-
Title: FC<import("flowbite-react").AccordionTitleProps>;
|
|
23
|
-
Content: FC<import("flowbite-react").AccordionContentProps>;
|
|
24
|
-
};
|
|
25
|
-
export type DeepPartial<T> = T extends object ? {
|
|
26
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
27
|
-
} : T;
|
|
28
|
-
export declare function mergeDeep<T extends object, S extends object>(target: T, source: S): T & S;
|
|
29
|
-
export declare function isObject(item: unknown): item is Record<string, unknown>;
|
|
30
|
-
export declare function cloneDeep<T>(source: T): T;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Accordion = void 0;
|
|
4
|
-
exports.mergeDeep = mergeDeep;
|
|
5
|
-
exports.isObject = isObject;
|
|
6
|
-
exports.cloneDeep = cloneDeep;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const hi_1 = require("react-icons/hi");
|
|
10
|
-
const tailwind_merge_1 = require("tailwind-merge");
|
|
11
|
-
const flowbite_react_1 = require("flowbite-react");
|
|
12
|
-
const AccordionComponent = ({ alwaysOpen = false, arrowIcon = hi_1.HiChevronDown, children, flush = false, collapseAll = false, className, theme: customTheme = {}, ...props }) => {
|
|
13
|
-
const [isOpen, setOpen] = (0, react_1.useState)(collapseAll ? -1 : 0);
|
|
14
|
-
const panels = (0, react_1.useMemo)(() => react_1.Children.map(children, (child, i) => {
|
|
15
|
-
return (0, react_1.cloneElement)(child, {
|
|
16
|
-
alwaysOpen: child.props.alwaysOpen ?? alwaysOpen,
|
|
17
|
-
arrowIcon: child.props.arrowIcon ?? arrowIcon,
|
|
18
|
-
flush: child.props.flush ?? flush,
|
|
19
|
-
isOpen: child.props.isOpen ?? isOpen === i,
|
|
20
|
-
setOpen: child.props.setOpen ?? (() => setOpen(isOpen === i ? -1 : i)),
|
|
21
|
-
});
|
|
22
|
-
}), [alwaysOpen, arrowIcon, children, flush, isOpen]);
|
|
23
|
-
const newTheme = mergeDeep(cloneDeep(flowbite_react_1.theme).accordion.root, customTheme);
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: (0, tailwind_merge_1.twMerge)(newTheme.base, newTheme.flush[flush ? "on" : "off"], className), "data-testid": "flowbite-accordion", ...props, children: panels }));
|
|
25
|
-
};
|
|
26
|
-
AccordionComponent.displayName = "Accordion";
|
|
27
|
-
flowbite_react_1.AccordionPanel.displayName = "Accordion.Panel";
|
|
28
|
-
flowbite_react_1.AccordionTitle.displayName = "Accordion.Title";
|
|
29
|
-
flowbite_react_1.AccordionContent.displayName = "Accordion.Content";
|
|
30
|
-
exports.Accordion = Object.assign(AccordionComponent, {
|
|
31
|
-
Panel: flowbite_react_1.AccordionPanel,
|
|
32
|
-
Title: flowbite_react_1.AccordionTitle,
|
|
33
|
-
Content: flowbite_react_1.AccordionContent,
|
|
34
|
-
});
|
|
35
|
-
function mergeDeep(target, source) {
|
|
36
|
-
if (isObject(source) && Object.keys(source).length === 0) {
|
|
37
|
-
return cloneDeep({ ...target, ...source });
|
|
38
|
-
}
|
|
39
|
-
const output = { ...target, ...source };
|
|
40
|
-
if (isObject(source) && isObject(target)) {
|
|
41
|
-
for (const key in source) {
|
|
42
|
-
if (isObject(source[key]) && key in target && isObject(target[key])) {
|
|
43
|
-
output[key] = mergeDeep(target[key], source[key]);
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
output[key] = isObject(source[key]) ? cloneDeep(source[key]) : source[key];
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return output;
|
|
51
|
-
}
|
|
52
|
-
function isObject(item) {
|
|
53
|
-
return item !== null && typeof item === "object" && item.constructor === Object;
|
|
54
|
-
}
|
|
55
|
-
function cloneDeep(source) {
|
|
56
|
-
if (!isObject(source)) {
|
|
57
|
-
return source;
|
|
58
|
-
}
|
|
59
|
-
const output = {};
|
|
60
|
-
for (const key in source) {
|
|
61
|
-
output[key] = cloneDeep(source[key]);
|
|
62
|
-
}
|
|
63
|
-
return output;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=Accordion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../../src/client/jsx/upstream/Accordion.tsx"],"names":[],"mappings":";;;AAgGA,8BAkBC;AAOD,4BAEC;AAED,8BAYC;;AAnID,iCAAkE;AAClE,uCAA+C;AAC/C,mDAAyC;AACzC,mDAA6L;AAsB7L,MAAM,kBAAkB,GAAuB,CAAC,EAC9C,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,kBAAa,EACzB,QAAQ,EACR,KAAK,GAAG,KAAK,EACb,WAAW,GAAG,KAAK,EACnB,SAAS,EACT,KAAK,EAAE,WAAW,GAAG,EAAE,EACvB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,IAAA,eAAO,EACpB,GAAG,EAAE,CACH,gBAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE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