@sanity/embeddings-index-ui 1.1.3 → 1.1.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.
package/dist/index.js CHANGED
@@ -49,17 +49,19 @@ function FeatureEnabledProvider(props) {
49
49
  function useIsFeatureEnabledContext() {
50
50
  return require$$0.useContext(FeatureEnabledContext);
51
51
  }
52
- function FeatureDisabledNotice() {
52
+ function FeatureDisabledNotice(props) {
53
+ var _a;
54
+ const projectId = sanity.useProjectId();
53
55
  return /* @__PURE__ */jsxRuntime.jsx(ui.Card, {
54
56
  tone: "primary",
55
57
  border: true,
56
- padding: 2,
58
+ padding: 4,
57
59
  children: /* @__PURE__ */jsxRuntime.jsxs(ui.Text, {
58
60
  size: 1,
59
- children: ["Embeddings index APIs are only available on the", " ", /* @__PURE__ */jsxRuntime.jsx("a", {
60
- href: "https://sanity.io/pricing",
61
- children: "Team tier and above"
62
- }), ". Please upgrade to enable access."]
61
+ children: ["\u{1F48E} Unlock semantic search with the Embeddings Index API \u2014 available on Team, Business, and Enterprise plans.", " ", /* @__PURE__ */jsxRuntime.jsx("a", {
62
+ href: "https://www.sanity.io/manage/project/".concat(projectId, "/plan").concat((_a = props.urlSuffix) != null ? _a : ""),
63
+ children: "Upgrade now \u2192"
64
+ })]
63
65
  })
64
66
  });
65
67
  }
@@ -2140,7 +2142,9 @@ function SemanticSearchReferenceInput(props) {
2140
2142
  children: [semantic && featureState == "loading" ? /* @__PURE__ */jsxRuntime.jsx(ui.Box, {
2141
2143
  padding: 2,
2142
2144
  children: /* @__PURE__ */jsxRuntime.jsx(ui.Spinner, {})
2143
- }) : null, semantic && featureState == "disabled" ? /* @__PURE__ */jsxRuntime.jsx(FeatureDisabledNotice, {}) : null, /* @__PURE__ */jsxRuntime.jsx(ui.Box, {
2145
+ }) : null, semantic && featureState == "disabled" ? /* @__PURE__ */jsxRuntime.jsx(FeatureDisabledNotice, {
2146
+ urlSuffix: "?ref=embeddings-ref"
2147
+ }) : null, /* @__PURE__ */jsxRuntime.jsx(ui.Box, {
2144
2148
  flex: 1,
2145
2149
  style: {
2146
2150
  maxHeight: 36,
@@ -2748,10 +2752,15 @@ function IndexStatus(_ref4) {
2748
2752
  function EmbeddingsIndexTool() {
2749
2753
  const featureState = useIsFeatureEnabled();
2750
2754
  return /* @__PURE__ */jsxRuntime.jsx(ui.Card, {
2751
- children: /* @__PURE__ */jsxRuntime.jsx(ui.Flex, {
2755
+ children: /* @__PURE__ */jsxRuntime.jsxs(ui.Flex, {
2752
2756
  justify: "center",
2753
2757
  flex: 1,
2754
- children: /* @__PURE__ */jsxRuntime.jsxs(ui.Card, {
2758
+ children: [featureState == "disabled" ? /* @__PURE__ */jsxRuntime.jsx(ui.Box, {
2759
+ padding: 4,
2760
+ children: /* @__PURE__ */jsxRuntime.jsx(FeatureDisabledNotice, {
2761
+ urlSuffix: "?ref=embeddings-tab"
2762
+ })
2763
+ }) : null, /* @__PURE__ */jsxRuntime.jsxs(ui.Card, {
2755
2764
  flex: 1,
2756
2765
  style: {
2757
2766
  maxWidth: 1200
@@ -2760,8 +2769,8 @@ function EmbeddingsIndexTool() {
2760
2769
  children: [featureState == "loading" ? /* @__PURE__ */jsxRuntime.jsx(ui.Box, {
2761
2770
  padding: 2,
2762
2771
  children: /* @__PURE__ */jsxRuntime.jsx(ui.Spinner, {})
2763
- }) : null, featureState == "disabled" ? /* @__PURE__ */jsxRuntime.jsx(FeatureDisabledNotice, {}) : null, featureState == "enabled" ? /* @__PURE__ */jsxRuntime.jsx(Indexes, {}) : null]
2764
- })
2772
+ }) : null, featureState == "enabled" ? /* @__PURE__ */jsxRuntime.jsx(Indexes, {}) : null]
2773
+ })]
2765
2774
  })
2766
2775
  });
2767
2776
  }