@rathnasgala2/template 3.0.1 → 3.2.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/README.md +144 -49
- package/contracts/render-policy.jcs +1 -1
- package/package.json +4 -3
- package/src/core/index.js +122 -17
- package/src/core/internal/appearance/base-layer.js +82 -0
- package/src/core/internal/chrome.js +5 -2
- package/src/core/internal/components.js +69 -10
- package/src/core/internal/content-security.js +0 -0
- package/src/core/internal/editions.js +297 -0
- package/src/core/internal/eleventy-render.js +5 -3
- package/src/core/internal/feeds.js +8 -18
- package/src/core/internal/icons.js +2 -0
- package/src/core/internal/interactions.js +349 -0
- package/src/core/internal/media/content-images.js +262 -0
- package/src/core/internal/media/gif-probe.js +162 -0
- package/src/core/internal/media/jpeg-codec.js +0 -0
- package/src/core/internal/media/limits.js +21 -0
- package/src/core/internal/media/pipeline.js +73 -40
- package/src/core/internal/media/sniff.js +15 -2
- package/src/core/internal/messages.js +16 -1
- package/src/core/internal/page-kinds.js +121 -26
- package/src/core/internal/render-policy-content.js +40 -5
- package/src/core/internal/skeleton.js +25 -4
- package/src/core/internal/source-inventory.js +4 -0
- package/src/modules/interactions/browser/gala-interactions.js +2176 -0
- package/types/index.d.ts +61 -3
package/types/index.d.ts
CHANGED
|
@@ -54,10 +54,23 @@ export interface RenderableBody {
|
|
|
54
54
|
renderPolicy: { name: string; version: string; digest: string };
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* A `contentEdition`-shaped object: which article a `kind: "edition"` document
|
|
59
|
+
* restates, at what depth, and where it came from. A stale edition never
|
|
60
|
+
* reaches the renderer, so `sourceDigest` is carried but not compared.
|
|
61
|
+
*/
|
|
62
|
+
export interface ContentEdition {
|
|
63
|
+
of: string;
|
|
64
|
+
kind: 'QUICK_READ' | 'STANDARD' | 'DEEP_DIVE';
|
|
65
|
+
sourceDigest: string;
|
|
66
|
+
generation: { provider: string; model: string; generationId: string };
|
|
67
|
+
approvedAt: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
57
70
|
/** A `contentFrontmatterNormalized`-shaped record's fields this renderer reads. */
|
|
58
71
|
export interface ContentFrontmatterNormalized {
|
|
59
72
|
id: string;
|
|
60
|
-
kind: 'article' | 'page';
|
|
73
|
+
kind: 'article' | 'page' | 'edition';
|
|
61
74
|
title: string;
|
|
62
75
|
description?: string;
|
|
63
76
|
language: string;
|
|
@@ -74,6 +87,20 @@ export interface ContentFrontmatterNormalized {
|
|
|
74
87
|
hero?: ResolvedMediaRef;
|
|
75
88
|
socialImage?: ResolvedFileRef;
|
|
76
89
|
redirects: string[];
|
|
90
|
+
/** Present exactly when `kind` is `edition`. */
|
|
91
|
+
edition?: ContentEdition;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* A `contentBuildMediaFile`-shaped entry: one repository file a document
|
|
96
|
+
* references. Every image the document's body references must be one of
|
|
97
|
+
* these (an image media type).
|
|
98
|
+
*/
|
|
99
|
+
export interface ContentBuildMediaFile {
|
|
100
|
+
path: string;
|
|
101
|
+
sourceDigest: string;
|
|
102
|
+
mediaType: string;
|
|
103
|
+
byteLength: number;
|
|
77
104
|
}
|
|
78
105
|
|
|
79
106
|
/** A `contentBuildRecord`-shaped record. */
|
|
@@ -87,6 +114,7 @@ export interface ContentBuildRecord {
|
|
|
87
114
|
sourceRevision: string;
|
|
88
115
|
sourceDigest: string;
|
|
89
116
|
resolvedAuthorIds: string[];
|
|
117
|
+
media?: ContentBuildMediaFile[];
|
|
90
118
|
}
|
|
91
119
|
|
|
92
120
|
/** A `socialLink`-shaped reference. */
|
|
@@ -174,9 +202,39 @@ export interface AppearanceNormalized {
|
|
|
174
202
|
fontAssets: ResolvedFileRef[];
|
|
175
203
|
tokens: Record<string, never>;
|
|
176
204
|
source: NormalizedSource;
|
|
205
|
+
/** The footer attribution switch; absent means the attribution shows. */
|
|
206
|
+
attribution?: { showMadeWith: boolean };
|
|
177
207
|
}
|
|
178
208
|
|
|
179
209
|
/** The subset of `build-input:2.0.0` this renderer reads. */
|
|
210
|
+
/** One author-defined reaction (`interactions-config:2.0.0`). */
|
|
211
|
+
export interface InteractionsReactionDefinition {
|
|
212
|
+
key: string;
|
|
213
|
+
label: string;
|
|
214
|
+
visual: { kind: 'emoji'; token: string };
|
|
215
|
+
order: number;
|
|
216
|
+
enabled: boolean;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** The repository's `gala/modules/interactions.json` (`interactions-config:2.0.0`). */
|
|
220
|
+
export interface InteractionsConfig {
|
|
221
|
+
schemaId: 'urn:gala:schema:interactions-config:2.0.0';
|
|
222
|
+
schemaVersion: '2.0.0';
|
|
223
|
+
reactions: {
|
|
224
|
+
enabled: boolean;
|
|
225
|
+
definitions: InteractionsReactionDefinition[];
|
|
226
|
+
};
|
|
227
|
+
comments: { enabled: boolean; allowReplies: boolean; maxDepth: number };
|
|
228
|
+
publicCounts: { reactions: boolean; comments: boolean };
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** `build-input.modules.interactions`: the config plus the two origins. */
|
|
232
|
+
export interface InteractionsModule {
|
|
233
|
+
config: InteractionsConfig;
|
|
234
|
+
apiOrigin: string;
|
|
235
|
+
appOrigin: string;
|
|
236
|
+
}
|
|
237
|
+
|
|
180
238
|
export interface NormalizedBuildInput {
|
|
181
239
|
schemaId: string;
|
|
182
240
|
schemaVersion: string;
|
|
@@ -200,7 +258,7 @@ export interface NormalizedBuildInput {
|
|
|
200
258
|
content: ContentBuildRecord[];
|
|
201
259
|
navigation: NavigationNormalized;
|
|
202
260
|
appearance: AppearanceNormalized;
|
|
203
|
-
modules:
|
|
261
|
+
modules: { interactions?: InteractionsModule };
|
|
204
262
|
buildEpoch: string;
|
|
205
263
|
baseUrl: string;
|
|
206
264
|
basePath: string;
|
|
@@ -221,7 +279,7 @@ export interface ManifestRouteEntry {
|
|
|
221
279
|
byteLength: string;
|
|
222
280
|
sha256: string;
|
|
223
281
|
routeClass: 'html' | 'feed' | 'sitemap' | 'asset' | 'error';
|
|
224
|
-
interactionBearing:
|
|
282
|
+
interactionBearing: boolean;
|
|
225
283
|
}
|
|
226
284
|
|
|
227
285
|
/** A `manifestAsset`-shaped entry (the media pipeline emits one per generated file). */
|