@barodoc/core 1.0.0 → 2.0.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.
@@ -35,6 +35,19 @@ var topbarSchema = z.object({
35
35
  var searchSchema = z.object({
36
36
  enabled: z.boolean().optional()
37
37
  }).optional();
38
+ var lineNumbersSchema = z.boolean().optional();
39
+ var editLinkSchema = z.object({
40
+ baseUrl: z.string()
41
+ }).optional();
42
+ var announcementSchema = z.object({
43
+ text: z.string(),
44
+ link: z.string().optional(),
45
+ dismissible: z.boolean().optional()
46
+ }).optional();
47
+ var feedbackSchema = z.object({
48
+ enabled: z.boolean(),
49
+ endpoint: z.string().optional()
50
+ }).optional();
38
51
  var pluginConfigSchema = z.union([
39
52
  z.string(),
40
53
  z.tuple([z.string(), z.record(z.unknown())])
@@ -43,11 +56,18 @@ var barodocConfigSchema = z.object({
43
56
  name: z.string(),
44
57
  logo: z.string().optional(),
45
58
  favicon: z.string().optional(),
59
+ site: z.string().optional(),
60
+ base: z.string().optional(),
46
61
  theme: themeConfigSchema,
47
62
  i18n: i18nConfigSchema,
48
63
  navigation: z.array(navItemSchema),
49
64
  topbar: topbarSchema,
50
65
  search: searchSchema,
66
+ lineNumbers: lineNumbersSchema,
67
+ editLink: editLinkSchema,
68
+ lastUpdated: z.boolean().optional(),
69
+ announcement: announcementSchema,
70
+ feedback: feedbackSchema,
51
71
  plugins: z.array(pluginConfigSchema).optional(),
52
72
  customCss: z.array(z.string()).optional()
53
73
  });
@@ -1,11 +1,13 @@
1
1
  import { z } from 'zod';
2
- import { R as ResolvedBarodocConfig, a as BarodocConfig } from '../types-DaMSwPOk.js';
2
+ import { R as ResolvedBarodocConfig, a as BarodocConfig } from '../types-EzD7o05V.js';
3
3
  import 'astro';
4
4
 
5
5
  declare const barodocConfigSchema: z.ZodObject<{
6
6
  name: z.ZodString;
7
7
  logo: z.ZodOptional<z.ZodString>;
8
8
  favicon: z.ZodOptional<z.ZodString>;
9
+ site: z.ZodOptional<z.ZodString>;
10
+ base: z.ZodOptional<z.ZodString>;
9
11
  theme: z.ZodOptional<z.ZodObject<{
10
12
  colors: z.ZodOptional<z.ZodObject<{
11
13
  primary: z.ZodOptional<z.ZodString>;
@@ -122,6 +124,38 @@ declare const barodocConfigSchema: z.ZodObject<{
122
124
  }, {
123
125
  enabled?: boolean | undefined;
124
126
  }>>;
127
+ lineNumbers: z.ZodOptional<z.ZodBoolean>;
128
+ editLink: z.ZodOptional<z.ZodObject<{
129
+ baseUrl: z.ZodString;
130
+ }, "strip", z.ZodTypeAny, {
131
+ baseUrl: string;
132
+ }, {
133
+ baseUrl: string;
134
+ }>>;
135
+ lastUpdated: z.ZodOptional<z.ZodBoolean>;
136
+ announcement: z.ZodOptional<z.ZodObject<{
137
+ text: z.ZodString;
138
+ link: z.ZodOptional<z.ZodString>;
139
+ dismissible: z.ZodOptional<z.ZodBoolean>;
140
+ }, "strip", z.ZodTypeAny, {
141
+ text: string;
142
+ link?: string | undefined;
143
+ dismissible?: boolean | undefined;
144
+ }, {
145
+ text: string;
146
+ link?: string | undefined;
147
+ dismissible?: boolean | undefined;
148
+ }>>;
149
+ feedback: z.ZodOptional<z.ZodObject<{
150
+ enabled: z.ZodBoolean;
151
+ endpoint: z.ZodOptional<z.ZodString>;
152
+ }, "strip", z.ZodTypeAny, {
153
+ enabled: boolean;
154
+ endpoint?: string | undefined;
155
+ }, {
156
+ enabled: boolean;
157
+ endpoint?: string | undefined;
158
+ }>>;
125
159
  plugins: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>], null>]>, "many">>;
126
160
  customCss: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
127
161
  }, "strip", z.ZodTypeAny, {
@@ -132,6 +166,8 @@ declare const barodocConfigSchema: z.ZodObject<{
132
166
  }, z.ZodTypeAny, "passthrough">[];
133
167
  logo?: string | undefined;
134
168
  favicon?: string | undefined;
169
+ site?: string | undefined;
170
+ base?: string | undefined;
135
171
  theme?: {
136
172
  colors?: {
137
173
  primary?: string | undefined;
@@ -162,6 +198,20 @@ declare const barodocConfigSchema: z.ZodObject<{
162
198
  search?: {
163
199
  enabled?: boolean | undefined;
164
200
  } | undefined;
201
+ lineNumbers?: boolean | undefined;
202
+ editLink?: {
203
+ baseUrl: string;
204
+ } | undefined;
205
+ lastUpdated?: boolean | undefined;
206
+ announcement?: {
207
+ text: string;
208
+ link?: string | undefined;
209
+ dismissible?: boolean | undefined;
210
+ } | undefined;
211
+ feedback?: {
212
+ enabled: boolean;
213
+ endpoint?: string | undefined;
214
+ } | undefined;
165
215
  plugins?: (string | [string, Record<string, unknown>])[] | undefined;
166
216
  customCss?: string[] | undefined;
167
217
  }, {
@@ -172,6 +222,8 @@ declare const barodocConfigSchema: z.ZodObject<{
172
222
  }, z.ZodTypeAny, "passthrough">[];
173
223
  logo?: string | undefined;
174
224
  favicon?: string | undefined;
225
+ site?: string | undefined;
226
+ base?: string | undefined;
175
227
  theme?: {
176
228
  colors?: {
177
229
  primary?: string | undefined;
@@ -202,6 +254,20 @@ declare const barodocConfigSchema: z.ZodObject<{
202
254
  search?: {
203
255
  enabled?: boolean | undefined;
204
256
  } | undefined;
257
+ lineNumbers?: boolean | undefined;
258
+ editLink?: {
259
+ baseUrl: string;
260
+ } | undefined;
261
+ lastUpdated?: boolean | undefined;
262
+ announcement?: {
263
+ text: string;
264
+ link?: string | undefined;
265
+ dismissible?: boolean | undefined;
266
+ } | undefined;
267
+ feedback?: {
268
+ enabled: boolean;
269
+ endpoint?: string | undefined;
270
+ } | undefined;
205
271
  plugins?: (string | [string, Record<string, unknown>])[] | undefined;
206
272
  customCss?: string[] | undefined;
207
273
  }>;
@@ -2,7 +2,7 @@ import {
2
2
  barodocConfigSchema,
3
3
  getConfigDefaults,
4
4
  loadConfig
5
- } from "../chunk-UNDAI47C.js";
5
+ } from "../chunk-TOOKPXGT.js";
6
6
  export {
7
7
  barodocConfigSchema,
8
8
  getConfigDefaults,
@@ -1,4 +1,4 @@
1
- import { b as BarodocI18nConfig, c as BarodocNavItem } from '../types-DaMSwPOk.js';
1
+ import { b as BarodocI18nConfig, c as BarodocNavItem } from '../types-EzD7o05V.js';
2
2
  import 'astro';
3
3
 
4
4
  declare function getLocaleFromPath(path: string, i18n: BarodocI18nConfig): string;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AstroIntegration } from 'astro';
2
- import { B as BarodocOptions } from './types-DaMSwPOk.js';
3
- export { a as BarodocConfig, b as BarodocI18nConfig, c as BarodocNavItem, d as BarodocPlugin, e as BarodocPluginFactory, f as BarodocPluginHooks, g as BarodocThemeColors, h as BarodocThemeConfig, i as BuildContext, C as ContentContext, P as PluginConfig, j as PluginContext, R as ResolvedBarodocConfig, k as ResolvedPlugin, T as ThemeExport } from './types-DaMSwPOk.js';
2
+ import { B as BarodocOptions } from './types-EzD7o05V.js';
3
+ export { a as BarodocConfig, b as BarodocI18nConfig, c as BarodocNavItem, d as BarodocPlugin, e as BarodocPluginFactory, f as BarodocPluginHooks, g as BarodocThemeColors, h as BarodocThemeConfig, i as BuildContext, C as ContentContext, P as PluginConfig, j as PluginContext, R as ResolvedBarodocConfig, k as ResolvedPlugin, T as ThemeExport } from './types-EzD7o05V.js';
4
4
  export { barodocConfigSchema, loadConfig } from './config/index.js';
5
5
  export { getLocaleFromPath, getLocaleLabel, getLocalizedNavGroup, getLocalizedPath, removeLocaleFromPath } from './i18n/index.js';
6
6
  export { definePlugin, getPluginIntegrations, loadPlugins, runConfigHook, runHook } from './plugins/index.js';
package/dist/index.js CHANGED
@@ -1,3 +1,7 @@
1
+ import {
2
+ barodocConfigSchema,
3
+ loadConfig
4
+ } from "./chunk-TOOKPXGT.js";
1
5
  import {
2
6
  getLocaleFromPath,
3
7
  getLocaleLabel,
@@ -12,10 +16,6 @@ import {
12
16
  runConfigHook,
13
17
  runHook
14
18
  } from "./chunk-UICDSNBG.js";
15
- import {
16
- barodocConfigSchema,
17
- loadConfig
18
- } from "./chunk-UNDAI47C.js";
19
19
 
20
20
  // src/integration.ts
21
21
  var VIRTUAL_CONFIG_ID = "virtual:barodoc/config";
@@ -84,7 +84,7 @@ function barodoc(options) {
84
84
  defaultLocale: "en",
85
85
  locales: ["en"]
86
86
  };
87
- const themeIntegration = options.theme.integration();
87
+ const themeIntegration = options.theme.integration(resolvedConfig);
88
88
  const pluginIntegrations = getPluginIntegrations(plugins, pluginContext);
89
89
  updateConfig({
90
90
  vite: {
@@ -1,5 +1,5 @@
1
- import { k as ResolvedPlugin, j as PluginContext, P as PluginConfig, R as ResolvedBarodocConfig, f as BarodocPluginHooks, d as BarodocPlugin } from '../types-DaMSwPOk.js';
2
- export { e as BarodocPluginFactory, i as BuildContext, C as ContentContext } from '../types-DaMSwPOk.js';
1
+ import { k as ResolvedPlugin, j as PluginContext, P as PluginConfig, R as ResolvedBarodocConfig, f as BarodocPluginHooks, d as BarodocPlugin } from '../types-EzD7o05V.js';
2
+ export { e as BarodocPluginFactory, i as BuildContext, C as ContentContext } from '../types-EzD7o05V.js';
3
3
  import * as astro from 'astro';
4
4
 
5
5
  /**
@@ -117,6 +117,8 @@ interface BarodocConfig {
117
117
  name: string;
118
118
  logo?: string;
119
119
  favicon?: string;
120
+ site?: string;
121
+ base?: string;
120
122
  theme?: BarodocThemeConfig;
121
123
  i18n?: BarodocI18nConfig;
122
124
  navigation: BarodocNavItem[];
@@ -128,12 +130,31 @@ interface BarodocConfig {
128
130
  search?: {
129
131
  enabled?: boolean;
130
132
  };
133
+ /** When true, code blocks render with line numbers. */
134
+ lineNumbers?: boolean;
135
+ /** GitHub edit link base URL for "Edit this page" links. */
136
+ editLink?: {
137
+ baseUrl: string;
138
+ };
139
+ /** When true, shows git-based last updated timestamp on each page. */
140
+ lastUpdated?: boolean;
141
+ /** Top-of-page announcement banner. */
142
+ announcement?: {
143
+ text: string;
144
+ link?: string;
145
+ dismissible?: boolean;
146
+ };
147
+ /** Page feedback widget ("Was this helpful?"). */
148
+ feedback?: {
149
+ enabled: boolean;
150
+ endpoint?: string;
151
+ };
131
152
  plugins?: PluginConfig[];
132
153
  customCss?: string[];
133
154
  }
134
155
  interface ThemeExport {
135
156
  name: string;
136
- integration: () => AstroIntegration;
157
+ integration: (config: ResolvedBarodocConfig) => AstroIntegration;
137
158
  pages?: Record<string, () => Promise<unknown>>;
138
159
  layouts?: Record<string, () => Promise<unknown>>;
139
160
  components?: Record<string, () => Promise<unknown>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barodoc/core",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "Core integration for Barodoc documentation framework",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",