@uniformdev/canvas 18.35.1-alpha.12 → 18.35.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.ts +379 -320
- package/dist/index.esm.js +39 -4
- package/dist/index.js +42 -4
- package/dist/index.mjs +39 -4
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
@@ -470,9 +470,17 @@ var CanvasClient = class extends ApiClient {
|
|
470
470
|
getCompositionByNodePath(options) {
|
471
471
|
return this.getOneComposition(options);
|
472
472
|
}
|
473
|
+
/** @deprecated use getCompositionByNodePath instead */
|
474
|
+
unstable_getCompositionByNodePath(options) {
|
475
|
+
return this.getOneComposition(options);
|
476
|
+
}
|
473
477
|
getCompositionByNodeId(options) {
|
474
478
|
return this.getOneComposition(options);
|
475
479
|
}
|
480
|
+
/** @deprecated Use getCompositionByNodeId instead */
|
481
|
+
unstable_getCompositionByNodeId(options) {
|
482
|
+
return this.getOneComposition(options);
|
483
|
+
}
|
476
484
|
getCompositionBySlug(options) {
|
477
485
|
return this.getOneComposition(options);
|
478
486
|
}
|
@@ -480,13 +488,13 @@ var CanvasClient = class extends ApiClient {
|
|
480
488
|
return this.getOneComposition(options);
|
481
489
|
}
|
482
490
|
getOneComposition({
|
483
|
-
|
491
|
+
unstable_resolveData: resolveData,
|
484
492
|
unstable_dynamicVariables: dynamicVariables,
|
485
|
-
diagnostics,
|
493
|
+
unstable_diagnostics: diagnostics,
|
486
494
|
...params
|
487
495
|
}) {
|
488
496
|
const { projectId } = this.options;
|
489
|
-
if (
|
497
|
+
if (!resolveData) {
|
490
498
|
return this.apiClient(this.createUrl(CANVAS_URL, { ...params, projectId }));
|
491
499
|
}
|
492
500
|
const edgeParams = {
|
@@ -1121,6 +1129,7 @@ var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
1121
1129
|
var IN_CONTEXT_EDITOR_COMPONENT_START_ROLE = "uniform-component-start";
|
1122
1130
|
var IN_CONTEXT_EDITOR_COMPONENT_END_ROLE = "uniform-component-end";
|
1123
1131
|
var IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID = "uniform-canvas-preview-script";
|
1132
|
+
var IS_RENDERED_BY_UNIFORM_ATTRIBUTE = "data-is-rendered-by-uniform";
|
1124
1133
|
var PLACEHOLDER_ID = "placeholder";
|
1125
1134
|
var EMPTY_COMPOSITION = {
|
1126
1135
|
_id: "_empty_composition_id",
|
@@ -1230,12 +1239,18 @@ var isReadyMessage = (message) => {
|
|
1230
1239
|
var isUpdateCompositionMessage = (message) => {
|
1231
1240
|
return message.type === "update-composition";
|
1232
1241
|
};
|
1242
|
+
var isUpdateCompositionInternalMessage = (message) => {
|
1243
|
+
return message.type === "update-composition-internal";
|
1244
|
+
};
|
1233
1245
|
var isAddComponentMessage = (message) => {
|
1234
1246
|
return message.type === "add-component";
|
1235
1247
|
};
|
1236
1248
|
var isMovingComponentMessage = (message) => {
|
1237
1249
|
return message.type === "move-component";
|
1238
1250
|
};
|
1251
|
+
var isUpdateComponentParameterMessage = (message) => {
|
1252
|
+
return message.type === "update-component-parameter";
|
1253
|
+
};
|
1239
1254
|
var isDismissPlaceholderMessage = (message) => {
|
1240
1255
|
return message.type === "dismiss-placeholder";
|
1241
1256
|
};
|
@@ -1297,6 +1312,14 @@ var createCanvasChannel = ({
|
|
1297
1312
|
};
|
1298
1313
|
postMessage(message);
|
1299
1314
|
};
|
1315
|
+
const updateCompositionInternal = (composition, hash) => {
|
1316
|
+
const message = {
|
1317
|
+
type: "update-composition-internal",
|
1318
|
+
composition,
|
1319
|
+
hash
|
1320
|
+
};
|
1321
|
+
postMessage(message);
|
1322
|
+
};
|
1300
1323
|
const addComponent = (options) => {
|
1301
1324
|
const message = {
|
1302
1325
|
...options,
|
@@ -1311,6 +1334,13 @@ var createCanvasChannel = ({
|
|
1311
1334
|
};
|
1312
1335
|
postMessage(message);
|
1313
1336
|
};
|
1337
|
+
const updateComponentParameter = (options) => {
|
1338
|
+
const message = {
|
1339
|
+
...options,
|
1340
|
+
type: "update-component-parameter"
|
1341
|
+
};
|
1342
|
+
postMessage(message);
|
1343
|
+
};
|
1314
1344
|
const dismissPlaceholder = (options) => {
|
1315
1345
|
const message = {
|
1316
1346
|
...options,
|
@@ -1333,7 +1363,7 @@ var createCanvasChannel = ({
|
|
1333
1363
|
postMessage(message);
|
1334
1364
|
};
|
1335
1365
|
const messageEventListener = (event) => {
|
1336
|
-
if (typeof event.data !== "string"
|
1366
|
+
if (typeof event.data !== "string") {
|
1337
1367
|
return;
|
1338
1368
|
}
|
1339
1369
|
let message = null;
|
@@ -1363,9 +1393,11 @@ var createCanvasChannel = ({
|
|
1363
1393
|
destroy,
|
1364
1394
|
selectComponent,
|
1365
1395
|
updateComposition,
|
1396
|
+
updateCompositionInternal,
|
1366
1397
|
on,
|
1367
1398
|
addComponent,
|
1368
1399
|
moveComponent,
|
1400
|
+
updateComponentParameter,
|
1369
1401
|
dismissPlaceholder,
|
1370
1402
|
updatePreviewSettings,
|
1371
1403
|
reportRenderedCompositions
|
@@ -1546,6 +1578,7 @@ export {
|
|
1546
1578
|
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
1547
1579
|
IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
|
1548
1580
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
1581
|
+
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
1549
1582
|
PLACEHOLDER_ID,
|
1550
1583
|
UncachedCanvasClient,
|
1551
1584
|
UniqueBatchEntries,
|
@@ -1568,6 +1601,8 @@ export {
|
|
1568
1601
|
isReportRenderedCompositionsMessage,
|
1569
1602
|
isSelectComponentMessage,
|
1570
1603
|
isSystemComponentDefinition,
|
1604
|
+
isUpdateComponentParameterMessage,
|
1605
|
+
isUpdateCompositionInternalMessage,
|
1571
1606
|
isUpdateCompositionMessage,
|
1572
1607
|
isUpdatePreviewSettingsMessage,
|
1573
1608
|
localize,
|
package/dist/index.js
CHANGED
@@ -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,
|
@@ -545,9 +548,17 @@ var CanvasClient = class extends import_api.ApiClient {
|
|
545
548
|
getCompositionByNodePath(options) {
|
546
549
|
return this.getOneComposition(options);
|
547
550
|
}
|
551
|
+
/** @deprecated use getCompositionByNodePath instead */
|
552
|
+
unstable_getCompositionByNodePath(options) {
|
553
|
+
return this.getOneComposition(options);
|
554
|
+
}
|
548
555
|
getCompositionByNodeId(options) {
|
549
556
|
return this.getOneComposition(options);
|
550
557
|
}
|
558
|
+
/** @deprecated Use getCompositionByNodeId instead */
|
559
|
+
unstable_getCompositionByNodeId(options) {
|
560
|
+
return this.getOneComposition(options);
|
561
|
+
}
|
551
562
|
getCompositionBySlug(options) {
|
552
563
|
return this.getOneComposition(options);
|
553
564
|
}
|
@@ -555,13 +566,13 @@ var CanvasClient = class extends import_api.ApiClient {
|
|
555
566
|
return this.getOneComposition(options);
|
556
567
|
}
|
557
568
|
getOneComposition({
|
558
|
-
|
569
|
+
unstable_resolveData: resolveData,
|
559
570
|
unstable_dynamicVariables: dynamicVariables,
|
560
|
-
diagnostics,
|
571
|
+
unstable_diagnostics: diagnostics,
|
561
572
|
...params
|
562
573
|
}) {
|
563
574
|
const { projectId } = this.options;
|
564
|
-
if (
|
575
|
+
if (!resolveData) {
|
565
576
|
return this.apiClient(this.createUrl(CANVAS_URL, { ...params, projectId }));
|
566
577
|
}
|
567
578
|
const edgeParams = {
|
@@ -1196,6 +1207,7 @@ var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
1196
1207
|
var IN_CONTEXT_EDITOR_COMPONENT_START_ROLE = "uniform-component-start";
|
1197
1208
|
var IN_CONTEXT_EDITOR_COMPONENT_END_ROLE = "uniform-component-end";
|
1198
1209
|
var IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID = "uniform-canvas-preview-script";
|
1210
|
+
var IS_RENDERED_BY_UNIFORM_ATTRIBUTE = "data-is-rendered-by-uniform";
|
1199
1211
|
var PLACEHOLDER_ID = "placeholder";
|
1200
1212
|
var EMPTY_COMPOSITION = {
|
1201
1213
|
_id: "_empty_composition_id",
|
@@ -1305,12 +1317,18 @@ var isReadyMessage = (message) => {
|
|
1305
1317
|
var isUpdateCompositionMessage = (message) => {
|
1306
1318
|
return message.type === "update-composition";
|
1307
1319
|
};
|
1320
|
+
var isUpdateCompositionInternalMessage = (message) => {
|
1321
|
+
return message.type === "update-composition-internal";
|
1322
|
+
};
|
1308
1323
|
var isAddComponentMessage = (message) => {
|
1309
1324
|
return message.type === "add-component";
|
1310
1325
|
};
|
1311
1326
|
var isMovingComponentMessage = (message) => {
|
1312
1327
|
return message.type === "move-component";
|
1313
1328
|
};
|
1329
|
+
var isUpdateComponentParameterMessage = (message) => {
|
1330
|
+
return message.type === "update-component-parameter";
|
1331
|
+
};
|
1314
1332
|
var isDismissPlaceholderMessage = (message) => {
|
1315
1333
|
return message.type === "dismiss-placeholder";
|
1316
1334
|
};
|
@@ -1372,6 +1390,14 @@ var createCanvasChannel = ({
|
|
1372
1390
|
};
|
1373
1391
|
postMessage(message);
|
1374
1392
|
};
|
1393
|
+
const updateCompositionInternal = (composition, hash) => {
|
1394
|
+
const message = {
|
1395
|
+
type: "update-composition-internal",
|
1396
|
+
composition,
|
1397
|
+
hash
|
1398
|
+
};
|
1399
|
+
postMessage(message);
|
1400
|
+
};
|
1375
1401
|
const addComponent = (options) => {
|
1376
1402
|
const message = {
|
1377
1403
|
...options,
|
@@ -1386,6 +1412,13 @@ var createCanvasChannel = ({
|
|
1386
1412
|
};
|
1387
1413
|
postMessage(message);
|
1388
1414
|
};
|
1415
|
+
const updateComponentParameter = (options) => {
|
1416
|
+
const message = {
|
1417
|
+
...options,
|
1418
|
+
type: "update-component-parameter"
|
1419
|
+
};
|
1420
|
+
postMessage(message);
|
1421
|
+
};
|
1389
1422
|
const dismissPlaceholder = (options) => {
|
1390
1423
|
const message = {
|
1391
1424
|
...options,
|
@@ -1408,7 +1441,7 @@ var createCanvasChannel = ({
|
|
1408
1441
|
postMessage(message);
|
1409
1442
|
};
|
1410
1443
|
const messageEventListener = (event) => {
|
1411
|
-
if (typeof event.data !== "string"
|
1444
|
+
if (typeof event.data !== "string") {
|
1412
1445
|
return;
|
1413
1446
|
}
|
1414
1447
|
let message = null;
|
@@ -1438,9 +1471,11 @@ var createCanvasChannel = ({
|
|
1438
1471
|
destroy,
|
1439
1472
|
selectComponent,
|
1440
1473
|
updateComposition,
|
1474
|
+
updateCompositionInternal,
|
1441
1475
|
on,
|
1442
1476
|
addComponent,
|
1443
1477
|
moveComponent,
|
1478
|
+
updateComponentParameter,
|
1444
1479
|
dismissPlaceholder,
|
1445
1480
|
updatePreviewSettings,
|
1446
1481
|
reportRenderedCompositions
|
@@ -1622,6 +1657,7 @@ var CanvasClientError = import_api4.ApiClientError;
|
|
1622
1657
|
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
1623
1658
|
IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
|
1624
1659
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
1660
|
+
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
1625
1661
|
PLACEHOLDER_ID,
|
1626
1662
|
UncachedCanvasClient,
|
1627
1663
|
UniqueBatchEntries,
|
@@ -1644,6 +1680,8 @@ var CanvasClientError = import_api4.ApiClientError;
|
|
1644
1680
|
isReportRenderedCompositionsMessage,
|
1645
1681
|
isSelectComponentMessage,
|
1646
1682
|
isSystemComponentDefinition,
|
1683
|
+
isUpdateComponentParameterMessage,
|
1684
|
+
isUpdateCompositionInternalMessage,
|
1647
1685
|
isUpdateCompositionMessage,
|
1648
1686
|
isUpdatePreviewSettingsMessage,
|
1649
1687
|
localize,
|
package/dist/index.mjs
CHANGED
@@ -470,9 +470,17 @@ var CanvasClient = class extends ApiClient {
|
|
470
470
|
getCompositionByNodePath(options) {
|
471
471
|
return this.getOneComposition(options);
|
472
472
|
}
|
473
|
+
/** @deprecated use getCompositionByNodePath instead */
|
474
|
+
unstable_getCompositionByNodePath(options) {
|
475
|
+
return this.getOneComposition(options);
|
476
|
+
}
|
473
477
|
getCompositionByNodeId(options) {
|
474
478
|
return this.getOneComposition(options);
|
475
479
|
}
|
480
|
+
/** @deprecated Use getCompositionByNodeId instead */
|
481
|
+
unstable_getCompositionByNodeId(options) {
|
482
|
+
return this.getOneComposition(options);
|
483
|
+
}
|
476
484
|
getCompositionBySlug(options) {
|
477
485
|
return this.getOneComposition(options);
|
478
486
|
}
|
@@ -480,13 +488,13 @@ var CanvasClient = class extends ApiClient {
|
|
480
488
|
return this.getOneComposition(options);
|
481
489
|
}
|
482
490
|
getOneComposition({
|
483
|
-
|
491
|
+
unstable_resolveData: resolveData,
|
484
492
|
unstable_dynamicVariables: dynamicVariables,
|
485
|
-
diagnostics,
|
493
|
+
unstable_diagnostics: diagnostics,
|
486
494
|
...params
|
487
495
|
}) {
|
488
496
|
const { projectId } = this.options;
|
489
|
-
if (
|
497
|
+
if (!resolveData) {
|
490
498
|
return this.apiClient(this.createUrl(CANVAS_URL, { ...params, projectId }));
|
491
499
|
}
|
492
500
|
const edgeParams = {
|
@@ -1121,6 +1129,7 @@ var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
1121
1129
|
var IN_CONTEXT_EDITOR_COMPONENT_START_ROLE = "uniform-component-start";
|
1122
1130
|
var IN_CONTEXT_EDITOR_COMPONENT_END_ROLE = "uniform-component-end";
|
1123
1131
|
var IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID = "uniform-canvas-preview-script";
|
1132
|
+
var IS_RENDERED_BY_UNIFORM_ATTRIBUTE = "data-is-rendered-by-uniform";
|
1124
1133
|
var PLACEHOLDER_ID = "placeholder";
|
1125
1134
|
var EMPTY_COMPOSITION = {
|
1126
1135
|
_id: "_empty_composition_id",
|
@@ -1230,12 +1239,18 @@ var isReadyMessage = (message) => {
|
|
1230
1239
|
var isUpdateCompositionMessage = (message) => {
|
1231
1240
|
return message.type === "update-composition";
|
1232
1241
|
};
|
1242
|
+
var isUpdateCompositionInternalMessage = (message) => {
|
1243
|
+
return message.type === "update-composition-internal";
|
1244
|
+
};
|
1233
1245
|
var isAddComponentMessage = (message) => {
|
1234
1246
|
return message.type === "add-component";
|
1235
1247
|
};
|
1236
1248
|
var isMovingComponentMessage = (message) => {
|
1237
1249
|
return message.type === "move-component";
|
1238
1250
|
};
|
1251
|
+
var isUpdateComponentParameterMessage = (message) => {
|
1252
|
+
return message.type === "update-component-parameter";
|
1253
|
+
};
|
1239
1254
|
var isDismissPlaceholderMessage = (message) => {
|
1240
1255
|
return message.type === "dismiss-placeholder";
|
1241
1256
|
};
|
@@ -1297,6 +1312,14 @@ var createCanvasChannel = ({
|
|
1297
1312
|
};
|
1298
1313
|
postMessage(message);
|
1299
1314
|
};
|
1315
|
+
const updateCompositionInternal = (composition, hash) => {
|
1316
|
+
const message = {
|
1317
|
+
type: "update-composition-internal",
|
1318
|
+
composition,
|
1319
|
+
hash
|
1320
|
+
};
|
1321
|
+
postMessage(message);
|
1322
|
+
};
|
1300
1323
|
const addComponent = (options) => {
|
1301
1324
|
const message = {
|
1302
1325
|
...options,
|
@@ -1311,6 +1334,13 @@ var createCanvasChannel = ({
|
|
1311
1334
|
};
|
1312
1335
|
postMessage(message);
|
1313
1336
|
};
|
1337
|
+
const updateComponentParameter = (options) => {
|
1338
|
+
const message = {
|
1339
|
+
...options,
|
1340
|
+
type: "update-component-parameter"
|
1341
|
+
};
|
1342
|
+
postMessage(message);
|
1343
|
+
};
|
1314
1344
|
const dismissPlaceholder = (options) => {
|
1315
1345
|
const message = {
|
1316
1346
|
...options,
|
@@ -1333,7 +1363,7 @@ var createCanvasChannel = ({
|
|
1333
1363
|
postMessage(message);
|
1334
1364
|
};
|
1335
1365
|
const messageEventListener = (event) => {
|
1336
|
-
if (typeof event.data !== "string"
|
1366
|
+
if (typeof event.data !== "string") {
|
1337
1367
|
return;
|
1338
1368
|
}
|
1339
1369
|
let message = null;
|
@@ -1363,9 +1393,11 @@ var createCanvasChannel = ({
|
|
1363
1393
|
destroy,
|
1364
1394
|
selectComponent,
|
1365
1395
|
updateComposition,
|
1396
|
+
updateCompositionInternal,
|
1366
1397
|
on,
|
1367
1398
|
addComponent,
|
1368
1399
|
moveComponent,
|
1400
|
+
updateComponentParameter,
|
1369
1401
|
dismissPlaceholder,
|
1370
1402
|
updatePreviewSettings,
|
1371
1403
|
reportRenderedCompositions
|
@@ -1546,6 +1578,7 @@ export {
|
|
1546
1578
|
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
1547
1579
|
IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
|
1548
1580
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
1581
|
+
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
1549
1582
|
PLACEHOLDER_ID,
|
1550
1583
|
UncachedCanvasClient,
|
1551
1584
|
UniqueBatchEntries,
|
@@ -1568,6 +1601,8 @@ export {
|
|
1568
1601
|
isReportRenderedCompositionsMessage,
|
1569
1602
|
isSelectComponentMessage,
|
1570
1603
|
isSystemComponentDefinition,
|
1604
|
+
isUpdateComponentParameterMessage,
|
1605
|
+
isUpdateCompositionInternalMessage,
|
1571
1606
|
isUpdateCompositionMessage,
|
1572
1607
|
isUpdatePreviewSettingsMessage,
|
1573
1608
|
localize,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/canvas",
|
3
|
-
"version": "18.35.1-alpha.
|
3
|
+
"version": "18.35.1-alpha.17+c528ec3cb",
|
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": "18.35.1-alpha.
|
50
|
+
"@uniformdev/context": "18.35.1-alpha.17+c528ec3cb"
|
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": "c528ec3cbb765bfd058357968a9be5ae0926362c"
|
59
59
|
}
|