@uniformdev/mesh-sdk 19.173.0 → 19.173.1-alpha.17

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
@@ -1030,6 +1030,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
1030
1030
  * Note that setValue() always sets the target language automatically.
1031
1031
  */
1032
1032
  targetLocale: string | undefined;
1033
+ /**
1034
+ * When editing a conditional value, this is the index in the parent parameter of the conditional value.
1035
+ * If this is -1, then the editor is not editing a conditional value.
1036
+ */
1037
+ targetConditionIndex: number;
1033
1038
  }, TIntegrationConfiguration>;
1034
1039
  type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'> & {
1035
1040
  /**
@@ -1209,9 +1214,10 @@ type MeshSDKEventInterface = Awaited<ReturnType<typeof connectToParent>>['parent
1209
1214
  * Imports the iframe communications library and provides an interface for interacting with
1210
1215
  * the parent window via said communications library.
1211
1216
  */
1212
- declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, }: {
1217
+ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, onValueExternallyUpdated, }: {
1213
1218
  dialogResponseHandlers: DialogResponseHandlers;
1214
1219
  onMetadataUpdated: (metadata: unknown) => void;
1220
+ onValueExternallyUpdated: (value: unknown) => void;
1215
1221
  }): Promise<{
1216
1222
  initData: MeshContextData;
1217
1223
  parent: {
package/dist/index.d.ts CHANGED
@@ -1030,6 +1030,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
1030
1030
  * Note that setValue() always sets the target language automatically.
1031
1031
  */
1032
1032
  targetLocale: string | undefined;
1033
+ /**
1034
+ * When editing a conditional value, this is the index in the parent parameter of the conditional value.
1035
+ * If this is -1, then the editor is not editing a conditional value.
1036
+ */
1037
+ targetConditionIndex: number;
1033
1038
  }, TIntegrationConfiguration>;
1034
1039
  type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'> & {
1035
1040
  /**
@@ -1209,9 +1214,10 @@ type MeshSDKEventInterface = Awaited<ReturnType<typeof connectToParent>>['parent
1209
1214
  * Imports the iframe communications library and provides an interface for interacting with
1210
1215
  * the parent window via said communications library.
1211
1216
  */
1212
- declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, }: {
1217
+ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, onValueExternallyUpdated, }: {
1213
1218
  dialogResponseHandlers: DialogResponseHandlers;
1214
1219
  onMetadataUpdated: (metadata: unknown) => void;
1220
+ onValueExternallyUpdated: (value: unknown) => void;
1215
1221
  }): Promise<{
1216
1222
  initData: MeshContextData;
1217
1223
  parent: {
package/dist/index.esm.js CHANGED
@@ -112,6 +112,9 @@ var getLogger = (prefix, debug) => {
112
112
  }
113
113
  };
114
114
 
115
+ // src/temp/version.ts
116
+ var UNIFORM_MESH_SDK_VERSION = "19.173.0";
117
+
115
118
  // src/framepost/constants.ts
116
119
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
117
120
 
@@ -361,6 +364,7 @@ var SharedClient = class {
361
364
  const message = serialize({
362
365
  type,
363
366
  apiVersion: "framepost/v1" /* v1 */,
367
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
364
368
  key,
365
369
  data,
366
370
  id: randomInsecureId(),
@@ -402,6 +406,7 @@ var SharedClient = class {
402
406
  const message = serialize({
403
407
  type: "channel_init" /* CHANNEL_INIT */,
404
408
  apiVersion: "framepost/v1" /* v1 */,
409
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
405
410
  key: "",
406
411
  data: context,
407
412
  id: randomInsecureId()
@@ -445,7 +450,8 @@ var ChildClient = class extends SharedClient {
445
450
  // src/sdkComms.ts
446
451
  async function connectToParent({
447
452
  dialogResponseHandlers,
448
- onMetadataUpdated
453
+ onMetadataUpdated,
454
+ onValueExternallyUpdated
449
455
  }) {
450
456
  const client = new ChildClient({ debug: false });
451
457
  window.parent.postMessage("parents just don't understand", "*");
@@ -463,6 +469,7 @@ async function connectToParent({
463
469
  delete dialogResponseHandlers[data.dialogId];
464
470
  });
465
471
  client.onRequest("metadata-value", onMetadataUpdated);
472
+ client.onRequest("external-value-update", onValueExternallyUpdated);
466
473
  return {
467
474
  initData,
468
475
  parent: {
@@ -648,6 +655,10 @@ async function initializeUniformMeshSDK({
648
655
  console.debug("Received metadata update", newMeta);
649
656
  currentMetadata = typedNewMeta;
650
657
  events.emit("onMetadataChanged", { newValue: newMeta });
658
+ },
659
+ onValueExternallyUpdated: (newValue) => {
660
+ console.debug("Received external value update", newValue);
661
+ events.emit("onValueChanged", { newValue });
651
662
  }
652
663
  });
653
664
  const { initData: contextData, parent } = connectResult;
package/dist/index.js CHANGED
@@ -151,6 +151,9 @@ var getLogger = (prefix, debug) => {
151
151
  }
152
152
  };
153
153
 
154
+ // src/temp/version.ts
155
+ var UNIFORM_MESH_SDK_VERSION = "19.173.0";
156
+
154
157
  // src/framepost/constants.ts
155
158
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
156
159
 
@@ -400,6 +403,7 @@ var SharedClient = class {
400
403
  const message = serialize({
401
404
  type,
402
405
  apiVersion: "framepost/v1" /* v1 */,
406
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
403
407
  key,
404
408
  data,
405
409
  id: randomInsecureId(),
@@ -441,6 +445,7 @@ var SharedClient = class {
441
445
  const message = serialize({
442
446
  type: "channel_init" /* CHANNEL_INIT */,
443
447
  apiVersion: "framepost/v1" /* v1 */,
448
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
444
449
  key: "",
445
450
  data: context,
446
451
  id: randomInsecureId()
@@ -484,7 +489,8 @@ var ChildClient = class extends SharedClient {
484
489
  // src/sdkComms.ts
485
490
  async function connectToParent({
486
491
  dialogResponseHandlers,
487
- onMetadataUpdated
492
+ onMetadataUpdated,
493
+ onValueExternallyUpdated
488
494
  }) {
489
495
  const client = new ChildClient({ debug: false });
490
496
  window.parent.postMessage("parents just don't understand", "*");
@@ -502,6 +508,7 @@ async function connectToParent({
502
508
  delete dialogResponseHandlers[data.dialogId];
503
509
  });
504
510
  client.onRequest("metadata-value", onMetadataUpdated);
511
+ client.onRequest("external-value-update", onValueExternallyUpdated);
505
512
  return {
506
513
  initData,
507
514
  parent: {
@@ -687,6 +694,10 @@ async function initializeUniformMeshSDK({
687
694
  console.debug("Received metadata update", newMeta);
688
695
  currentMetadata = typedNewMeta;
689
696
  events.emit("onMetadataChanged", { newValue: newMeta });
697
+ },
698
+ onValueExternallyUpdated: (newValue) => {
699
+ console.debug("Received external value update", newValue);
700
+ events.emit("onValueChanged", { newValue });
690
701
  }
691
702
  });
692
703
  const { initData: contextData, parent } = connectResult;
package/dist/index.mjs CHANGED
@@ -112,6 +112,9 @@ var getLogger = (prefix, debug) => {
112
112
  }
113
113
  };
114
114
 
115
+ // src/temp/version.ts
116
+ var UNIFORM_MESH_SDK_VERSION = "19.173.0";
117
+
115
118
  // src/framepost/constants.ts
116
119
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
117
120
 
@@ -361,6 +364,7 @@ var SharedClient = class {
361
364
  const message = serialize({
362
365
  type,
363
366
  apiVersion: "framepost/v1" /* v1 */,
367
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
364
368
  key,
365
369
  data,
366
370
  id: randomInsecureId(),
@@ -402,6 +406,7 @@ var SharedClient = class {
402
406
  const message = serialize({
403
407
  type: "channel_init" /* CHANNEL_INIT */,
404
408
  apiVersion: "framepost/v1" /* v1 */,
409
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
405
410
  key: "",
406
411
  data: context,
407
412
  id: randomInsecureId()
@@ -445,7 +450,8 @@ var ChildClient = class extends SharedClient {
445
450
  // src/sdkComms.ts
446
451
  async function connectToParent({
447
452
  dialogResponseHandlers,
448
- onMetadataUpdated
453
+ onMetadataUpdated,
454
+ onValueExternallyUpdated
449
455
  }) {
450
456
  const client = new ChildClient({ debug: false });
451
457
  window.parent.postMessage("parents just don't understand", "*");
@@ -463,6 +469,7 @@ async function connectToParent({
463
469
  delete dialogResponseHandlers[data.dialogId];
464
470
  });
465
471
  client.onRequest("metadata-value", onMetadataUpdated);
472
+ client.onRequest("external-value-update", onValueExternallyUpdated);
466
473
  return {
467
474
  initData,
468
475
  parent: {
@@ -648,6 +655,10 @@ async function initializeUniformMeshSDK({
648
655
  console.debug("Received metadata update", newMeta);
649
656
  currentMetadata = typedNewMeta;
650
657
  events.emit("onMetadataChanged", { newValue: newMeta });
658
+ },
659
+ onValueExternallyUpdated: (newValue) => {
660
+ console.debug("Received external value update", newValue);
661
+ events.emit("onValueChanged", { newValue });
651
662
  }
652
663
  });
653
664
  const { initData: contextData, parent } = connectResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk",
3
- "version": "19.173.0",
3
+ "version": "19.173.1-alpha.17+25c1176cea",
4
4
  "description": "Uniform Mesh Framework SDK",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -16,9 +16,10 @@
16
16
  "types": "./dist/index.d.ts",
17
17
  "sideEffects": false,
18
18
  "scripts": {
19
- "build": "run-s update-openapi build:js",
19
+ "build": "run-s update-openapi build:setversion build:js",
20
20
  "build:js": "tsup",
21
- "dev": "pnpm update-openapi && tsup --watch",
21
+ "build:setversion": "tsx ./scripts/set-version.ts",
22
+ "dev": "pnpm update-openapi && pnpm build:setversion && tsup --watch",
22
23
  "clean": "rimraf dist",
23
24
  "test": "jest --maxWorkers=1 --passWithNoTests",
24
25
  "lint": "eslint \"src/**/*.{js,ts,tsx}\"",
@@ -33,14 +34,14 @@
33
34
  "access": "public"
34
35
  },
35
36
  "dependencies": {
36
- "@uniformdev/canvas": "19.173.0",
37
- "@uniformdev/context": "19.173.0",
38
- "@uniformdev/project-map": "19.173.0",
37
+ "@uniformdev/canvas": "19.173.1-alpha.17+25c1176cea",
38
+ "@uniformdev/context": "19.173.1-alpha.17+25c1176cea",
39
+ "@uniformdev/project-map": "19.173.1-alpha.17+25c1176cea",
39
40
  "imagesloaded": "^5.0.0",
40
41
  "mitt": "^3.0.0"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@types/imagesloaded": "^4.1.2"
44
45
  },
45
- "gitHead": "d71596f8829efb4f28ef7213dd9c06421b5cc388"
46
+ "gitHead": "25c1176cea8d5114b92fc75cdd8bba4aa6463a50"
46
47
  }