tetrons 2.3.55 → 2.3.59

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.
@@ -75,23 +75,8 @@ export default function EditorContent({ apiKey }: EditorContentProps) {
75
75
 
76
76
  const wrapperRef = useRef<HTMLDivElement>(null);
77
77
 
78
- function getApiBaseUrl(): string {
79
- if (
80
- typeof import.meta !== "undefined" &&
81
- import.meta.env?.VITE_TETRONS_API_URL
82
- ) {
83
- return import.meta.env.VITE_TETRONS_API_URL;
84
- }
85
- if (
86
- typeof process !== "undefined" &&
87
- process.env?.NEXT_PUBLIC_TETRONS_API_URL
88
- ) {
89
- return process.env.NEXT_PUBLIC_TETRONS_API_URL;
90
- }
91
- return "https://staging.tetrons.com";
92
- }
93
-
94
- const API_BASE_URL = getApiBaseUrl();
78
+ const API_BASE_URL =
79
+ process.env.NEXT_PUBLIC_TETRONS_API_URL || "https://staging.tetrons.com";
95
80
 
96
81
  useEffect(() => {
97
82
  const validateKey = async () => {
@@ -16829,16 +16829,7 @@ function EditorContent({ apiKey }) {
16829
16829
  null
16830
16830
  );
16831
16831
  const wrapperRef = useRef7(null);
16832
- function getApiBaseUrl() {
16833
- if (typeof import.meta !== "undefined" && import.meta.env?.VITE_TETRONS_API_URL) {
16834
- return import.meta.env.VITE_TETRONS_API_URL;
16835
- }
16836
- if (typeof process !== "undefined" && process.env?.NEXT_PUBLIC_TETRONS_API_URL) {
16837
- return process.env.NEXT_PUBLIC_TETRONS_API_URL;
16838
- }
16839
- return "https://staging.tetrons.com";
16840
- }
16841
- const API_BASE_URL = getApiBaseUrl();
16832
+ const API_BASE_URL = process.env.NEXT_PUBLIC_TETRONS_API_URL || "https://staging.tetrons.com";
16842
16833
  useEffect8(() => {
16843
16834
  const validateKey = async () => {
16844
16835
  try {
@@ -16809,7 +16809,6 @@ function TetronsToolbar({
16809
16809
  }
16810
16810
 
16811
16811
  // src/components/tetrons/EditorContent.tsx
16812
- var import_meta = {};
16813
16812
  var lowlight = (0, import_lowlight.createLowlight)();
16814
16813
  lowlight.register("js", javascript);
16815
16814
  lowlight.register("ts", typescript);
@@ -16823,16 +16822,7 @@ function EditorContent({ apiKey }) {
16823
16822
  null
16824
16823
  );
16825
16824
  const wrapperRef = (0, import_react20.useRef)(null);
16826
- function getApiBaseUrl() {
16827
- if (typeof import_meta !== "undefined" && import_meta.env?.VITE_TETRONS_API_URL) {
16828
- return import_meta.env.VITE_TETRONS_API_URL;
16829
- }
16830
- if (typeof process !== "undefined" && process.env?.NEXT_PUBLIC_TETRONS_API_URL) {
16831
- return process.env.NEXT_PUBLIC_TETRONS_API_URL;
16832
- }
16833
- return "https://staging.tetrons.com";
16834
- }
16835
- const API_BASE_URL = getApiBaseUrl();
16825
+ const API_BASE_URL = process.env.NEXT_PUBLIC_TETRONS_API_URL || "https://staging.tetrons.com";
16836
16826
  (0, import_react20.useEffect)(() => {
16837
16827
  const validateKey = async () => {
16838
16828
  try {
@@ -16829,16 +16829,7 @@ function EditorContent({ apiKey }) {
16829
16829
  null
16830
16830
  );
16831
16831
  const wrapperRef = useRef7(null);
16832
- function getApiBaseUrl() {
16833
- if (typeof import.meta !== "undefined" && import.meta.env?.VITE_TETRONS_API_URL) {
16834
- return import.meta.env.VITE_TETRONS_API_URL;
16835
- }
16836
- if (typeof process !== "undefined" && process.env?.NEXT_PUBLIC_TETRONS_API_URL) {
16837
- return process.env.NEXT_PUBLIC_TETRONS_API_URL;
16838
- }
16839
- return "https://staging.tetrons.com";
16840
- }
16841
- const API_BASE_URL = getApiBaseUrl();
16832
+ const API_BASE_URL = process.env.NEXT_PUBLIC_TETRONS_API_URL || "https://staging.tetrons.com";
16842
16833
  useEffect8(() => {
16843
16834
  const validateKey = async () => {
16844
16835
  try {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "tetrons",
3
- "version": "2.3.55",
3
+ "version": "2.3.59",
4
4
  "description": "A Next.js project written in TypeScript",
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.mjs",
7
- "types": "dist/index.d.ts",
5
+ "main": "./dist/index.node.cjs",
6
+ "module": "./dist/index.node.mjs",
7
+ "types": "./dist/index.d.ts",
8
8
  "scripts": {
9
9
  "dev": "next dev --turbo",
10
10
  "build": "tsup && copyfiles -u 2 src/styles/*.css dist/styles && copyfiles -u 2 src/components/**/*.tsx dist/components",
@@ -75,11 +75,16 @@
75
75
  "license": "MIT",
76
76
  "exports": {
77
77
  ".": {
78
- "import": "./dist/index.mjs",
79
- "require": "./dist/index.cjs",
80
- "browser": "./dist/index.browser.js",
81
- "node": "./dist/index.node.js"
82
- },
78
+ "browser": {
79
+ "import": "./dist/index.browser.js"
80
+ },
81
+ "node": {
82
+ "import": "./dist/index.node.mjs",
83
+ "require": "./dist/index.node.cjs"
84
+ },
85
+ "import": "./dist/index.node.mjs",
86
+ "require": "./dist/index.node.cjs"
87
+ },
83
88
  "./style.css": "./dist/styles/tetrons.css",
84
89
  "./app/api/ai-action/route": {
85
90
  "import": "./dist/app/api/ai-action/route.mjs",