Skip to content

Commit 3bc23be

Browse files
committed
Update example
1 parent ba15673 commit 3bc23be

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

docs/assets/scripts/search.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,12 +395,12 @@
395395
}
396396
});
397397

398-
// Show the search dialog when slash (or CMD+K) is pressed and focus is not inside a form element
398+
// Show the search dialog when (SHFT + ?) (or CMD+K) is pressed and focus is not inside a form element
399399
document.addEventListener('keydown', event =>
400400
{
401401
if(
402402
!isShowing &&
403-
(event.key === '/' || (event.key === 'k' && (event.metaKey || event.ctrlKey))) &&
403+
((event.key === '?' && event.shiftKey) || (event.key === 'k' && (event.metaKey || event.ctrlKey))) &&
404404
!event.composedPath().some(el => ['input', 'textarea'].includes(el?.tagName?.toLowerCase()))
405405
)
406406
{

docs/pages/components/editor.md

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,10 @@ layout: component
77

88
```html:preview
99
10-
<zn-editor></zn-editor>
11-
12-
13-
<script>
14-
let cannedResponses = [
15-
{
16-
title: 'Hello',
17-
content: 'Hello, how can I help you?'
18-
command: 'hello'
19-
},
20-
{
21-
title: 'Goodbye',
22-
content: 'Goodbye, have a nice day!'
23-
command: 'goodbye'
24-
}
25-
];
26-
27-
let editor = document.querySelector('zn-editor');
28-
editor.setAttribute('canned-responses', JSON.stringify(cannedResponses));
29-
</script>
10+
<zn-editor
11+
canned-responses="[{&quot;title&quot;: &quot;Example With Data&quot;,&quot;content&quot;: &quot;Hi \n\nThis is a message from Kyle Essex to test data. \n\n\nFrom &quot;,&quot;labels&quot;: [&quot;test&quot;],&quot;command&quot;: &quot;example-with-data&quot;},{&quot;title&quot;: &quot;Styled Response&quot;,&quot;content&quot;: &quot;&lt;p&gt;It&apos;s for chat,&lt;/p&gt;\n\n&lt;p&gt;Try not to use any specific styling&lt;/p&gt;\n&quot;,&quot;labels&quot;: [&quot;styled, test&quot;],&quot;command&quot;: &quot;styled-response&quot;}]">
12+
13+
</zn-editor>
3014
```
3115

3216
## Examples

0 commit comments

Comments
 (0)