@equinor/fusion-framework-cli 9.10.1-msal-a48dcfe523e40243313637b31b0dc70d1b1ddc47 → 9.11.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.
@@ -32,7 +32,7 @@
32
32
  }
33
33
  </style>
34
34
 
35
- <script type="module" crossorigin src="/assets/index-DUTgqy6Z.js"></script>
35
+ <script type="module" crossorigin src="/assets/index-BBPkK1B1.js"></script>
36
36
 
37
37
  <body>
38
38
  <div id="root"></div>
@@ -0,0 +1,3 @@
1
+ import { ContextSearchProps } from '@equinor/fusion-react-context-selector';
2
+ export declare const ContextSelector: (props: ContextSearchProps) => JSX.Element | null;
3
+ export default ContextSelector;
@@ -0,0 +1 @@
1
+ export { ContextSelector } from './ContextSelector';
@@ -0,0 +1,9 @@
1
+ import { IContextProvider } from '@equinor/fusion-framework-module-context';
2
+ import '@equinor/fusion-framework-app';
3
+ import { ContextResult, ContextResolver } from '@equinor/fusion-react-context-selector';
4
+ export declare const useContextResolver: () => {
5
+ resolver: ContextResolver | null;
6
+ provider: IContextProvider | null;
7
+ currentContext: ContextResult;
8
+ };
9
+ export default useContextResolver;
@@ -1 +1 @@
1
- export declare const version = "9.10.0";
1
+ export declare const version = "9.11.0";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const version = '9.10.0';
1
+ export const version = '9.11.0';
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-cli",
3
- "version": "9.10.1-msal-a48dcfe523e40243313637b31b0dc70d1b1ddc47",
3
+ "version": "9.11.0",
4
4
  "keywords": [
5
5
  "Fusion",
6
6
  "Fusion Framework",
@@ -12,21 +12,22 @@
12
12
  "access": "public"
13
13
  },
14
14
  "type": "module",
15
- "main": "./bin/main.js",
16
15
  "bin": {
17
16
  "fusion-framework-cli": "./bin/cli.mjs"
18
17
  },
18
+ "main": "./bin/main.js",
19
+ "types": "./dist/types/lib/index.d.ts",
19
20
  "exports": {
20
21
  ".": {
21
22
  "types": "./dist/types/lib/index.d.ts",
22
23
  "import": "./dist/lib/index.js"
23
24
  }
24
25
  },
25
- "types": "./dist/types/lib/index.d.ts",
26
26
  "dependencies": {
27
27
  "@equinor/eds-core-react": "^0.36.0",
28
28
  "@equinor/eds-icons": "^0.21.0",
29
29
  "@equinor/eds-tokens": "^0.9.2",
30
+ "@equinor/fusion-wc-chip": "^1.2.1",
30
31
  "@equinor/fusion-wc-person": "^2.6.5",
31
32
  "@types/adm-zip": "^0.5.0",
32
33
  "@types/semver": "^7.5.0",
@@ -49,9 +50,9 @@
49
50
  "vite-plugin-environment": "^1.1.3",
50
51
  "vite-plugin-restart": "^0.4.0",
51
52
  "vite-tsconfig-paths": "^4.2.0",
52
- "@equinor/fusion-framework-app": "^9.0.1-msal-a48dcfe523e40243313637b31b0dc70d1b1ddc47",
53
+ "@equinor/fusion-framework-app": "^9.0.1",
54
+ "@equinor/fusion-framework-react-components-people-provider": "^1.3.1",
53
55
  "@equinor/fusion-framework-module-feature-flag": "^1.1.0",
54
- "@equinor/fusion-framework-react-components-people-provider": "^1.3.1-msal-a48dcfe523e40243313637b31b0dc70d1b1ddc47",
55
56
  "@equinor/fusion-observable": "^8.2.0"
56
57
  },
57
58
  "devDependencies": {
@@ -71,18 +72,18 @@
71
72
  "rxjs": "^7.8.1",
72
73
  "styled-components": "^6.0.7",
73
74
  "typescript": "^5.4.2",
74
- "@equinor/fusion-framework": "^7.1.1-msal-a48dcfe523e40243313637b31b0dc70d1b1ddc47",
75
- "@equinor/fusion-framework-app": "^9.0.1-msal-a48dcfe523e40243313637b31b0dc70d1b1ddc47",
76
- "@equinor/fusion-framework-module-app": "^5.3.0",
75
+ "@equinor/fusion-framework": "^7.1.1",
76
+ "@equinor/fusion-framework-app": "^9.0.1",
77
77
  "@equinor/fusion-framework-module-bookmark": "^1.2.0",
78
+ "@equinor/fusion-framework-module-app": "^5.3.0",
79
+ "@equinor/fusion-framework-module-http": "^5.2.0",
80
+ "@equinor/fusion-framework-module-msal": "^3.1.0",
78
81
  "@equinor/fusion-framework-module-context": "^5.0.0",
79
- "@equinor/fusion-framework-module-http": "^5.2.1-msal-a48dcfe523e40243313637b31b0dc70d1b1ddc47",
80
82
  "@equinor/fusion-framework-module-navigation": "^4.0.0",
81
- "@equinor/fusion-framework-module-msal": "^3.2.0-msal-a48dcfe523e40243313637b31b0dc70d1b1ddc47",
82
- "@equinor/fusion-framework-module-services": "^4.0.0",
83
- "@equinor/fusion-framework-react": "^7.0.1-msal-a48dcfe523e40243313637b31b0dc70d1b1ddc47",
84
- "@equinor/fusion-framework-react-module-bookmark": "^2.1.1-msal-a48dcfe523e40243313637b31b0dc70d1b1ddc47",
85
- "@equinor/fusion-framework-react-components-bookmark": "^0.4.1-msal-a48dcfe523e40243313637b31b0dc70d1b1ddc47",
83
+ "@equinor/fusion-framework-react": "^7.0.1",
84
+ "@equinor/fusion-framework-module-services": "^4.0.1",
85
+ "@equinor/fusion-framework-react-components-bookmark": "^0.4.1",
86
+ "@equinor/fusion-framework-react-module-bookmark": "^2.1.1",
86
87
  "@equinor/fusion-query": "^4.1.0"
87
88
  },
88
89
  "scripts": {
@@ -1,134 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { jsx as _jsx } from "react/jsx-runtime";
11
- import { useCallback, useMemo, useState } from 'react';
12
- import { useFramework } from '@equinor/fusion-framework-react';
13
- import { useCurrentApp } from '@equinor/fusion-framework-react/app';
14
- import { useObservableState, useObservableSubscription } from '@equinor/fusion-observable/react';
15
- import { EMPTY } from 'rxjs';
16
- import { ContextProvider, ContextSearch, } from '@equinor/fusion-react-context-selector';
17
- import { styled } from 'styled-components';
18
- const Styled = {
19
- ContextSelectorWrapper: styled.div `
20
- min-width: 25rem;
21
- width: fit-content;
22
- `,
23
- };
24
- const mapper = (src) => {
25
- return src.map((i) => {
26
- var _a, _b;
27
- return {
28
- id: i.id,
29
- title: i.title,
30
- subTitle: (_a = i.type) === null || _a === void 0 ? void 0 : _a.id,
31
- graphic: ((_b = i.type) === null || _b === void 0 ? void 0 : _b.id) === 'OrgChart' ? 'list' : undefined,
32
- };
33
- });
34
- };
35
- const singleItem = (props) => {
36
- return Object.assign({ id: 'no-such-item', title: 'Change me' }, props);
37
- };
38
- const noPreselect = [];
39
- const processError = (err) => {
40
- if (err.name === 'QueryClientError') {
41
- return processError(err.cause);
42
- }
43
- if (err.name === 'FusionContextSearchError') {
44
- const error = err;
45
- return [
46
- singleItem({
47
- id: error.name,
48
- title: error.title,
49
- subTitle: error.description,
50
- graphic: 'error_outlined',
51
- isDisabled: true,
52
- }),
53
- ];
54
- }
55
- return [
56
- singleItem({
57
- title: 'Unexpected error occurred',
58
- subTitle: 'Please try again or report the issue in Services@Equinor',
59
- graphic: 'error_outlined',
60
- isDisabled: true,
61
- }),
62
- ];
63
- };
64
- const useQueryContext = () => {
65
- const framework = useFramework();
66
- const { value: currentContext } = useObservableState(useMemo(() => framework.modules.context.currentContext$, [framework.modules.context]));
67
- const preselected = useMemo(() => (currentContext ? mapper([currentContext]) : noPreselect), [currentContext]);
68
- const [provider, setProvider] = useState(null);
69
- const { currentApp } = useCurrentApp();
70
- const instance$ = useMemo(() => (currentApp === null || currentApp === void 0 ? void 0 : currentApp.instance$) || EMPTY, [currentApp]);
71
- const onContextProviderChange = useCallback((modules) => {
72
- const contextProvider = modules.context;
73
- if (contextProvider) {
74
- setProvider(contextProvider);
75
- }
76
- }, [setProvider]);
77
- const clearContextProvider = useCallback(() => setProvider(null), [setProvider]);
78
- useObservableSubscription(instance$, onContextProviderChange, clearContextProvider);
79
- const minLength = 3;
80
- const resolver = useMemo(() => ({
81
- searchQuery: (search) => __awaiter(void 0, void 0, void 0, function* () {
82
- if (!provider) {
83
- return [];
84
- }
85
- if (search.length < minLength) {
86
- return [
87
- singleItem({
88
- id: 'min-length',
89
- title: `Type ${minLength - search.length} more chars to search`,
90
- isDisabled: true,
91
- }),
92
- ];
93
- }
94
- try {
95
- const result = yield provider.queryContextAsync(search);
96
- if (result.length) {
97
- return mapper(result);
98
- }
99
- return [
100
- singleItem({
101
- id: 'no-results',
102
- title: 'No results found',
103
- graphic: 'info_circle',
104
- isDisabled: true,
105
- }),
106
- ];
107
- }
108
- catch (e) {
109
- const err = e;
110
- console.log('ContextResolver query was cancelled');
111
- return processError(err);
112
- }
113
- }),
114
- initialResult: preselected,
115
- }), [provider, preselected]);
116
- const setContext = useCallback((e) => {
117
- var _a;
118
- if ((_a = e.nativeEvent.detail) === null || _a === void 0 ? void 0 : _a.selected.length) {
119
- framework.modules.context.setCurrentContextByIdAsync(e.nativeEvent.detail.selected[0].id);
120
- }
121
- }, [framework]);
122
- const clearContext = useCallback(() => {
123
- if (!framework)
124
- return;
125
- framework.modules.context.clearCurrentContext();
126
- }, [framework]);
127
- return [resolver, setContext, preselected === null || preselected === void 0 ? void 0 : preselected[0], clearContext];
128
- };
129
- export const ContextSelector = () => {
130
- const [resolver, setContext, currentContext, clearContext] = useQueryContext();
131
- return (_jsx(ContextProvider, { resolver: resolver, children: _jsx(Styled.ContextSelectorWrapper, { children: _jsx(ContextSearch, { id: "context-selector-header", placeholder: "Search for context", initialText: "Start typing to search", dropdownHeight: "300px", variant: "header", onSelect: setContext, autofocus: true, onClearContext: clearContext, previewItem: currentContext !== null && currentContext !== void 0 ? currentContext : null, value: currentContext === null || currentContext === void 0 ? void 0 : currentContext.title, selectedId: currentContext === null || currentContext === void 0 ? void 0 : currentContext.title }) }) }));
132
- };
133
- export default ContextSelector;
134
- //# sourceMappingURL=ContextSelector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextSelector.js","sourceRoot":"","sources":["../../../src/bin/dev-portal/ContextSelector.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAOpE,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAEjG,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAE7B,OAAO,EACH,eAAe,EACf,aAAa,GAKhB,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,MAAM,MAAM,GAAG;IACX,sBAAsB,EAAE,MAAM,CAAC,GAAG,CAAA;;;KAGjC;CACJ,CAAC;AAQF,MAAM,MAAM,GAAG,CAAC,GAAuB,EAAiB,EAAE;IACtD,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;;QACjB,OAAO;YACH,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,QAAQ,EAAE,MAAA,CAAC,CAAC,IAAI,0CAAE,EAAE;YACpB,OAAO,EAAE,CAAA,MAAA,CAAC,CAAC,IAAI,0CAAE,EAAE,MAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;SAC1D,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAOF,MAAM,UAAU,GAAG,CAAC,KAAiC,EAAqB,EAAE;IACxE,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,E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