@flowtomic/ui 0.1.2 → 0.1.5
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/blocks/developer-panel/page.d.ts.map +1 -1
- package/dist/blocks/developer-panel/page.js +2 -2
- 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/encrypted-text/encrypted-text.d.ts +57 -0
- package/dist/components/atoms/animation/encrypted-text/encrypted-text.d.ts.map +1 -0
- package/dist/components/atoms/animation/encrypted-text/encrypted-text.js +104 -0
- package/dist/components/atoms/animation/encrypted-text/index.d.ts +3 -0
- package/dist/components/atoms/animation/encrypted-text/index.d.ts.map +1 -0
- package/dist/components/atoms/animation/encrypted-text/index.js +1 -0
- package/dist/components/atoms/animation/index.d.ts +2 -0
- package/dist/components/atoms/animation/index.d.ts.map +1 -1
- package/dist/components/atoms/animation/index.js +1 -0
- package/dist/components/atoms/data-display/index.d.ts +2 -0
- package/dist/components/atoms/data-display/index.d.ts.map +1 -1
- package/dist/components/atoms/data-display/index.js +1 -0
- package/dist/components/atoms/data-display/qr-code/index.d.ts +3 -0
- package/dist/components/atoms/data-display/qr-code/index.d.ts.map +1 -0
- package/dist/components/atoms/data-display/qr-code/index.js +1 -0
- package/dist/components/atoms/data-display/qr-code/qr-code.d.ts +18 -0
- package/dist/components/atoms/data-display/qr-code/qr-code.d.ts.map +1 -0
- package/dist/components/atoms/data-display/qr-code/qr-code.js +79 -0
- package/dist/components/atoms/feedback/tooltip/index.d.ts +1 -1
- package/dist/components/atoms/feedback/tooltip/index.d.ts.map +1 -1
- package/dist/components/atoms/feedback/tooltip/index.js +1 -1
- package/dist/components/atoms/feedback/tooltip/tooltip.d.ts +42 -5
- package/dist/components/atoms/feedback/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/atoms/feedback/tooltip/tooltip.js +188 -5
- package/dist/components/atoms/forms/autocomplete/autocomplete-context.d.ts +29 -0
- package/dist/components/atoms/forms/autocomplete/autocomplete-context.d.ts.map +1 -0
- package/dist/components/atoms/forms/autocomplete/autocomplete-context.js +10 -0
- package/dist/components/atoms/forms/autocomplete/autocomplete-item.d.ts +16 -0
- package/dist/components/atoms/forms/autocomplete/autocomplete-item.d.ts.map +1 -0
- package/dist/components/atoms/forms/autocomplete/autocomplete-item.js +48 -0
- package/dist/components/atoms/forms/autocomplete/autocomplete-section.d.ts +14 -0
- package/dist/components/atoms/forms/autocomplete/autocomplete-section.d.ts.map +1 -0
- package/dist/components/atoms/forms/autocomplete/autocomplete-section.js +13 -0
- package/dist/components/atoms/forms/autocomplete/autocomplete.d.ts +13 -9
- package/dist/components/atoms/forms/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/atoms/forms/autocomplete/autocomplete.js +295 -87
- package/dist/components/atoms/forms/autocomplete/index.d.ts +6 -0
- package/dist/components/atoms/forms/autocomplete/index.d.ts.map +1 -1
- package/dist/components/atoms/forms/autocomplete/index.js +3 -0
- package/dist/components/atoms/forms/index.d.ts +0 -2
- package/dist/components/atoms/forms/index.d.ts.map +1 -1
- package/dist/components/atoms/forms/index.js +0 -1
- package/dist/components/atoms/forms/input/input.d.ts +1 -1
- package/dist/components/atoms/forms/toggle/toggle.d.ts +1 -1
- 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/navigation/tabs/tabs.js +2 -2
- package/dist/components/molecules/auth/auth-navigation-link/auth-navigation-link.d.ts +1 -11
- package/dist/components/molecules/auth/auth-navigation-link/auth-navigation-link.d.ts.map +1 -1
- package/dist/components/molecules/auth/auth-navigation-link/auth-navigation-link.js +2 -3
- package/dist/components/molecules/forms/autocomplete/autocomplete-context.d.ts +16 -0
- package/dist/components/molecules/forms/autocomplete/autocomplete-context.d.ts.map +1 -0
- package/dist/components/molecules/forms/autocomplete/autocomplete-context.js +14 -0
- package/dist/components/molecules/forms/autocomplete/autocomplete-item.d.ts +23 -0
- package/dist/components/molecules/forms/autocomplete/autocomplete-item.d.ts.map +1 -0
- package/dist/components/molecules/forms/autocomplete/autocomplete-item.js +29 -0
- package/dist/components/molecules/forms/autocomplete/autocomplete-section.d.ts +19 -0
- package/dist/components/molecules/forms/autocomplete/autocomplete-section.d.ts.map +1 -0
- package/dist/components/molecules/forms/autocomplete/autocomplete-section.js +13 -0
- package/dist/components/molecules/forms/autocomplete/autocomplete.d.ts +33 -0
- package/dist/components/molecules/forms/autocomplete/autocomplete.d.ts.map +1 -0
- package/dist/components/molecules/forms/autocomplete/autocomplete.js +101 -0
- package/dist/components/molecules/forms/autocomplete/index.d.ts +9 -0
- package/dist/components/molecules/forms/autocomplete/index.d.ts.map +1 -0
- package/dist/components/molecules/forms/autocomplete/index.js +4 -0
- package/dist/components/molecules/forms/item/item.d.ts +1 -1
- package/dist/components/molecules/forms/text-editor/index.d.ts +3 -0
- package/dist/components/molecules/forms/text-editor/index.d.ts.map +1 -0
- package/dist/components/molecules/forms/text-editor/index.js +1 -0
- package/dist/components/molecules/forms/text-editor/text-editor.d.ts +33 -0
- package/dist/components/molecules/forms/text-editor/text-editor.d.ts.map +1 -0
- package/dist/components/molecules/forms/text-editor/text-editor.js +211 -0
- package/dist/components/molecules/index.d.ts +4 -2
- package/dist/components/molecules/index.d.ts.map +1 -1
- package/dist/components/molecules/index.js +2 -1
- package/dist/components/molecules/navigation/menu-dock/menu-dock.d.ts +5 -0
- package/dist/components/molecules/navigation/menu-dock/menu-dock.d.ts.map +1 -1
- package/dist/components/molecules/navigation/menu-dock/menu-dock.js +103 -10
- package/dist/components/molecules/typography/index.d.ts +0 -2
- package/dist/components/molecules/typography/index.d.ts.map +1 -1
- package/dist/components/molecules/typography/index.js +1 -1
- package/dist/components/organisms/context/context.d.ts +4 -4
- package/dist/components/organisms/document-editor/document-editor.d.ts +43 -0
- package/dist/components/organisms/document-editor/document-editor.d.ts.map +1 -0
- package/dist/components/organisms/document-editor/document-editor.js +144 -0
- package/dist/components/organisms/document-editor/index.d.ts +3 -0
- package/dist/components/organisms/document-editor/index.d.ts.map +1 -0
- package/dist/components/organisms/document-editor/index.js +1 -0
- package/dist/components/organisms/form-layout/form-layout.d.ts +111 -0
- package/dist/components/organisms/form-layout/form-layout.d.ts.map +1 -0
- package/dist/components/organisms/form-layout/form-layout.js +83 -0
- package/dist/components/organisms/form-layout/index.d.ts +2 -0
- package/dist/components/organisms/form-layout/index.d.ts.map +1 -0
- package/dist/components/organisms/form-layout/index.js +1 -0
- package/dist/components/organisms/index.d.ts +4 -0
- package/dist/components/organisms/index.d.ts.map +1 -1
- package/dist/components/organisms/index.js +2 -0
- package/dist/components/organisms/model-selector/model-selector.d.ts +1 -1
- package/dist/index.js +623 -526
- package/dist/styles/globals.css +489 -0
- package/dist/styles/theme.css +1364 -0
- package/dist/styles/typography.css +430 -0
- package/package.json +45 -18
|
@@ -5,6 +5,8 @@
|
|
|
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";
|
|
8
10
|
export type { AnimatedSlidingNumberProps } from "./animation/animated-sliding-number";
|
|
9
11
|
export { AnimatedSlidingNumber } from "./animation/animated-sliding-number";
|
|
10
12
|
export type { ButtonCounterProps } from "./animation/button-counter";
|
|
@@ -52,6 +54,8 @@ export { Confirmation, ConfirmationAccepted, ConfirmationAction, ConfirmationAct
|
|
|
52
54
|
export type { CanvasProps } from "./flow/canvas";
|
|
53
55
|
export { Canvas } from "./flow/canvas";
|
|
54
56
|
export { Connection } from "./flow/connection";
|
|
57
|
+
export type { AutocompleteContextValue, AutocompleteItemProps, AutocompleteProps, AutocompleteSectionProps, } from "./forms/autocomplete";
|
|
58
|
+
export { Autocomplete, AutocompleteItem, AutocompleteSection, useAutocompleteContext, } from "./forms/autocomplete";
|
|
55
59
|
export type { ButtonGroupProps, ButtonGroupSeparatorProps, ButtonGroupTextProps, } from "./forms/button-group";
|
|
56
60
|
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText } from "./forms/button-group";
|
|
57
61
|
export type { ImageDropzoneProps } from "./forms/image-dropzone";
|
|
@@ -68,6 +72,4 @@ export type { MobileAppCard, NavigationItem, SidebarNavigationProps, } from "./n
|
|
|
68
72
|
export { SidebarNavigation } from "./navigation/sidebar-navigation";
|
|
69
73
|
export type { StartPosition, ThemeToggleButtonProps, } from "./theme/theme-toggle-button/theme-toggle-button";
|
|
70
74
|
export { ThemeToggleButton } from "./theme/theme-toggle-button/theme-toggle-button";
|
|
71
|
-
export type { AnimatedShinyTextProps } from "./typography";
|
|
72
|
-
export { AnimatedShinyText } from "./typography";
|
|
73
75
|
//# 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,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,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BAAwB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,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,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
|
|
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,EACh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oB,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"}
|
|
@@ -3,6 +3,7 @@
|
|
|
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";
|
|
6
7
|
export { AnimatedSlidingNumber } from "./animation/animated-sliding-number";
|
|
7
8
|
export { ButtonCounter } from "./animation/button-counter";
|
|
8
9
|
export { AuthFormErrorMessage, AuthNavigationLink, PasswordInput } from "./auth";
|
|
@@ -27,6 +28,7 @@ export { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "./data-dis
|
|
|
27
28
|
export { Confirmation, ConfirmationAccepted, ConfirmationAction, ConfirmationActions, ConfirmationRejected, ConfirmationRequest, ConfirmationTitle, } from "./feedback/confirmation";
|
|
28
29
|
export { Canvas } from "./flow/canvas";
|
|
29
30
|
export { Connection } from "./flow/connection";
|
|
31
|
+
export { Autocomplete, AutocompleteItem, AutocompleteSection, useAutocompleteContext, } from "./forms/autocomplete";
|
|
30
32
|
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText } from "./forms/button-group";
|
|
31
33
|
export { ImageDropzone } from "./forms/image-dropzone";
|
|
32
34
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupTextarea, } from "./forms/input-group";
|
|
@@ -35,4 +37,3 @@ export { DashboardHeader } from "./layout/dashboard-header";
|
|
|
35
37
|
export { MenuDock } from "./navigation/menu-dock";
|
|
36
38
|
export { SidebarNavigation } from "./navigation/sidebar-navigation";
|
|
37
39
|
export { ThemeToggleButton } from "./theme/theme-toggle-button/theme-toggle-button";
|
|
38
|
-
export { AnimatedShinyText } from "./typography";
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* MenuDock - Componente Molecule
|
|
3
3
|
*
|
|
4
4
|
* Componente de dock de menu com animação e suporte a múltiplos itens
|
|
5
|
+
* Suporta duas animações: "default" (underline animado) e "floating" (estilo macOS)
|
|
5
6
|
*/
|
|
6
7
|
import type React from "react";
|
|
7
8
|
type IconComponentType = React.ElementType<{
|
|
@@ -13,6 +14,7 @@ export interface MenuDockItem {
|
|
|
13
14
|
icon: IconComponentType;
|
|
14
15
|
onClick?: () => void;
|
|
15
16
|
path?: string;
|
|
17
|
+
href?: string;
|
|
16
18
|
}
|
|
17
19
|
export interface MenuDockProps {
|
|
18
20
|
items?: MenuDockItem[];
|
|
@@ -21,9 +23,12 @@ export interface MenuDockProps {
|
|
|
21
23
|
orientation?: "horizontal" | "vertical";
|
|
22
24
|
showLabels?: boolean;
|
|
23
25
|
animated?: boolean;
|
|
26
|
+
animationType?: "default" | "floating";
|
|
24
27
|
defaultActiveIndex?: number;
|
|
25
28
|
activeIndex?: number;
|
|
26
29
|
onActiveIndexChange?: (index: number) => void;
|
|
30
|
+
desktopClassName?: string;
|
|
31
|
+
mobileClassName?: string;
|
|
27
32
|
}
|
|
28
33
|
export declare const MenuDock: React.FC<MenuDockProps>;
|
|
29
34
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-dock.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/navigation/menu-dock/menu-dock.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"menu-dock.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/navigation/menu-dock/menu-dock.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/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"}
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
* MenuDock - Componente Molecule
|
|
3
3
|
*
|
|
4
4
|
* Componente de dock de menu com animação e suporte a múltiplos itens
|
|
5
|
+
* Suporta duas animações: "default" (underline animado) e "floating" (estilo macOS)
|
|
5
6
|
*/
|
|
6
7
|
"use client";
|
|
7
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
9
|
import { useAnimatedIndicator } from "@flowtomic/logic";
|
|
9
|
-
import { motion, useReducedMotion } from "motion/react";
|
|
10
|
+
import { AnimatePresence, motion, useMotionValue, useReducedMotion, useSpring, useTransform, } from "motion/react";
|
|
10
11
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
12
|
+
import { Menu } from "lucide-react";
|
|
11
13
|
import { cn } from "@/lib/utils";
|
|
12
14
|
const defaultItems = [
|
|
13
15
|
{ label: "home", icon: () => null },
|
|
@@ -16,7 +18,7 @@ const defaultItems = [
|
|
|
16
18
|
{ label: "security", icon: () => null },
|
|
17
19
|
{ label: "settings", icon: () => null },
|
|
18
20
|
];
|
|
19
|
-
export const MenuDock = ({ items, className, variant = "default", orientation = "horizontal", showLabels = true, animated: _animated = true, defaultActiveIndex = 0, activeIndex: controlledActiveIndex, onActiveIndexChange, }) => {
|
|
21
|
+
export const MenuDock = ({ items, className, variant = "default", orientation = "horizontal", showLabels = true, animated: _animated = true, animationType = "default", defaultActiveIndex = 0, activeIndex: controlledActiveIndex, onActiveIndexChange, desktopClassName, mobileClassName, }) => {
|
|
20
22
|
const finalItems = useMemo(() => {
|
|
21
23
|
const isValid = items && Array.isArray(items) && items.length >= 2 && items.length <= 8;
|
|
22
24
|
if (!isValid) {
|
|
@@ -25,6 +27,16 @@ export const MenuDock = ({ items, className, variant = "default", orientation =
|
|
|
25
27
|
}
|
|
26
28
|
return items;
|
|
27
29
|
}, [items]);
|
|
30
|
+
// Se animationType for "floating", renderizar FloatingDock
|
|
31
|
+
if (animationType === "floating") {
|
|
32
|
+
return (_jsx(FloatingDock, { items: finalItems.map((item) => ({
|
|
33
|
+
title: item.label,
|
|
34
|
+
icon: _jsx(item.icon, { className: "h-full w-full" }),
|
|
35
|
+
href: item.href || item.path || "#",
|
|
36
|
+
onClick: item.onClick,
|
|
37
|
+
})), desktopClassName: desktopClassName, mobileClassName: mobileClassName, className: className }));
|
|
38
|
+
}
|
|
39
|
+
// Animação default (comportamento original)
|
|
28
40
|
const [internalActiveIndex, setInternalActiveIndex] = useState(defaultActiveIndex);
|
|
29
41
|
// Usar índice controlado se fornecido, caso contrário usar estado interno
|
|
30
42
|
const isControlled = controlledActiveIndex !== undefined;
|
|
@@ -39,20 +51,38 @@ export const MenuDock = ({ items, className, variant = "default", orientation =
|
|
|
39
51
|
const shouldReduceMotion = useReducedMotion();
|
|
40
52
|
// Para o underline, precisamos rastrear o texto, não o botão
|
|
41
53
|
const textRefs = useRef([]);
|
|
54
|
+
const buttonRefs = useRef([]);
|
|
42
55
|
useEffect(() => {
|
|
43
56
|
if (activeIndex >= finalItems.length && !isControlled) {
|
|
44
57
|
setInternalActiveIndex(0);
|
|
45
58
|
}
|
|
46
59
|
}, [finalItems, activeIndex, isControlled]);
|
|
47
60
|
// Usar o hook apenas quando showLabels e horizontal
|
|
48
|
-
const
|
|
61
|
+
const shouldUseIndicator = showLabels && orientation === "horizontal";
|
|
62
|
+
const { indicatorStyle, registerElement, unregisterElement } = useAnimatedIndicator({
|
|
49
63
|
containerRef: containerRef,
|
|
50
|
-
activeSelector: '[data-active="true"]',
|
|
64
|
+
activeSelector: 'span[data-active="true"]',
|
|
65
|
+
value: activeIndex.toString(),
|
|
51
66
|
getElementValue: (element) => {
|
|
52
67
|
return element.getAttribute("data-index") || "";
|
|
53
68
|
},
|
|
54
|
-
updateOnResize:
|
|
69
|
+
updateOnResize: shouldUseIndicator,
|
|
55
70
|
});
|
|
71
|
+
// Registrar elementos quando shouldUseIndicator mudar ou items mudarem
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (shouldUseIndicator) {
|
|
74
|
+
textRefs.current.forEach((el, index) => {
|
|
75
|
+
if (el) {
|
|
76
|
+
registerElement(el, index.toString());
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return () => {
|
|
80
|
+
textRefs.current.forEach((_, index) => {
|
|
81
|
+
unregisterElement(index.toString());
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}, [shouldUseIndicator, finalItems.length, registerElement, unregisterElement]);
|
|
56
86
|
const sizeClasses = {
|
|
57
87
|
default: "p-3",
|
|
58
88
|
compact: "p-2",
|
|
@@ -66,16 +96,18 @@ export const MenuDock = ({ items, className, variant = "default", orientation =
|
|
|
66
96
|
return (_jsxs("nav", { ref: containerRef, className: cn("relative flex", orientation === "horizontal" ? "flex-row" : "flex-col", "items-center gap-2", "bg-background border border-border rounded-lg", "p-2", className), "aria-label": "Menu dock", children: [finalItems.map((item, index) => {
|
|
67
97
|
const Icon = item.icon;
|
|
68
98
|
const isActive = activeIndex === index;
|
|
69
|
-
return (_jsxs("button", { type: "button",
|
|
99
|
+
return (_jsxs("button", { type: "button", ref: (el) => {
|
|
100
|
+
buttonRefs.current[index] = el;
|
|
101
|
+
}, "data-active": isActive ? "true" : "false", "data-index": index.toString(), onClick: () => {
|
|
70
102
|
setActiveIndex(index);
|
|
71
103
|
item.onClick?.();
|
|
72
104
|
}, className: cn("relative flex items-center gap-2", "px-3 py-2 rounded-md", "transition-all duration-200", "hover:bg-accent hover:text-accent-foreground", isActive && "bg-accent text-accent-foreground", sizeClasses[variant]), "aria-label": item.label, "aria-current": isActive ? "page" : undefined, children: [_jsx(Icon, { className: cn(iconSizes[variant], isActive && "text-primary") }), showLabels && (_jsx("span", { ref: (el) => {
|
|
73
105
|
textRefs.current[index] = el;
|
|
74
|
-
if (
|
|
106
|
+
if (shouldUseIndicator && el) {
|
|
75
107
|
registerElement(el, index.toString());
|
|
76
108
|
}
|
|
77
|
-
}, "data-active": isActive, "data-index": index.toString(), className: cn("text-sm font-medium", "transition-all duration-200", isActive && "text-primary"), children: item.label }))] }, item.id || `menu-item-${index}`));
|
|
78
|
-
}),
|
|
109
|
+
}, "data-active": isActive, "data-index": index.toString(), className: cn("text-sm font-medium inline-block", "transition-all duration-200", isActive && "text-primary"), children: item.label }))] }, item.id || `menu-item-${index}`));
|
|
110
|
+
}), shouldUseIndicator && (_jsx(motion.div, { className: "absolute bottom-0 bg-primary", initial: false, animate: shouldReduceMotion
|
|
79
111
|
? {
|
|
80
112
|
opacity: indicatorStyle.opacity,
|
|
81
113
|
}
|
|
@@ -90,8 +122,69 @@ export const MenuDock = ({ items, className, variant = "default", orientation =
|
|
|
90
122
|
mass: 0.5,
|
|
91
123
|
}, style: {
|
|
92
124
|
pointerEvents: "none",
|
|
125
|
+
zIndex: 0,
|
|
93
126
|
left: 0,
|
|
94
127
|
bottom: 0,
|
|
95
128
|
height: "2px",
|
|
96
129
|
} }))] }));
|
|
97
130
|
};
|
|
131
|
+
/**
|
|
132
|
+
* FloatingDock - Componente de dock estilo macOS
|
|
133
|
+
*
|
|
134
|
+
* Note: Use position fixed according to your needs
|
|
135
|
+
* Desktop navbar is better positioned at the bottom
|
|
136
|
+
* Mobile navbar is better positioned at bottom right.
|
|
137
|
+
*/
|
|
138
|
+
const FloatingDock = ({ items, desktopClassName, mobileClassName, className, }) => {
|
|
139
|
+
return (_jsxs(_Fragment, { children: [_jsx(FloatingDockDesktop, { items: items, className: desktopClassName || className }), _jsx(FloatingDockMobile, { items: items, className: mobileClassName || className })] }));
|
|
140
|
+
};
|
|
141
|
+
const FloatingDockMobile = ({ items, className }) => {
|
|
142
|
+
const [open, setOpen] = useState(false);
|
|
143
|
+
return (_jsxs("div", { className: cn("relative block md:hidden", className), children: [_jsx(AnimatePresence, { children: open && (_jsx(motion.div, { layoutId: "nav", className: "absolute inset-x-0 bottom-full mb-2 flex flex-col gap-2", children: items.map((item, idx) => (_jsx(motion.div, { initial: { opacity: 0, y: 10 }, animate: {
|
|
144
|
+
opacity: 1,
|
|
145
|
+
y: 0,
|
|
146
|
+
}, exit: {
|
|
147
|
+
opacity: 0,
|
|
148
|
+
y: 10,
|
|
149
|
+
transition: {
|
|
150
|
+
delay: idx * 0.05,
|
|
151
|
+
},
|
|
152
|
+
}, transition: { delay: (items.length - 1 - idx) * 0.05 }, children: _jsx("a", { href: item.href, onClick: item.onClick, className: "flex h-10 w-10 items-center justify-center rounded-full bg-gray-50 dark:bg-neutral-900", children: _jsx("div", { className: "h-4 w-4", children: item.icon }) }) }, item.title))) })) }), _jsx("button", { onClick: () => setOpen(!open), className: "flex h-10 w-10 items-center justify-center rounded-full bg-gray-50 dark:bg-neutral-800", "aria-label": "Toggle menu", children: _jsx(Menu, { className: "h-5 w-5 text-neutral-500 dark:text-neutral-400" }) })] }));
|
|
153
|
+
};
|
|
154
|
+
const FloatingDockDesktop = ({ items, className }) => {
|
|
155
|
+
const mouseX = useMotionValue(Infinity);
|
|
156
|
+
return (_jsx(motion.div, { onMouseMove: (e) => mouseX.set(e.pageX), onMouseLeave: () => mouseX.set(Infinity), className: cn("mx-auto hidden h-16 items-end gap-4 rounded-2xl bg-gray-50 px-4 pb-3 md:flex dark:bg-neutral-900", className), children: items.map((item) => (_jsx(IconContainer, { mouseX: mouseX, ...item }, item.title))) }));
|
|
157
|
+
};
|
|
158
|
+
function IconContainer({ mouseX, title, icon, href, onClick, }) {
|
|
159
|
+
const ref = useRef(null);
|
|
160
|
+
const distance = useTransform(mouseX, (val) => {
|
|
161
|
+
const bounds = ref.current?.getBoundingClientRect() ?? { x: 0, width: 0 };
|
|
162
|
+
return val - bounds.x - bounds.width / 2;
|
|
163
|
+
});
|
|
164
|
+
const widthTransform = useTransform(distance, [-150, 0, 150], [40, 80, 40]);
|
|
165
|
+
const heightTransform = useTransform(distance, [-150, 0, 150], [40, 80, 40]);
|
|
166
|
+
const widthTransformIcon = useTransform(distance, [-150, 0, 150], [20, 40, 20]);
|
|
167
|
+
const heightTransformIcon = useTransform(distance, [-150, 0, 150], [20, 40, 20]);
|
|
168
|
+
const width = useSpring(widthTransform, {
|
|
169
|
+
mass: 0.1,
|
|
170
|
+
stiffness: 150,
|
|
171
|
+
damping: 12,
|
|
172
|
+
});
|
|
173
|
+
const height = useSpring(heightTransform, {
|
|
174
|
+
mass: 0.1,
|
|
175
|
+
stiffness: 150,
|
|
176
|
+
damping: 12,
|
|
177
|
+
});
|
|
178
|
+
const widthIcon = useSpring(widthTransformIcon, {
|
|
179
|
+
mass: 0.1,
|
|
180
|
+
stiffness: 150,
|
|
181
|
+
damping: 12,
|
|
182
|
+
});
|
|
183
|
+
const heightIcon = useSpring(heightTransformIcon, {
|
|
184
|
+
mass: 0.1,
|
|
185
|
+
stiffness: 150,
|
|
186
|
+
damping: 12,
|
|
187
|
+
});
|
|
188
|
+
const [hovered, setHovered] = useState(false);
|
|
189
|
+
return (_jsx("a", { href: href, onClick: onClick, children: _jsxs(motion.div, { ref: ref, style: { width, height }, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), className: "relative flex aspect-square items-center justify-center rounded-full bg-gray-200 dark:bg-neutral-800", children: [_jsx(AnimatePresence, { children: hovered && (_jsx(motion.div, { initial: { opacity: 0, y: 10, x: "-50%" }, animate: { opacity: 1, y: 0, x: "-50%" }, exit: { opacity: 0, y: 2, x: "-50%" }, className: "absolute -top-8 left-1/2 w-fit rounded-md border border-gray-200 bg-gray-100 px-2 py-0.5 text-xs whitespace-pre text-neutral-700 dark:border-neutral-900 dark:bg-neutral-800 dark:text-white", children: title })) }), _jsx(motion.div, { style: { width: widthIcon, height: heightIcon }, className: "flex items-center justify-center", children: icon })] }) }));
|
|
190
|
+
}
|
|
@@ -2,6 +2,4 @@
|
|
|
2
2
|
* Typography Molecules - Componentes de Tipografia Compostos
|
|
3
3
|
* Atomic Design: Componentes compostos de tipografia
|
|
4
4
|
*/
|
|
5
|
-
export type { AnimatedShinyTextProps } from "./animated-shiny-text";
|
|
6
|
-
export { AnimatedShinyText } from "./animated-shiny-text";
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/typography/index.ts"],"names":[],"mappings":"AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/typography/index.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -26,12 +26,12 @@ export declare const ContextContentBody: ({ children, className, ...props }: Con
|
|
|
26
26
|
export type ContextContentFooterProps = ComponentProps<"div">;
|
|
27
27
|
export declare const ContextContentFooter: ({ children, className, ...props }: ContextContentFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
export type ContextInputUsageProps = ComponentProps<"div">;
|
|
29
|
-
export declare const ContextInputUsage: ({ className, children, ...props }: ContextInputUsageProps) => string | number | bigint | true | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> |
|
|
29
|
+
export declare const ContextInputUsage: ({ className, children, ...props }: ContextInputUsageProps) => string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null;
|
|
30
30
|
export type ContextOutputUsageProps = ComponentProps<"div">;
|
|
31
|
-
export declare const ContextOutputUsage: ({ className, children, ...props }: ContextOutputUsageProps) => string | number | bigint | true | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> |
|
|
31
|
+
export declare const ContextOutputUsage: ({ className, children, ...props }: ContextOutputUsageProps) => string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null;
|
|
32
32
|
export type ContextReasoningUsageProps = ComponentProps<"div">;
|
|
33
|
-
export declare const ContextReasoningUsage: ({ className, children, ...props }: ContextReasoningUsageProps) => string | number | bigint | true | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> |
|
|
33
|
+
export declare const ContextReasoningUsage: ({ className, children, ...props }: ContextReasoningUsageProps) => string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null;
|
|
34
34
|
export type ContextCacheUsageProps = ComponentProps<"div">;
|
|
35
|
-
export declare const ContextCacheUsage: ({ className, children, ...props }: ContextCacheUsageProps) => string | number | bigint | true | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> |
|
|
35
|
+
export declare const ContextCacheUsage: ({ className, children, ...props }: ContextCacheUsageProps) => string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null;
|
|
36
36
|
export {};
|
|
37
37
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DocumentEditor - Flowtomic UI
|
|
3
|
+
*
|
|
4
|
+
* Editor de documentos multi-página similar ao Google Docs.
|
|
5
|
+
* Combina TextEditor com gerenciamento de páginas, título e metadata.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Múltiplas páginas com navegação
|
|
9
|
+
* - Título editável do documento
|
|
10
|
+
* - Metadata (última edição, palavras, caracteres)
|
|
11
|
+
* - Adicionar/remover páginas
|
|
12
|
+
* - Navegação entre páginas
|
|
13
|
+
* - Modo de edição Rich apenas (sem abas)
|
|
14
|
+
*/
|
|
15
|
+
import * as React from "react";
|
|
16
|
+
export interface DocumentPage {
|
|
17
|
+
id: string;
|
|
18
|
+
content: string;
|
|
19
|
+
}
|
|
20
|
+
export interface DocumentEditorProps {
|
|
21
|
+
/** Título do documento */
|
|
22
|
+
title?: string;
|
|
23
|
+
/** Callback quando o título muda */
|
|
24
|
+
onTitleChange?: (title: string) => void;
|
|
25
|
+
/** Páginas do documento */
|
|
26
|
+
pages?: DocumentPage[];
|
|
27
|
+
/** Callback quando as páginas mudam */
|
|
28
|
+
onPagesChange?: (pages: DocumentPage[]) => void;
|
|
29
|
+
/** Página ativa (índice) */
|
|
30
|
+
activePage?: number;
|
|
31
|
+
/** Callback quando a página ativa muda */
|
|
32
|
+
onActivePageChange?: (index: number) => void;
|
|
33
|
+
/** Se o documento é somente leitura */
|
|
34
|
+
readOnly?: boolean;
|
|
35
|
+
/** Modo de visualização: 'single' (paginado) ou 'continuous' (scroll contínuo) */
|
|
36
|
+
viewMode?: "single" | "continuous";
|
|
37
|
+
/** Callback quando o modo de visualização muda */
|
|
38
|
+
onViewModeChange?: (mode: "single" | "continuous") => void;
|
|
39
|
+
/** Classe CSS adicional */
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare const DocumentEditor: React.ForwardRefExoticComponent<DocumentEditorProps & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
//# sourceMappingURL=document-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/document-editor/document-editor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/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,4FAsS1B,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* DocumentEditor - Flowtomic UI
|
|
4
|
+
*
|
|
5
|
+
* Editor de documentos multi-página similar ao Google Docs.
|
|
6
|
+
* Combina TextEditor com gerenciamento de páginas, título e metadata.
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Múltiplas páginas com navegação
|
|
10
|
+
* - Título editável do documento
|
|
11
|
+
* - Metadata (última edição, palavras, caracteres)
|
|
12
|
+
* - Adicionar/remover páginas
|
|
13
|
+
* - Navegação entre páginas
|
|
14
|
+
* - Modo de edição Rich apenas (sem abas)
|
|
15
|
+
*/
|
|
16
|
+
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
|
+
import { cn } from "@/lib/utils";
|
|
21
|
+
function generateId() {
|
|
22
|
+
return `page-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
23
|
+
}
|
|
24
|
+
function countWords(text) {
|
|
25
|
+
return text.trim().split(/\s+/).filter(Boolean).length;
|
|
26
|
+
}
|
|
27
|
+
function countCharacters(text) {
|
|
28
|
+
return text.length;
|
|
29
|
+
}
|
|
30
|
+
export const DocumentEditor = React.forwardRef(({ title: controlledTitle, onTitleChange, pages: controlledPages, onPagesChange, activePage: controlledActivePage, onActivePageChange, readOnly = false, viewMode: controlledViewMode, onViewModeChange, className, }, ref) => {
|
|
31
|
+
// Estado interno para título
|
|
32
|
+
const [internalTitle, setInternalTitle] = React.useState("Documento sem título");
|
|
33
|
+
const title = controlledTitle ?? internalTitle;
|
|
34
|
+
const handleTitleChange = (newTitle) => {
|
|
35
|
+
if (!readOnly) {
|
|
36
|
+
setInternalTitle(newTitle);
|
|
37
|
+
onTitleChange?.(newTitle);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
// Estado interno para páginas
|
|
41
|
+
const [internalPages, setInternalPages] = React.useState([
|
|
42
|
+
{ id: generateId(), content: "" },
|
|
43
|
+
]);
|
|
44
|
+
const pages = controlledPages ?? internalPages;
|
|
45
|
+
const handlePagesChange = (newPages) => {
|
|
46
|
+
setInternalPages(newPages);
|
|
47
|
+
onPagesChange?.(newPages);
|
|
48
|
+
};
|
|
49
|
+
// Estado interno para página ativa
|
|
50
|
+
const [internalActivePage, setInternalActivePage] = React.useState(0);
|
|
51
|
+
const activePage = controlledActivePage ?? internalActivePage;
|
|
52
|
+
const handleActivePageChange = (index) => {
|
|
53
|
+
setInternalActivePage(index);
|
|
54
|
+
onActivePageChange?.(index);
|
|
55
|
+
};
|
|
56
|
+
// Última edição (timestamp)
|
|
57
|
+
const [lastEdit, setLastEdit] = React.useState(new Date());
|
|
58
|
+
// Estado interno para modo de visualização
|
|
59
|
+
const [internalViewMode, setInternalViewMode] = React.useState("single");
|
|
60
|
+
const viewMode = controlledViewMode ?? internalViewMode;
|
|
61
|
+
const handleViewModeChange = (mode) => {
|
|
62
|
+
setInternalViewMode(mode);
|
|
63
|
+
onViewModeChange?.(mode);
|
|
64
|
+
};
|
|
65
|
+
// Atualizar conteúdo da página ativa
|
|
66
|
+
const handlePageContentChange = (content) => {
|
|
67
|
+
if (readOnly)
|
|
68
|
+
return;
|
|
69
|
+
const newPages = [...pages];
|
|
70
|
+
newPages[activePage] = { ...newPages[activePage], content };
|
|
71
|
+
handlePagesChange(newPages);
|
|
72
|
+
setLastEdit(new Date());
|
|
73
|
+
};
|
|
74
|
+
// Atualizar conteúdo de uma página específica (modo contínuo)
|
|
75
|
+
const handleSpecificPageContentChange = (index, content) => {
|
|
76
|
+
if (readOnly)
|
|
77
|
+
return;
|
|
78
|
+
const newPages = [...pages];
|
|
79
|
+
newPages[index] = { ...newPages[index], content };
|
|
80
|
+
handlePagesChange(newPages);
|
|
81
|
+
setLastEdit(new Date());
|
|
82
|
+
};
|
|
83
|
+
// Adicionar nova página
|
|
84
|
+
const handleAddPage = () => {
|
|
85
|
+
if (readOnly)
|
|
86
|
+
return;
|
|
87
|
+
const newPage = { id: generateId(), content: "" };
|
|
88
|
+
handlePagesChange([...pages, newPage]);
|
|
89
|
+
handleActivePageChange(pages.length); // Ir para a nova página
|
|
90
|
+
};
|
|
91
|
+
// Remover página atual
|
|
92
|
+
const handleRemovePage = () => {
|
|
93
|
+
if (readOnly || pages.length <= 1)
|
|
94
|
+
return;
|
|
95
|
+
const newPages = pages.filter((_, i) => i !== activePage);
|
|
96
|
+
handlePagesChange(newPages);
|
|
97
|
+
// Ajustar página ativa
|
|
98
|
+
if (activePage >= newPages.length) {
|
|
99
|
+
handleActivePageChange(newPages.length - 1);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
// Navegar para página anterior
|
|
103
|
+
const handlePreviousPage = () => {
|
|
104
|
+
if (activePage > 0) {
|
|
105
|
+
handleActivePageChange(activePage - 1);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
// Navegar para próxima página
|
|
109
|
+
const handleNextPage = () => {
|
|
110
|
+
if (activePage < pages.length - 1) {
|
|
111
|
+
handleActivePageChange(activePage + 1);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
// Calcular estatísticas do documento
|
|
115
|
+
const totalWords = React.useMemo(() => {
|
|
116
|
+
return pages.reduce((sum, page) => sum + countWords(page.content), 0);
|
|
117
|
+
}, [pages]);
|
|
118
|
+
const totalCharacters = React.useMemo(() => {
|
|
119
|
+
return pages.reduce((sum, page) => sum + countCharacters(page.content), 0);
|
|
120
|
+
}, [pages]);
|
|
121
|
+
// Garantir que activePage está dentro do range válido
|
|
122
|
+
const safeActivePage = Math.min(Math.max(0, activePage), pages.length - 1);
|
|
123
|
+
const currentPage = pages[safeActivePage];
|
|
124
|
+
// Sincronizar activePage se estiver fora do range
|
|
125
|
+
React.useEffect(() => {
|
|
126
|
+
if (activePage !== safeActivePage) {
|
|
127
|
+
handleActivePageChange(safeActivePage);
|
|
128
|
+
}
|
|
129
|
+
}, [activePage, safeActivePage]);
|
|
130
|
+
if (!currentPage) {
|
|
131
|
+
return null; // Fallback de segurança
|
|
132
|
+
}
|
|
133
|
+
return (_jsxs("div", { ref: ref, className: cn("flex h-full flex-col", className), children: [_jsx("div", { className: "border-b bg-background p-4", children: _jsxs("div", { className: "mx-auto max-w-4xl space-y-3", children: [_jsx("input", { type: "text", value: title, onChange: (e) => handleTitleChange(e.target.value), disabled: readOnly, className: "w-full border-none bg-transparent text-2xl font-semibold outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed", placeholder: "Documento sem t\u00EDtulo" }), _jsxs("div", { className: "flex items-center gap-4 text-xs text-muted-foreground", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(Clock, { className: "size-3.5" }), _jsxs("span", { children: ["\u00DAltima edi\u00E7\u00E3o: ", lastEdit.toLocaleTimeString()] })] }), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(FileText, { className: "size-3.5" }), _jsxs("span", { children: [pages.length, " p\u00E1gina", pages.length !== 1 ? "s" : ""] })] }), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(Type, { className: "size-3.5" }), _jsxs("span", { children: [totalWords, " palavras \u00B7 ", totalCharacters, " caracteres"] })] })] })] }) }), _jsx("div", { className: "border-b bg-muted/30 px-4 py-2", children: _jsxs("div", { className: "mx-auto flex max-w-4xl items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { variant: viewMode === "single" ? "default" : "ghost", size: "sm", onClick: () => handleViewModeChange("single"), children: [_jsx(Columns, { className: "size-4" }), "Paginado"] }), _jsxs(Button, { variant: viewMode === "continuous" ? "default" : "ghost", size: "sm", onClick: () => handleViewModeChange("continuous"), children: [_jsx(List, { className: "size-4" }), "Cont\u00EDnuo"] })] }), viewMode === "single" && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { variant: "ghost", size: "sm", onClick: handlePreviousPage, disabled: safeActivePage === 0, children: [_jsx(ChevronLeft, { className: "size-4" }), "Anterior"] }), _jsxs("span", { className: "text-sm text-muted-foreground", children: ["P\u00E1gina ", safeActivePage + 1, " de ", pages.length] }), _jsxs(Button, { variant: "ghost", size: "sm", onClick: handleNextPage, disabled: safeActivePage === pages.length - 1, children: ["Pr\u00F3xima", _jsx(ChevronRight, { className: "size-4" })] })] })), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { variant: "ghost", size: "sm", onClick: handleAddPage, disabled: readOnly, children: [_jsx(Plus, { className: "size-4" }), "Adicionar p\u00E1gina"] }), viewMode === "single" && (_jsxs(Button, { variant: "ghost", size: "sm", onClick: handleRemovePage, disabled: readOnly || pages.length <= 1, children: [_jsx(Trash2, { className: "size-4" }), "Remover p\u00E1gina"] }))] })] }) }), _jsx("div", { className: "flex-1 overflow-auto bg-muted/20 p-8", children: _jsx("div", { className: "mx-auto max-w-4xl space-y-8", children: viewMode === "single" ? (
|
|
134
|
+
/* Modo paginado - apenas página ativa */
|
|
135
|
+
_jsx("div", { className: "min-h-[297mm] rounded-lg border bg-background p-16 shadow-sm", children: _jsx(TextEditor, { value: currentPage.content, onChange: handlePageContentChange, availableModes: ["rich"], editable: !readOnly, placeholder: "Comece a digitar..." }, currentPage.id) })) : (
|
|
136
|
+
/* Modo contínuo - todas as páginas */
|
|
137
|
+
pages.map((page, index) => (_jsxs("div", { className: "relative", children: [_jsxs("div", { className: "mb-2 flex items-center justify-between text-sm text-muted-foreground", children: [_jsxs("span", { children: ["P\u00E1gina ", index + 1] }), !readOnly && pages.length > 1 && (_jsxs(Button, { variant: "ghost", size: "sm", onClick: () => {
|
|
138
|
+
if (pages.length <= 1)
|
|
139
|
+
return;
|
|
140
|
+
const newPages = pages.filter((_, i) => i !== index);
|
|
141
|
+
handlePagesChange(newPages);
|
|
142
|
+
}, children: [_jsx(Trash2, { className: "size-3" }), "Remover"] }))] }), _jsx("div", { className: "min-h-[297mm] rounded-lg border bg-background p-16 shadow-sm", children: _jsx(TextEditor, { value: page.content, onChange: (content) => handleSpecificPageContentChange(index, content), availableModes: ["rich"], editable: !readOnly, placeholder: "Comece a digitar..." }, page.id) })] }, page.id)))) }) })] }));
|
|
143
|
+
});
|
|
144
|
+
DocumentEditor.displayName = "DocumentEditor";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/document-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DocumentEditor } from "./document-editor";
|