@bikdotai/bik-component-library 0.0.835-beta.2 → 0.0.835

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 (70) hide show
  1. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  2. package/dist/cjs/components/button/Button.styled.js +2 -7
  3. package/dist/cjs/components/button/Button.styled.js.map +1 -1
  4. package/dist/cjs/components/button/themes.js +3 -3
  5. package/dist/cjs/components/button/themes.js.map +1 -1
  6. package/dist/cjs/components/checkBox/CheckBox.js +1 -1
  7. package/dist/cjs/components/checkBox/CheckBox.js.map +1 -1
  8. package/dist/cjs/components/checkBox/CheckBox.styled.js +10 -7
  9. package/dist/cjs/components/checkBox/CheckBox.styled.js.map +1 -1
  10. package/dist/cjs/components/dropdown/ChipInput.js +1 -1
  11. package/dist/cjs/components/dropdown/ChipInput.js.map +1 -1
  12. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  13. package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
  14. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  15. package/dist/cjs/components/input/Input.js +1 -1
  16. package/dist/cjs/components/input/Input.js.map +1 -1
  17. package/dist/cjs/components/input/Input.styled.js +12 -25
  18. package/dist/cjs/components/input/Input.styled.js.map +1 -1
  19. package/dist/cjs/components/tabs/Tabs.js +1 -1
  20. package/dist/cjs/components/tabs/Tabs.js.map +1 -1
  21. package/dist/cjs/components/tabs/Tabs.styles.js +8 -22
  22. package/dist/cjs/components/tabs/Tabs.styles.js.map +1 -1
  23. package/dist/cjs/components/whats-new/WhatsNew.js +1 -1
  24. package/dist/cjs/components/whats-new/WhatsNew.js.map +1 -1
  25. package/dist/cjs/components/whats-new/WhatsNewButton.js +2 -2
  26. package/dist/cjs/components/whats-new/WhatsNewButton.js.map +1 -1
  27. package/dist/cjs/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -1
  28. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  29. package/dist/esm/components/button/Button.styled.js +6 -11
  30. package/dist/esm/components/button/Button.styled.js.map +1 -1
  31. package/dist/esm/components/button/themes.d.ts +1 -1
  32. package/dist/esm/components/button/themes.js +1 -1
  33. package/dist/esm/components/button/themes.js.map +1 -1
  34. package/dist/esm/components/checkBox/CheckBox.js +16 -17
  35. package/dist/esm/components/checkBox/CheckBox.js.map +1 -1
  36. package/dist/esm/components/checkBox/CheckBox.styled.d.ts +0 -1
  37. package/dist/esm/components/checkBox/CheckBox.styled.js +11 -9
  38. package/dist/esm/components/checkBox/CheckBox.styled.js.map +1 -1
  39. package/dist/esm/components/dropdown/ChipInput.d.ts +0 -1
  40. package/dist/esm/components/dropdown/ChipInput.js +30 -37
  41. package/dist/esm/components/dropdown/ChipInput.js.map +1 -1
  42. package/dist/esm/components/dropdown/Dropdown.d.ts +0 -2
  43. package/dist/esm/components/dropdown/Dropdown.js +88 -95
  44. package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
  45. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  46. package/dist/esm/components/input/Input.js +101 -104
  47. package/dist/esm/components/input/Input.js.map +1 -1
  48. package/dist/esm/components/input/Input.model.d.ts +0 -2
  49. package/dist/esm/components/input/Input.styled.d.ts +0 -2
  50. package/dist/esm/components/input/Input.styled.js +25 -38
  51. package/dist/esm/components/input/Input.styled.js.map +1 -1
  52. package/dist/esm/components/tabs/Tabs.js +73 -93
  53. package/dist/esm/components/tabs/Tabs.js.map +1 -1
  54. package/dist/esm/components/tabs/Tabs.model.d.ts +0 -7
  55. package/dist/esm/components/tabs/Tabs.styles.d.ts +0 -2
  56. package/dist/esm/components/tabs/Tabs.styles.js +9 -23
  57. package/dist/esm/components/tabs/Tabs.styles.js.map +1 -1
  58. package/dist/esm/components/whats-new/WhatsNew.d.ts +0 -1
  59. package/dist/esm/components/whats-new/WhatsNew.js +17 -19
  60. package/dist/esm/components/whats-new/WhatsNew.js.map +1 -1
  61. package/dist/esm/components/whats-new/WhatsNew.types.d.ts +0 -1
  62. package/dist/esm/components/whats-new/WhatsNewButton.js +32 -37
  63. package/dist/esm/components/whats-new/WhatsNewButton.js.map +1 -1
  64. package/dist/esm/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -1
  65. package/dist/esm/icons/index.d.ts +25 -25
  66. package/package.json +2 -2
  67. package/dist/cjs/utils/rgba.js +0 -2
  68. package/dist/cjs/utils/rgba.js.map +0 -1
  69. package/dist/esm/utils/rgba.js +0 -10
  70. package/dist/esm/utils/rgba.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { jsxs as g, Fragment as S, jsx as s } from "react/jsx-runtime";
2
- import { useState as b } from "react";
3
- import { WhatsNewButton as j } from "./WhatsNewButton.js";
4
- import { WhatsNewPanel as I } from "./WhatsNewPanel.js";
5
- import { useWhatsNewContext as y } from "./WhatsNewProvider.js";
6
- const A = ({
1
+ import { jsxs as O, Fragment as g, jsx as s } from "react/jsx-runtime";
2
+ import { useState as S } from "react";
3
+ import { WhatsNewButton as b } from "./WhatsNewButton.js";
4
+ import { WhatsNewPanel as j } from "./WhatsNewPanel.js";
5
+ import { useWhatsNewContext as I } from "./WhatsNewProvider.js";
6
+ const z = ({
7
7
  title: a = "What's new",
8
8
  tooltip: r = "What's new",
9
9
  searchPlaceholder: h = "Search posts",
@@ -18,16 +18,15 @@ const A = ({
18
18
  iconHeight: d = 24,
19
19
  iconColor: u,
20
20
  iconPadding: f,
21
- buttonSize: N,
22
- customIcon: W
21
+ customIcon: N
23
22
  }) => {
24
- const [t, n] = b(!1), { whatsNewContent: k, isLoading: o, newContentCount: x } = y();
25
- return /* @__PURE__ */ g(S, { children: [
23
+ const [t, n] = S(!1), { whatsNewContent: W, isLoading: o, newContentCount: k } = I();
24
+ return /* @__PURE__ */ O(g, { children: [
26
25
  /* @__PURE__ */ s(
27
- j,
26
+ b,
28
27
  {
29
28
  onClick: () => n(!0),
30
- newContentCount: x,
29
+ newContentCount: k,
31
30
  isOpen: t,
32
31
  isLoading: o,
33
32
  tooltip: r,
@@ -36,16 +35,15 @@ const A = ({
36
35
  iconHeight: d,
37
36
  iconColor: u,
38
37
  iconPadding: f,
39
- buttonSize: N,
40
- customIcon: W
38
+ customIcon: N
41
39
  }
42
40
  ),
43
41
  /* @__PURE__ */ s(
44
- I,
42
+ j,
45
43
  {
46
44
  isOpen: t,
47
45
  onClose: () => n(!1),
48
- content: k,
46
+ content: W,
49
47
  isLoading: o,
50
48
  title: a,
51
49
  searchPlaceholder: h,
@@ -53,8 +51,8 @@ const A = ({
53
51
  emptyStateDescription: c,
54
52
  noResultsText: i,
55
53
  width: m,
56
- onContentClick: (O) => {
57
- e && e(O);
54
+ onContentClick: (x) => {
55
+ e && e(x);
58
56
  },
59
57
  renderCustomContent: p
60
58
  }
@@ -62,6 +60,6 @@ const A = ({
62
60
  ] });
63
61
  };
64
62
  export {
65
- A as WhatsNew
63
+ z as WhatsNew
66
64
  };
67
65
  //# sourceMappingURL=WhatsNew.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WhatsNew.js","sources":["../../../../src/components/whats-new/WhatsNew.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { WhatsNewContent } from './WhatsNew.types';\nimport { WhatsNewButton } from './WhatsNewButton';\nimport { WhatsNewPanel } from './WhatsNewPanel';\nimport { useWhatsNewContext } from './WhatsNewProvider';\n\ninterface WhatsNewProps {\n\ttitle?: string;\n\ttooltip?: string;\n\tsearchPlaceholder?: string;\n\temptyStateTitle?: string;\n\temptyStateDescription?: string;\n\tnoResultsText?: string;\n\twidth?: string;\n\tonContentClick?: (content: WhatsNewContent) => void;\n\trenderCustomContent?: (content: WhatsNewContent) => React.ReactNode;\n\tbuttonTestId?: string;\n\ticonWidth?: number;\n\ticonHeight?: number;\n\ticonColor?: string;\n\ticonPadding?: number;\n\tbuttonSize?: number;\n\tcustomIcon?: React.ComponentType<{\n\t\twidth?: number;\n\t\theight?: number;\n\t\tcolor?: string;\n\t}>;\n}\n\nexport const WhatsNew: React.FC<WhatsNewProps> = ({\n\ttitle = \"What's new\",\n\ttooltip = \"What's new\",\n\tsearchPlaceholder = 'Search posts',\n\temptyStateTitle = 'Nothing new!',\n\temptyStateDescription = 'There are no new updates or features at the moment. Check back soon!',\n\tnoResultsText = 'Sorry, no results found.',\n\twidth = '480px',\n\tonContentClick,\n\trenderCustomContent,\n\tbuttonTestId = 'whats-new-button',\n\ticonWidth = 24,\n\ticonHeight = 24,\n\ticonColor,\n\ticonPadding,\n\tbuttonSize,\n\tcustomIcon,\n}) => {\n\tconst [isOpen, setIsOpen] = useState(false);\n\tconst { whatsNewContent, isLoading, newContentCount } = useWhatsNewContext();\n\n\tconst handleOpen = () => setIsOpen(true);\n\tconst handleClose = () => setIsOpen(false);\n\n\tconst handleContentClick = (contentItem: WhatsNewContent) => {\n\t\t// WhatsNewPanel handles video/redirect logic directly\n\t\t// This handler is only for parent-level analytics/tracking\n\n\t\tif (onContentClick) {\n\t\t\tonContentClick(contentItem);\n\t\t}\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<WhatsNewButton\n\t\t\t\tonClick={handleOpen}\n\t\t\t\tnewContentCount={newContentCount}\n\t\t\t\tisOpen={isOpen}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\ttooltip={tooltip}\n\t\t\t\ttestId={buttonTestId}\n\t\t\t\ticonWidth={iconWidth}\n\t\t\t\ticonHeight={iconHeight}\n\t\t\t\ticonColor={iconColor}\n\t\t\t\ticonPadding={iconPadding}\n\t\t\t\tbuttonSize={buttonSize}\n\t\t\t\tcustomIcon={customIcon}\n\t\t\t/>\n\t\t\t<WhatsNewPanel\n\t\t\t\tisOpen={isOpen}\n\t\t\t\tonClose={handleClose}\n\t\t\t\tcontent={whatsNewContent}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\ttitle={title}\n\t\t\t\tsearchPlaceholder={searchPlaceholder}\n\t\t\t\temptyStateTitle={emptyStateTitle}\n\t\t\t\temptyStateDescription={emptyStateDescription}\n\t\t\t\tnoResultsText={noResultsText}\n\t\t\t\twidth={width}\n\t\t\t\tonContentClick={handleContentClick}\n\t\t\t\trenderCustomContent={renderCustomContent}\n\t\t\t/>\n\t\t</>\n\t);\n};\n"],"names":["WhatsNew","title","tooltip","searchPlaceholder","emptyStateTitle","emptyStateDescription","noResultsText","width","onContentClick","renderCustomContent","buttonTestId","iconWidth","iconHeight","iconColor","iconPadding","buttonSize","customIcon","isOpen","setIsOpen","useState","whatsNewContent","isLoading","newContentCount","useWhatsNewContext","jsxs","Fragment","jsx","WhatsNewButton","WhatsNewPanel","contentItem"],"mappings":";;;;;AA6BO,MAAMA,IAAoC,CAAC;AAAA,EACjD,OAAAC,IAAQ;AAAA,EACR,SAAAC,IAAU;AAAA,EACV,mBAAAC,IAAoB;AAAA,EACpB,iBAAAC,IAAkB;AAAA,EAClB,uBAAAC,IAAwB;AAAA,EACxB,eAAAC,IAAgB;AAAA,EAChB,OAAAC,IAAQ;AAAA,EACR,gBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AACD,MAAM;AACL,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GACpC,EAAE,iBAAAC,GAAiB,WAAAC,GAAW,iBAAAC,EAAA,IAAoBC,EAAA;AAcxD,SACC,gBAAAC,EAAAC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACA,SAfgB,MAAMT,EAAU,EAAI;AAAA,QAgBpC,iBAAAI;AAAA,QACA,QAAAL;AAAA,QACA,WAAAI;AAAA,QACA,SAAAnB;AAAA,QACA,QAAQQ;AAAA,QACR,WAAAC;AAAA,QACA,YAAAC;AAAA,QACA,WAAAC;AAAA,QACA,aAAAC;AAAA,QACA,YAAAC;AAAA,QACA,YAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,IAED,gBAAAU;AAAA,MAACE;AAAA,MAAA;AAAA,QACA,QAAAX;AAAA,QACA,SA7BiB,MAAMC,EAAU,EAAK;AAAA,QA8BtC,SAASE;AAAA,QACT,WAAAC;AAAA,QACA,OAAApB;AAAA,QACA,mBAAAE;AAAA,QACA,iBAAAC;AAAA,QACA,uBAAAC;AAAA,QACA,eAAAC;AAAA,QACA,OAAAC;AAAA,QACA,gBApCwB,CAACsB,MAAiC;AAI5D,UAAIrB,KACHA,EAAeqB,CAAW;AAAA,QAE5B;AAAA,QA8BG,qBAAApB;AAAA,MAAA;AAAA,IAAA;AAAA,EACD,GACD;AAEF;"}
1
+ {"version":3,"file":"WhatsNew.js","sources":["../../../../src/components/whats-new/WhatsNew.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { WhatsNewContent } from './WhatsNew.types';\nimport { WhatsNewButton } from './WhatsNewButton';\nimport { WhatsNewPanel } from './WhatsNewPanel';\nimport { useWhatsNewContext } from './WhatsNewProvider';\n\ninterface WhatsNewProps {\n\ttitle?: string;\n\ttooltip?: string;\n\tsearchPlaceholder?: string;\n\temptyStateTitle?: string;\n\temptyStateDescription?: string;\n\tnoResultsText?: string;\n\twidth?: string;\n\tonContentClick?: (content: WhatsNewContent) => void;\n\trenderCustomContent?: (content: WhatsNewContent) => React.ReactNode;\n\tbuttonTestId?: string;\n\ticonWidth?: number;\n\ticonHeight?: number;\n\ticonColor?: string;\n\ticonPadding?: number;\n\tcustomIcon?: React.ComponentType<{\n\t\twidth?: number;\n\t\theight?: number;\n\t\tcolor?: string;\n\t}>;\n}\n\nexport const WhatsNew: React.FC<WhatsNewProps> = ({\n\ttitle = \"What's new\",\n\ttooltip = \"What's new\",\n\tsearchPlaceholder = 'Search posts',\n\temptyStateTitle = 'Nothing new!',\n\temptyStateDescription = 'There are no new updates or features at the moment. Check back soon!',\n\tnoResultsText = 'Sorry, no results found.',\n\twidth = '480px',\n\tonContentClick,\n\trenderCustomContent,\n\tbuttonTestId = 'whats-new-button',\n\ticonWidth = 24,\n\ticonHeight = 24,\n\ticonColor,\n\ticonPadding,\n\tcustomIcon,\n}) => {\n\tconst [isOpen, setIsOpen] = useState(false);\n\tconst { whatsNewContent, isLoading, newContentCount } = useWhatsNewContext();\n\n\tconst handleOpen = () => setIsOpen(true);\n\tconst handleClose = () => setIsOpen(false);\n\n\tconst handleContentClick = (contentItem: WhatsNewContent) => {\n\t\t// WhatsNewPanel handles video/redirect logic directly\n\t\t// This handler is only for parent-level analytics/tracking\n\n\t\tif (onContentClick) {\n\t\t\tonContentClick(contentItem);\n\t\t}\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<WhatsNewButton\n\t\t\t\tonClick={handleOpen}\n\t\t\t\tnewContentCount={newContentCount}\n\t\t\t\tisOpen={isOpen}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\ttooltip={tooltip}\n\t\t\t\ttestId={buttonTestId}\n\t\t\t\ticonWidth={iconWidth}\n\t\t\t\ticonHeight={iconHeight}\n\t\t\t\ticonColor={iconColor}\n\t\t\t\ticonPadding={iconPadding}\n\t\t\t\tcustomIcon={customIcon}\n\t\t\t/>\n\t\t\t<WhatsNewPanel\n\t\t\t\tisOpen={isOpen}\n\t\t\t\tonClose={handleClose}\n\t\t\t\tcontent={whatsNewContent}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\ttitle={title}\n\t\t\t\tsearchPlaceholder={searchPlaceholder}\n\t\t\t\temptyStateTitle={emptyStateTitle}\n\t\t\t\temptyStateDescription={emptyStateDescription}\n\t\t\t\tnoResultsText={noResultsText}\n\t\t\t\twidth={width}\n\t\t\t\tonContentClick={handleContentClick}\n\t\t\t\trenderCustomContent={renderCustomContent}\n\t\t\t/>\n\t\t</>\n\t);\n};\n"],"names":["WhatsNew","title","tooltip","searchPlaceholder","emptyStateTitle","emptyStateDescription","noResultsText","width","onContentClick","renderCustomContent","buttonTestId","iconWidth","iconHeight","iconColor","iconPadding","customIcon","isOpen","setIsOpen","useState","whatsNewContent","isLoading","newContentCount","useWhatsNewContext","jsxs","Fragment","jsx","WhatsNewButton","WhatsNewPanel","contentItem"],"mappings":";;;;;AA4BO,MAAMA,IAAoC,CAAC;AAAA,EACjD,OAAAC,IAAQ;AAAA,EACR,SAAAC,IAAU;AAAA,EACV,mBAAAC,IAAoB;AAAA,EACpB,iBAAAC,IAAkB;AAAA,EAClB,uBAAAC,IAAwB;AAAA,EACxB,eAAAC,IAAgB;AAAA,EAChB,OAAAC,IAAQ;AAAA,EACR,gBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AACD,MAAM;AACL,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GACpC,EAAE,iBAAAC,GAAiB,WAAAC,GAAW,iBAAAC,EAAA,IAAoBC,EAAA;AAcxD,SACC,gBAAAC,EAAAC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACA,SAfgB,MAAMT,EAAU,EAAI;AAAA,QAgBpC,iBAAAI;AAAA,QACA,QAAAL;AAAA,QACA,WAAAI;AAAA,QACA,SAAAlB;AAAA,QACA,QAAQQ;AAAA,QACR,WAAAC;AAAA,QACA,YAAAC;AAAA,QACA,WAAAC;AAAA,QACA,aAAAC;AAAA,QACA,YAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,IAED,gBAAAU;AAAA,MAACE;AAAA,MAAA;AAAA,QACA,QAAAX;AAAA,QACA,SA5BiB,MAAMC,EAAU,EAAK;AAAA,QA6BtC,SAASE;AAAA,QACT,WAAAC;AAAA,QACA,OAAAnB;AAAA,QACA,mBAAAE;AAAA,QACA,iBAAAC;AAAA,QACA,uBAAAC;AAAA,QACA,eAAAC;AAAA,QACA,OAAAC;AAAA,QACA,gBAnCwB,CAACqB,MAAiC;AAI5D,UAAIpB,KACHA,EAAeoB,CAAW;AAAA,QAE5B;AAAA,QA6BG,qBAAAnB;AAAA,MAAA;AAAA,IAAA;AAAA,EACD,GACD;AAEF;"}
@@ -36,7 +36,6 @@ export interface WhatsNewButtonProps {
36
36
  iconHeight?: number;
37
37
  iconColor?: string;
38
38
  iconPadding?: number;
39
- buttonSize?: number;
40
39
  customIcon?: React.ComponentType<{
41
40
  width?: number;
42
41
  height?: number;
@@ -1,25 +1,24 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import { COLORS as a } from "../../constants/Theme.js";
3
- import { WhatsNewIconContainer as x } from "./WhatsNew.styles.js";
4
- import { Tooltip as y } from "../tooltips/Tooltip.js";
5
- import { IconButton as u } from "../icon-button/IconButton.js";
6
- import w from "../../icons/Legacy - Bikayi specific/Services/Marketing.js";
7
- const j = ({
8
- onClick: d,
1
+ import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
+ import { COLORS as s } from "../../constants/Theme.js";
3
+ import { WhatsNewIconContainer as b } from "./WhatsNew.styles.js";
4
+ import { Tooltip as x } from "../tooltips/Tooltip.js";
5
+ import { IconButton as y } from "../icon-button/IconButton.js";
6
+ import u from "../../icons/Legacy - Bikayi specific/Services/Marketing.js";
7
+ const W = ({
8
+ onClick: a,
9
9
  newContentCount: i = 0,
10
10
  isOpen: o = !1,
11
- isLoading: c = !1,
12
- tooltip: h = "What's new",
13
- testId: l = "whats-new-button",
14
- iconWidth: m = 24,
15
- iconHeight: f = 24,
16
- iconColor: p,
17
- iconPadding: g,
18
- buttonSize: r = 24,
19
- customIcon: b
11
+ isLoading: d = !1,
12
+ tooltip: c = "What's new",
13
+ testId: h = "whats-new-button",
14
+ iconWidth: l = 24,
15
+ iconHeight: m = 24,
16
+ iconColor: f,
17
+ iconPadding: p,
18
+ customIcon: g
20
19
  }) => {
21
- if (c)
22
- return /* @__PURE__ */ s("div", { style: { margin: "0px 8px" }, children: [
20
+ if (d)
21
+ return /* @__PURE__ */ n("div", { style: { margin: "0px 8px" }, children: [
23
22
  /* @__PURE__ */ t(
24
23
  "div",
25
24
  {
@@ -40,37 +39,33 @@ const j = ({
40
39
  }
41
40
  ` })
42
41
  ] });
43
- const e = i > 99 ? "99+" : String(i), n = e.length >= 3 ? 20 : e.length === 2 ? 16 : 12;
44
- return /* @__PURE__ */ s(x, { count: i, children: [
45
- /* @__PURE__ */ t(y, { body: h, placement: "bottom", children: /* @__PURE__ */ t(
46
- u,
42
+ const e = i > 99 ? "99+" : String(i), r = e.length >= 3 ? 20 : e.length === 2 ? 16 : 12;
43
+ return /* @__PURE__ */ n(b, { count: i, children: [
44
+ /* @__PURE__ */ t(x, { body: c, placement: "bottom", children: /* @__PURE__ */ t(
45
+ y,
47
46
  {
48
- Icon: b ?? w,
49
- width: m,
50
- height: f,
51
- iconPadding: g,
47
+ Icon: g ?? u,
48
+ width: l,
49
+ height: m,
50
+ iconPadding: p,
52
51
  isSelected: o,
53
- iconColor: p ?? (o ? a.content.brand : a.content.primary),
54
- onClick: d,
55
- "data-testid": l,
56
- style: {
57
- width: r,
58
- height: r,
59
- boxSizing: "border-box"
60
- }
52
+ iconColor: f ?? (o ? s.content.brand : s.content.primary),
53
+ onClick: a,
54
+ "data-testid": h,
55
+ style: { width: 24, height: 24, boxSizing: "border-box" }
61
56
  }
62
57
  ) }),
63
58
  i > 0 && /* @__PURE__ */ t(
64
59
  "div",
65
60
  {
66
61
  className: "notification--count",
67
- style: { width: n, height: n },
62
+ style: { width: r, height: r },
68
63
  children: /* @__PURE__ */ t("div", { className: "count--text", children: e })
69
64
  }
70
65
  )
71
66
  ] });
72
67
  };
73
68
  export {
74
- j as WhatsNewButton
69
+ W as WhatsNewButton
75
70
  };
76
71
  //# sourceMappingURL=WhatsNewButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WhatsNewButton.js","sources":["../../../../src/components/whats-new/WhatsNewButton.tsx"],"sourcesContent":["import React from 'react';\nimport { COLORS } from '../../constants/Theme';\nimport { Marketing } from '../../icons';\nimport { IconButton } from '../icon-button';\nimport { Tooltip } from '../tooltips';\nimport { WhatsNewIconContainer } from './WhatsNew.styles';\nimport { WhatsNewButtonProps } from './WhatsNew.types';\n\nexport const WhatsNewButton: React.FC<WhatsNewButtonProps> = ({\n\tonClick,\n\tnewContentCount = 0,\n\tisOpen = false,\n\tisLoading = false,\n\ttooltip = \"What's new\",\n\ttestId = 'whats-new-button',\n\ticonWidth = 24,\n\ticonHeight = 24,\n\ticonColor,\n\ticonPadding,\n\tbuttonSize = 24,\n\tcustomIcon: CustomIcon,\n}) => {\n\tif (isLoading) {\n\t\treturn (\n\t\t\t<div style={{ margin: '0px 8px' }}>\n\t\t\t\t{/* Simple loading spinner */}\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\twidth: 16,\n\t\t\t\t\t\theight: 16,\n\t\t\t\t\t\tborder: '2px solid #f3f3f3',\n\t\t\t\t\t\tborderTop: '2px solid #731DCF',\n\t\t\t\t\t\tborderRadius: '50%',\n\t\t\t\t\t\tanimation: 'spin 1s linear infinite',\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<style>\n\t\t\t\t\t{`\n\t\t\t\t\t\t@keyframes spin {\n\t\t\t\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t\t\t\t}\n\t\t\t\t\t`}\n\t\t\t\t</style>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst badgeText = newContentCount > 99 ? '99+' : String(newContentCount);\n\t// diameter grows with digit count so the badge stays a perfect circle\n\tconst badgeSize =\n\t\tbadgeText.length >= 3 ? 20 : badgeText.length === 2 ? 16 : 12;\n\n\treturn (\n\t\t<WhatsNewIconContainer count={newContentCount}>\n\t\t\t<Tooltip body={tooltip} placement={'bottom'}>\n\t\t\t\t<IconButton\n\t\t\t\t\tIcon={\n\t\t\t\t\t\t(CustomIcon ?? Marketing) as React.FC<\n\t\t\t\t\t\t\tReact.SVGAttributes<SVGElement>\n\t\t\t\t\t\t>\n\t\t\t\t\t}\n\t\t\t\t\twidth={iconWidth}\n\t\t\t\t\theight={iconHeight}\n\t\t\t\t\ticonPadding={iconPadding}\n\t\t\t\t\tisSelected={isOpen}\n\t\t\t\t\ticonColor={\n\t\t\t\t\t\ticonColor ??\n\t\t\t\t\t\t(isOpen ? COLORS.content.brand : COLORS.content.primary)\n\t\t\t\t\t}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tdata-testid={testId}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\twidth: buttonSize,\n\t\t\t\t\t\theight: buttonSize,\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t\t{newContentCount > 0 && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"notification--count\"\n\t\t\t\t\tstyle={{ width: badgeSize, height: badgeSize }}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"count--text\">{badgeText}</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</WhatsNewIconContainer>\n\t);\n};\n"],"names":["WhatsNewButton","onClick","newContentCount","isOpen","isLoading","tooltip","testId","iconWidth","iconHeight","iconColor","iconPadding","buttonSize","CustomIcon","jsx","badgeText","badgeSize","jsxs","WhatsNewIconContainer","Tooltip","IconButton","Marketing","COLORS"],"mappings":";;;;;;AAQO,MAAMA,IAAgD,CAAC;AAAA,EAC7D,SAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU;AAAA,EACV,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,YAAYC;AACb,MAAM;AACL,MAAIR;AACH,6BACE,OAAA,EAAI,OAAO,EAAE,QAAQ,aAErB,UAAA;AAAA,MAAA,gBAAAS;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,OAAO;AAAA,YACN,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,QAAQ;AAAA,YACR,WAAW;AAAA,YACX,cAAc;AAAA,YACd,WAAW;AAAA,UAAA;AAAA,QACZ;AAAA,MAAA;AAAA,wBAEA,SAAA,EACC,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAA,CAMF;AAAA,IAAA,GACD;AAIF,QAAMC,IAAYZ,IAAkB,KAAK,QAAQ,OAAOA,CAAe,GAEjEa,IACLD,EAAU,UAAU,IAAI,KAAKA,EAAU,WAAW,IAAI,KAAK;AAE5D,SACC,gBAAAE,EAACC,GAAA,EAAsB,OAAOf,GAC7B,UAAA;AAAA,IAAA,gBAAAW,EAACK,GAAA,EAAQ,MAAMb,GAAS,WAAW,UAClC,UAAA,gBAAAQ;AAAA,MAACM;AAAA,MAAA;AAAA,QACA,MACEP,KAAcQ;AAAAA,QAIhB,OAAOb;AAAA,QACP,QAAQC;AAAA,QACR,aAAAE;AAAA,QACA,YAAYP;AAAA,QACZ,WACCM,MACCN,IAASkB,EAAO,QAAQ,QAAQA,EAAO,QAAQ;AAAA,QAEjD,SAAApB;AAAA,QACA,eAAaK;AAAA,QACb,OAAO;AAAA,UACN,OAAOK;AAAA,UACP,QAAQA;AAAA,UACR,WAAW;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA,GAEF;AAAA,IACCT,IAAkB,KAClB,gBAAAW;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,WAAU;AAAA,QACV,OAAO,EAAE,OAAOE,GAAW,QAAQA,EAAA;AAAA,QAEnC,UAAA,gBAAAF,EAAC,OAAA,EAAI,WAAU,eAAe,UAAAC,EAAA,CAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EACzC,GAEF;AAEF;"}
1
+ {"version":3,"file":"WhatsNewButton.js","sources":["../../../../src/components/whats-new/WhatsNewButton.tsx"],"sourcesContent":["import React from 'react';\nimport { COLORS } from '../../constants/Theme';\nimport { Marketing } from '../../icons';\nimport { IconButton } from '../icon-button';\nimport { Tooltip } from '../tooltips';\nimport { WhatsNewIconContainer } from './WhatsNew.styles';\nimport { WhatsNewButtonProps } from './WhatsNew.types';\n\nexport const WhatsNewButton: React.FC<WhatsNewButtonProps> = ({\n\tonClick,\n\tnewContentCount = 0,\n\tisOpen = false,\n\tisLoading = false,\n\ttooltip = \"What's new\",\n\ttestId = 'whats-new-button',\n\ticonWidth = 24,\n\ticonHeight = 24,\n\ticonColor,\n\ticonPadding,\n\tcustomIcon: CustomIcon,\n}) => {\n\tif (isLoading) {\n\t\treturn (\n\t\t\t<div style={{ margin: '0px 8px' }}>\n\t\t\t\t{/* Simple loading spinner */}\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\twidth: 16,\n\t\t\t\t\t\theight: 16,\n\t\t\t\t\t\tborder: '2px solid #f3f3f3',\n\t\t\t\t\t\tborderTop: '2px solid #731DCF',\n\t\t\t\t\t\tborderRadius: '50%',\n\t\t\t\t\t\tanimation: 'spin 1s linear infinite',\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<style>\n\t\t\t\t\t{`\n\t\t\t\t\t\t@keyframes spin {\n\t\t\t\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t\t\t\t}\n\t\t\t\t\t`}\n\t\t\t\t</style>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst badgeText = newContentCount > 99 ? '99+' : String(newContentCount);\n\t// diameter grows with digit count so the badge stays a perfect circle\n\tconst badgeSize =\n\t\tbadgeText.length >= 3 ? 20 : badgeText.length === 2 ? 16 : 12;\n\n\treturn (\n\t\t<WhatsNewIconContainer count={newContentCount}>\n\t\t\t<Tooltip body={tooltip} placement={'bottom'}>\n\t\t\t\t<IconButton\n\t\t\t\t\tIcon={\n\t\t\t\t\t\t(CustomIcon ?? Marketing) as React.FC<\n\t\t\t\t\t\t\tReact.SVGAttributes<SVGElement>\n\t\t\t\t\t\t>\n\t\t\t\t\t}\n\t\t\t\t\twidth={iconWidth}\n\t\t\t\t\theight={iconHeight}\n\t\t\t\t\ticonPadding={iconPadding}\n\t\t\t\t\tisSelected={isOpen}\n\t\t\t\t\ticonColor={\n\t\t\t\t\t\ticonColor ??\n\t\t\t\t\t\t(isOpen ? COLORS.content.brand : COLORS.content.primary)\n\t\t\t\t\t}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tdata-testid={testId}\n\t\t\t\t\tstyle={{ width: 24, height: 24, boxSizing: 'border-box' }}\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t\t{newContentCount > 0 && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"notification--count\"\n\t\t\t\t\tstyle={{ width: badgeSize, height: badgeSize }}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"count--text\">{badgeText}</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</WhatsNewIconContainer>\n\t);\n};\n"],"names":["WhatsNewButton","onClick","newContentCount","isOpen","isLoading","tooltip","testId","iconWidth","iconHeight","iconColor","iconPadding","CustomIcon","jsx","badgeText","badgeSize","jsxs","WhatsNewIconContainer","Tooltip","IconButton","Marketing","COLORS"],"mappings":";;;;;;AAQO,MAAMA,IAAgD,CAAC;AAAA,EAC7D,SAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU;AAAA,EACV,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAYC;AACb,MAAM;AACL,MAAIP;AACH,6BACE,OAAA,EAAI,OAAO,EAAE,QAAQ,aAErB,UAAA;AAAA,MAAA,gBAAAQ;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,OAAO;AAAA,YACN,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,QAAQ;AAAA,YACR,WAAW;AAAA,YACX,cAAc;AAAA,YACd,WAAW;AAAA,UAAA;AAAA,QACZ;AAAA,MAAA;AAAA,wBAEA,SAAA,EACC,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAA,CAMF;AAAA,IAAA,GACD;AAIF,QAAMC,IAAYX,IAAkB,KAAK,QAAQ,OAAOA,CAAe,GAEjEY,IACLD,EAAU,UAAU,IAAI,KAAKA,EAAU,WAAW,IAAI,KAAK;AAE5D,SACC,gBAAAE,EAACC,GAAA,EAAsB,OAAOd,GAC7B,UAAA;AAAA,IAAA,gBAAAU,EAACK,GAAA,EAAQ,MAAMZ,GAAS,WAAW,UAClC,UAAA,gBAAAO;AAAA,MAACM;AAAA,MAAA;AAAA,QACA,MACEP,KAAcQ;AAAAA,QAIhB,OAAOZ;AAAA,QACP,QAAQC;AAAA,QACR,aAAAE;AAAA,QACA,YAAYP;AAAA,QACZ,WACCM,MACCN,IAASiB,EAAO,QAAQ,QAAQA,EAAO,QAAQ;AAAA,QAEjD,SAAAnB;AAAA,QACA,eAAaK;AAAA,QACb,OAAO,EAAE,OAAO,IAAI,QAAQ,IAAI,WAAW,aAAA;AAAA,MAAa;AAAA,IAAA,GAE1D;AAAA,IACCJ,IAAkB,KAClB,gBAAAU;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,WAAU;AAAA,QACV,OAAO,EAAE,OAAOE,GAAW,QAAQA,EAAA;AAAA,QAEnC,UAAA,gBAAAF,EAAC,OAAA,EAAI,WAAU,eAAe,UAAAC,EAAA,CAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EACzC,GAEF;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CharacterLimitExtension.js","sources":["../../../../../src/editor/extensions/characterLimit/CharacterLimitExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport type { Node as PMNode } from '@tiptap/pm/model';\nimport { Plugin, PluginKey } from '@tiptap/pm/state';\nimport { Decoration, DecorationSet } from '@tiptap/pm/view';\n\nexport interface CharacterLimitOptions {\n\t/** Soft character limit. 0 / undefined disables the extension entirely. */\n\tlimit: number;\n}\n\n/**\n * Soft character limit with two behaviours (see CRM design):\n *\n * 1. Typing is BLOCKED once the content is at/over the limit — `handleTextInput`\n * rejects the insertion. This never fires for paste (paste flows through the\n * clipboard pipeline), so paste is free to push the content over the limit.\n * 2. Every character BEYOND the limit is decorated with `bik-editor-overflow`\n * (rendered grey) so pasted overflow is visible but clearly marked.\n *\n * Counting mirrors `extractContent` exactly — `doc.textBetween(0, size, '\\n\\n',\n * '\\n')` — so the grey boundary lines up with the `characterCount` the consumer\n * shows in its error message (paragraph break = 2 chars, soft break = 1 char).\n */\nexport const CharacterLimitExtension = Extension.create<CharacterLimitOptions>({\n\tname: 'characterLimitOverflow',\n\n\taddOptions() {\n\t\treturn { limit: 0 };\n\t},\n\n\taddProseMirrorPlugins() {\n\t\tconst limit = this.options.limit;\n\t\tif (!limit || limit <= 0) return [];\n\n\t\t// Same metric as BikEditor.utils.extractContent → keeps the grey boundary\n\t\t// and the consumer's characterCount in sync.\n\t\tconst countChars = (doc: PMNode) =>\n\t\t\tdoc.textBetween(0, doc.content.size, '\\n\\n', '\\n').length;\n\n\t\treturn [\n\t\t\tnew Plugin({\n\t\t\t\tkey: new PluginKey('characterLimitOverflow'),\n\t\t\t\tprops: {\n\t\t\t\t\t// Block typed/composed input that would exceed the limit. Replacing\n\t\t\t\t\t// a selection is allowed as long as the result still fits.\n\t\t\t\t\thandleTextInput(view, from, to, text) {\n\t\t\t\t\t\tconst doc = view.state.doc;\n\t\t\t\t\t\tconst current = countChars(doc);\n\t\t\t\t\t\tconst removed = doc.textBetween(from, to, '\\n\\n', '\\n').length;\n\t\t\t\t\t\treturn current - removed + text.length > limit;\n\t\t\t\t\t},\n\t\t\t\t\tdecorations(state) {\n\t\t\t\t\t\tconst decorations: Decoration[] = [];\n\t\t\t\t\t\tlet count = 0;\n\t\t\t\t\t\tlet overflowing = false;\n\n\t\t\t\t\t\tstate.doc.descendants((node, pos, parent, index) => {\n\t\t\t\t\t\t\t// Account for the \"\\n\\n\" separator inserted between top-level\n\t\t\t\t\t\t\t// blocks so the boundary matches textBetween's counting.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!overflowing &&\n\t\t\t\t\t\t\t\tparent &&\n\t\t\t\t\t\t\t\tparent.type.name === 'doc' &&\n\t\t\t\t\t\t\t\tindex > 0\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcount += 2;\n\t\t\t\t\t\t\t\tif (count > limit) overflowing = true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (node.isText && node.text) {\n\t\t\t\t\t\t\t\tconst len = node.text.length;\n\t\t\t\t\t\t\t\tif (overflowing) {\n\t\t\t\t\t\t\t\t\tdecorations.push(\n\t\t\t\t\t\t\t\t\t\tDecoration.inline(pos, pos + len, {\n\t\t\t\t\t\t\t\t\t\t\tclass: 'bik-editor-overflow',\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else if (count + len > limit) {\n\t\t\t\t\t\t\t\t\tconst startOffset = Math.max(0, limit - count);\n\t\t\t\t\t\t\t\t\tdecorations.push(\n\t\t\t\t\t\t\t\t\t\tDecoration.inline(pos + startOffset, pos + len, {\n\t\t\t\t\t\t\t\t\t\t\tclass: 'bik-editor-overflow',\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\toverflowing = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcount += len;\n\t\t\t\t\t\t\t} else if (node.type.name === 'hardBreak') {\n\t\t\t\t\t\t\t\t// Soft line break → \"\\n\" (1 char) in textBetween.\n\t\t\t\t\t\t\t\tcount += 1;\n\t\t\t\t\t\t\t\tif (!overflowing && count > limit) overflowing = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn DecorationSet.create(state.doc, decorations);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t];\n\t},\n});\n"],"names":["CharacterLimitExtension","Extension","limit","countChars","doc","Plugin","PluginKey","view","from","to","text","current","removed","state","decorations","count","overflowing","node","pos","parent","index","len","Decoration","startOffset","DecorationSet"],"mappings":";;;AAuBO,MAAMA,IAA0BC,EAAU,OAA8B;AAAA,EAC9E,MAAM;AAAA,EAEN,aAAa;AACZ,WAAO,EAAE,OAAO,EAAA;AAAA,EACjB;AAAA,EAEA,wBAAwB;AACvB,UAAMC,IAAQ,KAAK,QAAQ;AAC3B,QAAI,CAACA,KAASA,KAAS,UAAU,CAAA;AAIjC,UAAMC,IAAa,CAACC,MACnBA,EAAI,YAAY,GAAGA,EAAI,QAAQ,MAAM;AAAA;AAAA,GAAQ;AAAA,CAAI,EAAE;AAEpD,WAAO;AAAA,MACN,IAAIC,EAAO;AAAA,QACV,KAAK,IAAIC,EAAU,wBAAwB;AAAA,QAC3C,OAAO;AAAA;AAAA;AAAA,UAGN,gBAAgBC,GAAMC,GAAMC,GAAIC,GAAM;AACrC,kBAAMN,IAAMG,EAAK,MAAM,KACjBI,IAAUR,EAAWC,CAAG,GACxBQ,IAAUR,EAAI,YAAYI,GAAMC,GAAI;AAAA;AAAA,GAAQ;AAAA,CAAI,EAAE;AACxD,mBAAOE,IAAUC,IAAUF,EAAK,SAASR;AAAA,UAC1C;AAAA,UACA,YAAYW,GAAO;AAClB,kBAAMC,IAA4B,CAAA;AAClC,gBAAIC,IAAQ,GACRC,IAAc;AAElB,mBAAAH,EAAM,IAAI,YAAY,CAACI,GAAMC,GAAKC,GAAQC,MAAU;AAanD,kBATC,CAACJ,KACDG,KACAA,EAAO,KAAK,SAAS,SACrBC,IAAQ,MAERL,KAAS,GACLA,IAAQb,MAAOc,IAAc,MAG9BC,EAAK,UAAUA,EAAK,MAAM;AAC7B,sBAAMI,IAAMJ,EAAK,KAAK;AACtB,oBAAID;AACH,kBAAAF,EAAY;AAAA,oBACXQ,EAAW,OAAOJ,GAAKA,IAAMG,GAAK;AAAA,sBACjC,OAAO;AAAA,oBAAA,CACP;AAAA,kBAAA;AAAA,yBAEQN,IAAQM,IAAMnB,GAAO;AAC/B,wBAAMqB,IAAc,KAAK,IAAI,GAAGrB,IAAQa,CAAK;AAC7C,kBAAAD,EAAY;AAAA,oBACXQ,EAAW,OAAOJ,IAAMK,GAAaL,IAAMG,GAAK;AAAA,sBAC/C,OAAO;AAAA,oBAAA,CACP;AAAA,kBAAA,GAEFL,IAAc;AAAA,gBACf;AACA,gBAAAD,KAASM;AAAA,cACV,MAAA,CAAWJ,EAAK,KAAK,SAAS,gBAE7BF,KAAS,GACL,CAACC,KAAeD,IAAQb,MAAOc,IAAc;AAElD,qBAAO;AAAA,YACR,CAAC,GAEMQ,EAAc,OAAOX,EAAM,KAAKC,CAAW;AAAA,UACnD;AAAA,QAAA;AAAA,MACD,CACA;AAAA,IAAA;AAAA,EAEH;AACD,CAAC;"}
1
+ {"version":3,"file":"CharacterLimitExtension.js","sources":["../../../../../src/editor/extensions/characterLimit/CharacterLimitExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport { Plugin, PluginKey } from '@tiptap/pm/state';\nimport { Decoration, DecorationSet } from '@tiptap/pm/view';\nimport type { Node as PMNode } from '@tiptap/pm/model';\n\nexport interface CharacterLimitOptions {\n\t/** Soft character limit. 0 / undefined disables the extension entirely. */\n\tlimit: number;\n}\n\n/**\n * Soft character limit with two behaviours (see CRM design):\n *\n * 1. Typing is BLOCKED once the content is at/over the limit — `handleTextInput`\n * rejects the insertion. This never fires for paste (paste flows through the\n * clipboard pipeline), so paste is free to push the content over the limit.\n * 2. Every character BEYOND the limit is decorated with `bik-editor-overflow`\n * (rendered grey) so pasted overflow is visible but clearly marked.\n *\n * Counting mirrors `extractContent` exactly — `doc.textBetween(0, size, '\\n\\n',\n * '\\n')` — so the grey boundary lines up with the `characterCount` the consumer\n * shows in its error message (paragraph break = 2 chars, soft break = 1 char).\n */\nexport const CharacterLimitExtension = Extension.create<CharacterLimitOptions>({\n\tname: 'characterLimitOverflow',\n\n\taddOptions() {\n\t\treturn { limit: 0 };\n\t},\n\n\taddProseMirrorPlugins() {\n\t\tconst limit = this.options.limit;\n\t\tif (!limit || limit <= 0) return [];\n\n\t\t// Same metric as BikEditor.utils.extractContent → keeps the grey boundary\n\t\t// and the consumer's characterCount in sync.\n\t\tconst countChars = (doc: PMNode) =>\n\t\t\tdoc.textBetween(0, doc.content.size, '\\n\\n', '\\n').length;\n\n\t\treturn [\n\t\t\tnew Plugin({\n\t\t\t\tkey: new PluginKey('characterLimitOverflow'),\n\t\t\t\tprops: {\n\t\t\t\t\t// Block typed/composed input that would exceed the limit. Replacing\n\t\t\t\t\t// a selection is allowed as long as the result still fits.\n\t\t\t\t\thandleTextInput(view, from, to, text) {\n\t\t\t\t\t\tconst doc = view.state.doc;\n\t\t\t\t\t\tconst current = countChars(doc);\n\t\t\t\t\t\tconst removed = doc.textBetween(from, to, '\\n\\n', '\\n').length;\n\t\t\t\t\t\treturn current - removed + text.length > limit;\n\t\t\t\t\t},\n\t\t\t\t\tdecorations(state) {\n\t\t\t\t\t\tconst decorations: Decoration[] = [];\n\t\t\t\t\t\tlet count = 0;\n\t\t\t\t\t\tlet overflowing = false;\n\n\t\t\t\t\t\tstate.doc.descendants((node, pos, parent, index) => {\n\t\t\t\t\t\t\t// Account for the \"\\n\\n\" separator inserted between top-level\n\t\t\t\t\t\t\t// blocks so the boundary matches textBetween's counting.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!overflowing &&\n\t\t\t\t\t\t\t\tparent &&\n\t\t\t\t\t\t\t\tparent.type.name === 'doc' &&\n\t\t\t\t\t\t\t\tindex > 0\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcount += 2;\n\t\t\t\t\t\t\t\tif (count > limit) overflowing = true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (node.isText && node.text) {\n\t\t\t\t\t\t\t\tconst len = node.text.length;\n\t\t\t\t\t\t\t\tif (overflowing) {\n\t\t\t\t\t\t\t\t\tdecorations.push(\n\t\t\t\t\t\t\t\t\t\tDecoration.inline(pos, pos + len, {\n\t\t\t\t\t\t\t\t\t\t\tclass: 'bik-editor-overflow',\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else if (count + len > limit) {\n\t\t\t\t\t\t\t\t\tconst startOffset = Math.max(0, limit - count);\n\t\t\t\t\t\t\t\t\tdecorations.push(\n\t\t\t\t\t\t\t\t\t\tDecoration.inline(pos + startOffset, pos + len, {\n\t\t\t\t\t\t\t\t\t\t\tclass: 'bik-editor-overflow',\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\toverflowing = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcount += len;\n\t\t\t\t\t\t\t} else if (node.type.name === 'hardBreak') {\n\t\t\t\t\t\t\t\t// Soft line break → \"\\n\" (1 char) in textBetween.\n\t\t\t\t\t\t\t\tcount += 1;\n\t\t\t\t\t\t\t\tif (!overflowing && count > limit) overflowing = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn DecorationSet.create(state.doc, decorations);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t];\n\t},\n});\n"],"names":["CharacterLimitExtension","Extension","limit","countChars","doc","Plugin","PluginKey","view","from","to","text","current","removed","state","decorations","count","overflowing","node","pos","parent","index","len","Decoration","startOffset","DecorationSet"],"mappings":";;;AAuBO,MAAMA,IAA0BC,EAAU,OAA8B;AAAA,EAC9E,MAAM;AAAA,EAEN,aAAa;AACZ,WAAO,EAAE,OAAO,EAAA;AAAA,EACjB;AAAA,EAEA,wBAAwB;AACvB,UAAMC,IAAQ,KAAK,QAAQ;AAC3B,QAAI,CAACA,KAASA,KAAS,UAAU,CAAA;AAIjC,UAAMC,IAAa,CAACC,MACnBA,EAAI,YAAY,GAAGA,EAAI,QAAQ,MAAM;AAAA;AAAA,GAAQ;AAAA,CAAI,EAAE;AAEpD,WAAO;AAAA,MACN,IAAIC,EAAO;AAAA,QACV,KAAK,IAAIC,EAAU,wBAAwB;AAAA,QAC3C,OAAO;AAAA;AAAA;AAAA,UAGN,gBAAgBC,GAAMC,GAAMC,GAAIC,GAAM;AACrC,kBAAMN,IAAMG,EAAK,MAAM,KACjBI,IAAUR,EAAWC,CAAG,GACxBQ,IAAUR,EAAI,YAAYI,GAAMC,GAAI;AAAA;AAAA,GAAQ;AAAA,CAAI,EAAE;AACxD,mBAAOE,IAAUC,IAAUF,EAAK,SAASR;AAAA,UAC1C;AAAA,UACA,YAAYW,GAAO;AAClB,kBAAMC,IAA4B,CAAA;AAClC,gBAAIC,IAAQ,GACRC,IAAc;AAElB,mBAAAH,EAAM,IAAI,YAAY,CAACI,GAAMC,GAAKC,GAAQC,MAAU;AAanD,kBATC,CAACJ,KACDG,KACAA,EAAO,KAAK,SAAS,SACrBC,IAAQ,MAERL,KAAS,GACLA,IAAQb,MAAOc,IAAc,MAG9BC,EAAK,UAAUA,EAAK,MAAM;AAC7B,sBAAMI,IAAMJ,EAAK,KAAK;AACtB,oBAAID;AACH,kBAAAF,EAAY;AAAA,oBACXQ,EAAW,OAAOJ,GAAKA,IAAMG,GAAK;AAAA,sBACjC,OAAO;AAAA,oBAAA,CACP;AAAA,kBAAA;AAAA,yBAEQN,IAAQM,IAAMnB,GAAO;AAC/B,wBAAMqB,IAAc,KAAK,IAAI,GAAGrB,IAAQa,CAAK;AAC7C,kBAAAD,EAAY;AAAA,oBACXQ,EAAW,OAAOJ,IAAMK,GAAaL,IAAMG,GAAK;AAAA,sBAC/C,OAAO;AAAA,oBAAA,CACP;AAAA,kBAAA,GAEFL,IAAc;AAAA,gBACf;AACA,gBAAAD,KAASM;AAAA,cACV,MAAA,CAAWJ,EAAK,KAAK,SAAS,gBAE7BF,KAAS,GACL,CAACC,KAAeD,IAAQb,MAAOc,IAAc;AAElD,qBAAO;AAAA,YACR,CAAC,GAEMQ,EAAc,OAAOX,EAAM,KAAKC,CAAW;AAAA,UACnD;AAAA,QAAA;AAAA,MACD,CACA;AAAA,IAAA;AAAA,EAEH;AACD,CAAC;"}
@@ -1,44 +1,44 @@
1
- export { Send, Activate, Code, Cross, Deactivate, Delete, Edit, Forward, Fullscreen, LinkSimpleHorizontal, Minus, Plus, ProductTour, RestApi, Save, SendAirplane, ShareAndroid, Shortcut, Task, } from './Actions/Common actions';
2
- export { CheckboxIcon, Copy, DecreaseIndent, Dropdown, IncreaseIndent, MultiLine, MultiSelect, Number, NumberList, Quotes, Subscript, Superscript, TextBold, Text, TextAlignCenter, TextAlignLeft, TextAlignRight, TextItalics, TextJustify, TextStrikethrough, TextUnderline, Textbox, } from './Actions/Formatting';
3
- export { ArrowRedo, ArrowUndo, LogIn, LogOut, OpenNewWindow, Refresh, Rewind, Sync, Whatsapp, } from './Actions/Navigation';
1
+ export { Send, Activate, Code, Cross, Deactivate, Delete, Edit, Forward, Fullscreen, LinkSimpleHorizontal, Minus, Plus, ProductTour, RestApi, Save, SendAirplane, ShareAndroid, Shortcut, Task } from './Actions/Common actions';
2
+ export { CheckboxIcon, Copy, DecreaseIndent, Dropdown, IncreaseIndent, MultiLine, MultiSelect, Number, NumberList, Quotes, Subscript, Superscript, TextBold, Text, TextAlignCenter, TextAlignLeft, TextAlignRight, TextItalics, TextJustify, TextStrikethrough, TextUnderline, Textbox } from './Actions/Formatting';
3
+ export { ArrowRedo, ArrowUndo, LogIn, LogOut, OpenNewWindow, Refresh, Rewind, Sync, Whatsapp } from './Actions/Navigation';
4
4
  export { HandleDrag, SingleChoice } from './Actions/Selection';
5
5
  export { CaratDown, CaratLeft, CaratRight, CaratUp } from './Arrows/Carat';
6
- export { ChevronDown, ChevronLeft, ChevronRight, ChevronUp, } from './Arrows/Chevron';
7
- export { ChevronDoubleDown, ChevronDoubleLeft, ChevronDoubleRight, ChevronDoubleUp, } from './Arrows/Double chevron';
8
- export { ArrowDown, ArrowDownLeft, ArrowDownRight, ArrowLeft, ArrowRight, ArrowUp, ArrowUpLeft, ArrowUpRight, } from './Arrows/Normal arrows';
6
+ export { ChevronDown, ChevronLeft, ChevronRight, ChevronUp } from './Arrows/Chevron';
7
+ export { ChevronDoubleDown, ChevronDoubleLeft, ChevronDoubleRight, ChevronDoubleUp } from './Arrows/Double chevron';
8
+ export { ArrowDown, ArrowDownLeft, ArrowDownRight, ArrowLeft, ArrowRight, ArrowUp, ArrowUpLeft, ArrowUpRight } from './Arrows/Normal arrows';
9
9
  export { ArrowSwitch } from './Arrows/Special';
10
- export { AiIcon, Webhook, AiEmoji, AiRobot, Expand, Frame27389, Frame27597, Frame27598, Frame27599, GeminiSparkle, ManifestSparkle, PricePlease, Shape, Shorter, Sparkling2Line, WandSparkles, Write, } from './BIK AI specific';
11
- export { Bell, BellSync, Bulb, Forms, MenuHamburger, MessageSearch, MoreHorizontal, MoreVertical, Placeholder, Search, Settings, Training, } from './Informational/Common UI';
12
- export { Chat, ChatCheck, ChatQuestion, ChatStar, Email, LiveChat, Phone, } from './Informational/Communication';
13
- export { ClipboardCheck, Experimental, Help, Percent, Purchase, Services, ShoppingCart, Unsatisfactory, UserSound, } from './Informational/Customer intent';
10
+ export { AiIcon, Webhook, AiEmoji, AiRobot, Expand, Frame27389, Frame27597, Frame27598, Frame27599, GeminiSparkle, ManifestSparkle, PricePlease, Shape, Shorter, Sparkling2Line, WandSparkles, Write } from './BIK AI specific';
11
+ export { Bell, BellSync, Bulb, Forms, MenuHamburger, MessageSearch, MoreHorizontal, MoreVertical, Placeholder, Search, Settings, Training } from './Informational/Common UI';
12
+ export { Chat, ChatCheck, ChatQuestion, ChatStar, Email, LiveChat, Phone } from './Informational/Communication';
13
+ export { ClipboardCheck, Experimental, Help, Percent, Purchase, Services, ShoppingCart, Unsatisfactory, UserSound } from './Informational/Customer intent';
14
14
  export { SingleChoice as SingleChoice2 } from './Informational/Customer intent';
15
- export { CalendarCheck, Calendar, CalendarAdd, Clock, HourGlass, WorkingHours, } from './Informational/Date and time';
16
- export { AddLabel, Click, Filter, Gift1, GiftMinus, GiftPlus, Promocode, Receipt, ShieldCheck, ShoppingBag, ShoppingBasket, } from './Informational/eCommerce';
15
+ export { CalendarCheck, Calendar, CalendarAdd, Clock, HourGlass, WorkingHours } from './Informational/Date and time';
16
+ export { AddLabel, Click, Filter, Gift1, GiftMinus, GiftPlus, Promocode, Receipt, ShieldCheck, ShoppingBag, ShoppingBasket } from './Informational/eCommerce';
17
17
  export { ShoppingCart as ShoppingCart2 } from './Informational/eCommerce';
18
- export { Archive1, Excel, File, FileCsv, FilePage, FilePdf, Folder, MediaMessage, Move, OrderHistory, PrivateNote, TextMessage, Unarchive, } from './Informational/Files and folders';
19
- export { Bank, CashOnDelivery, ChartLine, CreditCard, Growth, Money1, NoCredits, Rupee, TablerTicket, Wallet, } from './Informational/Finance';
18
+ export { Archive1, Excel, File, FileCsv, FilePage, FilePdf, Folder, MediaMessage, Move, OrderHistory, PrivateNote, TextMessage, Unarchive } from './Informational/Files and folders';
19
+ export { Bank, CashOnDelivery, ChartLine, CreditCard, Growth, Money1, NoCredits, Rupee, TablerTicket, Wallet } from './Informational/Finance';
20
20
  export { Percent as Percent2 } from './Informational/Finance';
21
- export { BookOpenText, TicketV2, AlertTriangle, Check, CheckDouble, CloseTicket1, Error, FailDoc, IcList, Info, Merge, NewTicket, RoundCheck, Slash, } from './Informational/General';
21
+ export { BookOpenText, TicketV2, AlertTriangle, Check, CheckDouble, CloseTicket1, Error, FailDoc, IcList, Info, Merge, NewTicket, RoundCheck, Slash } from './Informational/General';
22
22
  export { Help as Help2 } from './Informational/General';
23
- export { User, Chatbot, Contacts, Group, IdCard, Person, Robot, Union, Union1, UserMinus1, UserPlus, } from './Informational/Identity';
24
- export { Address, LanguageChange, MapPin, Truck, } from './Informational/Location';
25
- export { AllProduct, Clipboard, CustomerReport, Head112, InventoryReport, LegalBalance, OrderReport, PaymentReport, Store, StoreSync, TicketForm, } from './Informational/Store related';
23
+ export { User, Chatbot, Contacts, Group, IdCard, Person, Robot, Union, Union1, UserMinus1, UserPlus } from './Informational/Identity';
24
+ export { Address, LanguageChange, MapPin, Truck } from './Informational/Location';
25
+ export { AllProduct, Clipboard, CustomerReport, Head112, InventoryReport, LegalBalance, OrderReport, PaymentReport, Store, StoreSync, TicketForm } from './Informational/Store related';
26
26
  export { ClipboardCheck as ClipboardCheck2 } from './Informational/Store related';
27
27
  export { Box, Box2 } from './Legacy - Bikayi specific/Categories';
28
28
  export { Journeys } from './Legacy - Bikayi specific/Navigation';
29
29
  export { Services as Services2 } from './Legacy - Bikayi specific/Navigation';
30
30
  export { PlanUltimate } from './Legacy - Bikayi specific/Plans';
31
- export { Businesscard, Customdomain, LoudSpeaker, Marketing, PaymentLink, Theme, } from './Legacy - Bikayi specific/Services';
32
- export { Microphone, Pause, Play, Sleep, VolumeMute, VolumeOneline, VolumeTwoline, } from './Media/Audio';
31
+ export { Businesscard, Customdomain, LoudSpeaker, Marketing, PaymentLink, Theme } from './Legacy - Bikayi specific/Services';
32
+ export { Microphone, Pause, Play, Sleep, VolumeMute, VolumeOneline, VolumeTwoline } from './Media/Audio';
33
33
  export { Desktop, Smartphone } from './Media/Devices';
34
- export { BarcodeScan, Download, EmojiSmile, Paperclip, Upload, } from './Media/Others';
35
- export { Frame26086263, Camera, CameraAdd, Crop, FlashOff, FlashOn, FormkitHappy, IconTrailing, Image, ImageAdd, Images, Maximize, RotateAnticlockwise, RotateClockwise, VideoCamcorder, VideoFilm, } from './Media/Visual';
36
- export { EmailMarketingV2, EmailV2, FacebookCommentV2, FacebookV2, GmailV2, InstagramCommentV2, InstagramV2, MessengerV2, PhoneV2, RcsV2, SmsV2, TaskV2, WebpushV2, WhatsAppCallV2, WhatsAppV2, Bigcommerce, EmailMarketing, Facebook, FacebookComment, Instagram, InstagramIcon, Messenger, MonoFacebookComment, MonoFacebook, MonoInstagram, MonoInstagramComment, MonoMail, MonoMessenger, MonoPhone, MonoTasks, MonoWhatsapp, ShopifyBrand, Tasks, WebPush, WhatsApp, } from './Social/Channels';
34
+ export { BarcodeScan, Download, EmojiSmile, Paperclip, Upload } from './Media/Others';
35
+ export { Frame26086263, Camera, CameraAdd, Crop, FlashOff, FlashOn, FormkitHappy, IconTrailing, Image, ImageAdd, Images, Maximize, RotateAnticlockwise, RotateClockwise, VideoCamcorder, VideoFilm } from './Media/Visual';
36
+ export { EmailMarketingV2, EmailV2, FacebookCommentV2, FacebookV2, GmailV2, InstagramCommentV2, InstagramV2, MessengerV2, PhoneV2, RcsV2, SmsV2, TaskV2, WebpushV2, WhatsAppCallV2, WhatsAppV2, Bigcommerce, EmailMarketing, Facebook, FacebookComment, Instagram, InstagramIcon, Messenger, MonoFacebookComment, MonoFacebook, MonoInstagram, MonoInstagramComment, MonoMail, MonoMessenger, MonoPhone, MonoTasks, MonoWhatsapp, ShopifyBrand, Tasks, WebPush, WhatsApp } from './Social/Channels';
37
37
  export { Email as Email2 } from './Social/Channels';
38
- export { SlackIcon, BigCommerce, Google, Gorgias, Kustomer, Rcs, ShopifyDefault, Twitter, Website, WooCommerce, Youtube, Zendesk, } from './Social/Social';
38
+ export { SlackIcon, BigCommerce, Google, Gorgias, Kustomer, Rcs, ShopifyDefault, Twitter, Website, WooCommerce, Youtube, Zendesk } from './Social/Social';
39
39
  export { EmailMarketing as EmailMarketing2 } from './Social/Social';
40
40
  export { Facebook as Facebook2 } from './Social/Social';
41
41
  export { Instagram as Instagram2 } from './Social/Social';
42
42
  export { Messenger as Messenger2 } from './Social/Social';
43
43
  export { Whatsapp as Whatsapp2 } from './Social/Social';
44
- export { Eye, EyeClosed, EyeOff, HeartEmpty, HeartFilled, Lock, StarEmpty, StarFilled, StarHalf, Unlock, } from './Toggles/General';
44
+ export { Eye, EyeClosed, EyeOff, HeartEmpty, HeartFilled, Lock, StarEmpty, StarFilled, StarHalf, Unlock } from './Toggles/General';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.835-beta.2",
3
+ "version": "0.0.835",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -64,7 +64,7 @@
64
64
  "not op_mini all"
65
65
  ],
66
66
  "dependencies": {
67
- "@bikdotai/bik-models": "11.26.1",
67
+ "@bikdotai/bik-models": "11.26.0",
68
68
  "@hello-pangea/dnd": "^18.0.1",
69
69
  "@popperjs/core": "^2.11.7",
70
70
  "@tippyjs/react": "^4.2.6",
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=(s,e=1)=>{let r=s.replace("#","");r.length===3&&(r=`${r[0]}${r[0]}${r[1]}${r[1]}${r[2]}${r[2]}`);const t=parseInt(r.substring(0,2),16),n=parseInt(r.substring(2,4),16),g=parseInt(r.substring(4,6),16);return e>1&&e<=100&&(e=e/100),`rgba(${t}, ${n}, ${g}, ${e})`};exports.rgba=$;
2
- //# sourceMappingURL=rgba.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rgba.js","sources":["../../../src/utils/rgba.ts"],"sourcesContent":["/**\n * Convert hex string to RGBA color.\n *\n * @see https://gist.github.com/danieliser/b4b24c9f772066bcf0a6\n * @example\n * rgba('#000', 0.5) // rgba(0, 0, 0, 0.5)\n */\nexport const rgba = (hexCode: string, opacity = 1) => {\n\tlet hex = hexCode.replace('#', '');\n\n\tif (hex.length === 3) {\n\t\thex = `${hex[0]}${hex[0]}${hex[1]}${hex[1]}${hex[2]}${hex[2]}`;\n\t}\n\n\tconst r = parseInt(hex.substring(0, 2), 16);\n\tconst g = parseInt(hex.substring(2, 4), 16);\n\tconst b = parseInt(hex.substring(4, 6), 16);\n\n\t/* Backward compatibility for whole number based opacity values. */\n\tif (opacity > 1 && opacity <= 100) {\n\t\topacity = opacity / 100;\n\t}\n\n\treturn `rgba(${r}, ${g}, ${b}, ${opacity})`;\n};\n"],"names":["rgba","hexCode","opacity","hex","r","g","b"],"mappings":"gFAOO,MAAMA,EAAO,CAACC,EAAiBC,EAAU,IAAM,CACrD,IAAIC,EAAMF,EAAQ,QAAQ,IAAK,EAAE,EAE7BE,EAAI,SAAW,IAClBA,EAAM,GAAGA,EAAI,CAAC,CAAC,GAAGA,EAAI,CAAC,CAAC,GAAGA,EAAI,CAAC,CAAC,GAAGA,EAAI,CAAC,CAAC,GAAGA,EAAI,CAAC,CAAC,GAAGA,EAAI,CAAC,CAAC,IAG7D,MAAMC,EAAI,SAASD,EAAI,UAAU,EAAG,CAAC,EAAG,EAAE,EACpCE,EAAI,SAASF,EAAI,UAAU,EAAG,CAAC,EAAG,EAAE,EACpCG,EAAI,SAASH,EAAI,UAAU,EAAG,CAAC,EAAG,EAAE,EAG1C,OAAID,EAAU,GAAKA,GAAW,MAC7BA,EAAUA,EAAU,KAGd,QAAQE,CAAC,KAAKC,CAAC,KAAKC,CAAC,KAAKJ,CAAO,GACzC"}
@@ -1,10 +0,0 @@
1
- const g = (n, s = 1) => {
2
- let r = n.replace("#", "");
3
- r.length === 3 && (r = `${r[0]}${r[0]}${r[1]}${r[1]}${r[2]}${r[2]}`);
4
- const e = parseInt(r.substring(0, 2), 16), t = parseInt(r.substring(2, 4), 16), $ = parseInt(r.substring(4, 6), 16);
5
- return s > 1 && s <= 100 && (s = s / 100), `rgba(${e}, ${t}, ${$}, ${s})`;
6
- };
7
- export {
8
- g as rgba
9
- };
10
- //# sourceMappingURL=rgba.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rgba.js","sources":["../../../src/utils/rgba.ts"],"sourcesContent":["/**\n * Convert hex string to RGBA color.\n *\n * @see https://gist.github.com/danieliser/b4b24c9f772066bcf0a6\n * @example\n * rgba('#000', 0.5) // rgba(0, 0, 0, 0.5)\n */\nexport const rgba = (hexCode: string, opacity = 1) => {\n\tlet hex = hexCode.replace('#', '');\n\n\tif (hex.length === 3) {\n\t\thex = `${hex[0]}${hex[0]}${hex[1]}${hex[1]}${hex[2]}${hex[2]}`;\n\t}\n\n\tconst r = parseInt(hex.substring(0, 2), 16);\n\tconst g = parseInt(hex.substring(2, 4), 16);\n\tconst b = parseInt(hex.substring(4, 6), 16);\n\n\t/* Backward compatibility for whole number based opacity values. */\n\tif (opacity > 1 && opacity <= 100) {\n\t\topacity = opacity / 100;\n\t}\n\n\treturn `rgba(${r}, ${g}, ${b}, ${opacity})`;\n};\n"],"names":["rgba","hexCode","opacity","hex","r","g","b"],"mappings":"AAOO,MAAMA,IAAO,CAACC,GAAiBC,IAAU,MAAM;AACrD,MAAIC,IAAMF,EAAQ,QAAQ,KAAK,EAAE;AAEjC,EAAIE,EAAI,WAAW,MAClBA,IAAM,GAAGA,EAAI,CAAC,CAAC,GAAGA,EAAI,CAAC,CAAC,GAAGA,EAAI,CAAC,CAAC,GAAGA,EAAI,CAAC,CAAC,GAAGA,EAAI,CAAC,CAAC,GAAGA,EAAI,CAAC,CAAC;AAG7D,QAAMC,IAAI,SAASD,EAAI,UAAU,GAAG,CAAC,GAAG,EAAE,GACpCE,IAAI,SAASF,EAAI,UAAU,GAAG,CAAC,GAAG,EAAE,GACpCG,IAAI,SAASH,EAAI,UAAU,GAAG,CAAC,GAAG,EAAE;AAG1C,SAAID,IAAU,KAAKA,KAAW,QAC7BA,IAAUA,IAAU,MAGd,QAAQE,CAAC,KAAKC,CAAC,KAAKC,CAAC,KAAKJ,CAAO;AACzC;"}