@bikdotai/bik-component-library 0.0.788-beta.4 → 0.0.788-beta.6
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.
- package/dist/cjs/editor/BikEditor.styles.js +1 -1
- package/dist/cjs/editor/extensions/buildExtensions.js +1 -1
- package/dist/cjs/editor/extensions/editorDropdown.styles.js +15 -18
- package/dist/cjs/editor/extensions/mention/MentionDropdown.js +1 -1
- package/dist/cjs/editor/extensions/slashCommand/SlashCommandMenu.js +1 -1
- package/dist/cjs/src/editor/BikEditor.types.d.ts +11 -0
- package/dist/esm/editor/BikEditor.styles.js +1 -1
- package/dist/esm/editor/extensions/buildExtensions.js +1 -1
- package/dist/esm/editor/extensions/editorDropdown.styles.js +11 -14
- package/dist/esm/editor/extensions/mention/MentionDropdown.js +1 -1
- package/dist/esm/editor/extensions/slashCommand/SlashCommandMenu.js +1 -1
- package/dist/esm/src/editor/BikEditor.types.d.ts +11 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@tiptap/extension-character-count"),n=require("@tiptap/extension-color"),t=require("@tiptap/extension-font-family"),i=require("@tiptap/extension-highlight"),o=require("@tiptap/extension-image"),r=require("@tiptap/extension-link"),a=require("@tiptap/extension-placeholder"),s=require("@tiptap/extension-subscript"),l=require("@tiptap/extension-superscript"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@tiptap/extension-character-count"),n=require("@tiptap/extension-color"),t=require("@tiptap/extension-font-family"),i=require("@tiptap/extension-highlight"),o=require("@tiptap/extension-image"),r=require("@tiptap/extension-link"),a=require("@tiptap/extension-placeholder"),s=require("@tiptap/extension-subscript"),l=require("@tiptap/extension-superscript"),d=require("@tiptap/extension-text-align"),u=require("@tiptap/extension-text-style"),p=require("@tiptap/extension-underline"),c=require("@tiptap/starter-kit"),x=require("./FontSizeExtension.js"),m=require("./mention/MentionExtension.js"),f=require("./paste/PasteExtension.js"),h=require("./plainClipboard/PlainClipboardExtension.js"),v=require("./sectionDivider/SectionDividerNode.js"),S=require("./sendShortcut/SendShortcutExtension.js"),g=require("./slashCommand/SlashCommandExtension.js"),q=require("./variable/VariableDecorationExtension.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var E=b(e),C=b(n),M=b(t),k=b(i),P=b(o),j=b(r),y=b(a),D=b(s),T=b(l),w=b(d),I=b(p),O=b(c);exports.buildExtensions=function(e){var n,t,i,o,r,a,s,l,d,p,c,b;const z=null!==(t=null===(n=e.features)||void 0===n?void 0:n.richPaste)&&void 0!==t&&t,A=null!==(o=null===(i=e.features)||void 0===i?void 0:i.richTypography)&&void 0!==o&&o,F=null===(r=e.features)||void 0===r?void 0:r.allowedMarks,N=e=>!F||F.includes(e);return[...[O.default.configure({link:!1,underline:!1,bold:!!N("bold")&&{},italic:!!N("italic")&&{},strike:!!N("strike")&&{},code:!!N("code")&&{}}),...N("underline")?[I.default]:[],j.default.extend({addPasteRules:()=>[],addInputRules:()=>[]}).configure({openOnClick:!1,autolink:!1,linkOnPaste:!1,HTMLAttributes:{rel:"noopener noreferrer",class:"bik-link"}}),u.TextStyle,y.default.configure({placeholder:null!==(a=e.placeholder)&&void 0!==a?a:"Type a message..."}),...e.onPaste?[f.PasteExtension.configure({onPaste:e.onPaste})]:[],...z?[]:[h.PlainClipboardExtension],S.SendShortcutExtension.configure({onSend:e.onSend,sendShortcut:e.sendShortcut,extraShortcuts:null!==(s=e.shortcuts)&&void 0!==s?s:[]}),q.VariableDecorationExtension,...e.maxCharacters?[E.default.configure({limit:e.maxCharacters})]:[],...e.hasSections?[v.SectionDividerNode]:[]],...[...(null===(d=null===(l=e.mentions)||void 0===l?void 0:l.agents)||void 0===d?void 0:d.length)?[m.buildAgentMentionExtension(e.mentions.agents,e.onMentionSelected,e.renderMentionItem,e.renderMentionDropdown)]:[],...(null===(c=null===(p=e.mentions)||void 0===p?void 0:p.teams)||void 0===c?void 0:c.length)?[m.buildTeamMentionExtension(e.mentions.teams,e.onMentionSelected,e.renderMentionItem,e.renderMentionDropdown)]:[],...(null===(b=e.slashCommands)||void 0===b?void 0:b.length)?[g.buildSlashCommandExtension(e.slashCommands,e.onSlashCommandSelected,e.renderSlashCommandItem,e.renderSlashCommandDropdown)]:[]],...A?[C.default,k.default.configure({multicolor:!0}),M.default,x.FontSizeExtension,w.default.configure({types:["heading","paragraph"]}),D.default,T.default,P.default]:[C.default]]};
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),
|
|
2
|
-
background: ${
|
|
3
|
-
border: 1px solid ${
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(e);const n=o.default.div`
|
|
2
|
+
background: ${t.COLORS.surface.standard};
|
|
3
|
+
border: 1px solid ${t.COLORS.stroke.primary};
|
|
4
4
|
border-radius: 8px;
|
|
5
5
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
6
6
|
padding: 4px;
|
|
7
|
-
min-width:
|
|
7
|
+
min-width: 330px;
|
|
8
8
|
max-height: 260px;
|
|
9
9
|
overflow-y: auto;
|
|
10
10
|
font-size: 14px;
|
|
11
|
-
color: ${
|
|
11
|
+
color: ${t.COLORS.content.primary};
|
|
12
12
|
`,a=o.default.div`
|
|
13
13
|
display: flex;
|
|
14
14
|
align-items: center;
|
|
15
15
|
gap: 8px;
|
|
16
|
-
padding:
|
|
16
|
+
padding: 12px 16px;
|
|
17
|
+
min-height: 43px;
|
|
17
18
|
border-radius: 6px;
|
|
18
19
|
cursor: pointer;
|
|
19
|
-
color: ${
|
|
20
|
-
background: ${e=>{let{$isActive:
|
|
21
|
-
|
|
22
|
-
&:hover {
|
|
23
|
-
background: ${r.COLORS.surface.hovered};
|
|
24
|
-
}
|
|
20
|
+
color: ${t.COLORS.content.primary};
|
|
21
|
+
background: ${e=>{let{$isActive:r}=e;return r?t.COLORS.surface.hovered:"transparent"}};
|
|
25
22
|
`,i=o.default.img`
|
|
26
23
|
width: 24px;
|
|
27
24
|
height: 24px;
|
|
@@ -30,19 +27,19 @@
|
|
|
30
27
|
flex-shrink: 0;
|
|
31
28
|
`,p=o.default.span`
|
|
32
29
|
font-weight: 500;
|
|
33
|
-
color: ${
|
|
30
|
+
color: ${t.COLORS.content.primary};
|
|
34
31
|
`,s=o.default.span`
|
|
35
32
|
width: 8px;
|
|
36
33
|
height: 8px;
|
|
37
34
|
border-radius: 50%;
|
|
38
|
-
background: ${e=>{let{$online:
|
|
35
|
+
background: ${e=>{let{$online:r}=e;return r?t.COLORS.content.positive:t.COLORS.content.placeholder}};
|
|
39
36
|
margin-left: auto;
|
|
40
37
|
flex-shrink: 0;
|
|
41
38
|
`,d=o.default.span`
|
|
42
39
|
font-weight: 500;
|
|
43
|
-
color: ${
|
|
44
|
-
`,
|
|
40
|
+
color: ${t.COLORS.content.primary};
|
|
41
|
+
`,l=o.default.span`
|
|
45
42
|
font-size: 12px;
|
|
46
|
-
color: ${
|
|
43
|
+
color: ${t.COLORS.content.secondary};
|
|
47
44
|
margin-left: auto;
|
|
48
|
-
`;exports.DropdownContainer=n,exports.DropdownItem=a,exports.MentionAvatar=i,exports.MentionLabel=p,exports.MentionPresenceDot=s,exports.SlashDescription=
|
|
45
|
+
`;exports.DropdownContainer=n,exports.DropdownItem=a,exports.MentionAvatar=i,exports.MentionLabel=p,exports.MentionPresenceDot=s,exports.SlashDescription=l,exports.SlashLabel=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=require("../editorDropdown.styles.js");const t=n.forwardRef(((t,o)=>{let{items:i,query:s,command:l,renderItem:a,renderDropdown:d}=t;const[c,u]=n.useState(0),p=e=>{i[e]&&l(i[e])};return n.useImperativeHandle(o,(()=>({onKeyDown:e=>{let{event:n}=e;return"ArrowUp"===n.key?(u((e=>(e+i.length-1)%i.length)),!0):"ArrowDown"===n.key?(u((e=>(e+1)%i.length)),!0):"Enter"===n.key&&(p(c),!0)}}))),n.useEffect((()=>u(0)),[i]),i.length?d?e.jsx(e.Fragment,{children:d({items:i,query:s,activeIndex:c,onSelect:e=>l(e)})}):e.jsx(r.DropdownContainer,{children:i.map(((n,t)=>e.jsx(r.DropdownItem,Object.assign({$isActive:t===c,onClick:()=>p(t)},{children:a?a(n,t===c):e.jsxs(e.Fragment,{children:[n.avatarUrl&&e.jsx(r.MentionAvatar,{src:n.avatarUrl,alt:""}),e.jsx(r.MentionLabel,{children:n.label}),void 0!==n.isOnline&&e.jsx(r.MentionPresenceDot,{$online:n.isOnline})]})}),n.id)))}):null}));t.displayName="MentionDropdown",exports.MentionDropdown=t;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=require("../editorDropdown.styles.js");const t=n.forwardRef(((t,o)=>{let{items:i,query:s,command:l,renderItem:a,renderDropdown:d}=t;const[c,u]=n.useState(0),p=e=>{i[e]&&l(i[e])};return n.useImperativeHandle(o,(()=>({onKeyDown:e=>{let{event:n}=e;return"ArrowUp"===n.key?(u((e=>(e+i.length-1)%i.length)),!0):"ArrowDown"===n.key?(u((e=>(e+1)%i.length)),!0):"Enter"===n.key&&(p(c),!0)}}))),n.useEffect((()=>u(0)),[i]),i.length?d?e.jsx(e.Fragment,{children:d({items:i,query:s,activeIndex:c,onSelect:e=>l(e)})}):e.jsx(r.DropdownContainer,{children:i.map(((n,t)=>e.jsx(r.DropdownItem,Object.assign({$isActive:t===c,onMouseEnter:()=>u(t),onClick:()=>p(t)},{children:a?a(n,t===c):e.jsxs(e.Fragment,{children:[n.avatarUrl&&e.jsx(r.MentionAvatar,{src:n.avatarUrl,alt:""}),e.jsx(r.MentionLabel,{children:n.label}),void 0!==n.isOnline&&e.jsx(r.MentionPresenceDot,{$online:n.isOnline})]})}),n.id)))}):null}));t.displayName="MentionDropdown",exports.MentionDropdown=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),n=require("../editorDropdown.styles.js");const t=r.forwardRef(((t,s)=>{let{items:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),n=require("../editorDropdown.styles.js");const t=r.forwardRef(((t,s)=>{let{items:o,query:i,command:l,renderItem:a,renderDropdown:d}=t;const[c,u]=r.useState(0),m=e=>{o[e]&&l(o[e])};return r.useImperativeHandle(s,(()=>({onKeyDown:e=>{let{event:r}=e;return"ArrowUp"===r.key?(u((e=>(e+o.length-1)%o.length)),!0):"ArrowDown"===r.key?(u((e=>(e+1)%o.length)),!0):"Enter"===r.key&&(m(c),!0)}}))),r.useEffect((()=>u(0)),[o]),o.length?d?e.jsx(e.Fragment,{children:d({items:o,query:i,activeIndex:c,onSelect:e=>l(e)})}):e.jsx(n.DropdownContainer,{children:o.map(((r,t)=>e.jsx(n.DropdownItem,Object.assign({$isActive:t===c,onMouseEnter:()=>u(t),onClick:()=>m(t)},{children:a?a(r,t===c):e.jsxs(e.Fragment,{children:[e.jsx(n.SlashLabel,{children:r.label}),r.description&&e.jsx(n.SlashDescription,{children:r.description})]})}),r.id)))}):null}));t.displayName="SlashCommandMenu",exports.SlashCommandMenu=t;
|
|
@@ -26,6 +26,17 @@ export interface EditorFeatures {
|
|
|
26
26
|
richPaste?: boolean;
|
|
27
27
|
/** Enable font family, font size, text alignment, highlight, subscript, superscript, and image. Default: `false`. */
|
|
28
28
|
richTypography?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Restrict which inline marks are active in the editor.
|
|
31
|
+
* When set, only the listed marks are registered — all others are disabled
|
|
32
|
+
* (no rendering, no keyboard shortcuts, no paste preservation).
|
|
33
|
+
* Omit to allow all marks (default).
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // LiveChat: bold only, no italic / underline / strike
|
|
37
|
+
* features={{ allowedMarks: ['bold'] }}
|
|
38
|
+
*/
|
|
39
|
+
allowedMarks?: Array<'bold' | 'italic' | 'strike' | 'underline' | 'code'>;
|
|
29
40
|
}
|
|
30
41
|
/**
|
|
31
42
|
* A named content section placed below the main body, separated by an invisible divider.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"@tiptap/extension-character-count";import e from"@tiptap/extension-color";import
|
|
1
|
+
import o from"@tiptap/extension-character-count";import e from"@tiptap/extension-color";import t from"@tiptap/extension-font-family";import n from"@tiptap/extension-highlight";import i from"@tiptap/extension-image";import r from"@tiptap/extension-link";import s from"@tiptap/extension-placeholder";import a from"@tiptap/extension-subscript";import l from"@tiptap/extension-superscript";import m from"@tiptap/extension-text-align";import{TextStyle as p}from"@tiptap/extension-text-style";import d from"@tiptap/extension-underline";import c from"@tiptap/starter-kit";import{FontSizeExtension as u}from"./FontSizeExtension.js";import{buildAgentMentionExtension as f,buildTeamMentionExtension as h}from"./mention/MentionExtension.js";import{PasteExtension as x}from"./paste/PasteExtension.js";import{PlainClipboardExtension as v}from"./plainClipboard/PlainClipboardExtension.js";import{SectionDividerNode as g}from"./sectionDivider/SectionDividerNode.js";import{SendShortcutExtension as S}from"./sendShortcut/SendShortcutExtension.js";import{buildSlashCommandExtension as C}from"./slashCommand/SlashCommandExtension.js";import{VariableDecorationExtension as k}from"./variable/VariableDecorationExtension.js";function b(b){var M,j,P,E,y,D,w,I,T,O,R,z;const A=null!==(j=null===(M=b.features)||void 0===M?void 0:M.richPaste)&&void 0!==j&&j,F=null!==(E=null===(P=b.features)||void 0===P?void 0:P.richTypography)&&void 0!==E&&E,H=null===(y=b.features)||void 0===y?void 0:y.allowedMarks,L=o=>!H||H.includes(o);return[...[c.configure({link:!1,underline:!1,bold:!!L("bold")&&{},italic:!!L("italic")&&{},strike:!!L("strike")&&{},code:!!L("code")&&{}}),...L("underline")?[d]:[],r.extend({addPasteRules:()=>[],addInputRules:()=>[]}).configure({openOnClick:!1,autolink:!1,linkOnPaste:!1,HTMLAttributes:{rel:"noopener noreferrer",class:"bik-link"}}),p,s.configure({placeholder:null!==(D=b.placeholder)&&void 0!==D?D:"Type a message..."}),...b.onPaste?[x.configure({onPaste:b.onPaste})]:[],...A?[]:[v],S.configure({onSend:b.onSend,sendShortcut:b.sendShortcut,extraShortcuts:null!==(w=b.shortcuts)&&void 0!==w?w:[]}),k,...b.maxCharacters?[o.configure({limit:b.maxCharacters})]:[],...b.hasSections?[g]:[]],...[...(null===(T=null===(I=b.mentions)||void 0===I?void 0:I.agents)||void 0===T?void 0:T.length)?[f(b.mentions.agents,b.onMentionSelected,b.renderMentionItem,b.renderMentionDropdown)]:[],...(null===(R=null===(O=b.mentions)||void 0===O?void 0:O.teams)||void 0===R?void 0:R.length)?[h(b.mentions.teams,b.onMentionSelected,b.renderMentionItem,b.renderMentionDropdown)]:[],...(null===(z=b.slashCommands)||void 0===z?void 0:z.length)?[C(b.slashCommands,b.onSlashCommandSelected,b.renderSlashCommandItem,b.renderSlashCommandDropdown)]:[]],...F?[e,n.configure({multicolor:!0}),t,u,m.configure({types:["heading","paragraph"]}),a,l,i]:[e]]}export{b as buildExtensions};
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import r from"styled-components";import{COLORS as o}from"../../constants/Theme.js";const
|
|
1
|
+
import r from"styled-components";import{COLORS as o}from"../../constants/Theme.js";const t=r.div`
|
|
2
2
|
background: ${o.surface.standard};
|
|
3
3
|
border: 1px solid ${o.stroke.primary};
|
|
4
4
|
border-radius: 8px;
|
|
5
5
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
6
6
|
padding: 4px;
|
|
7
|
-
min-width:
|
|
7
|
+
min-width: 330px;
|
|
8
8
|
max-height: 260px;
|
|
9
9
|
overflow-y: auto;
|
|
10
10
|
font-size: 14px;
|
|
11
11
|
color: ${o.content.primary};
|
|
12
|
-
`,
|
|
12
|
+
`,e=r.div`
|
|
13
13
|
display: flex;
|
|
14
14
|
align-items: center;
|
|
15
15
|
gap: 8px;
|
|
16
|
-
padding:
|
|
16
|
+
padding: 12px 16px;
|
|
17
|
+
min-height: 43px;
|
|
17
18
|
border-radius: 6px;
|
|
18
19
|
cursor: pointer;
|
|
19
20
|
color: ${o.content.primary};
|
|
20
|
-
background: ${r=>{let{$isActive:
|
|
21
|
-
|
|
22
|
-
&:hover {
|
|
23
|
-
background: ${o.surface.hovered};
|
|
24
|
-
}
|
|
21
|
+
background: ${r=>{let{$isActive:t}=r;return t?o.surface.hovered:"transparent"}};
|
|
25
22
|
`,n=r.img`
|
|
26
23
|
width: 24px;
|
|
27
24
|
height: 24px;
|
|
@@ -31,18 +28,18 @@ import r from"styled-components";import{COLORS as o}from"../../constants/Theme.j
|
|
|
31
28
|
`,i=r.span`
|
|
32
29
|
font-weight: 500;
|
|
33
30
|
color: ${o.content.primary};
|
|
34
|
-
`,
|
|
31
|
+
`,p=r.span`
|
|
35
32
|
width: 8px;
|
|
36
33
|
height: 8px;
|
|
37
34
|
border-radius: 50%;
|
|
38
|
-
background: ${r=>{let{$online:
|
|
35
|
+
background: ${r=>{let{$online:t}=r;return t?o.content.positive:o.content.placeholder}};
|
|
39
36
|
margin-left: auto;
|
|
40
37
|
flex-shrink: 0;
|
|
41
|
-
`,
|
|
38
|
+
`,a=r.span`
|
|
42
39
|
font-weight: 500;
|
|
43
40
|
color: ${o.content.primary};
|
|
44
|
-
`,
|
|
41
|
+
`,s=r.span`
|
|
45
42
|
font-size: 12px;
|
|
46
43
|
color: ${o.content.secondary};
|
|
47
44
|
margin-left: auto;
|
|
48
|
-
`;export{
|
|
45
|
+
`;export{t as DropdownContainer,e as DropdownItem,n as MentionAvatar,i as MentionLabel,p as MentionPresenceDot,s as SlashDescription,a as SlashLabel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as
|
|
1
|
+
import{jsx as e,Fragment as n,jsxs as r}from"react/jsx-runtime";import{forwardRef as t,useState as o,useImperativeHandle as i,useEffect as l}from"react";import{DropdownContainer as a,DropdownItem as c,MentionAvatar as d,MentionLabel as s,MentionPresenceDot as m}from"../editorDropdown.styles.js";const p=t(((t,p)=>{let{items:h,query:y,command:u,renderItem:w,renderDropdown:v}=t;const[g,D]=o(0),k=e=>{h[e]&&u(h[e])};return i(p,(()=>({onKeyDown:e=>{let{event:n}=e;return"ArrowUp"===n.key?(D((e=>(e+h.length-1)%h.length)),!0):"ArrowDown"===n.key?(D((e=>(e+1)%h.length)),!0):"Enter"===n.key&&(k(g),!0)}}))),l((()=>D(0)),[h]),h.length?v?e(n,{children:v({items:h,query:y,activeIndex:g,onSelect:e=>u(e)})}):e(a,{children:h.map(((t,o)=>e(c,Object.assign({$isActive:o===g,onMouseEnter:()=>D(o),onClick:()=>k(o)},{children:w?w(t,o===g):r(n,{children:[t.avatarUrl&&e(d,{src:t.avatarUrl,alt:""}),e(s,{children:t.label}),void 0!==t.isOnline&&e(m,{$online:t.isOnline})]})}),t.id)))}):null}));p.displayName="MentionDropdown";export{p as MentionDropdown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as r,jsxs as n}from"react/jsx-runtime";import{forwardRef as t,useState as o,useImperativeHandle as i,useEffect as l}from"react";import{DropdownContainer as c,DropdownItem as d,SlashLabel as m,SlashDescription as s}from"../editorDropdown.styles.js";const a=t(((t,a)=>{let{items:h,query:p,command:
|
|
1
|
+
import{jsx as e,Fragment as r,jsxs as n}from"react/jsx-runtime";import{forwardRef as t,useState as o,useImperativeHandle as i,useEffect as l}from"react";import{DropdownContainer as c,DropdownItem as d,SlashLabel as m,SlashDescription as s}from"../editorDropdown.styles.js";const a=t(((t,a)=>{let{items:h,query:p,command:u,renderItem:y,renderDropdown:w}=t;const[g,k]=o(0),D=e=>{h[e]&&u(h[e])};return i(a,(()=>({onKeyDown:e=>{let{event:r}=e;return"ArrowUp"===r.key?(k((e=>(e+h.length-1)%h.length)),!0):"ArrowDown"===r.key?(k((e=>(e+1)%h.length)),!0):"Enter"===r.key&&(D(g),!0)}}))),l((()=>k(0)),[h]),h.length?w?e(r,{children:w({items:h,query:p,activeIndex:g,onSelect:e=>u(e)})}):e(c,{children:h.map(((t,o)=>e(d,Object.assign({$isActive:o===g,onMouseEnter:()=>k(o),onClick:()=>D(o)},{children:y?y(t,o===g):n(r,{children:[e(m,{children:t.label}),t.description&&e(s,{children:t.description})]})}),t.id)))}):null}));a.displayName="SlashCommandMenu";export{a as SlashCommandMenu};
|
|
@@ -26,6 +26,17 @@ export interface EditorFeatures {
|
|
|
26
26
|
richPaste?: boolean;
|
|
27
27
|
/** Enable font family, font size, text alignment, highlight, subscript, superscript, and image. Default: `false`. */
|
|
28
28
|
richTypography?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Restrict which inline marks are active in the editor.
|
|
31
|
+
* When set, only the listed marks are registered — all others are disabled
|
|
32
|
+
* (no rendering, no keyboard shortcuts, no paste preservation).
|
|
33
|
+
* Omit to allow all marks (default).
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // LiveChat: bold only, no italic / underline / strike
|
|
37
|
+
* features={{ allowedMarks: ['bold'] }}
|
|
38
|
+
*/
|
|
39
|
+
allowedMarks?: Array<'bold' | 'italic' | 'strike' | 'underline' | 'code'>;
|
|
29
40
|
}
|
|
30
41
|
/**
|
|
31
42
|
* A named content section placed below the main body, separated by an invisible divider.
|