@arcanejs/react-toolkit 0.7.0 → 0.8.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/README.md +4 -5
- package/dist/chunk-CAHNLXTY.mjs +246 -0
- package/dist/chunk-Q54JXYCV.js +246 -0
- package/dist/colors.d.mts +64 -11
- package/dist/colors.d.ts +64 -11
- package/dist/colors.js +8 -7
- package/dist/colors.mjs +2 -1
- package/dist/index.d.mts +103 -26
- package/dist/index.d.ts +103 -26
- package/dist/index.js +33 -225
- package/dist/index.mjs +9 -201
- package/package.json +13 -13
- package/dist/chunk-HVMRFXJ2.mjs +0 -49
- package/dist/chunk-RKOUSLUW.js +0 -49
- package/dist/types-D0Wa4a4d.d.mts +0 -66
- package/dist/types-D0Wa4a4d.d.ts +0 -66
package/dist/colors.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkQ54JXYCVjs = require('./chunk-Q54JXYCV.js');
|
|
6
|
+
require('./chunk-RT2VSMJL.js');
|
|
6
7
|
|
|
7
8
|
// src/colors.tsx
|
|
8
9
|
var _react = require('react');
|
|
@@ -55,10 +56,10 @@ var HslColorPicker = ({
|
|
|
55
56
|
},
|
|
56
57
|
[onChange]
|
|
57
58
|
);
|
|
58
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
59
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
59
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQ54JXYCVjs.Group, { ...DEFAULT_GROUP_PROPS, ...groupProps, children: [
|
|
60
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQ54JXYCVjs.Rect, { color: `hsl(${hue}deg ${saturation}% ${lightness}% / ${alpha})` }),
|
|
60
61
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
61
|
-
|
|
62
|
+
_chunkQ54JXYCVjs.SliderButton,
|
|
62
63
|
{
|
|
63
64
|
value: hue,
|
|
64
65
|
onChange: setHue,
|
|
@@ -70,7 +71,7 @@ var HslColorPicker = ({
|
|
|
70
71
|
}
|
|
71
72
|
),
|
|
72
73
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
73
|
-
|
|
74
|
+
_chunkQ54JXYCVjs.SliderButton,
|
|
74
75
|
{
|
|
75
76
|
value: saturation,
|
|
76
77
|
onChange: setSat,
|
|
@@ -86,7 +87,7 @@ var HslColorPicker = ({
|
|
|
86
87
|
}
|
|
87
88
|
),
|
|
88
89
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
89
|
-
|
|
90
|
+
_chunkQ54JXYCVjs.SliderButton,
|
|
90
91
|
{
|
|
91
92
|
value: lightness,
|
|
92
93
|
onChange: setLightness,
|
|
@@ -102,7 +103,7 @@ var HslColorPicker = ({
|
|
|
102
103
|
}
|
|
103
104
|
),
|
|
104
105
|
showAlpha && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
105
|
-
|
|
106
|
+
_chunkQ54JXYCVjs.SliderButton,
|
|
106
107
|
{
|
|
107
108
|
value: alpha,
|
|
108
109
|
onChange: setAlpha,
|
package/dist/colors.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,32 +1,109 @@
|
|
|
1
|
+
import * as _arcanejs_protocol_core from '@arcanejs/protocol/core';
|
|
2
|
+
import * as _arcanejs_protocol_styles from '@arcanejs/protocol/styles';
|
|
3
|
+
import * as _arcanejs_toolkit_components_group from '@arcanejs/toolkit/components/group';
|
|
4
|
+
import { Props } from '@arcanejs/toolkit/components/group';
|
|
5
|
+
import * as _arcanejs_toolkit_components_button from '@arcanejs/toolkit/components/button';
|
|
6
|
+
import React__default from 'react';
|
|
1
7
|
import * as ld from '@arcanejs/toolkit';
|
|
2
|
-
import { Group as Group$1, GroupHeader as GroupHeader$1,
|
|
3
|
-
import {
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { Button as Button$1 } from '@arcanejs/toolkit/components/button';
|
|
6
|
-
import { Label as Label$1 } from '@arcanejs/toolkit/components/label';
|
|
7
|
-
import { Rect as Rect$1 } from '@arcanejs/toolkit/components/rect';
|
|
8
|
-
import { SliderButton as SliderButton$1 } from '@arcanejs/toolkit/components/slider-button';
|
|
9
|
-
import { Switch as Switch$1 } from '@arcanejs/toolkit/components/switch';
|
|
10
|
-
import { Tab as Tab$1, Tabs as Tabs$1 } from '@arcanejs/toolkit/components/tabs';
|
|
11
|
-
import { Timeline as Timeline$1 } from '@arcanejs/toolkit/components/timeline';
|
|
12
|
-
import { TextInput as TextInput$1 } from '@arcanejs/toolkit/components/text-input';
|
|
8
|
+
import { Button as Button$1, Group as Group$1, GroupHeader as GroupHeader$1, Label as Label$1, Rect as Rect$1, SliderButton as SliderButton$1, Switch as Switch$1, Tab as Tab$1, Tabs as Tabs$1, TextInput as TextInput$1, Timeline as Timeline$1 } from '@arcanejs/toolkit';
|
|
9
|
+
import { AnyComponent, BaseParent, Base } from '@arcanejs/toolkit/components/base';
|
|
13
10
|
|
|
14
|
-
type
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
type ComponentClass = new (...args: any[]) => AnyComponent;
|
|
12
|
+
type ComponentsDefinition = {
|
|
13
|
+
[key: string]: ComponentClass;
|
|
14
|
+
};
|
|
15
|
+
type Child = JSX.Element | null | undefined | false | string;
|
|
16
|
+
type Children = Child | Child[];
|
|
17
|
+
type PropsOfComponent<T extends ComponentClass> = T extends new (props?: infer P) => BaseParent<any, any, any> ? Partial<P & {
|
|
18
|
+
children: Children;
|
|
19
|
+
}> : T extends new (props: infer P) => BaseParent<any, any, any> ? P & {
|
|
20
|
+
children?: Children;
|
|
21
|
+
} : T extends new (props?: infer P) => Base<any, any, any> ? Partial<P> : T extends new (props: infer P) => Base<any, any, any> ? P : never;
|
|
22
|
+
type InstanceType<T extends ComponentClass> = T extends new (...args: any[]) => infer R ? R : never;
|
|
23
|
+
type Creators<D extends ComponentsDefinition> = {
|
|
24
|
+
[K in keyof D]: (props: {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}) => AnyComponent;
|
|
27
|
+
};
|
|
28
|
+
type ComponentFunctionForComponent<T extends ComponentClass> = React__default.ForwardRefExoticComponent<React__default.PropsWithoutRef<PropsOfComponent<T>> & React__default.RefAttributes<InstanceType<T>>>;
|
|
29
|
+
type ComponentFunctions<D extends ComponentsDefinition> = {
|
|
30
|
+
[K in keyof D]: ComponentFunctionForComponent<D[K]>;
|
|
31
|
+
};
|
|
32
|
+
type PreparedComponents<D extends ComponentsDefinition> = {
|
|
33
|
+
_namespace: string;
|
|
34
|
+
_creators: Creators<D>;
|
|
35
|
+
} & ComponentFunctions<D>;
|
|
36
|
+
declare const prepareComponents: <D extends ComponentsDefinition>(namespace: string, defn: D) => PreparedComponents<D>;
|
|
26
37
|
|
|
38
|
+
declare const CoreComponents: PreparedComponents<{
|
|
39
|
+
Button: typeof Button$1;
|
|
40
|
+
Group: typeof Group$1;
|
|
41
|
+
GroupHeader: typeof GroupHeader$1;
|
|
42
|
+
Label: typeof Label$1;
|
|
43
|
+
Rect: typeof Rect$1;
|
|
44
|
+
SliderButton: typeof SliderButton$1;
|
|
45
|
+
Switch: typeof Switch$1;
|
|
46
|
+
Tab: typeof Tab$1;
|
|
47
|
+
Tabs: typeof Tabs$1;
|
|
48
|
+
TextInput: typeof TextInput$1;
|
|
49
|
+
Timeline: typeof Timeline$1;
|
|
50
|
+
}>;
|
|
51
|
+
|
|
52
|
+
type ReactToolkitConfig = {
|
|
53
|
+
componentNamespaces: Array<PreparedComponents<any>>;
|
|
54
|
+
};
|
|
27
55
|
declare const ToolkitRenderer: {
|
|
28
|
-
renderGroup: (component: JSX.Element, container: ld.Group) => void;
|
|
29
|
-
render: (component: JSX.Element, container: ld.Toolkit, rootGroupProps?: Props) => void;
|
|
56
|
+
renderGroup: (component: JSX.Element, container: ld.Group, config?: ReactToolkitConfig) => void;
|
|
57
|
+
render: (component: JSX.Element, container: ld.Toolkit, rootGroupProps?: Props, config?: ReactToolkitConfig) => void;
|
|
30
58
|
};
|
|
31
59
|
|
|
32
|
-
|
|
60
|
+
declare const Button: React__default.ForwardRefExoticComponent<Partial<Partial<_arcanejs_toolkit_components_button.InternalProps>> & React__default.RefAttributes<ld.Button>>;
|
|
61
|
+
declare const Group: React__default.ForwardRefExoticComponent<Partial<Partial<_arcanejs_toolkit_components_group.InternalProps> & {
|
|
62
|
+
children: (string | false | JSX.Element | null | undefined) | (string | false | JSX.Element | null | undefined)[];
|
|
63
|
+
}> & React__default.RefAttributes<ld.Group>>;
|
|
64
|
+
declare const GroupHeader: React__default.ForwardRefExoticComponent<Record<never, never> & {
|
|
65
|
+
children?: (string | false | JSX.Element | null | undefined) | (string | false | JSX.Element | null | undefined)[];
|
|
66
|
+
} & React__default.RefAttributes<ld.GroupHeader>>;
|
|
67
|
+
declare const Label: React__default.ForwardRefExoticComponent<Partial<_arcanejs_protocol_styles.LabelComponentStyle & {
|
|
68
|
+
text: string | null;
|
|
69
|
+
}> & React__default.RefAttributes<ld.Label>>;
|
|
70
|
+
declare const Rect: React__default.ForwardRefExoticComponent<Partial<Partial<{
|
|
71
|
+
color: string;
|
|
72
|
+
grow?: boolean | undefined;
|
|
73
|
+
}>> & React__default.RefAttributes<ld.Rect>>;
|
|
74
|
+
declare const SliderButton: React__default.ForwardRefExoticComponent<Partial<Pick<Pick<_arcanejs_protocol_core.SliderButtonComponent, "grow" | "min" | "max" | "step" | "gradient"> & {
|
|
75
|
+
value?: number | undefined;
|
|
76
|
+
defaultValue?: number | undefined;
|
|
77
|
+
onChange?: ((value: number) => void | Promise<void>) | undefined;
|
|
78
|
+
}, "value"> & Partial<Omit<Pick<_arcanejs_protocol_core.SliderButtonComponent, "grow" | "min" | "max" | "step" | "gradient"> & {
|
|
79
|
+
value?: number | undefined;
|
|
80
|
+
defaultValue?: number | undefined;
|
|
81
|
+
onChange?: ((value: number) => void | Promise<void>) | undefined;
|
|
82
|
+
}, "value">>> & React__default.RefAttributes<ld.SliderButton>>;
|
|
83
|
+
declare const Switch: React__default.ForwardRefExoticComponent<Partial<Partial<{
|
|
84
|
+
value?: "on" | "off" | undefined;
|
|
85
|
+
defaultValue?: "on" | "off" | undefined;
|
|
86
|
+
onChange?: ((state: "on" | "off") => void | Promise<void>) | undefined;
|
|
87
|
+
}>> & React__default.RefAttributes<ld.Switch>>;
|
|
88
|
+
declare const Tab: React__default.ForwardRefExoticComponent<{
|
|
89
|
+
name: string;
|
|
90
|
+
} & {
|
|
91
|
+
children?: (string | false | JSX.Element | null | undefined) | (string | false | JSX.Element | null | undefined)[];
|
|
92
|
+
} & React__default.RefAttributes<ld.Tab>>;
|
|
93
|
+
declare const Tabs: React__default.ForwardRefExoticComponent<Partial<{} & {
|
|
94
|
+
children: (string | false | JSX.Element | null | undefined) | (string | false | JSX.Element | null | undefined)[];
|
|
95
|
+
}> & React__default.RefAttributes<ld.Tabs>>;
|
|
96
|
+
declare const TextInput: React__default.ForwardRefExoticComponent<Partial<Partial<{
|
|
97
|
+
value: string | null;
|
|
98
|
+
onChange?: ((value: string) => void | Promise<void>) | undefined;
|
|
99
|
+
}>> & React__default.RefAttributes<ld.TextInput>>;
|
|
100
|
+
declare const Timeline: React__default.ForwardRefExoticComponent<Partial<Partial<{
|
|
101
|
+
state: _arcanejs_protocol_core.TimelineState;
|
|
102
|
+
title: string | null;
|
|
103
|
+
subtitles: string[] | null;
|
|
104
|
+
source: {
|
|
105
|
+
name: string;
|
|
106
|
+
} | null | undefined;
|
|
107
|
+
}>> & React__default.RefAttributes<ld.Timeline>>;
|
|
108
|
+
|
|
109
|
+
export { Button, CoreComponents, Group, GroupHeader, Label, Rect, SliderButton, Switch, Tab, Tabs, TextInput, Timeline, ToolkitRenderer, prepareComponents };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,109 @@
|
|
|
1
|
+
import * as _arcanejs_protocol_core from '@arcanejs/protocol/core';
|
|
2
|
+
import * as _arcanejs_protocol_styles from '@arcanejs/protocol/styles';
|
|
3
|
+
import * as _arcanejs_toolkit_components_group from '@arcanejs/toolkit/components/group';
|
|
4
|
+
import { Props } from '@arcanejs/toolkit/components/group';
|
|
5
|
+
import * as _arcanejs_toolkit_components_button from '@arcanejs/toolkit/components/button';
|
|
6
|
+
import React__default from 'react';
|
|
1
7
|
import * as ld from '@arcanejs/toolkit';
|
|
2
|
-
import { Group as Group$1, GroupHeader as GroupHeader$1,
|
|
3
|
-
import {
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { Button as Button$1 } from '@arcanejs/toolkit/components/button';
|
|
6
|
-
import { Label as Label$1 } from '@arcanejs/toolkit/components/label';
|
|
7
|
-
import { Rect as Rect$1 } from '@arcanejs/toolkit/components/rect';
|
|
8
|
-
import { SliderButton as SliderButton$1 } from '@arcanejs/toolkit/components/slider-button';
|
|
9
|
-
import { Switch as Switch$1 } from '@arcanejs/toolkit/components/switch';
|
|
10
|
-
import { Tab as Tab$1, Tabs as Tabs$1 } from '@arcanejs/toolkit/components/tabs';
|
|
11
|
-
import { Timeline as Timeline$1 } from '@arcanejs/toolkit/components/timeline';
|
|
12
|
-
import { TextInput as TextInput$1 } from '@arcanejs/toolkit/components/text-input';
|
|
8
|
+
import { Button as Button$1, Group as Group$1, GroupHeader as GroupHeader$1, Label as Label$1, Rect as Rect$1, SliderButton as SliderButton$1, Switch as Switch$1, Tab as Tab$1, Tabs as Tabs$1, TextInput as TextInput$1, Timeline as Timeline$1 } from '@arcanejs/toolkit';
|
|
9
|
+
import { AnyComponent, BaseParent, Base } from '@arcanejs/toolkit/components/base';
|
|
13
10
|
|
|
14
|
-
type
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
type ComponentClass = new (...args: any[]) => AnyComponent;
|
|
12
|
+
type ComponentsDefinition = {
|
|
13
|
+
[key: string]: ComponentClass;
|
|
14
|
+
};
|
|
15
|
+
type Child = JSX.Element | null | undefined | false | string;
|
|
16
|
+
type Children = Child | Child[];
|
|
17
|
+
type PropsOfComponent<T extends ComponentClass> = T extends new (props?: infer P) => BaseParent<any, any, any> ? Partial<P & {
|
|
18
|
+
children: Children;
|
|
19
|
+
}> : T extends new (props: infer P) => BaseParent<any, any, any> ? P & {
|
|
20
|
+
children?: Children;
|
|
21
|
+
} : T extends new (props?: infer P) => Base<any, any, any> ? Partial<P> : T extends new (props: infer P) => Base<any, any, any> ? P : never;
|
|
22
|
+
type InstanceType<T extends ComponentClass> = T extends new (...args: any[]) => infer R ? R : never;
|
|
23
|
+
type Creators<D extends ComponentsDefinition> = {
|
|
24
|
+
[K in keyof D]: (props: {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}) => AnyComponent;
|
|
27
|
+
};
|
|
28
|
+
type ComponentFunctionForComponent<T extends ComponentClass> = React__default.ForwardRefExoticComponent<React__default.PropsWithoutRef<PropsOfComponent<T>> & React__default.RefAttributes<InstanceType<T>>>;
|
|
29
|
+
type ComponentFunctions<D extends ComponentsDefinition> = {
|
|
30
|
+
[K in keyof D]: ComponentFunctionForComponent<D[K]>;
|
|
31
|
+
};
|
|
32
|
+
type PreparedComponents<D extends ComponentsDefinition> = {
|
|
33
|
+
_namespace: string;
|
|
34
|
+
_creators: Creators<D>;
|
|
35
|
+
} & ComponentFunctions<D>;
|
|
36
|
+
declare const prepareComponents: <D extends ComponentsDefinition>(namespace: string, defn: D) => PreparedComponents<D>;
|
|
26
37
|
|
|
38
|
+
declare const CoreComponents: PreparedComponents<{
|
|
39
|
+
Button: typeof Button$1;
|
|
40
|
+
Group: typeof Group$1;
|
|
41
|
+
GroupHeader: typeof GroupHeader$1;
|
|
42
|
+
Label: typeof Label$1;
|
|
43
|
+
Rect: typeof Rect$1;
|
|
44
|
+
SliderButton: typeof SliderButton$1;
|
|
45
|
+
Switch: typeof Switch$1;
|
|
46
|
+
Tab: typeof Tab$1;
|
|
47
|
+
Tabs: typeof Tabs$1;
|
|
48
|
+
TextInput: typeof TextInput$1;
|
|
49
|
+
Timeline: typeof Timeline$1;
|
|
50
|
+
}>;
|
|
51
|
+
|
|
52
|
+
type ReactToolkitConfig = {
|
|
53
|
+
componentNamespaces: Array<PreparedComponents<any>>;
|
|
54
|
+
};
|
|
27
55
|
declare const ToolkitRenderer: {
|
|
28
|
-
renderGroup: (component: JSX.Element, container: ld.Group) => void;
|
|
29
|
-
render: (component: JSX.Element, container: ld.Toolkit, rootGroupProps?: Props) => void;
|
|
56
|
+
renderGroup: (component: JSX.Element, container: ld.Group, config?: ReactToolkitConfig) => void;
|
|
57
|
+
render: (component: JSX.Element, container: ld.Toolkit, rootGroupProps?: Props, config?: ReactToolkitConfig) => void;
|
|
30
58
|
};
|
|
31
59
|
|
|
32
|
-
|
|
60
|
+
declare const Button: React__default.ForwardRefExoticComponent<Partial<Partial<_arcanejs_toolkit_components_button.InternalProps>> & React__default.RefAttributes<ld.Button>>;
|
|
61
|
+
declare const Group: React__default.ForwardRefExoticComponent<Partial<Partial<_arcanejs_toolkit_components_group.InternalProps> & {
|
|
62
|
+
children: (string | false | JSX.Element | null | undefined) | (string | false | JSX.Element | null | undefined)[];
|
|
63
|
+
}> & React__default.RefAttributes<ld.Group>>;
|
|
64
|
+
declare const GroupHeader: React__default.ForwardRefExoticComponent<Record<never, never> & {
|
|
65
|
+
children?: (string | false | JSX.Element | null | undefined) | (string | false | JSX.Element | null | undefined)[];
|
|
66
|
+
} & React__default.RefAttributes<ld.GroupHeader>>;
|
|
67
|
+
declare const Label: React__default.ForwardRefExoticComponent<Partial<_arcanejs_protocol_styles.LabelComponentStyle & {
|
|
68
|
+
text: string | null;
|
|
69
|
+
}> & React__default.RefAttributes<ld.Label>>;
|
|
70
|
+
declare const Rect: React__default.ForwardRefExoticComponent<Partial<Partial<{
|
|
71
|
+
color: string;
|
|
72
|
+
grow?: boolean | undefined;
|
|
73
|
+
}>> & React__default.RefAttributes<ld.Rect>>;
|
|
74
|
+
declare const SliderButton: React__default.ForwardRefExoticComponent<Partial<Pick<Pick<_arcanejs_protocol_core.SliderButtonComponent, "grow" | "min" | "max" | "step" | "gradient"> & {
|
|
75
|
+
value?: number | undefined;
|
|
76
|
+
defaultValue?: number | undefined;
|
|
77
|
+
onChange?: ((value: number) => void | Promise<void>) | undefined;
|
|
78
|
+
}, "value"> & Partial<Omit<Pick<_arcanejs_protocol_core.SliderButtonComponent, "grow" | "min" | "max" | "step" | "gradient"> & {
|
|
79
|
+
value?: number | undefined;
|
|
80
|
+
defaultValue?: number | undefined;
|
|
81
|
+
onChange?: ((value: number) => void | Promise<void>) | undefined;
|
|
82
|
+
}, "value">>> & React__default.RefAttributes<ld.SliderButton>>;
|
|
83
|
+
declare const Switch: React__default.ForwardRefExoticComponent<Partial<Partial<{
|
|
84
|
+
value?: "on" | "off" | undefined;
|
|
85
|
+
defaultValue?: "on" | "off" | undefined;
|
|
86
|
+
onChange?: ((state: "on" | "off") => void | Promise<void>) | undefined;
|
|
87
|
+
}>> & React__default.RefAttributes<ld.Switch>>;
|
|
88
|
+
declare const Tab: React__default.ForwardRefExoticComponent<{
|
|
89
|
+
name: string;
|
|
90
|
+
} & {
|
|
91
|
+
children?: (string | false | JSX.Element | null | undefined) | (string | false | JSX.Element | null | undefined)[];
|
|
92
|
+
} & React__default.RefAttributes<ld.Tab>>;
|
|
93
|
+
declare const Tabs: React__default.ForwardRefExoticComponent<Partial<{} & {
|
|
94
|
+
children: (string | false | JSX.Element | null | undefined) | (string | false | JSX.Element | null | undefined)[];
|
|
95
|
+
}> & React__default.RefAttributes<ld.Tabs>>;
|
|
96
|
+
declare const TextInput: React__default.ForwardRefExoticComponent<Partial<Partial<{
|
|
97
|
+
value: string | null;
|
|
98
|
+
onChange?: ((value: string) => void | Promise<void>) | undefined;
|
|
99
|
+
}>> & React__default.RefAttributes<ld.TextInput>>;
|
|
100
|
+
declare const Timeline: React__default.ForwardRefExoticComponent<Partial<Partial<{
|
|
101
|
+
state: _arcanejs_protocol_core.TimelineState;
|
|
102
|
+
title: string | null;
|
|
103
|
+
subtitles: string[] | null;
|
|
104
|
+
source: {
|
|
105
|
+
name: string;
|
|
106
|
+
} | null | undefined;
|
|
107
|
+
}>> & React__default.RefAttributes<ld.Timeline>>;
|
|
108
|
+
|
|
109
|
+
export { Button, CoreComponents, Group, GroupHeader, Label, Rect, SliderButton, Switch, Tab, Tabs, TextInput, Timeline, ToolkitRenderer, prepareComponents };
|
package/dist/index.js
CHANGED
|
@@ -1,225 +1,33 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var updateListeners = (type, instance, prevProps, nextProps) => {
|
|
35
|
-
if (isType("button", type, prevProps) && isType("button", type, nextProps)) {
|
|
36
|
-
if (instance instanceof ld.Button) {
|
|
37
|
-
updateListener("click", "onClick", instance, prevProps, nextProps);
|
|
38
|
-
}
|
|
39
|
-
} else if (isType("group", type, prevProps) && isType("group", type, nextProps)) {
|
|
40
|
-
if (instance instanceof ld.Group) {
|
|
41
|
-
updateListener(
|
|
42
|
-
"title-changed",
|
|
43
|
-
"onTitleChanged",
|
|
44
|
-
instance,
|
|
45
|
-
prevProps,
|
|
46
|
-
nextProps
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
} else if (isType("slider-button", type, prevProps) && isType("slider-button", type, nextProps)) {
|
|
50
|
-
if (instance instanceof ld.SliderButton) {
|
|
51
|
-
updateListener("change", "onChange", instance, prevProps, nextProps);
|
|
52
|
-
}
|
|
53
|
-
} else if (isType("switch", type, prevProps) && isType("switch", type, nextProps)) {
|
|
54
|
-
if (instance instanceof ld.Switch) {
|
|
55
|
-
updateListener("change", "onChange", instance, prevProps, nextProps);
|
|
56
|
-
}
|
|
57
|
-
} else if (isType("text-input", type, prevProps) && isType("text-input", type, nextProps)) {
|
|
58
|
-
if (instance instanceof ld.TextInput) {
|
|
59
|
-
updateListener("change", "onChange", instance, prevProps, nextProps);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
var hostConfig = {
|
|
64
|
-
supportsMutation: true,
|
|
65
|
-
supportsPersistence: false,
|
|
66
|
-
noTimeout: -1,
|
|
67
|
-
isPrimaryRenderer: true,
|
|
68
|
-
supportsHydration: false,
|
|
69
|
-
afterActiveInstanceBlur: () => null,
|
|
70
|
-
appendChild: (parentInstance, child) => {
|
|
71
|
-
if (parentInstance instanceof _base.BaseParent) {
|
|
72
|
-
parentInstance.appendChild(child);
|
|
73
|
-
} else {
|
|
74
|
-
throw new Error(`Unexpected Parent: ${parentInstance}`);
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
appendInitialChild: (parentInstance, child) => {
|
|
78
|
-
if (parentInstance instanceof _base.BaseParent) {
|
|
79
|
-
parentInstance.appendChild(child);
|
|
80
|
-
} else {
|
|
81
|
-
throw new Error(`Unexpected Parent: ${parentInstance}`);
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
appendChildToContainer(container, child) {
|
|
85
|
-
container.appendChild(child);
|
|
86
|
-
},
|
|
87
|
-
beforeActiveInstanceBlur: () => null,
|
|
88
|
-
cancelTimeout: (id) => clearTimeout(id),
|
|
89
|
-
clearContainer: (container) => container.removeAllChildren(),
|
|
90
|
-
commitMount: () => {
|
|
91
|
-
throw new Error(`Unexpected call to commitMount()`);
|
|
92
|
-
},
|
|
93
|
-
commitUpdate(instance, updatePayload, type, prevProps, nextProps, _internalHandle) {
|
|
94
|
-
if (canSetProps(instance)) {
|
|
95
|
-
instance.setProps(updatePayload);
|
|
96
|
-
updateListeners(type, instance, prevProps, nextProps);
|
|
97
|
-
} else {
|
|
98
|
-
throw new Error(`Unexpected Instance: ${instance}`);
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
commitTextUpdate: (textInstance, _oldText, newText) => textInstance.setText(newText),
|
|
102
|
-
createInstance: (type, props) => {
|
|
103
|
-
let instance = null;
|
|
104
|
-
if (isType("button", type, props)) {
|
|
105
|
-
instance = new ld.Button(props);
|
|
106
|
-
} else if (isType("group", type, props)) {
|
|
107
|
-
instance = new ld.Group(props);
|
|
108
|
-
} else if (isType("group-header", type, props)) {
|
|
109
|
-
instance = new ld.GroupHeader(props);
|
|
110
|
-
} else if (isType("label", type, props)) {
|
|
111
|
-
instance = new ld.Label(props);
|
|
112
|
-
} else if (isType("rect", type, props)) {
|
|
113
|
-
instance = new ld.Rect(props);
|
|
114
|
-
} else if (isType("slider-button", type, props)) {
|
|
115
|
-
instance = new ld.SliderButton(props);
|
|
116
|
-
} else if (isType("switch", type, props)) {
|
|
117
|
-
instance = new ld.Switch(props);
|
|
118
|
-
} else if (isType("tab", type, props)) {
|
|
119
|
-
instance = new ld.Tab(props);
|
|
120
|
-
} else if (isType("tabs", type, props)) {
|
|
121
|
-
instance = new ld.Tabs(props);
|
|
122
|
-
} else if (isType("text-input", type, props)) {
|
|
123
|
-
instance = new ld.TextInput(props);
|
|
124
|
-
} else if (isType("timeline", type, props)) {
|
|
125
|
-
instance = new ld.Timeline(props);
|
|
126
|
-
}
|
|
127
|
-
if (instance) {
|
|
128
|
-
updateListeners(type, instance, {}, props);
|
|
129
|
-
return instance;
|
|
130
|
-
} else {
|
|
131
|
-
throw new Error(`Not implemented type: ${type}`);
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
createTextInstance: (text) => new ld.Label({ text }),
|
|
135
|
-
detachDeletedInstance: () => null,
|
|
136
|
-
getChildHostContext: (parentHostContext) => parentHostContext,
|
|
137
|
-
getCurrentEventPriority: () => _constants.DefaultEventPriority,
|
|
138
|
-
getInstanceFromNode: () => {
|
|
139
|
-
throw new Error("Not yet implemented.");
|
|
140
|
-
},
|
|
141
|
-
getInstanceFromScope: () => {
|
|
142
|
-
throw new Error("Not yet implemented.");
|
|
143
|
-
},
|
|
144
|
-
getPublicInstance: (instance) => instance,
|
|
145
|
-
getRootHostContext: () => null,
|
|
146
|
-
insertBefore: (parentInstance, child, beforeChild) => {
|
|
147
|
-
if (parentInstance instanceof _base.BaseParent) {
|
|
148
|
-
parentInstance.insertBefore(child, beforeChild);
|
|
149
|
-
} else {
|
|
150
|
-
throw new Error(`Unexpected Parent: ${parentInstance}`);
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
insertInContainerBefore: (container, child, beforeChild) => container.insertBefore(child, beforeChild),
|
|
154
|
-
finalizeInitialChildren: () => false,
|
|
155
|
-
prepareForCommit: () => null,
|
|
156
|
-
preparePortalMount: () => null,
|
|
157
|
-
prepareScopeUpdate: () => null,
|
|
158
|
-
prepareUpdate: (_instance, _type, _oldProps, newProps, _rootContainer, _hostContext) => {
|
|
159
|
-
const updates = {};
|
|
160
|
-
for (const [key, val] of Object.entries(newProps)) {
|
|
161
|
-
if (key !== "children") {
|
|
162
|
-
updates[key] = val;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
if (Object.keys(updates).length) {
|
|
166
|
-
return updates;
|
|
167
|
-
} else {
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
removeChild(parentInstance, child) {
|
|
172
|
-
if (parentInstance instanceof _base.BaseParent) {
|
|
173
|
-
parentInstance.removeChild(child);
|
|
174
|
-
} else {
|
|
175
|
-
throw new Error(`Unexpected Parent: ${parentInstance}`);
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
removeChildFromContainer: (container, child) => container.removeChild(child),
|
|
179
|
-
resetAfterCommit: () => null,
|
|
180
|
-
resetTextContent: () => {
|
|
181
|
-
throw new Error(`Unexpected call to resetTextContent()`);
|
|
182
|
-
},
|
|
183
|
-
scheduleTimeout: (fn, delay) => setTimeout(fn, delay),
|
|
184
|
-
shouldSetTextContent: () => false,
|
|
185
|
-
// Not-implemented
|
|
186
|
-
hideInstance: () => {
|
|
187
|
-
console.log("Not-implemented: hideInstance");
|
|
188
|
-
},
|
|
189
|
-
hideTextInstance: () => {
|
|
190
|
-
console.log("Not-implemented: hideTextInstance");
|
|
191
|
-
},
|
|
192
|
-
unhideInstance: () => {
|
|
193
|
-
console.log("Not-implemented: unhideInstance");
|
|
194
|
-
},
|
|
195
|
-
unhideTextInstance: () => {
|
|
196
|
-
console.log("Not-implemented: unhideTextInstance");
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
var reconciler = _reactreconciler2.default.call(void 0, hostConfig);
|
|
200
|
-
var ToolkitRenderer = {
|
|
201
|
-
renderGroup: (component, container) => {
|
|
202
|
-
const root = reconciler.createContainer(container, 0, false, null);
|
|
203
|
-
const componentWithContexts = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRT2VSMJLjs.LoggerContext.Provider, { value: container.log, children: component });
|
|
204
|
-
reconciler.updateContainer(componentWithContexts, root, null);
|
|
205
|
-
},
|
|
206
|
-
render: (component, container, rootGroupProps) => {
|
|
207
|
-
const group = new ld.Group({ direction: "vertical", ...rootGroupProps });
|
|
208
|
-
container.setRoot(group);
|
|
209
|
-
ToolkitRenderer.renderGroup(component, group);
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
exports.Button = _chunkRKOUSLUWjs.Button; exports.Group = _chunkRKOUSLUWjs.Group; exports.GroupHeader = _chunkRKOUSLUWjs.GroupHeader; exports.Label = _chunkRKOUSLUWjs.Label; exports.Rect = _chunkRKOUSLUWjs.Rect; exports.SliderButton = _chunkRKOUSLUWjs.SliderButton; exports.Switch = _chunkRKOUSLUWjs.Switch; exports.Tab = _chunkRKOUSLUWjs.Tab; exports.Tabs = _chunkRKOUSLUWjs.Tabs; exports.TextInput = _chunkRKOUSLUWjs.TextInput; exports.Timeline = _chunkRKOUSLUWjs.Timeline; exports.ToolkitRenderer = ToolkitRenderer;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunkQ54JXYCVjs = require('./chunk-Q54JXYCV.js');
|
|
17
|
+
require('./chunk-RT2VSMJL.js');
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
exports.Button = _chunkQ54JXYCVjs.Button; exports.CoreComponents = _chunkQ54JXYCVjs.CoreComponents; exports.Group = _chunkQ54JXYCVjs.Group; exports.GroupHeader = _chunkQ54JXYCVjs.GroupHeader; exports.Label = _chunkQ54JXYCVjs.Label; exports.Rect = _chunkQ54JXYCVjs.Rect; exports.SliderButton = _chunkQ54JXYCVjs.SliderButton; exports.Switch = _chunkQ54JXYCVjs.Switch; exports.Tab = _chunkQ54JXYCVjs.Tab; exports.Tabs = _chunkQ54JXYCVjs.Tabs; exports.TextInput = _chunkQ54JXYCVjs.TextInput; exports.Timeline = _chunkQ54JXYCVjs.Timeline; exports.ToolkitRenderer = _chunkQ54JXYCVjs.ToolkitRenderer; exports.prepareComponents = _chunkQ54JXYCVjs.prepareComponents;
|