@uniformdev/mesh-sdk 19.117.2-alpha.2 → 19.118.1-alpha.1

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/dist/index.d.mts CHANGED
@@ -1028,9 +1028,12 @@ interface DialogOptions<TDialogParams = DialogParams> {
1028
1028
  disableCloseDialogOnSetValue?: boolean;
1029
1029
  /**
1030
1030
  * Options for setting the max width of the dialog.
1031
+ *
1032
+ * Custom string can be used for specific custom width .e.g "clamp(300px, 50%, 600px)"
1033
+ *
1031
1034
  * @deprecated Use `width` instead. This property will become ignored in a future release.
1032
1035
  */
1033
- maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | 'full';
1036
+ maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | 'full' | string;
1034
1037
  /**
1035
1038
  * Options for setting the width of the dialog.
1036
1039
  */
@@ -1040,6 +1043,10 @@ interface DialogOptions<TDialogParams = DialogParams> {
1040
1043
  * the `metadata` object for the dialog location, e.g. `metadata.dialogParams`.
1041
1044
  * Parameters should be simple (serializable) types, not functions or DOM
1042
1045
  * elements or similar non-serializable objects.
1046
+ *
1047
+ * Best practice is to keep size of the params as small as possible.
1048
+ *
1049
+ * @see https://surma.dev/things/is-postmessage-slow/
1043
1050
  */
1044
1051
  params?: TDialogParams;
1045
1052
  /**
package/dist/index.d.ts CHANGED
@@ -1028,9 +1028,12 @@ interface DialogOptions<TDialogParams = DialogParams> {
1028
1028
  disableCloseDialogOnSetValue?: boolean;
1029
1029
  /**
1030
1030
  * Options for setting the max width of the dialog.
1031
+ *
1032
+ * Custom string can be used for specific custom width .e.g "clamp(300px, 50%, 600px)"
1033
+ *
1031
1034
  * @deprecated Use `width` instead. This property will become ignored in a future release.
1032
1035
  */
1033
- maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | 'full';
1036
+ maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | 'full' | string;
1034
1037
  /**
1035
1038
  * Options for setting the width of the dialog.
1036
1039
  */
@@ -1040,6 +1043,10 @@ interface DialogOptions<TDialogParams = DialogParams> {
1040
1043
  * the `metadata` object for the dialog location, e.g. `metadata.dialogParams`.
1041
1044
  * Parameters should be simple (serializable) types, not functions or DOM
1042
1045
  * elements or similar non-serializable objects.
1046
+ *
1047
+ * Best practice is to keep size of the params as small as possible.
1048
+ *
1049
+ * @see https://surma.dev/things/is-postmessage-slow/
1043
1050
  */
1044
1051
  params?: TDialogParams;
1045
1052
  /**
package/dist/index.esm.js CHANGED
@@ -480,10 +480,6 @@ async function connectToParent({
480
480
  await client.request("setValue", value);
481
481
  },
482
482
  openDialog: async (message) => {
483
- var _a;
484
- if (getByteSize((_a = message.options) == null ? void 0 : _a.params) > 1e5) {
485
- throw new Error(`Dialog parameters object is too large, maximum size is 100KB`);
486
- }
487
483
  const res = await client.request(
488
484
  "openDialog",
489
485
  message
@@ -519,18 +515,6 @@ async function connectToParent({
519
515
  }
520
516
  };
521
517
  }
522
- function getByteSize(val) {
523
- if (!val || typeof Blob === "undefined") {
524
- return 0;
525
- }
526
- try {
527
- const serialized = JSON.stringify(val);
528
- const size = new Blob([serialized]).size;
529
- return size;
530
- } catch (error) {
531
- throw new Error("Error calculating object size: " + error.message);
532
- }
533
- }
534
518
 
535
519
  // src/sdkWindow.ts
536
520
  import imagesLoaded from "imagesloaded";
package/dist/index.js CHANGED
@@ -519,10 +519,6 @@ async function connectToParent({
519
519
  await client.request("setValue", value);
520
520
  },
521
521
  openDialog: async (message) => {
522
- var _a;
523
- if (getByteSize((_a = message.options) == null ? void 0 : _a.params) > 1e5) {
524
- throw new Error(`Dialog parameters object is too large, maximum size is 100KB`);
525
- }
526
522
  const res = await client.request(
527
523
  "openDialog",
528
524
  message
@@ -558,18 +554,6 @@ async function connectToParent({
558
554
  }
559
555
  };
560
556
  }
561
- function getByteSize(val) {
562
- if (!val || typeof Blob === "undefined") {
563
- return 0;
564
- }
565
- try {
566
- const serialized = JSON.stringify(val);
567
- const size = new Blob([serialized]).size;
568
- return size;
569
- } catch (error) {
570
- throw new Error("Error calculating object size: " + error.message);
571
- }
572
- }
573
557
 
574
558
  // src/sdkWindow.ts
575
559
  var import_imagesloaded = __toESM(require("imagesloaded"));
package/dist/index.mjs CHANGED
@@ -480,10 +480,6 @@ async function connectToParent({
480
480
  await client.request("setValue", value);
481
481
  },
482
482
  openDialog: async (message) => {
483
- var _a;
484
- if (getByteSize((_a = message.options) == null ? void 0 : _a.params) > 1e5) {
485
- throw new Error(`Dialog parameters object is too large, maximum size is 100KB`);
486
- }
487
483
  const res = await client.request(
488
484
  "openDialog",
489
485
  message
@@ -519,18 +515,6 @@ async function connectToParent({
519
515
  }
520
516
  };
521
517
  }
522
- function getByteSize(val) {
523
- if (!val || typeof Blob === "undefined") {
524
- return 0;
525
- }
526
- try {
527
- const serialized = JSON.stringify(val);
528
- const size = new Blob([serialized]).size;
529
- return size;
530
- } catch (error) {
531
- throw new Error("Error calculating object size: " + error.message);
532
- }
533
- }
534
518
 
535
519
  // src/sdkWindow.ts
536
520
  import imagesLoaded from "imagesloaded";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk",
3
- "version": "19.117.2-alpha.2+cb8f2c5106",
3
+ "version": "19.118.1-alpha.1+6beb0b5ebc",
4
4
  "description": "Uniform Mesh Framework SDK",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -33,14 +33,14 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@uniformdev/canvas": "19.117.2-alpha.2+cb8f2c5106",
37
- "@uniformdev/context": "19.117.2-alpha.2+cb8f2c5106",
38
- "@uniformdev/project-map": "19.117.2-alpha.2+cb8f2c5106",
36
+ "@uniformdev/canvas": "19.118.1-alpha.1+6beb0b5ebc",
37
+ "@uniformdev/context": "19.118.1-alpha.1+6beb0b5ebc",
38
+ "@uniformdev/project-map": "19.118.1-alpha.1+6beb0b5ebc",
39
39
  "imagesloaded": "^5.0.0",
40
40
  "mitt": "^3.0.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/imagesloaded": "^4.1.2"
44
44
  },
45
- "gitHead": "cb8f2c51062a045c338e6b61ab217bb392196337"
45
+ "gitHead": "6beb0b5ebc5ccde16fb6f737d4c1fe44dc738eec"
46
46
  }