art-bd-ui 1.0.33 → 1.0.35

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.
@@ -1,11 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
3
+ var propTypes = {exports: {}};
4
4
 
5
- var _commonjsHelpers = require('./_commonjsHelpers.js');
6
- var index = require('../node_modules/color-name/index.js');
7
-
8
- var colorNameExports = index.__require();
9
- var names = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(colorNameExports);
10
-
11
- exports.default = names;
5
+ exports.__module = propTypes;
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _commonjsHelpers = require('./_commonjsHelpers.js');
6
- var index$1 = require('../node_modules/color-convert/index.js');
6
+ var index = require('../node_modules/color-name/index.js');
7
7
 
8
- var colorConvertExports = index$1.__require();
9
- var index = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(colorConvertExports);
8
+ var colorNameExports = index.__require();
9
+ var names = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(colorNameExports);
10
10
 
11
- exports.default = index;
11
+ exports.default = names;
@@ -1,5 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var propTypes = {exports: {}};
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- exports.__module = propTypes;
5
+ var _commonjsHelpers = require('./_commonjsHelpers.js');
6
+ var index$1 = require('../node_modules/color-convert/index.js');
7
+
8
+ var colorConvertExports = index$1.__require();
9
+ var index = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(colorConvertExports);
10
+
11
+ exports.default = index;
@@ -2,13 +2,12 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var React = require('react');
5
- var index = require('../../../../../node_modules/@tiptap/react/dist/index.js');
6
5
  var config = require('./config.js');
7
6
  var shared = require('./shared.js');
8
7
 
9
8
  const CarouselView = ({ node }) => {
10
9
  const attrs = React.useMemo(() => config.normalizeCarouselAttrs((node.attrs || {})), [node.attrs]);
11
- return (jsxRuntime.jsx(index.NodeViewWrapper, { children: jsxRuntime.jsx(shared.SharedCarousel, { images: attrs.images, opts: attrs }) }));
10
+ return jsxRuntime.jsx(shared.SharedCarousel, { images: attrs.images, opts: attrs });
12
11
  };
13
12
 
14
13
  exports.CarouselView = CarouselView;
@@ -36,7 +36,6 @@ var horizontalRule = require('./extensions/horizontal-rule.js');
36
36
  var details = require('./extensions/details.js');
37
37
  var detailsSummary = require('./extensions/details-summary.js');
38
38
  var detailsContent = require('./extensions/details-content.js');
39
- var codeBlockLowlightBase = require('./extensions/code-block-lowlight-base.js');
40
39
  var code = require('./extensions/code.js');
41
40
  var subscript = require('./extensions/subscript.js');
42
41
  var superscript = require('./extensions/superscript.js');
@@ -93,7 +92,7 @@ const CORE_EXTENSIONS = [
93
92
  index$2.default,
94
93
  extension.Carousel,
95
94
  tableKit.TableKit,
96
- codeBlockLowlightBase.CodeBlockLowlightBase,
95
+ // CodeBlockLowlightBase,
97
96
  ];
98
97
  /**
99
98
  * Default configurations for editor extensions.
@@ -25,23 +25,20 @@ const defaultOnFileUpload = (files) => tslib_es6.__awaiter(void 0, void 0, void
25
25
  alt: file.name.replace(/\.[^/.]+$/, ""),
26
26
  }));
27
27
  });
28
- /**
29
- * Drop-in rich editor built with Tiptap + shadcn/ui.
30
- * - Configurable toolbar (Headings, lists, quote, code, link, image, align, marks)
31
- * - BubbleMenu on text select
32
- * - CodeBlock w/ Lowlight highlighting
33
- * - Character counter & max length (optional)
34
- */
35
- function RichEditor({ value, outputFormat = "html", onChange, editable = true, placeholder = "Start typing…", maxChars, className, editorContentClassName, showToolbar = true, showBubbleMenu = true, showFooter = true, toolbarActions, onFileUpload = defaultOnFileUpload, }) {
36
- const lastContent = React.useRef(value);
28
+ function RichEditor({ initialValue, outputFormat, onChange, editable = true, placeholder = "Start typing…", maxChars, className, editorContentClassName, showToolbar = true, showBubbleMenu = true, showFooter = true, toolbarActions, onFileUpload = defaultOnFileUpload, }) {
29
+ const format = outputFormat !== null && outputFormat !== void 0 ? outputFormat : "html";
30
+ const onChangeRef = React.useRef(onChange);
31
+ onChangeRef.current = onChange;
32
+ const onFileUploadRef = React.useRef(onFileUpload);
33
+ onFileUploadRef.current = onFileUpload;
37
34
  const editor$1 = index.useEditor({
38
35
  editable,
39
- content: value || "",
36
+ content: initialValue || "",
40
37
  extensions: extensions.getEditorExtensions([
41
38
  codeBlockLowlight.CodeBlockLowlight,
42
39
  index$1.default.configure({ placeholder }),
43
40
  editor.CarouselEditor.configure({
44
- onUploadFiles: onFileUpload,
41
+ onUploadFiles: (files) => onFileUploadRef.current(files),
45
42
  }),
46
43
  index$2.default.configure({ limit: maxChars !== null && maxChars !== void 0 ? maxChars : 0 }),
47
44
  ]),
@@ -75,8 +72,9 @@ function RichEditor({ value, outputFormat = "html", onChange, editable = true, p
75
72
  },
76
73
  },
77
74
  onUpdate: ({ editor }) => {
75
+ var _a;
78
76
  let content;
79
- switch (outputFormat) {
77
+ switch (format) {
80
78
  case "json":
81
79
  content = editor.getJSON();
82
80
  break;
@@ -88,29 +86,14 @@ function RichEditor({ value, outputFormat = "html", onChange, editable = true, p
88
86
  content = editor.getHTML();
89
87
  break;
90
88
  }
91
- // Use JSON.stringify for comparison when content is an object
92
- const currentSerialized = typeof content === "object" ? JSON.stringify(content) : content;
93
- const lastSerialized = typeof lastContent.current === "object" ? JSON.stringify(lastContent.current) : lastContent.current;
94
- if (currentSerialized !== lastSerialized) {
95
- lastContent.current = content;
96
- onChange === null || onChange === void 0 ? void 0 : onChange(content);
97
- }
89
+ (_a = onChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onChangeRef, content);
98
90
  },
99
91
  immediatelyRender: false,
100
- }, [editable, placeholder, maxChars, onFileUpload, outputFormat, onChange]);
101
- React.useEffect(() => {
102
- if (!editor$1)
103
- return;
104
- if (typeof value === "string" && value !== lastContent.current) {
105
- // external update (e.g., form reset)
106
- lastContent.current = value;
107
- editor$1.commands.setContent(value);
108
- }
109
- }, [value, editor$1]);
92
+ }, [editable, placeholder, maxChars, outputFormat]);
110
93
  if (!editor$1)
111
94
  return null;
112
95
  const isLimit = maxChars && editor$1.storage.characterCount.characters() >= (maxChars !== null && maxChars !== void 0 ? maxChars : 0);
113
- return (jsxRuntime.jsx(tooltip.TooltipProvider, { children: jsxRuntime.jsxs("div", { className: "w-full rounded-2xl border bg-background shadow-sm " + (className !== null && className !== void 0 ? className : ""), children: [showToolbar && jsxRuntime.jsx(toolbar.Toolbar, { editor: editor$1, actions: toolbarActions, onFileUpload: onFileUpload }), jsxRuntime.jsxs("div", { className: "relative px-4", children: [showBubbleMenu && jsxRuntime.jsx(floatingBubbleControls.FloatingBubbleControls, { editor: editor$1 }), jsxRuntime.jsx(index.EditorContent, { editor: editor$1, className: ["min-h-[220px] py-4", editorContentClassName].filter(Boolean).join(" ") }), jsxRuntime.jsx(tableFloatingControls.TableFloatingControls, { editor: editor$1 })] }), showFooter && jsxRuntime.jsx(Footer, { editor: editor$1, maxChars: maxChars, isLimit: !!isLimit })] }) }));
96
+ return (jsxRuntime.jsx(tooltip.TooltipProvider, { children: jsxRuntime.jsxs("div", { className: "w-full rounded-2xl border bg-background shadow-sm " + (className !== null && className !== void 0 ? className : ""), children: [showToolbar && (jsxRuntime.jsx(toolbar.Toolbar, { editor: editor$1, actions: toolbarActions, onFileUpload: (files) => onFileUploadRef.current(files) })), jsxRuntime.jsxs("div", { className: "relative px-4", children: [showBubbleMenu && jsxRuntime.jsx(floatingBubbleControls.FloatingBubbleControls, { editor: editor$1 }), jsxRuntime.jsx(index.EditorContent, { editor: editor$1, className: ["min-h-[220px] py-4", editorContentClassName].filter(Boolean).join(" ") }), jsxRuntime.jsx(tableFloatingControls.TableFloatingControls, { editor: editor$1 })] }), showFooter && jsxRuntime.jsx(Footer, { editor: editor$1, maxChars: maxChars, isLimit: !!isLimit })] }) }));
114
97
  }
115
98
  // ---------- Footer ----------
116
99
  function Footer({ editor, maxChars, isLimit }) {
@@ -2,8 +2,8 @@
2
2
 
3
3
  require('../../ckeditor5-core/dist/index.js');
4
4
  var index = require('../../ckeditor5-utils/dist/index.js');
5
- require('../../../../_virtual/index5.js');
6
5
  require('../../../../_virtual/index6.js');
6
+ require('../../../../_virtual/index7.js');
7
7
  require('../../ckeditor5-engine/dist/index.js');
8
8
 
9
9
  /**
@@ -2,8 +2,8 @@
2
2
 
3
3
  var index = require('../../ckeditor5-core/dist/index.js');
4
4
  var index$1 = require('../../ckeditor5-utils/dist/index.js');
5
- require('../../../../_virtual/index5.js');
6
5
  require('../../../../_virtual/index6.js');
6
+ require('../../../../_virtual/index7.js');
7
7
  require('../../ckeditor5-engine/dist/index.js');
8
8
 
9
9
  /**
@@ -3,7 +3,7 @@
3
3
  var index$1 = require('../../ckeditor5-utils/dist/index.js');
4
4
  var index = require('../../ckeditor5-core/dist/index.js');
5
5
  var index$3 = require('../../../color-parse/index.js');
6
- var index$2 = require('../../../../_virtual/index6.js');
6
+ var index$2 = require('../../../../_virtual/index7.js');
7
7
  var hex = require('../../../vanilla-colorful/lib/entrypoints/hex.js');
8
8
  require('../../ckeditor5-engine/dist/index.js');
9
9
  var assignIn = require('../../../lodash-es/assignIn.js');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('../../_virtual/index5.js');
5
+ var index = require('../../_virtual/index6.js');
6
6
 
7
7
  /**
8
8
  * @module color-parse
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index$1 = require('../../_virtual/index7.js');
3
+ var index$1 = require('../../_virtual/index5.js');
4
4
  var index = require('./node_modules/react-is/index.js');
5
5
  var factoryWithTypeCheckers = require('./factoryWithTypeCheckers.js');
6
6
  var factoryWithThrowingShims = require('./factoryWithThrowingShims.js');
@@ -1,7 +1,3 @@
1
- import { getDefaultExportFromCjs } from './_commonjsHelpers.js';
2
- import { __require as requireColorName } from '../node_modules/color-name/index.js';
1
+ var propTypes = {exports: {}};
3
2
 
4
- var colorNameExports = requireColorName();
5
- var names = /*@__PURE__*/getDefaultExportFromCjs(colorNameExports);
6
-
7
- export { names as default };
3
+ export { propTypes as __module };
@@ -1,7 +1,7 @@
1
1
  import { getDefaultExportFromCjs } from './_commonjsHelpers.js';
2
- import { __require as requireColorConvert } from '../node_modules/color-convert/index.js';
2
+ import { __require as requireColorName } from '../node_modules/color-name/index.js';
3
3
 
4
- var colorConvertExports = requireColorConvert();
5
- var index = /*@__PURE__*/getDefaultExportFromCjs(colorConvertExports);
4
+ var colorNameExports = requireColorName();
5
+ var names = /*@__PURE__*/getDefaultExportFromCjs(colorNameExports);
6
6
 
7
- export { index as default };
7
+ export { names as default };
@@ -1,3 +1,7 @@
1
- var propTypes = {exports: {}};
1
+ import { getDefaultExportFromCjs } from './_commonjsHelpers.js';
2
+ import { __require as requireColorConvert } from '../node_modules/color-convert/index.js';
2
3
 
3
- export { propTypes as __module };
4
+ var colorConvertExports = requireColorConvert();
5
+ var index = /*@__PURE__*/getDefaultExportFromCjs(colorConvertExports);
6
+
7
+ export { index as default };
@@ -1,12 +1,11 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { useMemo } from 'react';
3
- import { NodeViewWrapper } from '../../../../../node_modules/@tiptap/react/dist/index.js';
4
3
  import { normalizeCarouselAttrs } from './config.js';
5
4
  import { SharedCarousel } from './shared.js';
6
5
 
7
6
  const CarouselView = ({ node }) => {
8
7
  const attrs = useMemo(() => normalizeCarouselAttrs((node.attrs || {})), [node.attrs]);
9
- return (jsx(NodeViewWrapper, { children: jsx(SharedCarousel, { images: attrs.images, opts: attrs }) }));
8
+ return jsx(SharedCarousel, { images: attrs.images, opts: attrs });
10
9
  };
11
10
 
12
11
  export { CarouselView };
@@ -34,7 +34,6 @@ import { HorizontalRule } from './extensions/horizontal-rule.js';
34
34
  import { Details } from './extensions/details.js';
35
35
  import { DetailsSummary } from './extensions/details-summary.js';
36
36
  import { DetailsContent } from './extensions/details-content.js';
37
- import { CodeBlockLowlightBase } from './extensions/code-block-lowlight-base.js';
38
37
  import { Code } from './extensions/code.js';
39
38
  import { Subscript } from './extensions/subscript.js';
40
39
  import { Superscript } from './extensions/superscript.js';
@@ -91,7 +90,7 @@ const CORE_EXTENSIONS = [
91
90
  index_default$2,
92
91
  Carousel,
93
92
  TableKit,
94
- CodeBlockLowlightBase,
93
+ // CodeBlockLowlightBase,
95
94
  ];
96
95
  /**
97
96
  * Default configurations for editor extensions.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { __awaiter } from '../../../node_modules/tslib/tslib.es6.js';
3
3
  import { jsx, jsxs } from 'react/jsx-runtime';
4
- import { useRef, useEffect } from 'react';
4
+ import { useRef } from 'react';
5
5
  import { useEditor, EditorContent } from '../../../node_modules/@tiptap/react/dist/index.js';
6
6
  import index_default from '../../../node_modules/@tiptap/extension-placeholder/dist/index.js';
7
7
  import index_default$1 from '../../../node_modules/@tiptap/extension-character-count/dist/index.js';
@@ -23,23 +23,20 @@ const defaultOnFileUpload = (files) => __awaiter(void 0, void 0, void 0, functio
23
23
  alt: file.name.replace(/\.[^/.]+$/, ""),
24
24
  }));
25
25
  });
26
- /**
27
- * Drop-in rich editor built with Tiptap + shadcn/ui.
28
- * - Configurable toolbar (Headings, lists, quote, code, link, image, align, marks)
29
- * - BubbleMenu on text select
30
- * - CodeBlock w/ Lowlight highlighting
31
- * - Character counter & max length (optional)
32
- */
33
- function RichEditor({ value, outputFormat = "html", onChange, editable = true, placeholder = "Start typing…", maxChars, className, editorContentClassName, showToolbar = true, showBubbleMenu = true, showFooter = true, toolbarActions, onFileUpload = defaultOnFileUpload, }) {
34
- const lastContent = useRef(value);
26
+ function RichEditor({ initialValue, outputFormat, onChange, editable = true, placeholder = "Start typing…", maxChars, className, editorContentClassName, showToolbar = true, showBubbleMenu = true, showFooter = true, toolbarActions, onFileUpload = defaultOnFileUpload, }) {
27
+ const format = outputFormat !== null && outputFormat !== void 0 ? outputFormat : "html";
28
+ const onChangeRef = useRef(onChange);
29
+ onChangeRef.current = onChange;
30
+ const onFileUploadRef = useRef(onFileUpload);
31
+ onFileUploadRef.current = onFileUpload;
35
32
  const editor = useEditor({
36
33
  editable,
37
- content: value || "",
34
+ content: initialValue || "",
38
35
  extensions: getEditorExtensions([
39
36
  CodeBlockLowlight,
40
37
  index_default.configure({ placeholder }),
41
38
  CarouselEditor.configure({
42
- onUploadFiles: onFileUpload,
39
+ onUploadFiles: (files) => onFileUploadRef.current(files),
43
40
  }),
44
41
  index_default$1.configure({ limit: maxChars !== null && maxChars !== void 0 ? maxChars : 0 }),
45
42
  ]),
@@ -73,8 +70,9 @@ function RichEditor({ value, outputFormat = "html", onChange, editable = true, p
73
70
  },
74
71
  },
75
72
  onUpdate: ({ editor }) => {
73
+ var _a;
76
74
  let content;
77
- switch (outputFormat) {
75
+ switch (format) {
78
76
  case "json":
79
77
  content = editor.getJSON();
80
78
  break;
@@ -86,29 +84,14 @@ function RichEditor({ value, outputFormat = "html", onChange, editable = true, p
86
84
  content = editor.getHTML();
87
85
  break;
88
86
  }
89
- // Use JSON.stringify for comparison when content is an object
90
- const currentSerialized = typeof content === "object" ? JSON.stringify(content) : content;
91
- const lastSerialized = typeof lastContent.current === "object" ? JSON.stringify(lastContent.current) : lastContent.current;
92
- if (currentSerialized !== lastSerialized) {
93
- lastContent.current = content;
94
- onChange === null || onChange === void 0 ? void 0 : onChange(content);
95
- }
87
+ (_a = onChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onChangeRef, content);
96
88
  },
97
89
  immediatelyRender: false,
98
- }, [editable, placeholder, maxChars, onFileUpload, outputFormat, onChange]);
99
- useEffect(() => {
100
- if (!editor)
101
- return;
102
- if (typeof value === "string" && value !== lastContent.current) {
103
- // external update (e.g., form reset)
104
- lastContent.current = value;
105
- editor.commands.setContent(value);
106
- }
107
- }, [value, editor]);
90
+ }, [editable, placeholder, maxChars, outputFormat]);
108
91
  if (!editor)
109
92
  return null;
110
93
  const isLimit = maxChars && editor.storage.characterCount.characters() >= (maxChars !== null && maxChars !== void 0 ? maxChars : 0);
111
- return (jsx(TooltipProvider, { children: jsxs("div", { className: "w-full rounded-2xl border bg-background shadow-sm " + (className !== null && className !== void 0 ? className : ""), children: [showToolbar && jsx(Toolbar, { editor: editor, actions: toolbarActions, onFileUpload: onFileUpload }), jsxs("div", { className: "relative px-4", children: [showBubbleMenu && jsx(FloatingBubbleControls, { editor: editor }), jsx(EditorContent, { editor: editor, className: ["min-h-[220px] py-4", editorContentClassName].filter(Boolean).join(" ") }), jsx(TableFloatingControls, { editor: editor })] }), showFooter && jsx(Footer, { editor: editor, maxChars: maxChars, isLimit: !!isLimit })] }) }));
94
+ return (jsx(TooltipProvider, { children: jsxs("div", { className: "w-full rounded-2xl border bg-background shadow-sm " + (className !== null && className !== void 0 ? className : ""), children: [showToolbar && (jsx(Toolbar, { editor: editor, actions: toolbarActions, onFileUpload: (files) => onFileUploadRef.current(files) })), jsxs("div", { className: "relative px-4", children: [showBubbleMenu && jsx(FloatingBubbleControls, { editor: editor }), jsx(EditorContent, { editor: editor, className: ["min-h-[220px] py-4", editorContentClassName].filter(Boolean).join(" ") }), jsx(TableFloatingControls, { editor: editor })] }), showFooter && jsx(Footer, { editor: editor, maxChars: maxChars, isLimit: !!isLimit })] }) }));
112
95
  }
113
96
  // ---------- Footer ----------
114
97
  function Footer({ editor, maxChars, isLimit }) {
@@ -1,7 +1,7 @@
1
1
  import '../../ckeditor5-core/dist/index.js';
2
2
  import { keyCodes } from '../../ckeditor5-utils/dist/index.js';
3
- import '../../../../_virtual/index5.js';
4
3
  import '../../../../_virtual/index6.js';
4
+ import '../../../../_virtual/index7.js';
5
5
  import '../../ckeditor5-engine/dist/index.js';
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  import { Plugin, Command } from '../../ckeditor5-core/dist/index.js';
2
2
  import { first } from '../../ckeditor5-utils/dist/index.js';
3
- import '../../../../_virtual/index5.js';
4
3
  import '../../../../_virtual/index6.js';
4
+ import '../../../../_virtual/index7.js';
5
5
  import '../../ckeditor5-engine/dist/index.js';
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  import { getEnvKeystrokeText, uid, env, delay, createElement, KeystrokeHandler, FocusTracker, toUnit, global, Rect, DomEmitterMixin, ObservableMixin, Collection, isIterable, CKEditorError, getOptimalPosition, logWarning, isVisible, EmitterMixin, isNode, priorities, isText, ResizeObserver, first, verifyLicense, isRange, toArray } from '../../ckeditor5-utils/dist/index.js';
2
2
  import { Plugin, icons, ContextPlugin } from '../../ckeditor5-core/dist/index.js';
3
3
  import parse from '../../../color-parse/index.js';
4
- import * as index from '../../../../_virtual/index6.js';
4
+ import * as index from '../../../../_virtual/index7.js';
5
5
  import { HexBase } from '../../../vanilla-colorful/lib/entrypoints/hex.js';
6
6
  import '../../ckeditor5-engine/dist/index.js';
7
7
  import assignIn from '../../../lodash-es/assignIn.js';
@@ -1,4 +1,4 @@
1
- import names from '../../_virtual/index5.js';
1
+ import names from '../../_virtual/index6.js';
2
2
 
3
3
  /**
4
4
  * @module color-parse
@@ -1,4 +1,4 @@
1
- import { __module as propTypes } from '../../_virtual/index7.js';
1
+ import { __module as propTypes } from '../../_virtual/index5.js';
2
2
  import { __require as requireReactIs } from './node_modules/react-is/index.js';
3
3
  import { __require as requireFactoryWithTypeCheckers } from './factoryWithTypeCheckers.js';
4
4
  import { __require as requireFactoryWithThrowingShims } from './factoryWithThrowingShims.js';
@@ -168,7 +168,7 @@ declare const Icon: React$1.ForwardRefExoticComponent<IconProps$1 & React$1.RefA
168
168
 
169
169
  declare const buttonVariants: (props?: ({
170
170
  variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
171
- size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
171
+ size?: "default" | "sm" | "lg" | "icon-sm" | "icon" | "icon-md" | "icon-lg" | null | undefined;
172
172
  } & class_variance_authority_types.ClassProp) | undefined) => string;
173
173
  type ButtonProps = ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
174
174
  asChild?: boolean;
@@ -301,7 +301,7 @@ declare const Dropzone: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes
301
301
 
302
302
  declare const labelVariants: (props?: ({
303
303
  size?: "default" | "sm" | "lg" | null | undefined;
304
- weight?: "default" | "bold" | "light" | null | undefined;
304
+ weight?: "default" | "light" | "bold" | null | undefined;
305
305
  } & class_variance_authority_types.ClassProp) | undefined) => string;
306
306
  type LabelProps = ComponentProps<typeof Root$5> & VariantProps<typeof labelVariants>;
307
307
  declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelProps, "ref"> & React$1.RefAttributes<HTMLLabelElement>>;
@@ -420,7 +420,7 @@ interface FormControlProps extends React$1.ComponentProps<typeof FormItem> {
420
420
  declare function FormControl({ name, label, description, showMessage, children, ...props }: FormControlProps): react_jsx_runtime.JSX.Element;
421
421
 
422
422
  declare const inputContainerVariants: (props?: ({
423
- size?: "sm" | "lg" | "md" | null | undefined;
423
+ size?: "sm" | "md" | "lg" | null | undefined;
424
424
  disabled?: boolean | null | undefined;
425
425
  fullWidth?: boolean | null | undefined;
426
426
  } & class_variance_authority_types.ClassProp) | undefined) => string;
@@ -448,7 +448,7 @@ declare const inputGroupAddonVariants: (props?: ({
448
448
  } & class_variance_authority_types.ClassProp) | undefined) => string;
449
449
  declare function InputGroupAddon({ className, align, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): react_jsx_runtime.JSX.Element;
450
450
  declare const inputGroupButtonVariants: (props?: ({
451
- size?: "sm" | "icon-sm" | "xs" | "icon-xs" | null | undefined;
451
+ size?: "sm" | "xs" | "icon-xs" | "icon-sm" | null | undefined;
452
452
  } & class_variance_authority_types.ClassProp) | undefined) => string;
453
453
  declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React$1.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): react_jsx_runtime.JSX.Element;
454
454
  declare function InputGroupText({ className, ...props }: React$1.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
@@ -638,8 +638,8 @@ declare const ToastDescription: React$1.ForwardRefExoticComponent<Omit<_radix_ui
638
638
  type ToastActionElement = ReactElement<typeof ToastAction>;
639
639
 
640
640
  declare const textVariants: (props?: ({
641
- size?: 2 | 1 | 3 | 9 | 8 | 7 | 6 | 5 | 4 | null | undefined;
642
- weight?: "bold" | "light" | "medium" | "regular" | null | undefined;
641
+ size?: 2 | 1 | 3 | 4 | 8 | 9 | 7 | 6 | 5 | null | undefined;
642
+ weight?: "light" | "bold" | "medium" | "regular" | null | undefined;
643
643
  align?: "center" | "right" | "left" | null | undefined;
644
644
  color?: "default" | "destructive" | "secondary" | "muted" | "primary" | "accent" | null | undefined;
645
645
  truncate?: boolean | null | undefined;
@@ -650,8 +650,8 @@ type TextProps = {
650
650
  declare const Text: React$1.ForwardRefExoticComponent<{
651
651
  asChild?: boolean;
652
652
  } & Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & VariantProps<(props?: ({
653
- size?: 2 | 1 | 3 | 9 | 8 | 7 | 6 | 5 | 4 | null | undefined;
654
- weight?: "bold" | "light" | "medium" | "regular" | null | undefined;
653
+ size?: 2 | 1 | 3 | 4 | 8 | 9 | 7 | 6 | 5 | null | undefined;
654
+ weight?: "light" | "bold" | "medium" | "regular" | null | undefined;
655
655
  align?: "center" | "right" | "left" | null | undefined;
656
656
  color?: "default" | "destructive" | "secondary" | "muted" | "primary" | "accent" | null | undefined;
657
657
  truncate?: boolean | null | undefined;
@@ -662,8 +662,8 @@ declare const Heading: React$1.ForwardRefExoticComponent<{
662
662
  level?: HeadingLevel;
663
663
  asChild?: boolean;
664
664
  } & Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & VariantProps<(props?: ({
665
- size?: 2 | 1 | 3 | 9 | 8 | 7 | 6 | 5 | 4 | null | undefined;
666
- weight?: "bold" | "light" | "medium" | "regular" | null | undefined;
665
+ size?: 2 | 1 | 3 | 4 | 8 | 9 | 7 | 6 | 5 | null | undefined;
666
+ weight?: "light" | "bold" | "medium" | "regular" | null | undefined;
667
667
  align?: "center" | "right" | "left" | null | undefined;
668
668
  color?: "default" | "destructive" | "secondary" | "muted" | "primary" | "accent" | null | undefined;
669
669
  truncate?: boolean | null | undefined;
@@ -1737,16 +1737,22 @@ declare module "@tiptap/core" {
1737
1737
  type ToolbarAction = "history" | "heading" | "fontFamily" | "fontSize" | "lineHeight" | "bold" | "italic" | "underline" | "strike" | "subscript" | "superscript" | "code" | "link" | "codeBlock" | "textColor" | "backgroundColor" | "highlight" | "clearFormatting" | "indent" | "alignment" | "bulletList" | "orderedList" | "blockquote" | "table" | "insert";
1738
1738
 
1739
1739
  type OutputFormat = "html" | "json" | "text";
1740
- type RichEditorProps = {
1741
- value?: string;
1740
+ type OutputFormatContentMap = {
1741
+ html: string;
1742
+ json: JSONContent;
1743
+ text: string;
1744
+ };
1745
+ type RichEditorProps<F extends OutputFormat = "html"> = {
1746
+ /** Initial content. Accepts an HTML string or a Tiptap JSONContent object. */
1747
+ initialValue?: string | JSONContent;
1742
1748
  /** Output format for the editor content. Defaults to 'html' */
1743
- outputFormat?: OutputFormat;
1749
+ outputFormat?: F;
1744
1750
  /** Called when content changes. The type depends on outputFormat:
1745
1751
  * - 'html': string (HTML)
1746
1752
  * - 'json': JSONContent (Tiptap JSON)
1747
1753
  * - 'text': string (plain text)
1748
1754
  */
1749
- onChange?: (content: string | JSONContent) => void;
1755
+ onChange?: (content: OutputFormatContentMap[F]) => void;
1750
1756
  editable?: boolean;
1751
1757
  placeholder?: string;
1752
1758
  maxChars?: number;
@@ -1760,14 +1766,7 @@ type RichEditorProps = {
1760
1766
  /** Generic file upload handler. Receives selected files and should return uploaded image data. */
1761
1767
  onFileUpload?: (files: File[]) => Promise<UploadedImage[]>;
1762
1768
  };
1763
- /**
1764
- * Drop-in rich editor built with Tiptap + shadcn/ui.
1765
- * - Configurable toolbar (Headings, lists, quote, code, link, image, align, marks)
1766
- * - BubbleMenu on text select
1767
- * - CodeBlock w/ Lowlight highlighting
1768
- * - Character counter & max length (optional)
1769
- */
1770
- declare function RichEditor({ value, outputFormat, onChange, editable, placeholder, maxChars, className, editorContentClassName, showToolbar, showBubbleMenu, showFooter, toolbarActions, onFileUpload, }: RichEditorProps): react_jsx_runtime.JSX.Element | null;
1769
+ declare function RichEditor<F extends OutputFormat = "html">({ initialValue, outputFormat, onChange, editable, placeholder, maxChars, className, editorContentClassName, showToolbar, showBubbleMenu, showFooter, toolbarActions, onFileUpload, }: RichEditorProps<F>): react_jsx_runtime.JSX.Element | null;
1771
1770
 
1772
1771
  type RichContentRendererProps = {
1773
1772
  doc?: JSONContent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "art-bd-ui",
3
- "version": "1.0.33",
3
+ "version": "1.0.35",
4
4
  "description": "Set of handy components for React like projects",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",