@bemedev/mind-flow 0.3.1 → 1.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.
- package/README.md +55 -12
- package/lib/helpers/clamp.d.ts +2 -0
- package/lib/helpers/clamp.d.ts.map +1 -0
- package/lib/helpers/createContext.d.ts +1 -1
- package/lib/helpers/createContext.d.ts.map +1 -1
- package/lib/helpers/index.d.ts +3 -0
- package/lib/helpers/index.d.ts.map +1 -0
- package/lib/index.cjs.js +1 -1
- package/lib/index.d.ts +9 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.es.js +2543 -448
- package/lib/output.css +1 -1
- package/lib/server.cjs.js +1129 -397
- package/lib/server.es.js +1095 -407
- package/lib/services/main.machine.d.ts +2453 -576
- package/lib/services/main.machine.d.ts.map +1 -1
- package/lib/services/main.machine.data.d.ts +14 -1
- package/lib/services/main.machine.data.d.ts.map +1 -1
- package/lib/services/main.machine.helpers.d.ts +1 -1
- package/lib/services/main.machine.helpers.d.ts.map +1 -1
- package/lib/services/main.machine.test.d.ts +2 -0
- package/lib/services/main.machine.test.d.ts.map +1 -0
- package/lib/services/main.machine.typings.d.ts +26 -8
- package/lib/services/main.machine.typings.d.ts.map +1 -1
- package/lib/ui/Flow.d.ts +8 -4
- package/lib/ui/Flow.d.ts.map +1 -1
- package/lib/ui/components/Bounds.d.ts.map +1 -1
- package/lib/ui/components/EdgeComponent.d.ts.map +1 -1
- package/lib/ui/components/EdgesBoard.d.ts.map +1 -1
- package/lib/ui/components/EditPanel.d.ts +19 -0
- package/lib/ui/components/EditPanel.d.ts.map +1 -0
- package/lib/ui/components/EditPanel.hooks.d.ts +29 -0
- package/lib/ui/components/EditPanel.hooks.d.ts.map +1 -0
- package/lib/ui/components/EditPanel.types.d.ts +47 -0
- package/lib/ui/components/EditPanel.types.d.ts.map +1 -0
- package/lib/ui/components/FlowChart.context.d.ts +2452 -575
- package/lib/ui/components/FlowChart.context.d.ts.map +1 -1
- package/lib/ui/components/FlowChart.d.ts +8 -47
- package/lib/ui/components/FlowChart.d.ts.map +1 -1
- package/lib/ui/components/FlowChart.types.d.ts +87 -0
- package/lib/ui/components/FlowChart.types.d.ts.map +1 -0
- package/lib/ui/components/NodeComponent.d.ts +10 -12
- package/lib/ui/components/NodeComponent.d.ts.map +1 -1
- package/lib/ui/components/NodesBoard.d.ts +17 -2
- package/lib/ui/components/NodesBoard.d.ts.map +1 -1
- package/lib/ui/components/Panels.d.ts +12 -0
- package/lib/ui/components/Panels.d.ts.map +1 -0
- package/lib/ui/globals/components/atoms/TypingText.d.ts +29 -0
- package/lib/ui/globals/components/atoms/TypingText.d.ts.map +1 -0
- package/lib/ui/globals/components/molecules/FadingDots.d.ts +21 -0
- package/lib/ui/globals/components/molecules/FadingDots.d.ts.map +1 -0
- package/lib/ui/globals/components/organisms/LoadingFallback.d.ts +46 -0
- package/lib/ui/globals/components/organisms/LoadingFallback.d.ts.map +1 -0
- package/lib/ui/globals/constants/index.d.ts +3 -0
- package/lib/ui/globals/constants/index.d.ts.map +1 -0
- package/lib/ui/globals/constants/links.d.ts +4 -0
- package/lib/ui/globals/constants/links.d.ts.map +1 -0
- package/lib/ui/globals/constants/strings.d.ts +5 -0
- package/lib/ui/globals/constants/strings.d.ts.map +1 -0
- package/lib/ui/globals/directives/clickOutside.d.ts +9 -0
- package/lib/ui/globals/directives/clickOutside.d.ts.map +1 -0
- package/lib/ui/globals/directives/index.d.ts +16 -0
- package/lib/ui/globals/directives/index.d.ts.map +1 -0
- package/lib/ui/globals/directives/mouseOut.d.ts +33 -0
- package/lib/ui/globals/directives/mouseOut.d.ts.map +1 -0
- package/lib/ui/globals/directives/mouseOut.test.d.ts +2 -0
- package/lib/ui/globals/directives/mouseOut.test.d.ts.map +1 -0
- package/lib/ui/globals/directives/resize.d.ts +11 -0
- package/lib/ui/globals/directives/resize.d.ts.map +1 -0
- package/lib/ui/globals/helpers/espace.d.ts +17 -0
- package/lib/ui/globals/helpers/espace.d.ts.map +1 -0
- package/lib/ui/globals/signals/createTyping.d.ts +27 -0
- package/lib/ui/globals/signals/createTyping.d.ts.map +1 -0
- package/lib/ui/globals/types.d.ts +54 -0
- package/lib/ui/globals/types.d.ts.map +1 -0
- package/lib/ui/utils.d.ts +11 -0
- package/lib/ui/utils.d.ts.map +1 -0
- package/package.json +2 -3
- package/src/helpers/clamp.ts +3 -0
- package/src/helpers/createContext.ts +20 -4
- package/src/helpers/index.ts +2 -0
- package/src/index.ts +9 -1
- package/src/services/main.machine.data.ts +13 -2
- package/src/services/main.machine.helpers.ts +12 -4
- package/src/services/main.machine.test.ts +205 -0
- package/src/services/main.machine.ts +253 -75
- package/src/services/main.machine.typings.ts +31 -6
- package/src/ui/Flow.tsx +47 -8
- package/src/ui/components/Bounds.tsx +0 -2
- package/src/ui/components/EdgeComponent.tsx +60 -46
- package/src/ui/components/EdgesBoard.tsx +1 -2
- package/src/ui/components/EditPanel.hooks.ts +69 -0
- package/src/ui/components/EditPanel.tsx +89 -0
- package/src/ui/components/EditPanel.types.ts +49 -0
- package/src/ui/components/FlowChart.context.ts +22 -141
- package/src/ui/components/FlowChart.tsx +27 -64
- package/src/ui/components/FlowChart.types.ts +92 -0
- package/src/ui/components/NodeComponent.tsx +88 -65
- package/src/ui/components/NodesBoard.tsx +61 -56
- package/src/ui/components/Panels.tsx +40 -0
- package/src/ui/globals/components/atoms/TypingText.tsx +63 -0
- package/src/ui/globals/components/molecules/FadingDots.tsx +45 -0
- package/src/ui/globals/components/organisms/LoadingFallback.tsx +116 -0
- package/src/ui/globals/constants/index.ts +2 -0
- package/src/ui/globals/constants/links.ts +15 -0
- package/src/ui/globals/constants/strings.ts +5 -0
- package/src/ui/globals/directives/clickOutside.ts +18 -0
- package/src/ui/globals/directives/index.ts +16 -0
- package/src/ui/globals/directives/mouseOut.test.ts +115 -0
- package/src/ui/globals/directives/mouseOut.ts +98 -0
- package/src/ui/globals/directives/resize.ts +33 -0
- package/src/ui/globals/helpers/espace.ts +26 -0
- package/src/ui/globals/signals/createTyping.ts +82 -0
- package/src/ui/globals/types.ts +83 -0
- package/src/ui/utils.ts +14 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { Component, ComponentProps, JSX, ValidComponent } from 'solid-js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Extracts a subset of component props from a valid component.
|
|
5
|
+
*
|
|
6
|
+
* @template | {@linkcode ValidComponent} `T` - Target component type.
|
|
7
|
+
* @template | `keyof ComponentProps<T>` `K` - Prop keys to pick.
|
|
8
|
+
*/
|
|
9
|
+
export type PropsOf<
|
|
10
|
+
T extends ValidComponent,
|
|
11
|
+
K extends keyof ComponentProps<T> = never,
|
|
12
|
+
> = Pick<ComponentProps<T>, K>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Omits a subset of component props from a valid component.
|
|
16
|
+
*
|
|
17
|
+
* @template | {@linkcode ValidComponent} `T` - Target component type.
|
|
18
|
+
* @template | `keyof ComponentProps<T>` `K` - Prop keys to omit.
|
|
19
|
+
*/
|
|
20
|
+
export type OmitPropsOf<
|
|
21
|
+
T extends ValidComponent,
|
|
22
|
+
K extends keyof ComponentProps<T> = never,
|
|
23
|
+
> = Omit<ComponentProps<T>, K>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Creates a component type where specified props are optional.
|
|
27
|
+
*
|
|
28
|
+
* @template | {@linkcode ValidComponent} `T` - Target component type.
|
|
29
|
+
* @template | `keyof ComponentProps<T>` `K` - Prop keys to make optional.
|
|
30
|
+
*/
|
|
31
|
+
export type ReduceComponent<
|
|
32
|
+
T extends ValidComponent,
|
|
33
|
+
K extends keyof ComponentProps<T> = never,
|
|
34
|
+
> = Component<OmitPropsOf<T, K> & Partial<PropsOf<T, K>>>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Short alias for type {@linkcode ReduceComponent}.
|
|
38
|
+
*
|
|
39
|
+
* @template | {@linkcode ValidComponent} `T` - Target component type.
|
|
40
|
+
* @template | `keyof ComponentProps<T>` `K` - Prop keys to make optional.
|
|
41
|
+
*/
|
|
42
|
+
export type RC<
|
|
43
|
+
T extends ValidComponent,
|
|
44
|
+
K extends keyof ComponentProps<T> = never,
|
|
45
|
+
> = ReduceComponent<T, K>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Creates a component type requiring only a picked subset of props.
|
|
49
|
+
*
|
|
50
|
+
* @template | {@linkcode ValidComponent} `T` - Target component type.
|
|
51
|
+
* @template | `keyof ComponentProps<T>` `K` - Picked prop keys.
|
|
52
|
+
*/
|
|
53
|
+
export type PickComponent<
|
|
54
|
+
T extends ValidComponent,
|
|
55
|
+
K extends keyof ComponentProps<T> = never,
|
|
56
|
+
> = Component<PropsOf<T, K>>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Short alias for type {@linkcode PickComponent}.
|
|
60
|
+
*
|
|
61
|
+
* @template | {@linkcode ValidComponent} `T` - Target component type.
|
|
62
|
+
* @template | `keyof ComponentProps<T>` `K` - Picked prop keys.
|
|
63
|
+
*/
|
|
64
|
+
export type PiC<
|
|
65
|
+
T extends ValidComponent,
|
|
66
|
+
K extends keyof ComponentProps<T> = never,
|
|
67
|
+
> = PickComponent<T, K>;
|
|
68
|
+
|
|
69
|
+
/** Type representing an HTML `<link>` tag properties. */
|
|
70
|
+
export type RootLink = JSX.HTMLElementTags['link'];
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Type representing an HTML element ref or ref callback.
|
|
74
|
+
*
|
|
75
|
+
* @template | {@linkcode HTMLElement} `T` - Target HTML element type.
|
|
76
|
+
*/
|
|
77
|
+
export type Ref<T extends HTMLElement> =
|
|
78
|
+
| T
|
|
79
|
+
| ((el: T | undefined) => void)
|
|
80
|
+
| undefined;
|
|
81
|
+
|
|
82
|
+
/** Class map dictionary for conditional styling in Solid.js components. */
|
|
83
|
+
export type ClassList = Record<string, boolean | undefined>;
|
package/src/ui/utils.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { clsx, type ClassValue } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Merges conditional CSS class names using `clsx` and resolves Tailwind CSS class
|
|
6
|
+
* conflicts with `twMerge`.
|
|
7
|
+
*
|
|
8
|
+
* @param inputs - Variable list of class values, objects, or arrays.
|
|
9
|
+
*
|
|
10
|
+
* @returns The resolved single class name string.
|
|
11
|
+
*/
|
|
12
|
+
export function cn(...inputs: ClassValue[]) {
|
|
13
|
+
return twMerge(clsx(inputs));
|
|
14
|
+
}
|