@syware/jlib 0.1.0 → 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.
- package/README.md +8 -6
- package/dist/all.js +4 -3
- package/dist/atoms/jl-icon.css_raw.js +1 -1
- package/dist/atoms/jl-icon.d.ts +7 -1
- package/dist/atoms/jl-icon.js +4 -1
- package/dist/atoms/jl-progress-ring.js +1 -6
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -2
- package/dist/lib/calendar.d.ts +15 -1
- package/dist/lib/calendar.js +72 -1
- package/dist/lib/dom.d.ts +2 -0
- package/dist/lib/dom.js +8 -1
- package/dist/lib/flow.d.ts +61 -0
- package/dist/lib/flow.js +336 -0
- package/dist/lib/options.d.ts +5 -0
- package/dist/lib/options.js +13 -1
- package/dist/molecules/jl-alert.d.ts +1 -0
- package/dist/molecules/jl-alert.js +3 -1
- package/dist/molecules/jl-date-picker.d.ts +10 -4
- package/dist/molecules/jl-date-picker.js +21 -8
- package/dist/molecules/jl-steps.css_raw.js +1 -1
- package/dist/molecules/jl-timeline.css_raw.js +1 -1
- package/dist/molecules/jl-timeline.d.ts +2 -1
- package/dist/molecules/jl-timeline.js +18 -16
- package/dist/molecules/jl-toast.css_raw.js +1 -1
- package/dist/molecules/jl-toast.d.ts +1 -0
- package/dist/molecules/jl-toast.js +3 -1
- package/dist/organisms/jl-flow.css_raw.js +3 -0
- package/dist/organisms/jl-flow.d.ts +86 -0
- package/dist/organisms/jl-flow.js +650 -0
- package/dist/types/calendar.types.d.ts +2 -0
- package/dist/types/jl-flow.types.d.ts +77 -0
- package/package.json +9 -3
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Tone } from './options.types';
|
|
2
|
+
/** A point in the flow's own pixels, which the view moves and zooms. */
|
|
3
|
+
export type FlowPoint = {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
};
|
|
7
|
+
/** An exit of a node, along its bottom edge. Its edges take its tone: `danger` ones are dashed. */
|
|
8
|
+
export type FlowPort = {
|
|
9
|
+
id: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
tone?: Tone;
|
|
12
|
+
};
|
|
13
|
+
export type FlowNode = {
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
/** The node's top left corner. */
|
|
17
|
+
position: FlowPoint;
|
|
18
|
+
/** A second, quieter line under the label. */
|
|
19
|
+
description?: string;
|
|
20
|
+
icon?: string;
|
|
21
|
+
/** The colour of the icon: `accent` by default. */
|
|
22
|
+
tone?: Tone;
|
|
23
|
+
/** The exits. Absent, the node has one without a name; empty, it has none (it ends the flow). */
|
|
24
|
+
ports?: FlowPort[];
|
|
25
|
+
/** A start takes no incoming edge. */
|
|
26
|
+
start?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type FlowEdge = {
|
|
29
|
+
id: string;
|
|
30
|
+
from: string;
|
|
31
|
+
/** The exit of `from` it leaves by; absent, the first one. */
|
|
32
|
+
port?: string;
|
|
33
|
+
to: string;
|
|
34
|
+
};
|
|
35
|
+
export type FlowGraph = {
|
|
36
|
+
nodes: FlowNode[];
|
|
37
|
+
edges: FlowEdge[];
|
|
38
|
+
};
|
|
39
|
+
/** Asks the page for a node after an exit: where to put it, and what to connect it to. */
|
|
40
|
+
export type FlowAddRequest = {
|
|
41
|
+
from: string;
|
|
42
|
+
port: string;
|
|
43
|
+
position: FlowPoint;
|
|
44
|
+
};
|
|
45
|
+
/** How far the view is moved, and how much it is zoomed. */
|
|
46
|
+
export type FlowViewport = {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
zoom: number;
|
|
50
|
+
};
|
|
51
|
+
/** Where an edge starts and ends, and the tone of the exit it leaves by. */
|
|
52
|
+
export type FlowEdgeEnds = {
|
|
53
|
+
from: FlowPoint;
|
|
54
|
+
to: FlowPoint;
|
|
55
|
+
tone: Tone;
|
|
56
|
+
};
|
|
57
|
+
/** What a press on the canvas is doing: moving the view, moving a node, or drawing an edge from an exit. */
|
|
58
|
+
export type FlowGesture = {
|
|
59
|
+
kind: 'idle';
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'pan';
|
|
62
|
+
start: FlowPoint;
|
|
63
|
+
origin: FlowViewport;
|
|
64
|
+
moved: boolean;
|
|
65
|
+
edge: string;
|
|
66
|
+
} | {
|
|
67
|
+
kind: 'drag';
|
|
68
|
+
node: string;
|
|
69
|
+
offset: FlowPoint;
|
|
70
|
+
start: FlowPoint;
|
|
71
|
+
moved: boolean;
|
|
72
|
+
} | {
|
|
73
|
+
kind: 'connect';
|
|
74
|
+
node: string;
|
|
75
|
+
port: string;
|
|
76
|
+
start: FlowPoint;
|
|
77
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syware/jlib",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A tree-shakeable component library on Jadis and native Web Components, organised in atomic design",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"bugs": {
|
|
24
24
|
"url": "https://github.com/bioleyl/jlib/issues"
|
|
25
25
|
},
|
|
26
|
-
"files": [
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
27
29
|
"main": "./dist/index.js",
|
|
28
30
|
"module": "./dist/index.js",
|
|
29
31
|
"types": "./dist/index.d.ts",
|
|
@@ -55,7 +57,11 @@
|
|
|
55
57
|
"./tokens.css": "./dist/tokens.css",
|
|
56
58
|
"./package.json": "./package.json"
|
|
57
59
|
},
|
|
58
|
-
"sideEffects": [
|
|
60
|
+
"sideEffects": [
|
|
61
|
+
"./dist/all.js",
|
|
62
|
+
"./dist/*.css",
|
|
63
|
+
"./src/all.ts"
|
|
64
|
+
],
|
|
59
65
|
"publishConfig": {
|
|
60
66
|
"access": "public"
|
|
61
67
|
},
|