@graview/core 0.1.72 → 0.1.73
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/dist/answer-seen.d.ts.map +1 -1
- package/dist/answer-seen.js +7 -2
- package/dist/answer-seen.js.map +1 -1
- package/dist/binding-served.d.ts +47 -0
- package/dist/binding-served.d.ts.map +1 -0
- package/dist/binding-served.js +90 -0
- package/dist/binding-served.js.map +1 -0
- package/dist/binding.d.ts +15 -0
- package/dist/binding.d.ts.map +1 -0
- package/dist/binding.js +168 -0
- package/dist/binding.js.map +1 -0
- package/dist/css/faces-words.d.ts +4 -0
- package/dist/css/faces-words.d.ts.map +1 -0
- package/dist/css/faces-words.js +48 -0
- package/dist/css/faces-words.js.map +1 -0
- package/dist/css/faces.d.ts +82 -0
- package/dist/css/faces.d.ts.map +1 -0
- package/dist/css/faces.js +317 -0
- package/dist/css/faces.js.map +1 -0
- package/dist/css/fonts.d.ts +13 -0
- package/dist/css/fonts.d.ts.map +1 -1
- package/dist/css/fonts.js +28 -5
- package/dist/css/fonts.js.map +1 -1
- package/dist/css/sanitize.d.ts +45 -7
- package/dist/css/sanitize.d.ts.map +1 -1
- package/dist/css/sanitize.js +112 -34
- package/dist/css/sanitize.js.map +1 -1
- package/dist/css.d.ts +4 -1
- package/dist/css.d.ts.map +1 -1
- package/dist/css.js +2 -0
- package/dist/css.js.map +1 -1
- package/dist/document/brand-check.d.ts.map +1 -1
- package/dist/document/brand-check.js +2 -0
- package/dist/document/brand-check.js.map +1 -1
- package/dist/document/compile.d.ts.map +1 -1
- package/dist/document/compile.js +6 -0
- package/dist/document/compile.js.map +1 -1
- package/dist/document/compiled.d.ts.map +1 -1
- package/dist/document/compiled.js +9 -0
- package/dist/document/compiled.js.map +1 -1
- package/dist/document/graview-template.d.ts.map +1 -1
- package/dist/document/graview-template.js +3 -1
- package/dist/document/graview-template.js.map +1 -1
- package/dist/document/migrate.d.ts.map +1 -1
- package/dist/document/migrate.js +4 -1
- package/dist/document/migrate.js.map +1 -1
- package/dist/document.schema.json +2 -2
- package/dist/field-sight.d.ts.map +1 -1
- package/dist/field-sight.js +3 -2
- package/dist/field-sight.js.map +1 -1
- package/dist/graph/archived.d.ts +10 -0
- package/dist/graph/archived.d.ts.map +1 -1
- package/dist/graph/archived.js +14 -1
- package/dist/graph/archived.js.map +1 -1
- package/dist/graph/graph.d.ts +19 -0
- package/dist/graph/graph.d.ts.map +1 -1
- package/dist/graph/graph.js +59 -4
- package/dist/graph/graph.js.map +1 -1
- package/dist/import/rows.js +2 -2
- package/dist/import/rows.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/ops/withheld.d.ts +2 -0
- package/dist/ops/withheld.d.ts.map +1 -1
- package/dist/ops/withheld.js +3 -1
- package/dist/ops/withheld.js.map +1 -1
- package/dist/permissions/policy.d.ts +31 -2
- package/dist/permissions/policy.d.ts.map +1 -1
- package/dist/permissions/policy.js +54 -3
- package/dist/permissions/policy.js.map +1 -1
- package/dist/permissions/sight.d.ts +4 -0
- package/dist/permissions/sight.d.ts.map +1 -1
- package/dist/permissions/sight.js.map +1 -1
- package/dist/scene.d.ts +1 -1
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +1 -1
- package/dist/scene.js.map +1 -1
- package/dist/schema/json-schema.d.ts.map +1 -1
- package/dist/schema/json-schema.js +4 -1
- package/dist/schema/json-schema.js.map +1 -1
- package/dist/schema/schema.d.ts.map +1 -1
- package/dist/schema/schema.js +4 -1
- package/dist/schema/schema.js.map +1 -1
- package/dist/seat.d.ts +3 -1
- package/dist/seat.d.ts.map +1 -1
- package/dist/seat.js +3 -1
- package/dist/seat.js.map +1 -1
- package/dist/seen.d.ts +16 -1
- package/dist/seen.d.ts.map +1 -1
- package/dist/seen.js +112 -10
- package/dist/seen.js.map +1 -1
- package/dist/store.d.ts +26 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +126 -6
- package/dist/store.js.map +1 -1
- package/dist/validate-graph.d.ts +2 -1
- package/dist/validate-graph.d.ts.map +1 -1
- package/dist/validate-graph.js +29 -0
- package/dist/validate-graph.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/village.d.ts +16 -1
- package/dist/village.d.ts.map +1 -1
- package/dist/village.js +29 -0
- package/dist/village.js.map +1 -1
- package/dist/who.d.ts +1 -0
- package/dist/who.d.ts.map +1 -1
- package/dist/who.js +7 -1
- package/dist/who.js.map +1 -1
- package/package.json +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"answer-seen.d.ts","sourceRoot":"","sources":["../src/answer-seen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAA2B,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAOhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"answer-seen.d.ts","sourceRoot":"","sources":["../src/answer-seen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAA2B,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB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AAE,MAAM,EAAE,SAAS,SAAS,EAAE,KAAK,MAAM,CAAC,YAAY,GAAG,UAAU,GAAG,iBAAiB,EAAE,SAAS,EAAE,CAAC,CAAC;AAGvL,gFAAgF;AAChF,eAAO,MAAM,iBAAiB,GAAI,OAAO,UAAU,KAAG,IAAqC,CAAC"}
|
package/dist/answer-seen.js
CHANGED
|
@@ -4,7 +4,8 @@ import { withoutKeptFields } from "./ops/kept-fields.js";
|
|
|
4
4
|
import { namesUnseen, redact, WITHHELD_INTENT } from "./ops/withheld.js";
|
|
5
5
|
import { actingAs } from "./permissions/policy.js";
|
|
6
6
|
import { recordsOf } from "./permissions/sight.js";
|
|
7
|
-
import { hidesFrom, seatLens, seenBy } from "./seen.js";
|
|
7
|
+
import { hidesFrom, namedAuthors, seatLens, seenBy } from "./seen.js";
|
|
8
|
+
import { unseatedPrimitive } from "./binding-served.js";
|
|
8
9
|
/*
|
|
9
10
|
* A file of its own (FR-179): what a seat's tools hand back after an act is
|
|
10
11
|
* fetched with those tools (`@graview/core/seat`), and a page that only
|
|
@@ -81,8 +82,9 @@ export function answerSeenBy(store, principal, answer) {
|
|
|
81
82
|
touched: [...diff.touched.filter(lens.shows), ...[...patched.keys()].filter((id) => lens.shows(id) && !diff.touched.includes(id))],
|
|
82
83
|
};
|
|
83
84
|
}
|
|
85
|
+
// Each op's author named as the person they were bound to, where this seat is served that person (Roadmap f-invite-binds-existing-person).
|
|
84
86
|
if (answer.ops)
|
|
85
|
-
out["ops"] = redact(answer.ops, lens);
|
|
87
|
+
out["ops"] = namedAuthors(store, lens, redact(answer.ops, lens));
|
|
86
88
|
if (answer.primitives) {
|
|
87
89
|
// An apply's primitives are its ops'; a preview's are not in the log yet, and are judged from the graph as it stands.
|
|
88
90
|
const ops = out["ops"];
|
|
@@ -92,6 +94,9 @@ export function answerSeenBy(store, principal, answer) {
|
|
|
92
94
|
? servePrimitives(answer.primitives, lens.timeline, { served: (node, writer) => lens.servedWith(node, writer), edgeClean: (edge) => !namesUnseen(edge, lens.sees), sees: lens.sees }, actingAs(principal).id)
|
|
93
95
|
: redact([{ id: "", seq: 0, batch: "", author: { kind: "system" }, intent: "", mutation: null, primitives: answer.primitives, reads: [], writes: [], at: "" }], lens)[0].primitives;
|
|
94
96
|
}
|
|
97
|
+
// Nor the seat a person is bound to: the host's alone (Roadmap f-invite-binds-existing-person).
|
|
98
|
+
if (out["primitives"])
|
|
99
|
+
out["primitives"] = out["primitives"].flatMap((one) => unseatedPrimitive(one, lens.keepsSeat) ?? []);
|
|
95
100
|
// What a change wrote of a field the seat may not see is no part of what it is told (Roadmap f-field-sight).
|
|
96
101
|
if (lens.kept && out["primitives"])
|
|
97
102
|
out["primitives"] = withoutKeptFields(out["primitives"], lens);
|
package/dist/answer-seen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"answer-seen.js","sourceRoot":"","sources":["../src/answer-seen.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAoB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAInD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxD;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAY1B,KAAmE,EAAE,SAAoB,EAAE,MAAS;IACpG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC;QAAE,OAAO,MAAM,CAAC;IAChD,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CA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,MAAM,iBAAiB,GAAG,CAAC,KAAiB,EAAQ,EAAE,CAAC,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Primitive } from "./graph/primitives.js";
|
|
2
|
+
import type { MutationCall } from "./mutations/types.js";
|
|
3
|
+
import type { Operation } from "./ops/types.js";
|
|
4
|
+
import type { Policy, Principal, Refusal } from "./permissions/types.js";
|
|
5
|
+
/** The name of the act that binds a seat to a person already entered. */
|
|
6
|
+
export declare const BIND_PERSON = "bind-person";
|
|
7
|
+
/** What `@graview/core/binding` teaches the store when it is loaded, as `PUBLISHING` does for a publish. */
|
|
8
|
+
export interface BindingServed {
|
|
9
|
+
/** The `bind-person` act for this store, or none where no kind is the people. */
|
|
10
|
+
act?: (store: object) => unknown;
|
|
11
|
+
/** Whether this seat may run this binding: the host's system seat, or a grant that names the act for one of its roles. */
|
|
12
|
+
judged?: (store: object, call: MutationCall, principal: Principal) => {
|
|
13
|
+
readonly ok: true;
|
|
14
|
+
} | {
|
|
15
|
+
readonly ok: false;
|
|
16
|
+
readonly refusal: Refusal;
|
|
17
|
+
};
|
|
18
|
+
/** Why this binding's op may not be taken back, in a sentence; undefined when it may. */
|
|
19
|
+
undo?: (store: object, op: Operation) => string | undefined;
|
|
20
|
+
}
|
|
21
|
+
export declare const BINDING: BindingServed;
|
|
22
|
+
/** Which seats a reader may be told a record is bound to: none (`NO_SEAT`), its own, or all of them. */
|
|
23
|
+
export type KeepsSeat = (seat: string) => boolean;
|
|
24
|
+
/** A record without the seat it is bound to — unless it is one `keeps` says this reader may be told. The record itself where nothing goes. */
|
|
25
|
+
export declare function unseated<N>(node: N, keeps?: KeepsSeat): N;
|
|
26
|
+
/** A primitive without a seat its reader may not be told; undefined where that was all it said. */
|
|
27
|
+
export declare function unseatedPrimitive(primitive: Primitive, keeps?: KeepsSeat): Primitive | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* AN OP WITHOUT A SEAT ITS READER MAY NOT BE TOLD: its primitives, what puts
|
|
30
|
+
* it back and, for a binding, its call. A seat is an account's id: its own
|
|
31
|
+
* account's to know, and the host's and whoever binds people's. The op
|
|
32
|
+
* itself where it names none.
|
|
33
|
+
*/
|
|
34
|
+
export declare function unseatedOp(op: Operation, keeps?: KeepsSeat): Operation;
|
|
35
|
+
/** A snapshot with no record bound to a seat: what leaves this installation (an export, a seed, a template). */
|
|
36
|
+
export declare function unseatedSnapshot<T extends {
|
|
37
|
+
readonly nodes: readonly unknown[];
|
|
38
|
+
}>(snapshot: T): T;
|
|
39
|
+
/**
|
|
40
|
+
* WHETHER A SEAT BINDS PEOPLE HERE: a person — no agent, nobody acting for
|
|
41
|
+
* another — holding a role a grant names `bind-person` for, by name. What
|
|
42
|
+
* may bind (`@graview/core/binding`), and what is told who is bound.
|
|
43
|
+
*/
|
|
44
|
+
export declare function bindsPeople(policy: Policy | undefined, principal: Principal): boolean;
|
|
45
|
+
/** The seats a reader may be told a record is bound to: every one for the host and whoever binds people; its own for a person; none for anybody else. */
|
|
46
|
+
export declare function seatsKept(policy: Policy | undefined, principal: Principal): KeepsSeat;
|
|
47
|
+
//# sourceMappingURL=binding-served.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding-served.d.ts","sourceRoot":"","sources":["../src/binding-served.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEzE,yEAAyE;AACzE,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,4GAA4G;AAC5G,MAAM,WAAW,aAAa;IAC5B,iFAAiF;IACjF,GAAG,CAAC,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AAM,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,SAAS,GAAG,SAAS,CAIrF"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHAT A PAGE CARRIES OF BINDING A SEAT TO A PERSON (Roadmap
|
|
3
|
+
* f-invite-binds-existing-person): the act's name, the one object
|
|
4
|
+
* `@graview/core/binding` fills in when a host loads it, and taking the
|
|
5
|
+
* mark off what is handed to anybody but the host. Resolving a seat to the
|
|
6
|
+
* record it was bound to (`seatedIn`, `Graph.personBoundTo`) is the main
|
|
7
|
+
* entry's; making a binding, judging who may and taking one back are the
|
|
8
|
+
* host's entry's alone, so no page pays for them.
|
|
9
|
+
*/
|
|
10
|
+
import { PERSON_SEAT } from "./graph/archived.js";
|
|
11
|
+
import { bindable, isSystem, seatPersonOf } from "./permissions/policy.js";
|
|
12
|
+
/** The name of the act that binds a seat to a person already entered. */
|
|
13
|
+
export const BIND_PERSON = "bind-person";
|
|
14
|
+
/* One object for the store and `@graview/core/binding`, found by a key every copy agrees on. */
|
|
15
|
+
export const BINDING = (globalThis[Symbol.for("@graview/core:binding")] ??= {});
|
|
16
|
+
const NO_SEAT = () => false;
|
|
17
|
+
/** Whether a node says a seat this reader may not be told. */
|
|
18
|
+
const tellsOther = (node, keeps) => {
|
|
19
|
+
if (!Object.hasOwn(node, PERSON_SEAT))
|
|
20
|
+
return false;
|
|
21
|
+
const seat = node[PERSON_SEAT];
|
|
22
|
+
return typeof seat !== "string" || !keeps(seat);
|
|
23
|
+
};
|
|
24
|
+
/** A record without the seat it is bound to — unless it is one `keeps` says this reader may be told. The record itself where nothing goes. */
|
|
25
|
+
export function unseated(node, keeps = NO_SEAT) {
|
|
26
|
+
if (node === null || typeof node !== "object" || !tellsOther(node, keeps))
|
|
27
|
+
return node;
|
|
28
|
+
const { [PERSON_SEAT]: _seat, ...rest } = node;
|
|
29
|
+
return rest;
|
|
30
|
+
}
|
|
31
|
+
/** A primitive without a seat its reader may not be told; undefined where that was all it said. */
|
|
32
|
+
export function unseatedPrimitive(primitive, keeps = NO_SEAT) {
|
|
33
|
+
switch (primitive.op) {
|
|
34
|
+
case "add-node":
|
|
35
|
+
case "remove-node": {
|
|
36
|
+
const node = unseated(primitive.node, keeps);
|
|
37
|
+
return node === primitive.node ? primitive : { ...primitive, node };
|
|
38
|
+
}
|
|
39
|
+
case "patch-node": {
|
|
40
|
+
if (!tellsOther(primitive.after, keeps) && !tellsOther(primitive.before, keeps))
|
|
41
|
+
return primitive;
|
|
42
|
+
// A seat bound or unbound: told whole only where both ends are this reader's to know.
|
|
43
|
+
const after = unseated(primitive.after);
|
|
44
|
+
const before = unseated(primitive.before);
|
|
45
|
+
return Object.keys(after).length === 0 && Object.keys(before).length === 0 ? undefined : { ...primitive, before, after };
|
|
46
|
+
}
|
|
47
|
+
default:
|
|
48
|
+
return primitive;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* AN OP WITHOUT A SEAT ITS READER MAY NOT BE TOLD: its primitives, what puts
|
|
53
|
+
* it back and, for a binding, its call. A seat is an account's id: its own
|
|
54
|
+
* account's to know, and the host's and whoever binds people's. The op
|
|
55
|
+
* itself where it names none.
|
|
56
|
+
*/
|
|
57
|
+
export function unseatedOp(op, keeps = NO_SEAT) {
|
|
58
|
+
const seat = op.mutation?.name === BIND_PERSON ? op.mutation.args?.["seat"] : undefined;
|
|
59
|
+
const binds = op.mutation?.name === BIND_PERSON && Object.hasOwn(op.mutation.args ?? {}, "seat") && !(typeof seat === "string" && keeps(seat));
|
|
60
|
+
const primitives = op.primitives.flatMap((one) => unseatedPrimitive(one, keeps) ?? []);
|
|
61
|
+
const inverse = op.inverse?.flatMap((one) => unseatedPrimitive(one, keeps) ?? []);
|
|
62
|
+
const same = !binds && primitives.length === op.primitives.length && primitives.every((one, at) => one === op.primitives[at]) && (op.inverse === undefined || (inverse.length === op.inverse.length && inverse.every((one, at) => one === op.inverse[at])));
|
|
63
|
+
if (same)
|
|
64
|
+
return op;
|
|
65
|
+
const { seat: _seat, ...args } = (op.mutation?.args ?? {});
|
|
66
|
+
return { ...op, primitives, ...(inverse ? { inverse } : {}), ...(binds ? { mutation: { ...op.mutation, args } } : {}) };
|
|
67
|
+
}
|
|
68
|
+
/** A snapshot with no record bound to a seat: what leaves this installation (an export, a seed, a template). */
|
|
69
|
+
export function unseatedSnapshot(snapshot) {
|
|
70
|
+
return snapshot.nodes.some((node) => unseated(node) !== node) ? { ...snapshot, nodes: snapshot.nodes.map((node) => unseated(node)) } : snapshot;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* WHETHER A SEAT BINDS PEOPLE HERE: a person — no agent, nobody acting for
|
|
74
|
+
* another — holding a role a grant names `bind-person` for, by name. What
|
|
75
|
+
* may bind (`@graview/core/binding`), and what is told who is bound.
|
|
76
|
+
*/
|
|
77
|
+
export function bindsPeople(policy, principal) {
|
|
78
|
+
if (principal.kind !== "human" || principal.onBehalfOf !== undefined || principal.shared === true)
|
|
79
|
+
return false;
|
|
80
|
+
const roles = principal.roles ?? [];
|
|
81
|
+
return (policy?.grants ?? []).some((grant) => Array.isArray(grant.mutations) && grant.mutations.includes(BIND_PERSON) && Array.isArray(grant.roles) && !grant.self && !grant.ownEnd && grant.roles.some((role) => roles.includes(role)));
|
|
82
|
+
}
|
|
83
|
+
/** The seats a reader may be told a record is bound to: every one for the host and whoever binds people; its own for a person; none for anybody else. */
|
|
84
|
+
export function seatsKept(policy, principal) {
|
|
85
|
+
if (isSystem(principal) || bindsPeople(policy, principal))
|
|
86
|
+
return () => true;
|
|
87
|
+
const own = bindable(principal) ? seatPersonOf(principal) : undefined;
|
|
88
|
+
return own === undefined ? NO_SEAT : (seat) => seat === own;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=binding-served.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding-served.js","sourceRoot":"","sources":["../src/binding-served.ts"],"names":[],"mappings":"A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C,CAAC;AAClQ,CAAC;AAED,yJAAyJ;AACzJ,MAAM,UAAU,SAAS,CAAC,MAA0B,EAAE,SAAoB;IACxE,IAAI,QAAQ,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC;QAAE,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC;IAC7E,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACtE,OAAO,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,GAAG,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Principal } from "./permissions/types.js";
|
|
2
|
+
import type { AnySchema } from "./schema/schema.js";
|
|
3
|
+
import type { ApplyOptions, ApplyResult, Store } from "./store.js";
|
|
4
|
+
/**
|
|
5
|
+
* BIND A JOINING ACCOUNT TO THE PERSON ENTERED FOR IT: what a host calls as
|
|
6
|
+
* an invitation is accepted. `joining` is the seat as the host will serve it
|
|
7
|
+
* (its account, and the profile it acts as, if any); `record` the person's
|
|
8
|
+
* id. The `bind-person` act, applied as `options.author` — the host's system
|
|
9
|
+
* seat, or somebody a grant names the act for — and so blamed on them and
|
|
10
|
+
* undone like any act, until the seat has acted as the record. Refused
|
|
11
|
+
* (`ActRefusal`, or `PermissionDeniedError` for who may) in a sentence a
|
|
12
|
+
* host can show.
|
|
13
|
+
*/
|
|
14
|
+
export declare function bindPerson<S extends AnySchema>(store: Store<S>, joining: Principal, record: string, options?: ApplyOptions): ApplyResult<S>;
|
|
15
|
+
//# sourceMappingURL=binding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../src/binding.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAW,MAAM,wBAAwB,CAAC;AAGjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AA6HnE;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,WAAW,CAAC,CAAC,CAAC,CAK/I"}
|
package/dist/binding.js
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@graview/core/binding` — A MEMBER WHO JOINS IS THE PERSON ENTERED FOR
|
|
3
|
+
* THEM (Roadmap f-invite-binds-existing-person). An organizer enters Bud
|
|
4
|
+
* before he joins — his household, his lists — and when his account accepts
|
|
5
|
+
* an invitation, the host binds it to that record rather than making a
|
|
6
|
+
* second Bud (`bindPerson`). A host's, on no page: loading it teaches every
|
|
7
|
+
* store the `bind-person` act, who may run it and when it may be taken back
|
|
8
|
+
* (`BINDING`). Resolving a seat to its record is the main entry's.
|
|
9
|
+
*/
|
|
10
|
+
import { BIND_PERSON, BINDING } from "./binding-served.js";
|
|
11
|
+
import { PERSON_SEAT, personSeatOf } from "./graph/archived.js";
|
|
12
|
+
import { isUnset } from "./graph/primitives.js";
|
|
13
|
+
import { MissingRecordError, NO_SUCH_RECORD } from "./graph/graph.js";
|
|
14
|
+
import { signedOutSeat } from "./mutations/vote-suggestion.js";
|
|
15
|
+
import { actingAs, bindable, isSystem, ownsId, seatPersonOf, withValidProfile } from "./permissions/policy.js";
|
|
16
|
+
import { ActRefusal } from "./refused.js";
|
|
17
|
+
import { labelOf, nounOf, withArticle } from "./schema/define-node.js";
|
|
18
|
+
import * as z from "./schema/zod.js";
|
|
19
|
+
/** A seat as a binding names it: an account's id, or an account's id and a profile's (`profilePersonId`). */
|
|
20
|
+
const SEAT = /^[^~]+(~[\w-]{1,64})?$/;
|
|
21
|
+
/**
|
|
22
|
+
* WHO WAS DONE AS WHICH RECORD, read from the log: each op's author as the
|
|
23
|
+
* seat it was, and the record that seat was bound to then — followed through
|
|
24
|
+
* every binding, its undo and a record put back — or the seat's own id where
|
|
25
|
+
* it was bound to none. A binding's own op is the binder's, not the seat's.
|
|
26
|
+
*/
|
|
27
|
+
function doneAs(store) {
|
|
28
|
+
const bound = new Map();
|
|
29
|
+
const done = [];
|
|
30
|
+
for (const op of store.log.all()) {
|
|
31
|
+
for (const primitive of op.primitives) {
|
|
32
|
+
if (primitive.op === "add-node" && personSeatOf(primitive.node))
|
|
33
|
+
bound.set(primitive.node.id, personSeatOf(primitive.node));
|
|
34
|
+
else if (primitive.op === "remove-node")
|
|
35
|
+
bound.delete(primitive.node.id);
|
|
36
|
+
else if (primitive.op === "patch-node" && Object.hasOwn(primitive.after, PERSON_SEAT)) {
|
|
37
|
+
const seat = primitive.after[PERSON_SEAT];
|
|
38
|
+
if (isUnset(seat) || typeof seat !== "string")
|
|
39
|
+
bound.delete(primitive.id);
|
|
40
|
+
else
|
|
41
|
+
bound.set(primitive.id, seat);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (op.mutation?.name === BIND_PERSON || (op.author.onBehalfOf ?? op.author).kind !== "human")
|
|
45
|
+
continue;
|
|
46
|
+
const seat = seatPersonOf(op.author);
|
|
47
|
+
if (seat === undefined)
|
|
48
|
+
continue;
|
|
49
|
+
const record = [...bound].find(([, one]) => one === seat)?.[0] ?? seat;
|
|
50
|
+
done.push({ seq: op.seq, seat, record });
|
|
51
|
+
}
|
|
52
|
+
return done;
|
|
53
|
+
}
|
|
54
|
+
/** The `bind-person` act for a store, where a kind is its people. */
|
|
55
|
+
function bindPersonMutation(store) {
|
|
56
|
+
const schema = store.schema;
|
|
57
|
+
const people = schema.definitions.find((definition) => definition.people);
|
|
58
|
+
if (!people)
|
|
59
|
+
return undefined;
|
|
60
|
+
const noun = nounOf(people, people.kind);
|
|
61
|
+
const named = (node) => labelOf(schema.tryDefinition(node.kind), node);
|
|
62
|
+
return {
|
|
63
|
+
name: BIND_PERSON,
|
|
64
|
+
title: `Bind an account to this ${noun}`,
|
|
65
|
+
description: `The account that joined is this ${noun} from now on: what it does is done as them, and no second ${noun} is made.`,
|
|
66
|
+
subject: { kinds: [people.kind], arg: "record" },
|
|
67
|
+
idempotent: true,
|
|
68
|
+
input: z.object({ record: z.string().check(z.minLength(1)), seat: z.string().check(z.regex(SEAT)) }),
|
|
69
|
+
describe: (args, graph) => {
|
|
70
|
+
const node = graph.getNode(String(args.record));
|
|
71
|
+
return `Bind ${node ? named(node) : `the ${noun}`} to the account that joined`;
|
|
72
|
+
},
|
|
73
|
+
apply(ctx, args) {
|
|
74
|
+
const { record, seat } = args;
|
|
75
|
+
const full = store.graph;
|
|
76
|
+
const node = full.getNode(record);
|
|
77
|
+
if (!node || !ctx.graph.getNode(record))
|
|
78
|
+
throw new MissingRecordError(record, NO_SUCH_RECORD.change);
|
|
79
|
+
const definition = schema.tryDefinition(node.kind);
|
|
80
|
+
if (!definition?.people)
|
|
81
|
+
throw new ActRefusal(`${named(node)} is ${withArticle(nounOf(definition, node.kind))}, not ${withArticle(noun)}: only ${withArticle(noun)} can be someone's record here.`);
|
|
82
|
+
const bound = personSeatOf(node);
|
|
83
|
+
// Bound to this seat already, or this seat's own record: nothing to do.
|
|
84
|
+
if (bound === seat || (bound === undefined && record === seat))
|
|
85
|
+
return;
|
|
86
|
+
// Somebody's already: bound to another seat, a profile's own person, or a record somebody else was ever done as here.
|
|
87
|
+
if (bound !== undefined || record.includes("~") || doneAs(store).some((one) => one.record === record && one.seat !== seat))
|
|
88
|
+
throw new ActRefusal(`${named(node)} is already someone else's record here.`);
|
|
89
|
+
const other = full.personBoundTo(seat);
|
|
90
|
+
const theirs = other === undefined ? undefined : full.getNode(other);
|
|
91
|
+
if (theirs)
|
|
92
|
+
throw new ActRefusal(`That account is already ${named(theirs)} here.`);
|
|
93
|
+
const own = full.getNode(seat);
|
|
94
|
+
if (own && schema.tryDefinition(own.kind)?.people)
|
|
95
|
+
throw new ActRefusal(`That account already has its own record here, ${named(own)}: merge the two instead.`);
|
|
96
|
+
ctx.patchNode(record, { [PERSON_SEAT]: seat });
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const refused = (call, message, wouldNeed = []) => ({ ok: false, refusal: { mutation: call.name, wouldNeed: [...wouldNeed], message } });
|
|
101
|
+
/**
|
|
102
|
+
* WHO MAY BIND A SEAT TO A PERSON: the host's system seat, and a seat a grant
|
|
103
|
+
* names `bind-person` for, by its name and for a role the seat holds — never
|
|
104
|
+
* a grant to every role, never every act (`*`), never a grant held to the
|
|
105
|
+
* seat's own record or end. With no policy, the host alone. Never a seat no
|
|
106
|
+
* one person holds, a visitor, one signed out, an agent or anybody acting
|
|
107
|
+
* for another; never a seat binding
|
|
108
|
+
* itself, whatever it is granted.
|
|
109
|
+
*/
|
|
110
|
+
function judgedBinding(store, call, principal) {
|
|
111
|
+
const held = store;
|
|
112
|
+
if (signedOutSeat(principal))
|
|
113
|
+
return refused(call, "Sign in to bind an account to a record here.");
|
|
114
|
+
// A person binds, never an agent nor anybody acting for one: what an agent reads in a record could steer it to.
|
|
115
|
+
if (principal.kind === "agent" || principal.onBehalfOf !== undefined)
|
|
116
|
+
return refused(call, "An agent cannot bind an account to a record here: a person who runs this app does that.");
|
|
117
|
+
if (isSystem(principal))
|
|
118
|
+
return { ok: true };
|
|
119
|
+
const seat = call.args["seat"];
|
|
120
|
+
const record = call.args["record"];
|
|
121
|
+
const acting = actingAs(principal);
|
|
122
|
+
const account = acting.id;
|
|
123
|
+
if ((typeof seat === "string" && account !== undefined && (seat === account || seat.startsWith(`${account}~`))) || (typeof record === "string" && ownsId(principal, record))) {
|
|
124
|
+
return refused(call, "You cannot bind yourself to a record here: somebody who runs this app does that.");
|
|
125
|
+
}
|
|
126
|
+
const naming = (held.policy?.grants ?? []).filter((grant) => Array.isArray(grant.mutations) && grant.mutations.includes(BIND_PERSON) && Array.isArray(grant.roles) && !grant.self && !grant.ownEnd);
|
|
127
|
+
const kind = typeof record === "string" ? held.graph.getNode(record)?.kind : undefined;
|
|
128
|
+
const roles = acting.roles ?? [];
|
|
129
|
+
const granted = naming.some((grant) => grant.roles.some((role) => roles.includes(role)) && (grant.kinds === undefined || grant.kinds === "*" || (kind !== undefined && grant.kinds.includes(kind))));
|
|
130
|
+
if (granted)
|
|
131
|
+
return { ok: true };
|
|
132
|
+
const who = [...new Set(naming.flatMap((grant) => grant.roles))];
|
|
133
|
+
return refused(call, who.length > 0 ? "Not permitted: only the people who run this app bind an account to a record here." : "Not permitted: only the host binds an account to a record here.", who);
|
|
134
|
+
}
|
|
135
|
+
/** Why a binding may not be taken back: the seat has acted as the record since, and unbinding would hand what it did to somebody else. */
|
|
136
|
+
function bindingKept(store, op) {
|
|
137
|
+
const held = store;
|
|
138
|
+
const args = (op.mutation?.args ?? {});
|
|
139
|
+
if (typeof args.record !== "string" || typeof args.seat !== "string")
|
|
140
|
+
return undefined;
|
|
141
|
+
if (!doneAs(held).some((one) => one.seq > op.seq && one.seat === args.seat && one.record === args.record))
|
|
142
|
+
return undefined;
|
|
143
|
+
const node = held.graph.getNode(args.record);
|
|
144
|
+
const name = node ? labelOf(held.schema.tryDefinition(node.kind), node) : "They";
|
|
145
|
+
return `${name} has acted here: unbinding would hand what they did to someone else.`;
|
|
146
|
+
}
|
|
147
|
+
BINDING.act = (store) => bindPersonMutation(store);
|
|
148
|
+
BINDING.judged = judgedBinding;
|
|
149
|
+
BINDING.undo = bindingKept;
|
|
150
|
+
/**
|
|
151
|
+
* BIND A JOINING ACCOUNT TO THE PERSON ENTERED FOR IT: what a host calls as
|
|
152
|
+
* an invitation is accepted. `joining` is the seat as the host will serve it
|
|
153
|
+
* (its account, and the profile it acts as, if any); `record` the person's
|
|
154
|
+
* id. The `bind-person` act, applied as `options.author` — the host's system
|
|
155
|
+
* seat, or somebody a grant names the act for — and so blamed on them and
|
|
156
|
+
* undone like any act, until the seat has acted as the record. Refused
|
|
157
|
+
* (`ActRefusal`, or `PermissionDeniedError` for who may) in a sentence a
|
|
158
|
+
* host can show.
|
|
159
|
+
*/
|
|
160
|
+
export function bindPerson(store, joining, record, options = {}) {
|
|
161
|
+
if (!store.schema.definitions.some((definition) => definition.people))
|
|
162
|
+
throw new ActRefusal("Nobody here can be bound to a record: this app says of no kind that it is its people.");
|
|
163
|
+
const seat = bindable(withValidProfile(joining)) ? seatPersonOf(withValidProfile(joining)) : undefined;
|
|
164
|
+
if (seat === undefined)
|
|
165
|
+
throw new ActRefusal("Only somebody who signed in can be bound to a record here.");
|
|
166
|
+
return store.apply({ name: BIND_PERSON, args: { record, seat } }, options);
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding.js","sourceRoot":"","sources":["../src/binding.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE/G,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAy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AC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,uFAAuF,CAAC,CAAC;IACrL,MAAM,IAAI,GAAG,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACvG,IAAI,IAAI,KAAK,SAAS;QAAE,MAAM,IAAI,UAAU,CAAC,4DAA4D,CAAC,CAAC;IAC3G,OAAO,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CssRefusal } from "./sanitize.js";
|
|
2
|
+
/** One refusal of a view's face, said to its author: what was refused, why, and what would do, ending with its finding code. */
|
|
3
|
+
export declare function viewFaceRefusedWords(refusal: CssRefusal): string;
|
|
4
|
+
//# sourceMappingURL=faces-words.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faces-words.d.ts","sourceRoot":"","sources":["../../src/css/faces-words.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAMhD,gIAAgI;AAChI,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAoChE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* WHAT IS SAID OF A VIEW'S OWN FACE (HQ f-view-font-face-data), in a module
|
|
3
|
+
* of its own: needed only where a face was refused, so a view that declares
|
|
4
|
+
* none never carries it.
|
|
5
|
+
*/
|
|
6
|
+
import { VIEW_FACE_DESCRIPTORS, VIEW_FACE_MOST_BYTES, VIEW_FACES_MOST, VIEW_FACES_MOST_BYTES } from "./faces.js";
|
|
7
|
+
const KB = (bytes) => `${(bytes / 1_000).toLocaleString("en-US", { maximumFractionDigits: 1 })} KB`;
|
|
8
|
+
const DRAWS = "a view's face is a data: URL of a WOFF2, WOFF, TTF or OTF font (src: url(data:font/woff2;base64,…))";
|
|
9
|
+
const LENT = "or a face the app lends its views (brand.views.fonts)";
|
|
10
|
+
/** One refusal of a view's face, said to its author: what was refused, why, and what would do, ending with its finding code. */
|
|
11
|
+
export function viewFaceRefusedWords(refusal) {
|
|
12
|
+
const named = refusal.family !== undefined ? `the @font-face "${refusal.family}"` : "an @font-face";
|
|
13
|
+
switch (refusal.name) {
|
|
14
|
+
case "where":
|
|
15
|
+
return `Not drawn: an @font-face inside @media, @supports, @container or a rule. A view's face is declared at the top of its stylesheet (view-font-face).`;
|
|
16
|
+
case "unreadable":
|
|
17
|
+
return `Not drawn: ${named}, which has something before its block. A face is @font-face { font-family: …; src: … } (view-font-face).`;
|
|
18
|
+
case "family":
|
|
19
|
+
return `Not drawn: ${named}: ${refusal.said ?? "its font-family is one name, in quotes or as plain words"}. It is called by a name of its own, which the view's rules then name (view-font-face-family).`;
|
|
20
|
+
case "src":
|
|
21
|
+
return `Not drawn: ${named} has ${refusal.said === "no src" ? "no src" : "a src that is no url()"}: ${DRAWS} (view-font-face-src).`;
|
|
22
|
+
case "address":
|
|
23
|
+
return `Not loaded: ${named} names url(${JSON.stringify(refusal.said ?? "")}). A view loads nothing from the network: ${DRAWS}, ${LENT} (view-font-face-src).`;
|
|
24
|
+
case "local":
|
|
25
|
+
return `Not loaded: ${named} names local(), a face installed on the reader's own machine, which differs from one reader to the next and tells the page what is installed: ${DRAWS} (view-font-face-src).`;
|
|
26
|
+
case "type":
|
|
27
|
+
return `Not loaded: ${named} is a data: URL of ${refusal.said ?? "no type"}, not a font: ${DRAWS} (view-font-face-type).`;
|
|
28
|
+
case "encoding":
|
|
29
|
+
return `Not loaded: ${named} is a data: URL that is not base64, or not base64 throughout: ${DRAWS} (view-font-face-type).`;
|
|
30
|
+
case "bytes":
|
|
31
|
+
return `Not loaded: ${named} holds bytes that are not a WOFF2, WOFF, TrueType or OpenType file, whatever its data: URL says (view-font-face-type).`;
|
|
32
|
+
case "size":
|
|
33
|
+
return `Not loaded: ${named} is ${KB(refusal.bytes ?? 0)} decoded, more than the ${KB(VIEW_FACE_MOST_BYTES)} one face a view declares may be: subset it to the letters the view draws, ${LENT}, which may be larger (view-font-face-size).`;
|
|
34
|
+
case "total":
|
|
35
|
+
return `Not loaded: ${named} would take the view's faces to ${KB(refusal.bytes ?? 0)}, more than the ${KB(VIEW_FACES_MOST_BYTES)} a view's faces may be together: the faces before it are drawn, and the app may lend the rest (brand.views.fonts) (view-font-faces-size).`;
|
|
36
|
+
case "count":
|
|
37
|
+
return `Not loaded: ${named} is more than the ${VIEW_FACES_MOST} faces a view's stylesheets may declare (view-font-faces-size).`;
|
|
38
|
+
case "descriptor":
|
|
39
|
+
return `Not kept: ${refusal.descriptor ?? "a descriptor"} in ${named}. A view's face takes ${VIEW_FACE_DESCRIPTORS.slice(0, -1).join(", ")} and ${VIEW_FACE_DESCRIPTORS.at(-1)}, and is drawn without the rest (view-font-face-descriptor).`;
|
|
40
|
+
case "value":
|
|
41
|
+
return `Not kept: the ${refusal.descriptor ?? "descriptor"} of ${named}, a value a face does not take, so the face is drawn as if it said none (view-font-face-descriptor).`;
|
|
42
|
+
case "lent":
|
|
43
|
+
return `Not loaded: ${named}, since the app lends its views a face by that name (brand.views.fonts), and the app's face is the one drawn: call the view's own something else (view-font-face-lent).`;
|
|
44
|
+
default:
|
|
45
|
+
return `Not drawn: ${named} (view-font-face).`;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=faces-words.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faces-words.js","sourceRoot":"","sources":["../../src/css/faces-words.ts"],"names":[],"mappings":"AAAA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AI,SAAS,iBAAiB,KAAK,yBAAyB,CAAC;QAC5H,KAAK,UAAU;YACb,OAAO,eAAe,KAAK,iEAAiE,KAAK,yBAAyB,CAAC;QAC7H,KAAK,OAAO;YACV,OAAO,eAAe,KAAK,wHAAwH,CAAC;QACtJ,KAAK,MAAM;YACT,OAAO,eAAe,KAAK,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,2BAA2B,EAAE,CAAC,oBAAoB,CAAC,8EAA8E,IAAI,8CAA8C,CAAC;QAC9O,KAAK,OAAO;YACV,OAAO,eAAe,KAAK,mCAAmC,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC,qBAAqB,CAAC,2IAA2I,CAAC;QAC9Q,KAAK,OAAO;YACV,OAAO,eAAe,KAAK,qBAAqB,eAAe,iEAAiE,CAAC;QACnI,KAAK,YAAY;YACf,OAAO,aAAa,OAAO,CAAC,UAAU,IAAI,cAAc,OAAO,KAAK,yBAAyB,qBAAqB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,8DAA8D,CAAC;QAC/O,KAAK,OAAO;YACV,OAAO,iBAAiB,OAAO,CAAC,UAAU,IAAI,YAAY,OAAO,KAAK,sGAAsG,CAAC;QAC/K,KAAK,MAAM;YACT,OAAO,eAAe,KAAK,yKAAyK,CAAC;QACvM;YACE,OAAO,cAAc,KAAK,oBAAoB,CAAC;IACnD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { ComponentValue, CssRefusal, Declaration } from "./sanitize.js";
|
|
2
|
+
/**
|
|
3
|
+
* The most bytes one face a view's stylesheet declares may be, decoded
|
|
4
|
+
* (HQ f-view-font-face-data). A view's face rides in its stylesheet — in
|
|
5
|
+
* every message the view sends with its sheets, and decoded on every page
|
|
6
|
+
* that draws it — so it is a face cut to what a view draws: a display face
|
|
7
|
+
* subset to Latin in WOFF2 is 15–40 KB. A whole family, or a face for a
|
|
8
|
+
* script with thousands of glyphs, is a file the app holds and lends its
|
|
9
|
+
* views (`brand.views.fonts`, up to `VIEW_FONT_MOST_BYTES`), fetched once.
|
|
10
|
+
*/
|
|
11
|
+
export declare const VIEW_FACE_MOST_BYTES = 50000;
|
|
12
|
+
/**
|
|
13
|
+
* The most bytes a view's faces may be together, decoded: four such faces —
|
|
14
|
+
* a display face, its italic, a bold and a numeral set — which keeps the
|
|
15
|
+
* sheets a view sends within a few hundred KB of text however many faces
|
|
16
|
+
* it declares.
|
|
17
|
+
*/
|
|
18
|
+
export declare const VIEW_FACES_MOST_BYTES = 200000;
|
|
19
|
+
/** The most faces a view's stylesheets may declare: the sixteen pieces a subset by unicode-range might be cut into. */
|
|
20
|
+
export declare const VIEW_FACES_MOST = 16;
|
|
21
|
+
/** The descriptors a view's face may say: anything else is left out of it, and said. */
|
|
22
|
+
export declare const VIEW_FACE_DESCRIPTORS: readonly string[];
|
|
23
|
+
/**
|
|
24
|
+
* How much more than their budget a view's sheets together may be read for
|
|
25
|
+
* the faces in them: twice what the faces may be as base64, so a face a
|
|
26
|
+
* little past its bounds is refused by name. One allowance for all of a
|
|
27
|
+
* view's sheets, read before any is parsed, so what is parsed of them is
|
|
28
|
+
* bounded however many there are; and of what is read, only the faces kept
|
|
29
|
+
* are not counted toward the sheets' budget.
|
|
30
|
+
*/
|
|
31
|
+
export declare const VIEW_FACES_TEXT_ALLOWANCE: number;
|
|
32
|
+
/** The most stylesheets of a view's that are read where it may declare faces: more is said, and not read. */
|
|
33
|
+
export declare const VIEW_SHEETS_MOST = 64;
|
|
34
|
+
/** The name a view's face is loaded and drawn under on its page: the host's name for the view, then the family it wrote. */
|
|
35
|
+
export declare function viewFaceFamily(scope: string, family: string): string;
|
|
36
|
+
/** Each face's family, lowercased, to its name on the page (`viewFaceFamily`). */
|
|
37
|
+
export declare function facesRenamed(faces: readonly ViewFace[], scope: string): ReadonlyMap<string, string>;
|
|
38
|
+
/**
|
|
39
|
+
* A `font-family` or `font` value with every family that names one of the
|
|
40
|
+
* view's faces written as its name on the page: in each comma's part, the
|
|
41
|
+
* family is its last string, or the idents it ends with (`700 2rem Shout
|
|
42
|
+
* Display`). Anything else is left as it was.
|
|
43
|
+
*/
|
|
44
|
+
export declare function renameFamilies(values: readonly ComponentValue[], rename: ReadonlyMap<string, string>): ComponentValue[];
|
|
45
|
+
/** One source of a view's face: its bytes, decoded, and the type its URL said. */
|
|
46
|
+
export interface ViewFaceSource {
|
|
47
|
+
readonly type: string;
|
|
48
|
+
readonly bytes: Uint8Array;
|
|
49
|
+
}
|
|
50
|
+
/** A face a view's stylesheet declares, as the host loads it: its sources tried in order, and its descriptors as `FontFace` takes them. */
|
|
51
|
+
export interface ViewFace {
|
|
52
|
+
readonly family: string;
|
|
53
|
+
readonly sources: readonly ViewFaceSource[];
|
|
54
|
+
/** Its sources' bytes together. */
|
|
55
|
+
readonly size: number;
|
|
56
|
+
readonly weight?: string;
|
|
57
|
+
readonly style?: string;
|
|
58
|
+
readonly stretch?: string;
|
|
59
|
+
readonly display?: string;
|
|
60
|
+
readonly unicodeRange?: string;
|
|
61
|
+
}
|
|
62
|
+
/** What was wrong with a face, as `CssRefusal.name` says it where its reason is `font-face`. */
|
|
63
|
+
export type ViewFaceProblem = "where" | "unreadable" | "family" | "src" | "address" | "local" | "type" | "encoding" | "bytes" | "size" | "total" | "count" | "descriptor" | "value" | "lent";
|
|
64
|
+
/** The types a font's `data:` URL may say: the four of `font/`, and the older names servers still give a font, as a lent face's file may be served. */
|
|
65
|
+
export declare function isFontType(type: string): boolean;
|
|
66
|
+
/** What is spent of a view's faces so far: across its sheets, in the order it gave them. */
|
|
67
|
+
export interface FaceBudget {
|
|
68
|
+
bytes: number;
|
|
69
|
+
count: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* One `@font-face` of a view's stylesheet, at its top, judged: the face, or
|
|
73
|
+
* nothing, with every refusal said as `{ reason: "font-face", name: <the
|
|
74
|
+
* problem> }`. `budget` is spent by a face kept.
|
|
75
|
+
*/
|
|
76
|
+
export declare function judgeFace(prelude: readonly ComponentValue[], items: readonly (Declaration | {
|
|
77
|
+
readonly type: "at-rule" | "qualified";
|
|
78
|
+
})[], budget: FaceBudget, refuse: (refusal: CssRefusal) => void, lent?: readonly string[]): {
|
|
79
|
+
readonly face?: ViewFace;
|
|
80
|
+
readonly data: number;
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=faces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faces.d.ts","sourceRoot":"","sources":["../../src/css/faces.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE7E;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAE7C,uHAAuH;AACvH,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,wFAAwF;AACxF,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAAyG,CAAC;AAE7J;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,QAA+C,CAAC;AAEtF,6GAA6G;AAC7G,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,4HAA4H;AAC5H,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAEnG;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,E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