@graview/core 0.1.15 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -5
- package/dist/app.d.ts +8 -8
- package/dist/app.d.ts.map +1 -1
- package/dist/arrangement.d.ts +2 -2
- package/dist/arrangement.d.ts.map +1 -1
- package/dist/arrangement.js +5 -5
- package/dist/arranging.js +3 -3
- package/dist/capabilities.js +1 -1
- package/dist/capabilities.js.map +1 -1
- package/dist/city.d.ts +5 -5
- package/dist/city.js +3 -3
- package/dist/cli/check/beginnings.js +2 -2
- package/dist/cli/check/brand.d.ts.map +1 -1
- package/dist/cli/check/brand.js +15 -9
- package/dist/cli/check/brand.js.map +1 -1
- package/dist/cli/check/city.js +1 -1
- package/dist/cli/check/context.js +1 -1
- package/dist/cli/check/relations.js +2 -2
- package/dist/cli/check/relations.js.map +1 -1
- package/dist/cli/check/settings.js +8 -8
- package/dist/cli/check/settings.js.map +1 -1
- package/dist/cli/check/views.d.ts +1 -1
- package/dist/cli/check/views.js +1 -1
- package/dist/cli/create.d.ts +1 -1
- package/dist/cli/create.js +5 -5
- package/dist/cli/describe.d.ts +1 -1
- package/dist/cli/describe.js +2 -2
- package/dist/cli/describe.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/columns.d.ts +1 -1
- package/dist/columns.js +1 -1
- package/dist/compiled.d.ts.map +1 -1
- package/dist/compiled.js +6 -2
- package/dist/compiled.js.map +1 -1
- package/dist/conformance/fixtures.d.ts.map +1 -1
- package/dist/conformance/fixtures.js +194 -0
- package/dist/conformance/fixtures.js.map +1 -1
- package/dist/describe.d.ts +1 -1
- package/dist/describe.d.ts.map +1 -1
- package/dist/document/brand-check.d.ts +10 -0
- package/dist/document/brand-check.d.ts.map +1 -0
- package/dist/document/brand-check.js +33 -0
- package/dist/document/brand-check.js.map +1 -0
- package/dist/document/brand.d.ts +10 -0
- package/dist/document/brand.d.ts.map +1 -0
- package/dist/document/brand.js +49 -0
- package/dist/document/brand.js.map +1 -0
- package/dist/document/compile-checked.d.ts.map +1 -1
- package/dist/document/compile-checked.js +6 -2
- package/dist/document/compile-checked.js.map +1 -1
- package/dist/document/compile.d.ts +6 -0
- package/dist/document/compile.d.ts.map +1 -1
- package/dist/document/compile.js +4 -13
- package/dist/document/compile.js.map +1 -1
- package/dist/document/compiled.d.ts.map +1 -1
- package/dist/document/compiled.js +12 -4
- package/dist/document/compiled.js.map +1 -1
- package/dist/document/describe-place.d.ts +16 -0
- package/dist/document/describe-place.d.ts.map +1 -1
- package/dist/document/describe-place.js +14 -1
- package/dist/document/describe-place.js.map +1 -1
- package/dist/document/diff.d.ts +1 -1
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +52 -7
- package/dist/document/diff.js.map +1 -1
- package/dist/document/edit.d.ts +7 -2
- package/dist/document/edit.d.ts.map +1 -1
- package/dist/document/edit.js +188 -48
- package/dist/document/edit.js.map +1 -1
- package/dist/document/expr/analyze.d.ts +2 -2
- package/dist/document/expr/analyze.js +2 -2
- package/dist/document/expr/print.js +1 -1
- package/dist/document/index.d.ts +3 -1
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +1 -0
- package/dist/document/index.js.map +1 -1
- package/dist/document/quote.d.ts +5 -0
- package/dist/document/quote.d.ts.map +1 -0
- package/dist/document/quote.js +17 -0
- package/dist/document/quote.js.map +1 -0
- package/dist/document/respell.d.ts +20 -0
- package/dist/document/respell.d.ts.map +1 -0
- package/dist/document/respell.js +66 -0
- package/dist/document/respell.js.map +1 -0
- package/dist/document/rules.d.ts +2 -2
- package/dist/document/rules.d.ts.map +1 -1
- package/dist/document/rules.js +2 -2
- package/dist/document/rules.js.map +1 -1
- package/dist/document/schema.d.ts +47 -2
- package/dist/document/schema.d.ts.map +1 -1
- package/dist/document/schema.js +27 -3
- package/dist/document/schema.js.map +1 -1
- package/dist/document/thumbnail.d.ts +9 -0
- package/dist/document/thumbnail.d.ts.map +1 -1
- package/dist/document/thumbnail.js +74 -12
- package/dist/document/thumbnail.js.map +1 -1
- package/dist/document/to-document.js +5 -5
- package/dist/document/to-document.js.map +1 -1
- package/dist/document/upgrade.d.ts +3 -1
- package/dist/document/upgrade.d.ts.map +1 -1
- package/dist/document/upgrade.js +6 -3
- package/dist/document/upgrade.js.map +1 -1
- package/dist/graph/graph.js +3 -3
- package/dist/graph/primitives.d.ts +2 -2
- package/dist/graph/primitives.js +2 -2
- package/dist/index.d.ts +12 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/invariants/engine.js +1 -1
- package/dist/invariants/types.d.ts +3 -3
- package/dist/invariants/types.d.ts.map +1 -1
- package/dist/labels.d.ts +1 -1
- package/dist/modules.d.ts +1 -1
- package/dist/modules.js +1 -1
- package/dist/mutations/define-mutation.js +4 -4
- package/dist/mutations/define-mutation.js.map +1 -1
- package/dist/mutations/derive-edits.js +3 -3
- package/dist/mutations/node-ref.js +1 -1
- package/dist/mutations/types.d.ts +1 -1
- package/dist/mutations/words.js +3 -3
- package/dist/ops/types.d.ts +1 -1
- package/dist/ops/withheld.d.ts +3 -3
- package/dist/permissions/policy.d.ts +1 -1
- package/dist/permissions/policy.js +3 -3
- package/dist/permissions/types.d.ts +2 -2
- package/dist/places.d.ts +19 -2
- package/dist/places.d.ts.map +1 -1
- package/dist/places.js +41 -4
- package/dist/places.js.map +1 -1
- package/dist/scaffold/domain.js +3 -3
- package/dist/scaffold/index.d.ts +1 -1
- package/dist/scaffold/index.d.ts.map +1 -1
- package/dist/scaffold/names.d.ts +1 -1
- package/dist/scaffold/names.js +1 -1
- package/dist/scaffold/names.js.map +1 -1
- package/dist/scaffold/project.d.ts.map +1 -1
- package/dist/scaffold/project.js +4 -1
- package/dist/scaffold/project.js.map +1 -1
- package/dist/scene-districts.d.ts +1 -1
- package/dist/schema/define-node.d.ts +4 -4
- package/dist/schema/define-node.d.ts.map +1 -1
- package/dist/schema/define-node.js +8 -8
- package/dist/schema/define-node.js.map +1 -1
- package/dist/schema/figures.d.ts +1 -1
- package/dist/schema/figures.js +7 -7
- package/dist/schema/figures.js.map +1 -1
- package/dist/schema/types.d.ts +1 -1
- package/dist/search.d.ts +13 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +33 -14
- package/dist/search.js.map +1 -1
- package/dist/seen.d.ts +2 -2
- package/dist/seen.js +12 -12
- package/dist/seen.js.map +1 -1
- package/dist/settings.d.ts +1 -1
- package/dist/settings.js +3 -3
- package/dist/settings.js.map +1 -1
- package/dist/store.d.ts +2 -2
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +8 -8
- package/dist/store.js.map +1 -1
- package/dist/sync/google-calendar.js +1 -1
- package/dist/sync/types.d.ts +2 -2
- package/dist/testing.d.ts +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +2 -2
- package/dist/testing.js.map +1 -1
- package/dist/theme/accent.d.ts +37 -0
- package/dist/theme/accent.d.ts.map +1 -0
- package/dist/theme/accent.js +138 -0
- package/dist/theme/accent.js.map +1 -0
- package/dist/theme/contrast.d.ts +7 -7
- package/dist/theme/contrast.d.ts.map +1 -1
- package/dist/theme/contrast.js +14 -14
- package/dist/theme/contrast.js.map +1 -1
- package/dist/theme/derive.d.ts +4 -4
- package/dist/theme/derive.d.ts.map +1 -1
- package/dist/theme/derive.js +21 -22
- package/dist/theme/derive.js.map +1 -1
- package/dist/theme/fonts.d.ts +19 -0
- package/dist/theme/fonts.d.ts.map +1 -0
- package/dist/theme/fonts.js +74 -0
- package/dist/theme/fonts.js.map +1 -0
- package/dist/theme/identity.d.ts +83 -0
- package/dist/theme/identity.d.ts.map +1 -0
- package/dist/theme/identity.js +128 -0
- package/dist/theme/identity.js.map +1 -0
- package/dist/theme/kit.d.ts +9 -9
- package/dist/theme/kit.d.ts.map +1 -1
- package/dist/theme/kit.js +15 -15
- package/dist/theme/kit.js.map +1 -1
- package/dist/theme/layers.d.ts +2 -2
- package/dist/theme/layers.d.ts.map +1 -1
- package/dist/theme/layers.js +2 -2
- package/dist/theme/layers.js.map +1 -1
- package/dist/theme/look.d.ts +27 -7
- package/dist/theme/look.d.ts.map +1 -1
- package/dist/theme/look.js +30 -6
- package/dist/theme/look.js.map +1 -1
- package/dist/theme/marks.d.ts +28 -0
- package/dist/theme/marks.d.ts.map +1 -0
- package/dist/theme/marks.js +237 -0
- package/dist/theme/marks.js.map +1 -0
- package/dist/theme/palettes.d.ts +15 -7
- package/dist/theme/palettes.d.ts.map +1 -1
- package/dist/theme/palettes.js +61 -53
- package/dist/theme/palettes.js.map +1 -1
- package/dist/theme/types.d.ts +38 -6
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/theme/types.js.map +1 -1
- package/dist/validate-graph.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/watched.js +8 -8
- package/package.json +1 -1
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A BRAND'S MARKS — its logo and its page icon (FR-124) — as a document
|
|
3
|
+
* holds them: an SVG written inline, or a path on the app's own host
|
|
4
|
+
* (`/graview/assets/<sha256>.svg`, where Graview Cloud keeps what a chat
|
|
5
|
+
* hands it). Drawn as given and never redrawn, so an SVG that could act —
|
|
6
|
+
* run a script, answer an event, embed a page, load anything — is refused
|
|
7
|
+
* with the reason rather than quietly rewritten.
|
|
8
|
+
*
|
|
9
|
+
* READ AS THE BROWSER READS IT. An inline mark reaches the page through
|
|
10
|
+
* the HTML parser, which takes a handler after a slash, an unquoted link,
|
|
11
|
+
* markup after the closing tag and a style written in escapes; rules that
|
|
12
|
+
* search the string for what is forbidden miss each of those. So the SVG
|
|
13
|
+
* is read whole, element by element, as both the HTML and the XML parser
|
|
14
|
+
* will read it, and only what a picture needs is kept: the elements a
|
|
15
|
+
* drawing is made of (no `a`, `style`, `script`, `foreignObject`,
|
|
16
|
+
* animation or `feImage`), no prefixed element, every attribute quoted and
|
|
17
|
+
* apart from the last, no handler, a link only within the picture (`#id`,
|
|
18
|
+
* or a `data:image/` on an `<image>`), a paint or a style that reaches only
|
|
19
|
+
* within it, no CDATA, no entity, and nothing after the root. These are
|
|
20
|
+
* the rules Graview Cloud's `add_image` holds an image to.
|
|
21
|
+
*/
|
|
22
|
+
/** The most an inline SVG mark may be, in characters. */
|
|
23
|
+
export const MAX_INLINE_SVG = 64 * 1024;
|
|
24
|
+
/** Whether a mark is an SVG written inline, rather than a path to one. */
|
|
25
|
+
export function isInlineSvg(mark) {
|
|
26
|
+
return /^\s*(<\?xml[^>]*>\s*)?(<!--[\s\S]*?-->\s*)*(<!DOCTYPE svg[^>]*>\s*)?<svg[\s>/]/i.test(mark);
|
|
27
|
+
}
|
|
28
|
+
const SVG_NS = "http://www.w3.org/2000/svg";
|
|
29
|
+
const OTHER_MARKUP = ["http://www.w3.org/1999/xhtml", "http://www.w3.org/1998/Math/MathML", SVG_NS];
|
|
30
|
+
/** What a picture is made of, spelled as SVG spells it: the HTML parser maps its lower-case reading back to these. */
|
|
31
|
+
const ELEMENTS = new Set(("svg g defs symbol use title desc path rect circle ellipse line polyline polygon text tspan textPath " +
|
|
32
|
+
"linearGradient radialGradient stop pattern clipPath mask marker image filter feBlend feColorMatrix " +
|
|
33
|
+
"feComponentTransfer feComposite feDropShadow feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur " +
|
|
34
|
+
"feMerge feMergeNode feMorphology feOffset feTile feTurbulence").split(" "));
|
|
35
|
+
/** Elements whose content the HTML parser reads as HTML: text alone inside them. */
|
|
36
|
+
const TEXT_ONLY = new Set(["title", "desc"]);
|
|
37
|
+
const MEDIA = "it embeds a page or media";
|
|
38
|
+
/** A refused element a reader would look for by name, said as the checker has always said it. */
|
|
39
|
+
const REFUSED_SAID = {
|
|
40
|
+
script: "it has a script in it",
|
|
41
|
+
foreignobject: "it embeds HTML (foreignObject)",
|
|
42
|
+
iframe: MEDIA,
|
|
43
|
+
embed: MEDIA,
|
|
44
|
+
object: MEDIA,
|
|
45
|
+
audio: MEDIA,
|
|
46
|
+
video: MEDIA,
|
|
47
|
+
style: "it has a style sheet in it; a mark is styled by its attributes",
|
|
48
|
+
a: "it links to something (an <a> element)",
|
|
49
|
+
};
|
|
50
|
+
const XML_ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', apos: "'" };
|
|
51
|
+
/** An attribute's value as the parser hands it on: character references read; any other named entity is null. */
|
|
52
|
+
function decoded(value) {
|
|
53
|
+
let unknown = false;
|
|
54
|
+
const out = value.replace(/&(#x[0-9a-f]+|#[0-9]+|[a-z][a-z0-9]*);?/gi, (_, ref) => {
|
|
55
|
+
if (ref[0] === "#") {
|
|
56
|
+
const code = ref[1] === "x" || ref[1] === "X" ? parseInt(ref.slice(2), 16) : parseInt(ref.slice(1), 10);
|
|
57
|
+
return code > 0 && code <= 0x10ffff ? String.fromCodePoint(code) : "�";
|
|
58
|
+
}
|
|
59
|
+
const known = XML_ENTITIES[ref.toLowerCase()];
|
|
60
|
+
if (known === undefined)
|
|
61
|
+
unknown = true;
|
|
62
|
+
return known ?? "";
|
|
63
|
+
});
|
|
64
|
+
return unknown ? null : out;
|
|
65
|
+
}
|
|
66
|
+
/** Whether a value reaches only within the picture: no escape, no at-rule, no image function, and every `url(` a fragment of it. */
|
|
67
|
+
function staysWithin(value) {
|
|
68
|
+
if (/\\|@|expression\s*\(|(?:image-set|cross-fade|image|element|src)\s*\(/i.test(value))
|
|
69
|
+
return false;
|
|
70
|
+
for (const [, target] of value.matchAll(/url\s*\(\s*["']?\s*([^)]*)/gi))
|
|
71
|
+
if (!target.startsWith("#"))
|
|
72
|
+
return false;
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
/** Why one attribute may not stand on this element, or null. */
|
|
76
|
+
function attributeProblem(element, name, raw) {
|
|
77
|
+
const value = decoded(raw);
|
|
78
|
+
if (value === null)
|
|
79
|
+
return "it declares XML entities";
|
|
80
|
+
const local = (name.includes(":") ? name.slice(name.indexOf(":") + 1) : name).toLowerCase();
|
|
81
|
+
if (local.startsWith("on"))
|
|
82
|
+
return "it has an event handler (an on… attribute)";
|
|
83
|
+
if (name === "xml:base")
|
|
84
|
+
return "it loads or links to something outside itself";
|
|
85
|
+
if (name === "xmlns")
|
|
86
|
+
return value === SVG_NS ? null : "it changes what its elements are (another xmlns)";
|
|
87
|
+
if (name.startsWith("xmlns:"))
|
|
88
|
+
return OTHER_MARKUP.includes(value) ? "it changes what its elements are (another xmlns)" : null;
|
|
89
|
+
if (local === "href" || local === "src") {
|
|
90
|
+
const link = value.replace(/[\u0000- ]+/g, "");
|
|
91
|
+
if (link.startsWith("#"))
|
|
92
|
+
return null;
|
|
93
|
+
if (element === "image" && /^data:image\/(png|jpe?g|gif|webp|avif);/i.test(link))
|
|
94
|
+
return null;
|
|
95
|
+
return "it loads or links to something outside itself";
|
|
96
|
+
}
|
|
97
|
+
if (!staysWithin(value))
|
|
98
|
+
return local === "style" ? "its style loads something outside itself" : "it loads or links to something outside itself";
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
const ATTRIBUTE = /^\s+([A-Za-z_][A-Za-z0-9_.:-]*)\s*=\s*(?:"([^"<]*)"|'([^'<]*)')/;
|
|
102
|
+
/** Why an SVG may not be drawn as it is: anything that could run, or reach outside the image. Null when it may. */
|
|
103
|
+
export function svgProblem(text) {
|
|
104
|
+
if (/<!ENTITY/i.test(text))
|
|
105
|
+
return "it declares XML entities";
|
|
106
|
+
if (/<!\[CDATA\[/i.test(text))
|
|
107
|
+
return "it has a CDATA section, which the page and the picture read differently";
|
|
108
|
+
const open = [];
|
|
109
|
+
let ended = false;
|
|
110
|
+
let at = /^\s*(<\?xml\s[^?<>]*\?>)?/.exec(text)[0].length;
|
|
111
|
+
while (at < text.length) {
|
|
112
|
+
const rest = text.slice(at);
|
|
113
|
+
const words = /^[^<]+/.exec(rest);
|
|
114
|
+
if (words) {
|
|
115
|
+
if (open.length === 0 && words[0].trim() !== "")
|
|
116
|
+
return "it is not one SVG: there is text outside it";
|
|
117
|
+
at += words[0].length;
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (rest.startsWith("<!--")) {
|
|
121
|
+
const close = rest.indexOf("-->", 4);
|
|
122
|
+
if (close < 0)
|
|
123
|
+
return "it has a comment that never ends";
|
|
124
|
+
const body = rest.slice(4, close);
|
|
125
|
+
if (/^-?>/.test(body) || body.includes("--") || body.includes("<!") || body.endsWith("-"))
|
|
126
|
+
return "it has a comment the page and the picture read differently";
|
|
127
|
+
at += close + 3;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (/^<!DOCTYPE/i.test(rest)) {
|
|
131
|
+
const doctype = /^<!DOCTYPE\s+svg\b[^<>[\]]*>/i.exec(rest);
|
|
132
|
+
if (!doctype || open.length > 0 || ended)
|
|
133
|
+
return "it declares XML entities";
|
|
134
|
+
at += doctype[0].length;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const close = /^<\/([A-Za-z][A-Za-z0-9_.:-]*)\s*>/.exec(rest);
|
|
138
|
+
if (close) {
|
|
139
|
+
if (open.pop() !== close[1])
|
|
140
|
+
return `it is not one SVG: </${close[1]}> closes what is not open`;
|
|
141
|
+
if (open.length === 0)
|
|
142
|
+
ended = true;
|
|
143
|
+
at += close[0].length;
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
const start = /^<([A-Za-z][A-Za-z0-9_.:-]*)/.exec(rest);
|
|
147
|
+
if (!start)
|
|
148
|
+
return "it is not one SVG: it has markup a picture cannot hold";
|
|
149
|
+
const name = start[1];
|
|
150
|
+
const refused = REFUSED_SAID[name.toLowerCase()];
|
|
151
|
+
if (refused)
|
|
152
|
+
return refused;
|
|
153
|
+
if (ended)
|
|
154
|
+
return `it is not one SVG: <${name}> comes after it ends`;
|
|
155
|
+
if (open.length === 0 && name !== "svg")
|
|
156
|
+
return "it is not one SVG";
|
|
157
|
+
if (name.includes(":"))
|
|
158
|
+
return `it has an element of another kind (<${name}>)`;
|
|
159
|
+
if (!ELEMENTS.has(name))
|
|
160
|
+
return `it has a <${name}> element, which a picture does not need`;
|
|
161
|
+
const parent = open[open.length - 1];
|
|
162
|
+
if (parent && TEXT_ONLY.has(parent))
|
|
163
|
+
return `it has an element inside a <${parent}>, which the page reads as HTML`;
|
|
164
|
+
let tag = start[0].length;
|
|
165
|
+
for (let attribute = ATTRIBUTE.exec(rest.slice(tag)); attribute; attribute = ATTRIBUTE.exec(rest.slice(tag))) {
|
|
166
|
+
const problem = attributeProblem(name, attribute[1], attribute[2] ?? attribute[3] ?? "");
|
|
167
|
+
if (problem)
|
|
168
|
+
return problem;
|
|
169
|
+
tag += attribute[0].length;
|
|
170
|
+
}
|
|
171
|
+
const end = /^\s*(\/?)>/.exec(rest.slice(tag));
|
|
172
|
+
if (!end) {
|
|
173
|
+
if (/(?:^|[\s/"'])on[a-z]+\s*=/i.test(rest.slice(tag, tag + 400)))
|
|
174
|
+
return "it has an event handler (an on… attribute)";
|
|
175
|
+
return `it is not one SVG: <${name}>'s attributes are not each quoted and apart`;
|
|
176
|
+
}
|
|
177
|
+
if (end[1] !== "/")
|
|
178
|
+
open.push(name);
|
|
179
|
+
else if (open.length === 0)
|
|
180
|
+
ended = true;
|
|
181
|
+
at += tag + end[0].length;
|
|
182
|
+
}
|
|
183
|
+
if (open.length > 0)
|
|
184
|
+
return `it is not one SVG: <${open[open.length - 1]}> is never closed`;
|
|
185
|
+
return ended ? null : "it is not one SVG";
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Why a mark may not be drawn, or null: an inline SVG under the rules
|
|
189
|
+
* above, or a path on the app's own host — under `/graview/assets/`, or
|
|
190
|
+
* relative to the page, never climbing out of either — and never another
|
|
191
|
+
* origin.
|
|
192
|
+
*/
|
|
193
|
+
export function markProblem(mark) {
|
|
194
|
+
if (isInlineSvg(mark)) {
|
|
195
|
+
if (mark.length > MAX_INLINE_SVG)
|
|
196
|
+
return `it is over ${MAX_INLINE_SVG / 1024} KB, the most an inline SVG may be`;
|
|
197
|
+
return svgProblem(mark);
|
|
198
|
+
}
|
|
199
|
+
if (/^\s*</.test(mark))
|
|
200
|
+
return "it is markup, and not an SVG";
|
|
201
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(mark) || mark.startsWith("//"))
|
|
202
|
+
return "it names another origin; a mark is inline SVG or a path on the app's own host, like /graview/assets/<sha256>.svg";
|
|
203
|
+
if (!/^[A-Za-z0-9._~/-]+$/.test(mark))
|
|
204
|
+
return "a path is letters, digits and . _ ~ / - only";
|
|
205
|
+
if (mark.split("/").some((part) => part === "." || part === ".."))
|
|
206
|
+
return "the path climbs out of where it is (a . or .. in it); name the file itself, like /graview/assets/<sha256>.svg";
|
|
207
|
+
if (mark.startsWith("/") && !mark.startsWith("/graview/assets/"))
|
|
208
|
+
return "a path on the app's own host is under /graview/assets/, or relative to the page";
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* A mark as an address an `<img>` or a `<link rel="icon">` can take: an
|
|
213
|
+
* inline SVG as a `data:` URI, a path, a web address or a `data:` image as
|
|
214
|
+
* given. Undefined for an inline SVG that could act, and for an address of
|
|
215
|
+
* any other scheme (`javascript:` among them). Which origins a mark may
|
|
216
|
+
* name is the checker's to judge (a document's only its own host; a
|
|
217
|
+
* TypeScript brand's wherever its author serves it); a face draws what it
|
|
218
|
+
* is given.
|
|
219
|
+
*/
|
|
220
|
+
export function markHref(mark) {
|
|
221
|
+
if (!mark)
|
|
222
|
+
return undefined;
|
|
223
|
+
if (!isInlineSvg(mark)) {
|
|
224
|
+
if (/^\s*</.test(mark))
|
|
225
|
+
return undefined;
|
|
226
|
+
const scheme = /^\s*([a-z][a-z0-9+.-]*):/i.exec(mark)?.[1]?.toLowerCase();
|
|
227
|
+
if (scheme === undefined || scheme === "http" || scheme === "https")
|
|
228
|
+
return mark;
|
|
229
|
+
return scheme === "data" && /^\s*data:image\//i.test(mark) ? mark : undefined;
|
|
230
|
+
}
|
|
231
|
+
return svgProblem(mark) === null ? `data:image/svg+xml,${encodeURIComponent(mark.trim())}` : undefined;
|
|
232
|
+
}
|
|
233
|
+
/** The page icon a brand asks for, as an address (FR-124), or undefined. */
|
|
234
|
+
export function faviconHref(brand) {
|
|
235
|
+
return markHref(brand?.favicon);
|
|
236
|
+
}
|
|
237
|
+
//# sourceMappingURL=marks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marks.js","sourceRoot":"","sources":["../../src/theme/marks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,yDAAyD;AACzD,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,GAAG,IAAI,CAAC;AAExC,0EAA0E;AAC1E,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,iFAAiF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtG,CAAC;AAED,MAAM,MAAM,GAAG,4BAA4B,CAAC;AAC5C,MAAM,YAAY,GAAG,CAAC,8BAA8B,EAAE,oCAAoC,EAAE,MAAM,CAAC,CAAC;AAEpG,sHAAsH;AACtH,MAAM,QAAQ,GAAG,IAAI,GAAG,CACtB,CACE,sGAAsG;IACtG,qGAAqG;IACrG,sGAAsG;IACtG,+DAA+D,CAChE,CAAC,KAAK,CAAC,GAAG,CAAC,CACb,CAAC;AACF,oFAAoF;AACpF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAC7C,MAAM,KAAK,GAAG,2BAA2B,CAAC;AAC1C,iGAAiG;AACjG,MAAM,YAAY,GAA2B;IAC3C,MAAM,EAAE,uBAAuB;IAC/B,aAAa,EAAE,gCAAgC;IAC/C,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,gEAAgE;IACvE,C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,4EAA4E;AAC5E,MAAM,UAAU,WAAW,CAAC,KAAgD;IAC1E,OAAO,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAClC,CAAC"}
|
package/dist/theme/palettes.d.ts
CHANGED
|
@@ -8,23 +8,31 @@ import type { Scheme, ThemeTokens } from "./types.js";
|
|
|
8
8
|
* base to build on without reaching into the UI package. A theme is a
|
|
9
9
|
* declaration, and declarations live here.
|
|
10
10
|
*
|
|
11
|
+
* Both are built on Graview's identity (`GRAVIEW_COLORS`, the design kit's
|
|
12
|
+
* revision 03): paper and reading ink, with En Dash navy as the accent in
|
|
13
|
+
* daylight. Turquoise is in neither: it is the symbol's point, a fill and
|
|
14
|
+
* never a word, and nothing a scheme draws depends on it.
|
|
15
|
+
*
|
|
11
16
|
* Two schemes, and they are not inversions of each other. Depth is the thing
|
|
12
17
|
* being drawn, and depth behaves differently in the two:
|
|
13
18
|
*
|
|
14
|
-
* - **Dark** is a lit control surface. Things at depth lose
|
|
15
|
-
* dissolve into the ground; the accent
|
|
16
|
-
*
|
|
19
|
+
* - **Dark** is a lit control surface on a deep navy. Things at depth lose
|
|
20
|
+
* luminance and dissolve into the ground; the accent is the navy's own hue
|
|
21
|
+
* made light, so it reads as light rather than as paint, and separation
|
|
22
|
+
* comes from a lit edge.
|
|
17
23
|
* - **Light** is daylight and paper. Things at depth lose CONTRAST and gain
|
|
18
24
|
* haze — real atmospheric perspective — and separation comes from soft cast
|
|
19
|
-
* shadow, the way objects on a desk separate.
|
|
20
|
-
*
|
|
25
|
+
* shadow, the way objects on a desk separate.
|
|
26
|
+
*
|
|
27
|
+
* Neither paints a wash or a glow behind the scene: the ground is a ground,
|
|
28
|
+
* and the scene standing on it is the picture.
|
|
21
29
|
*
|
|
22
|
-
* One rule holds across both: **secondary text is a
|
|
30
|
+
* One rule holds across both: **secondary text is a color, never an
|
|
23
31
|
* opacity.** Opacity composites against whatever is behind and fails contrast
|
|
24
32
|
* silently. `checkContrast` measures every pair on both, and axe-core checks
|
|
25
33
|
* the rendered result on every run of the a11y harness.
|
|
26
34
|
*/
|
|
27
|
-
/** A lit control surface. */
|
|
35
|
+
/** A lit control surface, on navy. */
|
|
28
36
|
export declare const DARK: ThemeTokens;
|
|
29
37
|
/** Daylight and paper. */
|
|
30
38
|
export declare const LIGHT: ThemeTokens;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"palettes.d.ts","sourceRoot":"","sources":["../../src/theme/palettes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"palettes.d.ts","sourceRoot":"","sources":["../../src/theme/palettes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,sCAAsC;AACtC,eAAO,MAAM,IAAI,EAAE,WAkClB,CAAC;AAEF,0BAA0B;AAC1B,eAAO,MAAM,KAAK,EAAE,WAkCnB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAgC,CAAC"}
|
package/dist/theme/palettes.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GRAVIEW_COLORS } from "./identity.js";
|
|
1
2
|
/**
|
|
2
3
|
* The two the framework ships with, as DATA.
|
|
3
4
|
*
|
|
@@ -7,91 +8,98 @@
|
|
|
7
8
|
* base to build on without reaching into the UI package. A theme is a
|
|
8
9
|
* declaration, and declarations live here.
|
|
9
10
|
*
|
|
11
|
+
* Both are built on Graview's identity (`GRAVIEW_COLORS`, the design kit's
|
|
12
|
+
* revision 03): paper and reading ink, with En Dash navy as the accent in
|
|
13
|
+
* daylight. Turquoise is in neither: it is the symbol's point, a fill and
|
|
14
|
+
* never a word, and nothing a scheme draws depends on it.
|
|
15
|
+
*
|
|
10
16
|
* Two schemes, and they are not inversions of each other. Depth is the thing
|
|
11
17
|
* being drawn, and depth behaves differently in the two:
|
|
12
18
|
*
|
|
13
|
-
* - **Dark** is a lit control surface. Things at depth lose
|
|
14
|
-
* dissolve into the ground; the accent
|
|
15
|
-
*
|
|
19
|
+
* - **Dark** is a lit control surface on a deep navy. Things at depth lose
|
|
20
|
+
* luminance and dissolve into the ground; the accent is the navy's own hue
|
|
21
|
+
* made light, so it reads as light rather than as paint, and separation
|
|
22
|
+
* comes from a lit edge.
|
|
16
23
|
* - **Light** is daylight and paper. Things at depth lose CONTRAST and gain
|
|
17
24
|
* haze — real atmospheric perspective — and separation comes from soft cast
|
|
18
|
-
* shadow, the way objects on a desk separate.
|
|
19
|
-
*
|
|
25
|
+
* shadow, the way objects on a desk separate.
|
|
26
|
+
*
|
|
27
|
+
* Neither paints a wash or a glow behind the scene: the ground is a ground,
|
|
28
|
+
* and the scene standing on it is the picture.
|
|
20
29
|
*
|
|
21
|
-
* One rule holds across both: **secondary text is a
|
|
30
|
+
* One rule holds across both: **secondary text is a color, never an
|
|
22
31
|
* opacity.** Opacity composites against whatever is behind and fails contrast
|
|
23
32
|
* silently. `checkContrast` measures every pair on both, and axe-core checks
|
|
24
33
|
* the rendered result on every run of the a11y harness.
|
|
25
34
|
*/
|
|
26
|
-
/** A lit control surface. */
|
|
35
|
+
/** A lit control surface, on navy. */
|
|
27
36
|
export const DARK = {
|
|
28
|
-
// Not black:
|
|
29
|
-
//
|
|
30
|
-
ground: "#
|
|
31
|
-
groundDeep: "#
|
|
32
|
-
wash: "
|
|
33
|
-
"radial-gradient(90% 60% at 12% 108%, rgba(111,220,234,0.10) 0%, transparent 62%)",
|
|
37
|
+
// Not black: the identity's navy taken down to a ground, so a block's hue
|
|
38
|
+
// reads as light on it.
|
|
39
|
+
ground: "#0a0f1f",
|
|
40
|
+
groundDeep: "#060914",
|
|
41
|
+
wash: "none",
|
|
34
42
|
// Nearly opaque, by necessity as much as taste: a captured subtree has
|
|
35
43
|
// nothing behind it, so `backdrop-filter` is a no-op and a translucent fill
|
|
36
44
|
// composites against transparency.
|
|
37
|
-
panel: "rgba(
|
|
38
|
-
panelMuted: "rgba(
|
|
39
|
-
panelWarning: "rgba(
|
|
40
|
-
edge: "rgba(
|
|
41
|
-
edgeBright: "rgba(
|
|
42
|
-
ink: "#
|
|
43
|
-
inkMuted: "#
|
|
44
|
-
inkFaint: "#
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
panel: "rgba(19, 27, 52, 0.96)",
|
|
46
|
+
panelMuted: "rgba(14, 21, 42, 0.94)",
|
|
47
|
+
panelWarning: "rgba(48, 33, 18, 0.95)",
|
|
48
|
+
edge: "rgba(164, 178, 222, 0.18)",
|
|
49
|
+
edgeBright: "rgba(154, 171, 255, 0.6)",
|
|
50
|
+
ink: "#eef0f6",
|
|
51
|
+
inkMuted: "#aab2c6",
|
|
52
|
+
inkFaint: "#97a0b6",
|
|
53
|
+
// The navy's own hue, lightened until it reads as light: 7.8:1 on the
|
|
54
|
+
// panel, and the navy itself is the text on it (7.3:1).
|
|
55
|
+
accent: "#9aabff",
|
|
56
|
+
accentDim: "rgba(154, 171, 255, 0.32)",
|
|
57
|
+
accentInk: GRAVIEW_COLORS.navy,
|
|
48
58
|
warn: "#f0a868",
|
|
49
59
|
good: "#8fdcaa",
|
|
50
60
|
bad: "#ffa3a3",
|
|
51
|
-
glow: "rgba(
|
|
52
|
-
bar: "
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
glow: "rgba(154, 171, 255, 0.18)",
|
|
62
|
+
bar: "rgba(10, 15, 31, 0.96)",
|
|
63
|
+
// No lighter than the panel: an accent derived to read on the panel reads here too.
|
|
64
|
+
float: "rgba(16, 23, 45, 0.98)",
|
|
65
|
+
liftLow: "0 14px 36px -22px #000",
|
|
66
|
+
liftHigh: "0 28px 64px -30px #000",
|
|
56
67
|
tintAlpha: 0.2,
|
|
57
68
|
tintLightness: 52,
|
|
58
69
|
gridAlpha: 0.35,
|
|
59
70
|
};
|
|
60
71
|
/** Daylight and paper. */
|
|
61
72
|
export const LIGHT = {
|
|
62
|
-
//
|
|
63
|
-
// scene glares
|
|
64
|
-
ground:
|
|
65
|
-
groundDeep: "#
|
|
66
|
-
wash: "
|
|
67
|
-
"radial-gradient(80% 60% at 92% 104%, rgba(12,110,120,0.06) 0%, transparent 60%)",
|
|
73
|
+
// The identity's paper: warm off-white, because pure white under a
|
|
74
|
+
// full-bleed scene glares.
|
|
75
|
+
ground: GRAVIEW_COLORS.paper,
|
|
76
|
+
groundDeep: "#efefe8",
|
|
77
|
+
wash: "none",
|
|
68
78
|
panel: "#ffffff",
|
|
69
|
-
panelMuted: "#
|
|
79
|
+
panelMuted: "#fafaf6",
|
|
70
80
|
panelWarning: "#fdf4ea",
|
|
71
|
-
edge: "rgba(24,
|
|
81
|
+
edge: "rgba(24, 33, 58, 0.12)",
|
|
72
82
|
/*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* at 1.93:1. Found by pointing the framework's own contrast check at the
|
|
76
|
-
* framework's own palette, which is the argument for having one.
|
|
83
|
+
* A lit edge is not text and still owes 3:1 — an outline nobody can see is
|
|
84
|
+
* a panel with no edge. Navy at 0.6 over white clears it.
|
|
77
85
|
*/
|
|
78
|
-
edgeBright: "rgba(
|
|
79
|
-
ink:
|
|
80
|
-
// Both clear 4.5:1 on white
|
|
81
|
-
inkMuted:
|
|
82
|
-
inkFaint: "#
|
|
83
|
-
accent:
|
|
84
|
-
accentDim: "rgba(
|
|
86
|
+
edgeBright: "rgba(0, 23, 105, 0.6)",
|
|
87
|
+
ink: GRAVIEW_COLORS.ink,
|
|
88
|
+
// Both clear 4.5:1 on white, on the muted panel and on paper.
|
|
89
|
+
inkMuted: GRAVIEW_COLORS.muted,
|
|
90
|
+
inkFaint: "#626b7d",
|
|
91
|
+
accent: GRAVIEW_COLORS.navy,
|
|
92
|
+
accentDim: "rgba(0, 23, 105, 0.16)",
|
|
85
93
|
accentInk: "#ffffff",
|
|
86
94
|
warn: "#9a5312",
|
|
87
95
|
good: "#1b6436",
|
|
88
96
|
bad: "#a1232d",
|
|
89
|
-
glow: "rgba(
|
|
90
|
-
bar: "
|
|
91
|
-
float: "
|
|
97
|
+
glow: "rgba(0, 23, 105, 0.08)",
|
|
98
|
+
bar: "rgba(255, 255, 255, 0.96)",
|
|
99
|
+
float: "#ffffff",
|
|
92
100
|
// Layered, short-then-long: how something actually casts on a desk.
|
|
93
|
-
liftLow: "0 1px 2px rgba(
|
|
94
|
-
liftHigh: "0 2px 6px rgba(
|
|
101
|
+
liftLow: "0 1px 2px rgba(24,33,58,0.06), 0 8px 24px -12px rgba(24,33,58,0.16)",
|
|
102
|
+
liftHigh: "0 2px 6px rgba(24,33,58,0.08), 0 24px 56px -24px rgba(24,33,58,0.26)",
|
|
95
103
|
tintAlpha: 0.16,
|
|
96
104
|
tintLightness: 46,
|
|
97
105
|
gridAlpha: 0.5,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"palettes.js","sourceRoot":"","sources":["../../src/theme/palettes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"palettes.js","sourceRoot":"","sources":["../../src/theme/palettes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,sCAAsC;AACtC,MAAM,CAAC,MAAM,IAAI,GAAgB;IAC/B,0EAA0E;IAC1E,wBAAwB;IACxB,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,SAAS;IACrB,IAAI,EAAE,MAAM;IACZ,uEAAuE;IACvE,4EAA4E;IAC5E,mCAAmC;IACnC,KAAK,EAAE,wBAAwB;IAC/B,UAAU,EAAE,wBAAwB;IACpC,YAAY,EAAE,wBAAwB;IACtC,IAAI,EAAE,2BAA2B;IACjC,UAAU,EAAE,0BAA0B;IACtC,GAAG,EAAE,SAAS;IACd,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,sE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CAAC,MAAM,OAAO,GAAgC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/theme/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { KitOverrides } from "./kit.js";
|
|
|
6
6
|
* components that read them live. The contract lives here for the same reason
|
|
7
7
|
* the schema does: `graview check` reads declarations, and a theme is a
|
|
8
8
|
* declaration. A custom palette can be wrong in ways nobody notices — a
|
|
9
|
-
* secondary text
|
|
9
|
+
* secondary text color that clears 4.5:1 on a dark ground and fails badly on
|
|
10
10
|
* paper — and contrast is a property the framework can verify rather than
|
|
11
11
|
* trust.
|
|
12
12
|
*/
|
|
@@ -32,7 +32,7 @@ export interface ThemeTokens {
|
|
|
32
32
|
* A STATUS THAT IS GOOD, AND ONE THAT IS BAD: booked, paid, passing;
|
|
33
33
|
* overdue, refused, failing. The accent means "selected" and the warning
|
|
34
34
|
* means "a rule is broken", and a badge that meant neither invented a
|
|
35
|
-
*
|
|
35
|
+
* color of its own and checked it by hand, if at all. Text colors,
|
|
36
36
|
* held to 4.5:1 on a panel and on the ground like every other ink.
|
|
37
37
|
*/
|
|
38
38
|
readonly good: string;
|
|
@@ -56,7 +56,7 @@ export interface ThemeTokens {
|
|
|
56
56
|
*
|
|
57
57
|
* Palette, wordmark and typography together, because they are one decision:
|
|
58
58
|
* a brand handing over a hex code has not given you a theme, and a brand
|
|
59
|
-
* handing over a logo without a
|
|
59
|
+
* handing over a logo without a color has not either.
|
|
60
60
|
*/
|
|
61
61
|
export interface Brand {
|
|
62
62
|
/** The product name, shown where the framework shows a wordmark. */
|
|
@@ -65,9 +65,31 @@ export interface Brand {
|
|
|
65
65
|
* A logo, as an inline SVG string or a URL.
|
|
66
66
|
*
|
|
67
67
|
* Inline is preferred and is what `currentColor` support is for: a logo
|
|
68
|
-
* that inherits the ink
|
|
68
|
+
* that inherits the ink color works in both schemes without two files.
|
|
69
69
|
*/
|
|
70
70
|
readonly logo?: string;
|
|
71
|
+
/**
|
|
72
|
+
* What the logo says to someone who cannot see it (FR-124): the app's
|
|
73
|
+
* name when absent. Drawn beside the name, the logo is said only when
|
|
74
|
+
* this says more than the name does.
|
|
75
|
+
*/
|
|
76
|
+
readonly logoAlt?: string;
|
|
77
|
+
/**
|
|
78
|
+
* The page's icon (FR-124), in the same forms as the logo: inline SVG or
|
|
79
|
+
* a same-origin path. Set only by a face that owns the whole page — the
|
|
80
|
+
* Shell, the routed face on its own, an embed told `favicon: true` —
|
|
81
|
+
* never by an embed on somebody else's page. `faviconHref` says it as an
|
|
82
|
+
* address.
|
|
83
|
+
*/
|
|
84
|
+
readonly favicon?: string;
|
|
85
|
+
/** A line under the name (FR-125): a document's `description`. */
|
|
86
|
+
readonly subtitle?: string;
|
|
87
|
+
/**
|
|
88
|
+
* THE SCHEME THE APP PREFERS (FR-124), when the reader has not chosen:
|
|
89
|
+
* "auto" (the default) follows the system's. A host's own `data-theme`
|
|
90
|
+
* stamp, or a scheme the host asks for, is a choice and wins.
|
|
91
|
+
*/
|
|
92
|
+
readonly scheme?: Scheme | "auto";
|
|
71
93
|
readonly typography?: {
|
|
72
94
|
/** Applied to everything. Include a real fallback stack. */
|
|
73
95
|
readonly body?: string;
|
|
@@ -75,13 +97,23 @@ export interface Brand {
|
|
|
75
97
|
readonly display?: string;
|
|
76
98
|
/** Code, ids, anything that must align in columns. */
|
|
77
99
|
readonly mono?: string;
|
|
100
|
+
/**
|
|
101
|
+
* The three weights (100–900): headings, reading text and action
|
|
102
|
+
* labels. Absent, the identity's 550, 450 and 600 on the framework's
|
|
103
|
+
* own face, and 600, 400 and 600 on a face this brand names.
|
|
104
|
+
*/
|
|
105
|
+
readonly weights?: {
|
|
106
|
+
readonly display?: number;
|
|
107
|
+
readonly body?: number;
|
|
108
|
+
readonly label?: number;
|
|
109
|
+
};
|
|
78
110
|
};
|
|
79
111
|
/**
|
|
80
112
|
* How square and how tight this product is.
|
|
81
113
|
*
|
|
82
114
|
* The third axis of an identity, and the one that was missing: with only a
|
|
83
115
|
* palette and a wordmark, four apps built on this looked like the same
|
|
84
|
-
* application four times in different
|
|
116
|
+
* application four times in different colors. A bid desk is square and
|
|
85
117
|
* dense; a household planner is round and roomy. Neither is a component
|
|
86
118
|
* change — both are one number.
|
|
87
119
|
*/
|
|
@@ -96,7 +128,7 @@ export interface Brand {
|
|
|
96
128
|
*
|
|
97
129
|
* The default is a stable hash — fine for "each kind looks like itself",
|
|
98
130
|
* useless for "our people are warm amber and our money is green". Declared
|
|
99
|
-
* here it reaches every surface that
|
|
131
|
+
* here it reaches every surface that colors by kind (chips, districts,
|
|
100
132
|
* calendars) through one lookup, and `graview check` refuses a key that
|
|
101
133
|
* names no declared kind — a silent typo would just quietly hash instead.
|
|
102
134
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/theme/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C;;;;;;;;;;GAUG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;I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AAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IACxD;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,WAAW,CAAC;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,WAAW,CAAC;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,WAAW,CAAC;IAClC,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EA8BzC,CAAC"}
|
package/dist/theme/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/theme/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/theme/types.ts"],"names":[],"mappings":"AAmLA,MAAM,CAAC,MAAM,UAAU,GAAwB;IAC7C,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,sBAAs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AAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,kCAAkC,EAAE;IAC7G,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,qBAAqB,EAAE;IACzF,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,yBAAyB,EAAE;IAC7F,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,yBAAyB,EAAE;IAC9E,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,wBAAwB,EAAE;IAC3F,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,wBAAwB,EAAE;IAC5E,0EAA0E;IAC1E,iEAAiE;IACjE,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE;CACrF,CAAC"}
|
package/dist/validate-graph.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Graph } from "./graph/graph.js";
|
|
|
2
2
|
import { UNSET } from "./graph/primitives.js";
|
|
3
3
|
import { edgeId } from "./graph/types.js";
|
|
4
4
|
import { evaluate } from "./invariants/engine.js";
|
|
5
|
-
import {
|
|
5
|
+
import { humanizeField, labelOf } from "./schema/define-node.js";
|
|
6
6
|
/** Every code, in the order findings are reported. */
|
|
7
7
|
export const GRAPH_FINDING_CODES = [
|
|
8
8
|
"kind-unknown",
|
|
@@ -140,7 +140,7 @@ export function validateGraph(app, snapshot, options = {}) {
|
|
|
140
140
|
code: "node-shape",
|
|
141
141
|
id: node.id,
|
|
142
142
|
detail: field,
|
|
143
|
-
message: `${name}: ${
|
|
143
|
+
message: `${name}: ${humanizeField(field)} does not fit what ${node.kind} declares`,
|
|
144
144
|
repair,
|
|
145
145
|
});
|
|
146
146
|
}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED