mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-30 18:25:01 +01:00
crates/engine/src/cmd/table.rs: both export lists. crates/engine/src/cmd/table/structure.rs: #1676's Insert Table validation, #1679's MAX_CONVERTED_CELLS. crates/ui-egui/src/dialogs.rs, dialogs/tests.rs: kept #1676's Insert Table dialog, Insert Pages and #1679's Convert dialogs and tests. crates/ui-egui/src/menus/tables.rs, tests.rs, ui_commands.rs: flat Convert Cell items; Convert dialogs in the menu. crates/ui-egui/src/i18n/*.rs: kept both sides' keys.
33 lines
1.1 KiB
Rust
33 lines
1.1 KiB
Rust
//! Table menu: create, convert, insert/delete rows and columns, merge, cell/row/column options,
|
|
//! table options and cell selection.
|
|
//!
|
|
//! Commands target the table at the text selection (a caret in a cell or next to a table anchor),
|
|
//! the selected cells, or an explicit `{story, table}`; `rows: [a, b]` / `cols: [a, b]` (or `row` /
|
|
//! `col`) narrow the cell range (default: the selected cells, else the caret's cell, else the
|
|
//! whole table).
|
|
|
|
use designcraft_compose as compose;
|
|
use designcraft_doc::story::floor_char_boundary;
|
|
use designcraft_doc::{
|
|
AltFills, CellAddr, CellRange, CellStroke, Document, RowHeightMode, RowKind, Selection, StoryId, StrokeType, Table, TableSel, TextSel,
|
|
VerticalJustification,
|
|
};
|
|
use serde_json::{Value, json};
|
|
|
|
use super::{CommandSpec, bad, cmd, f64_or, has_doc, has_text, ok, str_param};
|
|
use crate::{Result, Session};
|
|
|
|
mod cell;
|
|
mod content;
|
|
mod options;
|
|
mod registry;
|
|
mod selection;
|
|
mod sizing;
|
|
mod structure;
|
|
mod styles;
|
|
mod target;
|
|
|
|
pub use registry::specs;
|
|
pub(crate) use selection::{one_selected_cell_to_text, step_cell};
|
|
pub use structure::{MAX_BODY_ROWS, MAX_COLUMNS, MAX_CONVERTED_CELLS, MAX_HEADER_FOOTER_ROWS};
|