Skip to content

Commit

Permalink
fix: QuickSearch outside-click
Browse files Browse the repository at this point in the history
  • Loading branch information
dineug committed Dec 23, 2023
1 parent 00727b9 commit 43dcd8a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 3 deletions.
9 changes: 9 additions & 0 deletions packages/erd-editor-shiki-worker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,13 @@ setGetShikiServiceCallback(getShikiService);
setGetShikiServiceCallback(getShikiService);
</script>
<!-- or -->
<script src="https://cdn.jsdelivr.net/npm/@dineug/erd-editor/dist/erd-editor.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@dineug/erd-editor-shiki-worker/dist/erd-editor-shiki-worker.min.js"></script>
<script>
const { setGetShikiServiceCallback } = window['@dineug/erd-editor'];
const { getShikiService } = window['@dineug/erd-editor-shiki-worker'];
setGetShikiServiceCallback(getShikiService);
</script>
```
1 change: 1 addition & 0 deletions packages/erd-editor-vscode-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"build": "vite build"
},
"devDependencies": {
"@dineug/shared": "workspace:*",
"@rollup/plugin-typescript": "^11.1.5",
"rollup-plugin-visualizer": "^5.11.0",
"ts-patch": "^3.1.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/erd-editor-vscode-bridge/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { isObject } from '@dineug/shared';

import {
AnyAction,
Callback,
Expand Down Expand Up @@ -112,6 +114,7 @@ export class Emitter<M extends BridgeActionMap> {
}

emit(action: AnyAction) {
if (!isObject(action)) return;
this.#observers.forEach(reducers => {
const reducer = Reflect.get(reducers, action.type);
safeCallback(reducer, action);
Expand Down
1 change: 1 addition & 0 deletions packages/erd-editor-vscode-webview/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default defineConfig(({ command, mode }) => {
formats: ['iife'],
},
outDir,
emptyOutDir: true,
},
plugins: [tsconfigPaths()],
};
Expand Down
4 changes: 2 additions & 2 deletions packages/erd-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ npm install @dineug/erd-editor

## Usage

### javascript

```js
import '@dineug/erd-editor';

Expand All @@ -34,6 +32,8 @@ const editor = document.createElement('erd-editor');
const editor = document.createElement('erd-editor');
</script>
<!-- or -->
<script src="https://cdn.jsdelivr.net/npm/@dineug/erd-editor/dist/erd-editor.min.js"></script>
```

## ErdEditorElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ const QuickSearch: FC<QuickSearchProps> = (props, ctx) => {
(action, index) => html`
<div
class=${[styles.action, { selected: index === state.index }]}
@click=${() => handlePerform(index)}
@click=${(event: MouseEvent) => {
event.stopPropagation();
handlePerform(index);
}}
>
${action.icon
? html`<div class=${styles.icon}>${action.icon}</div>`
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 43dcd8a

Please sign in to comment.