@fluencypassdevs/cycle 1.5.0 → 1.5.1

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.
@@ -0,0 +1,303 @@
1
+ import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from './chunk-IGMII4BK.js';
2
+ import { CycleIcon } from './chunk-V7M2NHUO.js';
3
+ import { toggleVariants } from './chunk-CIM6KJH5.js';
4
+ import { cn } from './chunk-TYCPXAXF.js';
5
+ import { __spreadValues } from './chunk-YINJ5YZ5.js';
6
+ import * as React from 'react';
7
+ import { useEditor, EditorContent } from '@tiptap/react';
8
+ import StarterKit from '@tiptap/starter-kit';
9
+ import Underline from '@tiptap/extension-underline';
10
+ import Placeholder from '@tiptap/extension-placeholder';
11
+ import { Undo2, Redo2, Bold, Italic, Underline as Underline$1, Strikethrough, Heading2, List, ListOrdered } from 'lucide-react';
12
+ import { jsxs, jsx } from 'react/jsx-runtime';
13
+
14
+ function ToolbarDivider() {
15
+ return /* @__PURE__ */ jsx("div", { className: "mx-1 h-5 w-px bg-neutral-border", "aria-hidden": "true" });
16
+ }
17
+ function ToolbarToggle({ pressed, onToggle, icon, label, disabled }) {
18
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
19
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
20
+ "button",
21
+ {
22
+ type: "button",
23
+ className: cn(
24
+ toggleVariants({ variant: "default", size: "icon-sm" }),
25
+ pressed && "bg-accent text-accent-foreground"
26
+ ),
27
+ onClick: onToggle,
28
+ "aria-pressed": pressed,
29
+ "aria-label": label,
30
+ disabled,
31
+ "data-state": pressed ? "on" : "off",
32
+ children: /* @__PURE__ */ jsx(CycleIcon, { icon, size: "xs", decorative: true })
33
+ }
34
+ ) }),
35
+ /* @__PURE__ */ jsx(TooltipContent, { children: label })
36
+ ] });
37
+ }
38
+ function getToolbarState(editor) {
39
+ return {
40
+ isBold: editor.isActive("bold"),
41
+ isItalic: editor.isActive("italic"),
42
+ isUnderline: editor.isActive("underline"),
43
+ isStrike: editor.isActive("strike"),
44
+ isH2: editor.isActive("heading", { level: 2 }),
45
+ isBulletList: editor.isActive("bulletList"),
46
+ isOrderedList: editor.isActive("orderedList"),
47
+ canUndo: editor.can().undo(),
48
+ canRedo: editor.can().redo()
49
+ };
50
+ }
51
+ function EditorToolbar({ editor, state, theme }) {
52
+ const {
53
+ isBold,
54
+ isItalic,
55
+ isUnderline,
56
+ isStrike,
57
+ isH2,
58
+ isBulletList,
59
+ isOrderedList,
60
+ canUndo,
61
+ canRedo
62
+ } = state;
63
+ return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(
64
+ "div",
65
+ {
66
+ className: cn(
67
+ "flex items-center gap-0.5 overflow-x-auto border-b border-neutral-border px-2 py-1.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
68
+ theme
69
+ ),
70
+ role: "toolbar",
71
+ "aria-label": "Formatting options",
72
+ children: [
73
+ /* @__PURE__ */ jsx(
74
+ ToolbarToggle,
75
+ {
76
+ pressed: false,
77
+ onToggle: () => editor.chain().focus().undo().run(),
78
+ icon: Undo2,
79
+ label: "Undo",
80
+ disabled: !canUndo
81
+ }
82
+ ),
83
+ /* @__PURE__ */ jsx(
84
+ ToolbarToggle,
85
+ {
86
+ pressed: false,
87
+ onToggle: () => editor.chain().focus().redo().run(),
88
+ icon: Redo2,
89
+ label: "Redo",
90
+ disabled: !canRedo
91
+ }
92
+ ),
93
+ /* @__PURE__ */ jsx(ToolbarDivider, {}),
94
+ /* @__PURE__ */ jsx(
95
+ ToolbarToggle,
96
+ {
97
+ pressed: isBold,
98
+ onToggle: () => editor.chain().focus().toggleBold().run(),
99
+ icon: Bold,
100
+ label: "Bold"
101
+ }
102
+ ),
103
+ /* @__PURE__ */ jsx(
104
+ ToolbarToggle,
105
+ {
106
+ pressed: isItalic,
107
+ onToggle: () => editor.chain().focus().toggleItalic().run(),
108
+ icon: Italic,
109
+ label: "Italic"
110
+ }
111
+ ),
112
+ /* @__PURE__ */ jsx(
113
+ ToolbarToggle,
114
+ {
115
+ pressed: isUnderline,
116
+ onToggle: () => editor.chain().focus().toggleUnderline().run(),
117
+ icon: Underline$1,
118
+ label: "Underline"
119
+ }
120
+ ),
121
+ /* @__PURE__ */ jsx(
122
+ ToolbarToggle,
123
+ {
124
+ pressed: isStrike,
125
+ onToggle: () => editor.chain().focus().toggleStrike().run(),
126
+ icon: Strikethrough,
127
+ label: "Strikethrough"
128
+ }
129
+ ),
130
+ /* @__PURE__ */ jsx(ToolbarDivider, {}),
131
+ /* @__PURE__ */ jsx(
132
+ ToolbarToggle,
133
+ {
134
+ pressed: isH2,
135
+ onToggle: () => editor.chain().focus().toggleHeading({ level: 2 }).run(),
136
+ icon: Heading2,
137
+ label: "Heading 2"
138
+ }
139
+ ),
140
+ /* @__PURE__ */ jsx(ToolbarDivider, {}),
141
+ /* @__PURE__ */ jsx(
142
+ ToolbarToggle,
143
+ {
144
+ pressed: isBulletList,
145
+ onToggle: () => editor.chain().focus().toggleBulletList().run(),
146
+ icon: List,
147
+ label: "Bullet list"
148
+ }
149
+ ),
150
+ /* @__PURE__ */ jsx(
151
+ ToolbarToggle,
152
+ {
153
+ pressed: isOrderedList,
154
+ onToggle: () => editor.chain().focus().toggleOrderedList().run(),
155
+ icon: ListOrdered,
156
+ label: "Ordered list"
157
+ }
158
+ )
159
+ ]
160
+ }
161
+ ) });
162
+ }
163
+ var Editor = React.forwardRef(
164
+ function Editor2({
165
+ content,
166
+ defaultContent,
167
+ onChange,
168
+ placeholder = "Type something...",
169
+ editable = true,
170
+ className,
171
+ autoFocus = false,
172
+ maxHeight,
173
+ minHeight = "120px",
174
+ resizable = false,
175
+ toolbarTheme
176
+ }, ref) {
177
+ var _a;
178
+ const [toolbarState, setToolbarState] = React.useState({
179
+ isBold: false,
180
+ isItalic: false,
181
+ isUnderline: false,
182
+ isStrike: false,
183
+ isH2: false,
184
+ isBulletList: false,
185
+ isOrderedList: false,
186
+ canUndo: false,
187
+ canRedo: false
188
+ });
189
+ const onChangeRef = React.useRef(onChange);
190
+ onChangeRef.current = onChange;
191
+ const editor = useEditor({
192
+ immediatelyRender: false,
193
+ extensions: [
194
+ StarterKit.configure({
195
+ heading: { levels: [2] }
196
+ }),
197
+ Underline,
198
+ Placeholder.configure({ placeholder })
199
+ ],
200
+ content: (_a = defaultContent != null ? defaultContent : content) != null ? _a : "",
201
+ editable,
202
+ autofocus: autoFocus,
203
+ onUpdate: ({ editor: e }) => {
204
+ var _a2;
205
+ (_a2 = onChangeRef.current) == null ? void 0 : _a2.call(onChangeRef, e.getHTML());
206
+ }
207
+ });
208
+ React.useEffect(() => {
209
+ if (!editor) return;
210
+ const sync = () => setToolbarState(getToolbarState(editor));
211
+ sync();
212
+ editor.on("transaction", sync);
213
+ return () => {
214
+ editor.off("transaction", sync);
215
+ };
216
+ }, [editor]);
217
+ React.useEffect(() => {
218
+ if (content !== void 0 && editor && editor.getHTML() !== content) {
219
+ editor.commands.setContent(content, { emitUpdate: false });
220
+ }
221
+ }, [content, editor]);
222
+ React.useEffect(() => {
223
+ editor == null ? void 0 : editor.setEditable(editable);
224
+ }, [editable, editor]);
225
+ React.useImperativeHandle(ref, () => ({
226
+ editor,
227
+ getHTML: () => {
228
+ var _a2;
229
+ return (_a2 = editor == null ? void 0 : editor.getHTML()) != null ? _a2 : "";
230
+ },
231
+ getText: () => {
232
+ var _a2;
233
+ return (_a2 = editor == null ? void 0 : editor.getText()) != null ? _a2 : "";
234
+ },
235
+ clear: () => {
236
+ editor == null ? void 0 : editor.commands.clearContent();
237
+ },
238
+ focus: () => {
239
+ editor == null ? void 0 : editor.commands.focus();
240
+ }
241
+ }), [editor]);
242
+ if (!editor) return null;
243
+ return /* @__PURE__ */ jsxs(
244
+ "div",
245
+ {
246
+ "data-editor-wrapper": true,
247
+ className: cn(
248
+ // Base — same tokens as Textarea (outline variant)
249
+ "w-full rounded-lg border border-neutral-border bg-transparent text-neutral-foreground shadow-xs dark:shadow-none",
250
+ "transition-[color,border-color,box-shadow,background-color] outline-none",
251
+ // Hover
252
+ "hover:border-ring hover:bg-ring/5",
253
+ // Focus-within (focus is on nested contenteditable, not the wrapper)
254
+ "focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 focus-within:bg-ring/5",
255
+ // Error
256
+ "aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:hover:border-destructive dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40",
257
+ // Disabled
258
+ !editable && "opacity-50 cursor-not-allowed pointer-events-none",
259
+ className
260
+ ),
261
+ children: [
262
+ /* @__PURE__ */ jsx("style", { children: `
263
+ [data-editor-wrapper] .tiptap {
264
+ min-height: var(--editor-min-h, 120px);
265
+ max-height: var(--editor-max-h, none);
266
+ }
267
+ [data-editor-wrapper] .tiptap p.is-editor-empty:first-child::before {
268
+ color: var(--color-neutral-muted-foreground);
269
+ content: attr(data-placeholder);
270
+ float: left;
271
+ height: 0;
272
+ pointer-events: none;
273
+ }
274
+ ` }),
275
+ /* @__PURE__ */ jsx(EditorToolbar, { editor, state: toolbarState, theme: toolbarTheme }),
276
+ /* @__PURE__ */ jsx(
277
+ EditorContent,
278
+ {
279
+ editor,
280
+ className: cn(
281
+ "text-sm text-foreground",
282
+ "selection:bg-primary selection:text-primary-foreground",
283
+ resizable && "resize-y",
284
+ // Scroll on .tiptap directly — Tiptap auto-scrolls to keep cursor in view
285
+ "[&_.tiptap]:outline-none [&_.tiptap]:overflow-y-auto [&_.tiptap]:px-4 [&_.tiptap]:py-2",
286
+ "[&_.tiptap_p]:my-1.5 [&_.tiptap_p]:leading-relaxed",
287
+ "[&_.tiptap_h2]:my-2 [&_.tiptap_h2]:text-lg [&_.tiptap_h2]:font-semibold",
288
+ "[&_.tiptap_ul]:my-1.5 [&_.tiptap_ul]:list-disc [&_.tiptap_ul]:pl-6",
289
+ "[&_.tiptap_ol]:my-1.5 [&_.tiptap_ol]:list-decimal [&_.tiptap_ol]:pl-6",
290
+ "[&_.tiptap_li]:my-0.5"
291
+ ),
292
+ style: __spreadValues(__spreadValues({}, minHeight && { ["--editor-min-h"]: minHeight }), maxHeight && { ["--editor-max-h"]: maxHeight })
293
+ }
294
+ )
295
+ ]
296
+ }
297
+ );
298
+ }
299
+ );
300
+
301
+ export { Editor };
302
+ //# sourceMappingURL=chunk-D4UH2HJQ.js.map
303
+ //# sourceMappingURL=chunk-D4UH2HJQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/editor.tsx"],"names":["UnderlineIcon","Editor","_a"],"mappings":";;;;;;;;;;;;;AAwEA,SAAS,cAAA,GAAiB;AACxB,EAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,iCAAA,EAAkC,eAAY,MAAA,EAAO,CAAA;AAC7E;AAUA,SAAS,cAAc,EAAE,OAAA,EAAS,UAAU,IAAA,EAAM,KAAA,EAAO,UAAS,EAAuB;AACvF,EAAA,4BACG,OAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,cAAA,EAAA,EAAe,SAAO,IAAA,EACrB,QAAA,kBAAA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAK,QAAA;AAAA,QACL,SAAA,EAAW,EAAA;AAAA,UACT,eAAe,EAAE,OAAA,EAAS,SAAA,EAAW,IAAA,EAAM,WAAW,CAAA;AAAA,UACtD,OAAA,IAAW;AAAA,SACb;AAAA,QACA,OAAA,EAAS,QAAA;AAAA,QACT,cAAA,EAAc,OAAA;AAAA,QACd,YAAA,EAAY,KAAA;AAAA,QACZ,QAAA;AAAA,QACA,YAAA,EAAY,UAAU,IAAA,GAAO,KAAA;AAAA,QAE7B,8BAAC,SAAA,EAAA,EAAU,IAAA,EAAY,IAAA,EAAK,IAAA,EAAK,YAAU,IAAA,EAAC;AAAA;AAAA,KAC9C,EACF,CAAA;AAAA,oBACA,GAAA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,MAAA,EAAgB,KAAA,EAAO,YAAA,EAAc,OAAO,YAAA,EAAc,CAAA;AAAA,0BAEzE,GAAA;AAAA,YAAC,aAAA;AAAA,YAAA;AAAA,cACC,MAAA;AAAA,cACA,SAAA,EAAW,EAAA;AAAA,gBACT,yBAAA;AAAA,gBACA,wDAAA;AAAA,gBACA,SAAA,IAAa,UAAA;AAAA;AAAA,gBAEb,wFAAA;AAAA,gBACA,oDAAA;AAAA,gBACA,yEAAA;AAAA,gBACA,oEAAA;AAAA,gBACA,uEAAA;AAAA,gBACA;AAAA,eACF;AAAA,cACA,KAAA,EAAO,cAAA,CAAA,cAAA,CAAA,EAAA,EACD,SAAA,IAAa,EAAE,CAAC,gBAA0B,GAAG,SAAA,EAAU,CAAA,EACvD,SAAA,IAAa,EAAE,CAAC,gBAA0B,GAAG,SAAA,EAAU;AAAA;AAAA;AAE/D;AAAA;AAAA,KACF;AAAA,EAEJ;AACF","file":"chunk-D4UH2HJQ.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { useEditor, EditorContent, type Editor as TiptapEditor } from \"@tiptap/react\"\nimport StarterKit from \"@tiptap/starter-kit\"\nimport Underline from \"@tiptap/extension-underline\"\nimport Placeholder from \"@tiptap/extension-placeholder\"\nimport {\n Bold,\n Italic,\n Underline as UnderlineIcon,\n Strikethrough,\n Heading2,\n List,\n ListOrdered,\n Undo2,\n Redo2,\n type LucideIcon,\n} from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { toggleVariants } from \"@/components/ui/toggle\"\nimport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n} from \"@/components/ui/tooltip\"\nimport { CycleIcon } from \"@/components/icons\"\n\n// ── Types ────────────────────────────────────────────────────────────\n\nexport interface EditorRef {\n /** The Tiptap editor instance */\n editor: TiptapEditor | null\n /** Get current HTML content */\n getHTML: () => string\n /** Get current plain-text content */\n getText: () => string\n /** Clear the editor */\n clear: () => void\n /** Focus the editor */\n focus: () => void\n}\n\nexport interface EditorProps {\n /** HTML content (controlled) */\n content?: string\n /** Default HTML content (uncontrolled) */\n defaultContent?: string\n /** Called when content changes with the HTML string */\n onChange?: (html: string) => void\n /** Placeholder text shown when the editor is empty */\n placeholder?: string\n /** Whether the editor is editable */\n editable?: boolean\n /** Additional class for the outer wrapper */\n className?: string\n /** Auto-focus the editor on mount */\n autoFocus?: boolean\n /** Max height of the content area — scrolls when exceeded (e.g. \"300px\", \"50vh\") */\n maxHeight?: string\n /** Min height of the content area (default: \"120px\") */\n minHeight?: string\n /** Allow the user to resize the editor vertically */\n resizable?: boolean\n /** Theme class for the toolbar pressed state (e.g. \"theme-class\", \"theme-brand\") */\n toolbarTheme?: string\n}\n\n// ── Toolbar internals ────────────────────────────────────────────────\n\nfunction ToolbarDivider() {\n return <div className=\"mx-1 h-5 w-px bg-neutral-border\" aria-hidden=\"true\" />\n}\n\ninterface ToolbarToggleProps {\n pressed: boolean\n onToggle: () => void\n icon: LucideIcon\n label: string\n disabled?: boolean\n}\n\nfunction ToolbarToggle({ pressed, onToggle, icon, label, disabled }: ToolbarToggleProps) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n className={cn(\n toggleVariants({ variant: \"default\", size: \"icon-sm\" }),\n pressed && \"bg-accent text-accent-foreground\"\n )}\n onClick={onToggle}\n aria-pressed={pressed}\n aria-label={label}\n disabled={disabled}\n data-state={pressed ? \"on\" : \"off\"}\n >\n <CycleIcon icon={icon} size=\"xs\" decorative />\n </button>\n </TooltipTrigger>\n <TooltipContent>{label}</TooltipContent>\n </Tooltip>\n )\n}\n\ninterface ToolbarState {\n isBold: boolean\n isItalic: boolean\n isUnderline: boolean\n isStrike: boolean\n isH2: boolean\n isBulletList: boolean\n isOrderedList: boolean\n canUndo: boolean\n canRedo: boolean\n}\n\nfunction getToolbarState(editor: TiptapEditor): ToolbarState {\n return {\n isBold: editor.isActive(\"bold\"),\n isItalic: editor.isActive(\"italic\"),\n isUnderline: editor.isActive(\"underline\"),\n isStrike: editor.isActive(\"strike\"),\n isH2: editor.isActive(\"heading\", { level: 2 }),\n isBulletList: editor.isActive(\"bulletList\"),\n isOrderedList: editor.isActive(\"orderedList\"),\n canUndo: editor.can().undo(),\n canRedo: editor.can().redo(),\n }\n}\n\nfunction EditorToolbar({ editor, state, theme }: { editor: TiptapEditor; state: ToolbarState; theme?: string }) {\n const {\n isBold, isItalic, isUnderline, isStrike, isH2,\n isBulletList, isOrderedList, canUndo, canRedo,\n } = state\n\n return (\n <TooltipProvider>\n <div\n className={cn(\n \"flex items-center gap-0.5 overflow-x-auto border-b border-neutral-border px-2 py-1.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n theme\n )}\n role=\"toolbar\"\n aria-label=\"Formatting options\"\n >\n {/* History */}\n <ToolbarToggle\n pressed={false}\n onToggle={() => editor.chain().focus().undo().run()}\n icon={Undo2}\n label=\"Undo\"\n disabled={!canUndo}\n />\n <ToolbarToggle\n pressed={false}\n onToggle={() => editor.chain().focus().redo().run()}\n icon={Redo2}\n label=\"Redo\"\n disabled={!canRedo}\n />\n\n <ToolbarDivider />\n\n {/* Text formatting */}\n <ToolbarToggle\n pressed={isBold}\n onToggle={() => editor.chain().focus().toggleBold().run()}\n icon={Bold}\n label=\"Bold\"\n />\n <ToolbarToggle\n pressed={isItalic}\n onToggle={() => editor.chain().focus().toggleItalic().run()}\n icon={Italic}\n label=\"Italic\"\n />\n <ToolbarToggle\n pressed={isUnderline}\n onToggle={() => editor.chain().focus().toggleUnderline().run()}\n icon={UnderlineIcon}\n label=\"Underline\"\n />\n <ToolbarToggle\n pressed={isStrike}\n onToggle={() => editor.chain().focus().toggleStrike().run()}\n icon={Strikethrough}\n label=\"Strikethrough\"\n />\n\n <ToolbarDivider />\n\n {/* Heading */}\n <ToolbarToggle\n pressed={isH2}\n onToggle={() => editor.chain().focus().toggleHeading({ level: 2 }).run()}\n icon={Heading2}\n label=\"Heading 2\"\n />\n\n <ToolbarDivider />\n\n {/* Lists */}\n <ToolbarToggle\n pressed={isBulletList}\n onToggle={() => editor.chain().focus().toggleBulletList().run()}\n icon={List}\n label=\"Bullet list\"\n />\n <ToolbarToggle\n pressed={isOrderedList}\n onToggle={() => editor.chain().focus().toggleOrderedList().run()}\n icon={ListOrdered}\n label=\"Ordered list\"\n />\n </div>\n </TooltipProvider>\n )\n}\n\n// ── Editor ───────────────────────────────────────────────────────────\n\nconst Editor = React.forwardRef<EditorRef, EditorProps>(\n function Editor(\n {\n content,\n defaultContent,\n onChange,\n placeholder = \"Type something...\",\n editable = true,\n className,\n autoFocus = false,\n maxHeight,\n minHeight = \"120px\",\n resizable = false,\n toolbarTheme,\n },\n ref\n ) {\n const [toolbarState, setToolbarState] = React.useState<ToolbarState>({\n isBold: false, isItalic: false, isUnderline: false, isStrike: false,\n isH2: false, isBulletList: false, isOrderedList: false,\n canUndo: false, canRedo: false,\n })\n\n const onChangeRef = React.useRef(onChange)\n onChangeRef.current = onChange\n\n const editor = useEditor({\n immediatelyRender: false,\n extensions: [\n StarterKit.configure({\n heading: { levels: [2] },\n }),\n Underline,\n Placeholder.configure({ placeholder }),\n ],\n content: defaultContent ?? content ?? \"\",\n editable,\n autofocus: autoFocus,\n onUpdate: ({ editor: e }) => {\n onChangeRef.current?.(e.getHTML())\n },\n })\n\n // Subscribe to editor events directly — avoids stale closure issues\n // with useEditor callbacks on React 19\n React.useEffect(() => {\n if (!editor) return\n const sync = () => setToolbarState(getToolbarState(editor))\n sync()\n editor.on(\"transaction\", sync)\n return () => { editor.off(\"transaction\", sync) }\n }, [editor])\n\n // Sync controlled content\n React.useEffect(() => {\n if (content !== undefined && editor && editor.getHTML() !== content) {\n editor.commands.setContent(content, { emitUpdate: false })\n }\n }, [content, editor])\n\n // Sync editable\n React.useEffect(() => {\n editor?.setEditable(editable)\n }, [editable, editor])\n\n // Expose ref\n React.useImperativeHandle(ref, () => ({\n editor,\n getHTML: () => editor?.getHTML() ?? \"\",\n getText: () => editor?.getText() ?? \"\",\n clear: () => { editor?.commands.clearContent() },\n focus: () => { editor?.commands.focus() },\n }), [editor])\n\n if (!editor) return null\n\n return (\n <div\n data-editor-wrapper\n className={cn(\n // Base — same tokens as Textarea (outline variant)\n \"w-full rounded-lg border border-neutral-border bg-transparent text-neutral-foreground shadow-xs dark:shadow-none\",\n \"transition-[color,border-color,box-shadow,background-color] outline-none\",\n // Hover\n \"hover:border-ring hover:bg-ring/5\",\n // Focus-within (focus is on nested contenteditable, not the wrapper)\n \"focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 focus-within:bg-ring/5\",\n // Error\n \"aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:hover:border-destructive dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40\",\n // Disabled\n !editable && \"opacity-50 cursor-not-allowed pointer-events-none\",\n className\n )}\n >\n {/* Scoped styles: placeholder + Tiptap scroll/sizing */}\n <style>{`\n [data-editor-wrapper] .tiptap {\n min-height: var(--editor-min-h, 120px);\n max-height: var(--editor-max-h, none);\n }\n [data-editor-wrapper] .tiptap p.is-editor-empty:first-child::before {\n color: var(--color-neutral-muted-foreground);\n content: attr(data-placeholder);\n float: left;\n height: 0;\n pointer-events: none;\n }\n `}</style>\n\n <EditorToolbar editor={editor} state={toolbarState} theme={toolbarTheme} />\n\n <EditorContent\n editor={editor}\n className={cn(\n \"text-sm text-foreground\",\n \"selection:bg-primary selection:text-primary-foreground\",\n resizable && \"resize-y\",\n // Scroll on .tiptap directly — Tiptap auto-scrolls to keep cursor in view\n \"[&_.tiptap]:outline-none [&_.tiptap]:overflow-y-auto [&_.tiptap]:px-4 [&_.tiptap]:py-2\",\n \"[&_.tiptap_p]:my-1.5 [&_.tiptap_p]:leading-relaxed\",\n \"[&_.tiptap_h2]:my-2 [&_.tiptap_h2]:text-lg [&_.tiptap_h2]:font-semibold\",\n \"[&_.tiptap_ul]:my-1.5 [&_.tiptap_ul]:list-disc [&_.tiptap_ul]:pl-6\",\n \"[&_.tiptap_ol]:my-1.5 [&_.tiptap_ol]:list-decimal [&_.tiptap_ol]:pl-6\",\n \"[&_.tiptap_li]:my-0.5\",\n )}\n style={{\n ...(minHeight && { [\"--editor-min-h\" as string]: minHeight }),\n ...(maxHeight && { [\"--editor-max-h\" as string]: maxHeight }),\n }}\n />\n </div>\n )\n }\n)\n\nexport { Editor }\n"]}
package/dist/index.d.ts CHANGED
@@ -43,6 +43,7 @@ export { Fab, FabProps, fabVariants } from './ui/fab.js';
43
43
  export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from './ui/drawer.js';
44
44
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from './ui/dialog.js';
45
45
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './ui/dropdown-menu.js';
46
+ export { Editor, EditorProps, EditorRef } from './ui/editor.js';
46
47
  import 'clsx';
47
48
  import 'react';
48
49
  import 'lucide-react';
@@ -54,3 +55,4 @@ import '@vidstack/react/player/layouts/default';
54
55
  import 'sonner';
55
56
  import 'react-resizable-panels';
56
57
  import 'vaul';
58
+ import '@tiptap/react';
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './chunk-NOMLQHZS.js';
2
+ export { Editor } from './chunk-D4UH2HJQ.js';
2
3
  export { ClassLogo, GroupTalkLogo, PrivateTalkLogo, ProductLogo } from './chunk-66CU7J2I.js';
3
4
  export { FluencypassIcon, FluencypassLogo } from './chunk-5LZHXNBV.js';
4
5
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './chunk-IGMII4BK.js';
@@ -4,8 +4,8 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const badgeVariants: (props?: ({
7
- variant?: "link" | "progress" | "default" | "outline" | "destructive" | "secondary" | "ghost" | "muted" | "success" | "progress-completed" | null | undefined;
8
- size?: "sm" | "default" | "lg" | null | undefined;
7
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "progress" | "muted" | "success" | "progress-completed" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface BadgeProps extends React.ComponentProps<"span">, VariantProps<typeof badgeVariants> {
11
11
  asChild?: boolean;
@@ -4,8 +4,8 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const buttonVariants: (props?: ({
7
- variant?: "link" | "default" | "outline" | "destructive" | "secondary" | "ghost" | null | undefined;
8
- size?: "sm" | "default" | "lg" | "xs" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
7
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
8
+ size?: "xs" | "sm" | "lg" | "icon" | "default" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface ButtonProps extends React.ComponentProps<"button">, VariantProps<typeof buttonVariants> {
11
11
  asChild?: boolean;
@@ -5,7 +5,7 @@ import { Checkbox as Checkbox$1 } from 'radix-ui';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
 
7
7
  declare const checkboxVariants: (props?: ({
8
- size?: "sm" | "default" | "lg" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | null | undefined;
9
9
  variant?: "default" | "circular" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  interface CheckboxProps extends React.ComponentProps<typeof Checkbox$1.Root>, VariantProps<typeof checkboxVariants> {
@@ -0,0 +1,42 @@
1
+ import * as React from 'react';
2
+ import { Editor as Editor$1 } from '@tiptap/react';
3
+
4
+ interface EditorRef {
5
+ /** The Tiptap editor instance */
6
+ editor: Editor$1 | null;
7
+ /** Get current HTML content */
8
+ getHTML: () => string;
9
+ /** Get current plain-text content */
10
+ getText: () => string;
11
+ /** Clear the editor */
12
+ clear: () => void;
13
+ /** Focus the editor */
14
+ focus: () => void;
15
+ }
16
+ interface EditorProps {
17
+ /** HTML content (controlled) */
18
+ content?: string;
19
+ /** Default HTML content (uncontrolled) */
20
+ defaultContent?: string;
21
+ /** Called when content changes with the HTML string */
22
+ onChange?: (html: string) => void;
23
+ /** Placeholder text shown when the editor is empty */
24
+ placeholder?: string;
25
+ /** Whether the editor is editable */
26
+ editable?: boolean;
27
+ /** Additional class for the outer wrapper */
28
+ className?: string;
29
+ /** Auto-focus the editor on mount */
30
+ autoFocus?: boolean;
31
+ /** Max height of the content area — scrolls when exceeded (e.g. "300px", "50vh") */
32
+ maxHeight?: string;
33
+ /** Min height of the content area (default: "120px") */
34
+ minHeight?: string;
35
+ /** Allow the user to resize the editor vertically */
36
+ resizable?: boolean;
37
+ /** Theme class for the toolbar pressed state (e.g. "theme-class", "theme-brand") */
38
+ toolbarTheme?: string;
39
+ }
40
+ declare const Editor: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<EditorRef>>;
41
+
42
+ export { Editor, type EditorProps, type EditorRef };
@@ -0,0 +1,9 @@
1
+ export { Editor } from '../chunk-D4UH2HJQ.js';
2
+ import '../chunk-IGMII4BK.js';
3
+ import '../chunk-JPEDYOV7.js';
4
+ import '../chunk-V7M2NHUO.js';
5
+ import '../chunk-CIM6KJH5.js';
6
+ import '../chunk-TYCPXAXF.js';
7
+ import '../chunk-YINJ5YZ5.js';
8
+ //# sourceMappingURL=editor.js.map
9
+ //# sourceMappingURL=editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"editor.js"}
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
5
5
  declare function Empty({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
6
6
  declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
7
7
  declare const emptyMediaVariants: (props?: ({
8
- variant?: "default" | "icon" | null | undefined;
8
+ variant?: "icon" | "default" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): react_jsx_runtime.JSX.Element;
11
11
  declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
package/dist/ui/fab.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const fabVariants: (props?: ({
7
- size?: "sm" | "default" | "lg" | null | undefined;
7
+ size?: "sm" | "lg" | "default" | null | undefined;
8
8
  variant?: "default" | "outline" | "secondary" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface FabProps extends React.ComponentProps<"button">, VariantProps<typeof fabVariants> {
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const fileCardVariants: (props?: ({
7
- size?: "sm" | "lg" | "md" | null | undefined;
7
+ size?: "sm" | "md" | "lg" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface FileCardProps extends Omit<React.ComponentProps<"button">, "children" | "size">, VariantProps<typeof fileCardVariants> {
10
10
  /** Nome do arquivo exibido como titulo */
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const likeDislikeVariants: (props?: ({
7
- size?: "sm" | "default" | "lg" | "xs" | null | undefined;
7
+ size?: "xs" | "sm" | "lg" | "default" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  type LikeDislikeValue = "like" | "dislike" | null;
10
10
  interface LikeDislikeProps extends Omit<React.ComponentProps<"div">, "onChange" | "defaultValue">, VariantProps<typeof likeDislikeVariants> {
@@ -4,10 +4,10 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const progressDotVariants: (props?: ({
7
- size?: "sm" | "default" | "lg" | "xs" | null | undefined;
7
+ size?: "xs" | "sm" | "lg" | "default" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  declare const dotVariants: (props?: ({
10
- size?: "sm" | "default" | "lg" | "xs" | null | undefined;
10
+ size?: "xs" | "sm" | "lg" | "default" | null | undefined;
11
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;
12
12
  interface ProgressDotProps extends React.ComponentProps<"div">, VariantProps<typeof dotVariants> {
13
13
  /** Numero total de stages (2–10) */
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const progressStagePillVariants: (props?: ({
7
- size?: "sm" | "default" | "lg" | "xs" | null | undefined;
7
+ size?: "xs" | "sm" | "lg" | "default" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface ProgressStageProps extends React.ComponentProps<"div">, VariantProps<typeof progressStagePillVariants> {
10
10
  /** Numero total de stages (2–10) */
@@ -5,7 +5,7 @@ import { Progress as Progress$1 } from 'radix-ui';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
 
7
7
  declare const progressVariants: (props?: ({
8
- size?: "sm" | "default" | "lg" | "xs" | null | undefined;
8
+ size?: "xs" | "sm" | "lg" | "default" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  declare const indicatorVariants: (props?: ({
11
11
  variant?: "default" | "destructive" | "secondary" | "muted" | null | undefined;
@@ -5,7 +5,7 @@ import { RadioGroup as RadioGroup$1 } from 'radix-ui';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
 
7
7
  declare const radioVariants: (props?: ({
8
- size?: "sm" | "default" | "lg" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface RadioGroupProps extends React.ComponentProps<typeof RadioGroup$1.Root> {
11
11
  }
@@ -5,7 +5,7 @@ import { Slider as Slider$1 } from 'radix-ui';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
 
7
7
  declare const sliderVariants: (props?: ({
8
- size?: "sm" | "default" | "lg" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface SliderProps extends React.ComponentProps<typeof Slider$1.Root>, VariantProps<typeof sliderVariants> {
11
11
  /** Classe de tema aplicada (ex: "theme-brand") */
@@ -5,7 +5,7 @@ import { Switch as Switch$1 } from 'radix-ui';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
 
7
7
  declare const switchVariants: (props?: ({
8
- size?: "sm" | "default" | "lg" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface SwitchProps extends React.ComponentProps<typeof Switch$1.Root>, VariantProps<typeof switchVariants> {
11
11
  /** Classe de tema aplicada no estado checked (ex: "theme-brand") */
package/dist/ui/tabs.d.ts CHANGED
@@ -6,7 +6,7 @@ import { Tabs as Tabs$1 } from 'radix-ui';
6
6
 
7
7
  declare function Tabs({ className, orientation, ...props }: React.ComponentProps<typeof Tabs$1.Root>): react_jsx_runtime.JSX.Element;
8
8
  declare const tabsListVariants: (props?: ({
9
- variant?: "line" | "default" | null | undefined;
9
+ variant?: "default" | "line" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  declare function TabsList({ className, variant, ...props }: React.ComponentProps<typeof Tabs$1.List> & VariantProps<typeof tabsListVariants>): react_jsx_runtime.JSX.Element;
12
12
  declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof Tabs$1.Trigger>): react_jsx_runtime.JSX.Element;
@@ -6,7 +6,7 @@ import { Toggle as Toggle$1 } from 'radix-ui';
6
6
 
7
7
  declare const toggleVariants: (props?: ({
8
8
  variant?: "default" | "outline" | null | undefined;
9
- size?: "sm" | "default" | "lg" | "xs" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
9
+ size?: "xs" | "sm" | "lg" | "icon" | "default" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  interface ToggleProps extends React.ComponentProps<typeof Toggle$1.Root>, VariantProps<typeof toggleVariants> {
12
12
  /** Preenche icones SVG quando o toggle esta ativo (on). Ideal para icones como Heart, Star, Bookmark. */
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@fluencypassdevs/cycle",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Cycle Design System — UI component library by Fluencypass",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/Fluencypass/Cycle.git"
8
+ "url": "git+https://github.com/Fluencypass/Cycle.git"
9
9
  },
10
10
  "type": "module",
11
11
  "sideEffects": [
@@ -51,7 +51,7 @@
51
51
  "./tailwind-theme.css": "./dist/styles/tokens.css"
52
52
  },
53
53
  "bin": {
54
- "cycle": "./bin/cli.mjs"
54
+ "cycle": "bin/cli.mjs"
55
55
  },
56
56
  "files": [
57
57
  "dist",
@@ -80,6 +80,10 @@
80
80
  }
81
81
  },
82
82
  "dependencies": {
83
+ "@tiptap/extension-placeholder": "^3.22.3",
84
+ "@tiptap/extension-underline": "^3.22.3",
85
+ "@tiptap/react": "^3.22.3",
86
+ "@tiptap/starter-kit": "^3.22.3",
83
87
  "class-variance-authority": "^0.7.1",
84
88
  "clsx": "^2.1.1",
85
89
  "lucide-react": "^0.577.0",