@forgedevstack/bear 1.0.5 → 1.0.7

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.
Files changed (183) hide show
  1. package/dist/components/BottomSheet/BottomSheet.cjs +1 -0
  2. package/dist/components/BottomSheet/BottomSheet.d.ts +3 -0
  3. package/dist/components/BottomSheet/BottomSheet.js +102 -0
  4. package/dist/components/BottomSheet/BottomSheet.types.d.ts +13 -0
  5. package/dist/components/BottomSheet/index.d.ts +2 -0
  6. package/dist/components/Button/Button.cjs +1 -1
  7. package/dist/components/Button/Button.js +40 -38
  8. package/dist/components/Button/Button.types.d.ts +4 -0
  9. package/dist/components/Calendar/Calendar.cjs +1 -1
  10. package/dist/components/Calendar/Calendar.const.cjs +1 -1
  11. package/dist/components/Calendar/Calendar.const.d.ts +1 -0
  12. package/dist/components/Calendar/Calendar.const.js +6 -5
  13. package/dist/components/Calendar/Calendar.helpers.cjs +1 -1
  14. package/dist/components/Calendar/Calendar.helpers.js +4 -4
  15. package/dist/components/Calendar/Calendar.js +128 -128
  16. package/dist/components/Cascader/Cascader.cjs +1 -0
  17. package/dist/components/Cascader/Cascader.const.cjs +1 -0
  18. package/dist/components/Cascader/Cascader.const.d.ts +33 -0
  19. package/dist/components/Cascader/Cascader.const.js +21 -0
  20. package/dist/components/Cascader/Cascader.d.ts +17 -0
  21. package/dist/components/Cascader/Cascader.js +227 -0
  22. package/dist/components/Cascader/Cascader.types.d.ts +94 -0
  23. package/dist/components/Cascader/index.d.ts +2 -0
  24. package/dist/components/CommandPalette/CommandPalette.cjs +1 -0
  25. package/dist/components/CommandPalette/CommandPalette.const.cjs +1 -0
  26. package/dist/components/CommandPalette/CommandPalette.const.d.ts +25 -0
  27. package/dist/components/CommandPalette/CommandPalette.const.js +13 -0
  28. package/dist/components/CommandPalette/CommandPalette.d.ts +18 -0
  29. package/dist/components/CommandPalette/CommandPalette.js +190 -0
  30. package/dist/components/CommandPalette/CommandPalette.types.d.ts +90 -0
  31. package/dist/components/CommandPalette/CommandPalette.utils.cjs +1 -0
  32. package/dist/components/CommandPalette/CommandPalette.utils.d.ts +17 -0
  33. package/dist/components/CommandPalette/CommandPalette.utils.js +63 -0
  34. package/dist/components/CommandPalette/index.d.ts +2 -0
  35. package/dist/components/CreditInput/CreditInput.cjs +1 -0
  36. package/dist/components/CreditInput/CreditInput.const.cjs +1 -0
  37. package/dist/components/CreditInput/CreditInput.const.d.ts +37 -0
  38. package/dist/components/CreditInput/CreditInput.const.js +66 -0
  39. package/dist/components/CreditInput/CreditInput.d.ts +15 -0
  40. package/dist/components/CreditInput/CreditInput.js +214 -0
  41. package/dist/components/CreditInput/CreditInput.types.d.ts +93 -0
  42. package/dist/components/CreditInput/CreditInput.utils.cjs +1 -0
  43. package/dist/components/CreditInput/CreditInput.utils.d.ts +48 -0
  44. package/dist/components/CreditInput/CreditInput.utils.js +79 -0
  45. package/dist/components/CreditInput/index.d.ts +2 -0
  46. package/dist/components/DatePicker/DatePicker.cjs +1 -1
  47. package/dist/components/DatePicker/DatePicker.js +108 -84
  48. package/dist/components/DatePicker/DatePicker.types.d.ts +2 -1
  49. package/dist/components/Drawer/Drawer.cjs +1 -1
  50. package/dist/components/Drawer/Drawer.js +75 -44
  51. package/dist/components/EmojiPicker/EmojiPicker.cjs +1 -0
  52. package/dist/components/EmojiPicker/EmojiPicker.const.cjs +1 -0
  53. package/dist/components/EmojiPicker/EmojiPicker.const.d.ts +5 -0
  54. package/dist/components/EmojiPicker/EmojiPicker.const.js +10 -0
  55. package/dist/components/EmojiPicker/EmojiPicker.d.ts +3 -0
  56. package/dist/components/EmojiPicker/EmojiPicker.js +63 -0
  57. package/dist/components/EmojiPicker/EmojiPicker.types.d.ts +6 -0
  58. package/dist/components/EmojiPicker/index.d.ts +3 -0
  59. package/dist/components/Form/Form.cjs +1 -0
  60. package/dist/components/Form/Form.const.cjs +1 -0
  61. package/dist/components/Form/Form.const.d.ts +33 -0
  62. package/dist/components/Form/Form.const.js +27 -0
  63. package/dist/components/Form/Form.context.cjs +1 -0
  64. package/dist/components/Form/Form.context.d.ts +13 -0
  65. package/dist/components/Form/Form.context.js +12 -0
  66. package/dist/components/Form/Form.d.ts +18 -0
  67. package/dist/components/Form/Form.js +230 -0
  68. package/dist/components/Form/Form.types.d.ts +166 -0
  69. package/dist/components/Form/Form.utils.cjs +1 -0
  70. package/dist/components/Form/Form.utils.d.ts +17 -0
  71. package/dist/components/Form/Form.utils.js +31 -0
  72. package/dist/components/Form/index.d.ts +3 -0
  73. package/dist/components/Kanban/Kanban.cjs +1 -0
  74. package/dist/components/Kanban/Kanban.d.ts +3 -0
  75. package/dist/components/Kanban/Kanban.js +90 -0
  76. package/dist/components/Kanban/Kanban.types.d.ts +21 -0
  77. package/dist/components/Kanban/index.d.ts +2 -0
  78. package/dist/components/MentionsInput/MentionsInput.cjs +1 -0
  79. package/dist/components/MentionsInput/MentionsInput.d.ts +3 -0
  80. package/dist/components/MentionsInput/MentionsInput.js +140 -0
  81. package/dist/components/MentionsInput/MentionsInput.types.d.ts +21 -0
  82. package/dist/components/MentionsInput/index.d.ts +2 -0
  83. package/dist/components/NotificationCenter/NotificationCenter.cjs +1 -0
  84. package/dist/components/NotificationCenter/NotificationCenter.const.cjs +1 -0
  85. package/dist/components/NotificationCenter/NotificationCenter.const.d.ts +25 -0
  86. package/dist/components/NotificationCenter/NotificationCenter.const.js +28 -0
  87. package/dist/components/NotificationCenter/NotificationCenter.d.ts +15 -0
  88. package/dist/components/NotificationCenter/NotificationCenter.js +223 -0
  89. package/dist/components/NotificationCenter/NotificationCenter.types.d.ts +117 -0
  90. package/dist/components/NotificationCenter/NotificationCenter.utils.cjs +1 -0
  91. package/dist/components/NotificationCenter/NotificationCenter.utils.d.ts +11 -0
  92. package/dist/components/NotificationCenter/NotificationCenter.utils.js +19 -0
  93. package/dist/components/NotificationCenter/index.d.ts +2 -0
  94. package/dist/components/PhoneInput/PhoneInput.cjs +1 -0
  95. package/dist/components/PhoneInput/PhoneInput.const.cjs +1 -0
  96. package/dist/components/PhoneInput/PhoneInput.const.d.ts +33 -0
  97. package/dist/components/PhoneInput/PhoneInput.const.js +82 -0
  98. package/dist/components/PhoneInput/PhoneInput.d.ts +16 -0
  99. package/dist/components/PhoneInput/PhoneInput.js +194 -0
  100. package/dist/components/PhoneInput/PhoneInput.types.d.ts +108 -0
  101. package/dist/components/PhoneInput/PhoneInput.utils.cjs +1 -0
  102. package/dist/components/PhoneInput/PhoneInput.utils.d.ts +25 -0
  103. package/dist/components/PhoneInput/PhoneInput.utils.js +39 -0
  104. package/dist/components/PhoneInput/index.d.ts +2 -0
  105. package/dist/components/RichEditor/RichEditor.cjs +1 -1
  106. package/dist/components/RichEditor/RichEditor.const.cjs +2 -2
  107. package/dist/components/RichEditor/RichEditor.const.d.ts +4 -1
  108. package/dist/components/RichEditor/RichEditor.const.js +51 -18
  109. package/dist/components/RichEditor/RichEditor.js +106 -105
  110. package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
  111. package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +105 -95
  112. package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.cjs +1 -1
  113. package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.d.ts +2 -0
  114. package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.js +47 -29
  115. package/dist/components/SegmentedControl/SegmentedControl.cjs +1 -0
  116. package/dist/components/SegmentedControl/SegmentedControl.d.ts +3 -0
  117. package/dist/components/SegmentedControl/SegmentedControl.js +58 -0
  118. package/dist/components/SegmentedControl/SegmentedControl.types.d.ts +16 -0
  119. package/dist/components/SegmentedControl/index.d.ts +2 -0
  120. package/dist/components/SignPad/SignPad.cjs +1 -1
  121. package/dist/components/SignPad/SignPad.js +94 -86
  122. package/dist/components/SliderRange/SliderRange.cjs +1 -0
  123. package/dist/components/SliderRange/SliderRange.d.ts +3 -0
  124. package/dist/components/SliderRange/SliderRange.js +142 -0
  125. package/dist/components/SliderRange/SliderRange.types.d.ts +17 -0
  126. package/dist/components/SliderRange/index.d.ts +2 -0
  127. package/dist/components/TagsInput/TagsInput.cjs +1 -0
  128. package/dist/components/TagsInput/TagsInput.d.ts +3 -0
  129. package/dist/components/TagsInput/TagsInput.js +100 -0
  130. package/dist/components/TagsInput/TagsInput.types.d.ts +16 -0
  131. package/dist/components/TagsInput/index.d.ts +2 -0
  132. package/dist/components/TimePicker/TimePicker.cjs +1 -1
  133. package/dist/components/TimePicker/TimePicker.constants.cjs +1 -1
  134. package/dist/components/TimePicker/TimePicker.constants.d.ts +22 -1
  135. package/dist/components/TimePicker/TimePicker.constants.js +36 -19
  136. package/dist/components/TimePicker/TimePicker.js +97 -131
  137. package/dist/components/TimePicker/TimePicker.types.d.ts +47 -6
  138. package/dist/components/TimePicker/components/TimePickerColumnsDropdown/TimePickerColumnsDropdown.cjs +1 -0
  139. package/dist/components/TimePicker/components/TimePickerColumnsDropdown/TimePickerColumnsDropdown.d.ts +3 -0
  140. package/dist/components/TimePicker/components/TimePickerColumnsDropdown/TimePickerColumnsDropdown.js +81 -0
  141. package/dist/components/TimePicker/components/TimePickerColumnsDropdown/index.d.ts +1 -0
  142. package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.cjs +1 -0
  143. package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.d.ts +3 -0
  144. package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.js +84 -0
  145. package/dist/components/TimePicker/components/TimePickerDialDropdown/index.d.ts +1 -0
  146. package/dist/components/TimePicker/helpers/ClockFaceSvg.cjs +1 -0
  147. package/dist/components/TimePicker/helpers/ClockFaceSvg.d.ts +18 -0
  148. package/dist/components/TimePicker/helpers/ClockFaceSvg.js +67 -0
  149. package/dist/components/TimePicker/helpers/index.d.ts +2 -0
  150. package/dist/components/TimePicker/index.d.ts +1 -1
  151. package/dist/components/VirtualList/VirtualList.cjs +1 -0
  152. package/dist/components/VirtualList/VirtualList.d.ts +3 -0
  153. package/dist/components/VirtualList/VirtualList.js +68 -0
  154. package/dist/components/VirtualList/VirtualList.types.d.ts +10 -0
  155. package/dist/components/VirtualList/index.d.ts +2 -0
  156. package/dist/components/index.cjs +1 -1
  157. package/dist/components/index.d.ts +28 -2
  158. package/dist/components/index.js +177 -146
  159. package/dist/hooks/index.cjs +1 -1
  160. package/dist/hooks/index.d.ts +4 -0
  161. package/dist/hooks/index.js +36 -32
  162. package/dist/hooks/useDragDrop/index.d.ts +2 -0
  163. package/dist/hooks/useDragDrop/useDragDrop.cjs +1 -0
  164. package/dist/hooks/useDragDrop/useDragDrop.d.ts +22 -0
  165. package/dist/hooks/useDragDrop/useDragDrop.js +56 -0
  166. package/dist/hooks/useDragDrop/useDragDrop.types.d.ts +55 -0
  167. package/dist/hooks/useLazyLoad/index.d.ts +2 -0
  168. package/dist/hooks/useLazyLoad/useLazyLoad.cjs +1 -0
  169. package/dist/hooks/useLazyLoad/useLazyLoad.d.ts +26 -0
  170. package/dist/hooks/useLazyLoad/useLazyLoad.js +27 -0
  171. package/dist/hooks/useLazyLoad/useLazyLoad.types.d.ts +25 -0
  172. package/dist/index.cjs +1 -1
  173. package/dist/index.js +290 -255
  174. package/dist/styles.css +1 -1
  175. package/package.json +1 -1
  176. package/dist/components/DateTimePicker/DateTimePicker.cjs +0 -1
  177. package/dist/components/DateTimePicker/DateTimePicker.d.ts +0 -3
  178. package/dist/components/DateTimePicker/DateTimePicker.js +0 -178
  179. package/dist/components/DateTimePicker/DateTimePicker.types.d.ts +0 -26
  180. package/dist/components/DateTimePicker/DateTimePicker.utils.cjs +0 -1
  181. package/dist/components/DateTimePicker/DateTimePicker.utils.d.ts +0 -2
  182. package/dist/components/DateTimePicker/DateTimePicker.utils.js +0 -16
  183. package/dist/components/DateTimePicker/index.d.ts +0 -2
@@ -0,0 +1,25 @@
1
+ import { CountryData, PhoneValue } from './PhoneInput.types';
2
+ /**
3
+ * Format phone number according to country format
4
+ */
5
+ export declare const formatPhoneNumber: (number: string, format?: string) => string;
6
+ /**
7
+ * Parse raw phone input to digits only
8
+ */
9
+ export declare const parsePhoneDigits: (input: string) => string;
10
+ /**
11
+ * Create phone value object
12
+ */
13
+ export declare const createPhoneValue: (country: CountryData, rawNumber: string) => PhoneValue;
14
+ /**
15
+ * Filter countries by search query
16
+ */
17
+ export declare const filterCountries: (countries: CountryData[], query: string) => CountryData[];
18
+ /**
19
+ * Sort countries with preferred countries first
20
+ */
21
+ export declare const sortCountriesWithPreferred: (countries: CountryData[], preferred: string[]) => CountryData[];
22
+ /**
23
+ * Get country by code
24
+ */
25
+ export declare const getCountryByCode: (countries: CountryData[], code: string) => CountryData | undefined;
@@ -0,0 +1,39 @@
1
+ const i = (e, t) => {
2
+ if (!t) return e;
3
+ const o = e.replace(/\D/g, "");
4
+ let r = "", s = 0;
5
+ for (const n of t) {
6
+ if (s >= o.length) break;
7
+ n === "#" ? (r += o[s], s++) : r += n;
8
+ }
9
+ return r;
10
+ }, a = (e) => e.replace(/\D/g, ""), l = (e, t) => {
11
+ const o = i(t, e.format);
12
+ return {
13
+ countryCode: e.code,
14
+ dialCode: e.dialCode,
15
+ number: t,
16
+ formattedNumber: `${e.dialCode} ${o}`,
17
+ rawNumber: a(t)
18
+ };
19
+ }, c = (e, t) => {
20
+ if (!t.trim()) return e;
21
+ const o = t.toLowerCase();
22
+ return e.filter(
23
+ (r) => r.name.toLowerCase().includes(o) || r.code.toLowerCase().includes(o) || r.dialCode.includes(t)
24
+ );
25
+ }, f = (e, t) => {
26
+ if (t.length === 0) return e;
27
+ const o = new Set(t.map((n) => n.toUpperCase())), r = e.filter((n) => o.has(n.code)), s = e.filter((n) => !o.has(n.code));
28
+ return r.sort(
29
+ (n, d) => t.indexOf(n.code) - t.indexOf(d.code)
30
+ ), [...r, ...s];
31
+ }, C = (e, t) => e.find((o) => o.code.toUpperCase() === t.toUpperCase());
32
+ export {
33
+ l as createPhoneValue,
34
+ c as filterCountries,
35
+ i as formatPhoneNumber,
36
+ C as getCountryByCode,
37
+ a as parsePhoneDigits,
38
+ f as sortCountriesWithPreferred
39
+ };
@@ -0,0 +1,2 @@
1
+ export { PhoneInput } from './PhoneInput';
2
+ export type { PhoneInputProps, PhoneValue, CountryData, PhoneInputSize, PhoneInputVariant, PhoneInputTranslations, } from './PhoneInput.types';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("react"),T=require("../../utils/cn.cjs"),u=require("./helpers/formatHelpers.cjs"),f=require("./RichEditor.const.cjs"),C=require("./components/ToolbarButton/ToolbarButton.cjs"),oe=require("./components/ToolbarDropdown/ToolbarDropdown.cjs"),H=require("./components/ToolbarColorPicker/ToolbarColorPicker.cjs"),re=require("./components/ToolbarMore/ToolbarMore.cjs"),i=require("../Icon/icons/editor.cjs"),ie=6,se=S=>{const{value:x,defaultValue:k="",onChange:j,placeholder:z="Start typing...",disabled:o=!1,readOnly:r=!1,minHeight:p=f.RICH_EDITOR_MIN_HEIGHT,maxHeight:b,toolbar:y=f.RICH_EDITOR_DEFAULT_TOOLBAR,className:B="",testId:A,id:O,allowImagePaste:E=!0,...v}=S,a=c.useRef(null),[D,F]=c.useState(new Set),[N,_]=c.useState("p"),[q,w]=c.useState("#000000"),[U,M]=c.useState("#fef08a"),[P,V]=c.useState([]),[J,G]=c.useState([]);c.useEffect(()=>{const e="bear-rich-editor-styles";if(!document.getElementById(e)){const n=document.createElement("style");n.id=e,n.textContent=f.RICH_EDITOR_CONTENT_STYLES,document.head.appendChild(n)}},[]),c.useEffect(()=>{a.current&&x!==void 0&&a.current.innerHTML!==x&&(a.current.innerHTML=x)},[x]),c.useEffect(()=>{a.current&&k&&!x&&(a.current.innerHTML=k)},[]);const I=c.useCallback(()=>{F(u.getActiveFormats());const e=u.queryCommandValue("formatBlock");e&&_(e.toLowerCase().replace(/[<>]/g,""))},[]),l=c.useCallback(()=>{a.current&&j&&j(a.current.innerHTML),I()},[j,I]),$=c.useCallback(e=>{var d;if(o||r)return;(d=a.current)==null||d.focus();const n=f.RICH_EDITOR_BUTTON_CONFIG[e];if(!n)return;const g="value"in n?n.value:void 0;g?u.execCommand(n.command,g):u.execCommand(n.command),I(),l()},[o,r,I,l]),Y=c.useCallback(e=>{var n;o||r||((n=a.current)==null||n.focus(),u.execCommand("formatBlock",e),_(e),l())},[o,r,l]),K=c.useCallback(()=>{var d;if(o||r)return;const e=window.getSelection(),n=e&&e.toString().length>0,g=prompt("Enter URL:",n?"":"https://");g&&((d=a.current)==null||d.focus(),u.insertLink(g),l())},[o,r,l]),m=c.useCallback((e,n)=>{if(!e)return;(n==="text"?V:G)(d=>{const s=d.filter(h=>h!==e);return[e,...s].slice(0,ie)})},[]),Q=c.useCallback(e=>{var n;o||r||((n=a.current)==null||n.focus(),u.setTextColor(e),w(e),m(e,"text"),l())},[o,r,l,m]),W=c.useCallback(e=>{var n;o||r||((n=a.current)==null||n.focus(),u.setHighlightColor(e),M(e),m(e,"highlight"),l())},[o,r,l,m]),X=c.useCallback(e=>{var n;o||r||((n=a.current)==null||n.focus(),u.setTextColor(e),l())},[o,r,l]),Z=c.useCallback(e=>{var n;o||r||((n=a.current)==null||n.focus(),u.setHighlightColor(e),l())},[o,r,l]),ee=c.useCallback(async e=>{var g;if(!E)return;const n=(g=e.clipboardData)==null?void 0:g.items;if(n)for(let d=0;d<n.length;d++){const s=n[d];if(s.type.startsWith("image/")){e.preventDefault();const h=s.getAsFile();if(h){const R=await u.fileToDataUrl(h);u.insertImage(R),l()}return}}},[E,l]),te=c.useCallback(()=>{if(o||r)return;const e=document.createElement("input");e.type="file",e.accept="image/*",e.onchange=async n=>{var d,s;const g=(d=n.target.files)==null?void 0:d[0];if(g){const h=await u.fileToDataUrl(g);(s=a.current)==null||s.focus(),u.insertImage(h),l()}},e.click()},[o,r,l]),ne={bold:t.jsx(i.BoldIcon,{size:16}),italic:t.jsx(i.ItalicIcon,{size:16}),underline:t.jsx(i.UnderlineIcon,{size:16}),strikethrough:t.jsx(i.StrikethroughIcon,{size:16}),heading1:t.jsx(i.Heading1Icon,{size:16}),heading2:t.jsx(i.Heading2Icon,{size:16}),heading3:t.jsx(i.Heading3Icon,{size:16}),bulletList:t.jsx(i.ListBulletIcon,{size:16}),orderedList:t.jsx(i.ListNumberedIcon,{size:16}),blockquote:t.jsx(i.QuoteIcon,{size:16}),code:t.jsx(i.CodeIcon,{size:16}),link:t.jsx(i.InsertLinkIcon,{size:16}),alignLeft:t.jsx(i.AlignLeftIcon,{size:16}),alignCenter:t.jsx(i.AlignCenterIcon,{size:16}),alignRight:t.jsx(i.AlignRightIcon,{size:16}),alignJustify:t.jsx(i.AlignJustifyIcon,{size:16}),image:t.jsx(i.InsertPhotoIcon,{size:16}),indent:t.jsx(i.IndentIncreaseIcon,{size:16}),outdent:t.jsx(i.IndentDecreaseIcon,{size:16}),clearFormat:t.jsx(i.FormatClearIcon,{size:16}),table:t.jsx(i.TableIcon,{size:16})},L=(e,n)=>{if(e==="divider")return t.jsx("div",{className:T.cn("Bear-RichEditor__divider",f.RICH_EDITOR_DIVIDER_CLASSES)},`divider-${n}`);if(e==="headingDropdown")return t.jsx(oe.ToolbarDropdown,{options:f.RICH_EDITOR_HEADING_OPTIONS,value:N,onChange:Y,title:"Text Style",disabled:o||r,icon:t.jsx(i.TextIcon,{size:16})},"heading-dropdown");if(e==="textColor")return t.jsx(H.ToolbarColorPicker,{value:q,onChange:Q,title:"Text Color",disabled:o||r,type:"text",recentColors:P,onApplyLast:X},"text-color");if(e==="highlightColor")return t.jsx(H.ToolbarColorPicker,{value:U,onChange:W,title:"Highlight Color",disabled:o||r,type:"highlight",recentColors:J,onApplyLast:Z},"highlight-color");if(e==="link")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.InsertLinkIcon,{size:16}),title:"Insert Link",onClick:K,disabled:o||r},"link");if(e==="image")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.InsertPhotoIcon,{size:16}),title:"Insert Image",onClick:te,disabled:o||r},"image");if(e==="alignLeft")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.AlignLeftIcon,{size:16}),title:"Align Left",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("justifyLeft"),l()},disabled:o||r},"alignLeft");if(e==="alignCenter")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.AlignCenterIcon,{size:16}),title:"Align Center",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("justifyCenter"),l()},disabled:o||r},"alignCenter");if(e==="alignRight")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.AlignRightIcon,{size:16}),title:"Align Right",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("justifyRight"),l()},disabled:o||r},"alignRight");if(e==="alignJustify")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.AlignJustifyIcon,{size:16}),title:"Justify",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("justifyFull"),l()},disabled:o||r},"alignJustify");if(e==="indent")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.IndentIncreaseIcon,{size:16}),title:"Increase Indent",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("indent"),l()},disabled:o||r},"indent");if(e==="outdent")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.IndentDecreaseIcon,{size:16}),title:"Decrease Indent",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("outdent"),l()},disabled:o||r},"outdent");if(e==="clearFormat")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.FormatClearIcon,{size:16}),title:"Clear Formatting",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("removeFormat"),l()},disabled:o||r},"clearFormat");if(e==="more"){const s=["alignLeft","alignCenter","alignRight","alignJustify","indent","outdent","blockquote","code","clearFormat"];return t.jsx(re.ToolbarMore,{disabled:o||r,children:s.map((h,R)=>L(h,R+1e3))},"more")}const g=f.RICH_EDITOR_BUTTON_CONFIG[e],d=ne[e];return!g||!d?null:t.jsx(C.ToolbarButton,{icon:d,title:g.title,active:D.has(e),onClick:()=>$(e),disabled:o||r},e)};return t.jsxs("div",{id:O,"data-testid":A,className:T.cn("Bear-RichEditor",f.RICH_EDITOR_ROOT_CLASSES,o&&"Bear-RichEditor--disabled",r&&"Bear-RichEditor--readonly",B),...v,children:[y.length>0&&t.jsx("div",{className:T.cn("Bear-RichEditor__toolbar",f.RICH_EDITOR_TOOLBAR_CLASSES),children:y.map((e,n)=>L(e,n))}),t.jsx("div",{ref:a,contentEditable:!o&&!r,onInput:l,onSelect:I,onKeyUp:I,onMouseUp:I,onPaste:ee,"data-placeholder":z,className:T.cn("Bear-RichEditor__content",f.RICH_EDITOR_CONTENT_CLASSES,"[&:empty]:before:bear-content-[attr(data-placeholder)] [&:empty]:before:bear-text-gray-400 [&:empty]:before:bear-pointer-events-none",o&&"Bear-RichEditor__content--disabled bear-opacity-50 bear-cursor-not-allowed"),style:{minHeight:typeof p=="number"?`${p}px`:p,maxHeight:b?typeof b=="number"?`${b}px`:b:void 0,overflowY:b?"auto":void 0}})]})};exports.RichEditor=se;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("react"),T=require("../../utils/cn.cjs"),u=require("./helpers/formatHelpers.cjs"),f=require("./RichEditor.const.cjs"),re=require("../../hooks/useMediaQuery.cjs"),C=require("./components/ToolbarButton/ToolbarButton.cjs"),se=require("./components/ToolbarDropdown/ToolbarDropdown.cjs"),H=require("./components/ToolbarColorPicker/ToolbarColorPicker.cjs"),le=require("./components/ToolbarMore/ToolbarMore.cjs"),r=require("../Icon/icons/editor.cjs"),ae=6,ce=B=>{const{value:x,defaultValue:E="",onChange:R,placeholder:S="Start typing...",disabled:o=!1,readOnly:i=!1,minHeight:j=f.RICH_EDITOR_MIN_HEIGHT,maxHeight:b,toolbar:z=f.RICH_EDITOR_DEFAULT_TOOLBAR,className:A="",testId:D,id:v,allowImagePaste:y=!0,...N}=B,a=c.useRef(null),p=re.useMediaQuery(`(max-width: ${f.RICH_EDITOR_MOBILE_BREAKPOINT}px)`),k=p?f.RICH_EDITOR_MOBILE_TOOLBAR:z,[F,M]=c.useState(new Set),[q,L]=c.useState("p"),[w,U]=c.useState("#000000"),[P,V]=c.useState("#fef08a"),[J,G]=c.useState([]),[$,Q]=c.useState([]);c.useEffect(()=>{const e="bear-rich-editor-styles";if(!document.getElementById(e)){const n=document.createElement("style");n.id=e,n.textContent=f.RICH_EDITOR_CONTENT_STYLES,document.head.appendChild(n)}},[]),c.useEffect(()=>{a.current&&x!==void 0&&a.current.innerHTML!==x&&(a.current.innerHTML=x)},[x]),c.useEffect(()=>{a.current&&E&&!x&&(a.current.innerHTML=E)},[]);const h=c.useCallback(()=>{M(u.getActiveFormats());const e=u.queryCommandValue("formatBlock");e&&L(e.toLowerCase().replace(/[<>]/g,""))},[]),l=c.useCallback(()=>{a.current&&R&&R(a.current.innerHTML),h()},[R,h]),K=c.useCallback(e=>{var d;if(o||i)return;(d=a.current)==null||d.focus();const n=f.RICH_EDITOR_BUTTON_CONFIG[e];if(!n)return;const g="value"in n?n.value:void 0;g?u.execCommand(n.command,g):u.execCommand(n.command),h(),l()},[o,i,h,l]),Y=c.useCallback(e=>{var n;o||i||((n=a.current)==null||n.focus(),u.execCommand("formatBlock",e),L(e),l())},[o,i,l]),W=c.useCallback(()=>{var d;if(o||i)return;const e=window.getSelection(),n=e&&e.toString().length>0,g=prompt("Enter URL:",n?"":"https://");g&&((d=a.current)==null||d.focus(),u.insertLink(g),l())},[o,i,l]),m=c.useCallback((e,n)=>{if(!e)return;(n==="text"?G:Q)(d=>{const s=d.filter(I=>I!==e);return[e,...s].slice(0,ae)})},[]),X=c.useCallback(e=>{var n;o||i||((n=a.current)==null||n.focus(),u.setTextColor(e),U(e),m(e,"text"),l())},[o,i,l,m]),Z=c.useCallback(e=>{var n;o||i||((n=a.current)==null||n.focus(),u.setHighlightColor(e),V(e),m(e,"highlight"),l())},[o,i,l,m]),ee=c.useCallback(e=>{var n;o||i||((n=a.current)==null||n.focus(),u.setTextColor(e),l())},[o,i,l]),te=c.useCallback(e=>{var n;o||i||((n=a.current)==null||n.focus(),u.setHighlightColor(e),l())},[o,i,l]),ne=c.useCallback(async e=>{var g;if(!y)return;const n=(g=e.clipboardData)==null?void 0:g.items;if(n)for(let d=0;d<n.length;d++){const s=n[d];if(s.type.startsWith("image/")){e.preventDefault();const I=s.getAsFile();if(I){const _=await u.fileToDataUrl(I);u.insertImage(_),l()}return}}},[y,l]),oe=c.useCallback(()=>{if(o||i)return;const e=document.createElement("input");e.type="file",e.accept="image/*",e.onchange=async n=>{var d,s;const g=(d=n.target.files)==null?void 0:d[0];if(g){const I=await u.fileToDataUrl(g);(s=a.current)==null||s.focus(),u.insertImage(I),l()}},e.click()},[o,i,l]),ie={bold:t.jsx(r.BoldIcon,{size:16}),italic:t.jsx(r.ItalicIcon,{size:16}),underline:t.jsx(r.UnderlineIcon,{size:16}),strikethrough:t.jsx(r.StrikethroughIcon,{size:16}),heading1:t.jsx(r.Heading1Icon,{size:16}),heading2:t.jsx(r.Heading2Icon,{size:16}),heading3:t.jsx(r.Heading3Icon,{size:16}),bulletList:t.jsx(r.ListBulletIcon,{size:16}),orderedList:t.jsx(r.ListNumberedIcon,{size:16}),blockquote:t.jsx(r.QuoteIcon,{size:16}),code:t.jsx(r.CodeIcon,{size:16}),link:t.jsx(r.InsertLinkIcon,{size:16}),alignLeft:t.jsx(r.AlignLeftIcon,{size:16}),alignCenter:t.jsx(r.AlignCenterIcon,{size:16}),alignRight:t.jsx(r.AlignRightIcon,{size:16}),alignJustify:t.jsx(r.AlignJustifyIcon,{size:16}),image:t.jsx(r.InsertPhotoIcon,{size:16}),indent:t.jsx(r.IndentIncreaseIcon,{size:16}),outdent:t.jsx(r.IndentDecreaseIcon,{size:16}),clearFormat:t.jsx(r.FormatClearIcon,{size:16}),table:t.jsx(r.TableIcon,{size:16})},O=(e,n)=>{if(e==="divider")return t.jsx("div",{className:T.cn("Bear-RichEditor__divider",f.RICH_EDITOR_DIVIDER_CLASSES)},`divider-${n}`);if(e==="headingDropdown")return t.jsx(se.ToolbarDropdown,{options:f.RICH_EDITOR_HEADING_OPTIONS,value:q,onChange:Y,title:"Text Style",disabled:o||i,icon:t.jsx(r.TextIcon,{size:16})},"heading-dropdown");if(e==="textColor")return t.jsx(H.ToolbarColorPicker,{value:w,onChange:X,title:"Text Color",disabled:o||i,type:"text",recentColors:J,onApplyLast:ee},"text-color");if(e==="highlightColor")return t.jsx(H.ToolbarColorPicker,{value:P,onChange:Z,title:"Highlight Color",disabled:o||i,type:"highlight",recentColors:$,onApplyLast:te},"highlight-color");if(e==="link")return t.jsx(C.ToolbarButton,{icon:t.jsx(r.InsertLinkIcon,{size:16}),title:"Insert Link",onClick:W,disabled:o||i},"link");if(e==="image")return t.jsx(C.ToolbarButton,{icon:t.jsx(r.InsertPhotoIcon,{size:16}),title:"Insert Image",onClick:oe,disabled:o||i},"image");if(e==="alignLeft")return t.jsx(C.ToolbarButton,{icon:t.jsx(r.AlignLeftIcon,{size:16}),title:"Align Left",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("justifyLeft"),l()},disabled:o||i},"alignLeft");if(e==="alignCenter")return t.jsx(C.ToolbarButton,{icon:t.jsx(r.AlignCenterIcon,{size:16}),title:"Align Center",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("justifyCenter"),l()},disabled:o||i},"alignCenter");if(e==="alignRight")return t.jsx(C.ToolbarButton,{icon:t.jsx(r.AlignRightIcon,{size:16}),title:"Align Right",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("justifyRight"),l()},disabled:o||i},"alignRight");if(e==="alignJustify")return t.jsx(C.ToolbarButton,{icon:t.jsx(r.AlignJustifyIcon,{size:16}),title:"Justify",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("justifyFull"),l()},disabled:o||i},"alignJustify");if(e==="indent")return t.jsx(C.ToolbarButton,{icon:t.jsx(r.IndentIncreaseIcon,{size:16}),title:"Increase Indent",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("indent"),l()},disabled:o||i},"indent");if(e==="outdent")return t.jsx(C.ToolbarButton,{icon:t.jsx(r.IndentDecreaseIcon,{size:16}),title:"Decrease Indent",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("outdent"),l()},disabled:o||i},"outdent");if(e==="clearFormat")return t.jsx(C.ToolbarButton,{icon:t.jsx(r.FormatClearIcon,{size:16}),title:"Clear Formatting",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("removeFormat"),l()},disabled:o||i},"clearFormat");if(e==="more"){const s=p?f.RICH_EDITOR_MOBILE_MORE_ITEMS:["alignLeft","alignCenter","alignRight","alignJustify","indent","outdent","blockquote","code","clearFormat"];return t.jsx(le.ToolbarMore,{disabled:o||i,isMobile:p,children:s.map((I,_)=>O(I,_+1e3))},"more")}const g=f.RICH_EDITOR_BUTTON_CONFIG[e],d=ie[e];return!g||!d?null:t.jsx(C.ToolbarButton,{icon:d,title:g.title,active:F.has(e),onClick:()=>K(e),disabled:o||i},e)};return t.jsxs("div",{id:v,"data-testid":D,className:T.cn("Bear-RichEditor",f.RICH_EDITOR_ROOT_CLASSES,o&&"Bear-RichEditor--disabled",i&&"Bear-RichEditor--readonly",A),...N,children:[k.length>0&&t.jsx("div",{className:T.cn("Bear-RichEditor__toolbar",f.RICH_EDITOR_TOOLBAR_CLASSES),children:k.map((e,n)=>O(e,n))}),t.jsx("div",{ref:a,contentEditable:!o&&!i,onInput:l,onSelect:h,onKeyUp:h,onMouseUp:h,onPaste:ne,"data-placeholder":S,className:T.cn("Bear-RichEditor__content",f.RICH_EDITOR_CONTENT_CLASSES,"[&:empty]:before:bear-content-[attr(data-placeholder)] [&:empty]:before:bear-text-gray-400 [&:empty]:before:bear-pointer-events-none",o&&"Bear-RichEditor__content--disabled bear-opacity-50 bear-cursor-not-allowed"),style:{minHeight:typeof j=="number"?`${j}px`:j,maxHeight:b?typeof b=="number"?`${b}px`:b:void 0,overflowY:b?"auto":void 0}})]})};exports.RichEditor=ce;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=150,a=["headingDropdown","divider","bold","italic","underline","strikethrough","divider","textColor","highlightColor","divider","alignLeft","alignCenter","alignRight","alignJustify","divider","bulletList","orderedList","divider","indent","outdent","divider","blockquote","code","link","image","divider","clearFormat"],o="Bear-RichEditor rounded-lg border border-gray-200 dark:border-zinc-700 overflow-hidden bg-white dark:bg-zinc-900 shadow-sm",r="flex flex-wrap items-center gap-0.5 p-2 border-b border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-800",i="p-4 outline-none max-w-none text-gray-900 dark:text-gray-100 bg-white dark:bg-zinc-900 min-h-[100px]",n="w-px h-5 bg-gray-300 dark:bg-zinc-600 mx-1",d="p-1.5 rounded transition-colors",l="bg-pink-500 text-white",c="text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-zinc-700",m="opacity-50 cursor-not-allowed",_=[{value:"p",label:"Paragraph",preview:e.jsx("span",{className:"bear-text-sm bear-font-normal",children:"Normal text"})},{value:"h1",label:"Heading 1",preview:e.jsx("span",{className:"bear-text-2xl bear-font-bold",children:"Heading 1"})},{value:"h2",label:"Heading 2",preview:e.jsx("span",{className:"bear-text-xl bear-font-bold",children:"Heading 2"})},{value:"h3",label:"Heading 3",preview:e.jsx("span",{className:"bear-text-lg bear-font-semibold",children:"Heading 3"})},{value:"h4",label:"Heading 4",preview:e.jsx("span",{className:"bear-text-base bear-font-semibold",children:"Heading 4"})},{value:"h5",label:"Heading 5",preview:e.jsx("span",{className:"bear-text-sm bear-font-semibold",children:"Heading 5"})},{value:"h6",label:"Heading 6",preview:e.jsx("span",{className:"bear-text-xs bear-font-semibold bear-uppercase",children:"Heading 6"})}],g={bold:{title:"Bold (Ctrl+B)",command:"bold"},italic:{title:"Italic (Ctrl+I)",command:"italic"},underline:{title:"Underline (Ctrl+U)",command:"underline"},strikethrough:{title:"Strikethrough",command:"strikeThrough"},heading1:{title:"Heading 1",command:"formatBlock",value:"h1"},heading2:{title:"Heading 2",command:"formatBlock",value:"h2"},heading3:{title:"Heading 3",command:"formatBlock",value:"h3"},heading4:{title:"Heading 4",command:"formatBlock",value:"h4"},heading5:{title:"Heading 5",command:"formatBlock",value:"h5"},heading6:{title:"Heading 6",command:"formatBlock",value:"h6"},paragraph:{title:"Paragraph",command:"formatBlock",value:"p"},bulletList:{title:"Bullet List",command:"insertUnorderedList"},orderedList:{title:"Numbered List",command:"insertOrderedList"},blockquote:{title:"Quote",command:"formatBlock",value:"blockquote"},code:{title:"Code Block",command:"formatBlock",value:"pre"},link:{title:"Insert Link",command:"createLink"},image:{title:"Insert Image",command:"insertImage"},textColor:{title:"Text Color",command:"foreColor"},highlightColor:{title:"Highlight Color",command:"hiliteColor"},alignLeft:{title:"Align Left",command:"justifyLeft"},alignCenter:{title:"Align Center",command:"justifyCenter"},alignRight:{title:"Align Right",command:"justifyRight"},alignJustify:{title:"Justify",command:"justifyFull"},indent:{title:"Increase Indent",command:"indent"},outdent:{title:"Decrease Indent",command:"outdent"},clearFormat:{title:"Clear Formatting",command:"removeFormat"},table:{title:"Insert Table",command:"insertTable"}},s=["#000000","#374151","#6b7280","#9ca3af","#d1d5db","#ffffff","#991b1b","#dc2626","#ef4444","#f87171","#fca5a5","#fee2e2","#9a3412","#ea580c","#f97316","#fb923c","#fdba74","#fed7aa","#854d0e","#ca8a04","#eab308","#facc15","#fde047","#fef08a","#166534","#16a34a","#22c55e","#4ade80","#86efac","#bbf7d0","#1e40af","#2563eb","#3b82f6","#60a5fa","#93c5fd","#bfdbfe","#6b21a8","#9333ea","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#9d174d","#db2777","#ec4899","#f472b6","#f9a8d4","#fbcfe8"],h=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=150,i=["headingDropdown","divider","bold","italic","underline","strikethrough","divider","textColor","highlightColor","divider","alignLeft","alignCenter","alignRight","alignJustify","divider","bulletList","orderedList","divider","indent","outdent","divider","blockquote","code","link","image","divider","clearFormat"],o=["headingDropdown","divider","bold","italic","strikethrough","divider","more"],r=["underline","textColor","highlightColor","divider","alignLeft","alignCenter","alignRight","alignJustify","divider","bulletList","orderedList","divider","indent","outdent","divider","blockquote","code","link","image","divider","clearFormat"],a=640,n="Bear-RichEditor rounded-lg border border-gray-200 dark:border-zinc-700 overflow-hidden bg-white dark:bg-zinc-900 shadow-sm",d="flex flex-wrap items-center gap-0.5 p-2 border-b border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-800 overflow-x-auto overflow-y-hidden",l="p-4 outline-none max-w-none text-gray-900 dark:text-gray-100 bg-white dark:bg-zinc-900 min-h-[100px]",c="w-px h-5 bg-gray-300 dark:bg-zinc-600 mx-1",m="p-1.5 rounded transition-colors",_="bg-pink-500 text-white",g="text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-zinc-700",s="opacity-50 cursor-not-allowed",h=[{value:"p",label:"Paragraph",preview:e.jsx("span",{className:"bear-text-sm bear-font-normal",children:"Normal text"})},{value:"h1",label:"Heading 1",preview:e.jsx("span",{className:"bear-text-2xl bear-font-bold",children:"Heading 1"})},{value:"h2",label:"Heading 2",preview:e.jsx("span",{className:"bear-text-xl bear-font-bold",children:"Heading 2"})},{value:"h3",label:"Heading 3",preview:e.jsx("span",{className:"bear-text-lg bear-font-semibold",children:"Heading 3"})},{value:"h4",label:"Heading 4",preview:e.jsx("span",{className:"bear-text-base bear-font-semibold",children:"Heading 4"})},{value:"h5",label:"Heading 5",preview:e.jsx("span",{className:"bear-text-sm bear-font-semibold",children:"Heading 5"})},{value:"h6",label:"Heading 6",preview:e.jsx("span",{className:"bear-text-xs bear-font-semibold bear-uppercase",children:"Heading 6"})}],R={bold:{title:"Bold (Ctrl+B)",command:"bold"},italic:{title:"Italic (Ctrl+I)",command:"italic"},underline:{title:"Underline (Ctrl+U)",command:"underline"},strikethrough:{title:"Strikethrough",command:"strikeThrough"},heading1:{title:"Heading 1",command:"formatBlock",value:"h1"},heading2:{title:"Heading 2",command:"formatBlock",value:"h2"},heading3:{title:"Heading 3",command:"formatBlock",value:"h3"},heading4:{title:"Heading 4",command:"formatBlock",value:"h4"},heading5:{title:"Heading 5",command:"formatBlock",value:"h5"},heading6:{title:"Heading 6",command:"formatBlock",value:"h6"},paragraph:{title:"Paragraph",command:"formatBlock",value:"p"},bulletList:{title:"Bullet List",command:"insertUnorderedList"},orderedList:{title:"Numbered List",command:"insertOrderedList"},blockquote:{title:"Quote",command:"formatBlock",value:"blockquote"},code:{title:"Code Block",command:"formatBlock",value:"pre"},link:{title:"Insert Link",command:"createLink"},image:{title:"Insert Image",command:"insertImage"},textColor:{title:"Text Color",command:"foreColor"},highlightColor:{title:"Highlight Color",command:"hiliteColor"},alignLeft:{title:"Align Left",command:"justifyLeft"},alignCenter:{title:"Align Center",command:"justifyCenter"},alignRight:{title:"Align Right",command:"justifyRight"},alignJustify:{title:"Justify",command:"justifyFull"},indent:{title:"Increase Indent",command:"indent"},outdent:{title:"Decrease Indent",command:"outdent"},clearFormat:{title:"Clear Formatting",command:"removeFormat"},table:{title:"Insert Table",command:"insertTable"}},b=["#000000","#374151","#6b7280","#9ca3af","#d1d5db","#ffffff","#991b1b","#dc2626","#ef4444","#f87171","#fca5a5","#fee2e2","#9a3412","#ea580c","#f97316","#fb923c","#fdba74","#fed7aa","#854d0e","#ca8a04","#eab308","#facc15","#fde047","#fef08a","#166534","#16a34a","#22c55e","#4ade80","#86efac","#bbf7d0","#1e40af","#2563eb","#3b82f6","#60a5fa","#93c5fd","#bfdbfe","#6b21a8","#9333ea","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#9d174d","#db2777","#ec4899","#f472b6","#f9a8d4","#fbcfe8"],E=`
2
2
  .Bear-RichEditor__content {
3
3
  line-height: 1.6;
4
4
  }
@@ -138,4 +138,4 @@
138
138
  .dark .Bear-RichEditor__content td {
139
139
  border-color: #4b5563;
140
140
  }
141
- `;exports.RICH_EDITOR_BUTTON_ACTIVE_CLASSES=l;exports.RICH_EDITOR_BUTTON_BASE_CLASSES=d;exports.RICH_EDITOR_BUTTON_CONFIG=g;exports.RICH_EDITOR_BUTTON_DISABLED_CLASSES=m;exports.RICH_EDITOR_BUTTON_INACTIVE_CLASSES=c;exports.RICH_EDITOR_COLORS=s;exports.RICH_EDITOR_CONTENT_CLASSES=i;exports.RICH_EDITOR_CONTENT_STYLES=h;exports.RICH_EDITOR_DEFAULT_TOOLBAR=a;exports.RICH_EDITOR_DIVIDER_CLASSES=n;exports.RICH_EDITOR_HEADING_OPTIONS=_;exports.RICH_EDITOR_MIN_HEIGHT=t;exports.RICH_EDITOR_ROOT_CLASSES=o;exports.RICH_EDITOR_TOOLBAR_CLASSES=r;
141
+ `;exports.RICH_EDITOR_BUTTON_ACTIVE_CLASSES=_;exports.RICH_EDITOR_BUTTON_BASE_CLASSES=m;exports.RICH_EDITOR_BUTTON_CONFIG=R;exports.RICH_EDITOR_BUTTON_DISABLED_CLASSES=s;exports.RICH_EDITOR_BUTTON_INACTIVE_CLASSES=g;exports.RICH_EDITOR_COLORS=b;exports.RICH_EDITOR_CONTENT_CLASSES=l;exports.RICH_EDITOR_CONTENT_STYLES=E;exports.RICH_EDITOR_DEFAULT_TOOLBAR=i;exports.RICH_EDITOR_DIVIDER_CLASSES=c;exports.RICH_EDITOR_HEADING_OPTIONS=h;exports.RICH_EDITOR_MIN_HEIGHT=t;exports.RICH_EDITOR_MOBILE_BREAKPOINT=a;exports.RICH_EDITOR_MOBILE_MORE_ITEMS=r;exports.RICH_EDITOR_MOBILE_TOOLBAR=o;exports.RICH_EDITOR_ROOT_CLASSES=n;exports.RICH_EDITOR_TOOLBAR_CLASSES=d;
@@ -2,9 +2,12 @@ import { ToolbarOption, DropdownOption } from './RichEditor.types';
2
2
  export declare const RICH_EDITOR_MIN_HEIGHT = 150;
3
3
  export declare const RICH_EDITOR_DEFAULT_TOOLBAR: ToolbarOption[];
4
4
  export declare const RICH_EDITOR_COMPACT_TOOLBAR: ToolbarOption[];
5
+ export declare const RICH_EDITOR_MOBILE_TOOLBAR: ToolbarOption[];
6
+ export declare const RICH_EDITOR_MOBILE_MORE_ITEMS: ToolbarOption[];
7
+ export declare const RICH_EDITOR_MOBILE_BREAKPOINT = 640;
5
8
  export declare const RICH_EDITOR_SIMPLE_TOOLBAR: ToolbarOption[];
6
9
  export declare const RICH_EDITOR_ROOT_CLASSES = "Bear-RichEditor rounded-lg border border-gray-200 dark:border-zinc-700 overflow-hidden bg-white dark:bg-zinc-900 shadow-sm";
7
- export declare const RICH_EDITOR_TOOLBAR_CLASSES = "flex flex-wrap items-center gap-0.5 p-2 border-b border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-800";
10
+ export declare const RICH_EDITOR_TOOLBAR_CLASSES = "flex flex-wrap items-center gap-0.5 p-2 border-b border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-800 overflow-x-auto overflow-y-hidden";
8
11
  export declare const RICH_EDITOR_CONTENT_CLASSES = "p-4 outline-none max-w-none text-gray-900 dark:text-gray-100 bg-white dark:bg-zinc-900 min-h-[100px]";
9
12
  export declare const RICH_EDITOR_DIVIDER_CLASSES = "w-px h-5 bg-gray-300 dark:bg-zinc-600 mx-1";
10
13
  export declare const RICH_EDITOR_BUTTON_BASE_CLASSES = "p-1.5 rounded transition-colors";
@@ -1,5 +1,5 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- const a = 150, o = [
2
+ const i = 150, o = [
3
3
  "headingDropdown",
4
4
  "divider",
5
5
  "bold",
@@ -27,7 +27,37 @@ const a = 150, o = [
27
27
  "image",
28
28
  "divider",
29
29
  "clearFormat"
30
- ], r = "Bear-RichEditor rounded-lg border border-gray-200 dark:border-zinc-700 overflow-hidden bg-white dark:bg-zinc-900 shadow-sm", i = "flex flex-wrap items-center gap-0.5 p-2 border-b border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-800", n = "p-4 outline-none max-w-none text-gray-900 dark:text-gray-100 bg-white dark:bg-zinc-900 min-h-[100px]", d = "w-px h-5 bg-gray-300 dark:bg-zinc-600 mx-1", l = "p-1.5 rounded transition-colors", c = "bg-pink-500 text-white", m = "text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-zinc-700", g = "opacity-50 cursor-not-allowed", s = [
30
+ ], r = [
31
+ "headingDropdown",
32
+ "divider",
33
+ "bold",
34
+ "italic",
35
+ "strikethrough",
36
+ "divider",
37
+ "more"
38
+ ], a = [
39
+ "underline",
40
+ "textColor",
41
+ "highlightColor",
42
+ "divider",
43
+ "alignLeft",
44
+ "alignCenter",
45
+ "alignRight",
46
+ "alignJustify",
47
+ "divider",
48
+ "bulletList",
49
+ "orderedList",
50
+ "divider",
51
+ "indent",
52
+ "outdent",
53
+ "divider",
54
+ "blockquote",
55
+ "code",
56
+ "link",
57
+ "image",
58
+ "divider",
59
+ "clearFormat"
60
+ ], n = 640, d = "Bear-RichEditor rounded-lg border border-gray-200 dark:border-zinc-700 overflow-hidden bg-white dark:bg-zinc-900 shadow-sm", l = "flex flex-wrap items-center gap-0.5 p-2 border-b border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-800 overflow-x-auto overflow-y-hidden", c = "p-4 outline-none max-w-none text-gray-900 dark:text-gray-100 bg-white dark:bg-zinc-900 min-h-[100px]", m = "w-px h-5 bg-gray-300 dark:bg-zinc-600 mx-1", g = "p-1.5 rounded transition-colors", s = "bg-pink-500 text-white", h = "text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-zinc-700", b = "opacity-50 cursor-not-allowed", f = [
31
61
  { value: "p", label: "Paragraph", preview: /* @__PURE__ */ e("span", { className: "bear-text-sm bear-font-normal", children: "Normal text" }) },
32
62
  { value: "h1", label: "Heading 1", preview: /* @__PURE__ */ e("span", { className: "bear-text-2xl bear-font-bold", children: "Heading 1" }) },
33
63
  { value: "h2", label: "Heading 2", preview: /* @__PURE__ */ e("span", { className: "bear-text-xl bear-font-bold", children: "Heading 2" }) },
@@ -35,7 +65,7 @@ const a = 150, o = [
35
65
  { value: "h4", label: "Heading 4", preview: /* @__PURE__ */ e("span", { className: "bear-text-base bear-font-semibold", children: "Heading 4" }) },
36
66
  { value: "h5", label: "Heading 5", preview: /* @__PURE__ */ e("span", { className: "bear-text-sm bear-font-semibold", children: "Heading 5" }) },
37
67
  { value: "h6", label: "Heading 6", preview: /* @__PURE__ */ e("span", { className: "bear-text-xs bear-font-semibold bear-uppercase", children: "Heading 6" }) }
38
- ], h = {
68
+ ], _ = {
39
69
  bold: { title: "Bold (Ctrl+B)", command: "bold" },
40
70
  italic: { title: "Italic (Ctrl+I)", command: "italic" },
41
71
  underline: { title: "Underline (Ctrl+U)", command: "underline" },
@@ -63,7 +93,7 @@ const a = 150, o = [
63
93
  outdent: { title: "Decrease Indent", command: "outdent" },
64
94
  clearFormat: { title: "Clear Formatting", command: "removeFormat" },
65
95
  table: { title: "Insert Table", command: "insertTable" }
66
- }, b = [
96
+ }, p = [
67
97
  // Row 1: Grayscale
68
98
  "#000000",
69
99
  "#374151",
@@ -120,7 +150,7 @@ const a = 150, o = [
120
150
  "#f472b6",
121
151
  "#f9a8d4",
122
152
  "#fbcfe8"
123
- ], f = `
153
+ ], u = `
124
154
  .Bear-RichEditor__content {
125
155
  line-height: 1.6;
126
156
  }
@@ -262,18 +292,21 @@ const a = 150, o = [
262
292
  }
263
293
  `;
264
294
  export {
265
- c as RICH_EDITOR_BUTTON_ACTIVE_CLASSES,
266
- l as RICH_EDITOR_BUTTON_BASE_CLASSES,
267
- h as RICH_EDITOR_BUTTON_CONFIG,
268
- g as RICH_EDITOR_BUTTON_DISABLED_CLASSES,
269
- m as RICH_EDITOR_BUTTON_INACTIVE_CLASSES,
270
- b as RICH_EDITOR_COLORS,
271
- n as RICH_EDITOR_CONTENT_CLASSES,
272
- f as RICH_EDITOR_CONTENT_STYLES,
295
+ s as RICH_EDITOR_BUTTON_ACTIVE_CLASSES,
296
+ g as RICH_EDITOR_BUTTON_BASE_CLASSES,
297
+ _ as RICH_EDITOR_BUTTON_CONFIG,
298
+ b as RICH_EDITOR_BUTTON_DISABLED_CLASSES,
299
+ h as RICH_EDITOR_BUTTON_INACTIVE_CLASSES,
300
+ p as RICH_EDITOR_COLORS,
301
+ c as RICH_EDITOR_CONTENT_CLASSES,
302
+ u as RICH_EDITOR_CONTENT_STYLES,
273
303
  o as RICH_EDITOR_DEFAULT_TOOLBAR,
274
- d as RICH_EDITOR_DIVIDER_CLASSES,
275
- s as RICH_EDITOR_HEADING_OPTIONS,
276
- a as RICH_EDITOR_MIN_HEIGHT,
277
- r as RICH_EDITOR_ROOT_CLASSES,
278
- i as RICH_EDITOR_TOOLBAR_CLASSES
304
+ m as RICH_EDITOR_DIVIDER_CLASSES,
305
+ f as RICH_EDITOR_HEADING_OPTIONS,
306
+ i as RICH_EDITOR_MIN_HEIGHT,
307
+ n as RICH_EDITOR_MOBILE_BREAKPOINT,
308
+ a as RICH_EDITOR_MOBILE_MORE_ITEMS,
309
+ r as RICH_EDITOR_MOBILE_TOOLBAR,
310
+ d as RICH_EDITOR_ROOT_CLASSES,
311
+ l as RICH_EDITOR_TOOLBAR_CLASSES
279
312
  };