@sanity/personalization-plugin 2.2.0-launch-darkly.1 → 2.3.0-launch-darkly.1
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.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/ExperimentInput.tsx +12 -2
- package/src/fieldExperiments.tsx +5 -1
- package/src/utils/launchDarkly.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -6508,7 +6508,11 @@ const useAddExperimentAction = (props) => {
|
|
|
6508
6508
|
},
|
|
6509
6509
|
[patch, subValues, aditionalChangePath]
|
|
6510
6510
|
);
|
|
6511
|
-
return experiments.length ? /* @__PURE__ */ jsxRuntime.jsx(Select, { ...props, listOptions: formatlistOptions(experiments), handleChange }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.
|
|
6511
|
+
return experiments.length ? /* @__PURE__ */ jsxRuntime.jsx(Select, { ...props, listOptions: formatlistOptions(experiments), handleChange }) : /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { padding: [3, 3, 4], radius: 2, shadow: 1, tone: "caution", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Text, { align: "center", size: [2, 2, 3], children: [
|
|
6512
|
+
"There are no defined ",
|
|
6513
|
+
props.experimentNameOverride,
|
|
6514
|
+
"s"
|
|
6515
|
+
] }) });
|
|
6512
6516
|
}, VariantInput = (props) => {
|
|
6513
6517
|
const defaultValue = sanity.useFormValue([props.path[0], "default"]), handleClick = () => {
|
|
6514
6518
|
props.onChange(sanity.set(defaultValue, ["value"]));
|
|
@@ -6609,7 +6613,14 @@ const createExperimentType = ({
|
|
|
6609
6613
|
name: experimentId,
|
|
6610
6614
|
type: "string",
|
|
6611
6615
|
components: {
|
|
6612
|
-
input: (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6616
|
+
input: (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6617
|
+
ExperimentInput,
|
|
6618
|
+
{
|
|
6619
|
+
...props,
|
|
6620
|
+
experimentNameOverride,
|
|
6621
|
+
variantNameOverride
|
|
6622
|
+
}
|
|
6623
|
+
)
|
|
6613
6624
|
},
|
|
6614
6625
|
hidden: ({ parent }) => !parent?.active
|
|
6615
6626
|
}),
|
|
@@ -6792,7 +6803,7 @@ const createExperimentType = ({
|
|
|
6792
6803
|
label: flag.name,
|
|
6793
6804
|
variants: flag.variations.map((variation) => ({
|
|
6794
6805
|
id: variation.value,
|
|
6795
|
-
label: variation.name
|
|
6806
|
+
label: variation.name ?? variation.value
|
|
6796
6807
|
}))
|
|
6797
6808
|
}));
|
|
6798
6809
|
featureExperiments.push(...experiments), items.length !== limit && (hasMore = !1);
|