@takagaki/cortex-decisions-viewer 0.12.199 → 0.12.200
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/google-confirm-page.js +40 -4
- package/dist/render.js +9 -0
- package/package.json +1 -1
|
@@ -87,6 +87,10 @@ function googleConfirmPageJs() {
|
|
|
87
87
|
var statusEl = $("gc-status");
|
|
88
88
|
var goBtn = $("gc-go");
|
|
89
89
|
var closeBtn = $("gc-close");
|
|
90
|
+
var busyEl = $("gc-busy");
|
|
91
|
+
var busyTextEl = $("gc-busy-text");
|
|
92
|
+
var busyNoteEl = $("gc-busy-note");
|
|
93
|
+
var pageEl = $("gc-page");
|
|
90
94
|
|
|
91
95
|
var ctx = null;
|
|
92
96
|
var flow = null;
|
|
@@ -98,6 +102,20 @@ function googleConfirmPageJs() {
|
|
|
98
102
|
statusEl.textContent = text || "";
|
|
99
103
|
statusEl.className = "gc-status" + (cls ? " " + cls : "");
|
|
100
104
|
}
|
|
105
|
+
/** 窓の中全体を「読み込み中」で覆う(保存が終わるまで他の操作をしかけないため)。覆いの間は後ろの画面を操作できない */
|
|
106
|
+
function showBusy(text, note) {
|
|
107
|
+
busyTextEl.textContent = text;
|
|
108
|
+
busyNoteEl.textContent = note || "";
|
|
109
|
+
busyNoteEl.hidden = !note;
|
|
110
|
+
busyEl.hidden = false;
|
|
111
|
+
pageEl.setAttribute("inert", "");
|
|
112
|
+
pageEl.setAttribute("aria-hidden", "true");
|
|
113
|
+
}
|
|
114
|
+
function hideBusy() {
|
|
115
|
+
busyEl.hidden = true;
|
|
116
|
+
pageEl.removeAttribute("inert");
|
|
117
|
+
pageEl.removeAttribute("aria-hidden");
|
|
118
|
+
}
|
|
101
119
|
function b64urlEncode(text) {
|
|
102
120
|
return btoa(text).replace(/\\+/g, "-").replace(/\\//g, "_").replace(/=+$/, "");
|
|
103
121
|
}
|
|
@@ -121,6 +139,7 @@ function googleConfirmPageJs() {
|
|
|
121
139
|
function succeed(message, extra) {
|
|
122
140
|
finished = true;
|
|
123
141
|
busy = false;
|
|
142
|
+
hideBusy();
|
|
124
143
|
goBtn.hidden = true;
|
|
125
144
|
closeBtn.hidden = false;
|
|
126
145
|
setStatus("✓ " + message + "。このウィンドウは閉じて構いません", "is-ok");
|
|
@@ -130,6 +149,7 @@ function googleConfirmPageJs() {
|
|
|
130
149
|
/** 失敗: 理由を出し、押し直せるように戻す(別のアカウントでやり直す人のため)。本体にも理由を渡す */
|
|
131
150
|
function retryable(message, extra) {
|
|
132
151
|
busy = false;
|
|
152
|
+
hideBusy();
|
|
133
153
|
goBtn.hidden = false;
|
|
134
154
|
goBtn.disabled = false;
|
|
135
155
|
goBtn.textContent = "もう一度 Google で確認する";
|
|
@@ -140,6 +160,7 @@ function googleConfirmPageJs() {
|
|
|
140
160
|
/** 続けられない(本体が見つからない・結果が読めない): 理由と[閉じる]だけ */
|
|
141
161
|
function dead(message) {
|
|
142
162
|
busy = false;
|
|
163
|
+
hideBusy();
|
|
143
164
|
finished = true;
|
|
144
165
|
goBtn.hidden = true;
|
|
145
166
|
closeBtn.hidden = false;
|
|
@@ -213,7 +234,7 @@ function googleConfirmPageJs() {
|
|
|
213
234
|
var g = window.google.picker;
|
|
214
235
|
var mine = new g.DocsView(g.ViewId.FOLDERS).setIncludeFolders(true).setSelectFolderEnabled(true).setMimeTypes("application/vnd.google-apps.folder");
|
|
215
236
|
var shared = new g.DocsView(g.ViewId.FOLDERS).setIncludeFolders(true).setSelectFolderEnabled(true).setEnableDrives(true).setMimeTypes("application/vnd.google-apps.folder");
|
|
216
|
-
new g.PickerBuilder()
|
|
237
|
+
var picker = new g.PickerBuilder()
|
|
217
238
|
.setAppId(info.projectNumber)
|
|
218
239
|
.setDeveloperKey(info.apiKey)
|
|
219
240
|
.setOAuthToken(accessToken)
|
|
@@ -224,8 +245,10 @@ function googleConfirmPageJs() {
|
|
|
224
245
|
if (data.action === g.Action.PICKED && data.docs && data.docs[0]) resolve(data.docs[0]);
|
|
225
246
|
else if (data.action === g.Action.CANCEL) resolve(null);
|
|
226
247
|
})
|
|
227
|
-
.build()
|
|
228
|
-
|
|
248
|
+
.build();
|
|
249
|
+
// Picker を操作できるように、出す前に覆いを外す(選ぶ・やめるのあとは、呼び出し側が覆いを戻すか結果を出す)
|
|
250
|
+
hideBusy();
|
|
251
|
+
picker.setVisible(true);
|
|
229
252
|
});
|
|
230
253
|
});
|
|
231
254
|
}
|
|
@@ -249,6 +272,7 @@ function googleConfirmPageJs() {
|
|
|
249
272
|
goBtn.hidden = true;
|
|
250
273
|
closeBtn.hidden = true;
|
|
251
274
|
setStatus("Google の画面へ移動しています…", "");
|
|
275
|
+
showBusy("Google の画面へ移動しています…");
|
|
252
276
|
var info = null;
|
|
253
277
|
loadInfo()
|
|
254
278
|
.then(function (i) {
|
|
@@ -275,7 +299,9 @@ function googleConfirmPageJs() {
|
|
|
275
299
|
busy = true;
|
|
276
300
|
goBtn.hidden = true;
|
|
277
301
|
closeBtn.hidden = true;
|
|
302
|
+
var isDrive = ctx.kind === "drive";
|
|
278
303
|
setStatus("確認しています…", "");
|
|
304
|
+
showBusy(isDrive ? "Google のフォルダを開いています…" : "確認しています…");
|
|
279
305
|
var tokens = null;
|
|
280
306
|
var info = null;
|
|
281
307
|
Promise.resolve()
|
|
@@ -297,6 +323,8 @@ function googleConfirmPageJs() {
|
|
|
297
323
|
var body;
|
|
298
324
|
if (ctx.kind === "drive") {
|
|
299
325
|
if (!picked) throw { message: "フォルダを選ばずに閉じられました。もう一度押してください" };
|
|
326
|
+
if (ctx.mode === "confirm") showBusy("確認しています…");
|
|
327
|
+
else showBusy("保存しています…", "終わるまでこの窓を閉じずにお待ちください");
|
|
300
328
|
body = ctx.mode === "confirm"
|
|
301
329
|
? { op: "confirm-drive-folder", id: ctx.id, folderId: picked.id }
|
|
302
330
|
: { op: "add-drive-folder", folderId: picked.id };
|
|
@@ -365,6 +393,7 @@ function googleConfirmPageJs() {
|
|
|
365
393
|
flow = returned.flow;
|
|
366
394
|
openChannel();
|
|
367
395
|
setStatus("確認の続きを準備しています…", "");
|
|
396
|
+
showBusy("確認しています…");
|
|
368
397
|
var asked = 0;
|
|
369
398
|
var timer = setInterval(function () {
|
|
370
399
|
if (ctx) { clearInterval(timer); return; }
|
|
@@ -398,7 +427,7 @@ function renderGoogleConfirmPage(assets) {
|
|
|
398
427
|
<link rel="stylesheet" href="${esc(assets.css)}" />
|
|
399
428
|
</head>
|
|
400
429
|
<body class="gc-body">
|
|
401
|
-
<main class="gc-page">
|
|
430
|
+
<main id="gc-page" class="gc-page">
|
|
402
431
|
<h1 id="gc-title" class="gc-title">Google で確認</h1>
|
|
403
432
|
<p id="gc-lead" class="gc-lead"></p>
|
|
404
433
|
<p id="gc-status" class="gc-status" role="status" aria-live="polite"></p>
|
|
@@ -407,6 +436,13 @@ function renderGoogleConfirmPage(assets) {
|
|
|
407
436
|
<button id="gc-close" class="ds-toggle-btn" type="button" hidden>閉じる</button>
|
|
408
437
|
</div>
|
|
409
438
|
</main>
|
|
439
|
+
<div id="gc-busy" class="gc-busy" role="status" aria-live="polite" hidden>
|
|
440
|
+
<div class="gc-busy-box">
|
|
441
|
+
<span class="gc-spinner" aria-hidden="true"></span>
|
|
442
|
+
<p id="gc-busy-text" class="gc-busy-text"></p>
|
|
443
|
+
<p id="gc-busy-note" class="gc-busy-note" hidden></p>
|
|
444
|
+
</div>
|
|
445
|
+
</div>
|
|
410
446
|
<script src="${esc(assets.js)}"></script>
|
|
411
447
|
</body>
|
|
412
448
|
</html>`;
|
package/dist/render.js
CHANGED
|
@@ -5603,6 +5603,15 @@ a.ds-tile:hover { text-decoration: none; }
|
|
|
5603
5603
|
.gc-status.is-ok { color: #1a7f37; }
|
|
5604
5604
|
.gc-status.is-error { color: #b42318; }
|
|
5605
5605
|
.gc-actions { display: flex; gap: 8px; }
|
|
5606
|
+
/* 保存が終わるまで窓の中全体を覆う「読み込み中」。CSS だけで回す(外から読み込むものは CSP で落ちる)。窓は幅 520・高さ 680 */
|
|
5607
|
+
.gc-busy { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg, #fff); }
|
|
5608
|
+
.gc-busy[hidden] { display: none; }
|
|
5609
|
+
.gc-busy-box { max-width: 360px; text-align: center; }
|
|
5610
|
+
.gc-spinner { display: block; width: 44px; height: 44px; margin: 0 auto 16px; border: 4px solid var(--border, #e3e6ea); border-top-color: var(--accent, #2f6fed); border-radius: 50%; animation: gc-spin 0.9s linear infinite; }
|
|
5611
|
+
.gc-busy-text { margin: 0; font-size: 18px; font-weight: 600; color: var(--text, #1a1a1a); }
|
|
5612
|
+
.gc-busy-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
|
|
5613
|
+
@keyframes gc-spin { to { transform: rotate(360deg); } }
|
|
5614
|
+
@media (prefers-reduced-motion: reduce) { .gc-spinner { animation-duration: 3s; } }
|
|
5606
5615
|
.gc-unverified { font-size: 12px; color: #9a6700; border: 1px solid #d4a72c; border-radius: 4px; padding: 0 6px; }
|
|
5607
5616
|
.gc-verify-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
|
|
5608
5617
|
/* Backlog の同期経路のスイッチ(#516)。role=switch の button に、トラックとつまみを描く。
|
package/package.json
CHANGED