@k8slens/hotbar-contracts 1.0.1 → 2.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k8slens/hotbar-contracts",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "lens": {
5
5
  "env": "renderer",
6
6
  "layer": "business",
@@ -41,10 +41,10 @@
41
41
  "check-types:tests": "lens-types-build --checkTypesTests"
42
42
  },
43
43
  "dependencies": {
44
- "@k8slens/drop-down-menu-contracts": "^1.0.0",
44
+ "@k8slens/composable-responsibilities": "^5.2.0",
45
+ "@k8slens/drop-down-menu-contracts": "^2.0.0",
45
46
  "@k8slens/injectable": "^26.2.0",
46
47
  "@k8slens/injectable-react": "^26.0.7",
47
- "@k8slens/public-utilities": "^1.0.0",
48
48
  "mobx": "^6.15.0",
49
49
  "mobx-react": "^9.2.1",
50
50
  "react": "^19.2.0"
@@ -1,48 +0,0 @@
1
- import { type ManyFactory, type SpecificInjectionToken2 } from "@k8slens/injectable";
2
- import type { MenuItem } from "@k8slens/drop-down-menu-contracts";
3
- import type { MaybePromise } from "@k8slens/public-utilities";
4
- import type { HotbarItemId } from "./hotbar-item-id";
5
- import { type HotbarItemKind } from "./hotbar-item-kind";
6
- /** Produces the menu item for one hotbar item, possibly later. */
7
- export type HotbarItemContextMenuItemFor = (id: HotbarItemId) => MaybePromise<MenuItem>;
8
- /** What `.for(kind).for(scopeIds)` yields: the menu items contributed to one kind as registered under those scopes. */
9
- export type HotbarItemContextMenuItemTokenFor = SpecificInjectionToken2<{
10
- singleFactory: HotbarItemContextMenuItemFor;
11
- manyFactory: ManyFactory<HotbarItemContextMenuItemFor>;
12
- specificTokenFactory: undefined;
13
- cardinality: "zero-or-many";
14
- }>;
15
- /** What `.for(kind)` yields: the kind's menu items, per scope, reached with `.for(scopeIds)`. */
16
- export type HotbarItemContextMenuItemTokenForKind = SpecificInjectionToken2<{
17
- singleFactory: HotbarItemContextMenuItemFor;
18
- manyFactory: ManyFactory<HotbarItemContextMenuItemFor>;
19
- specificTokenFactory: (scopeIds: readonly string[]) => HotbarItemContextMenuItemTokenFor;
20
- cardinality: "zero-or-many";
21
- }>;
22
- /**
23
- * The right-click menu of a hotbar item: one entry per contribution, registered against the
24
- * item's kind via `.for(kind).for(scopeIds)`. The scopes are those of the registration, so the
25
- * `injectionToken` is given as a function of them. The hotbar contributes the way to remove
26
- * the item to every kind itself.
27
- *
28
- * @example
29
- * ```ts
30
- * export const openBookmarkInBrowserInjectable = getInjectable2({
31
- * id: "open-bookmark-in-browser",
32
- * instantiate: () => (id): MenuItem => ({
33
- * id: "open-in-browser",
34
- * kind: "action",
35
- * labelText: "Open in browser",
36
- * onClick: () => openInBrowser(urlOf(id)),
37
- * orderNumber: 10,
38
- * parentId: undefined,
39
- * }),
40
- * injectionToken: ({ scopeIds }) => hotbarItemContextMenuItemInjectionToken.for(bookmarkHotbarItemKind).for(scopeIds),
41
- * });
42
- * ```
43
- */
44
- export declare const hotbarItemContextMenuItemInjectionToken: import("@k8slens/injectable").InjectionToken2Base<HotbarItemContextMenuItemFor, (id: string) => MaybePromise<MenuItem>[], "zero-or-many", (id: string) => import("@k8slens/injectable").InjectionInstanceWithMeta<MaybePromise<MenuItem>>, (id: string) => import("@k8slens/injectable").InjectionInstanceWithMeta<MaybePromise<MenuItem>>[]> & {
45
- readonly __abstract: true;
46
- for: (kind: HotbarItemKind<any>) => HotbarItemContextMenuItemTokenForKind;
47
- };
48
- //# sourceMappingURL=hotbar-item-context-menu-item.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hotbar-item-context-menu-item.d.ts","sourceRoot":"","sources":["../../src/hotbar-item-context-menu-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,WAAW,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACzG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE9E,kEAAkE;AAClE,MAAM,MAAM,4BAA4B,GAAG,CAAC,EAAE,EAAE,YAAY,KAAK,YAAY,CAAC,QAAQ,CAAC,CAAC;AAExF,uHAAuH;AACvH,MAAM,MAAM,iCAAiC,GAAG,uBAAuB,CAAC;IACtE,aAAa,EAAE,4BAA4B,CAAC;IAC5C,WAAW,EAAE,WAAW,CAAC,4BAA4B,CAAC,CAAC;IACvD,oBAAoB,EAAE,SAAS,CAAC;IAChC,WAAW,EAAE,cAAc,CAAC;CAC7B,CAAC,CAAC;AAEH,iGAAiG;AACjG,MAAM,MAAM,qCAAqC,GAAG,uBAAuB,CAAC;IAC1E,aAAa,EAAE,4BAA4B,CAAC;IAC5C,WAAW,EAAE,WAAW,CAAC,4BAA4B,CAAC,CAAC;IACvD,oBAAoB,EAAE,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,KAAK,iCAAiC,CAAC;IACzF,WAAW,EAAE,cAAc,CAAC;CAC7B,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,uCAAuC;;gBAO3C,cAAc,CAAC,GAAG,CAAC,KAAG,qCAAqC;CAmBnE,CAAC"}