diff --git a/public/snippets/installation-define-actions.html b/public/snippets/installation-define-actions.html new file mode 100644 index 0000000..37f1f6e --- /dev/null +++ b/public/snippets/installation-define-actions.html @@ -0,0 +1,25 @@ +
import { defineAction } from 'solid-command-palette';
+
+const minimalAction = defineAction({
+ id: 'minimal',
+ title: 'Minimal Action',
+ run: () => {
+ console.log('ran minimal action');
+ },
+});
+
+const incrementCounterAction = defineAction({
+ id: 'increment-counter',
+ title: 'Increment Counter by 1',
+ subtitle: 'Press CMD + E to trigger this.',
+ shortcut: '$mod+e', // $mod = Command on Mac & Control on Windows.
+ run: ({ rootContext }) => {
+ rootContext.increment();
+ },
+});
+
+export const actions = {
+ [minimalAction.id]: minimalAction,
+ [incrementCounterAction.id]: incrementCounterAction,
+};
+
\ No newline at end of file
diff --git a/public/snippets/installation-integrate-components.html b/public/snippets/installation-integrate-components.html
new file mode 100644
index 0000000..9ed75b0
--- /dev/null
+++ b/public/snippets/installation-integrate-components.html
@@ -0,0 +1,23 @@
+import { Root, CommandPalette } from 'solid-command-palette';
+import { actions } from './actions';
+import 'solid-command-palette/pkg-dist/style.css';
+
+const App = () => {
+ const actionsContext = {
+ increment() {
+ console.log('increment count state by 1');
+ },
+ };
+
+ return (
+ <div class="my-app">
+ <Root
+ actions={actions}
+ actionsContext={actionsContext}
+ >
+ <CommandPalette />
+ </Root>
+ </div>
+ );
+};
+
\ No newline at end of file
diff --git a/public/snippets/installation-packages.html b/public/snippets/installation-packages.html
new file mode 100644
index 0000000..15b6331
--- /dev/null
+++ b/public/snippets/installation-packages.html
@@ -0,0 +1,6 @@
+# Core Library
+npm install solid-command-palette
+
+# Peer Dependencies
+npm install solid-transition-group tinykeys fuse.js
+
\ No newline at end of file
diff --git a/snippets/installation-define-actions.snippet.tsx b/snippets/installation-define-actions.snippet.tsx
new file mode 100644
index 0000000..998aea9
--- /dev/null
+++ b/snippets/installation-define-actions.snippet.tsx
@@ -0,0 +1,24 @@
+import { defineAction } from 'solid-command-palette';
+
+const minimalAction = defineAction({
+ id: 'minimal',
+ title: 'Minimal Action',
+ run: () => {
+ console.log('ran minimal action');
+ },
+});
+
+const incrementCounterAction = defineAction({
+ id: 'increment-counter',
+ title: 'Increment Counter by 1',
+ subtitle: 'Press CMD + E to trigger this.',
+ shortcut: '$mod+e', // $mod = Command on Mac & Control on Windows.
+ run: ({ rootContext }) => {
+ rootContext.increment();
+ },
+});
+
+export const actions = {
+ [minimalAction.id]: minimalAction,
+ [incrementCounterAction.id]: incrementCounterAction,
+};
diff --git a/snippets/installation-integrate-components.snippet.tsx b/snippets/installation-integrate-components.snippet.tsx
new file mode 100644
index 0000000..8baf57a
--- /dev/null
+++ b/snippets/installation-integrate-components.snippet.tsx
@@ -0,0 +1,22 @@
+import { Root, CommandPalette } from 'solid-command-palette';
+import { actions } from './actions';
+import 'solid-command-palette/pkg-dist/style.css';
+
+const App = () => {
+ const actionsContext = {
+ increment() {
+ console.log('increment count state by 1');
+ },
+ };
+
+ return (
+