@openpicker/protocol 0.1.1 → 0.1.2

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/dist/index.d.cts CHANGED
@@ -100,6 +100,18 @@ interface PickParams {
100
100
  lockSelectorEdit?: boolean;
101
101
  /** Only allow confirming (OK) when the selector matches exactly one element. Default: false. */
102
102
  requireUniqueMatch?: boolean;
103
+ /**
104
+ * Restrict which elements can be picked: the user may only select an element that
105
+ * matches this CSS selector — hovering a descendant snaps to the nearest matching
106
+ * ancestor (Element.closest), and elements with no match are not selectable
107
+ * (not-allowed cursor, click ignored). A comma list works:
108
+ * "input, textarea, select, [contenteditable]". Omit for no restriction.
109
+ *
110
+ * Orthogonal to {@link selector}: `mustMatch` decides WHICH element is picked,
111
+ * `selector` decides HOW its selector is built. Must be a valid CSS selector — an
112
+ * invalid one rejects the pick with `invalid_params`.
113
+ */
114
+ mustMatch?: string;
103
115
  }
104
116
  interface PickedElement {
105
117
  tag: string;
package/dist/index.d.ts CHANGED
@@ -100,6 +100,18 @@ interface PickParams {
100
100
  lockSelectorEdit?: boolean;
101
101
  /** Only allow confirming (OK) when the selector matches exactly one element. Default: false. */
102
102
  requireUniqueMatch?: boolean;
103
+ /**
104
+ * Restrict which elements can be picked: the user may only select an element that
105
+ * matches this CSS selector — hovering a descendant snaps to the nearest matching
106
+ * ancestor (Element.closest), and elements with no match are not selectable
107
+ * (not-allowed cursor, click ignored). A comma list works:
108
+ * "input, textarea, select, [contenteditable]". Omit for no restriction.
109
+ *
110
+ * Orthogonal to {@link selector}: `mustMatch` decides WHICH element is picked,
111
+ * `selector` decides HOW its selector is built. Must be a valid CSS selector — an
112
+ * invalid one rejects the pick with `invalid_params`.
113
+ */
114
+ mustMatch?: string;
103
115
  }
104
116
  interface PickedElement {
105
117
  tag: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpicker/protocol",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Open postMessage protocol for the openpicker CSS element picker — wire types, constants, and selector helpers.",
5
5
  "license": "MIT",
6
6
  "author": "Usertour (https://www.usertour.io)",