@novely/solid-renderer 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Modal.d.ts +1 -0
- package/dist/index.jsx +10 -6
- package/dist/styles/index.css +17 -17
- package/package.json +1 -1
package/dist/index.jsx
CHANGED
|
@@ -108,6 +108,12 @@ var Modal = (props) => {
|
|
|
108
108
|
let modalWindow;
|
|
109
109
|
const handleKeydown = (event) => {
|
|
110
110
|
if (untrack(props.isOpen) && event.key === "Tab") {
|
|
111
|
+
if (!untrack(props.trapFocus)) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (!modalWindow) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
111
117
|
const nodes = modalWindow.querySelectorAll("*");
|
|
112
118
|
const tabbable = Array.from(nodes).filter((node) => node.tabIndex >= 0);
|
|
113
119
|
let index = tabbable.indexOf(document.activeElement);
|
|
@@ -472,7 +478,7 @@ var Game = (props) => {
|
|
|
472
478
|
/></div>
|
|
473
479
|
</div>
|
|
474
480
|
</div>
|
|
475
|
-
<Modal isOpen={() => props.state.choices.visible}><div class="dialog-container">
|
|
481
|
+
<Modal isOpen={() => props.state.choices.visible} trapFocus={() => !props.state.exitPromptShown}><div class="dialog-container">
|
|
476
482
|
<span class="dialog-fix" aria-hidden="true"></span>
|
|
477
483
|
<div class="dialog-panel">
|
|
478
484
|
<span
|
|
@@ -492,7 +498,7 @@ var Game = (props) => {
|
|
|
492
498
|
}}</For>
|
|
493
499
|
</div>
|
|
494
500
|
</div></Modal>
|
|
495
|
-
<Modal isOpen={() => props.state.input.visible}><div class="dialog-container">
|
|
501
|
+
<Modal isOpen={() => props.state.input.visible} trapFocus={() => !props.state.exitPromptShown}><div class="dialog-container">
|
|
496
502
|
<span class="dialog-fix" aria-hidden="true"></span>
|
|
497
503
|
<div class="dialog-panel input-dialog-panel">
|
|
498
504
|
<label for="novely-input" class="input-dialog-label">
|
|
@@ -508,13 +514,11 @@ var Game = (props) => {
|
|
|
508
514
|
>{data.t("Sumbit")}</button>
|
|
509
515
|
</div>
|
|
510
516
|
</div></Modal>
|
|
511
|
-
<Modal isOpen={() => props.state.exitPromptShown}><div class="dialog-container">
|
|
517
|
+
<Modal isOpen={() => props.state.exitPromptShown} trapFocus={() => props.state.exitPromptShown}><div class="dialog-container">
|
|
512
518
|
<span class="dialog-fix" aria-hidden="true"></span>
|
|
513
519
|
<div class="dialog-backdrop" />
|
|
514
520
|
<div class="dialog-panel exit-dialog-panel">
|
|
515
|
-
<span
|
|
516
|
-
class="dialog-panel-label"
|
|
517
|
-
>{data.t("ExitDialogWarning")}</span>
|
|
521
|
+
<span class="dialog-panel-label">{data.t("ExitDialogWarning")}</span>
|
|
518
522
|
<div class="exit-dialog-panel-buttons">
|
|
519
523
|
<button
|
|
520
524
|
type="button"
|
package/dist/styles/index.css
CHANGED
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
font-size: 1.32rem;
|
|
292
292
|
}
|
|
293
293
|
.action-dialog-container {
|
|
294
|
-
border-radius: 14px 14px 0 0;
|
|
294
|
+
border-radius: var(--novely-dialog-border-radius, 14px 14px 0 0);
|
|
295
295
|
}
|
|
296
296
|
.action-dialog-content {
|
|
297
297
|
text-shadow: none;
|
|
@@ -388,16 +388,16 @@
|
|
|
388
388
|
max-width: 100%;
|
|
389
389
|
}
|
|
390
390
|
.input-dialog-panel {
|
|
391
|
-
color: #fff;
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
background-
|
|
396
|
-
|
|
397
|
-
|
|
391
|
+
color: var(--novely-input-dialog-color, #fff);
|
|
392
|
+
border: var(--novely-input-dialog-border-width, 3px) solid var(--novely-input-dialog-border-color, #fff);
|
|
393
|
+
border-radius: var(--novely-input-dialog-border-radius, 14px);
|
|
394
|
+
box-shadow: 1px 1px 4px var(--novely-input-dialog-box-shadow-color, #00000072);
|
|
395
|
+
background-image: var(--novely-input-dialog-background-image, radial-gradient(#d6608998 20%, transparent 20%), radial-gradient(#d6608998 20%, transparent 20%));
|
|
396
|
+
background-color: var(--novely-input-dialog-background-color, #f092b4d8);
|
|
397
|
+
background-position: var(--novely-input-dialog-background-position, 0 0, 50px 50px);
|
|
398
|
+
background-size: var(--novely-input-dialog-background-size, 100px 100px);
|
|
398
399
|
justify-content: center;
|
|
399
400
|
align-items: center;
|
|
400
|
-
box-shadow: 1px 1px 4px #00000072;
|
|
401
401
|
}
|
|
402
402
|
|
|
403
403
|
/* src/styles/input-dialog/button/button.css */
|
|
@@ -411,16 +411,16 @@
|
|
|
411
411
|
|
|
412
412
|
/* src/styles/exit-dialog/exit-dialog.css */
|
|
413
413
|
.exit-dialog-panel {
|
|
414
|
-
color: #fff;
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
background-
|
|
419
|
-
|
|
420
|
-
|
|
414
|
+
color: var(--novely-exit-dialog-color, #fff);
|
|
415
|
+
border: var(--novely-exit-dialog-border-width, 3px) solid var(--novely-exit-dialog-border-color, #fff);
|
|
416
|
+
border-radius: var(--novely-exit-dialog-border-radius, 14px);
|
|
417
|
+
box-shadow: 1px 1px 4px var(--novely-exit-dialog-box-shadow-color, #00000072);
|
|
418
|
+
background-image: var(--novely-exit-dialog-background-image, radial-gradient(#d6608998 20%, transparent 20%), radial-gradient(#d6608998 20%, transparent 20%));
|
|
419
|
+
background-color: var(--novely-exit-dialog-background-color, #f092b4d8);
|
|
420
|
+
background-position: var(--novely-exit-dialog-background-position, 0 0, 50px 50px);
|
|
421
|
+
background-size: var(--novely-exit-dialog-background-size, 100px 100px);
|
|
421
422
|
justify-content: center;
|
|
422
423
|
align-items: center;
|
|
423
|
-
box-shadow: 1px 1px 4px #00000072;
|
|
424
424
|
}
|
|
425
425
|
.exit-dialog-panel-buttons {
|
|
426
426
|
gap: .5rem;
|