@cloudscape-design/components-themeable 3.0.1102 → 3.0.1103

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.
Files changed (104) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/app-layout/visual-refresh-toolbar/drawer/styles.scss +10 -1
  3. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  4. package/lib/internal/template/app-layout/utils/use-ai-drawer.d.ts +0 -1
  5. package/lib/internal/template/app-layout/utils/use-ai-drawer.d.ts.map +1 -1
  6. package/lib/internal/template/app-layout/utils/use-ai-drawer.js +1 -1
  7. package/lib/internal/template/app-layout/utils/use-ai-drawer.js.map +1 -1
  8. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js +2 -2
  9. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js.map +1 -1
  10. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawers.d.ts +0 -1
  11. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawers.d.ts.map +1 -1
  12. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawers.js +0 -2
  13. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawers.js.map +1 -1
  14. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/index.d.ts +2 -2
  15. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/index.d.ts.map +1 -1
  16. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/index.js +2 -2
  17. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/index.js.map +1 -1
  18. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts +0 -1
  19. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
  20. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +0 -2
  21. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
  22. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +25 -24
  23. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +74 -66
  24. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +25 -24
  25. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.d.ts +0 -7
  26. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.d.ts.map +1 -1
  27. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.js +0 -14
  28. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.js.map +1 -1
  29. package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/index.d.ts +0 -1
  30. package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/index.d.ts.map +1 -1
  31. package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/index.js +0 -3
  32. package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/index.js.map +1 -1
  33. package/lib/internal/template/app-layout/visual-refresh-toolbar/notifications/index.d.ts +0 -1
  34. package/lib/internal/template/app-layout/visual-refresh-toolbar/notifications/index.d.ts.map +1 -1
  35. package/lib/internal/template/app-layout/visual-refresh-toolbar/notifications/index.js +0 -3
  36. package/lib/internal/template/app-layout/visual-refresh-toolbar/notifications/index.js.map +1 -1
  37. package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/index.d.ts +0 -2
  38. package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/index.d.ts.map +1 -1
  39. package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/index.js +0 -3
  40. package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/index.js.map +1 -1
  41. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts +0 -1
  42. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
  43. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js +0 -3
  44. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
  45. package/lib/internal/template/date-range-picker/calendar/index.d.ts +4 -18
  46. package/lib/internal/template/date-range-picker/calendar/index.d.ts.map +1 -1
  47. package/lib/internal/template/date-range-picker/calendar/index.js +2 -2
  48. package/lib/internal/template/date-range-picker/calendar/index.js.map +1 -1
  49. package/lib/internal/template/date-range-picker/calendar/interfaces.d.ts +22 -0
  50. package/lib/internal/template/date-range-picker/calendar/interfaces.d.ts.map +1 -0
  51. package/lib/internal/template/date-range-picker/calendar/interfaces.js +2 -0
  52. package/lib/internal/template/date-range-picker/calendar/interfaces.js.map +1 -0
  53. package/lib/internal/template/date-range-picker/calendar/range-inputs.d.ts +2 -20
  54. package/lib/internal/template/date-range-picker/calendar/range-inputs.d.ts.map +1 -1
  55. package/lib/internal/template/date-range-picker/calendar/range-inputs.js +11 -13
  56. package/lib/internal/template/date-range-picker/calendar/range-inputs.js.map +1 -1
  57. package/lib/internal/template/date-range-picker/calendar/utils.d.ts +4 -0
  58. package/lib/internal/template/date-range-picker/calendar/utils.d.ts.map +1 -1
  59. package/lib/internal/template/date-range-picker/calendar/utils.js +40 -0
  60. package/lib/internal/template/date-range-picker/calendar/utils.js.map +1 -1
  61. package/lib/internal/template/date-range-picker/dropdown.d.ts +3 -2
  62. package/lib/internal/template/date-range-picker/dropdown.d.ts.map +1 -1
  63. package/lib/internal/template/date-range-picker/dropdown.js +2 -2
  64. package/lib/internal/template/date-range-picker/dropdown.js.map +1 -1
  65. package/lib/internal/template/date-range-picker/index.d.ts.map +1 -1
  66. package/lib/internal/template/date-range-picker/index.js +3 -2
  67. package/lib/internal/template/date-range-picker/index.js.map +1 -1
  68. package/lib/internal/template/date-range-picker/interfaces.d.ts +53 -11
  69. package/lib/internal/template/date-range-picker/interfaces.d.ts.map +1 -1
  70. package/lib/internal/template/date-range-picker/interfaces.js.map +1 -1
  71. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  72. package/lib/internal/template/internal/environment.js +2 -2
  73. package/lib/internal/template/internal/environment.json +2 -2
  74. package/lib/internal/template/internal/plugins/widget/internal.d.ts +4 -0
  75. package/lib/internal/template/internal/plugins/widget/internal.d.ts.map +1 -1
  76. package/lib/internal/template/internal/plugins/widget/internal.js +16 -0
  77. package/lib/internal/template/internal/plugins/widget/internal.js.map +1 -1
  78. package/lib/internal/template/internal/plugins/widget.d.ts +1 -1
  79. package/lib/internal/template/internal/plugins/widget.d.ts.map +1 -1
  80. package/lib/internal/template/internal/plugins/widget.js +1 -1
  81. package/lib/internal/template/internal/plugins/widget.js.map +1 -1
  82. package/lib/internal/template/internal/utils/date-time/format-date-time-with-offset.d.ts.map +1 -1
  83. package/lib/internal/template/internal/utils/date-time/format-date-time-with-offset.js +4 -0
  84. package/lib/internal/template/internal/utils/date-time/format-date-time-with-offset.js.map +1 -1
  85. package/lib/internal/template/mixed-line-bar-chart/bar-groups.d.ts.map +1 -1
  86. package/lib/internal/template/mixed-line-bar-chart/bar-groups.js +4 -1
  87. package/lib/internal/template/mixed-line-bar-chart/bar-groups.js.map +1 -1
  88. package/lib/internal/template/status-indicator/index.d.ts +1 -1
  89. package/lib/internal/template/status-indicator/index.d.ts.map +1 -1
  90. package/lib/internal/template/status-indicator/index.js.map +1 -1
  91. package/lib/internal/template/status-indicator/interfaces.d.ts +46 -0
  92. package/lib/internal/template/status-indicator/interfaces.d.ts.map +1 -0
  93. package/lib/internal/template/status-indicator/interfaces.js +2 -0
  94. package/lib/internal/template/status-indicator/interfaces.js.map +1 -0
  95. package/lib/internal/template/status-indicator/internal.d.ts +3 -31
  96. package/lib/internal/template/status-indicator/internal.d.ts.map +1 -1
  97. package/lib/internal/template/status-indicator/internal.js +6 -2
  98. package/lib/internal/template/status-indicator/internal.js.map +1 -1
  99. package/lib/internal/template/steps/interfaces.d.ts +1 -1
  100. package/lib/internal/template/steps/interfaces.d.ts.map +1 -1
  101. package/lib/internal/template/steps/interfaces.js.map +1 -1
  102. package/lib/internal/template/table/internal.js +2 -2
  103. package/lib/internal/template/table/internal.js.map +1 -1
  104. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "ac7819675dffc9c3de4bf0b791f8c1ae2ef3f340"
2
+ "commit": "a463d12ad683b181343235ae03fac117ddad0fa3"
3
3
  }
@@ -23,6 +23,7 @@
23
23
  $global-drawer-gap-size: 8px;
24
24
  $global-drawer-expanded-mode-motion: #{awsui.$motion-duration-refresh-only-slow} #{awsui.$motion-easing-refresh-only-a};
25
25
  $drawer-resize-handle-size: awsui.$space-m;
26
+ $ai-drawer-heider-height: 41px;
26
27
 
27
28
  .drawer {
28
29
  position: sticky;
@@ -284,8 +285,10 @@ $drawer-resize-handle-size: awsui.$space-m;
284
285
  }
285
286
 
286
287
  > .drawer-content {
288
+ grid-row: 1 / span 4;
289
+
287
290
  > .drawer-content-header {
288
- block-size: 41px;
291
+ block-size: $ai-drawer-heider-height;
289
292
  position: sticky;
290
293
  z-index: 1000;
291
294
  display: flex;
@@ -380,6 +383,12 @@ $drawer-resize-handle-size: awsui.$space-m;
380
383
  }
381
384
  }
382
385
  }
386
+
387
+ > .drawer-content-content {
388
+ display: flex;
389
+ flex-direction: column;
390
+ block-size: calc(100% - #{$ai-drawer-heider-height});
391
+ }
383
392
  }
384
393
  }
385
394
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Build environment
3
- $awsui-commit-hash: "ac781967";
3
+ $awsui-commit-hash: "a463d12a";
4
4
  // Manually managed CSS-variables
5
5
  $maxContentWidth: --awsui-max-content-width-y15yd5;
6
6
  $minContentWidth: --awsui-min-content-width-y15yd5;
@@ -1,7 +1,6 @@
1
1
  export interface OnChangeParams {
2
2
  initiatedByUserAction: boolean;
3
3
  }
4
- export declare const MIN_DRAWER_SIZE = 290;
5
4
  interface UseDrawersProps {
6
5
  isEnabled: boolean;
7
6
  onAiDrawerFocus: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"use-ai-drawer.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-ai-drawer.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,cAAc;IAC7B,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAsED,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,UAAU,eAAe;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACrD;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,EAAE,eAAe;;;;;;0CAUjG,MAAM,GAAG,IAAI,8BACC,cAAc;;;;;;;;;mCAPL,MAAM;EAwC7C"}
1
+ {"version":3,"file":"use-ai-drawer.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-ai-drawer.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,cAAc;IAC7B,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAwED,UAAU,eAAe;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACrD;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,EAAE,eAAe;;;;;;0CAUjG,MAAM,GAAG,IAAI,8BACC,cAAc;;;;;;;;;mCAPL,MAAM;EAwC7C"}
@@ -65,7 +65,7 @@ function useRuntimeAiDrawer(isEnabled, activeAiDrawerId, onActiveAiDrawerChange,
65
65
  }, [isEnabled, appLayoutMessageHandler, onAiDrawersChangeStable, onActiveAiDrawerResizeStable]);
66
66
  return aiDrawer && mapRuntimeConfigToAiDrawer(aiDrawer);
67
67
  }
68
- export const MIN_DRAWER_SIZE = 290;
68
+ const MIN_DRAWER_SIZE = 400;
69
69
  export function useAiDrawer({ isEnabled, onAiDrawerFocus, expandedDrawerId, setExpandedDrawerId }) {
70
70
  var _a, _b;
71
71
  const [activeAiDrawerId, setActiveAiDrawerId] = useState(null);
@@ -1 +1 @@
1
- {"version":3,"file":"use-ai-drawer.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-ai-drawer.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAC5G,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAM/D,MAAM,wBAAwB,GAAG,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC;AAEjE,SAAS,kBAAkB,CACzB,SAAkB,EAClB,gBAA+B,EAC/B,sBAAuG,EACvG,sBAA8C;IAE9C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAA+B,IAAI,CAAC,CAAC;IAC7E,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,CAAC,KAAuB,EAAE,EAAE;QAC5E,IAAI,KAAK,CAAC,IAAI,KAAK,oBAAoB,EAAE;YACvC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC3B,IAAI,CAAC,kBAAkB,CAAC,OAAO,IAAI,KAAK,CAA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AAC,MAAA,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,WAAW,mCAAI,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3G,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,WAAW,mCAAI,eAAe,EAAE,eAAe,CAAC,CAAC;IAElG,OAAO;QACL,QAAQ;QACR,sBAAsB;QACtB,cAAc;QACd,gBAAgB;QAChB,kBAAkB;QAClB,eAAe;QACf,sBAAsB;KACvB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect, useRef, useState } from 'react';\n\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { metrics } from '../../internal/metrics';\nimport { AppLayoutMessage, DrawerPayload as RuntimeAiDrawerConfig } from '../../internal/plugins/widget/interfaces';\nimport { getAppLayoutInitialState, registerAppLayoutHandler } from '../../internal/plugins/widget/internal';\nimport { assertNever } from '../../internal/types';\nimport { mapRuntimeConfigToAiDrawer } from '../runtime-drawer';\n\nexport interface OnChangeParams {\n initiatedByUserAction: boolean;\n}\n\nconst DEFAULT_ON_CHANGE_PARAMS = { initiatedByUserAction: true };\n\nfunction useRuntimeAiDrawer(\n isEnabled: boolean,\n activeAiDrawerId: string | null,\n onActiveAiDrawerChange: (newDrawerId: string | null, { initiatedByUserAction }: OnChangeParams) => void,\n onActiveAiDrawerResize: (size: number) => void\n) {\n const [aiDrawer, setAiDrawer] = useState<RuntimeAiDrawerConfig | null>(null);\n const appLayoutMessageHandler = useStableCallback((event: AppLayoutMessage) => {\n if (event.type === 'registerLeftDrawer') {\n setAiDrawer(event.payload);\n if (!aiDrawerWasOpenRef.current && event.payload.defaultActive) {\n onAiDrawersChangeStable(event.payload.id, { initiatedByUserAction: false });\n }\n return;\n }\n if (aiDrawer && aiDrawer.id !== event.payload.id) {\n metrics.sendOpsMetricObject('awsui-widget-drawer-incorrect-id', { oldId: aiDrawer?.id, newId: event.payload.id });\n return;\n }\n switch (event.type) {\n case 'updateDrawerConfig':\n setAiDrawer(current => (current ? { ...current, ...event.payload } : current));\n break;\n case 'openDrawer':\n onActiveAiDrawerChangeStable(event.payload.id, { initiatedByUserAction: false });\n break;\n case 'closeDrawer':\n onActiveAiDrawerChangeStable(null, { initiatedByUserAction: false });\n break;\n case 'resizeDrawer':\n onActiveAiDrawerResizeStable(event.payload.size);\n break;\n /* istanbul ignore next: this code is not intended to be visited */\n default:\n assertNever(event);\n }\n });\n const onAiDrawersChangeStable = useStableCallback(onActiveAiDrawerChange);\n const onActiveAiDrawerResizeStable = useStableCallback(onActiveAiDrawerResize);\n const onActiveAiDrawerChangeStable = useStableCallback(onActiveAiDrawerChange);\n const aiDrawerWasOpenRef = useRef(false);\n aiDrawerWasOpenRef.current = aiDrawerWasOpenRef.current || !!activeAiDrawerId;\n\n useEffect(() => {\n if (!isEnabled) {\n return;\n }\n\n const initialDrawerMessage = getAppLayoutInitialState()?.find(message => message.type === 'registerLeftDrawer');\n if (initialDrawerMessage && initialDrawerMessage.type === 'registerLeftDrawer') {\n setAiDrawer(initialDrawerMessage.payload);\n if (!aiDrawerWasOpenRef.current && initialDrawerMessage.payload.defaultActive) {\n onAiDrawersChangeStable(initialDrawerMessage.payload.id, { initiatedByUserAction: false });\n }\n }\n\n const unsubscribe = registerAppLayoutHandler(appLayoutMessageHandler);\n return () => {\n unsubscribe();\n setAiDrawer(null);\n };\n }, [isEnabled, appLayoutMessageHandler, onAiDrawersChangeStable, onActiveAiDrawerResizeStable]);\n\n return aiDrawer && mapRuntimeConfigToAiDrawer(aiDrawer);\n}\n\nexport const MIN_DRAWER_SIZE = 290;\n\ninterface UseDrawersProps {\n isEnabled: boolean;\n onAiDrawerFocus: () => void;\n expandedDrawerId: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n}\n\nexport function useAiDrawer({ isEnabled, onAiDrawerFocus, expandedDrawerId, setExpandedDrawerId }: UseDrawersProps) {\n const [activeAiDrawerId, setActiveAiDrawerId] = useState<string | null>(null);\n const [size, setSize] = useState<number | null>(null);\n\n function onActiveAiDrawerResize(size: number) {\n setSize(size);\n fireNonCancelableEvent(activeAiDrawer?.onResize, { id: activeAiDrawerId, size });\n }\n\n function onActiveAiDrawerChange(\n newDrawerId: string | null,\n { initiatedByUserAction }: OnChangeParams = DEFAULT_ON_CHANGE_PARAMS\n ) {\n setActiveAiDrawerId(newDrawerId);\n\n if (newDrawerId) {\n fireNonCancelableEvent(aiDrawer?.onToggle, { isOpen: true, initiatedByUserAction });\n }\n\n if (activeAiDrawerId) {\n fireNonCancelableEvent(aiDrawer?.onToggle, { isOpen: false, initiatedByUserAction });\n\n if (activeAiDrawerId === expandedDrawerId) {\n setExpandedDrawerId?.(null);\n }\n }\n\n onAiDrawerFocus?.();\n }\n\n const aiDrawer = useRuntimeAiDrawer(isEnabled, activeAiDrawerId, onActiveAiDrawerChange, onActiveAiDrawerResize);\n const activeAiDrawer = activeAiDrawerId && activeAiDrawerId === aiDrawer?.id ? aiDrawer : null;\n const activeAiDrawerSize = activeAiDrawerId ? (size ?? activeAiDrawer?.defaultSize ?? MIN_DRAWER_SIZE) : 0;\n const minAiDrawerSize = Math.min(activeAiDrawer?.defaultSize ?? MIN_DRAWER_SIZE, MIN_DRAWER_SIZE);\n\n return {\n aiDrawer,\n onActiveAiDrawerChange,\n activeAiDrawer,\n activeAiDrawerId,\n activeAiDrawerSize,\n minAiDrawerSize,\n onActiveAiDrawerResize,\n };\n}\n"]}
1
+ {"version":3,"file":"use-ai-drawer.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-ai-drawer.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EA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liates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect, useRef, useState } from 'react';\n\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { metrics } from '../../internal/metrics';\nimport { AppLayoutMessage, DrawerPayload as RuntimeAiDrawerConfig } from '../../internal/plugins/widget/interfaces';\nimport { getAppLayoutInitialState, registerAppLayoutHandler } from '../../internal/plugins/widget/internal';\nimport { assertNever } from '../../internal/types';\nimport { mapRuntimeConfigToAiDrawer } from '../runtime-drawer';\n\nexport interface OnChangeParams {\n initiatedByUserAction: boolean;\n}\n\nconst DEFAULT_ON_CHANGE_PARAMS = { initiatedByUserAction: true };\n\nfunction useRuntimeAiDrawer(\n isEnabled: boolean,\n activeAiDrawerId: string | null,\n onActiveAiDrawerChange: (newDrawerId: string | null, { initiatedByUserAction }: OnChangeParams) => void,\n onActiveAiDrawerResize: (size: number) => void\n) {\n const [aiDrawer, setAiDrawer] = useState<RuntimeAiDrawerConfig | null>(null);\n const appLayoutMessageHandler = useStableCallback((event: AppLayoutMessage) => {\n if (event.type === 'registerLeftDrawer') {\n setAiDrawer(event.payload);\n if (!aiDrawerWasOpenRef.current && event.payload.defaultActive) {\n onAiDrawersChangeStable(event.payload.id, { initiatedByUserAction: false });\n }\n return;\n }\n if (aiDrawer && aiDrawer.id !== event.payload.id) {\n metrics.sendOpsMetricObject('awsui-widget-drawer-incorrect-id', { oldId: aiDrawer?.id, newId: event.payload.id });\n return;\n }\n switch (event.type) {\n case 'updateDrawerConfig':\n setAiDrawer(current => (current ? { ...current, ...event.payload } : current));\n break;\n case 'openDrawer':\n onActiveAiDrawerChangeStable(event.payload.id, { initiatedByUserAction: false });\n break;\n case 'closeDrawer':\n onActiveAiDrawerChangeStable(null, { initiatedByUserAction: false });\n break;\n case 'resizeDrawer':\n onActiveAiDrawerResizeStable(event.payload.size);\n break;\n /* istanbul ignore next: this code is not intended to be visited */\n default:\n assertNever(event);\n }\n });\n const onAiDrawersChangeStable = useStableCallback(onActiveAiDrawerChange);\n const onActiveAiDrawerResizeStable = useStableCallback(onActiveAiDrawerResize);\n const onActiveAiDrawerChangeStable = useStableCallback(onActiveAiDrawerChange);\n const aiDrawerWasOpenRef = useRef(false);\n aiDrawerWasOpenRef.current = aiDrawerWasOpenRef.current || !!activeAiDrawerId;\n\n useEffect(() => {\n if (!isEnabled) {\n return;\n }\n\n const initialDrawerMessage = getAppLayoutInitialState()?.find(message => message.type === 'registerLeftDrawer');\n if (initialDrawerMessage && initialDrawerMessage.type === 'registerLeftDrawer') {\n setAiDrawer(initialDrawerMessage.payload);\n if (!aiDrawerWasOpenRef.current && initialDrawerMessage.payload.defaultActive) {\n onAiDrawersChangeStable(initialDrawerMessage.payload.id, { initiatedByUserAction: false });\n }\n }\n\n const unsubscribe = registerAppLayoutHandler(appLayoutMessageHandler);\n return () => {\n unsubscribe();\n setAiDrawer(null);\n };\n }, [isEnabled, appLayoutMessageHandler, onAiDrawersChangeStable, onActiveAiDrawerResizeStable]);\n\n return aiDrawer && mapRuntimeConfigToAiDrawer(aiDrawer);\n}\n\nconst MIN_DRAWER_SIZE = 400;\n\ninterface UseDrawersProps {\n isEnabled: boolean;\n onAiDrawerFocus: () => void;\n expandedDrawerId: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n}\n\nexport function useAiDrawer({ isEnabled, onAiDrawerFocus, expandedDrawerId, setExpandedDrawerId }: UseDrawersProps) {\n const [activeAiDrawerId, setActiveAiDrawerId] = useState<string | null>(null);\n const [size, setSize] = useState<number | null>(null);\n\n function onActiveAiDrawerResize(size: number) {\n setSize(size);\n fireNonCancelableEvent(activeAiDrawer?.onResize, { id: activeAiDrawerId, size });\n }\n\n function onActiveAiDrawerChange(\n newDrawerId: string | null,\n { initiatedByUserAction }: OnChangeParams = DEFAULT_ON_CHANGE_PARAMS\n ) {\n setActiveAiDrawerId(newDrawerId);\n\n if (newDrawerId) {\n fireNonCancelableEvent(aiDrawer?.onToggle, { isOpen: true, initiatedByUserAction });\n }\n\n if (activeAiDrawerId) {\n fireNonCancelableEvent(aiDrawer?.onToggle, { isOpen: false, initiatedByUserAction });\n\n if (activeAiDrawerId === expandedDrawerId) {\n setExpandedDrawerId?.(null);\n }\n }\n\n onAiDrawerFocus?.();\n }\n\n const aiDrawer = useRuntimeAiDrawer(isEnabled, activeAiDrawerId, onActiveAiDrawerChange, onActiveAiDrawerResize);\n const activeAiDrawer = activeAiDrawerId && activeAiDrawerId === aiDrawer?.id ? aiDrawer : null;\n const activeAiDrawerSize = activeAiDrawerId ? (size ?? activeAiDrawer?.defaultSize ?? MIN_DRAWER_SIZE) : 0;\n const minAiDrawerSize = Math.min(activeAiDrawer?.defaultSize ?? MIN_DRAWER_SIZE, MIN_DRAWER_SIZE);\n\n return {\n aiDrawer,\n onActiveAiDrawerChange,\n activeAiDrawer,\n activeAiDrawerId,\n activeAiDrawerSize,\n minAiDrawerSize,\n onActiveAiDrawerResize,\n };\n}\n"]}
@@ -112,8 +112,8 @@ export function AppLayoutGlobalAiDrawerImplementation({ appLayoutInternals, show
112
112
  }, ariaLabel: "Left panel actions", items: drawerActions }))),
113
113
  !isMobile && isExpanded && ((_d = activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.ariaLabels) === null || _d === void 0 ? void 0 : _d.exitExpandedModeButton) && (React.createElement("div", { className: styles['drawer-back-to-console-slot'] },
114
114
  React.createElement("div", { className: styles['drawer-back-to-console-button-wrapper'] },
115
- React.createElement("button", { className: clsx(testutilStyles['active-ai-drawer-leave-expanded-mode-custom-button'], styles['drawer-back-to-console-button']), formAction: "none", onClick: () => setExpandedDrawerId(null) }, (_e = activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.ariaLabels) === null || _e === void 0 ? void 0 : _e.exitExpandedModeButton))))), activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 :
116
- activeAiDrawer.content))));
115
+ React.createElement("button", { className: clsx(testutilStyles['active-ai-drawer-leave-expanded-mode-custom-button'], styles['drawer-back-to-console-button']), formAction: "none", onClick: () => setExpandedDrawerId(null) }, (_e = activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.ariaLabels) === null || _e === void 0 ? void 0 : _e.exitExpandedModeButton))))),
116
+ React.createElement("div", { className: styles['drawer-content-content'] }, activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.content)))));
117
117
  }));
118
118
  }));
119
119
  }
@@ -1 +1 @@
1
- {"version":3,"file":"global-ai-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAKxE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAwBrC,MAAM,UAAU,qCAAqC,CAAC,EACpD,kBAAkB,EAClB,IAAI,EACJ,cAAc,EACd,aAAa,GAC8B;;IAC3C,MAAM,EACJ,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACR,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,m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AG,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAEvC,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,UAAU,0CAAE,sBAAsB,CAC5C,CACL,CACF,CACP,CACM,EACR,cAAc,aAAd,cAAc;wBAAd,cAAc,CAAE,OAAO,CACpB,CACF,CACA,CACT,CAAC;QACJ,CAAC,CACU,CACd,CAAC;IACJ,CAAC,CACU,CACd,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalItemOrGroup } from '../../../button-group/interfaces';\nimport ButtonGroup from '../../../button-group/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { AppLayoutProps } from '../../interfaces';\nimport { OnChangeParams } from '../../utils/use-ai-drawer';\nimport { FocusControlState } from '../../utils/use-focus-control';\nimport { AppLayoutInternals, InternalDrawer } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AIDrawerProps {\n activeAiDrawerSize: number;\n minAiDrawerSize: number;\n aiDrawer: AppLayoutProps.Drawer | undefined;\n maxAiDrawerSize: number;\n ariaLabels: any;\n aiDrawerFocusControl: FocusControlState | undefined;\n isMobile: boolean;\n drawersOpenQueue: ReadonlyArray<string> | undefined;\n onActiveAiDrawerChange: undefined | ((newDrawerId: string | null, params?: OnChangeParams) => void);\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n expandedDrawerId?: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n}\n\ninterface AppLayoutGlobalAiDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n show: boolean;\n activeAiDrawer: InternalDrawer | null;\n aiDrawerProps: AIDrawerProps;\n}\n\nexport function AppLayoutGlobalAiDrawerImplementation({\n appLayoutInternals,\n show,\n activeAiDrawer,\n aiDrawerProps,\n}: AppLayoutGlobalAiDrawerImplementationProps) {\n const {\n activeAiDrawerSize,\n minAiDrawerSize,\n maxAiDrawerSize,\n ariaLabels,\n aiDrawerFocusControl,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n onActiveDrawerResize,\n expandedDrawerId,\n setExpandedDrawerId,\n } = aiDrawerProps;\n const { verticalOffsets, placement } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeAiDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeAiDrawer ? activeAiDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeAiDrawer ? activeAiDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const resizeProps = useResize({\n currentWidth: activeAiDrawerSize,\n minWidth: minAiDrawerSize,\n maxWidth: maxAiDrawerSize,\n panelRef: drawerRef,\n handleRef: aiDrawerFocusControl!.refs.slider,\n onResize: size => {\n onActiveDrawerResize({ id: activeDrawerId!, size });\n },\n position: 'side-start',\n });\n const size = getLimitedValue(minAiDrawerSize, activeAiDrawerSize, maxAiDrawerSize);\n const isExpanded = activeAiDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n (activeAiDrawer?.defaultActive && !drawersOpenQueue?.includes(activeAiDrawer.id)) || (wasExpanded && !isExpanded);\n const drawerHeight = `calc(100vh - ${verticalOffsets.toolbar + placement.insetBlockEnd}px)`;\n // disable resizing when the drawer is at its minimum width in a \"squeezed\" state\n // (window is between mobile and desktop sizes). At this point, the drawer can't be\n // resized in either direction, so we disable the resize handler\n const isResizingDisabled = maxAiDrawerSize < activeAiDrawerSize;\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-left',\n text: computedAriaLabels.closeButton,\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeAiDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeAiDrawer?.ariaLabels?.expandedModeButton ?? '',\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeAiDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeAiDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n return (\n <Transition nodeRef={drawerRef} in={show} appear={show} mountOnEnter={true} timeout={250}>\n {drawerTransitionState => {\n return (\n <Transition nodeRef={drawerRef} in={isExpanded} timeout={250}>\n {expandedTransitionState => {\n return (\n <aside\n id={activeAiDrawer?.id}\n aria-hidden={!activeAiDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(\n styles.drawer,\n styles['ai-drawer'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [sharedStyles['with-motion-horizontal']]: !animationDisabled,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-hidden']]: !show && drawerTransitionState === 'exited',\n [testutilStyles['drawer-closed']]: !activeAiDrawer,\n [styles['drawer-expanded']]: isExpanded,\n }\n )}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n aiDrawerFocusControl?.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: `${placement.insetBlockStart}px`,\n ...(!isMobile && {\n [customCssProps.drawerMinSize]: `${size}px`,\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(drawerTransitionState) ? size : 0}px`,\n }),\n }}\n data-testid={activeDrawerId && `awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile && activeAiDrawer?.resizable && (!isExpanded || expandedTransitionState !== 'entered') && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={aiDrawerFocusControl?.refs.slider}\n position=\"side-start\"\n className={clsx(testutilStyles['drawers-slider'], styles['ai-drawer-slider-handle'])}\n ariaLabel={activeAiDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeAiDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n onDirectionClick={resizeProps.onDirectionClick}\n disabled={isResizingDisabled}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}>\n <div className={styles['drawer-content']}>\n <header className={styles['drawer-content-header']}>\n <div className={styles['drawer-content-header-content']}>\n {activeAiDrawer?.header ?? <div />}\n <div className={styles['drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveAiDrawerChange?.(null, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId!);\n break;\n default:\n activeAiDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Left panel actions\"\n items={drawerActions}\n />\n </div>\n </div>\n {!isMobile && isExpanded && activeAiDrawer?.ariaLabels?.exitExpandedModeButton && (\n <div className={styles['drawer-back-to-console-slot']}>\n <div className={styles['drawer-back-to-console-button-wrapper']}>\n <button\n className={clsx(\n testutilStyles['active-ai-drawer-leave-expanded-mode-custom-button'],\n styles['drawer-back-to-console-button']\n )}\n formAction=\"none\"\n onClick={() => setExpandedDrawerId(null)}\n >\n {activeAiDrawer?.ariaLabels?.exitExpandedModeButton}\n </button>\n </div>\n </div>\n )}\n </header>\n {activeAiDrawer?.content}\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n );\n }}\n </Transition>\n );\n}\n"]}
1
+ {"version":3,"file":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;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalItemOrGroup } from '../../../button-group/interfaces';\nimport ButtonGroup from '../../../button-group/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { AppLayoutProps } from '../../interfaces';\nimport { OnChangeParams } from '../../utils/use-ai-drawer';\nimport { FocusControlState } from '../../utils/use-focus-control';\nimport { AppLayoutInternals, InternalDrawer } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AIDrawerProps {\n activeAiDrawerSize: number;\n minAiDrawerSize: number;\n aiDrawer: AppLayoutProps.Drawer | undefined;\n maxAiDrawerSize: number;\n ariaLabels: any;\n aiDrawerFocusControl: FocusControlState | undefined;\n isMobile: boolean;\n drawersOpenQueue: ReadonlyArray<string> | undefined;\n onActiveAiDrawerChange: undefined | ((newDrawerId: string | null, params?: OnChangeParams) => void);\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n expandedDrawerId?: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n}\n\ninterface AppLayoutGlobalAiDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n show: boolean;\n activeAiDrawer: InternalDrawer | null;\n aiDrawerProps: AIDrawerProps;\n}\n\nexport function AppLayoutGlobalAiDrawerImplementation({\n appLayoutInternals,\n show,\n activeAiDrawer,\n aiDrawerProps,\n}: AppLayoutGlobalAiDrawerImplementationProps) {\n const {\n activeAiDrawerSize,\n minAiDrawerSize,\n maxAiDrawerSize,\n ariaLabels,\n aiDrawerFocusControl,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n onActiveDrawerResize,\n expandedDrawerId,\n setExpandedDrawerId,\n } = aiDrawerProps;\n const { verticalOffsets, placement } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeAiDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeAiDrawer ? activeAiDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeAiDrawer ? activeAiDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const resizeProps = useResize({\n currentWidth: activeAiDrawerSize,\n minWidth: minAiDrawerSize,\n maxWidth: maxAiDrawerSize,\n panelRef: drawerRef,\n handleRef: aiDrawerFocusControl!.refs.slider,\n onResize: size => {\n onActiveDrawerResize({ id: activeDrawerId!, size });\n },\n position: 'side-start',\n });\n const size = getLimitedValue(minAiDrawerSize, activeAiDrawerSize, maxAiDrawerSize);\n const isExpanded = activeAiDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n (activeAiDrawer?.defaultActive && !drawersOpenQueue?.includes(activeAiDrawer.id)) || (wasExpanded && !isExpanded);\n const drawerHeight = `calc(100vh - ${verticalOffsets.toolbar + placement.insetBlockEnd}px)`;\n // disable resizing when the drawer is at its minimum width in a \"squeezed\" state\n // (window is between mobile and desktop sizes). At this point, the drawer can't be\n // resized in either direction, so we disable the resize handler\n const isResizingDisabled = maxAiDrawerSize < activeAiDrawerSize;\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-left',\n text: computedAriaLabels.closeButton,\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeAiDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeAiDrawer?.ariaLabels?.expandedModeButton ?? '',\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeAiDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeAiDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n return (\n <Transition nodeRef={drawerRef} in={show} appear={show} mountOnEnter={true} timeout={250}>\n {drawerTransitionState => {\n return (\n <Transition nodeRef={drawerRef} in={isExpanded} timeout={250}>\n {expandedTransitionState => {\n return (\n <aside\n id={activeAiDrawer?.id}\n aria-hidden={!activeAiDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(\n styles.drawer,\n styles['ai-drawer'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [sharedStyles['with-motion-horizontal']]: !animationDisabled,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-hidden']]: !show && drawerTransitionState === 'exited',\n [testutilStyles['drawer-closed']]: !activeAiDrawer,\n [styles['drawer-expanded']]: isExpanded,\n }\n )}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n aiDrawerFocusControl?.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: `${placement.insetBlockStart}px`,\n ...(!isMobile && {\n [customCssProps.drawerMinSize]: `${size}px`,\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(drawerTransitionState) ? size : 0}px`,\n }),\n }}\n data-testid={activeDrawerId && `awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile && activeAiDrawer?.resizable && (!isExpanded || expandedTransitionState !== 'entered') && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={aiDrawerFocusControl?.refs.slider}\n position=\"side-start\"\n className={clsx(testutilStyles['drawers-slider'], styles['ai-drawer-slider-handle'])}\n ariaLabel={activeAiDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeAiDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n onDirectionClick={resizeProps.onDirectionClick}\n disabled={isResizingDisabled}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}>\n <div className={styles['drawer-content']}>\n <header className={styles['drawer-content-header']}>\n <div className={styles['drawer-content-header-content']}>\n {activeAiDrawer?.header ?? <div />}\n <div className={styles['drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveAiDrawerChange?.(null, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId!);\n break;\n default:\n activeAiDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Left panel actions\"\n items={drawerActions}\n />\n </div>\n </div>\n {!isMobile && isExpanded && activeAiDrawer?.ariaLabels?.exitExpandedModeButton && (\n <div className={styles['drawer-back-to-console-slot']}>\n <div className={styles['drawer-back-to-console-button-wrapper']}>\n <button\n className={clsx(\n testutilStyles['active-ai-drawer-leave-expanded-mode-custom-button'],\n styles['drawer-back-to-console-button']\n )}\n formAction=\"none\"\n onClick={() => setExpandedDrawerId(null)}\n >\n {activeAiDrawer?.ariaLabels?.exitExpandedModeButton}\n </button>\n </div>\n </div>\n )}\n </header>\n <div className={styles['drawer-content-content']}>{activeAiDrawer?.content}</div>\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n );\n }}\n </Transition>\n );\n}\n"]}
@@ -4,6 +4,5 @@ interface AppLayoutGlobalDrawersImplementationProps {
4
4
  appLayoutInternals: AppLayoutInternals;
5
5
  }
6
6
  export declare function AppLayoutGlobalDrawersImplementation({ appLayoutInternals, }: AppLayoutGlobalDrawersImplementationProps): JSX.Element;
7
- export declare const createWidgetizedAppLayoutGlobalDrawers: (Loader?: typeof AppLayoutGlobalDrawersImplementation | undefined) => typeof AppLayoutGlobalDrawersImplementation;
8
7
  export {};
9
8
  //# sourceMappingURL=global-drawers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"global-drawers.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawers.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGnD,UAAU,yCAAyC;IACjD,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,wBAAgB,oCAAoC,CAAC,EACnD,kBAAkB,GACnB,EAAE,yCAAyC,eA6B3C;AAED,eAAO,MAAM,sCAAsC,mHAAkE,CAAC"}
1
+ {"version":3,"file":"global-drawers.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawers.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGnD,UAAU,yCAAyC;IACjD,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,wBAAgB,oCAAoC,CAAC,EACnD,kBAAkB,GACnB,EAAE,yCAAyC,eA6B3C"}
@@ -1,7 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React, { useRef } from 'react';
4
- import { createWidgetizedComponent } from '../../../internal/widgets';
5
4
  import AppLayoutGlobalDrawer from './global-drawer';
6
5
  export function AppLayoutGlobalDrawersImplementation({ appLayoutInternals, }) {
7
6
  const { globalDrawers, activeGlobalDrawersIds, expandedDrawerId } = appLayoutInternals;
@@ -17,5 +16,4 @@ export function AppLayoutGlobalDrawersImplementation({ appLayoutInternals, }) {
17
16
  return (React.createElement(AppLayoutGlobalDrawer, { key: drawer.id, show: activeGlobalDrawersIds.includes(drawer.id) && (!expandedDrawerId || drawer.id === expandedDrawerId), activeGlobalDrawer: drawer, appLayoutInternals: appLayoutInternals }));
18
17
  })));
19
18
  }
20
- export const createWidgetizedAppLayoutGlobalDrawers = createWidgetizedComponent(AppLayoutGlobalDrawersImplementation);
21
19
  //# sourceMappingURL=global-drawers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"global-drawers.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawers.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,qBAAqB,MAAM,iBAAiB,CAAC;AAMpD,MAAM,UAAU,oCAAoC,CAAC,EACnD,kBAAkB,GACwB;IAC1C,MAAM,EAAE,aAAa,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,GAAG,kBAAkB,CAAC;IACvF,MAAM,kBAAkB,GAAG,MAAM,CAAc,IAAI,GAAG,EAAE,CAAC,CAAC;IAE1D,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE;QACzB,OAAO,yCAAK,CAAC;KACd;IAED,OAAO,CACL,0CACG,aAAa;SACX,MAAM,CACL,MAAM,CAAC,EAAE,CACP,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1C,CAAC,MAAM,CAAC,uBAAuB,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAChF;SACA,GAAG,CAAC,MAAM,CAAC,EAAE;QACZ,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC1C,OAAO,CACL,oBAAC,qBAAqB,IACpB,GAAG,EAAE,MAAM,CAAC,EAAE,EACd,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,gBAAgB,IAAI,MAAM,CAAC,EAAE,KAAK,gBAAgB,CAAC,EACzG,kBAAkB,EAAE,MAAM,EAC1B,kBAAkB,EAAE,kBAAkB,GACtC,CACH,CAAC;IACJ,CAAC,CAAC,CACH,CACJ,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,sCAAsC,GAAG,yBAAyB,CAAC,oCAAoC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\n\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutInternals } from '../interfaces';\nimport AppLayoutGlobalDrawer from './global-drawer';\n\ninterface AppLayoutGlobalDrawersImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n}\n\nexport function AppLayoutGlobalDrawersImplementation({\n appLayoutInternals,\n}: AppLayoutGlobalDrawersImplementationProps) {\n const { globalDrawers, activeGlobalDrawersIds, expandedDrawerId } = appLayoutInternals;\n const openDrawersHistory = useRef<Set<string>>(new Set());\n\n if (!globalDrawers.length) {\n return <></>;\n }\n\n return (\n <>\n {globalDrawers\n .filter(\n drawer =>\n activeGlobalDrawersIds.includes(drawer.id) ||\n (drawer.preserveInactiveContent && openDrawersHistory.current.has(drawer.id))\n )\n .map(drawer => {\n openDrawersHistory.current.add(drawer.id);\n return (\n <AppLayoutGlobalDrawer\n key={drawer.id}\n show={activeGlobalDrawersIds.includes(drawer.id) && (!expandedDrawerId || drawer.id === expandedDrawerId)}\n activeGlobalDrawer={drawer}\n appLayoutInternals={appLayoutInternals}\n />\n );\n })}\n </>\n );\n}\n\nexport const createWidgetizedAppLayoutGlobalDrawers = createWidgetizedComponent(AppLayoutGlobalDrawersImplementation);\n"]}
1
+ {"version":3,"file":"global-drawers.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawers.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,qBAAqB,MAAM,iBAAiB,CAAC;AAMpD,MAAM,UAAU,oCAAoC,CAAC,EACnD,kBAAkB,GACwB;IAC1C,MAAM,EAAE,aAAa,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,GAAG,kBAAkB,CAAC;IACvF,MAAM,kBAAkB,GAAG,MAAM,CAAc,IAAI,GAAG,EAAE,CAAC,CAAC;IAE1D,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE;QACzB,OAAO,yCAAK,CAAC;KACd;IAED,OAAO,CACL,0CACG,aAAa;SACX,MAAM,CACL,MAAM,CAAC,EAAE,CACP,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1C,CAAC,MAAM,CAAC,uBAAuB,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAChF;SACA,GAAG,CAAC,MAAM,CAAC,EAAE;QACZ,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC1C,OAAO,CACL,oBAAC,qBAAqB,IACpB,GAAG,EAAE,MAAM,CAAC,EAAE,EACd,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,gBAAgB,IAAI,MAAM,CAAC,EAAE,KAAK,gBAAgB,CAAC,EACzG,kBAAkB,EAAE,MAAM,EAC1B,kBAAkB,EAAE,kBAAkB,GACtC,CACH,CAAC;IACJ,CAAC,CAAC,CACH,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\n\nimport { AppLayoutInternals } from '../interfaces';\nimport AppLayoutGlobalDrawer from './global-drawer';\n\ninterface AppLayoutGlobalDrawersImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n}\n\nexport function AppLayoutGlobalDrawersImplementation({\n appLayoutInternals,\n}: AppLayoutGlobalDrawersImplementationProps) {\n const { globalDrawers, activeGlobalDrawersIds, expandedDrawerId } = appLayoutInternals;\n const openDrawersHistory = useRef<Set<string>>(new Set());\n\n if (!globalDrawers.length) {\n return <></>;\n }\n\n return (\n <>\n {globalDrawers\n .filter(\n drawer =>\n activeGlobalDrawersIds.includes(drawer.id) ||\n (drawer.preserveInactiveContent && openDrawersHistory.current.has(drawer.id))\n )\n .map(drawer => {\n openDrawersHistory.current.add(drawer.id);\n return (\n <AppLayoutGlobalDrawer\n key={drawer.id}\n show={activeGlobalDrawersIds.includes(drawer.id) && (!expandedDrawerId || drawer.id === expandedDrawerId)}\n activeGlobalDrawer={drawer}\n appLayoutInternals={appLayoutInternals}\n />\n );\n })}\n </>\n );\n}\n"]}
@@ -1,3 +1,3 @@
1
- export { createWidgetizedAppLayoutDrawer, AppLayoutDrawerImplementation } from './local-drawer';
2
- export { createWidgetizedAppLayoutGlobalDrawers, AppLayoutGlobalDrawersImplementation } from './global-drawers';
1
+ export { AppLayoutDrawerImplementation } from './local-drawer';
2
+ export { AppLayoutGlobalDrawersImplementation } from './global-drawers';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,sCAAsC,EAAE,oCAAoC,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,oCAAoC,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- export { createWidgetizedAppLayoutDrawer, AppLayoutDrawerImplementation } from './local-drawer';
4
- export { createWidgetizedAppLayoutGlobalDrawers, AppLayoutGlobalDrawersImplementation } from './global-drawers';
3
+ export { AppLayoutDrawerImplementation } from './local-drawer';
4
+ export { AppLayoutGlobalDrawersImplementation } from './global-drawers';
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,sCAAsC,EAAE,oCAAoC,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport { createWidgetizedAppLayoutDrawer, AppLayoutDrawerImplementation } from './local-drawer';\nexport { createWidgetizedAppLayoutGlobalDrawers, AppLayoutGlobalDrawersImplementation } from './global-drawers';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,oCAAoC,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport { AppLayoutDrawerImplementation } from './local-drawer';\nexport { AppLayoutGlobalDrawersImplementation } from './global-drawers';\n"]}
@@ -4,6 +4,5 @@ interface AppLayoutDrawerImplementationProps {
4
4
  appLayoutInternals: AppLayoutInternals;
5
5
  }
6
6
  export declare function AppLayoutDrawerImplementation({ appLayoutInternals }: AppLayoutDrawerImplementationProps): JSX.Element;
7
- export declare const createWidgetizedAppLayoutDrawer: (Loader?: typeof AppLayoutDrawerImplementation | undefined) => typeof AppLayoutDrawerImplementation;
8
7
  export {};
9
8
  //# sourceMappingURL=local-drawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/local-drawer.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOnD,UAAU,kCAAkC;IAC1C,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,wBAAgB,6BAA6B,CAAC,EAAE,kBAAkB,EAAE,EAAE,kCAAkC,eA4HvG;AAED,eAAO,MAAM,+BAA+B,qGAA2D,CAAC"}
1
+ {"version":3,"file":"local-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/local-drawer.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOnD,UAAU,kCAAkC;IAC1C,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,wBAAgB,6BAA6B,CAAC,EAAE,kBAAkB,EAAE,EAAE,kCAAkC,eA4HvG"}
@@ -6,7 +6,6 @@ import clsx from 'clsx';
6
6
  import { InternalButton } from '../../../button/internal';
7
7
  import PanelResizeHandle from '../../../internal/components/panel-resize-handle';
8
8
  import customCssProps from '../../../internal/generated/custom-css-properties';
9
- import { createWidgetizedComponent } from '../../../internal/widgets';
10
9
  import { getLimitedValue } from '../../../split-panel/utils/size-utils';
11
10
  import { TOOLS_DRAWER_ID } from '../../utils/use-drawers';
12
11
  import { getDrawerStyles } from '../compute-layout';
@@ -70,5 +69,4 @@ export function AppLayoutDrawerImplementation({ appLayoutInternals }) {
70
69
  activeDrawerId !== TOOLS_DRAWER_ID && (React.createElement("div", { className: styles['drawer-content'], style: { blockSize: drawerHeight } }, activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content)))));
71
70
  }));
72
71
  }
73
- export const createWidgetizedAppLayoutDrawer = createWidgetizedComponent(AppLayoutDrawerImplementation);
74
72
  //# sourceMappingURL=local-drawer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/local-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAMrC,MAAM,UAAU,6BAA6B,CAAC,EAAE,kBAAkB,EAAsC;;IACtG,MAAM,EACJ,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,OAAO,EACP,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,GACrB,GAAG,kBAAkB,CAAC;I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port React, { useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../../../button/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { TOOLS_DRAWER_ID } from '../../utils/use-drawers';\nimport { getDrawerStyles } from '../compute-layout';\nimport { AppLayoutInternals } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n}\n\nexport function AppLayoutDrawerImplementation({ appLayoutInternals }: AppLayoutDrawerImplementationProps) {\n const {\n activeDrawer,\n minDrawerSize,\n activeDrawerSize,\n maxDrawerSize,\n ariaLabels,\n drawers,\n drawersFocusControl,\n isMobile,\n placement,\n verticalOffsets,\n drawersOpenQueue,\n onActiveDrawerChange,\n onActiveDrawerResize,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeDrawer ? activeDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawer ? activeDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const { drawerTopOffset, drawerHeight } = getDrawerStyles(verticalOffsets, isMobile, placement);\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\n const isToolsDrawer = activeDrawer?.id === TOOLS_DRAWER_ID || toolsOnlyMode;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: drawersFocusControl.refs.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n // temporary handle a situation when app-layout is old, but this component come as a widget\n const isLegacyDrawer = drawersOpenQueue === undefined;\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue?.length ? drawersOpenQueue[0] : activeDrawerId;\n const animationDisabled = activeDrawer?.defaultActive && !drawersOpenQueue.includes(activeDrawer.id);\n\n return (\n <Transition nodeRef={drawerRef} in={!!activeDrawer} appear={true} timeout={0}>\n {state => (\n <aside\n id={activeDrawerId}\n aria-hidden={!activeDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, {\n [sharedStyles['with-motion-horizontal']]: !animationDisabled,\n [styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,\n [styles.legacy]: isLegacyDrawer,\n [testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\n [styles['drawer-hidden']]: !activeDrawer,\n [testutilStyles['drawer-closed']]: !activeDrawer,\n })}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n drawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: drawerTopOffset,\n ...(!isMobile &&\n !isLegacyDrawer && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? size : 0}px`,\n }),\n }}\n data-testid={activeDrawerId && `awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile && activeDrawer?.resizable && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={drawersFocusControl.refs.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n onDirectionClick={resizeProps.onDirectionClick}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}>\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: !isToolsDrawer && activeDrawerId,\n [testutilStyles['tools-close']]: isToolsDrawer,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => onActiveDrawerChange(null, { initiatedByUserAction: true })}\n ref={drawersFocusControl.refs.close}\n variant=\"icon\"\n analyticsAction=\"close\"\n />\n </div>\n <div\n className={clsx(\n styles['drawer-content'],\n activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']\n )}\n style={{ blockSize: drawerHeight }}\n >\n {toolsContent}\n </div>\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n <div className={styles['drawer-content']} style={{ blockSize: drawerHeight }}>\n {activeDrawer?.content}\n </div>\n )}\n </div>\n </aside>\n )}\n </Transition>\n );\n}\n\nexport const createWidgetizedAppLayoutDrawer = createWidgetizedComponent(AppLayoutDrawerImplementation);\n"]}
1
+ {"version":3,"file":"local-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/local-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,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M,CAAC,uBAAuB,CAAC,CACtE,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IAEjC,YAAY,CACT;gBACL,cAAc,KAAK,eAAe,IAAI,CACrC,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IACzE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAClB,CACP,CACG,CACA,CACT,CAAA;KAAA,CACU,CACd,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../../../button/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { TOOLS_DRAWER_ID } from '../../utils/use-drawers';\nimport { getDrawerStyles } from '../compute-layout';\nimport { AppLayoutInternals } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n}\n\nexport function AppLayoutDrawerImplementation({ appLayoutInternals }: AppLayoutDrawerImplementationProps) {\n const {\n activeDrawer,\n minDrawerSize,\n activeDrawerSize,\n maxDrawerSize,\n ariaLabels,\n drawers,\n drawersFocusControl,\n isMobile,\n placement,\n verticalOffsets,\n drawersOpenQueue,\n onActiveDrawerChange,\n onActiveDrawerResize,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeDrawer ? activeDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawer ? activeDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const { drawerTopOffset, drawerHeight } = getDrawerStyles(verticalOffsets, isMobile, placement);\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\n const isToolsDrawer = activeDrawer?.id === TOOLS_DRAWER_ID || toolsOnlyMode;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: drawersFocusControl.refs.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n // temporary handle a situation when app-layout is old, but this component come as a widget\n const isLegacyDrawer = drawersOpenQueue === undefined;\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue?.length ? drawersOpenQueue[0] : activeDrawerId;\n const animationDisabled = activeDrawer?.defaultActive && !drawersOpenQueue.includes(activeDrawer.id);\n\n return (\n <Transition nodeRef={drawerRef} in={!!activeDrawer} appear={true} timeout={0}>\n {state => (\n <aside\n id={activeDrawerId}\n aria-hidden={!activeDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, {\n [sharedStyles['with-motion-horizontal']]: !animationDisabled,\n [styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,\n [styles.legacy]: isLegacyDrawer,\n [testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\n [styles['drawer-hidden']]: !activeDrawer,\n [testutilStyles['drawer-closed']]: !activeDrawer,\n })}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n drawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: drawerTopOffset,\n ...(!isMobile &&\n !isLegacyDrawer && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? size : 0}px`,\n }),\n }}\n data-testid={activeDrawerId && `awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile && activeDrawer?.resizable && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={drawersFocusControl.refs.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n onDirectionClick={resizeProps.onDirectionClick}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}>\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: !isToolsDrawer && activeDrawerId,\n [testutilStyles['tools-close']]: isToolsDrawer,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => onActiveDrawerChange(null, { initiatedByUserAction: true })}\n ref={drawersFocusControl.refs.close}\n variant=\"icon\"\n analyticsAction=\"close\"\n />\n </div>\n <div\n className={clsx(\n styles['drawer-content'],\n activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']\n )}\n style={{ blockSize: drawerHeight }}\n >\n {toolsContent}\n </div>\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n <div className={styles['drawer-content']} style={{ blockSize: drawerHeight }}>\n {activeDrawer?.content}\n </div>\n )}\n </div>\n </aside>\n )}\n </Transition>\n );\n}\n"]}
@@ -1,29 +1,30 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "drawer": "awsui_drawer_12i0j_4fws7_193",
5
- "with-expanded-motion": "awsui_with-expanded-motion_12i0j_4fws7_207",
6
- "legacy": "awsui_legacy_12i0j_4fws7_221",
7
- "ai-drawer": "awsui_ai-drawer_12i0j_4fws7_221",
8
- "last-opened": "awsui_last-opened_12i0j_4fws7_229",
9
- "drawer-global": "awsui_drawer-global_12i0j_4fws7_233",
10
- "drawer-expanded": "awsui_drawer-expanded_12i0j_4fws7_242",
11
- "drawer-hidden": "awsui_drawer-hidden_12i0j_4fws7_246",
12
- "has-next-siblings": "awsui_has-next-siblings_12i0j_4fws7_256",
13
- "global-drawer-wrapper": "awsui_global-drawer-wrapper_12i0j_4fws7_256",
14
- "drawer-content-container": "awsui_drawer-content-container_12i0j_4fws7_270",
15
- "drawer-gap": "awsui_drawer-gap_12i0j_4fws7_273",
16
- "drawer-close-button": "awsui_drawer-close-button_12i0j_4fws7_291",
17
- "drawer-expanded-mode-button": "awsui_drawer-expanded-mode-button_12i0j_4fws7_297",
18
- "drawer-content": "awsui_drawer-content_12i0j_4fws7_270",
19
- "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_4fws7_309",
20
- "drawer-slider": "awsui_drawer-slider_12i0j_4fws7_312",
21
- "drawer-actions": "awsui_drawer-actions_12i0j_4fws7_362",
22
- "ai-drawer-slider-handle": "awsui_ai-drawer-slider-handle_12i0j_4fws7_416",
23
- "drawer-content-header": "awsui_drawer-content-header_12i0j_4fws7_433",
24
- "drawer-content-header-content": "awsui_drawer-content-header-content_12i0j_4fws7_446",
25
- "drawer-back-to-console-slot": "awsui_drawer-back-to-console-slot_12i0j_4fws7_463",
26
- "drawer-back-to-console-button-wrapper": "awsui_drawer-back-to-console-button-wrapper_12i0j_4fws7_502",
27
- "drawer-back-to-console-button": "awsui_drawer-back-to-console-button_12i0j_4fws7_502"
4
+ "drawer": "awsui_drawer_12i0j_1x1mt_193",
5
+ "with-expanded-motion": "awsui_with-expanded-motion_12i0j_1x1mt_207",
6
+ "legacy": "awsui_legacy_12i0j_1x1mt_221",
7
+ "ai-drawer": "awsui_ai-drawer_12i0j_1x1mt_221",
8
+ "last-opened": "awsui_last-opened_12i0j_1x1mt_229",
9
+ "drawer-global": "awsui_drawer-global_12i0j_1x1mt_233",
10
+ "drawer-expanded": "awsui_drawer-expanded_12i0j_1x1mt_242",
11
+ "drawer-hidden": "awsui_drawer-hidden_12i0j_1x1mt_246",
12
+ "has-next-siblings": "awsui_has-next-siblings_12i0j_1x1mt_256",
13
+ "global-drawer-wrapper": "awsui_global-drawer-wrapper_12i0j_1x1mt_256",
14
+ "drawer-content-container": "awsui_drawer-content-container_12i0j_1x1mt_270",
15
+ "drawer-gap": "awsui_drawer-gap_12i0j_1x1mt_273",
16
+ "drawer-close-button": "awsui_drawer-close-button_12i0j_1x1mt_291",
17
+ "drawer-expanded-mode-button": "awsui_drawer-expanded-mode-button_12i0j_1x1mt_297",
18
+ "drawer-content": "awsui_drawer-content_12i0j_1x1mt_270",
19
+ "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_1x1mt_309",
20
+ "drawer-slider": "awsui_drawer-slider_12i0j_1x1mt_312",
21
+ "drawer-actions": "awsui_drawer-actions_12i0j_1x1mt_362",
22
+ "ai-drawer-slider-handle": "awsui_ai-drawer-slider-handle_12i0j_1x1mt_416",
23
+ "drawer-content-header": "awsui_drawer-content-header_12i0j_1x1mt_436",
24
+ "drawer-content-header-content": "awsui_drawer-content-header-content_12i0j_1x1mt_449",
25
+ "drawer-back-to-console-slot": "awsui_drawer-back-to-console-slot_12i0j_1x1mt_466",
26
+ "drawer-back-to-console-button-wrapper": "awsui_drawer-back-to-console-button-wrapper_12i0j_1x1mt_505",
27
+ "drawer-back-to-console-button": "awsui_drawer-back-to-console-button_12i0j_1x1mt_505",
28
+ "drawer-content-content": "awsui_drawer-content-content_12i0j_1x1mt_578"
28
29
  };
29
30