@uniformdev/canvas 19.1.0 → 19.2.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/dist/index.d.ts +1645 -471
- package/dist/index.esm.js +49 -3
- package/dist/index.js +56 -6
- package/dist/index.mjs +49 -3
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
@@ -481,7 +481,6 @@ var CanvasClient = class extends ApiClient {
|
|
481
481
|
}
|
482
482
|
getOneComposition({
|
483
483
|
skipDataResolution,
|
484
|
-
unstable_dynamicVariables: dynamicVariables,
|
485
484
|
diagnostics,
|
486
485
|
...params
|
487
486
|
}) {
|
@@ -492,7 +491,6 @@ var CanvasClient = class extends ApiClient {
|
|
492
491
|
const edgeParams = {
|
493
492
|
...params,
|
494
493
|
projectId,
|
495
|
-
...dynamicVariables ? { dynamicVariables: JSON.stringify(dynamicVariables) } : {},
|
496
494
|
...diagnostics ? { diagnostics: "true" } : {}
|
497
495
|
};
|
498
496
|
const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
|
@@ -1184,6 +1182,7 @@ var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
1184
1182
|
var IN_CONTEXT_EDITOR_COMPONENT_START_ROLE = "uniform-component-start";
|
1185
1183
|
var IN_CONTEXT_EDITOR_COMPONENT_END_ROLE = "uniform-component-end";
|
1186
1184
|
var IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID = "uniform-canvas-preview-script";
|
1185
|
+
var IS_RENDERED_BY_UNIFORM_ATTRIBUTE = "data-is-rendered-by-uniform";
|
1187
1186
|
var PLACEHOLDER_ID = "placeholder";
|
1188
1187
|
var EMPTY_COMPOSITION = {
|
1189
1188
|
_id: "_empty_composition_id",
|
@@ -1293,12 +1292,18 @@ var isReadyMessage = (message) => {
|
|
1293
1292
|
var isUpdateCompositionMessage = (message) => {
|
1294
1293
|
return message.type === "update-composition";
|
1295
1294
|
};
|
1295
|
+
var isUpdateCompositionInternalMessage = (message) => {
|
1296
|
+
return message.type === "update-composition-internal";
|
1297
|
+
};
|
1296
1298
|
var isAddComponentMessage = (message) => {
|
1297
1299
|
return message.type === "add-component";
|
1298
1300
|
};
|
1299
1301
|
var isMovingComponentMessage = (message) => {
|
1300
1302
|
return message.type === "move-component";
|
1301
1303
|
};
|
1304
|
+
var isUpdateComponentParameterMessage = (message) => {
|
1305
|
+
return message.type === "update-component-parameter";
|
1306
|
+
};
|
1302
1307
|
var isDismissPlaceholderMessage = (message) => {
|
1303
1308
|
return message.type === "dismiss-placeholder";
|
1304
1309
|
};
|
@@ -1360,6 +1365,14 @@ var createCanvasChannel = ({
|
|
1360
1365
|
};
|
1361
1366
|
postMessage(message);
|
1362
1367
|
};
|
1368
|
+
const updateCompositionInternal = (composition, hash) => {
|
1369
|
+
const message = {
|
1370
|
+
type: "update-composition-internal",
|
1371
|
+
composition,
|
1372
|
+
hash
|
1373
|
+
};
|
1374
|
+
postMessage(message);
|
1375
|
+
};
|
1363
1376
|
const addComponent = (options) => {
|
1364
1377
|
const message = {
|
1365
1378
|
...options,
|
@@ -1374,6 +1387,13 @@ var createCanvasChannel = ({
|
|
1374
1387
|
};
|
1375
1388
|
postMessage(message);
|
1376
1389
|
};
|
1390
|
+
const updateComponentParameter = (options) => {
|
1391
|
+
const message = {
|
1392
|
+
...options,
|
1393
|
+
type: "update-component-parameter"
|
1394
|
+
};
|
1395
|
+
postMessage(message);
|
1396
|
+
};
|
1377
1397
|
const dismissPlaceholder = (options) => {
|
1378
1398
|
const message = {
|
1379
1399
|
...options,
|
@@ -1396,7 +1416,7 @@ var createCanvasChannel = ({
|
|
1396
1416
|
postMessage(message);
|
1397
1417
|
};
|
1398
1418
|
const messageEventListener = (event) => {
|
1399
|
-
if (typeof event.data !== "string"
|
1419
|
+
if (typeof event.data !== "string") {
|
1400
1420
|
return;
|
1401
1421
|
}
|
1402
1422
|
let message = null;
|
@@ -1426,9 +1446,11 @@ var createCanvasChannel = ({
|
|
1426
1446
|
destroy,
|
1427
1447
|
selectComponent,
|
1428
1448
|
updateComposition,
|
1449
|
+
updateCompositionInternal,
|
1429
1450
|
on,
|
1430
1451
|
addComponent,
|
1431
1452
|
moveComponent,
|
1453
|
+
updateComponentParameter,
|
1432
1454
|
dismissPlaceholder,
|
1433
1455
|
updatePreviewSettings,
|
1434
1456
|
reportRenderedCompositions
|
@@ -1513,6 +1535,26 @@ function subscribeToComposition({
|
|
1513
1535
|
};
|
1514
1536
|
}
|
1515
1537
|
|
1538
|
+
// src/RouteClient.ts
|
1539
|
+
import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
|
1540
|
+
var ROUTE_URL = "/api/v1/route";
|
1541
|
+
var unstable_RouteClient = class extends ApiClient5 {
|
1542
|
+
constructor(options) {
|
1543
|
+
var _a;
|
1544
|
+
if (!options.limitPolicy) {
|
1545
|
+
options.limitPolicy = createLimitPolicy({});
|
1546
|
+
}
|
1547
|
+
super(options);
|
1548
|
+
this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
|
1549
|
+
}
|
1550
|
+
/** Fetches lists of Canvas compositions, optionally by type */
|
1551
|
+
async getRoute(options) {
|
1552
|
+
const { projectId } = this.options;
|
1553
|
+
const fetchUri = this.createUrl(ROUTE_URL, { ...options, projectId }, this.edgeApiHost);
|
1554
|
+
return await this.apiClient(fetchUri);
|
1555
|
+
}
|
1556
|
+
};
|
1557
|
+
|
1516
1558
|
// src/utils/createApiEnhancer.ts
|
1517
1559
|
var createUniformApiEnhancer = ({ apiUrl }) => {
|
1518
1560
|
return async (message) => {
|
@@ -1609,6 +1651,7 @@ export {
|
|
1609
1651
|
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
1610
1652
|
IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
|
1611
1653
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
1654
|
+
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
1612
1655
|
PLACEHOLDER_ID,
|
1613
1656
|
UncachedCanvasClient,
|
1614
1657
|
UniqueBatchEntries,
|
@@ -1631,6 +1674,8 @@ export {
|
|
1631
1674
|
isReportRenderedCompositionsMessage,
|
1632
1675
|
isSelectComponentMessage,
|
1633
1676
|
isSystemComponentDefinition,
|
1677
|
+
isUpdateComponentParameterMessage,
|
1678
|
+
isUpdateCompositionInternalMessage,
|
1634
1679
|
isUpdateCompositionMessage,
|
1635
1680
|
isUpdatePreviewSettingsMessage,
|
1636
1681
|
localize,
|
@@ -1639,5 +1684,6 @@ export {
|
|
1639
1684
|
nullLimitPolicy,
|
1640
1685
|
subscribeToComposition,
|
1641
1686
|
unstable_CompositionRelationshipClient,
|
1687
|
+
unstable_RouteClient,
|
1642
1688
|
walkComponentTree
|
1643
1689
|
};
|
package/dist/index.js
CHANGED
@@ -274,7 +274,7 @@ var require_retry2 = __commonJS({
|
|
274
274
|
// src/index.ts
|
275
275
|
var src_exports = {};
|
276
276
|
__export(src_exports, {
|
277
|
-
ApiClientError: () =>
|
277
|
+
ApiClientError: () => import_api6.ApiClientError,
|
278
278
|
BatchEntry: () => BatchEntry,
|
279
279
|
CANVAS_DRAFT_STATE: () => CANVAS_DRAFT_STATE,
|
280
280
|
CANVAS_ENRICHMENT_TAG_PARAM: () => CANVAS_ENRICHMENT_TAG_PARAM,
|
@@ -307,6 +307,7 @@ __export(src_exports, {
|
|
307
307
|
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE: () => IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
308
308
|
IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID: () => IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
|
309
309
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM: () => IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
310
|
+
IS_RENDERED_BY_UNIFORM_ATTRIBUTE: () => IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
310
311
|
PLACEHOLDER_ID: () => PLACEHOLDER_ID,
|
311
312
|
UncachedCanvasClient: () => UncachedCanvasClient,
|
312
313
|
UniqueBatchEntries: () => UniqueBatchEntries,
|
@@ -329,6 +330,8 @@ __export(src_exports, {
|
|
329
330
|
isReportRenderedCompositionsMessage: () => isReportRenderedCompositionsMessage,
|
330
331
|
isSelectComponentMessage: () => isSelectComponentMessage,
|
331
332
|
isSystemComponentDefinition: () => isSystemComponentDefinition,
|
333
|
+
isUpdateComponentParameterMessage: () => isUpdateComponentParameterMessage,
|
334
|
+
isUpdateCompositionInternalMessage: () => isUpdateCompositionInternalMessage,
|
332
335
|
isUpdateCompositionMessage: () => isUpdateCompositionMessage,
|
333
336
|
isUpdatePreviewSettingsMessage: () => isUpdatePreviewSettingsMessage,
|
334
337
|
localize: () => localize,
|
@@ -337,6 +340,7 @@ __export(src_exports, {
|
|
337
340
|
nullLimitPolicy: () => nullLimitPolicy,
|
338
341
|
subscribeToComposition: () => subscribeToComposition,
|
339
342
|
unstable_CompositionRelationshipClient: () => unstable_CompositionRelationshipClient,
|
343
|
+
unstable_RouteClient: () => unstable_RouteClient,
|
340
344
|
walkComponentTree: () => walkComponentTree
|
341
345
|
});
|
342
346
|
module.exports = __toCommonJS(src_exports);
|
@@ -557,7 +561,6 @@ var CanvasClient = class extends import_api.ApiClient {
|
|
557
561
|
}
|
558
562
|
getOneComposition({
|
559
563
|
skipDataResolution,
|
560
|
-
unstable_dynamicVariables: dynamicVariables,
|
561
564
|
diagnostics,
|
562
565
|
...params
|
563
566
|
}) {
|
@@ -568,7 +571,6 @@ var CanvasClient = class extends import_api.ApiClient {
|
|
568
571
|
const edgeParams = {
|
569
572
|
...params,
|
570
573
|
projectId,
|
571
|
-
...dynamicVariables ? { dynamicVariables: JSON.stringify(dynamicVariables) } : {},
|
572
574
|
...diagnostics ? { diagnostics: "true" } : {}
|
573
575
|
};
|
574
576
|
const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
|
@@ -1260,6 +1262,7 @@ var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
1260
1262
|
var IN_CONTEXT_EDITOR_COMPONENT_START_ROLE = "uniform-component-start";
|
1261
1263
|
var IN_CONTEXT_EDITOR_COMPONENT_END_ROLE = "uniform-component-end";
|
1262
1264
|
var IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID = "uniform-canvas-preview-script";
|
1265
|
+
var IS_RENDERED_BY_UNIFORM_ATTRIBUTE = "data-is-rendered-by-uniform";
|
1263
1266
|
var PLACEHOLDER_ID = "placeholder";
|
1264
1267
|
var EMPTY_COMPOSITION = {
|
1265
1268
|
_id: "_empty_composition_id",
|
@@ -1369,12 +1372,18 @@ var isReadyMessage = (message) => {
|
|
1369
1372
|
var isUpdateCompositionMessage = (message) => {
|
1370
1373
|
return message.type === "update-composition";
|
1371
1374
|
};
|
1375
|
+
var isUpdateCompositionInternalMessage = (message) => {
|
1376
|
+
return message.type === "update-composition-internal";
|
1377
|
+
};
|
1372
1378
|
var isAddComponentMessage = (message) => {
|
1373
1379
|
return message.type === "add-component";
|
1374
1380
|
};
|
1375
1381
|
var isMovingComponentMessage = (message) => {
|
1376
1382
|
return message.type === "move-component";
|
1377
1383
|
};
|
1384
|
+
var isUpdateComponentParameterMessage = (message) => {
|
1385
|
+
return message.type === "update-component-parameter";
|
1386
|
+
};
|
1378
1387
|
var isDismissPlaceholderMessage = (message) => {
|
1379
1388
|
return message.type === "dismiss-placeholder";
|
1380
1389
|
};
|
@@ -1436,6 +1445,14 @@ var createCanvasChannel = ({
|
|
1436
1445
|
};
|
1437
1446
|
postMessage(message);
|
1438
1447
|
};
|
1448
|
+
const updateCompositionInternal = (composition, hash) => {
|
1449
|
+
const message = {
|
1450
|
+
type: "update-composition-internal",
|
1451
|
+
composition,
|
1452
|
+
hash
|
1453
|
+
};
|
1454
|
+
postMessage(message);
|
1455
|
+
};
|
1439
1456
|
const addComponent = (options) => {
|
1440
1457
|
const message = {
|
1441
1458
|
...options,
|
@@ -1450,6 +1467,13 @@ var createCanvasChannel = ({
|
|
1450
1467
|
};
|
1451
1468
|
postMessage(message);
|
1452
1469
|
};
|
1470
|
+
const updateComponentParameter = (options) => {
|
1471
|
+
const message = {
|
1472
|
+
...options,
|
1473
|
+
type: "update-component-parameter"
|
1474
|
+
};
|
1475
|
+
postMessage(message);
|
1476
|
+
};
|
1453
1477
|
const dismissPlaceholder = (options) => {
|
1454
1478
|
const message = {
|
1455
1479
|
...options,
|
@@ -1472,7 +1496,7 @@ var createCanvasChannel = ({
|
|
1472
1496
|
postMessage(message);
|
1473
1497
|
};
|
1474
1498
|
const messageEventListener = (event) => {
|
1475
|
-
if (typeof event.data !== "string"
|
1499
|
+
if (typeof event.data !== "string") {
|
1476
1500
|
return;
|
1477
1501
|
}
|
1478
1502
|
let message = null;
|
@@ -1502,9 +1526,11 @@ var createCanvasChannel = ({
|
|
1502
1526
|
destroy,
|
1503
1527
|
selectComponent,
|
1504
1528
|
updateComposition,
|
1529
|
+
updateCompositionInternal,
|
1505
1530
|
on,
|
1506
1531
|
addComponent,
|
1507
1532
|
moveComponent,
|
1533
|
+
updateComponentParameter,
|
1508
1534
|
dismissPlaceholder,
|
1509
1535
|
updatePreviewSettings,
|
1510
1536
|
reportRenderedCompositions
|
@@ -1589,6 +1615,26 @@ function subscribeToComposition({
|
|
1589
1615
|
};
|
1590
1616
|
}
|
1591
1617
|
|
1618
|
+
// src/RouteClient.ts
|
1619
|
+
var import_api5 = require("@uniformdev/context/api");
|
1620
|
+
var ROUTE_URL = "/api/v1/route";
|
1621
|
+
var unstable_RouteClient = class extends import_api5.ApiClient {
|
1622
|
+
constructor(options) {
|
1623
|
+
var _a;
|
1624
|
+
if (!options.limitPolicy) {
|
1625
|
+
options.limitPolicy = createLimitPolicy({});
|
1626
|
+
}
|
1627
|
+
super(options);
|
1628
|
+
this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
|
1629
|
+
}
|
1630
|
+
/** Fetches lists of Canvas compositions, optionally by type */
|
1631
|
+
async getRoute(options) {
|
1632
|
+
const { projectId } = this.options;
|
1633
|
+
const fetchUri = this.createUrl(ROUTE_URL, { ...options, projectId }, this.edgeApiHost);
|
1634
|
+
return await this.apiClient(fetchUri);
|
1635
|
+
}
|
1636
|
+
};
|
1637
|
+
|
1592
1638
|
// src/utils/createApiEnhancer.ts
|
1593
1639
|
var createUniformApiEnhancer = ({ apiUrl }) => {
|
1594
1640
|
return async (message) => {
|
@@ -1649,8 +1695,8 @@ function mapSlotToTestVariations(slot) {
|
|
1649
1695
|
}
|
1650
1696
|
|
1651
1697
|
// src/index.ts
|
1652
|
-
var
|
1653
|
-
var CanvasClientError =
|
1698
|
+
var import_api6 = require("@uniformdev/context/api");
|
1699
|
+
var CanvasClientError = import_api6.ApiClientError;
|
1654
1700
|
// Annotate the CommonJS export names for ESM import in node:
|
1655
1701
|
0 && (module.exports = {
|
1656
1702
|
ApiClientError,
|
@@ -1686,6 +1732,7 @@ var CanvasClientError = import_api5.ApiClientError;
|
|
1686
1732
|
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
1687
1733
|
IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
|
1688
1734
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
1735
|
+
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
1689
1736
|
PLACEHOLDER_ID,
|
1690
1737
|
UncachedCanvasClient,
|
1691
1738
|
UniqueBatchEntries,
|
@@ -1708,6 +1755,8 @@ var CanvasClientError = import_api5.ApiClientError;
|
|
1708
1755
|
isReportRenderedCompositionsMessage,
|
1709
1756
|
isSelectComponentMessage,
|
1710
1757
|
isSystemComponentDefinition,
|
1758
|
+
isUpdateComponentParameterMessage,
|
1759
|
+
isUpdateCompositionInternalMessage,
|
1711
1760
|
isUpdateCompositionMessage,
|
1712
1761
|
isUpdatePreviewSettingsMessage,
|
1713
1762
|
localize,
|
@@ -1716,5 +1765,6 @@ var CanvasClientError = import_api5.ApiClientError;
|
|
1716
1765
|
nullLimitPolicy,
|
1717
1766
|
subscribeToComposition,
|
1718
1767
|
unstable_CompositionRelationshipClient,
|
1768
|
+
unstable_RouteClient,
|
1719
1769
|
walkComponentTree
|
1720
1770
|
});
|
package/dist/index.mjs
CHANGED
@@ -481,7 +481,6 @@ var CanvasClient = class extends ApiClient {
|
|
481
481
|
}
|
482
482
|
getOneComposition({
|
483
483
|
skipDataResolution,
|
484
|
-
unstable_dynamicVariables: dynamicVariables,
|
485
484
|
diagnostics,
|
486
485
|
...params
|
487
486
|
}) {
|
@@ -492,7 +491,6 @@ var CanvasClient = class extends ApiClient {
|
|
492
491
|
const edgeParams = {
|
493
492
|
...params,
|
494
493
|
projectId,
|
495
|
-
...dynamicVariables ? { dynamicVariables: JSON.stringify(dynamicVariables) } : {},
|
496
494
|
...diagnostics ? { diagnostics: "true" } : {}
|
497
495
|
};
|
498
496
|
const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
|
@@ -1184,6 +1182,7 @@ var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
1184
1182
|
var IN_CONTEXT_EDITOR_COMPONENT_START_ROLE = "uniform-component-start";
|
1185
1183
|
var IN_CONTEXT_EDITOR_COMPONENT_END_ROLE = "uniform-component-end";
|
1186
1184
|
var IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID = "uniform-canvas-preview-script";
|
1185
|
+
var IS_RENDERED_BY_UNIFORM_ATTRIBUTE = "data-is-rendered-by-uniform";
|
1187
1186
|
var PLACEHOLDER_ID = "placeholder";
|
1188
1187
|
var EMPTY_COMPOSITION = {
|
1189
1188
|
_id: "_empty_composition_id",
|
@@ -1293,12 +1292,18 @@ var isReadyMessage = (message) => {
|
|
1293
1292
|
var isUpdateCompositionMessage = (message) => {
|
1294
1293
|
return message.type === "update-composition";
|
1295
1294
|
};
|
1295
|
+
var isUpdateCompositionInternalMessage = (message) => {
|
1296
|
+
return message.type === "update-composition-internal";
|
1297
|
+
};
|
1296
1298
|
var isAddComponentMessage = (message) => {
|
1297
1299
|
return message.type === "add-component";
|
1298
1300
|
};
|
1299
1301
|
var isMovingComponentMessage = (message) => {
|
1300
1302
|
return message.type === "move-component";
|
1301
1303
|
};
|
1304
|
+
var isUpdateComponentParameterMessage = (message) => {
|
1305
|
+
return message.type === "update-component-parameter";
|
1306
|
+
};
|
1302
1307
|
var isDismissPlaceholderMessage = (message) => {
|
1303
1308
|
return message.type === "dismiss-placeholder";
|
1304
1309
|
};
|
@@ -1360,6 +1365,14 @@ var createCanvasChannel = ({
|
|
1360
1365
|
};
|
1361
1366
|
postMessage(message);
|
1362
1367
|
};
|
1368
|
+
const updateCompositionInternal = (composition, hash) => {
|
1369
|
+
const message = {
|
1370
|
+
type: "update-composition-internal",
|
1371
|
+
composition,
|
1372
|
+
hash
|
1373
|
+
};
|
1374
|
+
postMessage(message);
|
1375
|
+
};
|
1363
1376
|
const addComponent = (options) => {
|
1364
1377
|
const message = {
|
1365
1378
|
...options,
|
@@ -1374,6 +1387,13 @@ var createCanvasChannel = ({
|
|
1374
1387
|
};
|
1375
1388
|
postMessage(message);
|
1376
1389
|
};
|
1390
|
+
const updateComponentParameter = (options) => {
|
1391
|
+
const message = {
|
1392
|
+
...options,
|
1393
|
+
type: "update-component-parameter"
|
1394
|
+
};
|
1395
|
+
postMessage(message);
|
1396
|
+
};
|
1377
1397
|
const dismissPlaceholder = (options) => {
|
1378
1398
|
const message = {
|
1379
1399
|
...options,
|
@@ -1396,7 +1416,7 @@ var createCanvasChannel = ({
|
|
1396
1416
|
postMessage(message);
|
1397
1417
|
};
|
1398
1418
|
const messageEventListener = (event) => {
|
1399
|
-
if (typeof event.data !== "string"
|
1419
|
+
if (typeof event.data !== "string") {
|
1400
1420
|
return;
|
1401
1421
|
}
|
1402
1422
|
let message = null;
|
@@ -1426,9 +1446,11 @@ var createCanvasChannel = ({
|
|
1426
1446
|
destroy,
|
1427
1447
|
selectComponent,
|
1428
1448
|
updateComposition,
|
1449
|
+
updateCompositionInternal,
|
1429
1450
|
on,
|
1430
1451
|
addComponent,
|
1431
1452
|
moveComponent,
|
1453
|
+
updateComponentParameter,
|
1432
1454
|
dismissPlaceholder,
|
1433
1455
|
updatePreviewSettings,
|
1434
1456
|
reportRenderedCompositions
|
@@ -1513,6 +1535,26 @@ function subscribeToComposition({
|
|
1513
1535
|
};
|
1514
1536
|
}
|
1515
1537
|
|
1538
|
+
// src/RouteClient.ts
|
1539
|
+
import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
|
1540
|
+
var ROUTE_URL = "/api/v1/route";
|
1541
|
+
var unstable_RouteClient = class extends ApiClient5 {
|
1542
|
+
constructor(options) {
|
1543
|
+
var _a;
|
1544
|
+
if (!options.limitPolicy) {
|
1545
|
+
options.limitPolicy = createLimitPolicy({});
|
1546
|
+
}
|
1547
|
+
super(options);
|
1548
|
+
this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
|
1549
|
+
}
|
1550
|
+
/** Fetches lists of Canvas compositions, optionally by type */
|
1551
|
+
async getRoute(options) {
|
1552
|
+
const { projectId } = this.options;
|
1553
|
+
const fetchUri = this.createUrl(ROUTE_URL, { ...options, projectId }, this.edgeApiHost);
|
1554
|
+
return await this.apiClient(fetchUri);
|
1555
|
+
}
|
1556
|
+
};
|
1557
|
+
|
1516
1558
|
// src/utils/createApiEnhancer.ts
|
1517
1559
|
var createUniformApiEnhancer = ({ apiUrl }) => {
|
1518
1560
|
return async (message) => {
|
@@ -1609,6 +1651,7 @@ export {
|
|
1609
1651
|
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
1610
1652
|
IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
|
1611
1653
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
1654
|
+
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
1612
1655
|
PLACEHOLDER_ID,
|
1613
1656
|
UncachedCanvasClient,
|
1614
1657
|
UniqueBatchEntries,
|
@@ -1631,6 +1674,8 @@ export {
|
|
1631
1674
|
isReportRenderedCompositionsMessage,
|
1632
1675
|
isSelectComponentMessage,
|
1633
1676
|
isSystemComponentDefinition,
|
1677
|
+
isUpdateComponentParameterMessage,
|
1678
|
+
isUpdateCompositionInternalMessage,
|
1634
1679
|
isUpdateCompositionMessage,
|
1635
1680
|
isUpdatePreviewSettingsMessage,
|
1636
1681
|
localize,
|
@@ -1639,5 +1684,6 @@ export {
|
|
1639
1684
|
nullLimitPolicy,
|
1640
1685
|
subscribeToComposition,
|
1641
1686
|
unstable_CompositionRelationshipClient,
|
1687
|
+
unstable_RouteClient,
|
1642
1688
|
walkComponentTree
|
1643
1689
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/canvas",
|
3
|
-
"version": "19.
|
3
|
+
"version": "19.2.0",
|
4
4
|
"description": "Common functionality and types for Uniform Canvas",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
6
6
|
"main": "./dist/index.js",
|
@@ -47,7 +47,7 @@
|
|
47
47
|
"pusher-js": "8.0.1"
|
48
48
|
},
|
49
49
|
"dependencies": {
|
50
|
-
"@uniformdev/context": "19.
|
50
|
+
"@uniformdev/context": "19.2.0"
|
51
51
|
},
|
52
52
|
"files": [
|
53
53
|
"/dist"
|
@@ -55,5 +55,5 @@
|
|
55
55
|
"publishConfig": {
|
56
56
|
"access": "public"
|
57
57
|
},
|
58
|
-
"gitHead": "
|
58
|
+
"gitHead": "9eb2423cd12a5db527f9f3a9d46b47ac2a0e7eb3"
|
59
59
|
}
|