From 677e6bb7d2897cdc7747cf937f0bb82b632bd017 Mon Sep 17 00:00:00 2001 From: jk021227 Date: Wed, 12 Feb 2025 15:12:09 +0400 Subject: [PATCH 1/4] {commit_message} --- app/projects/[theme]/[...slug]/page.tsx | 67 ++++-- content/projects/aura-points-calculator.mdx | 141 +++++++---- package-lock.json | 249 +++++++++----------- 3 files changed, 251 insertions(+), 206 deletions(-) diff --git a/app/projects/[theme]/[...slug]/page.tsx b/app/projects/[theme]/[...slug]/page.tsx index 69fa851..e9dd65f 100644 --- a/app/projects/[theme]/[...slug]/page.tsx +++ b/app/projects/[theme]/[...slug]/page.tsx @@ -1,3 +1,5 @@ +'use client' + import { projects } from '#site/content' import { notFound } from 'next/navigation' import { MDXContent } from '@/components/mdx-components' @@ -8,6 +10,7 @@ import PythonResizableCodeEditor from '@/components/code-resizable-executor' import { getExerciseById } from '@/lib/projects/utils' import { ProjectStatus } from '@/components/projects/project-status' import '@/styles/mdx-style.css' +import { useState, useEffect } from 'react' interface PostPageProps { params: { @@ -15,6 +18,7 @@ interface PostPageProps { } } +// Modified function to fetch post data based on params async function getPostFromParams(params: PostPageProps['params']) { const slug = params?.slug?.join('/') const post = projects.find((post) => post.slugAsParams === slug) @@ -22,25 +26,43 @@ async function getPostFromParams(params: PostPageProps['params']) { return post } -// if slug is same as slugAsParams of one of the pages -export async function generateStaticParams(): Promise< - { slug: string[]; revalidate?: number }[] -> { - return projects.map((post) => ({ - slug: post.slugAsParams.split('/'), - revalidate: 7200, - })) -} +// No need for generateStaticParams anymore, dynamic rendering on demand +export default function ProjectPage({ params }: PostPageProps) { + const [post, setPost] = useState(null) + const [exercise, setExercise] = useState(null) + const [currentStep, setCurrentStep] = useState(0) -export default async function ProjectPage({ params }: PostPageProps) { - const post = await getPostFromParams(params) - const fullLinkGenerated = `${siteConfig.url}/projects/${post?.theme.trim().replace("", '-')}/${params?.slug?.join('/')}` - const exercise = getExerciseById(post!.id) + useEffect(() => { + const fetchData = async () => { + const fetchedPost = await getPostFromParams(params) + + if (!fetchedPost || !fetchedPost.published) { + notFound() + } + + setPost(fetchedPost) + console.log(fetchedPost.body) // Log the post body content + + // Fetch exercise data after post data is loaded + if (fetchedPost) { + const fetchedExercise = getExerciseById(fetchedPost.id) + setExercise(fetchedExercise) + } + } - if (!post || !post.published) { - notFound() + fetchData() + }, [params]) // Depend on params to refetch when they change + + const handleNextStep = () => { + setCurrentStep((prevStep) => prevStep + 1) + } + + if (!post) { + return
Loading...
// Optional loading state } + const fullLinkGenerated = `${siteConfig.url}/projects/${post?.theme.trim().replace("", '-')}/${params?.slug?.join('/')}` + return (
{/* Navigation bar */} @@ -53,7 +75,6 @@ export default async function ProjectPage({ params }: PostPageProps) { {/* Split screen container */}
- {' '} {/* Left side - Tutorial content */}
@@ -65,18 +86,22 @@ export default async function ProjectPage({ params }: PostPageProps) {
{post.description && ( -

+

{post.description}

)}
- + {/*
*/} + + {/*
*/} + {/* */}
{/* Right side - Code editor */} -
- {' '} +
{exercise && (
) -} \ No newline at end of file +} diff --git a/content/projects/aura-points-calculator.mdx b/content/projects/aura-points-calculator.mdx index 9915a9f..8ca2ede 100644 --- a/content/projects/aura-points-calculator.mdx +++ b/content/projects/aura-points-calculator.mdx @@ -25,60 +25,115 @@ You'll build a calculator that: - Understanding of classes and methods - Familiarity with lists and dictionaries -## Getting Started -First, let's create the basic structure for our Character class: +## Getting Started +### 1. Let's create the basic structure for our `Character` class: + +Before adding game mechanics, we need a foundational class to represent our characters. Each character will have: + + +- A `name` to identify them. +- A `base_aura`, which is their starting aura level (default is 100). +- A `current_aura` that tracks their aura as it changes during the game. +- Two lists, `buffs` and `debuffs`, to store any temporary effects that strengthen or weaken the character. + +Here's how it should look start like: ```python class Character: def __init__(self, name, base_aura=100): self.name = name - self.base_aura = base_aura - self.current_aura = base_aura - self.buffs = [] - self.debuffs = [] + . + . + . +``` + +### 2. Adding Buffs and Debuffs + +Now that we have a basic `Character` class, let's add functionality to apply buffs (power-ups) and debuffs (power-downs) that modify a character's aura. + +#### 2.1 Adding Buffs + +Buffs increase the character’s aura. The `add_buff` method: +- Takes a `name` and a `power_increase` value. +- Appends the `name` and the `power_increase` as a set to the `buffs` list. +- Recalculates the character’s current aura. + +```python +def add_buff(self, name, power_increase): + """Add a power-up buff to the character""" + . + . + . +``` + +#### 2.2 Adding Debuffs + +Debuffs decrease the character’s aura. The `add_debuff` method: +- Takes a `name` and a `power_decrease` value. +- Adds the` name` and `power_decrease` as a set to the `debuffs` list. +- Recalculates the character’s current aura. + +```python +def add_debuff(self, name, power_decrease): + """Add a power-down debuff to the character""" + . + . + . +``` + +### 3. Calculating Aura + +Every time a buff or debuff is applied, the aura needs to be recalculated. The `calculate_current_aura` method: +- Starts with the `base_aura` value. +- Adds all buff effects. +- Subtracts all debuff effects. +- Ensures the aura never goes below 0. + +```python +def calculate_current_aura(self): + """Calculate total aura points including buffs and debuffs""" + total = self.base_aura - def add_buff(self, name, power_increase): - """Add a power-up buff to the character""" - self.buffs.append({"name": name, "power": power_increase}) - self.calculate_current_aura() + # Add all buff effects + for buff in self.buffs: + . + . + . + + # Subtract all debuff effects + for debuff in self.debuffs: + . + . + . - def add_debuff(self, name, power_decrease): - """Add a power-down debuff to the character""" - self.debuffs.append({"name": name, "power": power_decrease}) - self.calculate_current_aura() + # Ensure aura doesn't go below 0 + self.current_aura = max(0, total) + return self.current_aura +``` + +### 4. Displaying Character Status + +To check a character’s current aura, buffs, and debuffs, we add the `display_status` method: +- Prints the base and current aura. +- Lists active buffs and debuffs (if any). + +```python +def display_status(self): + """Display character's current status""" + print(f"\nCharacter Status: ") + print("=" * 30) + print(f"Base Aura: ") + print(f"Current Aura: ") - def calculate_current_aura(self): - """Calculate total aura points including buffs and debuffs""" - total = self.base_aura - - # Add all buff effects + if self.buffs: + print("\nActive Buffs:") for buff in self.buffs: - total += buff["power"] + print(f"- {?}: + {?}") - # Subtract all debuff effects + if self.debuffs: + print("\nActive Debuffs:") for debuff in self.debuffs: - total -= debuff["power"] - - # Ensure aura doesn't go below 0 - self.current_aura = max(0, total) - return self.current_aura - - def display_status(self): - """Display character's current status""" - print(f"\nCharacter Status: {self.name}") - print("=" * 30) - print(f"Base Aura: {self.base_aura}") - print(f"Current Aura: {self.current_aura}") - - if self.buffs: - print("\nActive Buffs:") - for buff in self.buffs: - print(f"- {buff['name']}: +{buff['power']}") - - if self.debuffs: - print("\nActive Debuffs:") - for debuff in self.debuffs: - print(f"- {debuff['name']}: -{debuff['power']}") + print(f"- {?}: -{?}") ``` ## Visual Representation diff --git a/package-lock.json b/package-lock.json index c9a06bc..5f7b8d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -95,7 +95,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", - "dev": true, "engines": { "node": ">=10" }, @@ -250,7 +249,7 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, + "devOptional": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -262,7 +261,7 @@ "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, + "devOptional": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -1956,7 +1955,6 @@ "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -1973,7 +1971,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, "engines": { "node": ">=12" }, @@ -1985,7 +1982,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, @@ -2000,7 +1996,6 @@ "version": "0.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dev": true, "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -2014,7 +2009,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, "engines": { "node": ">=6.0.0" } @@ -2023,7 +2017,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true, "engines": { "node": ">=6.0.0" } @@ -2042,14 +2035,12 @@ "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -2358,7 +2349,6 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -2371,7 +2361,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, "engines": { "node": ">= 8" } @@ -2380,7 +2369,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -2421,7 +2409,6 @@ "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, "optional": true, "engines": { "node": ">=14" @@ -4667,25 +4654,25 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", - "dev": true + "devOptional": true }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true + "devOptional": true }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true + "devOptional": true }, "node_modules/@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true + "devOptional": true }, "node_modules/@types/acorn": { "version": "4.0.6", @@ -4867,8 +4854,7 @@ "node_modules/@types/prop-types": { "version": "15.7.13", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.13.tgz", - "integrity": "sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==", - "dev": true + "integrity": "sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==" }, "node_modules/@types/qs": { "version": "6.9.16", @@ -4884,7 +4870,6 @@ "version": "18.3.7", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.7.tgz", "integrity": "sha512-KUnDCJF5+AiZd8owLIeVHqmW9yM4sqmDVf2JRJiBMFkGvkoZ4/WyV2lL4zVsoinmRS/W3FeEdZLEWFRofnT2FQ==", - "dev": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.0.2" @@ -4894,7 +4879,7 @@ "version": "18.3.0", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.0.tgz", "integrity": "sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==", - "dev": true, + "devOptional": true, "dependencies": { "@types/react": "*" } @@ -5332,7 +5317,7 @@ "version": "8.3.4", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", - "dev": true, + "devOptional": true, "dependencies": { "acorn": "^8.11.0" }, @@ -5390,14 +5375,12 @@ "node_modules/any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", - "dev": true + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -5409,8 +5392,7 @@ "node_modules/arg": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", - "dev": true + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==" }, "node_modules/argparse": { "version": "2.0.1", @@ -5693,8 +5675,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/base64-js": { "version": "1.5.1", @@ -5744,7 +5725,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "dev": true, "engines": { "node": ">=8" }, @@ -5808,7 +5788,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -5886,7 +5865,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", - "dev": true, "engines": { "node": ">= 6" } @@ -5985,7 +5963,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dev": true, "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -6009,7 +5986,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -6193,7 +6169,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true, "engines": { "node": ">= 6" } @@ -6294,7 +6269,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true + "devOptional": true }, "node_modules/crelt": { "version": "1.0.6", @@ -6306,7 +6281,6 @@ "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -6331,8 +6305,7 @@ "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", - "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "dev": true + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/damerau-levenshtein": { "version": "1.0.8", @@ -6557,14 +6530,13 @@ "node_modules/didyoumean": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", - "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", - "dev": true + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==" }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.3.1" } @@ -6572,8 +6544,7 @@ "node_modules/dlv": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", - "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", - "dev": true + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==" }, "node_modules/doctrine": { "version": "3.0.0", @@ -6612,8 +6583,7 @@ "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", @@ -6632,8 +6602,7 @@ "node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "node_modules/emoji-regex-xs": { "version": "1.0.0", @@ -7635,7 +7604,6 @@ "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -7651,7 +7619,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -7698,7 +7665,6 @@ "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dev": true, "dependencies": { "reusify": "^1.0.4" } @@ -7744,7 +7710,6 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -7919,7 +7884,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", - "dev": true, "dependencies": { "cross-spawn": "^7.0.0", "signal-exit": "^4.0.1" @@ -8008,7 +7972,6 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -8090,16 +8053,64 @@ } }, "node_modules/gcp-metadata": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.0.tgz", - "integrity": "sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz", + "integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==", "license": "Apache-2.0", + "optional": true, + "peer": true, "dependencies": { - "gaxios": "^6.0.0", + "gaxios": "^5.0.0", "json-bigint": "^1.0.0" }, "engines": { - "node": ">=14" + "node": ">=12" + } + }, + "node_modules/gcp-metadata/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/gcp-metadata/node_modules/gaxios": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.1.3.tgz", + "integrity": "sha512-95hVgBRgEIRQQQHIbnxBXeHbW4TqFk4ZDJW7wmVtvYar72FdhRIo1UGOLS2eRAKCPEdPBWu+M7+A33D9CdX9rA==", + "license": "Apache-2.0", + "optional": true, + "peer": true, + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/gcp-metadata/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" } }, "node_modules/get-caller-file": { @@ -8176,7 +8187,6 @@ "version": "10.3.10", "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", - "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^2.3.5", @@ -8198,7 +8208,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, "dependencies": { "is-glob": "^4.0.3" }, @@ -8210,7 +8219,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -8219,7 +8227,6 @@ "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -8278,6 +8285,19 @@ "node": ">=14" } }, + "node_modules/google-auth-library/node_modules/gcp-metadata": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.0.tgz", + "integrity": "sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==", + "license": "Apache-2.0", + "dependencies": { + "gaxios": "^6.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/google-auth-library/node_modules/jwa": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", @@ -9003,7 +9023,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, "dependencies": { "binary-extensions": "^2.0.0" }, @@ -9051,7 +9070,6 @@ "version": "2.15.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", - "dev": true, "dependencies": { "hasown": "^2.0.2" }, @@ -9106,7 +9124,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -9149,7 +9166,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -9211,7 +9227,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } @@ -9400,8 +9415,7 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/iterator.prototype": { "version": "1.1.2", @@ -9420,7 +9434,6 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", - "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -9438,7 +9451,6 @@ "version": "1.21.6", "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz", "integrity": "sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==", - "dev": true, "bin": { "jiti": "bin/jiti.js" } @@ -9636,7 +9648,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", - "dev": true, "engines": { "node": ">=10" } @@ -9649,8 +9660,7 @@ "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" }, "node_modules/locate-path": { "version": "6.0.0", @@ -9782,8 +9792,7 @@ "node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" }, "node_modules/lru-memoizer": { "version": "2.3.0", @@ -9819,7 +9828,7 @@ "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true + "devOptional": true }, "node_modules/markdown-extensions": { "version": "2.0.0", @@ -10167,7 +10176,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, "engines": { "node": ">= 8" } @@ -10903,7 +10911,6 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -10967,7 +10974,6 @@ "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, "engines": { "node": ">=16 || 14 >=14.17" } @@ -10984,6 +10990,13 @@ "node": ">=10" } }, + "node_modules/monaco-editor": { + "version": "0.52.2", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.52.2.tgz", + "integrity": "sha512-GEQWEZmfkOGLdd3XK8ryrfWz3AIP8YymVXiPHEdewrUq7mh0qrKrfHLNCXcbB6sTnMLnOZ3ztSiKcciFUkIJwQ==", + "license": "MIT", + "peer": true + }, "node_modules/mongodb": { "version": "6.9.0", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.9.0.tgz", @@ -11088,7 +11101,6 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dev": true, "dependencies": { "any-promise": "^1.0.0", "object-assign": "^4.0.1", @@ -11406,7 +11418,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -11429,7 +11440,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", - "devOptional": true, "engines": { "node": ">= 6" } @@ -11765,7 +11775,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "engines": { "node": ">=8" } @@ -11773,14 +11782,12 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-scurry": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -11807,7 +11814,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, @@ -11819,7 +11825,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -11828,7 +11833,6 @@ "version": "4.0.6", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", - "dev": true, "engines": { "node": ">= 6" } @@ -11845,7 +11849,6 @@ "version": "8.4.47", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", - "dev": true, "funding": [ { "type": "opencollective", @@ -11873,7 +11876,6 @@ "version": "15.1.0", "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", - "dev": true, "dependencies": { "postcss-value-parser": "^4.0.0", "read-cache": "^1.0.0", @@ -11890,7 +11892,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.0.1.tgz", "integrity": "sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==", - "dev": true, "dependencies": { "camelcase-css": "^2.0.1" }, @@ -11909,7 +11910,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz", "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", - "dev": true, "funding": [ { "type": "opencollective", @@ -11944,7 +11944,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==", - "dev": true, "engines": { "node": ">=14" }, @@ -11956,7 +11955,6 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", - "dev": true, "funding": [ { "type": "opencollective", @@ -11981,7 +11979,6 @@ "version": "6.1.2", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", - "dev": true, "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -11993,14 +11990,12 @@ "node_modules/postcss-value-parser": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "dev": true + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "node_modules/postcss/node_modules/nanoid": { "version": "3.3.8", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", - "dev": true, "funding": [ { "type": "github", @@ -12162,7 +12157,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, "funding": [ { "type": "github", @@ -12405,7 +12399,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", - "dev": true, "dependencies": { "pify": "^2.3.0" } @@ -12429,7 +12422,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, "dependencies": { "picomatch": "^2.2.1" }, @@ -12939,7 +12931,6 @@ "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -12999,7 +12990,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -13046,7 +13036,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "funding": [ { "type": "github", @@ -13290,7 +13279,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -13302,7 +13290,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } @@ -13354,7 +13341,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, "engines": { "node": ">=14" }, @@ -13552,7 +13538,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -13570,7 +13555,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -13583,14 +13567,12 @@ "node_modules/string-width-cjs/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/string-width/node_modules/ansi-regex": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, "engines": { "node": ">=12" }, @@ -13602,7 +13584,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, @@ -13738,7 +13719,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -13822,7 +13802,6 @@ "version": "3.35.0", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", "integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==", - "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.2", "commander": "^4.0.0", @@ -13855,7 +13834,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -13889,7 +13867,6 @@ "version": "3.4.12", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.12.tgz", "integrity": "sha512-Htf/gHj2+soPb9UayUNci/Ja3d8pTmu9ONTfh4QY8r3MATTZOzmv6UYWF7ZwikEIC8okpfqmGqrmDehua8mF8w==", - "dev": true, "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", @@ -14034,7 +14011,6 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "dev": true, "dependencies": { "any-promise": "^1.0.0" } @@ -14043,7 +14019,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", - "dev": true, "dependencies": { "thenify": ">= 3.1.0 < 4" }, @@ -14055,7 +14030,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -14134,14 +14108,13 @@ "node_modules/ts-interface-checker": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", - "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", - "dev": true + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" }, "node_modules/ts-node": { "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", - "dev": true, + "devOptional": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -14252,7 +14225,7 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true + "devOptional": true }, "node_modules/tsconfig": { "version": "7.0.0", @@ -14405,7 +14378,7 @@ "version": "5.6.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", - "dev": true, + "devOptional": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -14695,7 +14668,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "devOptional": true }, "node_modules/vary": { "version": "1.1.2", @@ -14843,7 +14816,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -14945,7 +14917,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -14963,7 +14934,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -14979,14 +14949,12 @@ "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/wrap-ansi-cjs/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -15000,7 +14968,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, "engines": { "node": ">=12" }, @@ -15012,7 +14979,6 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, "engines": { "node": ">=12" }, @@ -15024,7 +14990,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, @@ -15154,7 +15119,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, + "devOptional": true, "engines": { "node": ">=6" } From 2bfbb9e94ccb631343642b7862a254b17c324788 Mon Sep 17 00:00:00 2001 From: jk021227 Date: Thu, 13 Feb 2025 16:50:30 +0400 Subject: [PATCH 2/4] unlock blur demo --- app/projects/[theme]/[...slug]/page.tsx | 164 ++++++++++++--- content/projects/aura-points-calculator.mdx | 220 +------------------- public/projects/aura-points-calculator.json | 141 +++++++++++++ 3 files changed, 272 insertions(+), 253 deletions(-) create mode 100644 public/projects/aura-points-calculator.json diff --git a/app/projects/[theme]/[...slug]/page.tsx b/app/projects/[theme]/[...slug]/page.tsx index e9dd65f..22bfbb9 100644 --- a/app/projects/[theme]/[...slug]/page.tsx +++ b/app/projects/[theme]/[...slug]/page.tsx @@ -18,50 +18,143 @@ interface PostPageProps { } } -// Modified function to fetch post data based on params +// --- Section Component --- +// Renders each JSON section with an Unlock button overlay. +// The section content is initially blurred until the user clicks "Unlock". +function Section({ item, index }: { item: any; index: number }) { + const [unlocked, setUnlocked] = useState(index === 0); + + return ( +
+ {index !== 0 &&
} + {/* Wrap section content in a container that is blurred if not unlocked */} +
+ {item.title && ( +

+ {item.title} +

+ )} + {item.description && ( +

+ {item.description} +

+ )} + {item.features && Array.isArray(item.features) && ( +
    + {item.features.map((feature: string, idx: number) => ( +
  • + {feature} +
  • + ))} +
+ )} + {item.code && typeof item.code === 'object' && item.code.content && ( +
+            
+              {item.code.content}
+            
+          
+ )} + {item.output && Array.isArray(item.output) && ( +
+            {item.output.join('\n')}
+          
+ )} + {item.tips && Array.isArray(item.tips) && ( +
    + {item.tips.map((tip: string, idx: number) => ( +
  • + {tip} +
  • + ))} +
+ )} + {item.final_note && ( + <> +
+

+ {item.final_note} +

+ + )} +
+ {/* Overlay unlock button if section is locked */} + {!unlocked && ( +
+ +
+ )} +
+ ); +} + +// --- Data Fetching Functions --- async function getPostFromParams(params: PostPageProps['params']) { - const slug = params?.slug?.join('/') - const post = projects.find((post) => post.slugAsParams === slug) + const slug = params?.slug?.join('/'); + const post = projects.find((post) => post.slugAsParams === slug); + return post; +} - return post +async function getJsonFromParams(params: PostPageProps['params']) { + const slug = params?.slug[0]; + try { + const response = await fetch(`/projects/${slug}.json`); + if (!response.ok) { + throw new Error(`Failed to fetch JSON for ${slug}`); + } + const jsonData = await response.json(); + console.log("this is json data: ", jsonData); + return jsonData; + } catch (error) { + console.error('Error fetching JSON:', error); + return null; + } } -// No need for generateStaticParams anymore, dynamic rendering on demand +// --- Main Component --- export default function ProjectPage({ params }: PostPageProps) { - const [post, setPost] = useState(null) - const [exercise, setExercise] = useState(null) - const [currentStep, setCurrentStep] = useState(0) + const [post, setPost] = useState(null); + const [exercise, setExercise] = useState(null); + const [jsonData, setJsonData] = useState(null); useEffect(() => { const fetchData = async () => { - const fetchedPost = await getPostFromParams(params) + const fetchedPost = await getPostFromParams(params); + const fetchedJson = await getJsonFromParams(params); + console.log("this is inside useEffect's json: ", fetchedJson); if (!fetchedPost || !fetchedPost.published) { - notFound() + notFound(); } - setPost(fetchedPost) - console.log(fetchedPost.body) // Log the post body content + setPost(fetchedPost); + setJsonData(fetchedJson); - // Fetch exercise data after post data is loaded if (fetchedPost) { - const fetchedExercise = getExerciseById(fetchedPost.id) - setExercise(fetchedExercise) + const fetchedExercise = getExerciseById(fetchedPost.id); + setExercise(fetchedExercise); } - } + }; - fetchData() - }, [params]) // Depend on params to refetch when they change - - const handleNextStep = () => { - setCurrentStep((prevStep) => prevStep + 1) - } + fetchData(); + }, [params]); if (!post) { - return
Loading...
// Optional loading state + return
Loading...
; } - const fullLinkGenerated = `${siteConfig.url}/projects/${post?.theme.trim().replace("", '-')}/${params?.slug?.join('/')}` + const fullLinkGenerated = `${siteConfig.url}/projects/${post?.theme.trim().replace("", '-')}/${params?.slug?.join('/')}`; return (
@@ -83,25 +176,28 @@ export default function ProjectPage({ params }: PostPageProps) { {post.title}
- +
{post.description && ( -

+

{post.description}

)}
- {/*
*/} - - {/*
*/} + +
+ {jsonData && + jsonData.sections && + Array.isArray(jsonData.sections) && + jsonData.sections.map((section: any, index: number) => ( +
+ ))} +
- {/* */}
{/* Right side - Code editor */} -
+
{exercise && (
- ) + ); } diff --git a/content/projects/aura-points-calculator.mdx b/content/projects/aura-points-calculator.mdx index 8ca2ede..a797521 100644 --- a/content/projects/aura-points-calculator.mdx +++ b/content/projects/aura-points-calculator.mdx @@ -25,222 +25,4 @@ You'll build a calculator that: - Understanding of classes and methods - Familiarity with lists and dictionaries -## Getting Started -### 1. Let's create the basic structure for our `Character` class: - -Before adding game mechanics, we need a foundational class to represent our characters. Each character will have: - - -- A `name` to identify them. -- A `base_aura`, which is their starting aura level (default is 100). -- A `current_aura` that tracks their aura as it changes during the game. -- Two lists, `buffs` and `debuffs`, to store any temporary effects that strengthen or weaken the character. - -Here's how it should look start like: - -```python -class Character: - def __init__(self, name, base_aura=100): - self.name = name - . - . - . -``` - -### 2. Adding Buffs and Debuffs - -Now that we have a basic `Character` class, let's add functionality to apply buffs (power-ups) and debuffs (power-downs) that modify a character's aura. - -#### 2.1 Adding Buffs - -Buffs increase the character’s aura. The `add_buff` method: -- Takes a `name` and a `power_increase` value. -- Appends the `name` and the `power_increase` as a set to the `buffs` list. -- Recalculates the character’s current aura. - -```python -def add_buff(self, name, power_increase): - """Add a power-up buff to the character""" - . - . - . -``` - -#### 2.2 Adding Debuffs - -Debuffs decrease the character’s aura. The `add_debuff` method: -- Takes a `name` and a `power_decrease` value. -- Adds the` name` and `power_decrease` as a set to the `debuffs` list. -- Recalculates the character’s current aura. - -```python -def add_debuff(self, name, power_decrease): - """Add a power-down debuff to the character""" - . - . - . -``` - -### 3. Calculating Aura - -Every time a buff or debuff is applied, the aura needs to be recalculated. The `calculate_current_aura` method: -- Starts with the `base_aura` value. -- Adds all buff effects. -- Subtracts all debuff effects. -- Ensures the aura never goes below 0. - -```python -def calculate_current_aura(self): - """Calculate total aura points including buffs and debuffs""" - total = self.base_aura - - # Add all buff effects - for buff in self.buffs: - . - . - . - - # Subtract all debuff effects - for debuff in self.debuffs: - . - . - . - - # Ensure aura doesn't go below 0 - self.current_aura = max(0, total) - return self.current_aura -``` - -### 4. Displaying Character Status - -To check a character’s current aura, buffs, and debuffs, we add the `display_status` method: -- Prints the base and current aura. -- Lists active buffs and debuffs (if any). - -```python -def display_status(self): - """Display character's current status""" - print(f"\nCharacter Status: ") - print("=" * 30) - print(f"Base Aura: ") - print(f"Current Aura: ") - - if self.buffs: - print("\nActive Buffs:") - for buff in self.buffs: - print(f"- {?}: + {?}") - - if self.debuffs: - print("\nActive Debuffs:") - for debuff in self.debuffs: - print(f"- {?}: -{?}") -``` - -## Visual Representation -Let's add a method to show a visual representation of the character's energy level: - -```python -def show_aura_bar(self, width=50): - """Display a visual representation of the aura level""" - percentage = self.current_aura / self.base_aura - filled_length = int(width * percentage) - bar = '█' * filled_length + '░' * (width - filled_length) - print(f"\nAura Level: {self.current_aura}/{self.base_aura}") - print(f"[{bar}] {percentage:.1%}") -``` - -## Save and Load Feature -Now, let's add the ability to save and load character data: - -```python -import json - -def save_character(self, filename): - """Save character data to a JSON file""" - data = { - "name": self.name, - "base_aura": self.base_aura, - "current_aura": self.current_aura, - "buffs": self.buffs, - "debuffs": self.debuffs - } - with open(filename, 'w') as f: - json.dump(data, f) - print(f"\nCharacter data saved to {filename}") - -@classmethod -def load_character(cls, filename): - """Load character data from a JSON file""" - with open(filename, 'r') as f: - data = json.load(f) - character = cls(data["name"], data["base_aura"]) - character.current_aura = data["current_aura"] - character.buffs = data["buffs"] - character.debuffs = data["debuffs"] - return character -``` - -## Example Usage -Here's how to use the Aura Points Calculator: - - -```python -# Create a new character -hero = Character("Zephyr", base_aura=100) - -# Add some buffs and debuffs -hero.add_buff("Training", 20) -hero.add_buff("Magic Crystal", 15) -hero.add_debuff("Exhaustion", 10) - -# Display status and visual representation -hero.display_status() -hero.show_aura_bar() - -# Save character data -hero.save_character("hero_data.json") - -# Load character data -loaded_hero = Character.load_character("hero_data.json") -``` - -## Challenge Tasks -1. Add a method to remove buffs and debuffs -2. Implement a time limit for buffs/debuffs -3. Create different character classes with unique base stats -4. Add special abilities that temporarily boost aura -5. Implement a battle system between two characters - -## Tips -- Always validate input values to prevent negative numbers -- Consider adding maximum limits to prevent overpowered characters -- Use descriptive names for buffs and debuffs -- Add error handling for file operations -- Consider adding different types of aura (e.g., attack, defense) - -## Sample Output -``` -Character Status: Zephyr -============================== -Base Aura: 100 -Current Aura: 125 - -Active Buffs: -- Training: +20 -- Magic Crystal: +15 - -Active Debuffs: -- Exhaustion: -10 - -Aura Level: 125/100 -[████████████████████████████░░░░░░░░░░░░░░░░░░░░░░] 125.0% -``` - -## Conclusion -Congratulations! You've built a complete aura points system that you can use in your games. This project demonstrates: -- Object-oriented programming principles -- Data persistence with JSON -- Visual representation of data -- Game mechanics fundamentals - -Feel free to expand upon this system by adding more features or integrating it into a larger game project! \ No newline at end of file +## Getting Started \ No newline at end of file diff --git a/public/projects/aura-points-calculator.json b/public/projects/aura-points-calculator.json new file mode 100644 index 0000000..c172284 --- /dev/null +++ b/public/projects/aura-points-calculator.json @@ -0,0 +1,141 @@ +{ + "sections": [ + { + "title": "1. Let's create the basic structure for our Character class", + "description": "Before adding game mechanics, we need a foundational class to represent our characters. Each character will have:", + "features": [ + "A name to identify them.", + "A base_aura, which is their starting aura level (default is 100).", + "A current_aura that tracks their aura as it changes during the game.", + "Two lists, buffs and debuffs, to store any temporary effects that strengthen or weaken the character." + ], + "code": { + "language": "python", + "content": "class Character:\n def __init__(self, name, base_aura=100):\n self.name = name\n .\n .\n ." + } + }, + { + "title": "2. Giving superpowers to your character", + "description": "Add a power-up buff to the character", + "function": "add_buff", + "parameters": [ + {"name": "name", "type": "str", "description": "The name of the buff"}, + {"name": "power_increase", "type": "int", "description": "The power increase of the buff"} + ], + "code": { + "language": "python", + "content": "def add_buff(self, name, power_increase):\n self.buffs.append({\"name\": name, \"power\": power_increase})\n self.calculate_current_aura()" + } + }, + { + "title": "3. Adding a power-down debuff to your character", + "description": "Add a power-down debuff to the character", + "function": "add_debuff", + "parameters": [ + {"name": "name", "type": "str", "description": "The name of the debuff"}, + {"name": "power_decrease", "type": "int", "description": "The power decrease of the debuff"} + ], + "code": { + "language": "python", + "content": "def add_debuff(self, name, power_decrease):\n self.debuffs.append({\"name\": name, \"power\": power_decrease})\n self.calculate_current_aura()" + } + }, + { + "title": "4. Calculate your character's current aura", + "description": "Calculate total aura points including buffs and debuffs", + "function": "calculate_current_aura", + "parameters": [], + "code": { + "language": "python", + "content": "def calculate_current_aura(self):\n total = self.base_aura\n for buff in self.buffs:\n total += buff[\"power\"]\n for debuff in self.debuffs:\n total -= debuff[\"power\"]\n self.current_aura = max(0, total)\n return self.current_aura" + } + }, + { + "title": "5. Displaying character's current status", + "description": "Display character's current status", + "function": "display_status", + "parameters": [], + "code": { + "language": "python", + "content": "def display_status(self):\n print(f\"\\nCharacter Status: {self.name}\")\n print(\"=\" * 30)\n print(f\"Base Aura: {self.base_aura}\")\n print(f\"Current Aura: {self.current_aura}\")\n if self.buffs:\n print(\"\\nActive Buffs:\")\n for buff in self.buffs:\n print(f\"- {buff['name']}: +{buff['power']}\")\n if self.debuffs:\n print(\"\\nActive Debuffs:\")\n for debuff in self.debuffs:\n print(f\"- {debuff['name']}: -{debuff['power']}\")" + } + }, + { + "title": "6. Visual Representation", + "description": "Let's add a method to show a visual representation of the character's energy level:", + "code": { + "language": "python", + "content": "def show_aura_bar(self, width=50):\n \"\"\"Display a visual representation of the aura level\"\"\"\n percentage = self.current_aura / self.base_aura\n filled_length = int(width * percentage)\n bar = '█' * filled_length + '░' * (width - filled_length)\n print(f\"\\nAura Level: {self.current_aura}/{self.base_aura}\")\n print(f\"[{bar}] {percentage:.1%}\")" + } + }, + { + "title": "7. Save and Load Feature", + "description": "Now, let's add the ability to save and load character data:", + "code": { + "language": "python", + "content": "import json\n\ndef save_character(self, filename):\n \"\"\"Save character data to a JSON file\"\"\"\n data = {\n \"name\": self.name,\n \"base_aura\": self.base_aura,\n \"current_aura\": self.current_aura,\n \"buffs\": self.buffs,\n \"debuffs\": self.debuffs\n }\n with open(filename, 'w') as f:\n json.dump(data, f)\n print(f\"\\nCharacter data saved to {filename}\")\n\n@classmethod\ndef load_character(cls, filename):\n \"\"\"Load character data from a JSON file\"\"\"\n with open(filename, 'r') as f:\n data = json.load(f)\n character = cls(data[\"name\"], data[\"base_aura\"])\n character.current_aura = data[\"current_aura\"]\n character.buffs = data[\"buffs\"]\n character.debuffs = data[\"debuffs\"]\n return character" + } + }, + { + "title": "Example Usage", + "description": "Here's how to use the Aura Points Calculator:", + "code": { + "language": "python", + "content": "# Create a new character\nhero = Character(\"Zephyr\", base_aura=100)\n\n# Add some buffs and debuffs\nhero.add_buff(\"Training\", 20)\nhero.add_buff(\"Magic Crystal\", 15)\nhero.add_debuff(\"Exhaustion\", 10)\n\n# Display status and visual representation\nhero.display_status()\nhero.show_aura_bar()\n\n# Save character data\nhero.save_character(\"hero_data.json\")\n\n# Load character data\nloaded_hero = Character.load_character(\"hero_data.json\")" + } + }, + { + "title": "Challenge Tasks", + "description": "Enhance your system with these tasks:", + "features": [ + "Add a method to remove buffs and debuffs", + "Implement a time limit for buffs/debuffs", + "Create different character classes with unique base stats", + "Add special abilities that temporarily boost aura", + "Implement a battle system between two characters" + ] + }, + { + "title": "Tips", + "description": "Helpful suggestions for improving your system:", + "features": [ + "Always validate input values to prevent negative numbers", + "Consider adding maximum limits to prevent overpowered characters", + "Use descriptive names for buffs and debuffs", + "Add error handling for file operations", + "Consider adding different types of aura (e.g., attack, defense)" + ] + }, + { + "title": "Sample Output", + "description": "Expected output when running the Aura Points Calculator:", + "output": [ + "Character Status: Zephyr", + "==============================", + "Base Aura: 100", + "Current Aura: 125", + "", + "Active Buffs:", + "- Training: +20", + "- Magic Crystal: +15", + "", + "Active Debuffs:", + "- Exhaustion: -10", + "", + "Aura Level: 125/100", + "[████████████████████████████░░░░░░░░░░░░░░░░░░░░░░] 125.0%" + ] + }, + { + "title": "Conclusion", + "description": "Congratulations! You've built a complete aura points system that you can use in your games. This project demonstrates:", + "features": [ + "Object-oriented programming principles", + "Data persistence with JSON", + "Visual representation of data", + "Game mechanics fundamentals" + ], + "final_note": "Feel free to expand upon this system by adding more features or integrating it into a larger game project!" + } + ] + } \ No newline at end of file From b11efa6b6c3fc3030af0f6fd3187dc945d10a6ab Mon Sep 17 00:00:00 2001 From: jk021227 Date: Fri, 14 Feb 2025 15:27:14 +0400 Subject: [PATCH 3/4] new next --- app/projects/[theme]/[...slug]/page.tsx | 132 ++++++++++++------------ public/lock.png | Bin 0 -> 5427 bytes 2 files changed, 66 insertions(+), 66 deletions(-) create mode 100644 public/lock.png diff --git a/app/projects/[theme]/[...slug]/page.tsx b/app/projects/[theme]/[...slug]/page.tsx index 22bfbb9..6097534 100644 --- a/app/projects/[theme]/[...slug]/page.tsx +++ b/app/projects/[theme]/[...slug]/page.tsx @@ -19,38 +19,45 @@ interface PostPageProps { } // --- Section Component --- -// Renders each JSON section with an Unlock button overlay. -// The section content is initially blurred until the user clicks "Unlock". -function Section({ item, index }: { item: any; index: number }) { - const [unlocked, setUnlocked] = useState(index === 0); +// The section content is initially blurred until the user clicks "next". +function Section({ + item, + index, + unlocked, + setUnlockedSections, + totalSections, + hiddenButtons, + setHiddenButtons +}: { + item: any; + index: number; + unlocked: boolean; + setUnlockedSections: React.Dispatch>; + totalSections: number; + hiddenButtons: { [key: number]: boolean }; + setHiddenButtons: React.Dispatch>; +}) { + const handleNext = () => { + setUnlockedSections(prev => ({ ...prev, [index + 1]: true})); + setHiddenButtons(prev => ({ ...prev, [index]: true })); + }; return ( -
- {index !== 0 &&
} - {/* Wrap section content in a container that is blurred if not unlocked */} +
+ {index !== 0 } + + {/* blur content if locked */}
{item.title && ( -

+

{item.title}

)} - {item.description && ( -

- {item.description} -

- )} + {item.description &&

{item.description}

} {item.features && Array.isArray(item.features) && (
    {item.features.map((feature: string, idx: number) => ( -
  • - {feature} -
  • +
  • {feature}
  • ))}
)} @@ -69,36 +76,32 @@ function Section({ item, index }: { item: any; index: number }) { {item.tips && Array.isArray(item.tips) && (
    {item.tips.map((tip: string, idx: number) => ( -
  • - {tip} -
  • +
  • {tip}
  • ))}
)} - {item.final_note && ( - <> -
-

- {item.final_note} -

- - )} + {item.final_note &&

{item.final_note}

}
- {/* Overlay unlock button if section is locked */} - {!unlocked && ( -
- + + {/* next btn - only if unlocked & not last section */} + {unlocked && index !== totalSections - 1 && !hiddenButtons[index] && ( +
+
)} + + +
); } + // --- Data Fetching Functions --- async function getPostFromParams(params: PostPageProps['params']) { const slug = params?.slug?.join('/'); @@ -127,12 +130,14 @@ export default function ProjectPage({ params }: PostPageProps) { const [post, setPost] = useState(null); const [exercise, setExercise] = useState(null); const [jsonData, setJsonData] = useState(null); + const [unlockedSections, setUnlockedSections] = useState<{ [key: number]: boolean }>({ 0: true }); + const [hiddenButtons, setHiddenButtons] = useState<{ [key: number]: boolean }>({}); + useEffect(() => { const fetchData = async () => { const fetchedPost = await getPostFromParams(params); const fetchedJson = await getJsonFromParams(params); - console.log("this is inside useEffect's json: ", fetchedJson); if (!fetchedPost || !fetchedPost.published) { notFound(); @@ -154,56 +159,51 @@ export default function ProjectPage({ params }: PostPageProps) { return
Loading...
; } - const fullLinkGenerated = `${siteConfig.url}/projects/${post?.theme.trim().replace("", '-')}/${params?.slug?.join('/')}`; + const totalSections = jsonData?.sections?.length || 0; return (
- {/* Navigation bar */}
- +
- {/* Split screen container */}
- {/* Left side - Tutorial content */}
-

- {post.title} -

+

{post.title}

{post.description && ( -

- {post.description} -

+

{post.description}

)}
- {jsonData && - jsonData.sections && - Array.isArray(jsonData.sections) && - jsonData.sections.map((section: any, index: number) => ( -
- ))} + {jsonData?.sections?.map((section: any, index: number) => ( +
+ ))}
- {/* Right side - Code editor */} +
{exercise && ( - + )}
diff --git a/public/lock.png b/public/lock.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd898dd4d1006c7ed8e02d15a89d4cd49411dd4 GIT binary patch literal 5427 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 literal 0 HcmV?d00001 From 154ab84eb4443b267536a1eeb70df53e45f107f2 Mon Sep 17 00:00:00 2001 From: jk021227 Date: Fri, 28 Mar 2025 17:15:20 +0400 Subject: [PATCH 4/4] compiler componenets --- api/index.py | 1 + api/routes/code_router.py | 13 +++++++ app/projects/[theme]/[...slug]/page.tsx | 52 ++++++++++++------------- components/code-resizable-executor.tsx | 32 +++++++++++---- 4 files changed, 64 insertions(+), 34 deletions(-) diff --git a/api/index.py b/api/index.py index ce1054e..6ebca95 100644 --- a/api/index.py +++ b/api/index.py @@ -13,6 +13,7 @@ # Add limiter to app state app.state.limiter = limiter + # Handle rate limit exceeded errors @app.exception_handler(RateLimitExceeded) async def ratelimit_handler(request: Request, exc: RateLimitExceeded): diff --git a/api/routes/code_router.py b/api/routes/code_router.py index 2cb2786..6428bfb 100644 --- a/api/routes/code_router.py +++ b/api/routes/code_router.py @@ -53,6 +53,19 @@ async def execute_code(request: Request, code_request: CodeExecutionRequest): detail=str(e) ) +@router.get("/health") +async def health_check(): + """Health check endpoint to verify API status""" + return { + "status": "healthy", + "services": { + "code_execution": "available", + "exercise": "available", + "project": "available", + "assignment": "available" + } + } + @router.post("/test-exercise") @limiter.limit("30/minute") async def test_exercise(request: Request, test_request: TestExerciseRequest): diff --git a/app/projects/[theme]/[...slug]/page.tsx b/app/projects/[theme]/[...slug]/page.tsx index 6097534..cf48028 100644 --- a/app/projects/[theme]/[...slug]/page.tsx +++ b/app/projects/[theme]/[...slug]/page.tsx @@ -37,17 +37,17 @@ function Section({ hiddenButtons: { [key: number]: boolean }; setHiddenButtons: React.Dispatch>; }) { - const handleNext = () => { - setUnlockedSections(prev => ({ ...prev, [index + 1]: true})); - setHiddenButtons(prev => ({ ...prev, [index]: true })); - }; + const titleNum = /^[0-9]+/.test(item.title ?? '') + const shouldBlur = !unlocked && /^[0-9]+/.test(item.title ?? '') + + // console.log(`Section ${index} - item.code.content:`, item.code?.content); return (
{index !== 0 } {/* blur content if locked */} -
+ {item.title && (

{item.title} @@ -61,12 +61,27 @@ function Section({ ))} )} - {item.code && typeof item.code === 'object' && item.code.content && ( -
-            
+        
+        
+ {item.code && typeof item.code === 'object' && item.code.content && titleNum ? ( +
+ { + setUnlockedSections(prev => ({ ...prev, [index + 1]: true })); + setHiddenButtons(prev => ({ ...prev, [index]: true })); + }} + /> +
+ ) : ( + item.code?.content && ( +
               {item.code.content}
-            
-          
+
+ ) )} {item.output && Array.isArray(item.output) && (
@@ -83,25 +98,10 @@ function Section({
         {item.final_note && 

{item.final_note}

}

- {/* next btn - only if unlocked & not last section */} - {unlocked && index !== totalSections - 1 && !hiddenButtons[index] && ( -
- -
- )} - - -
); } - // --- Data Fetching Functions --- async function getPostFromParams(params: PostPageProps['params']) { const slug = params?.slug?.join('/'); @@ -186,7 +186,7 @@ export default function ProjectPage({ params }: PostPageProps) {
{jsonData?.sections?.map((section: any, index: number) => (
{ + onSuccess, +}: CodeEditorProps & { onSuccess?: () => void }) => { const {user} = useAuth() const [code, setCode] = useState(initialCode) const [output, setOutput] = useState('') @@ -85,21 +86,34 @@ const PythonResizableCodeEditor = ({ }) const data = await response.json() + console.log("this is response from python editor: ", data) - // Set output and error states - setOutput(data.output) + // If successful, prepend "Successfully compiled" + const combinedOutput = data.success + ? `✅ Successfully compiled\n${data.output}` + : data.output + + setOutput(combinedOutput) setError(data.error ? data.output : null) + // Set correctness for submissions if (isSubmission) { setIsCorrect(data.success) - invalidateCache() + + // Handle project completion if it's a real project + if (isProject) { + invalidateCache() + if (user && data.success) { + await handleProjectCompletion(user, project_id, code!, true) + } + } } - - // Handle project completion - if (data.success && user && isSubmission) { - await handleProjectCompletion(user, project_id, code!, true) + + if (onSuccess && data.success) { + onSuccess() } + } catch (err) { setError(err instanceof Error ? err.message : 'An error occurred') if (isSubmission) { @@ -121,6 +135,8 @@ const PythonResizableCodeEditor = ({ } const isDarkTheme = theme === 'dark' || theme === 'vscode' + console.log("🧩 PythonResizableCodeEditor mounted with initialCode:", initialCode) + return ( <>