@code0-tech/pictor 0.6.0 → 0.6.2
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/LICENSE +1 -1
- package/dist/assets/components/command/Command.style.css +1 -1
- package/dist/assets/components/form/Input.style.css +1 -1
- package/dist/assets/components/gantt/Gantt.style.css +1 -0
- package/dist/assets/components/layout/Layout.style.css +1 -1
- package/dist/components/alert/Alert.d.ts +2 -2
- package/dist/components/alert/Alert.js +8 -7
- package/dist/components/avatar/Avatar.d.ts +2 -2
- package/dist/components/avatar/Avatar.js +30 -27
- package/dist/components/badge/Badge.d.ts +2 -2
- package/dist/components/badge/Badge.js +26 -23
- package/dist/components/breadcrumb/Breadcrumb.d.ts +2 -2
- package/dist/components/breadcrumb/Breadcrumb.js +16 -14
- package/dist/components/button/Button.d.ts +3 -3
- package/dist/components/button/Button.js +13 -12
- package/dist/components/button-group/ButtonGroup.d.ts +2 -2
- package/dist/components/button-group/ButtonGroup.js +23 -20
- package/dist/components/card/Card.d.ts +3 -3
- package/dist/components/card/Card.js +19 -16
- package/dist/components/card/CardSection.d.ts +2 -2
- package/dist/components/card/CardSection.js +16 -13
- package/dist/components/col/Col.d.ts +2 -2
- package/dist/components/col/Col.js +22 -19
- package/dist/components/command/Command.d.ts +12 -12
- package/dist/components/command/Command.js +95 -82
- package/dist/components/container/Container.d.ts +2 -2
- package/dist/components/container/Container.js +13 -10
- package/dist/components/context-menu/ContextMenu.d.ts +13 -13
- package/dist/components/context-menu/ContextMenu.js +26 -25
- package/dist/components/data-table/DataTable.d.ts +2 -2
- package/dist/components/data-table/DataTable.js +18 -17
- package/dist/components/data-table/DataTableColumn.d.ts +2 -2
- package/dist/components/data-table/DataTableColumn.js +12 -11
- package/dist/components/data-table/DataTableFilterInput.js +4 -3
- package/dist/components/dialog/Dialog.d.ts +12 -12
- package/dist/components/dialog/Dialog.js +24 -23
- package/dist/components/editor/Editor.d.ts +2 -2
- package/dist/components/editor/Editor.js +4 -3
- package/dist/components/file-tabs/FileTabs.d.ts +5 -5
- package/dist/components/file-tabs/FileTabs.js +38 -35
- package/dist/components/flex/Flex.d.ts +2 -2
- package/dist/components/flex/Flex.js +16 -13
- package/dist/components/form/CheckboxInput.js +17 -15
- package/dist/components/form/Input.d.ts +3 -3
- package/dist/components/form/Input.js +4 -3
- package/dist/components/form/PinInput.d.ts +3 -3
- package/dist/components/form/PinInput.js +33 -30
- package/dist/components/form/RadioGroup.js +22 -19
- package/dist/components/form/RadioInput.d.ts +2 -2
- package/dist/components/form/RadioInput.js +19 -16
- package/dist/components/fullscreen/FullScreen.d.ts +2 -2
- package/dist/components/fullscreen/FullScreen.js +8 -6
- package/dist/components/gantt/Gantt.d.ts +12 -0
- package/dist/components/gantt/Gantt.js +92 -0
- package/dist/components/gantt/GanttFooter.d.ts +2 -0
- package/dist/components/gantt/GanttFooter.js +38 -0
- package/dist/components/gantt/GanttGroup.d.ts +8 -0
- package/dist/components/gantt/GanttGroup.js +134 -0
- package/dist/components/gantt/GanttHeader.d.ts +10 -0
- package/dist/components/gantt/GanttHeader.js +55 -0
- package/dist/components/gantt/GanttItem.d.ts +16 -0
- package/dist/components/gantt/GanttItem.js +23 -0
- package/dist/components/layout/Layout.d.ts +3 -3
- package/dist/components/layout/Layout.js +37 -33
- package/dist/components/menu/Menu.d.ts +15 -15
- package/dist/components/menu/Menu.js +35 -32
- package/dist/components/resizable/Resizable.d.ts +4 -4
- package/dist/components/resizable/Resizable.js +18 -17
- package/dist/components/row/Row.d.ts +2 -2
- package/dist/components/row/Row.js +15 -12
- package/dist/components/scroll-area/ScrollArea.d.ts +6 -6
- package/dist/components/scroll-area/ScrollArea.js +35 -32
- package/dist/components/segmented-control/SegmentedControl.d.ts +3 -3
- package/dist/components/segmented-control/SegmentedControl.js +12 -11
- package/dist/components/spacing/Spacing.d.ts +3 -3
- package/dist/components/spacing/Spacing.js +12 -11
- package/dist/components/tab/Tab.d.ts +5 -5
- package/dist/components/tab/Tab.js +22 -21
- package/dist/components/text/Text.d.ts +3 -3
- package/dist/components/text/Text.js +14 -11
- package/dist/components/toast/Toast.d.ts +2 -2
- package/dist/components/toast/Toast.js +32 -31
- package/dist/components/tooltip/Tooltip.d.ts +6 -6
- package/dist/components/tooltip/Tooltip.js +34 -31
- package/dist/index.d.ts +1 -0
- package/dist/index.js +151 -152
- package/dist/utils/color.d.ts +4 -0
- package/dist/utils/color.js +43 -0
- package/dist/utils/component.d.ts +105 -0
- package/dist/utils/component.js +130 -0
- package/dist/utils/index.d.ts +3 -4
- package/dist/utils/index.js +14 -18
- package/dist/utils/size.d.ts +4 -0
- package/dist/utils/size.js +21 -0
- package/dist/utils/utils.d.ts +0 -55
- package/dist/utils/utils.js +1 -159
- package/package.json +3 -3
- package/dist/utils/nonReactiveArrayService.d.ts +0 -19
- package/dist/utils/nonReactiveArrayService.js +0 -54
- package/dist/utils/objectStore.d.ts +0 -12
- package/dist/utils/objectStore.js +0 -34
- package/dist/utils/types.d.ts +0 -57
- package/dist/utils/types.js +0 -4
package/dist/utils/index.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import { ContextStore as o, ContextStoreProvider as t, useService as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { getDOMSizeFromCodeZeroSize as R, hashToColor as d, mergeCode0Props as u } from "./utils.js";
|
|
1
|
+
import { ContextStore as o, ContextStoreProvider as t, useService as i, useStore as m } from "./contextStore.js";
|
|
2
|
+
import { ReactiveArrayService as S, useReactiveArrayService as x } from "./reactiveArrayService.js";
|
|
3
|
+
import { mergeComponentProps as s } from "./component.js";
|
|
4
|
+
import { Colors as C, hashToColor as c, withAlpha as f } from "./color.js";
|
|
5
|
+
import { getDOMSizeFromCodeZeroSize as n } from "./size.js";
|
|
7
6
|
export {
|
|
8
|
-
|
|
7
|
+
C as Colors,
|
|
9
8
|
o as ContextStore,
|
|
10
9
|
t as ContextStoreProvider,
|
|
11
|
-
S as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
C as useReactiveArrayService,
|
|
20
|
-
c as useService,
|
|
21
|
-
i as useStore
|
|
10
|
+
S as ReactiveArrayService,
|
|
11
|
+
n as getDOMSizeFromCodeZeroSize,
|
|
12
|
+
c as hashToColor,
|
|
13
|
+
s as mergeComponentProps,
|
|
14
|
+
x as useReactiveArrayService,
|
|
15
|
+
i as useService,
|
|
16
|
+
m as useStore,
|
|
17
|
+
f as withAlpha
|
|
22
18
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export type Sizes = "xxs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
3
|
+
export type FontSizes = "0.35" | "0.7" | "0.8" | "1" | "1.2" | "1.3";
|
|
4
|
+
export declare const getDOMSizeFromCodeZeroSize: (size: Sizes | CSSProperties["x"]) => CSSProperties["x"];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const r = (e) => {
|
|
2
|
+
switch (e) {
|
|
3
|
+
case "xxs":
|
|
4
|
+
return "0.35rem";
|
|
5
|
+
case "xs":
|
|
6
|
+
return "0.7rem";
|
|
7
|
+
case "sm":
|
|
8
|
+
return "0.8rem";
|
|
9
|
+
case "md":
|
|
10
|
+
return "1rem";
|
|
11
|
+
case "lg":
|
|
12
|
+
return "1.2rem";
|
|
13
|
+
case "xl":
|
|
14
|
+
return "1.3rem";
|
|
15
|
+
default:
|
|
16
|
+
return e;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
r as getDOMSizeFromCodeZeroSize
|
|
21
|
+
};
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
import { Code0Sizes } from './types';
|
|
3
|
-
export declare const mergeCode0Props: (cn: string, rest: object) => {
|
|
4
|
-
m?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
5
|
-
my?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
6
|
-
mx?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
7
|
-
mt?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
8
|
-
mb?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
9
|
-
ml?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
10
|
-
mr?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
11
|
-
p?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
12
|
-
py?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
13
|
-
px?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
14
|
-
pt?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
15
|
-
pb?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
16
|
-
pl?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
17
|
-
pr?: import('./types').StyleProp<number | `${number}`> | undefined;
|
|
18
|
-
bg?: import("csstype").Property.BackgroundColor | undefined;
|
|
19
|
-
c?: import("csstype").Property.Color | undefined;
|
|
20
|
-
opacity?: import("csstype").Property.Opacity | undefined;
|
|
21
|
-
ff?: import('./types').StyleProp<"mono" | "text" | "heading" | (string & {})> | undefined;
|
|
22
|
-
fz?: import('./types').StyleProp<import('./types').Code0FontSizes | number | `${number}`> | undefined;
|
|
23
|
-
fw?: import("csstype").Property.FontWeight | undefined;
|
|
24
|
-
lts?: import("csstype").Property.LetterSpacing<string | number> | undefined;
|
|
25
|
-
ta?: import("csstype").Property.TextAlign | undefined;
|
|
26
|
-
lh?: import('./types').StyleProp<number | (string & {})> | undefined;
|
|
27
|
-
fs?: import("csstype").Property.FontStyle | undefined;
|
|
28
|
-
tt?: import("csstype").Property.TextTransform | undefined;
|
|
29
|
-
td?: import("csstype").Property.TextDecoration<string | number> | undefined;
|
|
30
|
-
w?: import("csstype").Property.Width<string | number> | undefined;
|
|
31
|
-
miw?: import("csstype").Property.MinWidth<string | number> | undefined;
|
|
32
|
-
maw?: import("csstype").Property.MaxWidth<string | number> | undefined;
|
|
33
|
-
h?: import("csstype").Property.Height<string | number> | undefined;
|
|
34
|
-
mih?: import("csstype").Property.MinHeight<string | number> | undefined;
|
|
35
|
-
mah?: import("csstype").Property.MaxHeight<string | number> | undefined;
|
|
36
|
-
bgsz?: import("csstype").Property.BackgroundSize<string | number> | undefined;
|
|
37
|
-
bgp?: import("csstype").Property.BackgroundPosition<string | number> | undefined;
|
|
38
|
-
bgr?: import("csstype").Property.BackgroundRepeat | undefined;
|
|
39
|
-
bga?: import("csstype").Property.BackgroundAttachment | undefined;
|
|
40
|
-
pos?: import("csstype").Property.Position | undefined;
|
|
41
|
-
top?: import("csstype").Property.Top<string | number> | undefined;
|
|
42
|
-
left?: import("csstype").Property.Left<string | number> | undefined;
|
|
43
|
-
bottom?: import("csstype").Property.Bottom<string | number> | undefined;
|
|
44
|
-
right?: import("csstype").Property.Right<string | number> | undefined;
|
|
45
|
-
inset?: import("csstype").Property.Inset<string | number> | undefined;
|
|
46
|
-
display?: import("csstype").Property.Display | undefined;
|
|
47
|
-
flex?: import("csstype").Property.Flex<string | number> | undefined;
|
|
48
|
-
align?: import("csstype").Property.AlignItems | undefined;
|
|
49
|
-
justify?: import("csstype").Property.JustifyContent | undefined;
|
|
50
|
-
tf?: import("csstype").Property.Transform | undefined;
|
|
51
|
-
style?: CSSProperties | undefined;
|
|
52
|
-
className: string;
|
|
53
|
-
};
|
|
54
|
-
export declare const getDOMSizeFromCodeZeroSize: (size: Code0Sizes | CSSProperties["x"]) => CSSProperties["x"];
|
|
55
|
-
export declare const hashToColor: (s: string, from?: number, to?: number) => string;
|
package/dist/utils/utils.js
CHANGED
|
@@ -1,159 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { md5 as p } from "js-md5";
|
|
3
|
-
const c = (m) => ({
|
|
4
|
-
...m.m ? {
|
|
5
|
-
margin: `${m.m}rem`
|
|
6
|
-
} : {},
|
|
7
|
-
...m.my ? {
|
|
8
|
-
marginTop: `${m.my}rem`,
|
|
9
|
-
marginBottom: `${m.my}rem`
|
|
10
|
-
} : {},
|
|
11
|
-
...m.mx ? {
|
|
12
|
-
marginLeft: `${m.mx}rem`,
|
|
13
|
-
marginRight: `${m.mx}rem`
|
|
14
|
-
} : {},
|
|
15
|
-
...m.mt ? {
|
|
16
|
-
marginTop: `${m.mt}rem`
|
|
17
|
-
} : {},
|
|
18
|
-
...m.mb ? {
|
|
19
|
-
marginBottom: `${m.mb}rem`
|
|
20
|
-
} : {},
|
|
21
|
-
...m.ml ? {
|
|
22
|
-
marginLeft: `${m.ml}rem`
|
|
23
|
-
} : {},
|
|
24
|
-
...m.mr ? {
|
|
25
|
-
marginRight: `${m.mr}rem`
|
|
26
|
-
} : {},
|
|
27
|
-
...m.p ? {
|
|
28
|
-
padding: `${m.p}rem`
|
|
29
|
-
} : {},
|
|
30
|
-
...m.py ? {
|
|
31
|
-
paddingTop: `${m.py}rem`,
|
|
32
|
-
paddingBottom: `${m.py}rem`
|
|
33
|
-
} : {},
|
|
34
|
-
...m.px ? {
|
|
35
|
-
paddingLeft: `${m.px}rem`,
|
|
36
|
-
paddingRight: `${m.px}rem`
|
|
37
|
-
} : {},
|
|
38
|
-
...m.pt ? {
|
|
39
|
-
paddingTop: `${m.pt}rem`
|
|
40
|
-
} : {},
|
|
41
|
-
...m.pb ? {
|
|
42
|
-
paddingBottom: `${m.pb}rem`
|
|
43
|
-
} : {},
|
|
44
|
-
...m.pl ? {
|
|
45
|
-
paddingLeft: `${m.pl}rem`
|
|
46
|
-
} : {},
|
|
47
|
-
...m.pr ? {
|
|
48
|
-
paddingRight: `${m.pr}rem`
|
|
49
|
-
} : {},
|
|
50
|
-
...m.bg ? {
|
|
51
|
-
backgroundColor: m.bg
|
|
52
|
-
} : {},
|
|
53
|
-
...m.c ? {
|
|
54
|
-
color: m.c
|
|
55
|
-
} : {},
|
|
56
|
-
...m.opacity ? {
|
|
57
|
-
opacity: m.opacity
|
|
58
|
-
} : {},
|
|
59
|
-
...m.ff ? {
|
|
60
|
-
fontFamily: m.ff
|
|
61
|
-
} : {},
|
|
62
|
-
...m.fz ? {
|
|
63
|
-
fontSize: `${m.fz}rem`
|
|
64
|
-
} : {},
|
|
65
|
-
...m.ta ? {
|
|
66
|
-
textAlign: m.ta
|
|
67
|
-
} : {},
|
|
68
|
-
...m.w ? {
|
|
69
|
-
width: m.w
|
|
70
|
-
} : {},
|
|
71
|
-
...m.miw ? {
|
|
72
|
-
minWidth: m.miw
|
|
73
|
-
} : {},
|
|
74
|
-
...m.maw ? {
|
|
75
|
-
maxWidth: m.maw
|
|
76
|
-
} : {},
|
|
77
|
-
...m.h ? {
|
|
78
|
-
height: m.h
|
|
79
|
-
} : {},
|
|
80
|
-
...m.mih ? {
|
|
81
|
-
minHeight: m.mih
|
|
82
|
-
} : {},
|
|
83
|
-
...m.mah ? {
|
|
84
|
-
maxHeight: m.mah
|
|
85
|
-
} : {},
|
|
86
|
-
...m.pos ? {
|
|
87
|
-
position: m.pos
|
|
88
|
-
} : {},
|
|
89
|
-
...m.top ? {
|
|
90
|
-
top: m.top
|
|
91
|
-
} : {},
|
|
92
|
-
...m.left ? {
|
|
93
|
-
left: m.left
|
|
94
|
-
} : {},
|
|
95
|
-
...m.bottom ? {
|
|
96
|
-
bottom: m.bottom
|
|
97
|
-
} : {},
|
|
98
|
-
...m.right ? {
|
|
99
|
-
right: m.right
|
|
100
|
-
} : {},
|
|
101
|
-
...m.display ? {
|
|
102
|
-
display: m.display
|
|
103
|
-
} : {},
|
|
104
|
-
...m.flex ? {
|
|
105
|
-
flex: m.flex
|
|
106
|
-
} : {},
|
|
107
|
-
...m.align ? {
|
|
108
|
-
alignItems: m.align
|
|
109
|
-
} : {},
|
|
110
|
-
...m.justify ? {
|
|
111
|
-
justifyContent: m.justify
|
|
112
|
-
} : {},
|
|
113
|
-
...m.tf ? {
|
|
114
|
-
transform: m.tf
|
|
115
|
-
} : {}
|
|
116
|
-
}), b = (m, r) => {
|
|
117
|
-
const i = c(r), o = {
|
|
118
|
-
...r
|
|
119
|
-
};
|
|
120
|
-
return ["m", "my", "mx", "mt", "mb", "ml", "mr", "p", "py", "px", "pt", "pb", "pl", "pr", "bg", "c", "opacity", "ff", "fz", "fw", "lts", "ta", "lh", "fs", "tt", "td", "w", "miw", "maw", "h", "mih", "mah", "bgsz", "bgp", "bgr", "bga", "pos", "top", "left", "bottom", "right", "inset", "display", "flex", "align", "justify", "tf"].forEach((a) => {
|
|
121
|
-
delete o[a];
|
|
122
|
-
}), t(o, {
|
|
123
|
-
className: m,
|
|
124
|
-
...Object.keys(i).length !== 0 ? {
|
|
125
|
-
style: i
|
|
126
|
-
} : {}
|
|
127
|
-
});
|
|
128
|
-
}, x = (m) => {
|
|
129
|
-
switch (m) {
|
|
130
|
-
case "xxs":
|
|
131
|
-
return "0.35rem";
|
|
132
|
-
case "xs":
|
|
133
|
-
return "0.7rem";
|
|
134
|
-
case "sm":
|
|
135
|
-
return "0.8rem";
|
|
136
|
-
case "md":
|
|
137
|
-
return "1rem";
|
|
138
|
-
case "lg":
|
|
139
|
-
return "1.2rem";
|
|
140
|
-
case "xl":
|
|
141
|
-
return "1.3rem";
|
|
142
|
-
default:
|
|
143
|
-
return m;
|
|
144
|
-
}
|
|
145
|
-
}, f = 137.50776405003785, h = (m) => {
|
|
146
|
-
const r = m.match(/\/(\d+)\s*$/);
|
|
147
|
-
return r ? Number(r[1]) : null;
|
|
148
|
-
}, e = (m, r = 25, i = 320) => {
|
|
149
|
-
const o = i - r, n = h(m);
|
|
150
|
-
if (n != null)
|
|
151
|
-
return `hsl(${r + n * f % o}, 100%, 72%)`;
|
|
152
|
-
const a = p(p(m)), g = parseInt(a.slice(0, 8), 16);
|
|
153
|
-
return `hsl(${r + g % o}, 100%, 72%)`;
|
|
154
|
-
};
|
|
155
|
-
export {
|
|
156
|
-
x as getDOMSizeFromCodeZeroSize,
|
|
157
|
-
e as hashToColor,
|
|
158
|
-
b as mergeCode0Props
|
|
159
|
-
};
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code0-tech/pictor",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A simple template for a custom React component library",
|
|
6
6
|
"scripts": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@storybook/builder-vite": "^10.3.3",
|
|
52
52
|
"@storybook/cli": "^10.3.3",
|
|
53
53
|
"@storybook/react-vite": "^10.3.3",
|
|
54
|
-
"@tabler/icons-react": "3.
|
|
54
|
+
"@tabler/icons-react": "3.41.1",
|
|
55
55
|
"@types/jest-image-snapshot": "^6.4.1",
|
|
56
56
|
"@types/react": "^19.2.14",
|
|
57
57
|
"@types/react-dom": "^19.2.3",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
121
121
|
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
122
122
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
123
|
-
"@tabler/icons-react": "3.
|
|
123
|
+
"@tabler/icons-react": "3.41.1",
|
|
124
124
|
"@uiw/codemirror-themes": "^4.25.4",
|
|
125
125
|
"@uiw/react-codemirror": "^4.25.4",
|
|
126
126
|
"@xyflow/react": "^12.10.0",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ArrayService } from './arrayService';
|
|
2
|
-
/**
|
|
3
|
-
* using a React ref as a store in combination with a map
|
|
4
|
-
* to be able to access and modify the store easily
|
|
5
|
-
*/
|
|
6
|
-
export type NonReactiveArrayStore<K> = K[];
|
|
7
|
-
export declare class NonReactiveArrayService<T> implements ArrayService<T, T> {
|
|
8
|
-
protected store: NonReactiveArrayStore<T>;
|
|
9
|
-
constructor(store: NonReactiveArrayStore<T>);
|
|
10
|
-
delete(index: number): void;
|
|
11
|
-
add(value: T): void;
|
|
12
|
-
set(index: number, value: T): void;
|
|
13
|
-
has(index: number): boolean;
|
|
14
|
-
get(index: number): T;
|
|
15
|
-
values(): NonReactiveArrayStore<T>;
|
|
16
|
-
update(): void;
|
|
17
|
-
clear(): void;
|
|
18
|
-
}
|
|
19
|
-
export declare const createNonReactiveArrayService: <K, T extends ArrayService<K>>(service: typeof T, callback?: (store: NonReactiveArrayStore<K>) => T) => [K[] | undefined, T];
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
function o(t, e, r) {
|
|
2
|
-
return (e = s(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
3
|
-
}
|
|
4
|
-
function s(t) {
|
|
5
|
-
var e = n(t, "string");
|
|
6
|
-
return typeof e == "symbol" ? e : e + "";
|
|
7
|
-
}
|
|
8
|
-
function n(t, e) {
|
|
9
|
-
if (typeof t != "object" || !t) return t;
|
|
10
|
-
var r = t[Symbol.toPrimitive];
|
|
11
|
-
if (r !== void 0) {
|
|
12
|
-
var i = r.call(t, e);
|
|
13
|
-
if (typeof i != "object") return i;
|
|
14
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
15
|
-
}
|
|
16
|
-
return (e === "string" ? String : Number)(t);
|
|
17
|
-
}
|
|
18
|
-
class u {
|
|
19
|
-
constructor(e) {
|
|
20
|
-
o(this, "store", void 0), this.store = e;
|
|
21
|
-
}
|
|
22
|
-
delete(e) {
|
|
23
|
-
delete this.store[e];
|
|
24
|
-
}
|
|
25
|
-
add(e) {
|
|
26
|
-
this.store.push(e);
|
|
27
|
-
}
|
|
28
|
-
set(e, r) {
|
|
29
|
-
this.store[e] = r;
|
|
30
|
-
}
|
|
31
|
-
has(e) {
|
|
32
|
-
return !!this.store[e];
|
|
33
|
-
}
|
|
34
|
-
get(e) {
|
|
35
|
-
return this.store[e];
|
|
36
|
-
}
|
|
37
|
-
values() {
|
|
38
|
-
return this.store;
|
|
39
|
-
}
|
|
40
|
-
update() {
|
|
41
|
-
this.store = [...this.store];
|
|
42
|
-
}
|
|
43
|
-
clear() {
|
|
44
|
-
this.store = [];
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
const a = (t, e) => {
|
|
48
|
-
const r = [];
|
|
49
|
-
return [r, e ? e(r) : new t(r)];
|
|
50
|
-
};
|
|
51
|
-
export {
|
|
52
|
-
u as NonReactiveArrayService,
|
|
53
|
-
a as createNonReactiveArrayService
|
|
54
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* using a React ref as a store in combination with a map
|
|
4
|
-
* to be able to access and modify the store easily
|
|
5
|
-
*/
|
|
6
|
-
export type ObjectStore<K> = [K | undefined, React.Dispatch<React.SetStateAction<K>>];
|
|
7
|
-
export declare class ObjectService<K> {
|
|
8
|
-
protected readonly store: ObjectStore<K>;
|
|
9
|
-
constructor(store: ObjectStore<K>);
|
|
10
|
-
object(): K | undefined;
|
|
11
|
-
}
|
|
12
|
-
export declare const createObjectService: <K, T extends ObjectService<K>>(service: typeof T, callback?: (store: ObjectStore<K>) => T, initial?: K) => [K | undefined, T];
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import o from "react";
|
|
2
|
-
function n(e, r, t) {
|
|
3
|
-
return (r = u(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e;
|
|
4
|
-
}
|
|
5
|
-
function u(e) {
|
|
6
|
-
var r = c(e, "string");
|
|
7
|
-
return typeof r == "symbol" ? r : r + "";
|
|
8
|
-
}
|
|
9
|
-
function c(e, r) {
|
|
10
|
-
if (typeof e != "object" || !e) return e;
|
|
11
|
-
var t = e[Symbol.toPrimitive];
|
|
12
|
-
if (t !== void 0) {
|
|
13
|
-
var i = t.call(e, r);
|
|
14
|
-
if (typeof i != "object") return i;
|
|
15
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16
|
-
}
|
|
17
|
-
return (r === "string" ? String : Number)(e);
|
|
18
|
-
}
|
|
19
|
-
class f {
|
|
20
|
-
constructor(r) {
|
|
21
|
-
n(this, "store", void 0), this.store = r;
|
|
22
|
-
}
|
|
23
|
-
object() {
|
|
24
|
-
return this.store[0];
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const v = (e, r, t) => {
|
|
28
|
-
const i = o.useState(t);
|
|
29
|
-
return [i[0], r ? r(i) : new e(i)];
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
f as ObjectService,
|
|
33
|
-
v as createObjectService
|
|
34
|
-
};
|
package/dist/utils/types.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { default as React, HTMLProps } from 'react';
|
|
2
|
-
export type Color = "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error";
|
|
3
|
-
export declare const Colors: Color[];
|
|
4
|
-
export type Code0Sizes = "xxs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
5
|
-
export type Code0FontSizes = "0.35" | "0.7" | "0.8" | "1" | "1.2" | "1.3";
|
|
6
|
-
export type StyleProp<Value> = Value;
|
|
7
|
-
export interface Code0ComponentProps {
|
|
8
|
-
m?: StyleProp<number | `${number}`>;
|
|
9
|
-
my?: StyleProp<number | `${number}`>;
|
|
10
|
-
mx?: StyleProp<number | `${number}`>;
|
|
11
|
-
mt?: StyleProp<number | `${number}`>;
|
|
12
|
-
mb?: StyleProp<number | `${number}`>;
|
|
13
|
-
ml?: StyleProp<number | `${number}`>;
|
|
14
|
-
mr?: StyleProp<number | `${number}`>;
|
|
15
|
-
p?: StyleProp<number | `${number}`>;
|
|
16
|
-
py?: StyleProp<number | `${number}`>;
|
|
17
|
-
px?: StyleProp<number | `${number}`>;
|
|
18
|
-
pt?: StyleProp<number | `${number}`>;
|
|
19
|
-
pb?: StyleProp<number | `${number}`>;
|
|
20
|
-
pl?: StyleProp<number | `${number}`>;
|
|
21
|
-
pr?: StyleProp<number | `${number}`>;
|
|
22
|
-
bg?: React.CSSProperties['backgroundColor'];
|
|
23
|
-
c?: React.CSSProperties['color'];
|
|
24
|
-
opacity?: React.CSSProperties['opacity'];
|
|
25
|
-
ff?: StyleProp<'mono' | 'text' | 'heading' | (string & {})>;
|
|
26
|
-
fz?: StyleProp<Code0FontSizes | number | `${number}`>;
|
|
27
|
-
fw?: StyleProp<React.CSSProperties['fontWeight']>;
|
|
28
|
-
lts?: StyleProp<React.CSSProperties['letterSpacing']>;
|
|
29
|
-
ta?: StyleProp<React.CSSProperties['textAlign']>;
|
|
30
|
-
lh?: StyleProp<number | (string & {})>;
|
|
31
|
-
fs?: StyleProp<React.CSSProperties['fontStyle']>;
|
|
32
|
-
tt?: StyleProp<React.CSSProperties['textTransform']>;
|
|
33
|
-
td?: StyleProp<React.CSSProperties['textDecoration']>;
|
|
34
|
-
w?: StyleProp<React.CSSProperties['width']>;
|
|
35
|
-
miw?: StyleProp<React.CSSProperties['minWidth']>;
|
|
36
|
-
maw?: StyleProp<React.CSSProperties['maxWidth']>;
|
|
37
|
-
h?: StyleProp<React.CSSProperties['height']>;
|
|
38
|
-
mih?: StyleProp<React.CSSProperties['minHeight']>;
|
|
39
|
-
mah?: StyleProp<React.CSSProperties['maxHeight']>;
|
|
40
|
-
bgsz?: StyleProp<React.CSSProperties['backgroundSize']>;
|
|
41
|
-
bgp?: StyleProp<React.CSSProperties['backgroundPosition']>;
|
|
42
|
-
bgr?: StyleProp<React.CSSProperties['backgroundRepeat']>;
|
|
43
|
-
bga?: StyleProp<React.CSSProperties['backgroundAttachment']>;
|
|
44
|
-
pos?: StyleProp<React.CSSProperties['position']>;
|
|
45
|
-
top?: StyleProp<React.CSSProperties['top']>;
|
|
46
|
-
left?: StyleProp<React.CSSProperties['left']>;
|
|
47
|
-
bottom?: StyleProp<React.CSSProperties['bottom']>;
|
|
48
|
-
right?: StyleProp<React.CSSProperties['right']>;
|
|
49
|
-
inset?: StyleProp<React.CSSProperties['inset']>;
|
|
50
|
-
display?: StyleProp<React.CSSProperties['display']>;
|
|
51
|
-
flex?: StyleProp<React.CSSProperties['flex']>;
|
|
52
|
-
align?: StyleProp<React.CSSProperties['alignItems']>;
|
|
53
|
-
justify?: StyleProp<React.CSSProperties['justifyContent']>;
|
|
54
|
-
tf?: StyleProp<React.CSSProperties['transform']>;
|
|
55
|
-
}
|
|
56
|
-
export interface Code0Component<T> extends Code0ComponentProps, HTMLProps<T> {
|
|
57
|
-
}
|
package/dist/utils/types.js
DELETED