Compare commits
14
Commits
207cb13363
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0641e5f1fd | ||
|
|
8f8cc573c6 | ||
|
|
79e7e9b4fd | ||
|
|
bfc1f92b2e | ||
|
|
32475b63bd | ||
|
|
533fd3a94f | ||
|
|
5cce0e95d7 | ||
|
|
df82588768 | ||
|
|
8f3812b588 | ||
|
|
6ddb83a903 | ||
|
|
34f30cde50 | ||
|
|
bf016f8db2 | ||
|
|
4900f0505d | ||
|
|
61e45be2e2 |
No files matched your search
+12
-38
@@ -1,41 +1,15 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(find /home/konstantinos/Projects/RadicalElements/boboko-core/docs/scratch -iname \"*cart*\" 2>/dev/null; find /home/konstantinos/Projects/RadicalElements -iname \"*cart-feature*\" -o -iname \"*feature-survey*\" 2>/dev/null)",
|
||||
"Read(//home/konstantinos/Projects/RadicalElements/**)",
|
||||
"Bash(find /home/konstantinos/Projects/RadicalElements/3dealer -path \"*config/lunar/payments.php\" 2>/dev/null; find /home/konstantinos/Projects/RadicalElements -maxdepth 4 -iname \"*stripe*\" -type d 2>/dev/null)",
|
||||
"Bash(grep -n 'process\\(\\\\|->using\\\\|\\\\$data' /home/konstantinos/Projects/RadicalElements/boboko-core/vendor/filament/actions/src/CreateAction.php)",
|
||||
"Bash(php -l src/Order/Commands/CloseExpiredReturnWindows.php)",
|
||||
"Bash(php -l config/core.php)",
|
||||
"Bash(./bin/dc-core.sh exec *)",
|
||||
"Bash(php -l src/Shipping/Extensions/OrderViewExtension.php)",
|
||||
"Bash(php -l src/Cart/Filament/Resources/CartResource/Pages/ViewCart.php)",
|
||||
"Bash(./bin/dc-core.sh exec app php artisan tinker '--execute= *)",
|
||||
"Bash(mkdir -p /home/konstantinos/Projects/RadicalElements/boboko-core/src/Cart/Http/Controllers)",
|
||||
"Bash(rmdir /home/konstantinos/Projects/RadicalElements/boboko-core/src/Checkout/routes)",
|
||||
"Bash(mkdir -p /home/konstantinos/Projects/RadicalElements/boboko-core/src/Checkout/routes)",
|
||||
"Bash(php -l src/Cart/Http/Controllers/CartController.php)",
|
||||
"Bash(php -l src/Checkout/Http/Controllers/CheckoutController.php)",
|
||||
"Bash(php -l src/Providers/CheckoutModuleServiceProvider.php)",
|
||||
"Bash(php -l src/Providers/CheckoutServiceProvider.php)",
|
||||
"Bash(php -l src/Checkout/routes/checkout.php)",
|
||||
"Bash(php -l config/checkout.php)",
|
||||
"Bash(cp /home/konstantinos/Projects/RadicalElements/3dealer/resources/css/checkout.css /home/konstantinos/Projects/RadicalElements/boboko-core/resources/css/)",
|
||||
"Bash(cp /home/konstantinos/Projects/RadicalElements/3dealer/resources/js/checkout/*.js /home/konstantinos/Projects/RadicalElements/boboko-core/resources/js/checkout/)",
|
||||
"Bash(rm /home/konstantinos/Projects/RadicalElements/3dealer/app/Providers/CheckoutModuleServiceProvider.php)",
|
||||
"Bash(rm -rf /home/konstantinos/Projects/RadicalElements/3dealer/app/Http/Controllers/Checkout)",
|
||||
"Bash(rm /home/konstantinos/Projects/RadicalElements/3dealer/routes/checkout.php)",
|
||||
"Bash(rm -rf /home/konstantinos/Projects/RadicalElements/3dealer/resources/js/checkout)",
|
||||
"Bash(rm /home/konstantinos/Projects/RadicalElements/3dealer/resources/css/checkout.css)",
|
||||
"Bash(composer dump-autoload *)",
|
||||
"Bash(curl -s -o /tmp/checkout_test.html -w \"%{http_code}\\\\n\" http://localhost:8091/en/checkout)",
|
||||
"Read(//tmp/**)",
|
||||
"Bash(curl -s -o /tmp/home_test.html -w \"%{http_code}\\\\n\" http://localhost:8091/en/)",
|
||||
"Bash(php -l bootstrap/providers.php)"
|
||||
],
|
||||
"additionalDirectories": [
|
||||
"/home/konstantinos/Projects/RadicalElements/3dealer/bootstrap",
|
||||
"/home/konstantinos/Projects/RadicalElements/3dealer/config"
|
||||
]
|
||||
"extraKnownMarketplaces": {
|
||||
"re-skills": {
|
||||
"source": {
|
||||
"source": "git",
|
||||
"url": "git@code.radical-elements.com:radical/re-skills.git"
|
||||
},
|
||||
"autoUpdate": true
|
||||
}
|
||||
},
|
||||
"enabledPlugins": {
|
||||
"engineering@re-skills": true,
|
||||
"boboko@re-skills": true
|
||||
}
|
||||
}
|
||||
@@ -12,3 +12,5 @@ yarn-error.log
|
||||
.idea
|
||||
.vscode
|
||||
*.log
|
||||
|
||||
.claude/settings.local.json
|
||||
@@ -4,6 +4,48 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
|
||||
## [0.31.4] - 2026-11-03
|
||||
### Added
|
||||
- Payment option icons on the checkout page, picked by payment driver and
|
||||
themeable via `--bbk-icon-payment-*` custom properties.
|
||||
|
||||
## [0.31.3] - 2026-11-03
|
||||
### Added
|
||||
- Icons on the order confirmation's shipping/billing headings and before the
|
||||
address phone number, themeable via `--bbk-icon-*` custom properties.
|
||||
Address name and phone lines now have their own classes
|
||||
(`.bbk-address-lines-name`, `.bbk-address-lines-phone`).
|
||||
|
||||
### Changed
|
||||
- Default checkout copy: cart button is now "Ταμείο" / "Checkout", and the
|
||||
final order button "Ολοκλήρωση αγοράς" / "Complete purchase".
|
||||
|
||||
## [0.31.2] - 2026-11-03
|
||||
### Changed
|
||||
- Cart line remove button now uses a trash bin icon instead of `×`. Themes
|
||||
can swap it via the new `--bbk-icon-remove` custom property, e.g.
|
||||
`:root { --bbk-icon-remove: url("/images/icons/bin.svg"); }`.
|
||||
|
||||
## [0.31.1] - 2026-10-19
|
||||
### Added
|
||||
- `storefront.search.view_all` translation ("View all :count results" /
|
||||
"Δες όλα τα :count αποτελέσματα"), for a live search dropdown's link to
|
||||
the full results.
|
||||
|
||||
### Changed
|
||||
- Product search matches the start of words again:
|
||||
`lunar:meilisearch:tune-product-search` turns Meilisearch's prefix
|
||||
search back on, so "παπ" finds "Παπάκι" and "cli" finds "clicker". Live
|
||||
search (results as you type, from 3 characters) needs this. Before, a
|
||||
query only matched whole words.
|
||||
- Typo tolerance on product search is now one typo from 10 and two from 16
|
||||
(was 8 / 12). Meilisearch counts Greek words about double, so under the
|
||||
old setting a 6-letter Greek word already got two typos. With prefix
|
||||
search on, that matched almost anything ("κατανα" → 179 products, now
|
||||
9). Greek words now get one typo from 5 letters and two from 8; Latin
|
||||
ones from 10 and 16. The app's entrypoint runs the command on every
|
||||
boot, so the settings apply on the next deploy.
|
||||
|
||||
## [0.31.0] - 2026-10-01
|
||||
### Added
|
||||
- A "Create voucher" button on Carrier Vouchers, for a parcel that isn't a
|
||||
|
||||
+4
-2
@@ -38,7 +38,9 @@ bin/core-mode repo # back to tagged releases
|
||||
|
||||
It swaps the `composer.json` / `package.json` wiring, runs `down` with the old mode's Compose wrapper and `up` with the new one, then waits until the entrypoints have re-resolved core. Running it for the mode you're already in skips the edits and just restarts the stack — in repo mode, that's how you pick up a newly pushed tag.
|
||||
|
||||
(`3dealer` has `bin/core-mode` and `bin/deploy`; they're app-agnostic, so other consumer apps can copy them as-is.)
|
||||
**Pre-commit guard.** The first time you run `bin/core-mode local` or `repo`, it sets `git config core.hooksPath .githooks`. That turns on a pre-commit hook (`bin/check-core-mode`) that blocks any commit with local-mode `composer.json`, `package.json` or either lockfile staged. You can keep working in local mode and commit everything else: just leave those four files unstaged (`git restore --staged composer.json composer.lock package.json package-lock.json`). If you already use a custom `core.hooksPath`, `core-mode` leaves it alone and warns you. In that case, call `bin/check-core-mode` from your own hook.
|
||||
|
||||
(`3dealer` has `bin/core-mode`, `bin/check-core-mode`, `.githooks/` and `bin/deploy`; they're app-agnostic, so other consumer apps can copy them as-is.)
|
||||
|
||||
### Day to day in local mode
|
||||
|
||||
@@ -106,7 +108,7 @@ export default defineConfig({
|
||||
|
||||
## Translations added in the UI
|
||||
|
||||
Default translation lines ship in core's seeders (`StorefrontTranslationsSeeder`, `CheckoutTranslationsSeeder`, `ValidationTranslationsSeeder`), which every app runs on boot and which only ever add missing keys. Lines added while building a storefront usually start in the Filament Language Lines UI instead. To move them into core:
|
||||
Default translation lines ship in core's seeders (`StorefrontTranslationsSeeder`, `CheckoutTranslationsSeeder`, `ValidationTranslationsSeeder`), which only ever add missing keys. A shop's entrypoint runs the checkout and validation seeders on every boot; `StorefrontTranslationsSeeder` currently has to be run explicitly (see `docs/localization.md`, "Seeding"). Lines added while building a storefront usually start in the Filament Language Lines UI instead. To move them into core:
|
||||
|
||||
```bash
|
||||
bin/dc-core.sh exec app php artisan boboko:translations:pull # local mode: writes into ../boboko-core
|
||||
|
||||
@@ -179,7 +179,7 @@ Add the repository to your project's `composer.json`:
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"boboko/core": "^1.0"
|
||||
"boboko/core": "0.*"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"name": "boboko/core",
|
||||
"description": "Core module — authentication and shared panel behaviour",
|
||||
"type": "library",
|
||||
"version": "0.31.0",
|
||||
"version": "0.31.4",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Modules\\Core\\": "src/"
|
||||
|
||||
+33
-18
@@ -1,6 +1,6 @@
|
||||
# Localization
|
||||
|
||||
Storefront routes can be locale-prefixed (`/el/proionta`, `/en/products`) using a middleware
|
||||
Storefront routes can be locale-prefixed (`/el/products`, `/en/products`) using a middleware
|
||||
that reads directly from Lunar's `languages` table — the same table the Filament **Languages**
|
||||
resource manages, so there's no separate locale config to keep in sync.
|
||||
|
||||
@@ -8,7 +8,7 @@ resource manages, so there's no separate locale config to keep in sync.
|
||||
|
||||
## Why prefix every locale, including the default
|
||||
|
||||
Leaving the default locale bare at the root (`/proionta` for Greek, `/en/products` for English)
|
||||
Leaving the default locale bare at the root (`/products` for Greek, `/en/products` for English)
|
||||
creates ambiguity: is `/` the language-neutral homepage or specifically the Greek version? It
|
||||
also complicates `hreflang` (needs a self-referencing tag on the root plus a possibly-duplicate
|
||||
`x-default`) and risks duplicate content if a bot or campaign link reaches the root without a
|
||||
@@ -17,6 +17,11 @@ language signal.
|
||||
Prefixing every locale avoids this: every URL unambiguously declares its language, `hreflang`
|
||||
tags are symmetrical, and adding a locale later requires no URL restructuring.
|
||||
|
||||
|
||||
**Slugs are the same in every locale** (`/el/products/…` and `/en/products/…`, never
|
||||
`/el/proionta/…`). Only the visible content is translated. Boboko shops don't use per-locale
|
||||
slugs.
|
||||
|
||||
---
|
||||
|
||||
## Opt-in, not global
|
||||
@@ -30,8 +35,8 @@ use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::middleware('locale')->group(function () {
|
||||
Route::get('/{locale}', HomeController::class);
|
||||
Route::get('/{locale}/proionta', ProductIndexController::class);
|
||||
Route::get('/{locale}/proionta/{slug}', ProductShowController::class);
|
||||
Route::get('/{locale}/products', ProductIndexController::class);
|
||||
Route::get('/{locale}/products/{slug}', ProductShowController::class);
|
||||
});
|
||||
```
|
||||
|
||||
@@ -198,21 +203,31 @@ registered.
|
||||
|
||||
### Seeding
|
||||
|
||||
A starter set of common e-shop labels (`nav.*`, `cart.*`, `product.*`, `auth.*`, `search.*`,
|
||||
`review.*`, `shop.*`, `pagination.*`, English + Greek) lives in
|
||||
`Modules\Core\Localization\Services\StorefrontLabels::all()` — kept as its own class, separate
|
||||
from the seeding logic, so the label list can be scanned/diffed without wading through the
|
||||
seeding mechanics.
|
||||
The default labels for every shop (`nav.*`, `footer.*`, `cart.*`, `product.*`, `shop.*`,
|
||||
`search.*`, `auth.*`, `account.*`, `orders.*`, `contact.*`, `review.*`, `wishlist.*`,
|
||||
`pagination.*`, English + Greek) live in
|
||||
`Modules\Core\Localization\Database\Seeders\StorefrontTranslationsSeeder::lines()`. Checkout and
|
||||
validation messages have their own seeders (`Modules\Core\Checkout\Database\Seeders\CheckoutTranslationsSeeder`,
|
||||
`Modules\Core\Localization\Database\Seeders\ValidationTranslationsSeeder`).
|
||||
|
||||
`Modules\Core\Command\InstallLunarCommand` (overrides Lunar's own `lunar:install`) seeds them via
|
||||
a **per-key upsert**, not an all-or-nothing "only seed if the group is empty" guard: a key already
|
||||
present in the database — including one an admin has since edited via the Filament **Language
|
||||
Lines** resource — is left untouched; only keys missing entirely are created. This is what makes
|
||||
it safe to add new keys to `StorefrontLabels::all()` later and re-run `lunar:install` on an
|
||||
already-installed store, without either silently skipping the new keys (the old guard's behavior)
|
||||
or reverting an admin's edits back to the hardcoded default (what a naive `updateOrCreate` would
|
||||
do). New writes go through `TranslationService::create()`, so the usual cache-invalidation and
|
||||
activity-log events fire for them too.
|
||||
The seeders are **additive per key**: a key already in the database, including one an admin has
|
||||
since edited in the Filament **Language Lines** resource, is left untouched; only missing keys
|
||||
are created. That makes it safe to add keys to a seeder later and re-run it on an installed store,
|
||||
without skipping the new keys or reverting an admin's edits. New lines go through
|
||||
`TranslationService::create()`, so the usual cache-invalidation and activity-log events fire.
|
||||
|
||||
**When they run:** a shop's `docker/entrypoint.sh` runs the checkout and validation seeders on
|
||||
every boot. `StorefrontTranslationsSeeder` isn't run automatically (not by `lunar:install`, not on
|
||||
boot), so run it explicitly after a core update that adds keys, or add it to the shop's
|
||||
entrypoint:
|
||||
|
||||
```bash
|
||||
php artisan db:seed --class="Modules\Core\Localization\Database\Seeders\StorefrontTranslationsSeeder"
|
||||
```
|
||||
|
||||
**Lines added in the admin** while building a storefront are copied back into the seeders with
|
||||
`php artisan boboko:translations:pull` (local mode; see `CONTRIBUTE.md`, "Translations added in
|
||||
the UI"). A key that exists only in one shop's database shows as a raw key everywhere else.
|
||||
|
||||
### Admin UI
|
||||
|
||||
|
||||
+25
-55
@@ -42,10 +42,10 @@ boboko-core/ (this repo)
|
||||
Stoic/
|
||||
```
|
||||
|
||||
The e-shop app (`boboko-test`) consumes it as `vendor/boboko/core`:
|
||||
A shop app (e.g. `3dealer`) consumes it as `vendor/boboko/core`:
|
||||
|
||||
```
|
||||
boboko-test/
|
||||
my-shop/
|
||||
app/
|
||||
Models/
|
||||
Customer.php ← app-level model, extends Modules\Core\Customer\Models\Customer
|
||||
@@ -75,7 +75,7 @@ Within a module, organise by concern rather than by type (`Auth/`, `Customer/`,
|
||||
|
||||
```json
|
||||
"require": {
|
||||
"boboko/core": "^1.0"
|
||||
"boboko/core": "0.*"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
@@ -99,7 +99,12 @@ This is the **default** — a fresh `composer install` never depends on a local
|
||||
]
|
||||
```
|
||||
|
||||
This is a **manual, deliberate swap** of `composer.json` — not automated, since Composer has no clean built-in mechanism to merge an additional repository on top of the main list per-environment (`composer.local.json` is not auto-merged in Composer 2.x; `COMPOSER_REPOSITORIES` does not merge either — both were tested and ruled out). Swap it back to `vcs` before committing, so CI/prod builds never require `../boboko-core` to exist.
|
||||
Don't swap it by hand: each shop's `bin/core-mode local` / `bin/core-mode repo` does it (and the
|
||||
`package.json` side), restarts the stack, and turns on a pre-commit guard; see `CONTRIBUTE.md`.
|
||||
It's a swap rather than an overlay because Composer has no clean built-in mechanism to merge an additional repository on top of the main list per-environment (`composer.local.json` is not auto-merged in Composer 2.x; `COMPOSER_REPOSITORIES` does not merge either — both were tested and ruled out). The committed state is always the `vcs` form, so CI/prod builds never require `../boboko-core` to exist.
|
||||
|
||||
Below 1.0, shops require core with an open range (`0.*` in Composer, `#semver:0.x` in npm), never
|
||||
a caret: `^0.31.0` means `<0.32.0` and would silently refuse the next minor.
|
||||
|
||||
### Docker Compose: the local-core mount
|
||||
|
||||
@@ -124,58 +129,23 @@ Docker Compose merges `volumes:` lists additively across `-f` files, so the over
|
||||
|
||||
## Frontend Assets (JS/CSS)
|
||||
|
||||
A module's JS (Stimulus controllers) and CSS ship as plain source files under `resources/js/` and `resources/css/` — **there is no separate npm package per module.** A module is never `npm install`ed; its frontend assets are read directly by the consuming app's own Vite build, straight out of `vendor/boboko/<module>`.
|
||||
A module's Stimulus controllers and CSS ship as a **real npm package** (`@boboko/core`),
|
||||
installed into the consumer's `node_modules`: a symlink to `../boboko-core` in local mode
|
||||
(`file:../boboko-core`), a real copy of the tagged release in repo mode
|
||||
(`git+https://…#semver:0.x`). It's a package rather than files read out of `vendor/` so npm
|
||||
installs core's own JS dependencies (`leaflet`, `@hotwired/stimulus`) transitively, the same way
|
||||
Composer does for PHP.
|
||||
|
||||
This mirrors the PHP story above exactly: Composer already gives every environment one single, unconditional path — `vendor/boboko/<module>` — whether that resolves to a symlink into a sibling checkout (local path repo) or a real installed copy (tagged VCS release). A consumer's `vite.config.js` and JS entry point read from that same path, so there is nothing to toggle on the JS side — whatever Composer resolved is exactly what Vite sees, in both dev and prod, automatically.
|
||||
- **One stable entry point:** consumers import only from the `@boboko/core` barrel
|
||||
(`resources/js/index.js`, e.g. `import { registerCheckout, registerWishlist } from "@boboko/core"`),
|
||||
never from a module's internal files, so the internal layout can change freely.
|
||||
- **CSS:** `node_modules/@boboko/core/resources/css/…` in the consumer's Vite inputs and `@vite()`
|
||||
(core's structural checkout CSS loads before the app's own, so the app's theming wins).
|
||||
- **Vite:** the consumer adds the `boboko()` plugin from `@boboko/core/vite-plugin`. It owns the
|
||||
settings the local-mode symlink needs (no stale pre-bundle, symlink-safe resolution, HMR on core
|
||||
edits), so consumers don't copy them.
|
||||
|
||||
**Each module exposes one stable JS entry point** — `resources/js/index.js` — that re-exports whatever a consumer needs, e.g. `boboko-core`'s:
|
||||
|
||||
```js
|
||||
// boboko-core/resources/js/index.js
|
||||
export { registerCheckout } from './checkout/index.js'
|
||||
```
|
||||
|
||||
A consuming app imports from that one file only, never from a path reaching into a module's internal folder structure directly:
|
||||
|
||||
```js
|
||||
// consumer app's resources/js/app.js
|
||||
import { registerCheckout } from "../../vendor/boboko/core/resources/js/index.js";
|
||||
registerCheckout(application);
|
||||
```
|
||||
|
||||
```php
|
||||
{{-- consumer app's layout --}}
|
||||
@vite(['vendor/boboko/core/resources/css/checkout.css', 'resources/css/app.css', 'resources/js/app.js'])
|
||||
```
|
||||
|
||||
This keeps a module's internal file layout free to change without breaking every consumer's entry point — the same reasoning as PSR-4 namespaces for PHP, just for JS imports.
|
||||
|
||||
**A consuming app's `vite.config.js` needs one addition**, because `vendor/boboko/<module>` is a symlink in local path-repo dev (not a real directory Vite would otherwise watch through):
|
||||
|
||||
```js
|
||||
export default defineConfig({
|
||||
server: {
|
||||
watch: {
|
||||
// vendor/boboko/<module> is a symlink into ../boboko-<module> in
|
||||
// local path-repo dev. Vite/chokidar don't follow symlinks for
|
||||
// watched files by default, so edits to a module's source
|
||||
// wouldn't otherwise trigger HMR. No-op against a real installed
|
||||
// copy (tagged VCS release) in production.
|
||||
followSymlinks: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Bare imports inside a module's own JS (e.g. `leaflet`, `@hotwired/stimulus`) resolve against the **consumer's** `node_modules` via Node's normal upward resolution walk from `vendor/boboko/<module>/resources/js/...` — no extra config needed, as long as `vendor/boboko/<module>` sits inside the consumer's own directory tree (true for both the symlink and real-copy case). The consumer's Vite Docker service (if any) needs the same bind mount the PHP containers already get, landing at the equivalent path relative to its own working directory:
|
||||
|
||||
```yaml
|
||||
# consumer app's docker-compose.core-dev.yml
|
||||
services:
|
||||
vite:
|
||||
volumes:
|
||||
- ../boboko-core:/app/vendor/boboko/core # match /app to the vite service's actual workdir
|
||||
```
|
||||
Full details and the export map: `CONTRIBUTE.md`, "JS/CSS: a real npm package".
|
||||
|
||||
---
|
||||
|
||||
@@ -190,7 +160,7 @@ services:
|
||||
"type": "library",
|
||||
"version": "1.0.0",
|
||||
"require": {
|
||||
"boboko/core": "^1.0"
|
||||
"boboko/core": "0.*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@boboko/core",
|
||||
"version": "0.31.0",
|
||||
"version": "0.31.4",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"description": "Portable Stimulus controllers and styles for boboko-core's cart + checkout module. Installed as a real npm dependency (file:../boboko-core in dev, a tagged git install in prod) so a consuming app's `npm install` resolves this package's own dependencies (leaflet, @hotwired/stimulus) transitively, the same way `composer update boboko/*` does for PHP. See CONTRIBUTE.md's \"JS/CSS: a real npm package\" section.",
|
||||
|
||||
@@ -58,6 +58,25 @@
|
||||
--bbk-radius: 8px;
|
||||
--bbk-radius-sm: 4px;
|
||||
--bbk-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
|
||||
|
||||
/* Icons (.bbk-icon) are CSS masks filled with currentColor, so they
|
||||
follow the element's colour (hover, theme). Swap one by pointing its
|
||||
variable at any single-colour SVG — the shape is what counts, not its
|
||||
fill:
|
||||
|
||||
:root { --bbk-icon-remove: url("/images/icons/bin.svg"); }
|
||||
*/
|
||||
--bbk-icon-remove: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6'/%3E%3C/svg%3E");
|
||||
--bbk-icon-shipping: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h11v10H3zM14 9h4l3 3v4h-7z'/%3E%3Ccircle cx='7' cy='17.5' r='1.75'/%3E%3Ccircle cx='17' cy='17.5' r='1.75'/%3E%3C/svg%3E");
|
||||
--bbk-icon-billing: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h14v18l-2.33-1.5L14.33 21 12 19.5 9.67 21l-2.34-1.5L5 21z'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h3'/%3E%3C/svg%3E");
|
||||
--bbk-icon-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h3.5l1.5 4.5-2.25 1.5a11 11 0 0 0 7.25 7.25L16.5 14l4.5 1.5V19a2 2 0 0 1-2 2A16 16 0 0 1 3 5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E");
|
||||
|
||||
/* Payment options, keyed by payment driver; --bbk-icon-payment is the
|
||||
fallback for any driver without its own icon. */
|
||||
--bbk-icon-payment: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 7V5a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V6'/%3E%3Cpath d='M17 14h.01'/%3E%3C/svg%3E");
|
||||
--bbk-icon-payment-stripe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='5' width='19' height='14' rx='2'/%3E%3Cpath d='M2.5 10h19'/%3E%3C/svg%3E");
|
||||
--bbk-icon-payment-cash-on-delivery: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='6' width='19' height='12' rx='2'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Cpath d='M6 12h.01M18 12h.01'/%3E%3C/svg%3E");
|
||||
--bbk-icon-payment-bank-transfer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9.5 12 4l9 5.5M4 20h16M5 10v7M9.67 10v7M14.33 10v7M19 10v7'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.bbk-cart[hidden] { display: none; }
|
||||
@@ -159,6 +178,29 @@
|
||||
.bbk-cart-heading:focus,
|
||||
.bbk-checkout-summary-heading:focus { outline: none; }
|
||||
|
||||
/* Generic masked icon: `<span class="bbk-icon bbk-icon--NAME" aria-hidden="true">`.
|
||||
Sized in em so it scales with the surrounding text; the shape comes from
|
||||
the matching --bbk-icon-NAME variable on :root. */
|
||||
.bbk-icon {
|
||||
display: inline-block;
|
||||
flex: 0 0 auto;
|
||||
width: 1.25em;
|
||||
height: 1.25em;
|
||||
background-color: currentColor;
|
||||
-webkit-mask: var(--bbk-icon) center / contain no-repeat;
|
||||
mask: var(--bbk-icon) center / contain no-repeat;
|
||||
}
|
||||
|
||||
.bbk-icon--remove { --bbk-icon: var(--bbk-icon-remove); }
|
||||
.bbk-icon--shipping { --bbk-icon: var(--bbk-icon-shipping); }
|
||||
.bbk-icon--billing { --bbk-icon: var(--bbk-icon-billing); }
|
||||
.bbk-icon--phone { --bbk-icon: var(--bbk-icon-phone); }
|
||||
/* Generic first, so a driver-specific class below wins when both apply. */
|
||||
.bbk-icon--payment { --bbk-icon: var(--bbk-icon-payment); }
|
||||
.bbk-icon--payment-stripe { --bbk-icon: var(--bbk-icon-payment-stripe); }
|
||||
.bbk-icon--payment-cash-on-delivery { --bbk-icon: var(--bbk-icon-payment-cash-on-delivery); }
|
||||
.bbk-icon--payment-bank-transfer { --bbk-icon: var(--bbk-icon-payment-bank-transfer); }
|
||||
|
||||
.bbk-visually-hidden {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
@@ -279,7 +321,6 @@ a.bbk-cart-item-title:hover { text-decoration: underline; }
|
||||
negative margins so the glyph lines up with the title's first line instead
|
||||
of pushing the row taller. */
|
||||
.bbk-cart-item-remove {
|
||||
font-size: 1.75rem;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
margin: -0.5rem -0.5rem 0 0;
|
||||
@@ -291,6 +332,8 @@ a.bbk-cart-item-title:hover { text-decoration: underline; }
|
||||
|
||||
.bbk-cart-item-remove:hover { background: var(--bbk-color-bg-muted); }
|
||||
|
||||
.bbk-cart-item-remove-icon { width: 1.25rem; height: 1.25rem; }
|
||||
|
||||
.bbk-cart-qty {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -880,7 +923,15 @@ textarea.bbk-field-input { resize: vertical; }
|
||||
|
||||
.bbk-checkout-payment-option:has(input:checked) { border-color: var(--bbk-color-accent); }
|
||||
|
||||
.bbk-checkout-payment-option-name { font-weight: 600; }
|
||||
.bbk-checkout-payment-option-name { flex: 1 1 auto; font-weight: 600; }
|
||||
|
||||
.bbk-checkout-payment-option-icon {
|
||||
font-size: 1.25rem;
|
||||
color: var(--bbk-color-muted);
|
||||
transition: color 0.15s ease;
|
||||
}
|
||||
|
||||
.bbk-checkout-payment-option:has(input:checked) .bbk-checkout-payment-option-icon { color: var(--bbk-color-text); }
|
||||
|
||||
.bbk-payment-element { margin: 0.25rem 0; }
|
||||
|
||||
@@ -1042,6 +1093,12 @@ textarea.bbk-field-input { resize: vertical; }
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.bbk-confirmation-address-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
/* Store-authored rich text (ManageStoreDetails' RichEditor) — may be
|
||||
paragraphs, bold text or a bank/IBAN/BIC table. */
|
||||
.bbk-confirmation-bank-transfer-body {
|
||||
@@ -1071,5 +1128,14 @@ textarea.bbk-field-input { resize: vertical; }
|
||||
flex-direction: column;
|
||||
gap: 0.125rem;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.bbk-address-lines-name { font-weight: 600; }
|
||||
|
||||
.bbk-address-lines-phone {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
margin-top: 0.25rem;
|
||||
color: var(--bbk-color-muted);
|
||||
}
|
||||
@@ -5,11 +5,17 @@
|
||||
@props(['address'])
|
||||
|
||||
<address class="bbk-address-lines">
|
||||
<span>{{ trim(($address->first_name ?? '') . ' ' . ($address->last_name ?? '')) }}</span>
|
||||
<span class="bbk-address-lines-name">{{ trim(($address->first_name ?? '') . ' ' . ($address->last_name ?? '')) }}</span>
|
||||
@if ($address->company_name)<span>{{ $address->company_name }}</span>@endif
|
||||
<span>{{ $address->line_one }}</span>
|
||||
@if ($address->line_two)<span>{{ $address->line_two }}</span>@endif
|
||||
<span>{{ trim(($address->postcode ?? '') . ' ' . ($address->city ?? '')) }}</span>
|
||||
@if ($address->state)<span>{{ $address->state }}</span>@endif
|
||||
@if ($address->contact_phone)<span>{{ $address->contact_phone }}</span>@endif
|
||||
@if ($address->contact_phone)
|
||||
<span class="bbk-address-lines-phone">
|
||||
<span class="bbk-icon bbk-icon--phone" aria-hidden="true"></span>
|
||||
<span class="bbk-visually-hidden">{{ __('checkout.page.phone') }}:</span>
|
||||
{{ $address->contact_phone }}
|
||||
</span>
|
||||
@endif
|
||||
</address>
|
||||
@@ -138,14 +138,20 @@
|
||||
<div class="bbk-confirmation-section bbk-confirmation-addresses">
|
||||
@if ($order->shippingAddress)
|
||||
<section class="bbk-confirmation-address" aria-labelledby="bbk-confirmation-shipping-heading">
|
||||
<h2 class="bbk-confirmation-address-heading" id="bbk-confirmation-shipping-heading">{{ __('checkout.page.confirmation_shipping_to') }}</h2>
|
||||
<h2 class="bbk-confirmation-address-heading" id="bbk-confirmation-shipping-heading">
|
||||
<span class="bbk-icon bbk-icon--shipping" aria-hidden="true"></span>
|
||||
{{ __('checkout.page.confirmation_shipping_to') }}
|
||||
</h2>
|
||||
<x-checkout::address-lines :address="$order->shippingAddress" />
|
||||
</section>
|
||||
@endif
|
||||
|
||||
@if ($order->billingAddress)
|
||||
<section class="bbk-confirmation-address" aria-labelledby="bbk-confirmation-billing-heading">
|
||||
<h2 class="bbk-confirmation-address-heading" id="bbk-confirmation-billing-heading">{{ __('checkout.page.confirmation_billing') }}</h2>
|
||||
<h2 class="bbk-confirmation-address-heading" id="bbk-confirmation-billing-heading">
|
||||
<span class="bbk-icon bbk-icon--billing" aria-hidden="true"></span>
|
||||
{{ __('checkout.page.confirmation_billing') }}
|
||||
</h2>
|
||||
<x-checkout::address-lines :address="$order->billingAddress" />
|
||||
</section>
|
||||
@endif
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
class="bbk-cart-item-remove"
|
||||
aria-label="{{ __('checkout.cart.remove') }}"
|
||||
aria-describedby="bbk-cart-item-title-{{ $line->id }}"
|
||||
><span aria-hidden="true">×</span></button>
|
||||
>{{-- Icon drawn by CSS (--bbk-icon-remove) so themes can swap it. --}}<span class="bbk-icon bbk-icon--remove bbk-cart-item-remove-icon" aria-hidden="true"></span></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
data-action="change->bbk-payment#selectMethod"
|
||||
>
|
||||
<span class="bbk-checkout-payment-option-name">{{ $method->translate('name') }}</span>
|
||||
{{-- Picked by driver (--bbk-icon-payment-{driver}); unknown
|
||||
drivers fall back to the generic --bbk-icon-payment. --}}
|
||||
<span class="bbk-icon bbk-icon--payment bbk-icon--payment-{{ $method->driver }} bbk-checkout-payment-option-icon" aria-hidden="true"></span>
|
||||
</label>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@@ -67,7 +67,7 @@ class CheckoutTranslationsSeeder extends Seeder
|
||||
'cart.shipping_pending' => ['Not selected yet', 'Δεν έχει επιλεγεί ακόμη'],
|
||||
'cart.tax' => ['VAT', 'ΦΠΑ'],
|
||||
'cart.total' => ['Total', 'Σύνολο'],
|
||||
'cart.checkout' => ['Checkout', 'Ολοκλήρωση παραγγελίας'],
|
||||
'cart.checkout' => ['Checkout', 'Ταμείο'],
|
||||
'cart.coupon_label' => ['Coupon code', 'Κωδικός κουπονιού'],
|
||||
'cart.coupon_placeholder' => ['Coupon code', 'Κωδικός κουπονιού'],
|
||||
'cart.coupon_apply' => ['Apply', 'Εφαρμογή'],
|
||||
@@ -153,7 +153,7 @@ class CheckoutTranslationsSeeder extends Seeder
|
||||
"You have a 14-day right of withdrawal. <a href=':link' target='_blank'>See details</a>.",
|
||||
"Έχεις δικαίωμα υπαναχώρησης εντός 14 ημερών. <a href=':link' target='_blank'>Δες λεπτομέρειες</a>.",
|
||||
],
|
||||
'page.place_order' => ['Place order — payment obligation', 'Παραγγελία με υποχρέωση πληρωμής'],
|
||||
'page.place_order' => ['Complete purchase', 'Ολοκλήρωση αγοράς'],
|
||||
'page.choose_payment_method' => ['Choose a payment method.', 'Επίλεξε τρόπο πληρωμής.'],
|
||||
'page.shipping_method_required' => [
|
||||
'Choose a shipping method below to continue.',
|
||||
|
||||
@@ -10,33 +10,31 @@ use Lunar\Models\Product;
|
||||
/**
|
||||
* lunarphp/meilisearch's own `lunar:meilisearch:setup` only pushes
|
||||
* filterableAttributes/sortableAttributes (see MeilisearchSetup::handle())
|
||||
* — it has no notion of typo tolerance or prefix search, and Meilisearch's
|
||||
* defaults for both are loose enough to produce bad matches on short Greek
|
||||
* words. Confirmed via showMatchesPosition that a query for "Κάπτεν" was
|
||||
* matching "κανένας" purely through prefixSearch's default 'indexingTime'
|
||||
* behavior (their edit distance is far past anything typo tolerance would
|
||||
* bridge) — fixed by disabling prefix search below, verified afterward with
|
||||
* "Super"/"Superheroes"-style prefix probes returning no results for a
|
||||
* partial word. minWordSizeForTypos is tightened defensively alongside it
|
||||
* so short words in general get less typo-tolerant fuzzing, even though a
|
||||
* separate short-word collision case ("Κάπτεν" vs "κάποτε", high letter
|
||||
* overlap despite real edit distance) persisted after both settings were
|
||||
* confirmed live and wasn't fully root-caused — treated as a known,
|
||||
* narrow edge case rather than a blocker. Run this after
|
||||
* `lunar:meilisearch:setup`, whenever Product's index needs
|
||||
* (re)provisioning.
|
||||
* — it has no notion of typo tolerance or prefix search. This tunes both
|
||||
* on the product index; run it after `lunar:meilisearch:setup` (the app's
|
||||
* entrypoint runs it on every boot).
|
||||
*
|
||||
* Disabling prefix search here is a deliberate tradeoff: it also turns off
|
||||
* legitimate partial-word matching (typing "car" matching "cart" before
|
||||
* you finish the word) — useful for a future autocomplete/search-as-you-
|
||||
* type UI. If that's built later, re-enable prefixSearch deliberately then,
|
||||
* informed by real UX needs, rather than leaving it on by accident today.
|
||||
* Typo tolerance: one typo only from 10, two from 16. Meilisearch measures
|
||||
* these thresholds so that Greek words count about double (verified
|
||||
* 2026-10-19: with the old 8/12, the 6-letter "μπαλόκ" still matched
|
||||
* "μπρελόκ" with two typos, while 7-letter Latin words got none). Combined
|
||||
* with prefix search, that let short Greek queries match almost anything
|
||||
* ("κατανα" → 179 products, "Κάπτεν" → "Μπανάνα Κατάνα"). At 10/16 a Greek
|
||||
* word gets one typo from 5 letters and two from 8 ("κατανα" → 9,
|
||||
* "Κάπτεν" → 1); Latin words from 10 and 16 letters.
|
||||
*
|
||||
* Prefix search is ON (`indexingTime`, Meilisearch's default): the last
|
||||
* word of a query also matches words starting with it, so "παπ" finds
|
||||
* "Παπάκι" and "cli" finds "clicker" — what the storefront's live search
|
||||
* needs as the shopper types (3+ characters). It had been disabled before
|
||||
* live search existed, while the loose Greek typo matching above was
|
||||
* being traced.
|
||||
*/
|
||||
class TuneProductSearchCommand extends Command
|
||||
{
|
||||
protected $signature = 'lunar:meilisearch:tune-product-search';
|
||||
|
||||
protected $description = 'Tighten typo-tolerance and disable prefix search on the product search index';
|
||||
protected $description = 'Tighten typo tolerance and enable prefix search on the product search index';
|
||||
|
||||
public function handle(EngineManager $engineManager): void
|
||||
{
|
||||
@@ -49,16 +47,16 @@ class TuneProductSearchCommand extends Command
|
||||
|
||||
$task = $index->updateTypoTolerance([
|
||||
'minWordSizeForTypos' => [
|
||||
'oneTypo' => 8,
|
||||
'twoTypos' => 12,
|
||||
'oneTypo' => 10,
|
||||
'twoTypos' => 16,
|
||||
],
|
||||
]);
|
||||
|
||||
$engine->waitForTask($task['taskUid']);
|
||||
|
||||
$this->components->info('Disabling prefix search for product search...');
|
||||
$this->components->info('Enabling prefix search for product search...');
|
||||
|
||||
$task = $index->updatePrefixSearch('disabled');
|
||||
$task = $index->updatePrefixSearch('indexingTime');
|
||||
|
||||
$engine->waitForTask($task['taskUid']);
|
||||
|
||||
|
||||
@@ -86,6 +86,11 @@ class StorefrontTranslationsSeeder extends Seeder
|
||||
// ── Search ──────────────────────────────────────────────────
|
||||
'search.placeholder' => ['Search products…', 'Αναζήτηση προϊόντων…'],
|
||||
'search.results_for' => ['Search results for ', 'Αποτελέσματα αναζήτησης για '],
|
||||
// Live search: the link under the suggestions to the full results page.
|
||||
'search.view_all' => [
|
||||
'{1} View :count result|[2,*] View all :count results',
|
||||
'{1} Δες :count αποτέλεσμα|[2,*] Δες όλα τα :count αποτελέσματα',
|
||||
],
|
||||
|
||||
'customer_reviews' => [
|
||||
'{0} No customer reviews|{1} :count customer review|[2,*] :count customer reviews',
|
||||
|
||||
Reference in new issue
Block a user