refactor: rename DTree to DValue

This commit is contained in:
udo
2026-06-12 11:05:52 +00:00
parent 941f5aea08
commit 7066da3cde
157 changed files with 1203 additions and 1074 deletions
@@ -1,10 +1,10 @@
#load "../../lib/app.uce"
void marketing_default_features(DTree& features)
void marketing_default_features(DValue& features)
{
if(features.get_type_name() == "array" && features["0"]["title"].to_string() != "")
return;
DTree item;
DValue item;
item["icon"] = "⚡";
item["title"] = "Lightning Fast";
@@ -194,7 +194,7 @@ COMPONENT:HERO_SECTION(Request& context)
COMPONENT:FEATURES_GRID(Request& context)
{
DTree features = context.props["features"];
DValue features = context.props["features"];
marketing_default_features(features);
<>
@@ -204,7 +204,7 @@ COMPONENT:FEATURES_GRID(Request& context)
<p>Discover the powerful features that make development a breeze</p>
</div>
<div class="features-grid">
<? features.each([&](DTree feature, String key) {
<? features.each([&](DValue feature, String key) {
?><div class="feature-card">
<div class="feature-icon"><?: feature["icon"].to_string() ?></div>
<h3 class="feature-title"><?= feature["title"].to_string() ?></h3>
@@ -288,10 +288,10 @@ COMPONENT:FEATURES_GRID(Request& context)
COMPONENT:STATS_SECTION(Request& context)
{
DTree stats = context.props["stats"];
DValue stats = context.props["stats"];
if(stats.get_type_name() != "array" || stats["0"]["label"].to_string() == "")
{
DTree item;
DValue item;
item["number"] = "99.9%"; item["label"] = "Uptime"; stats.push(item); item.clear();
item["number"] = "500ms"; item["label"] = "Average Response"; stats.push(item); item.clear();
item["number"] = "50K+"; item["label"] = "Active Users"; stats.push(item); item.clear();
@@ -306,7 +306,7 @@ COMPONENT:STATS_SECTION(Request& context)
<p>Join thousands of developers who have chosen our framework</p>
</div>
<div class="stats-grid">
<? stats.each([&](DTree stat, String key) {
<? stats.each([&](DValue stat, String key) {
?><div class="stat-item">
<div class="stat-number"><?= stat["number"].to_string() ?></div>
<div class="stat-label"><?= stat["label"].to_string() ?></div>
@@ -364,10 +364,10 @@ COMPONENT:STATS_SECTION(Request& context)
COMPONENT:BRANDS_SHOWCASE(Request& context)
{
DTree logos = context.props["logos"];
DValue logos = context.props["logos"];
if(logos.get_type_name() != "array" || logos["0"]["name"].to_string() == "")
{
DTree item;
DValue item;
for(s32 i = 1; i <= 6; i++)
{
item["name"] = "Brand " + std::to_string(i);
@@ -383,7 +383,7 @@ COMPONENT:BRANDS_SHOWCASE(Request& context)
<div class="brands-container">
<h3 class="brands-title"><?= title ?></h3>
<div class="brands-grid">
<? logos.each([&](DTree logo, String key) {
<? logos.each([&](DValue logo, String key) {
?><div class="brand-item">
<img src="<?= logo["url"].to_string() ?>" alt="<?= logo["name"].to_string() ?>" />
</div><?
@@ -410,10 +410,10 @@ COMPONENT:BRANDS_SHOWCASE(Request& context)
COMPONENT:TESTIMONIALS(Request& context)
{
DTree testimonials = context.props["testimonials"];
DValue testimonials = context.props["testimonials"];
if(testimonials.get_type_name() != "array" || testimonials["0"]["name"].to_string() == "")
{
DTree item;
DValue item;
item["name"] = "Sarah Johnson"; item["role"] = "Senior Developer at TechCorp"; item["avatar"] = "img/cat01.jpg"; item["content"] = "This framework has revolutionized our development process."; item["rating"] = "5"; testimonials.push(item); item.clear();
item["name"] = "Michael Chen"; item["role"] = "CTO at StartupX"; item["avatar"] = "img/cat02.jpg"; item["content"] = "We switched from our legacy system and saw immediate improvements."; item["rating"] = "5"; testimonials.push(item); item.clear();
item["name"] = "Emily Rodriguez"; item["role"] = "Full Stack Developer"; item["avatar"] = "img/cat03.jpg"; item["content"] = "The documentation is excellent and the learning curve is gentle."; item["rating"] = "5"; testimonials.push(item);
@@ -427,7 +427,7 @@ COMPONENT:TESTIMONIALS(Request& context)
<p>Don't just take our word for it - hear from the community</p>
</div>
<div class="testimonials-grid">
<? testimonials.each([&](DTree testimonial, String key) {
<? testimonials.each([&](DValue testimonial, String key) {
?><div class="testimonial-card">
<div class="testimonial-content">
<div class="quote-icon">"</div>
@@ -473,11 +473,11 @@ COMPONENT:TESTIMONIALS(Request& context)
COMPONENT:PRICING_TABLE(Request& context)
{
DTree plans = context.props["plans"];
DValue plans = context.props["plans"];
if(plans.get_type_name() != "array" || plans["0"]["name"].to_string() == "")
{
DTree plan;
DTree feature;
DValue plan;
DValue feature;
plan["name"] = "Starter"; plan["price"] = "Free"; plan["period"] = ""; plan["description"] = "Perfect for small projects and learning"; plan["cta"] = "Start Free"; feature = "Up to 3 projects"; plan["features"].push(feature); feature = "Community support"; plan["features"].push(feature); feature = "Basic components"; plan["features"].push(feature); plans.push(plan); plan.clear();
plan["name"] = "Pro"; plan["price"] = "$24"; plan["period"] = "/mo"; plan["description"] = "For serious products and teams"; plan["cta"] = "Choose Pro"; plan["popular"].set_bool(true); feature = "Unlimited projects"; plan["features"].push(feature); feature = "Priority support"; plan["features"].push(feature); feature = "Advanced components"; plan["features"].push(feature); plans.push(plan); plan.clear();
@@ -492,7 +492,7 @@ COMPONENT:PRICING_TABLE(Request& context)
<p>Choose the plan that fits your product stage.</p>
</div>
<div class="pricing-grid">
<? plans.each([&](DTree plan, String key) {
<? plans.each([&](DValue plan, String key) {
bool popular = plan["popular"].to_string() != "";
?><div class="pricing-card<?= popular ? " popular" : "" ?>">
<? if(popular) { ?><div class="popular-badge">Most Popular</div><? } ?>
@@ -505,7 +505,7 @@ COMPONENT:PRICING_TABLE(Request& context)
<p class="plan-description"><?= plan["description"].to_string() ?></p>
</div>
<ul class="plan-features">
<? plan["features"].each([&](DTree feature, String feature_key) { ?><li><?= feature.to_string() ?></li><? }); ?>
<? plan["features"].each([&](DValue feature, String feature_key) { ?><li><?= feature.to_string() ?></li><? }); ?>
</ul>
<div class="plan-footer">
<button class="btn <?= popular ? "btn-primary" : "btn-outline" ?> btn-large plan-cta"><?= first(plan["cta"].to_string(), "Choose Plan") ?></button>
@@ -107,7 +107,7 @@ COMPONENT(Request& context)
<div id="theme-menu" class="theme-menu" hidden>
<div class="theme-menu-title">Available Themes</div>
<div class="theme-menu-list">
<? context.cfg.get_by_path("theme/options").each([&](DTree theme_info, String theme_key) {
<? context.cfg.get_by_path("theme/options").each([&](DValue theme_info, String theme_key) {
StringMap params;
params["theme"] = theme_key;
String href = app_link(route_path == "index" ? "" : route_path, params, context);