@uniformdev/canvas 20.86.0 → 20.86.1-alpha.1.sha-047a8346cd
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 +171 -1
- package/dist/index.d.ts +171 -1
- package/dist/index.esm.js +238 -1
- package/dist/index.js +247 -2
- package/dist/index.mjs +238 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -225,6 +225,7 @@ var CANVAS_PERSONALIZE_TYPE = "$personalization";
|
|
|
225
225
|
var CANVAS_TEST_TYPE = "$test";
|
|
226
226
|
var CANVAS_LOCALIZATION_TYPE = "$localization";
|
|
227
227
|
var CANVAS_SLOT_SECTION_TYPE = "$slotSection";
|
|
228
|
+
var CANVAS_LOOP_TYPE = "$loop";
|
|
228
229
|
var CANVAS_INTENT_TAG_PARAM = "intentTag";
|
|
229
230
|
var CANVAS_LOCALE_TAG_PARAM = "locale";
|
|
230
231
|
var CANVAS_BLOCK_PARAM_TYPE = "$block";
|
|
@@ -232,6 +233,9 @@ var CANVAS_PERSONALIZE_SLOT = "pz";
|
|
|
232
233
|
var CANVAS_TEST_SLOT = "test";
|
|
233
234
|
var CANVAS_LOCALIZATION_SLOT = "localized";
|
|
234
235
|
var CANVAS_SLOT_SECTION_SLOT = "$slotSectionItems";
|
|
236
|
+
var CANVAS_LOOP_SLOT = "body";
|
|
237
|
+
var CANVAS_LOOP_DATA_TYPE = "sys-reserved-loop";
|
|
238
|
+
var CANVAS_ALIAS_DATA_TYPE = "sys-reserved-alias";
|
|
235
239
|
var CANVAS_SLOT_SECTION_NAME_PARAM = "name";
|
|
236
240
|
var CANVAS_SLOT_SECTION_MIN_PARAM = "min";
|
|
237
241
|
var CANVAS_SLOT_SECTION_MAX_PARAM = "max";
|
|
@@ -4059,6 +4063,231 @@ function handleRichTextNodeBinding(object, options) {
|
|
|
4059
4063
|
return void 0;
|
|
4060
4064
|
}
|
|
4061
4065
|
|
|
4066
|
+
// src/utils/wellKnownSystemComponentParameters.ts
|
|
4067
|
+
var wellKnownSystemComponentParameters = [
|
|
4068
|
+
{
|
|
4069
|
+
id: CANVAS_COMPONENT_DISPLAY_NAME_PARAM,
|
|
4070
|
+
name: "Display Name",
|
|
4071
|
+
type: "text"
|
|
4072
|
+
},
|
|
4073
|
+
{
|
|
4074
|
+
id: CANVAS_INTENT_TAG_PARAM,
|
|
4075
|
+
name: "Intent Tag",
|
|
4076
|
+
type: "intentTag"
|
|
4077
|
+
},
|
|
4078
|
+
{
|
|
4079
|
+
id: CANVAS_LOCALE_TAG_PARAM,
|
|
4080
|
+
name: "Locale Visibility",
|
|
4081
|
+
type: "localeSelect"
|
|
4082
|
+
},
|
|
4083
|
+
{
|
|
4084
|
+
id: CANVAS_PERSONALIZATION_PARAM,
|
|
4085
|
+
name: "Personalization Criteria",
|
|
4086
|
+
type: CANVAS_PERSONALIZATION_PARAM
|
|
4087
|
+
},
|
|
4088
|
+
{
|
|
4089
|
+
id: CANVAS_ENRICHMENT_TAG_PARAM,
|
|
4090
|
+
name: "Enrichment Tags",
|
|
4091
|
+
type: CANVAS_ENRICHMENT_TAG_PARAM,
|
|
4092
|
+
helpText: "Seeing this component will increase a visitor's score in these enrichments."
|
|
4093
|
+
},
|
|
4094
|
+
{
|
|
4095
|
+
id: CANVAS_TEST_VARIANT_PARAM,
|
|
4096
|
+
name: "A/B Test",
|
|
4097
|
+
type: "testVariant"
|
|
4098
|
+
},
|
|
4099
|
+
{
|
|
4100
|
+
id: CANVAS_VIZ_CONTROL_PARAM,
|
|
4101
|
+
name: "Visibility Control",
|
|
4102
|
+
type: CANVAS_VIZ_CONTROL_PARAM
|
|
4103
|
+
}
|
|
4104
|
+
];
|
|
4105
|
+
|
|
4106
|
+
// src/utils/wellKnownSystemComponents.ts
|
|
4107
|
+
var wellKnownSystemComponents = [
|
|
4108
|
+
{
|
|
4109
|
+
id: CANVAS_PERSONALIZE_TYPE,
|
|
4110
|
+
name: "Personalization",
|
|
4111
|
+
icon: "track",
|
|
4112
|
+
titleParameter: CANVAS_PERSONALIZATION_EVENT_NAME_PARAM,
|
|
4113
|
+
description: "Contains components that will be shown to visitors based on configurable personalization criteria.",
|
|
4114
|
+
slots: [
|
|
4115
|
+
{
|
|
4116
|
+
id: CANVAS_PERSONALIZE_SLOT,
|
|
4117
|
+
inheritAllowedComponents: true,
|
|
4118
|
+
name: "Personalized Variations",
|
|
4119
|
+
allowedComponents: []
|
|
4120
|
+
}
|
|
4121
|
+
],
|
|
4122
|
+
parameters: [
|
|
4123
|
+
{
|
|
4124
|
+
id: CANVAS_PERSONALIZATION_EVENT_NAME_PARAM,
|
|
4125
|
+
name: "Analytics tracking name",
|
|
4126
|
+
type: "text",
|
|
4127
|
+
typeConfig: {
|
|
4128
|
+
required: true,
|
|
4129
|
+
caption: "Will be sent to your analytics tool. We recommend not changing this once the composition is published."
|
|
4130
|
+
}
|
|
4131
|
+
},
|
|
4132
|
+
{
|
|
4133
|
+
id: CANVAS_PERSONALIZATION_ALGORITHM_PARAM,
|
|
4134
|
+
name: "Selection method",
|
|
4135
|
+
type: CANVAS_PERSONALIZATION_ALGORITHM_TYPE,
|
|
4136
|
+
typeConfig: {
|
|
4137
|
+
required: true
|
|
4138
|
+
}
|
|
4139
|
+
},
|
|
4140
|
+
{
|
|
4141
|
+
id: CANVAS_PERSONALIZATION_TAKE_PARAM,
|
|
4142
|
+
name: "Number of variations to select",
|
|
4143
|
+
type: "number",
|
|
4144
|
+
typeConfig: {
|
|
4145
|
+
regex: "^[0-9]+$",
|
|
4146
|
+
regexMessage: "Please enter a whole number",
|
|
4147
|
+
placeholder: "1"
|
|
4148
|
+
}
|
|
4149
|
+
},
|
|
4150
|
+
{
|
|
4151
|
+
id: CANVAS_HYPOTHESIS_PARAM,
|
|
4152
|
+
name: "Hypothesis",
|
|
4153
|
+
type: "richText",
|
|
4154
|
+
typeConfig: {
|
|
4155
|
+
formatting: {
|
|
4156
|
+
builtIn: ["bold", "italic", "underline"]
|
|
4157
|
+
},
|
|
4158
|
+
elements: {
|
|
4159
|
+
builtIn: ["unorderedList", "orderedList"]
|
|
4160
|
+
}
|
|
4161
|
+
},
|
|
4162
|
+
helpText: "Document the hypothesis or reasoning behind this personalization strategy.",
|
|
4163
|
+
guidance: "Document the hypothesis or reasoning behind this personalization strategy. Not localizable; do not pass a locale when editing."
|
|
4164
|
+
}
|
|
4165
|
+
]
|
|
4166
|
+
},
|
|
4167
|
+
{
|
|
4168
|
+
id: CANVAS_TEST_TYPE,
|
|
4169
|
+
name: "A/B Test",
|
|
4170
|
+
icon: "style",
|
|
4171
|
+
titleParameter: "test",
|
|
4172
|
+
description: "Contains components that will be shown to visitors randomly based on a configurable traffic split.",
|
|
4173
|
+
slots: [
|
|
4174
|
+
{
|
|
4175
|
+
id: CANVAS_TEST_SLOT,
|
|
4176
|
+
inheritAllowedComponents: true,
|
|
4177
|
+
name: "Test Variations",
|
|
4178
|
+
allowedComponents: []
|
|
4179
|
+
}
|
|
4180
|
+
],
|
|
4181
|
+
parameters: [
|
|
4182
|
+
{
|
|
4183
|
+
id: "test",
|
|
4184
|
+
name: "Test name",
|
|
4185
|
+
type: "testSelect"
|
|
4186
|
+
},
|
|
4187
|
+
{
|
|
4188
|
+
id: CANVAS_HYPOTHESIS_PARAM,
|
|
4189
|
+
name: "Hypothesis",
|
|
4190
|
+
type: "richText",
|
|
4191
|
+
typeConfig: {
|
|
4192
|
+
formatting: {
|
|
4193
|
+
builtIn: ["bold", "italic", "underline"]
|
|
4194
|
+
},
|
|
4195
|
+
elements: {
|
|
4196
|
+
builtIn: ["unorderedList", "orderedList"]
|
|
4197
|
+
}
|
|
4198
|
+
},
|
|
4199
|
+
helpText: "Document the hypothesis or expected outcome of this A/B test.",
|
|
4200
|
+
guidance: "Document the hypothesis or expected outcome of this A/B test. Not localizable; do not pass a locale when editing."
|
|
4201
|
+
}
|
|
4202
|
+
]
|
|
4203
|
+
},
|
|
4204
|
+
{
|
|
4205
|
+
id: CANVAS_LOCALIZATION_TYPE,
|
|
4206
|
+
name: "Localization",
|
|
4207
|
+
icon: "globe-alt",
|
|
4208
|
+
description: "Contains components that will be shown based on visitor locale.",
|
|
4209
|
+
slots: [
|
|
4210
|
+
{
|
|
4211
|
+
id: CANVAS_LOCALIZATION_SLOT,
|
|
4212
|
+
inheritAllowedComponents: true,
|
|
4213
|
+
name: "Localized Variations",
|
|
4214
|
+
allowedComponents: []
|
|
4215
|
+
}
|
|
4216
|
+
]
|
|
4217
|
+
},
|
|
4218
|
+
{
|
|
4219
|
+
id: CANVAS_LOOP_TYPE,
|
|
4220
|
+
name: "Loop",
|
|
4221
|
+
icon: "repeat",
|
|
4222
|
+
description: "Contains components that will be repeated for each item in a list (array) selected from a data resource.",
|
|
4223
|
+
slots: [
|
|
4224
|
+
{
|
|
4225
|
+
id: CANVAS_LOOP_SLOT,
|
|
4226
|
+
inheritAllowedComponents: true,
|
|
4227
|
+
name: "Body",
|
|
4228
|
+
minComponents: 1,
|
|
4229
|
+
allowedComponents: []
|
|
4230
|
+
}
|
|
4231
|
+
]
|
|
4232
|
+
},
|
|
4233
|
+
{
|
|
4234
|
+
id: CANVAS_SLOT_SECTION_TYPE,
|
|
4235
|
+
name: "Slot Section",
|
|
4236
|
+
icon: "copy-all",
|
|
4237
|
+
titleParameter: CANVAS_SLOT_SECTION_NAME_PARAM,
|
|
4238
|
+
description: "When using this pattern, new components may be added at the location where this component is inserted.",
|
|
4239
|
+
slots: [
|
|
4240
|
+
{
|
|
4241
|
+
id: CANVAS_SLOT_SECTION_SLOT,
|
|
4242
|
+
inheritAllowedComponents: true,
|
|
4243
|
+
name: "Items",
|
|
4244
|
+
allowedComponents: []
|
|
4245
|
+
}
|
|
4246
|
+
],
|
|
4247
|
+
parameters: [
|
|
4248
|
+
{
|
|
4249
|
+
id: CANVAS_SLOT_SECTION_NAME_PARAM,
|
|
4250
|
+
name: "Name",
|
|
4251
|
+
type: "text"
|
|
4252
|
+
},
|
|
4253
|
+
{
|
|
4254
|
+
id: CANVAS_SLOT_SECTION_MIN_PARAM,
|
|
4255
|
+
name: "Minimum",
|
|
4256
|
+
type: "text"
|
|
4257
|
+
},
|
|
4258
|
+
{
|
|
4259
|
+
id: CANVAS_SLOT_SECTION_MAX_PARAM,
|
|
4260
|
+
name: "Maximum",
|
|
4261
|
+
type: "text"
|
|
4262
|
+
},
|
|
4263
|
+
{
|
|
4264
|
+
id: CANVAS_SLOT_SECTION_GROUP_TYPE_PARAM,
|
|
4265
|
+
name: "Group Type",
|
|
4266
|
+
type: "text"
|
|
4267
|
+
},
|
|
4268
|
+
{
|
|
4269
|
+
id: CANVAS_SLOT_SECTION_SPECIFIC_PARAM,
|
|
4270
|
+
name: "Specific",
|
|
4271
|
+
type: "array"
|
|
4272
|
+
}
|
|
4273
|
+
]
|
|
4274
|
+
}
|
|
4275
|
+
];
|
|
4276
|
+
var systemComponentsMetadata = {
|
|
4277
|
+
$personalization: void 0,
|
|
4278
|
+
$test: void 0,
|
|
4279
|
+
$localization: void 0,
|
|
4280
|
+
$loop: void 0,
|
|
4281
|
+
$slotSection: {
|
|
4282
|
+
isAutoAllowed: true,
|
|
4283
|
+
isOnlyAllowedInPatternEditor: true
|
|
4284
|
+
}
|
|
4285
|
+
};
|
|
4286
|
+
var getComponentMetadata = (type) => {
|
|
4287
|
+
const metadata = systemComponentsMetadata[type];
|
|
4288
|
+
return metadata;
|
|
4289
|
+
};
|
|
4290
|
+
|
|
4062
4291
|
// src/index.ts
|
|
4063
4292
|
import { ApiClientError as ApiClientError5 } from "@uniformdev/context/api";
|
|
4064
4293
|
|
|
@@ -4121,6 +4350,7 @@ export {
|
|
|
4121
4350
|
ApiClientError5 as ApiClientError,
|
|
4122
4351
|
BatchEntry,
|
|
4123
4352
|
BlockFormatError,
|
|
4353
|
+
CANVAS_ALIAS_DATA_TYPE,
|
|
4124
4354
|
CANVAS_BLOCK_PARAM_TYPE,
|
|
4125
4355
|
CANVAS_COMPONENT_DISPLAY_NAME_PARAM,
|
|
4126
4356
|
CANVAS_CONTEXTUAL_EDITING_PARAM,
|
|
@@ -4133,6 +4363,9 @@ export {
|
|
|
4133
4363
|
CANVAS_LOCALE_TAG_PARAM,
|
|
4134
4364
|
CANVAS_LOCALIZATION_SLOT,
|
|
4135
4365
|
CANVAS_LOCALIZATION_TYPE,
|
|
4366
|
+
CANVAS_LOOP_DATA_TYPE,
|
|
4367
|
+
CANVAS_LOOP_SLOT,
|
|
4368
|
+
CANVAS_LOOP_TYPE,
|
|
4136
4369
|
CANVAS_PERSONALIZATION_ALGORITHM_PARAM,
|
|
4137
4370
|
CANVAS_PERSONALIZATION_ALGORITHM_TYPE,
|
|
4138
4371
|
CANVAS_PERSONALIZATION_EVENT_NAME_PARAM,
|
|
@@ -4236,6 +4469,7 @@ export {
|
|
|
4236
4469
|
generateHash,
|
|
4237
4470
|
getBlockValue,
|
|
4238
4471
|
getComponentJsonPointer,
|
|
4472
|
+
getComponentMetadata,
|
|
4239
4473
|
getComponentPath,
|
|
4240
4474
|
getDataSourceVariantFromRouteGetParams,
|
|
4241
4475
|
getEffectivePropertyValue,
|
|
@@ -4287,7 +4521,10 @@ export {
|
|
|
4287
4521
|
parseVariableExpression,
|
|
4288
4522
|
projectionToQuery,
|
|
4289
4523
|
queryToProjection,
|
|
4524
|
+
systemComponentsMetadata,
|
|
4290
4525
|
version,
|
|
4291
4526
|
walkNodeTree,
|
|
4292
|
-
walkPropertyValues
|
|
4527
|
+
walkPropertyValues,
|
|
4528
|
+
wellKnownSystemComponentParameters,
|
|
4529
|
+
wellKnownSystemComponents
|
|
4293
4530
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas",
|
|
3
|
-
"version": "20.86.
|
|
3
|
+
"version": "20.86.1-alpha.1.sha-047a8346cd",
|
|
4
4
|
"description": "Common functionality and types for Uniform Canvas",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"svix": "1.96.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@uniformdev/assets": "20.86.
|
|
40
|
-
"@uniformdev/context": "20.86.
|
|
41
|
-
"@uniformdev/richtext": "20.86.
|
|
39
|
+
"@uniformdev/assets": "20.86.1-alpha.1.sha-047a8346cd",
|
|
40
|
+
"@uniformdev/context": "20.86.1-alpha.1.sha-047a8346cd",
|
|
41
|
+
"@uniformdev/richtext": "20.86.1-alpha.1.sha-047a8346cd",
|
|
42
42
|
"immer": "10.2.0",
|
|
43
43
|
"p-limit": "6.2.0",
|
|
44
44
|
"p-retry": "6.2.1",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "047a8346cd83803ac47f6bd28a9a59276b83ffc7"
|
|
54
54
|
}
|