@meowdown/react 0.32.0 → 0.33.0

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/README.md CHANGED
@@ -54,6 +54,8 @@ export function App() {
54
54
 
55
55
  See the full API reference [here](https://npmx.dev/package-docs/@meowdown%2Freact/).
56
56
 
57
+ Slash menu host items can include `keywords` to match hidden terms without changing the displayed label.
58
+
57
59
  ## Styling
58
60
 
59
61
  Import both stylesheets: `@meowdown/core/style.css` (the editor theme and variables) and `@meowdown/react/style.css` (the component layout). The core theme is documented in [`@meowdown/core`](https://www.npmjs.com/package/@meowdown/core).
package/dist/index.d.ts CHANGED
@@ -24,7 +24,8 @@ interface EditorHandle {
24
24
  setMarkdown: (markdown: string) => void;
25
25
  /**
26
26
  * Parses `markdown` and inserts it at the current selection as a single
27
- * undoable edit, replacing any selected content. A lone paragraph is
27
+ * undoable edit. An active selection collapses first and is never
28
+ * deleted - this is a host-initiated insert, not a paste. A lone paragraph is
28
29
  * inserted inline at the cursor; anything else is inserted as blocks. The
29
30
  * cursor lands at the end of the inserted content. An empty or
30
31
  * whitespace-only string is a no-op. Unlike `setMarkdown`, it fires
@@ -87,6 +88,8 @@ interface SlashMenuItem {
87
88
  id?: string;
88
89
  /** Display text, matched against the typed query like the built-in items. */
89
90
  label: string;
91
+ /** Extra match terms beyond the label; never displayed. */
92
+ keywords?: string[];
90
93
  /** Secondary text shown beside the label. */
91
94
  detail?: string;
92
95
  /** Runs after the menu closes and the typed `/query` text is removed. */
package/dist/index.js CHANGED
@@ -882,9 +882,9 @@ var autocomplete_menu_module_default = {
882
882
  //#endregion
883
883
  //#region src/components/slash-menu.tsx
884
884
  const regex$2 = canUseRegexLookbehind() ? /(?<!\S)\/(\S.*)?$/u : /\/(\S.*)?$/u;
885
- function SlashMenuItem({ label, detail, kbd, onSelect }) {
885
+ function SlashMenuItem({ label, keywords, detail, kbd, onSelect }) {
886
886
  return /* @__PURE__ */ jsxs(AutocompleteItem, {
887
- value: label,
887
+ value: [label, ...keywords ?? []].join(" "),
888
888
  className: autocomplete_menu_module_default.Item,
889
889
  onSelect,
890
890
  children: [
@@ -1005,6 +1005,7 @@ function SlashMenu({ timeFormat = "12", onSlashMenuSearch }) {
1005
1005
  }),
1006
1006
  hostItems.map((item) => /* @__PURE__ */ jsx(SlashMenuItem, {
1007
1007
  label: item.label,
1008
+ keywords: item.keywords,
1008
1009
  detail: item.detail,
1009
1010
  onSelect: item.onSelect
1010
1011
  }, item.id ?? item.label)),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meowdown/react",
3
3
  "type": "module",
4
- "version": "0.32.0",
4
+ "version": "0.33.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -25,7 +25,7 @@
25
25
  "@prosekit/react": "^0.8.0-beta.15",
26
26
  "clsx": "^2.1.1",
27
27
  "lucide-react": "^1.21.0",
28
- "@meowdown/core": "0.32.0"
28
+ "@meowdown/core": "0.33.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "react": "^19.0.0",