@uniformdev/canvas 19.38.3-alpha.70 → 19.38.3-alpha.78

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.esm.js CHANGED
@@ -679,11 +679,84 @@ var unstable_CompositionRelationshipClient = class extends ApiClient3 {
679
679
  }
680
680
  };
681
681
 
682
- // src/DataSourceClient.ts
682
+ // src/ContentClient.ts
683
683
  import { ApiClient as ApiClient4 } from "@uniformdev/context/api";
684
+ var _contentTypesUrl, _entriesUrl;
685
+ var _ContentClient = class _ContentClient extends ApiClient4 {
686
+ constructor(options) {
687
+ var _a;
688
+ super(options);
689
+ this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
690
+ }
691
+ getContentTypes(options) {
692
+ const { projectId } = this.options;
693
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl), { ...options, projectId });
694
+ return this.apiClient(fetchUri);
695
+ }
696
+ getEntries(options) {
697
+ const { projectId } = this.options;
698
+ const { skipDataResolution, ...params } = options;
699
+ const fetchUri = skipDataResolution ? this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId }) : this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
700
+ return this.apiClient(fetchUri);
701
+ }
702
+ async upsertContentType(body) {
703
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
704
+ await this.apiClient(fetchUri, {
705
+ method: "PUT",
706
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
707
+ expectNoContent: true
708
+ });
709
+ }
710
+ async upsertEntry(body) {
711
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
712
+ await this.apiClient(fetchUri, {
713
+ method: "PUT",
714
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
715
+ expectNoContent: true
716
+ });
717
+ }
718
+ async deleteContentType(body) {
719
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
720
+ await this.apiClient(fetchUri, {
721
+ method: "DELETE",
722
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
723
+ expectNoContent: true
724
+ });
725
+ }
726
+ async deleteEntry(body) {
727
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
728
+ await this.apiClient(fetchUri, {
729
+ method: "DELETE",
730
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
731
+ expectNoContent: true
732
+ });
733
+ }
734
+ getEdgeOptions(options) {
735
+ const { projectId } = this.options;
736
+ const { skipDataResolution, ...params } = options;
737
+ return {
738
+ projectId,
739
+ ...params,
740
+ diagnostics: (options == null ? void 0 : options.diagnostics) ? "true" : void 0
741
+ };
742
+ }
743
+ };
744
+ _contentTypesUrl = new WeakMap();
745
+ _entriesUrl = new WeakMap();
746
+ __privateAdd(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
747
+ __privateAdd(_ContentClient, _entriesUrl, "/api/v1/entries");
748
+ var ContentClient = _ContentClient;
749
+ var UncachedContentClient = class extends ContentClient {
750
+ constructor(options) {
751
+ super({ ...options, bypassCache: true });
752
+ }
753
+ };
754
+
755
+ // src/DataSourceClient.ts
756
+ import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
684
757
  var dataSourceUrl = "/api/v1/data-source";
685
758
  var dataSourcesUrl = "/api/v1/data-sources";
686
- var DataSourceClient = class extends ApiClient4 {
759
+ var DataSourceClient = class extends ApiClient5 {
687
760
  constructor(options) {
688
761
  super(options);
689
762
  }
@@ -720,9 +793,9 @@ var DataSourceClient = class extends ApiClient4 {
720
793
  };
721
794
 
722
795
  // src/DataTypeClient.ts
723
- import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
796
+ import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
724
797
  var _url;
725
- var _DataTypeClient = class _DataTypeClient extends ApiClient5 {
798
+ var _DataTypeClient = class _DataTypeClient extends ApiClient6 {
726
799
  constructor(options) {
727
800
  super(options);
728
801
  }
@@ -1245,10 +1318,13 @@ var CANVAS_TEST_SLOT = "test";
1245
1318
  var CANVAS_LOCALIZATION_SLOT = "localized";
1246
1319
  var CANVAS_DRAFT_STATE = 0;
1247
1320
  var CANVAS_PUBLISHED_STATE = 64;
1321
+ var CANVAS_EDITOR_STATE = 63;
1248
1322
  var CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
1249
1323
  var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
1250
1324
  var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
1251
1325
  var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
1326
+ var IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM = "is_incontext_editing_playground";
1327
+ var IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM = "is_config_check";
1252
1328
  var IN_CONTEXT_EDITOR_COMPONENT_START_ROLE = "uniform-component-start";
1253
1329
  var IN_CONTEXT_EDITOR_COMPONENT_END_ROLE = "uniform-component-end";
1254
1330
  var IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID = "uniform-canvas-preview-script";
@@ -1515,6 +1591,12 @@ var createCanvasChannel = ({
1515
1591
  };
1516
1592
  postMessage(message);
1517
1593
  };
1594
+ const editorStateUpdated = () => {
1595
+ const message = {
1596
+ type: "editor-state-updated"
1597
+ };
1598
+ postMessage(message);
1599
+ };
1518
1600
  const messageEventListener = (event) => {
1519
1601
  if (typeof event.data !== "string") {
1520
1602
  return;
@@ -1556,7 +1638,8 @@ var createCanvasChannel = ({
1556
1638
  updatePreviewSettings,
1557
1639
  updateContextualEditingStateInternal,
1558
1640
  selectParameter,
1559
- reportRenderedCompositions
1641
+ reportRenderedCompositions,
1642
+ editorStateUpdated
1560
1643
  };
1561
1644
  };
1562
1645
 
@@ -1639,9 +1722,9 @@ function subscribeToComposition({
1639
1722
  }
1640
1723
 
1641
1724
  // src/RouteClient.ts
1642
- import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
1725
+ import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
1643
1726
  var ROUTE_URL = "/api/v1/route";
1644
- var RouteClient = class extends ApiClient6 {
1727
+ var RouteClient = class extends ApiClient7 {
1645
1728
  constructor(options) {
1646
1729
  var _a;
1647
1730
  if (!options.limitPolicy) {
@@ -1934,6 +2017,7 @@ export {
1934
2017
  ApiClientError2 as ApiClientError,
1935
2018
  BatchEntry,
1936
2019
  CANVAS_DRAFT_STATE,
2020
+ CANVAS_EDITOR_STATE,
1937
2021
  CANVAS_ENRICHMENT_TAG_PARAM,
1938
2022
  CANVAS_INTENT_TAG_PARAM,
1939
2023
  CANVAS_LOCALE_TAG_PARAM,
@@ -1950,6 +2034,7 @@ export {
1950
2034
  CanvasClientError,
1951
2035
  CategoryClient,
1952
2036
  ChildEnhancerBuilder,
2037
+ ContentClient,
1953
2038
  DataSourceClient,
1954
2039
  DataTypeClient,
1955
2040
  EDGE_CACHE_DISABLED,
@@ -1963,13 +2048,16 @@ export {
1963
2048
  EnhancerBuilder,
1964
2049
  IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
1965
2050
  IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
2051
+ IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM,
1966
2052
  IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
2053
+ IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
1967
2054
  IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
1968
2055
  IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
1969
2056
  PLACEHOLDER_ID,
1970
2057
  RouteClient,
1971
2058
  UncachedCanvasClient,
1972
2059
  UncachedCategoryClient,
2060
+ UncachedContentClient,
1973
2061
  UniqueBatchEntries,
1974
2062
  bindVariables,
1975
2063
  bindVariablesToObject,
package/dist/index.js CHANGED
@@ -283,9 +283,10 @@ __export(src_exports, {
283
283
  ATTRIBUTE_PARAMETER_TYPE: () => ATTRIBUTE_PARAMETER_TYPE,
284
284
  ATTRIBUTE_PARAMETER_VALUE: () => ATTRIBUTE_PARAMETER_VALUE,
285
285
  ATTRIBUTE_PLACEHOLDER: () => ATTRIBUTE_PLACEHOLDER,
286
- ApiClientError: () => import_api8.ApiClientError,
286
+ ApiClientError: () => import_api9.ApiClientError,
287
287
  BatchEntry: () => BatchEntry,
288
288
  CANVAS_DRAFT_STATE: () => CANVAS_DRAFT_STATE,
289
+ CANVAS_EDITOR_STATE: () => CANVAS_EDITOR_STATE,
289
290
  CANVAS_ENRICHMENT_TAG_PARAM: () => CANVAS_ENRICHMENT_TAG_PARAM,
290
291
  CANVAS_INTENT_TAG_PARAM: () => CANVAS_INTENT_TAG_PARAM,
291
292
  CANVAS_LOCALE_TAG_PARAM: () => CANVAS_LOCALE_TAG_PARAM,
@@ -302,6 +303,7 @@ __export(src_exports, {
302
303
  CanvasClientError: () => CanvasClientError,
303
304
  CategoryClient: () => CategoryClient,
304
305
  ChildEnhancerBuilder: () => ChildEnhancerBuilder,
306
+ ContentClient: () => ContentClient,
305
307
  DataSourceClient: () => DataSourceClient,
306
308
  DataTypeClient: () => DataTypeClient,
307
309
  EDGE_CACHE_DISABLED: () => EDGE_CACHE_DISABLED,
@@ -315,13 +317,16 @@ __export(src_exports, {
315
317
  EnhancerBuilder: () => EnhancerBuilder,
316
318
  IN_CONTEXT_EDITOR_COMPONENT_END_ROLE: () => IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
317
319
  IN_CONTEXT_EDITOR_COMPONENT_START_ROLE: () => IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
320
+ IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM: () => IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM,
318
321
  IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID: () => IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
322
+ IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM: () => IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
319
323
  IN_CONTEXT_EDITOR_QUERY_STRING_PARAM: () => IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
320
324
  IS_RENDERED_BY_UNIFORM_ATTRIBUTE: () => IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
321
325
  PLACEHOLDER_ID: () => PLACEHOLDER_ID,
322
326
  RouteClient: () => RouteClient,
323
327
  UncachedCanvasClient: () => UncachedCanvasClient,
324
328
  UncachedCategoryClient: () => UncachedCategoryClient,
329
+ UncachedContentClient: () => UncachedContentClient,
325
330
  UniqueBatchEntries: () => UniqueBatchEntries,
326
331
  bindVariables: () => bindVariables,
327
332
  bindVariablesToObject: () => bindVariablesToObject,
@@ -775,11 +780,84 @@ var unstable_CompositionRelationshipClient = class extends import_api4.ApiClient
775
780
  }
776
781
  };
777
782
 
778
- // src/DataSourceClient.ts
783
+ // src/ContentClient.ts
779
784
  var import_api5 = require("@uniformdev/context/api");
785
+ var _contentTypesUrl, _entriesUrl;
786
+ var _ContentClient = class _ContentClient extends import_api5.ApiClient {
787
+ constructor(options) {
788
+ var _a;
789
+ super(options);
790
+ this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
791
+ }
792
+ getContentTypes(options) {
793
+ const { projectId } = this.options;
794
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl), { ...options, projectId });
795
+ return this.apiClient(fetchUri);
796
+ }
797
+ getEntries(options) {
798
+ const { projectId } = this.options;
799
+ const { skipDataResolution, ...params } = options;
800
+ const fetchUri = skipDataResolution ? this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId }) : this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
801
+ return this.apiClient(fetchUri);
802
+ }
803
+ async upsertContentType(body) {
804
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
805
+ await this.apiClient(fetchUri, {
806
+ method: "PUT",
807
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
808
+ expectNoContent: true
809
+ });
810
+ }
811
+ async upsertEntry(body) {
812
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
813
+ await this.apiClient(fetchUri, {
814
+ method: "PUT",
815
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
816
+ expectNoContent: true
817
+ });
818
+ }
819
+ async deleteContentType(body) {
820
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
821
+ await this.apiClient(fetchUri, {
822
+ method: "DELETE",
823
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
824
+ expectNoContent: true
825
+ });
826
+ }
827
+ async deleteEntry(body) {
828
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
829
+ await this.apiClient(fetchUri, {
830
+ method: "DELETE",
831
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
832
+ expectNoContent: true
833
+ });
834
+ }
835
+ getEdgeOptions(options) {
836
+ const { projectId } = this.options;
837
+ const { skipDataResolution, ...params } = options;
838
+ return {
839
+ projectId,
840
+ ...params,
841
+ diagnostics: (options == null ? void 0 : options.diagnostics) ? "true" : void 0
842
+ };
843
+ }
844
+ };
845
+ _contentTypesUrl = new WeakMap();
846
+ _entriesUrl = new WeakMap();
847
+ __privateAdd(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
848
+ __privateAdd(_ContentClient, _entriesUrl, "/api/v1/entries");
849
+ var ContentClient = _ContentClient;
850
+ var UncachedContentClient = class extends ContentClient {
851
+ constructor(options) {
852
+ super({ ...options, bypassCache: true });
853
+ }
854
+ };
855
+
856
+ // src/DataSourceClient.ts
857
+ var import_api6 = require("@uniformdev/context/api");
780
858
  var dataSourceUrl = "/api/v1/data-source";
781
859
  var dataSourcesUrl = "/api/v1/data-sources";
782
- var DataSourceClient = class extends import_api5.ApiClient {
860
+ var DataSourceClient = class extends import_api6.ApiClient {
783
861
  constructor(options) {
784
862
  super(options);
785
863
  }
@@ -816,9 +894,9 @@ var DataSourceClient = class extends import_api5.ApiClient {
816
894
  };
817
895
 
818
896
  // src/DataTypeClient.ts
819
- var import_api6 = require("@uniformdev/context/api");
897
+ var import_api7 = require("@uniformdev/context/api");
820
898
  var _url;
821
- var _DataTypeClient = class _DataTypeClient extends import_api6.ApiClient {
899
+ var _DataTypeClient = class _DataTypeClient extends import_api7.ApiClient {
822
900
  constructor(options) {
823
901
  super(options);
824
902
  }
@@ -1341,10 +1419,13 @@ var CANVAS_TEST_SLOT = "test";
1341
1419
  var CANVAS_LOCALIZATION_SLOT = "localized";
1342
1420
  var CANVAS_DRAFT_STATE = 0;
1343
1421
  var CANVAS_PUBLISHED_STATE = 64;
1422
+ var CANVAS_EDITOR_STATE = 63;
1344
1423
  var CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
1345
1424
  var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
1346
1425
  var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
1347
1426
  var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
1427
+ var IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM = "is_incontext_editing_playground";
1428
+ var IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM = "is_config_check";
1348
1429
  var IN_CONTEXT_EDITOR_COMPONENT_START_ROLE = "uniform-component-start";
1349
1430
  var IN_CONTEXT_EDITOR_COMPONENT_END_ROLE = "uniform-component-end";
1350
1431
  var IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID = "uniform-canvas-preview-script";
@@ -1611,6 +1692,12 @@ var createCanvasChannel = ({
1611
1692
  };
1612
1693
  postMessage(message);
1613
1694
  };
1695
+ const editorStateUpdated = () => {
1696
+ const message = {
1697
+ type: "editor-state-updated"
1698
+ };
1699
+ postMessage(message);
1700
+ };
1614
1701
  const messageEventListener = (event) => {
1615
1702
  if (typeof event.data !== "string") {
1616
1703
  return;
@@ -1652,7 +1739,8 @@ var createCanvasChannel = ({
1652
1739
  updatePreviewSettings,
1653
1740
  updateContextualEditingStateInternal,
1654
1741
  selectParameter,
1655
- reportRenderedCompositions
1742
+ reportRenderedCompositions,
1743
+ editorStateUpdated
1656
1744
  };
1657
1745
  };
1658
1746
 
@@ -1735,9 +1823,9 @@ function subscribeToComposition({
1735
1823
  }
1736
1824
 
1737
1825
  // src/RouteClient.ts
1738
- var import_api7 = require("@uniformdev/context/api");
1826
+ var import_api8 = require("@uniformdev/context/api");
1739
1827
  var ROUTE_URL = "/api/v1/route";
1740
- var RouteClient = class extends import_api7.ApiClient {
1828
+ var RouteClient = class extends import_api8.ApiClient {
1741
1829
  constructor(options) {
1742
1830
  var _a;
1743
1831
  if (!options.limitPolicy) {
@@ -2018,8 +2106,8 @@ function handleRichTextNodeBinding(object, options) {
2018
2106
  }
2019
2107
 
2020
2108
  // src/index.ts
2021
- var import_api8 = require("@uniformdev/context/api");
2022
- var CanvasClientError = import_api8.ApiClientError;
2109
+ var import_api9 = require("@uniformdev/context/api");
2110
+ var CanvasClientError = import_api9.ApiClientError;
2023
2111
  // Annotate the CommonJS export names for ESM import in node:
2024
2112
  0 && (module.exports = {
2025
2113
  ATTRIBUTE_COMPONENT_ID,
@@ -2031,6 +2119,7 @@ var CanvasClientError = import_api8.ApiClientError;
2031
2119
  ApiClientError,
2032
2120
  BatchEntry,
2033
2121
  CANVAS_DRAFT_STATE,
2122
+ CANVAS_EDITOR_STATE,
2034
2123
  CANVAS_ENRICHMENT_TAG_PARAM,
2035
2124
  CANVAS_INTENT_TAG_PARAM,
2036
2125
  CANVAS_LOCALE_TAG_PARAM,
@@ -2047,6 +2136,7 @@ var CanvasClientError = import_api8.ApiClientError;
2047
2136
  CanvasClientError,
2048
2137
  CategoryClient,
2049
2138
  ChildEnhancerBuilder,
2139
+ ContentClient,
2050
2140
  DataSourceClient,
2051
2141
  DataTypeClient,
2052
2142
  EDGE_CACHE_DISABLED,
@@ -2060,13 +2150,16 @@ var CanvasClientError = import_api8.ApiClientError;
2060
2150
  EnhancerBuilder,
2061
2151
  IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
2062
2152
  IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
2153
+ IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM,
2063
2154
  IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
2155
+ IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
2064
2156
  IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
2065
2157
  IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
2066
2158
  PLACEHOLDER_ID,
2067
2159
  RouteClient,
2068
2160
  UncachedCanvasClient,
2069
2161
  UncachedCategoryClient,
2162
+ UncachedContentClient,
2070
2163
  UniqueBatchEntries,
2071
2164
  bindVariables,
2072
2165
  bindVariablesToObject,
package/dist/index.mjs CHANGED
@@ -679,11 +679,84 @@ var unstable_CompositionRelationshipClient = class extends ApiClient3 {
679
679
  }
680
680
  };
681
681
 
682
- // src/DataSourceClient.ts
682
+ // src/ContentClient.ts
683
683
  import { ApiClient as ApiClient4 } from "@uniformdev/context/api";
684
+ var _contentTypesUrl, _entriesUrl;
685
+ var _ContentClient = class _ContentClient extends ApiClient4 {
686
+ constructor(options) {
687
+ var _a;
688
+ super(options);
689
+ this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
690
+ }
691
+ getContentTypes(options) {
692
+ const { projectId } = this.options;
693
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl), { ...options, projectId });
694
+ return this.apiClient(fetchUri);
695
+ }
696
+ getEntries(options) {
697
+ const { projectId } = this.options;
698
+ const { skipDataResolution, ...params } = options;
699
+ const fetchUri = skipDataResolution ? this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId }) : this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
700
+ return this.apiClient(fetchUri);
701
+ }
702
+ async upsertContentType(body) {
703
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
704
+ await this.apiClient(fetchUri, {
705
+ method: "PUT",
706
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
707
+ expectNoContent: true
708
+ });
709
+ }
710
+ async upsertEntry(body) {
711
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
712
+ await this.apiClient(fetchUri, {
713
+ method: "PUT",
714
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
715
+ expectNoContent: true
716
+ });
717
+ }
718
+ async deleteContentType(body) {
719
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
720
+ await this.apiClient(fetchUri, {
721
+ method: "DELETE",
722
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
723
+ expectNoContent: true
724
+ });
725
+ }
726
+ async deleteEntry(body) {
727
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
728
+ await this.apiClient(fetchUri, {
729
+ method: "DELETE",
730
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
731
+ expectNoContent: true
732
+ });
733
+ }
734
+ getEdgeOptions(options) {
735
+ const { projectId } = this.options;
736
+ const { skipDataResolution, ...params } = options;
737
+ return {
738
+ projectId,
739
+ ...params,
740
+ diagnostics: (options == null ? void 0 : options.diagnostics) ? "true" : void 0
741
+ };
742
+ }
743
+ };
744
+ _contentTypesUrl = new WeakMap();
745
+ _entriesUrl = new WeakMap();
746
+ __privateAdd(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
747
+ __privateAdd(_ContentClient, _entriesUrl, "/api/v1/entries");
748
+ var ContentClient = _ContentClient;
749
+ var UncachedContentClient = class extends ContentClient {
750
+ constructor(options) {
751
+ super({ ...options, bypassCache: true });
752
+ }
753
+ };
754
+
755
+ // src/DataSourceClient.ts
756
+ import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
684
757
  var dataSourceUrl = "/api/v1/data-source";
685
758
  var dataSourcesUrl = "/api/v1/data-sources";
686
- var DataSourceClient = class extends ApiClient4 {
759
+ var DataSourceClient = class extends ApiClient5 {
687
760
  constructor(options) {
688
761
  super(options);
689
762
  }
@@ -720,9 +793,9 @@ var DataSourceClient = class extends ApiClient4 {
720
793
  };
721
794
 
722
795
  // src/DataTypeClient.ts
723
- import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
796
+ import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
724
797
  var _url;
725
- var _DataTypeClient = class _DataTypeClient extends ApiClient5 {
798
+ var _DataTypeClient = class _DataTypeClient extends ApiClient6 {
726
799
  constructor(options) {
727
800
  super(options);
728
801
  }
@@ -1245,10 +1318,13 @@ var CANVAS_TEST_SLOT = "test";
1245
1318
  var CANVAS_LOCALIZATION_SLOT = "localized";
1246
1319
  var CANVAS_DRAFT_STATE = 0;
1247
1320
  var CANVAS_PUBLISHED_STATE = 64;
1321
+ var CANVAS_EDITOR_STATE = 63;
1248
1322
  var CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
1249
1323
  var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
1250
1324
  var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
1251
1325
  var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
1326
+ var IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM = "is_incontext_editing_playground";
1327
+ var IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM = "is_config_check";
1252
1328
  var IN_CONTEXT_EDITOR_COMPONENT_START_ROLE = "uniform-component-start";
1253
1329
  var IN_CONTEXT_EDITOR_COMPONENT_END_ROLE = "uniform-component-end";
1254
1330
  var IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID = "uniform-canvas-preview-script";
@@ -1515,6 +1591,12 @@ var createCanvasChannel = ({
1515
1591
  };
1516
1592
  postMessage(message);
1517
1593
  };
1594
+ const editorStateUpdated = () => {
1595
+ const message = {
1596
+ type: "editor-state-updated"
1597
+ };
1598
+ postMessage(message);
1599
+ };
1518
1600
  const messageEventListener = (event) => {
1519
1601
  if (typeof event.data !== "string") {
1520
1602
  return;
@@ -1556,7 +1638,8 @@ var createCanvasChannel = ({
1556
1638
  updatePreviewSettings,
1557
1639
  updateContextualEditingStateInternal,
1558
1640
  selectParameter,
1559
- reportRenderedCompositions
1641
+ reportRenderedCompositions,
1642
+ editorStateUpdated
1560
1643
  };
1561
1644
  };
1562
1645
 
@@ -1639,9 +1722,9 @@ function subscribeToComposition({
1639
1722
  }
1640
1723
 
1641
1724
  // src/RouteClient.ts
1642
- import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
1725
+ import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
1643
1726
  var ROUTE_URL = "/api/v1/route";
1644
- var RouteClient = class extends ApiClient6 {
1727
+ var RouteClient = class extends ApiClient7 {
1645
1728
  constructor(options) {
1646
1729
  var _a;
1647
1730
  if (!options.limitPolicy) {
@@ -1934,6 +2017,7 @@ export {
1934
2017
  ApiClientError2 as ApiClientError,
1935
2018
  BatchEntry,
1936
2019
  CANVAS_DRAFT_STATE,
2020
+ CANVAS_EDITOR_STATE,
1937
2021
  CANVAS_ENRICHMENT_TAG_PARAM,
1938
2022
  CANVAS_INTENT_TAG_PARAM,
1939
2023
  CANVAS_LOCALE_TAG_PARAM,
@@ -1950,6 +2034,7 @@ export {
1950
2034
  CanvasClientError,
1951
2035
  CategoryClient,
1952
2036
  ChildEnhancerBuilder,
2037
+ ContentClient,
1953
2038
  DataSourceClient,
1954
2039
  DataTypeClient,
1955
2040
  EDGE_CACHE_DISABLED,
@@ -1963,13 +2048,16 @@ export {
1963
2048
  EnhancerBuilder,
1964
2049
  IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
1965
2050
  IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
2051
+ IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM,
1966
2052
  IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
2053
+ IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
1967
2054
  IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
1968
2055
  IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
1969
2056
  PLACEHOLDER_ID,
1970
2057
  RouteClient,
1971
2058
  UncachedCanvasClient,
1972
2059
  UncachedCategoryClient,
2060
+ UncachedContentClient,
1973
2061
  UniqueBatchEntries,
1974
2062
  bindVariables,
1975
2063
  bindVariablesToObject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.38.3-alpha.70+55e5a8fe1",
3
+ "version": "19.38.3-alpha.78+5c9892bf1",
4
4
  "description": "Common functionality and types for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -32,13 +32,13 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/retry": "0.12.1",
35
- "lexical": "^0.11.3",
35
+ "lexical": "^0.12.0",
36
36
  "p-retry": "5.1.2",
37
37
  "p-throttle": "5.0.0",
38
38
  "pusher-js": "8.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@uniformdev/context": "19.38.3-alpha.70+55e5a8fe1",
41
+ "@uniformdev/context": "19.38.3-alpha.78+5c9892bf1",
42
42
  "immer": "9.0.21"
43
43
  },
44
44
  "files": [
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "55e5a8fe1d80971a93ea31d3a50cec72e71be70a"
50
+ "gitHead": "5c9892bf101584d351d06b65e1658a1237594cfb"
51
51
  }