@tenphi/renderer 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +23 -0
- package/dist/client/appearance.d.ts +12 -0
- package/dist/client/appearance.d.ts.map +1 -0
- package/dist/client/appearance.js +66 -0
- package/dist/client/appearance.js.map +1 -0
- package/dist/client/code-copy.d.ts +1 -0
- package/dist/client/code-copy.js +63 -0
- package/dist/client/code-copy.js.map +1 -0
- package/dist/client/heading-links.d.ts +6 -0
- package/dist/client/heading-links.d.ts.map +1 -0
- package/dist/client/heading-links.js +87 -0
- package/dist/client/heading-links.js.map +1 -0
- package/dist/client/mobile-toc.d.ts +1 -0
- package/dist/client/mobile-toc.js +28 -0
- package/dist/client/mobile-toc.js.map +1 -0
- package/dist/client/navigation.d.ts +1 -0
- package/dist/client/navigation.js +112 -0
- package/dist/client/navigation.js.map +1 -0
- package/dist/client/page-copy.d.ts +1 -0
- package/dist/client/page-copy.js +34 -0
- package/dist/client/page-copy.js.map +1 -0
- package/dist/client/search.d.ts +13 -0
- package/dist/client/search.d.ts.map +1 -0
- package/dist/client/search.js +87 -0
- package/dist/client/search.js.map +1 -0
- package/dist/client/sidebar.d.ts +1 -0
- package/dist/client/sidebar.js +93 -0
- package/dist/client/sidebar.js.map +1 -0
- package/dist/client/tabs.d.ts +6 -0
- package/dist/client/tabs.d.ts.map +1 -0
- package/dist/client/tabs.js +64 -0
- package/dist/client/tabs.js.map +1 -0
- package/dist/components/Callout.astro +15 -0
- package/dist/components/Card.astro +13 -0
- package/dist/components/CodeGroup.astro +47 -0
- package/dist/components/ContrastIcon.astro +29 -0
- package/dist/components/EditLink.astro +11 -0
- package/dist/components/GlobalStyles.js +1675 -0
- package/dist/components/HeaderLinks.astro +84 -0
- package/dist/components/Icon.astro +39 -0
- package/dist/components/LastUpdated.astro +17 -0
- package/dist/components/LayoutComponents.js +866 -0
- package/dist/components/Logo.astro +37 -0
- package/dist/components/MobileNavigationTabs.astro +79 -0
- package/dist/components/MobileTocList.astro +22 -0
- package/dist/components/PackageVersion.astro +25 -0
- package/dist/components/PageActions.astro +29 -0
- package/dist/components/Pagination.astro +29 -0
- package/dist/components/Preview.astro +34 -0
- package/dist/components/SidebarList.astro +122 -0
- package/dist/components/SiteLogo.astro +40 -0
- package/dist/components/SiteTitle.astro +7 -0
- package/dist/components/Steps.astro +6 -0
- package/dist/components/Tab.astro +10 -0
- package/dist/components/TableOfContents.astro +23 -0
- package/dist/components/Tabs.astro +16 -0
- package/dist/components/TastyComponents.js +255 -0
- package/dist/components/VersionSwitcher.astro +44 -0
- package/dist/components/appearance-preferences.test.ts +91 -0
- package/dist/components/appearance-preferences.ts +57 -0
- package/dist/components/component-styles.test.ts +129 -0
- package/dist/components/component-styles.ts +65 -0
- package/dist/components/customize-component.js +8 -0
- package/dist/components/props.d.ts +38 -0
- package/dist/components/props.d.ts.map +1 -0
- package/dist/components/props.js +1 -0
- package/dist/components/props.ts +30 -0
- package/dist/components/svg-icon.test.ts +11 -0
- package/dist/components/svg-icon.ts +11 -0
- package/dist/components/tasty-states.d.ts +2 -0
- package/dist/components/tasty-states.js +42 -0
- package/dist/components-public.d.ts +21 -0
- package/dist/components.d.ts +10 -0
- package/dist/components.js +9 -0
- package/dist/content.d.ts +11 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +16 -0
- package/dist/content.js.map +1 -0
- package/dist/eslint-plugin.d.ts +32 -0
- package/dist/eslint-plugin.d.ts.map +1 -0
- package/dist/eslint-plugin.js +155 -0
- package/dist/eslint-plugin.js.map +1 -0
- package/dist/icons/arrow-left.svg +1 -0
- package/dist/icons/arrow-right.svg +1 -0
- package/dist/icons/check.svg +1 -0
- package/dist/icons/chevron-down.svg +1 -0
- package/dist/icons/chevron-right.svg +1 -0
- package/dist/icons/close.svg +1 -0
- package/dist/icons/copy.svg +1 -0
- package/dist/icons/device-desktop.svg +1 -0
- package/dist/icons/favicon.svg +11 -0
- package/dist/icons/menu.svg +1 -0
- package/dist/icons/moon.svg +1 -0
- package/dist/icons/palette.svg +1 -0
- package/dist/icons/search.svg +1 -0
- package/dist/icons/sun.svg +1 -0
- package/dist/index-BuX_Sb5c.d.ts +10 -0
- package/dist/index-BuX_Sb5c.d.ts.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1648 -0
- package/dist/index.js.map +1 -0
- package/dist/localization.d.ts +69 -0
- package/dist/localization.d.ts.map +1 -0
- package/dist/localization.js +195 -0
- package/dist/localization.js.map +1 -0
- package/dist/markdown/rendered-content.d.ts +6 -0
- package/dist/markdown/rendered-content.d.ts.map +1 -0
- package/dist/markdown/rendered-content.js +34 -0
- package/dist/markdown/rendered-content.js.map +1 -0
- package/dist/messages-B_3xUzUb.js +14 -0
- package/dist/messages-B_3xUzUb.js.map +1 -0
- package/dist/navigation.d.ts +31 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +165 -0
- package/dist/navigation.js.map +1 -0
- package/dist/overrides/DraftContentNotice.astro +8 -0
- package/dist/overrides/EmptyFooter.astro +3 -0
- package/dist/overrides/Footer.astro +23 -0
- package/dist/overrides/Head.astro +59 -0
- package/dist/overrides/Header.astro +139 -0
- package/dist/overrides/Hero.astro +73 -0
- package/dist/overrides/LanguageSelect.astro +63 -0
- package/dist/overrides/MarkdownContent.astro +14 -0
- package/dist/overrides/MobileMenuFooter.astro +15 -0
- package/dist/overrides/MobileMenuToggle.astro +36 -0
- package/dist/overrides/MobileTableOfContents.astro +37 -0
- package/dist/overrides/PageFrame.astro +35 -0
- package/dist/overrides/Search.astro +64 -0
- package/dist/overrides/Sidebar.astro +89 -0
- package/dist/overrides/SocialIcons.astro +27 -0
- package/dist/overrides/ThemeSelect.astro +148 -0
- package/dist/page-metadata.d.ts +13 -0
- package/dist/page-metadata.d.ts.map +1 -0
- package/dist/page-metadata.js +109 -0
- package/dist/page-metadata.js.map +1 -0
- package/dist/route-context.d.ts +85 -0
- package/dist/route-context.d.ts.map +1 -0
- package/dist/route-context.js +116 -0
- package/dist/route-context.js.map +1 -0
- package/dist/routes/DocsPage.astro +91 -0
- package/dist/routes/NotFound.astro +12 -0
- package/dist/routes/Page.astro +120 -0
- package/dist/styling.d.ts +17 -0
- package/dist/styling.d.ts.map +1 -0
- package/dist/styling.js +17 -0
- package/dist/styling.js.map +1 -0
- package/dist/tasty-states-BDKIbfw2.js +65 -0
- package/dist/tasty-states-BDKIbfw2.js.map +1 -0
- package/dist/theme/defaults.d.ts +21 -0
- package/dist/theme/defaults.d.ts.map +1 -0
- package/dist/theme/defaults.js +93 -0
- package/dist/theme/defaults.js.map +1 -0
- package/dist/theme/fonts.ts +64 -0
- package/dist/theme/shiki-theme.d.ts +13 -0
- package/dist/theme/shiki-theme.d.ts.map +1 -0
- package/dist/theme/shiki-theme.js +328 -0
- package/dist/theme/shiki-theme.js.map +1 -0
- package/dist/theme/tasty-config.d.ts +13 -0
- package/dist/theme/tasty-config.d.ts.map +1 -0
- package/dist/theme/tasty-config.js +16 -0
- package/dist/theme/tasty-config.js.map +1 -0
- package/dist/ui.d.ts +6 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +53 -0
- package/dist/ui.js.map +1 -0
- package/dist/versioning.d.ts +11 -0
- package/dist/versioning.d.ts.map +1 -0
- package/dist/versioning.js +38 -0
- package/dist/versioning.js.map +1 -0
- package/package.json +92 -0
- package/tasty.config.mjs +1 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface CardProps {
|
|
2
|
+
title?: string;
|
|
3
|
+
href?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface LogoProps {
|
|
6
|
+
label?: string;
|
|
7
|
+
decorative?: boolean;
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PreviewProps {
|
|
11
|
+
title: string;
|
|
12
|
+
html?: string;
|
|
13
|
+
css?: string;
|
|
14
|
+
javascript?: string;
|
|
15
|
+
}
|
|
16
|
+
export type StepsProps = Record<string, never>;
|
|
17
|
+
export interface TabsProps {
|
|
18
|
+
label?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface TabProps {
|
|
21
|
+
label: string;
|
|
22
|
+
}
|
|
23
|
+
export interface CalloutProps {
|
|
24
|
+
title?: string;
|
|
25
|
+
kind?: "note" | "tip" | "caution" | "danger";
|
|
26
|
+
}
|
|
27
|
+
export interface CodeGroupProps {
|
|
28
|
+
label?: string;
|
|
29
|
+
items: Array<{ label: string; code: string; language?: string }>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { svgIconUrl } from "./svg-icon.js";
|
|
3
|
+
|
|
4
|
+
describe("svgIconUrl", () => {
|
|
5
|
+
it("preserves case-sensitive SVG data when Tasty lowercases the style", () => {
|
|
6
|
+
const svg = '<svg viewBox="0 0 24 24"><path d="M1 2H3Z"/></svg>';
|
|
7
|
+
const [, payload] = svgIconUrl(svg).toLowerCase().split(",", 2);
|
|
8
|
+
|
|
9
|
+
expect(decodeURIComponent(payload ?? "")).toBe(svg);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Encode an SVG data URL that remains valid after Tasty lowercases styles. */
|
|
2
|
+
export function svgIconUrl(svg: string): string {
|
|
3
|
+
const encoded = encodeURIComponent(svg).replace(
|
|
4
|
+
/%[0-9A-F]{2}|[A-Z]/g,
|
|
5
|
+
(token) =>
|
|
6
|
+
token.startsWith("%")
|
|
7
|
+
? token.toLowerCase()
|
|
8
|
+
: `%${token.charCodeAt(0).toString(16)}`,
|
|
9
|
+
);
|
|
10
|
+
return `data:image/svg+xml,${encoded}`;
|
|
11
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { configure, getGlobalPredefinedStates } from "@tenphi/tasty";
|
|
2
|
+
import { resolveTypographyPresets } from "../theme/defaults.js";
|
|
3
|
+
import { TASTY_UNITS } from "../theme/tasty-config.js";
|
|
4
|
+
|
|
5
|
+
export const cookbookStates = {
|
|
6
|
+
"@mobile": "@media(w < 50rem)",
|
|
7
|
+
"@desktop": "@media(w >= 50rem)",
|
|
8
|
+
"@small": "@media(w <= 40rem)",
|
|
9
|
+
"@compact": "@media(w <= 23rem)",
|
|
10
|
+
"@shell-mobile": "@media(w <= 48rem)",
|
|
11
|
+
"@shell-desktop": "@media(w > 48rem)",
|
|
12
|
+
"@narrow-layout": "@media(w < 72rem)",
|
|
13
|
+
"@medium-layout": "@media(w >= 50rem) & @media(w < 72rem)",
|
|
14
|
+
"@reduced-motion": "@media(prefers-reduced-motion: reduce)",
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
let configured = false;
|
|
18
|
+
let configuredRuntime;
|
|
19
|
+
|
|
20
|
+
/** Configure aliases in the renderer's Tasty module before styles are parsed. */
|
|
21
|
+
export function configureCookbookStates() {
|
|
22
|
+
// Process-local server configuration shared across Astro/Vite module graphs.
|
|
23
|
+
// The integration prevents this module from entering browser bundles.
|
|
24
|
+
const runtime = globalThis.__tenphiCookbookTastyRuntime;
|
|
25
|
+
if (configured && configuredRuntime === runtime) return;
|
|
26
|
+
configure({
|
|
27
|
+
presets: resolveTypographyPresets(),
|
|
28
|
+
...runtime,
|
|
29
|
+
units: { ...TASTY_UNITS, ...runtime?.units },
|
|
30
|
+
});
|
|
31
|
+
configuredRuntime = runtime;
|
|
32
|
+
// The integration may have configured this runtime already, including
|
|
33
|
+
// consumer overrides of built-in breakpoints. Only supply missing aliases.
|
|
34
|
+
const existingStates = getGlobalPredefinedStates();
|
|
35
|
+
const missingStates = Object.fromEntries(
|
|
36
|
+
Object.entries(cookbookStates).filter(
|
|
37
|
+
([name]) => existingStates[name] === undefined,
|
|
38
|
+
),
|
|
39
|
+
);
|
|
40
|
+
if (Object.keys(missingStates).length) configure({ states: missingStates });
|
|
41
|
+
configured = true;
|
|
42
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AstroComponentFactory } from "astro/runtime/server/index.js";
|
|
2
|
+
import type {
|
|
3
|
+
CardProps,
|
|
4
|
+
LogoProps,
|
|
5
|
+
PreviewProps,
|
|
6
|
+
StepsProps,
|
|
7
|
+
TabsProps,
|
|
8
|
+
TabProps,
|
|
9
|
+
CalloutProps,
|
|
10
|
+
CodeGroupProps,
|
|
11
|
+
} from "./components/props.js";
|
|
12
|
+
export type * from "./components/props.js";
|
|
13
|
+
type Component<Props> = (props: Props) => ReturnType<AstroComponentFactory>;
|
|
14
|
+
export const Card: Component<CardProps>;
|
|
15
|
+
export const Logo: Component<LogoProps>;
|
|
16
|
+
export const Preview: Component<PreviewProps>;
|
|
17
|
+
export const Steps: Component<StepsProps>;
|
|
18
|
+
export const Tabs: Component<TabsProps>;
|
|
19
|
+
export const Tab: Component<TabProps>;
|
|
20
|
+
export const Callout: Component<CalloutProps>;
|
|
21
|
+
export const CodeGroup: Component<CodeGroupProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CalloutProps, CardProps, CodeGroupProps, LogoProps, PreviewProps, StepsProps, TabProps, TabsProps } from "./components/props.js";
|
|
2
|
+
import Card from "./components/Card.astro";
|
|
3
|
+
import Logo from "./components/Logo.astro";
|
|
4
|
+
import Preview from "./components/Preview.astro";
|
|
5
|
+
import Steps from "./components/Steps.astro";
|
|
6
|
+
import Tabs from "./components/Tabs.astro";
|
|
7
|
+
import Tab from "./components/Tab.astro";
|
|
8
|
+
import Callout from "./components/Callout.astro";
|
|
9
|
+
import CodeGroup from "./components/CodeGroup.astro";
|
|
10
|
+
export { Callout, type CalloutProps, Card, type CardProps, CodeGroup, type CodeGroupProps, Logo, type LogoProps, Preview, type PreviewProps, Steps, type StepsProps, Tab, type TabProps, Tabs, type TabsProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Card from "./components/Card.astro";
|
|
2
|
+
import Logo from "./components/Logo.astro";
|
|
3
|
+
import Preview from "./components/Preview.astro";
|
|
4
|
+
import Steps from "./components/Steps.astro";
|
|
5
|
+
import Tabs from "./components/Tabs.astro";
|
|
6
|
+
import Tab from "./components/Tab.astro";
|
|
7
|
+
import Callout from "./components/Callout.astro";
|
|
8
|
+
import CodeGroup from "./components/CodeGroup.astro";
|
|
9
|
+
export { Callout, Card, CodeGroup, Logo, Preview, Steps, Tab, Tabs };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DocsEntry } from "@tenphi/docs";
|
|
2
|
+
//#region src/content.d.ts
|
|
3
|
+
/** Cookbook's build-time content graph. Return snapshots so consumers cannot mutate routing. */
|
|
4
|
+
declare function getCookbookCollection(options?: {
|
|
5
|
+
includeDrafts?: boolean;
|
|
6
|
+
}): DocsEntry[];
|
|
7
|
+
/** Exact, base-free documentation route. Direct lookup can retrieve drafts. */
|
|
8
|
+
declare function getCookbookEntry(route: string): DocsEntry | undefined;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { getCookbookCollection, getCookbookEntry };
|
|
11
|
+
//# sourceMappingURL=content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","names":[],"sources":["../src/content.ts"],"mappings":";;;iBAKgB,sBACd;EAAW;IACV;;iBASa,iBAAiB,gBAAgB"}
|
package/dist/content.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { normalizeNavigationPath } from "./navigation.js";
|
|
2
|
+
import { content } from "virtual:cookbook/config";
|
|
3
|
+
//#region src/content.ts
|
|
4
|
+
/** Cookbook's build-time content graph. Return snapshots so consumers cannot mutate routing. */
|
|
5
|
+
function getCookbookCollection(options = {}) {
|
|
6
|
+
return structuredClone(content.entries.filter((entry) => options.includeDrafts || !entry.frontmatter.draft));
|
|
7
|
+
}
|
|
8
|
+
/** Exact, base-free documentation route. Direct lookup can retrieve drafts. */
|
|
9
|
+
function getCookbookEntry(route) {
|
|
10
|
+
const entry = content.entries.find((entry) => entry.route === normalizeNavigationPath(route));
|
|
11
|
+
return entry ? structuredClone(entry) : void 0;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { getCookbookCollection, getCookbookEntry };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","names":[],"sources":["../src/content.ts"],"sourcesContent":["import type { DocsEntry } from \"@tenphi/docs\";\nimport { content } from \"virtual:cookbook/config\";\nimport { normalizeNavigationPath } from \"./navigation.js\";\n\n/** Cookbook's build-time content graph. Return snapshots so consumers cannot mutate routing. */\nexport function getCookbookCollection(\n options: { includeDrafts?: boolean } = {},\n): DocsEntry[] {\n return structuredClone(\n content.entries.filter(\n (entry) => options.includeDrafts || !entry.frontmatter.draft,\n ),\n );\n}\n\n/** Exact, base-free documentation route. Direct lookup can retrieve drafts. */\nexport function getCookbookEntry(route: string): DocsEntry | undefined {\n const entry = content.entries.find(\n (entry) => entry.route === normalizeNavigationPath(route),\n );\n return entry ? structuredClone(entry) : undefined;\n}\n"],"mappings":";;;;AAKA,SAAgB,sBACd,UAAuC,CAAC,GAC3B;CACb,OAAO,gBACL,QAAQ,QAAQ,QACb,UAAU,QAAQ,iBAAiB,CAAC,MAAM,YAAY,KACzD,CACF;AACF;;AAGA,SAAgB,iBAAiB,OAAsC;CACrE,MAAM,QAAQ,QAAQ,QAAQ,MAC3B,UAAU,MAAM,UAAU,wBAAwB,KAAK,CAC1D;CACA,OAAO,QAAQ,gBAAgB,KAAK,IAAI,KAAA;AAC1C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ThemeConfig } from "@tenphi/docs";
|
|
2
|
+
import eslint_plugin_tasty_default, { ResolvedConfig, StyleFunctionConfig, TastyValidationConfig, TastyValidationConfig as TastyValidationConfig$1, recommended, strict } from "@tenphi/eslint-plugin-tasty";
|
|
3
|
+
//#region src/tasty.config.d.ts
|
|
4
|
+
declare const _default: {
|
|
5
|
+
importSources: string[];
|
|
6
|
+
styleFunctions: {
|
|
7
|
+
defineComponent: {
|
|
8
|
+
argument: number;
|
|
9
|
+
kind: "options";
|
|
10
|
+
};
|
|
11
|
+
resolveComponentStyles: {
|
|
12
|
+
argument: number;
|
|
13
|
+
kind: "styles";
|
|
14
|
+
};
|
|
15
|
+
mergeStyles: {
|
|
16
|
+
argument: "all";
|
|
17
|
+
kind: "styles";
|
|
18
|
+
partial: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
tokens: string[];
|
|
22
|
+
units: string[];
|
|
23
|
+
states: string[];
|
|
24
|
+
presets: string[];
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/eslint-plugin.d.ts
|
|
28
|
+
/** Keep editor/linter names aligned with a Cookbook theme. */
|
|
29
|
+
declare function createValidationConfig(theme?: ThemeConfig): TastyValidationConfig$1;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { type ResolvedConfig, type StyleFunctionConfig, type TastyValidationConfig, createValidationConfig, eslint_plugin_tasty_default as default, recommended, strict, _default as validationConfig };
|
|
32
|
+
//# sourceMappingURL=eslint-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-plugin.d.ts","names":[],"sources":["../src/tasty.config.ts","../src/eslint-plugin.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCagB,uBACd,QAAO,cACN"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import eslint_plugin_tasty_default, { recommended, strict } from "@tenphi/eslint-plugin-tasty";
|
|
2
|
+
//#region src/tasty.config.ts
|
|
3
|
+
var tasty_config_default = {
|
|
4
|
+
importSources: ["@tenphi/cookbook/styling", "@tenphi/renderer/styling"],
|
|
5
|
+
styleFunctions: {
|
|
6
|
+
defineComponent: {
|
|
7
|
+
argument: 1,
|
|
8
|
+
kind: "options"
|
|
9
|
+
},
|
|
10
|
+
resolveComponentStyles: {
|
|
11
|
+
argument: 1,
|
|
12
|
+
kind: "styles"
|
|
13
|
+
},
|
|
14
|
+
mergeStyles: {
|
|
15
|
+
argument: "all",
|
|
16
|
+
kind: "styles",
|
|
17
|
+
partial: true
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
tokens: [
|
|
21
|
+
"$gap",
|
|
22
|
+
"$radius",
|
|
23
|
+
"$header-control-radius",
|
|
24
|
+
"$card-radius",
|
|
25
|
+
"$border-width",
|
|
26
|
+
"$outline-width",
|
|
27
|
+
"$outline-offset",
|
|
28
|
+
"$layout-width",
|
|
29
|
+
"$content-width",
|
|
30
|
+
"$sidebar-width",
|
|
31
|
+
"$control-height",
|
|
32
|
+
"$transition",
|
|
33
|
+
"$sharp-radius",
|
|
34
|
+
"$bold-font-weight",
|
|
35
|
+
"#white",
|
|
36
|
+
"#black",
|
|
37
|
+
"#clear",
|
|
38
|
+
"#current",
|
|
39
|
+
"#surface",
|
|
40
|
+
"#header",
|
|
41
|
+
"#heading",
|
|
42
|
+
"#surface-2",
|
|
43
|
+
"#surface-3",
|
|
44
|
+
"#surface-2-hover",
|
|
45
|
+
"#surface-2-pressed",
|
|
46
|
+
"#surface-3-hover",
|
|
47
|
+
"#surface-3-pressed",
|
|
48
|
+
"#text",
|
|
49
|
+
"#text-soft",
|
|
50
|
+
"#text-muted",
|
|
51
|
+
"#sidebar-text",
|
|
52
|
+
"#border",
|
|
53
|
+
"#border-strong",
|
|
54
|
+
"#accent-text",
|
|
55
|
+
"#accent-surface",
|
|
56
|
+
"#accent-surface-text",
|
|
57
|
+
"#logo-surface",
|
|
58
|
+
"#logo-mark",
|
|
59
|
+
"#accent-surface-subtle",
|
|
60
|
+
"#accent-surface-2-subtle",
|
|
61
|
+
"#focus",
|
|
62
|
+
"#shadow",
|
|
63
|
+
"#overlay",
|
|
64
|
+
"#syntax-bg",
|
|
65
|
+
"#syntax-text",
|
|
66
|
+
"#syntax-comment",
|
|
67
|
+
"#syntax-punctuation",
|
|
68
|
+
"#syntax-keyword",
|
|
69
|
+
"#syntax-string",
|
|
70
|
+
"#syntax-token",
|
|
71
|
+
"#syntax-property",
|
|
72
|
+
"#syntax-number",
|
|
73
|
+
"#syntax-function",
|
|
74
|
+
"#syntax-value",
|
|
75
|
+
"#syntax-operator",
|
|
76
|
+
"#info",
|
|
77
|
+
"#info-surface",
|
|
78
|
+
"#info-text",
|
|
79
|
+
"#success",
|
|
80
|
+
"#success-surface",
|
|
81
|
+
"#success-text",
|
|
82
|
+
"#warning",
|
|
83
|
+
"#warning-surface",
|
|
84
|
+
"#warning-text",
|
|
85
|
+
"#danger",
|
|
86
|
+
"#danger-surface",
|
|
87
|
+
"#danger-text",
|
|
88
|
+
"#orange-surface",
|
|
89
|
+
"#orange",
|
|
90
|
+
"#orange-text",
|
|
91
|
+
"#green-surface",
|
|
92
|
+
"#green",
|
|
93
|
+
"#green-text",
|
|
94
|
+
"#blue-surface",
|
|
95
|
+
"#blue",
|
|
96
|
+
"#blue-text",
|
|
97
|
+
"#purple-surface",
|
|
98
|
+
"#purple",
|
|
99
|
+
"#purple-text",
|
|
100
|
+
"#red-surface",
|
|
101
|
+
"#red",
|
|
102
|
+
"#red-text"
|
|
103
|
+
],
|
|
104
|
+
units: [
|
|
105
|
+
"x",
|
|
106
|
+
"r",
|
|
107
|
+
"cr",
|
|
108
|
+
"bw"
|
|
109
|
+
],
|
|
110
|
+
states: [
|
|
111
|
+
"@mobile",
|
|
112
|
+
"@desktop",
|
|
113
|
+
"@small",
|
|
114
|
+
"@compact",
|
|
115
|
+
"@shell-mobile",
|
|
116
|
+
"@shell-desktop",
|
|
117
|
+
"@narrow-layout",
|
|
118
|
+
"@medium-layout",
|
|
119
|
+
"@reduced-motion"
|
|
120
|
+
],
|
|
121
|
+
presets: [
|
|
122
|
+
"body",
|
|
123
|
+
"heading",
|
|
124
|
+
"h1",
|
|
125
|
+
"h2",
|
|
126
|
+
"h3",
|
|
127
|
+
"h4",
|
|
128
|
+
"h5",
|
|
129
|
+
"h6",
|
|
130
|
+
"navigation",
|
|
131
|
+
"small",
|
|
132
|
+
"code"
|
|
133
|
+
]
|
|
134
|
+
};
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/eslint-plugin.ts
|
|
137
|
+
/** Keep editor/linter names aligned with a Cookbook theme. */
|
|
138
|
+
function createValidationConfig(theme = {}) {
|
|
139
|
+
return {
|
|
140
|
+
...tasty_config_default,
|
|
141
|
+
tokens: [
|
|
142
|
+
...tasty_config_default.tokens,
|
|
143
|
+
...Object.keys(theme.tokens ?? {}).map((name) => name.startsWith("--") ? `$${name.slice(2)}` : name),
|
|
144
|
+
...Object.keys(theme.palette ?? {}).map((name) => `#${name === "textSoft" ? "text-soft" : name}`)
|
|
145
|
+
],
|
|
146
|
+
units: [...tasty_config_default.units, ...Object.keys(theme.units ?? {})],
|
|
147
|
+
states: [...tasty_config_default.states, ...Object.keys(theme.states ?? {})],
|
|
148
|
+
presets: [...tasty_config_default.presets, ...Object.keys(theme.presets ?? {})],
|
|
149
|
+
recipes: Object.keys(theme.recipes ?? {})
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
export { createValidationConfig, eslint_plugin_tasty_default as default, recommended, strict, tasty_config_default as validationConfig };
|
|
154
|
+
|
|
155
|
+
//# sourceMappingURL=eslint-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-plugin.js","names":["validationConfig"],"sources":["../src/tasty.config.ts","../src/eslint-plugin.ts"],"sourcesContent":["import type { TastyValidationConfig } from \"@tenphi/eslint-plugin-tasty\";\n\nexport default {\n importSources: [\"@tenphi/cookbook/styling\", \"@tenphi/renderer/styling\"],\n styleFunctions: {\n defineComponent: { argument: 1, kind: \"options\" },\n resolveComponentStyles: { argument: 1, kind: \"styles\" },\n mergeStyles: { argument: \"all\", kind: \"styles\", partial: true },\n },\n tokens: [\n \"$gap\",\n \"$radius\",\n \"$header-control-radius\",\n \"$card-radius\",\n \"$border-width\",\n \"$outline-width\",\n \"$outline-offset\",\n \"$layout-width\",\n \"$content-width\",\n \"$sidebar-width\",\n \"$control-height\",\n \"$transition\",\n \"$sharp-radius\",\n \"$bold-font-weight\",\n \"#white\",\n \"#black\",\n \"#clear\",\n \"#current\",\n \"#surface\",\n \"#header\",\n \"#heading\",\n \"#surface-2\",\n \"#surface-3\",\n \"#surface-2-hover\",\n \"#surface-2-pressed\",\n \"#surface-3-hover\",\n \"#surface-3-pressed\",\n \"#text\",\n \"#text-soft\",\n \"#text-muted\",\n \"#sidebar-text\",\n \"#border\",\n \"#border-strong\",\n \"#accent-text\",\n \"#accent-surface\",\n \"#accent-surface-text\",\n \"#logo-surface\",\n \"#logo-mark\",\n \"#accent-surface-subtle\",\n \"#accent-surface-2-subtle\",\n \"#focus\",\n \"#shadow\",\n \"#overlay\",\n \"#syntax-bg\",\n \"#syntax-text\",\n \"#syntax-comment\",\n \"#syntax-punctuation\",\n \"#syntax-keyword\",\n \"#syntax-string\",\n \"#syntax-token\",\n \"#syntax-property\",\n \"#syntax-number\",\n \"#syntax-function\",\n \"#syntax-value\",\n \"#syntax-operator\",\n \"#info\",\n \"#info-surface\",\n \"#info-text\",\n \"#success\",\n \"#success-surface\",\n \"#success-text\",\n \"#warning\",\n \"#warning-surface\",\n \"#warning-text\",\n \"#danger\",\n \"#danger-surface\",\n \"#danger-text\",\n \"#orange-surface\",\n \"#orange\",\n \"#orange-text\",\n \"#green-surface\",\n \"#green\",\n \"#green-text\",\n \"#blue-surface\",\n \"#blue\",\n \"#blue-text\",\n \"#purple-surface\",\n \"#purple\",\n \"#purple-text\",\n \"#red-surface\",\n \"#red\",\n \"#red-text\",\n ],\n units: [\"x\", \"r\", \"cr\", \"bw\"],\n states: [\n \"@mobile\",\n \"@desktop\",\n \"@small\",\n \"@compact\",\n \"@shell-mobile\",\n \"@shell-desktop\",\n \"@narrow-layout\",\n \"@medium-layout\",\n \"@reduced-motion\",\n ],\n presets: [\n \"body\",\n \"heading\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"navigation\",\n \"small\",\n \"code\",\n ],\n} satisfies TastyValidationConfig;\n","export { default, recommended, strict } from \"@tenphi/eslint-plugin-tasty\";\nexport type {\n ResolvedConfig,\n StyleFunctionConfig,\n TastyValidationConfig,\n} from \"@tenphi/eslint-plugin-tasty\";\nexport { default as validationConfig } from \"./tasty.config.js\";\n\nimport type { ThemeConfig } from \"@tenphi/docs\";\nimport type { TastyValidationConfig } from \"@tenphi/eslint-plugin-tasty\";\nimport validationConfig from \"./tasty.config.js\";\n\n/** Keep editor/linter names aligned with a Cookbook theme. */\nexport function createValidationConfig(\n theme: ThemeConfig = {},\n): TastyValidationConfig {\n return {\n ...validationConfig,\n tokens: [\n ...validationConfig.tokens,\n ...Object.keys(theme.tokens ?? {}).map((name) =>\n name.startsWith(\"--\") ? `$${name.slice(2)}` : name,\n ),\n ...Object.keys(theme.palette ?? {}).map(\n (name) => `#${name === \"textSoft\" ? \"text-soft\" : name}`,\n ),\n ],\n units: [...validationConfig.units, ...Object.keys(theme.units ?? {})],\n states: [...validationConfig.states, ...Object.keys(theme.states ?? {})],\n presets: [...validationConfig.presets, ...Object.keys(theme.presets ?? {})],\n recipes: Object.keys(theme.recipes ?? {}),\n };\n}\n"],"mappings":";;AAEA,IAAA,uBAAe;CACb,eAAe,CAAC,4BAA4B,0BAA0B;CACtE,gBAAgB;EACd,iBAAiB;GAAE,UAAU;GAAG,MAAM;EAAU;EAChD,wBAAwB;GAAE,UAAU;GAAG,MAAM;EAAS;EACtD,aAAa;GAAE,UAAU;GAAO,MAAM;GAAU,SAAS;EAAK;CAChE;CACA,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EAAC;EAAK;EAAK;EAAM;CAAI;CAC5B,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;;;;ACzGA,SAAgB,uBACd,QAAqB,CAAC,GACC;CACvB,OAAO;EACL,GAAGA;EACH,QAAQ;GACN,GAAGA,qBAAiB;GACpB,GAAG,OAAO,KAAK,MAAM,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,SACtC,KAAK,WAAW,IAAI,IAAI,IAAI,KAAK,MAAM,CAAC,MAAM,IAChD;GACA,GAAG,OAAO,KAAK,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC,KACjC,SAAS,IAAI,SAAS,aAAa,cAAc,MACpD;EACF;EACA,OAAO,CAAC,GAAGA,qBAAiB,OAAO,GAAG,OAAO,KAAK,MAAM,SAAS,CAAC,CAAC,CAAC;EACpE,QAAQ,CAAC,GAAGA,qBAAiB,QAAQ,GAAG,OAAO,KAAK,MAAM,UAAU,CAAC,CAAC,CAAC;EACvE,SAAS,CAAC,GAAGA,qBAAiB,SAAS,GAAG,OAAO,KAAK,MAAM,WAAW,CAAC,CAAC,CAAC;EAC1E,SAAS,OAAO,KAAK,MAAM,WAAW,CAAC,CAAC;CAC1C;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m5 12 6 6"/><path d="m5 12 6-6"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m13 18 6-6"/><path d="m13 6 6 6"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12l5 5l10 -10"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 6 6 6-6 6"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18M6 6l12 12"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 9.667A2.667 2.667 0 0 1 9.667 7h8.666A2.667 2.667 0 0 1 21 9.667v8.666A2.667 2.667 0 0 1 18.333 21H9.667A2.667 2.667 0 0 1 7 18.333z"/><path d="M4.012 16.737A2.005 2.005 0 0 1 3 15V5c0-1.1.9-2 2-2h10c.75 0 1.158.385 1.5 1"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1zM7 20h10M9 16v4M15 16v4"/></svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
2
|
+
<rect width="64" height="64" rx="14" fill="#4b6dc3" />
|
|
3
|
+
<path
|
|
4
|
+
fill="#fff"
|
|
5
|
+
d="M14.8 16c6.7.2 12.3 2 16.7 5.4v28.4c-4.4-3.1-10-4.7-16.6-4.9a3 3 0 0 1-2.9-3V19a3 3 0 0 1 2.8-3Z"
|
|
6
|
+
/>
|
|
7
|
+
<path
|
|
8
|
+
fill="#fff"
|
|
9
|
+
d="M49.2 16c-6.7.2-12.3 2-16.7 5.4v28.4c4.4-3.1 10-4.7 16.6-4.9a3 3 0 0 0 2.9-3V19a3 3 0 0 0-2.8-3Z"
|
|
10
|
+
/>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h16M4 12h16M4 18h16"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3h.393a7.5 7.5 0 0 0 7.92 12.446A9 9 0 1 1 12 2.992z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3a9 9 0 1 0 0 18h1.5a2.5 2.5 0 0 0 1.8-4.2 1.5 1.5 0 0 1 1.1-2.6H18a3 3 0 0 0 3-3C21 6.7 17 3 12 3Z"/><circle cx="7.5" cy="10.5" r=".75" fill="currentColor" stroke="none"/><circle cx="10" cy="7" r=".75" fill="currentColor" stroke="none"/><circle cx="14" cy="7" r=".75" fill="currentColor" stroke="none"/><circle cx="17" cy="10" r=".75" fill="currentColor" stroke="none"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0"/><path d="m21 21-6-6"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 12a4 4 0 1 0 8 0 4 4 0 1 0-8 0M3 12h1m8-9v1m8 8h1m-9 8v1M5.6 5.6l.7.7m12.1-.7-.7.7m0 11.4.7.7m-12.1-.7-.7.7"/></svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ThemeConfig, ThemeTokens, TypographyPreset, resolveColorTheme } from "@tenphi/docs";
|
|
2
|
+
//#region src/theme/index.d.ts
|
|
3
|
+
interface ResolvedDocsTheme extends ReturnType<typeof resolveColorTheme> {
|
|
4
|
+
tokens: ThemeTokens;
|
|
5
|
+
presets: Record<string, TypographyPreset>;
|
|
6
|
+
}
|
|
7
|
+
declare function resolveDocsTheme(theme?: ThemeConfig): ResolvedDocsTheme;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { resolveDocsTheme as n, ResolvedDocsTheme as t };
|
|
10
|
+
//# sourceMappingURL=index-BuX_Sb5c.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BuX_Sb5c.d.ts","names":[],"sources":["../src/theme/index.ts"],"mappings":";;UASiB,0BAA0B,kBAClC;EAEP,QAAQ;EACR,SAAS,eAAe;;iBAGV,iBAAiB,QAAO,cAAmB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { n as resolveDocsTheme, t as ResolvedDocsTheme } from "./index-BuX_Sb5c.js";
|
|
2
|
+
import { DEFAULT_THEME_TOKENS, DEFAULT_TYPOGRAPHY_PRESETS } from "./theme/defaults.js";
|
|
3
|
+
import { DocsConfig, DocsEntry } from "@tenphi/docs";
|
|
4
|
+
import { AstroIntegration } from "astro";
|
|
5
|
+
//#region src/plugin-contract.d.ts
|
|
6
|
+
type FrontmatterSchema = {
|
|
7
|
+
parseAsync(value: unknown): Promise<Record<string, unknown>>;
|
|
8
|
+
} | {
|
|
9
|
+
parse(value: unknown): Record<string, unknown>;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/integration.d.ts
|
|
13
|
+
interface CookbookOptions {
|
|
14
|
+
config?: DocsConfig;
|
|
15
|
+
root?: string;
|
|
16
|
+
configFile?: string | false;
|
|
17
|
+
/** Validate custom metadata only; reserved routing/frontmatter fields cannot be changed. */
|
|
18
|
+
frontmatterSchema?: FrontmatterSchema;
|
|
19
|
+
}
|
|
20
|
+
declare function cookbook(options?: CookbookOptions): AstroIntegration;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { type CookbookOptions, DEFAULT_THEME_TOKENS, DEFAULT_TYPOGRAPHY_PRESETS, type ResolvedDocsTheme, cookbook as default, resolveDocsTheme };
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/plugin-contract.ts","../src/integration.ts"],"mappings":";;;;;KAEY;EAEN,WAAW,iBAAiB,QAAQ;;EAGpC,MAAM,iBAAiB;;;;UC6FZ;EACf,SAAS;EACT;EACA;;EAEA,oBAAoB;;iBAGE,SACtB,UAAS,kBACR"}
|