@upstash/react-redis-browser 0.2.15 → 0.2.16

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
@@ -4207,10 +4207,14 @@ function parseFieldBuilder(str, fieldName) {
4207
4207
  };
4208
4208
  }
4209
4209
  if (str.startsWith("s.keyword()")) {
4210
- return "KEYWORD";
4210
+ const fromValue = extractFromValue(str);
4211
+ if (fromValue === void 0) return "KEYWORD";
4212
+ return { type: "KEYWORD", from: fromValue };
4211
4213
  }
4212
4214
  if (str.startsWith("s.facet()")) {
4213
- return "FACET";
4215
+ const fromValue = extractFromValue(str);
4216
+ if (fromValue === void 0) return "FACET";
4217
+ return { type: "FACET", from: fromValue };
4214
4218
  }
4215
4219
  if (str.startsWith("s.")) {
4216
4220
  const typeMatch = str.match(/^s\.(\w+)\(/);
@@ -6039,11 +6043,31 @@ declare class DateFieldBuilder<Fast extends Record<"fast", boolean> = {
6039
6043
  from: TFrom["from"];
6040
6044
  } : { type: "DATE" };
6041
6045
  }
6042
- declare class KeywordFieldBuilder {
6043
- [BUILD](): { type: "KEYWORD" };
6046
+ declare class KeywordFieldBuilder<TFrom extends Record<"from", string | null> = {
6047
+ from: null;
6048
+ }> {
6049
+ private _from;
6050
+ constructor(from?: TFrom);
6051
+ from(field: string): KeywordFieldBuilder<{
6052
+ from: string;
6053
+ }>;
6054
+ [BUILD](): TFrom["from"] extends string ? {
6055
+ type: "KEYWORD";
6056
+ from: TFrom["from"];
6057
+ } : { type: "KEYWORD" };
6044
6058
  }
6045
- declare class FacetFieldBuilder {
6046
- [BUILD](): { type: "FACET" };
6059
+ declare class FacetFieldBuilder<TFrom extends Record<"from", string | null> = {
6060
+ from: null;
6061
+ }> {
6062
+ private _from;
6063
+ constructor(from?: TFrom);
6064
+ from(field: string): FacetFieldBuilder<{
6065
+ from: string;
6066
+ }>;
6067
+ [BUILD](): TFrom["from"] extends string ? {
6068
+ type: "FACET";
6069
+ from: TFrom["from"];
6070
+ } : { type: "FACET" };
6047
6071
  }
6048
6072
  type FieldBuilder = TextFieldBuilder<{
6049
6073
  noTokenize: boolean;
@@ -6061,7 +6085,11 @@ type FieldBuilder = TextFieldBuilder<{
6061
6085
  fast: boolean;
6062
6086
  }, {
6063
6087
  from: string | null;
6064
- }> | KeywordFieldBuilder | FacetFieldBuilder;
6088
+ }> | KeywordFieldBuilder<{
6089
+ from: string | null;
6090
+ }> | FacetFieldBuilder<{
6091
+ from: string | null;
6092
+ }>;
6065
6093
  declare const s: {
6066
6094
  string(): TextFieldBuilder;
6067
6095
  number<T extends NumericField["type"] = "F64">(type?: T): NumericFieldBuilder<T>;
@@ -6382,7 +6410,7 @@ var SearchDisplay = ({
6382
6410
  DocsLink,
6383
6411
  {
6384
6412
  className: "absolute bottom-2 right-2 text-sm",
6385
- href: "https://upstash-search.mintlify.app/redis/search/schema-definition"
6413
+ href: "https://upstash.com/docs/redis/search/schema-definition"
6386
6414
  }
6387
6415
  )
6388
6416
  ] }),
@@ -7647,10 +7675,12 @@ export type DateField = {
7647
7675
 
7648
7676
  export type KeywordField = {
7649
7677
  type: "KEYWORD";
7678
+ from?: string;
7650
7679
  };
7651
7680
 
7652
7681
  export type FacetField = {
7653
7682
  type: "FACET";
7683
+ from?: string;
7654
7684
  };
7655
7685
 
7656
7686
  export type DetailedField =
@@ -8638,7 +8668,7 @@ var QueryWizardPopover = ({ onClose }) => {
8638
8668
  ),
8639
8669
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
8640
8670
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs text-zinc-500", children: 'Example: Find people named "John", boost if older than 20.' }),
8641
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DocsLink, { href: "https://upstash-search.mintlify.app/redis/search/query-operators/boolean-operators/overview" })
8671
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DocsLink, { href: "https://upstash.com/docs/redis/search/query-operators/boolean-operators/overview" })
8642
8672
  ] })
8643
8673
  ] })
8644
8674
  ] }),
@@ -9614,7 +9644,7 @@ var SearchEmptyState = () => {
9614
9644
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
9615
9645
  "a",
9616
9646
  {
9617
- href: "https://upstash-search.mintlify.app/redis/search/introduction",
9647
+ href: "https://upstash.com/docs/redis/search/introduction",
9618
9648
  target: "_blank",
9619
9649
  rel: "noopener noreferrer",
9620
9650
  className: "mt-5 inline-block text-sm text-emerald-600 underline-offset-2 hover:underline",
@@ -10452,7 +10482,7 @@ var BoostBadge = ({
10452
10482
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TooltipTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `flex h-full cursor-default items-center px-2 ${labelBg} ${textColor}`, children: isNegative ? "Demote" : "Boost" }) }),
10453
10483
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, TooltipContent, { side: "bottom", className: "max-w-xs", children: [
10454
10484
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: isNegative ? `Multiplies this condition's score by ${_nullishCoalesce(node.boost, () => ( 0))}, subtracting from the total.` : `Multiplies this condition's score by ${_nullishCoalesce(node.boost, () => ( 0))}.` }),
10455
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DocsLink, { href: "https://upstash-search.mintlify.app/redis/search/query-operators/boolean-operators/boost" })
10485
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DocsLink, { href: "https://upstash.com/docs/redis/search/query-operators/boolean-operators/boost" })
10456
10486
  ] })
10457
10487
  ] }),
10458
10488
  isStatic ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `px-2 ${textColor}`, children: node.boost }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex h-full items-center bg-white px-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -11360,7 +11390,7 @@ var InnerGroup = ({
11360
11390
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TooltipTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "ml-2 mt-2 flex h-[26px] w-fit cursor-default select-none items-center rounded-md border border-zinc-300 bg-amber-50 px-2 text-sm font-medium capitalize text-amber-800", children: "Must Not" }) }),
11361
11391
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, TooltipContent, { side: "right", className: "max-w-xs", children: [
11362
11392
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Keys matching any of the conditions below are excluded from the results." }),
11363
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DocsLink, { href: "https://upstash-search.mintlify.app/redis/search/query-operators/boolean-operators/must-not" })
11393
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DocsLink, { href: "https://upstash.com/docs/redis/search/query-operators/boolean-operators/must-not" })
11364
11394
  ] })
11365
11395
  ] }),
11366
11396
  node.children.map(
@@ -11800,7 +11830,7 @@ var QueryBuilderContent = () => {
11800
11830
  DocsLink,
11801
11831
  {
11802
11832
  className: "absolute bottom-2 right-2 text-sm",
11803
- href: "https://upstash-search.mintlify.app/redis/search/query-operators/boolean-operators/overview"
11833
+ href: "https://upstash.com/docs/redis/search/query-operators/boolean-operators/overview"
11804
11834
  }
11805
11835
  )
11806
11836
  ] });
package/dist/index.mjs CHANGED
@@ -4207,10 +4207,14 @@ function parseFieldBuilder(str, fieldName) {
4207
4207
  };
4208
4208
  }
4209
4209
  if (str.startsWith("s.keyword()")) {
4210
- return "KEYWORD";
4210
+ const fromValue = extractFromValue(str);
4211
+ if (fromValue === void 0) return "KEYWORD";
4212
+ return { type: "KEYWORD", from: fromValue };
4211
4213
  }
4212
4214
  if (str.startsWith("s.facet()")) {
4213
- return "FACET";
4215
+ const fromValue = extractFromValue(str);
4216
+ if (fromValue === void 0) return "FACET";
4217
+ return { type: "FACET", from: fromValue };
4214
4218
  }
4215
4219
  if (str.startsWith("s.")) {
4216
4220
  const typeMatch = str.match(/^s\.(\w+)\(/);
@@ -6039,11 +6043,31 @@ declare class DateFieldBuilder<Fast extends Record<"fast", boolean> = {
6039
6043
  from: TFrom["from"];
6040
6044
  } : { type: "DATE" };
6041
6045
  }
6042
- declare class KeywordFieldBuilder {
6043
- [BUILD](): { type: "KEYWORD" };
6046
+ declare class KeywordFieldBuilder<TFrom extends Record<"from", string | null> = {
6047
+ from: null;
6048
+ }> {
6049
+ private _from;
6050
+ constructor(from?: TFrom);
6051
+ from(field: string): KeywordFieldBuilder<{
6052
+ from: string;
6053
+ }>;
6054
+ [BUILD](): TFrom["from"] extends string ? {
6055
+ type: "KEYWORD";
6056
+ from: TFrom["from"];
6057
+ } : { type: "KEYWORD" };
6044
6058
  }
6045
- declare class FacetFieldBuilder {
6046
- [BUILD](): { type: "FACET" };
6059
+ declare class FacetFieldBuilder<TFrom extends Record<"from", string | null> = {
6060
+ from: null;
6061
+ }> {
6062
+ private _from;
6063
+ constructor(from?: TFrom);
6064
+ from(field: string): FacetFieldBuilder<{
6065
+ from: string;
6066
+ }>;
6067
+ [BUILD](): TFrom["from"] extends string ? {
6068
+ type: "FACET";
6069
+ from: TFrom["from"];
6070
+ } : { type: "FACET" };
6047
6071
  }
6048
6072
  type FieldBuilder = TextFieldBuilder<{
6049
6073
  noTokenize: boolean;
@@ -6061,7 +6085,11 @@ type FieldBuilder = TextFieldBuilder<{
6061
6085
  fast: boolean;
6062
6086
  }, {
6063
6087
  from: string | null;
6064
- }> | KeywordFieldBuilder | FacetFieldBuilder;
6088
+ }> | KeywordFieldBuilder<{
6089
+ from: string | null;
6090
+ }> | FacetFieldBuilder<{
6091
+ from: string | null;
6092
+ }>;
6065
6093
  declare const s: {
6066
6094
  string(): TextFieldBuilder;
6067
6095
  number<T extends NumericField["type"] = "F64">(type?: T): NumericFieldBuilder<T>;
@@ -6382,7 +6410,7 @@ var SearchDisplay = ({
6382
6410
  DocsLink,
6383
6411
  {
6384
6412
  className: "absolute bottom-2 right-2 text-sm",
6385
- href: "https://upstash-search.mintlify.app/redis/search/schema-definition"
6413
+ href: "https://upstash.com/docs/redis/search/schema-definition"
6386
6414
  }
6387
6415
  )
6388
6416
  ] }),
@@ -7647,10 +7675,12 @@ export type DateField = {
7647
7675
 
7648
7676
  export type KeywordField = {
7649
7677
  type: "KEYWORD";
7678
+ from?: string;
7650
7679
  };
7651
7680
 
7652
7681
  export type FacetField = {
7653
7682
  type: "FACET";
7683
+ from?: string;
7654
7684
  };
7655
7685
 
7656
7686
  export type DetailedField =
@@ -8638,7 +8668,7 @@ var QueryWizardPopover = ({ onClose }) => {
8638
8668
  ),
8639
8669
  /* @__PURE__ */ jsxs30("div", { children: [
8640
8670
  /* @__PURE__ */ jsx52("span", { className: "text-xs text-zinc-500", children: 'Example: Find people named "John", boost if older than 20.' }),
8641
- /* @__PURE__ */ jsx52(DocsLink, { href: "https://upstash-search.mintlify.app/redis/search/query-operators/boolean-operators/overview" })
8671
+ /* @__PURE__ */ jsx52(DocsLink, { href: "https://upstash.com/docs/redis/search/query-operators/boolean-operators/overview" })
8642
8672
  ] })
8643
8673
  ] })
8644
8674
  ] }),
@@ -9614,7 +9644,7 @@ var SearchEmptyState = () => {
9614
9644
  /* @__PURE__ */ jsx65(
9615
9645
  "a",
9616
9646
  {
9617
- href: "https://upstash-search.mintlify.app/redis/search/introduction",
9647
+ href: "https://upstash.com/docs/redis/search/introduction",
9618
9648
  target: "_blank",
9619
9649
  rel: "noopener noreferrer",
9620
9650
  className: "mt-5 inline-block text-sm text-emerald-600 underline-offset-2 hover:underline",
@@ -10452,7 +10482,7 @@ var BoostBadge = ({
10452
10482
  /* @__PURE__ */ jsx73(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx73("span", { className: `flex h-full cursor-default items-center px-2 ${labelBg} ${textColor}`, children: isNegative ? "Demote" : "Boost" }) }),
10453
10483
  /* @__PURE__ */ jsxs42(TooltipContent, { side: "bottom", className: "max-w-xs", children: [
10454
10484
  /* @__PURE__ */ jsx73("span", { children: isNegative ? `Multiplies this condition's score by ${node.boost ?? 0}, subtracting from the total.` : `Multiplies this condition's score by ${node.boost ?? 0}.` }),
10455
- /* @__PURE__ */ jsx73(DocsLink, { href: "https://upstash-search.mintlify.app/redis/search/query-operators/boolean-operators/boost" })
10485
+ /* @__PURE__ */ jsx73(DocsLink, { href: "https://upstash.com/docs/redis/search/query-operators/boolean-operators/boost" })
10456
10486
  ] })
10457
10487
  ] }),
10458
10488
  isStatic ? /* @__PURE__ */ jsx73("span", { className: `px-2 ${textColor}`, children: node.boost }) : /* @__PURE__ */ jsx73("span", { className: "flex h-full items-center bg-white px-2", children: /* @__PURE__ */ jsx73(
@@ -11360,7 +11390,7 @@ var InnerGroup = ({
11360
11390
  /* @__PURE__ */ jsx81(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx81("div", { className: "ml-2 mt-2 flex h-[26px] w-fit cursor-default select-none items-center rounded-md border border-zinc-300 bg-amber-50 px-2 text-sm font-medium capitalize text-amber-800", children: "Must Not" }) }),
11361
11391
  /* @__PURE__ */ jsxs48(TooltipContent, { side: "right", className: "max-w-xs", children: [
11362
11392
  /* @__PURE__ */ jsx81("span", { children: "Keys matching any of the conditions below are excluded from the results." }),
11363
- /* @__PURE__ */ jsx81(DocsLink, { href: "https://upstash-search.mintlify.app/redis/search/query-operators/boolean-operators/must-not" })
11393
+ /* @__PURE__ */ jsx81(DocsLink, { href: "https://upstash.com/docs/redis/search/query-operators/boolean-operators/must-not" })
11364
11394
  ] })
11365
11395
  ] }),
11366
11396
  node.children.map(
@@ -11800,7 +11830,7 @@ var QueryBuilderContent = () => {
11800
11830
  DocsLink,
11801
11831
  {
11802
11832
  className: "absolute bottom-2 right-2 text-sm",
11803
- href: "https://upstash-search.mintlify.app/redis/search/query-operators/boolean-operators/overview"
11833
+ href: "https://upstash.com/docs/redis/search/query-operators/boolean-operators/overview"
11804
11834
  }
11805
11835
  )
11806
11836
  ] });
package/package.json CHANGED
@@ -1 +1 @@
1
- { "name": "@upstash/react-redis-browser", "version": "0.2.15", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", "private": false, "publishConfig": { "access": "public" }, "repository": { "type": "git", "url": "git@github.com:upstash/react-redis-browser.git" }, "bugs": { "url": "https://github.com/upstash/react-redis-browser/issues" }, "homepage": "https://github.com/upstash/react-redis-browser", "files": [ "./dist/**" ], "scripts": { "build": "tsup", "dev": "vite", "lint": "tsc && eslint", "fmt": "prettier --write ./src", "test": "bun test src", "test:e2e": "playwright test", "prepare": "husky" }, "lint-staged": { "**/*.{js,ts,tsx}": [ "prettier --write", "eslint --fix" ] }, "dependencies": { "@dnd-kit/core": "^6.3.1", "@dnd-kit/modifiers": "^9.0.0", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", "@ianvs/prettier-plugin-sort-imports": "^4.7.1", "@monaco-editor/react": "^4.6.0", "@radix-ui/react-context-menu": "^2.2.16", "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-dropdown-menu": "^2.1.16", "@radix-ui/react-label": "^2.1.8", "@radix-ui/react-popover": "^1.1.15", "@radix-ui/react-portal": "^1.1.10", "@radix-ui/react-progress": "^1.1.8", "@radix-ui/react-scroll-area": "^1.2.10", "@radix-ui/react-select": "^2.2.6", "@radix-ui/react-separator": "^1.1.8", "@radix-ui/react-slot": "^1.2.4", "@radix-ui/react-switch": "^1.2.6", "@radix-ui/react-toast": "^1.2.15", "@radix-ui/react-tooltip": "^1.2.8", "@tabler/icons-react": "^3.19.0", "@tanstack/react-query": "^5.32.0", "@types/bytes": "^3.1.4", "@upstash/redis": "1.37.0-rc.12", "bytes": "^3.1.2", "cmdk": "^1.1.1", "react-hook-form": "^7.53.0", "react-resizable-panels": "^2.1.4", "zustand": "5.0.0" }, "devDependencies": { "@playwright/test": "^1.56.1", "@types/bun": "^1.3.7", "@types/node": "^22.8.4", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@typescript-eslint/eslint-plugin": "8.4.0", "@typescript-eslint/parser": "8.4.0", "@vitejs/plugin-react": "^4.1.0", "autoprefixer": "^10.4.14", "class-variance-authority": "^0.7.0", "clsx": "^2.0.0", "dotenv": "^16.5.0", "eslint": "9.10.0", "eslint-plugin-unicorn": "55.0.0", "husky": "^9.1.7", "lint-staged": "^16.2.7", "postcss": "^8.4.31", "postcss-prefix-selector": "^2.1.0", "prettier": "^3.0.3", "prettier-plugin-tailwindcss": "^0.5.5", "react": "^18.3.1", "react-dom": "^18.3.1", "tailwind-merge": "^2.5.4", "tailwindcss": "^3.4.14", "tailwindcss-animate": "^1.0.7", "tsup": "^8.3.5", "typescript": "^5.0.4", "vite": "^5.4.10", "vite-tsconfig-paths": "^5.0.1" }, "peerDependencies": { "react": "^18.2.0 || ^19", "react-dom": "^18.2.0 || ^19" } }
1
+ { "name": "@upstash/react-redis-browser", "version": "0.2.16", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", "private": false, "publishConfig": { "access": "public" }, "repository": { "type": "git", "url": "git@github.com:upstash/react-redis-browser.git" }, "bugs": { "url": "https://github.com/upstash/react-redis-browser/issues" }, "homepage": "https://github.com/upstash/react-redis-browser", "files": [ "./dist/**" ], "scripts": { "build": "tsup", "dev": "vite", "lint": "tsc && eslint", "fmt": "prettier --write ./src", "test": "bun test src", "test:e2e": "playwright test", "prepare": "husky" }, "lint-staged": { "**/*.{js,ts,tsx}": [ "prettier --write", "eslint --fix" ] }, "dependencies": { "@dnd-kit/core": "^6.3.1", "@dnd-kit/modifiers": "^9.0.0", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", "@ianvs/prettier-plugin-sort-imports": "^4.7.1", "@monaco-editor/react": "^4.6.0", "@radix-ui/react-context-menu": "^2.2.16", "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-dropdown-menu": "^2.1.16", "@radix-ui/react-label": "^2.1.8", "@radix-ui/react-popover": "^1.1.15", "@radix-ui/react-portal": "^1.1.10", "@radix-ui/react-progress": "^1.1.8", "@radix-ui/react-scroll-area": "^1.2.10", "@radix-ui/react-select": "^2.2.6", "@radix-ui/react-separator": "^1.1.8", "@radix-ui/react-slot": "^1.2.4", "@radix-ui/react-switch": "^1.2.6", "@radix-ui/react-toast": "^1.2.15", "@radix-ui/react-tooltip": "^1.2.8", "@tabler/icons-react": "^3.19.0", "@tanstack/react-query": "^5.32.0", "@types/bytes": "^3.1.4", "@upstash/redis": "1.37.0", "bytes": "^3.1.2", "cmdk": "^1.1.1", "react-hook-form": "^7.53.0", "react-resizable-panels": "^2.1.4", "zustand": "5.0.0" }, "devDependencies": { "@playwright/test": "^1.56.1", "@types/bun": "^1.3.7", "@types/node": "^22.8.4", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@typescript-eslint/eslint-plugin": "8.4.0", "@typescript-eslint/parser": "8.4.0", "@vitejs/plugin-react": "^4.1.0", "autoprefixer": "^10.4.14", "class-variance-authority": "^0.7.0", "clsx": "^2.0.0", "dotenv": "^16.5.0", "eslint": "9.10.0", "eslint-plugin-unicorn": "55.0.0", "husky": "^9.1.7", "lint-staged": "^16.2.7", "postcss": "^8.4.31", "postcss-prefix-selector": "^2.1.0", "prettier": "^3.0.3", "prettier-plugin-tailwindcss": "^0.5.5", "react": "^18.3.1", "react-dom": "^18.3.1", "tailwind-merge": "^2.5.4", "tailwindcss": "^3.4.14", "tailwindcss-animate": "^1.0.7", "tsup": "^8.3.5", "typescript": "^5.0.4", "vite": "^5.4.10", "vite-tsconfig-paths": "^5.0.1" }, "peerDependencies": { "react": "^18.2.0 || ^19", "react-dom": "^18.2.0 || ^19" } }