npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@servicetitan/line-item-editor

v1.2.0

Published

Reusable line-item editor (TreeList grid) and supporting components — extracted from servicetitan/app `st-components` for independent versioning, publishing, and reuse across MFEs.

Readme

@servicetitan/line-item-editor

Reusable line-item editor built on top of the Kendo TreeList and Anvil 2. Originally extracted from servicetitan/app packages/st-components.

A single component that replaces several legacy editing surfaces in the monolith (estimate page, SBET / input-based proposal, margin calculator, invoice page). The host injects a domain-specific data adapter + settings; the component does not know about estimates, invoices, or any specific business domain.

Installation

npm install @servicetitan/line-item-editor

Peer dependencies: react >= 18, react-dom >= 18, @servicetitan/anvil2 >= 3.0.0, @progress/kendo-react-treelist >= 5.19.0, mobx >= 6, mobx-react >= 9, dompurify >= 3 (used by the description sanitizer).

Architecture (4 layers, top-down)

L1 — core           Kendo TreeList, editing, selection, drag-and-drop,
                    tree builder, aggregation engine. Domain-agnostic.

L2 — presets        Column configurator, system column presets,
                    transaction-item / price-field type mappings.

L2.5 — shell        Anvil 2 + MobX glue: toolbar, view modes,
                    column picker, item-group card, configurable
                    services drawer, split-by-type layout.

L4 — host page      The consumer wires an IDataAdapter and ShellSettings
                    and renders <LineItemShell />. Lives in the host
                    application (monolith, MFE, etc.).

Dependencies flow strictly top-down. L1 has no knowledge of L2.5; L4 is the only layer that knows the business domain.

Quick start

import {
    LineItemShell,
    useLineItemShell,
    SystemPresets,
    type IDataAdapter,
} from '@servicetitan/line-item-editor';

const adapter: IDataAdapter = {
    /* host-provided: load, save, validate, search SKUs, ... */
};

const MyEditor = () => {
    const shell = useLineItemShell({
        adapter,
        columnPresets: SystemPresets.estimate,
        viewModes: DEFAULT_VIEW_MODES,
    });

    return <LineItemShell {...shell} />;
};

Public API surface

L1 — core

| Export | Purpose | | --- | --- | | LineItemEditor | Low-level TreeList editor. Used by LineItemShell. | | ItemToolbar / ActionsMenu | Composable toolbar pieces. | | DataManager | Owns the in-memory rows + pending changes. | | SelectionManager | Multi-select + range selection state. | | buildTree / recomputeVirtualAggregates | Flat → tree transform, virtual aggregates. | | computeAggregations | Group totals (sum, count, weighted average). | | ColumnConfigurationManager | Per-user, per-grid column visibility/order/width. |

L1 — editors (cell editors)

TextEditor, NumberEditor, CurrencyEditor, BooleanEditor, TextareaEditor, DropdownEditor, ComboboxEditor, SkuPickerEditor.

createEditorRegistry lets the host register additional editors keyed by column type.

L1 — types

LineItemNode, ViewConfig, ColumnConfig, HierarchyConfig, AggregationConfig, RowLockRule, RowAction, IDataAdapter, MutationResult, SearchResultItem, DataContext, CreateContext, SearchContext, MoveTarget, BulkOperation, ValidationResult, EditorPlugin, EditorProps, ChangeEvent, PendingChange, ClientValidationRule, LineItemEditorProps, LineItemEditorRef, ExternalEditorContext, CellRendererProps.

L2 — presets

| Export | Purpose | | --- | --- | | createColumnContext | Build the per-row context passed to columns. | | SystemPresets | Built-in column sets (estimate, invoice, …). | | getConfigurableColumns | Compute which columns the user can toggle. | | TransactionItemType, CalculatePriceFields (types) | Pricing-adjacent type aliases. |

L2.5 — shell

| Export | Purpose | | --- | --- | | LineItemShell | The full grid + toolbar + drawers composite. Drop in. | | useLineItemShell | Hook that wires adapter + settings into a shell. | | ShellGridKeys, getGridKey | Build-time constants for grid identifiers used by column-config storage. | | SplitByTypeLayout | Layout that renders one grid per SKU type. | | ShellOverlays | Loading / error / empty overlays. | | DefaultToolbar, DEFAULT_VIEW_MODES, ItemGroupCard | Stock toolbar + view modes + group card. | | createNameAndCodeView, createDescriptionView | View-mode factory helpers. | | ConfigurableServicesDrawer | Drawer for the "configurable service" workflow. | | PricingItemsGrid, PricingToolbar | Pricing-tool / margin-calc grid. |

Utilities

| Export | Purpose | | --- | --- | | sanitizeHtml, sanitizeRichText, stripHtml | DOMPurify-backed sanitizers for description fields. | | formatMoney | Locale-aware currency formatter (replaces accounting). |

Adjacent components

This package also ships a small RichTextEditor used inside the editor description fields. It lives at @servicetitan/line-item-editor/... once we firm up the entry-points; for now it is re-exported from the root index.

Storage / persistence

The editor never persists anything on its own. The host supplies an IDataAdapter for line-item CRUD and an IColumnConfigStorage for per-user column configuration. Both interfaces are exported from L1.

Status

Pre-release (v0.0.x). Public API still in motion. No tests yet — tests are tracked as the next blocker before a 1.0 cut.