@input/pen-search 0.1.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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026-present Input B.V.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # @input/pen-search
2
+
3
+ Document search and replacement primitives for Pen.
4
+
5
+ This package is renderer-agnostic. It does not ship a search UI — renderer packages bind the controller to their own primitives.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pnpm add @input/pen-search
11
+ ```
12
+
13
+ ## What It Provides
14
+
15
+ - a headless search controller
16
+ - query navigation and replacement operations
17
+ - document-wide search across blocks and grid-backed cell content
18
+
19
+ This package is renderer-agnostic. Renderer packages can bind the controller state to UI primitives.
20
+
21
+ The packaged extension keeps the runtime contract broad:
22
+
23
+ - search, navigation, and replace work across blocks and tables
24
+ - active grid matches reveal by selecting the containing cell
25
+ - the built-in search decoration helper only highlights block-text matches today
26
+
27
+ Cell-specific visual highlighting needs a richer decoration surface than the current block/inline model.
28
+
29
+ ## Usage
30
+
31
+ ```ts
32
+ import { createEditor } from "@input/pen-core";
33
+ import { searchExtension, getSearchController } from "@input/pen-search";
34
+
35
+ const editor = createEditor({
36
+ extensions: [searchExtension()],
37
+ });
38
+
39
+ const search = getSearchController(editor);
40
+ search?.open();
41
+ ```
42
+
43
+ `searchExtension()` takes no options. Runtime `SearchOptions` on the controller default to:
44
+
45
+ | Option | Default |
46
+ | --------------- | ------- |
47
+ | `caseSensitive` | `false` |
48
+ | `regex` | `false` |
49
+ | `wholeWord` | `false` |
50
+
51
+ ## Facets and commands
52
+
53
+ Contributes the search controller facet (`searchControllerFacet` / `SEARCH_CONTROLLER_SLOT`) and one `keymapFacet` provider per search binding (undeclared priority → `300` → `default`, same as the v1 shim). Bindings, not catalog commands: `Mod-f` opens, `Mod-g` / `Enter` next, `Shift-Mod-g` / `Shift-Enter` previous, `Escape` closes. Requires no other extensions.
54
+
55
+ ## Documentation
56
+
57
+ The docs site (the `@input/pen-docs` package) covers this area on the Extensions and facets page (`#/extensions`).
58
+
59
+ The public signatures of record are in `api-report.md` next to this package's source in the Pen repository. The docs site does not host a generated browsable reference.
60
+
61
+ ## License
62
+
63
+ MIT © Input B.V. See [`LICENSE.md`](./LICENSE.md).