@flowtomic/ui 0.1.8 → 0.1.10
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/atoms/actions/badge/badge.d.ts +1 -1
- package/dist/components/atoms/actions/button/button.d.ts +2 -2
- package/dist/components/atoms/animation/sliding-number/sliding-number.d.ts.map +1 -1
- package/dist/components/atoms/animation/sliding-number/sliding-number.js +6 -3
- package/dist/components/atoms/data-display/qr-code/qr-code.d.ts +2 -2
- package/dist/components/atoms/data-display/qr-code/qr-code.d.ts.map +1 -1
- package/dist/components/atoms/data-display/qr-code/qr-code.js +4 -3
- package/dist/components/atoms/feedback/alert/alert.d.ts +1 -1
- package/dist/components/atoms/feedback/alert-dialog/alert-dialog.d.ts +2 -2
- package/dist/components/atoms/forms/input/input.d.ts +2 -2
- package/dist/components/atoms/forms/toggle/toggle.d.ts +1 -1
- package/dist/components/atoms/index.d.ts +2 -0
- package/dist/components/atoms/index.d.ts.map +1 -1
- package/dist/components/atoms/index.js +1 -0
- package/dist/components/atoms/layout/sidebar/sidebar.d.ts +1 -1
- package/dist/components/atoms/navigation/command/command.d.ts +13 -13
- package/dist/components/atoms/widget-resize-handle/index.d.ts +3 -0
- package/dist/components/atoms/widget-resize-handle/index.d.ts.map +1 -0
- package/dist/components/atoms/widget-resize-handle/index.js +1 -0
- package/dist/components/atoms/widget-resize-handle/widget-resize-handle.d.ts +60 -0
- package/dist/components/atoms/widget-resize-handle/widget-resize-handle.d.ts.map +1 -0
- package/dist/components/atoms/widget-resize-handle/widget-resize-handle.js +75 -0
- package/dist/components/molecules/draggable-widget/draggable-widget.d.ts +73 -0
- package/dist/components/molecules/draggable-widget/draggable-widget.d.ts.map +1 -0
- package/dist/components/molecules/draggable-widget/draggable-widget.js +44 -0
- package/dist/components/molecules/draggable-widget/index.d.ts +3 -0
- package/dist/components/molecules/draggable-widget/index.d.ts.map +1 -0
- package/dist/components/molecules/draggable-widget/index.js +1 -0
- package/dist/components/molecules/edit-mode-toggle/edit-mode-toggle.d.ts +41 -0
- package/dist/components/molecules/edit-mode-toggle/edit-mode-toggle.d.ts.map +1 -0
- package/dist/components/molecules/edit-mode-toggle/edit-mode-toggle.js +26 -0
- package/dist/components/molecules/edit-mode-toggle/index.d.ts +3 -0
- package/dist/components/molecules/edit-mode-toggle/index.d.ts.map +1 -0
- package/dist/components/molecules/edit-mode-toggle/index.js +1 -0
- package/dist/components/molecules/forms/autocomplete/autocomplete-context.d.ts.map +1 -1
- package/dist/components/molecules/forms/autocomplete/autocomplete-item.d.ts.map +1 -1
- package/dist/components/molecules/forms/autocomplete/autocomplete-section.d.ts.map +1 -1
- package/dist/components/molecules/forms/autocomplete/autocomplete.d.ts +1 -1
- package/dist/components/molecules/forms/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/molecules/forms/autocomplete/autocomplete.js +4 -4
- package/dist/components/molecules/forms/autocomplete/index.d.ts +2 -2
- package/dist/components/molecules/forms/autocomplete/index.d.ts.map +1 -1
- package/dist/components/molecules/forms/autocomplete/index.js +1 -1
- package/dist/components/molecules/forms/text-editor/text-editor.d.ts.map +1 -1
- package/dist/components/molecules/forms/text-editor/text-editor.js +13 -12
- package/dist/components/molecules/index.d.ts +8 -2
- package/dist/components/molecules/index.d.ts.map +1 -1
- package/dist/components/molecules/index.js +4 -1
- package/dist/components/molecules/navigation/menu-dock/menu-dock.d.ts.map +1 -1
- package/dist/components/molecules/navigation/menu-dock/menu-dock.js +1 -1
- package/dist/components/molecules/widget-renderer/index.d.ts +3 -0
- package/dist/components/molecules/widget-renderer/index.d.ts.map +1 -0
- package/dist/components/molecules/widget-renderer/index.js +1 -0
- package/dist/components/molecules/widget-renderer/widget-renderer.d.ts +46 -0
- package/dist/components/molecules/widget-renderer/widget-renderer.d.ts.map +1 -0
- package/dist/components/molecules/widget-renderer/widget-renderer.js +37 -0
- package/dist/components/organisms/document-editor/document-editor.d.ts.map +1 -1
- package/dist/components/organisms/document-editor/document-editor.js +3 -3
- package/dist/components/organisms/document-editor/index.d.ts +1 -1
- package/dist/components/organisms/document-editor/index.d.ts.map +1 -1
- package/dist/components/organisms/draggable-dashboard-grid/draggable-dashboard-grid.d.ts +65 -0
- package/dist/components/organisms/draggable-dashboard-grid/draggable-dashboard-grid.d.ts.map +1 -0
- package/dist/components/organisms/draggable-dashboard-grid/draggable-dashboard-grid.js +124 -0
- package/dist/components/organisms/draggable-dashboard-grid/index.d.ts +3 -0
- package/dist/components/organisms/draggable-dashboard-grid/index.d.ts.map +1 -0
- package/dist/components/organisms/draggable-dashboard-grid/index.js +1 -0
- package/dist/components/organisms/form-layout/form-layout.d.ts +2 -2
- package/dist/components/organisms/form-layout/form-layout.d.ts.map +1 -1
- package/dist/components/organisms/form-layout/form-layout.js +11 -9
- package/dist/components/organisms/form-layout/index.d.ts +1 -1
- package/dist/components/organisms/form-layout/index.d.ts.map +1 -1
- package/dist/components/organisms/index.d.ts +6 -0
- package/dist/components/organisms/index.d.ts.map +1 -1
- package/dist/components/organisms/index.js +3 -0
- package/dist/components/organisms/model-selector/model-selector.d.ts +1 -1
- package/dist/components/organisms/widget-config-modal/index.d.ts +3 -0
- package/dist/components/organisms/widget-config-modal/index.d.ts.map +1 -0
- package/dist/components/organisms/widget-config-modal/index.js +1 -0
- package/dist/components/organisms/widget-config-modal/widget-config-modal.d.ts +57 -0
- package/dist/components/organisms/widget-config-modal/widget-config-modal.d.ts.map +1 -0
- package/dist/components/organisms/widget-config-modal/widget-config-modal.js +35 -0
- package/dist/components/organisms/widget-palette/index.d.ts +3 -0
- package/dist/components/organisms/widget-palette/index.d.ts.map +1 -0
- package/dist/components/organisms/widget-palette/index.js +1 -0
- package/dist/components/organisms/widget-palette/widget-palette.d.ts +71 -0
- package/dist/components/organisms/widget-palette/widget-palette.d.ts.map +1 -0
- package/dist/components/organisms/widget-palette/widget-palette.js +42 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +458 -454
- package/dist/types/dashboard.d.ts +74 -0
- package/dist/types/dashboard.d.ts.map +1 -0
- package/dist/types/dashboard.js +7 -0
- package/package.json +3 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* EditModeToggle - Molecule Component
|
|
4
|
+
*
|
|
5
|
+
* Componente para alternar entre modo de edição e visualização.
|
|
6
|
+
* Genérico e reutilizável para qualquer contexto de edição.
|
|
7
|
+
*/
|
|
8
|
+
import { Edit2, Eye } from "lucide-react";
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { Button } from "@/components/atoms";
|
|
11
|
+
import { cn } from "@/lib/utils";
|
|
12
|
+
/**
|
|
13
|
+
* Toggle para alternar modo de edição
|
|
14
|
+
*
|
|
15
|
+
* Componente genérico que permite alternar entre modo de edição e visualização.
|
|
16
|
+
* Pode ser usado em qualquer contexto que precise de toggle de edição.
|
|
17
|
+
*/
|
|
18
|
+
export const EditModeToggle = React.forwardRef(({ isEditMode, onToggle, disabled = false, viewLabel = "Visualizar", editLabel = "Editar Dashboard", className, ...props }, ref) => {
|
|
19
|
+
const handleClick = () => {
|
|
20
|
+
if (!disabled) {
|
|
21
|
+
onToggle(!isEditMode);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return (_jsx(Button, { ref: ref, variant: isEditMode ? "default" : "outline", size: "sm", onClick: handleClick, disabled: disabled, className: cn("gap-2", className), "aria-label": isEditMode ? "Sair do modo de edição" : "Entrar no modo de edição", "aria-pressed": isEditMode, ...props, children: isEditMode ? (_jsxs(_Fragment, { children: [_jsx(Eye, { className: "w-4 h-4" }), _jsx("span", { children: viewLabel })] })) : (_jsxs(_Fragment, { children: [_jsx(Edit2, { className: "w-4 h-4" }), _jsx("span", { children: editLabel })] })) }));
|
|
25
|
+
});
|
|
26
|
+
EditModeToggle.displayName = "EditModeToggle";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/edit-mode-toggle/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EditModeToggle } from "./edit-mode-toggle";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-context.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete-context.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"autocomplete-context.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete-context.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,qBAAqB,EAAmB,MAAM,iBAAiB,CAAC;AAC9E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB;IACrE,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,mBAAmB,qDAE/B,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,wBAAwB,CAMjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete-item.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"autocomplete-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete-item.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC;IAChF;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,gBAAgB,6FA+CrB,CAAC;AAIF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-section.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete-section.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"autocomplete-section.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete-section.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,wBAAyB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpF;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,mBAAmB,iGAmBxB,CAAC;AAIF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Componente de autocomplete usando hook headless useAutocomplete
|
|
5
5
|
* Suporta API antiga (options) e composição (Compound Components)
|
|
6
6
|
*/
|
|
7
|
-
import * as React from "react";
|
|
8
7
|
import { type AutocompleteOption } from "flowtomic/logic";
|
|
8
|
+
import * as React from "react";
|
|
9
9
|
export interface AutocompleteProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "onChange" | "defaultValue"> {
|
|
10
10
|
options?: AutocompleteOption[];
|
|
11
11
|
value?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,KAAK,kBAAkB,EAAmB,MAAM,iBAAiB,CAAC;AAI3E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAyB/B,MAAM,WAAW,iBACf,SAAQ,IAAI,CACV,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAC3C,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,CAC/C;IAED,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAEpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA4OD,eAAO,MAAM,YAAY;;;;;;CAMvB,CAAC"}
|
|
@@ -5,18 +5,18 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
5
5
|
* Componente de autocomplete usando hook headless useAutocomplete
|
|
6
6
|
* Suporta API antiga (options) e composição (Compound Components)
|
|
7
7
|
*/
|
|
8
|
-
// React e types
|
|
9
|
-
import * as React from "react";
|
|
10
8
|
// Hooks Flowtomic
|
|
11
9
|
import { useAutocomplete } from "flowtomic/logic";
|
|
12
10
|
// Ícones
|
|
13
11
|
import { ChevronDownIcon, XIcon } from "lucide-react";
|
|
12
|
+
// React e types
|
|
13
|
+
import * as React from "react";
|
|
14
14
|
// Utils
|
|
15
15
|
import { cn } from "@/lib/utils";
|
|
16
|
-
import { inputVariants } from "../../../atoms/forms/input/input";
|
|
17
16
|
import { Spinner } from "../../../atoms/animation/spinner/spinner";
|
|
18
17
|
// Feedback/Overlay
|
|
19
|
-
import { Popover, PopoverContent, PopoverTrigger
|
|
18
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../../atoms/feedback/popover/popover";
|
|
19
|
+
import { inputVariants } from "../../../atoms/forms/input/input";
|
|
20
20
|
// Context/Composição
|
|
21
21
|
import { AutocompleteContext, } from "./autocomplete-context";
|
|
22
22
|
import { AutocompleteItem } from "./autocomplete-item";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type { AutocompleteProps } from "./autocomplete";
|
|
2
2
|
export { Autocomplete } from "./autocomplete";
|
|
3
|
+
export type { AutocompleteContextValue } from "./autocomplete-context";
|
|
4
|
+
export { useAutocompleteContext } from "./autocomplete-context";
|
|
3
5
|
export type { AutocompleteItemProps } from "./autocomplete-item";
|
|
4
6
|
export { AutocompleteItem } from "./autocomplete-item";
|
|
5
7
|
export type { AutocompleteSectionProps } from "./autocomplete-section";
|
|
6
8
|
export { AutocompleteSection } from "./autocomplete-section";
|
|
7
|
-
export type { AutocompleteContextValue } from "./autocomplete-context";
|
|
8
|
-
export { useAutocompleteContext } from "./autocomplete-context";
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Autocomplete } from "./autocomplete";
|
|
2
|
+
export { useAutocompleteContext } from "./autocomplete-context";
|
|
2
3
|
export { AutocompleteItem } from "./autocomplete-item";
|
|
3
4
|
export { AutocompleteSection } from "./autocomplete-section";
|
|
4
|
-
export { useAutocompleteContext } from "./autocomplete-context";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-editor.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/text-editor/text-editor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"text-editor.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/text-editor/text-editor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA4BH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqB/B,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAE7D,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,YAAY,GACZ,aAAa,GACb,YAAY,GACZ,WAAW,GACX,aAAa,GACb,YAAY,GACZ,WAAW,GACX,OAAO,CAAC;AAEZ,QAAA,MAAM,eAAe,EAAE,uBAAuB,EAgB7C,CAAC;AA2DF,KAAK,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAE3E,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAC3C,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACzD,YAAY,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IACnC,4EAA4E;IAC5E,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC;CAC1C;AAED,eAAO,MAAM,UAAU,wFA4XtB,CAAC;AA8BF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -9,19 +9,19 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
* - Somente 'preview' => somente visualização
|
|
10
10
|
* - Múltiplos modos => abas para cada modo disponível
|
|
11
11
|
*/
|
|
12
|
-
import * as React from "react";
|
|
13
|
-
import { useEditor, EditorContent } from "@tiptap/react";
|
|
14
|
-
import StarterKit from "@tiptap/starter-kit";
|
|
15
|
-
import Placeholder from "@tiptap/extension-placeholder";
|
|
16
|
-
import TextStyle from "@tiptap/extension-text-style";
|
|
17
12
|
import Color from "@tiptap/extension-color";
|
|
18
|
-
import TextAlign from "@tiptap/extension-text-align";
|
|
19
13
|
import Image from "@tiptap/extension-image";
|
|
20
|
-
import
|
|
21
|
-
import
|
|
14
|
+
import Placeholder from "@tiptap/extension-placeholder";
|
|
15
|
+
import TextAlign from "@tiptap/extension-text-align";
|
|
16
|
+
import TextStyle from "@tiptap/extension-text-style";
|
|
17
|
+
import { EditorContent, useEditor } from "@tiptap/react";
|
|
18
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
19
|
+
import { AlignCenter, AlignLeft, AlignRight, Bold, Code, Eye, FileText, Heading1, Heading2, Heading3, ImageIcon, Italic, List as ListIcon, ListOrdered, Palette, Quote, Strikethrough, } from "lucide-react";
|
|
20
|
+
import * as React from "react";
|
|
22
21
|
import { Streamdown } from "streamdown";
|
|
22
|
+
import { Markdown } from "tiptap-markdown";
|
|
23
23
|
import { cn } from "@/lib/utils";
|
|
24
|
-
import { Button, Separator, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger,
|
|
24
|
+
import { Button, Popover, PopoverContent, PopoverTrigger, Separator, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../../../atoms";
|
|
25
25
|
const DEFAULT_ACTIONS = [
|
|
26
26
|
"bold",
|
|
27
27
|
"italic",
|
|
@@ -96,7 +96,7 @@ function stripMarkdown(md) {
|
|
|
96
96
|
}
|
|
97
97
|
export const TextEditor = React.forwardRef(({ className, value: controlledValue, defaultValue, onChange, placeholder = "Escreva algo...", editable = true, mode: controlledMode, onModeChange, toolbar = true, allowedActions = DEFAULT_ACTIONS, onUploadImage, outputFormat = "markdown", availableModes = ["rich", "markdown"], ...props }, ref) => {
|
|
98
98
|
const initial = controlledValue ?? defaultValue ?? "";
|
|
99
|
-
const { value: internalMarkdown, setValue: setInternalMarkdown, isControlled } = useMarkdownState(controlledValue, initial);
|
|
99
|
+
const { value: internalMarkdown, setValue: setInternalMarkdown, isControlled, } = useMarkdownState(controlledValue, initial);
|
|
100
100
|
// Expandir modos: se markdown está presente, adicionar preview automaticamente
|
|
101
101
|
const effectiveModes = React.useMemo(() => {
|
|
102
102
|
const unique = availableModes.filter((m, i, arr) => arr.indexOf(m) === i);
|
|
@@ -130,8 +130,9 @@ export const TextEditor = React.forwardRef(({ className, value: controlledValue,
|
|
|
130
130
|
content: internalMarkdown ? undefined : "",
|
|
131
131
|
onUpdate: ({ editor }) => {
|
|
132
132
|
try {
|
|
133
|
-
//
|
|
134
|
-
|
|
133
|
+
// Acesso ao storage markdown da extensão tiptap-markdown
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
135
|
+
const md = editor?.storage?.markdown?.getMarkdown?.() ?? "";
|
|
135
136
|
if (typeof md === "string") {
|
|
136
137
|
if (!isControlled)
|
|
137
138
|
setInternalMarkdown(md);
|
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
export type { ConnectionLineComponent } from "@xyflow/react";
|
|
6
6
|
export type { ModalBodyProps, ModalContentProps, ModalFooterProps, ModalProps, ModalTriggerProps, } from "./animation/animated-modal";
|
|
7
7
|
export { Modal, ModalBody, ModalContent, ModalFooter, ModalTrigger, } from "./animation/animated-modal";
|
|
8
|
-
export type { TextEditorMode, TextEditorProps, TextEditorToolbarAction } from "./forms/text-editor";
|
|
9
|
-
export { TextEditor } from "./forms/text-editor";
|
|
10
8
|
export type { AnimatedSlidingNumberProps } from "./animation/animated-sliding-number";
|
|
11
9
|
export { AnimatedSlidingNumber } from "./animation/animated-sliding-number";
|
|
12
10
|
export type { ButtonCounterProps } from "./animation/button-counter";
|
|
@@ -49,6 +47,10 @@ export type { TimeTrackerProps } from "./data-display/time-tracker";
|
|
|
49
47
|
export { TimeTracker } from "./data-display/time-tracker";
|
|
50
48
|
export type { ToolContentProps, ToolHeaderProps, ToolInputProps, ToolOutputProps, ToolProps, } from "./data-display/tool";
|
|
51
49
|
export { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "./data-display/tool";
|
|
50
|
+
export type { DraggableWidgetProps } from "./draggable-widget";
|
|
51
|
+
export { DraggableWidget } from "./draggable-widget";
|
|
52
|
+
export type { EditModeToggleProps } from "./edit-mode-toggle";
|
|
53
|
+
export { EditModeToggle } from "./edit-mode-toggle";
|
|
52
54
|
export type { ConfirmationAcceptedProps, ConfirmationActionProps, ConfirmationActionsProps, ConfirmationProps, ConfirmationRejectedProps, ConfirmationRequestProps, ConfirmationTitleProps, } from "./feedback/confirmation";
|
|
53
55
|
export { Confirmation, ConfirmationAccepted, ConfirmationAction, ConfirmationActions, ConfirmationRejected, ConfirmationRequest, ConfirmationTitle, } from "./feedback/confirmation";
|
|
54
56
|
export type { CanvasProps } from "./flow/canvas";
|
|
@@ -64,6 +66,8 @@ export type { InputGroupAddonProps, InputGroupButtonProps, InputGroupProps, Inpu
|
|
|
64
66
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupTextarea, } from "./forms/input-group";
|
|
65
67
|
export type { ItemActionsProps, ItemContentProps, ItemDescriptionProps, ItemFooterProps, ItemGroupProps, ItemHeaderProps, ItemMediaProps, ItemProps, ItemSeparatorProps, ItemTitleProps, } from "./forms/item";
|
|
66
68
|
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, } from "./forms/item";
|
|
69
|
+
export type { TextEditorMode, TextEditorProps, TextEditorToolbarAction } from "./forms/text-editor";
|
|
70
|
+
export { TextEditor } from "./forms/text-editor";
|
|
67
71
|
export type { DashboardHeaderProps, DashboardUser, Notification, } from "./layout/dashboard-header";
|
|
68
72
|
export { DashboardHeader } from "./layout/dashboard-header";
|
|
69
73
|
export type { MenuDockItem, MenuDockProps } from "./navigation/menu-dock";
|
|
@@ -72,4 +76,6 @@ export type { MobileAppCard, NavigationItem, SidebarNavigationProps, } from "./n
|
|
|
72
76
|
export { SidebarNavigation } from "./navigation/sidebar-navigation";
|
|
73
77
|
export type { StartPosition, ThemeToggleButtonProps, } from "./theme/theme-toggle-button/theme-toggle-button";
|
|
74
78
|
export { ThemeToggleButton } from "./theme/theme-toggle-button/theme-toggle-button";
|
|
79
|
+
export type { WidgetRendererProps } from "./widget-renderer";
|
|
80
|
+
export { WidgetRenderer } from "./widget-renderer";
|
|
75
81
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/molecules/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC7D,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,YAAY,GACb,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/molecules/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC7D,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,YAAY,GACb,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EACV,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACjF,YAAY,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,QAAQ,EACR,cAAc,EACd,eAAe,EACf,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,C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gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,IAAI,EACJ,WAAW,EACX,WAAW,EACX,eAAe,EACf,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,YAAY,GACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,YAAY,EACV,aAAa,EACb,cAAc,EACd,sBAAsB,GACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,YAAY,EACV,aAAa,EACb,sBAAsB,GACvB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACpF,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Atomic Design: Componentes compostos por múltiplos atoms
|
|
4
4
|
*/
|
|
5
5
|
export { Modal, ModalBody, ModalContent, ModalFooter, ModalTrigger, } from "./animation/animated-modal";
|
|
6
|
-
export { TextEditor } from "./forms/text-editor";
|
|
7
6
|
export { AnimatedSlidingNumber } from "./animation/animated-sliding-number";
|
|
8
7
|
export { ButtonCounter } from "./animation/button-counter";
|
|
9
8
|
export { AuthFormErrorMessage, AuthNavigationLink, PasswordInput } from "./auth";
|
|
@@ -25,6 +24,8 @@ export { Task, TaskContent, TaskItem, TaskItemFile, TaskTrigger } from "./data-d
|
|
|
25
24
|
export { TeamMemberList } from "./data-display/team-member-list";
|
|
26
25
|
export { TimeTracker } from "./data-display/time-tracker";
|
|
27
26
|
export { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "./data-display/tool";
|
|
27
|
+
export { DraggableWidget } from "./draggable-widget";
|
|
28
|
+
export { EditModeToggle } from "./edit-mode-toggle";
|
|
28
29
|
export { Confirmation, ConfirmationAccepted, ConfirmationAction, ConfirmationActions, ConfirmationRejected, ConfirmationRequest, ConfirmationTitle, } from "./feedback/confirmation";
|
|
29
30
|
export { Canvas } from "./flow/canvas";
|
|
30
31
|
export { Connection } from "./flow/connection";
|
|
@@ -33,7 +34,9 @@ export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText } from "./forms/butt
|
|
|
33
34
|
export { ImageDropzone } from "./forms/image-dropzone";
|
|
34
35
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupTextarea, } from "./forms/input-group";
|
|
35
36
|
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, } from "./forms/item";
|
|
37
|
+
export { TextEditor } from "./forms/text-editor";
|
|
36
38
|
export { DashboardHeader } from "./layout/dashboard-header";
|
|
37
39
|
export { MenuDock } from "./navigation/menu-dock";
|
|
38
40
|
export { SidebarNavigation } from "./navigation/sidebar-navigation";
|
|
39
41
|
export { ThemeToggleButton } from "./theme/theme-toggle-button/theme-toggle-button";
|
|
42
|
+
export { WidgetRenderer } from "./widget-renderer";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-dock.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/navigation/menu-dock/menu-dock.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"menu-dock.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/navigation/menu-dock/menu-dock.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC1C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAUD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA4M5C,CAAC"}
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"use client";
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
9
|
import { useAnimatedIndicator } from "@flowtomic/logic";
|
|
10
|
+
import { Menu } from "lucide-react";
|
|
10
11
|
import { AnimatePresence, motion, useMotionValue, useReducedMotion, useSpring, useTransform, } from "motion/react";
|
|
11
12
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
12
|
-
import { Menu } from "lucide-react";
|
|
13
13
|
import { cn } from "@/lib/utils";
|
|
14
14
|
const defaultItems = [
|
|
15
15
|
{ label: "home", icon: () => null },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/widget-renderer/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WidgetRenderer } from "./widget-renderer";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WidgetRenderer - Molecule Component
|
|
3
|
+
*
|
|
4
|
+
* Renderizador base para widgets com render prop pattern.
|
|
5
|
+
* Totalmente extensível e genérico.
|
|
6
|
+
*/
|
|
7
|
+
import type { WidgetLayout } from "@/types/dashboard";
|
|
8
|
+
export interface WidgetRendererProps {
|
|
9
|
+
/**
|
|
10
|
+
* Layout do widget a ser renderizado
|
|
11
|
+
*/
|
|
12
|
+
widget: WidgetLayout;
|
|
13
|
+
/**
|
|
14
|
+
* Dados para o widget (opcional, depende do tipo)
|
|
15
|
+
*/
|
|
16
|
+
data?: unknown;
|
|
17
|
+
/**
|
|
18
|
+
* Se está carregando
|
|
19
|
+
*/
|
|
20
|
+
isLoading?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Render prop para renderizar widget customizado
|
|
23
|
+
* Tem prioridade sobre widgetRegistry
|
|
24
|
+
*/
|
|
25
|
+
renderWidget?: (widget: WidgetLayout, data?: unknown) => React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Registry de componentes por tipo de widget
|
|
28
|
+
* Usado quando renderWidget não é fornecido
|
|
29
|
+
*/
|
|
30
|
+
widgetRegistry?: Map<string, React.ComponentType<{
|
|
31
|
+
widget: WidgetLayout;
|
|
32
|
+
data?: unknown;
|
|
33
|
+
}>>;
|
|
34
|
+
/**
|
|
35
|
+
* Fallback quando widget não é encontrado
|
|
36
|
+
*/
|
|
37
|
+
fallback?: React.ReactNode;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Renderiza widget baseado no tipo
|
|
41
|
+
*
|
|
42
|
+
* Componente genérico que usa render prop pattern ou registry pattern
|
|
43
|
+
* para renderizar widgets. Totalmente extensível.
|
|
44
|
+
*/
|
|
45
|
+
export declare const WidgetRenderer: import("react").NamedExoticComponent<WidgetRendererProps>;
|
|
46
|
+
//# sourceMappingURL=widget-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-renderer.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/widget-renderer/widget-renderer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;IAErB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC;IAEzE;;;OAGG;IACH,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,MAAM,EAAE,YAAY,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,CAAC;IAE5F;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,2DAkC1B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* WidgetRenderer - Molecule Component
|
|
4
|
+
*
|
|
5
|
+
* Renderizador base para widgets com render prop pattern.
|
|
6
|
+
* Totalmente extensível e genérico.
|
|
7
|
+
*/
|
|
8
|
+
import { memo, Suspense } from "react";
|
|
9
|
+
import { CardSkeleton } from "@/components/atoms";
|
|
10
|
+
/**
|
|
11
|
+
* Renderiza widget baseado no tipo
|
|
12
|
+
*
|
|
13
|
+
* Componente genérico que usa render prop pattern ou registry pattern
|
|
14
|
+
* para renderizar widgets. Totalmente extensível.
|
|
15
|
+
*/
|
|
16
|
+
export const WidgetRenderer = memo(({ widget, data, isLoading = false, renderWidget, widgetRegistry, fallback }) => {
|
|
17
|
+
if (isLoading) {
|
|
18
|
+
return _jsx(CardSkeleton, {});
|
|
19
|
+
}
|
|
20
|
+
// Prioridade 1: Render prop
|
|
21
|
+
if (renderWidget) {
|
|
22
|
+
return _jsx(Suspense, { fallback: _jsx(CardSkeleton, {}), children: renderWidget(widget, data) });
|
|
23
|
+
}
|
|
24
|
+
// Prioridade 2: Registry
|
|
25
|
+
if (widgetRegistry) {
|
|
26
|
+
const WidgetComponent = widgetRegistry.get(widget.type);
|
|
27
|
+
if (WidgetComponent) {
|
|
28
|
+
return (_jsx(Suspense, { fallback: _jsx(CardSkeleton, {}), children: _jsx(WidgetComponent, { widget: widget, data: data }) }));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Fallback: Widget não encontrado
|
|
32
|
+
if (fallback) {
|
|
33
|
+
return _jsx(_Fragment, { children: fallback });
|
|
34
|
+
}
|
|
35
|
+
return (_jsx("div", { className: "p-4", children: _jsxs("p", { className: "text-muted-foreground", children: ["Tipo de widget desconhecido: ", widget.type] }) }));
|
|
36
|
+
});
|
|
37
|
+
WidgetRenderer.displayName = "WidgetRenderer";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/document-editor/document-editor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"document-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/document-editor/document-editor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAaH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,2BAA2B;IAC3B,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,uCAAuC;IACvC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;IAChD,4BAA4B;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,QAAQ,GAAG,YAAY,CAAC;IACnC,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,YAAY,KAAK,IAAI,CAAC;IAC3D,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD,eAAO,MAAM,cAAc,4FAyS1B,CAAC"}
|
|
@@ -13,11 +13,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
* - Navegação entre páginas
|
|
14
14
|
* - Modo de edição Rich apenas (sem abas)
|
|
15
15
|
*/
|
|
16
|
+
import { ChevronLeft, ChevronRight, Clock, Columns, FileText, List, Plus, Trash2, Type, } from "lucide-react";
|
|
16
17
|
import * as React from "react";
|
|
17
|
-
import { TextEditor } from "../../molecules/forms/text-editor";
|
|
18
|
-
import { Button } from "../../atoms";
|
|
19
|
-
import { Plus, Trash2, ChevronLeft, ChevronRight, FileText, Clock, Type, Columns, List, } from "lucide-react";
|
|
20
18
|
import { cn } from "@/lib/utils";
|
|
19
|
+
import { Button } from "../../atoms";
|
|
20
|
+
import { TextEditor } from "../../molecules/forms/text-editor";
|
|
21
21
|
function generateId() {
|
|
22
22
|
return `page-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/document-editor/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/document-editor/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DraggableDashboardGrid - Organism Component
|
|
3
|
+
*
|
|
4
|
+
* Grid principal com drag and drop para dashboards.
|
|
5
|
+
* Componente genérico e reutilizável para qualquer dashboard.
|
|
6
|
+
*/
|
|
7
|
+
import type * as React from "react";
|
|
8
|
+
import type { GridConfig, WidgetLayout } from "@/types/dashboard";
|
|
9
|
+
export interface DraggableDashboardGridProps {
|
|
10
|
+
/**
|
|
11
|
+
* Widgets a serem renderizados
|
|
12
|
+
*/
|
|
13
|
+
widgets: WidgetLayout[];
|
|
14
|
+
/**
|
|
15
|
+
* Renderiza o conteúdo de um widget
|
|
16
|
+
*/
|
|
17
|
+
renderWidget: (widget: WidgetLayout) => React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Se está em modo de edição
|
|
20
|
+
*/
|
|
21
|
+
isEditMode: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Configuração do grid (opcional, usa defaults se não fornecido)
|
|
24
|
+
*/
|
|
25
|
+
gridConfig?: GridConfig;
|
|
26
|
+
/**
|
|
27
|
+
* Callback quando widget é configurado
|
|
28
|
+
*/
|
|
29
|
+
onConfigureWidget?: (widgetId: string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Callback quando widget é removido
|
|
32
|
+
*/
|
|
33
|
+
onRemoveWidget?: (widgetId: string) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Callback quando widget é redimensionado
|
|
36
|
+
*/
|
|
37
|
+
onResizeWidget?: (widgetId: string, w: number, h: number) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Callback quando widget é adicionado da paleta
|
|
40
|
+
*/
|
|
41
|
+
onAddWidget?: (widgetType: string, defaultSize: {
|
|
42
|
+
w: number;
|
|
43
|
+
h: number;
|
|
44
|
+
}) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Callback quando widget é movido
|
|
47
|
+
*/
|
|
48
|
+
onMoveWidget?: (widgetId: string, x: number, y: number) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Empty state customizável (opcional)
|
|
51
|
+
*/
|
|
52
|
+
emptyState?: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* Classe CSS adicional
|
|
55
|
+
*/
|
|
56
|
+
className?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Grid principal com drag and drop
|
|
60
|
+
*
|
|
61
|
+
* Componente genérico que gerencia um grid de widgets com funcionalidades
|
|
62
|
+
* de drag and drop, redimensionamento e edição.
|
|
63
|
+
*/
|
|
64
|
+
export declare function DraggableDashboardGrid({ widgets, renderWidget, isEditMode, gridConfig, onConfigureWidget, onRemoveWidget, onResizeWidget, onAddWidget, onMoveWidget, emptyState, className, }: DraggableDashboardGridProps): import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
//# sourceMappingURL=draggable-dashboard-grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draggable-dashboard-grid.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/draggable-dashboard-grid/draggable-dashboard-grid.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAElE,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,OAAO,EAAE,YAAY,EAAE,CAAC;IAExB;;OAEG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,KAAK,CAAC,SAAS,CAAC;IAExD;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAE/C;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5C;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAElE;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,W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