@uniformdev/canvas-next-rsc-client 20.6.2-alpha.11 → 20.7.1-alpha.4
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 +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.esm.js +2 -5
- package/dist/index.js +2 -5
- package/dist/index.mjs +2 -5
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ManifestV2, TestEvent, Quirks, ScoreVector } from '@uniformdev/context';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { JSX, PropsWithChildren } from 'react';
|
|
4
4
|
import { PersonalizationEvent } from '@uniformdev/context/*';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { PureContextualEditingComponentWrapperProps } from '@uniformdev/canvas-react/core';
|
|
@@ -27,7 +27,7 @@ type ClientContextComponentProps = {
|
|
|
27
27
|
*/
|
|
28
28
|
experimentalQuirkSerialization: boolean;
|
|
29
29
|
};
|
|
30
|
-
type ClientContextComponent = (props: ClientContextComponentProps) =>
|
|
30
|
+
type ClientContextComponent = (props: ClientContextComponentProps) => JSX.Element | null;
|
|
31
31
|
|
|
32
32
|
declare const ClientContextPersonalizationTransfer: ({ event, ts, }: {
|
|
33
33
|
event: PersonalizationEvent;
|
|
@@ -52,11 +52,11 @@ declare const ContextUpdateTransferClient: ({ update, ts, }: {
|
|
|
52
52
|
|
|
53
53
|
declare const DefaultUniformClientContext: ClientContextComponent;
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
type PersonalizeClientProps = PersonalizeProps & {
|
|
56
56
|
indexes: number[];
|
|
57
57
|
slots: ComponentProps['slots'];
|
|
58
58
|
component: ComponentProps['component'];
|
|
59
|
-
}
|
|
59
|
+
};
|
|
60
60
|
declare const PersonalizeClient: (props: PersonalizeClientProps) => react.FunctionComponentElement<{
|
|
61
61
|
children?: react.ReactNode | undefined;
|
|
62
62
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ManifestV2, TestEvent, Quirks, ScoreVector } from '@uniformdev/context';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { JSX, PropsWithChildren } from 'react';
|
|
4
4
|
import { PersonalizationEvent } from '@uniformdev/context/*';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { PureContextualEditingComponentWrapperProps } from '@uniformdev/canvas-react/core';
|
|
@@ -27,7 +27,7 @@ type ClientContextComponentProps = {
|
|
|
27
27
|
*/
|
|
28
28
|
experimentalQuirkSerialization: boolean;
|
|
29
29
|
};
|
|
30
|
-
type ClientContextComponent = (props: ClientContextComponentProps) =>
|
|
30
|
+
type ClientContextComponent = (props: ClientContextComponentProps) => JSX.Element | null;
|
|
31
31
|
|
|
32
32
|
declare const ClientContextPersonalizationTransfer: ({ event, ts, }: {
|
|
33
33
|
event: PersonalizationEvent;
|
|
@@ -52,11 +52,11 @@ declare const ContextUpdateTransferClient: ({ update, ts, }: {
|
|
|
52
52
|
|
|
53
53
|
declare const DefaultUniformClientContext: ClientContextComponent;
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
type PersonalizeClientProps = PersonalizeProps & {
|
|
56
56
|
indexes: number[];
|
|
57
57
|
slots: ComponentProps['slots'];
|
|
58
58
|
component: ComponentProps['component'];
|
|
59
|
-
}
|
|
59
|
+
};
|
|
60
60
|
declare const PersonalizeClient: (props: PersonalizeClientProps) => react.FunctionComponentElement<{
|
|
61
61
|
children?: react.ReactNode | undefined;
|
|
62
62
|
}>;
|
package/dist/index.esm.js
CHANGED
|
@@ -720,7 +720,6 @@ defaultData_fn = function() {
|
|
|
720
720
|
controlGroup: (_c = (_b = __privateGet(this, _options).manifest) == null ? void 0 : _b.rollForControlGroup()) != null ? _c : false
|
|
721
721
|
};
|
|
722
722
|
};
|
|
723
|
-
var _personalizationSelectionAlgorithms;
|
|
724
723
|
var _serverTransitionState;
|
|
725
724
|
var _scores;
|
|
726
725
|
var _state;
|
|
@@ -734,7 +733,6 @@ var emitTest_fn;
|
|
|
734
733
|
var updateGoals_fn;
|
|
735
734
|
var updateComputedScores_fn;
|
|
736
735
|
var calculateScores_fn;
|
|
737
|
-
_personalizationSelectionAlgorithms = /* @__PURE__ */ new WeakMap();
|
|
738
736
|
_serverTransitionState = /* @__PURE__ */ new WeakMap();
|
|
739
737
|
_scores = /* @__PURE__ */ new WeakMap();
|
|
740
738
|
_state = /* @__PURE__ */ new WeakMap();
|
|
@@ -945,6 +943,7 @@ import { CANVAS_PERSONALIZE_SLOT } from "@uniformdev/canvas";
|
|
|
945
943
|
import { runPersonalization } from "@uniformdev/canvas-next-rsc-shared";
|
|
946
944
|
import { createElement, Fragment as Fragment3, useEffect as useEffect7, useState as useState6 } from "react";
|
|
947
945
|
var PersonalizeClient = (props) => {
|
|
946
|
+
const { slots } = props;
|
|
948
947
|
const { context } = useUniformContext();
|
|
949
948
|
const [indexesToShow, setIndexesToShow] = useState6(props.indexes);
|
|
950
949
|
useEffect7(() => {
|
|
@@ -959,16 +958,14 @@ var PersonalizeClient = (props) => {
|
|
|
959
958
|
setIndexesToShow(result.indexes);
|
|
960
959
|
};
|
|
961
960
|
context.events.on("scoresUpdated", handleRunPersonalization);
|
|
962
|
-
context.events.on("quirksUpdated", handleRunPersonalization);
|
|
963
961
|
handleRunPersonalization();
|
|
964
962
|
return () => {
|
|
965
963
|
context.events.off("scoresUpdated", handleRunPersonalization);
|
|
966
|
-
context.events.off("quirksUpdated", handleRunPersonalization);
|
|
967
964
|
};
|
|
968
965
|
}, [props, context]);
|
|
969
966
|
const slotsToShow = indexesToShow.map((key) => {
|
|
970
967
|
var _a;
|
|
971
|
-
return (_a =
|
|
968
|
+
return (_a = slots[CANVAS_PERSONALIZE_SLOT]) == null ? void 0 : _a.items[key];
|
|
972
969
|
});
|
|
973
970
|
return createElement(Fragment3, void 0, slotsToShow);
|
|
974
971
|
};
|
package/dist/index.js
CHANGED
|
@@ -746,7 +746,6 @@ defaultData_fn = function() {
|
|
|
746
746
|
controlGroup: (_c = (_b = __privateGet(this, _options).manifest) == null ? void 0 : _b.rollForControlGroup()) != null ? _c : false
|
|
747
747
|
};
|
|
748
748
|
};
|
|
749
|
-
var _personalizationSelectionAlgorithms;
|
|
750
749
|
var _serverTransitionState;
|
|
751
750
|
var _scores;
|
|
752
751
|
var _state;
|
|
@@ -760,7 +759,6 @@ var emitTest_fn;
|
|
|
760
759
|
var updateGoals_fn;
|
|
761
760
|
var updateComputedScores_fn;
|
|
762
761
|
var calculateScores_fn;
|
|
763
|
-
_personalizationSelectionAlgorithms = /* @__PURE__ */ new WeakMap();
|
|
764
762
|
_serverTransitionState = /* @__PURE__ */ new WeakMap();
|
|
765
763
|
_scores = /* @__PURE__ */ new WeakMap();
|
|
766
764
|
_state = /* @__PURE__ */ new WeakMap();
|
|
@@ -971,6 +969,7 @@ var import_canvas2 = require("@uniformdev/canvas");
|
|
|
971
969
|
var import_canvas_next_rsc_shared2 = require("@uniformdev/canvas-next-rsc-shared");
|
|
972
970
|
var import_react8 = require("react");
|
|
973
971
|
var PersonalizeClient = (props) => {
|
|
972
|
+
const { slots } = props;
|
|
974
973
|
const { context } = useUniformContext();
|
|
975
974
|
const [indexesToShow, setIndexesToShow] = (0, import_react8.useState)(props.indexes);
|
|
976
975
|
(0, import_react8.useEffect)(() => {
|
|
@@ -985,16 +984,14 @@ var PersonalizeClient = (props) => {
|
|
|
985
984
|
setIndexesToShow(result.indexes);
|
|
986
985
|
};
|
|
987
986
|
context.events.on("scoresUpdated", handleRunPersonalization);
|
|
988
|
-
context.events.on("quirksUpdated", handleRunPersonalization);
|
|
989
987
|
handleRunPersonalization();
|
|
990
988
|
return () => {
|
|
991
989
|
context.events.off("scoresUpdated", handleRunPersonalization);
|
|
992
|
-
context.events.off("quirksUpdated", handleRunPersonalization);
|
|
993
990
|
};
|
|
994
991
|
}, [props, context]);
|
|
995
992
|
const slotsToShow = indexesToShow.map((key) => {
|
|
996
993
|
var _a;
|
|
997
|
-
return (_a =
|
|
994
|
+
return (_a = slots[import_canvas2.CANVAS_PERSONALIZE_SLOT]) == null ? void 0 : _a.items[key];
|
|
998
995
|
});
|
|
999
996
|
return (0, import_react8.createElement)(import_react8.Fragment, void 0, slotsToShow);
|
|
1000
997
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -720,7 +720,6 @@ defaultData_fn = function() {
|
|
|
720
720
|
controlGroup: (_c = (_b = __privateGet(this, _options).manifest) == null ? void 0 : _b.rollForControlGroup()) != null ? _c : false
|
|
721
721
|
};
|
|
722
722
|
};
|
|
723
|
-
var _personalizationSelectionAlgorithms;
|
|
724
723
|
var _serverTransitionState;
|
|
725
724
|
var _scores;
|
|
726
725
|
var _state;
|
|
@@ -734,7 +733,6 @@ var emitTest_fn;
|
|
|
734
733
|
var updateGoals_fn;
|
|
735
734
|
var updateComputedScores_fn;
|
|
736
735
|
var calculateScores_fn;
|
|
737
|
-
_personalizationSelectionAlgorithms = /* @__PURE__ */ new WeakMap();
|
|
738
736
|
_serverTransitionState = /* @__PURE__ */ new WeakMap();
|
|
739
737
|
_scores = /* @__PURE__ */ new WeakMap();
|
|
740
738
|
_state = /* @__PURE__ */ new WeakMap();
|
|
@@ -945,6 +943,7 @@ import { CANVAS_PERSONALIZE_SLOT } from "@uniformdev/canvas";
|
|
|
945
943
|
import { runPersonalization } from "@uniformdev/canvas-next-rsc-shared";
|
|
946
944
|
import { createElement, Fragment as Fragment3, useEffect as useEffect7, useState as useState6 } from "react";
|
|
947
945
|
var PersonalizeClient = (props) => {
|
|
946
|
+
const { slots } = props;
|
|
948
947
|
const { context } = useUniformContext();
|
|
949
948
|
const [indexesToShow, setIndexesToShow] = useState6(props.indexes);
|
|
950
949
|
useEffect7(() => {
|
|
@@ -959,16 +958,14 @@ var PersonalizeClient = (props) => {
|
|
|
959
958
|
setIndexesToShow(result.indexes);
|
|
960
959
|
};
|
|
961
960
|
context.events.on("scoresUpdated", handleRunPersonalization);
|
|
962
|
-
context.events.on("quirksUpdated", handleRunPersonalization);
|
|
963
961
|
handleRunPersonalization();
|
|
964
962
|
return () => {
|
|
965
963
|
context.events.off("scoresUpdated", handleRunPersonalization);
|
|
966
|
-
context.events.off("quirksUpdated", handleRunPersonalization);
|
|
967
964
|
};
|
|
968
965
|
}, [props, context]);
|
|
969
966
|
const slotsToShow = indexesToShow.map((key) => {
|
|
970
967
|
var _a;
|
|
971
|
-
return (_a =
|
|
968
|
+
return (_a = slots[CANVAS_PERSONALIZE_SLOT]) == null ? void 0 : _a.items[key];
|
|
972
969
|
});
|
|
973
970
|
return createElement(Fragment3, void 0, slotsToShow);
|
|
974
971
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc-client",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.7.1-alpha.4+20185a97ff",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"typescript": "5.7.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@uniformdev/canvas": "20.
|
|
37
|
-
"@uniformdev/canvas-next-rsc-shared": "^20.
|
|
38
|
-
"@uniformdev/canvas-react": "^20.
|
|
36
|
+
"@uniformdev/canvas": "20.7.1-alpha.4+20185a97ff",
|
|
37
|
+
"@uniformdev/canvas-next-rsc-shared": "^20.7.1-alpha.4+20185a97ff",
|
|
38
|
+
"@uniformdev/canvas-react": "^20.7.1-alpha.4+20185a97ff"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": "^18.18.0 || ^19.8.0 || >= 20.0.0"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "20185a97ff6c2de2f871223af12d73583fe300af"
|
|
52
52
|
}
|