@cloudscape-design/components 3.0.1160 → 3.0.1161

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.
@@ -2004,5 +2004,5 @@ body {
2004
2004
  }
2005
2005
  }
2006
2006
  :root {
2007
- --awsui-version-info-37a490cb: true;
2007
+ --awsui-version-info-0e97d47d: true;
2008
2008
  }
@@ -1,6 +1,6 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (37a490cb)";
3
- export var GIT_SHA = "37a490cb";
2
+ export var PACKAGE_VERSION = "3.0.0 (0e97d47d)";
3
+ export var GIT_SHA = "0e97d47d";
4
4
  export var THEME = "open-source-visual-refresh";
5
5
  export var SYSTEM = "core";
6
6
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (37a490cb)",
4
- "GIT_SHA": "37a490cb",
3
+ "PACKAGE_VERSION": "3.0.0 (0e97d47d)",
4
+ "GIT_SHA": "0e97d47d",
5
5
  "THEME": "open-source-visual-refresh",
6
6
  "SYSTEM": "core",
7
7
  "ALWAYS_VISUAL_REFRESH": true
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "37a490cb79a9d5020808bcb6964691bb489a6080"
2
+ "commit": "0e97d47d3227c5fd54ad51c40294488a92d1c85d"
3
3
  }
@@ -16,9 +16,9 @@ export interface ActionConfig {
16
16
  type ActionRegistrationListener = (action: Array<ActionConfig>) => void;
17
17
  export interface ActionsApiPublic {
18
18
  registerAction(config: ActionConfig): void;
19
+ clearRegisteredActionsForTesting(): void;
19
20
  }
20
21
  export interface ActionsApiInternal {
21
- clearRegisteredActions(): void;
22
22
  onActionRegistered(listener: ActionRegistrationListener): () => void;
23
23
  }
24
24
  export declare class ActionButtonsController {
@@ -26,7 +26,7 @@ export declare class ActionButtonsController {
26
26
  private actions;
27
27
  private scheduleUpdate;
28
28
  registerAction: (action: ActionConfig) => void;
29
- clearRegisteredActions: () => void;
29
+ clearRegisteredActionsForTesting: () => void;
30
30
  onActionRegistered: (listener: ActionRegistrationListener) => () => void;
31
31
  installPublic(api?: Partial<ActionsApiPublic>): ActionsApiPublic;
32
32
  installInternal(internalApi?: Partial<ActionsApiInternal>): ActionsApiInternal;
@@ -1 +1 @@
1
- {"version":3,"file":"action-buttons.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/action-buttons.ts"],"names":[],"mappings":"AAMA,UAAU,OAAO,CAAC,CAAC;IACjB,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IACvE,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IACzE,cAAc,EAAE,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,CAAC;CAClD;AAED,KAAK,0BAA0B,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;AAExE,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,kBAAkB;IACjC,sBAAsB,IAAI,IAAI,CAAC;IAC/B,kBAAkB,CAAC,QAAQ,EAAE,0BAA0B,GAAG,MAAM,IAAI,CAAC;CACtE;AAED,qBAAa,uBAAuB;IAClC,OAAO,CAAC,SAAS,CAAyC;IAC1D,OAAO,CAAC,OAAO,CAA2B;IAE1C,OAAO,CAAC,cAAc,CAEhB;IAEN,cAAc,GAAI,QAAQ,YAAY,UAIpC;IAEF,sBAAsB,aAEpB;IAEF,kBAAkB,GAAI,UAAU,0BAA0B,gBAMxD;IAEF,aAAa,CAAC,GAAG,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,gBAAgB;IAKpE,eAAe,CAAC,WAAW,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAAG,kBAAkB;CAKnF"}
1
+ {"version":3,"file":"action-buttons.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/action-buttons.ts"],"names":[],"mappings":"AAMA,UAAU,OAAO,CAAC,CAAC;IACjB,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IACvE,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IACzE,cAAc,EAAE,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,CAAC;CAClD;AAED,KAAK,0BAA0B,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;AAExE,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3C,gCAAgC,IAAI,IAAI,CAAC;CAC1C;AAED,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,CAAC,QAAQ,EAAE,0BAA0B,GAAG,MAAM,IAAI,CAAC;CACtE;AAED,qBAAa,uBAAuB;IAClC,OAAO,CAAC,SAAS,CAAyC;IAC1D,OAAO,CAAC,OAAO,CAA2B;IAE1C,OAAO,CAAC,cAAc,CAEhB;IAEN,cAAc,GAAI,QAAQ,YAAY,UAIpC;IAEF,gCAAgC,aAE9B;IAEF,kBAAkB,GAAI,UAAU,0BAA0B,gBAMxD;IAEF,aAAa,CAAC,GAAG,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,gBAAgB;IAMpE,eAAe,CAAC,WAAW,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAAG,kBAAkB;CAInF"}
@@ -14,7 +14,7 @@ export class ActionButtonsController {
14
14
  this.actions = sortByPriority(this.actions);
15
15
  this.scheduleUpdate();
16
16
  };
17
- this.clearRegisteredActions = () => {
17
+ this.clearRegisteredActionsForTesting = () => {
18
18
  this.actions = [];
19
19
  };
20
20
  this.onActionRegistered = (listener) => {
@@ -26,14 +26,14 @@ export class ActionButtonsController {
26
26
  };
27
27
  }
28
28
  installPublic(api = {}) {
29
- var _a;
29
+ var _a, _b;
30
30
  (_a = api.registerAction) !== null && _a !== void 0 ? _a : (api.registerAction = this.registerAction);
31
+ (_b = api.clearRegisteredActionsForTesting) !== null && _b !== void 0 ? _b : (api.clearRegisteredActionsForTesting = this.clearRegisteredActionsForTesting);
31
32
  return api;
32
33
  }
33
34
  installInternal(internalApi = {}) {
34
- var _a, _b;
35
- (_a = internalApi.clearRegisteredActions) !== null && _a !== void 0 ? _a : (internalApi.clearRegisteredActions = this.clearRegisteredActions);
36
- (_b = internalApi.onActionRegistered) !== null && _b !== void 0 ? _b : (internalApi.onActionRegistered = this.onActionRegistered);
35
+ var _a;
36
+ (_a = internalApi.onActionRegistered) !== null && _a !== void 0 ? _a : (internalApi.onActionRegistered = this.onActionRegistered);
37
37
  return internalApi;
38
38
  }
39
39
  }
@@ -1 +1 @@
1
-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AlB,GAAG,CAAC,cAAc,GAAK,IAAI,CAAC,cAAc,EAAC;QAC3C,OAAO,GAAuB,CAAC;IACjC,CAAC;IAED,eAAe,CAAC,cAA2C,EAAE;;QAC3D,MAAA,WAAW,CAAC,sBAAsB,oCAAlC,WAAW,CAAC,sBAAsB,GAAK,IAAI,CAAC,sBAAsB,EAAC;QACnE,MAAA,WAAW,CAAC,kBAAkB,oCAA9B,WAAW,CAAC,kBAAkB,GAAK,IAAI,CAAC,kBAAkB,EAAC;QAC3D,OAAO,WAAiC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport debounce from '../../debounce';\nimport { sortByPriority } from '../helpers/utils';\n\n// this code should not depend on React typings, because it is portable between major versions\ninterface RefShim<T> {\n current: T | null;\n}\n\nexport interface ActionContext {\n type: string;\n headerRef: RefShim<HTMLElement>;\n contentRef: RefShim<HTMLElement>;\n}\n\nexport interface ActionConfig {\n id: string;\n orderPriority?: number;\n mountContent: (container: HTMLElement, context: ActionContext) => void;\n updateContent?: (container: HTMLElement, context: ActionContext) => void;\n unmountContent: (container: HTMLElement) => void;\n}\n\ntype ActionRegistrationListener = (action: Array<ActionConfig>) => void;\n\nexport interface ActionsApiPublic {\n registerAction(config: ActionConfig): void;\n}\n\nexport interface ActionsApiInternal {\n clearRegisteredActions(): void;\n onActionRegistered(listener: ActionRegistrationListener): () => void;\n}\n\nexport class ActionButtonsController {\n private listeners: Array<ActionRegistrationListener> = [];\n private actions: Array<ActionConfig> = [];\n\n private scheduleUpdate = debounce(() => {\n this.listeners.forEach(listener => listener(this.actions));\n }, 0);\n\n registerAction = (action: ActionConfig) => {\n this.actions.push(action);\n this.actions = sortByPriority(this.actions);\n this.scheduleUpdate();\n };\n\n clearRegisteredActions = () => {\n this.actions = [];\n };\n\n onActionRegistered = (listener: ActionRegistrationListener) => {\n this.listeners.push(listener);\n this.scheduleUpdate();\n return () => {\n this.listeners = this.listeners.filter(item => item !== listener);\n };\n };\n\n installPublic(api: Partial<ActionsApiPublic> = {}): ActionsApiPublic {\n api.registerAction ??= this.registerAction;\n return api as ActionsApiPublic;\n }\n\n installInternal(internalApi: Partial<ActionsApiInternal> = {}): ActionsApiInternal {\n internalApi.clearRegisteredActions ??= this.clearRegisteredActions;\n internalApi.onActionRegistered ??= this.onActionRegistered;\n return internalApi as ActionsApiInternal;\n }\n}\n"]}
1
+ {"version":3,"file":"action-buttons.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/action-buttons.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAgClD,MAAM,OAAO,uBAAuB;IAApC;QACU,cAAS,GAAsC,EAAE,CAAC;QAClD,YAAO,GAAwB,EAAE,CAAC;QAElC,mBAAc,GAAG,QAAQ,CAAC,GAAG,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7D,CAAC,EAAE,CAAC,CAAC,CAAC;QAEN,mBAAc,GAAG,CAAC,MAAoB,EAAE,EAAE;YACxC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC1B,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC,cAAc,EAAE,CAAC;QACxB,CAAC,CAAC;QAEF,qCAAgC,GAAG,GAAG,EAAE;YACtC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QACpB,CAAC,CAAC;QAEF,uBAAkB,GAAG,CAAC,QAAoC,EAAE,EAAE;YAC5D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC9B,IAAI,CAAC,cAAc,EAAE,CAAC;YACtB,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;YACpE,CAAC,CAAC;QACJ,CAAC,CAAC;IAYJ,CAAC;IAVC,aAAa,CAAC,MAAiC,EAAE;;QAC/C,MAAA,GAAG,CAAC,cAAc,oCAAlB,GAAG,CAAC,cAAc,GAAK,IAAI,CAAC,cAAc,EAAC;QAC3C,MAAA,GAAG,CAAC,gCAAgC,oCAApC,GAAG,CAAC,gCAAgC,GAAK,IAAI,CAAC,gCAAgC,EAAC;QAC/E,OAAO,GAAuB,CAAC;IACjC,CAAC;IAED,eAAe,CAAC,cAA2C,EAAE;;QAC3D,MAAA,WAAW,CAAC,kBAAkB,oCAA9B,WAAW,CAAC,kBAAkB,GAAK,IAAI,CAAC,kBAAkB,EAAC;QAC3D,OAAO,WAAiC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport debounce from '../../debounce';\nimport { sortByPriority } from '../helpers/utils';\n\n// this code should not depend on React typings, because it is portable between major versions\ninterface RefShim<T> {\n current: T | null;\n}\n\nexport interface ActionContext {\n type: string;\n headerRef: RefShim<HTMLElement>;\n contentRef: RefShim<HTMLElement>;\n}\n\nexport interface ActionConfig {\n id: string;\n orderPriority?: number;\n mountContent: (container: HTMLElement, context: ActionContext) => void;\n updateContent?: (container: HTMLElement, context: ActionContext) => void;\n unmountContent: (container: HTMLElement) => void;\n}\n\ntype ActionRegistrationListener = (action: Array<ActionConfig>) => void;\n\nexport interface ActionsApiPublic {\n registerAction(config: ActionConfig): void;\n clearRegisteredActionsForTesting(): void;\n}\n\nexport interface ActionsApiInternal {\n onActionRegistered(listener: ActionRegistrationListener): () => void;\n}\n\nexport class ActionButtonsController {\n private listeners: Array<ActionRegistrationListener> = [];\n private actions: Array<ActionConfig> = [];\n\n private scheduleUpdate = debounce(() => {\n this.listeners.forEach(listener => listener(this.actions));\n }, 0);\n\n registerAction = (action: ActionConfig) => {\n this.actions.push(action);\n this.actions = sortByPriority(this.actions);\n this.scheduleUpdate();\n };\n\n clearRegisteredActionsForTesting = () => {\n this.actions = [];\n };\n\n onActionRegistered = (listener: ActionRegistrationListener) => {\n this.listeners.push(listener);\n this.scheduleUpdate();\n return () => {\n this.listeners = this.listeners.filter(item => item !== listener);\n };\n };\n\n installPublic(api: Partial<ActionsApiPublic> = {}): ActionsApiPublic {\n api.registerAction ??= this.registerAction;\n api.clearRegisteredActionsForTesting ??= this.clearRegisteredActionsForTesting;\n return api as ActionsApiPublic;\n }\n\n installInternal(internalApi: Partial<ActionsApiInternal> = {}): ActionsApiInternal {\n internalApi.onActionRegistered ??= this.onActionRegistered;\n return internalApi as ActionsApiInternal;\n }\n}\n"]}
@@ -38,16 +38,16 @@ export interface AlertFlashContentConfig {
38
38
  type AlertFlashContentRegistrationListener = (provider: AlertFlashContentConfig) => () => void;
39
39
  export interface AlertFlashContentApiPublic {
40
40
  registerContentReplacer(config: AlertFlashContentConfig): void;
41
+ clearRegisteredReplacerForTesting(): void;
41
42
  }
42
43
  export interface AlertFlashContentApiInternal {
43
- clearRegisteredReplacer(): void;
44
44
  onContentRegistered(listener: AlertFlashContentRegistrationListener): () => void;
45
45
  initialCheck(context: AlertFlashContentInitialContext): boolean;
46
46
  }
47
47
  export declare class AlertFlashContentController {
48
48
  #private;
49
49
  registerContentReplacer: (content: AlertFlashContentConfig) => void;
50
- clearRegisteredReplacer: () => void;
50
+ clearRegisteredReplacerForTesting: () => void;
51
51
  initialCheck: (context: AlertFlashContentInitialContext) => boolean;
52
52
  onContentRegistered: (listener: AlertFlashContentRegistrationListener) => () => void;
53
53
  installPublic(api?: Partial<AlertFlashContentApiPublic>): AlertFlashContentApiPublic;
@@ -1 +1 @@
1
- {"version":3,"file":"alert-flash-content.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/alert-flash-content.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMlC,UAAU,OAAO,CAAC,CAAC;IACjB,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;CACnB;AAED,UAAU,wBAAwB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAClC;AAED,UAAU,+BAA+B;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEjE,UAAU,cAAc;IACtB,UAAU,IAAI,IAAI,CAAC;IACnB,aAAa,IAAI,IAAI,CAAC;IACtB,aAAa,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAAC;IAChE,WAAW,IAAI,IAAI,CAAC;IACpB,cAAc,IAAI,IAAI,CAAC;IACvB,cAAc,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAAC;CAClE;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,CAAC,UAAU,EAAE;QAAE,0BAA0B,EAAE,WAAW,CAAC;QAAC,2BAA2B,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;CACtH;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,CAAC,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,cAAc,KAAK,uBAAuB,CAAC;IAC5G,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,+BAA+B,KAAK,OAAO,CAAC;CACtE;AAED,KAAK,qCAAqC,GAAG,CAAC,QAAQ,EAAE,uBAAuB,KAAK,MAAM,IAAI,CAAC;AAE/F,MAAM,WAAW,0BAA0B;IACzC,uBAAuB,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAAC;CAChE;AAED,MAAM,WAAW,4BAA4B;IAC3C,uBAAuB,IAAI,IAAI,CAAC;IAChC,mBAAmB,CAAC,QAAQ,EAAE,qCAAqC,GAAG,MAAM,IAAI,CAAC;IACjF,YAAY,CAAC,OAAO,EAAE,+BAA+B,GAAG,OAAO,CAAC;CACjE;AAED,qBAAa,2BAA2B;;IAgBtC,uBAAuB,GAAI,SAAS,uBAAuB,UAYzD;IAEF,uBAAuB,aAErB;IAEF,YAAY,GAAI,SAAS,+BAA+B,KAAG,OAAO,CAKhE;IAEF,mBAAmB,GAAI,UAAU,qCAAqC,gBAapE;IAEF,aAAa,CAAC,GAAG,GAAE,OAAO,CAAC,0BAA0B,CAAM,GAAG,0BAA0B;IAKxF,eAAe,CAAC,WAAW,GAAE,OAAO,CAAC,4BAA4B,CAAM,GAAG,4BAA4B;CAMvG"}
1
+ {"version":3,"file":"alert-flash-content.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/alert-flash-content.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMlC,UAAU,OAAO,CAAC,CAAC;IACjB,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;CACnB;AAED,UAAU,wBAAwB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAClC;AAED,UAAU,+BAA+B;IACvC,UAAU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AC,OAAO,EAAE,+BAA+B,GAAG,OAAO,CAAC;CACjE;AAED,qBAAa,2BAA2B;;IAgBtC,uBAAuB,GAAI,SAAS,uBAAuB,UAYzD;IAEF,iCAAiC,aAE/B;IAEF,YAAY,GAAI,SAAS,+BAA+B,KAAG,OAAO,CAKhE;IAEF,mBAAmB,GAAI,UAAU,qCAAqC,gBAapE;IAEF,aAAa,CAAC,GAAG,GAAE,OAAO,CAAC,0BAA0B,CAAM,GAAG,0BAA0B;IAMxF,eAAe,CAAC,WAAW,GAAE,OAAO,CAAC,4BAA4B,CAAM,GAAG,4BAA4B;CAKvG"}
@@ -24,7 +24,7 @@ export class AlertFlashContentController {
24
24
  // Notify existing components if registration happens after the components are rendered.
25
25
  __classPrivateFieldGet(this, _AlertFlashContentController_scheduleUpdate, "f").call(this);
26
26
  };
27
- this.clearRegisteredReplacer = () => {
27
+ this.clearRegisteredReplacerForTesting = () => {
28
28
  __classPrivateFieldSet(this, _AlertFlashContentController_provider, undefined, "f");
29
29
  };
30
30
  this.initialCheck = (context) => {
@@ -52,15 +52,15 @@ export class AlertFlashContentController {
52
52
  };
53
53
  }
54
54
  installPublic(api = {}) {
55
- var _a;
55
+ var _a, _b;
56
56
  (_a = api.registerContentReplacer) !== null && _a !== void 0 ? _a : (api.registerContentReplacer = this.registerContentReplacer);
57
+ (_b = api.clearRegisteredReplacerForTesting) !== null && _b !== void 0 ? _b : (api.clearRegisteredReplacerForTesting = this.clearRegisteredReplacerForTesting);
57
58
  return api;
58
59
  }
59
60
  installInternal(internalApi = {}) {
60
- var _a, _b, _c;
61
- (_a = internalApi.clearRegisteredReplacer) !== null && _a !== void 0 ? _a : (internalApi.clearRegisteredReplacer = this.clearRegisteredReplacer);
62
- (_b = internalApi.onContentRegistered) !== null && _b !== void 0 ? _b : (internalApi.onContentRegistered = this.onContentRegistered);
63
- (_c = internalApi.initialCheck) !== null && _c !== void 0 ? _c : (internalApi.initialCheck = this.initialCheck);
61
+ var _a, _b;
62
+ (_a = internalApi.onContentRegistered) !== null && _a !== void 0 ? _a : (internalApi.onContentRegistered = this.onContentRegistered);
63
+ (_b = internalApi.initialCheck) !== null && _b !== void 0 ? _b : (internalApi.initialCheck = this.initialCheck);
64
64
  return internalApi;
65
65
  }
66
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"alert-flash-content.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/alert-flash-content.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;;AAItC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAuD7D,MAAM,OAAO,2BAA2B;IAAxC;QACE,iDAA2D,EAAE,EAAC;QAC9D,gDAAY,IAAI,GAAG,EAAqD,EAAC;QACzE,wDAAoC;QAEpC,sDAAkB,QAAQ,CACxB,GAAG,EAAE,CACH,uBAAA,IAAI,8CAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACjC,IAAI,uBAAA,IAAI,6CAAU,EAAE,CAAC;gBACnB,MAAM,OAAO,GAAG,QAAQ,CAAC,uBAAA,IAAI,6CAAU,CAAC,CAAC;gBACzC,uBAAA,IAAI,6CAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACxC,CAAC;QACH,CAAC,CAAC,EACJ,CAAC,CACF,EAAC;QAEF,4BAAuB,GAAG,CAAC,OAAgC,EAAE,EAAE;YAC7D,IAAI,uBAAA,IAAI,6CAAU,EAAE,CAAC;gBACnB,uBAAuB,CACrB,qBAAqB,EACrB,gFAAgF,uBAAA,IAAI,6CAAU,CAAC,EAAE,uBAAuB,CACzH,CAAC;gBACF,OAAO;YACT,CAAC;YACD,uBAAA,IAAI,yCAAa,OAAO,MAAA,CAAC;YAEzB,wFAAwF;YACxF,uBAAA,IAAI,mDAAgB,MAApB,IAAI,CAAkB,CAAC;QACzB,CAAC,CAAC;QAEF,4BAAuB,GAAG,GAAG,EA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cAAqD,EAAE;;QACrE,MAAA,WAAW,CAAC,uBAAuB,oCAAnC,WAAW,CAAC,uBAAuB,GAAK,IAAI,CAAC,uBAAuB,EAAC;QACrE,MAAA,WAAW,CAAC,mBAAmB,oCAA/B,WAAW,CAAC,mBAAmB,GAAK,IAAI,CAAC,mBAAmB,EAAC;QAC7D,MAAA,WAAW,CAAC,YAAY,oCAAxB,WAAW,CAAC,YAAY,GAAK,IAAI,CAAC,YAAY,EAAC;QAC/C,OAAO,WAA2C,CAAC;IACrD,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ReactNode } from 'react';\n\nimport debounce from '../../debounce';\nimport { reportRuntimeApiWarning } from '../helpers/metrics';\n\n// this code should not depend on React typings, because it is portable between major versions\ninterface RefShim<T> {\n current: T | null;\n}\n\ninterface AlertFlashContentContext {\n instanceId: string;\n type: string;\n headerRef: RefShim<HTMLElement>;\n contentRef: RefShim<HTMLElement>;\n}\n\ninterface AlertFlashContentInitialContext {\n instanceId: string;\n type: string;\n header?: ReactNode;\n content?: ReactNode;\n}\n\nexport type ReplacementType = 'original' | 'remove' | 'replaced';\n\ninterface ReplacementApi {\n hideHeader(): void;\n restoreHeader(): void;\n replaceHeader(replacer: (container: HTMLElement) => void): void;\n hideContent(): void;\n restoreContent(): void;\n replaceContent(replacer: (container: HTMLElement) => void): void;\n}\n\nexport interface AlertFlashContentResult {\n update: () => void;\n unmount: (containers: { replacementHeaderContainer: HTMLElement; replacementContentContainer: HTMLElement }) => void;\n}\n\nexport interface AlertFlashContentConfig {\n id: string;\n runReplacer: (context: AlertFlashContentContext, replacementApi: ReplacementApi) => AlertFlashContentResult;\n initialCheck?: (context: AlertFlashContentInitialContext) => boolean;\n}\n\ntype AlertFlashContentRegistrationListener = (provider: AlertFlashContentConfig) => () => void;\n\nexport interface AlertFlashContentApiPublic {\n registerContentReplacer(config: AlertFlashContentConfig): void;\n}\n\nexport interface AlertFlashContentApiInternal {\n clearRegisteredReplacer(): void;\n onContentRegistered(listener: AlertFlashContentRegistrationListener): () => void;\n initialCheck(context: AlertFlashContentInitialContext): boolean;\n}\n\nexport class AlertFlashContentController {\n #listeners: Array<AlertFlashContentRegistrationListener> = [];\n #cleanups = new Map<AlertFlashContentRegistrationListener, () => void>();\n #provider?: AlertFlashContentConfig;\n\n #scheduleUpdate = debounce(\n () =>\n this.#listeners.forEach(listener => {\n if (this.#provider) {\n const cleanup = listener(this.#provider);\n this.#cleanups.set(listener, cleanup);\n }\n }),\n 0\n );\n\n registerContentReplacer = (content: AlertFlashContentConfig) => {\n if (this.#provider) {\n reportRuntimeApiWarning(\n 'alert-flash-content',\n `Cannot call \\`registerContentReplacer\\` with new provider: provider with id \"${this.#provider.id}\" already registered.`\n );\n return;\n }\n this.#provider = content;\n\n // Notify existing components if registration happens after the components are rendered.\n this.#scheduleUpdate();\n };\n\n clearRegisteredReplacer = () => {\n this.#provider = undefined;\n };\n\n initialCheck = (context: AlertFlashContentInitialContext): boolean => {\n if (this.#provider?.initialCheck) {\n return this.#provider.initialCheck(context);\n }\n return false;\n };\n\n onContentRegistered = (listener: AlertFlashContentRegistrationListener) => {\n if (this.#provider) {\n const cleanup = listener(this.#provider);\n this.#listeners.push(listener);\n this.#cleanups.set(listener, cleanup);\n } else {\n this.#listeners.push(listener);\n }\n return () => {\n this.#cleanups.get(listener)?.();\n this.#listeners = this.#listeners.filter(item => item !== listener);\n this.#cleanups.delete(listener);\n };\n };\n\n installPublic(api: Partial<AlertFlashContentApiPublic> = {}): AlertFlashContentApiPublic {\n api.registerContentReplacer ??= this.registerContentReplacer;\n return api as AlertFlashContentApiPublic;\n }\n\n installInternal(internalApi: Partial<AlertFlashContentApiInternal> = {}): AlertFlashContentApiInternal {\n internalApi.clearRegisteredReplacer ??= this.clearRegisteredReplacer;\n internalApi.onContentRegistered ??= this.onContentRegistered;\n internalApi.initialCheck ??= this.initialCheck;\n return internalApi as AlertFlashContentApiInternal;\n }\n}\n"]}
1
+ {"version":3,"file":"alert-flash-content.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/alert-flash-content.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;;AAItC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAuD7D,MAAM,OAAO,2BAA2B;IAAxC;QACE,iDAA2D,EAAE,EAAC;QAC9D,gDAAY,IAAI,GAAG,EAAqD,EAAC;QACzE,wDAAoC;QAEpC,sDAAkB,QAAQ,CACxB,GAAG,EAAE,CACH,uBAAA,IAAI,8CAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACjC,IAAI,uBAAA,IAAI,6CAAU,EAAE,CAAC;gBACnB,MAAM,OAAO,GAAG,QAAQ,CAAC,uBAAA,IAAI,6CAAU,CAAC,CAAC;gBACzC,uBAAA,IAAI,6CAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACxC,CAAC;QACH,CAAC,CAAC,EACJ,CAAC,CACF,EAAC;QAEF,4BAAuB,GAAG,CAAC,OAAgC,EAAE,EAAE;YAC7D,IAAI,uBAAA,IAAI,6CAAU,EAAE,CAAC;gBACnB,uBAAuB,CACrB,qBAAqB,EACrB,gFAAgF,uBAAA,IAAI,6CAAU,CAAC,EAAE,uBAAuB,CACzH,CAAC;gBACF,OAAO;YACT,CAAC;YACD,uBAAA,IAAI,yCAAa,OAAO,MAAA,CAAC;YAEzB,wFAAwF;YACxF,uBAAA,IAAI,mDAAgB,MAApB,IAAI,CAAkB,CAAC;QACzB,CAAC,CAAC;QAEF,sCAAiC,GAAG,GAAG,EAAE;YACvC,uBAAA,IAAI,yCAAa,SAAS,MAAA,CAAC;QAC7B,CAAC,CAAC;QAEF,iBAAY,GAAG,CAAC,OAAwC,EAAW,EAAE;;YACnE,IAAI,MAAA,uBAAA,IAAI,6CAAU,0CAAE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,mBAAmB,GAAK,IAAI,CAAC,mBAAmB,EAAC;QAC7D,MAAA,WAAW,CAAC,YAAY,oCAAxB,WAAW,CAAC,YAAY,GAAK,IAAI,CAAC,YAAY,EAAC;QAC/C,OAAO,WAA2C,CAAC;IACrD,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ReactNode } from 'react';\n\nimport debounce from '../../debounce';\nimport { reportRuntimeApiWarning } from '../helpers/metrics';\n\n// this code should not depend on React typings, because it is portable between major versions\ninterface RefShim<T> {\n current: T | null;\n}\n\ninterface AlertFlashContentContext {\n instanceId: string;\n type: string;\n headerRef: RefShim<HTMLElement>;\n contentRef: RefShim<HTMLElement>;\n}\n\ninterface AlertFlashContentInitialContext {\n instanceId: string;\n type: string;\n header?: ReactNode;\n content?: ReactNode;\n}\n\nexport type ReplacementType = 'original' | 'remove' | 'replaced';\n\ninterface ReplacementApi {\n hideHeader(): void;\n restoreHeader(): void;\n replaceHeader(replacer: (container: HTMLElement) => void): void;\n hideContent(): void;\n restoreContent(): void;\n replaceContent(replacer: (container: HTMLElement) => void): void;\n}\n\nexport interface AlertFlashContentResult {\n update: () => void;\n unmount: (containers: { replacementHeaderContainer: HTMLElement; replacementContentContainer: HTMLElement }) => void;\n}\n\nexport interface AlertFlashContentConfig {\n id: string;\n runReplacer: (context: AlertFlashContentContext, replacementApi: ReplacementApi) => AlertFlashContentResult;\n initialCheck?: (context: AlertFlashContentInitialContext) => boolean;\n}\n\ntype AlertFlashContentRegistrationListener = (provider: AlertFlashContentConfig) => () => void;\n\nexport interface AlertFlashContentApiPublic {\n registerContentReplacer(config: AlertFlashContentConfig): void;\n clearRegisteredReplacerForTesting(): void;\n}\n\nexport interface AlertFlashContentApiInternal {\n onContentRegistered(listener: AlertFlashContentRegistrationListener): () => void;\n initialCheck(context: AlertFlashContentInitialContext): boolean;\n}\n\nexport class AlertFlashContentController {\n #listeners: Array<AlertFlashContentRegistrationListener> = [];\n #cleanups = new Map<AlertFlashContentRegistrationListener, () => void>();\n #provider?: AlertFlashContentConfig;\n\n #scheduleUpdate = debounce(\n () =>\n this.#listeners.forEach(listener => {\n if (this.#provider) {\n const cleanup = listener(this.#provider);\n this.#cleanups.set(listener, cleanup);\n }\n }),\n 0\n );\n\n registerContentReplacer = (content: AlertFlashContentConfig) => {\n if (this.#provider) {\n reportRuntimeApiWarning(\n 'alert-flash-content',\n `Cannot call \\`registerContentReplacer\\` with new provider: provider with id \"${this.#provider.id}\" already registered.`\n );\n return;\n }\n this.#provider = content;\n\n // Notify existing components if registration happens after the components are rendered.\n this.#scheduleUpdate();\n };\n\n clearRegisteredReplacerForTesting = () => {\n this.#provider = undefined;\n };\n\n initialCheck = (context: AlertFlashContentInitialContext): boolean => {\n if (this.#provider?.initialCheck) {\n return this.#provider.initialCheck(context);\n }\n return false;\n };\n\n onContentRegistered = (listener: AlertFlashContentRegistrationListener) => {\n if (this.#provider) {\n const cleanup = listener(this.#provider);\n this.#listeners.push(listener);\n this.#cleanups.set(listener, cleanup);\n } else {\n this.#listeners.push(listener);\n }\n return () => {\n this.#cleanups.get(listener)?.();\n this.#listeners = this.#listeners.filter(item => item !== listener);\n this.#cleanups.delete(listener);\n };\n };\n\n installPublic(api: Partial<AlertFlashContentApiPublic> = {}): AlertFlashContentApiPublic {\n api.registerContentReplacer ??= this.registerContentReplacer;\n api.clearRegisteredReplacerForTesting ??= this.clearRegisteredReplacerForTesting;\n return api as AlertFlashContentApiPublic;\n }\n\n installInternal(internalApi: Partial<AlertFlashContentApiInternal> = {}): AlertFlashContentApiInternal {\n internalApi.onContentRegistered ??= this.onContentRegistered;\n internalApi.initialCheck ??= this.initialCheck;\n return internalApi as AlertFlashContentApiInternal;\n }\n}\n"]}
@@ -56,9 +56,9 @@ export interface DrawersApiPublic {
56
56
  openDrawer(drawerId: string, params?: OpenCloseDrawerParams): void;
57
57
  closeDrawer(drawerId: string, params?: OpenCloseDrawerParams): void;
58
58
  resizeDrawer(drawerId: string, size: number): void;
59
+ clearRegisteredDrawersForTesting(): void;
59
60
  }
60
61
  export interface DrawersApiInternal {
61
- clearRegisteredDrawers(): void;
62
62
  onDrawersRegistered(listener: DrawersRegistrationListener): () => void;
63
63
  onDrawerOpened(listener: DrawersToggledListener): () => void;
64
64
  onDrawerClosed(listener: DrawersToggledListener): () => void;
@@ -80,7 +80,7 @@ export declare class DrawersController {
80
80
  ...rest
81
81
  }: UpdateDrawerConfig) => void;
82
82
  onDrawersRegistered: (listener: DrawersRegistrationListener) => () => void;
83
- clearRegisteredDrawers: () => void;
83
+ clearRegisteredDrawersForTesting: () => void;
84
84
  onDrawerOpened: (listener: DrawersToggledListener) => () => void;
85
85
  onDrawerClosed: (listener: DrawersToggledListener) => () => void;
86
86
  openDrawer: (drawerId: string, params?: OpenCloseDrawerParams) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"drawers.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/drawers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAGzD,KAAK,sBAAsB,GAAG,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;AAE/E,UAAU,mBAAmB;IAC3B,kBAAkB,EAAE,sBAAsB,CAAC;CAC5C;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,UAAU,EAAE;QACV,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC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[];
60
60
  };
61
61
  };
62
- this.clearRegisteredDrawers = () => {
62
+ this.clearRegisteredDrawersForTesting = () => {
63
63
  this.drawers = [];
64
64
  };
65
65
  this.onDrawerOpened = (listener) => {
@@ -112,23 +112,23 @@ export class DrawersController {
112
112
  };
113
113
  }
114
114
  installPublic(api = {}) {
115
- var _a, _b, _c, _d, _e;
115
+ var _a, _b, _c, _d, _e, _f;
116
116
  (_a = api.registerDrawer) !== null && _a !== void 0 ? _a : (api.registerDrawer = this.registerDrawer);
117
117
  (_b = api.updateDrawer) !== null && _b !== void 0 ? _b : (api.updateDrawer = this.updateDrawer);
118
118
  (_c = api.openDrawer) !== null && _c !== void 0 ? _c : (api.openDrawer = this.openDrawer);
119
119
  (_d = api.closeDrawer) !== null && _d !== void 0 ? _d : (api.closeDrawer = this.closeDrawer);
120
120
  (_e = api.resizeDrawer) !== null && _e !== void 0 ? _e : (api.resizeDrawer = this.resizeDrawer);
121
+ (_f = api.clearRegisteredDrawersForTesting) !== null && _f !== void 0 ? _f : (api.clearRegisteredDrawersForTesting = this.clearRegisteredDrawersForTesting);
121
122
  return api;
122
123
  }
123
124
  installInternal(internalApi = {}) {
124
- var _a, _b, _c, _d, _e, _f, _g;
125
- (_a = internalApi.clearRegisteredDrawers) !== null && _a !== void 0 ? _a : (internalApi.clearRegisteredDrawers = this.clearRegisteredDrawers);
126
- (_b = internalApi.onDrawersRegistered) !== null && _b !== void 0 ? _b : (internalApi.onDrawersRegistered = this.onDrawersRegistered);
127
- (_c = internalApi.onDrawerOpened) !== null && _c !== void 0 ? _c : (internalApi.onDrawerOpened = this.onDrawerOpened);
128
- (_d = internalApi.onDrawerClosed) !== null && _d !== void 0 ? _d : (internalApi.onDrawerClosed = this.onDrawerClosed);
129
- (_e = internalApi.onDrawerResize) !== null && _e !== void 0 ? _e : (internalApi.onDrawerResize = this.onDrawerResize);
130
- (_f = internalApi.onDrawersUpdated) !== null && _f !== void 0 ? _f : (internalApi.onDrawersUpdated = this.onDrawersUpdated);
131
- (_g = internalApi.getDrawersState) !== null && _g !== void 0 ? _g : (internalApi.getDrawersState = this.getDrawersState);
125
+ var _a, _b, _c, _d, _e, _f;
126
+ (_a = internalApi.onDrawersRegistered) !== null && _a !== void 0 ? _a : (internalApi.onDrawersRegistered = this.onDrawersRegistered);
127
+ (_b = internalApi.onDrawerOpened) !== null && _b !== void 0 ? _b : (internalApi.onDrawerOpened = this.onDrawerOpened);
128
+ (_c = internalApi.onDrawerClosed) !== null && _c !== void 0 ? _c : (internalApi.onDrawerClosed = this.onDrawerClosed);
129
+ (_d = internalApi.onDrawerResize) !== null && _d !== void 0 ? _d : (internalApi.onDrawerResize = this.onDrawerResize);
130
+ (_e = internalApi.onDrawersUpdated) !== null && _e !== void 0 ? _e : (internalApi.onDrawersUpdated = this.onDrawersUpdated);
131
+ (_f = internalApi.getDrawersState) !== null && _f !== void 0 ? _f : (internalApi.getDrawersState = this.getDrawersState);
132
132
  return internalApi;
133
133
  }
134
134
  }
@@ -1 +1 @@
1
- {"version":3,"file":"drawers.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/drawers.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AA0C7D,MAAM,mBAAmB,GAAG;IAC1B,OAAO;IACP,WAAW;IACX,aAAa;IACb,eAAe;IACf,eAAe;IACf,UAAU;CACF,CAAC;AAkCX,MAAM,OAAO,iBAAiB;IAA9B;QACU,YAAO,GAAwB,EAAE,CAAC;QAClC,gCAA2B,GAAuC,IAAI,CAAC;QACvE,yBAAoB,GAAkC,IAAI,CAAC;QAC3D,yBAAoB,GAAkC,IAAI,CAAC;QAC3D,2BAAsB,GAAiC,EAAE,CAAC;QAC1D,yBAAoB,GAAiC,IAAI,CAAC;QAElE,mBAAc,GAAG,QAAQ,CAAC,GAAG,EAAE;;YAC7B,MAAA,IAAI,CAAC,2BAA2B,qDAAG,I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W,CAAC,eAAe,GAAK,IAAI,CAAC,eAAe,EAAC;QACrD,OAAO,WAAiC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonGroupProps, ItemRuntime } from '../../../button-group/interfaces';\nimport debounce from '../../debounce';\nimport { NonCancelableEventHandler } from '../../events';\nimport { reportRuntimeApiWarning } from '../helpers/metrics';\n\ntype DrawerVisibilityChange = (callback: (isVisible: boolean) => void) => void;\n\ninterface MountContentContext {\n onVisibilityChange: DrawerVisibilityChange;\n}\n\nexport interface DrawerStateChangeParams {\n isOpen: boolean;\n initiatedByUserAction?: boolean;\n}\n\nexport interface DrawerConfig {\n id: string;\n type?: 'local' | 'global';\n ariaLabels: {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n resizeHandleTooltipText?: string;\n expandedModeButton?: string;\n };\n isExpandable?: boolean;\n badge?: boolean;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n orderPriority?: number;\n defaultActive?: boolean;\n trigger?: {\n iconSvg?: string;\n };\n mountContent: (container: HTMLElement, mountContext: MountContentContext) => void;\n unmountContent: (container: HTMLElement) => void;\n preserveInactiveContent?: boolean;\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n headerActions?: ReadonlyArray<ItemRuntime>;\n onHeaderActionClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n}\n\nconst updatableProperties = [\n 'badge',\n 'resizable',\n 'defaultSize',\n 'orderPriority',\n 'defaultActive',\n 'onResize',\n] as const;\n\nexport type UpdateDrawerConfig = { id: DrawerConfig['id'] } & Partial<\n Pick<DrawerConfig, (typeof updatableProperties)[number]>\n>;\n\ntype DrawersRegistrationListener = (drawers: Array<DrawerConfig>) => void;\ntype DrawersUpdateListener = (drawers: Array<DrawerConfig>) => void;\n\nexport type DrawersToggledListener = (drawerId: string, params?: OpenCloseDrawerParams) => void;\ntype DrawersResizeListener = (drawerId: string, size: number) => void;\n\ninterface OpenCloseDrawerParams {\n initiatedByUserAction: boolean;\n}\n\nexport interface DrawersApiPublic {\n registerDrawer(config: DrawerConfig): void;\n updateDrawer(config: UpdateDrawerConfig): void;\n openDrawer(drawerId: string, params?: OpenCloseDrawerParams): void;\n closeDrawer(drawerId: string, params?: OpenCloseDrawerParams): void;\n resizeDrawer(drawerId: string, size: number): void;\n}\n\nexport interface DrawersApiInternal {\n clearRegisteredDrawers(): void;\n onDrawersRegistered(listener: DrawersRegistrationListener): () => void;\n onDrawerOpened(listener: DrawersToggledListener): () => void;\n onDrawerClosed(listener: DrawersToggledListener): () => void;\n onDrawerResize(listener: DrawersResizeListener): () => void;\n onDrawersUpdated(listener: DrawersUpdateListener): void;\n getDrawersState(): Array<DrawerConfig>;\n}\n\nexport class DrawersController {\n private drawers: Array<DrawerConfig> = [];\n private drawersRegistrationListener: DrawersRegistrationListener | null = null;\n private drawerOpenedListener: DrawersToggledListener | null = null;\n private drawerClosedListener: DrawersToggledListener | null = null;\n private drawersUpdateListeners: Array<DrawersUpdateListener> = [];\n private drawerResizeListener: DrawersResizeListener | null = null;\n\n scheduleUpdate = debounce(() => {\n this.drawersRegistrationListener?.(this.drawers);\n this.drawersUpdateListeners.forEach(drawersUpdateListeners => {\n drawersUpdateListeners?.(this.drawers);\n });\n }, 0);\n\n registerDrawer = (config: DrawerConfig) => {\n if (this.drawers.find(drawer => drawer.id === config.id)) {\n reportRuntimeApiWarning('app-layout-drawers', `drawer with id \"${config.id}\" is already registered`);\n }\n this.drawers = this.drawers.concat(config);\n this.scheduleUpdate();\n };\n\n updateDrawer = ({ id: drawerId, ...rest }: UpdateDrawerConfig) => {\n const drawerIndex = this.drawers.findIndex(({ id }) => id === drawerId);\n const oldDrawerConfig = this.drawers?.[drawerIndex];\n if (!oldDrawerConfig) {\n throw new Error(`[AwsUi] [runtime drawers] drawer with id ${drawerId} not found`);\n }\n const drawers = this.drawers.slice();\n const updatedDrawer = { ...oldDrawerConfig };\n for (const key of updatableProperties) {\n if (key in rest) {\n updatedDrawer[key] = (rest as any)[key];\n }\n }\n drawers[drawerIndex] = updatedDrawer;\n this.drawers = drawers;\n this.scheduleUpdate();\n };\n\n onDrawersRegistered = (listener: DrawersRegistrationListener) => {\n if (this.drawersRegistrationListener !== null) {\n reportRuntimeApiWarning(\n 'app-layout-drawers',\n 'multiple app layout instances detected when calling onDrawersRegistered'\n );\n }\n this.drawersRegistrationListener = listener;\n this.scheduleUpdate();\n return () => {\n this.drawersRegistrationListener = null;\n this.drawersUpdateListeners = [];\n };\n };\n\n clearRegisteredDrawers = () => {\n this.drawers = [];\n };\n\n onDrawerOpened = (listener: DrawersToggledListener) => {\n if (this.drawerOpenedListener !== null) {\n reportRuntimeApiWarning(\n 'app-layout-drawers',\n 'multiple app layout instances detected when calling onDrawerOpened'\n );\n }\n\n this.drawerOpenedListener = listener;\n\n return () => {\n this.drawerOpenedListener = null;\n };\n };\n\n onDrawerClosed = (listener: DrawersToggledListener) => {\n if (this.drawerClosedListener !== null) {\n reportRuntimeApiWarning(\n 'app-layout-drawers',\n 'multiple app layout instances detected when calling onDrawerClosed'\n );\n }\n\n this.drawerClosedListener = listener;\n\n return () => {\n this.drawerClosedListener = null;\n };\n };\n\n openDrawer = (drawerId: string, params?: OpenCloseDrawerParams) => {\n this.drawerOpenedListener?.(drawerId, params);\n };\n\n closeDrawer = (drawerId: string, params?: OpenCloseDrawerParams) => {\n this.drawerClosedListener?.(drawerId, params);\n };\n\n onDrawersUpdated = (listener: DrawersUpdateListener) => {\n this.drawersUpdateListeners.push(listener);\n\n return () => {\n this.drawersUpdateListeners = this.drawersUpdateListeners.filter(item => item !== listener);\n };\n };\n\n onDrawerResize = (listener: DrawersResizeListener) => {\n if (this.drawerResizeListener !== null) {\n reportRuntimeApiWarning(\n 'app-layout-drawers',\n 'multiple app layout instances detected when calling onDrawerResize'\n );\n }\n\n this.drawerResizeListener = listener;\n\n return () => {\n this.drawerResizeListener = null;\n };\n };\n\n resizeDrawer = (drawerId: string, size: number) => {\n this.drawerResizeListener?.(drawerId, size);\n };\n\n getDrawersState = () => {\n return this.drawers;\n };\n\n installPublic(api: Partial<DrawersApiPublic> = {}): DrawersApiPublic {\n api.registerDrawer ??= this.registerDrawer;\n api.updateDrawer ??= this.updateDrawer;\n api.openDrawer ??= this.openDrawer;\n api.closeDrawer ??= this.closeDrawer;\n api.resizeDrawer ??= this.resizeDrawer;\n return api as DrawersApiPublic;\n }\n\n installInternal(internalApi: Partial<DrawersApiInternal> = {}): DrawersApiInternal {\n internalApi.clearRegisteredDrawers ??= this.clearRegisteredDrawers;\n internalApi.onDrawersRegistered ??= this.onDrawersRegistered;\n internalApi.onDrawerOpened ??= this.onDrawerOpened;\n internalApi.onDrawerClosed ??= this.onDrawerClosed;\n internalApi.onDrawerResize ??= this.onDrawerResize;\n internalApi.onDrawersUpdated ??= this.onDrawersUpdated;\n internalApi.getDrawersState ??= this.getDrawersState;\n return internalApi as DrawersApiInternal;\n }\n}\n"]}
1
+ {"version":3,"file":"drawers.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/drawers.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AA0C7D,MAAM,mBAAmB,GAAG;IAC1B,OAAO;IACP,WAAW;IACX,aAAa;IACb,eAAe;IACf,eAAe;IACf,UAAU;CACF,CAAC;AAkCX,MAAM,OAAO,iBAAiB;IAA9B;QACU,YAAO,GAAwB,EAAE,CAAC;QAClC,gCAA2B,GAAuC,IAAI,CAAC;QACvE,yBAAoB,GAAkC,IAAI,CAAC;QAC3D,yBAAoB,GAAkC,IAAI,CAAC;QAC3D,2BAAsB,GAAiC,EAAE,CAAC;QAC1D,yBAAoB,GAAiC,IAAI,CAAC;QAElE,mBAAc,GAAG,QAAQ,CAAC,G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AgB,EAAC;QACvD,MAAA,WAAW,CAAC,eAAe,oCAA3B,WAAW,CAAC,eAAe,GAAK,IAAI,CAAC,eAAe,EAAC;QACrD,OAAO,WAAiC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonGroupProps, ItemRuntime } from '../../../button-group/interfaces';\nimport debounce from '../../debounce';\nimport { NonCancelableEventHandler } from '../../events';\nimport { reportRuntimeApiWarning } from '../helpers/metrics';\n\ntype DrawerVisibilityChange = (callback: (isVisible: boolean) => void) => void;\n\ninterface MountContentContext {\n onVisibilityChange: DrawerVisibilityChange;\n}\n\nexport interface DrawerStateChangeParams {\n isOpen: boolean;\n initiatedByUserAction?: boolean;\n}\n\nexport interface DrawerConfig {\n id: string;\n type?: 'local' | 'global';\n ariaLabels: {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n resizeHandleTooltipText?: string;\n expandedModeButton?: string;\n };\n isExpandable?: boolean;\n badge?: boolean;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n orderPriority?: number;\n defaultActive?: boolean;\n trigger?: {\n iconSvg?: string;\n };\n mountContent: (container: HTMLElement, mountContext: MountContentContext) => void;\n unmountContent: (container: HTMLElement) => void;\n preserveInactiveContent?: boolean;\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n headerActions?: ReadonlyArray<ItemRuntime>;\n onHeaderActionClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n}\n\nconst updatableProperties = [\n 'badge',\n 'resizable',\n 'defaultSize',\n 'orderPriority',\n 'defaultActive',\n 'onResize',\n] as const;\n\nexport type UpdateDrawerConfig = { id: DrawerConfig['id'] } & Partial<\n Pick<DrawerConfig, (typeof updatableProperties)[number]>\n>;\n\ntype DrawersRegistrationListener = (drawers: Array<DrawerConfig>) => void;\ntype DrawersUpdateListener = (drawers: Array<DrawerConfig>) => void;\n\nexport type DrawersToggledListener = (drawerId: string, params?: OpenCloseDrawerParams) => void;\ntype DrawersResizeListener = (drawerId: string, size: number) => void;\n\ninterface OpenCloseDrawerParams {\n initiatedByUserAction: boolean;\n}\n\nexport interface DrawersApiPublic {\n registerDrawer(config: DrawerConfig): void;\n updateDrawer(config: UpdateDrawerConfig): void;\n openDrawer(drawerId: string, params?: OpenCloseDrawerParams): void;\n closeDrawer(drawerId: string, params?: OpenCloseDrawerParams): void;\n resizeDrawer(drawerId: string, size: number): void;\n clearRegisteredDrawersForTesting(): void;\n}\n\nexport interface DrawersApiInternal {\n onDrawersRegistered(listener: DrawersRegistrationListener): () => void;\n onDrawerOpened(listener: DrawersToggledListener): () => void;\n onDrawerClosed(listener: DrawersToggledListener): () => void;\n onDrawerResize(listener: DrawersResizeListener): () => void;\n onDrawersUpdated(listener: DrawersUpdateListener): void;\n getDrawersState(): Array<DrawerConfig>;\n}\n\nexport class DrawersController {\n private drawers: Array<DrawerConfig> = [];\n private drawersRegistrationListener: DrawersRegistrationListener | null = null;\n private drawerOpenedListener: DrawersToggledListener | null = null;\n private drawerClosedListener: DrawersToggledListener | null = null;\n private drawersUpdateListeners: Array<DrawersUpdateListener> = [];\n private drawerResizeListener: DrawersResizeListener | null = null;\n\n scheduleUpdate = debounce(() => {\n this.drawersRegistrationListener?.(this.drawers);\n this.drawersUpdateListeners.forEach(drawersUpdateListeners => {\n drawersUpdateListeners?.(this.drawers);\n });\n }, 0);\n\n registerDrawer = (config: DrawerConfig) => {\n if (this.drawers.find(drawer => drawer.id === config.id)) {\n reportRuntimeApiWarning('app-layout-drawers', `drawer with id \"${config.id}\" is already registered`);\n }\n this.drawers = this.drawers.concat(config);\n this.scheduleUpdate();\n };\n\n updateDrawer = ({ id: drawerId, ...rest }: UpdateDrawerConfig) => {\n const drawerIndex = this.drawers.findIndex(({ id }) => id === drawerId);\n const oldDrawerConfig = this.drawers?.[drawerIndex];\n if (!oldDrawerConfig) {\n throw new Error(`[AwsUi] [runtime drawers] drawer with id ${drawerId} not found`);\n }\n const drawers = this.drawers.slice();\n const updatedDrawer = { ...oldDrawerConfig };\n for (const key of updatableProperties) {\n if (key in rest) {\n updatedDrawer[key] = (rest as any)[key];\n }\n }\n drawers[drawerIndex] = updatedDrawer;\n this.drawers = drawers;\n this.scheduleUpdate();\n };\n\n onDrawersRegistered = (listener: DrawersRegistrationListener) => {\n if (this.drawersRegistrationListener !== null) {\n reportRuntimeApiWarning(\n 'app-layout-drawers',\n 'multiple app layout instances detected when calling onDrawersRegistered'\n );\n }\n this.drawersRegistrationListener = listener;\n this.scheduleUpdate();\n return () => {\n this.drawersRegistrationListener = null;\n this.drawersUpdateListeners = [];\n };\n };\n\n clearRegisteredDrawersForTesting = () => {\n this.drawers = [];\n };\n\n onDrawerOpened = (listener: DrawersToggledListener) => {\n if (this.drawerOpenedListener !== null) {\n reportRuntimeApiWarning(\n 'app-layout-drawers',\n 'multiple app layout instances detected when calling onDrawerOpened'\n );\n }\n\n this.drawerOpenedListener = listener;\n\n return () => {\n this.drawerOpenedListener = null;\n };\n };\n\n onDrawerClosed = (listener: DrawersToggledListener) => {\n if (this.drawerClosedListener !== null) {\n reportRuntimeApiWarning(\n 'app-layout-drawers',\n 'multiple app layout instances detected when calling onDrawerClosed'\n );\n }\n\n this.drawerClosedListener = listener;\n\n return () => {\n this.drawerClosedListener = null;\n };\n };\n\n openDrawer = (drawerId: string, params?: OpenCloseDrawerParams) => {\n this.drawerOpenedListener?.(drawerId, params);\n };\n\n closeDrawer = (drawerId: string, params?: OpenCloseDrawerParams) => {\n this.drawerClosedListener?.(drawerId, params);\n };\n\n onDrawersUpdated = (listener: DrawersUpdateListener) => {\n this.drawersUpdateListeners.push(listener);\n\n return () => {\n this.drawersUpdateListeners = this.drawersUpdateListeners.filter(item => item !== listener);\n };\n };\n\n onDrawerResize = (listener: DrawersResizeListener) => {\n if (this.drawerResizeListener !== null) {\n reportRuntimeApiWarning(\n 'app-layout-drawers',\n 'multiple app layout instances detected when calling onDrawerResize'\n );\n }\n\n this.drawerResizeListener = listener;\n\n return () => {\n this.drawerResizeListener = null;\n };\n };\n\n resizeDrawer = (drawerId: string, size: number) => {\n this.drawerResizeListener?.(drawerId, size);\n };\n\n getDrawersState = () => {\n return this.drawers;\n };\n\n installPublic(api: Partial<DrawersApiPublic> = {}): DrawersApiPublic {\n api.registerDrawer ??= this.registerDrawer;\n api.updateDrawer ??= this.updateDrawer;\n api.openDrawer ??= this.openDrawer;\n api.closeDrawer ??= this.closeDrawer;\n api.resizeDrawer ??= this.resizeDrawer;\n api.clearRegisteredDrawersForTesting ??= this.clearRegisteredDrawersForTesting;\n return api as DrawersApiPublic;\n }\n\n installInternal(internalApi: Partial<DrawersApiInternal> = {}): DrawersApiInternal {\n internalApi.onDrawersRegistered ??= this.onDrawersRegistered;\n internalApi.onDrawerOpened ??= this.onDrawerOpened;\n internalApi.onDrawerClosed ??= this.onDrawerClosed;\n internalApi.onDrawerResize ??= this.onDrawerResize;\n internalApi.onDrawersUpdated ??= this.onDrawersUpdated;\n internalApi.getDrawersState ??= this.getDrawersState;\n return internalApi as DrawersApiInternal;\n }\n}\n"]}
package/package.json CHANGED
@@ -158,7 +158,7 @@
158
158
  "./internal/base-component/index.js",
159
159
  "./internal/base-component/styles.css.js"
160
160
  ],
161
- "version": "3.0.1160",
161
+ "version": "3.0.1161",
162
162
  "repository": {
163
163
  "type": "git",
164
164
  "url": "https://github.com/cloudscape-design/components.git"