From d7dbe7fee362d587dfc334135d9581b6216a4295 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 23 Nov 2025 04:13:56 +0000
Subject: [PATCH] =Timeline block, and feed block updated. DataStore.js refactored to not block rendering
---
inc/meta/MetaForm.php | 51 ++++++++++++++++++++++++++++-----------------------
1 files changed, 28 insertions(+), 23 deletions(-)
diff --git a/inc/meta/MetaForm.php b/inc/meta/MetaForm.php
index cf1e401..953450f 100644
--- a/inc/meta/MetaForm.php
+++ b/inc/meta/MetaForm.php
@@ -426,7 +426,7 @@
class="decrease"
title="<?= array_key_exists('remove', $field) ? $field['remove'] : 'Decrease amount' ?>"
aria-label="Decrease <?= esc_attr($field['label']) ?>">
- <?= jvbIcon('minus') ?>
+ <?= jvbIcon('minus-square') ?>
</button>
<input type="number"
@@ -445,7 +445,7 @@
class="increase"
title="<?= array_key_exists('add', $field) ? $field['add'] : 'Increase amount' ?>"
aria-label="Increase <?= esc_attr($field['label']) ?>">
- <?= jvbIcon('add') ?>
+ <?= jvbIcon('plus-square') ?>
</button>
</div>
@@ -624,7 +624,6 @@
private function renderRepeaterField(string $name, mixed $value, array $field):void
{
- error_log('Rendering Repeater Field!');
$values = is_array($value) ? $value : array();
$conditional = $this->handleConditionalField($field);
@@ -678,11 +677,11 @@
<div class="repeater-row" data-index="<?= esc_attr($index); ?>">
<details <?= (is_string($index)) ? 'open' : ''; ?>>
<summary class="repeater-row-header row btw">
- <span class="drag-handle"><?= jvbIcon('grab'); ?></span>
+ <span class="drag-handle"><?= jvbIcon('dots-six-vertical'); ?></span>
<span class="row-number">#<?= esc_html($display_number); ?></span>
<span class="row-title"><?= esc_html($this->getRowTitle($fields, $values, $rowTitle)); ?></span>
<button type="button" class="remove-row" title="Remove">
- <?= jvbIcon('delete', ['title'=>'Remove']); ?>
+ <?= jvbIcon('trash', ['title'=>'Remove']); ?>
</button>
</summary>
<div class="repeater-row-content">
@@ -722,9 +721,11 @@
protected function renderGroupField(string $name, mixed $value, array $field): void
{
if (!array_key_exists('fields', $field) || empty($field['fields'])) {
+ error_log('No fields to render');
return;
}
+
$values = is_array($value) ? $value : [];
$original = $name;
@@ -744,14 +745,15 @@
$conditional = $this->handleConditionalField($field);
$validationAttrs = $this->buildValidationAttributes($field);
$describedBy = (!empty($field['description'])) ? ' aria-describedby="' . $name . '-help"' : '';
-
+ $fieldset = (array_key_exists('wrap', $field) && $field['wrap'] === 'details') ? 'details' : 'fieldset';
+ $legend = (array_key_exists('wrap', $field) && $field['wrap'] === 'details') ? 'summary' : 'legend';
?>
- <fieldset class="field group <?= esc_attr($name) ?>"
+ <<?= $fieldset?> class="field group <?= esc_attr($name) ?>"
<?= $conditional ?>
data-field="<?= esc_attr($name) ?>"
<?= $validationAttrs ?>
<?= $describedBy ?>>
- <legend><?= esc_html($field['label']) ?></legend>
+ <<?=$legend?>><?= esc_html($field['label']) ?></<?=$legend?>>
<?php $this->renderHintAndDescription($field, $name); ?>
@@ -760,7 +762,7 @@
</div>
<span class="validation-message" hidden role="alert"></span>
- </fieldset>
+ </<?= $fieldset?>>
<?php
}
@@ -931,18 +933,18 @@
<div class="selection-actions row btw" hidden>
<button type="button" data-action="add-to-group">
- <?= jvbIcon('add') ?>
+ <?= jvbIcon('plus-square') ?>
Group
</button>
<button type="button" data-action="delete-upload">
- <?= jvbIcon('delete') ?>
+ <?= jvbIcon('trash') ?>
Delete
</button>
</div>
</div>
<button type="button" data-action="upload" class="submit-uploads">
- <?= jvbIcon('upload') ?> Upload <?= esc_html($plural ?? 'Content'); ?>
+ <?= jvbIcon('cloud-arrow-up') ?> Upload <?= esc_html($plural ?? 'Content'); ?>
</button>
</div>
<?php endif; ?>
@@ -959,7 +961,7 @@
</div>
<?php if ($destination === 'post_group') : ?>
- <p class="hint"><?= jvbIcon('elbow-left-up') ?> These will become individual <?= $plural ?> <?= jvbIcon('elbow-right-up')?></p>
+ <p class="hint"><?= jvbIcon('arrow-elbow-left-up') ?> These will become individual <?= $plural ?> <?= jvbIcon('arrow-elbow-right-up')?></p>
</div>
<div class="sidebar flex col">
<div class="header">
@@ -971,7 +973,7 @@
<p>Drag here to create a new <?= $singular ?>!</p>
</div>
</div>
- <p class="hint"><?= jvbIcon('elbow-left-up') ?> Each group will become its own <?= $singular ?> <?= jvbIcon('elbow-right-up')?></p>
+ <p class="hint"><?= jvbIcon('arrow-elbow-left-up') ?> Each group will become its own <?= $singular ?> <?= jvbIcon('arrow-elbow-right-up')?></p>
</div>
</div>
<?php endif; ?>
@@ -1072,7 +1074,7 @@
<?php jvbRenderProgressBar('',true) ?>
<input type="checkbox" class="upload-select" name="select-item" id="select-item<?=$addID?>">
<label for="select-item<?=$addID?>" aria-label="Select image">
- <?= ($attachment) ? $attachment : '<img>
+ <?= ($attachment) ?: '<img>
<video></video>
<span></span>' ?>
</label>
@@ -1087,12 +1089,12 @@
</div>
<button type="button" data-action="delete-upload" title="Remove from Group">
- <?=jvbIcon('delete')?>
+ <?=jvbIcon('trash')?>
</button>
</div>
</div>
- <details>';
- <summary class="row btw"><?=jvbIcon('edit')?><span>Edit Info</span></summary>
+ <details>
+ <summary class="row btw"><?=jvbIcon('pencil-simple')?><span>Edit Info</span></summary>
<?php
@@ -1127,7 +1129,10 @@
]
], $fields);
- $this->render('upload_data', null, $fields);
+ $meta = new MetaManager($id);
+ foreach ($fields as $field => $config) {
+ $meta->render('form', $field, $config);
+ }
?>
</details>
</div>
@@ -1162,12 +1167,12 @@
</div>
<button type="button" data-action="delete-upload" title="Remove from Group">
- <?=jvbIcon('delete')?>
+ <?=jvbIcon('trash')?>
</button>
</div>
</div>
<details>';
- <summary class="row btw"><?=jvbIcon('edit')?><span>Edit Info</span></summary>
+ <summary class="row btw"><?=jvbIcon('pencil-simple')?><span>Edit Info</span></summary>
<?php
$fields = array_key_exists('fields', $config) ? $config['fields'] : [];
@@ -1235,12 +1240,12 @@
</div>
<button type="button" data-action="delete-upload" title="Remove from Group">
- <?=jvbIcon('delete')?>
+ <?=jvbIcon('trash')?>
</button>
</div>
</div>
<details>';
- <summary class="row btw"><?=jvbIcon('edit')?><span>Edit Info</span></summary>
+ <summary class="row btw"><?=jvbIcon('pencil-simple')?><span>Edit Info</span></summary>
<?php
$fields = array_key_exists('fields', $config) ? $config['fields'] : [];
--
Gitblit v1.10.0