@uniformdev/canvas-next-rsc-client 20.49.2 → 20.49.3-alpha.47

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,7 +1,6 @@
1
1
  import { ManifestV2, PersonalizationEvent, TestEvent, CompositionMetadata, Quirks, ScoreVector } from '@uniformdev/context';
2
2
  import * as react from 'react';
3
3
  import { ReactNode, PropsWithChildren } from 'react';
4
- import * as react_jsx_runtime from 'react/jsx-runtime';
5
4
  import { PureContextualEditingComponentWrapperProps } from '@uniformdev/canvas-react/core';
6
5
  import * as _uniformdev_canvas_next_rsc_shared from '@uniformdev/canvas-next-rsc-shared';
7
6
  import { AppDirectoryContextState, ComponentProps, PersonalizeProps, TestProps, CreateUniformContextOptions, AppDirectoryContext } from '@uniformdev/canvas-next-rsc-shared';
@@ -38,12 +37,12 @@ declare const ClientContextTestTransfer: ({ event, ts }: {
38
37
  ts: number;
39
38
  }) => null;
40
39
 
41
- declare const ClientContextualEditingComponentWrapper: (props: PropsWithChildren<PureContextualEditingComponentWrapperProps>) => react_jsx_runtime.JSX.Element;
40
+ declare const ClientContextualEditingComponentWrapper: (props: PropsWithChildren<PureContextualEditingComponentWrapperProps>) => react.JSX.Element;
42
41
 
43
42
  declare const ClientContextUpdate: ({ path, compositionMetadata, }: {
44
43
  path: string;
45
44
  compositionMetadata: CompositionMetadata;
46
- }) => react_jsx_runtime.JSX.Element;
45
+ }) => react.JSX.Element;
47
46
 
48
47
  declare const ContextUpdateTransferClient: ({ update, ts, }: {
49
48
  update: Partial<AppDirectoryContextState>;
@@ -59,12 +58,12 @@ declare const PersonalizeClient: (props: PersonalizeClientProps) => react.Functi
59
58
 
60
59
  declare const TestClient: (props: ComponentProps<TestProps>) => react.FunctionComponentElement<react.FragmentProps> | null;
61
60
 
62
- declare const UniformScript: () => react_jsx_runtime.JSX.Element;
61
+ declare const UniformScript: () => react.JSX.Element;
63
62
 
64
63
  declare const VisibilityRulesWrapperClient: ({ parameter, initialIsVisible, children, }: PropsWithChildren<{
65
64
  parameter: VisibilityParameterValue;
66
65
  initialIsVisible: boolean | null;
67
- }>) => react_jsx_runtime.JSX.Element | null;
66
+ }>) => react.JSX.Element | null;
68
67
 
69
68
  type CreateClientUniformContextOptions = Omit<CreateUniformContextOptions, 'serverCookieValue'>;
70
69
  declare const createClientUniformContext: (options: CreateClientUniformContextOptions) => _uniformdev_canvas_next_rsc_shared.AppDirectoryContextInstance;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { ManifestV2, PersonalizationEvent, TestEvent, CompositionMetadata, Quirks, ScoreVector } from '@uniformdev/context';
2
2
  import * as react from 'react';
3
3
  import { ReactNode, PropsWithChildren } from 'react';
4
- import * as react_jsx_runtime from 'react/jsx-runtime';
5
4
  import { PureContextualEditingComponentWrapperProps } from '@uniformdev/canvas-react/core';
6
5
  import * as _uniformdev_canvas_next_rsc_shared from '@uniformdev/canvas-next-rsc-shared';
7
6
  import { AppDirectoryContextState, ComponentProps, PersonalizeProps, TestProps, CreateUniformContextOptions, AppDirectoryContext } from '@uniformdev/canvas-next-rsc-shared';
@@ -38,12 +37,12 @@ declare const ClientContextTestTransfer: ({ event, ts }: {
38
37
  ts: number;
39
38
  }) => null;
40
39
 
41
- declare const ClientContextualEditingComponentWrapper: (props: PropsWithChildren<PureContextualEditingComponentWrapperProps>) => react_jsx_runtime.JSX.Element;
40
+ declare const ClientContextualEditingComponentWrapper: (props: PropsWithChildren<PureContextualEditingComponentWrapperProps>) => react.JSX.Element;
42
41
 
43
42
  declare const ClientContextUpdate: ({ path, compositionMetadata, }: {
44
43
  path: string;
45
44
  compositionMetadata: CompositionMetadata;
46
- }) => react_jsx_runtime.JSX.Element;
45
+ }) => react.JSX.Element;
47
46
 
48
47
  declare const ContextUpdateTransferClient: ({ update, ts, }: {
49
48
  update: Partial<AppDirectoryContextState>;
@@ -59,12 +58,12 @@ declare const PersonalizeClient: (props: PersonalizeClientProps) => react.Functi
59
58
 
60
59
  declare const TestClient: (props: ComponentProps<TestProps>) => react.FunctionComponentElement<react.FragmentProps> | null;
61
60
 
62
- declare const UniformScript: () => react_jsx_runtime.JSX.Element;
61
+ declare const UniformScript: () => react.JSX.Element;
63
62
 
64
63
  declare const VisibilityRulesWrapperClient: ({ parameter, initialIsVisible, children, }: PropsWithChildren<{
65
64
  parameter: VisibilityParameterValue;
66
65
  initialIsVisible: boolean | null;
67
- }>) => react_jsx_runtime.JSX.Element | null;
66
+ }>) => react.JSX.Element | null;
68
67
 
69
68
  type CreateClientUniformContextOptions = Omit<CreateUniformContextOptions, 'serverCookieValue'>;
70
69
  declare const createClientUniformContext: (options: CreateClientUniformContextOptions) => _uniformdev_canvas_next_rsc_shared.AppDirectoryContextInstance;
package/dist/index.esm.js CHANGED
@@ -689,10 +689,20 @@ calculateScores_fn = function(newData) {
689
689
  return newScores;
690
690
  };
691
691
  var isBrowser = typeof top !== "undefined";
692
+ function isInCrossOriginIframe() {
693
+ if (!isBrowser) {
694
+ return false;
695
+ }
696
+ try {
697
+ return top !== window && !(top == null ? void 0 : top.location.href);
698
+ } catch (e) {
699
+ return true;
700
+ }
701
+ }
692
702
  function enableContextDevTools(options) {
693
703
  return {
694
704
  logDrain: (message) => {
695
- if (!isBrowser) {
705
+ if (!isBrowser || isInCrossOriginIframe()) {
696
706
  return;
697
707
  }
698
708
  top == null ? void 0 : top.postMessage(
@@ -704,6 +714,11 @@ function enableContextDevTools(options) {
704
714
  );
705
715
  },
706
716
  init: (context) => {
717
+ if (isInCrossOriginIframe()) {
718
+ console.info("Uniform Context DevTools disabled in cross-origin iframe");
719
+ return () => {
720
+ };
721
+ }
707
722
  const personalizations = [];
708
723
  const tests = [];
709
724
  const onContextDataUpdated = () => {
package/dist/index.js CHANGED
@@ -221,8 +221,8 @@ var require_rfdc = __commonJS({
221
221
  });
222
222
 
223
223
  // src/index.ts
224
- var src_exports = {};
225
- __export(src_exports, {
224
+ var index_exports = {};
225
+ __export(index_exports, {
226
226
  ClientContextPersonalizationTransfer: () => ClientContextPersonalizationTransfer,
227
227
  ClientContextTestTransfer: () => ClientContextTestTransfer,
228
228
  ClientContextUpdate: () => ClientContextUpdate,
@@ -240,7 +240,7 @@ __export(src_exports, {
240
240
  useUniformContext: () => useUniformContext,
241
241
  useUniformContextualEditingState: () => useUniformContextualEditingState
242
242
  });
243
- module.exports = __toCommonJS(src_exports);
243
+ module.exports = __toCommonJS(index_exports);
244
244
 
245
245
  // src/components/ClientContextPersonalizationTransfer.tsx
246
246
  var import_react2 = require("react");
@@ -715,10 +715,20 @@ calculateScores_fn = function(newData) {
715
715
  return newScores;
716
716
  };
717
717
  var isBrowser = typeof top !== "undefined";
718
+ function isInCrossOriginIframe() {
719
+ if (!isBrowser) {
720
+ return false;
721
+ }
722
+ try {
723
+ return top !== window && !(top == null ? void 0 : top.location.href);
724
+ } catch (e) {
725
+ return true;
726
+ }
727
+ }
718
728
  function enableContextDevTools(options) {
719
729
  return {
720
730
  logDrain: (message) => {
721
- if (!isBrowser) {
731
+ if (!isBrowser || isInCrossOriginIframe()) {
722
732
  return;
723
733
  }
724
734
  top == null ? void 0 : top.postMessage(
@@ -730,6 +740,11 @@ function enableContextDevTools(options) {
730
740
  );
731
741
  },
732
742
  init: (context) => {
743
+ if (isInCrossOriginIframe()) {
744
+ console.info("Uniform Context DevTools disabled in cross-origin iframe");
745
+ return () => {
746
+ };
747
+ }
733
748
  const personalizations = [];
734
749
  const tests = [];
735
750
  const onContextDataUpdated = () => {
package/dist/index.mjs CHANGED
@@ -689,10 +689,20 @@ calculateScores_fn = function(newData) {
689
689
  return newScores;
690
690
  };
691
691
  var isBrowser = typeof top !== "undefined";
692
+ function isInCrossOriginIframe() {
693
+ if (!isBrowser) {
694
+ return false;
695
+ }
696
+ try {
697
+ return top !== window && !(top == null ? void 0 : top.location.href);
698
+ } catch (e) {
699
+ return true;
700
+ }
701
+ }
692
702
  function enableContextDevTools(options) {
693
703
  return {
694
704
  logDrain: (message) => {
695
- if (!isBrowser) {
705
+ if (!isBrowser || isInCrossOriginIframe()) {
696
706
  return;
697
707
  }
698
708
  top == null ? void 0 : top.postMessage(
@@ -704,6 +714,11 @@ function enableContextDevTools(options) {
704
714
  );
705
715
  },
706
716
  init: (context) => {
717
+ if (isInCrossOriginIframe()) {
718
+ console.info("Uniform Context DevTools disabled in cross-origin iframe");
719
+ return () => {
720
+ };
721
+ }
707
722
  const personalizations = [];
708
723
  const tests = [];
709
724
  const onContextDataUpdated = () => {
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-next-rsc-client",
3
- "version": "20.49.2",
3
+ "version": "20.49.3-alpha.47+9aed70a64d",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "scripts": {
6
6
  "build": "tsup",
7
7
  "dev": "tsup --watch",
8
- "lint": "eslint \"src/**/*.{ts,tsx}\" --fix",
9
- "document": "api-extractor run --local"
8
+ "clean": "rimraf dist",
9
+ "format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
10
+ "apidocs-extract": "api-extractor run --local"
10
11
  },
11
12
  "sideEffects": false,
12
13
  "main": "./dist/index.js",
@@ -25,18 +26,18 @@
25
26
  ],
26
27
  "devDependencies": {
27
28
  "@types/js-cookie": "3.0.6",
28
- "@types/node": "24.3.1",
29
- "@types/react": "19.2.2",
30
- "next": "15.2.5",
29
+ "@types/node": "26.0.0",
30
+ "@types/react": "19.2.17",
31
+ "next": "15.5.19",
31
32
  "react": "19.2.1",
32
33
  "react-dom": "19.2.1",
33
- "typescript": "5.9.2"
34
+ "typescript": "6.0.3"
34
35
  },
35
36
  "dependencies": {
36
- "@uniformdev/canvas": "20.49.2",
37
- "@uniformdev/canvas-next-rsc-shared": "20.49.2",
38
- "@uniformdev/canvas-react": "20.49.2",
39
- "js-cookie": "3.0.5"
37
+ "@uniformdev/canvas": "20.49.3-alpha.47+9aed70a64d",
38
+ "@uniformdev/canvas-next-rsc-shared": "20.49.3-alpha.47+9aed70a64d",
39
+ "@uniformdev/canvas-react": "20.49.3-alpha.47+9aed70a64d",
40
+ "js-cookie": "3.0.8"
40
41
  },
41
42
  "engines": {
42
43
  "node": "^18.18.0 || ^19.8.0 || >= 20.0.0"
@@ -49,5 +50,5 @@
49
50
  "publishConfig": {
50
51
  "access": "public"
51
52
  },
52
- "gitHead": "6236dd13bff34cc8ec526d2e93e344428c1c9541"
53
+ "gitHead": "9aed70a64de0ca177d27ea99dc25f1ad053f87ad"
53
54
  }