@1shotapi/ows-signer 0.4.2 → 0.4.3
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/html/signer.css +63 -0
- package/package.json +1 -1
- package/src/ui.js +13 -1
package/html/signer.css
CHANGED
|
@@ -56,8 +56,71 @@ body {
|
|
|
56
56
|
text-align: center;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
body.ows-ceremony-open {
|
|
60
|
+
align-items: stretch;
|
|
61
|
+
justify-content: flex-end;
|
|
62
|
+
background: transparent;
|
|
63
|
+
}
|
|
64
|
+
|
|
59
65
|
.ows-signer-ui--ceremony {
|
|
60
66
|
gap: 0;
|
|
67
|
+
margin: 0;
|
|
68
|
+
width: 100%;
|
|
69
|
+
max-width: none;
|
|
70
|
+
height: 100%;
|
|
71
|
+
max-height: 100%;
|
|
72
|
+
min-height: 0;
|
|
73
|
+
padding: 12px 20px 0;
|
|
74
|
+
justify-content: flex-start;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
border: 1px solid var(--ows-border);
|
|
77
|
+
border-bottom: none;
|
|
78
|
+
border-radius: var(--ows-radius-card) var(--ows-radius-card) 0 0;
|
|
79
|
+
box-shadow: 0 -2px 16px rgb(0 0 0 / 6%);
|
|
80
|
+
animation: ows-sheet-in 280ms cubic-bezier(0.32, 0.72, 0, 1) both;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@keyframes ows-sheet-in {
|
|
84
|
+
from {
|
|
85
|
+
transform: translateY(100%);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
to {
|
|
89
|
+
transform: translateY(0);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ows-ceremony-grab {
|
|
94
|
+
flex: 0 0 auto;
|
|
95
|
+
width: 2.5rem;
|
|
96
|
+
height: 0.25rem;
|
|
97
|
+
border-radius: 999px;
|
|
98
|
+
background: color-mix(in srgb, var(--ows-text-muted) 35%, transparent);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ows-signer-ui--ceremony .ows-ceremony-grab {
|
|
102
|
+
margin: 0 auto 12px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ows-signer-ui--ceremony .ows-ceremony-header {
|
|
106
|
+
flex-shrink: 0;
|
|
107
|
+
padding: 0;
|
|
108
|
+
margin: 0 0 8px;
|
|
109
|
+
text-align: left;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ows-signer-ui--ceremony .ows-ceremony-body {
|
|
113
|
+
flex: 0 0 auto;
|
|
114
|
+
flex-shrink: 0;
|
|
115
|
+
min-height: auto;
|
|
116
|
+
overflow: visible;
|
|
117
|
+
padding: 0 0 4px;
|
|
118
|
+
margin-bottom: 12px;
|
|
119
|
+
text-align: left;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.ows-signer-ui--ceremony .ows-ceremony-actions {
|
|
123
|
+
padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
|
|
61
124
|
}
|
|
62
125
|
|
|
63
126
|
.ows-signer-ui:empty {
|
package/package.json
CHANGED
package/src/ui.js
CHANGED
|
@@ -66,7 +66,14 @@ export function initUi(container) {
|
|
|
66
66
|
root.className = "ows-signer-ui";
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
function setCeremonyOpen(open) {
|
|
70
|
+
if (typeof document !== "undefined" && document.body) {
|
|
71
|
+
document.body.classList.toggle("ows-ceremony-open", open);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
69
75
|
export function clearUi() {
|
|
76
|
+
setCeremonyOpen(false);
|
|
70
77
|
if (root) {
|
|
71
78
|
root.innerHTML = "";
|
|
72
79
|
root.className = "ows-signer-ui";
|
|
@@ -170,11 +177,16 @@ export function promptCeremonyConfirm(fields, runOnConfirm) {
|
|
|
170
177
|
cancelPendingCeremonyConfirm();
|
|
171
178
|
clearUi();
|
|
172
179
|
root.className = "ows-signer-ui ows-signer-ui--ceremony";
|
|
180
|
+
setCeremonyOpen(true);
|
|
173
181
|
const ui = resolveCeremonyUi(fields);
|
|
174
182
|
|
|
175
183
|
return new Promise((resolve, reject) => {
|
|
176
184
|
pendingConfirmReject = reject;
|
|
177
185
|
|
|
186
|
+
const grab = document.createElement("div");
|
|
187
|
+
grab.className = "ows-ceremony-grab";
|
|
188
|
+
grab.setAttribute("aria-hidden", "true");
|
|
189
|
+
|
|
178
190
|
const header = document.createElement("h2");
|
|
179
191
|
header.className = "ows-ceremony-header";
|
|
180
192
|
header.textContent = ui.header;
|
|
@@ -238,7 +250,7 @@ export function promptCeremonyConfirm(fields, runOnConfirm) {
|
|
|
238
250
|
});
|
|
239
251
|
|
|
240
252
|
actions.append(confirmBtn, denyBtn);
|
|
241
|
-
root.append(header, body, actions);
|
|
253
|
+
root.append(grab, header, body, actions);
|
|
242
254
|
});
|
|
243
255
|
}
|
|
244
256
|
|