@metamask/snaps-controllers 9.0.0 → 9.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 CHANGED
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [9.1.0]
10
+ ### Added
11
+ - Add `Checkbox` component ([#2501](https://github.com/MetaMask/snaps/pull/2501))
12
+ - Add `FileInput` component ([#2469](https://github.com/MetaMask/snaps/pull/2469))
13
+ - Support additional components inside forms ([#2497](https://github.com/MetaMask/snaps/pull/2497))
14
+
9
15
  ## [9.0.0]
10
16
  ### Changed
11
17
  - **BREAKING:** Defer creation of offscreen document in `OffscreenExecutionService` ([#2473](https://github.com/MetaMask/snaps/pull/2473))
@@ -297,7 +303,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
297
303
  - The version of the package no longer needs to match the version of all other
298
304
  MetaMask Snaps packages.
299
305
 
300
- [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@9.0.0...HEAD
306
+ [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@9.1.0...HEAD
307
+ [9.1.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@9.0.0...@metamask/snaps-controllers@9.1.0
301
308
  [9.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@8.4.0...@metamask/snaps-controllers@9.0.0
302
309
  [8.4.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@8.3.1...@metamask/snaps-controllers@8.4.0
303
310
  [8.3.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@8.3.0...@metamask/snaps-controllers@8.3.1
@@ -0,0 +1,100 @@
1
+ // src/interface/utils.ts
2
+ import { assert } from "@metamask/snaps-sdk";
3
+ import { isJSXElementUnsafe } from "@metamask/snaps-sdk/jsx";
4
+ import {
5
+ getJsonSizeUnsafe,
6
+ getJsxChildren,
7
+ getJsxElementFromComponent,
8
+ walkJsx
9
+ } from "@metamask/snaps-utils";
10
+ function getJsxInterface(component) {
11
+ if (isJSXElementUnsafe(component)) {
12
+ return component;
13
+ }
14
+ return getJsxElementFromComponent(component);
15
+ }
16
+ function assertNameIsUnique(state, name) {
17
+ assert(
18
+ state[name] === void 0,
19
+ `Duplicate component names are not allowed, found multiple instances of: "${name}".`
20
+ );
21
+ }
22
+ function constructComponentSpecificDefaultState(element) {
23
+ switch (element.type) {
24
+ case "Dropdown": {
25
+ const children = getJsxChildren(element);
26
+ return children[0]?.props.value;
27
+ }
28
+ case "Checkbox":
29
+ return false;
30
+ default:
31
+ return null;
32
+ }
33
+ }
34
+ function getComponentStateValue(element) {
35
+ switch (element.type) {
36
+ case "Checkbox":
37
+ return element.props.checked;
38
+ default:
39
+ return element.props.value;
40
+ }
41
+ }
42
+ function constructInputState(oldState, element, form) {
43
+ const oldStateUnwrapped = form ? oldState[form] : oldState;
44
+ const oldInputState = oldStateUnwrapped?.[element.props.name];
45
+ if (element.type === "FileInput") {
46
+ return oldInputState ?? null;
47
+ }
48
+ return getComponentStateValue(element) ?? oldInputState ?? constructComponentSpecificDefaultState(element) ?? null;
49
+ }
50
+ function constructState(oldState, rootComponent) {
51
+ const newState = {};
52
+ const formStack = [];
53
+ walkJsx(rootComponent, (component, depth) => {
54
+ let currentForm = formStack[formStack.length - 1];
55
+ if (currentForm && depth <= currentForm.depth) {
56
+ formStack.pop();
57
+ currentForm = formStack[formStack.length - 1];
58
+ }
59
+ if (component.type === "Form") {
60
+ assertNameIsUnique(newState, component.props.name);
61
+ formStack.push({ name: component.props.name, depth });
62
+ newState[component.props.name] = {};
63
+ return;
64
+ }
65
+ if (currentForm && (component.type === "Input" || component.type === "Dropdown" || component.type === "FileInput" || component.type === "Checkbox")) {
66
+ const formState = newState[currentForm.name];
67
+ assertNameIsUnique(formState, component.props.name);
68
+ formState[component.props.name] = constructInputState(
69
+ oldState,
70
+ component,
71
+ currentForm.name
72
+ );
73
+ return;
74
+ }
75
+ if (component.type === "Input" || component.type === "Dropdown" || component.type === "FileInput" || component.type === "Checkbox") {
76
+ assertNameIsUnique(newState, component.props.name);
77
+ newState[component.props.name] = constructInputState(oldState, component);
78
+ }
79
+ });
80
+ return newState;
81
+ }
82
+ var MAX_CONTEXT_SIZE = 1e6;
83
+ function validateInterfaceContext(context) {
84
+ if (!context) {
85
+ return;
86
+ }
87
+ const size = getJsonSizeUnsafe(context);
88
+ assert(
89
+ size <= MAX_CONTEXT_SIZE,
90
+ `A Snap interface context may not be larger than ${MAX_CONTEXT_SIZE / 1e6} MB.`
91
+ );
92
+ }
93
+
94
+ export {
95
+ getJsxInterface,
96
+ assertNameIsUnique,
97
+ constructState,
98
+ validateInterfaceContext
99
+ };
100
+ //# sourceMappingURL=chunk-3T6W5VI2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/interface/utils.ts"],"sourcesContent":["import { assert } from '@metamask/snaps-sdk';\nimport type {\n FormState,\n InterfaceState,\n ComponentOrElement,\n InterfaceContext,\n State,\n} from '@metamask/snaps-sdk';\nimport type {\n DropdownElement,\n InputElement,\n JSXElement,\n OptionElement,\n FileInputElement,\n CheckboxElement,\n} from '@metamask/snaps-sdk/jsx';\nimport { isJSXElementUnsafe } from '@metamask/snaps-sdk/jsx';\nimport {\n getJsonSizeUnsafe,\n getJsxChildren,\n getJsxElementFromComponent,\n walkJsx,\n} from '@metamask/snaps-utils';\n\n/**\n * Get a JSX element from a component or JSX element. If the component is a\n * JSX element, it is returned as is. Otherwise, the component is converted to\n * a JSX element.\n *\n * @param component - The component to convert.\n * @returns The JSX element.\n */\nexport function getJsxInterface(component: ComponentOrElement): JSXElement {\n if (isJSXElementUnsafe(component)) {\n return component;\n }\n\n return getJsxElementFromComponent(component);\n}\n\n/**\n * Assert that the component name is unique in state.\n *\n * @param state - The interface state to verify against.\n * @param name - The component name to verify.\n */\nexport function assertNameIsUnique(state: InterfaceState, name: string) {\n assert(\n state[name] === undefined,\n `Duplicate component names are not allowed, found multiple instances of: \"${name}\".`,\n );\n}\n\n/**\n * Construct default state for a component.\n *\n * This function is meant to be used inside constructInputState to account\n * for component specific defaults and will not override the component value or existing form state.\n *\n * @param element - The input element.\n * @returns The default state for the specific component, if any.\n */\nfunction constructComponentSpecificDefaultState(\n element: InputElement | DropdownElement | CheckboxElement,\n) {\n switch (element.type) {\n case 'Dropdown': {\n const children = getJsxChildren(element) as OptionElement[];\n return children[0]?.props.value;\n }\n\n case 'Checkbox':\n return false;\n\n default:\n return null;\n }\n}\n\n/**\n * Get the state value for a stateful component.\n *\n * Most components store the state value as a `value` prop.\n * This function exists to account for components where that isn't the case.\n *\n * @param element - The input element.\n * @returns The state value for a given component.\n */\nfunction getComponentStateValue(\n element: InputElement | DropdownElement | CheckboxElement,\n) {\n switch (element.type) {\n case 'Checkbox':\n return element.props.checked;\n\n default:\n return element.props.value;\n }\n}\n\n/**\n * Construct the state for an input field.\n *\n * @param oldState - The previous state.\n * @param element - The input element.\n * @param form - An optional form that the input is enclosed in.\n * @returns The input state.\n */\nfunction constructInputState(\n oldState: InterfaceState,\n element: InputElement | DropdownElement | FileInputElement | CheckboxElement,\n form?: string,\n) {\n const oldStateUnwrapped = form ? (oldState[form] as FormState) : oldState;\n const oldInputState = oldStateUnwrapped?.[element.props.name] as State;\n\n if (element.type === 'FileInput') {\n return oldInputState ?? null;\n }\n\n return (\n getComponentStateValue(element) ??\n oldInputState ??\n constructComponentSpecificDefaultState(element) ??\n null\n );\n}\n\n/**\n * Construct the interface state for a given component tree.\n *\n * @param oldState - The previous state.\n * @param rootComponent - The UI component to construct state from.\n * @returns The interface state of the passed component.\n */\nexport function constructState(\n oldState: InterfaceState,\n rootComponent: JSXElement,\n): InterfaceState {\n const newState: InterfaceState = {};\n\n // Stack containing the forms we have visited and at which depth\n const formStack: { name: string; depth: number }[] = [];\n\n walkJsx(rootComponent, (component, depth) => {\n let currentForm = formStack[formStack.length - 1];\n\n // Pop the current form of the stack once we leave its depth.\n if (currentForm && depth <= currentForm.depth) {\n formStack.pop();\n currentForm = formStack[formStack.length - 1];\n }\n\n if (component.type === 'Form') {\n assertNameIsUnique(newState, component.props.name);\n formStack.push({ name: component.props.name, depth });\n newState[component.props.name] = {};\n return;\n }\n\n // Stateful components inside a form\n if (\n currentForm &&\n (component.type === 'Input' ||\n component.type === 'Dropdown' ||\n component.type === 'FileInput' ||\n component.type === 'Checkbox')\n ) {\n const formState = newState[currentForm.name] as FormState;\n assertNameIsUnique(formState, component.props.name);\n formState[component.props.name] = constructInputState(\n oldState,\n component,\n currentForm.name,\n );\n return;\n }\n\n // Stateful components outside a form\n if (\n component.type === 'Input' ||\n component.type === 'Dropdown' ||\n component.type === 'FileInput' ||\n component.type === 'Checkbox'\n ) {\n assertNameIsUnique(newState, component.props.name);\n newState[component.props.name] = constructInputState(oldState, component);\n }\n });\n\n return newState;\n}\n\nconst MAX_CONTEXT_SIZE = 1_000_000; // 1 mb\n\n/**\n * Validate a JSON blob to be used as the interface context.\n *\n * @param context - The JSON blob.\n * @throws If the JSON blob is too large.\n */\nexport function validateInterfaceContext(context?: InterfaceContext) {\n if (!context) {\n return;\n }\n\n // We assume the validity of this JSON to be validated by the caller.\n // E.g., in the RPC method implementation.\n const size = getJsonSizeUnsafe(context);\n assert(\n size <= MAX_CONTEXT_SIZE,\n `A Snap interface context may not be larger than ${\n MAX_CONTEXT_SIZE / 1000000\n } MB.`,\n );\n}\n"],"mappings":";AAAA,SAAS,cAAc;AAgBvB,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUA,SAAS,gBAAgB,WAA2C;AACzE,MAAI,mBAAmB,SAAS,GAAG;AACjC,WAAO;AAAA,EACT;AAEA,SAAO,2BAA2B,SAAS;AAC7C;AAQO,SAAS,mBAAmB,OAAuB,MAAc;AACtE;AAAA,IACE,MAAM,IAAI,MAAM;AAAA,IAChB,4EAA4E,IAAI;AAAA,EAClF;AACF;AAWA,SAAS,uCACP,SACA;AACA,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK,YAAY;AACf,YAAM,WAAW,eAAe,OAAO;AACvC,aAAO,SAAS,CAAC,GAAG,MAAM;AAAA,IAC5B;AAAA,IAEA,KAAK;AACH,aAAO;AAAA,IAET;AACE,aAAO;AAAA,EACX;AACF;AAWA,SAAS,uBACP,SACA;AACA,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK;AACH,aAAO,QAAQ,MAAM;AAAA,IAEvB;AACE,aAAO,QAAQ,MAAM;AAAA,EACzB;AACF;AAUA,SAAS,oBACP,UACA,SACA,MACA;AACA,QAAM,oBAAoB,OAAQ,SAAS,IAAI,IAAkB;AACjE,QAAM,gBAAgB,oBAAoB,QAAQ,MAAM,IAAI;AAE5D,MAAI,QAAQ,SAAS,aAAa;AAChC,WAAO,iBAAiB;AAAA,EAC1B;AAEA,SACE,uBAAuB,OAAO,KAC9B,iBACA,uCAAuC,OAAO,KAC9C;AAEJ;AASO,SAAS,eACd,UACA,eACgB;AAChB,QAAM,WAA2B,CAAC;AAGlC,QAAM,YAA+C,CAAC;AAEtD,UAAQ,eAAe,CAAC,WAAW,UAAU;AAC3C,QAAI,cAAc,UAAU,UAAU,SAAS,CAAC;AAGhD,QAAI,eAAe,SAAS,YAAY,OAAO;AAC7C,gBAAU,IAAI;AACd,oBAAc,UAAU,UAAU,SAAS,CAAC;AAAA,IAC9C;AAEA,QAAI,UAAU,SAAS,QAAQ;AAC7B,yBAAmB,UAAU,UAAU,MAAM,IAAI;AACjD,gBAAU,KAAK,EAAE,MAAM,UAAU,MAAM,MAAM,MAAM,CAAC;AACpD,eAAS,UAAU,MAAM,IAAI,IAAI,CAAC;AAClC;AAAA,IACF;AAGA,QACE,gBACC,UAAU,SAAS,WAClB,UAAU,SAAS,cACnB,UAAU,SAAS,eACnB,UAAU,SAAS,aACrB;AACA,YAAM,YAAY,SAAS,YAAY,IAAI;AAC3C,yBAAmB,WAAW,UAAU,MAAM,IAAI;AAClD,gBAAU,UAAU,MAAM,IAAI,IAAI;AAAA,QAChC;AAAA,QACA;AAAA,QACA,YAAY;AAAA,MACd;AACA;AAAA,IACF;AAGA,QACE,UAAU,SAAS,WACnB,UAAU,SAAS,cACnB,UAAU,SAAS,eACnB,UAAU,SAAS,YACnB;AACA,yBAAmB,UAAU,UAAU,MAAM,IAAI;AACjD,eAAS,UAAU,MAAM,IAAI,IAAI,oBAAoB,UAAU,SAAS;AAAA,IAC1E;AAAA,EACF,CAAC;AAED,SAAO;AACT;AAEA,IAAM,mBAAmB;AAQlB,SAAS,yBAAyB,SAA4B;AACnE,MAAI,CAAC,SAAS;AACZ;AAAA,EACF;AAIA,QAAM,OAAO,kBAAkB,OAAO;AACtC;AAAA,IACE,QAAQ;AAAA,IACR,mDACE,mBAAmB,GACrB;AAAA,EACF;AACF;","names":[]}
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkWCDDYBFWjs = require('./chunk-WCDDYBFW.js');
5
+ var _chunkH7TB7I6Zjs = require('./chunk-H7TB7I6Z.js');
6
6
 
7
7
 
8
8
 
@@ -67,11 +67,11 @@ var SnapInterfaceController = class extends _basecontroller.BaseController {
67
67
  * @returns The newly interface id.
68
68
  */
69
69
  async createInterface(snapId, content, context) {
70
- const element = _chunkWCDDYBFWjs.getJsxInterface.call(void 0, content);
70
+ const element = _chunkH7TB7I6Zjs.getJsxInterface.call(void 0, content);
71
71
  await _chunkEXN2TFDJjs.__privateMethod.call(void 0, this, _validateContent, validateContent_fn).call(this, element);
72
- _chunkWCDDYBFWjs.validateInterfaceContext.call(void 0, context);
72
+ _chunkH7TB7I6Zjs.validateInterfaceContext.call(void 0, context);
73
73
  const id = _nanoid.nanoid.call(void 0, );
74
- const componentState = _chunkWCDDYBFWjs.constructState.call(void 0, {}, element);
74
+ const componentState = _chunkH7TB7I6Zjs.constructState.call(void 0, {}, element);
75
75
  this.update((draftState) => {
76
76
  draftState.interfaces[id] = {
77
77
  snapId,
@@ -102,10 +102,10 @@ var SnapInterfaceController = class extends _basecontroller.BaseController {
102
102
  */
103
103
  async updateInterface(snapId, id, content) {
104
104
  _chunkEXN2TFDJjs.__privateMethod.call(void 0, this, _validateArgs, validateArgs_fn).call(this, snapId, id);
105
- const element = _chunkWCDDYBFWjs.getJsxInterface.call(void 0, content);
105
+ const element = _chunkH7TB7I6Zjs.getJsxInterface.call(void 0, content);
106
106
  await _chunkEXN2TFDJjs.__privateMethod.call(void 0, this, _validateContent, validateContent_fn).call(this, element);
107
107
  const oldState = this.state.interfaces[id].state;
108
- const newState = _chunkWCDDYBFWjs.constructState.call(void 0, oldState, element);
108
+ const newState = _chunkH7TB7I6Zjs.constructState.call(void 0, oldState, element);
109
109
  this.update((draftState) => {
110
110
  draftState.interfaces[id].state = newState;
111
111
  draftState.interfaces[id].content = element;
@@ -190,4 +190,4 @@ validateContent_fn = async function(element) {
190
190
 
191
191
 
192
192
  exports.SnapInterfaceController = SnapInterfaceController;
193
- //# sourceMappingURL=chunk-6VGMRXGY.js.map
193
+ //# sourceMappingURL=chunk-BUHS4M6F.js.map
@@ -0,0 +1,100 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/interface/utils.ts
2
+ var _snapssdk = require('@metamask/snaps-sdk');
3
+ var _jsx = require('@metamask/snaps-sdk/jsx');
4
+
5
+
6
+
7
+
8
+
9
+ var _snapsutils = require('@metamask/snaps-utils');
10
+ function getJsxInterface(component) {
11
+ if (_jsx.isJSXElementUnsafe.call(void 0, component)) {
12
+ return component;
13
+ }
14
+ return _snapsutils.getJsxElementFromComponent.call(void 0, component);
15
+ }
16
+ function assertNameIsUnique(state, name) {
17
+ _snapssdk.assert.call(void 0,
18
+ state[name] === void 0,
19
+ `Duplicate component names are not allowed, found multiple instances of: "${name}".`
20
+ );
21
+ }
22
+ function constructComponentSpecificDefaultState(element) {
23
+ switch (element.type) {
24
+ case "Dropdown": {
25
+ const children = _snapsutils.getJsxChildren.call(void 0, element);
26
+ return children[0]?.props.value;
27
+ }
28
+ case "Checkbox":
29
+ return false;
30
+ default:
31
+ return null;
32
+ }
33
+ }
34
+ function getComponentStateValue(element) {
35
+ switch (element.type) {
36
+ case "Checkbox":
37
+ return element.props.checked;
38
+ default:
39
+ return element.props.value;
40
+ }
41
+ }
42
+ function constructInputState(oldState, element, form) {
43
+ const oldStateUnwrapped = form ? oldState[form] : oldState;
44
+ const oldInputState = oldStateUnwrapped?.[element.props.name];
45
+ if (element.type === "FileInput") {
46
+ return oldInputState ?? null;
47
+ }
48
+ return getComponentStateValue(element) ?? oldInputState ?? constructComponentSpecificDefaultState(element) ?? null;
49
+ }
50
+ function constructState(oldState, rootComponent) {
51
+ const newState = {};
52
+ const formStack = [];
53
+ _snapsutils.walkJsx.call(void 0, rootComponent, (component, depth) => {
54
+ let currentForm = formStack[formStack.length - 1];
55
+ if (currentForm && depth <= currentForm.depth) {
56
+ formStack.pop();
57
+ currentForm = formStack[formStack.length - 1];
58
+ }
59
+ if (component.type === "Form") {
60
+ assertNameIsUnique(newState, component.props.name);
61
+ formStack.push({ name: component.props.name, depth });
62
+ newState[component.props.name] = {};
63
+ return;
64
+ }
65
+ if (currentForm && (component.type === "Input" || component.type === "Dropdown" || component.type === "FileInput" || component.type === "Checkbox")) {
66
+ const formState = newState[currentForm.name];
67
+ assertNameIsUnique(formState, component.props.name);
68
+ formState[component.props.name] = constructInputState(
69
+ oldState,
70
+ component,
71
+ currentForm.name
72
+ );
73
+ return;
74
+ }
75
+ if (component.type === "Input" || component.type === "Dropdown" || component.type === "FileInput" || component.type === "Checkbox") {
76
+ assertNameIsUnique(newState, component.props.name);
77
+ newState[component.props.name] = constructInputState(oldState, component);
78
+ }
79
+ });
80
+ return newState;
81
+ }
82
+ var MAX_CONTEXT_SIZE = 1e6;
83
+ function validateInterfaceContext(context) {
84
+ if (!context) {
85
+ return;
86
+ }
87
+ const size = _snapsutils.getJsonSizeUnsafe.call(void 0, context);
88
+ _snapssdk.assert.call(void 0,
89
+ size <= MAX_CONTEXT_SIZE,
90
+ `A Snap interface context may not be larger than ${MAX_CONTEXT_SIZE / 1e6} MB.`
91
+ );
92
+ }
93
+
94
+
95
+
96
+
97
+
98
+
99
+ exports.getJsxInterface = getJsxInterface; exports.assertNameIsUnique = assertNameIsUnique; exports.constructState = constructState; exports.validateInterfaceContext = validateInterfaceContext;
100
+ //# sourceMappingURL=chunk-H7TB7I6Z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/interface/utils.ts"],"names":[],"mappings":";AAAA,SAAS,cAAc;AAgBvB,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUA,SAAS,gBAAgB,WAA2C;AACzE,MAAI,mBAAmB,SAAS,GAAG;AACjC,WAAO;AAAA,EACT;AAEA,SAAO,2BAA2B,SAAS;AAC7C;AAQO,SAAS,mBAAmB,OAAuB,MAAc;AACtE;AAAA,IACE,MAAM,IAAI,MAAM;AAAA,IAChB,4EAA4E,IAAI;AAAA,EAClF;AACF;AAWA,SAAS,uCACP,SACA;AACA,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK,YAAY;AACf,YAAM,WAAW,eAAe,OAAO;AACvC,aAAO,SAAS,CAAC,GAAG,MAAM;AAAA,IAC5B;AAAA,IAEA,KAAK;AACH,aAAO;AAAA,IAET;AACE,aAAO;AAAA,EACX;AACF;AAWA,SAAS,uBACP,SACA;AACA,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK;AACH,aAAO,QAAQ,MAAM;AAAA,IAEvB;AACE,aAAO,QAAQ,MAAM;AAAA,EACzB;AACF;AAUA,SAAS,oBACP,UACA,SACA,MACA;AACA,QAAM,oBAAoB,OAAQ,SAAS,IAAI,IAAkB;AACjE,QAAM,gBAAgB,oBAAoB,QAAQ,MAAM,IAAI;AAE5D,MAAI,QAAQ,SAAS,aAAa;AAChC,WAAO,iBAAiB;AAAA,EAC1B;AAEA,SACE,uBAAuB,OAAO,KAC9B,iBACA,uCAAuC,OAAO,KAC9C;AAEJ;AASO,SAAS,eACd,UACA,eACgB;AAChB,QAAM,WAA2B,CAAC;AAGlC,QAAM,YAA+C,CAAC;AAEtD,UAAQ,eAAe,CAAC,WAAW,UAAU;AAC3C,QAAI,cAAc,UAAU,UAAU,SAAS,CAAC;AAGhD,QAAI,eAAe,SAAS,YAAY,OAAO;AAC7C,gBAAU,IAAI;AACd,oBAAc,UAAU,UAAU,SAAS,CAAC;AAAA,IAC9C;AAEA,QAAI,UAAU,SAAS,QAAQ;AAC7B,yBAAmB,UAAU,UAAU,MAAM,IAAI;AACjD,gBAAU,KAAK,EAAE,MAAM,UAAU,MAAM,MAAM,MAAM,CAAC;AACpD,eAAS,UAAU,MAAM,IAAI,IAAI,CAAC;AAClC;AAAA,IACF;AAGA,QACE,gBACC,UAAU,SAAS,WAClB,UAAU,SAAS,cACnB,UAAU,SAAS,eACnB,UAAU,SAAS,aACrB;AACA,YAAM,YAAY,SAAS,YAAY,IAAI;AAC3C,yBAAmB,WAAW,UAAU,MAAM,IAAI;AAClD,gBAAU,UAAU,MAAM,IAAI,IAAI;AAAA,QAChC;AAAA,QACA;AAAA,QACA,YAAY;AAAA,MACd;AACA;AAAA,IACF;AAGA,QACE,UAAU,SAAS,WACnB,UAAU,SAAS,cACnB,UAAU,SAAS,eACnB,UAAU,SAAS,YACnB;AACA,yBAAmB,UAAU,UAAU,MAAM,IAAI;AACjD,eAAS,UAAU,MAAM,IAAI,IAAI,oBAAoB,UAAU,SAAS;AAAA,IAC1E;AAAA,EACF,CAAC;AAED,SAAO;AACT;AAEA,IAAM,mBAAmB;AAQlB,SAAS,yBAAyB,SAA4B;AACnE,MAAI,CAAC,SAAS;AACZ;AAAA,EACF;AAIA,QAAM,OAAO,kBAAkB,OAAO;AACtC;AAAA,IACE,QAAQ;AAAA,IACR,mDACE,mBAAmB,GACrB;AAAA,EACF;AACF","sourcesContent":["import { assert } from '@metamask/snaps-sdk';\nimport type {\n FormState,\n InterfaceState,\n ComponentOrElement,\n InterfaceContext,\n State,\n} from '@metamask/snaps-sdk';\nimport type {\n DropdownElement,\n InputElement,\n JSXElement,\n OptionElement,\n FileInputElement,\n CheckboxElement,\n} from '@metamask/snaps-sdk/jsx';\nimport { isJSXElementUnsafe } from '@metamask/snaps-sdk/jsx';\nimport {\n getJsonSizeUnsafe,\n getJsxChildren,\n getJsxElementFromComponent,\n walkJsx,\n} from '@metamask/snaps-utils';\n\n/**\n * Get a JSX element from a component or JSX element. If the component is a\n * JSX element, it is returned as is. Otherwise, the component is converted to\n * a JSX element.\n *\n * @param component - The component to convert.\n * @returns The JSX element.\n */\nexport function getJsxInterface(component: ComponentOrElement): JSXElement {\n if (isJSXElementUnsafe(component)) {\n return component;\n }\n\n return getJsxElementFromComponent(component);\n}\n\n/**\n * Assert that the component name is unique in state.\n *\n * @param state - The interface state to verify against.\n * @param name - The component name to verify.\n */\nexport function assertNameIsUnique(state: InterfaceState, name: string) {\n assert(\n state[name] === undefined,\n `Duplicate component names are not allowed, found multiple instances of: \"${name}\".`,\n );\n}\n\n/**\n * Construct default state for a component.\n *\n * This function is meant to be used inside constructInputState to account\n * for component specific defaults and will not override the component value or existing form state.\n *\n * @param element - The input element.\n * @returns The default state for the specific component, if any.\n */\nfunction constructComponentSpecificDefaultState(\n element: InputElement | DropdownElement | CheckboxElement,\n) {\n switch (element.type) {\n case 'Dropdown': {\n const children = getJsxChildren(element) as OptionElement[];\n return children[0]?.props.value;\n }\n\n case 'Checkbox':\n return false;\n\n default:\n return null;\n }\n}\n\n/**\n * Get the state value for a stateful component.\n *\n * Most components store the state value as a `value` prop.\n * This function exists to account for components where that isn't the case.\n *\n * @param element - The input element.\n * @returns The state value for a given component.\n */\nfunction getComponentStateValue(\n element: InputElement | DropdownElement | CheckboxElement,\n) {\n switch (element.type) {\n case 'Checkbox':\n return element.props.checked;\n\n default:\n return element.props.value;\n }\n}\n\n/**\n * Construct the state for an input field.\n *\n * @param oldState - The previous state.\n * @param element - The input element.\n * @param form - An optional form that the input is enclosed in.\n * @returns The input state.\n */\nfunction constructInputState(\n oldState: InterfaceState,\n element: InputElement | DropdownElement | FileInputElement | CheckboxElement,\n form?: string,\n) {\n const oldStateUnwrapped = form ? (oldState[form] as FormState) : oldState;\n const oldInputState = oldStateUnwrapped?.[element.props.name] as State;\n\n if (element.type === 'FileInput') {\n return oldInputState ?? null;\n }\n\n return (\n getComponentStateValue(element) ??\n oldInputState ??\n constructComponentSpecificDefaultState(element) ??\n null\n );\n}\n\n/**\n * Construct the interface state for a given component tree.\n *\n * @param oldState - The previous state.\n * @param rootComponent - The UI component to construct state from.\n * @returns The interface state of the passed component.\n */\nexport function constructState(\n oldState: InterfaceState,\n rootComponent: JSXElement,\n): InterfaceState {\n const newState: InterfaceState = {};\n\n // Stack containing the forms we have visited and at which depth\n const formStack: { name: string; depth: number }[] = [];\n\n walkJsx(rootComponent, (component, depth) => {\n let currentForm = formStack[formStack.length - 1];\n\n // Pop the current form of the stack once we leave its depth.\n if (currentForm && depth <= currentForm.depth) {\n formStack.pop();\n currentForm = formStack[formStack.length - 1];\n }\n\n if (component.type === 'Form') {\n assertNameIsUnique(newState, component.props.name);\n formStack.push({ name: component.props.name, depth });\n newState[component.props.name] = {};\n return;\n }\n\n // Stateful components inside a form\n if (\n currentForm &&\n (component.type === 'Input' ||\n component.type === 'Dropdown' ||\n component.type === 'FileInput' ||\n component.type === 'Checkbox')\n ) {\n const formState = newState[currentForm.name] as FormState;\n assertNameIsUnique(formState, component.props.name);\n formState[component.props.name] = constructInputState(\n oldState,\n component,\n currentForm.name,\n );\n return;\n }\n\n // Stateful components outside a form\n if (\n component.type === 'Input' ||\n component.type === 'Dropdown' ||\n component.type === 'FileInput' ||\n component.type === 'Checkbox'\n ) {\n assertNameIsUnique(newState, component.props.name);\n newState[component.props.name] = constructInputState(oldState, component);\n }\n });\n\n return newState;\n}\n\nconst MAX_CONTEXT_SIZE = 1_000_000; // 1 mb\n\n/**\n * Validate a JSON blob to be used as the interface context.\n *\n * @param context - The JSON blob.\n * @throws If the JSON blob is too large.\n */\nexport function validateInterfaceContext(context?: InterfaceContext) {\n if (!context) {\n return;\n }\n\n // We assume the validity of this JSON to be validated by the caller.\n // E.g., in the RPC method implementation.\n const size = getJsonSizeUnsafe(context);\n assert(\n size <= MAX_CONTEXT_SIZE,\n `A Snap interface context may not be larger than ${\n MAX_CONTEXT_SIZE / 1000000\n } MB.`,\n );\n}\n"]}
@@ -2,7 +2,7 @@ import {
2
2
  constructState,
3
3
  getJsxInterface,
4
4
  validateInterfaceContext
5
- } from "./chunk-7CZDBXIY.mjs";
5
+ } from "./chunk-3T6W5VI2.mjs";
6
6
  import {
7
7
  __privateAdd,
8
8
  __privateMethod
@@ -190,4 +190,4 @@ validateContent_fn = async function(element) {
190
190
  export {
191
191
  SnapInterfaceController
192
192
  };
193
- //# sourceMappingURL=chunk-YAZ55WUL.mjs.map
193
+ //# sourceMappingURL=chunk-WP3DAIFM.mjs.map
@@ -16,8 +16,8 @@ require('../chunk-AP7CJ6DA.js');
16
16
  require('../chunk-JQ54YYLU.js');
17
17
  require('../chunk-YYPUPKQY.js');
18
18
  require('../chunk-VNOCJWOK.js');
19
- require('../chunk-6VGMRXGY.js');
20
- require('../chunk-WCDDYBFW.js');
19
+ require('../chunk-BUHS4M6F.js');
20
+ require('../chunk-H7TB7I6Z.js');
21
21
  require('../chunk-4URGXJP7.js');
22
22
  require('../chunk-OHMCPTOI.js');
23
23
  require('../chunk-D74XJG2L.js');
@@ -16,8 +16,8 @@ import "../chunk-NC5PBDKD.mjs";
16
16
  import "../chunk-4M2FX2AT.mjs";
17
17
  import "../chunk-P7Y6MIZW.mjs";
18
18
  import "../chunk-U74FML7Z.mjs";
19
- import "../chunk-YAZ55WUL.mjs";
20
- import "../chunk-7CZDBXIY.mjs";
19
+ import "../chunk-WP3DAIFM.mjs";
20
+ import "../chunk-3T6W5VI2.mjs";
21
21
  import "../chunk-IABOI7TW.mjs";
22
22
  import "../chunk-ESQPQNEF.mjs";
23
23
  import "../chunk-V6NFZ47P.mjs";
@@ -16,8 +16,8 @@ require('../chunk-AP7CJ6DA.js');
16
16
  require('../chunk-JQ54YYLU.js');
17
17
  require('../chunk-YYPUPKQY.js');
18
18
  require('../chunk-VNOCJWOK.js');
19
- require('../chunk-6VGMRXGY.js');
20
- require('../chunk-WCDDYBFW.js');
19
+ require('../chunk-BUHS4M6F.js');
20
+ require('../chunk-H7TB7I6Z.js');
21
21
  require('../chunk-4URGXJP7.js');
22
22
  require('../chunk-OHMCPTOI.js');
23
23
  require('../chunk-D74XJG2L.js');
@@ -16,8 +16,8 @@ import "../chunk-NC5PBDKD.mjs";
16
16
  import "../chunk-4M2FX2AT.mjs";
17
17
  import "../chunk-P7Y6MIZW.mjs";
18
18
  import "../chunk-U74FML7Z.mjs";
19
- import "../chunk-YAZ55WUL.mjs";
20
- import "../chunk-7CZDBXIY.mjs";
19
+ import "../chunk-WP3DAIFM.mjs";
20
+ import "../chunk-3T6W5VI2.mjs";
21
21
  import "../chunk-IABOI7TW.mjs";
22
22
  import "../chunk-ESQPQNEF.mjs";
23
23
  import "../chunk-V6NFZ47P.mjs";
package/dist/index.js CHANGED
@@ -43,8 +43,8 @@ var _chunkYYPUPKQYjs = require('./chunk-YYPUPKQY.js');
43
43
  require('./chunk-VNOCJWOK.js');
44
44
 
45
45
 
46
- var _chunk6VGMRXGYjs = require('./chunk-6VGMRXGY.js');
47
- require('./chunk-WCDDYBFW.js');
46
+ var _chunkBUHS4M6Fjs = require('./chunk-BUHS4M6F.js');
47
+ require('./chunk-H7TB7I6Z.js');
48
48
  require('./chunk-4URGXJP7.js');
49
49
  require('./chunk-OHMCPTOI.js');
50
50
  require('./chunk-D74XJG2L.js');
@@ -118,5 +118,5 @@ require('./chunk-EXN2TFDJ.js');
118
118
 
119
119
 
120
120
 
121
- exports.AbstractExecutionService = _chunkS775IABYjs.AbstractExecutionService; exports.BaseNpmLocation = _chunkXWDEGRM5js.BaseNpmLocation; exports.CronjobController = _chunkGRBWVPLFjs.CronjobController; exports.DAILY_TIMEOUT = _chunkGRBWVPLFjs.DAILY_TIMEOUT; exports.DEFAULT_NPM_REGISTRY = _chunkXWDEGRM5js.DEFAULT_NPM_REGISTRY; exports.HttpLocation = _chunkRDBT3ZJQjs.HttpLocation; exports.IframeExecutionService = _chunkZRC46TUFjs.IframeExecutionService; exports.JsonSnapsRegistry = _chunkCPUUURMTjs.JsonSnapsRegistry; exports.LocalLocation = _chunkLWBPKSU2js.LocalLocation; exports.NpmLocation = _chunkXWDEGRM5js.NpmLocation; exports.OffscreenExecutionService = _chunk6ERB63FHjs.OffscreenExecutionService; exports.ProxyPostMessageStream = _chunk7Y6P5FRNjs.ProxyPostMessageStream; exports.SNAP_APPROVAL_INSTALL = _chunkZBSBCWWMjs.SNAP_APPROVAL_INSTALL; exports.SNAP_APPROVAL_RESULT = _chunkZBSBCWWMjs.SNAP_APPROVAL_RESULT; exports.SNAP_APPROVAL_UPDATE = _chunkZBSBCWWMjs.SNAP_APPROVAL_UPDATE; exports.SnapController = _chunkZBSBCWWMjs.SnapController; exports.SnapInterfaceController = _chunk6VGMRXGYjs.SnapInterfaceController; exports.SnapsRegistryStatus = _chunk4CA3O64Hjs.SnapsRegistryStatus; exports.TARBALL_SIZE_SAFETY_LIMIT = _chunkXWDEGRM5js.TARBALL_SIZE_SAFETY_LIMIT; exports.WebWorkerExecutionService = _chunkHQ6HMINLjs.WebWorkerExecutionService; exports.calculateConnectionsChange = _chunkCDTGUNSAjs.calculateConnectionsChange; exports.controllerName = _chunkZBSBCWWMjs.controllerName; exports.delay = _chunkCDTGUNSAjs.delay; exports.delayWithTimer = _chunkCDTGUNSAjs.delayWithTimer; exports.detectSnapLocation = _chunkPT22IXNSjs.detectSnapLocation; exports.fetchNpmMetadata = _chunkXWDEGRM5js.fetchNpmMetadata; exports.fetchSnap = _chunkCDTGUNSAjs.fetchSnap; exports.getNpmCanonicalBasePath = _chunkXWDEGRM5js.getNpmCanonicalBasePath; exports.getRunnableSnaps = _chunkYYPUPKQYjs.getRunnableSnaps; exports.getSnapFiles = _chunkCDTGUNSAjs.getSnapFiles; exports.hasTimedOut = _chunkCDTGUNSAjs.hasTimedOut; exports.permissionsDiff = _chunkCDTGUNSAjs.permissionsDiff; exports.setDiff = _chunkCDTGUNSAjs.setDiff; exports.setupMultiplex = _chunkS775IABYjs.setupMultiplex; exports.withTimeout = _chunkCDTGUNSAjs.withTimeout;
121
+ exports.AbstractExecutionService = _chunkS775IABYjs.AbstractExecutionService; exports.BaseNpmLocation = _chunkXWDEGRM5js.BaseNpmLocation; exports.CronjobController = _chunkGRBWVPLFjs.CronjobController; exports.DAILY_TIMEOUT = _chunkGRBWVPLFjs.DAILY_TIMEOUT; exports.DEFAULT_NPM_REGISTRY = _chunkXWDEGRM5js.DEFAULT_NPM_REGISTRY; exports.HttpLocation = _chunkRDBT3ZJQjs.HttpLocation; exports.IframeExecutionService = _chunkZRC46TUFjs.IframeExecutionService; exports.JsonSnapsRegistry = _chunkCPUUURMTjs.JsonSnapsRegistry; exports.LocalLocation = _chunkLWBPKSU2js.LocalLocation; exports.NpmLocation = _chunkXWDEGRM5js.NpmLocation; exports.OffscreenExecutionService = _chunk6ERB63FHjs.OffscreenExecutionService; exports.ProxyPostMessageStream = _chunk7Y6P5FRNjs.ProxyPostMessageStream; exports.SNAP_APPROVAL_INSTALL = _chunkZBSBCWWMjs.SNAP_APPROVAL_INSTALL; exports.SNAP_APPROVAL_RESULT = _chunkZBSBCWWMjs.SNAP_APPROVAL_RESULT; exports.SNAP_APPROVAL_UPDATE = _chunkZBSBCWWMjs.SNAP_APPROVAL_UPDATE; exports.SnapController = _chunkZBSBCWWMjs.SnapController; exports.SnapInterfaceController = _chunkBUHS4M6Fjs.SnapInterfaceController; exports.SnapsRegistryStatus = _chunk4CA3O64Hjs.SnapsRegistryStatus; exports.TARBALL_SIZE_SAFETY_LIMIT = _chunkXWDEGRM5js.TARBALL_SIZE_SAFETY_LIMIT; exports.WebWorkerExecutionService = _chunkHQ6HMINLjs.WebWorkerExecutionService; exports.calculateConnectionsChange = _chunkCDTGUNSAjs.calculateConnectionsChange; exports.controllerName = _chunkZBSBCWWMjs.controllerName; exports.delay = _chunkCDTGUNSAjs.delay; exports.delayWithTimer = _chunkCDTGUNSAjs.delayWithTimer; exports.detectSnapLocation = _chunkPT22IXNSjs.detectSnapLocation; exports.fetchNpmMetadata = _chunkXWDEGRM5js.fetchNpmMetadata; exports.fetchSnap = _chunkCDTGUNSAjs.fetchSnap; exports.getNpmCanonicalBasePath = _chunkXWDEGRM5js.getNpmCanonicalBasePath; exports.getRunnableSnaps = _chunkYYPUPKQYjs.getRunnableSnaps; exports.getSnapFiles = _chunkCDTGUNSAjs.getSnapFiles; exports.hasTimedOut = _chunkCDTGUNSAjs.hasTimedOut; exports.permissionsDiff = _chunkCDTGUNSAjs.permissionsDiff; exports.setDiff = _chunkCDTGUNSAjs.setDiff; exports.setupMultiplex = _chunkS775IABYjs.setupMultiplex; exports.withTimeout = _chunkCDTGUNSAjs.withTimeout;
122
122
  //# sourceMappingURL=index.js.map
package/dist/index.mjs CHANGED
@@ -43,8 +43,8 @@ import {
43
43
  import "./chunk-U74FML7Z.mjs";
44
44
  import {
45
45
  SnapInterfaceController
46
- } from "./chunk-YAZ55WUL.mjs";
47
- import "./chunk-7CZDBXIY.mjs";
46
+ } from "./chunk-WP3DAIFM.mjs";
47
+ import "./chunk-3T6W5VI2.mjs";
48
48
  import "./chunk-IABOI7TW.mjs";
49
49
  import "./chunk-ESQPQNEF.mjs";
50
50
  import "./chunk-V6NFZ47P.mjs";
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk6VGMRXGYjs = require('../chunk-6VGMRXGY.js');
4
- require('../chunk-WCDDYBFW.js');
3
+ var _chunkBUHS4M6Fjs = require('../chunk-BUHS4M6F.js');
4
+ require('../chunk-H7TB7I6Z.js');
5
5
  require('../chunk-EXN2TFDJ.js');
6
6
 
7
7
 
8
- exports.SnapInterfaceController = _chunk6VGMRXGYjs.SnapInterfaceController;
8
+ exports.SnapInterfaceController = _chunkBUHS4M6Fjs.SnapInterfaceController;
9
9
  //# sourceMappingURL=SnapInterfaceController.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SnapInterfaceController
3
- } from "../chunk-YAZ55WUL.mjs";
4
- import "../chunk-7CZDBXIY.mjs";
3
+ } from "../chunk-WP3DAIFM.mjs";
4
+ import "../chunk-3T6W5VI2.mjs";
5
5
  import "../chunk-YRZVIDCF.mjs";
6
6
  export {
7
7
  SnapInterfaceController
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-VNOCJWOK.js');
2
2
 
3
3
 
4
- var _chunk6VGMRXGYjs = require('../chunk-6VGMRXGY.js');
5
- require('../chunk-WCDDYBFW.js');
4
+ var _chunkBUHS4M6Fjs = require('../chunk-BUHS4M6F.js');
5
+ require('../chunk-H7TB7I6Z.js');
6
6
  require('../chunk-EXN2TFDJ.js');
7
7
 
8
8
 
9
- exports.SnapInterfaceController = _chunk6VGMRXGYjs.SnapInterfaceController;
9
+ exports.SnapInterfaceController = _chunkBUHS4M6Fjs.SnapInterfaceController;
10
10
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
1
  import "../chunk-U74FML7Z.mjs";
2
2
  import {
3
3
  SnapInterfaceController
4
- } from "../chunk-YAZ55WUL.mjs";
5
- import "../chunk-7CZDBXIY.mjs";
4
+ } from "../chunk-WP3DAIFM.mjs";
5
+ import "../chunk-3T6W5VI2.mjs";
6
6
  import "../chunk-YRZVIDCF.mjs";
7
7
  export {
8
8
  SnapInterfaceController
@@ -3,12 +3,12 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkWCDDYBFWjs = require('../chunk-WCDDYBFW.js');
6
+ var _chunkH7TB7I6Zjs = require('../chunk-H7TB7I6Z.js');
7
7
  require('../chunk-EXN2TFDJ.js');
8
8
 
9
9
 
10
10
 
11
11
 
12
12
 
13
- exports.assertNameIsUnique = _chunkWCDDYBFWjs.assertNameIsUnique; exports.constructState = _chunkWCDDYBFWjs.constructState; exports.getJsxInterface = _chunkWCDDYBFWjs.getJsxInterface; exports.validateInterfaceContext = _chunkWCDDYBFWjs.validateInterfaceContext;
13
+ exports.assertNameIsUnique = _chunkH7TB7I6Zjs.assertNameIsUnique; exports.constructState = _chunkH7TB7I6Zjs.constructState; exports.getJsxInterface = _chunkH7TB7I6Zjs.getJsxInterface; exports.validateInterfaceContext = _chunkH7TB7I6Zjs.validateInterfaceContext;
14
14
  //# sourceMappingURL=utils.js.map
@@ -3,7 +3,7 @@ import {
3
3
  constructState,
4
4
  getJsxInterface,
5
5
  validateInterfaceContext
6
- } from "../chunk-7CZDBXIY.mjs";
6
+ } from "../chunk-3T6W5VI2.mjs";
7
7
  import "../chunk-YRZVIDCF.mjs";
8
8
  export {
9
9
  assertNameIsUnique,
package/dist/node.js CHANGED
@@ -51,8 +51,8 @@ var _chunkYYPUPKQYjs = require('./chunk-YYPUPKQY.js');
51
51
  require('./chunk-VNOCJWOK.js');
52
52
 
53
53
 
54
- var _chunk6VGMRXGYjs = require('./chunk-6VGMRXGY.js');
55
- require('./chunk-WCDDYBFW.js');
54
+ var _chunkBUHS4M6Fjs = require('./chunk-BUHS4M6F.js');
55
+ require('./chunk-H7TB7I6Z.js');
56
56
  require('./chunk-4URGXJP7.js');
57
57
  require('./chunk-OHMCPTOI.js');
58
58
  require('./chunk-D74XJG2L.js');
@@ -128,5 +128,5 @@ require('./chunk-EXN2TFDJ.js');
128
128
 
129
129
 
130
130
 
131
- exports.AbstractExecutionService = _chunkS775IABYjs.AbstractExecutionService; exports.BaseNpmLocation = _chunkXWDEGRM5js.BaseNpmLocation; exports.CronjobController = _chunkGRBWVPLFjs.CronjobController; exports.DAILY_TIMEOUT = _chunkGRBWVPLFjs.DAILY_TIMEOUT; exports.DEFAULT_NPM_REGISTRY = _chunkXWDEGRM5js.DEFAULT_NPM_REGISTRY; exports.HttpLocation = _chunkRDBT3ZJQjs.HttpLocation; exports.IframeExecutionService = _chunkZRC46TUFjs.IframeExecutionService; exports.JsonSnapsRegistry = _chunkCPUUURMTjs.JsonSnapsRegistry; exports.LocalLocation = _chunkLWBPKSU2js.LocalLocation; exports.NodeProcessExecutionService = _chunk3AANDIXTjs.NodeProcessExecutionService; exports.NodeThreadExecutionService = _chunkRW7AYHRGjs.NodeThreadExecutionService; exports.NpmLocation = _chunkXWDEGRM5js.NpmLocation; exports.OffscreenExecutionService = _chunk6ERB63FHjs.OffscreenExecutionService; exports.ProxyPostMessageStream = _chunk7Y6P5FRNjs.ProxyPostMessageStream; exports.SNAP_APPROVAL_INSTALL = _chunkZBSBCWWMjs.SNAP_APPROVAL_INSTALL; exports.SNAP_APPROVAL_RESULT = _chunkZBSBCWWMjs.SNAP_APPROVAL_RESULT; exports.SNAP_APPROVAL_UPDATE = _chunkZBSBCWWMjs.SNAP_APPROVAL_UPDATE; exports.SnapController = _chunkZBSBCWWMjs.SnapController; exports.SnapInterfaceController = _chunk6VGMRXGYjs.SnapInterfaceController; exports.SnapsRegistryStatus = _chunk4CA3O64Hjs.SnapsRegistryStatus; exports.TARBALL_SIZE_SAFETY_LIMIT = _chunkXWDEGRM5js.TARBALL_SIZE_SAFETY_LIMIT; exports.WebWorkerExecutionService = _chunkHQ6HMINLjs.WebWorkerExecutionService; exports.calculateConnectionsChange = _chunkCDTGUNSAjs.calculateConnectionsChange; exports.controllerName = _chunkZBSBCWWMjs.controllerName; exports.delay = _chunkCDTGUNSAjs.delay; exports.delayWithTimer = _chunkCDTGUNSAjs.delayWithTimer; exports.detectSnapLocation = _chunkPT22IXNSjs.detectSnapLocation; exports.fetchNpmMetadata = _chunkXWDEGRM5js.fetchNpmMetadata; exports.fetchSnap = _chunkCDTGUNSAjs.fetchSnap; exports.getNpmCanonicalBasePath = _chunkXWDEGRM5js.getNpmCanonicalBasePath; exports.getRunnableSnaps = _chunkYYPUPKQYjs.getRunnableSnaps; exports.getSnapFiles = _chunkCDTGUNSAjs.getSnapFiles; exports.hasTimedOut = _chunkCDTGUNSAjs.hasTimedOut; exports.permissionsDiff = _chunkCDTGUNSAjs.permissionsDiff; exports.setDiff = _chunkCDTGUNSAjs.setDiff; exports.setupMultiplex = _chunkS775IABYjs.setupMultiplex; exports.withTimeout = _chunkCDTGUNSAjs.withTimeout;
131
+ exports.AbstractExecutionService = _chunkS775IABYjs.AbstractExecutionService; exports.BaseNpmLocation = _chunkXWDEGRM5js.BaseNpmLocation; exports.CronjobController = _chunkGRBWVPLFjs.CronjobController; exports.DAILY_TIMEOUT = _chunkGRBWVPLFjs.DAILY_TIMEOUT; exports.DEFAULT_NPM_REGISTRY = _chunkXWDEGRM5js.DEFAULT_NPM_REGISTRY; exports.HttpLocation = _chunkRDBT3ZJQjs.HttpLocation; exports.IframeExecutionService = _chunkZRC46TUFjs.IframeExecutionService; exports.JsonSnapsRegistry = _chunkCPUUURMTjs.JsonSnapsRegistry; exports.LocalLocation = _chunkLWBPKSU2js.LocalLocation; exports.NodeProcessExecutionService = _chunk3AANDIXTjs.NodeProcessExecutionService; exports.NodeThreadExecutionService = _chunkRW7AYHRGjs.NodeThreadExecutionService; exports.NpmLocation = _chunkXWDEGRM5js.NpmLocation; exports.OffscreenExecutionService = _chunk6ERB63FHjs.OffscreenExecutionService; exports.ProxyPostMessageStream = _chunk7Y6P5FRNjs.ProxyPostMessageStream; exports.SNAP_APPROVAL_INSTALL = _chunkZBSBCWWMjs.SNAP_APPROVAL_INSTALL; exports.SNAP_APPROVAL_RESULT = _chunkZBSBCWWMjs.SNAP_APPROVAL_RESULT; exports.SNAP_APPROVAL_UPDATE = _chunkZBSBCWWMjs.SNAP_APPROVAL_UPDATE; exports.SnapController = _chunkZBSBCWWMjs.SnapController; exports.SnapInterfaceController = _chunkBUHS4M6Fjs.SnapInterfaceController; exports.SnapsRegistryStatus = _chunk4CA3O64Hjs.SnapsRegistryStatus; exports.TARBALL_SIZE_SAFETY_LIMIT = _chunkXWDEGRM5js.TARBALL_SIZE_SAFETY_LIMIT; exports.WebWorkerExecutionService = _chunkHQ6HMINLjs.WebWorkerExecutionService; exports.calculateConnectionsChange = _chunkCDTGUNSAjs.calculateConnectionsChange; exports.controllerName = _chunkZBSBCWWMjs.controllerName; exports.delay = _chunkCDTGUNSAjs.delay; exports.delayWithTimer = _chunkCDTGUNSAjs.delayWithTimer; exports.detectSnapLocation = _chunkPT22IXNSjs.detectSnapLocation; exports.fetchNpmMetadata = _chunkXWDEGRM5js.fetchNpmMetadata; exports.fetchSnap = _chunkCDTGUNSAjs.fetchSnap; exports.getNpmCanonicalBasePath = _chunkXWDEGRM5js.getNpmCanonicalBasePath; exports.getRunnableSnaps = _chunkYYPUPKQYjs.getRunnableSnaps; exports.getSnapFiles = _chunkCDTGUNSAjs.getSnapFiles; exports.hasTimedOut = _chunkCDTGUNSAjs.hasTimedOut; exports.permissionsDiff = _chunkCDTGUNSAjs.permissionsDiff; exports.setDiff = _chunkCDTGUNSAjs.setDiff; exports.setupMultiplex = _chunkS775IABYjs.setupMultiplex; exports.withTimeout = _chunkCDTGUNSAjs.withTimeout;
132
132
  //# sourceMappingURL=node.js.map
package/dist/node.mjs CHANGED
@@ -51,8 +51,8 @@ import {
51
51
  import "./chunk-U74FML7Z.mjs";
52
52
  import {
53
53
  SnapInterfaceController
54
- } from "./chunk-YAZ55WUL.mjs";
55
- import "./chunk-7CZDBXIY.mjs";
54
+ } from "./chunk-WP3DAIFM.mjs";
55
+ import "./chunk-3T6W5VI2.mjs";
56
56
  import "./chunk-IABOI7TW.mjs";
57
57
  import "./chunk-ESQPQNEF.mjs";
58
58
  import "./chunk-V6NFZ47P.mjs";
@@ -49,8 +49,8 @@ var _chunkYYPUPKQYjs = require('./chunk-YYPUPKQY.js');
49
49
  require('./chunk-VNOCJWOK.js');
50
50
 
51
51
 
52
- var _chunk6VGMRXGYjs = require('./chunk-6VGMRXGY.js');
53
- require('./chunk-WCDDYBFW.js');
52
+ var _chunkBUHS4M6Fjs = require('./chunk-BUHS4M6F.js');
53
+ require('./chunk-H7TB7I6Z.js');
54
54
  require('./chunk-4URGXJP7.js');
55
55
  require('./chunk-OHMCPTOI.js');
56
56
  require('./chunk-D74XJG2L.js');
@@ -125,5 +125,5 @@ require('./chunk-EXN2TFDJ.js');
125
125
 
126
126
 
127
127
 
128
- exports.AbstractExecutionService = _chunkS775IABYjs.AbstractExecutionService; exports.BaseNpmLocation = _chunkXWDEGRM5js.BaseNpmLocation; exports.CronjobController = _chunkGRBWVPLFjs.CronjobController; exports.DAILY_TIMEOUT = _chunkGRBWVPLFjs.DAILY_TIMEOUT; exports.DEFAULT_NPM_REGISTRY = _chunkXWDEGRM5js.DEFAULT_NPM_REGISTRY; exports.HttpLocation = _chunkRDBT3ZJQjs.HttpLocation; exports.IframeExecutionService = _chunkZRC46TUFjs.IframeExecutionService; exports.JsonSnapsRegistry = _chunkCPUUURMTjs.JsonSnapsRegistry; exports.LocalLocation = _chunkLWBPKSU2js.LocalLocation; exports.NpmLocation = _chunkXWDEGRM5js.NpmLocation; exports.OffscreenExecutionService = _chunk6ERB63FHjs.OffscreenExecutionService; exports.ProxyPostMessageStream = _chunk7Y6P5FRNjs.ProxyPostMessageStream; exports.SNAP_APPROVAL_INSTALL = _chunkZBSBCWWMjs.SNAP_APPROVAL_INSTALL; exports.SNAP_APPROVAL_RESULT = _chunkZBSBCWWMjs.SNAP_APPROVAL_RESULT; exports.SNAP_APPROVAL_UPDATE = _chunkZBSBCWWMjs.SNAP_APPROVAL_UPDATE; exports.SnapController = _chunkZBSBCWWMjs.SnapController; exports.SnapInterfaceController = _chunk6VGMRXGYjs.SnapInterfaceController; exports.SnapsRegistryStatus = _chunk4CA3O64Hjs.SnapsRegistryStatus; exports.TARBALL_SIZE_SAFETY_LIMIT = _chunkXWDEGRM5js.TARBALL_SIZE_SAFETY_LIMIT; exports.WebViewExecutionService = _chunkFPGAQ6MTjs.WebViewExecutionService; exports.WebWorkerExecutionService = _chunkHQ6HMINLjs.WebWorkerExecutionService; exports.calculateConnectionsChange = _chunkCDTGUNSAjs.calculateConnectionsChange; exports.controllerName = _chunkZBSBCWWMjs.controllerName; exports.delay = _chunkCDTGUNSAjs.delay; exports.delayWithTimer = _chunkCDTGUNSAjs.delayWithTimer; exports.detectSnapLocation = _chunkPT22IXNSjs.detectSnapLocation; exports.fetchNpmMetadata = _chunkXWDEGRM5js.fetchNpmMetadata; exports.fetchSnap = _chunkCDTGUNSAjs.fetchSnap; exports.getNpmCanonicalBasePath = _chunkXWDEGRM5js.getNpmCanonicalBasePath; exports.getRunnableSnaps = _chunkYYPUPKQYjs.getRunnableSnaps; exports.getSnapFiles = _chunkCDTGUNSAjs.getSnapFiles; exports.hasTimedOut = _chunkCDTGUNSAjs.hasTimedOut; exports.permissionsDiff = _chunkCDTGUNSAjs.permissionsDiff; exports.setDiff = _chunkCDTGUNSAjs.setDiff; exports.setupMultiplex = _chunkS775IABYjs.setupMultiplex; exports.withTimeout = _chunkCDTGUNSAjs.withTimeout;
128
+ exports.AbstractExecutionService = _chunkS775IABYjs.AbstractExecutionService; exports.BaseNpmLocation = _chunkXWDEGRM5js.BaseNpmLocation; exports.CronjobController = _chunkGRBWVPLFjs.CronjobController; exports.DAILY_TIMEOUT = _chunkGRBWVPLFjs.DAILY_TIMEOUT; exports.DEFAULT_NPM_REGISTRY = _chunkXWDEGRM5js.DEFAULT_NPM_REGISTRY; exports.HttpLocation = _chunkRDBT3ZJQjs.HttpLocation; exports.IframeExecutionService = _chunkZRC46TUFjs.IframeExecutionService; exports.JsonSnapsRegistry = _chunkCPUUURMTjs.JsonSnapsRegistry; exports.LocalLocation = _chunkLWBPKSU2js.LocalLocation; exports.NpmLocation = _chunkXWDEGRM5js.NpmLocation; exports.OffscreenExecutionService = _chunk6ERB63FHjs.OffscreenExecutionService; exports.ProxyPostMessageStream = _chunk7Y6P5FRNjs.ProxyPostMessageStream; exports.SNAP_APPROVAL_INSTALL = _chunkZBSBCWWMjs.SNAP_APPROVAL_INSTALL; exports.SNAP_APPROVAL_RESULT = _chunkZBSBCWWMjs.SNAP_APPROVAL_RESULT; exports.SNAP_APPROVAL_UPDATE = _chunkZBSBCWWMjs.SNAP_APPROVAL_UPDATE; exports.SnapController = _chunkZBSBCWWMjs.SnapController; exports.SnapInterfaceController = _chunkBUHS4M6Fjs.SnapInterfaceController; exports.SnapsRegistryStatus = _chunk4CA3O64Hjs.SnapsRegistryStatus; exports.TARBALL_SIZE_SAFETY_LIMIT = _chunkXWDEGRM5js.TARBALL_SIZE_SAFETY_LIMIT; exports.WebViewExecutionService = _chunkFPGAQ6MTjs.WebViewExecutionService; exports.WebWorkerExecutionService = _chunkHQ6HMINLjs.WebWorkerExecutionService; exports.calculateConnectionsChange = _chunkCDTGUNSAjs.calculateConnectionsChange; exports.controllerName = _chunkZBSBCWWMjs.controllerName; exports.delay = _chunkCDTGUNSAjs.delay; exports.delayWithTimer = _chunkCDTGUNSAjs.delayWithTimer; exports.detectSnapLocation = _chunkPT22IXNSjs.detectSnapLocation; exports.fetchNpmMetadata = _chunkXWDEGRM5js.fetchNpmMetadata; exports.fetchSnap = _chunkCDTGUNSAjs.fetchSnap; exports.getNpmCanonicalBasePath = _chunkXWDEGRM5js.getNpmCanonicalBasePath; exports.getRunnableSnaps = _chunkYYPUPKQYjs.getRunnableSnaps; exports.getSnapFiles = _chunkCDTGUNSAjs.getSnapFiles; exports.hasTimedOut = _chunkCDTGUNSAjs.hasTimedOut; exports.permissionsDiff = _chunkCDTGUNSAjs.permissionsDiff; exports.setDiff = _chunkCDTGUNSAjs.setDiff; exports.setupMultiplex = _chunkS775IABYjs.setupMultiplex; exports.withTimeout = _chunkCDTGUNSAjs.withTimeout;
129
129
  //# sourceMappingURL=react-native.js.map
@@ -49,8 +49,8 @@ import {
49
49
  import "./chunk-U74FML7Z.mjs";
50
50
  import {
51
51
  SnapInterfaceController
52
- } from "./chunk-YAZ55WUL.mjs";
53
- import "./chunk-7CZDBXIY.mjs";
52
+ } from "./chunk-WP3DAIFM.mjs";
53
+ import "./chunk-3T6W5VI2.mjs";
54
54
  import "./chunk-IABOI7TW.mjs";
55
55
  import "./chunk-ESQPQNEF.mjs";
56
56
  import "./chunk-V6NFZ47P.mjs";