notation_site library

A site of notation files held in memory (pages/.txt, components/.txt, site.json): read and expanded by the rules of the command-line expand <site folder>, with no file system.

Classes

NotationSiteExpander
Expands a site's files with what the site and a design system give them (see the library's comment), as the tool's NotationExpander does.
NotationSiteFiles
A site's files as the expander reads them.
OverlayScoping
What scopeOverlays did and what it could not do.

Constants

notationAppStatePath → const String
The path of an app's state file as a project keeps it (at its root, beside pages/ and components/): the state every page and component shares, as state lines (readNotationAppState).
notationBuiltKey → const String
The key of a manifest that says what expand wrote in it: {"all": true} for a manifest written whole (the site has none of its own), or {"variables": [names]} for the variables written from app.txt into the site's own manifest. What it names is not the site's source.
notationSiteDefaults → const NotationSiteSettings
The settings expand <site folder> has with no flag: pages 1440 wide.
notationSiteManifestPath → const String
The path of a site's manifest as a project keeps it (at its root).

Functions

isOverlayEvent(String? event) → bool
Whether event is one scopeOverlays gave a component.
notationBuiltManifest({required Json? source, required List<String> pages, required Map<String, Json> appVariables}) → Json?
The manifest expand writes for a site whose shared state is in app.txt, which a render reads its variables from: source (the site's own manifest; null: none, and the manifest lists pages, the page ids in order) with appVariables (app.txt's, as NotationSiteFiles.appVariables) among its variables, marked as written (notationBuiltKey). Null when there is nothing to write: a manifest of the site's own and no state in app.txt.
notationCallsIn(String text, Set<String> types) → Set<String>
The names of types that text calls: a line written with one as its word (Card#c "…", Card.compact), or type=Card.
notationComponentType(String text) → String?
The type a component's notation text declares (component Name "…", its first line that is not blank or a comment); null when it is not one.
notationIsDefinitions(String text) → bool
Whether text is definitions: its first line that is not blank or a // comment starts with define or primitive .
notationPageOrder(Iterable<String> names) → List<String>
The page ids names in the order a site with no listed pages shows them: home first, then the others by name.
notationSitePath(String path) → String
path with / between its parts and none before the first.
notationSiteVariables(Object? manifestVariables, NotationAppState? app, {void say(int line, String message)?}) → Map<String, Json>
The variables a site's pages read: the manifest's (manifestVariables, its variables as written) and app.txt's (app, null: no such file), as NotationOptions.projectVariables takes them. A name both declare is app.txt's, and said in say at its line of app.txt.
notationSourceManifest(Json manifest) → Json?
manifest (a site.json as read) as the site's source: without what expand wrote in it (notationBuiltKey). Null when all of it was (the site has no manifest of its own).
notationUndeclaredNames(Json document, {required String text, Set<String> known = const {}, Iterable<String>? others, List<String>? drawing}) → List<String>
The names document (a page or a component as expanded) reads, sets or binds in its expressions that known does not hold and the document does not declare with a line of its own (text is its notation: a name with a state line there is declared): what the app's state file still has to declare for the page to show it. In the order first read.
pageScopedId(String id, String page) → String
The id page page's overlay id is given when it is made the page's own: nav--board.
scopeOverlays(List<ScopedPage> pages, List<ScopedComponent> components, {Map<String, ({Json document, String path})> otherComponents = const {}}) → OverlayScoping
Makes the overlays of pages that two or more pages write with one id and draw differently each page's own, and what names them follow (see the head of this file). components are the site's notation components (changed too); otherComponents the types of the site's components that are not (JSON ones): an open of a per-page overlay in one of those is said. pages and components hold documents changed in place.
unscopeOverlays(Json document) → Json
document as its notation wrote it, before scopeOverlays: a page's overlays made its own named as written again (and what names them), a component's events for them its actions again, and the calls' reactions to those events gone. document itself when it has none of them.
writtenOverlayId(String id, String page, Json? canvas) → String?
The id as written of canvas id of a page whose canvas is page when it is one made the page's own (pageScopedId) and its node canvas keeps the written id as its name; else null.

Typedefs

ExpandedNotationSite = ({Map<String, NotationResult> componentResults, List<ScopedComponent> components, List<ScopedPage> pages, List<NotationResult> results, OverlayScoping scoping})
A site expanded whole (NotationSiteExpander.expandAll).
NotationComponentSource = ({String path, String text, String type})
A component written in the notation: its type (the name on its component line), its file and its text.
NotationSiteProblem = ({int? line, String message, String path})
Something of a site's file that is not read, or must be said: the file, its line when it has one, and what to write.
NotationSiteSettings = ({bool named, bool nearestColors, bool open, bool reflow, NotationVocabulary vocabulary, double width})
How NotationSiteExpander expands each file: the tool's flags.
ScopedComponent = ({Json document, String path, String type})
One notation component of a site: its type, its source file and its document (changed in place).
ScopedPage = ({Json document, String name, String path})
One page of a site: its name (its canvas id), its source file and its document (changed in place).