@purview-dev/astroc4 1.0.0-prerelease.4 → 1.0.0-prerelease.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +222 -77
- package/dist/expressive-code.d.ts +0 -4
- package/dist/expressive-code.js.map +5 -5
- package/dist/fences.d.ts +45 -16
- package/dist/file-layout.d.ts +4 -0
- package/dist/grammar/langium.d.ts +0 -4
- package/dist/grammar/source.d.ts +0 -12
- package/dist/grammar/textmate.d.ts +0 -2
- package/dist/icon-assets.d.ts +28 -0
- package/dist/icon-plugin.d.ts +16 -0
- package/dist/index.d.ts +21 -43
- package/dist/index.js +707 -97
- package/dist/index.js.map +15 -9
- package/dist/integration.d.ts +27 -0
- package/dist/integration.js +827 -0
- package/dist/integration.js.map +17 -0
- package/dist/projects.d.ts +24 -0
- package/dist/translations.d.ts +1 -0
- package/dist/workspace.d.ts +5 -0
- package/package.json +24 -4
- package/src/components/DiagramFrame.astro +14 -16
- package/src/components/DiagramShell.astro +19 -20
- package/src/components/ErrorBoundary.tsx +1 -5
- package/src/components/LikeC4Fence.astro +3 -6
- package/src/components/LikeC4InlineView.tsx +6 -16
- package/src/components/LikeC4ProjectView.tsx +0 -5
- package/src/components/LikeC4View.astro +75 -21
- package/src/components/LoadingPlaceholder.astro +10 -9
- package/src/components/icon-source.ts +5 -22
- package/src/components/labels.ts +10 -16
- package/src/components/md-fences.tsx +37 -0
- package/src/components/render-icon.tsx +0 -9
- package/src/components/utils.ts +40 -7
- package/src/translations.ts +3 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,64 +1,42 @@
|
|
|
1
1
|
import type { StarlightPlugin } from '@astrojs/starlight/types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
2
|
+
import type { AstroIntegration } from 'astro';
|
|
3
|
+
import { missingOptimizedDependencies } from './integration.js';
|
|
4
|
+
import type { LikeC4IntegrationOptions } from './integration.js';
|
|
5
|
+
export { missingOptimizedDependencies };
|
|
7
6
|
export interface LikeC4HighlightingOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Branch, tag or commit SHA to read `like-c4.langium` from.
|
|
10
|
-
* Defaults to `main`; pin a tag (`v1.59.4`) or a SHA for reproducible CI.
|
|
11
|
-
* Also read from `ASTROC4_REF`.
|
|
12
|
-
*/
|
|
7
|
+
/** Branch, tag or commit SHA of `likec4/likec4`. Defaults to `main`; also `ASTROC4_REF`. */
|
|
13
8
|
ref?: string;
|
|
14
|
-
/**
|
|
9
|
+
/** Defaults to `likec4/likec4`. */
|
|
15
10
|
repo?: string;
|
|
16
11
|
/** Use the bundled snapshot and never touch the network. Also `ASTROC4_OFFLINE=1`. */
|
|
17
12
|
offline?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* What to do when the grammar cannot be fetched. Defaults to `fail`, so
|
|
20
|
-
* `astro build` and `astro check` fail like any other build error.
|
|
21
|
-
* A `ref` that does not exist always fails.
|
|
22
|
-
*/
|
|
13
|
+
/** When the grammar cannot be fetched. Defaults to `fail`; a `ref` that does not exist always fails. */
|
|
23
14
|
onError?: 'fail' | 'warn' | 'silent';
|
|
24
|
-
/** Seconds a cached fetch stays fresh. Defaults to
|
|
15
|
+
/** Seconds a cached fetch stays fresh. Defaults to 3600. */
|
|
25
16
|
cacheTtl?: number;
|
|
26
17
|
/** Ignore the cache and refetch. */
|
|
27
18
|
refresh?: boolean;
|
|
28
|
-
/**
|
|
19
|
+
/** Defaults to `node_modules/.cache/astroc4`. */
|
|
29
20
|
cacheDir?: string;
|
|
30
|
-
/** Raw host to read from
|
|
21
|
+
/** Raw host to read from. Defaults to `https://raw.githubusercontent.com`. */
|
|
31
22
|
baseUrl?: string;
|
|
32
23
|
/** Request timeout in milliseconds. Defaults to 15000. */
|
|
33
24
|
timeout?: number;
|
|
34
25
|
}
|
|
35
|
-
export interface StarlightLikeC4Options {
|
|
36
|
-
/**
|
|
37
|
-
* Passed through to `LikeC4VitePlugin` — e.g. `{ workspace: 'diagrams' }` to
|
|
38
|
-
* look for .c4 files somewhere other than the site root.
|
|
39
|
-
*/
|
|
40
|
-
vitePlugin?: Parameters<typeof LikeC4VitePlugin>[0];
|
|
41
|
-
/** Render ```likec4 fences in .mdx pages as diagrams. Defaults to `true`. */
|
|
42
|
-
fences?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Highlight ```c4 / ```likec4 source. Defaults to `true`; `false` leaves
|
|
45
|
-
* Expressive Code entirely to the site.
|
|
46
|
-
*/
|
|
26
|
+
export interface StarlightLikeC4Options extends LikeC4IntegrationOptions {
|
|
27
|
+
/** Highlight ```c4 / ```likec4 source. Defaults to `true`; `false` leaves Expressive Code to the site. */
|
|
47
28
|
highlighting?: boolean | LikeC4HighlightingOptions;
|
|
48
29
|
}
|
|
49
|
-
export default function starlightLikeC4(options?: StarlightLikeC4Options): StarlightPlugin;
|
|
50
30
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
* Expressive Code
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @param expressiveCode The site's `expressiveCode` option.
|
|
61
|
-
* @param registration Shiki language registration.
|
|
31
|
+
* A Starlight plugin and an Astro integration in one object. The hook sets are
|
|
32
|
+
* disjoint, so `astro add`'s `integrations: [astroc4()]` works too.
|
|
33
|
+
*/
|
|
34
|
+
export type LikeC4StarlightPlugin = StarlightPlugin & Pick<AstroIntegration, 'hooks'>;
|
|
35
|
+
export default function starlightLikeC4(options?: StarlightLikeC4Options): LikeC4StarlightPlugin;
|
|
36
|
+
/**
|
|
37
|
+
* The site's Expressive Code options plus the LikeC4 language. Starlight's
|
|
38
|
+
* `updateConfig` merges shallowly, so existing options are carried over; an
|
|
39
|
+
* existing LikeC4 entry is replaced so the configured ref wins.
|
|
62
40
|
*/
|
|
63
41
|
export declare function withLikeC4Language(expressiveCode: unknown, registration: Record<string, unknown>): Record<string, unknown> & {
|
|
64
42
|
shiki: {
|