Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
shared-key: rust-sqlpage-proj-test
save-if: ${{ github.ref == 'refs/heads/main' }}
- run: cargo fmt --all -- --check
- run: cargo test --locked --features config-schema --test mod configuration_docs
- run: cargo clippy --all-targets --all-features -- -D warnings
# The database matrix below runs the same Rust test harnesses against
# different DATABASE_URL values. Package the Linux test executables once
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## unreleased

- Each `login` component’s labels target its own fields. Set `false AS autofocus` to keep the username field from taking focus when the page opens.
- The official documentation now connects tutorials, component examples, and the function reference through shared navigation. Browse by task, open search with Ctrl+K or ⌘K, and share a link to a specific parameter. Code blocks have copy controls. Wide examples show SQL beside the live result.
- JSON `shell` menu items with a link are now links in the accessibility tree instead of being announced as buttons; only submenu toggles keep `role="button"`.
- The new [`status_bar` component](https://sql-page.com/component.sql?component=status_bar) displays short status messages and links along the bottom of the screen or inline with page content.
- A file input with `multiple` now keeps every selected file, instead of only the last one. The new [`sqlpage.persist_uploaded_files`](https://sql-page.com/functions.sql?function=persist_uploaded_files) function saves them all and returns a JSON array with the `path`, original `name`, `mime_type` and `size` of each file.
Expand Down
25 changes: 25 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ tokio = { version = "1.24.1", features = ["macros", "rt", "process", "sync"] }
tokio-stream = "0.1.9"
anyhow = "1"
serde = "1"
schemars = { version = "1", optional = true }
serde_json = { version = "1.0.82", features = [
"preserve_order",
"raw_value",
Expand Down Expand Up @@ -137,6 +138,7 @@ opentelemetry-semantic-conventions = { version = "0.33", features = ["semconv_ex

[features]
default = []
config-schema = ["dep:schemars"]
odbc-static = ["odbc-sys", "odbc-sys/vendored-unix-odbc"]
lambda-web = [
"dep:actix-http",
Expand All @@ -151,3 +153,7 @@ actix-http = "3"
tempfile = "3"
tokio = { version = "1", features = ["rt", "time", "test-util"] }

[[example]]
name = "export_config_schema"
required-features = ["config-schema"]

15 changes: 15 additions & 0 deletions examples/export_config_schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use schemars::generate::SchemaSettings;
use sqlpage::app_config::AppConfig;
use std::io::{self, Write};

fn main() -> anyhow::Result<()> {
let settings =
SchemaSettings::draft2020_12().with(|settings| settings.inline_subschemas = true);
let schema = settings
.into_generator()
.into_root_schema_for::<AppConfig>();
let mut stdout = io::stdout().lock();
serde_json::to_writer_pretty(&mut stdout, &schema)?;
writeln!(stdout)?;
Ok(())
}
2 changes: 1 addition & 1 deletion examples/official-site/404.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
select 'status_code' as component, 404 as status;
select 'http_header' as component, 'no-store, max-age=0' as "Cache-Control";
select 'dynamic' as component, properties FROM example WHERE component = 'shell' LIMIT 1;
select 'shell-docs' as component, 'Page not found - SQLPage' as title;

select 'hero' as component,
'Not Found' as title,
Expand Down
15 changes: 15 additions & 0 deletions examples/official-site/assets/copy-code.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** Select the code for the browser's Copy command if clipboard access is unavailable. */
export async function copyCode(code, label) {
try {
await navigator.clipboard.writeText(code.textContent);
return `${label} copied.`;
} catch {
code.closest("[tabindex]")?.focus({ preventScroll: true });
const range = document.createRange();
range.selectNodeContents(code);
const selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
return `${label} selected. Use Copy.`;
}
}
112 changes: 112 additions & 0 deletions examples/official-site/assets/docs/catalog-preview.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
.catalog-picks {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 0.5rem;
width: 100%;
max-width: 29rem;
}
.catalog-pick {
min-width: 0;
border: 1px solid #304256;
border-radius: 0.5rem;
background: #101a26;
color: #dce8f6;
text-decoration: none;
}
.catalog-pick:is(:hover, :focus-visible) {
border-color: #85acdb;
color: #fff;
text-decoration: none;
}
.catalog-pick-art {
display: grid;
place-items: center;
height: 5rem;
padding: 0.55rem;
border-radius: 0.5rem 0.5rem 0 0;
background: linear-gradient(145deg, #192a3e, #121c2a);
pointer-events: none;
user-select: none;
}
.catalog-pick-label {
display: flex;
justify-content: space-between;
align-items: center;
gap: 0.2rem;
padding: 0.4rem 0.55rem;
border-top: 1px solid #304256;
font: 500 0.85rem / 1.4 var(--tblr-font-monospace);
}
.catalog-pick-label svg {
color: #94b6de;
}
.catalog-thumb-table,
.catalog-thumb-form,
.catalog-thumb-chart {
width: 100%;
max-width: 6.25rem;
}
.catalog-thumb-table,
.catalog-thumb-form {
font: 500 0.55rem / 1.1 var(--tblr-font-monospace);
color: #bdcde1;
}
.catalog-thumb-table {
border: 1px solid #3b506b;
border-collapse: separate;
border-spacing: 0;
border-radius: 0.2rem;
overflow: hidden;
background: #101b29;
}
.catalog-thumb-table :is(th, td) {
padding: 0.12rem 0.3rem;
text-align: left;
}
.catalog-thumb-table tr > :last-child {
border-left: 1px solid #304258;
text-align: right;
}
.catalog-thumb-table th {
background: #283e58;
color: #d5e7ff;
}
.catalog-thumb-table td {
border-top: 1px solid #293a4e;
}
.catalog-thumb-form {
display: grid;
gap: 0.28rem;
}
.catalog-thumb-form b {
display: block;
margin-top: 0.1rem;
padding: 0.15rem 0.3rem;
border: 1px solid #526c8b;
border-radius: 0.16rem;
background: #101b29;
color: #d5e7ff;
font-weight: 400;
}
.catalog-thumb-chart {
display: flex;
align-items: end;
justify-content: space-evenly;
height: 3.2rem;
padding-inline: 3%;
border-left: 1px solid #556b86;
border-bottom: 1px solid #556b86;
background: repeating-linear-gradient(
to top,
transparent 0 calc(33.333% - 1px),
#2d415a calc(33.333% - 1px) 33.333%
);
}
.catalog-thumb-chart i {
width: 9%;
border-radius: 0.12rem 0.12rem 0 0;
background: #6896ca;
}
.catalog-thumb-chart i:last-child {
background: #a6ceff;
}
Loading
Loading