@graview/core 0.1.34 → 0.1.36
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/document/edit.d.ts.map +1 -1
- package/dist/document/edit.js +13 -2
- package/dist/document/edit.js.map +1 -1
- package/dist/document/linked-findings.d.ts.map +1 -1
- package/dist/document/linked-findings.js +3 -27
- package/dist/document/linked-findings.js.map +1 -1
- package/dist/document/linked-relation-findings.d.ts +11 -0
- package/dist/document/linked-relation-findings.d.ts.map +1 -0
- package/dist/document/linked-relation-findings.js +35 -0
- package/dist/document/linked-relation-findings.js.map +1 -0
- package/dist/document/migrate.d.ts.map +1 -1
- package/dist/document/migrate.js +24 -0
- package/dist/document/migrate.js.map +1 -1
- package/dist/document.schema.json +2 -2
- package/dist/history.d.ts +20 -4
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/past.d.ts +22 -1
- package/dist/past.d.ts.map +1 -1
- package/dist/past.js +46 -2
- package/dist/past.js.map +1 -1
- package/dist/schema/files.d.ts +17 -2
- package/dist/schema/files.d.ts.map +1 -1
- package/dist/schema/files.js +2 -0
- package/dist/schema/files.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/document/edit.ts"],"names":[],"mappings":"AAKA,OAAO,EAAS,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/document/edit.ts"],"names":[],"mappings":"AAKA,OAAO,EAAS,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAcpD,OAAO,EAaL,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAyCrB,MAAM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AM,GAAG;QAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAA;KAAE,CAAC;CACrI;AAED,4EAA4E;AAC5E,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC7F;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACzE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1E;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,IAAI,EAAE;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAiBjL"}
|
package/dist/document/edit.js
CHANGED
|
@@ -13,6 +13,8 @@ const refusedFormat = (format, type) => {
|
|
|
13
13
|
return `${sentence}; ${fix}`;
|
|
14
14
|
};
|
|
15
15
|
import { farEnd } from "./far-end.js";
|
|
16
|
+
import { linkedRelationFindings } from "./linked-relation-findings.js";
|
|
17
|
+
import { linkedRelationOfSpec, reachesAnotherApp } from "../schema/linked.js";
|
|
16
18
|
import { ActSpec, EDGE_NAME, EdgeSpec, FIELD_NAME, FIELD_TYPES, FieldSpec, GrantSpec, KindSpec, NAME, RuleSpec, SightSpec, } from "./schema.js";
|
|
17
19
|
import { SHIPPED_LENSES, isShippedLens, SHIPPED_LENS_NAMES } from "../places.js";
|
|
18
20
|
import { placeSlug } from "../views/types.js";
|
|
@@ -205,6 +207,8 @@ const clone = (v) => structuredClone(v);
|
|
|
205
207
|
const asArray = (v) => [v ?? []].flat();
|
|
206
208
|
const kebab = (camel) => camel.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
|
|
207
209
|
const words = (name) => kebab(name).replace(/-/g, " ");
|
|
210
|
+
/** Another app's kinds as people say them: "one house in the app @nick/house", "houses or flats in the app @nick/house". Their plural is that app's to say; this one says the plain one. */
|
|
211
|
+
const farKindsWords = (far) => `${far.cardinality === "one" ? `one ${far.kinds.map(words).join(" or ")}` : far.kinds.map((k) => `${words(k)}s`).join(" or ")} in the app ${far.address}, another app, read there as whoever is looking`;
|
|
208
212
|
function hasKind(kinds, kind) {
|
|
209
213
|
return kinds === "*" || kinds.has(kind);
|
|
210
214
|
}
|
|
@@ -2126,13 +2130,20 @@ class Editor {
|
|
|
2126
2130
|
}
|
|
2127
2131
|
const edge = { ...parsed.data };
|
|
2128
2132
|
delete edge.renamedFrom;
|
|
2129
|
-
|
|
2133
|
+
// One to another app's kind (`@nick/house/house`) is judged as `graview check` judges it in a whole document, and refused in its words.
|
|
2134
|
+
if (reachesAnotherApp(parsed.data)) {
|
|
2135
|
+
const [finding] = linkedRelationFindings(`edits.${i}`, relation, kind, parsed.data);
|
|
2136
|
+
if (finding)
|
|
2137
|
+
return void this.findings.push(finding);
|
|
2138
|
+
}
|
|
2139
|
+
else if (edge.to !== "*")
|
|
2130
2140
|
for (const t of edge.to)
|
|
2131
2141
|
if (!this.doc.kinds[t])
|
|
2132
2142
|
return this.fail(i, "to", `"${t}" is not a kind this app has`);
|
|
2143
|
+
const far = linkedRelationOfSpec(parsed.data);
|
|
2133
2144
|
(spec.edges ??= {})[relation] = edge;
|
|
2134
2145
|
this.edgeOrigin.set(`${kind}.${relation}`, undefined);
|
|
2135
|
-
this.said.push(`${kind} gains a relation, "${relation}", to ${edge.to === "*" ? "any record" : edge.to.join(" or ")}.`);
|
|
2146
|
+
this.said.push(`${kind} gains a relation, "${relation}", to ${edge.to === "*" ? "any record" : far ? farKindsWords(far) : edge.to.join(" or ")}.`);
|
|
2136
2147
|
}
|
|
2137
2148
|
renameRelation(i, kind, relation, to) {
|
|
2138
2149
|
const spec = this.kind(i, kind);
|