@tenphi/docs 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,4 +27,4 @@ extraction root.
27
27
 
28
28
  Most applications should install `@tenphi/cookbook`, which combines this engine
29
29
  with the supported Astro/Starlight renderer. This package is useful for custom
30
- tooling, validation, and alternate renderers. Node.js 22.14 or newer is required.
30
+ tooling, validation, and alternate renderers. Node.js 22.19 or newer is required.
@@ -1,4 +1,4 @@
1
- import { A as NavigationConfig, B as SiteIconConfig, D as HeadConfig, E as EditLinkConfig, G as TypographyPreset, H as ThemePaletteConfig, K as TypographyPresets, M as NavigationPlacement, N as NavigationTab, O as LocaleConfig, P as NormalizedDocsConfig, R as SearchConfig, T as DocsSource, U as ThemeTokenValue, V as ThemeConfig, W as ThemeTokens, _ as DocsConfig, a as ComponentStyleConfig, c as ComponentsConfig, i as COOKBOOK_COMPONENT_SUB_ELEMENTS, j as NavigationItem, k as MarkdownConfig, l as ContentConfig, n as BuildConfig, o as ComponentStyles, r as COOKBOOK_COMPONENT_NAMES, s as ComponentStylesConfig, t as BrandConfig, u as CookbookComponentName, v as DocsDiagnostic, z as SiteConfig } from "../types-B-msp1dH.js";
1
+ import { $ as TypographyPresets, A as LocaleConfig, B as SearchConfig, D as EditLinkConfig, E as DocsSource, F as NavigationTab, G as ThemeFont, H as SiteIconConfig, I as NormalizedDocsConfig, J as ThemePaletteColor, K as ThemeFontFile, M as NavigationConfig, N as NavigationItem, O as HeadConfig, P as NavigationPlacement, Q as TypographyPreset, V as SiteConfig, W as ThemeConfig, X as ThemeTokenValue, Y as ThemePaletteConfig, Z as ThemeTokens, a as COOKBOOK_COMPONENT_SUB_ELEMENTS, c as ComponentStylesConfig, d as CookbookComponentName, i as COOKBOOK_COMPONENT_NAMES, j as MarkdownConfig, k as HeaderLink, l as ComponentsConfig, n as BrandDeclaration, o as ComponentStyleConfig, q as ThemeFonts, r as BuildConfig, s as ComponentStyles, t as BrandConfig, u as ContentConfig, v as DocsConfig, y as DocsDiagnostic } from "../types-C-AgUcAb.js";
2
2
  //#region src/config/index.d.ts
3
3
  declare class DocsConfigError extends Error {
4
4
  readonly diagnostics: DocsDiagnostic[];
@@ -7,8 +7,8 @@ declare class DocsConfigError extends Error {
7
7
  declare function validateConfig(config: DocsConfig): DocsDiagnostic[];
8
8
  declare function normalizeDocsConfig(config?: DocsConfig): NormalizedDocsConfig;
9
9
  declare function defineDocsConfig(config: DocsConfig): DocsConfig;
10
- /** Compose presets. Objects merge, arrays replace, and styles use Tasty semantics. */
10
+ /** Compose presets. Color roles and fonts replace, other objects merge, and styles use Tasty semantics. */
11
11
  declare function mergeDocsConfig(...configs: DocsConfig[]): DocsConfig;
12
12
  //#endregion
13
- export { type BrandConfig, type BuildConfig, COOKBOOK_COMPONENT_NAMES, COOKBOOK_COMPONENT_SUB_ELEMENTS, type ComponentStyleConfig, type ComponentStyles, type ComponentStylesConfig, type ComponentsConfig, type ContentConfig, type CookbookComponentName, type DocsConfig, DocsConfigError, type DocsSource, type EditLinkConfig, type HeadConfig, type LocaleConfig, type MarkdownConfig, type NavigationConfig, type NavigationItem, type NavigationPlacement, type NavigationTab, type NormalizedDocsConfig, type SearchConfig, type SiteConfig, type SiteIconConfig, type ThemeConfig, type ThemePaletteConfig, type ThemeTokenValue, type ThemeTokens, type TypographyPreset, type TypographyPresets, defineDocsConfig, mergeDocsConfig, normalizeDocsConfig, validateConfig };
13
+ export { type BrandConfig, type BrandDeclaration, type BuildConfig, COOKBOOK_COMPONENT_NAMES, COOKBOOK_COMPONENT_SUB_ELEMENTS, type ComponentStyleConfig, type ComponentStyles, type ComponentStylesConfig, type ComponentsConfig, type ContentConfig, type CookbookComponentName, type DocsConfig, DocsConfigError, type DocsSource, type EditLinkConfig, type HeadConfig, type HeaderLink, type LocaleConfig, type MarkdownConfig, type NavigationConfig, type NavigationItem, type NavigationPlacement, type NavigationTab, type NormalizedDocsConfig, type SearchConfig, type SiteConfig, type SiteIconConfig, type ThemeConfig, type ThemeFont, type ThemeFontFile, type ThemeFonts, type ThemePaletteColor, type ThemePaletteConfig, type ThemeTokenValue, type ThemeTokens, type TypographyPreset, type TypographyPresets, defineDocsConfig, mergeDocsConfig, normalizeDocsConfig, validateConfig };
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/config/index.ts"],"mappings":";;cAyEa,wBAAwB;WAC1B,aAAa;EAEtB,YAAY,aAAa;;iBAOX,eAAe,QAAQ,aAAa;iBA4iBpC,oBACd,SAAQ,aACP;iBA4Ca,iBAAiB,QAAQ,aAAa;;iBAOtC,mBAAmB,SAAS,eAAe"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/config/index.ts"],"mappings":";;cA8Fa,wBAAwB;WAC1B,aAAa;EAEtB,YAAY,aAAa;;iBAOX,eAAe,QAAQ,aAAa;iBA23BpC,oBACd,SAAQ,aACP;iBA4Ca,iBAAiB,QAAQ,aAAa;;iBAOtC,mBAAmB,SAAS,eAAe"}
@@ -1,2 +1,2 @@
1
- import { a as validateConfig, i as normalizeDocsConfig, n as defineDocsConfig, o as COOKBOOK_COMPONENT_NAMES, r as mergeDocsConfig, s as COOKBOOK_COMPONENT_SUB_ELEMENTS, t as DocsConfigError } from "../config-DoR8g9IM.js";
1
+ import { a as validateConfig, i as normalizeDocsConfig, n as defineDocsConfig, o as COOKBOOK_COMPONENT_NAMES, r as mergeDocsConfig, s as COOKBOOK_COMPONENT_SUB_ELEMENTS, t as DocsConfigError } from "../config-Ci9Nv0wQ.js";
2
2
  export { COOKBOOK_COMPONENT_NAMES, COOKBOOK_COMPONENT_SUB_ELEMENTS, DocsConfigError, defineDocsConfig, mergeDocsConfig, normalizeDocsConfig, validateConfig };
@@ -15,6 +15,19 @@
15
15
  "version": {
16
16
  "type": "string"
17
17
  },
18
+ "versions": {
19
+ "type": "array",
20
+ "minItems": 2,
21
+ "items": {
22
+ "type": "object",
23
+ "additionalProperties": false,
24
+ "required": ["label", "routeBase"],
25
+ "properties": {
26
+ "label": { "type": "string", "minLength": 1 },
27
+ "routeBase": { "type": "string", "pattern": "^/(?!/)" }
28
+ }
29
+ }
30
+ },
18
31
  "description": {
19
32
  "type": "string"
20
33
  },
@@ -48,6 +61,32 @@
48
61
  }
49
62
  }
50
63
  ]
64
+ },
65
+ "headerLinks": {
66
+ "type": "array",
67
+ "items": {
68
+ "type": "object",
69
+ "additionalProperties": false,
70
+ "required": ["label", "link"],
71
+ "properties": {
72
+ "label": {
73
+ "type": "string",
74
+ "minLength": 1,
75
+ "pattern": "\\S"
76
+ },
77
+ "link": {
78
+ "type": "string",
79
+ "pattern": "^(?:https?://[^\\s\\\\]+|/(?!/)[^\\s\\\\]*|#[^\\s\\\\]*)$"
80
+ },
81
+ "variant": {
82
+ "enum": ["default", "primary"]
83
+ },
84
+ "newTab": {
85
+ "type": "boolean",
86
+ "default": false
87
+ }
88
+ }
89
+ }
51
90
  }
52
91
  }
53
92
  },
@@ -153,18 +192,29 @@
153
192
  "type": "object",
154
193
  "additionalProperties": false,
155
194
  "properties": {
156
- "brand": {},
195
+ "brand": { "$ref": "#/$defs/brandColor" },
157
196
  "palette": {
158
197
  "type": "object",
159
198
  "additionalProperties": false,
160
199
  "properties": {
161
- "surface": {},
162
- "text": {},
163
- "textSoft": {},
164
- "info": {},
165
- "success": {},
166
- "warning": {},
167
- "danger": {}
200
+ "surface": { "$ref": "#/$defs/paletteColor" },
201
+ "text": { "$ref": "#/$defs/paletteColor" },
202
+ "textSoft": { "$ref": "#/$defs/paletteColor" },
203
+ "info": { "$ref": "#/$defs/paletteColor" },
204
+ "success": { "$ref": "#/$defs/paletteColor" },
205
+ "warning": { "$ref": "#/$defs/paletteColor" },
206
+ "danger": { "$ref": "#/$defs/paletteColor" },
207
+ "header": { "$ref": "#/$defs/paletteColor" },
208
+ "overlay": { "$ref": "#/$defs/paletteColor" }
209
+ }
210
+ },
211
+ "fonts": {
212
+ "type": "object",
213
+ "additionalProperties": false,
214
+ "properties": {
215
+ "body": { "$ref": "#/$defs/themeFont" },
216
+ "heading": { "$ref": "#/$defs/themeFont" },
217
+ "code": { "$ref": "#/$defs/themeFont" }
168
218
  }
169
219
  },
170
220
  "states": {
@@ -328,6 +378,14 @@
328
378
  }
329
379
  }
330
380
  },
381
+ "VersionSwitcher": {
382
+ "type": "object",
383
+ "propertyNames": {
384
+ "not": {
385
+ "const": "mode"
386
+ }
387
+ }
388
+ },
331
389
  "Preview": {
332
390
  "type": "object",
333
391
  "propertyNames": {
@@ -407,6 +465,54 @@
407
465
  "const": "mode"
408
466
  }
409
467
  }
468
+ },
469
+ "HeaderFrame": {
470
+ "type": "object",
471
+ "propertyNames": {
472
+ "not": {
473
+ "const": "mode"
474
+ }
475
+ }
476
+ },
477
+ "HeaderLinks": {
478
+ "type": "object",
479
+ "propertyNames": {
480
+ "not": {
481
+ "const": "mode"
482
+ }
483
+ }
484
+ },
485
+ "Layout": {
486
+ "type": "object",
487
+ "propertyNames": {
488
+ "not": {
489
+ "const": "mode"
490
+ }
491
+ }
492
+ },
493
+ "SearchButton": {
494
+ "type": "object",
495
+ "propertyNames": {
496
+ "not": {
497
+ "const": "mode"
498
+ }
499
+ }
500
+ },
501
+ "TableOfContentsLayout": {
502
+ "type": "object",
503
+ "propertyNames": {
504
+ "not": {
505
+ "const": "mode"
506
+ }
507
+ }
508
+ },
509
+ "PageFrame": {
510
+ "type": "object",
511
+ "propertyNames": {
512
+ "not": {
513
+ "const": "mode"
514
+ }
515
+ }
410
516
  }
411
517
  }
412
518
  },
@@ -533,6 +639,207 @@
533
639
  }
534
640
  },
535
641
  "$defs": {
642
+ "brandColor": {
643
+ "description": "A Glaze from declaration for the brand seed, optionally with APCA targets. Literal shorthand and structured hue, saturation, and tone are also supported.",
644
+ "oneOf": [
645
+ { "$ref": "#/$defs/glazeColorValue" },
646
+ {
647
+ "type": "object",
648
+ "additionalProperties": false,
649
+ "required": ["from"],
650
+ "properties": {
651
+ "from": { "$ref": "#/$defs/glazeColorValue" },
652
+ "contrast": { "$ref": "#/$defs/brandContrast" },
653
+ "unsafeContrast": { "type": "boolean" }
654
+ }
655
+ },
656
+ {
657
+ "type": "object",
658
+ "additionalProperties": false,
659
+ "required": ["hue", "saturation", "tone"],
660
+ "properties": {
661
+ "hue": { "type": "number", "minimum": 0, "maximum": 360 },
662
+ "saturation": { "type": "number", "minimum": 0, "maximum": 100 },
663
+ "tone": { "type": "number", "minimum": 0, "maximum": 100 },
664
+ "contrast": { "$ref": "#/$defs/brandContrast" },
665
+ "unsafeContrast": { "type": "boolean" }
666
+ }
667
+ }
668
+ ]
669
+ },
670
+ "brandContrast": {
671
+ "type": "object",
672
+ "additionalProperties": false,
673
+ "required": ["apca"],
674
+ "properties": {
675
+ "apca": {
676
+ "oneOf": [
677
+ { "type": "number" },
678
+ {
679
+ "type": "array",
680
+ "prefixItems": [{ "type": "number" }, { "type": "number" }],
681
+ "minItems": 2,
682
+ "maxItems": 2
683
+ }
684
+ ]
685
+ }
686
+ }
687
+ },
688
+ "paletteColor": {
689
+ "description": "A Glaze color declaration; literal colors are convenient seed shorthands.",
690
+ "oneOf": [
691
+ { "$ref": "#/$defs/glazeColorValue" },
692
+ { "$ref": "#/$defs/glazeDeclaration" }
693
+ ]
694
+ },
695
+ "glazeColorValue": {
696
+ "oneOf": [
697
+ { "type": "string" },
698
+ {
699
+ "type": "object",
700
+ "additionalProperties": false,
701
+ "required": ["h", "s", "l"],
702
+ "properties": {
703
+ "h": { "type": "number" },
704
+ "s": { "type": "number" },
705
+ "l": { "type": "number" }
706
+ }
707
+ },
708
+ {
709
+ "type": "object",
710
+ "additionalProperties": false,
711
+ "required": ["h", "s", "t"],
712
+ "properties": {
713
+ "h": { "type": "number" },
714
+ "s": { "type": "number" },
715
+ "t": { "type": "number" }
716
+ }
717
+ },
718
+ {
719
+ "type": "object",
720
+ "additionalProperties": false,
721
+ "required": ["r", "g", "b"],
722
+ "properties": {
723
+ "r": { "type": "number" },
724
+ "g": { "type": "number" },
725
+ "b": { "type": "number" }
726
+ }
727
+ },
728
+ {
729
+ "type": "object",
730
+ "additionalProperties": false,
731
+ "required": ["l", "c", "h"],
732
+ "properties": {
733
+ "l": { "type": "number" },
734
+ "c": { "type": "number" },
735
+ "h": { "type": "number" }
736
+ }
737
+ }
738
+ ]
739
+ },
740
+ "glazeDeclaration": {
741
+ "type": "object",
742
+ "additionalProperties": false,
743
+ "properties": {
744
+ "from": { "$ref": "#/$defs/glazeColorValue" },
745
+ "tone": {
746
+ "oneOf": [
747
+ { "type": "number", "minimum": 0, "maximum": 100 },
748
+ { "type": "string" },
749
+ {
750
+ "type": "array",
751
+ "prefixItems": [
752
+ { "oneOf": [{ "type": "number" }, { "type": "string" }] },
753
+ { "oneOf": [{ "type": "number" }, { "type": "string" }] }
754
+ ],
755
+ "minItems": 2,
756
+ "maxItems": 2
757
+ }
758
+ ]
759
+ },
760
+ "saturation": { "type": "number", "minimum": 0, "maximum": 1 },
761
+ "hue": { "oneOf": [{ "type": "number" }, { "type": "string" }] },
762
+ "darkHue": { "oneOf": [{ "type": "number" }, { "type": "string" }] },
763
+ "darkSaturation": { "type": "number", "minimum": 0, "maximum": 1 },
764
+ "base": { "type": "string" },
765
+ "contrast": {
766
+ "oneOf": [
767
+ { "type": "number" },
768
+ { "type": "string" },
769
+ {
770
+ "type": "array",
771
+ "minItems": 2,
772
+ "maxItems": 2
773
+ },
774
+ {
775
+ "type": "object",
776
+ "additionalProperties": false,
777
+ "properties": {
778
+ "apca": {},
779
+ "wcag": {}
780
+ }
781
+ }
782
+ ]
783
+ },
784
+ "mode": { "enum": ["auto", "fixed", "static"] },
785
+ "autoFlip": { "type": "boolean" },
786
+ "opacity": { "type": "number", "minimum": 0, "maximum": 1 },
787
+ "pastel": { "type": "boolean" },
788
+ "role": { "type": "string" },
789
+ "inherit": { "type": "boolean" }
790
+ }
791
+ },
792
+ "themeFont": {
793
+ "oneOf": [
794
+ { "type": "string", "minLength": 1 },
795
+ {
796
+ "type": "object",
797
+ "additionalProperties": false,
798
+ "required": ["google"],
799
+ "properties": {
800
+ "google": { "type": "string", "minLength": 1 },
801
+ "weights": {
802
+ "type": "array",
803
+ "minItems": 1,
804
+ "items": { "type": "integer", "minimum": 1, "maximum": 1000 }
805
+ }
806
+ }
807
+ },
808
+ {
809
+ "type": "object",
810
+ "additionalProperties": false,
811
+ "required": ["family", "files"],
812
+ "properties": {
813
+ "family": { "type": "string", "minLength": 1 },
814
+ "files": {
815
+ "type": "array",
816
+ "minItems": 1,
817
+ "items": {
818
+ "type": "object",
819
+ "additionalProperties": false,
820
+ "required": ["src"],
821
+ "properties": {
822
+ "src": {
823
+ "type": "string",
824
+ "pattern": "^/(?!/).+\\.(woff2?|ttf|otf)$"
825
+ },
826
+ "weight": {
827
+ "oneOf": [
828
+ { "type": "integer", "minimum": 1, "maximum": 1000 },
829
+ {
830
+ "type": "string",
831
+ "pattern": "^(?:[1-9][0-9]{0,2}|1000) (?:[1-9][0-9]{0,2}|1000)$"
832
+ }
833
+ ]
834
+ },
835
+ "style": { "enum": ["normal", "italic"] }
836
+ }
837
+ }
838
+ }
839
+ }
840
+ }
841
+ ]
842
+ },
536
843
  "locale": {
537
844
  "type": "object",
538
845
  "additionalProperties": false,
@@ -567,6 +874,14 @@
567
874
  "items": {
568
875
  "$ref": "#/$defs/navigationItem"
569
876
  }
877
+ },
878
+ "link": {
879
+ "type": "string",
880
+ "pattern": "^/(?!/)[^?#\\\\\\s]*$",
881
+ "description": "Optional parent page route, without a deployment base, query, or fragment.",
882
+ "not": {
883
+ "pattern": "//|(^|/)\\.{1,2}(/|$)"
884
+ }
570
885
  }
571
886
  }
572
887
  },
@@ -587,6 +902,14 @@
587
902
  "type": "string"
588
903
  }
589
904
  }
905
+ },
906
+ "link": {
907
+ "type": "string",
908
+ "pattern": "^/(?!/)[^?#\\\\\\s]*$",
909
+ "description": "Optional parent page route, without a deployment base, query, or fragment.",
910
+ "not": {
911
+ "pattern": "//|(^|/)\\.{1,2}(/|$)"
912
+ }
590
913
  }
591
914
  }
592
915
  },
@@ -780,6 +1103,17 @@
780
1103
  "format": "uri"
781
1104
  }
782
1105
  }
1106
+ },
1107
+ {
1108
+ "type": "object",
1109
+ "additionalProperties": false,
1110
+ "required": ["openapi"],
1111
+ "properties": {
1112
+ "openapi": { "type": "string", "minLength": 1 },
1113
+ "id": { "type": "string", "pattern": "^[a-zA-Z0-9_-]+$" },
1114
+ "root": { "type": "string" },
1115
+ "routeBase": { "type": "string" }
1116
+ }
783
1117
  }
784
1118
  ]
785
1119
  },