@equinor/fusion-framework-module-bookmark 0.1.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/CHANGELOG.md +16 -0
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/dist/esm/bookmark-config-builder.js +70 -0
- package/dist/esm/bookmark-config-builder.js.map +1 -0
- package/dist/esm/bookmark-provider.js +130 -0
- package/dist/esm/bookmark-provider.js.map +1 -0
- package/dist/esm/client/bookmarkActions.js +8 -0
- package/dist/esm/client/bookmarkActions.js.map +1 -0
- package/dist/esm/client/bookmarkClient.js +212 -0
- package/dist/esm/client/bookmarkClient.js.map +1 -0
- package/dist/esm/client/bookmarkFlows.js +30 -0
- package/dist/esm/client/bookmarkFlows.js.map +1 -0
- package/dist/esm/client/bookmarkReducer.js +23 -0
- package/dist/esm/client/bookmarkReducer.js.map +1 -0
- package/dist/esm/configurator.js +172 -0
- package/dist/esm/configurator.js.map +1 -0
- package/dist/esm/enable-bookmark.js +10 -0
- package/dist/esm/enable-bookmark.js.map +1 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/module.js +27 -0
- package/dist/esm/module.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils/handle-url.js +11 -0
- package/dist/esm/utils/handle-url.js.map +1 -0
- package/dist/esm/utils/index.js +2 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/bookmark-config-builder.d.ts +25 -0
- package/dist/types/bookmark-provider.d.ts +63 -0
- package/dist/types/client/bookmarkActions.d.ts +21 -0
- package/dist/types/client/bookmarkClient.d.ts +48 -0
- package/dist/types/client/bookmarkFlows.d.ts +22 -0
- package/dist/types/client/bookmarkReducer.d.ts +5 -0
- package/dist/types/configurator.d.ts +47 -0
- package/dist/types/enable-bookmark.d.ts +4 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/module.d.ts +22 -0
- package/dist/types/types.d.ts +54 -0
- package/dist/types/utils/handle-url.d.ts +2 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +48 -0
- package/src/bookmark-config-builder.ts +171 -0
- package/src/bookmark-provider.ts +288 -0
- package/src/client/bookmarkActions.ts +34 -0
- package/src/client/bookmarkClient.ts +290 -0
- package/src/client/bookmarkFlows.ts +66 -0
- package/src/client/bookmarkReducer.ts +29 -0
- package/src/configurator.ts +260 -0
- package/src/enable-bookmark.ts +32 -0
- package/src/index.ts +18 -0
- package/src/module.ts +40 -0
- package/src/types.ts +65 -0
- package/src/utils/handle-url.ts +13 -0
- package/src/utils/index.ts +1 -0
- package/tsconfig.json +36 -0
|
@@ -0,0 +1,172 @@
|
|
|
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
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
13
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
|
+
};
|
|
15
|
+
var _BookmarkModuleConfigurator_instances, _BookmarkModuleConfigurator_configBuilders, _BookmarkModuleConfigurator_applyParentProviderConfiguration;
|
|
16
|
+
import { getBookmarkIdFormURL } from './utils/handle-url';
|
|
17
|
+
import { BookmarkConfigBuilder } from './bookmark-config-builder';
|
|
18
|
+
export class BookmarkModuleConfigurator {
|
|
19
|
+
constructor() {
|
|
20
|
+
_BookmarkModuleConfigurator_instances.add(this);
|
|
21
|
+
this.defaultExpireTime = 1 * 60 * 1000;
|
|
22
|
+
_BookmarkModuleConfigurator_configBuilders.set(this, []);
|
|
23
|
+
}
|
|
24
|
+
addConfigBuilder(init) {
|
|
25
|
+
__classPrivateFieldGet(this, _BookmarkModuleConfigurator_configBuilders, "f").push(init);
|
|
26
|
+
}
|
|
27
|
+
createConfig(init, parentProvider) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const config = yield __classPrivateFieldGet(this, _BookmarkModuleConfigurator_configBuilders, "f").reduce((cur, cb) => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
const builder = new BookmarkConfigBuilder(init, yield cur);
|
|
31
|
+
yield Promise.resolve(cb(builder));
|
|
32
|
+
return Object.assign(cur, builder.config);
|
|
33
|
+
}), Promise.resolve({}));
|
|
34
|
+
const appProvider = yield this._getAppProvider(init);
|
|
35
|
+
__classPrivateFieldGet(this, _BookmarkModuleConfigurator_instances, "m", _BookmarkModuleConfigurator_applyParentProviderConfiguration).call(this, parentProvider, config);
|
|
36
|
+
if (!config.resolveBookmarkId) {
|
|
37
|
+
config.resolveBookmarkId = getBookmarkIdFormURL;
|
|
38
|
+
}
|
|
39
|
+
if (!config.getCurrentAppIdentification) {
|
|
40
|
+
config.getCurrentAppIdentification = () => { var _a; return (_a = appProvider.current) === null || _a === void 0 ? void 0 : _a.appKey; };
|
|
41
|
+
}
|
|
42
|
+
if (!config.getContextId) {
|
|
43
|
+
const contextProvider = yield this._getContextProvider(init);
|
|
44
|
+
config.getContextId = () => {
|
|
45
|
+
var _a;
|
|
46
|
+
return (_a = contextProvider.currentContext) === null || _a === void 0 ? void 0 : _a.id;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (!config.event) {
|
|
50
|
+
const event = yield this._getEventProvider(init);
|
|
51
|
+
config.event = event;
|
|
52
|
+
}
|
|
53
|
+
config.clientConfiguration = yield this._createClientConfiguration(init, config.clientConfiguration);
|
|
54
|
+
if (!config.sourceSystem) {
|
|
55
|
+
throw Error('missing sourceSystem configuration');
|
|
56
|
+
}
|
|
57
|
+
return config;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
_createClientConfiguration(init, config = {}) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
if (!config.client) {
|
|
63
|
+
const apiProvider = yield this._getServiceProvider(init);
|
|
64
|
+
config.client = yield apiProvider.createBookmarksClient('fetch');
|
|
65
|
+
}
|
|
66
|
+
if (!config.queryClientConfig) {
|
|
67
|
+
const apiProvider = yield this._getServiceProvider(init);
|
|
68
|
+
const bookmarkClient = yield apiProvider.createBookmarksClient('json$');
|
|
69
|
+
config.queryClientConfig = Object.assign({ getBookmarkById: {
|
|
70
|
+
client: {
|
|
71
|
+
fn: (args) => bookmarkClient.get('v1', args),
|
|
72
|
+
},
|
|
73
|
+
key: ({ id }) => id,
|
|
74
|
+
expire: this.defaultExpireTime,
|
|
75
|
+
}, getAllBookmarks: {
|
|
76
|
+
client: {
|
|
77
|
+
fn: () => bookmarkClient.getAll('v1'),
|
|
78
|
+
},
|
|
79
|
+
key: () => 'all-bookmarks',
|
|
80
|
+
validate: ({ args }) => args.isValid,
|
|
81
|
+
expire: this.defaultExpireTime,
|
|
82
|
+
} }, bookmarkClient);
|
|
83
|
+
}
|
|
84
|
+
return config;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
_getServiceProvider(init) {
|
|
88
|
+
var _a;
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
if (init.hasModule('services')) {
|
|
91
|
+
return init.requireInstance('services');
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
const parentServiceModule = (_a = init.ref) === null || _a === void 0 ? void 0 : _a.services;
|
|
95
|
+
if (parentServiceModule) {
|
|
96
|
+
return parentServiceModule;
|
|
97
|
+
}
|
|
98
|
+
throw Error('[BookmarkConfigurator] No service provider configures [ServicesModule] ');
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
_getContextProvider(init) {
|
|
103
|
+
var _a;
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
if (init.hasModule('context')) {
|
|
106
|
+
return init.requireInstance('context');
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
const parentContextModule = (_a = init.ref) === null || _a === void 0 ? void 0 : _a.context;
|
|
110
|
+
if (parentContextModule) {
|
|
111
|
+
return parentContextModule;
|
|
112
|
+
}
|
|
113
|
+
throw Error('[BookmarkConfigurator] No context provider configures [ContextModule]');
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
_getAppProvider(init) {
|
|
118
|
+
var _a;
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
if (init.hasModule('app')) {
|
|
121
|
+
return init.requireInstance('app');
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
const parentAppModule = (_a = init.ref) === null || _a === void 0 ? void 0 : _a.app;
|
|
125
|
+
if (parentAppModule) {
|
|
126
|
+
return parentAppModule;
|
|
127
|
+
}
|
|
128
|
+
throw Error('[BookmarkConfigurator] No app provider configures [AppModule]');
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
_getEventProvider(init) {
|
|
133
|
+
var _a;
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
if (init.hasModule('event')) {
|
|
136
|
+
return init.requireInstance('event');
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
const parentEventModule = (_a = init.ref) === null || _a === void 0 ? void 0 : _a.event;
|
|
140
|
+
if (parentEventModule) {
|
|
141
|
+
return parentEventModule;
|
|
142
|
+
}
|
|
143
|
+
throw Error('[BookmarkConfigurator] No event provider configures [EventModule]');
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
_getNavigationProvider(init) {
|
|
148
|
+
var _a;
|
|
149
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
150
|
+
if (init.hasModule('navigation')) {
|
|
151
|
+
return init.requireInstance('navigation');
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
const parentNavigationModule = (_a = init.ref) === null || _a === void 0 ? void 0 : _a.navigation;
|
|
155
|
+
if (parentNavigationModule) {
|
|
156
|
+
return parentNavigationModule;
|
|
157
|
+
}
|
|
158
|
+
throw Error('[BookmarkConfigurator] No navigation provider configures [NavigationModule]');
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
_BookmarkModuleConfigurator_configBuilders = new WeakMap(), _BookmarkModuleConfigurator_instances = new WeakSet(), _BookmarkModuleConfigurator_applyParentProviderConfiguration = function _BookmarkModuleConfigurator_applyParentProviderConfiguration(parentProvider, config) {
|
|
164
|
+
if (parentProvider) {
|
|
165
|
+
config.clientConfiguration = parentProvider.config.clientConfiguration;
|
|
166
|
+
config.sourceSystem = parentProvider.config.sourceSystem;
|
|
167
|
+
config.getContextId = parentProvider.config.getContextId;
|
|
168
|
+
config.getCurrentAppIdentification = parentProvider.config.getCurrentAppIdentification;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
export default BookmarkModuleConfigurator;
|
|
172
|
+
//# sourceMappingURL=configurator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator.js","sourceRoot":"","sources":["../../src/configurator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EA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BAA2B,CAAC;KAC1F;AACL,CAAC;AAmHL,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { module } from './module';
|
|
2
|
+
export const enableBookmark = (configurator, builder) => {
|
|
3
|
+
configurator.addConfig({
|
|
4
|
+
module,
|
|
5
|
+
configure: (contextConfigurator) => {
|
|
6
|
+
builder && contextConfigurator.addConfigBuilder(builder);
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=enable-bookmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enable-bookmark.js","sourceRoot":"","sources":["../../src/enable-bookmark.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAMlC,MAAM,CAAC,MAAM,cAAc,GAAG,CAE1B,YAA4C,EAC5C,OAKyB,EACrB,EAAE;IACN,YAAY,CAAC,SAAS,CAAC;QACnB,MAAM;QACN,SAAS,EAAE,CAAC,mBAAmB,EAAE,EAAE;YAC/B,OAAO,IAAI,mBAAmB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC7D,CAAC;KACJ,CAAC,CAAC;AACP,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BookmarkModuleConfigurator, } from './configurator';
|
|
2
|
+
export { default, module as bookmarkModule, moduleKey as bookmarkModuleKey, } from './module';
|
|
3
|
+
export { BookmarkModuleProvider } from './bookmark-provider';
|
|
4
|
+
export { enableBookmark } from './enable-bookmark';
|
|
5
|
+
export * from './types';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,0BAA0B,GAG7B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,OAAO,EAEP,MAAM,IAAI,cAAc,EACxB,SAAS,IAAI,iBAAiB,GACjC,MAAM,UAAU,CAAC;AAElB,OAAO,EAA2B,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEtF,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { BookmarkModuleProvider } from './bookmark-provider';
|
|
11
|
+
import { BookmarkModuleConfigurator } from './configurator';
|
|
12
|
+
export const moduleKey = 'bookmark';
|
|
13
|
+
export const module = {
|
|
14
|
+
name: moduleKey,
|
|
15
|
+
configure: () => new BookmarkModuleConfigurator(),
|
|
16
|
+
initialize: (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
var _a;
|
|
18
|
+
const ref = (_a = args.ref) === null || _a === void 0 ? void 0 : _a.bookmark;
|
|
19
|
+
const config = yield args.config.createConfig(args, ref);
|
|
20
|
+
return new BookmarkModuleProvider(config, ref);
|
|
21
|
+
}),
|
|
22
|
+
dispose: (args) => {
|
|
23
|
+
args.instance.dispose();
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
export default module;
|
|
27
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":";;;;;;;;;AAKA,OAAO,EAAE,sBAAsB,EAA2B,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,0BAA0B,EAA+B,MAAM,gBAAgB,CAAC;AAIzF,MAAM,CAAC,MAAM,SAAS,GAAsB,UAAU,CAAC;AASvD,MAAM,CAAC,MAAM,MAAM,GAAmB;IAClC,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,0BAA0B,EAAE;IACjD,UAAU,EAAE,CAAO,IAAI,EAAE,EAAE;;QACvB,MAAM,GAAG,GAAG,MAAC,IAAI,CAAC,GAAyC,0CAAE,QAAQ,CAAC;QACtE,MAAM,MAAM,GAAG,MAAO,IAAI,CAAC,MAAqC,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAEzF,OAAO,IAAI,sBAAsB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC,CAAA;IACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QACb,IAAI,CAAC,QAAmC,CAAC,OAAO,EAAE,CAAC;IACxD,CAAC;CACJ,CAAC;AAQF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const BOOKMARK_SEARCH_PARAM = 'bookmarkId';
|
|
2
|
+
export function removeBookmarkIdFromURL() {
|
|
3
|
+
const params = new URLSearchParams(document.location.search);
|
|
4
|
+
params.delete(BOOKMARK_SEARCH_PARAM);
|
|
5
|
+
document.location.search = params.toString();
|
|
6
|
+
}
|
|
7
|
+
export const getBookmarkIdFormURL = () => {
|
|
8
|
+
const params = new URLSearchParams(document.location.search);
|
|
9
|
+
return params.get(BOOKMARK_SEARCH_PARAM);
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=handle-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-url.js","sourceRoot":"","sources":["../../../src/utils/handle-url.ts"],"names":[],"mappings":"AAAA,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAE3C,MAAM,UAAU,uBAAuB;IACnC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7D,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAErC,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;AACjD,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAkB,EAAE;IACpD,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7D,OAAO,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAC7C,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC"}
|