egregore-artifacts 0.9.5 → 0.9.6
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/lib/index.js +0 -6
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -24,11 +24,7 @@ import { derivedParent, loadComments } from './comments.js';
|
|
|
24
24
|
const PARSERS = { quest: parseQuest, handoff: parseHandoff, 'handoff-v1': parseHandoffV1, activity: parseActivity, document: parseDocument, board: parseBoard, network: parseNetwork };
|
|
25
25
|
const TEMPLATES = { quest: questTemplate, handoff: handoffTemplate, 'handoff-v1': handoffV1Template, activity: activityTemplate, document: documentTemplate, board: boardTemplate, network: networkTemplate };
|
|
26
26
|
|
|
27
|
-
// Types that participate in the comments system. Skipped: board (interactive
|
|
28
|
-
// editor with its own UI), activity/network (live feeds without a stable
|
|
29
|
-
// parent_id).
|
|
30
27
|
const COMMENTABLE_TYPES = new Set(['quest', 'handoff', 'document']);
|
|
31
|
-
|
|
32
28
|
export async function generateArtifact(type, input, options = {}) {
|
|
33
29
|
const template = TEMPLATES[type];
|
|
34
30
|
if (!template) throw new Error(`Unknown artifact type: ${type}. Available: ${Object.keys(TEMPLATES).join(', ')}`);
|
|
@@ -42,14 +38,12 @@ export async function generateArtifact(type, input, options = {}) {
|
|
|
42
38
|
data = input;
|
|
43
39
|
}
|
|
44
40
|
|
|
45
|
-
// Comments — only when rendering from a real file path and the type supports them.
|
|
46
41
|
let parent = null;
|
|
47
42
|
let comments = [];
|
|
48
43
|
if (typeof input === 'string' && COMMENTABLE_TYPES.has(type)) {
|
|
49
44
|
parent = derivedParent(type, input);
|
|
50
45
|
if (parent) comments = loadComments(parent);
|
|
51
46
|
}
|
|
52
|
-
|
|
53
47
|
// Link context for inlineMarkdown — only enabled when both values are supplied.
|
|
54
48
|
// Missing either falls through to plain <code> rendering (OSS mode).
|
|
55
49
|
setLinkContext({ viewBase: options.viewBase, orgSlug: options.orgSlug });
|