@soul-refiner/design-system 2.14.158 → 2.14.159

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.
@@ -75,12 +75,12 @@
75
75
  max-width: 864px;
76
76
  width: 100%;
77
77
  margin: 0 auto;
78
- `,y=o.styled.div`
78
+ `,w=o.styled.div`
79
79
  display: flex;
80
80
  justify-content: flex-end;
81
81
  align-items: center;
82
82
  gap: 4px;
83
83
  padding: 4px 0;
84
- `,w=o.styled.div`
84
+ `,y=o.styled.div`
85
85
  position: relative;
86
- `;exports.Editor=({audioLoader:i,commentInputLoader:o,commentLoader:n,editable:a,handleAudioClick:h,handleVideoClick:g,imageSrcLoader:d,onChange:u,previousContent:m,defaultFilter:b,videoTitleLoader:q,filterComponent:k,hideShowAnswersButton:L,showAnswersBelowInput:O,enableHighlighting:E=!1,initialHighlights:R,onHighlightsChange:A,onOpenNotes:B,renderToolbarItems:P,toolbarPortalTarget:D})=>{const{highlights:F,addHighlight:I,updateHighlight:N,removeHighlight:T}=c.useHighlights({initialHighlights:R,onHighlightsChange:A}),[M,S]=j.default.useState(!1);j.default.useEffect(()=>{"production"!==process.env.NODE_ENV&&a&&E&&console.warn("[Editor] enableHighlighting is only supported with editable={false}. Highlight positions are not reconciled when the document changes and will drift out of alignment after edits.")},[a,E]);const V=F.length>0,z=j.default.useMemo(()=>{if(0!==F.length)return p.createHighlightDecorate(F)},[F]);return e.jsx(r.EditorContext.Provider,{value:{audioLoader:i,commentInputLoader:o,commentLoader:n,handleAudioClick:h,handleVideoClick:g,imageSrcLoader:d,videoTitleLoader:q,defaultFilter:b,filterComponent:k,hideShowAnswersButton:L,showAnswersBelowInput:O,enableHighlighting:E,highlights:F},children:e.jsxs(l.Plate,{id:"main",initialValue:m,onChange:u,plugins:H,children:[D&&t.createPortal(e.jsxs(e.Fragment,{children:[P?.(),(E||V)&&e.jsxs(w,{children:[e.jsx(f.HighlightButton,{count:F.length,isOpen:M,onClick:()=>S(e=>!e)}),e.jsx(x.HighlightsDropdown,{isOpen:M,highlights:F,onRemove:T,onClose:()=>S(!1)})]})]}),D),e.jsxs(C,{children:[a&&e.jsx(s.EditorBar,{}),!D&&(E||V||P)&&e.jsxs(y,{children:[P?.(),(E||V)&&e.jsxs(w,{children:[e.jsx(f.HighlightButton,{count:F.length,isOpen:M,onClick:()=>S(e=>!e)}),e.jsx(x.HighlightsDropdown,{isOpen:M,highlights:F,onRemove:T,onClose:()=>S(!1)})]})]}),e.jsx(v,{decorate:z,enableHighlighting:E,editable:a,highlights:F,addHighlight:I,updateHighlight:N,removeHighlight:T,hasHighlights:V,onOpenNotes:B})]})]})})};
86
+ `;exports.Editor=({audioLoader:i,commentInputLoader:o,commentLoader:n,editable:a,handleAudioClick:h,handleVideoClick:g,imageSrcLoader:d,onChange:u,previousContent:m,defaultFilter:b,videoTitleLoader:k,filterComponent:q,hideShowAnswersButton:L,showAnswersBelowInput:O,enableHighlighting:E=!1,initialHighlights:I,onHighlightsChange:R,onOpenNotes:A,renderToolbarItems:B,toolbarPortalTarget:D,dropdownItems:P,onDropdownItemClick:F})=>{const{highlights:N,addHighlight:T,updateHighlight:M,removeHighlight:S}=c.useHighlights({initialHighlights:I,onHighlightsChange:R}),[V,z]=j.default.useState(!1);j.default.useEffect(()=>{"production"!==process.env.NODE_ENV&&a&&E&&console.warn("[Editor] enableHighlighting is only supported with editable={false}. Highlight positions are not reconciled when the document changes and will drift out of alignment after edits.")},[a,E]);const U=N.length>0,_=j.default.useMemo(()=>{if(0!==N.length)return p.createHighlightDecorate(N)},[N]);return e.jsx(r.EditorContext.Provider,{value:{audioLoader:i,commentInputLoader:o,commentLoader:n,handleAudioClick:h,handleVideoClick:g,imageSrcLoader:d,videoTitleLoader:k,defaultFilter:b,filterComponent:q,hideShowAnswersButton:L,showAnswersBelowInput:O,enableHighlighting:E,highlights:N},children:e.jsxs(l.Plate,{id:"main",initialValue:m,onChange:u,plugins:H,children:[D&&t.createPortal(e.jsxs(e.Fragment,{children:[B?.(),(E||U)&&e.jsxs(y,{children:[e.jsx(f.HighlightButton,{count:N.length,isOpen:V,onClick:()=>z(e=>!e)}),e.jsx(x.HighlightsDropdown,{isOpen:V,highlights:N,items:P,onItemClick:F,onRemove:S,onClose:()=>z(!1)})]})]}),D),e.jsxs(C,{children:[a&&e.jsx(s.EditorBar,{}),!D&&(E||U||B)&&e.jsxs(w,{children:[B?.(),(E||U)&&e.jsxs(y,{children:[e.jsx(f.HighlightButton,{count:N.length,isOpen:V,onClick:()=>z(e=>!e)}),e.jsx(x.HighlightsDropdown,{isOpen:V,highlights:N,onRemove:S,onClose:()=>z(!1)})]})]}),e.jsx(v,{decorate:_,enableHighlighting:E,editable:a,highlights:N,addHighlight:T,updateHighlight:M,removeHighlight:S,hasHighlights:U,onOpenNotes:A})]})]})})};
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("styled-components");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t);const i=r.styled.div`
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("styled-components"),n=require("../../../atoms/typography/paragraph.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(t);const l=r.styled.div`
2
2
  position: absolute;
3
3
  top: calc(100% + 4px);
4
4
  right: 0;
@@ -12,22 +12,22 @@
12
12
  overflow: hidden;
13
13
  display: flex;
14
14
  flex-direction: column;
15
- `,l=r.styled.div`
15
+ `,s=r.styled.div`
16
16
  display: flex;
17
17
  align-items: center;
18
18
  justify-content: space-between;
19
19
  padding: 12px 16px;
20
20
  border-bottom: 1px solid var(--color-grey-9, #f3f4f6);
21
- `,s=r.styled.span`
21
+ `,a=r.styled.span`
22
22
  font-size: 14px;
23
23
  font-weight: 500;
24
24
  color: var(--color-grey-4, #636971);
25
25
  font-family: var(--font-inter);
26
- `,a=r.styled.div`
26
+ `,c=r.styled.div`
27
27
  overflow-y: auto;
28
28
  flex: 1;
29
29
  padding: 4px;
30
- `,c=r.styled.div`
30
+ `,d=r.styled.div`
31
31
  display: flex;
32
32
  align-items: center;
33
33
  gap: 8px;
@@ -37,11 +37,12 @@
37
37
  &:hover {
38
38
  background: var(--color-grey-10, #f9fafb);
39
39
  }
40
- `,d=r.styled.button`
40
+ `,u=r.styled.button`
41
41
  flex: 1;
42
42
  display: flex;
43
- align-items: flex-start;
44
- gap: 10px;
43
+ flex-direction: column;
44
+ align-items: stretch;
45
+ gap: 2px;
45
46
  padding: 8px;
46
47
  background: none;
47
48
  border: none;
@@ -49,7 +50,7 @@
49
50
  text-align: left;
50
51
  border-radius: 6px;
51
52
  min-width: 0;
52
- `,u=r.styled.span`
53
+ `,f=r.styled.span`
53
54
  font-size: 12px;
54
55
  color: var(--color-grey-4, #636971);
55
56
  font-family: var(--font-inter);
@@ -57,7 +58,7 @@
57
58
  white-space: nowrap;
58
59
  overflow: hidden;
59
60
  text-overflow: ellipsis;
60
- `,f=r.styled.button`
61
+ `,h=r.styled.button`
61
62
  display: flex;
62
63
  align-items: center;
63
64
  justify-content: center;
@@ -70,23 +71,23 @@
70
71
  color: var(--color-grey-3, #4a4f55);
71
72
  cursor: pointer;
72
73
  padding: 0;
73
- `,h=r.styled.div`
74
+ `,p=r.styled.div`
74
75
  display: flex;
75
76
  flex-direction: column;
76
77
  align-items: center;
77
78
  padding: 32px 24px;
78
79
  gap: 8px;
79
- `,p=r.styled.div`
80
+ `,x=r.styled.div`
80
81
  margin-bottom: 4px;
81
82
  opacity: 0.6;
82
- `,x=r.styled.span`
83
+ `,g=r.styled.span`
83
84
  font-size: 14px;
84
85
  font-weight: 600;
85
86
  color: var(--color-grey-4, #4b5563);
86
87
  font-family: var(--font-inter);
87
- `,g=r.styled.span`
88
+ `,y=r.styled.span`
88
89
  font-size: 13px;
89
90
  color: var(--color-grey-6, #9ca3af);
90
91
  font-family: var(--font-inter);
91
92
  text-align: center;
92
- `;exports.HighlightsDropdown=({isOpen:t,highlights:r,onRemove:n,onClose:y})=>{const m=o.default.useRef(null),v=o.default.useRef(null),b=o.default.useRef([]),w=o.default.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null),b.current.forEach(e=>{e.removeAttribute("data-highlight-pulse")}),b.current=[]},[]),j=o.default.useCallback(e=>{const t=document.querySelectorAll(`[data-highlight-id="${e}"]`);0!==t.length&&(t[0].scrollIntoView({behavior:"smooth",block:"center"}),w(),b.current=Array.from(t),b.current.forEach(e=>{e.setAttribute("data-highlight-pulse","true")}),v.current=setTimeout(()=>{b.current.forEach(e=>{e.removeAttribute("data-highlight-pulse")}),b.current=[],v.current=null},1500))},[w]);o.default.useEffect(()=>w,[w]);const k=o.default.useRef(null);if(o.default.useEffect(()=>{if(t){k.current=document.activeElement??null;const e=window.requestAnimationFrame(()=>{m.current?.focus()});return()=>window.cancelAnimationFrame(e)}k.current&&(k.current.focus({preventScroll:!0}),k.current=null)},[t]),o.default.useEffect(()=>{if(!t)return;const e=e=>{if("Escape"===e.key)return void y();if("Tab"!==e.key)return;const t=(()=>{const e=m.current;return e?Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("disabled")):[]})();if(0===t.length)return e.preventDefault(),void m.current?.focus();const r=t[0],n=t[t.length-1],o=document.activeElement;e.shiftKey?o!==r&&o!==m.current||(e.preventDefault(),n.focus()):o===n&&(e.preventDefault(),r.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,y]),o.default.useEffect(()=>{if(!t)return;const e=e=>{if(m.current&&!m.current.contains(e.target)){if(e.target.closest("[data-highlight-toggle]"))return;y()}},r=setTimeout(()=>{document.addEventListener("mousedown",e)},50);return()=>{clearTimeout(r),document.removeEventListener("mousedown",e)}},[t,y]),!t)return null;const E=[...r].sort((e,t)=>t.createdAt-e.createdAt);return e.jsxs(i,{ref:m,role:"dialog","aria-label":"Highlights","aria-modal":"false",tabIndex:-1,children:[e.jsx(l,{children:e.jsx(s,{children:"Your highlights"})}),0===r.length?e.jsxs(h,{children:[e.jsx(p,{children:e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-grey-6, #9ca3af)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 20h9"}),e.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),e.jsx(x,{children:"No highlights yet"}),e.jsx(g,{children:"Select text to highlight important sections"})]}):e.jsx(a,{children:E.map(t=>e.jsxs(c,{children:[e.jsx(d,{onClick:()=>{j(t.id),y()},children:e.jsx(u,{children:t.snippetText})}),e.jsx(f,{onClick:e=>{e.stopPropagation(),n(t.id)},title:"Remove highlight",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),e.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})})]},t.id))})]})};
93
+ `;exports.HighlightsDropdown=({isOpen:t,highlights:r,onRemove:o,onClose:m,items:v,onItemClick:b})=>{const w=i.default.useRef(null),j=i.default.useRef(null),k=i.default.useRef([]),E=i.default.useCallback(()=>{j.current&&(clearTimeout(j.current),j.current=null),k.current.forEach(e=>{e.removeAttribute("data-highlight-pulse")}),k.current=[]},[]),A=i.default.useCallback(e=>{const t=document.querySelectorAll(`[data-highlight-id="${e}"]`);0!==t.length&&(t[0].scrollIntoView({behavior:"smooth",block:"center"}),E(),k.current=Array.from(t),k.current.forEach(e=>{e.setAttribute("data-highlight-pulse","true")}),j.current=setTimeout(()=>{k.current.forEach(e=>{e.removeAttribute("data-highlight-pulse")}),k.current=[],j.current=null},1500))},[E]);i.default.useEffect(()=>E,[E]);const L=i.default.useRef(null);if(i.default.useEffect(()=>{if(t){L.current=document.activeElement??null;const e=window.requestAnimationFrame(()=>{w.current?.focus()});return()=>window.cancelAnimationFrame(e)}L.current&&(L.current.focus({preventScroll:!0}),L.current=null)},[t]),i.default.useEffect(()=>{if(!t)return;const e=e=>{if("Escape"===e.key)return void m();if("Tab"!==e.key)return;const t=(()=>{const e=w.current;return e?Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("disabled")):[]})();if(0===t.length)return e.preventDefault(),void w.current?.focus();const r=t[0],n=t[t.length-1],o=document.activeElement;e.shiftKey?o!==r&&o!==w.current||(e.preventDefault(),n.focus()):o===n&&(e.preventDefault(),r.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,m]),i.default.useEffect(()=>{if(!t)return;const e=e=>{if(w.current&&!w.current.contains(e.target)){if(e.target.closest("[data-highlight-toggle]"))return;m()}},r=setTimeout(()=>{document.addEventListener("mousedown",e)},50);return()=>{clearTimeout(r),document.removeEventListener("mousedown",e)}},[t,m]),!t)return null;const T=[...v??r].sort((e,t)=>t.createdAt-e.createdAt);return e.jsxs(l,{ref:w,role:"dialog","aria-label":"Highlights","aria-modal":"false",tabIndex:-1,children:[e.jsx(s,{children:e.jsx(a,{children:"Your highlights"})}),0===T.length?e.jsxs(p,{children:[e.jsx(x,{children:e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-grey-6, #9ca3af)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 20h9"}),e.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),e.jsx(g,{children:"No highlights yet"}),e.jsx(y,{children:"Select text to highlight important sections"})]}):e.jsx(c,{children:T.map(t=>e.jsxs(d,{children:[e.jsxs(u,{onClick:()=>{b?b(t):A(t.id),m()},children:[t.sectionTitle&&e.jsx(n.P,{$fontSize:14,$lineHeight:20,$color:"grey-5",$sx:"font-weight: 600;",children:t.sectionTitle}),e.jsx(f,{children:t.snippetText})]}),e.jsx(h,{onClick:e=>{e.stopPropagation(),o(t.id)},title:"Remove highlight",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),e.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})})]},t.id))})]})};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { TElement } from '@udecode/plate-common';
3
3
  import { CommentInputProps, CommentLoaderProps, FilterComponentProps } from './context';
4
- import { HighlightData } from './plugins/highlights/types';
4
+ import { HighlightData, HighlightDropdownItem } from './plugins/highlights/types';
5
5
  export interface EditorProps {
6
6
  audioLoader?: (props: {
7
7
  courseMediaId: number;
@@ -46,7 +46,9 @@ export interface EditorProps {
46
46
  }) => void;
47
47
  renderToolbarItems?: () => React.ReactNode;
48
48
  toolbarPortalTarget?: HTMLElement | null;
49
+ dropdownItems?: HighlightDropdownItem[];
50
+ onDropdownItemClick?: (item: HighlightDropdownItem) => void;
49
51
  }
50
52
  export type EditorContent = TElement;
51
- export declare const Editor: ({ audioLoader, commentInputLoader, commentLoader, editable, handleAudioClick, handleVideoClick, imageSrcLoader, onChange, previousContent, defaultFilter, videoTitleLoader, filterComponent, hideShowAnswersButton, showAnswersBelowInput, enableHighlighting, initialHighlights, onHighlightsChange, onOpenNotes, renderToolbarItems, toolbarPortalTarget, }: EditorProps) => import("react/jsx-runtime").JSX.Element;
53
+ export declare const Editor: ({ audioLoader, commentInputLoader, commentLoader, editable, handleAudioClick, handleVideoClick, imageSrcLoader, onChange, previousContent, defaultFilter, videoTitleLoader, filterComponent, hideShowAnswersButton, showAnswersBelowInput, enableHighlighting, initialHighlights, onHighlightsChange, onOpenNotes, renderToolbarItems, toolbarPortalTarget, dropdownItems, onDropdownItemClick, }: EditorProps) => import("react/jsx-runtime").JSX.Element;
52
54
  //# sourceMappingURL=editor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/editor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAIL,QAAQ,EAET,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAElB,oBAAoB,EACrB,MAAM,WAAW,CAAC;AAOnB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAe3D,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC,YAAY,CAAC;IACvE,kBAAkB,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,KAAK,CAAC,YAAY,CAAC;IACrE,aAAa,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,KAAK,CAAC,YAAY,CAAC;IACjE,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACzC,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,CAAC,KAAK,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC,YAAY,CAAC;IAC3E,eAAe,CAAC,EA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BAAmB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACxC,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAC7D;AAED,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;AAErC,eAAO,MAAM,MAAM,sYAuBhB,WAAW,4CAsHb,CAAC"}
@@ -4,7 +4,7 @@ export { SimpleEditor } from './simple_editor';
4
4
  export type { SimpleEditorProps } from './simple_editor';
5
5
  export { MinimalEditor } from './minimal_editor';
6
6
  export type { MinimalEditorProps } from './minimal_editor';
7
- export type { HighlightData } from './plugins/highlights/types';
7
+ export type { HighlightData, HighlightDropdownItem, } from './plugins/highlights/types';
8
8
  export { HIGHLIGHT_COLORS, DEFAULT_HIGHLIGHT_COLOR, } from './plugins/highlights/types';
9
9
  export { useHighlights } from './plugins/highlights/use-highlights';
10
10
  export { HighlightButton } from './plugins/highlights/highlight-button';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EACL,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,YAAY,EACV,aAAa,EACb,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC"}
@@ -1,10 +1,12 @@
1
- import { HighlightData } from './types';
1
+ import { HighlightData, HighlightDropdownItem } from './types';
2
2
  interface HighlightsDropdownProps {
3
3
  isOpen: boolean;
4
4
  highlights: HighlightData[];
5
5
  onRemove: (id: string) => void;
6
6
  onClose: () => void;
7
+ items?: HighlightDropdownItem[];
8
+ onItemClick?: (item: HighlightDropdownItem) => void;
7
9
  }
8
- export declare const HighlightsDropdown: ({ isOpen, highlights, onRemove, onClose, }: HighlightsDropdownProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const HighlightsDropdown: ({ isOpen, highlights, onRemove, onClose, items, onItemClick, }: HighlightsDropdownProps) => import("react/jsx-runtime").JSX.Element;
9
11
  export {};
10
12
  //# sourceMappingURL=highlights-dropdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"highlights-dropdown.d.ts","sourceRoot":"","sources":["../../../../../../src/components/editor/plugins/highlights/highlights-dropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,UAAU,uBAAuB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAID,eAAO,MAAM,kBAAkB,+CAK5B,uBAAuB,4CA+NzB,CAAC"}
1
+ {"version":3,"file":"highlights-dropdown.d.ts","sourceRoot":"","sources":["../../../../../../src/components/editor/plugins/highlights/highlights-dropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAG/D,UAAU,uBAAuB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACrD;AAID,eAAO,MAAM,kBAAkB,mEAO5B,uBAAuB,4CA8OzB,CAAC"}
@@ -8,6 +8,9 @@ export interface HighlightData {
8
8
  color: string;
9
9
  createdAt: number;
10
10
  }
11
+ export interface HighlightDropdownItem extends HighlightData {
12
+ sectionTitle?: string;
13
+ }
11
14
  export declare const HIGHLIGHT_COLORS: readonly [{
12
15
  readonly label: "Yellow";
13
16
  readonly value: "#FBD33D";
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/editor/plugins/highlights/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAKnB,CAAC;AAEX,eAAO,MAAM,uBAAuB,WAA4B,CAAC;AAQjE,eAAO,MAAM,qBAAqB,QAAS,MAAM,KAAG,MAQnD,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/editor/plugins/highlights/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAMD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAKnB,CAAC;AAEX,eAAO,MAAM,uBAAuB,WAA4B,CAAC;AAQjE,eAAO,MAAM,qBAAqB,QAAS,MAAM,KAAG,MAQnD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "2.14.158",
3
+ "version": "2.14.159",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "license": "MIT",