@metamask/snaps-sdk 1.3.1 → 1.3.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/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.3.2]
10
+ ### Fixed
11
+ - Fix missing `sensitive` property in `Copyable` type ([#2070](https://github.com/MetaMask/snaps/pull/2070))
12
+
9
13
  ## [1.3.1]
10
14
  ### Fixed
11
15
  - Export error wrappers ([#2043](https://github.com/MetaMask/snaps/pull/2043))
@@ -33,7 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
33
37
  ### Added
34
38
  - Initial release of this package.
35
39
 
36
- [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@1.3.1...HEAD
40
+ [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@1.3.2...HEAD
41
+ [1.3.2]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@1.3.1...@metamask/snaps-sdk@1.3.2
37
42
  [1.3.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@1.3.0...@metamask/snaps-sdk@1.3.1
38
43
  [1.3.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@1.2.0...@metamask/snaps-sdk@1.3.0
39
44
  [1.2.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@1.1.0...@metamask/snaps-sdk@1.2.0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ui/components/copyable.ts"],"sourcesContent":["import {\n assign,\n boolean,\n literal,\n object,\n optional,\n string,\n} from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\nimport type { Literal } from '../nodes';\n\n/**\n * Text that can be copied to the clipboard. It can optionally be marked as\n * sensitive, in which case it will only be displayed to the user after clicking\n * on the component.\n *\n * @property type - The type of the node. Must be the string `copyable`.\n * @property value - The text to be copied.\n * @property sensitive - Whether the value is sensitive or not. Sensitive values\n * are only displayed to the user after clicking on the component. Defaults to\n * false.\n */\nexport type Copyable = Literal & {\n type: NodeType.Copyable;\n value: string;\n};\n\nexport const CopyableStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Copyable),\n value: string(),\n sensitive: optional(boolean()),\n }),\n);\n\n/**\n * Create a {@link Copyable} component.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `text` property.\n * @param args.value - The text to be copied.\n * @param args.sensitive - Whether the value is sensitive or not. Sensitive\n * values are only displayed to the user after clicking on the component.\n * Defaults to false.\n * @returns A {@link Copyable} component.\n * @example\n * const node = copyable('Hello, world!');\n * const node = copyable({ value: 'Hello, world!' });\n */\nexport const copyable = createBuilder(NodeType.Copyable, CopyableStruct, [\n 'value',\n 'sensitive',\n]);\n"],"names":["CopyableStruct","copyable","assign","LiteralStruct","object","type","literal","NodeType","Copyable","value","string","sensitive","optional","boolean","createBuilder"],"mappings":";;;;;;;;;;;IA6BaA,cAAc;eAAdA;;IAuBAC,QAAQ;eAARA;;;6BA7CN;yBAEuB;uBACU;AAmBjC,MAAMD,iBAAiBE,IAAAA,mBAAM,EAClCC,oBAAa,EACbC,IAAAA,mBAAM,EAAC;IACLC,MAAMC,IAAAA,oBAAO,EAACC,eAAQ,CAACC,QAAQ;IAC/BC,OAAOC,IAAAA,mBAAM;IACbC,WAAWC,IAAAA,qBAAQ,EAACC,IAAAA,oBAAO;AAC7B;AAiBK,MAAMZ,WAAWa,IAAAA,sBAAa,EAACP,eAAQ,CAACC,QAAQ,EAAER,gBAAgB;IACvE;IACA;CACD"}
1
+ {"version":3,"sources":["../../../../src/ui/components/copyable.ts"],"sourcesContent":["import type { Infer } from 'superstruct';\nimport {\n assign,\n boolean,\n literal,\n object,\n optional,\n string,\n} from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const CopyableStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Copyable),\n value: string(),\n sensitive: optional(boolean()),\n }),\n);\n\n/**\n * Text that can be copied to the clipboard. It can optionally be marked as\n * sensitive, in which case it will only be displayed to the user after clicking\n * on the component.\n *\n * @property type - The type of the node. Must be the string `copyable`.\n * @property value - The text to be copied.\n * @property sensitive - Whether the value is sensitive or not. Sensitive values\n * are only displayed to the user after clicking on the component. Defaults to\n * false.\n */\nexport type Copyable = Infer<typeof CopyableStruct>;\n\n/**\n * Create a {@link Copyable} component.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `text` property.\n * @param args.value - The text to be copied.\n * @param args.sensitive - Whether the value is sensitive or not. Sensitive\n * values are only displayed to the user after clicking on the component.\n * Defaults to false.\n * @returns A {@link Copyable} component.\n * @example\n * const node = copyable('Hello, world!');\n * const node = copyable({ value: 'Hello, world!' });\n */\nexport const copyable = createBuilder(NodeType.Copyable, CopyableStruct, [\n 'value',\n 'sensitive',\n]);\n"],"names":["CopyableStruct","copyable","assign","LiteralStruct","object","type","literal","NodeType","Copyable","value","string","sensitive","optional","boolean","createBuilder"],"mappings":";;;;;;;;;;;IAaaA,cAAc;eAAdA;;IAoCAC,QAAQ;eAARA;;;6BAzCN;yBAEuB;uBACU;AAEjC,MAAMD,iBAAiBE,IAAAA,mBAAM,EAClCC,oBAAa,EACbC,IAAAA,mBAAM,EAAC;IACLC,MAAMC,IAAAA,oBAAO,EAACC,eAAQ,CAACC,QAAQ;IAC/BC,OAAOC,IAAAA,mBAAM;IACbC,WAAWC,IAAAA,qBAAQ,EAACC,IAAAA,oBAAO;AAC7B;AA8BK,MAAMZ,WAAWa,IAAAA,sBAAa,EAACP,eAAQ,CAACC,QAAQ,EAAER,gBAAgB;IACvE;IACA;CACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ui/components/copyable.ts"],"sourcesContent":["import {\n assign,\n boolean,\n literal,\n object,\n optional,\n string,\n} from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\nimport type { Literal } from '../nodes';\n\n/**\n * Text that can be copied to the clipboard. It can optionally be marked as\n * sensitive, in which case it will only be displayed to the user after clicking\n * on the component.\n *\n * @property type - The type of the node. Must be the string `copyable`.\n * @property value - The text to be copied.\n * @property sensitive - Whether the value is sensitive or not. Sensitive values\n * are only displayed to the user after clicking on the component. Defaults to\n * false.\n */\nexport type Copyable = Literal & {\n type: NodeType.Copyable;\n value: string;\n};\n\nexport const CopyableStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Copyable),\n value: string(),\n sensitive: optional(boolean()),\n }),\n);\n\n/**\n * Create a {@link Copyable} component.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `text` property.\n * @param args.value - The text to be copied.\n * @param args.sensitive - Whether the value is sensitive or not. Sensitive\n * values are only displayed to the user after clicking on the component.\n * Defaults to false.\n * @returns A {@link Copyable} component.\n * @example\n * const node = copyable('Hello, world!');\n * const node = copyable({ value: 'Hello, world!' });\n */\nexport const copyable = createBuilder(NodeType.Copyable, CopyableStruct, [\n 'value',\n 'sensitive',\n]);\n"],"names":["assign","boolean","literal","object","optional","string","createBuilder","LiteralStruct","NodeType","CopyableStruct","type","Copyable","value","sensitive","copyable"],"mappings":"AAAA,SACEA,MAAM,EACNC,OAAO,EACPC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,MAAM,QACD,cAAc;AAErB,SAASC,aAAa,QAAQ,aAAa;AAC3C,SAASC,aAAa,EAAEC,QAAQ,QAAQ,WAAW;AAmBnD,OAAO,MAAMC,iBAAiBT,OAC5BO,eACAJ,OAAO;IACLO,MAAMR,QAAQM,SAASG,QAAQ;IAC/BC,OAAOP;IACPQ,WAAWT,SAASH;AACtB,IACA;AAEF;;;;;;;;;;;;;CAaC,GACD,OAAO,MAAMa,WAAWR,cAAcE,SAASG,QAAQ,EAAEF,gBAAgB;IACvE;IACA;CACD,EAAE"}
1
+ {"version":3,"sources":["../../../../src/ui/components/copyable.ts"],"sourcesContent":["import type { Infer } from 'superstruct';\nimport {\n assign,\n boolean,\n literal,\n object,\n optional,\n string,\n} from 'superstruct';\n\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\nexport const CopyableStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Copyable),\n value: string(),\n sensitive: optional(boolean()),\n }),\n);\n\n/**\n * Text that can be copied to the clipboard. It can optionally be marked as\n * sensitive, in which case it will only be displayed to the user after clicking\n * on the component.\n *\n * @property type - The type of the node. Must be the string `copyable`.\n * @property value - The text to be copied.\n * @property sensitive - Whether the value is sensitive or not. Sensitive values\n * are only displayed to the user after clicking on the component. Defaults to\n * false.\n */\nexport type Copyable = Infer<typeof CopyableStruct>;\n\n/**\n * Create a {@link Copyable} component.\n *\n * @param args - The node arguments. This can either be a string, or an object\n * with the `text` property.\n * @param args.value - The text to be copied.\n * @param args.sensitive - Whether the value is sensitive or not. Sensitive\n * values are only displayed to the user after clicking on the component.\n * Defaults to false.\n * @returns A {@link Copyable} component.\n * @example\n * const node = copyable('Hello, world!');\n * const node = copyable({ value: 'Hello, world!' });\n */\nexport const copyable = createBuilder(NodeType.Copyable, CopyableStruct, [\n 'value',\n 'sensitive',\n]);\n"],"names":["assign","boolean","literal","object","optional","string","createBuilder","LiteralStruct","NodeType","CopyableStruct","type","Copyable","value","sensitive","copyable"],"mappings":"AACA,SACEA,MAAM,EACNC,OAAO,EACPC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,MAAM,QACD,cAAc;AAErB,SAASC,aAAa,QAAQ,aAAa;AAC3C,SAASC,aAAa,EAAEC,QAAQ,QAAQ,WAAW;AAEnD,OAAO,MAAMC,iBAAiBT,OAC5BO,eACAJ,OAAO;IACLO,MAAMR,QAAQM,SAASG,QAAQ;IAC/BC,OAAOP;IACPQ,WAAWT,SAASH;AACtB,IACA;AAeF;;;;;;;;;;;;;CAaC,GACD,OAAO,MAAMa,WAAWR,cAAcE,SAASG,QAAQ,EAAEF,gBAAgB;IACvE;IACA;CACD,EAAE"}
@@ -1,5 +1,14 @@
1
+ import type { Infer } from 'superstruct';
1
2
  import { NodeType } from '../nodes';
2
- import type { Literal } from '../nodes';
3
+ export declare const CopyableStruct: import("superstruct").Struct<{
4
+ value: string;
5
+ type: NodeType.Copyable;
6
+ sensitive?: boolean | undefined;
7
+ }, {
8
+ type: import("superstruct").Struct<NodeType.Copyable, NodeType.Copyable>;
9
+ value: import("superstruct").Struct<string, null>;
10
+ sensitive: import("superstruct").Struct<boolean | undefined, null>;
11
+ }>;
3
12
  /**
4
13
  * Text that can be copied to the clipboard. It can optionally be marked as
5
14
  * sensitive, in which case it will only be displayed to the user after clicking
@@ -11,19 +20,7 @@ import type { Literal } from '../nodes';
11
20
  * are only displayed to the user after clicking on the component. Defaults to
12
21
  * false.
13
22
  */
14
- export declare type Copyable = Literal & {
15
- type: NodeType.Copyable;
16
- value: string;
17
- };
18
- export declare const CopyableStruct: import("superstruct").Struct<{
19
- value: string;
20
- type: NodeType.Copyable;
21
- sensitive?: boolean | undefined;
22
- }, {
23
- type: import("superstruct").Struct<NodeType.Copyable, NodeType.Copyable>;
24
- value: import("superstruct").Struct<string, null>;
25
- sensitive: import("superstruct").Struct<boolean | undefined, null>;
26
- }>;
23
+ export declare type Copyable = Infer<typeof CopyableStruct>;
27
24
  /**
28
25
  * Create a {@link Copyable} component.
29
26
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/snaps-sdk",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/MetaMask/snaps.git"
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@lavamoat/allow-scripts": "^2.5.1",
47
- "@metamask/auto-changelog": "^3.4.3",
47
+ "@metamask/auto-changelog": "^3.4.4",
48
48
  "@metamask/eslint-config": "^12.1.0",
49
49
  "@metamask/eslint-config-jest": "^12.1.0",
50
50
  "@metamask/eslint-config-nodejs": "^12.1.0",