@uniformdev/canvas-next-rsc-client 20.8.1 → 20.8.2-alpha.21

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ManifestV2, TestEvent, Quirks, ScoreVector } from '@uniformdev/context';
2
2
  import * as react from 'react';
3
- import { JSX, PropsWithChildren } from 'react';
3
+ import { ReactNode, 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) => JSX.Element | null;
30
+ type ClientContextComponent = (props: ClientContextComponentProps) => ReactNode;
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
- type PersonalizeClientProps = PersonalizeProps & {
55
+ interface PersonalizeClientProps extends 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 { JSX, PropsWithChildren } from 'react';
3
+ import { ReactNode, 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) => JSX.Element | null;
30
+ type ClientContextComponent = (props: ClientContextComponentProps) => ReactNode;
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
- type PersonalizeClientProps = PersonalizeProps & {
55
+ interface PersonalizeClientProps extends 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,6 +720,7 @@ 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;
723
724
  var _serverTransitionState;
724
725
  var _scores;
725
726
  var _state;
@@ -733,6 +734,7 @@ var emitTest_fn;
733
734
  var updateGoals_fn;
734
735
  var updateComputedScores_fn;
735
736
  var calculateScores_fn;
737
+ _personalizationSelectionAlgorithms = /* @__PURE__ */ new WeakMap();
736
738
  _serverTransitionState = /* @__PURE__ */ new WeakMap();
737
739
  _scores = /* @__PURE__ */ new WeakMap();
738
740
  _state = /* @__PURE__ */ new WeakMap();
@@ -943,7 +945,6 @@ import { CANVAS_PERSONALIZE_SLOT } from "@uniformdev/canvas";
943
945
  import { runPersonalization } from "@uniformdev/canvas-next-rsc-shared";
944
946
  import { createElement, Fragment as Fragment3, useEffect as useEffect7, useState as useState6 } from "react";
945
947
  var PersonalizeClient = (props) => {
946
- const { slots } = props;
947
948
  const { context } = useUniformContext();
948
949
  const [indexesToShow, setIndexesToShow] = useState6(props.indexes);
949
950
  useEffect7(() => {
@@ -958,14 +959,16 @@ var PersonalizeClient = (props) => {
958
959
  setIndexesToShow(result.indexes);
959
960
  };
960
961
  context.events.on("scoresUpdated", handleRunPersonalization);
962
+ context.events.on("quirksUpdated", handleRunPersonalization);
961
963
  handleRunPersonalization();
962
964
  return () => {
963
965
  context.events.off("scoresUpdated", handleRunPersonalization);
966
+ context.events.off("quirksUpdated", handleRunPersonalization);
964
967
  };
965
968
  }, [props, context]);
966
969
  const slotsToShow = indexesToShow.map((key) => {
967
970
  var _a;
968
- return (_a = slots[CANVAS_PERSONALIZE_SLOT]) == null ? void 0 : _a.items[key];
971
+ return (_a = props.slots[CANVAS_PERSONALIZE_SLOT]) == null ? void 0 : _a.items[key];
969
972
  });
970
973
  return createElement(Fragment3, void 0, slotsToShow);
971
974
  };
package/dist/index.js CHANGED
@@ -746,6 +746,7 @@ 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;
749
750
  var _serverTransitionState;
750
751
  var _scores;
751
752
  var _state;
@@ -759,6 +760,7 @@ var emitTest_fn;
759
760
  var updateGoals_fn;
760
761
  var updateComputedScores_fn;
761
762
  var calculateScores_fn;
763
+ _personalizationSelectionAlgorithms = /* @__PURE__ */ new WeakMap();
762
764
  _serverTransitionState = /* @__PURE__ */ new WeakMap();
763
765
  _scores = /* @__PURE__ */ new WeakMap();
764
766
  _state = /* @__PURE__ */ new WeakMap();
@@ -969,7 +971,6 @@ var import_canvas2 = require("@uniformdev/canvas");
969
971
  var import_canvas_next_rsc_shared2 = require("@uniformdev/canvas-next-rsc-shared");
970
972
  var import_react8 = require("react");
971
973
  var PersonalizeClient = (props) => {
972
- const { slots } = props;
973
974
  const { context } = useUniformContext();
974
975
  const [indexesToShow, setIndexesToShow] = (0, import_react8.useState)(props.indexes);
975
976
  (0, import_react8.useEffect)(() => {
@@ -984,14 +985,16 @@ var PersonalizeClient = (props) => {
984
985
  setIndexesToShow(result.indexes);
985
986
  };
986
987
  context.events.on("scoresUpdated", handleRunPersonalization);
988
+ context.events.on("quirksUpdated", handleRunPersonalization);
987
989
  handleRunPersonalization();
988
990
  return () => {
989
991
  context.events.off("scoresUpdated", handleRunPersonalization);
992
+ context.events.off("quirksUpdated", handleRunPersonalization);
990
993
  };
991
994
  }, [props, context]);
992
995
  const slotsToShow = indexesToShow.map((key) => {
993
996
  var _a;
994
- return (_a = slots[import_canvas2.CANVAS_PERSONALIZE_SLOT]) == null ? void 0 : _a.items[key];
997
+ return (_a = props.slots[import_canvas2.CANVAS_PERSONALIZE_SLOT]) == null ? void 0 : _a.items[key];
995
998
  });
996
999
  return (0, import_react8.createElement)(import_react8.Fragment, void 0, slotsToShow);
997
1000
  };
package/dist/index.mjs CHANGED
@@ -720,6 +720,7 @@ 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;
723
724
  var _serverTransitionState;
724
725
  var _scores;
725
726
  var _state;
@@ -733,6 +734,7 @@ var emitTest_fn;
733
734
  var updateGoals_fn;
734
735
  var updateComputedScores_fn;
735
736
  var calculateScores_fn;
737
+ _personalizationSelectionAlgorithms = /* @__PURE__ */ new WeakMap();
736
738
  _serverTransitionState = /* @__PURE__ */ new WeakMap();
737
739
  _scores = /* @__PURE__ */ new WeakMap();
738
740
  _state = /* @__PURE__ */ new WeakMap();
@@ -943,7 +945,6 @@ import { CANVAS_PERSONALIZE_SLOT } from "@uniformdev/canvas";
943
945
  import { runPersonalization } from "@uniformdev/canvas-next-rsc-shared";
944
946
  import { createElement, Fragment as Fragment3, useEffect as useEffect7, useState as useState6 } from "react";
945
947
  var PersonalizeClient = (props) => {
946
- const { slots } = props;
947
948
  const { context } = useUniformContext();
948
949
  const [indexesToShow, setIndexesToShow] = useState6(props.indexes);
949
950
  useEffect7(() => {
@@ -958,14 +959,16 @@ var PersonalizeClient = (props) => {
958
959
  setIndexesToShow(result.indexes);
959
960
  };
960
961
  context.events.on("scoresUpdated", handleRunPersonalization);
962
+ context.events.on("quirksUpdated", handleRunPersonalization);
961
963
  handleRunPersonalization();
962
964
  return () => {
963
965
  context.events.off("scoresUpdated", handleRunPersonalization);
966
+ context.events.off("quirksUpdated", handleRunPersonalization);
964
967
  };
965
968
  }, [props, context]);
966
969
  const slotsToShow = indexesToShow.map((key) => {
967
970
  var _a;
968
- return (_a = slots[CANVAS_PERSONALIZE_SLOT]) == null ? void 0 : _a.items[key];
971
+ return (_a = props.slots[CANVAS_PERSONALIZE_SLOT]) == null ? void 0 : _a.items[key];
969
972
  });
970
973
  return createElement(Fragment3, void 0, slotsToShow);
971
974
  };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-next-rsc-client",
3
- "version": "20.8.1",
3
+ "version": "20.8.2-alpha.21+42bfa4ce42",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "scripts": {
6
6
  "build": "tsup",
7
7
  "dev": "tsup --watch",
8
8
  "lint": "eslint \"src/**/*.{ts,tsx}\" --fix",
9
- "test": "jest --maxWorkers=1 --passWithNoTests"
9
+ "test": "jest --maxWorkers=1 --passWithNoTests",
10
+ "document": "api-extractor run --local"
10
11
  },
11
12
  "sideEffects": false,
12
13
  "main": "./dist/index.js",
@@ -33,9 +34,9 @@
33
34
  "typescript": "5.7.2"
34
35
  },
35
36
  "dependencies": {
36
- "@uniformdev/canvas": "20.8.1",
37
- "@uniformdev/canvas-next-rsc-shared": "^20.8.1",
38
- "@uniformdev/canvas-react": "^20.8.1"
37
+ "@uniformdev/canvas": "20.8.2-alpha.21+42bfa4ce42",
38
+ "@uniformdev/canvas-next-rsc-shared": "^20.8.2-alpha.21+42bfa4ce42",
39
+ "@uniformdev/canvas-react": "^20.8.2-alpha.21+42bfa4ce42"
39
40
  },
40
41
  "engines": {
41
42
  "node": "^18.18.0 || ^19.8.0 || >= 20.0.0"
@@ -48,5 +49,5 @@
48
49
  "publishConfig": {
49
50
  "access": "public"
50
51
  },
51
- "gitHead": "7f4a0fc0650b043561f32bedc6c4cc18683df111"
52
+ "gitHead": "42bfa4ce42d4efdd35192096f1d4c23577e6cf2b"
52
53
  }