Add shared library + changed imports
This commit is contained in:
parent
0d33354b7f
commit
c707733bbc
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "src/shared"]
|
||||||
|
path = src/shared
|
||||||
|
url = https://github.com/Accords-Library/shared-library.git
|
|
@ -4,7 +4,7 @@
|
||||||
"typescript.preferences.importModuleSpecifier": "non-relative",
|
"typescript.preferences.importModuleSpecifier": "non-relative",
|
||||||
"explorer.fileNesting.enabled": true,
|
"explorer.fileNesting.enabled": true,
|
||||||
"explorer.fileNesting.patterns": {
|
"explorer.fileNesting.patterns": {
|
||||||
"package.json": "package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb, .ncurc.*, .nvmrc, *.config.cjs, *.config.js, *.config.ts, *config.json, .*ignore",
|
"package.json": ".git*, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb, .ncurc.*, .nvmrc, *.config.cjs, *.config.js, *.config.ts, *config.json, .*ignore",
|
||||||
".env": ".env.*",
|
".env": ".env.*",
|
||||||
"README.md": "*.md"
|
"README.md": "*.md"
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,10 +8,11 @@
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"astro": "astro",
|
"astro": "astro",
|
||||||
"upgrade": "ncu",
|
"upgrade": "ncu",
|
||||||
|
"fetch-submodules": "git submodule update --recursive --remote",
|
||||||
"script:download-currencies": "node --env-file=.env scripts/download-currencies.mjs",
|
"script:download-currencies": "node --env-file=.env scripts/download-currencies.mjs",
|
||||||
"script:download-wording-keys": "npm run scripts/download-wording-keys.ts",
|
"script:download-wording-keys": "npm run scripts/download-wording-keys.ts",
|
||||||
"prettier": "prettier --write --list-different --plugin=prettier-plugin-astro .",
|
"prettier": "prettier --write --list-different --plugin=prettier-plugin-astro .",
|
||||||
"precommit": "npm run script:download-currencies && npm run script:download-wording-keys && npm run prettier && npm run astro check"
|
"precommit": "npm run fetch-submodules && npm run script:download-currencies && npm run script:download-wording-keys && npm run prettier && npm run astro check"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"npm": ">=10.0.0",
|
"npm": ">=10.0.0",
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
import { writeFileSync } from "fs";
|
|
||||||
|
|
||||||
const PAYLOAD_FOLDER = `${process.cwd()}/src/shared/payload`;
|
|
||||||
|
|
||||||
const sdk = await fetch(`${import.meta.env.PAYLOAD_API_URL}/sdk`);
|
|
||||||
|
|
||||||
if (!sdk.ok) {
|
|
||||||
console.error("Failed to get the sdk", sdk.status, sdk.statusText);
|
|
||||||
} else {
|
|
||||||
const sdkFile = await sdk.text();
|
|
||||||
writeFileSync(`${PAYLOAD_FOLDER}/payload-sdk.ts`, sdkFile, {
|
|
||||||
encoding: "utf-8",
|
|
||||||
});
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { writeFileSync } from "fs";
|
import { writeFileSync } from "fs";
|
||||||
import { PayloadSDK } from "src/shared/payload/payload-sdk";
|
import { PayloadSDK } from "src/shared/payload/sdk";
|
||||||
|
|
||||||
const TRANSLATION_FOLDER = `${process.cwd()}/src/i18n`;
|
const TRANSLATION_FOLDER = `${process.cwd()}/src/i18n`;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import type {
|
import type {
|
||||||
|
EndpointLanguage,
|
||||||
EndpointWebsiteConfig,
|
EndpointWebsiteConfig,
|
||||||
EndpointWording,
|
EndpointWording,
|
||||||
Language,
|
} from "src/shared/payload/endpoint-types";
|
||||||
PayloadSDK,
|
import type { PayloadSDK } from "src/shared/payload/sdk";
|
||||||
} from "src/shared/payload/payload-sdk";
|
|
||||||
import { getLogger } from "src/utils/logger";
|
import { getLogger } from "src/utils/logger";
|
||||||
|
|
||||||
export class ContextCache {
|
export class ContextCache {
|
||||||
|
@ -12,7 +12,7 @@ export class ContextCache {
|
||||||
|
|
||||||
constructor(private readonly payload: PayloadSDK) {}
|
constructor(private readonly payload: PayloadSDK) {}
|
||||||
|
|
||||||
languages: Language[] = [];
|
languages: EndpointLanguage[] = [];
|
||||||
locales: string[] = [];
|
locales: string[] = [];
|
||||||
currencies: string[] = [];
|
currencies: string[] = [];
|
||||||
wordings: EndpointWording[] = [];
|
wordings: EndpointWording[] = [];
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import type { PayloadSDK } from "src/shared/payload/payload-sdk";
|
|
||||||
import { getLogger } from "src/utils/logger";
|
import { getLogger } from "src/utils/logger";
|
||||||
import { writeFile, mkdir, readFile } from "fs/promises";
|
import { writeFile, mkdir, readFile } from "fs/promises";
|
||||||
import { existsSync } from "fs";
|
import { existsSync } from "fs";
|
||||||
|
import type { PayloadSDK } from "src/shared/payload/sdk";
|
||||||
|
|
||||||
const ON_DISK_ROOT = `.cache/dataCache`;
|
const ON_DISK_ROOT = `.cache/dataCache`;
|
||||||
const ON_DISK_RESPONSE_CACHE_FILE = `${ON_DISK_ROOT}/responseCache.json`;
|
const ON_DISK_RESPONSE_CACHE_FILE = `${ON_DISK_ROOT}/responseCache.json`;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import type { PayloadSDK } from "src/shared/payload/payload-sdk";
|
|
||||||
import { getLogger } from "src/utils/logger";
|
import { getLogger } from "src/utils/logger";
|
||||||
import { writeFile, mkdir, readFile } from "fs/promises";
|
import { writeFile, mkdir, readFile } from "fs/promises";
|
||||||
import { existsSync } from "fs";
|
import { existsSync } from "fs";
|
||||||
|
@ -7,6 +6,7 @@ import {
|
||||||
serializeResponse,
|
serializeResponse,
|
||||||
type SerializableResponse,
|
type SerializableResponse,
|
||||||
} from "src/utils/responses";
|
} from "src/utils/responses";
|
||||||
|
import type { PayloadSDK } from "src/shared/payload/sdk";
|
||||||
|
|
||||||
const ON_DISK_ROOT = `.cache/pageCache`;
|
const ON_DISK_ROOT = `.cache/pageCache`;
|
||||||
const ON_DISK_RESPONSE_CACHE_FILE = `${ON_DISK_ROOT}/responseCache.json`;
|
const ON_DISK_RESPONSE_CACHE_FILE = `${ON_DISK_ROOT}/responseCache.json`;
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
import Html from "./components/Html.astro";
|
import Html from "./components/Html.astro";
|
||||||
import Topbar from "./components/Topbar/Topbar.astro";
|
import Topbar from "./components/Topbar/Topbar.astro";
|
||||||
import Footer from "./components/Footer.astro";
|
import Footer from "./components/Footer.astro";
|
||||||
import { getSDKEndpoint, type EndpointSource } from "src/shared/payload/payload-sdk";
|
|
||||||
import AppLayoutBackgroundImg from "./components/AppLayoutBackgroundImg.astro";
|
import AppLayoutBackgroundImg from "./components/AppLayoutBackgroundImg.astro";
|
||||||
import type { ComponentProps } from "astro/types";
|
import type { ComponentProps } from "astro/types";
|
||||||
|
import type { EndpointSource } from "src/shared/payload/endpoint-types";
|
||||||
|
import { getSDKEndpoint } from "src/shared/payload/sdk";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
openGraph?: ComponentProps<typeof Html>["openGraph"];
|
openGraph?: ComponentProps<typeof Html>["openGraph"];
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
---
|
---
|
||||||
|
import { getRandomId } from "src/utils/random";
|
||||||
|
import { sizesToSrcset } from "src/utils/img";
|
||||||
import type {
|
import type {
|
||||||
EndpointImage,
|
EndpointImage,
|
||||||
EndpointPayloadImage,
|
EndpointPayloadImage,
|
||||||
EndpointScanImage,
|
EndpointScanImage,
|
||||||
} from "src/shared/payload/payload-sdk";
|
} from "src/shared/payload/endpoint-types";
|
||||||
import { getRandomId } from "src/utils/random";
|
|
||||||
import { sizesToSrcset } from "src/utils/img";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
img: EndpointImage | EndpointPayloadImage | EndpointScanImage;
|
img: EndpointImage | EndpointPayloadImage | EndpointScanImage;
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
---
|
---
|
||||||
import { UAParser } from "ua-parser-js";
|
import { UAParser } from "ua-parser-js";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
|
import { contextCache } from "src/utils/payload";
|
||||||
|
import { PostProcessingTags } from "src/middleware/postProcessing";
|
||||||
import type {
|
import type {
|
||||||
EndpointAudio,
|
EndpointAudio,
|
||||||
EndpointImage,
|
EndpointImage,
|
||||||
EndpointPayloadImage,
|
EndpointPayloadImage,
|
||||||
EndpointVideo,
|
EndpointVideo,
|
||||||
} from "src/shared/payload/payload-sdk";
|
} from "src/shared/payload/endpoint-types";
|
||||||
import { contextCache } from "src/utils/payload";
|
|
||||||
import { PostProcessingTags } from "src/middleware/postProcessing";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
openGraph?:
|
openGraph?:
|
||||||
|
|
|
@ -6,7 +6,7 @@ import LanguageSelector from "./components/LanguageSelector.astro";
|
||||||
import CurrencySelector from "./components/CurrencySelector.astro";
|
import CurrencySelector from "./components/CurrencySelector.astro";
|
||||||
import ParentPagesButton from "./components/ParentPagesButton.astro";
|
import ParentPagesButton from "./components/ParentPagesButton.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointSource } from "src/shared/payload/payload-sdk";
|
import type { EndpointSource } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
parentPages?: EndpointSource[] | undefined;
|
parentPages?: EndpointSource[] | undefined;
|
||||||
|
|
|
@ -3,8 +3,8 @@ import Tooltip from "components/Tooltip.astro";
|
||||||
import { Icon } from "astro-icon/components";
|
import { Icon } from "astro-icon/components";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import ReturnToButton from "./ReturnToButton.astro";
|
import ReturnToButton from "./ReturnToButton.astro";
|
||||||
import type { EndpointSource } from "src/shared/payload/payload-sdk";
|
|
||||||
import SourceRow from "components/SourceRow.astro";
|
import SourceRow from "components/SourceRow.astro";
|
||||||
|
import type { EndpointSource } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
parentPages: EndpointSource[];
|
parentPages: EndpointSource[];
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import { Icon } from "astro-icon/components";
|
import { Icon } from "astro-icon/components";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointSource } from "src/shared/payload/payload-sdk";
|
import type { EndpointSource } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
parentPage: EndpointSource;
|
parentPage: EndpointSource;
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
---
|
---
|
||||||
import { AttributeTypes, type EndpointAttribute } from "src/shared/payload/payload-sdk";
|
|
||||||
import Metadata from "./Metadata.astro";
|
import Metadata from "./Metadata.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import ErrorMessage from "./ErrorMessage.astro";
|
import ErrorMessage from "./ErrorMessage.astro";
|
||||||
import type { Attribute } from "src/utils/attributes";
|
import type { Attribute } from "src/utils/attributes";
|
||||||
|
import type { EndpointAttribute } from "src/shared/payload/endpoint-types";
|
||||||
|
import { AttributeTypes } from "src/shared/payload/constants";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
attributes: (EndpointAttribute | Attribute)[];
|
attributes: (EndpointAttribute | Attribute)[];
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
import type { EndpointAudioPreview } from "src/shared/payload/payload-sdk";
|
import type { EndpointAudioPreview } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
audio: EndpointAudioPreview;
|
audio: EndpointAudioPreview;
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
---
|
---
|
||||||
import {
|
|
||||||
isBlockLineBlock,
|
|
||||||
type GenericBlock,
|
|
||||||
isBlockCueBlock,
|
|
||||||
} from "src/shared/payload/payload-sdk";
|
|
||||||
|
|
||||||
import LineBlock from "./components/LineBlock.astro";
|
import LineBlock from "./components/LineBlock.astro";
|
||||||
import CueBlock from "./components/CueBlock.astro";
|
import CueBlock from "./components/CueBlock.astro";
|
||||||
import ErrorMessage from "components/ErrorMessage.astro";
|
import ErrorMessage from "components/ErrorMessage.astro";
|
||||||
|
import { type GenericBlock, isBlockLineBlock, isBlockCueBlock } from "src/shared/payload/blocks";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
block: GenericBlock;
|
block: GenericBlock;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
import RichText from "components/RichText/RichText.astro";
|
import RichText from "components/RichText/RichText.astro";
|
||||||
import type { CueBlock } from "src/shared/payload/payload-sdk";
|
import type { CueBlock } from "src/shared/payload/blocks";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
block: CueBlock;
|
block: CueBlock;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
import RichText from "components/RichText/RichText.astro";
|
import RichText from "components/RichText/RichText.astro";
|
||||||
import type { LineBlock } from "src/shared/payload/payload-sdk";
|
import type { LineBlock } from "src/shared/payload/blocks";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
block: LineBlock;
|
block: LineBlock;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
import type { EndpointCredit } from "src/shared/payload/payload-sdk";
|
import type { EndpointCredit } from "src/shared/payload/endpoint-types";
|
||||||
import Metadata from "./Metadata.astro";
|
import Metadata from "./Metadata.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
---
|
---
|
||||||
import { AttributeTypes, type EndpointAttribute } from "src/shared/payload/payload-sdk";
|
|
||||||
import InlineMetadata from "./InlineMetadata.astro";
|
import InlineMetadata from "./InlineMetadata.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import ErrorMessage from "./ErrorMessage.astro";
|
import ErrorMessage from "./ErrorMessage.astro";
|
||||||
import type { Attribute } from "src/utils/attributes";
|
import type { Attribute } from "src/utils/attributes";
|
||||||
|
import { AttributeTypes } from "src/shared/payload/constants";
|
||||||
|
import type { EndpointAttribute } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
attributes: (EndpointAttribute | Attribute)[];
|
attributes: (EndpointAttribute | Attribute)[];
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import type { EndpointCredit } from "src/shared/payload/payload-sdk";
|
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import InlineMetadata from "./InlineMetadata.astro";
|
import InlineMetadata from "./InlineMetadata.astro";
|
||||||
|
import type { EndpointCredit } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
credits: EndpointCredit[];
|
credits: EndpointCredit[];
|
||||||
|
|
|
@ -1,11 +1,4 @@
|
||||||
---
|
---
|
||||||
import {
|
|
||||||
type EndpointCredit,
|
|
||||||
type EndpointImage,
|
|
||||||
type EndpointPayloadImage,
|
|
||||||
type EndpointScanImage,
|
|
||||||
type RichTextContent,
|
|
||||||
} from "src/shared/payload/payload-sdk";
|
|
||||||
import Credits from "./Credits.astro";
|
import Credits from "./Credits.astro";
|
||||||
import DownloadButton from "./DownloadButton.astro";
|
import DownloadButton from "./DownloadButton.astro";
|
||||||
import AppLayoutTitle from "./AppLayout/components/AppLayoutTitle.astro";
|
import AppLayoutTitle from "./AppLayout/components/AppLayoutTitle.astro";
|
||||||
|
@ -14,6 +7,13 @@ import Attributes from "./Attributes.astro";
|
||||||
import { sizesToSrcset } from "src/utils/img";
|
import { sizesToSrcset } from "src/utils/img";
|
||||||
import { Icon } from "astro-icon/components";
|
import { Icon } from "astro-icon/components";
|
||||||
import RichText from "./RichText/RichText.astro";
|
import RichText from "./RichText/RichText.astro";
|
||||||
|
import type {
|
||||||
|
EndpointImage,
|
||||||
|
EndpointScanImage,
|
||||||
|
EndpointPayloadImage,
|
||||||
|
EndpointCredit,
|
||||||
|
} from "src/shared/payload/endpoint-types";
|
||||||
|
import type { RichTextContent } from "src/shared/payload/rich-text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
previousImageHref?: string | undefined;
|
previousImageHref?: string | undefined;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointAudioPreview } from "src/shared/payload/payload-sdk";
|
import type { EndpointAudioPreview } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
audio: EndpointAudioPreview;
|
audio: EndpointAudioPreview;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointChronologyEvent } from "src/shared/payload/payload-sdk";
|
import type { EndpointChronologyEvent } from "src/shared/payload/endpoint-types";
|
||||||
import { formatRichTextToString, formatTimelineDateToId } from "src/utils/format";
|
import { formatRichTextToString, formatTimelineDateToId } from "src/utils/format";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import { formatPriceForPostProcessing } from "src/middleware/postProcessing";
|
import { formatPriceForPostProcessing } from "src/middleware/postProcessing";
|
||||||
import type { EndpointCollectiblePreview } from "src/shared/payload/payload-sdk";
|
import type { EndpointCollectiblePreview } from "src/shared/payload/endpoint-types";
|
||||||
import type { Attribute } from "src/utils/attributes";
|
import type { Attribute } from "src/utils/attributes";
|
||||||
import { formatLocale } from "src/utils/format";
|
import { formatLocale } from "src/utils/format";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointFilePreview } from "src/shared/payload/payload-sdk";
|
import type { EndpointFilePreview } from "src/shared/payload/endpoint-types";
|
||||||
import { getFileIcon } from "src/utils/attributes";
|
import { getFileIcon } from "src/utils/attributes";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointFolder } from "src/shared/payload/payload-sdk";
|
import type { EndpointFolder } from "src/shared/payload/endpoint-types";
|
||||||
import type { Attribute } from "src/utils/attributes";
|
import type { Attribute } from "src/utils/attributes";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -1,11 +1,4 @@
|
||||||
---
|
---
|
||||||
import {
|
|
||||||
AttributeTypes,
|
|
||||||
type EndpointAttribute,
|
|
||||||
type EndpointImagePreview,
|
|
||||||
type EndpointPayloadImage,
|
|
||||||
type EndpointScanImage,
|
|
||||||
} from "src/shared/payload/payload-sdk";
|
|
||||||
import Card from "components/Card.astro";
|
import Card from "components/Card.astro";
|
||||||
import { Icon } from "astro-icon/components";
|
import { Icon } from "astro-icon/components";
|
||||||
import type { ComponentProps } from "astro/types";
|
import type { ComponentProps } from "astro/types";
|
||||||
|
@ -13,6 +6,13 @@ import { getI18n } from "src/i18n/i18n";
|
||||||
import InlineAttributes from "components/InlineAttributes.astro";
|
import InlineAttributes from "components/InlineAttributes.astro";
|
||||||
import { sizesToSrcset, sizesForGridLayout } from "src/utils/img";
|
import { sizesToSrcset, sizesForGridLayout } from "src/utils/img";
|
||||||
import type { Attribute } from "src/utils/attributes";
|
import type { Attribute } from "src/utils/attributes";
|
||||||
|
import type {
|
||||||
|
EndpointAttribute,
|
||||||
|
EndpointImagePreview,
|
||||||
|
EndpointPayloadImage,
|
||||||
|
EndpointScanImage,
|
||||||
|
} from "src/shared/payload/endpoint-types";
|
||||||
|
import { AttributeTypes } from "src/shared/payload/constants";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
thumbnail?: EndpointImagePreview | EndpointPayloadImage | EndpointScanImage | undefined;
|
thumbnail?: EndpointImagePreview | EndpointPayloadImage | EndpointScanImage | undefined;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointImagePreview } from "src/shared/payload/payload-sdk";
|
import type { EndpointImagePreview } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
image: EndpointImagePreview;
|
image: EndpointImagePreview;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointPagePreview } from "src/shared/payload/payload-sdk";
|
import type { EndpointPagePreview } from "src/shared/payload/endpoint-types";
|
||||||
import type { Attribute } from "src/utils/attributes";
|
import type { Attribute } from "src/utils/attributes";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointRecorder } from "src/shared/payload/payload-sdk";
|
import type { EndpointRecorder } from "src/shared/payload/endpoint-types";
|
||||||
import type { Attribute } from "src/utils/attributes";
|
import type { Attribute } from "src/utils/attributes";
|
||||||
import { formatLocale } from "src/utils/format";
|
import { formatLocale } from "src/utils/format";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointVideoPreview } from "src/shared/payload/payload-sdk";
|
import type { EndpointVideoPreview } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
video: EndpointVideoPreview;
|
video: EndpointVideoPreview;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
---
|
---
|
||||||
import type { RichTextContent } from "src/shared/payload/payload-sdk";
|
|
||||||
import RTNode from "./components/RTNode.astro";
|
import RTNode from "./components/RTNode.astro";
|
||||||
import RTProse from "./components/RTProse.astro";
|
import RTProse from "./components/RTProse.astro";
|
||||||
import { type RichTextContext } from "src/utils/richText";
|
import { type RichTextContext } from "src/utils/richText";
|
||||||
import ConditionalWrapper from "components/ConditionalWrapper.astro";
|
import ConditionalWrapper from "components/ConditionalWrapper.astro";
|
||||||
|
import type { RichTextContent } from "src/shared/payload/rich-text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
content: RichTextContent;
|
content: RichTextContent;
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
import type { RichTextContext } from "src/utils/richText";
|
import type { RichTextContext } from "src/utils/richText";
|
||||||
import RTSection from "./components/RTSection.astro";
|
import RTSection from "./components/RTSection.astro";
|
||||||
import RTTranscript from "./components/RTTranscript.astro";
|
import RTTranscript from "./components/RTTranscript.astro";
|
||||||
import {
|
|
||||||
isBlockNodeBreakBlock,
|
|
||||||
isBlockNodeSectionBlock,
|
|
||||||
isBlockNodeTranscriptBlock,
|
|
||||||
type RichTextBlockNode,
|
|
||||||
} from "src/shared/payload/payload-sdk";
|
|
||||||
import ErrorMessage from "components/ErrorMessage.astro";
|
import ErrorMessage from "components/ErrorMessage.astro";
|
||||||
import RTBreak from "./components/RTBreak.astro";
|
import RTBreak from "./components/RTBreak.astro";
|
||||||
|
import {
|
||||||
|
type RichTextBlockNode,
|
||||||
|
isBlockNodeSectionBlock,
|
||||||
|
isBlockNodeTranscriptBlock,
|
||||||
|
isBlockNodeBreakBlock,
|
||||||
|
} from "src/shared/payload/rich-text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: RichTextBlockNode;
|
node: RichTextBlockNode;
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
---
|
---
|
||||||
import type { RichTextContext } from "src/utils/richText";
|
import type { RichTextContext } from "src/utils/richText";
|
||||||
import { BreakBlockType, type RichTextBreakBlock } from "src/shared/payload/payload-sdk";
|
|
||||||
import ErrorMessage from "components/ErrorMessage.astro";
|
import ErrorMessage from "components/ErrorMessage.astro";
|
||||||
|
import { BreakBlockType } from "src/shared/payload/constants";
|
||||||
|
import type { RichTextBreakBlock } from "src/shared/payload/rich-text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: RichTextBreakBlock;
|
node: RichTextBreakBlock;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import HeaderTitle from "components/HeaderTitle.astro";
|
import HeaderTitle from "components/HeaderTitle.astro";
|
||||||
import RichText from "components/RichText/RichText.astro";
|
import RichText from "components/RichText/RichText.astro";
|
||||||
import type { RichTextSectionBlock } from "src/shared/payload/payload-sdk";
|
import type { RichTextSectionBlock } from "src/shared/payload/rich-text";
|
||||||
import type { RichTextContext } from "src/utils/richText";
|
import type { RichTextContext } from "src/utils/richText";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import type { RichTextContext } from "src/utils/richText";
|
import type { RichTextContext } from "src/utils/richText";
|
||||||
import type { RichTextTranscriptBlock } from "src/shared/payload/payload-sdk";
|
|
||||||
import Block from "components/Blocks/Block.astro";
|
import Block from "components/Blocks/Block.astro";
|
||||||
|
import type { RichTextTranscriptBlock } from "src/shared/payload/rich-text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: RichTextTranscriptBlock;
|
node: RichTextTranscriptBlock;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
|
import type { RichTextLinebreakNode } from "src/shared/payload/rich-text";
|
||||||
import type { RichTextContext } from "src/utils/richText";
|
import type { RichTextContext } from "src/utils/richText";
|
||||||
import type { RichTextLinebreakNode } from "src/shared/payload/payload-sdk";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: RichTextLinebreakNode;
|
node: RichTextLinebreakNode;
|
||||||
|
|
|
@ -3,12 +3,12 @@ import type { RichTextContext } from "src/utils/richText";
|
||||||
import RTNode from "../RTNode.astro";
|
import RTNode from "../RTNode.astro";
|
||||||
import RTCustomLink from "./components/RTCustomLink.astro";
|
import RTCustomLink from "./components/RTCustomLink.astro";
|
||||||
import RTInternalLink from "./components/RTInternalLink.astro";
|
import RTInternalLink from "./components/RTInternalLink.astro";
|
||||||
|
import ErrorMessage from "components/ErrorMessage.astro";
|
||||||
import {
|
import {
|
||||||
isLinkNodeCustomLinkNode,
|
isLinkNodeCustomLinkNode,
|
||||||
isLinkNodeInternalLinkNode,
|
isLinkNodeInternalLinkNode,
|
||||||
type RichTextLinkNode,
|
type RichTextLinkNode,
|
||||||
} from "src/shared/payload/payload-sdk";
|
} from "src/shared/payload/rich-text";
|
||||||
import ErrorMessage from "components/ErrorMessage.astro";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: RichTextLinkNode;
|
node: RichTextLinkNode;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import ErrorMessage from "components/ErrorMessage.astro";
|
import ErrorMessage from "components/ErrorMessage.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import { Collections } from "src/shared/payload/payload-sdk";
|
import { Collections } from "src/shared/payload/constants";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
doc: {
|
doc: {
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
import type { RichTextContext } from "src/utils/richText";
|
import type { RichTextContext } from "src/utils/richText";
|
||||||
import RTBasicListItem from "./components/RTBasicListItem.astro";
|
import RTBasicListItem from "./components/RTBasicListItem.astro";
|
||||||
import RTCheckListItem from "./components/RTCheckListItem.astro";
|
import RTCheckListItem from "./components/RTCheckListItem.astro";
|
||||||
|
import ErrorMessage from "components/ErrorMessage.astro";
|
||||||
import {
|
import {
|
||||||
|
type RichTextListNode,
|
||||||
|
isListNodeNumberListNode,
|
||||||
isListNodeBulletListNode,
|
isListNodeBulletListNode,
|
||||||
isListNodeCheckListNode,
|
isListNodeCheckListNode,
|
||||||
isListNodeNumberListNode,
|
} from "src/shared/payload/rich-text";
|
||||||
type RichTextListNode,
|
|
||||||
} from "src/shared/payload/payload-sdk";
|
|
||||||
import ErrorMessage from "components/ErrorMessage.astro";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: RichTextListNode;
|
node: RichTextListNode;
|
||||||
|
|
|
@ -5,21 +5,21 @@ import RTText from "./RTText/RTText.astro";
|
||||||
import RTLink from "./RTLink/RTLink.astro";
|
import RTLink from "./RTLink/RTLink.astro";
|
||||||
import RTBlock from "./RTBlock/RTBlock.astro";
|
import RTBlock from "./RTBlock/RTBlock.astro";
|
||||||
import type { RichTextContext } from "src/utils/richText";
|
import type { RichTextContext } from "src/utils/richText";
|
||||||
import {
|
|
||||||
isNodeBlockNode,
|
|
||||||
isNodeLinebreakNode,
|
|
||||||
isNodeLinkNode,
|
|
||||||
isNodeListNode,
|
|
||||||
isNodeParagraphNode,
|
|
||||||
isNodeTabNode,
|
|
||||||
isNodeTextNode,
|
|
||||||
isNodeUploadNode,
|
|
||||||
type RichTextNode,
|
|
||||||
} from "src/shared/payload/payload-sdk";
|
|
||||||
import RTTab from "./RTTab.astro";
|
import RTTab from "./RTTab.astro";
|
||||||
import ErrorMessage from "components/ErrorMessage.astro";
|
import ErrorMessage from "components/ErrorMessage.astro";
|
||||||
import RTLinebreak from "./RTLinebreak.astro";
|
import RTLinebreak from "./RTLinebreak.astro";
|
||||||
import RTUpload from "./RTUpload/RTUpload.astro";
|
import RTUpload from "./RTUpload/RTUpload.astro";
|
||||||
|
import {
|
||||||
|
type RichTextNode,
|
||||||
|
isNodeParagraphNode,
|
||||||
|
isNodeListNode,
|
||||||
|
isNodeTextNode,
|
||||||
|
isNodeLinebreakNode,
|
||||||
|
isNodeLinkNode,
|
||||||
|
isNodeBlockNode,
|
||||||
|
isNodeTabNode,
|
||||||
|
isNodeUploadNode,
|
||||||
|
} from "src/shared/payload/rich-text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: RichTextNode;
|
node: RichTextNode;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import type { RichTextContext } from "src/utils/richText";
|
import type { RichTextContext } from "src/utils/richText";
|
||||||
import RTNode from "./RTNode.astro";
|
import RTNode from "./RTNode.astro";
|
||||||
import type { RichTextParagraphNode } from "src/shared/payload/payload-sdk";
|
import type { RichTextParagraphNode } from "src/shared/payload/rich-text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: RichTextParagraphNode;
|
node: RichTextParagraphNode;
|
||||||
|
|
|
@ -8,7 +8,7 @@ import RTSubscript from "./components/RTSubscript.astro";
|
||||||
import RTSuperscript from "./components/RTSuperscript.astro";
|
import RTSuperscript from "./components/RTSuperscript.astro";
|
||||||
import RTInlineCode from "./components/RTInlineCode.astro";
|
import RTInlineCode from "./components/RTInlineCode.astro";
|
||||||
import type { RichTextContext } from "src/utils/richText";
|
import type { RichTextContext } from "src/utils/richText";
|
||||||
import type { RichTextTextNode } from "src/shared/payload/payload-sdk";
|
import type { RichTextTextNode } from "src/shared/payload/rich-text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: RichTextTextNode;
|
node: RichTextTextNode;
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
---
|
---
|
||||||
import {
|
|
||||||
isUploadNodeAudioNode,
|
|
||||||
isUploadNodeImageNode,
|
|
||||||
isUploadNodeVideoNode,
|
|
||||||
type RichTextUploadNode,
|
|
||||||
} from "src/shared/payload/payload-sdk";
|
|
||||||
import type { RichTextContext } from "src/utils/richText";
|
import type { RichTextContext } from "src/utils/richText";
|
||||||
import RTImage from "./components/RTImage.astro";
|
import RTImage from "./components/RTImage.astro";
|
||||||
import ErrorMessage from "components/ErrorMessage.astro";
|
import ErrorMessage from "components/ErrorMessage.astro";
|
||||||
import RTAudio from "./components/RTAudio.astro";
|
import RTAudio from "./components/RTAudio.astro";
|
||||||
import RTVideo from "./components/RTVideo.astro";
|
import RTVideo from "./components/RTVideo.astro";
|
||||||
|
import {
|
||||||
|
type RichTextUploadNode,
|
||||||
|
isUploadNodeImageNode,
|
||||||
|
isUploadNodeAudioNode,
|
||||||
|
isUploadNodeVideoNode,
|
||||||
|
} from "src/shared/payload/rich-text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: RichTextUploadNode;
|
node: RichTextUploadNode;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
---
|
---
|
||||||
import { type RichTextUploadAudioNode } from "src/shared/payload/payload-sdk";
|
|
||||||
import type { RichTextContext } from "src/utils/richText";
|
import type { RichTextContext } from "src/utils/richText";
|
||||||
import AudioPlayer from "components/AudioPlayer.astro";
|
import AudioPlayer from "components/AudioPlayer.astro";
|
||||||
import HeaderTitle from "components/HeaderTitle.astro";
|
import HeaderTitle from "components/HeaderTitle.astro";
|
||||||
import { Icon } from "astro-icon/components";
|
import { Icon } from "astro-icon/components";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import OpenMediaPageButton from "./OpenMediaPageButton.astro";
|
import OpenMediaPageButton from "./OpenMediaPageButton.astro";
|
||||||
|
import type { RichTextUploadAudioNode } from "src/shared/payload/rich-text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: RichTextUploadAudioNode;
|
node: RichTextUploadAudioNode;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
---
|
---
|
||||||
import { type RichTextUploadImageNode } from "src/shared/payload/payload-sdk";
|
|
||||||
import type { RichTextContext } from "src/utils/richText";
|
import type { RichTextContext } from "src/utils/richText";
|
||||||
import OpenMediaPageButton from "./OpenMediaPageButton.astro";
|
import OpenMediaPageButton from "./OpenMediaPageButton.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import HeaderTitle from "components/HeaderTitle.astro";
|
import HeaderTitle from "components/HeaderTitle.astro";
|
||||||
import { Icon } from "astro-icon/components";
|
import { Icon } from "astro-icon/components";
|
||||||
import { sizesToSrcset } from "src/utils/img";
|
import { sizesToSrcset } from "src/utils/img";
|
||||||
|
import type { RichTextUploadImageNode } from "src/shared/payload/rich-text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: RichTextUploadImageNode;
|
node: RichTextUploadImageNode;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
---
|
---
|
||||||
import { type RichTextUploadVideoNode } from "src/shared/payload/payload-sdk";
|
|
||||||
import type { RichTextContext } from "src/utils/richText";
|
import type { RichTextContext } from "src/utils/richText";
|
||||||
import VideoPlayer from "components/VideoPlayer.astro";
|
import VideoPlayer from "components/VideoPlayer.astro";
|
||||||
import OpenMediaPageButton from "./OpenMediaPageButton.astro";
|
import OpenMediaPageButton from "./OpenMediaPageButton.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import HeaderTitle from "components/HeaderTitle.astro";
|
import HeaderTitle from "components/HeaderTitle.astro";
|
||||||
import { Icon } from "astro-icon/components";
|
import { Icon } from "astro-icon/components";
|
||||||
|
import type { RichTextUploadVideoNode } from "src/shared/payload/rich-text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: RichTextUploadVideoNode;
|
node: RichTextUploadVideoNode;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointSource } from "src/shared/payload/payload-sdk";
|
import type { EndpointSource } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
source: EndpointSource;
|
source: EndpointSource;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
---
|
---
|
||||||
import type { TableOfContentEntry } from "src/shared/payload/payload-sdk";
|
|
||||||
import TableOfContentItem from "./components/TableOfContentItem.astro";
|
import TableOfContentItem from "./components/TableOfContentItem.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import TitleIcon from "components/TitleIcon.astro";
|
import TitleIcon from "components/TitleIcon.astro";
|
||||||
|
import type { TableOfContentEntry } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
toc: TableOfContentEntry[];
|
toc: TableOfContentEntry[];
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { TableOfContentEntry } from "src/shared/payload/payload-sdk";
|
import type { TableOfContentEntry } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
entry: TableOfContentEntry;
|
entry: TableOfContentEntry;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
import type { EndpointVideoPreview } from "src/shared/payload/payload-sdk";
|
import type { EndpointVideoPreview } from "src/shared/payload/endpoint-types";
|
||||||
import { formatLocale } from "src/utils/format";
|
import { formatLocale } from "src/utils/format";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import type { WordingKey } from "src/i18n/wordings-keys";
|
import type { WordingKey } from "src/i18n/wordings-keys";
|
||||||
import type { EndpointChronologyEvent, EndpointSource } from "src/shared/payload/payload-sdk";
|
|
||||||
import { contextCache } from "src/utils/payload";
|
import { contextCache } from "src/utils/payload";
|
||||||
import { capitalize, formatInlineTitle } from "src/utils/format";
|
import { capitalize, formatInlineTitle } from "src/utils/format";
|
||||||
|
import type { EndpointChronologyEvent, EndpointSource } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
export const defaultLocale = "en";
|
export const defaultLocale = "en";
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
isValidTheme,
|
isValidTheme,
|
||||||
redirect,
|
redirect,
|
||||||
} from "src/middleware/utils";
|
} from "src/middleware/utils";
|
||||||
import { trackEvent } from "src/shared/analytics/analytics";
|
import { analytics } from "src/services";
|
||||||
|
|
||||||
const ninetyDaysInSeconds = 60 * 60 * 24 * 90;
|
const ninetyDaysInSeconds = 60 * 60 * 24 * 90;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ export const actionsHandlingMiddleware = defineMiddleware(async ({ url, cookies
|
||||||
: url.pathname;
|
: url.pathname;
|
||||||
url.pathname = getAbsoluteLocaleUrl(language, pathnameWithoutLocale);
|
url.pathname = getAbsoluteLocaleUrl(language, pathnameWithoutLocale);
|
||||||
url.searchParams.delete("action-lang");
|
url.searchParams.delete("action-lang");
|
||||||
trackEvent("action-lang");
|
analytics.trackEvent("action-lang");
|
||||||
cookies.set(CookieKeys.Language, language, {
|
cookies.set(CookieKeys.Language, language, {
|
||||||
maxAge: ninetyDaysInSeconds,
|
maxAge: ninetyDaysInSeconds,
|
||||||
path: "/",
|
path: "/",
|
||||||
|
@ -32,7 +32,7 @@ export const actionsHandlingMiddleware = defineMiddleware(async ({ url, cookies
|
||||||
|
|
||||||
const currency = url.searchParams.get("action-currency");
|
const currency = url.searchParams.get("action-currency");
|
||||||
if (isValidCurrency(currency)) {
|
if (isValidCurrency(currency)) {
|
||||||
trackEvent("action-currency");
|
analytics.trackEvent("action-currency");
|
||||||
cookies.set(CookieKeys.Currency, currency, {
|
cookies.set(CookieKeys.Currency, currency, {
|
||||||
maxAge: ninetyDaysInSeconds,
|
maxAge: ninetyDaysInSeconds,
|
||||||
path: "/",
|
path: "/",
|
||||||
|
@ -44,7 +44,7 @@ export const actionsHandlingMiddleware = defineMiddleware(async ({ url, cookies
|
||||||
|
|
||||||
const theme = url.searchParams.get("action-theme");
|
const theme = url.searchParams.get("action-theme");
|
||||||
if (isValidTheme(theme)) {
|
if (isValidTheme(theme)) {
|
||||||
trackEvent("action-theme");
|
analytics.trackEvent("action-theme");
|
||||||
cookies.set(CookieKeys.Theme, theme, {
|
cookies.set(CookieKeys.Theme, theme, {
|
||||||
maxAge: theme === "auto" ? 0 : ninetyDaysInSeconds,
|
maxAge: theme === "auto" ? 0 : ninetyDaysInSeconds,
|
||||||
path: "/",
|
path: "/",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { defineMiddleware } from "astro:middleware";
|
import { defineMiddleware } from "astro:middleware";
|
||||||
import { trackEvent } from "src/shared/analytics/analytics";
|
|
||||||
import { defaultLocale } from "src/i18n/i18n";
|
import { defaultLocale } from "src/i18n/i18n";
|
||||||
import {
|
import {
|
||||||
getAbsoluteLocaleUrl,
|
getAbsoluteLocaleUrl,
|
||||||
|
@ -8,6 +7,7 @@ import {
|
||||||
getCurrentLocale,
|
getCurrentLocale,
|
||||||
redirect,
|
redirect,
|
||||||
} from "src/middleware/utils";
|
} from "src/middleware/utils";
|
||||||
|
import { analytics } from "src/services";
|
||||||
|
|
||||||
const localeAgnosticPaths = ["/api/"];
|
const localeAgnosticPaths = ["/api/"];
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ export const localeNegotiationMiddleware = defineMiddleware(({ cookies, url, req
|
||||||
|
|
||||||
if (!currentLocale) {
|
if (!currentLocale) {
|
||||||
const redirectURL = getAbsoluteLocaleUrl(bestMatchingLocale, url.pathname);
|
const redirectURL = getAbsoluteLocaleUrl(bestMatchingLocale, url.pathname);
|
||||||
trackEvent("locale-redirect");
|
analytics.trackEvent("locale-redirect");
|
||||||
return redirect(redirectURL);
|
return redirect(redirectURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentLocale !== bestMatchingLocale) {
|
if (currentLocale !== bestMatchingLocale) {
|
||||||
const pathnameWithoutLocale = url.pathname.substring(currentLocale.length + 1);
|
const pathnameWithoutLocale = url.pathname.substring(currentLocale.length + 1);
|
||||||
const redirectURL = getAbsoluteLocaleUrl(bestMatchingLocale, pathnameWithoutLocale);
|
const redirectURL = getAbsoluteLocaleUrl(bestMatchingLocale, pathnameWithoutLocale);
|
||||||
trackEvent("locale-redirect");
|
analytics.trackEvent("locale-redirect");
|
||||||
return redirect(redirectURL);
|
return redirect(redirectURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
import { defineMiddleware } from "astro/middleware";
|
import { defineMiddleware } from "astro/middleware";
|
||||||
import { trackRequest } from "src/shared/analytics/analytics";
|
import { analytics } from "src/services";
|
||||||
|
|
||||||
export const requestTrackingMiddleware = defineMiddleware(async (context, next) => {
|
export const requestTrackingMiddleware = defineMiddleware(async (context, next) => {
|
||||||
const { request, params, locals, clientAddress } = context;
|
const { request, locals, clientAddress } = context;
|
||||||
const response = await next();
|
const response = await next();
|
||||||
trackRequest(request, { params, locals, clientAddress });
|
analytics.trackRequest(request, {
|
||||||
|
clientAddress,
|
||||||
|
locale: locals.currentLocale,
|
||||||
|
responseStatus: response.status,
|
||||||
|
});
|
||||||
return response;
|
return response;
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
import type { EndpointPayloadImage } from "src/shared/payload/payload-sdk";
|
import type { EndpointPayloadImage } from "src/shared/payload/endpoint-types";
|
||||||
import { sizesForGridLayout, sizesToSrcset } from "src/utils/img";
|
import { sizesForGridLayout, sizesToSrcset } from "src/utils/img";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import type { APIRoute } from "astro";
|
import type { APIRoute } from "astro";
|
||||||
|
import { Collections } from "src/shared/payload/constants";
|
||||||
|
import type { AfterOperationWebHookMessage } from "src/shared/payload/webhooks";
|
||||||
import { contextCache, dataCache } from "src/utils/payload.ts";
|
import { contextCache, dataCache } from "src/utils/payload.ts";
|
||||||
import { Collections, type AfterOperationWebHookMessage } from "src/shared/payload/payload-sdk";
|
|
||||||
|
|
||||||
export const POST: APIRoute = async ({ request }) => {
|
export const POST: APIRoute = async ({ request }) => {
|
||||||
const auth = request.headers.get("Authorization");
|
const auth = request.headers.get("Authorization");
|
||||||
|
|
|
@ -4,7 +4,7 @@ import Credits from "components/Credits.astro";
|
||||||
import InlineCredits from "components/InlineCredits.astro";
|
import InlineCredits from "components/InlineCredits.astro";
|
||||||
import MasoActor from "components/Maso/MasoActor.astro";
|
import MasoActor from "components/Maso/MasoActor.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointCredit, EndpointPage } from "src/shared/payload/payload-sdk";
|
import type { EndpointCredit, EndpointPage } from "src/shared/payload/endpoint-types";
|
||||||
import { formatLocale } from "src/utils/format";
|
import { formatLocale } from "src/utils/format";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
---
|
---
|
||||||
import RichText from "components/RichText/RichText.astro";
|
import RichText from "components/RichText/RichText.astro";
|
||||||
import type { EndpointPage } from "src/shared/payload/payload-sdk";
|
|
||||||
import AppLayoutTitle from "components/AppLayout/components/AppLayoutTitle.astro";
|
import AppLayoutTitle from "components/AppLayout/components/AppLayoutTitle.astro";
|
||||||
import MasoTarget from "components/Maso/MasoTarget.astro";
|
import MasoTarget from "components/Maso/MasoTarget.astro";
|
||||||
import TableOfContent from "components/TableOfContent/TableOfContent.astro";
|
import TableOfContent from "components/TableOfContent/TableOfContent.astro";
|
||||||
|
@ -11,6 +10,7 @@ import type { Attribute } from "src/utils/attributes";
|
||||||
import { payload } from "src/utils/payload";
|
import { payload } from "src/utils/payload";
|
||||||
import { sizesToSrcset } from "src/utils/img";
|
import { sizesToSrcset } from "src/utils/img";
|
||||||
import PageCredits from "./_components/PageCredits.astro";
|
import PageCredits from "./_components/PageCredits.astro";
|
||||||
|
import type { EndpointPage } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
export const partial = true;
|
export const partial = true;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import TimelineLanguageOverride from "pages/[locale]/timeline/_components/Timeli
|
||||||
import TimelineNote from "pages/[locale]/timeline/_components/TimelineNote.astro";
|
import TimelineNote from "pages/[locale]/timeline/_components/TimelineNote.astro";
|
||||||
import TimelineSourcesButton from "pages/[locale]/timeline/_components/TimelineSourcesButton.astro";
|
import TimelineSourcesButton from "pages/[locale]/timeline/_components/TimelineSourcesButton.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointChronologyEvent } from "src/shared/payload/payload-sdk";
|
import type { EndpointChronologyEvent } from "src/shared/payload/endpoint-types";
|
||||||
import { payload } from "src/utils/payload";
|
import { payload } from "src/utils/payload";
|
||||||
|
|
||||||
export const partial = true;
|
export const partial = true;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import TitleIcon from "components/TitleIcon.astro";
|
import TitleIcon from "components/TitleIcon.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointCollectible } from "src/shared/payload/payload-sdk";
|
import type { EndpointCollectible } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
urls: EndpointCollectible["urls"];
|
urls: EndpointCollectible["urls"];
|
||||||
|
|
|
@ -2,12 +2,13 @@
|
||||||
import ErrorMessage from "components/ErrorMessage.astro";
|
import ErrorMessage from "components/ErrorMessage.astro";
|
||||||
import RichText from "components/RichText/RichText.astro";
|
import RichText from "components/RichText/RichText.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import { Collections, type EndpointCollectible } from "src/shared/payload/payload-sdk";
|
|
||||||
import Card from "components/Card.astro";
|
import Card from "components/Card.astro";
|
||||||
import AudioPlayer from "components/AudioPlayer.astro";
|
import AudioPlayer from "components/AudioPlayer.astro";
|
||||||
import VideoPlayer from "components/VideoPlayer.astro";
|
import VideoPlayer from "components/VideoPlayer.astro";
|
||||||
import InlineAttributes from "components/InlineAttributes.astro";
|
import InlineAttributes from "components/InlineAttributes.astro";
|
||||||
import { formatInlineTitle } from "src/utils/format";
|
import { formatInlineTitle } from "src/utils/format";
|
||||||
|
import { Collections } from "src/shared/payload/constants";
|
||||||
|
import type { EndpointCollectible } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
content: EndpointCollectible["contents"][number];
|
content: EndpointCollectible["contents"][number];
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
---
|
---
|
||||||
import type { EndpointCollectible } from "src/shared/payload/payload-sdk";
|
|
||||||
import ContentRow from "./ContentRow.astro";
|
import ContentRow from "./ContentRow.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import TitleIcon from "components/TitleIcon.astro";
|
import TitleIcon from "components/TitleIcon.astro";
|
||||||
|
import type { EndpointCollectible } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
contents: EndpointCollectible["contents"];
|
contents: EndpointCollectible["contents"];
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
---
|
---
|
||||||
import type {
|
import type {
|
||||||
EndpointImage,
|
EndpointImage,
|
||||||
EndpointPayloadImage,
|
|
||||||
EndpointScanImage,
|
EndpointScanImage,
|
||||||
} from "src/shared/payload/payload-sdk";
|
EndpointPayloadImage,
|
||||||
|
} from "src/shared/payload/endpoint-types";
|
||||||
import { sizesToSrcset } from "src/utils/img";
|
import { sizesToSrcset } from "src/utils/img";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
---
|
---
|
||||||
import TitleIcon from "components/TitleIcon.astro";
|
import TitleIcon from "components/TitleIcon.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import {
|
import { CollectibleBindingTypes, CollectiblePageOrders } from "src/shared/payload/constants";
|
||||||
CollectibleBindingTypes,
|
import type { EndpointCollectible } from "src/shared/payload/endpoint-types";
|
||||||
CollectiblePageOrders,
|
|
||||||
type EndpointCollectible,
|
|
||||||
} from "src/shared/payload/payload-sdk";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
pageInfo: NonNullable<EndpointCollectible["pageInfo"]>;
|
pageInfo: NonNullable<EndpointCollectible["pageInfo"]>;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import FilePreview from "components/Previews/FilePreview.astro";
|
import FilePreview from "components/Previews/FilePreview.astro";
|
||||||
import TitleIcon from "components/TitleIcon.astro";
|
import TitleIcon from "components/TitleIcon.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointCollectible } from "src/shared/payload/payload-sdk";
|
import type { EndpointCollectible } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
files: EndpointCollectible["files"];
|
files: EndpointCollectible["files"];
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import CollectiblePreview from "components/Previews/CollectiblePreview.astro";
|
import CollectiblePreview from "components/Previews/CollectiblePreview.astro";
|
||||||
import TitleIcon from "components/TitleIcon.astro";
|
import TitleIcon from "components/TitleIcon.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointCollectible } from "src/shared/payload/payload-sdk";
|
import type { EndpointCollectible } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
subitems: EndpointCollectible["subitems"];
|
subitems: EndpointCollectible["subitems"];
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import AppLayout from "components/AppLayout/AppLayout.astro";
|
import AppLayout from "components/AppLayout/AppLayout.astro";
|
||||||
import AppLayoutTitle from "components/AppLayout/components/AppLayoutTitle.astro";
|
import AppLayoutTitle from "components/AppLayout/components/AppLayoutTitle.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import { CollectibleNature } from "src/shared/payload/payload-sdk";
|
|
||||||
import { fetchOr404 } from "src/utils/responses";
|
import { fetchOr404 } from "src/utils/responses";
|
||||||
import ImageTile from "./_components/ImageTile.astro";
|
import ImageTile from "./_components/ImageTile.astro";
|
||||||
import SizeInfo from "./_components/SizeInfo.astro";
|
import SizeInfo from "./_components/SizeInfo.astro";
|
||||||
|
@ -20,6 +19,7 @@ import { sizesToSrcset } from "src/utils/img";
|
||||||
import RichText from "components/RichText/RichText.astro";
|
import RichText from "components/RichText/RichText.astro";
|
||||||
import SubFilesSection from "./_components/SubFilesSection.astro";
|
import SubFilesSection from "./_components/SubFilesSection.astro";
|
||||||
import PriceInfo from "./_components/PriceInfo.astro";
|
import PriceInfo from "./_components/PriceInfo.astro";
|
||||||
|
import { CollectibleNature } from "src/shared/payload/constants";
|
||||||
|
|
||||||
const slug = Astro.params.slug!;
|
const slug = Astro.params.slug!;
|
||||||
const { getLocalizedMatch, getLocalizedUrl, t, formatDate } = await getI18n(
|
const { getLocalizedMatch, getLocalizedUrl, t, formatDate } = await getI18n(
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointScanImage } from "src/shared/payload/payload-sdk";
|
import type { EndpointScanImage } from "src/shared/payload/endpoint-types";
|
||||||
import { sizesForGridLayout, sizesToSrcset } from "src/utils/img";
|
import { sizesForGridLayout, sizesToSrcset } from "src/utils/img";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
---
|
---
|
||||||
import { Collections } from "src/shared/payload/payload-sdk";
|
|
||||||
import FoldersSection from "./_components/FoldersSection.astro";
|
import FoldersSection from "./_components/FoldersSection.astro";
|
||||||
import { fetchOr404 } from "src/utils/responses";
|
import { fetchOr404 } from "src/utils/responses";
|
||||||
import ErrorMessage from "components/ErrorMessage.astro";
|
import ErrorMessage from "components/ErrorMessage.astro";
|
||||||
|
@ -15,6 +14,7 @@ import AppLayoutTitle from "components/AppLayout/components/AppLayoutTitle.astro
|
||||||
import { payload } from "src/utils/payload";
|
import { payload } from "src/utils/payload";
|
||||||
import RichText from "components/RichText/RichText.astro";
|
import RichText from "components/RichText/RichText.astro";
|
||||||
import FilePreview from "components/Previews/FilePreview.astro";
|
import FilePreview from "components/Previews/FilePreview.astro";
|
||||||
|
import { Collections } from "src/shared/payload/constants";
|
||||||
|
|
||||||
const slug = Astro.params.slug!;
|
const slug = Astro.params.slug!;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
import type { EndpointFolderPreview } from "src/shared/payload/payload-sdk";
|
import type { EndpointFolderPreview } from "src/shared/payload/endpoint-types";
|
||||||
import FolderCard from "./FolderCard.astro";
|
import FolderCard from "./FolderCard.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@ import ImagePreview from "components/Previews/ImagePreview.astro";
|
||||||
import PagePreview from "components/Previews/PagePreview.astro";
|
import PagePreview from "components/Previews/PagePreview.astro";
|
||||||
import VideoPreview from "components/Previews/VideoPreview.astro";
|
import VideoPreview from "components/Previews/VideoPreview.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import { Collections } from "src/shared/payload/payload-sdk";
|
|
||||||
import { meilisearch } from "src/utils/meilisearch";
|
|
||||||
import CollectiblePreview from "components/Previews/CollectiblePreview.astro";
|
import CollectiblePreview from "components/Previews/CollectiblePreview.astro";
|
||||||
import Button from "components/Button.astro";
|
import Button from "components/Button.astro";
|
||||||
import Paginator from "./_components/Paginator.astro";
|
import Paginator from "./_components/Paginator.astro";
|
||||||
|
@ -17,6 +15,8 @@ import HomeTitle from "../_components/HomeTitle.astro";
|
||||||
import RecorderPreview from "components/Previews/RecorderPreview.astro";
|
import RecorderPreview from "components/Previews/RecorderPreview.astro";
|
||||||
import FolderPreview from "components/Previews/FolderPreview.astro";
|
import FolderPreview from "components/Previews/FolderPreview.astro";
|
||||||
import ChronologyEventPreview from "components/Previews/ChronologyEventPreview.astro";
|
import ChronologyEventPreview from "components/Previews/ChronologyEventPreview.astro";
|
||||||
|
import { Collections } from "src/shared/payload/constants";
|
||||||
|
import { meilisearch } from "src/services";
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
q: string;
|
q: string;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
---
|
---
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointChronologyEvent } from "src/shared/payload/payload-sdk";
|
|
||||||
import TimelineEventPartial from "../../api/timeline/partial.astro";
|
import TimelineEventPartial from "../../api/timeline/partial.astro";
|
||||||
import { formatTimelineDateToId } from "src/utils/format";
|
import { formatTimelineDateToId } from "src/utils/format";
|
||||||
|
import type { EndpointChronologyEvent } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
event: EndpointChronologyEvent;
|
event: EndpointChronologyEvent;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import InlineCredits from "components/InlineCredits.astro";
|
||||||
import MasoActor from "components/Maso/MasoActor.astro";
|
import MasoActor from "components/Maso/MasoActor.astro";
|
||||||
import Tooltip from "components/Tooltip.astro";
|
import Tooltip from "components/Tooltip.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointCredit } from "src/shared/payload/payload-sdk";
|
import type { EndpointCredit } from "src/shared/payload/endpoint-types";
|
||||||
import { formatLocale } from "src/utils/format";
|
import { formatLocale } from "src/utils/format";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Icon } from "astro-icon/components";
|
||||||
import RichText from "components/RichText/RichText.astro";
|
import RichText from "components/RichText/RichText.astro";
|
||||||
import Tooltip from "components/Tooltip.astro";
|
import Tooltip from "components/Tooltip.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { RichTextContent } from "src/shared/payload/payload-sdk";
|
import type { RichTextContent } from "src/shared/payload/rich-text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
notes: RichTextContent;
|
notes: RichTextContent;
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Icon } from "astro-icon/components";
|
||||||
import SourceRow from "components/SourceRow.astro";
|
import SourceRow from "components/SourceRow.astro";
|
||||||
import Tooltip from "components/Tooltip.astro";
|
import Tooltip from "components/Tooltip.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
import type { EndpointSource } from "src/shared/payload/payload-sdk";
|
import type { EndpointSource } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
sources: EndpointSource[];
|
sources: EndpointSource[];
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import type { EndpointChronologyEvent } from "src/shared/payload/payload-sdk";
|
|
||||||
import TimelineEvent from "./TimelineEvent.astro";
|
import TimelineEvent from "./TimelineEvent.astro";
|
||||||
import { getI18n } from "src/i18n/i18n";
|
import { getI18n } from "src/i18n/i18n";
|
||||||
|
import type { EndpointChronologyEvent } from "src/shared/payload/endpoint-types";
|
||||||
import { contextCache } from "src/utils/payload";
|
import { contextCache } from "src/utils/payload";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { AnalyticsSDK } from "src/shared/analytics/sdk";
|
||||||
|
import { MeilisearchSDK } from "src/shared/meilisearch/sdk";
|
||||||
|
|
||||||
|
export const meilisearch = new MeilisearchSDK(
|
||||||
|
import.meta.env.MEILISEARCH_URL,
|
||||||
|
import.meta.env.MEILISEARCH_MASTER_KEY
|
||||||
|
);
|
||||||
|
|
||||||
|
export const analytics = new AnalyticsSDK(import.meta.env.ANALYTICS_URL);
|
|
@ -1,12 +1,12 @@
|
||||||
|
import type { EndpointChronologyEvent } from "src/shared/payload/endpoint-types";
|
||||||
import {
|
import {
|
||||||
isNodeLinkNode,
|
isNodeLinkNode,
|
||||||
isNodeListNode,
|
isNodeListNode,
|
||||||
isNodeParagraphNode,
|
isNodeParagraphNode,
|
||||||
isNodeTextNode,
|
isNodeTextNode,
|
||||||
type EndpointChronologyEvent,
|
|
||||||
type RichTextContent,
|
type RichTextContent,
|
||||||
type RichTextNode,
|
type RichTextNode,
|
||||||
} from "src/shared/payload/payload-sdk";
|
} from "src/shared/payload/rich-text";
|
||||||
import { contextCache } from "src/utils/payload";
|
import { contextCache } from "src/utils/payload";
|
||||||
|
|
||||||
export const formatLocale = (code: string): string =>
|
export const formatLocale = (code: string): string =>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { PayloadImage } from "src/shared/payload/payload-sdk";
|
import type { PayloadImage } from "src/shared/payload/endpoint-types";
|
||||||
|
|
||||||
export const sizesToSrcset = (sizes: PayloadImage[]): string =>
|
export const sizesToSrcset = (sizes: PayloadImage[]): string =>
|
||||||
sizes.map(({ url, width }) => `${encodeURI(url)} ${width}w`).join(", ");
|
sizes.map(({ url, width }) => `${encodeURI(url)} ${width}w`).join(", ");
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
import { Meilisearch } from "src/shared/meilisearch/meilisearch-sdk";
|
|
||||||
|
|
||||||
export const meilisearch = new Meilisearch(
|
|
||||||
import.meta.env.MEILISEARCH_URL,
|
|
||||||
import.meta.env.MEILISEARCH_MASTER_KEY
|
|
||||||
);
|
|
|
@ -2,7 +2,7 @@ import { ContextCache } from "src/cache/contextCache";
|
||||||
import { DataCache } from "src/cache/dataCache";
|
import { DataCache } from "src/cache/dataCache";
|
||||||
import { PageCache } from "src/cache/pageCache";
|
import { PageCache } from "src/cache/pageCache";
|
||||||
import { TokenCache } from "src/cache/tokenCache";
|
import { TokenCache } from "src/cache/tokenCache";
|
||||||
import { PayloadSDK } from "src/shared/payload/payload-sdk";
|
import { PayloadSDK } from "src/shared/payload/sdk";
|
||||||
|
|
||||||
const tokenCache = new TokenCache();
|
const tokenCache = new TokenCache();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue