@kubohiroya/turbowarp-extension-security-dialog 0.5.1 → 0.5.2
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/index.cjs +9 -0
- package/dist/index.mjs +9 -0
- package/package.json +1 -1
- package/styles.css +0 -12
- package/webpack4.css +0 -12
package/dist/index.cjs
CHANGED
|
@@ -516,6 +516,14 @@ var formatMessage = (locale, key, values = {}) => {
|
|
|
516
516
|
};
|
|
517
517
|
|
|
518
518
|
// src/wait-dialog.js
|
|
519
|
+
var styles = ".twextsec-wait{position:fixed;left:50vw;top:50vh;right:auto;bottom:auto;margin:0;transform:translate(-50%,-50%);box-sizing:border-box;width:min(440px,calc(100vw - 32px));border:1px solid var(--ui-black-transparent,#0000001a);border-radius:12px;padding:20px 24px;color:var(--ui-modal-foreground,#263145);background:var(--ui-modal-background,#fff);box-shadow:0 16px 48px #0000004d;font:inherit}.twextsec-wait::backdrop{background:#111827a6}.twextsec-wait:focus,.twextsec-wait:focus-visible{outline:none}.twextsec-wait h2{margin:0 0 10px;font-size:1.05em}.twextsec-wait p{margin:0 0 8px}.twextsec-wait-source{overflow-wrap:anywhere;font-size:.85em;opacity:.7}.twextsec-wait-note{margin-bottom:0;font-size:.9em;opacity:.8}";
|
|
520
|
+
var injectStyles = (document) => {
|
|
521
|
+
if (!document.head || document.querySelector("[data-twextsec-wait-style]")) return;
|
|
522
|
+
const element = document.createElement("style");
|
|
523
|
+
element.setAttribute("data-twextsec-wait-style", "");
|
|
524
|
+
element.textContent = styles;
|
|
525
|
+
document.head.appendChild(element);
|
|
526
|
+
};
|
|
519
527
|
var text = (document, tag, value, className) => {
|
|
520
528
|
const element = document.createElement(tag);
|
|
521
529
|
element.textContent = value;
|
|
@@ -536,6 +544,7 @@ function createExtensionWaitDialog(document, locale = "en", { delayMs = 300 } =
|
|
|
536
544
|
const open = () => {
|
|
537
545
|
timer = null;
|
|
538
546
|
if (disposed || dialog || !document || !document.body) return;
|
|
547
|
+
injectStyles(document);
|
|
539
548
|
dialog = document.createElement("dialog");
|
|
540
549
|
dialog.className = "twextsec-wait";
|
|
541
550
|
dialog.setAttribute("data-testid", "twextsec-wait");
|
package/dist/index.mjs
CHANGED
|
@@ -466,6 +466,14 @@ var formatMessage = (locale, key, values = {}) => {
|
|
|
466
466
|
};
|
|
467
467
|
|
|
468
468
|
// src/wait-dialog.js
|
|
469
|
+
var styles = ".twextsec-wait{position:fixed;left:50vw;top:50vh;right:auto;bottom:auto;margin:0;transform:translate(-50%,-50%);box-sizing:border-box;width:min(440px,calc(100vw - 32px));border:1px solid var(--ui-black-transparent,#0000001a);border-radius:12px;padding:20px 24px;color:var(--ui-modal-foreground,#263145);background:var(--ui-modal-background,#fff);box-shadow:0 16px 48px #0000004d;font:inherit}.twextsec-wait::backdrop{background:#111827a6}.twextsec-wait:focus,.twextsec-wait:focus-visible{outline:none}.twextsec-wait h2{margin:0 0 10px;font-size:1.05em}.twextsec-wait p{margin:0 0 8px}.twextsec-wait-source{overflow-wrap:anywhere;font-size:.85em;opacity:.7}.twextsec-wait-note{margin-bottom:0;font-size:.9em;opacity:.8}";
|
|
470
|
+
var injectStyles = (document) => {
|
|
471
|
+
if (!document.head || document.querySelector("[data-twextsec-wait-style]")) return;
|
|
472
|
+
const element = document.createElement("style");
|
|
473
|
+
element.setAttribute("data-twextsec-wait-style", "");
|
|
474
|
+
element.textContent = styles;
|
|
475
|
+
document.head.appendChild(element);
|
|
476
|
+
};
|
|
469
477
|
var text = (document, tag, value, className) => {
|
|
470
478
|
const element = document.createElement(tag);
|
|
471
479
|
element.textContent = value;
|
|
@@ -486,6 +494,7 @@ function createExtensionWaitDialog(document, locale = "en", { delayMs = 300 } =
|
|
|
486
494
|
const open = () => {
|
|
487
495
|
timer = null;
|
|
488
496
|
if (disposed || dialog || !document || !document.body) return;
|
|
497
|
+
injectStyles(document);
|
|
489
498
|
dialog = document.createElement("dialog");
|
|
490
499
|
dialog.className = "twextsec-wait";
|
|
491
500
|
dialog.setAttribute("data-testid", "twextsec-wait");
|
package/package.json
CHANGED
package/styles.css
CHANGED
|
@@ -208,15 +208,3 @@
|
|
|
208
208
|
.twextsec-resize[data-edge="nw"], .twextsec-resize[data-edge="se"] { cursor: nwse-resize; }
|
|
209
209
|
[data-twextsec-maximized] > .twextsec-resize { display: none; }
|
|
210
210
|
|
|
211
|
-
/* A wait the person cannot act on takes the middle of the screen, where the approval dialog that
|
|
212
|
-
follows appears too. Native dialog auto margins follow an overflowing host layout, so centre it
|
|
213
|
-
with viewport units the way the host's own permission dialog does. */
|
|
214
|
-
.twextsec-wait { position: fixed; left: 50vw; top: 50vh; right: auto; bottom: auto; margin: 0; transform: translate(-50%, -50%); box-sizing: border-box; width: min(440px, calc(100vw - 32px)); border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 12px; padding: 20px 24px; color: var(--ui-modal-foreground, #263145); background: var(--ui-modal-background, #fff); box-shadow: 0 16px 48px #0000004d; font: inherit; }
|
|
215
|
-
.twextsec-wait::backdrop { background: #111827a6; }
|
|
216
|
-
/* showModal focuses the dialog itself because nothing inside it is focusable. The ring marks a
|
|
217
|
-
place the keyboard cannot go, so drop it; the backdrop already shows what has the screen. */
|
|
218
|
-
.twextsec-wait:focus, .twextsec-wait:focus-visible { outline: none; }
|
|
219
|
-
.twextsec-wait h2 { margin: 0 0 10px; font-size: 1.05em; }
|
|
220
|
-
.twextsec-wait p { margin: 0 0 8px; }
|
|
221
|
-
.twextsec-wait-source { overflow-wrap: anywhere; font-size: .85em; opacity: .7; }
|
|
222
|
-
.twextsec-wait-note { margin-bottom: 0; font-size: .9em; opacity: .8; }
|
package/webpack4.css
CHANGED
|
@@ -208,15 +208,3 @@
|
|
|
208
208
|
:global(.twextsec-resize)[data-edge="nw"], :global(.twextsec-resize)[data-edge="se"] { cursor: nwse-resize; }
|
|
209
209
|
[data-twextsec-maximized] > :global(.twextsec-resize) { display: none; }
|
|
210
210
|
|
|
211
|
-
/* A wait the person cannot act on takes the middle of the screen, where the approval dialog that
|
|
212
|
-
follows appears too. Native dialog auto margins follow an overflowing host layout, so centre it
|
|
213
|
-
with viewport units the way the host's own permission dialog does. */
|
|
214
|
-
:global(.twextsec-wait) { position: fixed; left: 50vw; top: 50vh; right: auto; bottom: auto; margin: 0; transform: translate(-50%, -50%); box-sizing: border-box; width: min(440px, calc(100vw - 32px)); border: 1px solid var(--ui-black-transparent, #0000001a); border-radius: 12px; padding: 20px 24px; color: var(--ui-modal-foreground, #263145); background: var(--ui-modal-background, #fff); box-shadow: 0 16px 48px #0000004d; font: inherit; }
|
|
215
|
-
:global(.twextsec-wait)::backdrop { background: #111827a6; }
|
|
216
|
-
/* showModal focuses the dialog itself because nothing inside it is focusable. The ring marks a
|
|
217
|
-
place the keyboard cannot go, so drop it; the backdrop already shows what has the screen. */
|
|
218
|
-
:global(.twextsec-wait):focus, :global(.twextsec-wait):focus-visible { outline: none; }
|
|
219
|
-
:global(.twextsec-wait) h2 { margin: 0 0 10px; font-size: 1.05em; }
|
|
220
|
-
:global(.twextsec-wait) p { margin: 0 0 8px; }
|
|
221
|
-
:global(.twextsec-wait-source) { overflow-wrap: anywhere; font-size: .85em; opacity: .7; }
|
|
222
|
-
:global(.twextsec-wait-note) { margin-bottom: 0; font-size: .9em; opacity: .8; }
|