@refrakt-md/types 0.7.1 → 0.8.0
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/content-model.d.ts +180 -0
- package/dist/content-model.d.ts.map +1 -0
- package/dist/content-model.js +10 -0
- package/dist/content-model.js.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +0 -9
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/package.d.ts +5 -0
- package/dist/package.d.ts.map +1 -1
- package/dist/pipeline.d.ts +102 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +3 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/schema/common.d.ts +0 -14
- package/dist/schema/common.d.ts.map +1 -1
- package/dist/schema/common.js.map +1 -1
- package/dist/schema/index.d.ts +6 -5
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +5 -3
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/page.d.ts +0 -22
- package/dist/schema/page.d.ts.map +1 -1
- package/dist/schema/page.js.map +1 -1
- package/dist/theme.d.ts +4 -0
- package/dist/theme.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declarative content model types.
|
|
3
|
+
*
|
|
4
|
+
* A content model describes how a rune's AST children are grouped and
|
|
5
|
+
* assigned to named fields. The resolver engine uses these declarations
|
|
6
|
+
* to replace per-rune `processChildren` methods with a generic, data-driven
|
|
7
|
+
* resolution step.
|
|
8
|
+
*/
|
|
9
|
+
/** Describes a single named field in a content model. */
|
|
10
|
+
export interface ContentFieldDefinition {
|
|
11
|
+
/** Field name — becomes the key in the resolved output. */
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* Node type to match.
|
|
15
|
+
*
|
|
16
|
+
* Block-level: 'paragraph', 'heading', 'heading:2', 'list',
|
|
17
|
+
* 'list:ordered', 'list:unordered', 'image', 'blockquote',
|
|
18
|
+
* 'fence', 'hr', 'tag:NAME', 'any'.
|
|
19
|
+
*
|
|
20
|
+
* Inline-level (for itemModel / headingExtract — future):
|
|
21
|
+
* 'strong', 'em', 'link', 'image', 'code', 'text'.
|
|
22
|
+
*/
|
|
23
|
+
match: string;
|
|
24
|
+
/** Whether the field can be absent without warning. Default `false`. */
|
|
25
|
+
optional?: boolean;
|
|
26
|
+
/** Consume all consecutive matching nodes into an array. Default `false`. */
|
|
27
|
+
greedy?: boolean;
|
|
28
|
+
/** Markdoc snippet for editor insertion (future). */
|
|
29
|
+
template?: string;
|
|
30
|
+
/** Human-readable description for editor UI (future). */
|
|
31
|
+
description?: string;
|
|
32
|
+
/** For list fields: declares how to extract structured data from each list item. */
|
|
33
|
+
itemModel?: ItemModel;
|
|
34
|
+
}
|
|
35
|
+
/** Pattern 1 — children matched in order by node type. */
|
|
36
|
+
export interface SequenceModel {
|
|
37
|
+
type: 'sequence';
|
|
38
|
+
fields: ContentFieldDefinition[];
|
|
39
|
+
}
|
|
40
|
+
/** A named zone within a delimited model. */
|
|
41
|
+
export interface DelimitedZone extends SequenceModel {
|
|
42
|
+
name: string;
|
|
43
|
+
}
|
|
44
|
+
/** A field extracted from section heading text. */
|
|
45
|
+
export interface HeadingExtractField {
|
|
46
|
+
/** Field name — becomes key in extracted output. */
|
|
47
|
+
name: string;
|
|
48
|
+
/** Match type — currently only 'text' (matches against heading text). */
|
|
49
|
+
match: 'text';
|
|
50
|
+
/** Pattern to extract. RegExp uses capture group 1. 'remainder' takes rest of text. */
|
|
51
|
+
pattern: RegExp | 'remainder';
|
|
52
|
+
/** Whether the field can fail to match. Default `false`. */
|
|
53
|
+
optional?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/** Defines how structured data is parsed from section heading text. */
|
|
56
|
+
export interface HeadingExtract {
|
|
57
|
+
fields: HeadingExtractField[];
|
|
58
|
+
}
|
|
59
|
+
/** Pattern 2 — children split into sections by heading elements. */
|
|
60
|
+
export interface SectionsModel {
|
|
61
|
+
type: 'sections';
|
|
62
|
+
/**
|
|
63
|
+
* Heading type to split on.
|
|
64
|
+
* `'heading'` auto-detects level from first heading child.
|
|
65
|
+
* `'heading:N'` uses an explicit level (e.g. `'heading:2'`).
|
|
66
|
+
*/
|
|
67
|
+
sectionHeading: string;
|
|
68
|
+
/** Preamble fields — resolved against content before the first section heading. */
|
|
69
|
+
fields?: ContentFieldDefinition[];
|
|
70
|
+
/** Content model applied to each section's body. */
|
|
71
|
+
sectionModel: ContentModel;
|
|
72
|
+
/** When set, sections are emitted as child rune tag nodes with this tag name. */
|
|
73
|
+
emitTag?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Attribute mapping for emitted tags.
|
|
76
|
+
* Values starting with `$` are references: `$heading` = heading text,
|
|
77
|
+
* `$fieldName` = heading-extracted field. Other values are literals.
|
|
78
|
+
*/
|
|
79
|
+
emitAttributes?: Record<string, string>;
|
|
80
|
+
/** Extract structured data from heading text. */
|
|
81
|
+
headingExtract?: HeadingExtract;
|
|
82
|
+
}
|
|
83
|
+
/** Pattern 3 — children split into groups by a delimiter node. */
|
|
84
|
+
export interface DelimitedModel {
|
|
85
|
+
type: 'delimited';
|
|
86
|
+
/** Delimiter node type (typically `'hr'`). */
|
|
87
|
+
delimiter: string;
|
|
88
|
+
/** Named zones — each group maps to a declared zone by index. */
|
|
89
|
+
zones?: DelimitedZone[];
|
|
90
|
+
/** When `true`, the number of zones is determined by delimiter count. */
|
|
91
|
+
dynamicZones?: boolean;
|
|
92
|
+
/** Zone model used when `dynamicZones` is `true`. */
|
|
93
|
+
zoneModel?: SequenceModel;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Pattern 4 — explicit escape hatch for runes whose content parsing is
|
|
97
|
+
* genuinely stateful and cannot be expressed declaratively.
|
|
98
|
+
*
|
|
99
|
+
* The `processChildren` function receives AST children and the rune's
|
|
100
|
+
* attribute values, returns rewritten nodes.
|
|
101
|
+
*/
|
|
102
|
+
export interface CustomModel {
|
|
103
|
+
type: 'custom';
|
|
104
|
+
processChildren: (nodes: unknown[], attributes: Record<string, unknown>) => unknown[];
|
|
105
|
+
/** Human-readable description of what the custom parser does. */
|
|
106
|
+
description: string;
|
|
107
|
+
}
|
|
108
|
+
/** A field extracted from inline content within a list item. */
|
|
109
|
+
export interface ItemFieldDefinition {
|
|
110
|
+
/** Field name — becomes key in extracted output. */
|
|
111
|
+
name: string;
|
|
112
|
+
/**
|
|
113
|
+
* Inline node type to match.
|
|
114
|
+
*
|
|
115
|
+
* Inline: 'strong', 'em', 'link', 'image', 'code', 'text'.
|
|
116
|
+
* Block (for nested content): 'list', 'paragraph'.
|
|
117
|
+
*/
|
|
118
|
+
match: string;
|
|
119
|
+
/** Whether the field can fail to match. Default `false`. */
|
|
120
|
+
optional?: boolean;
|
|
121
|
+
/** Consume all consecutive matching nodes into an array. Default `false`. */
|
|
122
|
+
greedy?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Which attribute to extract instead of text content.
|
|
125
|
+
* E.g., `'href'` on a link match extracts the URL.
|
|
126
|
+
*/
|
|
127
|
+
extract?: string;
|
|
128
|
+
/**
|
|
129
|
+
* For text-level extraction: regex pattern or `'remainder'` for leftover text.
|
|
130
|
+
* When a RegExp, capture group 1 is used. When `'remainder'`, captures
|
|
131
|
+
* whatever text is left after all other patterns have matched.
|
|
132
|
+
*/
|
|
133
|
+
pattern?: RegExp | 'remainder';
|
|
134
|
+
/** Nested item model for sub-lists. */
|
|
135
|
+
itemModel?: ItemModel;
|
|
136
|
+
}
|
|
137
|
+
/** Declares how to extract structured data from each list item's inline children. */
|
|
138
|
+
export interface ItemModel {
|
|
139
|
+
fields: ItemFieldDefinition[];
|
|
140
|
+
}
|
|
141
|
+
/** Condition: attribute value is in a set. */
|
|
142
|
+
export interface AttributeInCondition {
|
|
143
|
+
attribute: string;
|
|
144
|
+
in: string[];
|
|
145
|
+
}
|
|
146
|
+
/** Condition: attribute is present (truthy). */
|
|
147
|
+
export interface AttributeExistsCondition {
|
|
148
|
+
attribute: string;
|
|
149
|
+
exists: true;
|
|
150
|
+
}
|
|
151
|
+
/** Condition: a child matching a node type is present. */
|
|
152
|
+
export interface HasChildCondition {
|
|
153
|
+
hasChild: string;
|
|
154
|
+
}
|
|
155
|
+
/** A content model condition — used in `when` branches. */
|
|
156
|
+
export type ContentModelCondition = AttributeInCondition | AttributeExistsCondition | HasChildCondition;
|
|
157
|
+
/** A conditional content model that branches on attributes or content shape. */
|
|
158
|
+
export interface ConditionalContentModel {
|
|
159
|
+
when: Array<{
|
|
160
|
+
condition: ContentModelCondition;
|
|
161
|
+
model: ContentModel;
|
|
162
|
+
}>;
|
|
163
|
+
default: ContentModel;
|
|
164
|
+
}
|
|
165
|
+
/** A structural content model pattern. */
|
|
166
|
+
export type StructuralContentModel = SequenceModel | SectionsModel | DelimitedModel | CustomModel;
|
|
167
|
+
/**
|
|
168
|
+
* A content model declaration.
|
|
169
|
+
*
|
|
170
|
+
* Supports `sequence`, `sections`, `delimited`, and `custom` patterns,
|
|
171
|
+
* plus `when` conditional branching.
|
|
172
|
+
*/
|
|
173
|
+
export type ContentModel = StructuralContentModel | ConditionalContentModel;
|
|
174
|
+
/** A single resolved field value. */
|
|
175
|
+
export type ResolvedField = unknown | unknown[] | ResolvedContent | undefined;
|
|
176
|
+
/** The output of resolving a content model against AST children. */
|
|
177
|
+
export interface ResolvedContent {
|
|
178
|
+
[fieldName: string]: ResolvedField;
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=content-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-model.d.ts","sourceRoot":"","sources":["../src/content-model.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,yDAAyD;AACzD,MAAM,WAAW,sBAAsB;IACtC,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;;;;OASG;IACH,KAAK,EA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0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,2DAA2D;AAC3D,MAAM,MAAM,qBAAqB,GAC9B,oBAAoB,GACpB,wBAAwB,GACxB,iBAAiB,CAAC;AAErB,gFAAgF;AAChF,MAAM,WAAW,uBAAuB;IACvC,IAAI,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,qBAAqB,CAAC;QAAC,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC,CAAC;IACvE,OAAO,EAAE,YAAY,CAAC;CACtB;AAMD,0CAA0C;AAC1C,MAAM,MAAM,sBAAsB,GAAG,aAAa,GAAG,aAAa,GAAG,cAAc,GAAG,WAAW,CAAC;AAElG;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,sBAAsB,GAAG,uBAAuB,CAAC;AAU5E,qCAAqC;AACrC,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,EAAE,GAAG,eAAe,GAAG,SAAS,CAAC;AAE9E,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC/B,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC;CACnC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declarative content model types.
|
|
3
|
+
*
|
|
4
|
+
* A content model describes how a rune's AST children are grouped and
|
|
5
|
+
* assigned to named fields. The resolver engine uses these declarations
|
|
6
|
+
* to replace per-rune `processChildren` methods with a generic, data-driven
|
|
7
|
+
* resolution step.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=content-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-model.js","sourceRoot":"","sources":["../src/content-model.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export { Newable, NodeType,
|
|
1
|
+
export { Newable, NodeType, } from './interfaces.js';
|
|
2
2
|
export { Type, TypeFactory, useSchema, } from './schema/index.js';
|
|
3
|
-
export { Page, PageSection
|
|
4
|
-
export { LinkItem, Command
|
|
3
|
+
export { Page, PageSection } from './schema/page.js';
|
|
4
|
+
export { LinkItem, Command } from './schema/common.js';
|
|
5
5
|
export type { DesignTokens } from './tokens.js';
|
|
6
6
|
export type { RefraktConfig, ThemeManifest, LayoutDefinition, RouteRule, ComponentDefinition, } from './theme.js';
|
|
7
7
|
export type { RunePackage, RunePackageEntry, RunePackageAttribute, RuneExtension, RunePackageThemeConfig, } from './package.js';
|
|
8
8
|
export type { SerializedTag, RendererNode } from './serialized.js';
|
|
9
|
+
export type { ContentFieldDefinition, SequenceModel, HeadingExtractField, HeadingExtract, SectionsModel, DelimitedZone, DelimitedModel, CustomModel, ItemFieldDefinition, ItemModel, AttributeInCondition, AttributeExistsCondition, HasChildCondition, ContentModelCondition, ConditionalContentModel, StructuralContentModel, ContentModel, ResolvedField, ResolvedContent, } from './content-model.js';
|
|
10
|
+
export type { TransformedPage, PipelineHeadingInfo, EntityRegistration, EntityRegistry, AggregatedData, PipelineContext, PipelineWarning, PackagePipelineHooks, } from './pipeline.js';
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,QAAQ,GACT,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,IAAI,EACJ,WAAW,EACX,SAAS,GACV,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGvD,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,YAAY,EACV,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAGtB,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGnE,YAAY,EACX,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,SAAS,EACT,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,eAAe,GACf,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACX,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,oBAAoB,GACpB,MAAM,eAAe,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,8BAA8B;AAC9B,OAAO,EACL,IAAI,EACJ,WAAW,EACX,SAAS,GACV,MAAM,mBAAmB,CAAC;AAE3B,4DAA4D;AAC5D,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
export interface Newable<T> {
|
|
2
2
|
new (...args: any[]): T;
|
|
3
3
|
}
|
|
4
|
-
export type PropertyNodes<TSchema> = {
|
|
5
|
-
[P in keyof TSchema]: NodeType;
|
|
6
|
-
};
|
|
7
4
|
export type NodeType = 'document' | 'meta' | 'address' | 'article' | 'aside' | 'details' | 'footer' | 'form' | 'header' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'hgroup' | 'main' | 'nav' | 'section' | 'search' | 'blockquote' | 'dd' | 'div' | 'dl' | 'dt' | 'figcaption' | 'figure' | 'hr' | 'li' | 'menu' | 'ol' | 'p' | 'pre' | 'ul' | 'a' | 'abbr' | 'b' | 'bdi' | 'bdo' | 'br' | 'cite' | 'code' | 'data' | 'dfn' | 'em' | 'i' | 'kbd' | 'span' | 'strong' | 'summary' | 'time' | 'area' | 'audio' | 'img' | 'map' | 'track' | 'video' | 'svg' | 'path' | 'math' | 'button' | 'fieldset' | 'input' | 'label' | 'legend' | 'option' | 'select' | 'textarea' | 'caption' | 'col' | 'colgroup' | 'table' | 'tbody' | 'td' | 'tfoot' | 'th' | 'thead' | 'tr';
|
|
8
|
-
export interface ComponentType<TSchema> {
|
|
9
|
-
tag: NodeType;
|
|
10
|
-
schema: TSchema;
|
|
11
|
-
properties: PropertyNodes<TSchema>;
|
|
12
|
-
refs: Record<string, NodeType>;
|
|
13
|
-
}
|
|
14
5
|
//# sourceMappingURL=interfaces.d.ts.map
|
package/dist/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACzB;AAED,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACzB;AAED,MAAM,MAAM,QAAQ,GAClB,UAAU,GAGV,MAAM,GAGN,SAAS,GACT,SAAS,GACT,OAAO,GACP,SAAS,GACT,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GACvC,QAAQ,GACR,MAAM,GACN,KAAK,GACL,SAAS,GACT,QAAQ,GAGR,YAAY,GACZ,IAAI,GACJ,KAAK,GACL,IAAI,GACJ,IAAI,GACJ,YAAY,GACZ,QAAQ,GACR,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,IAAI,GACJ,GAAG,GACH,KAAK,GACL,IAAI,GAGJ,GAAG,GACH,MAAM,GACN,GAAG,GACH,KAAK,GACL,KAAK,GACL,IAAI,GACJ,MAAM,GACN,MAAM,GACN,MAAM,GACN,KAAK,GACL,IAAI,GACJ,GAAG,GACH,KAAK,GACL,MAAM,GACN,QAAQ,GACR,SAAS,GACT,MAAM,GAGN,MAAM,GACN,OAAO,GACP,KAAK,GACL,KAAK,GACL,OAAO,GACP,OAAO,GAGP,KAAK,GACL,MAAM,GACN,MAAM,GAGN,QAAQ,GACR,UAAU,GACV,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,UAAU,GAGV,SAAS,GACT,KAAK,GACL,UAAU,GACV,OAAO,GACP,OAAO,GACP,IAAI,GACJ,OAAO,GACP,IAAI,GACJ,OAAO,GACP,IAAI,CAAC"}
|
package/dist/package.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export interface RunePackageThemeConfig {
|
|
|
37
37
|
runes?: Record<string, Record<string, unknown>>;
|
|
38
38
|
/** Additional icon SVGs (group name → icon name → SVG string) */
|
|
39
39
|
icons?: Record<string, Record<string, string>>;
|
|
40
|
+
/** Background preset definitions for this package's runes */
|
|
41
|
+
backgrounds?: Record<string, Record<string, unknown>>;
|
|
40
42
|
}
|
|
41
43
|
/** A community rune package's exported registration object */
|
|
42
44
|
export interface RunePackage {
|
|
@@ -55,5 +57,8 @@ export interface RunePackage {
|
|
|
55
57
|
/** Client-side behavior functions keyed by rune typeof name (lowercase).
|
|
56
58
|
* Typed as unknown here — actual BehaviorFn type lives in @refrakt-md/behaviors. */
|
|
57
59
|
behaviors?: Record<string, unknown>;
|
|
60
|
+
/** Build-time cross-page pipeline hooks.
|
|
61
|
+
* Optional — packages that don't need cross-page awareness omit this entirely. */
|
|
62
|
+
pipeline?: import('./pipeline.js').PackagePipelineHooks;
|
|
58
63
|
}
|
|
59
64
|
//# sourceMappingURL=package.d.ts.map
|
package/dist/package.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../src/package.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAEhD,qEAAqE;AACrE,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,oDAAoD;AACpD,MAAM,WAAW,gBAAgB;IAChC,qFAAqF;IACrF,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC9C,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MA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AAe,EAAE,oBAAoB,CAAC;CACxD"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/** Cross-page pipeline types */
|
|
2
|
+
/** A page heading (level, text, generated anchor id) */
|
|
3
|
+
export interface PipelineHeadingInfo {
|
|
4
|
+
level: number;
|
|
5
|
+
text: string;
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A page after Phase 1 (parse + rune transform), before Phase 4 (post-process).
|
|
10
|
+
* Passed to all three pipeline hooks.
|
|
11
|
+
*/
|
|
12
|
+
export interface TransformedPage {
|
|
13
|
+
/** Resolved URL for this page (e.g. '/docs/getting-started/') */
|
|
14
|
+
url: string;
|
|
15
|
+
/** Page title from frontmatter */
|
|
16
|
+
title: string;
|
|
17
|
+
/** Headings extracted from the page content */
|
|
18
|
+
headings: PipelineHeadingInfo[];
|
|
19
|
+
/** Raw frontmatter values */
|
|
20
|
+
frontmatter: Record<string, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* The page's renderable content after rune transforms.
|
|
23
|
+
* At pipeline time this holds the framework's native AST node type
|
|
24
|
+
* (e.g. Markdoc Tag instances), which is serialized to plain objects later.
|
|
25
|
+
* Typed as unknown to avoid importing framework-specific types here.
|
|
26
|
+
*/
|
|
27
|
+
renderable: unknown;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A named entity registered during Phase 2 (Register).
|
|
31
|
+
* The id field must be unique within its type.
|
|
32
|
+
*/
|
|
33
|
+
export interface EntityRegistration {
|
|
34
|
+
/** Entity category (e.g. 'page', 'heading', 'character', 'term') */
|
|
35
|
+
type: string;
|
|
36
|
+
/** Unique identifier within this type (e.g. '/docs/guide/' or '/docs/guide/#intro') */
|
|
37
|
+
id: string;
|
|
38
|
+
/** URL of the page this entity was registered from */
|
|
39
|
+
sourceUrl: string;
|
|
40
|
+
/** Entity-specific payload */
|
|
41
|
+
data: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
/** The site-wide entity registry built during Phase 2 (Register) */
|
|
44
|
+
export interface EntityRegistry {
|
|
45
|
+
register(entry: EntityRegistration): void;
|
|
46
|
+
/** All entities of a given type, in registration order */
|
|
47
|
+
getAll(type: string): EntityRegistration[];
|
|
48
|
+
/** All entities of a given type registered from a specific page URL */
|
|
49
|
+
getByUrl(type: string, url: string): EntityRegistration[];
|
|
50
|
+
/** Find a specific entity by type and id */
|
|
51
|
+
getById(type: string, id: string): EntityRegistration | undefined;
|
|
52
|
+
/** All registered entity type names */
|
|
53
|
+
getTypes(): string[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Cross-page data produced by aggregate hooks (Phase 3).
|
|
57
|
+
* Keyed by package name to prevent collisions between packages.
|
|
58
|
+
*/
|
|
59
|
+
export type AggregatedData = Record<string, unknown>;
|
|
60
|
+
/** Context object passed to each pipeline hook for emitting structured warnings */
|
|
61
|
+
export interface PipelineContext {
|
|
62
|
+
info(message: string, url?: string): void;
|
|
63
|
+
warn(message: string, url?: string): void;
|
|
64
|
+
error(message: string, url?: string): void;
|
|
65
|
+
}
|
|
66
|
+
/** A diagnostic emitted by a pipeline hook */
|
|
67
|
+
export interface PipelineWarning {
|
|
68
|
+
severity: 'info' | 'warning' | 'error';
|
|
69
|
+
phase: 'register' | 'aggregate' | 'postProcess';
|
|
70
|
+
packageName: string;
|
|
71
|
+
/** Page URL that triggered the warning, if applicable */
|
|
72
|
+
url?: string;
|
|
73
|
+
message: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Build-time cross-page pipeline hooks a RunePackage can provide.
|
|
77
|
+
* All three hooks are optional — packages that don't need cross-page
|
|
78
|
+
* awareness omit this field entirely.
|
|
79
|
+
*/
|
|
80
|
+
export interface PackagePipelineHooks {
|
|
81
|
+
/**
|
|
82
|
+
* Phase 2 — Register.
|
|
83
|
+
* Scan all transformed pages and register named entities in the site-wide registry.
|
|
84
|
+
* Called once with the full page array after Phase 1 is complete.
|
|
85
|
+
*/
|
|
86
|
+
register?: (pages: readonly TransformedPage[], registry: EntityRegistry, ctx: PipelineContext) => void;
|
|
87
|
+
/**
|
|
88
|
+
* Phase 3 — Aggregate.
|
|
89
|
+
* Build cross-page indexes, graphs, or collections from the full registry.
|
|
90
|
+
* Called once after all register hooks have run.
|
|
91
|
+
* Return value is stored as aggregated[packageName].
|
|
92
|
+
*/
|
|
93
|
+
aggregate?: (registry: Readonly<EntityRegistry>, ctx: PipelineContext) => unknown;
|
|
94
|
+
/**
|
|
95
|
+
* Phase 4 — Post-process.
|
|
96
|
+
* Enrich a page's renderable tree using cross-page data from aggregated.
|
|
97
|
+
* Called once per page, in package registration order.
|
|
98
|
+
* Return the modified page (or the original if no changes needed).
|
|
99
|
+
*/
|
|
100
|
+
postProcess?: (page: TransformedPage, aggregated: AggregatedData, ctx: PipelineContext) => TransformedPage;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAC;IACZ,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC;;;;;OAKG;IACH,UAAU,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAClC,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF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AAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CACV,KAAK,EAAE,SAAS,eAAe,EAAE,EACjC,QAAQ,EAAE,cAAc,EACxB,GAAG,EAAE,eAAe,KAChB,IAAI,CAAC;IAEV;;;;;OAKG;IACH,SAAS,CAAC,EAAE,CACX,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,EAClC,GAAG,EAAE,eAAe,KAChB,OAAO,CAAC;IAEb;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CACb,IAAI,EAAE,eAAe,EACrB,UAAU,EAAE,cAAc,EAC1B,GAAG,EAAE,eAAe,KAChB,eAAe,CAAC;CACrB"}
|
package/dist/pipeline.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA,gCAAgC"}
|
package/dist/schema/common.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ComponentType } from "../interfaces.js";
|
|
2
1
|
export declare class LinkItem {
|
|
3
2
|
name: string;
|
|
4
3
|
url: string;
|
|
@@ -6,17 +5,4 @@ export declare class LinkItem {
|
|
|
6
5
|
export declare class Command {
|
|
7
6
|
code: string;
|
|
8
7
|
}
|
|
9
|
-
export interface LinkItemComponent extends ComponentType<LinkItem> {
|
|
10
|
-
tag: 'li';
|
|
11
|
-
properties: {
|
|
12
|
-
name: 'span' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
13
|
-
url: 'a';
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export interface CommandComponent extends ComponentType<Command> {
|
|
17
|
-
tag: 'div';
|
|
18
|
-
properties: {
|
|
19
|
-
code: 'code';
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
8
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/schema/common.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/schema/common.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ;IACnB,IAAI,EAAE,MAAM,CAAM;IAClB,GAAG,EAAE,MAAM,CAAM;CAClB;AAED,qBAAa,OAAO;IAClB,IAAI,EAAE,MAAM,CAAM;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/schema/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/schema/common.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,QAAQ;IACnB,IAAI,GAAW,EAAE,CAAC;IAClB,GAAG,GAAW,EAAE,CAAC;CAClB;AAED,MAAM,OAAO,OAAO;IAClB,IAAI,GAAW,EAAE,CAAC;CACnB"}
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class Type<
|
|
1
|
+
import { Newable } from "../interfaces.js";
|
|
2
|
+
export declare class Type<TSchema extends object = object> {
|
|
3
3
|
readonly name: string;
|
|
4
4
|
private schemaCtr;
|
|
5
5
|
context: Record<string, string>;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
readonly schemaOrgType?: string | undefined;
|
|
7
|
+
constructor(name: string, schemaCtr: Newable<TSchema>, context?: Record<string, string>, schemaOrgType?: string | undefined);
|
|
8
|
+
create(): TSchema;
|
|
8
9
|
}
|
|
9
10
|
export declare class TypeFactory<TSchema extends object> {
|
|
10
11
|
private schema;
|
|
11
12
|
constructor(schema: Newable<TSchema>);
|
|
12
|
-
defineType
|
|
13
|
+
defineType(name: string, context?: Record<string, string>, schemaOrgType?: string): Type<TSchema>;
|
|
13
14
|
}
|
|
14
15
|
export declare function useSchema<T extends object>(schema: Newable<T>): TypeFactory<T>;
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,qBAAa,IAAI,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;aAE7B,IAAI,EAAE,MAAM;IAC5B,OAAO,CAAC,SAAS;IACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;aACtB,aAAa,CAAC,EAAE,MAAM;gBAHtB,IAAI,EAAE,MAAM,EACpB,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,EAC5B,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EAC3B,aAAa,CAAC,EAAE,MAAM,YAAA;IAGxC,MAAM;CAGP;AAED,qBAAa,WAAW,CAAC,OAAO,SAAS,MAAM;IACjC,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC;IAE5C,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EAAE,aAAa,CAAC,EAAE,MAAM;CAGtF;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,kBAE7D"}
|
package/dist/schema/index.js
CHANGED
|
@@ -2,10 +2,12 @@ export class Type {
|
|
|
2
2
|
name;
|
|
3
3
|
schemaCtr;
|
|
4
4
|
context;
|
|
5
|
-
|
|
5
|
+
schemaOrgType;
|
|
6
|
+
constructor(name, schemaCtr, context = {}, schemaOrgType) {
|
|
6
7
|
this.name = name;
|
|
7
8
|
this.schemaCtr = schemaCtr;
|
|
8
9
|
this.context = context;
|
|
10
|
+
this.schemaOrgType = schemaOrgType;
|
|
9
11
|
}
|
|
10
12
|
create() {
|
|
11
13
|
return new this.schemaCtr();
|
|
@@ -16,8 +18,8 @@ export class TypeFactory {
|
|
|
16
18
|
constructor(schema) {
|
|
17
19
|
this.schema = schema;
|
|
18
20
|
}
|
|
19
|
-
defineType(name, context = {}) {
|
|
20
|
-
return new Type(name, this.schema, context);
|
|
21
|
+
defineType(name, context = {}, schemaOrgType) {
|
|
22
|
+
return new Type(name, this.schema, context, schemaOrgType);
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
export function useSchema(schema) {
|
package/dist/schema/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,IAAI;IAEG;IACR;IACD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,IAAI;IAEG;IACR;IACD;IACS;IAJlB,YACkB,IAAY,EACpB,SAA2B,EAC5B,UAAkC,EAAE,EAC3B,aAAsB;QAHtB,SAAI,GAAJ,IAAI,CAAQ;QACpB,cAAS,GAAT,SAAS,CAAkB;QAC5B,YAAO,GAAP,OAAO,CAA6B;QAC3B,kBAAa,GAAb,aAAa,CAAS;IACrC,CAAC;IAEJ,MAAM;QACJ,OAAO,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;IAC9B,CAAC;CACF;AAED,MAAM,OAAO,WAAW;IACF;IAApB,YAAoB,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAkB;IAAG,CAAC;IAEhD,UAAU,CAAC,IAAY,EAAE,UAAkC,EAAE,EAAE,aAAsB;QACnF,OAAO,IAAI,IAAI,CAAU,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;IACtE,CAAC;CACF;AAED,MAAM,UAAU,SAAS,CAAmB,MAAkB;IAC5D,OAAO,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC"}
|
package/dist/schema/page.d.ts
CHANGED
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
import { ComponentType, PropertyNodes } from "../interfaces.js";
|
|
2
1
|
export declare class PageSection {
|
|
3
2
|
eyebrow: string | undefined;
|
|
4
3
|
headline: string | undefined;
|
|
5
4
|
blurb: string | undefined;
|
|
6
5
|
}
|
|
7
|
-
export interface PageSectionProperties extends PropertyNodes<PageSection> {
|
|
8
|
-
eyebrow: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
9
|
-
headline: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
10
|
-
blurb: 'p';
|
|
11
|
-
}
|
|
12
|
-
export interface PageSectionComponent extends ComponentType<PageSection> {
|
|
13
|
-
tag: 'section';
|
|
14
|
-
properties: PageSectionProperties;
|
|
15
|
-
}
|
|
16
6
|
export declare class Page {
|
|
17
7
|
name: string;
|
|
18
8
|
description: string;
|
|
19
9
|
contentSection: PageSection[];
|
|
20
10
|
}
|
|
21
|
-
export interface PageProperties extends PropertyNodes<Page> {
|
|
22
|
-
name: 'h1';
|
|
23
|
-
description: 'p';
|
|
24
|
-
contentSection: 'section';
|
|
25
|
-
}
|
|
26
|
-
export interface PageComponent extends ComponentType<Page> {
|
|
27
|
-
tag: 'document';
|
|
28
|
-
properties: PageProperties;
|
|
29
|
-
refs: {
|
|
30
|
-
body: 'main';
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
11
|
//# sourceMappingURL=page.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/schema/page.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/schema/page.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IACtB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAa;IACxC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAa;IACzC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAa;CACvC;AAED,qBAAa,IAAI;IACf,IAAI,EAAE,MAAM,CAAM;IAClB,WAAW,EAAE,MAAM,CAAM;IACzB,cAAc,EAAE,WAAW,EAAE,CAAM;CACpC"}
|
package/dist/schema/page.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../src/schema/page.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../src/schema/page.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAW;IACtB,OAAO,GAAuB,SAAS,CAAC;IACxC,QAAQ,GAAuB,SAAS,CAAC;IACzC,KAAK,GAAuB,SAAS,CAAC;CACvC;AAED,MAAM,OAAO,IAAI;IACf,IAAI,GAAW,EAAE,CAAC;IAClB,WAAW,GAAW,EAAE,CAAC;IACzB,cAAc,GAAkB,EAAE,CAAC;CACpC"}
|
package/dist/theme.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ export interface RefraktConfig {
|
|
|
22
22
|
icons?: Record<string, string>;
|
|
23
23
|
/** Community rune packages to load (npm package names) */
|
|
24
24
|
packages?: string[];
|
|
25
|
+
/** Project-level tint presets — merged after theme tints (last wins) */
|
|
26
|
+
tints?: Record<string, Record<string, unknown>>;
|
|
27
|
+
/** Project-level background presets — merged after theme backgrounds (last wins) */
|
|
28
|
+
backgrounds?: Record<string, Record<string, unknown>>;
|
|
25
29
|
/** Rune resolution configuration */
|
|
26
30
|
runes?: {
|
|
27
31
|
/** Resolve name collisions between community packages: rune name → preferred package name.
|
package/dist/theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[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