@erudit-js/core 3.0.0-dev.25
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/brand.d.ts +2 -0
- package/dist/brand.js +9 -0
- package/dist/brandTerminal.d.ts +2 -0
- package/dist/brandTerminal.js +4 -0
- package/dist/cameo.d.ts +11 -0
- package/dist/cameo.js +3 -0
- package/dist/content/book.d.ts +5 -0
- package/dist/content/book.js +4 -0
- package/dist/content/contributions.d.ts +39 -0
- package/dist/content/contributions.js +1 -0
- package/dist/content/dependencies.d.ts +5 -0
- package/dist/content/dependencies.js +1 -0
- package/dist/content/externals.d.ts +15 -0
- package/dist/content/externals.js +1 -0
- package/dist/content/flags.d.ts +3 -0
- package/dist/content/flags.js +1 -0
- package/dist/content/global.d.ts +26 -0
- package/dist/content/global.js +48 -0
- package/dist/content/group.d.ts +6 -0
- package/dist/content/group.js +4 -0
- package/dist/content/item.d.ts +67 -0
- package/dist/content/item.js +12 -0
- package/dist/content/page.d.ts +6 -0
- package/dist/content/page.js +4 -0
- package/dist/content/path.d.ts +7 -0
- package/dist/content/path.js +38 -0
- package/dist/content/pointer.d.ts +15 -0
- package/dist/content/pointer.js +1 -0
- package/dist/content/prose.d.ts +3 -0
- package/dist/content/prose.js +10 -0
- package/dist/content/seo.d.ts +4 -0
- package/dist/content/seo.js +1 -0
- package/dist/content/topic.d.ts +9 -0
- package/dist/content/topic.js +8 -0
- package/dist/content/type.d.ts +3 -0
- package/dist/content/type.js +4 -0
- package/dist/contributor.d.ts +49 -0
- package/dist/contributor.js +34 -0
- package/dist/eruditConfig/ads.d.ts +33 -0
- package/dist/eruditConfig/ads.js +1 -0
- package/dist/eruditConfig/analytics.d.ts +12 -0
- package/dist/eruditConfig/analytics.js +1 -0
- package/dist/eruditConfig/config.d.ts +34 -0
- package/dist/eruditConfig/config.js +1 -0
- package/dist/eruditConfig/debug.d.ts +9 -0
- package/dist/eruditConfig/debug.js +1 -0
- package/dist/eruditConfig/elements.d.ts +1 -0
- package/dist/eruditConfig/elements.js +1 -0
- package/dist/eruditConfig/indexPage.d.ts +14 -0
- package/dist/eruditConfig/indexPage.js +1 -0
- package/dist/eruditConfig/language.d.ts +12 -0
- package/dist/eruditConfig/language.js +1 -0
- package/dist/eruditConfig/links.d.ts +6 -0
- package/dist/eruditConfig/links.js +1 -0
- package/dist/eruditConfig/repository.d.ts +11 -0
- package/dist/eruditConfig/repository.js +1 -0
- package/dist/eruditConfig/seo.d.ts +10 -0
- package/dist/eruditConfig/seo.js +1 -0
- package/dist/eruditConfig/site.d.ts +34 -0
- package/dist/eruditConfig/site.js +1 -0
- package/dist/mode.d.ts +1 -0
- package/dist/mode.js +1 -0
- package/dist/preview/request.d.ts +31 -0
- package/dist/preview/request.js +1 -0
- package/dist/preview/type.d.ts +1 -0
- package/dist/preview/type.js +1 -0
- package/dist/prose/documentId.d.ts +14 -0
- package/dist/prose/documentId.js +61 -0
- package/dist/prose/link.d.ts +22 -0
- package/dist/prose/link.js +10 -0
- package/dist/quote.d.ts +28 -0
- package/dist/quote.js +19 -0
- package/dist/sponsor.d.ts +32 -0
- package/dist/sponsor.js +3 -0
- package/package.json +26 -0
package/dist/brand.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const brandLogotype = "\n\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\n\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\n\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\n\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\n\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\n\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\n";
|
|
2
|
+
export declare const brandColors: string[];
|
package/dist/brand.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const brandLogotype = `
|
|
2
|
+
███████╗██████╗ ██╗ ██╗██████╗ ██╗████████╗
|
|
3
|
+
██╔════╝██╔══██╗██║ ██║██╔══██╗██║╚══██╔══╝
|
|
4
|
+
█████╗ ██████╔╝██║ ██║██║ ██║██║ ██║
|
|
5
|
+
██╔══╝ ██╔══██╗██║ ██║██║ ██║██║ ██║
|
|
6
|
+
███████╗██║ ██║╚██████╔╝██████╔╝██║ ██║
|
|
7
|
+
╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝
|
|
8
|
+
`;
|
|
9
|
+
export const brandColors = ['#4aa44c', '#1278b9'];
|
package/dist/cameo.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface Cameo {
|
|
2
|
+
cameoId: string;
|
|
3
|
+
name: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
messages: string[];
|
|
6
|
+
avatarExtension: string;
|
|
7
|
+
color: string;
|
|
8
|
+
link?: string;
|
|
9
|
+
}
|
|
10
|
+
export type CameoConfig = Omit<Cameo, 'cameoId' | 'avatarExtension' | 'icon'>;
|
|
11
|
+
export declare function defineCameo(cameo: CameoConfig): CameoConfig;
|
package/dist/cameo.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { GlobalContributorTypeguard } from '../contributor.js';
|
|
2
|
+
export interface ConfigContributionDescribed {
|
|
3
|
+
contributor: GlobalContributorTypeguard;
|
|
4
|
+
description: string;
|
|
5
|
+
}
|
|
6
|
+
export type ConfigContribution = GlobalContributorTypeguard | ConfigContributionDescribed;
|
|
7
|
+
export type IContributable = {
|
|
8
|
+
/**
|
|
9
|
+
* List of contributions to this content item.
|
|
10
|
+
* You can access contributors via `$CONTRIBUTOR` global variable:
|
|
11
|
+
* ```ts
|
|
12
|
+
* contributions: [
|
|
13
|
+
* $CONTRIBUTOR.john,
|
|
14
|
+
* {
|
|
15
|
+
* contributor: $CONTRIBUTOR.alice,
|
|
16
|
+
* description: 'Proposed problem "A game of circles".'
|
|
17
|
+
* }
|
|
18
|
+
* ],
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
contributions?: ConfigContribution[];
|
|
22
|
+
};
|
|
23
|
+
export interface ContentContribution {
|
|
24
|
+
contributorId: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
avatarUrl?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ContributorContributionItem {
|
|
30
|
+
type: 'topic' | 'page';
|
|
31
|
+
title: string;
|
|
32
|
+
link: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ContributorContributionBook {
|
|
35
|
+
type: 'book';
|
|
36
|
+
title: string;
|
|
37
|
+
items: ContributorContributionItem[];
|
|
38
|
+
}
|
|
39
|
+
export type ContributorContribution = ContributorContributionItem | ContributorContributionBook;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface BaseContentExternal {
|
|
2
|
+
type: 'web' | 'physical';
|
|
3
|
+
title: string;
|
|
4
|
+
info?: string;
|
|
5
|
+
reason: string;
|
|
6
|
+
}
|
|
7
|
+
export interface WebContentExternal extends BaseContentExternal {
|
|
8
|
+
type: 'web';
|
|
9
|
+
link: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PhysicalContentExternal extends BaseContentExternal {
|
|
12
|
+
type: 'physical';
|
|
13
|
+
}
|
|
14
|
+
export type ContentExternal = WebContentExternal | PhysicalContentExternal;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const contentFlags = ['dev', 'advanced', 'secondary'];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const globalContentItemBrand: unique symbol;
|
|
2
|
+
declare const globalContentTopicPartBrand: unique symbol;
|
|
3
|
+
declare const globalContentUniqueBrand: unique symbol;
|
|
4
|
+
export interface GlobalContentItemTypeguard {
|
|
5
|
+
[globalContentItemBrand]: true;
|
|
6
|
+
}
|
|
7
|
+
export interface GlobalContentTopicPartTypeguard {
|
|
8
|
+
[globalContentTopicPartBrand]: true;
|
|
9
|
+
}
|
|
10
|
+
export interface GlobalContentUniqueTypeguard {
|
|
11
|
+
[globalContentUniqueBrand]: true;
|
|
12
|
+
}
|
|
13
|
+
export type GlobalContentTypeguard = GlobalContentItemTypeguard | GlobalContentTopicPartTypeguard | GlobalContentUniqueTypeguard;
|
|
14
|
+
export interface GlobalContentItem {
|
|
15
|
+
__ERUDIT_globalContentItem: true;
|
|
16
|
+
__path: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function createGlobalContentProxy(path?: string): {
|
|
19
|
+
__ERUDIT_globalContentItem: true;
|
|
20
|
+
__path: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function transformGlobalContentPath(path: string): string;
|
|
23
|
+
export declare function createGlobalContent(path: string): GlobalContentItem;
|
|
24
|
+
export declare function isGlobalContent(value: any): value is GlobalContentItem;
|
|
25
|
+
export declare function getGlobalContentPath(item: GlobalContentItem): string;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Typeguards used only for compile-time checks
|
|
3
|
+
//
|
|
4
|
+
export function createGlobalContentProxy(path = '') {
|
|
5
|
+
return new Proxy({
|
|
6
|
+
__ERUDIT_globalContentItem: true,
|
|
7
|
+
__path: path,
|
|
8
|
+
}, {
|
|
9
|
+
get(_, prop) {
|
|
10
|
+
if (prop === '__ERUDIT_globalContentItem')
|
|
11
|
+
return true;
|
|
12
|
+
if (prop === '__path')
|
|
13
|
+
return path;
|
|
14
|
+
const finalPath = path ? `${path}/${prop}` : prop;
|
|
15
|
+
return createGlobalContentProxy(transformGlobalContentPath(finalPath));
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export function transformGlobalContentPath(path) {
|
|
20
|
+
const parts = path.split('/').filter((part) => part.length > 0);
|
|
21
|
+
const finalParts = [];
|
|
22
|
+
for (const part of parts) {
|
|
23
|
+
if (part.startsWith('$')) {
|
|
24
|
+
finalParts.push(part);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
finalParts.push(part.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase());
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return finalParts.join('/');
|
|
31
|
+
}
|
|
32
|
+
export function createGlobalContent(path) {
|
|
33
|
+
return {
|
|
34
|
+
__ERUDIT_globalContentItem: true,
|
|
35
|
+
__path: transformGlobalContentPath(path),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function isGlobalContent(value) {
|
|
39
|
+
return (typeof value === 'object' &&
|
|
40
|
+
value !== null &&
|
|
41
|
+
'__ERUDIT_globalContentItem' in value &&
|
|
42
|
+
value.__ERUDIT_globalContentItem === true &&
|
|
43
|
+
'__path' in value &&
|
|
44
|
+
typeof value.__path === 'string');
|
|
45
|
+
}
|
|
46
|
+
export function getGlobalContentPath(item) {
|
|
47
|
+
return item.__path;
|
|
48
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ContentItem, type TypelessContentItem } from './item.js';
|
|
2
|
+
export interface GroupContentItem extends ContentItem {
|
|
3
|
+
type: 'group';
|
|
4
|
+
separator?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function defineGroup(group?: TypelessContentItem<GroupContentItem>): ContentItem;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ContentFlags } from './flags.js';
|
|
2
|
+
import type { ContentDependency } from './dependencies.js';
|
|
3
|
+
import type { ContentType } from './type.js';
|
|
4
|
+
import type { ContentExternal } from './externals.js';
|
|
5
|
+
import type { ContentSeo } from './seo.js';
|
|
6
|
+
export type ContentItem = {
|
|
7
|
+
type: ContentType;
|
|
8
|
+
} & Partial<{
|
|
9
|
+
title: string;
|
|
10
|
+
navTitle: string;
|
|
11
|
+
description: string;
|
|
12
|
+
/**
|
|
13
|
+
* Hidden content items do not appear in aside content navigation
|
|
14
|
+
* but are still accessible via direct URL.
|
|
15
|
+
*/
|
|
16
|
+
hidden: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Mark content with specific flags.
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* flags: {
|
|
22
|
+
* dev: true, // Override parent `dev` if present
|
|
23
|
+
* secondary: false, // Override parent `secondary` if present
|
|
24
|
+
* // `advanced` is not set, so it will inherit from parent if present
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
flags: ContentFlags;
|
|
29
|
+
/**
|
|
30
|
+
* Manual list of content items this item depends on with explanations.
|
|
31
|
+
* Use this to emphasize important dependencies beyond the automatic ones.
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* dependencies: [
|
|
35
|
+
* {
|
|
36
|
+
* dependency: $CONTENT.combinatorics,
|
|
37
|
+
* reason: 'Provides foundational concepts used in this topic.'
|
|
38
|
+
* },
|
|
39
|
+
* {
|
|
40
|
+
* dependency: $CONTENT.combinatorics.baseRules.product,
|
|
41
|
+
* reason: 'This topic builds upon the product rule explained in that article.'
|
|
42
|
+
* },
|
|
43
|
+
* ];
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
dependencies: ContentDependency[];
|
|
47
|
+
/**
|
|
48
|
+
* List of **important** external resources related to this content item.
|
|
49
|
+
* It is not a reference list!
|
|
50
|
+
* Add only resources that can provide significant additional value to the reader and relate directly to the content.
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* externals: [
|
|
54
|
+
* {
|
|
55
|
+
* type: 'physical',
|
|
56
|
+
* title: 'Combinatorial Mathematics',
|
|
57
|
+
* description: 'A comprehensive guide to combinatorial principles and applications.',
|
|
58
|
+
* reason: 'Great amount of problems to practice combinatorial concepts.'
|
|
59
|
+
* },
|
|
60
|
+
* ];
|
|
61
|
+
*/
|
|
62
|
+
externals: ContentExternal[];
|
|
63
|
+
seo: ContentSeo;
|
|
64
|
+
}>;
|
|
65
|
+
export type TypelessContentItem<TContentItem extends ContentItem> = Omit<TContentItem, 'type'>;
|
|
66
|
+
export declare function finalizeContentItem(type: ContentType, item: TypelessContentItem<ContentItem>): ContentItem;
|
|
67
|
+
export declare function isContentItem<TContentItem extends ContentItem>(item: any, type: TContentItem['type']): item is TContentItem;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// export interface ContentItem extends ContentItemBase {
|
|
2
|
+
// type: ContentType;
|
|
3
|
+
// }
|
|
4
|
+
export function finalizeContentItem(type, item) {
|
|
5
|
+
return {
|
|
6
|
+
...item,
|
|
7
|
+
type,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export function isContentItem(item, type) {
|
|
11
|
+
return (item && typeof item === 'object' && 'type' in item && item.type === type);
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IContributable } from './contributions.js';
|
|
2
|
+
import { type ContentItem, type TypelessContentItem } from './item.js';
|
|
3
|
+
export interface PageContentItem extends ContentItem, IContributable {
|
|
4
|
+
type: 'page';
|
|
5
|
+
}
|
|
6
|
+
export declare function definePage(page?: TypelessContentItem<PageContentItem>): ContentItem;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ParsedContentPathPart {
|
|
2
|
+
position: number;
|
|
3
|
+
skip: boolean;
|
|
4
|
+
partId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function parseContentPathPart(part: string): ParsedContentPathPart | undefined;
|
|
7
|
+
export declare function contentPathToId(path: string, projectPath: string, short: 'full' | 'short'): string | undefined;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function parseContentPathPart(part) {
|
|
2
|
+
const [_all, position, skipChar, partId] = part.match(/^(\d+)([-\+])(.+)$/) || [];
|
|
3
|
+
if (position && skipChar && partId) {
|
|
4
|
+
return {
|
|
5
|
+
position: parseInt(position),
|
|
6
|
+
skip: skipChar === '+',
|
|
7
|
+
partId,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function contentPathToId(path, projectPath, short) {
|
|
12
|
+
if (path.startsWith(`${projectPath}/content/`)) {
|
|
13
|
+
const pathAfterContent = path.slice(`${projectPath}/content/`.length);
|
|
14
|
+
const parts = pathAfterContent.split('/');
|
|
15
|
+
const parsedParts = [];
|
|
16
|
+
for (const part of parts) {
|
|
17
|
+
const parsedPart = parseContentPathPart(part);
|
|
18
|
+
if (parsedPart) {
|
|
19
|
+
parsedParts.push(parsedPart);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
// Reached a part that's not a content path part, stop here
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (parsedParts.length === 0) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
// Build the content ID
|
|
30
|
+
const partsToInclude = short === 'short'
|
|
31
|
+
? parsedParts.filter((part, index) => {
|
|
32
|
+
// Keep all non-skippable parts, or if it's the last part (even if skippable)
|
|
33
|
+
return !part.skip || index === parsedParts.length - 1;
|
|
34
|
+
})
|
|
35
|
+
: parsedParts;
|
|
36
|
+
return partsToInclude.map((part) => part.partId).join('/');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TopicPart } from './topic.js';
|
|
2
|
+
import type { ContentType } from './type.js';
|
|
3
|
+
interface BasePointer {
|
|
4
|
+
type: ContentType;
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GenericContentPointer extends BasePointer {
|
|
8
|
+
type: Exclude<ContentType, 'topic'>;
|
|
9
|
+
}
|
|
10
|
+
export interface TopicContentPointer extends BasePointer {
|
|
11
|
+
type: 'topic';
|
|
12
|
+
part: TopicPart;
|
|
13
|
+
}
|
|
14
|
+
export type ContentPointer = GenericContentPointer | TopicContentPointer;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IContributable } from './contributions.js';
|
|
2
|
+
import { type ContentItem, type TypelessContentItem } from './item.js';
|
|
3
|
+
export declare const topicParts: readonly ["article", "summary", "practice"];
|
|
4
|
+
export type TopicPart = (typeof topicParts)[number];
|
|
5
|
+
export declare function isTopicPart(value: unknown): value is TopicPart;
|
|
6
|
+
export interface TopicContentItem extends ContentItem, IContributable {
|
|
7
|
+
type: 'topic';
|
|
8
|
+
}
|
|
9
|
+
export declare function defineTopic(topic?: TypelessContentItem<TopicContentItem>): ContentItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { finalizeContentItem, } from './item.js';
|
|
2
|
+
export const topicParts = ['article', 'summary', 'practice'];
|
|
3
|
+
export function isTopicPart(value) {
|
|
4
|
+
return topicParts.includes(value);
|
|
5
|
+
}
|
|
6
|
+
export function defineTopic(topic) {
|
|
7
|
+
return finalizeContentItem('topic', topic ?? {});
|
|
8
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { AnySchema, FinalizedProse, RawElement } from '@jsprose/core';
|
|
2
|
+
import type { ContributorContribution } from './content/contributions.js';
|
|
3
|
+
export interface EruditContributors {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
becomeContributorLink?: string;
|
|
6
|
+
howToImproveLink?: string;
|
|
7
|
+
reportIssueLink?: string;
|
|
8
|
+
editLinkPrefix?: string;
|
|
9
|
+
}
|
|
10
|
+
export type ContributorDefinition = Partial<{
|
|
11
|
+
displayName: string;
|
|
12
|
+
short: string;
|
|
13
|
+
editor: boolean;
|
|
14
|
+
links: Record<string, string>;
|
|
15
|
+
description: RawElement<AnySchema>;
|
|
16
|
+
}>;
|
|
17
|
+
export declare function defineContributor(contributor: ContributorDefinition): Partial<{
|
|
18
|
+
displayName: string;
|
|
19
|
+
short: string;
|
|
20
|
+
editor: boolean;
|
|
21
|
+
links: Record<string, string>;
|
|
22
|
+
description: RawElement<AnySchema>;
|
|
23
|
+
}>;
|
|
24
|
+
declare const globalContributorBrand: unique symbol;
|
|
25
|
+
export interface GlobalContributorTypeguard {
|
|
26
|
+
[globalContributorBrand]: true;
|
|
27
|
+
}
|
|
28
|
+
export declare function contributorIdToPropertyName(contributorId: string): string;
|
|
29
|
+
export declare function globalContributorsObject(contributorIds: string[]): Record<string, string>;
|
|
30
|
+
export declare function globalContributorsTypes(contributors: Record<string, string>): string;
|
|
31
|
+
export interface ListContributor {
|
|
32
|
+
id: string;
|
|
33
|
+
displayName?: string;
|
|
34
|
+
short?: string;
|
|
35
|
+
avatarUrl?: string;
|
|
36
|
+
contributions?: number;
|
|
37
|
+
editor?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface PageContributor {
|
|
40
|
+
id: string;
|
|
41
|
+
displayName?: string;
|
|
42
|
+
short?: string;
|
|
43
|
+
links?: Record<string, string>;
|
|
44
|
+
avatarUrl?: string;
|
|
45
|
+
description?: FinalizedProse;
|
|
46
|
+
editor?: boolean;
|
|
47
|
+
contributions?: ContributorContribution[];
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function defineContributor(contributor) {
|
|
2
|
+
return contributor;
|
|
3
|
+
}
|
|
4
|
+
export function contributorIdToPropertyName(contributorId) {
|
|
5
|
+
return contributorId
|
|
6
|
+
.split('-')
|
|
7
|
+
.map((p, i) => (i === 0 ? p : p.charAt(0).toUpperCase() + p.slice(1)))
|
|
8
|
+
.join('');
|
|
9
|
+
}
|
|
10
|
+
export function globalContributorsObject(contributorIds) {
|
|
11
|
+
const contributors = {};
|
|
12
|
+
for (const contributorId of contributorIds) {
|
|
13
|
+
const exportName = contributorIdToPropertyName(contributorId);
|
|
14
|
+
if (contributors[exportName]) {
|
|
15
|
+
throw new Error(`Duplicate contributor export name detected: "${exportName}" (from contributor ID: "${contributorId}")!`);
|
|
16
|
+
}
|
|
17
|
+
contributors[exportName] = contributorId;
|
|
18
|
+
}
|
|
19
|
+
return contributors;
|
|
20
|
+
}
|
|
21
|
+
export function globalContributorsTypes(contributors) {
|
|
22
|
+
return `import type { GlobalContributorTypeguard } from '@erudit-js/core/contributor';
|
|
23
|
+
|
|
24
|
+
export {};
|
|
25
|
+
|
|
26
|
+
declare global {
|
|
27
|
+
const $CONTRIBUTOR: {
|
|
28
|
+
${Object.keys(contributors)
|
|
29
|
+
.map((contributorId) => ` ${contributorId}: GlobalContributorTypeguard;`)
|
|
30
|
+
.join('\n')}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type AdsProvider = 'replacer' | 'yandex' | 'custom';
|
|
2
|
+
interface AdsBase {
|
|
3
|
+
provider: AdsProvider;
|
|
4
|
+
}
|
|
5
|
+
export interface CustomAdsItem {
|
|
6
|
+
src: string;
|
|
7
|
+
link: string;
|
|
8
|
+
}
|
|
9
|
+
export interface EruditAdsReplacer extends AdsBase {
|
|
10
|
+
provider: 'replacer';
|
|
11
|
+
}
|
|
12
|
+
export interface EruditAdsYandex extends AdsBase {
|
|
13
|
+
provider: 'yandex';
|
|
14
|
+
blockId: string;
|
|
15
|
+
}
|
|
16
|
+
export interface EruditAdsCustom extends AdsBase {
|
|
17
|
+
provider: 'custom';
|
|
18
|
+
banners: CustomAdsItem[];
|
|
19
|
+
}
|
|
20
|
+
export type EruditAds = EruditAdsReplacer | EruditAdsYandex | EruditAdsCustom;
|
|
21
|
+
export type EruditAdsAsideBanner = EruditAdsReplacer | EruditAdsYandex | {
|
|
22
|
+
provider: 'custom';
|
|
23
|
+
banners: {
|
|
24
|
+
full?: CustomAdsItem[];
|
|
25
|
+
mobile?: CustomAdsItem[];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type EruditAdsBottomBanner = EruditAdsReplacer | EruditAdsYandex | EruditAdsCustom;
|
|
29
|
+
export interface EruditAdsBanners {
|
|
30
|
+
aside?: EruditAdsAsideBanner;
|
|
31
|
+
bottom?: EruditAdsBottomBanner;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type YandexAnalytics = {
|
|
2
|
+
metricsId?: string;
|
|
3
|
+
verification?: string;
|
|
4
|
+
};
|
|
5
|
+
export type GoogleAnalytics = {
|
|
6
|
+
gtag?: string;
|
|
7
|
+
verification?: string;
|
|
8
|
+
};
|
|
9
|
+
export interface EruditAnalytics {
|
|
10
|
+
google?: GoogleAnalytics;
|
|
11
|
+
yandex?: YandexAnalytics;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Nuxt } from '@nuxt/schema';
|
|
2
|
+
import type { EruditIndexPage } from './indexPage.js';
|
|
3
|
+
import type { EruditSponsors } from '../sponsor.js';
|
|
4
|
+
import type { EruditAdsBanners } from './ads.js';
|
|
5
|
+
import type { EruditAnalytics } from './analytics.js';
|
|
6
|
+
import type { EruditDebug } from './debug.js';
|
|
7
|
+
import type { EruditCustomLinks } from './links.js';
|
|
8
|
+
import type { EruditRepository } from './repository.js';
|
|
9
|
+
import type { EruditSeo } from './seo.js';
|
|
10
|
+
import type { EruditSite } from './site.js';
|
|
11
|
+
import type { EruditLanguage } from './language.js';
|
|
12
|
+
import type { EruditElements } from './elements.js';
|
|
13
|
+
import type { EruditContributors } from '../contributor.js';
|
|
14
|
+
export interface EruditConfig {
|
|
15
|
+
language?: EruditLanguage;
|
|
16
|
+
debug?: EruditDebug;
|
|
17
|
+
contentTargets?: string[];
|
|
18
|
+
analytics?: EruditAnalytics;
|
|
19
|
+
ads?: EruditAdsBanners;
|
|
20
|
+
site?: EruditSite;
|
|
21
|
+
indexPage?: EruditIndexPage;
|
|
22
|
+
contributors?: EruditContributors;
|
|
23
|
+
sponsors?: EruditSponsors;
|
|
24
|
+
seo?: EruditSeo;
|
|
25
|
+
repository?: EruditRepository;
|
|
26
|
+
customLinks?: EruditCustomLinks;
|
|
27
|
+
elements?: EruditElements;
|
|
28
|
+
countElements?: (string | string[])[];
|
|
29
|
+
/**
|
|
30
|
+
* Erudit uses Nuxt under the hood.
|
|
31
|
+
* Use this to alter Nuxt configuration.
|
|
32
|
+
*/
|
|
33
|
+
nuxtAugmentations?: [(nuxt: Nuxt) => Promise<void> | void];
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type EruditElements = string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const eruditLanguageCodes: readonly ["en", "ru"];
|
|
2
|
+
export type EruditLanguageCode = (typeof eruditLanguageCodes)[number];
|
|
3
|
+
export type EruditTranslation = {
|
|
4
|
+
name: string;
|
|
5
|
+
link: string;
|
|
6
|
+
};
|
|
7
|
+
export type EruditTranslations = Record<EruditLanguageCode, EruditTranslation>;
|
|
8
|
+
export interface EruditLanguage {
|
|
9
|
+
current: EruditLanguageCode;
|
|
10
|
+
translations?: EruditTranslations;
|
|
11
|
+
contribute?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const eruditLanguageCodes = ['en', 'ru'];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type EruditRepositoryType = 'custom' | 'github';
|
|
2
|
+
export interface EruditRepositoryCustom {
|
|
3
|
+
type: 'custom';
|
|
4
|
+
link: string;
|
|
5
|
+
}
|
|
6
|
+
export interface EruditRepositoryGitHub {
|
|
7
|
+
type: 'github';
|
|
8
|
+
name: string;
|
|
9
|
+
branch: string;
|
|
10
|
+
}
|
|
11
|
+
export type EruditRepository = EruditRepositoryCustom | EruditRepositoryGitHub;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TopicPart } from '../content/topic.js';
|
|
2
|
+
import type { ContentType } from '../content/type.js';
|
|
3
|
+
export type EruditSiteFaviconConfig = Partial<{
|
|
4
|
+
default?: string;
|
|
5
|
+
} & Exclude<Record<ContentType, string>, 'topic'> & Record<TopicPart, string>> | string;
|
|
6
|
+
export type EruditSiteFaviconResolved = Partial<{
|
|
7
|
+
default: string;
|
|
8
|
+
} & Exclude<Record<ContentType, string>, 'topic'> & Record<TopicPart, string>>;
|
|
9
|
+
export type EruditSite = Partial<{
|
|
10
|
+
/**
|
|
11
|
+
* `https://en.erudit.io/base-url/article/my-article`
|
|
12
|
+
*
|
|
13
|
+
* Origin URL: `https://en.erudit.io/`
|
|
14
|
+
*/
|
|
15
|
+
originUrl: string;
|
|
16
|
+
/**
|
|
17
|
+
* `https://en.erudit.io/base-url/article/my-article`
|
|
18
|
+
*
|
|
19
|
+
* Base URL: `/base-url/`
|
|
20
|
+
*/
|
|
21
|
+
baseUrl: string;
|
|
22
|
+
title: string;
|
|
23
|
+
short: string | false;
|
|
24
|
+
/**
|
|
25
|
+
* - `string` — url to your logotype (use `projectPublic` to target path inside `public` directory)
|
|
26
|
+
* - `false` — do not show logotype
|
|
27
|
+
* - falsy (`0`, `undefined`, `null`, `""` and etc.) — use default Erudit logotype
|
|
28
|
+
*/
|
|
29
|
+
logotype: string | false;
|
|
30
|
+
favicon: EruditSiteFaviconConfig;
|
|
31
|
+
style: Partial<{
|
|
32
|
+
brandColor: string;
|
|
33
|
+
}>;
|
|
34
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/mode.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type EruditMode = 'dev' | 'build' | 'generate';
|
package/dist/mode.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { PreviewType } from './type.js';
|
|
2
|
+
import type { ContentType } from '../content/type.js';
|
|
3
|
+
import type { TopicPart } from '../content/topic.js';
|
|
4
|
+
interface BasePreviewRequest {
|
|
5
|
+
type: PreviewType;
|
|
6
|
+
}
|
|
7
|
+
export interface PreviewRequestDirectLink extends BasePreviewRequest {
|
|
8
|
+
type: 'direct-link';
|
|
9
|
+
href: string;
|
|
10
|
+
}
|
|
11
|
+
export type PreviewRequestContentPage = BasePreviewRequest & {
|
|
12
|
+
type: 'content-page';
|
|
13
|
+
fullId: string;
|
|
14
|
+
} & ({
|
|
15
|
+
contentType: 'topic';
|
|
16
|
+
topicPart: TopicPart;
|
|
17
|
+
} | {
|
|
18
|
+
contentType: Exclude<ContentType, 'topic'>;
|
|
19
|
+
});
|
|
20
|
+
export type PreviewRequestUnique = BasePreviewRequest & {
|
|
21
|
+
type: 'unique';
|
|
22
|
+
contentFullId: string;
|
|
23
|
+
uniqueName: string;
|
|
24
|
+
} & ({
|
|
25
|
+
contentType: 'topic';
|
|
26
|
+
topicPart: TopicPart;
|
|
27
|
+
} | {
|
|
28
|
+
contentType: Exclude<ContentType, 'topic'>;
|
|
29
|
+
});
|
|
30
|
+
export type PreviewRequest = PreviewRequestDirectLink | PreviewRequestContentPage | PreviewRequestUnique;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type PreviewType = 'direct-link' | 'content-page' | 'unique';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TopicPart } from '../content/topic.js';
|
|
2
|
+
export interface ContentPageDocumentId {
|
|
3
|
+
type: 'contentPage';
|
|
4
|
+
contentId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ContentTopicDocumentId {
|
|
7
|
+
type: 'contentTopic';
|
|
8
|
+
contentId: string;
|
|
9
|
+
topicPart: TopicPart;
|
|
10
|
+
}
|
|
11
|
+
export type DocumentId = ContentPageDocumentId | ContentTopicDocumentId;
|
|
12
|
+
export declare function stringifyDocumentId(documentId: DocumentId): string;
|
|
13
|
+
export declare function parseDocumentId(strDocumentId: string): DocumentId;
|
|
14
|
+
export declare function pathToDocumentId(path: string, projectPath: string): DocumentId | undefined;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { contentPathToId } from '../content/path.js';
|
|
2
|
+
export function stringifyDocumentId(documentId) {
|
|
3
|
+
switch (documentId.type) {
|
|
4
|
+
case 'contentPage':
|
|
5
|
+
return `contentPage/${documentId.contentId}`;
|
|
6
|
+
case 'contentTopic':
|
|
7
|
+
return `contentTopic/${documentId.topicPart}/${documentId.contentId}`;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export function parseDocumentId(strDocumentId) {
|
|
11
|
+
const parts = strDocumentId.split('/');
|
|
12
|
+
const type = parts.shift();
|
|
13
|
+
switch (type) {
|
|
14
|
+
case 'contentPage':
|
|
15
|
+
return {
|
|
16
|
+
type: 'contentPage',
|
|
17
|
+
contentId: parts.join('/'),
|
|
18
|
+
};
|
|
19
|
+
case 'contentTopic':
|
|
20
|
+
const topicPart = parts.shift();
|
|
21
|
+
return {
|
|
22
|
+
type: 'contentTopic',
|
|
23
|
+
topicPart,
|
|
24
|
+
contentId: parts.join('/'),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
throw new Error(`Inable to parse document ID from string: ${strDocumentId}`);
|
|
28
|
+
}
|
|
29
|
+
export function pathToDocumentId(path, projectPath) {
|
|
30
|
+
if (path.startsWith(`${projectPath}/content/`)) {
|
|
31
|
+
const fullContentId = contentPathToId(path, projectPath, 'full');
|
|
32
|
+
if (fullContentId) {
|
|
33
|
+
const lastPart = path.split('/').pop();
|
|
34
|
+
switch (lastPart) {
|
|
35
|
+
case 'page.tsx':
|
|
36
|
+
return {
|
|
37
|
+
type: 'contentPage',
|
|
38
|
+
contentId: fullContentId,
|
|
39
|
+
};
|
|
40
|
+
case 'article.tsx':
|
|
41
|
+
return {
|
|
42
|
+
type: 'contentTopic',
|
|
43
|
+
topicPart: 'article',
|
|
44
|
+
contentId: fullContentId,
|
|
45
|
+
};
|
|
46
|
+
case 'summary.tsx':
|
|
47
|
+
return {
|
|
48
|
+
type: 'contentTopic',
|
|
49
|
+
topicPart: 'summary',
|
|
50
|
+
contentId: fullContentId,
|
|
51
|
+
};
|
|
52
|
+
case 'practice.tsx':
|
|
53
|
+
return {
|
|
54
|
+
type: 'contentTopic',
|
|
55
|
+
topicPart: 'practice',
|
|
56
|
+
contentId: fullContentId,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ContentPointer } from '../content/pointer.js';
|
|
2
|
+
export declare const proseLinkTypes: readonly ["direct", "contentItem", "unique"];
|
|
3
|
+
export type ProseLinkType = (typeof proseLinkTypes)[number];
|
|
4
|
+
export declare function isProseLinkType(value: unknown): value is ProseLinkType;
|
|
5
|
+
interface BaseProseLink {
|
|
6
|
+
type: ProseLinkType;
|
|
7
|
+
}
|
|
8
|
+
export interface DirectProseLink extends BaseProseLink {
|
|
9
|
+
type: 'direct';
|
|
10
|
+
href: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ContentItemProseLink extends BaseProseLink {
|
|
13
|
+
type: 'contentItem';
|
|
14
|
+
contentPointer: ContentPointer;
|
|
15
|
+
}
|
|
16
|
+
export interface UniqueProseLink extends BaseProseLink {
|
|
17
|
+
type: 'unique';
|
|
18
|
+
contentPointer: ContentPointer;
|
|
19
|
+
uniqueName: string;
|
|
20
|
+
}
|
|
21
|
+
export type ProseLink = DirectProseLink | ContentItemProseLink | UniqueProseLink;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const proseLinkTypes = [
|
|
2
|
+
'direct',
|
|
3
|
+
'contentItem',
|
|
4
|
+
'unique',
|
|
5
|
+
// 'anonymousUnique' TODO! Passing anonymous uniques directly to the <A> tag
|
|
6
|
+
];
|
|
7
|
+
export function isProseLinkType(value) {
|
|
8
|
+
return (typeof value === 'string' &&
|
|
9
|
+
proseLinkTypes.includes(value));
|
|
10
|
+
}
|
package/dist/quote.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type QuoteType = 'cameo' | 'sponsor';
|
|
2
|
+
interface BaseQuote {
|
|
3
|
+
type: QuoteType;
|
|
4
|
+
name: string;
|
|
5
|
+
link?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CameoQuote extends BaseQuote {
|
|
8
|
+
type: 'cameo';
|
|
9
|
+
icon: string;
|
|
10
|
+
messages: string[];
|
|
11
|
+
avatarUrl: string;
|
|
12
|
+
color: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SponsorQuote extends BaseQuote {
|
|
15
|
+
type: 'sponsor';
|
|
16
|
+
icon?: string;
|
|
17
|
+
messages?: string[];
|
|
18
|
+
avatarUrl?: string;
|
|
19
|
+
color?: string;
|
|
20
|
+
}
|
|
21
|
+
export type Quote = CameoQuote | SponsorQuote;
|
|
22
|
+
export type QuoteIds = Partial<Record<QuoteType, string[]>>;
|
|
23
|
+
export declare function createQuoteId(type: QuoteType, id: string): string;
|
|
24
|
+
export declare function parseQuoteId(quoteId: string): {
|
|
25
|
+
type: QuoteType;
|
|
26
|
+
id: string;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
package/dist/quote.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
//
|
|
3
|
+
//
|
|
4
|
+
export function createQuoteId(type, id) {
|
|
5
|
+
return `${type}-${id}`;
|
|
6
|
+
}
|
|
7
|
+
export function parseQuoteId(quoteId) {
|
|
8
|
+
const parts = quoteId.split('-');
|
|
9
|
+
const type = parts.shift();
|
|
10
|
+
const id = parts.join('-');
|
|
11
|
+
switch (type) {
|
|
12
|
+
case 'cameo':
|
|
13
|
+
return { type: 'cameo', id };
|
|
14
|
+
case 'sponsor':
|
|
15
|
+
return { type: 'sponsor', id };
|
|
16
|
+
default:
|
|
17
|
+
throw new Error(`Unknown quote type of "${quoteId}"!`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface EruditSponsors {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
becomeSponsorLink: string;
|
|
4
|
+
defaultSponsorMessages: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface Sponsor {
|
|
7
|
+
sponsorId: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
group?: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
avatarExtension?: string;
|
|
12
|
+
info?: string;
|
|
13
|
+
color?: string;
|
|
14
|
+
link?: string;
|
|
15
|
+
messages?: {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
list?: string[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
type SponsorOmit = 'sponsorId' | 'avatarExtension';
|
|
21
|
+
export type SponsorConfig = Omit<Sponsor, SponsorOmit>;
|
|
22
|
+
export declare function defineSponsor(sponsor: SponsorConfig): SponsorConfig;
|
|
23
|
+
export interface PageSponsor {
|
|
24
|
+
name: string;
|
|
25
|
+
group?: string;
|
|
26
|
+
icon?: string;
|
|
27
|
+
info?: string;
|
|
28
|
+
color?: string;
|
|
29
|
+
link?: string;
|
|
30
|
+
avatarUrl?: string;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
package/dist/sponsor.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@erudit-js/core",
|
|
3
|
+
"version": "3.0.0-dev.25",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Erudit core essentials",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {},
|
|
8
|
+
"./*": {
|
|
9
|
+
"import": "./dist/*.js",
|
|
10
|
+
"types": "./dist/*.d.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "rm -rf dist && bun tsc --project ./tsconfig.src.json",
|
|
19
|
+
"test": "bun vitest run",
|
|
20
|
+
"prepack": "bun run build"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@jsprose/core": "link:@jsprose/core",
|
|
24
|
+
"gradient-string": "^3.0.0"
|
|
25
|
+
}
|
|
26
|
+
}
|