@sanity/personalization-plugin
3.1.03.1.1
dist/index.js~
dist/index.jsModified+14−9
Index: package/dist/index.js
===================================================================
--- package/dist/index.js
+++ package/dist/index.js
@@ -1,5 +1,6 @@
-import { i as ArrayItem, n as flattenSchemaType, r as clearChildrenGroups, t as fieldLevelExperiments } from "./fieldExperiments-D9NPbCCN.js";
+import { i as ArrayItem, n as flattenSchemaType, r as clearChildrenGroups, t as fieldLevelExperiments } from "./fieldExperiments-CPrY-K44.js";
+import "@sanity/ui/styles.css";
import { defineDocumentFieldAction, defineField, definePlugin, defineType, isImage, isObjectInputProps, isReference, set, unset, useClient, useFormValue, useWorkspace } from "sanity";
import { c } from "react/compiler-runtime";
import { createContext, useContext, useEffect, useState } from "react";
import { Button, Inline, Stack } from "@sanity/ui";
@@ -346,16 +347,20 @@
segmentNameOverride,
segmentId,
segmentArrayName
}) },
- form: { components: { input: (props) => !(props.id === "root" && isObjectInputProps(props)) || !flattenSchemaType(props.schemaType).some((field) => field.type.name.startsWith(personalizationNameOverride) || field.name.startsWith(personalizationNameOverride)) ? props.renderDefault(props) : /* @__PURE__ */ jsx(PersonalizationProvider, {
- ...props,
- personalizationFieldPluginConfig: {
- ...pluginConfig,
- segmentId,
- segmentArrayName
- }
- }) } }
+ form: { components: { input: (props) => {
+ if (!(props.id === "root" && isObjectInputProps(props)) || !flattenSchemaType(props.schemaType).some((field) => field.type.name.startsWith(personalizationNameOverride) || field.name.startsWith(personalizationNameOverride))) return props.renderDefault(props);
+ let providerProps = {
+ ...props,
+ personalizationFieldPluginConfig: {
+ ...pluginConfig,
+ segmentId,
+ segmentArrayName
+ }
+ };
+ return /* @__PURE__ */ jsx(PersonalizationProvider, { ...providerProps });
+ } } }
};
});
export { fieldLevelExperiments, fieldLevelPersonalization, flattenSchemaType };