@mysten/enoki-connect 0.0.25 → 0.1.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/CHANGELOG.md +29 -0
- package/dist/cjs/components/base-modal.d.ts +43 -0
- package/dist/cjs/components/base-modal.js +197 -0
- package/dist/cjs/components/base-modal.js.map +7 -0
- package/dist/cjs/components/modal.d.ts +24 -0
- package/dist/cjs/components/modal.js +269 -0
- package/dist/cjs/components/modal.js.map +7 -0
- package/dist/cjs/package.json +1 -2
- package/dist/cjs/wallet/index.d.ts +1 -0
- package/dist/cjs/wallet/index.js +46 -7
- package/dist/cjs/wallet/index.js.map +3 -3
- package/dist/esm/components/base-modal.d.ts +43 -0
- package/dist/esm/components/base-modal.js +179 -0
- package/dist/esm/components/base-modal.js.map +7 -0
- package/dist/esm/components/modal.d.ts +24 -0
- package/dist/esm/components/modal.js +251 -0
- package/dist/esm/components/modal.js.map +7 -0
- package/dist/esm/package.json +1 -2
- package/dist/esm/wallet/index.d.ts +1 -0
- package/dist/esm/wallet/index.js +46 -7
- package/dist/esm/wallet/index.js.map +2 -2
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @mysten/enoki-connect
|
|
2
2
|
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 45efc26: show fallback modal to click to open a popup when opening a new tab is blocked
|
|
8
|
+
- ea1ac70: Update dependencies and improve support for typescript 5.9
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 45efc26: enhance wallet operation request popup fallback modal to support custom CSS variables for
|
|
13
|
+
improved styling flexibility
|
|
14
|
+
- Updated dependencies [45efc26]
|
|
15
|
+
- Updated dependencies [3c1741f]
|
|
16
|
+
- Updated dependencies [ea1ac70]
|
|
17
|
+
- @mysten/window-wallet-core@0.1.0
|
|
18
|
+
- @mysten/sui@1.38.0
|
|
19
|
+
- @mysten/wallet-standard@0.17.0
|
|
20
|
+
- @mysten/utils@0.2.0
|
|
21
|
+
|
|
22
|
+
## 0.0.26
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [c689b98]
|
|
27
|
+
- Updated dependencies [c689b98]
|
|
28
|
+
- Updated dependencies [5b9ff1a]
|
|
29
|
+
- @mysten/sui@1.37.6
|
|
30
|
+
- @mysten/wallet-standard@0.16.14
|
|
31
|
+
|
|
3
32
|
## 0.0.25
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import type { PropertyValues } from 'lit';
|
|
3
|
+
import type { PromiseWithResolvers } from '@mysten/utils';
|
|
4
|
+
export declare class BaseModal extends LitElement {
|
|
5
|
+
#private;
|
|
6
|
+
static shadowRootOptions: {
|
|
7
|
+
delegatesFocus: boolean;
|
|
8
|
+
clonable?: boolean;
|
|
9
|
+
customElementRegistry?: CustomElementRegistry;
|
|
10
|
+
mode: ShadowRootMode;
|
|
11
|
+
serializable?: boolean;
|
|
12
|
+
slotAssignment?: SlotAssignmentMode;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Opens the dialog when set to `true` and closes it when set to `false`.
|
|
16
|
+
*/
|
|
17
|
+
get open(): boolean;
|
|
18
|
+
set open(open: boolean);
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
private readonly _dialog;
|
|
21
|
+
protected _closingResolvers?: PromiseWithResolvers<void>;
|
|
22
|
+
protected get _isClosing(): boolean;
|
|
23
|
+
firstUpdated(changedProperties: PropertyValues): void;
|
|
24
|
+
/**
|
|
25
|
+
* Opens the dialog and fires a cancelable `open` event. An `opened` event
|
|
26
|
+
* is fired after the dialog opens.
|
|
27
|
+
*
|
|
28
|
+
* @return A `Promise` that resolves after the `opened` event was fired.
|
|
29
|
+
*/
|
|
30
|
+
show(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Closes the dialog and fires a cancelable `close` event. After a dialog's
|
|
33
|
+
* animation, a `closed` event is fired.
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
close(): Promise<void>;
|
|
37
|
+
protected handleAnimationEnd(e: AnimationEvent): void;
|
|
38
|
+
connectedCallback(): void;
|
|
39
|
+
disconnectedCallback(): void;
|
|
40
|
+
protected handleContentClick(): void;
|
|
41
|
+
protected handleDialogClick(): void;
|
|
42
|
+
protected handleCancel(e?: Event): void;
|
|
43
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __typeError = (msg) => {
|
|
7
|
+
throw TypeError(msg);
|
|
8
|
+
};
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
23
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
24
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
25
|
+
if (decorator = decorators[i])
|
|
26
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
27
|
+
if (kind && result) __defProp(target, key, result);
|
|
28
|
+
return result;
|
|
29
|
+
};
|
|
30
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
31
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
32
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
33
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
34
|
+
var base_modal_exports = {};
|
|
35
|
+
__export(base_modal_exports, {
|
|
36
|
+
BaseModal: () => BaseModal
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(base_modal_exports);
|
|
39
|
+
var import_lit = require("lit");
|
|
40
|
+
var import_decorators = require("lit/decorators.js");
|
|
41
|
+
var import_utils = require("@mysten/utils");
|
|
42
|
+
var _isOpen, _isOpening, _isConnected, _nextClickIsFromContent, _keyDownHandler;
|
|
43
|
+
class BaseModal extends import_lit.LitElement {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments);
|
|
46
|
+
__privateAdd(this, _isOpen, false);
|
|
47
|
+
__privateAdd(this, _isOpening, false);
|
|
48
|
+
__privateAdd(this, _isConnected, (0, import_utils.promiseWithResolvers)());
|
|
49
|
+
__privateAdd(this, _nextClickIsFromContent, false);
|
|
50
|
+
this.disabled = false;
|
|
51
|
+
__privateAdd(this, _keyDownHandler, (e) => {
|
|
52
|
+
if (e.key === "Escape" && this.open) {
|
|
53
|
+
this.handleCancel(e);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
get open() {
|
|
58
|
+
return __privateGet(this, _isOpen);
|
|
59
|
+
}
|
|
60
|
+
set open(open) {
|
|
61
|
+
if (open === __privateGet(this, _isOpen)) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
__privateSet(this, _isOpen, open);
|
|
65
|
+
if (__privateGet(this, _isOpen)) {
|
|
66
|
+
this.setAttribute("open", "");
|
|
67
|
+
this.show();
|
|
68
|
+
} else {
|
|
69
|
+
this.removeAttribute("open");
|
|
70
|
+
this.close();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
get _isClosing() {
|
|
74
|
+
return !!this._closingResolvers;
|
|
75
|
+
}
|
|
76
|
+
firstUpdated(changedProperties) {
|
|
77
|
+
super.firstUpdated(changedProperties);
|
|
78
|
+
this._dialog.addEventListener("keydown", __privateGet(this, _keyDownHandler), { capture: true });
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Opens the dialog and fires a cancelable `open` event. An `opened` event
|
|
82
|
+
* is fired after the dialog opens.
|
|
83
|
+
*
|
|
84
|
+
* @return A `Promise` that resolves after the `opened` event was fired.
|
|
85
|
+
*/
|
|
86
|
+
async show() {
|
|
87
|
+
this._closingResolvers?.resolve();
|
|
88
|
+
this._closingResolvers = void 0;
|
|
89
|
+
__privateSet(this, _isOpening, true);
|
|
90
|
+
await __privateGet(this, _isConnected).promise;
|
|
91
|
+
await this.updateComplete;
|
|
92
|
+
if (this._dialog.open || !__privateGet(this, _isOpening)) {
|
|
93
|
+
__privateSet(this, _isOpening, false);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const wasDispatched = this.dispatchEvent(new Event("open", { cancelable: true }));
|
|
97
|
+
if (!wasDispatched) {
|
|
98
|
+
this.open = false;
|
|
99
|
+
__privateSet(this, _isOpening, false);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
this._dialog.showModal();
|
|
103
|
+
this.open = true;
|
|
104
|
+
this.dispatchEvent(new Event("opened"));
|
|
105
|
+
__privateSet(this, _isOpening, false);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Closes the dialog and fires a cancelable `close` event. After a dialog's
|
|
109
|
+
* animation, a `closed` event is fired.
|
|
110
|
+
*
|
|
111
|
+
*/
|
|
112
|
+
async close() {
|
|
113
|
+
if (this._closingResolvers) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
__privateSet(this, _isOpening, false);
|
|
117
|
+
if (!this.isConnected) {
|
|
118
|
+
this.open = false;
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
await this.updateComplete;
|
|
122
|
+
if (!this._dialog.open || __privateGet(this, _isOpening)) {
|
|
123
|
+
this.open = false;
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const wasDispatched = this.dispatchEvent(new Event("close", { cancelable: true }));
|
|
127
|
+
if (!wasDispatched) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this._closingResolvers = (0, import_utils.promiseWithResolvers)();
|
|
131
|
+
this.open = false;
|
|
132
|
+
return this._closingResolvers.promise;
|
|
133
|
+
}
|
|
134
|
+
handleAnimationEnd(e) {
|
|
135
|
+
if (e.animationName === "fadeOut" && !this.open && this._dialog.open && this._closingResolvers) {
|
|
136
|
+
this._closingResolvers.resolve();
|
|
137
|
+
this._closingResolvers = void 0;
|
|
138
|
+
this._dialog.close();
|
|
139
|
+
this.dispatchEvent(new Event("closed"));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
connectedCallback() {
|
|
143
|
+
super.connectedCallback();
|
|
144
|
+
__privateGet(this, _isConnected).resolve();
|
|
145
|
+
}
|
|
146
|
+
disconnectedCallback() {
|
|
147
|
+
super.disconnectedCallback();
|
|
148
|
+
__privateSet(this, _isConnected, Promise.withResolvers());
|
|
149
|
+
this._dialog.removeEventListener("keydown", __privateGet(this, _keyDownHandler), { capture: true });
|
|
150
|
+
}
|
|
151
|
+
handleContentClick() {
|
|
152
|
+
__privateSet(this, _nextClickIsFromContent, true);
|
|
153
|
+
}
|
|
154
|
+
handleDialogClick() {
|
|
155
|
+
if (__privateGet(this, _nextClickIsFromContent)) {
|
|
156
|
+
__privateSet(this, _nextClickIsFromContent, false);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
this.handleCancel();
|
|
160
|
+
}
|
|
161
|
+
handleCancel(e) {
|
|
162
|
+
if (this.disabled || this._closingResolvers) {
|
|
163
|
+
e?.preventDefault();
|
|
164
|
+
e?.stopPropagation();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const wasDispatched = this.dispatchEvent(new Event("cancel", { cancelable: true }));
|
|
168
|
+
if (!wasDispatched) {
|
|
169
|
+
e?.preventDefault();
|
|
170
|
+
e?.stopPropagation();
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
this.close();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
_isOpen = new WeakMap();
|
|
177
|
+
_isOpening = new WeakMap();
|
|
178
|
+
_isConnected = new WeakMap();
|
|
179
|
+
_nextClickIsFromContent = new WeakMap();
|
|
180
|
+
_keyDownHandler = new WeakMap();
|
|
181
|
+
BaseModal.shadowRootOptions = {
|
|
182
|
+
...import_lit.LitElement.shadowRootOptions,
|
|
183
|
+
delegatesFocus: true
|
|
184
|
+
};
|
|
185
|
+
__decorateClass([
|
|
186
|
+
(0, import_decorators.property)({ type: Boolean })
|
|
187
|
+
], BaseModal.prototype, "open", 1);
|
|
188
|
+
__decorateClass([
|
|
189
|
+
(0, import_decorators.property)()
|
|
190
|
+
], BaseModal.prototype, "disabled", 2);
|
|
191
|
+
__decorateClass([
|
|
192
|
+
(0, import_decorators.query)("dialog")
|
|
193
|
+
], BaseModal.prototype, "_dialog", 2);
|
|
194
|
+
__decorateClass([
|
|
195
|
+
(0, import_decorators.state)()
|
|
196
|
+
], BaseModal.prototype, "_closingResolvers", 2);
|
|
197
|
+
//# sourceMappingURL=base-modal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/base-modal.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LitElement } from 'lit';\nimport type { PropertyValues } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { promiseWithResolvers } from '@mysten/utils';\nimport type { PromiseWithResolvers } from '@mysten/utils';\n\nexport class BaseModal extends LitElement {\n\t#isOpen = false;\n\t#isOpening = false;\n\t#isConnected = promiseWithResolvers<void>();\n\t#nextClickIsFromContent = false;\n\n\tstatic override shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tdelegatesFocus: true,\n\t};\n\n\t/**\n\t * Opens the dialog when set to `true` and closes it when set to `false`.\n\t */\n\t@property({ type: Boolean })\n\tget open() {\n\t\treturn this.#isOpen;\n\t}\n\n\tset open(open: boolean) {\n\t\tif (open === this.#isOpen) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#isOpen = open;\n\t\tif (this.#isOpen) {\n\t\t\tthis.setAttribute('open', '');\n\t\t\tthis.show();\n\t\t} else {\n\t\t\tthis.removeAttribute('open');\n\t\t\tthis.close();\n\t\t}\n\t}\n\t@property()\n\tdisabled: boolean = false;\n\n\t@query('dialog')\n\tprivate readonly _dialog!: HTMLDialogElement;\n\n\t@state()\n\tprotected _closingResolvers?: PromiseWithResolvers<void>;\n\n\t#keyDownHandler = (e: KeyboardEvent) => {\n\t\tif (e.key === 'Escape' && this.open) {\n\t\t\tthis.handleCancel(e);\n\t\t}\n\t};\n\n\tprotected get _isClosing() {\n\t\treturn !!this._closingResolvers;\n\t}\n\n\toverride firstUpdated(changedProperties: PropertyValues) {\n\t\tsuper.firstUpdated(changedProperties);\n\t\t// NOTE: there is a bug in Chrome where even after canceling the dialog cancel event still closes the dialog. (The second time the user clicks escape)\n\t\t// Using this handler to mitigate this issue.\n\t\tthis._dialog.addEventListener('keydown', this.#keyDownHandler, { capture: true });\n\t}\n\n\t/**\n\t * Opens the dialog and fires a cancelable `open` event. An `opened` event\n\t * is fired after the dialog opens.\n\t *\n\t * @return A `Promise` that resolves after the `opened` event was fired.\n\t */\n\tasync show() {\n\t\tthis._closingResolvers?.resolve();\n\t\tthis._closingResolvers = undefined;\n\t\tthis.#isOpening = true;\n\n\t\t// Dialogs can be opened before being attached to the DOM, so we need to\n\t\t// wait until we're connected before calling `showModal()`.\n\t\tawait this.#isConnected.promise;\n\t\tawait this.updateComplete;\n\n\t\t// Check if already opened or if `dialog.close()` was called while awaiting.\n\t\tif (this._dialog.open || !this.#isOpening) {\n\t\t\tthis.#isOpening = false;\n\t\t\treturn;\n\t\t}\n\n\t\tconst wasDispatched = this.dispatchEvent(new Event('open', { cancelable: true }));\n\t\tif (!wasDispatched) {\n\t\t\tthis.open = false;\n\t\t\tthis.#isOpening = false;\n\t\t\treturn;\n\t\t}\n\n\t\tthis._dialog.showModal();\n\t\tthis.open = true;\n\n\t\tthis.dispatchEvent(new Event('opened'));\n\t\tthis.#isOpening = false;\n\t}\n\n\t/**\n\t * Closes the dialog and fires a cancelable `close` event. After a dialog's\n\t * animation, a `closed` event is fired.\n\t *\n\t */\n\tasync close() {\n\t\tif (this._closingResolvers) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#isOpening = false;\n\n\t\tif (!this.isConnected) {\n\t\t\t// Disconnected dialogs do not fire close events or animate.\n\t\t\tthis.open = false;\n\t\t\treturn;\n\t\t}\n\n\t\tawait this.updateComplete;\n\n\t\t// Check if already closed or if `dialog.show()` was called while awaiting.\n\t\tif (!this._dialog.open || this.#isOpening) {\n\t\t\tthis.open = false;\n\t\t\treturn;\n\t\t}\n\n\t\tconst wasDispatched = this.dispatchEvent(new Event('close', { cancelable: true }));\n\t\tif (!wasDispatched) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._closingResolvers = promiseWithResolvers<void>();\n\t\tthis.open = false;\n\n\t\treturn this._closingResolvers.promise;\n\t}\n\n\tprotected handleAnimationEnd(e: AnimationEvent) {\n\t\tif (\n\t\t\te.animationName === 'fadeOut' &&\n\t\t\t!this.open &&\n\t\t\tthis._dialog.open &&\n\t\t\tthis._closingResolvers\n\t\t) {\n\t\t\tthis._closingResolvers.resolve();\n\t\t\tthis._closingResolvers = undefined;\n\t\t\tthis._dialog.close();\n\t\t\tthis.dispatchEvent(new Event('closed'));\n\t\t}\n\t}\n\n\toverride connectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.#isConnected.resolve();\n\t}\n\n\toverride disconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t\tthis.#isConnected = Promise.withResolvers<void>();\n\t\tthis._dialog.removeEventListener('keydown', this.#keyDownHandler, { capture: true });\n\t}\n\n\tprotected handleContentClick() {\n\t\tthis.#nextClickIsFromContent = true;\n\t}\n\n\tprotected handleDialogClick() {\n\t\tif (this.#nextClickIsFromContent) {\n\t\t\t// This trick uses event bubbling to determine whether or not the click originated\n\t\t\t// from the dialog content or dialog backdrop psuedo-element. If you click the dialog\n\t\t\t// content, then `nextClickIsFromContent` will be set to true and we'll early exit.\n\t\t\tthis.#nextClickIsFromContent = false;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.handleCancel();\n\t}\n\n\tprotected handleCancel(e?: Event) {\n\t\tif (this.disabled || this._closingResolvers) {\n\t\t\te?.preventDefault();\n\t\t\te?.stopPropagation();\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst wasDispatched = this.dispatchEvent(new Event('cancel', { cancelable: true }));\n\n\t\tif (!wasDispatched) {\n\t\t\te?.preventDefault();\n\t\t\te?.stopPropagation();\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.close();\n\t}\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseModal } from './base-modal.js';
|
|
2
|
+
/**
|
|
3
|
+
* A modal component for displaying wallet operation request fallback UI.
|
|
4
|
+
*
|
|
5
|
+
* @element enoki-connect-modal
|
|
6
|
+
*
|
|
7
|
+
* @prop {string} walletName - The name of the wallet.
|
|
8
|
+
* @prop {string} dappName - The name of the dapp.
|
|
9
|
+
* @prop {boolean} disabled - Whether the modal is disabled.
|
|
10
|
+
* @prop {boolean} open - Whether the modal is open.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
export declare class EnokiConnectModal extends BaseModal {
|
|
14
|
+
#private;
|
|
15
|
+
static styles: import("lit").CSSResult;
|
|
16
|
+
walletName: string;
|
|
17
|
+
dappName: string;
|
|
18
|
+
render(): import("lit").TemplateResult<1>;
|
|
19
|
+
}
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
'enoki-connect-modal': EnokiConnectModal;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __typeError = (msg) => {
|
|
7
|
+
throw TypeError(msg);
|
|
8
|
+
};
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
23
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
24
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
25
|
+
if (decorator = decorators[i])
|
|
26
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
27
|
+
if (kind && result) __defProp(target, key, result);
|
|
28
|
+
return result;
|
|
29
|
+
};
|
|
30
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
31
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
32
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
33
|
+
var modal_exports = {};
|
|
34
|
+
__export(modal_exports, {
|
|
35
|
+
EnokiConnectModal: () => EnokiConnectModal
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(modal_exports);
|
|
38
|
+
var import_lit = require("lit");
|
|
39
|
+
var import_decorators = require("lit/decorators.js");
|
|
40
|
+
var import_base_modal = require("./base-modal.js");
|
|
41
|
+
var _EnokiConnectModal_instances, handleContinue_fn;
|
|
42
|
+
let EnokiConnectModal = class extends import_base_modal.BaseModal {
|
|
43
|
+
constructor() {
|
|
44
|
+
super(...arguments);
|
|
45
|
+
__privateAdd(this, _EnokiConnectModal_instances);
|
|
46
|
+
this.walletName = "";
|
|
47
|
+
this.dappName = "";
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
return import_lit.html`<dialog
|
|
51
|
+
@click=${this.handleDialogClick}
|
|
52
|
+
@cancel=${this.handleCancel}
|
|
53
|
+
class="modal${this._isClosing ? " closing" : ""}"
|
|
54
|
+
@animationend=${this.handleAnimationEnd}
|
|
55
|
+
>
|
|
56
|
+
<div class="content" @click=${this.handleContentClick}>
|
|
57
|
+
<button
|
|
58
|
+
class="close"
|
|
59
|
+
@click=${this.handleCancel}
|
|
60
|
+
?disabled=${this.disabled || this._isClosing}
|
|
61
|
+
>
|
|
62
|
+
<svg
|
|
63
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
64
|
+
viewBox="0 0 24 24"
|
|
65
|
+
fill="none"
|
|
66
|
+
stroke="currentColor"
|
|
67
|
+
stroke-width="2"
|
|
68
|
+
stroke-linecap="round"
|
|
69
|
+
stroke-linejoin="round"
|
|
70
|
+
class="lucide lucide-x"
|
|
71
|
+
>
|
|
72
|
+
<path d="M18 6 6 18" />
|
|
73
|
+
<path d="m6 6 12 12" />
|
|
74
|
+
</svg>
|
|
75
|
+
</button>
|
|
76
|
+
<h1 class="title capitalize">${this.walletName} Operation Request</h1>
|
|
77
|
+
<p class="description">
|
|
78
|
+
<span class="capitalize bold">${this.dappName}</span> requested a wallet operation. Click
|
|
79
|
+
continue to open <span class="wallet-name bold">${this.walletName}</span> (in a new tab)
|
|
80
|
+
and review the request.
|
|
81
|
+
</p>
|
|
82
|
+
<div class="footer">
|
|
83
|
+
<button
|
|
84
|
+
class="btn secondary"
|
|
85
|
+
@click=${this.handleCancel}
|
|
86
|
+
?disabled=${this.disabled || this._isClosing}
|
|
87
|
+
>
|
|
88
|
+
Cancel
|
|
89
|
+
</button>
|
|
90
|
+
<button
|
|
91
|
+
class="btn primary"
|
|
92
|
+
@click=${__privateMethod(this, _EnokiConnectModal_instances, handleContinue_fn)}
|
|
93
|
+
?disabled=${this.disabled || this._isClosing}
|
|
94
|
+
>
|
|
95
|
+
Continue
|
|
96
|
+
</button>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</dialog>`;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
_EnokiConnectModal_instances = new WeakSet();
|
|
103
|
+
handleContinue_fn = function() {
|
|
104
|
+
this.dispatchEvent(new CustomEvent("approved"));
|
|
105
|
+
};
|
|
106
|
+
EnokiConnectModal.styles = import_lit.css`
|
|
107
|
+
:host {
|
|
108
|
+
--modal-font-family: var(
|
|
109
|
+
--font-family,
|
|
110
|
+
ui-sans-serif,
|
|
111
|
+
system-ui,
|
|
112
|
+
-apple-system,
|
|
113
|
+
BlinkMacSystemFont,
|
|
114
|
+
'Segoe UI',
|
|
115
|
+
Roboto,
|
|
116
|
+
'Helvetica Neue',
|
|
117
|
+
Arial,
|
|
118
|
+
'Noto Sans',
|
|
119
|
+
sans-serif,
|
|
120
|
+
'Apple Color Emoji',
|
|
121
|
+
'Segoe UI Emoji',
|
|
122
|
+
'Segoe UI Symbol',
|
|
123
|
+
'Noto Color Emoji'
|
|
124
|
+
);
|
|
125
|
+
--modal-radius: var(--radius, 0.625rem);
|
|
126
|
+
--modal-background: var(--popover, oklch(1 0 0));
|
|
127
|
+
--modal-foreground: var(--popover-foreground, oklch(0.145 0 0));
|
|
128
|
+
--modal-backdrop: oklch(from var(--modal-background) l c h / 0.4);
|
|
129
|
+
--modal-box-shadow: 0 1px 10px oklch(from var(--modal-foreground) l c h / 0.01);
|
|
130
|
+
--modal-primary: var(--primary, oklch(0.205 0 0));
|
|
131
|
+
--modal-primary-foreground: var(--primary-foreground, oklch(0.985 0 0));
|
|
132
|
+
--modal-primary-hover: color-mix(in oklch, var(--modal-primary) 85%, white);
|
|
133
|
+
--modal-secondary: var(--secondary, oklch(0.97 0 0));
|
|
134
|
+
--modal-secondary-foreground: var(--secondary-foreground, oklch(0.205 0 0));
|
|
135
|
+
--modal-secondary-hover: color-mix(in oklch, var(--modal-secondary) 85%, white);
|
|
136
|
+
--modal-muted-foreground: var(--muted-foreground, oklch(0.556 0 0));
|
|
137
|
+
--modal-accent: var(--accent, oklch(0.97 0 0));
|
|
138
|
+
--modal-accent-foreground: var(--accent-foreground, oklch(0.205 0 0));
|
|
139
|
+
}
|
|
140
|
+
.modal {
|
|
141
|
+
color: var(--modal-foreground);
|
|
142
|
+
border: none;
|
|
143
|
+
animation: fadeIn 250ms ease-in-out forwards;
|
|
144
|
+
max-width: 320px;
|
|
145
|
+
background-color: var(--modal-background);
|
|
146
|
+
border-radius: var(--modal-radius);
|
|
147
|
+
box-shadow: var(--modal-box-shadow);
|
|
148
|
+
padding: 0;
|
|
149
|
+
font-family: var(--modal-font-family);
|
|
150
|
+
}
|
|
151
|
+
.modal::backdrop {
|
|
152
|
+
background-color: var(--modal-backdrop);
|
|
153
|
+
}
|
|
154
|
+
.content {
|
|
155
|
+
padding: 20px;
|
|
156
|
+
display: flex;
|
|
157
|
+
flex-direction: column;
|
|
158
|
+
gap: 10px;
|
|
159
|
+
}
|
|
160
|
+
.capitalize {
|
|
161
|
+
text-transform: capitalize;
|
|
162
|
+
}
|
|
163
|
+
.bold {
|
|
164
|
+
font-weight: 800;
|
|
165
|
+
}
|
|
166
|
+
.title {
|
|
167
|
+
font-size: 16px;
|
|
168
|
+
font-weight: 600;
|
|
169
|
+
line-height: 1.5;
|
|
170
|
+
color: var(--modal-foreground);
|
|
171
|
+
margin: 0;
|
|
172
|
+
}
|
|
173
|
+
.description {
|
|
174
|
+
font-size: 14px;
|
|
175
|
+
line-height: 1.5;
|
|
176
|
+
color: var(--modal-muted-foreground);
|
|
177
|
+
margin: 0;
|
|
178
|
+
}
|
|
179
|
+
.footer {
|
|
180
|
+
display: flex;
|
|
181
|
+
justify-content: flex-end;
|
|
182
|
+
align-items: center;
|
|
183
|
+
gap: 10px;
|
|
184
|
+
}
|
|
185
|
+
.btn {
|
|
186
|
+
border: none;
|
|
187
|
+
border-radius: 6px;
|
|
188
|
+
padding: 8px 14px;
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
transition: background 0.2s;
|
|
191
|
+
font-size: 13px;
|
|
192
|
+
font-weight: 600;
|
|
193
|
+
}
|
|
194
|
+
.btn.primary {
|
|
195
|
+
background: var(--modal-primary);
|
|
196
|
+
color: var(--modal-primary-foreground);
|
|
197
|
+
}
|
|
198
|
+
.btn.primary:hover,
|
|
199
|
+
.btn.primary:focus,
|
|
200
|
+
.btn.primary:active {
|
|
201
|
+
background: var(--modal-primary-hover);
|
|
202
|
+
}
|
|
203
|
+
.btn.secondary {
|
|
204
|
+
background: var(--modal-secondary);
|
|
205
|
+
color: var(--modal-secondary-foreground);
|
|
206
|
+
}
|
|
207
|
+
.btn.secondary:hover,
|
|
208
|
+
.btn.secondary:focus,
|
|
209
|
+
.btn.secondary:active {
|
|
210
|
+
background: var(--modal-secondary-hover);
|
|
211
|
+
}
|
|
212
|
+
button:disabled {
|
|
213
|
+
opacity: 0.5;
|
|
214
|
+
cursor: default;
|
|
215
|
+
}
|
|
216
|
+
.close {
|
|
217
|
+
all: unset;
|
|
218
|
+
position: absolute;
|
|
219
|
+
top: 5px;
|
|
220
|
+
right: 5px;
|
|
221
|
+
background: transparent;
|
|
222
|
+
color: var(--modal-muted-foreground);
|
|
223
|
+
border: none;
|
|
224
|
+
cursor: pointer;
|
|
225
|
+
width: 18px;
|
|
226
|
+
height: 18px;
|
|
227
|
+
border-radius: var(--modal-radius);
|
|
228
|
+
padding: 3px;
|
|
229
|
+
transition: background 0.2s;
|
|
230
|
+
}
|
|
231
|
+
.close:hover,
|
|
232
|
+
.close:focus,
|
|
233
|
+
.close:active {
|
|
234
|
+
background: var(--modal-accent);
|
|
235
|
+
color: var(--modal-accent-foreground);
|
|
236
|
+
}
|
|
237
|
+
.modal.closing {
|
|
238
|
+
animation: fadeOut 250ms ease-in-out forwards;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
@keyframes fadeIn {
|
|
242
|
+
from {
|
|
243
|
+
transform: translateY(-20px) scale(0.8);
|
|
244
|
+
opacity: 0;
|
|
245
|
+
}
|
|
246
|
+
to {
|
|
247
|
+
opacity: 1;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
@keyframes fadeOut {
|
|
251
|
+
from {
|
|
252
|
+
opacity: 1;
|
|
253
|
+
}
|
|
254
|
+
to {
|
|
255
|
+
transform: translateY(20px) scale(0.8);
|
|
256
|
+
opacity: 0;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
`;
|
|
260
|
+
__decorateClass([
|
|
261
|
+
(0, import_decorators.property)()
|
|
262
|
+
], EnokiConnectModal.prototype, "walletName", 2);
|
|
263
|
+
__decorateClass([
|
|
264
|
+
(0, import_decorators.property)()
|
|
265
|
+
], EnokiConnectModal.prototype, "dappName", 2);
|
|
266
|
+
EnokiConnectModal = __decorateClass([
|
|
267
|
+
(0, import_decorators.customElement)("enoki-connect-modal")
|
|
268
|
+
], EnokiConnectModal);
|
|
269
|
+
//# sourceMappingURL=modal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/modal.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { BaseModal } from './base-modal.js';\n\n/**\n * A modal component for displaying wallet operation request fallback UI.\n *\n * @element enoki-connect-modal\n *\n * @prop {string} walletName - The name of the wallet.\n * @prop {string} dappName - The name of the dapp.\n * @prop {boolean} disabled - Whether the modal is disabled.\n * @prop {boolean} open - Whether the modal is open.\n *\n */\n@customElement('enoki-connect-modal')\nexport class EnokiConnectModal extends BaseModal {\n\tstatic styles = css`\n\t\t:host {\n\t\t\t--modal-font-family: var(\n\t\t\t\t--font-family,\n\t\t\t\tui-sans-serif,\n\t\t\t\tsystem-ui,\n\t\t\t\t-apple-system,\n\t\t\t\tBlinkMacSystemFont,\n\t\t\t\t'Segoe UI',\n\t\t\t\tRoboto,\n\t\t\t\t'Helvetica Neue',\n\t\t\t\tArial,\n\t\t\t\t'Noto Sans',\n\t\t\t\tsans-serif,\n\t\t\t\t'Apple Color Emoji',\n\t\t\t\t'Segoe UI Emoji',\n\t\t\t\t'Segoe UI Symbol',\n\t\t\t\t'Noto Color Emoji'\n\t\t\t);\n\t\t\t--modal-radius: var(--radius, 0.625rem);\n\t\t\t--modal-background: var(--popover, oklch(1 0 0));\n\t\t\t--modal-foreground: var(--popover-foreground, oklch(0.145 0 0));\n\t\t\t--modal-backdrop: oklch(from var(--modal-background) l c h / 0.4);\n\t\t\t--modal-box-shadow: 0 1px 10px oklch(from var(--modal-foreground) l c h / 0.01);\n\t\t\t--modal-primary: var(--primary, oklch(0.205 0 0));\n\t\t\t--modal-primary-foreground: var(--primary-foreground, oklch(0.985 0 0));\n\t\t\t--modal-primary-hover: color-mix(in oklch, var(--modal-primary) 85%, white);\n\t\t\t--modal-secondary: var(--secondary, oklch(0.97 0 0));\n\t\t\t--modal-secondary-foreground: var(--secondary-foreground, oklch(0.205 0 0));\n\t\t\t--modal-secondary-hover: color-mix(in oklch, var(--modal-secondary) 85%, white);\n\t\t\t--modal-muted-foreground: var(--muted-foreground, oklch(0.556 0 0));\n\t\t\t--modal-accent: var(--accent, oklch(0.97 0 0));\n\t\t\t--modal-accent-foreground: var(--accent-foreground, oklch(0.205 0 0));\n\t\t}\n\t\t.modal {\n\t\t\tcolor: var(--modal-foreground);\n\t\t\tborder: none;\n\t\t\tanimation: fadeIn 250ms ease-in-out forwards;\n\t\t\tmax-width: 320px;\n\t\t\tbackground-color: var(--modal-background);\n\t\t\tborder-radius: var(--modal-radius);\n\t\t\tbox-shadow: var(--modal-box-shadow);\n\t\t\tpadding: 0;\n\t\t\tfont-family: var(--modal-font-family);\n\t\t}\n\t\t.modal::backdrop {\n\t\t\tbackground-color: var(--modal-backdrop);\n\t\t}\n\t\t.content {\n\t\t\tpadding: 20px;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 10px;\n\t\t}\n\t\t.capitalize {\n\t\t\ttext-transform: capitalize;\n\t\t}\n\t\t.bold {\n\t\t\tfont-weight: 800;\n\t\t}\n\t\t.title {\n\t\t\tfont-size: 16px;\n\t\t\tfont-weight: 600;\n\t\t\tline-height: 1.5;\n\t\t\tcolor: var(--modal-foreground);\n\t\t\tmargin: 0;\n\t\t}\n\t\t.description {\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 1.5;\n\t\t\tcolor: var(--modal-muted-foreground);\n\t\t\tmargin: 0;\n\t\t}\n\t\t.footer {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: flex-end;\n\t\t\talign-items: center;\n\t\t\tgap: 10px;\n\t\t}\n\t\t.btn {\n\t\t\tborder: none;\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 8px 14px;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.2s;\n\t\t\tfont-size: 13px;\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.btn.primary {\n\t\t\tbackground: var(--modal-primary);\n\t\t\tcolor: var(--modal-primary-foreground);\n\t\t}\n\t\t.btn.primary:hover,\n\t\t.btn.primary:focus,\n\t\t.btn.primary:active {\n\t\t\tbackground: var(--modal-primary-hover);\n\t\t}\n\t\t.btn.secondary {\n\t\t\tbackground: var(--modal-secondary);\n\t\t\tcolor: var(--modal-secondary-foreground);\n\t\t}\n\t\t.btn.secondary:hover,\n\t\t.btn.secondary:focus,\n\t\t.btn.secondary:active {\n\t\t\tbackground: var(--modal-secondary-hover);\n\t\t}\n\t\tbutton:disabled {\n\t\t\topacity: 0.5;\n\t\t\tcursor: default;\n\t\t}\n\t\t.close {\n\t\t\tall: unset;\n\t\t\tposition: absolute;\n\t\t\ttop: 5px;\n\t\t\tright: 5px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--modal-muted-foreground);\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\twidth: 18px;\n\t\t\theight: 18px;\n\t\t\tborder-radius: var(--modal-radius);\n\t\t\tpadding: 3px;\n\t\t\ttransition: background 0.2s;\n\t\t}\n\t\t.close:hover,\n\t\t.close:focus,\n\t\t.close:active {\n\t\t\tbackground: var(--modal-accent);\n\t\t\tcolor: var(--modal-accent-foreground);\n\t\t}\n\t\t.modal.closing {\n\t\t\tanimation: fadeOut 250ms ease-in-out forwards;\n\t\t}\n\n\t\t@keyframes fadeIn {\n\t\t\tfrom {\n\t\t\t\ttransform: translateY(-20px) scale(0.8);\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tto {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\t\t@keyframes fadeOut {\n\t\t\tfrom {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\tto {\n\t\t\t\ttransform: translateY(20px) scale(0.8);\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t}\n\t`;\n\n\t@property()\n\twalletName: string = '';\n\t@property()\n\tdappName: string = '';\n\n\t#handleContinue() {\n\t\tthis.dispatchEvent(new CustomEvent('approved'));\n\t}\n\n\toverride render() {\n\t\treturn html`<dialog\n\t\t\t@click=${this.handleDialogClick}\n\t\t\t@cancel=${this.handleCancel}\n\t\t\tclass=\"modal${this._isClosing ? ' closing' : ''}\"\n\t\t\t@animationend=${this.handleAnimationEnd}\n\t\t>\n\t\t\t<div class=\"content\" @click=${this.handleContentClick}>\n\t\t\t\t<button\n\t\t\t\t\tclass=\"close\"\n\t\t\t\t\t@click=${this.handleCancel}\n\t\t\t\t\t?disabled=${this.disabled || this._isClosing}\n\t\t\t\t>\n\t\t\t\t\t<svg\n\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\tclass=\"lucide lucide-x\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path d=\"M18 6 6 18\" />\n\t\t\t\t\t\t<path d=\"m6 6 12 12\" />\n\t\t\t\t\t</svg>\n\t\t\t\t</button>\n\t\t\t\t<h1 class=\"title capitalize\">${this.walletName} Operation Request</h1>\n\t\t\t\t<p class=\"description\">\n\t\t\t\t\t<span class=\"capitalize bold\">${this.dappName}</span> requested a wallet operation. Click\n\t\t\t\t\tcontinue to open <span class=\"wallet-name bold\">${this.walletName}</span> (in a new tab)\n\t\t\t\t\tand review the request.\n\t\t\t\t</p>\n\t\t\t\t<div class=\"footer\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"btn secondary\"\n\t\t\t\t\t\t@click=${this.handleCancel}\n\t\t\t\t\t\t?disabled=${this.disabled || this._isClosing}\n\t\t\t\t\t>\n\t\t\t\t\t\tCancel\n\t\t\t\t\t</button>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"btn primary\"\n\t\t\t\t\t\t@click=${this.#handleContinue}\n\t\t\t\t\t\t?disabled=${this.disabled || this._isClosing}\n\t\t\t\t\t>\n\t\t\t\t\t\tContinue\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</dialog>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'enoki-connect-modal': EnokiConnectModal;\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAA0B;AAC1B,wBAAwC;AACxC,wBAA0B;AAJ1B;AAkBO,IAAM,oBAAN,cAAgC,4BAAU;AAAA,EAA1C;AAAA;AAAA;AA6JN,sBAAqB;AAErB,oBAAmB;AAAA;AAAA,EAMV,SAAS;AACjB,WAAO;AAAA,YACG,KAAK,iBAAiB;AAAA,aACrB,KAAK,YAAY;AAAA,iBACb,KAAK,aAAa,aAAa,EAAE;AAAA,mBAC/B,KAAK,kBAAkB;AAAA;AAAA,iCAET,KAAK,kBAAkB;AAAA;AAAA;AAAA,cAG1C,KAAK,YAAY;AAAA,iBACd,KAAK,YAAY,KAAK,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAgBd,KAAK,UAAU;AAAA;AAAA,qCAEb,KAAK,QAAQ;AAAA,uDACK,KAAK,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAMvD,KAAK,YAAY;AAAA,kBACd,KAAK,YAAY,KAAK,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAMnC,sBAAK,gDAAe;AAAA,kBACjB,KAAK,YAAY,KAAK,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOjD;AACD;AAzNO;AAiKN,oBAAe,WAAG;AACjB,OAAK,cAAc,IAAI,YAAY,UAAU,CAAC;AAC/C;AAnKY,kBACL,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4JhB;AAAA,MADC,4BAAS;AAAA,GA5JE,kBA6JZ;AAEA;AAAA,MADC,4BAAS;AAAA,GA9JE,kBA+JZ;AA/JY,oBAAN;AAAA,MADN,iCAAc,qBAAqB;AAAA,GACvB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cjs/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature, SuiSignAndExecuteTransactionFeature, SuiSignPersonalMessageFeature, SuiSignTransactionBlockFeature, SuiSignTransactionFeature, Wallet, WalletIcon } from '@mysten/wallet-standard';
|
|
2
2
|
import { ReadonlyWalletAccount } from '@mysten/wallet-standard';
|
|
3
|
+
import '../components/modal.js';
|
|
3
4
|
export type SupportedNetwork = 'mainnet' | 'testnet' | 'devnet';
|
|
4
5
|
export declare class EnokiConnectWallet implements Wallet {
|
|
5
6
|
#private;
|