@rspress/shared 0.0.0-nightly-20230915160133 → 0.0.1

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/dist/index.d.ts CHANGED
@@ -2,52 +2,6 @@ import { BuilderConfig } from '@modern-js/builder-rspack-provider';
2
2
  import { PluggableList } from 'unified';
3
3
  import { BuilderPlugin } from '@modern-js/builder';
4
4
 
5
- interface ZoomOptions {
6
- /**
7
- * The space outside the zoomed image.
8
- *
9
- * @default 0
10
- */
11
- margin?: number
12
-
13
- /**
14
- * The background of the overlay.
15
- *
16
- * @default '#fff'
17
- */
18
- background?: string
19
-
20
- /**
21
- * The number of pixels to scroll to close the zoom.
22
- *
23
- * @default 40
24
- */
25
- scrollOffset?: number
26
-
27
- /**
28
- * The viewport to render the zoom in.
29
- *
30
- * @default null
31
- */
32
- container?: string | HTMLElement | ZoomContainer
33
-
34
- /**
35
- * The template element to display on zoom.
36
- *
37
- * @default null
38
- */
39
- template?: string | HTMLTemplateElement
40
- }
41
-
42
- interface ZoomContainer {
43
- width?: number
44
- height?: number
45
- top?: number
46
- bottom?: number
47
- right?: number
48
- left?: number
49
- }
50
-
51
5
  interface Config$1 {
52
6
  /**
53
7
  * Whether to enable dark mode.
@@ -151,7 +105,7 @@ interface LocaleConfig {
151
105
  nextPageText?: string;
152
106
  langRoutePrefix?: string;
153
107
  }
154
- type NavItem = NavItemWithLink | NavItemWithChildren | NavItemWithLinkAndChildren;
108
+ type NavItem = NavItemWithLink | NavItemWithChildren;
155
109
  type NavItemWithLink = {
156
110
  text: string;
157
111
  link: string;
@@ -162,15 +116,7 @@ type NavItemWithLink = {
162
116
  interface NavItemWithChildren {
163
117
  text?: string;
164
118
  tag?: string;
165
- items: NavItem[];
166
- position?: 'left' | 'right';
167
- }
168
- interface NavItemWithLinkAndChildren {
169
- text: string;
170
- link: string;
171
- items: NavItem[];
172
- tag?: string;
173
- activeMatch?: string;
119
+ items: (NavItemWithChildren | NavItemWithLink)[];
174
120
  position?: 'left' | 'right';
175
121
  }
176
122
  type Image = string | {
@@ -284,7 +230,7 @@ interface RspressPlugin {
284
230
  /**
285
231
  * Inject global components.
286
232
  */
287
- globalUIComponents?: (string | [string, object])[];
233
+ globalUIComponents?: string[];
288
234
  /**
289
235
  * Modify doc config.
290
236
  */
@@ -435,7 +381,7 @@ interface UserConfig<ThemeConfig = Config$1> {
435
381
  /**
436
382
  * Global components
437
383
  */
438
- globalUIComponents?: (string | [string, object])[];
384
+ globalUIComponents?: string[];
439
385
  /**
440
386
  * Global styles, is a Absolute path
441
387
  */
@@ -449,7 +395,6 @@ interface UserConfig<ThemeConfig = Config$1> {
449
395
  */
450
396
  mediumZoom?: boolean | {
451
397
  selector?: string;
452
- options?: ZoomOptions;
453
398
  };
454
399
  /**
455
400
  * Add some extra builder plugins
@@ -601,9 +546,8 @@ type Config = UserConfig | Promise<UserConfig> | ((env: any) => UserConfig | Pro
601
546
  declare const QUERY_REGEXP: RegExp;
602
547
  declare const HASH_REGEXP: RegExp;
603
548
  declare const MDX_REGEXP: RegExp;
604
- declare const APPEARANCE_KEY = "rspress-theme-appearance";
549
+ declare const APPEARANCE_KEY = "modern-theme-appearance";
605
550
  declare const SEARCH_INDEX_NAME = "search_index";
606
- declare const RSPRESS_TEMP_DIR = ".rspress";
607
551
  declare const isSCM: () => boolean;
608
552
  declare const isProduction: () => boolean;
609
553
  declare const isDebugMode: () => boolean;
@@ -632,4 +576,4 @@ declare function removeBase(url: string, base: string): string;
632
576
  declare function withoutHash(url: string): string;
633
577
  declare const mergeDocConfig: (...configs: UserConfig[]) => UserConfig;
634
578
 
635
- export { APPEARANCE_KEY, AdditionalPage, BaseRuntimePageInfo, Config, Config$1 as DefaultThemeConfig, DocFooter, EditLink, Feature, Footer, FrontMatterMeta, HASH_REGEXP, Header, Hero, Image, LocalSearchOptions, Locale, LocaleConfig, LocaleLink, LocaleLinks, MDX_REGEXP, MarkdownOptions, NavItem, NavItemWithChildren, NavItemWithLink, NavItemWithLinkAndChildren, NormalizedConfig, NormalizedConfig as NormalizedDefaultThemeConfig, NormalizedLocales, NormalizedSidebar, NormalizedSidebarGroup, PageData, PageIndexInfo, PageModule, PageType, RspressPlugin as Plugin, QUERY_REGEXP, RSPRESS_TEMP_DIR, RemotePageInfo, RemoteSearchIndexInfo, RemoteSearchOptions, ReplaceRule, Route, RouteMeta, RouteOptions, RspressPlugin, SEARCH_INDEX_NAME, SearchHooks, SearchOptions, Sidebar, SidebarGroup, SidebarItem, SiteData, SocialLink, SocialLinkIcon, UserConfig, addLeadingSlash, cleanUrl, inBrowser, isDebugMode, isExternalUrl, isProduction, isSCM, mergeDocConfig, normalizeHref, normalizePosixPath, normalizeSlash, omit, parseUrl, removeBase, removeLeadingSlash, removeTrailingSlash, replaceLang, slash, withBase, withoutBase, withoutHash, withoutLang };
579
+ export { APPEARANCE_KEY, AdditionalPage, BaseRuntimePageInfo, Config, Config$1 as DefaultThemeConfig, DocFooter, EditLink, Feature, Footer, FrontMatterMeta, HASH_REGEXP, Header, Hero, Image, LocalSearchOptions, Locale, LocaleConfig, LocaleLink, LocaleLinks, MDX_REGEXP, MarkdownOptions, NavItem, NavItemWithChildren, NavItemWithLink, NormalizedConfig, NormalizedConfig as NormalizedDefaultThemeConfig, NormalizedLocales, NormalizedSidebar, NormalizedSidebarGroup, PageData, PageIndexInfo, PageModule, PageType, QUERY_REGEXP, RemotePageInfo, RemoteSearchIndexInfo, RemoteSearchOptions, ReplaceRule, Route, RouteMeta, RouteOptions, RspressPlugin, SEARCH_INDEX_NAME, SearchHooks, SearchOptions, Sidebar, SidebarGroup, SidebarItem, SiteData, SocialLink, SocialLinkIcon, UserConfig, addLeadingSlash, cleanUrl, inBrowser, isDebugMode, isExternalUrl, isProduction, isSCM, mergeDocConfig, normalizeHref, normalizePosixPath, normalizeSlash, omit, parseUrl, removeBase, removeLeadingSlash, removeTrailingSlash, replaceLang, slash, withBase, withoutBase, withoutHash, withoutLang };