@uniformdev/next-app-router 20.75.1-alpha.16 → 20.75.1-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/component.d.mts +2 -2
- package/dist/component.d.ts +2 -2
- package/dist/component.js +15 -31
- package/dist/component.mjs +2 -18
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/middleware.js +6 -6
- package/dist/middleware.mjs +6 -6
- package/package.json +8 -8
package/dist/component.d.mts
CHANGED
|
@@ -36,7 +36,7 @@ type RenderRichTextComponentResolver = (node: RichTextNode) => RichTextRendererC
|
|
|
36
36
|
declare const UniformRichText: React.ForwardRefExoticComponent<{
|
|
37
37
|
/**
|
|
38
38
|
* The name of the HTML tag to render.
|
|
39
|
-
* @
|
|
39
|
+
* @defaultValue "div"
|
|
40
40
|
*/
|
|
41
41
|
as?: React.ElementType;
|
|
42
42
|
/**
|
|
@@ -51,7 +51,7 @@ declare const UniformRichText: React.ForwardRefExoticComponent<{
|
|
|
51
51
|
/**
|
|
52
52
|
* Sets the value to show in Canvas editor when the parameter value is empty.
|
|
53
53
|
* Can be a static string, or a function to generate the placeholder out of parameter info.
|
|
54
|
-
* @
|
|
54
|
+
* @defaultValue undefined
|
|
55
55
|
*/
|
|
56
56
|
placeholder?: string | ((parameter: {
|
|
57
57
|
id: string;
|
package/dist/component.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ type RenderRichTextComponentResolver = (node: RichTextNode) => RichTextRendererC
|
|
|
36
36
|
declare const UniformRichText: React.ForwardRefExoticComponent<{
|
|
37
37
|
/**
|
|
38
38
|
* The name of the HTML tag to render.
|
|
39
|
-
* @
|
|
39
|
+
* @defaultValue "div"
|
|
40
40
|
*/
|
|
41
41
|
as?: React.ElementType;
|
|
42
42
|
/**
|
|
@@ -51,7 +51,7 @@ declare const UniformRichText: React.ForwardRefExoticComponent<{
|
|
|
51
51
|
/**
|
|
52
52
|
* Sets the value to show in Canvas editor when the parameter value is empty.
|
|
53
53
|
* Can be a static string, or a function to generate the placeholder out of parameter info.
|
|
54
|
-
* @
|
|
54
|
+
* @defaultValue undefined
|
|
55
55
|
*/
|
|
56
56
|
placeholder?: string | ((parameter: {
|
|
57
57
|
id: string;
|
package/dist/component.js
CHANGED
|
@@ -936,11 +936,11 @@ var ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
|
|
|
936
936
|
var ATTRIBUTE_PARAMETER_TYPE = "data-uniform-parameter-type";
|
|
937
937
|
|
|
938
938
|
// src/components/UniformRichText.tsx
|
|
939
|
-
var
|
|
939
|
+
var import_richtext6 = require("@uniformdev/richtext");
|
|
940
940
|
var import_react12 = __toESM(require("react"));
|
|
941
941
|
|
|
942
942
|
// src/components/UniformRichTextNode.tsx
|
|
943
|
-
var
|
|
943
|
+
var import_richtext5 = require("@uniformdev/richtext");
|
|
944
944
|
var import_react11 = __toESM(require("react"));
|
|
945
945
|
|
|
946
946
|
// src/components/nodes/AssetRichTextNode.tsx
|
|
@@ -986,57 +986,41 @@ var LinkRichTextNode = ({ children, node }) => {
|
|
|
986
986
|
};
|
|
987
987
|
|
|
988
988
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
989
|
-
var import_richtext2 = require("@uniformdev/richtext");
|
|
990
989
|
var import_react5 = __toESM(require("react"));
|
|
991
990
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
992
991
|
const { value } = node;
|
|
993
|
-
|
|
994
|
-
return /* @__PURE__ */ import_react5.default.createElement(
|
|
995
|
-
"li",
|
|
996
|
-
{
|
|
997
|
-
value: typeof normalizedValue === "number" && Number.isFinite(normalizedValue) && normalizedValue > 0 ? normalizedValue : void 0
|
|
998
|
-
},
|
|
999
|
-
children
|
|
1000
|
-
);
|
|
992
|
+
return /* @__PURE__ */ import_react5.default.createElement("li", { value: Number.isFinite(value) && value > 0 ? value : void 0 }, children);
|
|
1001
993
|
};
|
|
1002
994
|
|
|
1003
995
|
// src/components/nodes/ListRichTextNode.tsx
|
|
1004
|
-
var import_richtext3 = require("@uniformdev/richtext");
|
|
1005
996
|
var import_react6 = __toESM(require("react"));
|
|
1006
997
|
var ListRichTextNode = ({ children, node }) => {
|
|
1007
998
|
const { tag, start } = node;
|
|
1008
999
|
const ListTag = tag != null ? tag : "ul";
|
|
1009
|
-
|
|
1010
|
-
return /* @__PURE__ */ import_react6.default.createElement(
|
|
1011
|
-
ListTag,
|
|
1012
|
-
{
|
|
1013
|
-
start: typeof normalizedStart === "number" && Number.isFinite(normalizedStart) && normalizedStart > 0 ? normalizedStart : void 0
|
|
1014
|
-
},
|
|
1015
|
-
children
|
|
1016
|
-
);
|
|
1000
|
+
return /* @__PURE__ */ import_react6.default.createElement(ListTag, { start: Number.isFinite(start) && start > 0 ? start : void 0 }, children);
|
|
1017
1001
|
};
|
|
1018
1002
|
|
|
1019
1003
|
// src/components/nodes/ParagraphRichTextNode.tsx
|
|
1020
|
-
var
|
|
1004
|
+
var import_richtext2 = require("@uniformdev/richtext");
|
|
1021
1005
|
var import_react7 = __toESM(require("react"));
|
|
1022
1006
|
var ParagraphRichTextNode = ({ children, node }) => {
|
|
1023
1007
|
const { format, direction } = node;
|
|
1024
1008
|
return /* @__PURE__ */ import_react7.default.createElement(
|
|
1025
1009
|
"p",
|
|
1026
1010
|
{
|
|
1027
|
-
dir: (0,
|
|
1028
|
-
style: (0,
|
|
1011
|
+
dir: (0, import_richtext2.isPureDirection)(direction) ? direction : void 0,
|
|
1012
|
+
style: (0, import_richtext2.isPureTextAlign)(format) ? { textAlign: format } : void 0
|
|
1029
1013
|
},
|
|
1030
1014
|
children
|
|
1031
1015
|
);
|
|
1032
1016
|
};
|
|
1033
1017
|
|
|
1034
1018
|
// src/components/nodes/TableCellRichTextNode.tsx
|
|
1035
|
-
var
|
|
1019
|
+
var import_richtext3 = require("@uniformdev/richtext");
|
|
1036
1020
|
var import_react8 = __toESM(require("react"));
|
|
1037
1021
|
var TableCellRichTextNode = ({ children, node }) => {
|
|
1038
1022
|
const { headerState } = node;
|
|
1039
|
-
const TableCellTag = (0,
|
|
1023
|
+
const TableCellTag = (0, import_richtext3.getRichTextTagFromTableCellHeaderState)(headerState);
|
|
1040
1024
|
return /* @__PURE__ */ import_react8.default.createElement(TableCellTag, null, children);
|
|
1041
1025
|
};
|
|
1042
1026
|
|
|
@@ -1047,18 +1031,18 @@ var TabRichTextNode = () => {
|
|
|
1047
1031
|
};
|
|
1048
1032
|
|
|
1049
1033
|
// src/components/nodes/TextRichTextNode.tsx
|
|
1050
|
-
var
|
|
1034
|
+
var import_richtext4 = require("@uniformdev/richtext");
|
|
1051
1035
|
var import_react10 = __toESM(require("react"));
|
|
1052
1036
|
var TextRichTextNode = ({ node }) => {
|
|
1053
1037
|
const { text, format } = node;
|
|
1054
|
-
const tags = (0,
|
|
1038
|
+
const tags = (0, import_richtext4.getRichTextTagsFromTextFormat)(format);
|
|
1055
1039
|
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ import_react10.default.createElement(Tag, null, children), text) : text);
|
|
1056
1040
|
};
|
|
1057
1041
|
|
|
1058
1042
|
// src/components/UniformRichTextNode.tsx
|
|
1059
1043
|
function UniformRichTextNode({ node, ...props }) {
|
|
1060
1044
|
var _a;
|
|
1061
|
-
if (!(0,
|
|
1045
|
+
if (!(0, import_richtext5.isRichTextNode)(node)) return null;
|
|
1062
1046
|
let NodeRenderer = (_a = props.resolveRichTextRenderer) == null ? void 0 : _a.call(props, node);
|
|
1063
1047
|
if (typeof NodeRenderer === "undefined") {
|
|
1064
1048
|
NodeRenderer = resolveRichTextDefaultRenderer(node);
|
|
@@ -1112,8 +1096,8 @@ var UniformRichText = import_react12.default.forwardRef(function UniformRichText
|
|
|
1112
1096
|
}
|
|
1113
1097
|
const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameter.parameterId }) : placeholder;
|
|
1114
1098
|
const value = parameter.value;
|
|
1115
|
-
if (!value || !(0,
|
|
1116
|
-
if (!isContextualEditing && (0,
|
|
1099
|
+
if (!value || !(0, import_richtext6.isRichTextValue)(value)) return null;
|
|
1100
|
+
if (!isContextualEditing && (0, import_richtext6.isRichTextValueConsideredEmpty)(value)) return null;
|
|
1117
1101
|
return Tag === null ? /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react12.default.createElement(
|
|
1118
1102
|
Tag,
|
|
1119
1103
|
{
|
|
@@ -1125,7 +1109,7 @@ var UniformRichText = import_react12.default.forwardRef(function UniformRichText
|
|
|
1125
1109
|
[ATTRIBUTE_PARAMETER_TYPE]: "richText"
|
|
1126
1110
|
} : {}
|
|
1127
1111
|
},
|
|
1128
|
-
(0,
|
|
1112
|
+
(0, import_richtext6.isRichTextValueConsideredEmpty)(value) ? /* @__PURE__ */ import_react12.default.createElement("p", null, /* @__PURE__ */ import_react12.default.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
|
|
1129
1113
|
);
|
|
1130
1114
|
});
|
|
1131
1115
|
|
package/dist/component.mjs
CHANGED
|
@@ -974,34 +974,18 @@ var LinkRichTextNode = ({ children, node }) => {
|
|
|
974
974
|
};
|
|
975
975
|
|
|
976
976
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
977
|
-
import { getRichTextListItemValue } from "@uniformdev/richtext";
|
|
978
977
|
import React5 from "react";
|
|
979
978
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
980
979
|
const { value } = node;
|
|
981
|
-
|
|
982
|
-
return /* @__PURE__ */ React5.createElement(
|
|
983
|
-
"li",
|
|
984
|
-
{
|
|
985
|
-
value: typeof normalizedValue === "number" && Number.isFinite(normalizedValue) && normalizedValue > 0 ? normalizedValue : void 0
|
|
986
|
-
},
|
|
987
|
-
children
|
|
988
|
-
);
|
|
980
|
+
return /* @__PURE__ */ React5.createElement("li", { value: Number.isFinite(value) && value > 0 ? value : void 0 }, children);
|
|
989
981
|
};
|
|
990
982
|
|
|
991
983
|
// src/components/nodes/ListRichTextNode.tsx
|
|
992
|
-
import { getRichTextListStart } from "@uniformdev/richtext";
|
|
993
984
|
import React6 from "react";
|
|
994
985
|
var ListRichTextNode = ({ children, node }) => {
|
|
995
986
|
const { tag, start } = node;
|
|
996
987
|
const ListTag = tag != null ? tag : "ul";
|
|
997
|
-
|
|
998
|
-
return /* @__PURE__ */ React6.createElement(
|
|
999
|
-
ListTag,
|
|
1000
|
-
{
|
|
1001
|
-
start: typeof normalizedStart === "number" && Number.isFinite(normalizedStart) && normalizedStart > 0 ? normalizedStart : void 0
|
|
1002
|
-
},
|
|
1003
|
-
children
|
|
1004
|
-
);
|
|
988
|
+
return /* @__PURE__ */ React6.createElement(ListTag, { start: Number.isFinite(start) && start > 0 ? start : void 0 }, children);
|
|
1005
989
|
};
|
|
1006
990
|
|
|
1007
991
|
// src/components/nodes/ParagraphRichTextNode.tsx
|
package/dist/index.d.mts
CHANGED
|
@@ -249,12 +249,12 @@ type EvaluatePersonalizationsFunction = (personalization: {
|
|
|
249
249
|
type PrecomputeCompositionOptions = Pick<ResolvedRouteResult, 'pageState' | 'route'> & {
|
|
250
250
|
/**
|
|
251
251
|
* Whether to evaluate tests
|
|
252
|
-
* @
|
|
252
|
+
* @defaultValue true
|
|
253
253
|
*/
|
|
254
254
|
evaluateTests?: boolean | EvaluateTestsFunction;
|
|
255
255
|
/**
|
|
256
256
|
* Whether to evaluate personalizations
|
|
257
|
-
* @
|
|
257
|
+
* @defaultValue true
|
|
258
258
|
*/
|
|
259
259
|
evaluatePersonalizations?: boolean | EvaluatePersonalizationsFunction;
|
|
260
260
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -249,12 +249,12 @@ type EvaluatePersonalizationsFunction = (personalization: {
|
|
|
249
249
|
type PrecomputeCompositionOptions = Pick<ResolvedRouteResult, 'pageState' | 'route'> & {
|
|
250
250
|
/**
|
|
251
251
|
* Whether to evaluate tests
|
|
252
|
-
* @
|
|
252
|
+
* @defaultValue true
|
|
253
253
|
*/
|
|
254
254
|
evaluateTests?: boolean | EvaluateTestsFunction;
|
|
255
255
|
/**
|
|
256
256
|
* Whether to evaluate personalizations
|
|
257
|
-
* @
|
|
257
|
+
* @defaultValue true
|
|
258
258
|
*/
|
|
259
259
|
evaluatePersonalizations?: boolean | EvaluatePersonalizationsFunction;
|
|
260
260
|
};
|
package/dist/middleware.js
CHANGED
|
@@ -4371,8 +4371,8 @@ var TransitionDataStore = class {
|
|
|
4371
4371
|
}
|
|
4372
4372
|
/**
|
|
4373
4373
|
* Updates data in the transition storage.
|
|
4374
|
-
* @param commands Commands to execute against existing stored value (event based stores)
|
|
4375
|
-
* @param computedValue Pre-computed new value against existing value (object based stores)
|
|
4374
|
+
* @param commands - Commands to execute against existing stored value (event based stores)
|
|
4375
|
+
* @param computedValue - Pre-computed new value against existing value (object based stores)
|
|
4376
4376
|
* @returns Resolved promise when the data has been updated
|
|
4377
4377
|
*/
|
|
4378
4378
|
updateData(commands, computedValue) {
|
|
@@ -4848,7 +4848,7 @@ var VisitorDataStore = class {
|
|
|
4848
4848
|
/**
|
|
4849
4849
|
* Deletes visitor data (forgetting them)
|
|
4850
4850
|
* In most cases you should use forget() on the Context instead of this function, which also clears the Context state.
|
|
4851
|
-
* @param fromAllDevices for an identified user, whether to delete all their data (for the entire account) - true, or data for this device (sign out) - false
|
|
4851
|
+
* @param fromAllDevices - for an identified user, whether to delete all their data (for the entire account) - true, or data for this device (sign out) - false
|
|
4852
4852
|
*/
|
|
4853
4853
|
async delete(fromAllDevices) {
|
|
4854
4854
|
var _a, _b, _c, _d, _e;
|
|
@@ -5367,7 +5367,7 @@ var Context = class {
|
|
|
5367
5367
|
}
|
|
5368
5368
|
/**
|
|
5369
5369
|
* Forgets the visitor's data and resets the Context to its initial state.
|
|
5370
|
-
* @param fromAllDevices for an identified user, whether to delete all their data (for the entire account) - true, or data for this device (sign out) - false
|
|
5370
|
+
* @param fromAllDevices - for an identified user, whether to delete all their data (for the entire account) - true, or data for this device (sign out) - false
|
|
5371
5371
|
*/
|
|
5372
5372
|
async forget(fromAllDevices) {
|
|
5373
5373
|
const previousCompositionMetadata = __privateGet4(this, _state).compositionMetadata;
|
|
@@ -5408,14 +5408,14 @@ var Context = class {
|
|
|
5408
5408
|
});
|
|
5409
5409
|
return transitionState;
|
|
5410
5410
|
}
|
|
5411
|
-
/** @deprecated */
|
|
5411
|
+
/** @deprecated Internal API for test event processing; not for public use. */
|
|
5412
5412
|
internal_processTestEvent(event) {
|
|
5413
5413
|
if (event.variantId) {
|
|
5414
5414
|
this.setTestVariantId(event.name, event.variantId);
|
|
5415
5415
|
__privateMethod(this, _Context_instances, emitTest_fn).call(this, event);
|
|
5416
5416
|
}
|
|
5417
5417
|
}
|
|
5418
|
-
/** @deprecated */
|
|
5418
|
+
/** @deprecated Internal API for personalization event processing; not for public use. */
|
|
5419
5419
|
internal_processPersonalizationEvent(event) {
|
|
5420
5420
|
__privateGet4(this, _pzCache)[event.name] = event.variantIds;
|
|
5421
5421
|
__privateGet4(this, _mitt3).emit("personalizationResult", event);
|
package/dist/middleware.mjs
CHANGED
|
@@ -4363,8 +4363,8 @@ var TransitionDataStore = class {
|
|
|
4363
4363
|
}
|
|
4364
4364
|
/**
|
|
4365
4365
|
* Updates data in the transition storage.
|
|
4366
|
-
* @param commands Commands to execute against existing stored value (event based stores)
|
|
4367
|
-
* @param computedValue Pre-computed new value against existing value (object based stores)
|
|
4366
|
+
* @param commands - Commands to execute against existing stored value (event based stores)
|
|
4367
|
+
* @param computedValue - Pre-computed new value against existing value (object based stores)
|
|
4368
4368
|
* @returns Resolved promise when the data has been updated
|
|
4369
4369
|
*/
|
|
4370
4370
|
updateData(commands, computedValue) {
|
|
@@ -4840,7 +4840,7 @@ var VisitorDataStore = class {
|
|
|
4840
4840
|
/**
|
|
4841
4841
|
* Deletes visitor data (forgetting them)
|
|
4842
4842
|
* In most cases you should use forget() on the Context instead of this function, which also clears the Context state.
|
|
4843
|
-
* @param fromAllDevices for an identified user, whether to delete all their data (for the entire account) - true, or data for this device (sign out) - false
|
|
4843
|
+
* @param fromAllDevices - for an identified user, whether to delete all their data (for the entire account) - true, or data for this device (sign out) - false
|
|
4844
4844
|
*/
|
|
4845
4845
|
async delete(fromAllDevices) {
|
|
4846
4846
|
var _a, _b, _c, _d, _e;
|
|
@@ -5359,7 +5359,7 @@ var Context = class {
|
|
|
5359
5359
|
}
|
|
5360
5360
|
/**
|
|
5361
5361
|
* Forgets the visitor's data and resets the Context to its initial state.
|
|
5362
|
-
* @param fromAllDevices for an identified user, whether to delete all their data (for the entire account) - true, or data for this device (sign out) - false
|
|
5362
|
+
* @param fromAllDevices - for an identified user, whether to delete all their data (for the entire account) - true, or data for this device (sign out) - false
|
|
5363
5363
|
*/
|
|
5364
5364
|
async forget(fromAllDevices) {
|
|
5365
5365
|
const previousCompositionMetadata = __privateGet4(this, _state).compositionMetadata;
|
|
@@ -5400,14 +5400,14 @@ var Context = class {
|
|
|
5400
5400
|
});
|
|
5401
5401
|
return transitionState;
|
|
5402
5402
|
}
|
|
5403
|
-
/** @deprecated */
|
|
5403
|
+
/** @deprecated Internal API for test event processing; not for public use. */
|
|
5404
5404
|
internal_processTestEvent(event) {
|
|
5405
5405
|
if (event.variantId) {
|
|
5406
5406
|
this.setTestVariantId(event.name, event.variantId);
|
|
5407
5407
|
__privateMethod(this, _Context_instances, emitTest_fn).call(this, event);
|
|
5408
5408
|
}
|
|
5409
5409
|
}
|
|
5410
|
-
/** @deprecated */
|
|
5410
|
+
/** @deprecated Internal API for personalization event processing; not for public use. */
|
|
5411
5411
|
internal_processPersonalizationEvent(event) {
|
|
5412
5412
|
__privateGet4(this, _pzCache)[event.name] = event.variantIds;
|
|
5413
5413
|
__privateGet4(this, _mitt3).emit("personalizationResult", event);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/next-app-router",
|
|
3
|
-
"version": "20.75.1-alpha.
|
|
3
|
+
"version": "20.75.1-alpha.6+28f494b01a",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -100,12 +100,12 @@
|
|
|
100
100
|
"vitest": "4.1.9"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@uniformdev/canvas-react": "20.75.1-alpha.
|
|
104
|
-
"@uniformdev/next-app-router-client": "20.75.1-alpha.
|
|
105
|
-
"@uniformdev/next-app-router-shared": "20.75.1-alpha.
|
|
106
|
-
"@uniformdev/redirect": "20.75.1-alpha.
|
|
107
|
-
"@uniformdev/richtext": "20.75.1-alpha.
|
|
108
|
-
"@uniformdev/webhooks": "20.75.1-alpha.
|
|
103
|
+
"@uniformdev/canvas-react": "20.75.1-alpha.6+28f494b01a",
|
|
104
|
+
"@uniformdev/next-app-router-client": "20.75.1-alpha.6+28f494b01a",
|
|
105
|
+
"@uniformdev/next-app-router-shared": "20.75.1-alpha.6+28f494b01a",
|
|
106
|
+
"@uniformdev/redirect": "20.75.1-alpha.6+28f494b01a",
|
|
107
|
+
"@uniformdev/richtext": "20.75.1-alpha.6+28f494b01a",
|
|
108
|
+
"@uniformdev/webhooks": "20.75.1-alpha.6+28f494b01a",
|
|
109
109
|
"@vercel/functions": "^3.7.2",
|
|
110
110
|
"encoding": "^0.1.13",
|
|
111
111
|
"server-only": "^0.0.1",
|
|
@@ -122,5 +122,5 @@
|
|
|
122
122
|
"publishConfig": {
|
|
123
123
|
"access": "public"
|
|
124
124
|
},
|
|
125
|
-
"gitHead": "
|
|
125
|
+
"gitHead": "28f494b01a1b988afdf9f7e3ecf6fad402bb3777"
|
|
126
126
|
}
|