@tramvai/tokens-child-app 4.12.4 → 4.13.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/lib/index.d.ts CHANGED
@@ -238,4 +238,37 @@ export type ChildAppPageComponent = ComponentType<{}> & {
238
238
  actions?: PageAction[];
239
239
  };
240
240
  export type ChildAppPageComponentDecl = ChildAppPageComponent | LazyComponentWrapper<ChildAppPageComponent>;
241
+ export type RootDiAccessMode = {
242
+ mode: 'blacklist';
243
+ list: string[];
244
+ } | {
245
+ mode: 'whitelist';
246
+ list: string[];
247
+ };
248
+ /**
249
+ * @public
250
+ *
251
+ * @description
252
+ * Allows to control access to root di for Child Apps. By default, all Child Apps have access to root di without any restrictions.
253
+ * Access modes overview:
254
+ * - `blacklist` - list of Child Apps that are not allowed to access root di as fallback
255
+ * - `whitelist` - list of Child Apps that are allowed to access root di as fallback
256
+ *
257
+ * @example
258
+ * - allow only for one "header" Child App - `{ mode: 'whitelist', list: ['header'] }`
259
+ * - allow for all except "header" Child App - `{ mode: 'blacklist', list: ['header'] }`
260
+ * - allow full access - `{ mode: 'blacklist', list: [] }`
261
+ * - block any access - `{ mode: 'whitelist', list: [] }`
262
+ */
263
+ export declare const CHILD_APP_ROOT_DI_ACCESS_MODE_TOKEN: ({
264
+ mode: 'blacklist';
265
+ list: string[];
266
+ } & {
267
+ __type?: "base token" | undefined;
268
+ }) | ({
269
+ mode: 'whitelist';
270
+ list: string[];
271
+ } & {
272
+ __type?: "base token" | undefined;
273
+ });
241
274
  //# sourceMappingURL=index.d.ts.map
package/lib/index.es.js CHANGED
@@ -138,5 +138,21 @@ const CHILD_APP_PAGE_COMPONENTS_TOKEN = createToken('child-app page components',
138
138
  * @description Children for `createChildApp.render` component
139
139
  */
140
140
  const CHILD_APP_RENDER_CHILDREN_TOKEN = createToken('child-app render children');
141
+ /**
142
+ * @public
143
+ *
144
+ * @description
145
+ * Allows to control access to root di for Child Apps. By default, all Child Apps have access to root di without any restrictions.
146
+ * Access modes overview:
147
+ * - `blacklist` - list of Child Apps that are not allowed to access root di as fallback
148
+ * - `whitelist` - list of Child Apps that are allowed to access root di as fallback
149
+ *
150
+ * @example
151
+ * - allow only for one "header" Child App - `{ mode: 'whitelist', list: ['header'] }`
152
+ * - allow for all except "header" Child App - `{ mode: 'blacklist', list: ['header'] }`
153
+ * - allow full access - `{ mode: 'blacklist', list: [] }`
154
+ * - block any access - `{ mode: 'whitelist', list: [] }`
155
+ */
156
+ const CHILD_APP_ROOT_DI_ACCESS_MODE_TOKEN = createToken('child-app root di access mode');
141
157
 
142
- export { CHILD_APP_ACTIONS_REGISTRY_TOKEN, CHILD_APP_COMMAND_LINE_RUNNER_TOKEN, CHILD_APP_COMMON_INITIAL_STATE_TOKEN, CHILD_APP_DI_MANAGER_TOKEN, CHILD_APP_INTERNAL_ACTION_TOKEN, CHILD_APP_INTERNAL_CHUNK_EXTRACTOR, CHILD_APP_INTERNAL_CONFIG_TOKEN, CHILD_APP_INTERNAL_RENDER_TOKEN, CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN, CHILD_APP_INTERNAL_ROOT_STATE_ALLOWED_STORE_TOKEN, CHILD_APP_INTERNAL_ROOT_STATE_SUBSCRIPTION_TOKEN, CHILD_APP_LOADER_TOKEN, CHILD_APP_PAGE_COMPONENTS_TOKEN, CHILD_APP_PAGE_SERVICE_TOKEN, CHILD_APP_PRELOAD_MANAGER_TOKEN, CHILD_APP_RENDER_CHILDREN_TOKEN, CHILD_APP_RENDER_MANAGER_TOKEN, CHILD_APP_RESOLUTION_CONFIGS_TOKEN, CHILD_APP_RESOLUTION_CONFIG_MANAGER_TOKEN, CHILD_APP_RESOLVE_BASE_URL_TOKEN, CHILD_APP_RESOLVE_CONFIG_TOKEN, CHILD_APP_SINGLETON_DI_MANAGER_TOKEN, CHILD_APP_STATE_MANAGER_TOKEN, IS_CHILD_APP_DI_TOKEN, commandLineListTokens };
158
+ export { CHILD_APP_ACTIONS_REGISTRY_TOKEN, CHILD_APP_COMMAND_LINE_RUNNER_TOKEN, CHILD_APP_COMMON_INITIAL_STATE_TOKEN, CHILD_APP_DI_MANAGER_TOKEN, CHILD_APP_INTERNAL_ACTION_TOKEN, CHILD_APP_INTERNAL_CHUNK_EXTRACTOR, CHILD_APP_INTERNAL_CONFIG_TOKEN, CHILD_APP_INTERNAL_RENDER_TOKEN, CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN, CHILD_APP_INTERNAL_ROOT_STATE_ALLOWED_STORE_TOKEN, CHILD_APP_INTERNAL_ROOT_STATE_SUBSCRIPTION_TOKEN, CHILD_APP_LOADER_TOKEN, CHILD_APP_PAGE_COMPONENTS_TOKEN, CHILD_APP_PAGE_SERVICE_TOKEN, CHILD_APP_PRELOAD_MANAGER_TOKEN, CHILD_APP_RENDER_CHILDREN_TOKEN, CHILD_APP_RENDER_MANAGER_TOKEN, CHILD_APP_RESOLUTION_CONFIGS_TOKEN, CHILD_APP_RESOLUTION_CONFIG_MANAGER_TOKEN, CHILD_APP_RESOLVE_BASE_URL_TOKEN, CHILD_APP_RESOLVE_CONFIG_TOKEN, CHILD_APP_ROOT_DI_ACCESS_MODE_TOKEN, CHILD_APP_SINGLETON_DI_MANAGER_TOKEN, CHILD_APP_STATE_MANAGER_TOKEN, IS_CHILD_APP_DI_TOKEN, commandLineListTokens };
package/lib/index.js CHANGED
@@ -142,6 +142,22 @@ const CHILD_APP_PAGE_COMPONENTS_TOKEN = dippy.createToken('child-app page compon
142
142
  * @description Children for `createChildApp.render` component
143
143
  */
144
144
  const CHILD_APP_RENDER_CHILDREN_TOKEN = dippy.createToken('child-app render children');
145
+ /**
146
+ * @public
147
+ *
148
+ * @description
149
+ * Allows to control access to root di for Child Apps. By default, all Child Apps have access to root di without any restrictions.
150
+ * Access modes overview:
151
+ * - `blacklist` - list of Child Apps that are not allowed to access root di as fallback
152
+ * - `whitelist` - list of Child Apps that are allowed to access root di as fallback
153
+ *
154
+ * @example
155
+ * - allow only for one "header" Child App - `{ mode: 'whitelist', list: ['header'] }`
156
+ * - allow for all except "header" Child App - `{ mode: 'blacklist', list: ['header'] }`
157
+ * - allow full access - `{ mode: 'blacklist', list: [] }`
158
+ * - block any access - `{ mode: 'whitelist', list: [] }`
159
+ */
160
+ const CHILD_APP_ROOT_DI_ACCESS_MODE_TOKEN = dippy.createToken('child-app root di access mode');
145
161
 
146
162
  exports.CHILD_APP_ACTIONS_REGISTRY_TOKEN = CHILD_APP_ACTIONS_REGISTRY_TOKEN;
147
163
  exports.CHILD_APP_COMMAND_LINE_RUNNER_TOKEN = CHILD_APP_COMMAND_LINE_RUNNER_TOKEN;
@@ -164,6 +180,7 @@ exports.CHILD_APP_RESOLUTION_CONFIGS_TOKEN = CHILD_APP_RESOLUTION_CONFIGS_TOKEN;
164
180
  exports.CHILD_APP_RESOLUTION_CONFIG_MANAGER_TOKEN = CHILD_APP_RESOLUTION_CONFIG_MANAGER_TOKEN;
165
181
  exports.CHILD_APP_RESOLVE_BASE_URL_TOKEN = CHILD_APP_RESOLVE_BASE_URL_TOKEN;
166
182
  exports.CHILD_APP_RESOLVE_CONFIG_TOKEN = CHILD_APP_RESOLVE_CONFIG_TOKEN;
183
+ exports.CHILD_APP_ROOT_DI_ACCESS_MODE_TOKEN = CHILD_APP_ROOT_DI_ACCESS_MODE_TOKEN;
167
184
  exports.CHILD_APP_SINGLETON_DI_MANAGER_TOKEN = CHILD_APP_SINGLETON_DI_MANAGER_TOKEN;
168
185
  exports.CHILD_APP_STATE_MANAGER_TOKEN = CHILD_APP_STATE_MANAGER_TOKEN;
169
186
  exports.IS_CHILD_APP_DI_TOKEN = IS_CHILD_APP_DI_TOKEN;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/tokens-child-app",
3
- "version": "4.12.4",
3
+ "version": "4.13.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -21,11 +21,11 @@
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@tinkoff/dippy": "0.10.4",
24
- "@tinkoff/router": "0.4.42",
25
- "@tramvai/core": "4.12.4",
26
- "@tramvai/react": "4.12.4",
27
- "@tramvai/state": "4.12.4",
28
- "@tramvai/tokens-common": "4.12.4",
24
+ "@tinkoff/router": "0.4.44",
25
+ "@tramvai/core": "4.13.0",
26
+ "@tramvai/react": "4.13.0",
27
+ "@tramvai/state": "4.13.0",
28
+ "@tramvai/tokens-common": "4.13.0",
29
29
  "@loadable/server": "*",
30
30
  "react": ">=16.14.0"
31
31
  },