@takagaki/cortex-decisions-viewer 0.12.270 → 0.12.278
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/build.js +151 -31
- package/dist/forward-reads.js +98 -0
- package/dist/intake-code-lines.js +19 -0
- package/dist/intake-scope.js +2 -1
- package/dist/member-page.js +235 -0
- package/dist/memory-evidence.js +33 -1
- package/dist/render.js +967 -84
- package/dist/run-history.js +435 -0
- package/package.json +1 -1
package/dist/memory-evidence.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MEMORY_EVIDENCE_KINDS = exports.MEMORY_EVIDENCE_VERSION = exports.MEMORY_EVIDENCE_FILE = void 0;
|
|
6
|
+
exports.EVIDENCE_ROLES = exports.MEMORY_EVIDENCE_KINDS = exports.MEMORY_EVIDENCE_VERSION = exports.MEMORY_EVIDENCE_FILE = void 0;
|
|
7
7
|
exports.memoryEvidenceItemOf = memoryEvidenceItemOf;
|
|
8
8
|
exports.parseMemoryEvidence = parseMemoryEvidence;
|
|
9
9
|
exports.readMemoryEvidence = readMemoryEvidence;
|
|
@@ -43,6 +43,8 @@ exports.MEMORY_EVIDENCE_FILE = "memory-evidence.json";
|
|
|
43
43
|
exports.MEMORY_EVIDENCE_VERSION = 1;
|
|
44
44
|
/** 項目の種類(決定の場面・言い直し・ルール・用語と関係者の作った晩/書き換えた晩) */
|
|
45
45
|
exports.MEMORY_EVIDENCE_KINDS = ["decided", "restated", "ruled", "created", "rewrote"];
|
|
46
|
+
/** 役目の語(engine `common.screen-evidence-by-region` の表の左) */
|
|
47
|
+
exports.EVIDENCE_ROLES = ["origin", "agree", "relay", "external", "told", "use", "meaning", "duty", "center"];
|
|
46
48
|
const DAY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
47
49
|
// engine の台帳の検め(`^https?://`)と揃える。空白を含む URL も項目ごと捨てない
|
|
48
50
|
const HTTP_RE = /^https?:\/\/\S/i;
|
|
@@ -65,8 +67,33 @@ function quoteOf(v) {
|
|
|
65
67
|
q.time = v.time.trim();
|
|
66
68
|
if (v.context === true)
|
|
67
69
|
q.context = true;
|
|
70
|
+
// 便 EV: 欄ごとに検め、崩れた欄だけ捨てる(引用は残す)
|
|
71
|
+
if (typeof v.role === "string" && exports.EVIDENCE_ROLES.includes(v.role))
|
|
72
|
+
q.role = v.role;
|
|
73
|
+
if (typeof v.url === "string" && HTTP_RE.test(v.url))
|
|
74
|
+
q.url = v.url;
|
|
75
|
+
if (typeof v.at === "string" && DAY_RE.test(v.at))
|
|
76
|
+
q.at = v.at;
|
|
77
|
+
if (typeof v.cond === "string" && v.cond.trim() !== "")
|
|
78
|
+
q.cond = v.cond.trim();
|
|
68
79
|
return q;
|
|
69
80
|
}
|
|
81
|
+
/** 印 1 つ。崩れていれば null(その印だけ捨てる)。`did` が空でない文字列でなければ崩れ */
|
|
82
|
+
function signOf(v) {
|
|
83
|
+
if (!isObj(v) || !isText(v.did))
|
|
84
|
+
return null;
|
|
85
|
+
// 補助の欄(型違いはその欄だけ null に落とす)。`did` と人数が無い印だけ、印ごと捨てる
|
|
86
|
+
const str = (x) => (typeof x === "string" && x.trim() !== "" ? x.trim() : null);
|
|
87
|
+
const onUrl = str(v.on_url);
|
|
88
|
+
const s = { on_url: onUrl && HTTP_RE.test(onUrl) ? onUrl : null, by: str(v.by), by_name: str(v.by_name), did: v.did, at: str(v.at) };
|
|
89
|
+
// 人数は `by` が null の時だけ・1 以上の整数。無い・崩れていれば人数の印として出せないので捨てる
|
|
90
|
+
if (!s.by) {
|
|
91
|
+
if (typeof v.count !== "number" || !Number.isInteger(v.count) || v.count < 1)
|
|
92
|
+
return null;
|
|
93
|
+
s.count = v.count;
|
|
94
|
+
}
|
|
95
|
+
return s;
|
|
96
|
+
}
|
|
70
97
|
/** 項目 1 つ。崩れていれば null(捨てる) */
|
|
71
98
|
function memoryEvidenceItemOf(v) {
|
|
72
99
|
if (!isObj(v))
|
|
@@ -87,6 +114,11 @@ function memoryEvidenceItemOf(v) {
|
|
|
87
114
|
return null;
|
|
88
115
|
const quotes = Array.isArray(v.quotes) ? v.quotes.map(quoteOf).filter((q) => q !== null) : [];
|
|
89
116
|
const item = { key: v.key, at: typeof v.at === "string" ? v.at : "", kind: v.kind, url, text_ref: url ? null : textRef, quotes };
|
|
117
|
+
if (Array.isArray(v.signs)) {
|
|
118
|
+
const signs = v.signs.map(signOf).filter((x) => x !== null);
|
|
119
|
+
if (signs.length)
|
|
120
|
+
item.signs = signs;
|
|
121
|
+
}
|
|
90
122
|
if (typeof v.night === "string" && DAY_RE.test(v.night))
|
|
91
123
|
item.night = v.night;
|
|
92
124
|
if (typeof v.cand === "string" && v.cand)
|