@cloudscape-design/components-themeable 3.0.985 → 3.0.987

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 (39) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/app-layout/visual-refresh-toolbar/drawer/styles.scss +2 -2
  3. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +17 -17
  4. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +37 -37
  5. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +17 -17
  6. package/lib/internal/template/code-editor/index.d.ts.map +1 -1
  7. package/lib/internal/template/code-editor/index.js +3 -0
  8. package/lib/internal/template/code-editor/index.js.map +1 -1
  9. package/lib/internal/template/code-editor/interfaces.d.ts +1 -0
  10. package/lib/internal/template/code-editor/interfaces.d.ts.map +1 -1
  11. package/lib/internal/template/code-editor/interfaces.js.map +1 -1
  12. package/lib/internal/template/code-editor/preferences-modal.d.ts +1 -0
  13. package/lib/internal/template/code-editor/preferences-modal.d.ts.map +1 -1
  14. package/lib/internal/template/code-editor/preferences-modal.js +1 -1
  15. package/lib/internal/template/code-editor/preferences-modal.js.map +1 -1
  16. package/lib/internal/template/collection-preferences/index.d.ts +1 -1
  17. package/lib/internal/template/collection-preferences/index.d.ts.map +1 -1
  18. package/lib/internal/template/collection-preferences/index.js +2 -2
  19. package/lib/internal/template/collection-preferences/index.js.map +1 -1
  20. package/lib/internal/template/collection-preferences/interfaces.d.ts +5 -0
  21. package/lib/internal/template/collection-preferences/interfaces.d.ts.map +1 -1
  22. package/lib/internal/template/collection-preferences/interfaces.js.map +1 -1
  23. package/lib/internal/template/internal/environment.js +1 -1
  24. package/lib/internal/template/internal/environment.json +1 -1
  25. package/lib/internal/template/split-panel/implementation.d.ts.map +1 -1
  26. package/lib/internal/template/split-panel/implementation.js +1 -0
  27. package/lib/internal/template/split-panel/implementation.js.map +1 -1
  28. package/lib/internal/template/split-panel/index.d.ts.map +1 -1
  29. package/lib/internal/template/split-panel/index.js +2 -1
  30. package/lib/internal/template/split-panel/index.js.map +1 -1
  31. package/lib/internal/template/split-panel/interfaces.d.ts +1 -0
  32. package/lib/internal/template/split-panel/interfaces.d.ts.map +1 -1
  33. package/lib/internal/template/split-panel/interfaces.js.map +1 -1
  34. package/lib/internal/template/split-panel/preferences-modal.d.ts +1 -0
  35. package/lib/internal/template/split-panel/preferences-modal.d.ts.map +1 -1
  36. package/lib/internal/template/split-panel/preferences-modal.js +1 -1
  37. package/lib/internal/template/split-panel/preferences-modal.js.map +1 -1
  38. package/package.json +1 -1
  39. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +0 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "727c496d5df702d063f05f28aae92cc763d7c723"
2
+ "commit": "076664583a9ef5d405244c66aefaa7cd76946f48"
3
3
  }
@@ -140,7 +140,7 @@ $drawer-resize-handle-size: awsui.$space-m;
140
140
  z-index: 1;
141
141
  align-self: start;
142
142
  display: flex;
143
- justify-content: end;
143
+ justify-content: flex-end;
144
144
  }
145
145
 
146
146
  > .drawer-content {
@@ -223,7 +223,7 @@ $drawer-resize-handle-size: awsui.$space-m;
223
223
  z-index: 1;
224
224
  align-self: start;
225
225
  display: flex;
226
- justify-content: end;
226
+ justify-content: flex-end;
227
227
  }
228
228
 
229
229
  > .drawer-content {
@@ -1,22 +1,22 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "drawer": "awsui_drawer_12i0j_1ybif_189",
5
- "with-expanded-motion": "awsui_with-expanded-motion_12i0j_1ybif_203",
6
- "legacy": "awsui_legacy_12i0j_1ybif_217",
7
- "last-opened": "awsui_last-opened_12i0j_1ybif_225",
8
- "drawer-global": "awsui_drawer-global_12i0j_1ybif_229",
9
- "drawer-expanded": "awsui_drawer-expanded_12i0j_1ybif_238",
10
- "drawer-hidden": "awsui_drawer-hidden_12i0j_1ybif_242",
11
- "has-next-siblings": "awsui_has-next-siblings_12i0j_1ybif_252",
12
- "global-drawer-wrapper": "awsui_global-drawer-wrapper_12i0j_1ybif_252",
13
- "drawer-content-container": "awsui_drawer-content-container_12i0j_1ybif_266",
14
- "drawer-gap": "awsui_drawer-gap_12i0j_1ybif_269",
15
- "drawer-close-button": "awsui_drawer-close-button_12i0j_1ybif_287",
16
- "drawer-expanded-mode-button": "awsui_drawer-expanded-mode-button_12i0j_1ybif_293",
17
- "drawer-content": "awsui_drawer-content_12i0j_1ybif_266",
18
- "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_1ybif_305",
19
- "drawer-slider": "awsui_drawer-slider_12i0j_1ybif_308",
20
- "drawer-actions": "awsui_drawer-actions_12i0j_1ybif_357"
4
+ "drawer": "awsui_drawer_12i0j_xh4dp_189",
5
+ "with-expanded-motion": "awsui_with-expanded-motion_12i0j_xh4dp_203",
6
+ "legacy": "awsui_legacy_12i0j_xh4dp_217",
7
+ "last-opened": "awsui_last-opened_12i0j_xh4dp_225",
8
+ "drawer-global": "awsui_drawer-global_12i0j_xh4dp_229",
9
+ "drawer-expanded": "awsui_drawer-expanded_12i0j_xh4dp_238",
10
+ "drawer-hidden": "awsui_drawer-hidden_12i0j_xh4dp_242",
11
+ "has-next-siblings": "awsui_has-next-siblings_12i0j_xh4dp_252",
12
+ "global-drawer-wrapper": "awsui_global-drawer-wrapper_12i0j_xh4dp_252",
13
+ "drawer-content-container": "awsui_drawer-content-container_12i0j_xh4dp_266",
14
+ "drawer-gap": "awsui_drawer-gap_12i0j_xh4dp_269",
15
+ "drawer-close-button": "awsui_drawer-close-button_12i0j_xh4dp_287",
16
+ "drawer-expanded-mode-button": "awsui_drawer-expanded-mode-button_12i0j_xh4dp_293",
17
+ "drawer-content": "awsui_drawer-content_12i0j_xh4dp_266",
18
+ "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_xh4dp_305",
19
+ "drawer-slider": "awsui_drawer-slider_12i0j_xh4dp_308",
20
+ "drawer-actions": "awsui_drawer-actions_12i0j_xh4dp_357"
21
21
  };
22
22
 
@@ -186,7 +186,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
186
186
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
187
187
  SPDX-License-Identifier: Apache-2.0
188
188
  */
189
- .awsui_drawer_12i0j_1ybif_189:not(#\9) {
189
+ .awsui_drawer_12i0j_xh4dp_189:not(#\9) {
190
190
  position: sticky;
191
191
  z-index: 830;
192
192
  background-color: var(--color-background-container-content-mvmryi, #ffffff);
@@ -200,56 +200,56 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
200
200
  pointer-events: auto;
201
201
  word-wrap: break-word;
202
202
  }
203
- .awsui_drawer_12i0j_1ybif_189.awsui_with-expanded-motion_12i0j_1ybif_203:not(#\9) {
203
+ .awsui_drawer_12i0j_xh4dp_189.awsui_with-expanded-motion_12i0j_xh4dp_203:not(#\9) {
204
204
  transition: inline-size var(--motion-duration-refresh-only-slow-zil3nj, 0ms) var(--motion-easing-refresh-only-a-8gio5w, cubic-bezier(0, 0, 0, 1)), min-inline-size var(--motion-duration-refresh-only-slow-zil3nj, 0ms) var(--motion-easing-refresh-only-a-8gio5w, cubic-bezier(0, 0, 0, 1));
205
205
  }
206
206
  @media (prefers-reduced-motion: reduce) {
207
- .awsui_drawer_12i0j_1ybif_189.awsui_with-expanded-motion_12i0j_1ybif_203:not(#\9) {
207
+ .awsui_drawer_12i0j_xh4dp_189.awsui_with-expanded-motion_12i0j_xh4dp_203:not(#\9) {
208
208
  animation: none;
209
209
  transition: none;
210
210
  }
211
211
  }
212
- .awsui-motion-disabled .awsui_drawer_12i0j_1ybif_189.awsui_with-expanded-motion_12i0j_1ybif_203:not(#\9), .awsui-mode-entering .awsui_drawer_12i0j_1ybif_189.awsui_with-expanded-motion_12i0j_1ybif_203:not(#\9) {
212
+ .awsui-motion-disabled .awsui_drawer_12i0j_xh4dp_189.awsui_with-expanded-motion_12i0j_xh4dp_203:not(#\9), .awsui-mode-entering .awsui_drawer_12i0j_xh4dp_189.awsui_with-expanded-motion_12i0j_xh4dp_203:not(#\9) {
213
213
  animation: none;
214
214
  transition: none;
215
215
  }
216
216
  @media (min-width: 689px) {
217
- .awsui_drawer_12i0j_1ybif_189:not(#\9):not(.awsui_legacy_12i0j_1ybif_217) {
217
+ .awsui_drawer_12i0j_xh4dp_189:not(#\9):not(.awsui_legacy_12i0j_xh4dp_217) {
218
218
  border-inline-start: var(--border-divider-section-width-sznrdy, 1px) solid var(--color-border-layout-gb61sp, #d5dbdb);
219
219
  }
220
220
  }
221
221
  @media (max-width: 688px) {
222
- .awsui_drawer_12i0j_1ybif_189:not(#\9) {
222
+ .awsui_drawer_12i0j_xh4dp_189:not(#\9) {
223
223
  inline-size: 100%;
224
224
  }
225
- .awsui_drawer_12i0j_1ybif_189.awsui_last-opened_12i0j_1ybif_225:not(#\9) {
225
+ .awsui_drawer_12i0j_xh4dp_189.awsui_last-opened_12i0j_xh4dp_225:not(#\9) {
226
226
  z-index: 1001;
227
227
  }
228
228
  }
229
- .awsui_drawer_12i0j_1ybif_189.awsui_drawer-global_12i0j_1ybif_229:not(#\9) {
229
+ .awsui_drawer_12i0j_xh4dp_189.awsui_drawer-global_12i0j_xh4dp_229:not(#\9) {
230
230
  display: block;
231
231
  }
232
232
  @media (min-width: 689px) {
233
- .awsui_drawer_12i0j_1ybif_189.awsui_drawer-global_12i0j_1ybif_229:not(#\9) {
233
+ .awsui_drawer_12i0j_xh4dp_189.awsui_drawer-global_12i0j_xh4dp_229:not(#\9) {
234
234
  inline-size: var(--awsui-drawer-size-xgujsu);
235
235
  }
236
236
  }
237
237
  @media (max-width: 688px) {
238
- .awsui_drawer_12i0j_1ybif_189.awsui_drawer-global_12i0j_1ybif_229:not(#\9):not(.awsui_last-opened_12i0j_1ybif_225):not(.awsui_drawer-expanded_12i0j_1ybif_238) {
238
+ .awsui_drawer_12i0j_xh4dp_189.awsui_drawer-global_12i0j_xh4dp_229:not(#\9):not(.awsui_last-opened_12i0j_xh4dp_225):not(.awsui_drawer-expanded_12i0j_xh4dp_238) {
239
239
  display: none;
240
240
  }
241
241
  }
242
- .awsui_drawer_12i0j_1ybif_189.awsui_drawer-hidden_12i0j_1ybif_242:not(#\9) {
242
+ .awsui_drawer_12i0j_xh4dp_189.awsui_drawer-hidden_12i0j_xh4dp_242:not(#\9) {
243
243
  display: none;
244
244
  }
245
- .awsui_drawer_12i0j_1ybif_189.awsui_drawer-expanded_12i0j_1ybif_238:not(#\9) {
245
+ .awsui_drawer_12i0j_xh4dp_189.awsui_drawer-expanded_12i0j_xh4dp_238:not(#\9) {
246
246
  inline-size: 100%;
247
247
  }
248
248
  @media (min-width: 689px) {
249
- .awsui_drawer_12i0j_1ybif_189.awsui_drawer-expanded_12i0j_1ybif_238:not(#\9) {
249
+ .awsui_drawer_12i0j_xh4dp_189.awsui_drawer-expanded_12i0j_xh4dp_238:not(#\9) {
250
250
  border-inline-start: none;
251
251
  }
252
- .awsui_drawer_12i0j_1ybif_189.awsui_drawer-expanded_12i0j_1ybif_238.awsui_has-next-siblings_12i0j_1ybif_252 > .awsui_global-drawer-wrapper_12i0j_1ybif_252:not(#\9):after {
252
+ .awsui_drawer_12i0j_xh4dp_189.awsui_drawer-expanded_12i0j_xh4dp_238.awsui_has-next-siblings_12i0j_xh4dp_252 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252:not(#\9):after {
253
253
  content: "";
254
254
  position: absolute;
255
255
  block-size: 100%;
@@ -259,14 +259,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
259
259
  border-inline-start: var(--border-divider-section-width-sznrdy, 1px) solid var(--color-border-layout-gb61sp, #d5dbdb);
260
260
  box-sizing: border-box;
261
261
  }
262
- .awsui_drawer_12i0j_1ybif_189.awsui_drawer-expanded_12i0j_1ybif_238 > .awsui_global-drawer-wrapper_12i0j_1ybif_252:not(#\9) {
262
+ .awsui_drawer_12i0j_xh4dp_189.awsui_drawer-expanded_12i0j_xh4dp_238 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252:not(#\9) {
263
263
  inline-size: 100%;
264
264
  grid-template-columns: 8px 1fr;
265
265
  }
266
- .awsui_drawer_12i0j_1ybif_189.awsui_drawer-expanded_12i0j_1ybif_238 > .awsui_global-drawer-wrapper_12i0j_1ybif_252 > .awsui_drawer-content-container_12i0j_1ybif_266:not(#\9) {
266
+ .awsui_drawer_12i0j_xh4dp_189.awsui_drawer-expanded_12i0j_xh4dp_238 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252 > .awsui_drawer-content-container_12i0j_xh4dp_266:not(#\9) {
267
267
  grid-column: 2;
268
268
  }
269
- .awsui_drawer_12i0j_1ybif_189.awsui_drawer-expanded_12i0j_1ybif_238 > .awsui_global-drawer-wrapper_12i0j_1ybif_252 > .awsui_drawer-gap_12i0j_1ybif_269:not(#\9) {
269
+ .awsui_drawer_12i0j_xh4dp_189.awsui_drawer-expanded_12i0j_xh4dp_238 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252 > .awsui_drawer-gap_12i0j_xh4dp_269:not(#\9) {
270
270
  grid-column: 1;
271
271
  grid-row: 1;
272
272
  block-size: 100%;
@@ -275,7 +275,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
275
275
  border-inline-end: var(--border-divider-section-width-sznrdy, 1px) solid var(--color-border-layout-gb61sp, #d5dbdb);
276
276
  }
277
277
  }
278
- .awsui_drawer_12i0j_1ybif_189 > .awsui_drawer-content-container_12i0j_1ybif_266:not(#\9) {
278
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_drawer-content-container_12i0j_xh4dp_266:not(#\9) {
279
279
  grid-column: 1/span 2;
280
280
  grid-row: 1;
281
281
  display: grid;
@@ -284,46 +284,46 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
284
284
  overflow-y: auto;
285
285
  min-inline-size: var(--awsui-drawer-size-xgujsu);
286
286
  }
287
- .awsui_drawer_12i0j_1ybif_189 > .awsui_drawer-content-container_12i0j_1ybif_266 > .awsui_drawer-close-button_12i0j_1ybif_287:not(#\9) {
287
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_drawer-content-container_12i0j_xh4dp_266 > .awsui_drawer-close-button_12i0j_xh4dp_287:not(#\9) {
288
288
  grid-column: 3;
289
289
  grid-row: 2;
290
290
  z-index: 1;
291
291
  align-self: start;
292
292
  }
293
- .awsui_drawer_12i0j_1ybif_189 > .awsui_drawer-content-container_12i0j_1ybif_266 > .awsui_drawer-expanded-mode-button_12i0j_1ybif_293:not(#\9) {
293
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_drawer-content-container_12i0j_xh4dp_266 > .awsui_drawer-expanded-mode-button_12i0j_xh4dp_293:not(#\9) {
294
294
  grid-column: 2;
295
295
  grid-row: 2;
296
296
  z-index: 1;
297
297
  align-self: start;
298
298
  display: flex;
299
- justify-content: end;
299
+ justify-content: flex-end;
300
300
  }
301
- .awsui_drawer_12i0j_1ybif_189 > .awsui_drawer-content-container_12i0j_1ybif_266 > .awsui_drawer-content_12i0j_1ybif_266:not(#\9) {
301
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_drawer-content-container_12i0j_xh4dp_266 > .awsui_drawer-content_12i0j_xh4dp_266:not(#\9) {
302
302
  grid-column: 1/span 4;
303
303
  grid-row: 1/span 2;
304
304
  }
305
- .awsui_drawer_12i0j_1ybif_189 > .awsui_drawer-content-container_12i0j_1ybif_266 > .awsui_drawer-content_12i0j_1ybif_266.awsui_drawer-content-hidden_12i0j_1ybif_305:not(#\9) {
305
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_drawer-content-container_12i0j_xh4dp_266 > .awsui_drawer-content_12i0j_xh4dp_266.awsui_drawer-content-hidden_12i0j_xh4dp_305:not(#\9) {
306
306
  display: none;
307
307
  }
308
- .awsui_drawer_12i0j_1ybif_189 > .awsui_drawer-slider_12i0j_1ybif_308:not(#\9) {
308
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_drawer-slider_12i0j_xh4dp_308:not(#\9) {
309
309
  grid-column: 1;
310
310
  grid-row: 1;
311
311
  block-size: 100%;
312
312
  display: flex;
313
313
  align-items: center;
314
314
  }
315
- .awsui_drawer_12i0j_1ybif_189 > .awsui_global-drawer-wrapper_12i0j_1ybif_252:not(#\9) {
315
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252:not(#\9) {
316
316
  display: grid;
317
317
  min-inline-size: var(--awsui-drawer-size-xgujsu);
318
318
  grid-template-columns: 8px var(--space-m-n2lypl, 16px) 1fr;
319
319
  overflow: hidden;
320
320
  }
321
321
  @media (max-width: 688px) {
322
- .awsui_drawer_12i0j_1ybif_189 > .awsui_global-drawer-wrapper_12i0j_1ybif_252:not(#\9) {
322
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252:not(#\9) {
323
323
  grid-template-columns: 1fr;
324
324
  }
325
325
  }
326
- .awsui_drawer_12i0j_1ybif_189 > .awsui_global-drawer-wrapper_12i0j_1ybif_252 > .awsui_drawer-gap_12i0j_1ybif_269:not(#\9) {
326
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252 > .awsui_drawer-gap_12i0j_xh4dp_269:not(#\9) {
327
327
  grid-column: 1;
328
328
  grid-row: 1;
329
329
  block-size: 100%;
@@ -331,13 +331,13 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
331
331
  background: var(--color-gap-global-drawer-lmfj7c, #eaeded);
332
332
  border-inline-end: var(--border-divider-section-width-sznrdy, 1px) solid var(--color-border-layout-gb61sp, #d5dbdb);
333
333
  }
334
- .awsui_drawer_12i0j_1ybif_189 > .awsui_global-drawer-wrapper_12i0j_1ybif_252 > .awsui_drawer-slider_12i0j_1ybif_308:not(#\9) {
334
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252 > .awsui_drawer-slider_12i0j_xh4dp_308:not(#\9) {
335
335
  grid-column: 2;
336
336
  grid-row: 1;
337
337
  display: flex;
338
338
  align-items: center;
339
339
  }
340
- .awsui_drawer_12i0j_1ybif_189 > .awsui_global-drawer-wrapper_12i0j_1ybif_252 > .awsui_drawer-content-container_12i0j_1ybif_266:not(#\9) {
340
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252 > .awsui_drawer-content-container_12i0j_xh4dp_266:not(#\9) {
341
341
  grid-row: 1;
342
342
  display: grid;
343
343
  grid-template-columns: var(--space-m-n2lypl, 16px) 1fr auto var(--space-m-n2lypl, 16px);
@@ -345,16 +345,16 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
345
345
  overflow-y: auto;
346
346
  }
347
347
  @media (min-width: 689px) {
348
- .awsui_drawer_12i0j_1ybif_189 > .awsui_global-drawer-wrapper_12i0j_1ybif_252 > .awsui_drawer-content-container_12i0j_1ybif_266:not(#\9) {
348
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252 > .awsui_drawer-content-container_12i0j_xh4dp_266:not(#\9) {
349
349
  grid-column: 2/span 2;
350
350
  }
351
351
  }
352
352
  @media (max-width: 688px) {
353
- .awsui_drawer_12i0j_1ybif_189 > .awsui_global-drawer-wrapper_12i0j_1ybif_252 > .awsui_drawer-content-container_12i0j_1ybif_266:not(#\9) {
353
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252 > .awsui_drawer-content-container_12i0j_xh4dp_266:not(#\9) {
354
354
  grid-column: 1/span 2;
355
355
  }
356
356
  }
357
- .awsui_drawer_12i0j_1ybif_189 > .awsui_global-drawer-wrapper_12i0j_1ybif_252 > .awsui_drawer-content-container_12i0j_1ybif_266 > .awsui_drawer-actions_12i0j_1ybif_357:not(#\9) {
357
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252 > .awsui_drawer-content-container_12i0j_xh4dp_266 > .awsui_drawer-actions_12i0j_xh4dp_357:not(#\9) {
358
358
  position: absolute;
359
359
  display: flex;
360
360
  align-self: flex-start;
@@ -362,24 +362,24 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
362
362
  padding-inline-end: var(--space-m-n2lypl, 16px);
363
363
  padding-block-start: 14px;
364
364
  }
365
- .awsui_drawer_12i0j_1ybif_189 > .awsui_global-drawer-wrapper_12i0j_1ybif_252 > .awsui_drawer-content-container_12i0j_1ybif_266 > .awsui_drawer-close-button_12i0j_1ybif_287:not(#\9) {
365
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252 > .awsui_drawer-content-container_12i0j_xh4dp_266 > .awsui_drawer-close-button_12i0j_xh4dp_287:not(#\9) {
366
366
  grid-column: 3;
367
367
  grid-row: 2;
368
368
  z-index: 1;
369
369
  align-self: start;
370
370
  }
371
- .awsui_drawer_12i0j_1ybif_189 > .awsui_global-drawer-wrapper_12i0j_1ybif_252 > .awsui_drawer-content-container_12i0j_1ybif_266 > .awsui_drawer-expanded-mode-button_12i0j_1ybif_293:not(#\9) {
371
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252 > .awsui_drawer-content-container_12i0j_xh4dp_266 > .awsui_drawer-expanded-mode-button_12i0j_xh4dp_293:not(#\9) {
372
372
  grid-column: 2;
373
373
  grid-row: 2;
374
374
  z-index: 1;
375
375
  align-self: start;
376
376
  display: flex;
377
- justify-content: end;
377
+ justify-content: flex-end;
378
378
  }
379
- .awsui_drawer_12i0j_1ybif_189 > .awsui_global-drawer-wrapper_12i0j_1ybif_252 > .awsui_drawer-content-container_12i0j_1ybif_266 > .awsui_drawer-content_12i0j_1ybif_266:not(#\9) {
379
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252 > .awsui_drawer-content-container_12i0j_xh4dp_266 > .awsui_drawer-content_12i0j_xh4dp_266:not(#\9) {
380
380
  grid-column: 1/span 4;
381
381
  grid-row: 1/span 2;
382
382
  }
383
- .awsui_drawer_12i0j_1ybif_189 > .awsui_global-drawer-wrapper_12i0j_1ybif_252 > .awsui_drawer-content-container_12i0j_1ybif_266 > .awsui_drawer-content_12i0j_1ybif_266.awsui_drawer-content-hidden_12i0j_1ybif_305:not(#\9) {
383
+ .awsui_drawer_12i0j_xh4dp_189 > .awsui_global-drawer-wrapper_12i0j_xh4dp_252 > .awsui_drawer-content-container_12i0j_xh4dp_266 > .awsui_drawer-content_12i0j_xh4dp_266.awsui_drawer-content-hidden_12i0j_xh4dp_305:not(#\9) {
384
384
  display: none;
385
385
  }
@@ -2,22 +2,22 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "drawer": "awsui_drawer_12i0j_1ybif_189",
6
- "with-expanded-motion": "awsui_with-expanded-motion_12i0j_1ybif_203",
7
- "legacy": "awsui_legacy_12i0j_1ybif_217",
8
- "last-opened": "awsui_last-opened_12i0j_1ybif_225",
9
- "drawer-global": "awsui_drawer-global_12i0j_1ybif_229",
10
- "drawer-expanded": "awsui_drawer-expanded_12i0j_1ybif_238",
11
- "drawer-hidden": "awsui_drawer-hidden_12i0j_1ybif_242",
12
- "has-next-siblings": "awsui_has-next-siblings_12i0j_1ybif_252",
13
- "global-drawer-wrapper": "awsui_global-drawer-wrapper_12i0j_1ybif_252",
14
- "drawer-content-container": "awsui_drawer-content-container_12i0j_1ybif_266",
15
- "drawer-gap": "awsui_drawer-gap_12i0j_1ybif_269",
16
- "drawer-close-button": "awsui_drawer-close-button_12i0j_1ybif_287",
17
- "drawer-expanded-mode-button": "awsui_drawer-expanded-mode-button_12i0j_1ybif_293",
18
- "drawer-content": "awsui_drawer-content_12i0j_1ybif_266",
19
- "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_1ybif_305",
20
- "drawer-slider": "awsui_drawer-slider_12i0j_1ybif_308",
21
- "drawer-actions": "awsui_drawer-actions_12i0j_1ybif_357"
5
+ "drawer": "awsui_drawer_12i0j_xh4dp_189",
6
+ "with-expanded-motion": "awsui_with-expanded-motion_12i0j_xh4dp_203",
7
+ "legacy": "awsui_legacy_12i0j_xh4dp_217",
8
+ "last-opened": "awsui_last-opened_12i0j_xh4dp_225",
9
+ "drawer-global": "awsui_drawer-global_12i0j_xh4dp_229",
10
+ "drawer-expanded": "awsui_drawer-expanded_12i0j_xh4dp_238",
11
+ "drawer-hidden": "awsui_drawer-hidden_12i0j_xh4dp_242",
12
+ "has-next-siblings": "awsui_has-next-siblings_12i0j_xh4dp_252",
13
+ "global-drawer-wrapper": "awsui_global-drawer-wrapper_12i0j_xh4dp_252",
14
+ "drawer-content-container": "awsui_drawer-content-container_12i0j_xh4dp_266",
15
+ "drawer-gap": "awsui_drawer-gap_12i0j_xh4dp_269",
16
+ "drawer-close-button": "awsui_drawer-close-button_12i0j_xh4dp_287",
17
+ "drawer-expanded-mode-button": "awsui_drawer-expanded-mode-button_12i0j_xh4dp_293",
18
+ "drawer-content": "awsui_drawer-content_12i0j_xh4dp_266",
19
+ "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_xh4dp_305",
20
+ "drawer-slider": "awsui_drawer-slider_12i0j_xh4dp_308",
21
+ "drawer-actions": "awsui_drawer-actions_12i0j_xh4dp_357"
22
22
  };
23
23
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/code-editor/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwE,MAAM,OAAO,CAAC;AAqB7F,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAqB/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FA2Qd,CAAC;AAGH,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/code-editor/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwE,MAAM,OAAO,CAAC;AAqB7F,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAqB/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FA+Qd,CAAC;AAGH,eAAe,UAAU,CAAC"}
@@ -43,6 +43,7 @@ const CodeEditor = forwardRef((props, ref) => {
43
43
  const isRefresh = useVisualRefresh();
44
44
  const baseProps = getBaseProps(rest);
45
45
  const i18n = useInternalI18n('code-editor');
46
+ const i18nModal = useInternalI18n('modal');
46
47
  const errorsTabRef = useRef(null);
47
48
  const warningsTabRef = useRef(null);
48
49
  const [codeEditorWidth, codeEditorMeasureRef] = useContainerQuery(rect => rect.contentBoxWidth);
@@ -144,6 +145,8 @@ const CodeEditor = forwardRef((props, ref) => {
144
145
  header: i18n('i18nStrings.preferencesModalHeader', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalHeader),
145
146
  cancel: i18n('i18nStrings.preferencesModalCancel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalCancel),
146
147
  confirm: i18n('i18nStrings.preferencesModalConfirm', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalConfirm),
148
+ close: i18nModal('closeAriaLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalCloseAriaLabel) ||
149
+ (i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalCancel),
147
150
  wrapLines: i18n('i18nStrings.preferencesModalWrapLines', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalWrapLines),
148
151
  theme: i18n('i18nStrings.preferencesModalTheme', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalTheme),
149
152
  lightThemes: i18n('i18nStrings.preferencesModalLightThemes', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalLightThemes),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/code-editor/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7F,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAA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AC;oBACvF,MAAM,EAAE,IAAI,CAAC,oCAAoC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,sBAAsB,CAAC;oBACvF,OAAO,EAAE,IAAI,CAAC,qCAAqC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,uBAAuB,CAAC;oBAC1F,SAAS,EAAE,IAAI,CAAC,uCAAuC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,yBAAyB,CAAC;oBAChG,KAAK,EAAE,IAAI,CAAC,mCAAmC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,qBAAqB,CAAC;oBACpF,WAAW,EAAE,IAAI,CAAC,yCAAyC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,2BAA2B,CAAC;oBACtG,UAAU,EAAE,IAAI,CAAC,wCAAwC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,0BAA0B,CAAC;oBACnG,uBAAuB,EAAE,IAAI,CAC3B,qDAAqD,EACrD,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,uCAAuC,CACrD;oBACD,yBAAyB,EAAE,IAAI,CAC7B,uDAAuD,EACvD,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,yCAAyC,CACvD;oBACD,4BAA4B,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,4CAA4C;iBACxF,GACD,CACH,CACA,CACJ,CACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAC3C,eAAe,UAAU,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Ace } from 'ace-builds';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useCurrentMode } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport InternalLiveRegion from '../live-region/internal';\nimport ErrorScreen from './error-screen';\nimport { CodeEditorProps } from './interfaces';\nimport { useChangeEffect } from './listeners';\nimport LoadingScreen from './loading-screen';\nimport { Pane } from './pane';\nimport PreferencesModal from './preferences-modal';\nimport { ResizableBox } from './resizable-box';\nimport { setupEditor } from './setup-editor';\nimport { StatusBar } from './status-bar';\nimport {\n useEditor,\n useSyncEditorLabels,\n useSyncEditorLanguage,\n useSyncEditorSize,\n useSyncEditorTheme,\n useSyncEditorValue,\n useSyncEditorWrapLines,\n} from './use-editor';\nimport { DEFAULT_AVAILABLE_THEMES, getDefaultTheme, getLanguageLabel, PaneStatus } from './util';\n\nimport styles from './styles.css.js';\n\nexport { CodeEditorProps };\n\nconst CodeEditor = forwardRef((props: CodeEditorProps, ref: React.Ref<CodeEditorProps.Ref>) => {\n const {\n ace,\n value,\n language,\n i18nStrings,\n editorContentHeight,\n onEditorContentResize,\n ariaLabel,\n languageLabel: customLanguageLabel,\n preferences,\n loading,\n themes,\n getModalRoot,\n removeModalRoot,\n ...rest\n } = props;\n const { __internalRootRef } = useBaseComponent('CodeEditor', { props: { language } });\n const { controlId, ariaLabelledby, ariaDescribedby } = useFormFieldContext(props);\n const [editorHeight = 480, setEditorHeight] = useControllable(editorContentHeight, onEditorContentResize, 480, {\n componentName: 'code-editor',\n changeHandler: 'onEditorContentResize',\n controlledProp: 'editorContentHeight',\n });\n const mode = useCurrentMode(__internalRootRef);\n const isRefresh = useVisualRefresh();\n const baseProps = getBaseProps(rest);\n const i18n = useInternalI18n('code-editor');\n\n const errorsTabRef = useRef<HTMLButtonElement>(null);\n const warningsTabRef = useRef<HTMLButtonElement>(null);\n const [codeEditorWidth, codeEditorMeasureRef] = useContainerQuery(rect => rect.contentBoxWidth);\n const mergedRef = useMergeRefs(codeEditorMeasureRef, __internalRootRef);\n\n const paneId = useUniqueId('code-editor-pane');\n\n const [paneStatus, setPaneStatus] = useState<PaneStatus>('hidden');\n const [annotations, setAnnotations] = useState<Ace.Annotation[]>([]);\n const [highlightedAnnotation, setHighlightedAnnotation] = useState<Ace.Annotation>();\n const [cursorPosition, setCursorPosition] = useState<Ace.Point>({ row: 0, column: 0 });\n const [isTabFocused, setTabFocused] = useState<boolean>(false);\n\n const { editorRef, editor } = useEditor(ace, themes, loading);\n\n useForwardFocus(ref, editorRef);\n\n useEffect(() => {\n if (!ace || !editor) {\n return;\n }\n\n setupEditor(ace, editor, setAnnotations, setCursorPosition, setHighlightedAnnotation, setPaneStatus);\n\n return () => {\n editor?.destroy();\n };\n }, [ace, editor]);\n\n useSyncEditorLabels(editor, { controlId, ariaLabel, ariaLabelledby, ariaDescribedby });\n\n const { onResize } = useSyncEditorSize(editor, { width: codeEditorWidth, height: editorContentHeight });\n\n useSyncEditorValue(editor, value);\n\n useSyncEditorLanguage(editor, language);\n\n useSyncEditorWrapLines(editor, preferences?.wrapLines);\n\n const defaultTheme = getDefaultTheme(mode, themes);\n useSyncEditorTheme(editor, preferences?.theme ?? defaultTheme);\n\n // Change listeners\n useChangeEffect(editor, props.onChange, props.onDelayedChange);\n\n // Hide error panel when there are no errors to show.\n useEffect(() => {\n if (annotations.length === 0) {\n setPaneStatus('hidden');\n }\n\n if (props.onValidate) {\n fireNonCancelableEvent(props.onValidate, { annotations });\n }\n }, [annotations, props.onValidate]);\n\n const languageLabel = customLanguageLabel ?? getLanguageLabel(language);\n\n const errorCount = annotations.filter(a => a.type === 'error').length;\n const warningCount = annotations.filter(a => a.type === 'warning').length;\n const currentAnnotations = useMemo(() => annotations.filter(a => a.type === paneStatus), [annotations, paneStatus]);\n\n /*\n * Callbacks\n */\n\n const onEditorKeydown = useCallback(\n (e: React.KeyboardEvent) => {\n if (editor && e.target === editor.container && e.keyCode === KeyCode.enter) {\n e.stopPropagation();\n e.preventDefault();\n editor.focus();\n }\n },\n [editor]\n );\n\n const onTabFocus = useCallback(() => setTabFocused(true), []);\n const onTabBlur = useCallback(() => setTabFocused(false), []);\n\n const onErrorPaneToggle = useCallback(() => {\n setPaneStatus(paneStatus !== 'error' ? 'error' : 'hidden');\n }, [paneStatus]);\n\n const onWarningPaneToggle = useCallback(() => {\n setPaneStatus(paneStatus !== 'warning' ? 'warning' : 'hidden');\n }, [paneStatus]);\n\n const onPaneClose = () => {\n setPaneStatus('hidden');\n };\n\n const onAnnotationClick = ({ row = 0, column = 0 }: Ace.Annotation) => {\n if (!editor) {\n return;\n }\n editor.focus();\n editor.gotoLine(row + 1, column, false);\n setHighlightedAnnotation(undefined);\n };\n\n const onAnnotationClear = useCallback(() => {\n setHighlightedAnnotation(undefined);\n }, []);\n\n const [isPreferencesModalVisible, setPreferencesModalVisible] = useState(false);\n const onPreferencesOpen = () => setPreferencesModalVisible(true);\n const onPreferencesConfirm = (p: CodeEditorProps.Preferences) => {\n fireNonCancelableEvent(props.onPreferencesChange, p);\n setPreferencesModalVisible(false);\n };\n const onPreferencesDismiss = () => setPreferencesModalVisible(false);\n\n const isPaneVisible = paneStatus !== 'hidden';\n\n return (\n <div\n {...baseProps}\n className={clsx(styles['code-editor'], baseProps.className, { [styles['code-editor-refresh']]: isRefresh })}\n ref={mergedRef}\n >\n {loading && (\n <LoadingScreen>\n <InternalLiveRegion tagName=\"span\">\n {i18n('i18nStrings.loadingState', i18nStrings?.loadingState)}\n </InternalLiveRegion>\n </LoadingScreen>\n )}\n\n {!ace && !loading && (\n <ErrorScreen\n recoveryText={i18n('i18nStrings.errorStateRecovery', i18nStrings?.errorStateRecovery)}\n onRecoveryClick={props.onRecoveryClick}\n >\n {i18n('i18nStrings.errorState', i18nStrings?.errorState)}\n </ErrorScreen>\n )}\n\n {ace && !loading && (\n <>\n <ResizableBox\n height={Math.max(editorHeight, 20)}\n minHeight={20}\n onResize={height => {\n setEditorHeight(height);\n onResize();\n fireNonCancelableEvent(onEditorContentResize, { height });\n }}\n handleAriaLabel={i18n('i18nStrings.resizeHandleAriaLabel', i18nStrings?.resizeHandleAriaLabel)}\n handleTooltipText={i18n('i18nStrings.resizeHandleTooltipText', i18nStrings?.resizeHandleTooltipText)}\n >\n <div\n ref={editorRef}\n className={clsx(styles.editor, styles.ace, isRefresh && styles['editor-refresh'])}\n onKeyDown={onEditorKeydown}\n tabIndex={0}\n role=\"group\"\n aria-label={i18n('i18nStrings.editorGroupAriaLabel', i18nStrings?.editorGroupAriaLabel)}\n />\n </ResizableBox>\n <div\n role=\"group\"\n aria-label={i18n('i18nStrings.statusBarGroupAriaLabel', i18nStrings?.statusBarGroupAriaLabel)}\n >\n <StatusBar\n languageLabel={languageLabel}\n cursorPosition={i18n(\n 'i18nStrings.cursorPosition',\n i18nStrings?.cursorPosition?.(cursorPosition.row + 1, cursorPosition.column + 1),\n format => format({ row: cursorPosition.row + 1, column: cursorPosition.column + 1 })\n )}\n errorCount={errorCount}\n warningCount={warningCount}\n paneStatus={paneStatus}\n onErrorPaneToggle={onErrorPaneToggle}\n onWarningPaneToggle={onWarningPaneToggle}\n onTabFocus={onTabFocus}\n onTabBlur={onTabBlur}\n errorsTabRef={errorsTabRef}\n warningsTabRef={warningsTabRef}\n i18nStrings={i18nStrings}\n isTabFocused={isTabFocused}\n paneId={isPaneVisible ? paneId : undefined}\n onPreferencesOpen={onPreferencesOpen}\n isRefresh={isRefresh}\n />\n <Pane\n id={paneId}\n paneStatus={paneStatus}\n visible={isPaneVisible}\n annotations={currentAnnotations}\n highlighted={highlightedAnnotation}\n onAnnotationClick={onAnnotationClick}\n onAnnotationClear={onAnnotationClear}\n onClose={onPaneClose}\n cursorPositionLabel={i18n(\n 'i18nStrings.cursorPosition',\n i18nStrings?.cursorPosition,\n format => (row, column) => format({ row, column })\n )}\n closeButtonAriaLabel={i18n('i18nStrings.paneCloseButtonAriaLabel', i18nStrings?.paneCloseButtonAriaLabel)}\n handleAriaLabel={i18n('i18nStrings.resizeHandleAriaLabel', i18nStrings?.resizeHandleAriaLabel)}\n handleTooltipText={i18n('i18nStrings.resizeHandleTooltipText', i18nStrings?.resizeHandleTooltipText)}\n />\n </div>\n {isPreferencesModalVisible && (\n <PreferencesModal\n getModalRoot={getModalRoot}\n removeModalRoot={removeModalRoot}\n onConfirm={onPreferencesConfirm}\n onDismiss={onPreferencesDismiss}\n themes={themes ?? DEFAULT_AVAILABLE_THEMES}\n preferences={preferences}\n defaultTheme={defaultTheme}\n i18nStrings={{\n header: i18n('i18nStrings.preferencesModalHeader', i18nStrings?.preferencesModalHeader),\n cancel: i18n('i18nStrings.preferencesModalCancel', i18nStrings?.preferencesModalCancel),\n confirm: i18n('i18nStrings.preferencesModalConfirm', i18nStrings?.preferencesModalConfirm),\n wrapLines: i18n('i18nStrings.preferencesModalWrapLines', i18nStrings?.preferencesModalWrapLines),\n theme: i18n('i18nStrings.preferencesModalTheme', i18nStrings?.preferencesModalTheme),\n lightThemes: i18n('i18nStrings.preferencesModalLightThemes', i18nStrings?.preferencesModalLightThemes),\n darkThemes: i18n('i18nStrings.preferencesModalDarkThemes', i18nStrings?.preferencesModalDarkThemes),\n themeFilteringAriaLabel: i18n(\n 'i18nStrings.preferencesModalThemeFilteringAriaLabel',\n i18nStrings?.preferencesModalThemeFilteringAriaLabel\n ),\n themeFilteringPlaceholder: i18n(\n 'i18nStrings.preferencesModalThemeFilteringPlaceholder',\n i18nStrings?.preferencesModalThemeFilteringPlaceholder\n ),\n themeFilteringClearAriaLabel: i18nStrings?.preferencesModalThemeFilteringClearAriaLabel,\n }}\n />\n )}\n </>\n )}\n </div>\n );\n});\n\napplyDisplayName(CodeEditor, 'CodeEditor');\nexport default CodeEditor;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/code-editor/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7F,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,aAAa,MAAM,kBAAkB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reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Ace } from 'ace-builds';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useCurrentMode } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport InternalLiveRegion from '../live-region/internal';\nimport ErrorScreen from './error-screen';\nimport { CodeEditorProps } from './interfaces';\nimport { useChangeEffect } from './listeners';\nimport LoadingScreen from './loading-screen';\nimport { Pane } from './pane';\nimport PreferencesModal from './preferences-modal';\nimport { ResizableBox } from './resizable-box';\nimport { setupEditor } from './setup-editor';\nimport { StatusBar } from './status-bar';\nimport {\n useEditor,\n useSyncEditorLabels,\n useSyncEditorLanguage,\n useSyncEditorSize,\n useSyncEditorTheme,\n useSyncEditorValue,\n useSyncEditorWrapLines,\n} from './use-editor';\nimport { DEFAULT_AVAILABLE_THEMES, getDefaultTheme, getLanguageLabel, PaneStatus } from './util';\n\nimport styles from './styles.css.js';\n\nexport { CodeEditorProps };\n\nconst CodeEditor = forwardRef((props: CodeEditorProps, ref: React.Ref<CodeEditorProps.Ref>) => {\n const {\n ace,\n value,\n language,\n i18nStrings,\n editorContentHeight,\n onEditorContentResize,\n ariaLabel,\n languageLabel: customLanguageLabel,\n preferences,\n loading,\n themes,\n getModalRoot,\n removeModalRoot,\n ...rest\n } = props;\n const { __internalRootRef } = useBaseComponent('CodeEditor', { props: { language } });\n const { controlId, ariaLabelledby, ariaDescribedby } = useFormFieldContext(props);\n const [editorHeight = 480, setEditorHeight] = useControllable(editorContentHeight, onEditorContentResize, 480, {\n componentName: 'code-editor',\n changeHandler: 'onEditorContentResize',\n controlledProp: 'editorContentHeight',\n });\n const mode = useCurrentMode(__internalRootRef);\n const isRefresh = useVisualRefresh();\n const baseProps = getBaseProps(rest);\n const i18n = useInternalI18n('code-editor');\n const i18nModal = useInternalI18n('modal');\n\n const errorsTabRef = useRef<HTMLButtonElement>(null);\n const warningsTabRef = useRef<HTMLButtonElement>(null);\n const [codeEditorWidth, codeEditorMeasureRef] = useContainerQuery(rect => rect.contentBoxWidth);\n const mergedRef = useMergeRefs(codeEditorMeasureRef, __internalRootRef);\n\n const paneId = useUniqueId('code-editor-pane');\n\n const [paneStatus, setPaneStatus] = useState<PaneStatus>('hidden');\n const [annotations, setAnnotations] = useState<Ace.Annotation[]>([]);\n const [highlightedAnnotation, setHighlightedAnnotation] = useState<Ace.Annotation>();\n const [cursorPosition, setCursorPosition] = useState<Ace.Point>({ row: 0, column: 0 });\n const [isTabFocused, setTabFocused] = useState<boolean>(false);\n\n const { editorRef, editor } = useEditor(ace, themes, loading);\n\n useForwardFocus(ref, editorRef);\n\n useEffect(() => {\n if (!ace || !editor) {\n return;\n }\n\n setupEditor(ace, editor, setAnnotations, setCursorPosition, setHighlightedAnnotation, setPaneStatus);\n\n return () => {\n editor?.destroy();\n };\n }, [ace, editor]);\n\n useSyncEditorLabels(editor, { controlId, ariaLabel, ariaLabelledby, ariaDescribedby });\n\n const { onResize } = useSyncEditorSize(editor, { width: codeEditorWidth, height: editorContentHeight });\n\n useSyncEditorValue(editor, value);\n\n useSyncEditorLanguage(editor, language);\n\n useSyncEditorWrapLines(editor, preferences?.wrapLines);\n\n const defaultTheme = getDefaultTheme(mode, themes);\n useSyncEditorTheme(editor, preferences?.theme ?? defaultTheme);\n\n // Change listeners\n useChangeEffect(editor, props.onChange, props.onDelayedChange);\n\n // Hide error panel when there are no errors to show.\n useEffect(() => {\n if (annotations.length === 0) {\n setPaneStatus('hidden');\n }\n\n if (props.onValidate) {\n fireNonCancelableEvent(props.onValidate, { annotations });\n }\n }, [annotations, props.onValidate]);\n\n const languageLabel = customLanguageLabel ?? getLanguageLabel(language);\n\n const errorCount = annotations.filter(a => a.type === 'error').length;\n const warningCount = annotations.filter(a => a.type === 'warning').length;\n const currentAnnotations = useMemo(() => annotations.filter(a => a.type === paneStatus), [annotations, paneStatus]);\n\n /*\n * Callbacks\n */\n\n const onEditorKeydown = useCallback(\n (e: React.KeyboardEvent) => {\n if (editor && e.target === editor.container && e.keyCode === KeyCode.enter) {\n e.stopPropagation();\n e.preventDefault();\n editor.focus();\n }\n },\n [editor]\n );\n\n const onTabFocus = useCallback(() => setTabFocused(true), []);\n const onTabBlur = useCallback(() => setTabFocused(false), []);\n\n const onErrorPaneToggle = useCallback(() => {\n setPaneStatus(paneStatus !== 'error' ? 'error' : 'hidden');\n }, [paneStatus]);\n\n const onWarningPaneToggle = useCallback(() => {\n setPaneStatus(paneStatus !== 'warning' ? 'warning' : 'hidden');\n }, [paneStatus]);\n\n const onPaneClose = () => {\n setPaneStatus('hidden');\n };\n\n const onAnnotationClick = ({ row = 0, column = 0 }: Ace.Annotation) => {\n if (!editor) {\n return;\n }\n editor.focus();\n editor.gotoLine(row + 1, column, false);\n setHighlightedAnnotation(undefined);\n };\n\n const onAnnotationClear = useCallback(() => {\n setHighlightedAnnotation(undefined);\n }, []);\n\n const [isPreferencesModalVisible, setPreferencesModalVisible] = useState(false);\n const onPreferencesOpen = () => setPreferencesModalVisible(true);\n const onPreferencesConfirm = (p: CodeEditorProps.Preferences) => {\n fireNonCancelableEvent(props.onPreferencesChange, p);\n setPreferencesModalVisible(false);\n };\n const onPreferencesDismiss = () => setPreferencesModalVisible(false);\n\n const isPaneVisible = paneStatus !== 'hidden';\n\n return (\n <div\n {...baseProps}\n className={clsx(styles['code-editor'], baseProps.className, { [styles['code-editor-refresh']]: isRefresh })}\n ref={mergedRef}\n >\n {loading && (\n <LoadingScreen>\n <InternalLiveRegion tagName=\"span\">\n {i18n('i18nStrings.loadingState', i18nStrings?.loadingState)}\n </InternalLiveRegion>\n </LoadingScreen>\n )}\n\n {!ace && !loading && (\n <ErrorScreen\n recoveryText={i18n('i18nStrings.errorStateRecovery', i18nStrings?.errorStateRecovery)}\n onRecoveryClick={props.onRecoveryClick}\n >\n {i18n('i18nStrings.errorState', i18nStrings?.errorState)}\n </ErrorScreen>\n )}\n\n {ace && !loading && (\n <>\n <ResizableBox\n height={Math.max(editorHeight, 20)}\n minHeight={20}\n onResize={height => {\n setEditorHeight(height);\n onResize();\n fireNonCancelableEvent(onEditorContentResize, { height });\n }}\n handleAriaLabel={i18n('i18nStrings.resizeHandleAriaLabel', i18nStrings?.resizeHandleAriaLabel)}\n handleTooltipText={i18n('i18nStrings.resizeHandleTooltipText', i18nStrings?.resizeHandleTooltipText)}\n >\n <div\n ref={editorRef}\n className={clsx(styles.editor, styles.ace, isRefresh && styles['editor-refresh'])}\n onKeyDown={onEditorKeydown}\n tabIndex={0}\n role=\"group\"\n aria-label={i18n('i18nStrings.editorGroupAriaLabel', i18nStrings?.editorGroupAriaLabel)}\n />\n </ResizableBox>\n <div\n role=\"group\"\n aria-label={i18n('i18nStrings.statusBarGroupAriaLabel', i18nStrings?.statusBarGroupAriaLabel)}\n >\n <StatusBar\n languageLabel={languageLabel}\n cursorPosition={i18n(\n 'i18nStrings.cursorPosition',\n i18nStrings?.cursorPosition?.(cursorPosition.row + 1, cursorPosition.column + 1),\n format => format({ row: cursorPosition.row + 1, column: cursorPosition.column + 1 })\n )}\n errorCount={errorCount}\n warningCount={warningCount}\n paneStatus={paneStatus}\n onErrorPaneToggle={onErrorPaneToggle}\n onWarningPaneToggle={onWarningPaneToggle}\n onTabFocus={onTabFocus}\n onTabBlur={onTabBlur}\n errorsTabRef={errorsTabRef}\n warningsTabRef={warningsTabRef}\n i18nStrings={i18nStrings}\n isTabFocused={isTabFocused}\n paneId={isPaneVisible ? paneId : undefined}\n onPreferencesOpen={onPreferencesOpen}\n isRefresh={isRefresh}\n />\n <Pane\n id={paneId}\n paneStatus={paneStatus}\n visible={isPaneVisible}\n annotations={currentAnnotations}\n highlighted={highlightedAnnotation}\n onAnnotationClick={onAnnotationClick}\n onAnnotationClear={onAnnotationClear}\n onClose={onPaneClose}\n cursorPositionLabel={i18n(\n 'i18nStrings.cursorPosition',\n i18nStrings?.cursorPosition,\n format => (row, column) => format({ row, column })\n )}\n closeButtonAriaLabel={i18n('i18nStrings.paneCloseButtonAriaLabel', i18nStrings?.paneCloseButtonAriaLabel)}\n handleAriaLabel={i18n('i18nStrings.resizeHandleAriaLabel', i18nStrings?.resizeHandleAriaLabel)}\n handleTooltipText={i18n('i18nStrings.resizeHandleTooltipText', i18nStrings?.resizeHandleTooltipText)}\n />\n </div>\n {isPreferencesModalVisible && (\n <PreferencesModal\n getModalRoot={getModalRoot}\n removeModalRoot={removeModalRoot}\n onConfirm={onPreferencesConfirm}\n onDismiss={onPreferencesDismiss}\n themes={themes ?? DEFAULT_AVAILABLE_THEMES}\n preferences={preferences}\n defaultTheme={defaultTheme}\n i18nStrings={{\n header: i18n('i18nStrings.preferencesModalHeader', i18nStrings?.preferencesModalHeader),\n cancel: i18n('i18nStrings.preferencesModalCancel', i18nStrings?.preferencesModalCancel),\n confirm: i18n('i18nStrings.preferencesModalConfirm', i18nStrings?.preferencesModalConfirm),\n close:\n i18nModal('closeAriaLabel', i18nStrings?.preferencesModalCloseAriaLabel) ||\n i18nStrings?.preferencesModalCancel,\n wrapLines: i18n('i18nStrings.preferencesModalWrapLines', i18nStrings?.preferencesModalWrapLines),\n theme: i18n('i18nStrings.preferencesModalTheme', i18nStrings?.preferencesModalTheme),\n lightThemes: i18n('i18nStrings.preferencesModalLightThemes', i18nStrings?.preferencesModalLightThemes),\n darkThemes: i18n('i18nStrings.preferencesModalDarkThemes', i18nStrings?.preferencesModalDarkThemes),\n themeFilteringAriaLabel: i18n(\n 'i18nStrings.preferencesModalThemeFilteringAriaLabel',\n i18nStrings?.preferencesModalThemeFilteringAriaLabel\n ),\n themeFilteringPlaceholder: i18n(\n 'i18nStrings.preferencesModalThemeFilteringPlaceholder',\n i18nStrings?.preferencesModalThemeFilteringPlaceholder\n ),\n themeFilteringClearAriaLabel: i18nStrings?.preferencesModalThemeFilteringClearAriaLabel,\n }}\n />\n )}\n </>\n )}\n </div>\n );\n});\n\napplyDisplayName(CodeEditor, 'CodeEditor');\nexport default CodeEditor;\n"]}
@@ -130,6 +130,7 @@ export declare namespace CodeEditorProps {
130
130
  preferencesModalHeader?: string;
131
131
  preferencesModalCancel?: string;
132
132
  preferencesModalConfirm?: string;
133
+ preferencesModalCloseAriaLabel?: string;
133
134
  preferencesModalWrapLines?: string;
134
135
  preferencesModalTheme?: string;
135
136
  preferencesModalLightThemes?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/code-editor/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,WAAW,eAAgB,SAAQ,kBAAkB,EAAE,qBAAqB,EAAE,cAAc;IAChG;;OAEG;IACH,GAAG,EAAE,GAAG,CAAC;IAET;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;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iB,YAAY;QAC3B,KAAK,EAAE,MAAM,CAAC;KACf;IAED,UAAiB,cAAc;QAC7B,WAAW,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC;KAC/B;IAED,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/code-editor/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Ace } from 'ace-builds';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { BaseModalProps } from '../modal/interfaces';\nimport { AceModes } from './ace-modes';\nimport { DarkThemes, LightThemes } from './ace-themes';\n\nexport interface CodeEditorProps extends BaseComponentProps, FormFieldControlProps, BaseModalProps {\n /**\n * The ace object.\n */\n ace: any;\n\n /**\n * Specifies the content that's displayed in the code editor.\n */\n value: string;\n\n /**\n * Specifies the programming language. You can use any of the programming languages supported by the `ace` object that you provide.\n * Alternatively, this can be used to set a language that is not supported by the default `language` list. Make sure you've added the highlighting support for this language to the Ace instance.\n * For more info on custom languages, see the [Code editor API](/components/code-editor?tabId=api) page.\n */\n language: CodeEditorProps.Language;\n\n /**\n * Specifies a custom label language. If set, it overrides the default language label.\n */\n languageLabel?: string;\n\n /**\n * An event handler called when the value changes.\n * The event `detail` contains the current value of the code editor content.\n * **Deprecated** Replaced by `onDelayedChange`.\n */\n onChange?: NonCancelableEventHandler<CodeEditorProps.ChangeDetail>;\n\n /**\n * An event handler called when the value changes.\n * The event `detail` contains the current value of the code editor content.\n * A user interaction can cause multiple change events to be emitted by the Ace editor. They are batched together into a single `onDelayedChange` event to avoid bugs when controlling the `value` field.\n */\n onDelayedChange?: NonCancelableEventHandler<CodeEditorProps.ChangeDetail>;\n\n /**\n * Annotations returned from Ace syntax checker after code validation.\n */\n onValidate?: NonCancelableEventHandler<CodeEditorProps.ValidateDetail>;\n\n /**\n * Specifies the component preferences.\n *\n * If set to `undefined`, the component uses the following default value:\n *\n * ```\n * {\n * wrapLines: true,\n * theme: 'dawn'\n * }\n * ```\n *\n * You can use any theme provided by Ace.\n */\n preferences?: Partial<CodeEditorProps.Preferences>;\n\n /**\n * List of Ace themes available for selection in preferences dialog. Make sure you include at least one light and at\n * least one dark theme. If not set explicitly, it will render all Ace themes available for selection, except\n * \"cloud_editor\" and \"cloud_editor_dark\".\n */\n themes?: CodeEditorProps.AvailableThemes;\n\n /**\n * Called when any of the preferences change.\n * The event `detail` contains the value of all the preferences as submitted by the user.\n *\n */\n onPreferencesChange: NonCancelableEventHandler<CodeEditorProps.Preferences>;\n\n /**\n * Renders the code editor in a loading state.\n */\n loading?: boolean;\n\n /**\n * Called when the user clicks the recovery button in the error state.\n * Use this to retry loading the code editor or to provide another option for the user to recover from the error.\n */\n onRecoveryClick?: NonCancelableEventHandler<void>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * The object should contain, among others:\n *\n * * `loadingState` - Specifies the text to display while the component is loading.\n * * `errorState` - Specifies the text to display if there is an error loading Ace.\n * * `errorStateRecovery`: Specifies the text for the recovery button that's displayed next to the error text.\n * Use the `recoveryClick` event to do a recovery action (for example, retrying the request).\n * @i18n\n */\n i18nStrings?: CodeEditorProps.I18nStrings;\n\n /**\n * Specifies the height of the code editor document.\n */\n editorContentHeight?: number;\n\n /**\n * Called when the user resizes the editor by dragging the resize icon.\n * The event `detail` contains the new height of the editor in pixels.\n */\n onEditorContentResize?: NonCancelableEventHandler<CodeEditorProps.ResizeDetail>;\n\n /**\n * Adds `aria-label` to the code editor's textarea element.\n */\n ariaLabel?: string;\n}\n\n// Prevents typescript from collapsing a string union type into a string type while still allowing any string.\n// This leads to more helpful editor suggestions for known values.\n// See: https://github.com/microsoft/TypeScript/issues/29729\ntype LiteralUnion<LiteralType, BaseType extends string> = LiteralType | (BaseType & { _?: never });\n\ntype BuiltInLanguage = (typeof AceModes)[number]['value'];\n\nexport namespace CodeEditorProps {\n export type Language = LiteralUnion<BuiltInLanguage, string>;\n export type Theme = (typeof LightThemes)[number]['value'] | (typeof DarkThemes)[number]['value'];\n\n export interface AvailableThemes {\n light: ReadonlyArray<string>;\n dark: ReadonlyArray<string>;\n }\n\n export interface Preferences {\n wrapLines: boolean;\n theme: Theme;\n }\n\n export interface I18nStrings {\n loadingState?: string;\n errorState?: string;\n errorStateRecovery?: string;\n\n editorGroupAriaLabel?: string;\n statusBarGroupAriaLabel?: string;\n\n cursorPosition?: (row: number, column: number) => string;\n errorsTab?: string;\n warningsTab?: string;\n preferencesButtonAriaLabel?: string;\n paneCloseButtonAriaLabel?: string;\n\n preferencesModalHeader?: string;\n preferencesModalCancel?: string;\n preferencesModalConfirm?: string;\n preferencesModalWrapLines?: string;\n preferencesModalTheme?: string;\n preferencesModalLightThemes?: string;\n preferencesModalDarkThemes?: string;\n\n preferencesModalThemeFilteringPlaceholder?: string;\n preferencesModalThemeFilteringAriaLabel?: string;\n preferencesModalThemeFilteringClearAriaLabel?: string;\n\n resizeHandleAriaLabel?: string;\n resizeHandleTooltipText?: string;\n }\n export interface ResizeDetail {\n height: number;\n }\n export interface ChangeDetail {\n value: string;\n }\n\n export interface ValidateDetail {\n annotations: Ace.Annotation[];\n }\n\n export interface Ref {\n /**\n * Sets input focus onto the code editor control.\n */\n focus(): void;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/code-editor/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Ace } from 'ace-builds';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { BaseModalProps } from '../modal/interfaces';\nimport { AceModes } from './ace-modes';\nimport { DarkThemes, LightThemes } from './ace-themes';\n\nexport interface CodeEditorProps extends BaseComponentProps, FormFieldControlProps, BaseModalProps {\n /**\n * The ace object.\n */\n ace: any;\n\n /**\n * Specifies the content that's displayed in the code editor.\n */\n value: string;\n\n /**\n * Specifies the programming language. You can use any of the programming languages supported by the `ace` object that you provide.\n * Alternatively, this can be used to set a language that is not supported by the default `language` list. Make sure you've added the highlighting support for this language to the Ace instance.\n * For more info on custom languages, see the [Code editor API](/components/code-editor?tabId=api) page.\n */\n language: CodeEditorProps.Language;\n\n /**\n * Specifies a custom label language. If set, it overrides the default language label.\n */\n languageLabel?: string;\n\n /**\n * An event handler called when the value changes.\n * The event `detail` contains the current value of the code editor content.\n * **Deprecated** Replaced by `onDelayedChange`.\n */\n onChange?: NonCancelableEventHandler<CodeEditorProps.ChangeDetail>;\n\n /**\n * An event handler called when the value changes.\n * The event `detail` contains the current value of the code editor content.\n * A user interaction can cause multiple change events to be emitted by the Ace editor. They are batched together into a single `onDelayedChange` event to avoid bugs when controlling the `value` field.\n */\n onDelayedChange?: NonCancelableEventHandler<CodeEditorProps.ChangeDetail>;\n\n /**\n * Annotations returned from Ace syntax checker after code validation.\n */\n onValidate?: NonCancelableEventHandler<CodeEditorProps.ValidateDetail>;\n\n /**\n * Specifies the component preferences.\n *\n * If set to `undefined`, the component uses the following default value:\n *\n * ```\n * {\n * wrapLines: true,\n * theme: 'dawn'\n * }\n * ```\n *\n * You can use any theme provided by Ace.\n */\n preferences?: Partial<CodeEditorProps.Preferences>;\n\n /**\n * List of Ace themes available for selection in preferences dialog. Make sure you include at least one light and at\n * least one dark theme. If not set explicitly, it will render all Ace themes available for selection, except\n * \"cloud_editor\" and \"cloud_editor_dark\".\n */\n themes?: CodeEditorProps.AvailableThemes;\n\n /**\n * Called when any of the preferences change.\n * The event `detail` contains the value of all the preferences as submitted by the user.\n *\n */\n onPreferencesChange: NonCancelableEventHandler<CodeEditorProps.Preferences>;\n\n /**\n * Renders the code editor in a loading state.\n */\n loading?: boolean;\n\n /**\n * Called when the user clicks the recovery button in the error state.\n * Use this to retry loading the code editor or to provide another option for the user to recover from the error.\n */\n onRecoveryClick?: NonCancelableEventHandler<void>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * The object should contain, among others:\n *\n * * `loadingState` - Specifies the text to display while the component is loading.\n * * `errorState` - Specifies the text to display if there is an error loading Ace.\n * * `errorStateRecovery`: Specifies the text for the recovery button that's displayed next to the error text.\n * Use the `recoveryClick` event to do a recovery action (for example, retrying the request).\n * @i18n\n */\n i18nStrings?: CodeEditorProps.I18nStrings;\n\n /**\n * Specifies the height of the code editor document.\n */\n editorContentHeight?: number;\n\n /**\n * Called when the user resizes the editor by dragging the resize icon.\n * The event `detail` contains the new height of the editor in pixels.\n */\n onEditorContentResize?: NonCancelableEventHandler<CodeEditorProps.ResizeDetail>;\n\n /**\n * Adds `aria-label` to the code editor's textarea element.\n */\n ariaLabel?: string;\n}\n\n// Prevents typescript from collapsing a string union type into a string type while still allowing any string.\n// This leads to more helpful editor suggestions for known values.\n// See: https://github.com/microsoft/TypeScript/issues/29729\ntype LiteralUnion<LiteralType, BaseType extends string> = LiteralType | (BaseType & { _?: never });\n\ntype BuiltInLanguage = (typeof AceModes)[number]['value'];\n\nexport namespace CodeEditorProps {\n export type Language = LiteralUnion<BuiltInLanguage, string>;\n export type Theme = (typeof LightThemes)[number]['value'] | (typeof DarkThemes)[number]['value'];\n\n export interface AvailableThemes {\n light: ReadonlyArray<string>;\n dark: ReadonlyArray<string>;\n }\n\n export interface Preferences {\n wrapLines: boolean;\n theme: Theme;\n }\n\n export interface I18nStrings {\n loadingState?: string;\n errorState?: string;\n errorStateRecovery?: string;\n\n editorGroupAriaLabel?: string;\n statusBarGroupAriaLabel?: string;\n\n cursorPosition?: (row: number, column: number) => string;\n errorsTab?: string;\n warningsTab?: string;\n preferencesButtonAriaLabel?: string;\n paneCloseButtonAriaLabel?: string;\n\n preferencesModalHeader?: string;\n preferencesModalCancel?: string;\n preferencesModalConfirm?: string;\n preferencesModalCloseAriaLabel?: string;\n preferencesModalWrapLines?: string;\n preferencesModalTheme?: string;\n preferencesModalLightThemes?: string;\n preferencesModalDarkThemes?: string;\n\n preferencesModalThemeFilteringPlaceholder?: string;\n preferencesModalThemeFilteringAriaLabel?: string;\n preferencesModalThemeFilteringClearAriaLabel?: string;\n\n resizeHandleAriaLabel?: string;\n resizeHandleTooltipText?: string;\n }\n export interface ResizeDetail {\n height: number;\n }\n export interface ChangeDetail {\n value: string;\n }\n\n export interface ValidateDetail {\n annotations: Ace.Annotation[];\n }\n\n export interface Ref {\n /**\n * Sets input focus onto the code editor control.\n */\n focus(): void;\n }\n}\n"]}
@@ -4,6 +4,7 @@ interface PreferencesModali18nStrings {
4
4
  header?: string;
5
5
  cancel?: string;
6
6
  confirm?: string;
7
+ close?: string;
7
8
  wrapLines?: string;
8
9
  theme?: string;
9
10
  lightThemes?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"preferences-modal.d.ts","sourceRoot":"","sources":["../../../src/code-editor/preferences-modal.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,UAAU,2BAA2B;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC;AAED,UAAU,qBAAqB;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IACnD,YAA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AEpC,SAAS,EAAE,CAAC,WAAW,EAAE,eAAe,CAAC,WAAW,KAAK,IAAI,CAAC;IAC9D,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;gCAMsB,qBAAqB;AAA5C,wBAgEE"}
@@ -32,7 +32,7 @@ export default (props) => {
32
32
  setTheme(e.detail.selectedOption.value);
33
33
  setSelectedThemeOption(e.detail.selectedOption);
34
34
  };
35
- return (React.createElement(InternalModal, { size: "medium", visible: true, getModalRoot: props.getModalRoot, removeModalRoot: props.removeModalRoot, onDismiss: props.onDismiss, header: props.i18nStrings.header, closeAriaLabel: props.i18nStrings.cancel, footer: React.createElement(InternalBox, { float: "right" },
35
+ return (React.createElement(InternalModal, { size: "medium", visible: true, getModalRoot: props.getModalRoot, removeModalRoot: props.removeModalRoot, onDismiss: props.onDismiss, header: props.i18nStrings.header, closeAriaLabel: props.i18nStrings.close, footer: React.createElement(InternalBox, { float: "right" },
36
36
  React.createElement(InternalSpaceBetween, { direction: "horizontal", size: "xs" },
37
37
  React.createElement(InternalButton, { onClick: props.onDismiss }, props.i18nStrings.cancel),
38
38
  React.createElement(InternalButton, { onClick: () => props.onConfirm({ wrapLines, theme }), variant: "primary" }, props.i18nStrings.confirm))) },
@@ -1 +1 @@
1
- {"version":3,"file":"preferences-modal.js","sourceRoot":"","sources":["../../../src/code-editor/preferences-modal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAEvD,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAE9C,OAAO,cAAc,MAAM,oBAAoB,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AE,eAAe,EACzB,OAAO,EAAE,YAAY,EACrB,aAAa,EAAC,MAAM,EACpB,kBAAkB,EAAE,KAAK,CAAC,WAAW,CAAC,uBAAuB,EAC7D,uBAAuB,EAAE,KAAK,CAAC,WAAW,CAAC,4BAA4B,EACvE,oBAAoB,EAAE,KAAK,CAAC,WAAW,CAAC,yBAAyB,GACjE,CACgB,CAChB,CACe,CACT,CACjB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\n\nimport InternalBox from '../box/internal';\nimport { InternalButton } from '../button/internal';\nimport InternalCheckbox from '../checkbox/internal';\nimport InternalColumnLayout from '../column-layout/internal';\nimport InternalFormField from '../form-field/internal';\nimport { NonCancelableCustomEvent } from '../internal/events';\nimport InternalModal from '../modal/internal';\nimport { SelectProps } from '../select/interfaces';\nimport InternalSelect from '../select/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { DarkThemes, LightThemes } from './ace-themes';\nimport { CodeEditorProps } from './interfaces';\n\ninterface PreferencesModali18nStrings {\n header?: string;\n cancel?: string;\n confirm?: string;\n wrapLines?: string;\n theme?: string;\n lightThemes?: string;\n darkThemes?: string;\n themeFilteringPlaceholder?: string;\n themeFilteringAriaLabel?: string;\n themeFilteringClearAriaLabel?: string;\n}\n\ninterface PreferencesModalProps {\n preferences?: Partial<CodeEditorProps.Preferences>;\n getModalRoot: CodeEditorProps['getModalRoot'];\n removeModalRoot: CodeEditorProps['removeModalRoot'];\n\n i18nStrings: PreferencesModali18nStrings;\n\n themes: CodeEditorProps.AvailableThemes;\n defaultTheme: CodeEditorProps.Theme;\n\n onConfirm: (preferences: CodeEditorProps.Preferences) => void;\n onDismiss: () => void;\n}\n\nfunction filterThemes(allThemes: ReadonlyArray<SelectProps.Option>, available: ReadonlyArray<string>) {\n return allThemes.filter(theme => available.indexOf(theme.value!) > -1);\n}\n\nexport default (props: PreferencesModalProps) => {\n const [wrapLines, setWrapLines] = useState<boolean>(props.preferences?.wrapLines ?? true);\n const [theme, setTheme] = useState<CodeEditorProps.Theme>(props.preferences?.theme ?? props.defaultTheme);\n const themeOptions = [\n {\n label: props.i18nStrings.lightThemes,\n options: filterThemes(LightThemes, props.themes.light),\n },\n {\n label: props.i18nStrings.darkThemes,\n options: filterThemes(DarkThemes, props.themes.dark),\n },\n ];\n const [selectedThemeOption, setSelectedThemeOption] = useState<SelectProps.Option>(\n () => [...LightThemes, ...DarkThemes].filter(t => t.value === theme)[0]\n );\n\n const onThemeSelected = (e: NonCancelableCustomEvent<SelectProps.ChangeDetail>) => {\n setTheme(e.detail.selectedOption.value as CodeEditorProps.Theme);\n setSelectedThemeOption(e.detail.selectedOption);\n };\n\n return (\n <InternalModal\n size=\"medium\"\n visible={true}\n getModalRoot={props.getModalRoot}\n removeModalRoot={props.removeModalRoot}\n onDismiss={props.onDismiss}\n header={props.i18nStrings.header}\n closeAriaLabel={props.i18nStrings.cancel}\n footer={\n <InternalBox float=\"right\">\n <InternalSpaceBetween direction=\"horizontal\" size=\"xs\">\n <InternalButton onClick={props.onDismiss}>{props.i18nStrings.cancel}</InternalButton>\n <InternalButton onClick={() => props.onConfirm({ wrapLines, theme })} variant=\"primary\">\n {props.i18nStrings.confirm}\n </InternalButton>\n </InternalSpaceBetween>\n </InternalBox>\n }\n >\n <InternalColumnLayout columns={2} variant=\"text-grid\">\n <div>\n <InternalCheckbox checked={wrapLines} onChange={e => setWrapLines(e.detail.checked)}>\n {props.i18nStrings.wrapLines}\n </InternalCheckbox>\n </div>\n <div>\n <InternalFormField label={props.i18nStrings.theme}>\n <InternalSelect\n selectedOption={selectedThemeOption}\n onChange={onThemeSelected}\n options={themeOptions}\n filteringType=\"auto\"\n filteringAriaLabel={props.i18nStrings.themeFilteringAriaLabel}\n filteringClearAriaLabel={props.i18nStrings.themeFilteringClearAriaLabel}\n filteringPlaceholder={props.i18nStrings.themeFilteringPlaceholder}\n />\n </InternalFormField>\n </div>\n </InternalColumnLayout>\n </InternalModal>\n );\n};\n"]}
1
+ {"version":3,"file":"preferences-modal.js","sourceRoot":"","sources":["../../../src/code-editor/preferences-modal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAEvD,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAE9C,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA+BvD,SAAS,YAAY,CAAC,SAA4C,EAAE,SAAgC;IAClG,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,KAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,eAAe,CAAC,KAA4B,EAAE,EAAE;;IAC9C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAU,MAAA,MAAA,KAAK,CAAC,WAAW,0CAAE,SAAS,mCAAI,IAAI,CAAC,CAAC;IAC1F,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAwB,MAAA,MAAA,KAAK,CAAC,WAAW,0CAAE,KAAK,mCAAI,KAAK,CAAC,YAAY,CAAC,CAAC;IAC1G,MAAM,YAAY,GAAG;QACnB;YACE,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,WAAW;YACpC,OAAO,EAA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AAS,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAC,SAAS,IACpF,KAAK,CAAC,WAAW,CAAC,OAAO,CACX,CACI,CACX;QAGhB,oBAAC,oBAAoB,IAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAC,WAAW;YACnD;gBACE,oBAAC,gBAAgB,IAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAChF,KAAK,CAAC,WAAW,CAAC,SAAS,CACX,CACf;YACN;gBACE,oBAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,KAAK;oBAC/C,oBAAC,cAAc,IACb,cAAc,EAAE,mBAAmB,EACnC,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,YAAY,EACrB,aAAa,EAAC,MAAM,EACpB,kBAAkB,EAAE,KAAK,CAAC,WAAW,CAAC,uBAAuB,EAC7D,uBAAuB,EAAE,KAAK,CAAC,WAAW,CAAC,4BAA4B,EACvE,oBAAoB,EAAE,KAAK,CAAC,WAAW,CAAC,yBAAyB,GACjE,CACgB,CAChB,CACe,CACT,CACjB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\n\nimport InternalBox from '../box/internal';\nimport { InternalButton } from '../button/internal';\nimport InternalCheckbox from '../checkbox/internal';\nimport InternalColumnLayout from '../column-layout/internal';\nimport InternalFormField from '../form-field/internal';\nimport { NonCancelableCustomEvent } from '../internal/events';\nimport InternalModal from '../modal/internal';\nimport { SelectProps } from '../select/interfaces';\nimport InternalSelect from '../select/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { DarkThemes, LightThemes } from './ace-themes';\nimport { CodeEditorProps } from './interfaces';\n\ninterface PreferencesModali18nStrings {\n header?: string;\n cancel?: string;\n confirm?: string;\n close?: string;\n wrapLines?: string;\n theme?: string;\n lightThemes?: string;\n darkThemes?: string;\n themeFilteringPlaceholder?: string;\n themeFilteringAriaLabel?: string;\n themeFilteringClearAriaLabel?: string;\n}\n\ninterface PreferencesModalProps {\n preferences?: Partial<CodeEditorProps.Preferences>;\n getModalRoot: CodeEditorProps['getModalRoot'];\n removeModalRoot: CodeEditorProps['removeModalRoot'];\n\n i18nStrings: PreferencesModali18nStrings;\n\n themes: CodeEditorProps.AvailableThemes;\n defaultTheme: CodeEditorProps.Theme;\n\n onConfirm: (preferences: CodeEditorProps.Preferences) => void;\n onDismiss: () => void;\n}\n\nfunction filterThemes(allThemes: ReadonlyArray<SelectProps.Option>, available: ReadonlyArray<string>) {\n return allThemes.filter(theme => available.indexOf(theme.value!) > -1);\n}\n\nexport default (props: PreferencesModalProps) => {\n const [wrapLines, setWrapLines] = useState<boolean>(props.preferences?.wrapLines ?? true);\n const [theme, setTheme] = useState<CodeEditorProps.Theme>(props.preferences?.theme ?? props.defaultTheme);\n const themeOptions = [\n {\n label: props.i18nStrings.lightThemes,\n options: filterThemes(LightThemes, props.themes.light),\n },\n {\n label: props.i18nStrings.darkThemes,\n options: filterThemes(DarkThemes, props.themes.dark),\n },\n ];\n const [selectedThemeOption, setSelectedThemeOption] = useState<SelectProps.Option>(\n () => [...LightThemes, ...DarkThemes].filter(t => t.value === theme)[0]\n );\n\n const onThemeSelected = (e: NonCancelableCustomEvent<SelectProps.ChangeDetail>) => {\n setTheme(e.detail.selectedOption.value as CodeEditorProps.Theme);\n setSelectedThemeOption(e.detail.selectedOption);\n };\n\n return (\n <InternalModal\n size=\"medium\"\n visible={true}\n getModalRoot={props.getModalRoot}\n removeModalRoot={props.removeModalRoot}\n onDismiss={props.onDismiss}\n header={props.i18nStrings.header}\n closeAriaLabel={props.i18nStrings.close}\n footer={\n <InternalBox float=\"right\">\n <InternalSpaceBetween direction=\"horizontal\" size=\"xs\">\n <InternalButton onClick={props.onDismiss}>{props.i18nStrings.cancel}</InternalButton>\n <InternalButton onClick={() => props.onConfirm({ wrapLines, theme })} variant=\"primary\">\n {props.i18nStrings.confirm}\n </InternalButton>\n </InternalSpaceBetween>\n </InternalBox>\n }\n >\n <InternalColumnLayout columns={2} variant=\"text-grid\">\n <div>\n <InternalCheckbox checked={wrapLines} onChange={e => setWrapLines(e.detail.checked)}>\n {props.i18nStrings.wrapLines}\n </InternalCheckbox>\n </div>\n <div>\n <InternalFormField label={props.i18nStrings.theme}>\n <InternalSelect\n selectedOption={selectedThemeOption}\n onChange={onThemeSelected}\n options={themeOptions}\n filteringType=\"auto\"\n filteringAriaLabel={props.i18nStrings.themeFilteringAriaLabel}\n filteringClearAriaLabel={props.i18nStrings.themeFilteringClearAriaLabel}\n filteringPlaceholder={props.i18nStrings.themeFilteringPlaceholder}\n />\n </InternalFormField>\n </div>\n </InternalColumnLayout>\n </InternalModal>\n );\n};\n"]}