@upstash/react-redis-browser 0.2.11 → 0.2.12-canary

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
@@ -263,15 +263,16 @@ var DatabrowserProvider = ({
263
263
  removeItem: () => {
264
264
  }
265
265
  },
266
- version: 4,
266
+ version: 5,
267
267
  migrate: (originalState, version) => {
268
268
  const state = originalState;
269
269
  if (version <= 1) {
270
270
  state.tabs = state.tabs.map(([id, data]) => [id, { ...data, id }]);
271
271
  }
272
- if (version <= 2) {
272
+ if (version <= 4) {
273
273
  state.tabs = state.tabs.map(([id, data]) => {
274
274
  const oldData = data;
275
+ if (oldData.selectedKeys && Array.isArray(oldData.selectedKeys)) return [id, data];
275
276
  return [
276
277
  id,
277
278
  { ...data, selectedKeys: oldData.selectedKey ? [oldData.selectedKey] : [] }
@@ -5133,7 +5134,13 @@ var handleCopyClick = async (textToCopy) => {
5133
5134
 
5134
5135
  // src/components/databrowser/components/display/input/custom-editor.tsx
5135
5136
 
5136
- var CustomEditor = ({
5137
+ var CustomEditor = (props) => {
5138
+ if (isTest) {
5139
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TestEditor, { ...props });
5140
+ }
5141
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MonacoEditor, { ...props });
5142
+ };
5143
+ var MonacoEditor = ({
5137
5144
  language,
5138
5145
  value,
5139
5146
  onChange,
@@ -5198,7 +5205,26 @@ var CustomEditor = ({
5198
5205
  className: cn("group/editor relative", height === void 0 && "h-full"),
5199
5206
  style: { height },
5200
5207
  children: [
5201
- isTest ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { "aria-label": "editor", value, onChange: (e) => onChange(e.target.value) }) : editor,
5208
+ editor,
5209
+ showCopyButton && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5210
+ CopyButton,
5211
+ {
5212
+ value,
5213
+ className: "absolute right-0 top-0 hidden group-hover/editor:flex"
5214
+ }
5215
+ )
5216
+ ]
5217
+ }
5218
+ );
5219
+ };
5220
+ var TestEditor = ({ value, onChange, height, showCopyButton }) => {
5221
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
5222
+ "div",
5223
+ {
5224
+ className: cn("group/editor relative", height === void 0 && "h-full"),
5225
+ style: { height },
5226
+ children: [
5227
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { "aria-label": "editor", value, onChange: (e) => onChange(e.target.value) }),
5202
5228
  showCopyButton && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5203
5229
  CopyButton,
5204
5230
  {
package/dist/index.mjs CHANGED
@@ -263,15 +263,16 @@ var DatabrowserProvider = ({
263
263
  removeItem: () => {
264
264
  }
265
265
  },
266
- version: 4,
266
+ version: 5,
267
267
  migrate: (originalState, version) => {
268
268
  const state = originalState;
269
269
  if (version <= 1) {
270
270
  state.tabs = state.tabs.map(([id, data]) => [id, { ...data, id }]);
271
271
  }
272
- if (version <= 2) {
272
+ if (version <= 4) {
273
273
  state.tabs = state.tabs.map(([id, data]) => {
274
274
  const oldData = data;
275
+ if (oldData.selectedKeys && Array.isArray(oldData.selectedKeys)) return [id, data];
275
276
  return [
276
277
  id,
277
278
  { ...data, selectedKeys: oldData.selectedKey ? [oldData.selectedKey] : [] }
@@ -5133,7 +5134,13 @@ var handleCopyClick = async (textToCopy) => {
5133
5134
 
5134
5135
  // src/components/databrowser/components/display/input/custom-editor.tsx
5135
5136
  import { jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
5136
- var CustomEditor = ({
5137
+ var CustomEditor = (props) => {
5138
+ if (isTest) {
5139
+ return /* @__PURE__ */ jsx32(TestEditor, { ...props });
5140
+ }
5141
+ return /* @__PURE__ */ jsx32(MonacoEditor, { ...props });
5142
+ };
5143
+ var MonacoEditor = ({
5137
5144
  language,
5138
5145
  value,
5139
5146
  onChange,
@@ -5198,7 +5205,26 @@ var CustomEditor = ({
5198
5205
  className: cn("group/editor relative", height === void 0 && "h-full"),
5199
5206
  style: { height },
5200
5207
  children: [
5201
- isTest ? /* @__PURE__ */ jsx32("input", { "aria-label": "editor", value, onChange: (e) => onChange(e.target.value) }) : editor,
5208
+ editor,
5209
+ showCopyButton && /* @__PURE__ */ jsx32(
5210
+ CopyButton,
5211
+ {
5212
+ value,
5213
+ className: "absolute right-0 top-0 hidden group-hover/editor:flex"
5214
+ }
5215
+ )
5216
+ ]
5217
+ }
5218
+ );
5219
+ };
5220
+ var TestEditor = ({ value, onChange, height, showCopyButton }) => {
5221
+ return /* @__PURE__ */ jsxs19(
5222
+ "div",
5223
+ {
5224
+ className: cn("group/editor relative", height === void 0 && "h-full"),
5225
+ style: { height },
5226
+ children: [
5227
+ /* @__PURE__ */ jsx32("input", { "aria-label": "editor", value, onChange: (e) => onChange(e.target.value) }),
5202
5228
  showCopyButton && /* @__PURE__ */ jsx32(
5203
5229
  CopyButton,
5204
5230
  {
package/package.json CHANGED
@@ -1 +1 @@
1
- { "name": "@upstash/react-redis-browser", "version": "v0.2.11", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", "private": false, "publishConfig": { "access": "public" }, "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" }, "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.4.0", "@monaco-editor/react": "^4.6.0", "@radix-ui/react-alert-dialog": "^1.0.5", "@radix-ui/react-context-menu": "^2.2.2", "@radix-ui/react-dialog": "^1.1.14", "@radix-ui/react-dropdown-menu": "^2.1.15", "@radix-ui/react-label": "^2.1.7", "@radix-ui/react-popover": "^1.0.7", "@radix-ui/react-portal": "^1.1.2", "@radix-ui/react-scroll-area": "^1.0.3", "@radix-ui/react-select": "^2.0.0", "@radix-ui/react-slot": "^1.0.2", "@radix-ui/react-toast": "^1.1.5", "@radix-ui/react-tooltip": "^1.0.7", "@tabler/icons-react": "^3.19.0", "@tanstack/react-query": "^5.32.0", "@types/bytes": "^3.1.4", "@upstash/redis": "^1.35.8", "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/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", "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": "v0.2.12-canary", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", "private": false, "publishConfig": { "access": "public" }, "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" }, "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.4.0", "@monaco-editor/react": "^4.6.0", "@radix-ui/react-alert-dialog": "^1.0.5", "@radix-ui/react-context-menu": "^2.2.2", "@radix-ui/react-dialog": "^1.1.14", "@radix-ui/react-dropdown-menu": "^2.1.15", "@radix-ui/react-label": "^2.1.7", "@radix-ui/react-popover": "^1.0.7", "@radix-ui/react-portal": "^1.1.2", "@radix-ui/react-scroll-area": "^1.0.3", "@radix-ui/react-select": "^2.0.0", "@radix-ui/react-slot": "^1.0.2", "@radix-ui/react-toast": "^1.1.5", "@radix-ui/react-tooltip": "^1.0.7", "@tabler/icons-react": "^3.19.0", "@tanstack/react-query": "^5.32.0", "@types/bytes": "^3.1.4", "@upstash/redis": "^1.35.8", "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/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", "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" } }