pub(crate) const TAG_VIEW: &str = "view";
pub(crate) const TAG_ROW: &str = "row";
pub(crate) const TAG_COLUMN: &str = "column";
pub(crate) const TAG_COL_REMOVED: &str = "col";
pub(crate) const TAG_GRID: &str = "grid";
pub(crate) const TAG_SCROLL: &str = "scroll";
pub(crate) const TAG_PORTAL: &str = "portal";
pub(crate) const TAG_FRAGMENT: &str = "fragment";
pub(crate) const TAG_TEXT: &str = "text";
pub(crate) const TAG_INPUT: &str = "input";
pub(crate) const TAG_IMAGE: &str = "image";
pub(crate) const TAG_CANVAS: &str = "canvas";
pub(crate) const TAG_SLOT: &str = "slot";
pub(crate) const TAG_PAGE_SLOT: &str = "page_slot";
pub(crate) const SCHEMA_VIEW: &str = "ViewElement";
pub(crate) const SCHEMA_ROW: &str = "RowElement";
pub(crate) const SCHEMA_COLUMN: &str = "ColumnElement";
pub(crate) const SCHEMA_GRID: &str = "GridElement";
pub(crate) const SCHEMA_SCROLL: &str = "ScrollElement";
pub(crate) const SCHEMA_PORTAL: &str = "PortalElement";
pub(crate) const SCHEMA_FRAGMENT: &str = "FragmentElement";
pub(crate) const SCHEMA_TEXT: &str = "TextElement";
pub(crate) const SCHEMA_INPUT: &str = "InputElement";
pub(crate) const SCHEMA_IMAGE: &str = "ImageElement";
pub(crate) const SCHEMA_CANVAS: &str = "CanvasElement";
pub(crate) const SCHEMA_SLOT: &str = "SlotElement";
pub(crate) const SCHEMA_PAGE_SLOT: &str = "PageSlotElement";
pub(crate) const PROP_STYLE: &str = "style";
pub(crate) const PROP_BIND_STYLE: &str = "bind_style";
pub(crate) const PROP_BIND_CHILDREN: &str = "bind_children";
pub(crate) const PROP_NODE_REF: &str = "node_ref";
pub(crate) const PROP_FOCUSABLE: &str = "focusable";
pub(crate) const PROP_ON_CLICK: &str = "on_click";
pub(crate) const PROP_ON_CHANGE: &str = "on_change";
pub(crate) const PROP_ON_SCROLL: &str = "on_scroll";
pub(crate) const PROP_ON_POINTER_DOWN: &str = "on_pointer_down";
pub(crate) const PROP_ON_POINTER_MOVE: &str = "on_pointer_move";
pub(crate) const PROP_ON_POINTER_UP: &str = "on_pointer_up";
pub(crate) const PROP_ON_POINTER_ENTER: &str = "on_pointer_enter";
pub(crate) const PROP_ON_POINTER_LEAVE: &str = "on_pointer_leave";
pub(crate) const PROP_ON_HOVER: &str = "on_hover";
pub(crate) const PROP_ON_KEY: &str = "on_key";
pub(crate) const PROP_ON_FOCUS: &str = "on_focus";
pub(crate) const PROP_ON_BLUR: &str = "on_blur";
pub(crate) const PROP_VALUE: &str = "value";
pub(crate) const PROP_PLACEHOLDER: &str = "placeholder";
pub(crate) const PROP_PASSWORD: &str = "password";
pub(crate) const PROP_MULTILINE: &str = "multiline";
pub(crate) const PROP_DISABLED: &str = "disabled";
pub(crate) const PROP_CARET: &str = "caret";
pub(crate) const PROP_SOURCE: &str = "source";
pub(crate) const PROP_PAINTER: &str = "painter";
pub(crate) const PROP_CACHING: &str = "caching";
pub(crate) const PROP_A11Y: &str = "a11y";
pub(crate) const PROP_ROLE: &str = "role";
pub(crate) const PROP_A11Y_LABEL: &str = "a11y_label";
pub(crate) const PROP_A11Y_HINT: &str = "a11y_hint";
pub(crate) const PROP_A11Y_VALUE: &str = "a11y_value";
pub(crate) const PROP_A11Y_DISABLED: &str = "a11y_disabled";
pub(crate) const PROP_A11Y_CHECKED: &str = "a11y_checked";
pub(crate) const PROP_ID: &str = "id";
pub(crate) const PROP_ROUTE: &str = "route";
pub(crate) const PROP_HUB: &str = "hub";
pub(crate) const PROP_FALLBACK: &str = "fallback";
pub(crate) const COMP_EUV_PAGE: &str = "EuvPage";
pub(crate) const COMP_EUV_FORM: &str = "EuvForm";
pub(crate) const COMP_EUV_NAVBAR: &str = "EuvNavbar";
pub(crate) const COMP_EUV_STAT_GRID: &str = "EuvStatGrid";
pub(crate) const METHOD_SECTION: &str = "section";
pub(crate) const METHOD_FIELD: &str = "field";
pub(crate) const METHOD_ACTION: &str = "action";
pub(crate) const METHOD_CARD: &str = "card";
pub(crate) const METHOD_CHILD: &str = "child";
pub(crate) const KNOWN_VIEW_PROPS: &[&str] = &[
PROP_STYLE,
PROP_BIND_STYLE,
PROP_BIND_CHILDREN,
PROP_NODE_REF,
PROP_FOCUSABLE,
PROP_ON_CLICK,
PROP_ON_CHANGE,
PROP_ON_SCROLL,
PROP_ON_POINTER_DOWN,
PROP_ON_POINTER_MOVE,
PROP_ON_POINTER_UP,
PROP_ON_POINTER_ENTER,
PROP_ON_POINTER_LEAVE,
PROP_ON_HOVER,
PROP_ON_KEY,
PROP_ON_FOCUS,
PROP_ON_BLUR,
PROP_VALUE,
PROP_PLACEHOLDER,
PROP_PASSWORD,
PROP_MULTILINE,
PROP_DISABLED,
PROP_CARET,
PROP_SOURCE,
PROP_PAINTER,
PROP_CACHING,
PROP_A11Y,
PROP_ROLE,
PROP_A11Y_LABEL,
PROP_A11Y_HINT,
PROP_A11Y_VALUE,
PROP_A11Y_DISABLED,
PROP_A11Y_CHECKED,
PROP_ID,
PROP_ROUTE,
PROP_HUB,
PROP_FALLBACK,
];
pub(crate) const ERR_LEGACY_VIEW_CTX: &str = "view! manages Context automatically; remove explicit `ctx` / `in ctx,` and wrap external scenes in `with_context(ctx, || view! { ... })`";
pub(crate) const ERR_VIEW_UNEXPECTED_SEMI: &str = "unexpected `;` in `view!` — separate properties and child nodes with newlines without semicolons";
pub(crate) const ERR_TAG_COL_REMOVED: &str =
"tag `col` is removed in `view!` — use `column { ... }` instead";
pub(crate) const ERR_LOOSE_STYLE_PROP_PREFIX: &str = "style property";
pub(crate) const ERR_FRAGMENT_PROP_FORBIDDEN: &str = "`fragment` is a transparent grouping container and only supports `node_ref:` and `bind_children:`";
pub(crate) const ERR_BIND_CHILDREN_CONTAINER_ONLY: &str = "`bind_children:` is only valid on container elements (`view`, `row`, `column`, `grid`, `scroll`, `portal`, `fragment`)";
pub(crate) const ERR_SLOT_FALLBACK_CONFLICT: &str =
"`fallback:` cannot be combined with inline fallback children on `slot` / `page_slot`";
pub(crate) const ERR_IMAGE_MISSING_SOURCE: &str =
"image element requires a `source:` ImageBuffer expression";
pub(crate) const ERR_CANVAS_MISSING_PAINTER: &str =
"canvas element requires a `painter:` closure `|bounds: Rect, dl: &mut DisplayList| { ... }`";
pub(crate) const ERR_SLOT_MISSING_ID: &str =
"`slot` element requires an `id:` string identifying the dynamic component slot";
pub(crate) const ERR_PAGE_SLOT_MISSING_ROUTE: &str =
"`page_slot` element requires a `route:` string identifying the dynamic page route";
pub(crate) const ERR_ID_ONLY_ON_SLOT: &str =
"`id:` is only valid on `slot { id: \"...\" }` dynamic component slots";
pub(crate) const ERR_ROUTE_ONLY_ON_PAGE_SLOT: &str =
"`route:` is only valid on `page_slot { route: \"/...\" }` dynamic page slots";
pub(crate) const ERR_HUB_ONLY_ON_DYNAMIC_SLOT: &str =
"`hub:` and `fallback:` are only valid on `slot` or `page_slot` dynamic elements";
pub(crate) const ERR_SOURCE_ONLY_ON_IMAGE: &str =
"`source:` is only valid on `image { source: ... }` elements";
pub(crate) const ERR_PAINTER_ONLY_ON_CANVAS: &str =
"`painter:` is only valid on `canvas { painter: ... }` elements";
pub(crate) const ERR_CACHING_ONLY_ON_CANVAS: &str =
"`caching:` is only valid on `canvas { caching: ... painter: ... }` elements";
pub(crate) const ERR_INPUT_PROP_ONLY_ON_INPUT: &str = "`value:`, `placeholder:`, `password:`, `multiline:`, `disabled:`, and `caret:` are only valid on `input { ... }` elements";
pub(crate) const ERR_LEAF_CHILDREN_FORBIDDEN: &str =
"leaf elements (`input`, `image`, `canvas`) cannot contain child nodes";
pub(crate) const ERR_BIND_CHILDREN_CONFLICT: &str = "`bind_children:` cannot be combined with inline static children because reactive updates replace all children";
pub(crate) const ERR_A11Y_CONFLICT: &str =
"`a11y:` cannot be combined with individual `role:` or `a11y_*` properties on the same element";
pub(crate) const ERR_TEXT_CHILD_INVALID: &str =
"`text` element accepts at most one string literal or `{ expr }` text expression";
pub(crate) const ERR_SPREAD_IN_EXPR_CONTEXT: &str =
"`..spread` can only appear inside a container, `fragment`, or component children block";
pub(crate) const ERR_DUPLICATE_PROP_PREFIX: &str = "duplicate property";
pub(crate) const IDENT_ROOT: &str = "__euv_root";
pub(crate) const IDENT_FRAG: &str = "__euv_frag";
pub(crate) const IDENT_COMP: &str = "__euv_comp";
pub(crate) const IDENT_NODE: &str = "__euv_node";
pub(crate) const IDENT_FB_ROOT: &str = "__euv_fb_root";
pub(crate) const IDENT_BATCH: &str = "__euv_batch";
pub(crate) const ERR_EXPECTED_BODY_OR_ARGS: &str =
"expected `{ ... }` body after element or component tag";
pub(crate) const ERR_COMPONENT_POSITIONAL_ARGS: &str = "component parameters must be passed as named attributes inside `Component { prop: value }` instead of positional `(...)` arguments";
pub(crate) const HTML_CONTAINER_TAGS: &[&str] = &[
"div", "section", "main", "header", "footer", "nav", "article", "aside", "ul", "ol", "li",
"form",
];
pub(crate) const HTML_TEXT_TAGS: &[&str] = &[
"span", "p", "h1", "h2", "h3", "h4", "h5", "h6", "label", "strong", "code",
];
pub(crate) const HTML_BUTTON_TAGS: &[&str] = &["button", "a"];
pub(crate) const HTML_IMAGE_TAGS: &[&str] = &["img"];
pub(crate) const HTML_REPLACE_CONTAINER: &str = "`column`, `row`, `view`, or `grid`";
pub(crate) const HTML_REPLACE_TEXT: &str = "`text`";
pub(crate) const HTML_REPLACE_BUTTON: &str =
"`EuvButton { label: \"...\" tokens: tokens }` or `view { on_click: ... }`";
pub(crate) const HTML_REPLACE_IMAGE: &str = "`image { source: ... }`";