@cloudscape-design/components-themeable 3.0.1219 → 3.0.1220
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/internal/manifest.json +1 -1
- package/lib/internal/scss/app-layout/visual-refresh-toolbar/drawer/styles.scss +8 -0
- package/lib/internal/scss/internal/do-not-use/feature-prompt/styles.scss +1 -1
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/template/app-layout/utils/use-drawers.d.ts +2 -1
- package/lib/internal/template/app-layout/utils/use-drawers.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-drawers.js +8 -2
- package/lib/internal/template/app-layout/utils/use-drawers.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/feature-notifications-drawer-content.d.ts +13 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/feature-notifications-drawer-content.d.ts.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/feature-notifications-drawer-content.js +47 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/feature-notifications-drawer-content.js.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +32 -30
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +89 -81
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +32 -30
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts +2 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-app-layout.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-app-layout.js +12 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-app-layout.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-feature-notifications.d.ts +18 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-feature-notifications.d.ts.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-feature-notifications.js +165 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-feature-notifications.js.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts +3 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +13 -5
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts +3 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js +13 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js.map +1 -1
- package/lib/internal/template/drawer/use-sticky-footer.js +2 -2
- package/lib/internal/template/drawer/use-sticky-footer.js.map +1 -1
- package/lib/internal/template/i18n/messages/all.all.js +1 -1
- package/lib/internal/template/i18n/messages/all.all.json +1 -1
- package/lib/internal/template/i18n/messages/all.ar.js +1 -1
- package/lib/internal/template/i18n/messages/all.ar.json +1 -1
- package/lib/internal/template/i18n/messages/all.de.js +1 -1
- package/lib/internal/template/i18n/messages/all.de.json +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.js +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.json +1 -1
- package/lib/internal/template/i18n/messages/all.en.js +1 -1
- package/lib/internal/template/i18n/messages/all.en.json +1 -1
- package/lib/internal/template/i18n/messages/all.es.js +1 -1
- package/lib/internal/template/i18n/messages/all.es.json +1 -1
- package/lib/internal/template/i18n/messages/all.fr.js +1 -1
- package/lib/internal/template/i18n/messages/all.fr.json +1 -1
- package/lib/internal/template/i18n/messages/all.id.js +1 -1
- package/lib/internal/template/i18n/messages/all.id.json +1 -1
- package/lib/internal/template/i18n/messages/all.it.js +1 -1
- package/lib/internal/template/i18n/messages/all.it.json +1 -1
- package/lib/internal/template/i18n/messages/all.ja.js +1 -1
- package/lib/internal/template/i18n/messages/all.ja.json +1 -1
- package/lib/internal/template/i18n/messages/all.ko.js +1 -1
- package/lib/internal/template/i18n/messages/all.ko.json +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.js +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.json +1 -1
- package/lib/internal/template/i18n/messages/all.tr.js +1 -1
- package/lib/internal/template/i18n/messages/all.tr.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.json +1 -1
- package/lib/internal/template/i18n/messages-types.d.ts +618 -610
- package/lib/internal/template/i18n/messages-types.d.ts.map +1 -1
- package/lib/internal/template/i18n/messages-types.js +0 -1
- package/lib/internal/template/i18n/messages-types.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/chart-popover/index.d.ts +1 -1
- package/lib/internal/template/internal/components/chart-popover/index.js +1 -1
- package/lib/internal/template/internal/components/chart-popover/index.js.map +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/interfaces.d.ts +4 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/interfaces.js.map +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/internal.d.ts.map +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/internal.js +37 -11
- package/lib/internal/template/internal/do-not-use/feature-prompt/internal.js.map +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/styles.css.js +3 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/styles.scoped.css +4 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/styles.selectors.js +3 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/persistence/index.d.ts +5 -0
- package/lib/internal/template/internal/persistence/index.d.ts.map +1 -1
- package/lib/internal/template/internal/persistence/index.js +17 -16
- package/lib/internal/template/internal/persistence/index.js.map +1 -1
- package/lib/internal/template/internal/plugins/widget/core.d.ts +3 -3
- package/lib/internal/template/internal/plugins/widget/core.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/widget/core.js.map +1 -1
- package/lib/internal/template/internal/plugins/widget/index.d.ts +10 -2
- package/lib/internal/template/internal/plugins/widget/index.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/widget/index.js +23 -0
- package/lib/internal/template/internal/plugins/widget/index.js.map +1 -1
- package/lib/internal/template/internal/plugins/widget/interfaces.d.ts +39 -3
- package/lib/internal/template/internal/plugins/widget/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/widget/interfaces.js.map +1 -1
- package/lib/internal/template/internal/plugins/widget.d.ts +1 -1
- package/lib/internal/template/internal/plugins/widget.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/widget.js +1 -1
- package/lib/internal/template/internal/plugins/widget.js.map +1 -1
- package/lib/internal/template/internal/utils/promises.d.ts +11 -0
- package/lib/internal/template/internal/utils/promises.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/promises.js +24 -0
- package/lib/internal/template/internal/utils/promises.js.map +1 -1
- package/lib/internal/template/package.json +2 -0
- package/lib/internal/template/plugins/index.d.ts +8 -0
- package/lib/internal/template/plugins/index.d.ts.map +1 -0
- package/lib/internal/template/plugins/index.js +11 -0
- package/lib/internal/template/plugins/index.js.map +1 -0
- package/lib/internal/template/popover/body.d.ts +2 -2
- package/lib/internal/template/popover/body.d.ts.map +1 -1
- package/lib/internal/template/popover/body.js +2 -2
- package/lib/internal/template/popover/body.js.map +1 -1
- package/lib/internal/template/select/parts/filter.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/persistence/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,0BAA0B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/persistence/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,0BAA0B;AAC1B,qEAAqE;AAoBrE,MAAM,UAAU,iCAAiC,CAAC,SAA8B;IAC9E,IAAI,SAAS,CAAC,sBAAsB,EAAE,CAAC;QACrC,sBAAsB,GAAG,SAAS,CAAC,sBAAsB,CAAC;IAC5D,CAAC;IACD,IAAI,SAAS,CAAC,uBAAuB,EAAE,CAAC;QACtC,uBAAuB,GAAG,SAAS,CAAC,uBAAuB,CAAC;IAC9D,CAAC;IACD,IAAI,SAAS,CAAC,mBAAmB,EAAE,CAAC;QAClC,mBAAmB,GAAG,SAAS,CAAC,mBAAmB,CAAC;IACtD,CAAC;IACD,IAAI,SAAS,CAAC,oBAAoB,EAAE,CAAC;QACnC,oBAAoB,GAAG,SAAS,CAAC,oBAAoB,CAAC;IACxD,CAAC;IACD,IAAI,SAAS,CAAC,2BAA2B,EAAE,CAAC;QAC1C,2BAA2B,GAAG,SAAS,CAAC,2BAA2B,CAAC;IACtE,CAAC;IACD,IAAI,SAAS,CAAC,4BAA4B,EAAE,CAAC;QAC3C,4BAA4B,GAAG,SAAS,CAAC,4BAA4B,CAAC;IACxE,CAAC;AACH,CAAC;AAED,MAAM,CAAC,IAAI,sBAAsB,GAAG,KAAK,WAAW,iBAAkD;IACpG,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,CAAC,IAAI,uBAAuB,GAAG,KAAK,WACxC,iBAAkD;IAElD,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,CAAC,IAAI,mBAAmB,GAAG,KAAK,WAAW,iBAA+C;IAC9F,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,CAAC,IAAI,oBAAoB,GAAG,KAAK,WAAW,iBAA+C;IAC/F,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,CAAC,IAAI,2BAA2B,GAAG,KAAK,WAC5C,iBAAwD,EAExD,KAA6B;IAE7B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,CAAC,IAAI,4BAA4B,GAAG,KAAK,WAC7C,iBAAwD;IAExD,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/* istanbul ignore file */\n/* eslint-disable require-await, @typescript-eslint/no-unused-vars */\n\nimport { AlertProps } from '../../alert/interfaces';\nimport { FlashbarProps } from '../../flashbar/interfaces';\nimport { FeatureNotificationsPersistenceConfig } from '../plugins/widget/interfaces';\n\ninterface PersistenceFunction {\n persistFlashbarDismiss?: (persistenceConfig: FlashbarProps.PersistenceConfig) => Promise<void>;\n retrieveFlashbarDismiss?: (persistenceConfig: FlashbarProps.PersistenceConfig) => Promise<boolean>;\n persistAlertDismiss?: (persistenceConfig: AlertProps.PersistenceConfig) => Promise<void>;\n retrieveAlertDismiss?: (persistenceConfig: AlertProps.PersistenceConfig) => Promise<boolean>;\n persistFeatureNotifications?: (\n persistenceConfig: FeatureNotificationsPersistenceConfig,\n value: Record<string, string>\n ) => Promise<void>;\n retrieveFeatureNotifications?: (\n persistenceConfig: FeatureNotificationsPersistenceConfig\n ) => Promise<Record<string, string>>;\n}\n\nexport function setPersistenceFunctionsForTesting(functions: PersistenceFunction) {\n if (functions.persistFlashbarDismiss) {\n persistFlashbarDismiss = functions.persistFlashbarDismiss;\n }\n if (functions.retrieveFlashbarDismiss) {\n retrieveFlashbarDismiss = functions.retrieveFlashbarDismiss;\n }\n if (functions.persistAlertDismiss) {\n persistAlertDismiss = functions.persistAlertDismiss;\n }\n if (functions.retrieveAlertDismiss) {\n retrieveAlertDismiss = functions.retrieveAlertDismiss;\n }\n if (functions.persistFeatureNotifications) {\n persistFeatureNotifications = functions.persistFeatureNotifications;\n }\n if (functions.retrieveFeatureNotifications) {\n retrieveFeatureNotifications = functions.retrieveFeatureNotifications;\n }\n}\n\nexport let persistFlashbarDismiss = async function (persistenceConfig: FlashbarProps.PersistenceConfig): Promise<void> {\n return Promise.resolve();\n};\n\nexport let retrieveFlashbarDismiss = async function (\n persistenceConfig: FlashbarProps.PersistenceConfig\n): Promise<boolean> {\n return Promise.resolve(false);\n};\n\nexport let persistAlertDismiss = async function (persistenceConfig: AlertProps.PersistenceConfig): Promise<void> {\n return Promise.resolve();\n};\n\nexport let retrieveAlertDismiss = async function (persistenceConfig: AlertProps.PersistenceConfig): Promise<boolean> {\n return Promise.resolve(false);\n};\n\nexport let persistFeatureNotifications = async function (\n persistenceConfig: FeatureNotificationsPersistenceConfig,\n\n value: Record<string, string>\n): Promise<void> {\n return Promise.resolve();\n};\n\nexport let retrieveFeatureNotifications = async function (\n persistenceConfig: FeatureNotificationsPersistenceConfig\n): Promise<Record<string, string>> {\n return Promise.resolve({});\n};\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InitialMessage, WidgetMessage } from './interfaces';
|
|
2
|
-
type MessageHandler = (event: WidgetMessage) => void;
|
|
2
|
+
type MessageHandler = (event: WidgetMessage<unknown>) => void;
|
|
3
3
|
export declare function getAppLayoutMessageHandler(): MessageHandler | undefined;
|
|
4
|
-
export declare function getAppLayoutInitialMessages(): Array<InitialMessage
|
|
5
|
-
export declare function pushInitialMessage(message: InitialMessage): void;
|
|
4
|
+
export declare function getAppLayoutInitialMessages<T>(): Array<InitialMessage<T>>;
|
|
5
|
+
export declare function pushInitialMessage<T>(message: InitialMessage<T>): void;
|
|
6
6
|
export declare function registerAppLayoutHandler(handler: MessageHandler): () => void;
|
|
7
7
|
export declare function clearInitialMessages(): void;
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/core.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAc7D,KAAK,cAAc,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/core.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAc7D,KAAK,cAAc,GAAG,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;AAM9D,wBAAgB,0BAA0B,+BAGzC;AAED,wBAAgB,2BAA2B,CAAC,CAAC,KAAK,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAMzE;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,QAI/D;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,cAAc,cAW/D;AAED,wBAAgB,oBAAoB,SAEnC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,YAE/B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,qBAOjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/core.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;AAChF,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;AAClF,MAAM,6BAA6B,GAAG,MAAM,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;AAQjF,MAAM,mBAAmB,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAIlD,SAAS,SAAS;IAChB,OAAO,MAAiC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;IACxB,OAAO,GAAG,CAAC,wBAAwB,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,2BAA2B;;IACzC,MAAM,eAAe,GAAG,MAAA,SAAS,EAAE,CAAC,yBAAyB,CAAC,mCAAI,EAAE,CAAC;IACrE,SAAS,EAAE,CAAC,yBAAyB,CAAC,GAAG,eAAe,CAAC,MAAM,CAC7D,OAAO,CAAC,EAAE,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CACvD,CAAC;IACF,OAAO,
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/core.ts"],"names":[],"mappings":"AA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C,uBAAuB,CAAC,iBAAiB,EAAE,iEAAiE,CAAC,CAAC;IAChH,CAAC;IACD,GAAG,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC;IACxC,MAAA,GAAG,CAAC,6BAA6B,CAAC,0CAAE,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACxD,GAAG,CAAC,6BAA6B,CAAC,GAAG,EAAE,CAAC;IACxC,OAAO,GAAG,EAAE;QACV,GAAG,CAAC,wBAAwB,CAAC,GAAG,SAAS,CAAC;IAC5C,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,SAAS,EAAE,CAAC,yBAAyB,CAAC,GAAG,SAAS,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,CAAC,CAAC,0BAA0B,EAAE,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;;IAChC,IAAI,gBAAgB,EAAE,EAAE,CAAC;QACvB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IACD,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;IACxB,GAAG,CAAC,6BAA6B,CAAC,GAAG,MAAA,GAAG,CAAC,6BAA6B,CAAC,mCAAI,EAAE,CAAC;IAC9E,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,WAAC,OAAA,MAAA,GAAG,CAAC,6BAA6B,CAAC,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAA,EAAA,CAAC,CAAC;AACnF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { reportRuntimeApiWarning } from '../helpers/metrics';\nimport { InitialMessage, WidgetMessage } from './interfaces';\n\nconst storageKeyMessageHandler = Symbol.for('awsui-widget-api-message-handler');\nconst storageKeyInitialMessages = Symbol.for('awsui-widget-api-initial-messages');\nconst storageKeyReadyDeferCallbacks = Symbol.for('awsui-widget-api-ready-defer');\n\ninterface WindowWithApi extends Window {\n [storageKeyMessageHandler]: MessageHandler | undefined;\n [storageKeyInitialMessages]: Array<InitialMessage<unknown>> | undefined;\n [storageKeyReadyDeferCallbacks]: Array<(value?: unknown) => void> | undefined;\n}\n\nconst oneTimeMessageTypes = ['emit-notification'];\n\ntype MessageHandler = (event: WidgetMessage<unknown>) => void;\n\nfunction getWindow() {\n return window as Window as WindowWithApi;\n}\n\nexport function getAppLayoutMessageHandler() {\n const win = getWindow();\n return win[storageKeyMessageHandler];\n}\n\nexport function getAppLayoutInitialMessages<T>(): Array<InitialMessage<T>> {\n const initialMessages = getWindow()[storageKeyInitialMessages] ?? [];\n getWindow()[storageKeyInitialMessages] = initialMessages.filter(\n message => !oneTimeMessageTypes.includes(message.type)\n );\n return initialMessages as Array<InitialMessage<T>>;\n}\n\nexport function pushInitialMessage<T>(message: InitialMessage<T>) {\n const win = getWindow();\n win[storageKeyInitialMessages] = win[storageKeyInitialMessages] ?? [];\n win[storageKeyInitialMessages].push(message as InitialMessage<unknown>);\n}\n\nexport function registerAppLayoutHandler(handler: MessageHandler) {\n const win = getWindow();\n if (win[storageKeyMessageHandler]) {\n reportRuntimeApiWarning('AppLayoutWidget', 'Double registration attempt, the old handler will be overridden');\n }\n win[storageKeyMessageHandler] = handler;\n win[storageKeyReadyDeferCallbacks]?.forEach(fn => fn());\n win[storageKeyReadyDeferCallbacks] = [];\n return () => {\n win[storageKeyMessageHandler] = undefined;\n };\n}\n\nexport function clearInitialMessages() {\n getWindow()[storageKeyInitialMessages] = undefined;\n}\n\n/**\n * Returns whether there is an app layout present on this page or not\n */\nexport function isAppLayoutReady() {\n return !!getAppLayoutMessageHandler();\n}\n\n/**\n * Returns a promise that resolves once the app layout has loaded\n */\nexport function whenAppLayoutReady() {\n if (isAppLayoutReady()) {\n return Promise.resolve();\n }\n const win = getWindow();\n win[storageKeyReadyDeferCallbacks] = win[storageKeyReadyDeferCallbacks] ?? [];\n return new Promise(resolve => win[storageKeyReadyDeferCallbacks]?.push(resolve));\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppLayoutUpdateMessage, DrawerPayload } from './interfaces';
|
|
1
|
+
import { AppLayoutUpdateMessage, DrawerPayload, FeatureNotificationsPayload, FeatureNotificationsPayloadPublic } from './interfaces';
|
|
2
2
|
/**
|
|
3
3
|
* Registers a new left runtime drawer to app layout
|
|
4
4
|
* @param drawer
|
|
@@ -9,9 +9,17 @@ export declare function registerLeftDrawer(drawer: DrawerPayload): void;
|
|
|
9
9
|
* @param drawer
|
|
10
10
|
*/
|
|
11
11
|
export declare function registerBottomDrawer(drawer: DrawerPayload): void;
|
|
12
|
+
/**
|
|
13
|
+
* Registers a new feature notifications runtime drawer to app layout
|
|
14
|
+
* @param payload
|
|
15
|
+
*/
|
|
16
|
+
export declare function registerFeatureNotifications<T>(payload: FeatureNotificationsPayload<T>): void;
|
|
17
|
+
export declare function registerFeatureNotificationsPublic<T>(payload: FeatureNotificationsPayloadPublic<T>): void;
|
|
18
|
+
export declare function showFeaturePromptIfPossible(): void;
|
|
19
|
+
export declare function clearFeatureNotifications(): void;
|
|
12
20
|
/**
|
|
13
21
|
* Interact with already registered app layout drawers
|
|
14
22
|
* @param message
|
|
15
23
|
*/
|
|
16
|
-
export declare function updateDrawer(message: AppLayoutUpdateMessage): void;
|
|
24
|
+
export declare function updateDrawer<T = unknown>(message: AppLayoutUpdateMessage<T>): void;
|
|
17
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,2BAA2B,EAC3B,iCAAiC,EAIlC,MAAM,cAAc,CAAC;AAEtB;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,QAIvD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,QAIzD;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,OAAO,EAAE,2BAA2B,CAAC,CAAC,CAAC,QAOtF;AACD,wBAAgB,kCAAkC,CAAC,CAAC,EAAE,OAAO,EAAE,iCAAiC,CAAC,CAAC,CAAC,QAElG;AAED,wBAAgB,2BAA2B,SAE1C;AAED,wBAAgB,yBAAyB,SAExC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,QAS3E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { getExternalProps } from '../../utils/external-props';
|
|
3
4
|
import { getAppLayoutInitialMessages, getAppLayoutMessageHandler, pushInitialMessage } from './core';
|
|
4
5
|
/**
|
|
5
6
|
* Registers a new left runtime drawer to app layout
|
|
@@ -21,6 +22,28 @@ export function registerBottomDrawer(drawer) {
|
|
|
21
22
|
pushInitialMessage(message);
|
|
22
23
|
(_a = getAppLayoutMessageHandler()) === null || _a === void 0 ? void 0 : _a(message);
|
|
23
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Registers a new feature notifications runtime drawer to app layout
|
|
27
|
+
* @param payload
|
|
28
|
+
*/
|
|
29
|
+
export function registerFeatureNotifications(payload) {
|
|
30
|
+
var _a;
|
|
31
|
+
const message = {
|
|
32
|
+
type: 'registerFeatureNotifications',
|
|
33
|
+
payload,
|
|
34
|
+
};
|
|
35
|
+
pushInitialMessage(message);
|
|
36
|
+
(_a = getAppLayoutMessageHandler()) === null || _a === void 0 ? void 0 : _a(message);
|
|
37
|
+
}
|
|
38
|
+
export function registerFeatureNotificationsPublic(payload) {
|
|
39
|
+
registerFeatureNotifications(getExternalProps(payload));
|
|
40
|
+
}
|
|
41
|
+
export function showFeaturePromptIfPossible() {
|
|
42
|
+
updateDrawer({ type: 'showFeaturePromptIfPossible' });
|
|
43
|
+
}
|
|
44
|
+
export function clearFeatureNotifications() {
|
|
45
|
+
updateDrawer({ type: 'clearFeatureNotifications' });
|
|
46
|
+
}
|
|
24
47
|
/**
|
|
25
48
|
* Interact with already registered app layout drawers
|
|
26
49
|
* @param message
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAWrG;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAqB;;IACtD,MAAM,OAAO,GAA0B,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IACvF,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC5B,MAAA,0BAA0B,EAAE,0CAAG,OAAiC,CAAC,CAAC;AACpE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAqB;;IACxD,MAAM,OAAO,GAA0B,EAAE,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC;IACpH,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC5B,MAAA,0BAA0B,EAAE,0CAAG,OAAiC,CAAC,CAAC;AACpE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAI,OAAuC;;IACrF,MAAM,OAAO,GAA2C;QACtD,IAAI,EAAE,8BAA8B;QACpC,OAAO;KACR,CAAC;IACF,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC5B,MAAA,0BAA0B,EAAE,0CAAG,OAAiC,CAAC,CAAC;AACpE,CAAC;AACD,MAAM,UAAU,kCAAkC,CAAI,OAA6C;IACjG,4BAA4B,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,YAAY,CAAC,EAAE,IAAI,EAAE,6BAA6B,EAAE,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,YAAY,CAAC,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC,CAAC;AACtD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAc,OAAkC;;IAC1E,IAAI,OAAO,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;QAC1C,2BAA2B,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;YACrD,IAAI,cAAc,CAAC,OAAO,CAAC,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;gBACrD,cAAc,CAAC,OAAO,GAAG,EAAE,GAAG,cAAc,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;YAC7E,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACD,MAAA,0BAA0B,EAAE,0CAAG,OAAiC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getExternalProps } from '../../utils/external-props';\nimport { getAppLayoutInitialMessages, getAppLayoutMessageHandler, pushInitialMessage } from './core';\nimport {\n AppLayoutUpdateMessage,\n DrawerPayload,\n FeatureNotificationsPayload,\n FeatureNotificationsPayloadPublic,\n RegisterDrawerMessage,\n RegisterFeatureNotificationsMessage,\n WidgetMessage,\n} from './interfaces';\n\n/**\n * Registers a new left runtime drawer to app layout\n * @param drawer\n */\nexport function registerLeftDrawer(drawer: DrawerPayload) {\n const message: RegisterDrawerMessage = { type: 'registerLeftDrawer', payload: drawer };\n pushInitialMessage(message);\n getAppLayoutMessageHandler()?.(message as WidgetMessage<unknown>);\n}\n\n/**\n * Registers a new bottom runtime drawer to app layout\n * @param drawer\n */\nexport function registerBottomDrawer(drawer: DrawerPayload) {\n const message: RegisterDrawerMessage = { type: 'registerBottomDrawer', payload: { ...drawer, position: 'bottom' } };\n pushInitialMessage(message);\n getAppLayoutMessageHandler()?.(message as WidgetMessage<unknown>);\n}\n\n/**\n * Registers a new feature notifications runtime drawer to app layout\n * @param payload\n */\nexport function registerFeatureNotifications<T>(payload: FeatureNotificationsPayload<T>) {\n const message: RegisterFeatureNotificationsMessage<T> = {\n type: 'registerFeatureNotifications',\n payload,\n };\n pushInitialMessage(message);\n getAppLayoutMessageHandler()?.(message as WidgetMessage<unknown>);\n}\nexport function registerFeatureNotificationsPublic<T>(payload: FeatureNotificationsPayloadPublic<T>) {\n registerFeatureNotifications(getExternalProps(payload));\n}\n\nexport function showFeaturePromptIfPossible() {\n updateDrawer({ type: 'showFeaturePromptIfPossible' });\n}\n\nexport function clearFeatureNotifications() {\n updateDrawer({ type: 'clearFeatureNotifications' });\n}\n\n/**\n * Interact with already registered app layout drawers\n * @param message\n */\nexport function updateDrawer<T = unknown>(message: AppLayoutUpdateMessage<T>) {\n if (message.type === 'updateDrawerConfig') {\n getAppLayoutInitialMessages().forEach(initialMessage => {\n if (initialMessage.payload.id === message.payload.id) {\n initialMessage.payload = { ...initialMessage.payload, ...message.payload };\n }\n });\n }\n getAppLayoutMessageHandler()?.(message as WidgetMessage<unknown>);\n}\n"]}
|
|
@@ -51,7 +51,37 @@ export interface DrawerPayload {
|
|
|
51
51
|
}>;
|
|
52
52
|
position?: 'side' | 'bottom';
|
|
53
53
|
}
|
|
54
|
+
type Destructor = () => void;
|
|
55
|
+
export type MountContentPart<T> = (container: HTMLElement, data: T) => Destructor | void;
|
|
56
|
+
export interface Feature<T> {
|
|
57
|
+
id: string;
|
|
58
|
+
header: T;
|
|
59
|
+
content: T;
|
|
60
|
+
contentCategory?: T;
|
|
61
|
+
releaseDate: Date;
|
|
62
|
+
}
|
|
63
|
+
export interface FeatureNotificationsPersistenceConfig {
|
|
64
|
+
uniqueKey: string;
|
|
65
|
+
}
|
|
66
|
+
type FeatureId = string;
|
|
67
|
+
type FeatureReleaseDateString = string;
|
|
68
|
+
export type PersistedFeaturesDict = Record<FeatureId, FeatureReleaseDateString>;
|
|
69
|
+
export type PersistFeatureNotifications = (persistenceConfig: FeatureNotificationsPersistenceConfig, value: PersistedFeaturesDict) => Promise<void>;
|
|
70
|
+
export type RetrieveFeatureNotifications = (persistenceConfig: FeatureNotificationsPersistenceConfig) => Promise<PersistedFeaturesDict>;
|
|
71
|
+
export interface FeatureNotificationsPayload<T> {
|
|
72
|
+
id: string;
|
|
73
|
+
suppressFeaturePrompt?: boolean;
|
|
74
|
+
features: Array<Feature<T>>;
|
|
75
|
+
mountItem?: MountContentPart<T>;
|
|
76
|
+
featuresPageLink?: string;
|
|
77
|
+
filterFeatures?: (item: Feature<T>) => boolean;
|
|
78
|
+
persistenceConfig?: FeatureNotificationsPersistenceConfig;
|
|
79
|
+
__persistFeatureNotifications?: PersistFeatureNotifications;
|
|
80
|
+
__retrieveFeatureNotifications?: RetrieveFeatureNotifications;
|
|
81
|
+
}
|
|
82
|
+
export type FeatureNotificationsPayloadPublic<T> = Omit<FeatureNotificationsPayload<T>, '__persistFeatureNotifications' | '__retrieveFeatureNotifications'>;
|
|
54
83
|
export type RegisterDrawerMessage = Message<'registerLeftDrawer' | 'registerBottomDrawer', DrawerPayload>;
|
|
84
|
+
export type RegisterFeatureNotificationsMessage<T> = Message<'registerFeatureNotifications', FeatureNotificationsPayload<T>>;
|
|
55
85
|
export type UpdateDrawerConfigMessage = Message<'updateDrawerConfig', Pick<DrawerPayload, 'id'> & Partial<Omit<DrawerPayload, 'mountContent' | 'unmountContent' | 'mountHeader' | 'unmountHeader'>>>;
|
|
56
86
|
export type OpenDrawerMessage = Message<'openDrawer', {
|
|
57
87
|
id: string;
|
|
@@ -69,8 +99,14 @@ export type ExpandDrawerMessage = Message<'expandDrawer', {
|
|
|
69
99
|
export interface ExitExpandedModeMessage {
|
|
70
100
|
type: 'exitExpandedMode';
|
|
71
101
|
}
|
|
72
|
-
export
|
|
73
|
-
|
|
74
|
-
|
|
102
|
+
export interface ShowFeaturePromptIfPossible {
|
|
103
|
+
type: 'showFeaturePromptIfPossible';
|
|
104
|
+
}
|
|
105
|
+
export interface ClearFeatureNotifications {
|
|
106
|
+
type: 'clearFeatureNotifications';
|
|
107
|
+
}
|
|
108
|
+
export type AppLayoutUpdateMessage<T = unknown> = UpdateDrawerConfigMessage | OpenDrawerMessage | CloseDrawerMessage | ResizeDrawerMessage | ExpandDrawerMessage | ExitExpandedModeMessage | RegisterFeatureNotificationsMessage<T> | ShowFeaturePromptIfPossible | ClearFeatureNotifications;
|
|
109
|
+
export type InitialMessage<T> = RegisterDrawerMessage | RegisterFeatureNotificationsMessage<T>;
|
|
110
|
+
export type WidgetMessage<T = unknown> = InitialMessage<T> | AppLayoutUpdateMessage<T>;
|
|
75
111
|
export {};
|
|
76
112
|
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAA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AC;AAE9B,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,qBAAqB,GAAG,mCAAmC,CAAC,CAAC,CAAC,CAAC;AAE/F,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,OAAO,IAAI,cAAc,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/interfaces.ts"],"names":[],"mappings":"","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 { NonCancelableEventHandler } from '../../events';\n\ninterface Message<Type, Payload> {\n type: Type;\n payload: Payload;\n}\n\ntype DrawerVisibilityChange = (callback: (isVisible: boolean) => void) => void;\n\ninterface MountContentContext {\n onVisibilityChange: DrawerVisibilityChange;\n}\n\ninterface DrawerStateChangeParams {\n isOpen: boolean;\n initiatedByUserAction?: boolean;\n}\n\nexport interface DrawerPayload {\n id: string;\n ariaLabels: {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n resizeHandleTooltipText?: string;\n expandedModeButton?: string;\n exitExpandedModeButton?: string;\n };\n isExpandable?: boolean;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n defaultActive?: boolean;\n trigger?: {\n iconSvg?: string;\n customIcon?: string;\n };\n exitExpandedModeTrigger?: {\n customIcon?: string;\n };\n mountContent: (container: HTMLElement, mountContext: MountContentContext) => void;\n unmountContent: (container: HTMLElement) => void;\n preserveInactiveContent?: boolean;\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n mountHeader?: (container: HTMLElement) => void;\n unmountHeader?: (container: HTMLElement) => void;\n headerActions?: ReadonlyArray<ItemRuntime>;\n onHeaderActionClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n onToggleFocusMode?: NonCancelableEventHandler<{ isExpanded: boolean }>;\n position?: 'side' | 'bottom';\n}\n\nexport type RegisterDrawerMessage = Message<'registerLeftDrawer' | 'registerBottomDrawer', DrawerPayload>;\nexport type UpdateDrawerConfigMessage = Message<\n 'updateDrawerConfig',\n Pick<DrawerPayload, 'id'> &\n Partial<Omit<DrawerPayload, 'mountContent' | 'unmountContent' | 'mountHeader' | 'unmountHeader'>>\n>;\nexport type OpenDrawerMessage = Message<'openDrawer', { id: string }>;\nexport type CloseDrawerMessage = Message<'closeDrawer', { id: string }>;\nexport type ResizeDrawerMessage = Message<'resizeDrawer', { id: string; size: number }>;\nexport type ExpandDrawerMessage = Message<'expandDrawer', { id: string }>;\nexport interface ExitExpandedModeMessage {\n type: 'exitExpandedMode';\n}\n\nexport type AppLayoutUpdateMessage =\n | UpdateDrawerConfigMessage\n | OpenDrawerMessage\n | CloseDrawerMessage\n | ResizeDrawerMessage\n | ExpandDrawerMessage\n | ExitExpandedModeMessage;\n\nexport type InitialMessage = RegisterDrawerMessage
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/interfaces.ts"],"names":[],"mappings":"","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 { NonCancelableEventHandler } from '../../events';\n\ninterface Message<Type, Payload> {\n type: Type;\n payload: Payload;\n}\n\ntype DrawerVisibilityChange = (callback: (isVisible: boolean) => void) => void;\n\ninterface MountContentContext {\n onVisibilityChange: DrawerVisibilityChange;\n}\n\ninterface DrawerStateChangeParams {\n isOpen: boolean;\n initiatedByUserAction?: boolean;\n}\n\nexport interface DrawerPayload {\n id: string;\n ariaLabels: {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n resizeHandleTooltipText?: string;\n expandedModeButton?: string;\n exitExpandedModeButton?: string;\n };\n isExpandable?: boolean;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n defaultActive?: boolean;\n trigger?: {\n iconSvg?: string;\n customIcon?: string;\n };\n exitExpandedModeTrigger?: {\n customIcon?: string;\n };\n mountContent: (container: HTMLElement, mountContext: MountContentContext) => void;\n unmountContent: (container: HTMLElement) => void;\n preserveInactiveContent?: boolean;\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n mountHeader?: (container: HTMLElement) => void;\n unmountHeader?: (container: HTMLElement) => void;\n headerActions?: ReadonlyArray<ItemRuntime>;\n onHeaderActionClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n onToggleFocusMode?: NonCancelableEventHandler<{ isExpanded: boolean }>;\n position?: 'side' | 'bottom';\n}\n\ntype Destructor = () => void;\nexport type MountContentPart<T> = (container: HTMLElement, data: T) => Destructor | void;\n\nexport interface Feature<T> {\n id: string;\n header: T;\n content: T;\n contentCategory?: T;\n releaseDate: Date;\n}\n\nexport interface FeatureNotificationsPersistenceConfig {\n uniqueKey: string;\n}\n\ntype FeatureId = string;\ntype FeatureReleaseDateString = string;\nexport type PersistedFeaturesDict = Record<FeatureId, FeatureReleaseDateString>;\nexport type PersistFeatureNotifications = (\n persistenceConfig: FeatureNotificationsPersistenceConfig,\n value: PersistedFeaturesDict\n) => Promise<void>;\nexport type RetrieveFeatureNotifications = (\n persistenceConfig: FeatureNotificationsPersistenceConfig\n) => Promise<PersistedFeaturesDict>;\n\nexport interface FeatureNotificationsPayload<T> {\n id: string;\n suppressFeaturePrompt?: boolean;\n features: Array<Feature<T>>;\n mountItem?: MountContentPart<T>;\n featuresPageLink?: string;\n filterFeatures?: (item: Feature<T>) => boolean;\n persistenceConfig?: FeatureNotificationsPersistenceConfig;\n __persistFeatureNotifications?: PersistFeatureNotifications;\n __retrieveFeatureNotifications?: RetrieveFeatureNotifications;\n}\n\nexport type FeatureNotificationsPayloadPublic<T> = Omit<\n FeatureNotificationsPayload<T>,\n '__persistFeatureNotifications' | '__retrieveFeatureNotifications'\n>;\n\nexport type RegisterDrawerMessage = Message<'registerLeftDrawer' | 'registerBottomDrawer', DrawerPayload>;\nexport type RegisterFeatureNotificationsMessage<T> = Message<\n 'registerFeatureNotifications',\n FeatureNotificationsPayload<T>\n>;\nexport type UpdateDrawerConfigMessage = Message<\n 'updateDrawerConfig',\n Pick<DrawerPayload, 'id'> &\n Partial<Omit<DrawerPayload, 'mountContent' | 'unmountContent' | 'mountHeader' | 'unmountHeader'>>\n>;\nexport type OpenDrawerMessage = Message<'openDrawer', { id: string }>;\nexport type CloseDrawerMessage = Message<'closeDrawer', { id: string }>;\nexport type ResizeDrawerMessage = Message<'resizeDrawer', { id: string; size: number }>;\nexport type ExpandDrawerMessage = Message<'expandDrawer', { id: string }>;\nexport interface ExitExpandedModeMessage {\n type: 'exitExpandedMode';\n}\nexport interface ShowFeaturePromptIfPossible {\n type: 'showFeaturePromptIfPossible';\n}\nexport interface ClearFeatureNotifications {\n type: 'clearFeatureNotifications';\n}\n\nexport type AppLayoutUpdateMessage<T = unknown> =\n | UpdateDrawerConfigMessage\n | OpenDrawerMessage\n | CloseDrawerMessage\n | ResizeDrawerMessage\n | ExpandDrawerMessage\n | ExitExpandedModeMessage\n | RegisterFeatureNotificationsMessage<T>\n | ShowFeaturePromptIfPossible\n | ClearFeatureNotifications;\n\nexport type InitialMessage<T> = RegisterDrawerMessage | RegisterFeatureNotificationsMessage<T>;\n\nexport type WidgetMessage<T = unknown> = InitialMessage<T> | AppLayoutUpdateMessage<T>;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './widget/interfaces';
|
|
2
2
|
export { isAppLayoutReady, whenAppLayoutReady } from './widget/core';
|
|
3
|
-
export { registerLeftDrawer, registerBottomDrawer, updateDrawer } from './widget/index';
|
|
3
|
+
export { registerLeftDrawer, registerBottomDrawer, registerFeatureNotifications, updateDrawer, showFeaturePromptIfPossible, clearFeatureNotifications, } from './widget/index';
|
|
4
4
|
//# sourceMappingURL=widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../../src/internal/plugins/widget.ts"],"names":[],"mappings":"AAEA,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,
|
|
1
|
+
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../../src/internal/plugins/widget.ts"],"names":[],"mappings":"AAEA,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC5B,YAAY,EACZ,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
export * from './widget/interfaces';
|
|
4
4
|
export { isAppLayoutReady, whenAppLayoutReady } from './widget/core';
|
|
5
|
-
export { registerLeftDrawer, registerBottomDrawer, updateDrawer } from './widget/index';
|
|
5
|
+
export { registerLeftDrawer, registerBottomDrawer, registerFeatureNotifications, updateDrawer, showFeaturePromptIfPossible, clearFeatureNotifications, } from './widget/index';
|
|
6
6
|
//# sourceMappingURL=widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../../src/internal/plugins/widget.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,
|
|
1
|
+
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../../src/internal/plugins/widget.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC5B,YAAY,EACZ,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport * from './widget/interfaces';\nexport { isAppLayoutReady, whenAppLayoutReady } from './widget/core';\nexport {\n registerLeftDrawer,\n registerBottomDrawer,\n registerFeatureNotifications,\n updateDrawer,\n showFeaturePromptIfPossible,\n clearFeatureNotifications,\n} from './widget/index';\n"]}
|
|
@@ -11,4 +11,15 @@ export declare function makeCancellable<T>(promise: Promise<T>): {
|
|
|
11
11
|
cancel: () => void;
|
|
12
12
|
isCancelled: () => boolean;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Returns a ref callback and promise that resolves when the ref is attached to a mounted element.
|
|
16
|
+
* Useful for coordinating async operations that depend on DOM element availability, such as
|
|
17
|
+
* setting focus or measuring dimensions after mount.
|
|
18
|
+
*
|
|
19
|
+
* @returns An object containing a ref callback and a promise that resolves with the mounted element
|
|
20
|
+
*/
|
|
21
|
+
export declare function useMountRefPromise<T extends HTMLElement>(): {
|
|
22
|
+
ref: (element: any) => void;
|
|
23
|
+
promise: Promise<T>;
|
|
24
|
+
};
|
|
14
25
|
//# sourceMappingURL=promises.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promises.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/promises.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"promises.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/promises.ts"],"names":[],"mappings":"AAIA,qBAAa,sBAAsB;CAAG;AAEtC;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG;IACvD,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,WAAW,EAAE,MAAM,OAAO,CAAC;CAC5B,CAwBA;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,WAAW;;;EAqBvD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { useCallback, useRef } from 'react';
|
|
3
4
|
export class PromiseCancelledSignal {
|
|
4
5
|
}
|
|
5
6
|
/**
|
|
@@ -29,4 +30,27 @@ export function makeCancellable(promise) {
|
|
|
29
30
|
isCancelled: () => cancelled,
|
|
30
31
|
};
|
|
31
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Returns a ref callback and promise that resolves when the ref is attached to a mounted element.
|
|
35
|
+
* Useful for coordinating async operations that depend on DOM element availability, such as
|
|
36
|
+
* setting focus or measuring dimensions after mount.
|
|
37
|
+
*
|
|
38
|
+
* @returns An object containing a ref callback and a promise that resolves with the mounted element
|
|
39
|
+
*/
|
|
40
|
+
export function useMountRefPromise() {
|
|
41
|
+
const promiseRef = useRef();
|
|
42
|
+
if (!promiseRef.current) {
|
|
43
|
+
let resolve;
|
|
44
|
+
const promise = new Promise(res => {
|
|
45
|
+
resolve = res;
|
|
46
|
+
});
|
|
47
|
+
promiseRef.current = { promise, resolve: resolve };
|
|
48
|
+
}
|
|
49
|
+
const ref = useCallback(element => {
|
|
50
|
+
if (element) {
|
|
51
|
+
promiseRef.current.resolve(element);
|
|
52
|
+
}
|
|
53
|
+
}, []);
|
|
54
|
+
return { ref, promise: promiseRef.current.promise };
|
|
55
|
+
}
|
|
32
56
|
//# sourceMappingURL=promises.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promises.js","sourceRoot":"","sources":["../../../../src/internal/utils/promises.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,MAAM,OAAO,sBAAsB;CAAG;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAI,OAAmB;IAKpD,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAC1B,KAAK,CAAC,EAAE;QACN,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,IAAI,sBAAsB,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,EACD,GAAG,CAAC,EAAE;QACJ,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,IAAI,sBAAsB,EAAE,CAAC;QACrC,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC,CACF,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,GAAG,EAAE;YACX,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport class PromiseCancelledSignal {}\n\n/**\n * Wrap and provide a handle for a promise to provide cancellation information inside\n * callbacks. Takes a similar approach to how an AbortController works in modern fetch.\n *\n * @see https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html\n */\nexport function makeCancellable<T>(promise: Promise<T>): {\n promise: Promise<T>;\n cancel: () => void;\n isCancelled: () => boolean;\n} {\n let cancelled = false;\n const wrapped = promise.then(\n value => {\n if (cancelled) {\n throw new PromiseCancelledSignal();\n }\n return value;\n },\n err => {\n if (cancelled) {\n throw new PromiseCancelledSignal();\n }\n throw err;\n }\n );\n\n return {\n promise: wrapped,\n cancel: () => {\n cancelled = true;\n },\n isCancelled: () => cancelled,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"promises.js","sourceRoot":"","sources":["../../../../src/internal/utils/promises.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,OAAO,sBAAsB;CAAG;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAI,OAAmB;IAKpD,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAC1B,KAAK,CAAC,EAAE;QACN,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,IAAI,sBAAsB,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,EACD,GAAG,CAAC,EAAE;QACJ,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,IAAI,sBAAsB,EAAE,CAAC;QACrC,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC,CACF,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,GAAG,EAAE;YACX,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS;KAC7B,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,UAAU,GAAG,MAAM,EAGrB,CAAC;IAEL,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,OAA6B,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,GAAG,CAAC,EAAE;YACnC,OAAO,GAAG,GAAG,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,UAAU,CAAC,OAAO,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,OAAQ,EAAE,CAAC;IACtD,CAAC;IAED,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,EAAE;QAChC,IAAI,OAAO,EAAE,CAAC;YACZ,UAAU,CAAC,OAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;AACtD,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback, useRef } from 'react';\n\nexport class PromiseCancelledSignal {}\n\n/**\n * Wrap and provide a handle for a promise to provide cancellation information inside\n * callbacks. Takes a similar approach to how an AbortController works in modern fetch.\n *\n * @see https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html\n */\nexport function makeCancellable<T>(promise: Promise<T>): {\n promise: Promise<T>;\n cancel: () => void;\n isCancelled: () => boolean;\n} {\n let cancelled = false;\n const wrapped = promise.then(\n value => {\n if (cancelled) {\n throw new PromiseCancelledSignal();\n }\n return value;\n },\n err => {\n if (cancelled) {\n throw new PromiseCancelledSignal();\n }\n throw err;\n }\n );\n\n return {\n promise: wrapped,\n cancel: () => {\n cancelled = true;\n },\n isCancelled: () => cancelled,\n };\n}\n\n/**\n * Returns a ref callback and promise that resolves when the ref is attached to a mounted element.\n * Useful for coordinating async operations that depend on DOM element availability, such as\n * setting focus or measuring dimensions after mount.\n *\n * @returns An object containing a ref callback and a promise that resolves with the mounted element\n */\nexport function useMountRefPromise<T extends HTMLElement>() {\n const promiseRef = useRef<{\n promise: Promise<T>;\n resolve: (element: T) => void;\n }>();\n\n if (!promiseRef.current) {\n let resolve: (element: T) => void;\n const promise = new Promise<T>(res => {\n resolve = res;\n });\n promiseRef.current = { promise, resolve: resolve! };\n }\n\n const ref = useCallback(element => {\n if (element) {\n promiseRef.current!.resolve(element);\n }\n }, []);\n\n return { ref, promise: promiseRef.current.promise };\n}\n"]}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"./contexts/form-field": "./contexts/form-field.js",
|
|
15
15
|
"./internal/plugins": "./internal/plugins/index.js",
|
|
16
16
|
"./internal/plugins/widget": "./internal/plugins/widget.js",
|
|
17
|
+
"./plugins": "./plugins/index.js",
|
|
17
18
|
"./internal/tooltip-do-not-use": "./internal/tooltip-do-not-use/index.js",
|
|
18
19
|
"./internal/do-not-use/chart-filter": "./internal/do-not-use/chart-filter.js",
|
|
19
20
|
"./internal/do-not-use/chart-tooltip": "./internal/do-not-use/chart-tooltip.js",
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
"./internal/do-not-use/i18n": "./internal/do-not-use/i18n.js",
|
|
22
23
|
"./internal/do-not-use/tooltip": "./internal/do-not-use/tooltip.js",
|
|
23
24
|
"./internal/do-not-use/drag-handle": "./internal/do-not-use/drag-handle.js",
|
|
25
|
+
"./internal/do-not-use/feature-prompt": "./internal/do-not-use/feature-prompt/index.js",
|
|
24
26
|
"./internal/widget-exports": "./internal/widget-exports.js",
|
|
25
27
|
"./test-utils/dom/internal/drag-handle": "./test-utils/dom/internal/drag-handle.js",
|
|
26
28
|
"./test-utils/selectors/internal/drag-handle": "./test-utils/selectors/internal/drag-handle.js",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from '../internal/plugins/widget/interfaces';
|
|
2
|
+
import { clearFeatureNotifications, registerFeatureNotificationsPublic, showFeaturePromptIfPossible } from '../internal/plugins/widget/index';
|
|
3
|
+
export declare const featureNotifications: {
|
|
4
|
+
registerFeatureNotifications: typeof registerFeatureNotificationsPublic;
|
|
5
|
+
showFeaturePromptIfPossible: typeof showFeaturePromptIfPossible;
|
|
6
|
+
clearFeatureNotifications: typeof clearFeatureNotifications;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/index.ts"],"names":[],"mappings":"AAGA,cAAc,uCAAuC,CAAC;AACtD,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAClC,2BAA2B,EAC5B,MAAM,kCAAkC,CAAC;AAE1C,eAAO,MAAM,oBAAoB;;;;CAIhC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
'use client';
|
|
4
|
+
export * from '../internal/plugins/widget/interfaces';
|
|
5
|
+
import { clearFeatureNotifications, registerFeatureNotificationsPublic, showFeaturePromptIfPossible, } from '../internal/plugins/widget/index';
|
|
6
|
+
export const featureNotifications = {
|
|
7
|
+
registerFeatureNotifications: registerFeatureNotificationsPublic,
|
|
8
|
+
showFeaturePromptIfPossible,
|
|
9
|
+
clearFeatureNotifications,
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,cAAc,uCAAuC,CAAC;AACtD,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAClC,2BAA2B,GAC5B,MAAM,kCAAkC,CAAC;AAE1C,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,4BAA4B,EAAE,kCAAkC;IAChE,2BAA2B;IAC3B,yBAAyB;CAC1B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nexport * from '../internal/plugins/widget/interfaces';\nimport {\n clearFeatureNotifications,\n registerFeatureNotificationsPublic,\n showFeaturePromptIfPossible,\n} from '../internal/plugins/widget/index';\n\nexport const featureNotifications = {\n registerFeatureNotifications: registerFeatureNotificationsPublic,\n showFeaturePromptIfPossible,\n clearFeatureNotifications,\n};\n"]}
|
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
export interface PopoverBodyProps {
|
|
3
3
|
dismissButton: boolean;
|
|
4
4
|
dismissAriaLabel: string | undefined;
|
|
5
|
-
onDismiss: (() => void) | undefined;
|
|
5
|
+
onDismiss: ((method?: 'escape' | 'close-button') => void) | undefined;
|
|
6
6
|
onBlur?: (event: React.FocusEvent) => void;
|
|
7
7
|
header: React.ReactNode | undefined;
|
|
8
8
|
children: React.ReactNode;
|
|
9
|
-
variant?: 'annotation' | 'chart';
|
|
9
|
+
variant?: 'annotation' | 'chart' | 'feature-prompt';
|
|
10
10
|
overflowVisible?: 'content' | 'both';
|
|
11
11
|
className?: string;
|
|
12
12
|
ariaLabelledby?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAe9D,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAe9D,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,cAAc,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACtE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAE3C,MAAM,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,GAAG,gBAAgB,CAAC;IACpD,eAAe,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAErC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,QAAA,MAAM,WAAW,yFAoGhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -18,7 +18,7 @@ const PopoverBody = React.forwardRef(({ dismissButton: showDismissButton, dismis
|
|
|
18
18
|
const onKeyDown = useCallback((event) => {
|
|
19
19
|
if (event.keyCode === KeyCode.escape) {
|
|
20
20
|
event.stopPropagation();
|
|
21
|
-
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
21
|
+
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss('escape');
|
|
22
22
|
}
|
|
23
23
|
}, [onDismiss]);
|
|
24
24
|
// Implement our own auto-focus rather than using FocusLock's,
|
|
@@ -32,7 +32,7 @@ const PopoverBody = React.forwardRef(({ dismissButton: showDismissButton, dismis
|
|
|
32
32
|
dismissButtonFocused.current = showDismissButton;
|
|
33
33
|
}, [showDismissButton]);
|
|
34
34
|
const dismissButton = (showDismissButton !== null && showDismissButton !== void 0 ? showDismissButton : null) && (React.createElement("div", { className: styles.dismiss, ...(closeAnalyticsAction ? getAnalyticsMetadataAttribute({ action: closeAnalyticsAction }) : {}) },
|
|
35
|
-
React.createElement(InternalButton, { variant: "icon", formAction: "none", iconName: "close", className: styles['dismiss-control'], ariaLabel: i18n('dismissAriaLabel', dismissAriaLabel), onClick: () => onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss(), ref: dismissButtonRef })));
|
|
35
|
+
React.createElement(InternalButton, { variant: "icon", formAction: "none", iconName: "close", className: styles['dismiss-control'], ariaLabel: i18n('dismissAriaLabel', dismissAriaLabel), onClick: () => onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss('close-button'), ref: dismissButtonRef })));
|
|
36
36
|
const isDialog = showDismissButton;
|
|
37
37
|
const shouldTrapFocus = showDismissButton && variant !== 'annotation';
|
|
38
38
|
const dialogProps = isDialog
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAGjH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,SAAS,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAmBrC,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,EACE,aAAa,EAAE,iBAAiB,EAChC,gBAAgB,EAChB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,eAAe,EACf,SAAS,EACT,cAAc,EACd,oBAAoB,GACH,EACnB,GAA8B,EAC9B,EAAE;IACF,MAAM,IAAI,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,YAAY,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACnD,MAAM,oBAAoB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3C,MAAM,gBAAgB,GAAG,MAAM,CA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,EAAE,EAAE,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC,IAC9F,QAAQ,CACL,CACF,CACI,CACS,CACnB,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport { BuiltInErrorBoundary } from '../error-boundary/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport FocusLock from '../internal/components/focus-lock';\nimport { KeyCode } from '../internal/keycode';\n\nimport styles from './styles.css.js';\n\nexport interface PopoverBodyProps {\n dismissButton: boolean;\n dismissAriaLabel: string | undefined;\n onDismiss: ((method?: 'escape' | 'close-button') => void) | undefined;\n onBlur?: (event: React.FocusEvent) => void;\n\n header: React.ReactNode | undefined;\n children: React.ReactNode;\n variant?: 'annotation' | 'chart' | 'feature-prompt';\n overflowVisible?: 'content' | 'both';\n\n className?: string;\n ariaLabelledby?: string;\n\n closeAnalyticsAction?: string;\n}\n\nconst PopoverBody = React.forwardRef(\n (\n {\n dismissButton: showDismissButton,\n dismissAriaLabel,\n header,\n children,\n onDismiss,\n onBlur,\n variant,\n overflowVisible,\n className,\n ariaLabelledby,\n closeAnalyticsAction,\n }: PopoverBodyProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const i18n = useInternalI18n('popover');\n const labelledById = useUniqueId('awsui-popover-');\n const dismissButtonFocused = useRef(false);\n const dismissButtonRef = useRef<ButtonProps.Ref>(null);\n\n const onKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n event.stopPropagation();\n onDismiss?.('escape');\n }\n },\n [onDismiss]\n );\n\n // Implement our own auto-focus rather than using FocusLock's,\n // because we also want to focus the dismiss button when it\n // is added dynamically (e.g. in chart popovers)\n useEffect(() => {\n if (showDismissButton && !dismissButtonFocused.current) {\n dismissButtonRef.current?.focus({ preventScroll: true });\n }\n dismissButtonFocused.current = showDismissButton;\n }, [showDismissButton]);\n\n const dismissButton = (showDismissButton ?? null) && (\n <div\n className={styles.dismiss}\n {...(closeAnalyticsAction ? getAnalyticsMetadataAttribute({ action: closeAnalyticsAction }) : {})}\n >\n <InternalButton\n variant=\"icon\"\n formAction=\"none\"\n iconName=\"close\"\n className={styles['dismiss-control']}\n ariaLabel={i18n('dismissAriaLabel', dismissAriaLabel)}\n onClick={() => onDismiss?.('close-button')}\n ref={dismissButtonRef}\n />\n </div>\n );\n\n const isDialog = showDismissButton;\n const shouldTrapFocus = showDismissButton && variant !== 'annotation';\n\n const dialogProps = isDialog\n ? {\n role: 'dialog',\n 'aria-labelledby': ariaLabelledby ?? (header ? labelledById : undefined),\n }\n : {};\n\n return (\n <div\n className={clsx(styles.body, styles[`body-variant-${variant}`], className, {\n [styles['body-overflow-visible']]: overflowVisible === 'both',\n })}\n onKeyDown={onKeyDown}\n ref={ref}\n onBlur={onBlur}\n {...dialogProps}\n >\n <BuiltInErrorBoundary>\n <FocusLock disabled={!shouldTrapFocus} autoFocus={false}>\n {header && (\n <div className={clsx(styles['header-row'], showDismissButton && styles['has-dismiss'])}>\n {dismissButton}\n <div className={styles.header} id={labelledById}>\n <h2>{header}</h2>\n </div>\n </div>\n )}\n <div className={!header && showDismissButton ? styles['has-dismiss'] : undefined}>\n {!header && dismissButton}\n <div className={clsx(styles.content, { [styles['content-overflow-visible']]: !!overflowVisible })}>\n {children}\n </div>\n </div>\n </FocusLock>\n </BuiltInErrorBoundary>\n </div>\n );\n }\n);\n\nexport default PopoverBody;\n"]}
|
|
@@ -5,6 +5,6 @@ export interface FilterProps extends InternalInputProps {
|
|
|
5
5
|
ref?: React.Ref<HTMLInputElement>;
|
|
6
6
|
filteringType: SelectProps.FilteringType;
|
|
7
7
|
}
|
|
8
|
-
declare const Filter: React.ForwardRefExoticComponent<Pick<FilterProps, "style" | "disabled" | "className" | "id" | "name" | "type" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "placeholder" | "inputMode" | "autoFocus" | "value" | "autoComplete" | "readOnly" | "step" | "invalid" | "warning" | "ariaLabel" | "ariaLabelledby" | "ariaDescribedby" | "clearAriaLabel" | "__internalRootRef" | "__injectAnalyticsComponentMetadata" | "__skipNativeAttributesWarnings" | "controlId" | "ariaRequired" | "
|
|
8
|
+
declare const Filter: React.ForwardRefExoticComponent<Pick<FilterProps, "style" | "disabled" | "className" | "id" | "name" | "type" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "placeholder" | "inputMode" | "autoFocus" | "value" | "autoComplete" | "readOnly" | "step" | "invalid" | "warning" | "ariaLabel" | "ariaLabelledby" | "ariaDescribedby" | "clearAriaLabel" | "__internalRootRef" | "__injectAnalyticsComponentMetadata" | "__skipNativeAttributesWarnings" | "controlId" | "ariaRequired" | "nativeInputAttributes" | "disableBrowserAutocorrect" | "spellcheck" | "filteringType" | "__leftIcon" | "__leftIconVariant" | "__onLeftIconClick" | "__rightIcon" | "__onRightIconClick" | "__noBorderRadius" | "__onDelayedInput" | "__onBlurWithDetail" | "__inheritFormFieldProps"> & React.RefAttributes<HTMLInputElement>>;
|
|
9
9
|
export default Filter;
|
|
10
10
|
//# sourceMappingURL=filter.d.ts.map
|