@uniformdev/canvas 19.45.0 → 19.45.2-alpha.6
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 +1873 -127
- package/dist/index.d.ts +1873 -127
- package/dist/index.esm.js +91 -7
- package/dist/index.js +97 -10
- package/dist/index.mjs +91 -7
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
@@ -679,11 +679,84 @@ var unstable_CompositionRelationshipClient = class extends ApiClient3 {
|
|
679
679
|
}
|
680
680
|
};
|
681
681
|
|
682
|
-
// src/
|
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
|
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
|
796
|
+
import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
|
724
797
|
var _url;
|
725
|
-
var _DataTypeClient = class _DataTypeClient extends
|
798
|
+
var _DataTypeClient = class _DataTypeClient extends ApiClient6 {
|
726
799
|
constructor(options) {
|
727
800
|
super(options);
|
728
801
|
}
|
@@ -1245,6 +1318,7 @@ 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";
|
@@ -1515,6 +1589,12 @@ var createCanvasChannel = ({
|
|
1515
1589
|
};
|
1516
1590
|
postMessage(message);
|
1517
1591
|
};
|
1592
|
+
const editorStateUpdated = () => {
|
1593
|
+
const message = {
|
1594
|
+
type: "editor-state-updated"
|
1595
|
+
};
|
1596
|
+
postMessage(message);
|
1597
|
+
};
|
1518
1598
|
const messageEventListener = (event) => {
|
1519
1599
|
if (typeof event.data !== "string") {
|
1520
1600
|
return;
|
@@ -1556,7 +1636,8 @@ var createCanvasChannel = ({
|
|
1556
1636
|
updatePreviewSettings,
|
1557
1637
|
updateContextualEditingStateInternal,
|
1558
1638
|
selectParameter,
|
1559
|
-
reportRenderedCompositions
|
1639
|
+
reportRenderedCompositions,
|
1640
|
+
editorStateUpdated
|
1560
1641
|
};
|
1561
1642
|
};
|
1562
1643
|
|
@@ -1639,9 +1720,9 @@ function subscribeToComposition({
|
|
1639
1720
|
}
|
1640
1721
|
|
1641
1722
|
// src/RouteClient.ts
|
1642
|
-
import { ApiClient as
|
1723
|
+
import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
|
1643
1724
|
var ROUTE_URL = "/api/v1/route";
|
1644
|
-
var RouteClient = class extends
|
1725
|
+
var RouteClient = class extends ApiClient7 {
|
1645
1726
|
constructor(options) {
|
1646
1727
|
var _a;
|
1647
1728
|
if (!options.limitPolicy) {
|
@@ -1934,6 +2015,7 @@ export {
|
|
1934
2015
|
ApiClientError2 as ApiClientError,
|
1935
2016
|
BatchEntry,
|
1936
2017
|
CANVAS_DRAFT_STATE,
|
2018
|
+
CANVAS_EDITOR_STATE,
|
1937
2019
|
CANVAS_ENRICHMENT_TAG_PARAM,
|
1938
2020
|
CANVAS_INTENT_TAG_PARAM,
|
1939
2021
|
CANVAS_LOCALE_TAG_PARAM,
|
@@ -1950,6 +2032,7 @@ export {
|
|
1950
2032
|
CanvasClientError,
|
1951
2033
|
CategoryClient,
|
1952
2034
|
ChildEnhancerBuilder,
|
2035
|
+
ContentClient,
|
1953
2036
|
DataSourceClient,
|
1954
2037
|
DataTypeClient,
|
1955
2038
|
EDGE_CACHE_DISABLED,
|
@@ -1970,6 +2053,7 @@ export {
|
|
1970
2053
|
RouteClient,
|
1971
2054
|
UncachedCanvasClient,
|
1972
2055
|
UncachedCategoryClient,
|
2056
|
+
UncachedContentClient,
|
1973
2057
|
UniqueBatchEntries,
|
1974
2058
|
bindVariables,
|
1975
2059
|
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: () =>
|
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,
|
@@ -322,6 +324,7 @@ __export(src_exports, {
|
|
322
324
|
RouteClient: () => RouteClient,
|
323
325
|
UncachedCanvasClient: () => UncachedCanvasClient,
|
324
326
|
UncachedCategoryClient: () => UncachedCategoryClient,
|
327
|
+
UncachedContentClient: () => UncachedContentClient,
|
325
328
|
UniqueBatchEntries: () => UniqueBatchEntries,
|
326
329
|
bindVariables: () => bindVariables,
|
327
330
|
bindVariablesToObject: () => bindVariablesToObject,
|
@@ -775,11 +778,84 @@ var unstable_CompositionRelationshipClient = class extends import_api4.ApiClient
|
|
775
778
|
}
|
776
779
|
};
|
777
780
|
|
778
|
-
// src/
|
781
|
+
// src/ContentClient.ts
|
779
782
|
var import_api5 = require("@uniformdev/context/api");
|
783
|
+
var _contentTypesUrl, _entriesUrl;
|
784
|
+
var _ContentClient = class _ContentClient extends import_api5.ApiClient {
|
785
|
+
constructor(options) {
|
786
|
+
var _a;
|
787
|
+
super(options);
|
788
|
+
this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
|
789
|
+
}
|
790
|
+
getContentTypes(options) {
|
791
|
+
const { projectId } = this.options;
|
792
|
+
const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl), { ...options, projectId });
|
793
|
+
return this.apiClient(fetchUri);
|
794
|
+
}
|
795
|
+
getEntries(options) {
|
796
|
+
const { projectId } = this.options;
|
797
|
+
const { skipDataResolution, ...params } = options;
|
798
|
+
const fetchUri = skipDataResolution ? this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId }) : this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
|
799
|
+
return this.apiClient(fetchUri);
|
800
|
+
}
|
801
|
+
async upsertContentType(body) {
|
802
|
+
const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
|
803
|
+
await this.apiClient(fetchUri, {
|
804
|
+
method: "PUT",
|
805
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
806
|
+
expectNoContent: true
|
807
|
+
});
|
808
|
+
}
|
809
|
+
async upsertEntry(body) {
|
810
|
+
const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
|
811
|
+
await this.apiClient(fetchUri, {
|
812
|
+
method: "PUT",
|
813
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
814
|
+
expectNoContent: true
|
815
|
+
});
|
816
|
+
}
|
817
|
+
async deleteContentType(body) {
|
818
|
+
const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
|
819
|
+
await this.apiClient(fetchUri, {
|
820
|
+
method: "DELETE",
|
821
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
822
|
+
expectNoContent: true
|
823
|
+
});
|
824
|
+
}
|
825
|
+
async deleteEntry(body) {
|
826
|
+
const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
|
827
|
+
await this.apiClient(fetchUri, {
|
828
|
+
method: "DELETE",
|
829
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
830
|
+
expectNoContent: true
|
831
|
+
});
|
832
|
+
}
|
833
|
+
getEdgeOptions(options) {
|
834
|
+
const { projectId } = this.options;
|
835
|
+
const { skipDataResolution, ...params } = options;
|
836
|
+
return {
|
837
|
+
projectId,
|
838
|
+
...params,
|
839
|
+
diagnostics: (options == null ? void 0 : options.diagnostics) ? "true" : void 0
|
840
|
+
};
|
841
|
+
}
|
842
|
+
};
|
843
|
+
_contentTypesUrl = new WeakMap();
|
844
|
+
_entriesUrl = new WeakMap();
|
845
|
+
__privateAdd(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
|
846
|
+
__privateAdd(_ContentClient, _entriesUrl, "/api/v1/entries");
|
847
|
+
var ContentClient = _ContentClient;
|
848
|
+
var UncachedContentClient = class extends ContentClient {
|
849
|
+
constructor(options) {
|
850
|
+
super({ ...options, bypassCache: true });
|
851
|
+
}
|
852
|
+
};
|
853
|
+
|
854
|
+
// src/DataSourceClient.ts
|
855
|
+
var import_api6 = require("@uniformdev/context/api");
|
780
856
|
var dataSourceUrl = "/api/v1/data-source";
|
781
857
|
var dataSourcesUrl = "/api/v1/data-sources";
|
782
|
-
var DataSourceClient = class extends
|
858
|
+
var DataSourceClient = class extends import_api6.ApiClient {
|
783
859
|
constructor(options) {
|
784
860
|
super(options);
|
785
861
|
}
|
@@ -816,9 +892,9 @@ var DataSourceClient = class extends import_api5.ApiClient {
|
|
816
892
|
};
|
817
893
|
|
818
894
|
// src/DataTypeClient.ts
|
819
|
-
var
|
895
|
+
var import_api7 = require("@uniformdev/context/api");
|
820
896
|
var _url;
|
821
|
-
var _DataTypeClient = class _DataTypeClient extends
|
897
|
+
var _DataTypeClient = class _DataTypeClient extends import_api7.ApiClient {
|
822
898
|
constructor(options) {
|
823
899
|
super(options);
|
824
900
|
}
|
@@ -1341,6 +1417,7 @@ var CANVAS_TEST_SLOT = "test";
|
|
1341
1417
|
var CANVAS_LOCALIZATION_SLOT = "localized";
|
1342
1418
|
var CANVAS_DRAFT_STATE = 0;
|
1343
1419
|
var CANVAS_PUBLISHED_STATE = 64;
|
1420
|
+
var CANVAS_EDITOR_STATE = 63;
|
1344
1421
|
var CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
|
1345
1422
|
var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
|
1346
1423
|
var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
|
@@ -1611,6 +1688,12 @@ var createCanvasChannel = ({
|
|
1611
1688
|
};
|
1612
1689
|
postMessage(message);
|
1613
1690
|
};
|
1691
|
+
const editorStateUpdated = () => {
|
1692
|
+
const message = {
|
1693
|
+
type: "editor-state-updated"
|
1694
|
+
};
|
1695
|
+
postMessage(message);
|
1696
|
+
};
|
1614
1697
|
const messageEventListener = (event) => {
|
1615
1698
|
if (typeof event.data !== "string") {
|
1616
1699
|
return;
|
@@ -1652,7 +1735,8 @@ var createCanvasChannel = ({
|
|
1652
1735
|
updatePreviewSettings,
|
1653
1736
|
updateContextualEditingStateInternal,
|
1654
1737
|
selectParameter,
|
1655
|
-
reportRenderedCompositions
|
1738
|
+
reportRenderedCompositions,
|
1739
|
+
editorStateUpdated
|
1656
1740
|
};
|
1657
1741
|
};
|
1658
1742
|
|
@@ -1735,9 +1819,9 @@ function subscribeToComposition({
|
|
1735
1819
|
}
|
1736
1820
|
|
1737
1821
|
// src/RouteClient.ts
|
1738
|
-
var
|
1822
|
+
var import_api8 = require("@uniformdev/context/api");
|
1739
1823
|
var ROUTE_URL = "/api/v1/route";
|
1740
|
-
var RouteClient = class extends
|
1824
|
+
var RouteClient = class extends import_api8.ApiClient {
|
1741
1825
|
constructor(options) {
|
1742
1826
|
var _a;
|
1743
1827
|
if (!options.limitPolicy) {
|
@@ -2018,8 +2102,8 @@ function handleRichTextNodeBinding(object, options) {
|
|
2018
2102
|
}
|
2019
2103
|
|
2020
2104
|
// src/index.ts
|
2021
|
-
var
|
2022
|
-
var CanvasClientError =
|
2105
|
+
var import_api9 = require("@uniformdev/context/api");
|
2106
|
+
var CanvasClientError = import_api9.ApiClientError;
|
2023
2107
|
// Annotate the CommonJS export names for ESM import in node:
|
2024
2108
|
0 && (module.exports = {
|
2025
2109
|
ATTRIBUTE_COMPONENT_ID,
|
@@ -2031,6 +2115,7 @@ var CanvasClientError = import_api8.ApiClientError;
|
|
2031
2115
|
ApiClientError,
|
2032
2116
|
BatchEntry,
|
2033
2117
|
CANVAS_DRAFT_STATE,
|
2118
|
+
CANVAS_EDITOR_STATE,
|
2034
2119
|
CANVAS_ENRICHMENT_TAG_PARAM,
|
2035
2120
|
CANVAS_INTENT_TAG_PARAM,
|
2036
2121
|
CANVAS_LOCALE_TAG_PARAM,
|
@@ -2047,6 +2132,7 @@ var CanvasClientError = import_api8.ApiClientError;
|
|
2047
2132
|
CanvasClientError,
|
2048
2133
|
CategoryClient,
|
2049
2134
|
ChildEnhancerBuilder,
|
2135
|
+
ContentClient,
|
2050
2136
|
DataSourceClient,
|
2051
2137
|
DataTypeClient,
|
2052
2138
|
EDGE_CACHE_DISABLED,
|
@@ -2067,6 +2153,7 @@ var CanvasClientError = import_api8.ApiClientError;
|
|
2067
2153
|
RouteClient,
|
2068
2154
|
UncachedCanvasClient,
|
2069
2155
|
UncachedCategoryClient,
|
2156
|
+
UncachedContentClient,
|
2070
2157
|
UniqueBatchEntries,
|
2071
2158
|
bindVariables,
|
2072
2159
|
bindVariablesToObject,
|
package/dist/index.mjs
CHANGED
@@ -679,11 +679,84 @@ var unstable_CompositionRelationshipClient = class extends ApiClient3 {
|
|
679
679
|
}
|
680
680
|
};
|
681
681
|
|
682
|
-
// src/
|
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
|
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
|
796
|
+
import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
|
724
797
|
var _url;
|
725
|
-
var _DataTypeClient = class _DataTypeClient extends
|
798
|
+
var _DataTypeClient = class _DataTypeClient extends ApiClient6 {
|
726
799
|
constructor(options) {
|
727
800
|
super(options);
|
728
801
|
}
|
@@ -1245,6 +1318,7 @@ 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";
|
@@ -1515,6 +1589,12 @@ var createCanvasChannel = ({
|
|
1515
1589
|
};
|
1516
1590
|
postMessage(message);
|
1517
1591
|
};
|
1592
|
+
const editorStateUpdated = () => {
|
1593
|
+
const message = {
|
1594
|
+
type: "editor-state-updated"
|
1595
|
+
};
|
1596
|
+
postMessage(message);
|
1597
|
+
};
|
1518
1598
|
const messageEventListener = (event) => {
|
1519
1599
|
if (typeof event.data !== "string") {
|
1520
1600
|
return;
|
@@ -1556,7 +1636,8 @@ var createCanvasChannel = ({
|
|
1556
1636
|
updatePreviewSettings,
|
1557
1637
|
updateContextualEditingStateInternal,
|
1558
1638
|
selectParameter,
|
1559
|
-
reportRenderedCompositions
|
1639
|
+
reportRenderedCompositions,
|
1640
|
+
editorStateUpdated
|
1560
1641
|
};
|
1561
1642
|
};
|
1562
1643
|
|
@@ -1639,9 +1720,9 @@ function subscribeToComposition({
|
|
1639
1720
|
}
|
1640
1721
|
|
1641
1722
|
// src/RouteClient.ts
|
1642
|
-
import { ApiClient as
|
1723
|
+
import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
|
1643
1724
|
var ROUTE_URL = "/api/v1/route";
|
1644
|
-
var RouteClient = class extends
|
1725
|
+
var RouteClient = class extends ApiClient7 {
|
1645
1726
|
constructor(options) {
|
1646
1727
|
var _a;
|
1647
1728
|
if (!options.limitPolicy) {
|
@@ -1934,6 +2015,7 @@ export {
|
|
1934
2015
|
ApiClientError2 as ApiClientError,
|
1935
2016
|
BatchEntry,
|
1936
2017
|
CANVAS_DRAFT_STATE,
|
2018
|
+
CANVAS_EDITOR_STATE,
|
1937
2019
|
CANVAS_ENRICHMENT_TAG_PARAM,
|
1938
2020
|
CANVAS_INTENT_TAG_PARAM,
|
1939
2021
|
CANVAS_LOCALE_TAG_PARAM,
|
@@ -1950,6 +2032,7 @@ export {
|
|
1950
2032
|
CanvasClientError,
|
1951
2033
|
CategoryClient,
|
1952
2034
|
ChildEnhancerBuilder,
|
2035
|
+
ContentClient,
|
1953
2036
|
DataSourceClient,
|
1954
2037
|
DataTypeClient,
|
1955
2038
|
EDGE_CACHE_DISABLED,
|
@@ -1970,6 +2053,7 @@ export {
|
|
1970
2053
|
RouteClient,
|
1971
2054
|
UncachedCanvasClient,
|
1972
2055
|
UncachedCategoryClient,
|
2056
|
+
UncachedContentClient,
|
1973
2057
|
UniqueBatchEntries,
|
1974
2058
|
bindVariables,
|
1975
2059
|
bindVariablesToObject,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/canvas",
|
3
|
-
"version": "19.45.
|
3
|
+
"version": "19.45.2-alpha.6+ea4628ae5",
|
4
4
|
"description": "Common functionality and types for Uniform Canvas",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
6
6
|
"main": "./dist/index.js",
|
@@ -38,7 +38,7 @@
|
|
38
38
|
"pusher-js": "8.2.0"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"@uniformdev/context": "19.45.
|
41
|
+
"@uniformdev/context": "19.45.2-alpha.6+ea4628ae5",
|
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": "
|
50
|
+
"gitHead": "ea4628ae5765af32b174d3dac546fed03170c9aa"
|
51
51
|
}
|