@metamask/snaps-sdk 4.1.0 → 4.3.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 +21 -1
- package/dist/index.js +59 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +59 -6
- package/dist/index.mjs.map +1 -1
- package/dist/jsx/index.js +99 -34
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +101 -35
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/jsx-dev-runtime.js +52 -4
- package/dist/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx/jsx-dev-runtime.mjs +54 -5
- package/dist/jsx/jsx-dev-runtime.mjs.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/jsx/components/Box.d.ts +4 -0
- package/dist/types/jsx/components/Row.d.ts +2 -1
- package/dist/types/jsx/components/Value.d.ts +31 -0
- package/dist/types/jsx/components/form/Dropdown.d.ts +40 -0
- package/dist/types/jsx/components/form/Field.d.ts +4 -1
- package/dist/types/jsx/components/form/Option.d.ts +35 -0
- package/dist/types/jsx/components/form/index.d.ts +5 -1
- package/dist/types/jsx/components/index.d.ts +3 -1
- package/dist/types/jsx/index.d.ts +1 -1
- package/dist/types/jsx/validation.d.ts +66 -2
- package/dist/types/types/handlers/user-input.d.ts +2 -0
- package/dist/types/types/interface.d.ts +23 -1
- package/dist/types/types/methods/create-interface.d.ts +2 -1
- package/dist/types/types/permissions.d.ts +2 -1
- package/jsx-dev-runtime.d.ts +1 -0
- package/jsx-runtime.d.ts +1 -0
- package/jsx.d.ts +1 -0
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [4.3.0]
|
|
10
|
+
### Added
|
|
11
|
+
- Add `Value` component ([#2435](https://github.com/MetaMask/snaps/pull/2435))
|
|
12
|
+
- Add `Dropdown` component ([#2420](https://github.com/MetaMask/snaps/pull/2420))
|
|
13
|
+
- Add positioning props to `Box` ([#2422](https://github.com/MetaMask/snaps/pull/2422))
|
|
14
|
+
- Allow `Button` within `Input` ([#2407](https://github.com/MetaMask/snaps/pull/2407))
|
|
15
|
+
- Add `context` field to `snap_createInterface` ([#2413](https://github.com/MetaMask/snaps/pull/2413), [#2427](https://github.com/MetaMask/snaps/pull/2427))
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- Correct validation for children of Box component ([#2423](https://github.com/MetaMask/snaps/pull/2423))
|
|
19
|
+
|
|
20
|
+
## [4.2.0]
|
|
21
|
+
### Added
|
|
22
|
+
- Add support for BIP-32-Ed25519 / CIP-3 key derivation ([#2408](https://github.com/MetaMask/snaps/pull/2408))
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- Add missing TypeScript declarations for JSX entry points ([#2404](https://github.com/MetaMask/snaps/pull/2404))
|
|
26
|
+
|
|
9
27
|
## [4.1.0]
|
|
10
28
|
### Added
|
|
11
29
|
- Add JSX support for custom UI ([#2258](https://github.com/MetaMask/snaps/pull/2258), [#2379](https://github.com/MetaMask/snaps/pull/2379))
|
|
@@ -118,7 +136,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
118
136
|
### Added
|
|
119
137
|
- Initial release of this package.
|
|
120
138
|
|
|
121
|
-
[Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@4.
|
|
139
|
+
[Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@4.3.0...HEAD
|
|
140
|
+
[4.3.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@4.2.0...@metamask/snaps-sdk@4.3.0
|
|
141
|
+
[4.2.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@4.1.0...@metamask/snaps-sdk@4.2.0
|
|
122
142
|
[4.1.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@4.0.1...@metamask/snaps-sdk@4.1.0
|
|
123
143
|
[4.0.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@4.0.0...@metamask/snaps-sdk@4.0.1
|
|
124
144
|
[4.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@3.2.0...@metamask/snaps-sdk@4.0.0
|
package/dist/index.js
CHANGED
|
@@ -61,6 +61,7 @@ __export(src_exports, {
|
|
|
61
61
|
InputChangeEventStruct: () => InputChangeEventStruct,
|
|
62
62
|
InputStruct: () => InputStruct,
|
|
63
63
|
InputType: () => InputType,
|
|
64
|
+
InterfaceContextStruct: () => InterfaceContextStruct,
|
|
64
65
|
InterfaceStateStruct: () => InterfaceStateStruct,
|
|
65
66
|
InternalError: () => InternalError,
|
|
66
67
|
InvalidInputError: () => InvalidInputError,
|
|
@@ -91,7 +92,7 @@ __export(src_exports, {
|
|
|
91
92
|
UserInputEventType: () => UserInputEventType,
|
|
92
93
|
UserRejectedRequestError: () => UserRejectedRequestError,
|
|
93
94
|
address: () => address,
|
|
94
|
-
assert: () =>
|
|
95
|
+
assert: () => import_utils9.assert,
|
|
95
96
|
assertIsComponent: () => assertIsComponent,
|
|
96
97
|
button: () => button,
|
|
97
98
|
copyable: () => copyable,
|
|
@@ -342,7 +343,7 @@ function isSvg(svg2) {
|
|
|
342
343
|
}
|
|
343
344
|
|
|
344
345
|
// src/index.ts
|
|
345
|
-
var
|
|
346
|
+
var import_utils9 = require("@metamask/utils");
|
|
346
347
|
|
|
347
348
|
// src/error-wrappers.ts
|
|
348
349
|
var import_rpc_errors = require("@metamask/rpc-errors");
|
|
@@ -816,6 +817,7 @@ var NotificationType = /* @__PURE__ */ ((NotificationType2) => {
|
|
|
816
817
|
})(NotificationType || {});
|
|
817
818
|
|
|
818
819
|
// src/types/interface.ts
|
|
820
|
+
var import_utils8 = require("@metamask/utils");
|
|
819
821
|
var import_superstruct18 = require("superstruct");
|
|
820
822
|
|
|
821
823
|
// src/jsx/validation.ts
|
|
@@ -855,10 +857,23 @@ var InputStruct2 = element("Input", {
|
|
|
855
857
|
value: (0, import_superstruct17.optional)((0, import_superstruct17.string)()),
|
|
856
858
|
placeholder: (0, import_superstruct17.optional)((0, import_superstruct17.string)())
|
|
857
859
|
});
|
|
860
|
+
var OptionStruct = element("Option", {
|
|
861
|
+
value: (0, import_superstruct17.string)(),
|
|
862
|
+
children: (0, import_superstruct17.string)()
|
|
863
|
+
});
|
|
864
|
+
var DropdownStruct = element("Dropdown", {
|
|
865
|
+
name: (0, import_superstruct17.string)(),
|
|
866
|
+
value: (0, import_superstruct17.optional)((0, import_superstruct17.string)()),
|
|
867
|
+
children: maybeArray(OptionStruct)
|
|
868
|
+
});
|
|
858
869
|
var FieldStruct = element("Field", {
|
|
859
870
|
label: (0, import_superstruct17.optional)((0, import_superstruct17.string)()),
|
|
860
871
|
error: (0, import_superstruct17.optional)((0, import_superstruct17.string)()),
|
|
861
|
-
children:
|
|
872
|
+
children: nullUnion([
|
|
873
|
+
(0, import_superstruct17.tuple)([InputStruct2, ButtonStruct2]),
|
|
874
|
+
InputStruct2,
|
|
875
|
+
DropdownStruct
|
|
876
|
+
])
|
|
862
877
|
});
|
|
863
878
|
var FormStruct2 = element("Form", {
|
|
864
879
|
children: maybeArray(nullUnion([FieldStruct, ButtonStruct2])),
|
|
@@ -896,7 +911,17 @@ var AddressStruct2 = element("Address", {
|
|
|
896
911
|
var BoxStruct = element("Box", {
|
|
897
912
|
children: maybeArray(
|
|
898
913
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
899
|
-
(0, import_superstruct17.nullable)((0, import_superstruct17.lazy)(() =>
|
|
914
|
+
(0, import_superstruct17.nullable)((0, import_superstruct17.lazy)(() => BoxChildStruct))
|
|
915
|
+
),
|
|
916
|
+
direction: (0, import_superstruct17.optional)(nullUnion([literal("horizontal"), literal("vertical")])),
|
|
917
|
+
alignment: (0, import_superstruct17.optional)(
|
|
918
|
+
nullUnion([
|
|
919
|
+
literal("start"),
|
|
920
|
+
literal("center"),
|
|
921
|
+
literal("end"),
|
|
922
|
+
literal("space-between"),
|
|
923
|
+
literal("space-around")
|
|
924
|
+
])
|
|
900
925
|
)
|
|
901
926
|
});
|
|
902
927
|
var CopyableStruct2 = element("Copyable", {
|
|
@@ -904,6 +929,10 @@ var CopyableStruct2 = element("Copyable", {
|
|
|
904
929
|
sensitive: (0, import_superstruct17.optional)((0, import_superstruct17.boolean)())
|
|
905
930
|
});
|
|
906
931
|
var DividerStruct2 = element("Divider");
|
|
932
|
+
var ValueStruct = element("Value", {
|
|
933
|
+
value: (0, import_superstruct17.string)(),
|
|
934
|
+
extra: (0, import_superstruct17.string)()
|
|
935
|
+
});
|
|
907
936
|
var HeadingStruct2 = element("Heading", {
|
|
908
937
|
children: StringElementStruct
|
|
909
938
|
});
|
|
@@ -922,12 +951,31 @@ var TextStruct2 = element("Text", {
|
|
|
922
951
|
});
|
|
923
952
|
var RowStruct2 = element("Row", {
|
|
924
953
|
label: (0, import_superstruct17.string)(),
|
|
925
|
-
children: nullUnion([AddressStruct2, ImageStruct2, TextStruct2]),
|
|
954
|
+
children: nullUnion([AddressStruct2, ImageStruct2, TextStruct2, ValueStruct]),
|
|
926
955
|
variant: (0, import_superstruct17.optional)(
|
|
927
956
|
nullUnion([literal("default"), literal("warning"), literal("error")])
|
|
928
957
|
)
|
|
929
958
|
});
|
|
930
959
|
var SpinnerStruct2 = element("Spinner");
|
|
960
|
+
var BoxChildStruct = nullUnion([
|
|
961
|
+
ButtonStruct2,
|
|
962
|
+
InputStruct2,
|
|
963
|
+
FormStruct2,
|
|
964
|
+
BoldStruct,
|
|
965
|
+
ItalicStruct,
|
|
966
|
+
AddressStruct2,
|
|
967
|
+
BoxStruct,
|
|
968
|
+
CopyableStruct2,
|
|
969
|
+
DividerStruct2,
|
|
970
|
+
HeadingStruct2,
|
|
971
|
+
ImageStruct2,
|
|
972
|
+
LinkStruct,
|
|
973
|
+
RowStruct2,
|
|
974
|
+
SpinnerStruct2,
|
|
975
|
+
TextStruct2,
|
|
976
|
+
DropdownStruct
|
|
977
|
+
]);
|
|
978
|
+
var RootJSXElementStruct = BoxChildStruct;
|
|
931
979
|
var JSXElementStruct = nullUnion([
|
|
932
980
|
ButtonStruct2,
|
|
933
981
|
InputStruct2,
|
|
@@ -944,7 +992,10 @@ var JSXElementStruct = nullUnion([
|
|
|
944
992
|
LinkStruct,
|
|
945
993
|
RowStruct2,
|
|
946
994
|
SpinnerStruct2,
|
|
947
|
-
TextStruct2
|
|
995
|
+
TextStruct2,
|
|
996
|
+
DropdownStruct,
|
|
997
|
+
OptionStruct,
|
|
998
|
+
ValueStruct
|
|
948
999
|
]);
|
|
949
1000
|
|
|
950
1001
|
// src/types/interface.ts
|
|
@@ -955,6 +1006,7 @@ var InterfaceStateStruct = (0, import_superstruct18.record)(
|
|
|
955
1006
|
);
|
|
956
1007
|
var ComponentOrElementStruct = (0, import_superstruct18.union)([
|
|
957
1008
|
ComponentStruct,
|
|
958
|
-
|
|
1009
|
+
RootJSXElementStruct
|
|
959
1010
|
]);
|
|
1011
|
+
var InterfaceContextStruct = (0, import_superstruct18.record)((0, import_superstruct18.string)(), import_utils8.JsonStruct);
|
|
960
1012
|
//# sourceMappingURL=index.js.map
|