@k8slens/element-components 3.9.0 → 3.9.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.
@@ -36,6 +36,24 @@ export type AnchorPluginProps = {
36
36
  */
37
37
  readonly $anchoredAt?: AnchoredAt;
38
38
  };
39
+ /**
40
+ * Lets {@link useAnchorNameFor} name an element as an anchor. A plugin whose wrapper may anchor
41
+ * what it renders to the element itself adds this to the element's `$className`. The name follows
42
+ * only when nothing else anchors the element, so the class alone changes nothing.
43
+ */
44
+ export declare const anchorableClassName: string;
45
+ /**
46
+ * The anchor name for what a plugin's wrapper renders beside its element and positions with
47
+ * `$anchoredAt` — a menu, say: that of the nearest `$anchor` around the element, the element's own
48
+ * included, or failing that a name of the element's own, which this gives it. Render what is
49
+ * positioned inside {@link AnchorNameProvider} with the returned name, so it finds its anchor.
50
+ *
51
+ * The element needs {@link anchorableClassName} for a name of its own to take effect, and is named
52
+ * only while `isAnchoring`: while what is positioned against it is shown.
53
+ */
54
+ export declare const useAnchorNameFor: (elementRef: React.RefObject<HTMLElement | null>, isAnchoring: boolean) => string | undefined;
55
+ /** Tells what is rendered inside which anchor to position against; see {@link useAnchorNameFor}. */
56
+ export declare const AnchorNameProvider: React.Provider<string | undefined>;
39
57
  export declare const anchorPlugin: import("@k8slens/element-component").Plugin<{
40
58
  $className?: import("@k8slens/public-utilities").IClassName;
41
59
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/anchor/anchor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,KAAK,UAAU,EAAsB,MAAM,kBAAkB,CAAC;AASvE;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GACtB,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,e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C;IAElC,oEAAoE;IACpE,QAAQ,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC;IAE1B,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;CAC7B,CAAC;AAIN,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEpC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;CACnC,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAAgB,CAAC;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,eAAgB,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,eAAe,OAAO,uBAkCrG,CAAC;AAIF,oGAAoG;AACpG,eAAO,MAAM,kBAAkB,oCAA6B,CAAC;AAmJ7D,eAAO,MAAM,YAAY;;;;;;;;;;;;;wBA9NH,KAAK,CAAC,SAAS;uBAMhB,OAAO;2BASH,UAAU;WA4PjC,CAAC"}
@@ -8,8 +8,10 @@ export type DropDownMenuPluginProps = {
8
8
  * from `@k8slens/drop-down-menu-contracts`; the items come from the contributions registered for
9
9
  * the kind.
10
10
  *
11
- * The menu positions itself against the nearest anchor around it, so the element — or something
12
- * enclosing it — declares `$anchor`.
11
+ * The menu positions itself against the nearest `$anchor` around the element, or against the
12
+ * element itself when there is none. Declare `$anchor` on an enclosing element to have the menu
13
+ * line up with that instead, as a menu opened from one half of a split button lines up with the
14
+ * whole of it.
13
15
  *
14
16
  * The menu takes focus as it opens, its first item becoming the current one — except when it
15
17
  * opens by being hovered, where focus stays on the element: the row the pointer rests on is what
@@ -1 +1 @@
1
- {"version":3,"file":"drop-down-menu.d.ts","sourceRoot":"","sources":["../../../../src/plugins/drop-down-menu/drop-down-menu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGxF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,gBAAgB,CAAC;CAC3C,CAAC;AA4OF,eAAO,MAAM,kBAAkB;;;;;;;wBAjQT,KAAK,CAAC,SAAS;wBACf,MAAM;6BAmBD,gBAAgB;WA8Q1C,CAAC"}
1
+ {"version":3,"file":"drop-down-menu.d.ts","sourceRoot":"","sources":["../../../../src/plugins/drop-down-menu/drop-down-menu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGxF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,gBAAgB,CAAC;CAC3C,CAAC;AAqPF,eAAO,MAAM,kBAAkB;;;;;;;wBA5QT,KAAK,CAAC,SAAS;wBACf,MAAM;6BAqBD,gBAAgB;WA6RzC,CAAC"}