@adminide-stack/extension-api 10.2.2-alpha.12 → 10.2.2-alpha.17

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.
@@ -0,0 +1,32 @@
1
+ import React__default,{useState,useEffect}from'react';import {Subscription,map}from'rxjs';import {useExtensionController}from'../../useExtensionController.js';import {ContributableViewContainer}from'../../../interfaces/contributions/contribution.js';const ViewComponent = props => {
2
+ const [panelView, setPanelView] = useState(null);
3
+ const controller = useExtensionController();
4
+ const subscriptions = new Subscription();
5
+ useEffect(() => {
6
+ subscriptions.add(controller?.services.panelView.getPanelViews(ContributableViewContainer.Panel).pipe(map(views => ({
7
+ views
8
+ }))).subscribe(stateUpdate => {
9
+ const view = stateUpdate.views.find(v => v.id === props.viewId);
10
+ setPanelView(view);
11
+ }));
12
+ return () => {
13
+ subscriptions.unsubscribe();
14
+ };
15
+ }, [controller?.services, props.viewId]);
16
+ if (!(props.viewId && props.visible && panelView)) {
17
+ return null;
18
+ }
19
+ const {
20
+ reactElement,
21
+ id
22
+ } = panelView;
23
+ return React__default.createElement("div", {
24
+ id: id
25
+ }, reactElement ? {
26
+ ...reactElement,
27
+ props: {
28
+ ...reactElement.props,
29
+ ...props.elementProps
30
+ }
31
+ } : null);
32
+ };export{ViewComponent};//# sourceMappingURL=ViewComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewComponent.js","sources":["../../../../src/react/components/view-component/ViewComponent.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"0PAYa,MAAA,aAAa,GAAG,KAAC,IAAyB;QAC7C,CAAA,SAAU,EAAA,YAAc,CAAA,WAAY,CAAA,IAAK,CAAA;AAC/C,EAAA,MAAA,UAAgB,GAAA,sBAAyB,EAAA;AACzC,EAAA,MAAA,aAAmB,GAAA,IAAO,YAAA,EAAY;WAE7B,CAAA,MAAM;AACX,IAAA,aAAA,CAAA,GAAa,CAAC,oBACE,CAAA,SAAkB,CAAA,aAAA,CAAA,0BAAA,CAAA,KAAA,CAAA,CAAA,IAAA,CAAA,GAAA,CAAA,KAAA,KAAA;AACzB,MAAA;AACA,KAAA,CAAA,CAAA,CAAA,CAAA,SAAK,CAAA,WAAY,IAAI;AACrB,MAAA,MAAA,IAAA,GAAA,WAAsB,CAAA,KAAA,CAAE,IAAE,CAAA,CAAA,IAAA,CAAA,CAAA,EAAA,KAAA,KAAA,CAAA,MAAA,CAAA;kBACjB,CAAA;;WAGjB,MAAC;AAEF,MAAA,aAAY,CAAA,WAAA,EAAA;;AAEZ,GAAA,EAAA,CAAA,UAAE,EAAA,QAAA,EAAA,KAAA,CAAA,MAAA,CAAA,CAAA;MACL,EAAG,KAAA,CAAA,MAAY,IAAA,KAAU,CAAA,OAAM,IAAA,SAAS,CAAA,EAAA;AAEzC,IAAA,OAAW,IAAA;AACP;QACH;AACD,IAAA,YAAoB;AACpB,IAAA;AAGY,GAAA,GAAA,SAAE;AACI,EAAA,OAAAA,cAAA,CAAG,aAAY,CAAA,KAAA,EAAA;;AAElB,GAAA,EAAA,YAAA,GAAA;AACH,IAAA,GAAA,YAEV;AACN,IAAE,KAAA,EAAA;;;;;"}
@@ -0,0 +1 @@
1
+ export{useExtensionController}from'./useExtensionController.js';export{ViewComponent}from'./components/view-component/ViewComponent.js';//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import*as React from'react';import {InversifyContext}from'@common-stack/client-react';import {ClientContainerService}from'common/lib/generated/generated-models.js';const isBrowser = typeof document !== 'undefined';
2
+ function useExtensionController() {
3
+ const {
4
+ container
5
+ } = React.useContext(InversifyContext);
6
+ const [extensionController, setExtensionController] = React.useState(null);
7
+ React.useEffect(() => {
8
+ if (isBrowser && container.isBound(ClientContainerService.ExtensionController)) {
9
+ const controller = container.get(ClientContainerService.ExtensionController);
10
+ setExtensionController(controller);
11
+ }
12
+ }, [container]);
13
+ return extensionController;
14
+ }export{useExtensionController};//# sourceMappingURL=useExtensionController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useExtensionController.js","sources":["../../src/react/useExtensionController.ts"],"sourcesContent":[null],"names":[],"mappings":"oKAKA,MAAM,SAAS,GAAG,OAAO,QAAQ,KAAK,WAAW;SAEjC,sBAAsB,GAAA;QAC5B;AACN,IAAA;AAEA,GAAA,GAAA,KAAM,CAAA,UAAU,CAAG,gBAAE,CAAA;QACjB,CAAI,mBAAa,EAAA,sBAAkB,CAAA,GAAA,KAAA,CAAA,QAAuB,CAAA,IAAA,CAAA;iBAChD,CAAA,MAAA;iBACgB,IAAA,SAAA,CAAA,OAAW,CAAA,sBAAE,CAAA,mBAAA,CAAA,EAAA;YACtC,UAAA,GAAA,SAAA,CAAA,GAAA,CAAA,sBAAA,CAAA,mBAAA,CAAA;AACL,MAAG,sBAAa,CAAA,UAAA,CAAA;AAEhB;AACJ,GAAC,EAAA,CAAA,SAAA,CAAA,CAAA;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminide-stack/extension-api",
3
- "version": "10.2.2-alpha.12",
3
+ "version": "10.2.2-alpha.17",
4
4
  "description": "Workbench core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -21,11 +21,11 @@
21
21
  "watch": "npm run build:lib:watch"
22
22
  },
23
23
  "dependencies": {
24
- "@adminide-stack/core": "10.2.2-alpha.12",
24
+ "@adminide-stack/core": "10.2.2-alpha.17",
25
25
  "@workbench-stack/core": "3.9.7",
26
26
  "abort-controller": "^3.0.0",
27
- "cdeops": "10.2.2-alpha.5",
28
- "common": "10.2.2-alpha.12",
27
+ "cdeops": "10.2.2-alpha.17",
28
+ "common": "10.2.2-alpha.17",
29
29
  "minimatch": "^10.0.0",
30
30
  "queueing-subject": "0.3.4",
31
31
  "utility-types": "^3.10.0",
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "a04e19e58f280d45518e482fa4bbed6101f785c8",
44
+ "gitHead": "3692fe66b945b3695663918b7f305743c696b092",
45
45
  "typescript": {
46
46
  "definition": "lib/index.d.ts"
47
47
  }