@fluxdown/solid 0.0.0-stage → 0.2.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.
Files changed (106) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +21 -0
  3. package/README.md +2 -2
  4. package/dist/cjs/assets/raw-Dob3BCyv.css +56 -0
  5. package/dist/cjs/chunks/raw-DlzW8_Im.cjs +609 -0
  6. package/dist/cjs/components/block-reconciler/index.d.cts +2 -0
  7. package/dist/cjs/components/block-reconciler/type.d.cts +22 -0
  8. package/dist/cjs/components/block-reconciler/utils.d.cts +2 -0
  9. package/dist/cjs/components/index.d.cts +2 -0
  10. package/dist/cjs/components/root-reconciler/index.d.cts +6 -0
  11. package/dist/cjs/consts/config.d.cts +2 -0
  12. package/dist/cjs/consts/defaults.d.cts +2 -0
  13. package/dist/cjs/consts/index.d.cts +4 -0
  14. package/dist/cjs/consts/smooth.d.cts +3 -0
  15. package/dist/cjs/consts/styles.d.cts +1 -0
  16. package/dist/cjs/context/index.d.cts +1 -0
  17. package/dist/cjs/context/render/index.d.cts +6 -0
  18. package/dist/cjs/env.d.cts +1 -0
  19. package/dist/cjs/full.browser.cjs +2 -0
  20. package/dist/cjs/full.cjs +13 -0
  21. package/dist/cjs/hooks/index.d.cts +1 -0
  22. package/dist/cjs/hooks/plugins.d.cts +6 -0
  23. package/dist/cjs/lite.browser.cjs +2 -0
  24. package/dist/cjs/lite.cjs +13 -0
  25. package/dist/cjs/modules/index.d.cts +1 -0
  26. package/dist/cjs/modules/solid-renderer/index.d.cts +9 -0
  27. package/dist/cjs/modules/solid-renderer/type.d.cts +4 -0
  28. package/dist/cjs/packs/full/index.d.cts +5 -0
  29. package/dist/cjs/packs/full/type.d.cts +3 -0
  30. package/dist/cjs/packs/lite/index.d.cts +5 -0
  31. package/dist/cjs/packs/lite/type.d.cts +3 -0
  32. package/dist/cjs/packs/raw/index.d.cts +5 -0
  33. package/dist/cjs/packs/raw/type.d.cts +77 -0
  34. package/dist/cjs/packs/raw/utils.d.cts +2 -0
  35. package/dist/cjs/packs/utils/config.d.cts +13 -0
  36. package/dist/cjs/packs/utils/effect.d.cts +4 -0
  37. package/dist/cjs/packs/utils/index.d.cts +3 -0
  38. package/dist/cjs/packs/utils/patches.d.cts +2 -0
  39. package/dist/cjs/raw.browser.cjs +2 -0
  40. package/dist/cjs/raw.cjs +3 -0
  41. package/dist/cjs/server/full.cjs +13 -0
  42. package/dist/cjs/server/lite.cjs +13 -0
  43. package/dist/cjs/server/raw.cjs +593 -0
  44. package/dist/cjs/styles.css +2 -0
  45. package/dist/cjs/theme/consts.d.cts +4 -0
  46. package/dist/cjs/theme/hooks.d.cts +2 -0
  47. package/dist/cjs/theme/index.d.cts +1 -0
  48. package/dist/cjs/theme/presets/base.d.cts +2 -0
  49. package/dist/cjs/theme/presets/dark.d.cts +2 -0
  50. package/dist/cjs/theme/presets/index.d.cts +4 -0
  51. package/dist/cjs/theme/presets/light.d.cts +2 -0
  52. package/dist/cjs/theme/utils.d.cts +4 -0
  53. package/dist/cjs/types/index.d.cts +2 -0
  54. package/dist/cjs/types/theme.d.cts +138 -0
  55. package/dist/esm/assets/raw-Dob3BCyv.css +56 -0
  56. package/dist/esm/chunks/raw-ULd4Y10B.js +598 -0
  57. package/dist/esm/components/block-reconciler/index.d.ts +2 -0
  58. package/dist/esm/components/block-reconciler/type.d.ts +22 -0
  59. package/dist/esm/components/block-reconciler/utils.d.ts +2 -0
  60. package/dist/esm/components/index.d.ts +2 -0
  61. package/dist/esm/components/root-reconciler/index.d.ts +6 -0
  62. package/dist/esm/consts/config.d.ts +2 -0
  63. package/dist/esm/consts/defaults.d.ts +2 -0
  64. package/dist/esm/consts/index.d.ts +4 -0
  65. package/dist/esm/consts/smooth.d.ts +3 -0
  66. package/dist/esm/consts/styles.d.ts +1 -0
  67. package/dist/esm/context/index.d.ts +1 -0
  68. package/dist/esm/context/render/index.d.ts +6 -0
  69. package/dist/esm/env.d.ts +1 -0
  70. package/dist/esm/full.browser.js +2 -0
  71. package/dist/esm/full.js +12 -0
  72. package/dist/esm/hooks/index.d.ts +1 -0
  73. package/dist/esm/hooks/plugins.d.ts +6 -0
  74. package/dist/esm/lite.browser.js +2 -0
  75. package/dist/esm/lite.js +12 -0
  76. package/dist/esm/modules/index.d.ts +1 -0
  77. package/dist/esm/modules/solid-renderer/index.d.ts +9 -0
  78. package/dist/esm/modules/solid-renderer/type.d.ts +4 -0
  79. package/dist/esm/packs/full/index.d.ts +5 -0
  80. package/dist/esm/packs/full/type.d.ts +3 -0
  81. package/dist/esm/packs/lite/index.d.ts +5 -0
  82. package/dist/esm/packs/lite/type.d.ts +3 -0
  83. package/dist/esm/packs/raw/index.d.ts +5 -0
  84. package/dist/esm/packs/raw/type.d.ts +77 -0
  85. package/dist/esm/packs/raw/utils.d.ts +2 -0
  86. package/dist/esm/packs/utils/config.d.ts +13 -0
  87. package/dist/esm/packs/utils/effect.d.ts +4 -0
  88. package/dist/esm/packs/utils/index.d.ts +3 -0
  89. package/dist/esm/packs/utils/patches.d.ts +2 -0
  90. package/dist/esm/raw.browser.js +2 -0
  91. package/dist/esm/raw.js +2 -0
  92. package/dist/esm/server/full.js +12 -0
  93. package/dist/esm/server/lite.js +12 -0
  94. package/dist/esm/server/raw.js +591 -0
  95. package/dist/esm/styles.css +2 -0
  96. package/dist/esm/theme/consts.d.ts +4 -0
  97. package/dist/esm/theme/hooks.d.ts +2 -0
  98. package/dist/esm/theme/index.d.ts +1 -0
  99. package/dist/esm/theme/presets/base.d.ts +2 -0
  100. package/dist/esm/theme/presets/dark.d.ts +2 -0
  101. package/dist/esm/theme/presets/index.d.ts +4 -0
  102. package/dist/esm/theme/presets/light.d.ts +2 -0
  103. package/dist/esm/theme/utils.d.ts +4 -0
  104. package/dist/esm/types/index.d.ts +2 -0
  105. package/dist/esm/types/theme.d.ts +138 -0
  106. package/package.json +121 -3
@@ -0,0 +1,6 @@
1
+ import type { IPluginItem } from '@fluxdown/solid-plugins/typings';
2
+ import type { Accessor } from 'solid-js';
3
+ type PluginChannel = Exclude<keyof IPluginItem, 'config'>;
4
+ export declare const createPlugins: <K extends PluginChannel>(items: Accessor<IPluginItem[]>, type: K) => Accessor<NonNullable<IPluginItem[K]>>;
5
+ export declare const createMergedPlugins: (presets: IPluginItem[], plugins: Accessor<IPluginItem | IPluginItem[] | undefined>) => Accessor<IPluginItem>;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ import './assets/raw-Dob3BCyv.css';
2
+ export * from './lite.js';
@@ -0,0 +1,12 @@
1
+ import { n as createMergedPlugins, t as FluxdownRaw } from "./chunks/raw-ULd4Y10B.js";
2
+ import { createComponent, mergeProps } from "solid-js/web";
3
+ import { PRESET_LITE_PLUGINS } from "@fluxdown/solid-plugins/lite";
4
+ //#region src/packs/lite/index.tsx
5
+ var FluxdownLite = (props) => {
6
+ const plugins = createMergedPlugins(PRESET_LITE_PLUGINS, () => props.plugins);
7
+ return createComponent(FluxdownRaw, mergeProps(props, { get plugins() {
8
+ return plugins();
9
+ } }));
10
+ };
11
+ //#endregion
12
+ export { FluxdownLite };
@@ -0,0 +1 @@
1
+ export * from './solid-renderer/index.js';
@@ -0,0 +1,9 @@
1
+ import type { SolidRenderExtraParams } from '@fluxdown/solid-plugins/base';
2
+ import type { IBlockState } from '@fluxdown/types';
3
+ import type { ElementContent, Parent, Root } from 'hast';
4
+ import type { JSX } from 'solid-js';
5
+ import { BaseRenderer } from '@fluxdown/core';
6
+ export type * from './type.js';
7
+ export declare class SolidRenderer extends BaseRenderer<Root, ElementContent, Parent, JSX.Element, SolidRenderExtraParams> {
8
+ protected renderItem(item: IBlockState<Root>): JSX.Element;
9
+ }
@@ -0,0 +1,4 @@
1
+ import type { BlockReconcilerProps } from '../../components/block-reconciler/type.js';
2
+ export interface SolidBlockElement extends BlockReconcilerProps {
3
+ key: string;
4
+ }
@@ -0,0 +1,5 @@
1
+ import type { FluxdownProps } from './type.js';
2
+ export type { BaseBuildConfig, EffectItem, FluxdownRawProps, FluxdownRef, SmoothConfig, StreamingConfig, } from '../raw/index.js';
3
+ export * from '../../types/index.js';
4
+ export * from './type.js';
5
+ export declare const Fluxdown: (props: FluxdownProps) => import("solid-js").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import type { PartialBy } from '@fluxdown/utils';
2
+ import type { FluxdownRawProps } from '../raw/index.js';
3
+ export type FluxdownProps = PartialBy<FluxdownRawProps, 'plugins'>;
@@ -0,0 +1,5 @@
1
+ import type { FluxdownLiteProps } from './type.js';
2
+ export type { BaseBuildConfig, EffectItem, FluxdownRawProps, FluxdownRef, SmoothConfig, StreamingConfig, } from '../raw/index.js';
3
+ export * from '../../types/index.js';
4
+ export * from './type.js';
5
+ export declare const FluxdownLite: (props: FluxdownLiteProps) => import("solid-js").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import type { PartialBy } from '@fluxdown/utils';
2
+ import type { FluxdownRawProps } from '../raw/index.js';
3
+ export type FluxdownLiteProps = PartialBy<FluxdownRawProps, 'plugins'>;
@@ -0,0 +1,5 @@
1
+ import type { JSX } from 'solid-js';
2
+ import type { FluxdownRawProps } from './type.js';
3
+ export * from '../../types/index.js';
4
+ export * from './type.js';
5
+ export declare const FluxdownRaw: (props: FluxdownRawProps) => JSX.Element;
@@ -0,0 +1,77 @@
1
+ import type { BlockCompilerConfig, IPatchItem, MapperPluggable } from '@fluxdown/core';
2
+ import type { SchedulerType, SmoothSchedulerClass, SmoothTickerClass, TickerType } from '@fluxdown/core-plugins/plugins/mapper/smooth';
3
+ import type { IPluginItem } from '@fluxdown/solid-plugins/typings';
4
+ import type { IPluggableConfig } from '@fluxdown/types';
5
+ import type { JSX } from 'solid-js';
6
+ import type { IReadableClosure } from 'stative';
7
+ import type { Theme } from '../../types/index.js';
8
+ export type BaseBuildConfig = Partial<Omit<BlockCompilerConfig, 'repairEnding'>>;
9
+ export type EffectItem = keyof EffectConfigs | {
10
+ [K in keyof EffectConfigs]: [K, IPluggableConfig<EffectConfigs[K]>];
11
+ }[keyof EffectConfigs] | MapperPluggable;
12
+ export interface SmoothConfig {
13
+ /**
14
+ * Reveal newly compiled content over successive ticks.
15
+ * @default false
16
+ */
17
+ enabled?: boolean;
18
+ /**
19
+ * Built-in timestamp source name or a custom ticker constructor.
20
+ */
21
+ ticker: TickerType | SmoothTickerClass;
22
+ /**
23
+ * Built-in progress scheduler name or a custom scheduler constructor.
24
+ */
25
+ scheduler: SchedulerType | SmoothSchedulerClass;
26
+ }
27
+ export interface StreamingConfig {
28
+ /**
29
+ * Repair incomplete Markdown syntax at the end of the document.
30
+ * @default true
31
+ */
32
+ repairEnding?: boolean;
33
+ /**
34
+ * Smoothly reveal appended compiled content.
35
+ * @default true
36
+ */
37
+ smooth?: boolean | SmoothConfig;
38
+ /**
39
+ * One effect or an ordered list of effects applied to newly revealed content.
40
+ * Set to true to enable the default scale entrance, or false to disable effects.
41
+ * @default 'scale'
42
+ */
43
+ effect?: boolean | EffectItem | EffectItem[];
44
+ }
45
+ export interface FluxdownRawProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children' | 'ref'> {
46
+ /**
47
+ * Receive the underlying readable Core instance.
48
+ */
49
+ ref?: (core: FluxdownRef) => void;
50
+ /**
51
+ * Markdown source text to compile and render.
52
+ */
53
+ text: string;
54
+ /**
55
+ * Static build configuration.
56
+ */
57
+ build?: BaseBuildConfig;
58
+ /**
59
+ * Streaming effect configuration.
60
+ * @default false
61
+ */
62
+ streaming?: boolean | StreamingConfig;
63
+ /**
64
+ * Inline render patches applied to the Markdown source.
65
+ */
66
+ patches?: IPatchItem<JSX.Element>[];
67
+ /**
68
+ * One plugin pack or an ordered list extending the compiler and Solid renderer.
69
+ */
70
+ plugins: IPluginItem | IPluginItem[];
71
+ /**
72
+ * Preset theme, deep partial overrides of light, or a preset/overrides tuple.
73
+ */
74
+ theme?: Theme;
75
+ }
76
+ /** Readable Core state containing internal renderer blocks. */
77
+ export type FluxdownRef = IReadableClosure<unknown[]>;
@@ -0,0 +1,2 @@
1
+ import type { JSX } from 'solid-js';
2
+ export declare const mergeStyles: (theme: JSX.CSSProperties, style: JSX.CSSProperties | string | undefined) => JSX.CSSProperties | string;
@@ -0,0 +1,13 @@
1
+ import type { BlockCompilerConfig } from '@fluxdown/core';
2
+ import type { BaseSmoothConfig, SchedulerType, SmoothSchedulerClass, SmoothTickerClass, TickerType } from '@fluxdown/core-plugins/plugins/mapper/smooth';
3
+ import type { BaseBuildConfig, SmoothConfig, StreamingConfig } from '../raw/type.js';
4
+ export interface ToBuildConfigParams {
5
+ base: BaseBuildConfig;
6
+ repairEnding: boolean;
7
+ idPrefix?: string;
8
+ }
9
+ export declare const getTickerByType: (type: TickerType | SmoothTickerClass) => SmoothTickerClass;
10
+ export declare const getSchedulerByType: (type: SchedulerType | SmoothSchedulerClass) => SmoothSchedulerClass;
11
+ export declare const toSmoothConfig: (config: boolean | SmoothConfig) => BaseSmoothConfig;
12
+ export declare const toStreamingConfig: (config?: boolean | StreamingConfig) => Required<StreamingConfig>;
13
+ export declare const toBuildConfig: ({ base, repairEnding, idPrefix, }: ToBuildConfigParams) => BlockCompilerConfig;
@@ -0,0 +1,4 @@
1
+ import type { Mapper, MapperPluggable } from '@fluxdown/core';
2
+ import type { EffectItem, StreamingConfig } from '../raw/type.js';
3
+ export declare const toEffects: (effect?: StreamingConfig['effect']) => EffectItem[];
4
+ export declare const toEffectMappers: (effects: EffectItem[], presets: Mapper[]) => MapperPluggable[];
@@ -0,0 +1,3 @@
1
+ export * from './config.js';
2
+ export * from './effect.js';
3
+ export * from './patches.js';
@@ -0,0 +1,2 @@
1
+ import type { IPatchItem } from '@fluxdown/core';
2
+ export declare const isPatchesEqual: <R>(left: IPatchItem<R>[], right: IPatchItem<R>[]) => boolean;
@@ -0,0 +1,2 @@
1
+ import './assets/raw-Dob3BCyv.css';
2
+ export * from './raw.js';
@@ -0,0 +1,2 @@
1
+ import { t as FluxdownRaw } from "./chunks/raw-ULd4Y10B.js";
2
+ export { FluxdownRaw };
@@ -0,0 +1,12 @@
1
+ import { FluxdownRaw, t as createMergedPlugins } from "./raw.js";
2
+ import { createComponent, mergeProps } from "solid-js/web";
3
+ import { PRESET_FULL_PLUGINS } from "@fluxdown/solid-plugins/full";
4
+ //#region src/packs/full/index.tsx
5
+ var Fluxdown = (props) => {
6
+ const plugins = createMergedPlugins(PRESET_FULL_PLUGINS, () => props.plugins);
7
+ return createComponent(FluxdownRaw, mergeProps(props, { get plugins() {
8
+ return plugins();
9
+ } }));
10
+ };
11
+ //#endregion
12
+ export { Fluxdown };
@@ -0,0 +1,12 @@
1
+ import { FluxdownRaw, t as createMergedPlugins } from "./raw.js";
2
+ import { createComponent, mergeProps } from "solid-js/web";
3
+ import { PRESET_LITE_PLUGINS } from "@fluxdown/solid-plugins/lite";
4
+ //#region src/packs/lite/index.tsx
5
+ var FluxdownLite = (props) => {
6
+ const plugins = createMergedPlugins(PRESET_LITE_PLUGINS, () => props.plugins);
7
+ return createComponent(FluxdownRaw, mergeProps(props, { get plugins() {
8
+ return plugins();
9
+ } }));
10
+ };
11
+ //#endregion
12
+ export { FluxdownLite };