@builder.io/sdk-react 3.0.3-0 → 3.0.5

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.
Files changed (93) hide show
  1. package/lib/browser/blocks-exports.cjs +32 -169
  2. package/lib/browser/blocks-exports.mjs +778 -1199
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +16 -17
  5. package/lib/browser/server-entry-101d66b8.cjs +2 -0
  6. package/lib/browser/{server-entry-da1754bd.js → server-entry-785c0408.js} +237 -279
  7. package/lib/browser/server-entry.cjs +1 -1
  8. package/lib/browser/server-entry.mjs +1 -1
  9. package/lib/edge/{accordion-388f5e60.cjs → accordion-190c4426.cjs} +1 -1
  10. package/lib/edge/{accordion-50de133c.js → accordion-cd6e0363.js} +1 -1
  11. package/lib/edge/{blocks-a5193d52.cjs → blocks-766e8d45.cjs} +9 -9
  12. package/lib/edge/blocks-exports.cjs +1 -1
  13. package/lib/edge/blocks-exports.mjs +12 -13
  14. package/lib/edge/{blocks-5e476ddc.js → blocks-fe2d7c1a.js} +2 -3
  15. package/lib/edge/{button-c6ec3aea.cjs → button-694fcd4f.cjs} +1 -1
  16. package/lib/edge/{button-4261ae64.js → button-6a27481c.js} +2 -2
  17. package/lib/edge/{columns-28e9fb0a.js → columns-90e6407e.js} +18 -18
  18. package/lib/edge/{columns-8c831c02.cjs → columns-b38bf0f7.cjs} +2 -2
  19. package/lib/edge/content-variants-4e385c19.cjs +134 -0
  20. package/lib/edge/{content-variants-36ca4fe5.js → content-variants-cbb89349.js} +124 -165
  21. package/lib/edge/dynamic-blocks-exports.cjs +1 -3
  22. package/lib/edge/dynamic-blocks-exports.mjs +2 -5
  23. package/lib/edge/form-16bbf874.js +166 -0
  24. package/lib/edge/form-547645eb.cjs +1 -0
  25. package/lib/edge/{get-class-prop-name-a86a3e60.cjs → get-class-prop-name-58770197.cjs} +1 -1
  26. package/lib/edge/{get-class-prop-name-65d6824c.js → get-class-prop-name-8b719c6b.js} +1 -1
  27. package/lib/edge/{image-2a2b26d2.js → image-38917f45.js} +22 -24
  28. package/lib/edge/image-590e36ae.cjs +17 -0
  29. package/lib/edge/{img-7de3a3de.cjs → img-8859c851.cjs} +1 -1
  30. package/lib/edge/{img-61d29fb3.js → img-d3351743.js} +1 -1
  31. package/lib/edge/index.cjs +1 -1
  32. package/lib/edge/index.mjs +17 -18
  33. package/lib/edge/{input-c8539054.js → input-24c601b4.js} +1 -1
  34. package/lib/edge/{input-bd5387a6.cjs → input-4fe0fc6d.cjs} +1 -1
  35. package/lib/edge/{select-6b5cda00.js → select-af05377b.js} +1 -1
  36. package/lib/edge/{select-73accaf4.cjs → select-c73bd418.cjs} +1 -1
  37. package/lib/edge/server-entry-3c7fa63a.cjs +2 -0
  38. package/lib/edge/{server-entry-838c1f06.js → server-entry-67bfc740.js} +280 -322
  39. package/lib/edge/server-entry.cjs +1 -1
  40. package/lib/edge/server-entry.mjs +1 -1
  41. package/lib/edge/{slot-403c77da.js → slot-32a4df0c.js} +3 -3
  42. package/lib/edge/{slot-099112f1.cjs → slot-759c8dd9.cjs} +1 -1
  43. package/lib/edge/{symbol-97f456f4.js → symbol-50360a37.js} +2 -2
  44. package/lib/edge/{symbol-ffa6e6cd.cjs → symbol-8d63aa7d.cjs} +1 -1
  45. package/lib/edge/{tabs-a7c94ead.js → tabs-6535c934.js} +3 -3
  46. package/lib/edge/{tabs-ad55c6a7.cjs → tabs-fc6c1700.cjs} +1 -1
  47. package/lib/edge/video-4ecfd08b.cjs +1 -0
  48. package/lib/edge/{video-58c2cc8d.js → video-a3f10439.js} +0 -1
  49. package/lib/node/blocks-exports.cjs +32 -169
  50. package/lib/node/blocks-exports.mjs +896 -1317
  51. package/lib/node/index.cjs +1 -1
  52. package/lib/node/index.mjs +16 -17
  53. package/lib/node/init.cjs +1 -1
  54. package/lib/node/init.mjs +3 -3
  55. package/lib/node/server-entry-95273908.cjs +2 -0
  56. package/lib/node/{server-entry-51bc0b1d.js → server-entry-ffc70868.js} +237 -279
  57. package/lib/node/server-entry.cjs +1 -1
  58. package/lib/node/server-entry.mjs +1 -1
  59. package/lib/node/{setIvm-575cf1f1.js → setIvm-2cea7252.js} +1 -1
  60. package/lib/node/{setIvm-d912cf4d.cjs → setIvm-4ce0db03.cjs} +1 -1
  61. package/lib/node/setIvm.cjs +1 -1
  62. package/lib/node/setIvm.mjs +2 -2
  63. package/lib/node/{should-force-browser-runtime-in-node-66df4856.js → should-force-browser-runtime-in-node-c0d50009.js} +1 -1
  64. package/lib/node/{should-force-browser-runtime-in-node-23225980.cjs → should-force-browser-runtime-in-node-d3e6df07.cjs} +1 -1
  65. package/package.json +2 -2
  66. package/types/blocks/form/form/form.d.ts +1 -0
  67. package/types/constants/sdk-version.d.ts +1 -1
  68. package/types/index-helpers/blocks-exports.d.ts +0 -1
  69. package/types/types/components.d.ts +2 -2
  70. package/types/types/input.d.ts +0 -1
  71. package/lib/browser/server-entry-c7bda8b5.cjs +0 -2
  72. package/lib/edge/content-variants-81713434.cjs +0 -134
  73. package/lib/edge/form-039fb5ff.js +0 -176
  74. package/lib/edge/form-e7a1dec9.cjs +0 -1
  75. package/lib/edge/image-4db81d72.cjs +0 -17
  76. package/lib/edge/personalization-container-3fda6014.cjs +0 -138
  77. package/lib/edge/personalization-container-c76e4fef.js +0 -379
  78. package/lib/edge/server-entry-ea2a8b0e.cjs +0 -2
  79. package/lib/edge/video-e20dcbbc.cjs +0 -1
  80. package/lib/node/server-entry-d7316893.cjs +0 -2
  81. package/types/blocks/index.d.ts +0 -4
  82. package/types/blocks/personalization-container/component-info.d.ts +0 -2
  83. package/types/blocks/personalization-container/helpers/index.d.ts +0 -15
  84. package/types/blocks/personalization-container/helpers/inlined-fns.d.ts +0 -8
  85. package/types/blocks/personalization-container/helpers.d.ts +0 -27
  86. package/types/blocks/personalization-container/index.d.ts +0 -1
  87. package/types/blocks/personalization-container/personalization-container.d.ts +0 -4
  88. package/types/blocks/personalization-container/personalization-container.types.d.ts +0 -14
  89. package/types/blocks/textarea/component-info.d.ts +0 -2
  90. package/types/blocks/textarea/index.d.ts +0 -1
  91. package/types/blocks/textarea/textarea.d.ts +0 -14
  92. package/types/functions/filter-with-custom-targeting.d.ts +0 -15
  93. package/types/helpers/user-attributes.d.ts +0 -17
@@ -1,27 +0,0 @@
1
- import type { BuilderBlock } from '../../types/builder-block';
2
- import type { PersonalizationContainerProps } from './personalization-container.types';
3
- export type UserAttributes = {
4
- date?: string | Date;
5
- urlPath?: string;
6
- [key: string]: any;
7
- };
8
- type QueryOperator = 'is' | 'isNot' | 'contains' | 'startsWith' | 'endsWith' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqualTo' | 'lessThanOrEqualTo';
9
- type QueryValue = string | number | boolean | Array<string | number | boolean>;
10
- export type Query = {
11
- property: string;
12
- operator: QueryOperator;
13
- value: QueryValue;
14
- };
15
- export declare function checkShouldRenderVariants(variants: PersonalizationContainerProps['variants'], canTrack: boolean): boolean;
16
- export declare function getBlocksToRender(options: {
17
- variants: PersonalizationContainerProps['variants'];
18
- previewingIndex?: number | null;
19
- isHydrated: boolean;
20
- filteredVariants: PersonalizationContainerProps['variants'];
21
- fallbackBlocks?: BuilderBlock[];
22
- }): {
23
- blocks: BuilderBlock[];
24
- path: string | undefined;
25
- };
26
- export declare const getPersonalizationScript: (variants: PersonalizationContainerProps['variants'], blockId: string, locale?: string) => string;
27
- export { filterWithCustomTargeting } from './helpers/inlined-fns';
@@ -1 +0,0 @@
1
- export { default } from './personalization-container';
@@ -1,4 +0,0 @@
1
- import * as React from "react";
2
- import type { PersonalizationContainerProps } from "./personalization-container.types";
3
- declare function PersonalizationContainer(props: PersonalizationContainerProps): React.JSX.Element;
4
- export default PersonalizationContainer;
@@ -1,14 +0,0 @@
1
- import type { BuilderBlock } from '../../types/builder-block';
2
- import type { BuilderDataProps } from '../../types/builder-props';
3
- import type { Query } from './helpers';
4
- export type PersonalizationContainerProps = {
5
- children?: any;
6
- attributes?: any;
7
- previewingIndex?: number | null;
8
- variants?: Array<{
9
- blocks: BuilderBlock[];
10
- query: Query[];
11
- startDate?: string;
12
- endDate?: string;
13
- }>;
14
- } & BuilderDataProps;
@@ -1,2 +0,0 @@
1
- import type { ComponentInfo } from '../../types/components';
2
- export declare const componentInfo: ComponentInfo;
@@ -1 +0,0 @@
1
- export { default } from './textarea';
@@ -1,14 +0,0 @@
1
- import * as React from "react";
2
- /**
3
- * This import is used by the Svelte SDK. Do not remove.
4
- */
5
- export interface TextareaProps {
6
- attributes?: any;
7
- name?: string;
8
- value?: string;
9
- defaultValue?: string;
10
- placeholder?: string;
11
- required?: boolean;
12
- }
13
- declare function Textarea(props: TextareaProps): React.JSX.Element;
14
- export default Textarea;
@@ -1,15 +0,0 @@
1
- type UserAttributes = {
2
- date?: string | Date;
3
- urlPath?: string;
4
- [key: string]: any;
5
- };
6
- type QueryOperator = 'is' | 'isNot' | 'contains' | 'startsWith' | 'endsWith' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqualTo' | 'lessThanOrEqualTo';
7
- type QueryValue = string | number | boolean | Array<string | number | boolean>;
8
- export type Query = {
9
- property: string;
10
- operator: QueryOperator;
11
- value: QueryValue;
12
- };
13
- export declare const filterWithCustomTargetingScript = "function filterWithCustomTargeting(e,t,n,r){var i={query:t,startDate:n,endDate:r},o=e.date&&new Date(e.date)||new Date;return!(i.startDate&&new Date(i.startDate)>o)&&(!(i.endDate&&new Date(i.endDate)<o)&&(!i.query||!i.query.length||i.query.every((function(t){return objectMatchesQuery(e,t)}))))}function isString(e){return\"string\"==typeof e}function isNumber(e){return\"number\"==typeof e}function objectMatchesQuery(e,t){return function(){var n=t.property,r=t.operator,i=t.value;if(t&&\"urlPath\"===t.property&&t.value&&\"string\"==typeof t.value&&\"/\"!==t.value&&t.value.endsWith(\"/\")&&(i=t.value.slice(0,-1)),!n||!r)return!0;if(Array.isArray(i))return\"isNot\"===r?i.every((function(t){return objectMatchesQuery(e,{property:n,operator:r,value:t})})):!!i.find((function(t){return objectMatchesQuery(e,{property:n,operator:r,value:t})}));var o=e[n];if(Array.isArray(o))return o.includes(i);switch(r){case\"is\":return o===i;case\"isNot\":return o!==i;case\"contains\":return(isString(o)||Array.isArray(o))&&o.includes(String(i));case\"startsWith\":return isString(o)&&o.startsWith(String(i));case\"endsWith\":return isString(o)&&o.endsWith(String(i));case\"greaterThan\":return isNumber(o)&&isNumber(i)&&o>i;case\"lessThan\":return isNumber(o)&&isNumber(i)&&o<i;case\"greaterThanOrEqualTo\":return isNumber(o)&&isNumber(i)&&o>=i;case\"lessThanOrEqualTo\":return isNumber(o)&&isNumber(i)&&o<=i}return!1}()}";
14
- export declare function filterWithCustomTargeting(userAttributes: UserAttributes, query: Query[], startDate?: string, endDate?: string): boolean;
15
- export {};
@@ -1,17 +0,0 @@
1
- export interface UserAttributes {
2
- [key: string]: any;
3
- }
4
- export declare const USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
5
- export declare function createUserAttributesService(): {
6
- setUserAttributes(newAttrs: UserAttributes): void;
7
- getUserAttributes(): any;
8
- subscribeOnUserAttributesChange(callback: (attrs: UserAttributes) => void): () => void;
9
- setCanTrack(value: boolean): void;
10
- };
11
- export declare const userAttributesService: {
12
- setUserAttributes(newAttrs: UserAttributes): void;
13
- getUserAttributes(): any;
14
- subscribeOnUserAttributesChange(callback: (attrs: UserAttributes) => void): () => void;
15
- setCanTrack(value: boolean): void;
16
- };
17
- export declare const setClientUserAttributes: (attributes: UserAttributes) => void;