@openpicker/sdk 0.2.2 → 0.2.4

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.
Files changed (2) hide show
  1. package/README.md +25 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -61,8 +61,31 @@ if (!matchesSelectorConfig(selector, config)) {
61
61
  }
62
62
  ```
63
63
 
64
- See [Configuring selectors](https://docs.openpicker.dev/guide/configuring-selectors) for the full
65
- model.
64
+ The picker won't return a selector that violates the active rules — it offers a conforming one or
65
+ none. See [Configuring selectors](https://docs.openpicker.dev/guide/configuring-selectors) for the
66
+ full model.
67
+
68
+ ## Restrict which element can be picked
69
+
70
+ `selector` shapes **how** a selector is built; `mustMatch` controls **which** element can be picked.
71
+ Pass a CSS selector and only matching elements are selectable (hovering a descendant snaps to the
72
+ nearest matching ancestor; non-matching elements aren't selectable):
73
+
74
+ ```ts
75
+ op.pick({ url, mustMatch: "input, textarea, select, [contenteditable]" })
76
+ ```
77
+
78
+ The two axes are independent and compose — e.g. "only inputs, identified by id":
79
+
80
+ ```ts
81
+ op.pick({
82
+ url,
83
+ mustMatch: "input, textarea, select, [contenteditable]",
84
+ selector: { class: { enabled: false }, attr: { enabled: false }, tag: { enabled: false } },
85
+ })
86
+ ```
87
+
88
+ An invalid `mustMatch` rejects the pick with `invalid_params`.
66
89
 
67
90
  ## More
68
91
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpicker/sdk",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Open-source CSS element picker — SDK for invoking the openpicker browser extension.",
5
5
  "license": "MIT",
6
6
  "author": "Usertour (https://www.usertour.io)",
@@ -43,7 +43,7 @@
43
43
  "registry": "https://registry.npmjs.org/"
44
44
  },
45
45
  "dependencies": {
46
- "@openpicker/protocol": "^0.1.1"
46
+ "@openpicker/protocol": "^0.1.2"
47
47
  },
48
48
  "devDependencies": {
49
49
  "tsup": "^8.5.0",