@apia/tree2-component 4.0.20

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.
@@ -0,0 +1,14 @@
1
+ import { MobXTreeState, MobXTree } from '@apia/tree2-controller';
2
+ export * from '@apia/tree2-controller';
3
+ import * as react from 'react';
4
+ import { BoxProps } from '@apia/theme';
5
+
6
+ declare const Tree: react.MemoExoticComponent<({ getHandler, store: customStore, containerProps, ...props }: Partial<{
7
+ containerProps?: BoxProps;
8
+ } & Pick<MobXTreeState, "aria-label" | "className" | "disableSelection" | "hideEmptyFolders" | "id" | "isMultiple" | "selectionMode" | "toggleNodesOnLabelClick" | "variant" | "onLoadData" | "filterString" | "isLoading" | "onNodeClick" | "onNodeExpanderClick" | "onNodeKeyDown" | "onNodeDoubleClick" | "onSelect" | "title"> & {
9
+ getHandler?: (handler: MobXTree) => unknown;
10
+ store?: MobXTree;
11
+ }>) => react.JSX.Element>;
12
+
13
+ export { Tree };
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,244 @@
1
+ import { MobXTreeNode, MobXTree } from '@apia/tree2-controller';
2
+ export * from '@apia/tree2-controller';
3
+ import { jsxs, Fragment, jsx } from '@apia/theme/jsx-runtime';
4
+ import { memo, useState } from 'react';
5
+ import { usePrevious, shallowEqual } from '@apia/util';
6
+ import { getVariant, Box, Spinner } from '@apia/theme';
7
+ import { observer } from 'mobx-react-lite';
8
+ import { Icon } from '@apia/icons';
9
+ import { IconButton } from '@apia/components';
10
+ import { reaction } from 'mobx';
11
+
12
+ function getTreeContainerProps(tree) {
13
+ const getNode = (el) => {
14
+ const nodeElement = el.closest(
15
+ ".mobxtree__node"
16
+ );
17
+ if (nodeElement) {
18
+ const node = tree.getNodeById(nodeElement.id.slice(1));
19
+ if (node instanceof MobXTreeNode) {
20
+ return node;
21
+ }
22
+ }
23
+ return null;
24
+ };
25
+ return {
26
+ ...getVariant("layout.common.trees.mobx"),
27
+ as: "ul",
28
+ className: "mobxtree",
29
+ id: tree.id,
30
+ onClick: (ev) => {
31
+ const node = getNode(ev.target);
32
+ if (node) {
33
+ ev.stopPropagation();
34
+ node.handleClick(ev);
35
+ }
36
+ },
37
+ onMouseDown: (ev) => {
38
+ const node = getNode(ev.target);
39
+ if (node) {
40
+ ev.preventDefault();
41
+ }
42
+ },
43
+ onDoubleClick: (ev) => {
44
+ const node = getNode(ev.target);
45
+ if (node) {
46
+ ev.stopPropagation();
47
+ node.handleDoubleClick(ev);
48
+ }
49
+ },
50
+ onKeyDown: (ev) => {
51
+ const node = getNode(ev.target);
52
+ if (node) {
53
+ node.handleKeyDown(ev);
54
+ } else {
55
+ const firstNode = tree.state.children.values().next();
56
+ if (firstNode?.value) {
57
+ tree.handleNodeKeyDown(firstNode.value, ev);
58
+ }
59
+ }
60
+ },
61
+ role: "tree"
62
+ };
63
+ }
64
+ function getNodeContainerProps(node) {
65
+ return {
66
+ "aria-expanded": node.state.isExpanded,
67
+ "aria-selected": node.isSelected,
68
+ as: "li",
69
+ className: `mobxtree__node ${node.isFocused ? "focus" : ""} ${node.isSelected ? "selected" : ""}`,
70
+ id: `_${node.id}`,
71
+ role: "treeitem",
72
+ tabIndex: node.isFocused ? 0 : -1
73
+ };
74
+ }
75
+ function getNodeChildrenContainerProps(node) {
76
+ return {
77
+ as: "ul",
78
+ className: "mobxtree__children__group",
79
+ role: "group"
80
+ };
81
+ }
82
+
83
+ const DefaultLabelRenderer = observer(({ node }) => {
84
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
85
+ /* @__PURE__ */ jsx(
86
+ Box,
87
+ {
88
+ as: "span",
89
+ className: "mobxtree__node__label__renderer",
90
+ title: node.state.title,
91
+ children: node.state.label
92
+ }
93
+ ),
94
+ node.state.labelIcons?.length > 0 && /* @__PURE__ */ jsx(Box, { className: "mobxtree__node__label__icons", children: node.state.labelIcons.map(
95
+ ({ className, icon, title, onClick, onKeyDown, ...props }) => /* @__PURE__ */ jsx(
96
+ IconButton,
97
+ {
98
+ className: `mobx__node__label__icon ${className ?? ""}`,
99
+ icon,
100
+ iconSize: "Xs",
101
+ title: title ?? "",
102
+ onClick: (ev) => {
103
+ ev.stopPropagation();
104
+ onClick?.(node, ev);
105
+ },
106
+ onKeyDown: (ev) => {
107
+ onKeyDown?.(node, ev);
108
+ },
109
+ size: "Sm",
110
+ variant: "icon-outline",
111
+ tabIndex: node.isFocused ? 0 : -1,
112
+ ...props
113
+ }
114
+ )
115
+ ) })
116
+ ] });
117
+ });
118
+
119
+ const DefaultIconRenderer = observer(({ node }) => {
120
+ return /* @__PURE__ */ jsx(
121
+ Icon,
122
+ {
123
+ className: "tree__node__icon",
124
+ name: node.state.icon,
125
+ size: node.state.iconSize ?? "iconSm",
126
+ title: node.state.label
127
+ }
128
+ );
129
+ });
130
+
131
+ const Spacer = ({ level }) => {
132
+ return /* @__PURE__ */ jsx(Fragment, { children: Array(level).fill("").map((_, i) => i).map((current) => /* @__PURE__ */ jsx(Box, { className: "spacer" }, current)) });
133
+ };
134
+
135
+ const NodeItemLabel = observer(
136
+ ({ level, node }) => {
137
+ const LabelRenderer = node.state.labelRenderer ?? DefaultLabelRenderer;
138
+ const IconRenderer = node.state.icon && typeof node.state.icon !== "string" ? node.state.icon : DefaultIconRenderer;
139
+ return /* @__PURE__ */ jsxs(Box, { className: "mobxtree__node__label__wrapper", children: [
140
+ /* @__PURE__ */ jsx(Spacer, { level }),
141
+ node.showExpander && /* @__PURE__ */ jsx(Box, { className: "mobxtree__node__expander", children: node.state.isLoading ? /* @__PURE__ */ jsx(
142
+ Spinner,
143
+ {
144
+ className: "mobxtree__node__expander__loading",
145
+ sx: { width: "iconSm", height: "iconSm" }
146
+ }
147
+ ) : /* @__PURE__ */ jsx(
148
+ Icon,
149
+ {
150
+ className: "mobxtree__node__expandIcon",
151
+ onClick: (ev) => node.handleExpanderClick(ev),
152
+ name: node.state.isExpanded ? "ArrowDownThin" : "ArrowRightThin",
153
+ title: "",
154
+ size: 20
155
+ }
156
+ ) }),
157
+ node.state.icon && /* @__PURE__ */ jsx(IconRenderer, { node }),
158
+ /* @__PURE__ */ jsx(Box, { as: "span", className: "mobxtree__node__label", children: /* @__PURE__ */ jsx(LabelRenderer, { node }) })
159
+ ] });
160
+ }
161
+ );
162
+
163
+ const NodeRenderer = observer(
164
+ ({
165
+ level = 0,
166
+ node,
167
+ containerProps
168
+ }) => {
169
+ const children = [...node.state.children.values()];
170
+ if (node instanceof MobXTree) {
171
+ return /* @__PURE__ */ jsx(
172
+ Box,
173
+ {
174
+ ...getTreeContainerProps(node),
175
+ ...containerProps,
176
+ tabIndex: node.focusedNode ? void 0 : 0,
177
+ children: children.map((c) => {
178
+ return /* @__PURE__ */ jsx(NodeRenderer, { level: 0, node: c }, c.id);
179
+ })
180
+ }
181
+ );
182
+ }
183
+ const previousFocused = usePrevious(node.isFocused);
184
+ const shouldFocus = node.isFocused && !previousFocused.current;
185
+ return /* @__PURE__ */ jsxs(
186
+ Box,
187
+ {
188
+ ...getNodeContainerProps(node),
189
+ ...containerProps,
190
+ ref: (el) => {
191
+ if (el && shouldFocus) {
192
+ el.focus();
193
+ }
194
+ },
195
+ children: [
196
+ /* @__PURE__ */ jsx(NodeItemLabel, { level, node }),
197
+ children.length > 0 && node.state.isExpanded && /* @__PURE__ */ jsx(Box, { ...getNodeChildrenContainerProps(), children: [...node.state.children.values()].map((c) => {
198
+ return /* @__PURE__ */ jsx(NodeRenderer, { level: level + 1, node: c }, c.id);
199
+ }) })
200
+ ]
201
+ }
202
+ );
203
+ }
204
+ );
205
+
206
+ const Tree = memo(
207
+ ({
208
+ getHandler,
209
+ store: customStore,
210
+ containerProps,
211
+ ...props
212
+ }) => {
213
+ const [store] = useState(() => {
214
+ const tree = customStore ?? new MobXTree(props);
215
+ getHandler?.(tree);
216
+ reaction(
217
+ () => tree.focusedNode,
218
+ (f) => {
219
+ if (f) {
220
+ const element = document.querySelector(`#_${tree.id} #_${f.id}`);
221
+ if (element instanceof HTMLElement) {
222
+ element.tabIndex = 0;
223
+ element.focus({ preventScroll: true });
224
+ element.querySelector(".mobxtree__node__label__wrapper").scrollIntoView({
225
+ behavior: "auto",
226
+ block: "nearest",
227
+ inline: "nearest"
228
+ });
229
+ }
230
+ }
231
+ }
232
+ );
233
+ return tree;
234
+ });
235
+ const previousProps = usePrevious(props);
236
+ if (!shallowEqual(previousProps.current, props)) {
237
+ Object.assign(store.state, props);
238
+ }
239
+ return /* @__PURE__ */ jsx(NodeRenderer, { node: store, containerProps });
240
+ }
241
+ );
242
+
243
+ export { Tree };
244
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/components/nodeProps.ts","../src/components/renderers/DefaultLabelRenderer.tsx","../src/components/renderers/DefaultIconRenderer.tsx","../src/components/renderers/Spacer.tsx","../src/components/NodeItemLabel.tsx","../src/components/NodeRenderer.tsx","../src/components/Tree.tsx"],"sourcesContent":["import { BoxProps, getVariant } from '@apia/theme';\r\nimport { MobXTree, MobXTreeNode } from '@apia/tree2-controller';\r\n\r\nexport function getTreeContainerProps(tree: MobXTree): BoxProps & {\r\n [key: `data-${string}`]: string;\r\n} {\r\n const getNode = (el: EventTarget) => {\r\n const nodeElement = (el as HTMLElement).closest<HTMLElement>(\r\n '.mobxtree__node',\r\n );\r\n if (nodeElement) {\r\n const node = tree.getNodeById(nodeElement.id.slice(1)); // Se quita el _ del principio\r\n if (node instanceof MobXTreeNode) {\r\n return node;\r\n }\r\n }\r\n return null;\r\n };\r\n\r\n return {\r\n ...getVariant('layout.common.trees.mobx'),\r\n as: 'ul',\r\n className: 'mobxtree',\r\n id: tree.id,\r\n onClick: (ev) => {\r\n const node = getNode(ev.target);\r\n if (node) {\r\n ev.stopPropagation();\r\n node.handleClick(ev);\r\n }\r\n },\r\n onMouseDown: (ev) => {\r\n const node = getNode(ev.target);\r\n if (node) {\r\n ev.preventDefault();\r\n }\r\n },\r\n onDoubleClick: (ev) => {\r\n const node = getNode(ev.target);\r\n if (node) {\r\n ev.stopPropagation();\r\n node.handleDoubleClick(ev);\r\n }\r\n },\r\n onKeyDown: (ev) => {\r\n const node = getNode(ev.target);\r\n if (node) {\r\n node.handleKeyDown(ev);\r\n } else {\r\n const firstNode = tree.state.children.values().next();\r\n if (firstNode?.value) {\r\n tree.handleNodeKeyDown(firstNode.value, ev);\r\n }\r\n }\r\n },\r\n role: 'tree',\r\n };\r\n}\r\n\r\nexport function getNodeContainerProps(node: MobXTreeNode): BoxProps & {\r\n [key: `data-${string}`]: string;\r\n} {\r\n return {\r\n 'aria-expanded': node.state.isExpanded,\r\n 'aria-selected': node.isSelected,\r\n as: 'li',\r\n className: `mobxtree__node ${node.isFocused ? 'focus' : ''} ${node.isSelected ? 'selected' : ''}`,\r\n id: `_${node.id}`,\r\n role: 'treeitem',\r\n tabIndex: node.isFocused ? 0 : -1,\r\n };\r\n}\r\n\r\nexport function getNodeChildrenContainerProps(node: MobXTreeNode): BoxProps {\r\n node;\r\n return {\r\n as: 'ul',\r\n className: 'mobxtree__children__group',\r\n role: 'group',\r\n };\r\n}\r\n","import { Box } from '@apia/theme';\r\nimport { TTreeLabelRenderer } from '../../store/types';\r\nimport { observer } from 'mobx-react-lite';\r\nimport { IconButton } from '@apia/components';\r\n\r\nconst DefaultLabelRenderer: TTreeLabelRenderer = observer(({ node }) => {\r\n return (\r\n <>\r\n <Box\r\n as=\"span\"\r\n className=\"mobxtree__node__label__renderer\"\r\n title={node.state.title}\r\n >\r\n {node.state.label}\r\n </Box>\r\n {node.state.labelIcons?.length > 0 && (\r\n <Box className=\"mobxtree__node__label__icons\">\r\n {node.state.labelIcons.map(\r\n ({ className, icon, title, onClick, onKeyDown, ...props }) => (\r\n <IconButton\r\n className={`mobx__node__label__icon ${className ?? ''}`}\r\n icon={icon}\r\n iconSize=\"Xs\"\r\n title={title ?? ''}\r\n onClick={(ev) => {\r\n ev.stopPropagation();\r\n onClick?.(node, ev as any);\r\n }}\r\n onKeyDown={(ev) => {\r\n onKeyDown?.(node, ev as any);\r\n }}\r\n size=\"Sm\"\r\n variant=\"icon-outline\"\r\n tabIndex={node.isFocused ? 0 : -1}\r\n {...props}\r\n />\r\n ),\r\n )}\r\n </Box>\r\n )}\r\n </>\r\n );\r\n});\r\n\r\nexport default DefaultLabelRenderer;\r\n","import { Icon, TIconName } from '@apia/icons';\r\nimport { TTreeIconRenderer } from '../../store/types';\r\nimport { observer } from 'mobx-react-lite';\r\n\r\nconst DefaultIconRenderer: TTreeIconRenderer = observer(({ node }) => {\r\n return (\r\n <Icon\r\n className=\"tree__node__icon\"\r\n name={node.state.icon as TIconName}\r\n size={node.state.iconSize ?? 'iconSm'}\r\n title={node.state.label}\r\n />\r\n );\r\n});\r\n\r\nexport default DefaultIconRenderer;\r\n","import React from 'react';\r\nimport { Box } from '@apia/theme';\r\n\r\nconst Spacer: React.FunctionComponent<{ level: number }> = ({ level }) => {\r\n return (\r\n <>\r\n {Array(level)\r\n .fill('')\r\n .map((_, i) => i)\r\n .map((current) => (\r\n <Box className=\"spacer\" key={current} />\r\n ))}\r\n </>\r\n );\r\n};\r\n\r\nexport default Spacer;\r\n","import { observer } from 'mobx-react-lite';\r\nimport { MobXTreeNode } from '../store/MobXTreeNode';\r\nimport { Icon } from '@apia/icons';\r\nimport { Box, Spinner } from '@apia/theme';\r\nimport DefaultLabelRenderer from './renderers/DefaultLabelRenderer';\r\nimport DefaultIconRenderer from './renderers/DefaultIconRenderer';\r\nimport Spacer from './renderers/Spacer';\r\n\r\nexport const NodeItemLabel = observer(\r\n ({ level, node }: { level: number; node: MobXTreeNode }) => {\r\n const LabelRenderer = node.state.labelRenderer ?? DefaultLabelRenderer;\r\n const IconRenderer =\r\n node.state.icon && typeof node.state.icon !== 'string'\r\n ? node.state.icon\r\n : DefaultIconRenderer;\r\n\r\n return (\r\n <Box className=\"mobxtree__node__label__wrapper\">\r\n <Spacer level={level} />\r\n {node.showExpander && (\r\n <Box className=\"mobxtree__node__expander\">\r\n {node.state.isLoading ? (\r\n <Spinner\r\n className=\"mobxtree__node__expander__loading\"\r\n sx={{ width: 'iconSm', height: 'iconSm' }}\r\n />\r\n ) : (\r\n <Icon\r\n className=\"mobxtree__node__expandIcon\"\r\n onClick={(ev) => node.handleExpanderClick(ev)}\r\n name={\r\n node.state.isExpanded ? 'ArrowDownThin' : 'ArrowRightThin'\r\n }\r\n title=\"\"\r\n size={20}\r\n />\r\n )}\r\n </Box>\r\n )}\r\n {node.state.icon && <IconRenderer node={node} />}\r\n <Box as=\"span\" className=\"mobxtree__node__label\">\r\n <LabelRenderer node={node} />\r\n </Box>\r\n </Box>\r\n );\r\n },\r\n);\r\n","import { Box, BoxProps } from '@apia/theme';\r\nimport { observer } from 'mobx-react-lite';\r\nimport {\r\n getNodeChildrenContainerProps,\r\n getNodeContainerProps,\r\n getTreeContainerProps,\r\n} from './nodeProps';\r\nimport { NodeItemLabel } from './NodeItemLabel';\r\nimport { usePrevious } from '@apia/util';\r\nimport { MobXTree, MobXTreeNode } from '@apia/tree2-controller';\r\n\r\nexport const NodeRenderer = observer(\r\n ({\r\n level = 0,\r\n node,\r\n containerProps,\r\n }: {\r\n level?: number;\r\n node: MobXTreeNode | MobXTree;\r\n containerProps?: BoxProps;\r\n }) => {\r\n const children = [...node.state.children.values()];\r\n\r\n if (node instanceof MobXTree) {\r\n return (\r\n <Box\r\n {...getTreeContainerProps(node)}\r\n {...containerProps}\r\n tabIndex={node.focusedNode ? undefined : 0}\r\n >\r\n {children.map((c) => {\r\n return <NodeRenderer level={0} key={c.id} node={c} />;\r\n })}\r\n </Box>\r\n );\r\n }\r\n\r\n const previousFocused = usePrevious(node.isFocused);\r\n const shouldFocus = node.isFocused && !previousFocused.current;\r\n\r\n return (\r\n <Box\r\n {...getNodeContainerProps(node)}\r\n {...containerProps}\r\n ref={(el) => {\r\n if (el && shouldFocus) {\r\n el.focus();\r\n }\r\n }}\r\n >\r\n <NodeItemLabel level={level} node={node} />\r\n {children.length > 0 && node.state.isExpanded && (\r\n <Box {...getNodeChildrenContainerProps(node)}>\r\n {[...node.state.children.values()].map((c) => {\r\n return <NodeRenderer level={level + 1} key={c.id} node={c} />;\r\n })}\r\n </Box>\r\n )}\r\n </Box>\r\n );\r\n },\r\n);\r\n","import { memo, useState } from 'react';\r\nimport { MobXTree, MobXTreeState } from '@apia/tree2-controller';\r\nimport { shallowEqual, usePrevious } from '@apia/util';\r\nimport { NodeRenderer } from './NodeRenderer';\r\nimport { reaction } from 'mobx';\r\nimport { BoxProps } from '@apia/theme';\r\n\r\nexport const Tree = memo(\r\n ({\r\n getHandler,\r\n store: customStore,\r\n containerProps,\r\n ...props\r\n }: Partial<\r\n { containerProps?: BoxProps } & Pick<\r\n MobXTreeState,\r\n | 'aria-label'\r\n | 'className'\r\n | 'disableSelection'\r\n | 'hideEmptyFolders'\r\n | 'id'\r\n | 'isMultiple'\r\n | 'selectionMode'\r\n | 'toggleNodesOnLabelClick'\r\n | 'variant'\r\n | 'onLoadData'\r\n | 'filterString'\r\n | 'isLoading'\r\n | 'onNodeClick'\r\n | 'onNodeExpanderClick'\r\n | 'onNodeKeyDown'\r\n | 'onNodeDoubleClick'\r\n | 'onSelect'\r\n | 'title'\r\n > & { getHandler?: (handler: MobXTree) => unknown; store?: MobXTree }\r\n >) => {\r\n const [store] = useState(() => {\r\n const tree = customStore ?? new MobXTree(props);\r\n getHandler?.(tree);\r\n\r\n reaction(\r\n () => tree.focusedNode,\r\n (f) => {\r\n if (f) {\r\n const element = document.querySelector(`#_${tree.id} #_${f.id}`);\r\n if (element instanceof HTMLElement) {\r\n element.tabIndex = 0;\r\n element.focus({ preventScroll: true });\r\n element\r\n .querySelector<HTMLElement>('.mobxtree__node__label__wrapper')!\r\n .scrollIntoView({\r\n behavior: 'auto',\r\n block: 'nearest',\r\n inline: 'nearest',\r\n });\r\n }\r\n }\r\n },\r\n );\r\n\r\n return tree;\r\n });\r\n\r\n const previousProps = usePrevious(props);\r\n if (!shallowEqual(previousProps.current, props)) {\r\n Object.assign(store.state, props);\r\n }\r\n\r\n return <NodeRenderer node={store} containerProps={containerProps} />;\r\n },\r\n);\r\n"],"names":[],"mappings":";;;;;;;;;;;AAGO,SAAS,sBAAsB,IAAA,EAEpC;AACA,EAAA,MAAM,OAAA,GAAU,CAAC,EAAA,KAAoB;AACnC,IAAA,MAAM,cAAe,EAAA,CAAmB,OAAA;AAAA,MACtC;AAAA,KACF;AACA,IAAA,IAAI,WAAA,EAAa;AACf,MAAA,MAAM,OAAO,IAAA,CAAK,WAAA,CAAY,YAAY,EAAA,CAAG,KAAA,CAAM,CAAC,CAAC,CAAA;AACrD,MAAA,IAAI,gBAAgB,YAAA,EAAc;AAChC,QAAA,OAAO,IAAA;AAAA;AACT;AAEF,IAAA,OAAO,IAAA;AAAA,GACT;AAEA,EAAA,OAAO;AAAA,IACL,GAAG,WAAW,0BAA0B,CAAA;AAAA,IACxC,EAAA,EAAI,IAAA;AAAA,IACJ,SAAA,EAAW,UAAA;AAAA,IACX,IAAI,IAAA,CAAK,EAAA;AAAA,IACT,OAAA,EAAS,CAAC,EAAA,KAAO;AACf,MAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,EAAA,CAAG,MAAM,CAAA;AAC9B,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,EAAA,CAAG,eAAA,EAAgB;AACnB,QAAA,IAAA,CAAK,YAAY,EAAE,CAAA;AAAA;AACrB,KACF;AAAA,IACA,WAAA,EAAa,CAAC,EAAA,KAAO;AACnB,MAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,EAAA,CAAG,MAAM,CAAA;AAC9B,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,EAAA,CAAG,cAAA,EAAe;AAAA;AACpB,KACF;AAAA,IACA,aAAA,EAAe,CAAC,EAAA,KAAO;AACrB,MAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,EAAA,CAAG,M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.20",
4
+ "sideEffects": false,
5
+ "author": "Alexis Leite <alexisleite@live.com>",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.js",
8
+ "type": "module",
9
+ "typings": "dist/index.d.ts",
10
+ "scripts": {
11
+ "libDev": "rollup --config ../../config/rollup.common.mjs --environment MODE:development,ENTRY:index.ts",
12
+ "libBuild": "rollup --config ../../config/rollup.common.mjs --environment MODE:production,ENTRY:index.ts",
13
+ "libWatch": "rollup --watch --config ../../config/rollup.common.mjs --environment MODE:development,ENTRY:index.ts,WATCH:true",
14
+ "libWatchDevExecution": "rollup --watch --config ../../config/rollup.common.mjs --environment MODE:development,ENTRY:index.ts,WATCH:true,DEV_SERVER_MODULE:execution",
15
+ "libWatchDevDashboards": "rollup --watch --config ../../config/rollup.common.mjs --environment MODE:development,ENTRY:index.ts,WATCH:true,DEV_SERVER_MODULE:dashboards"
16
+ },
17
+ "dependencies": {
18
+ "@apia/components": "^4.0.20",
19
+ "@apia/icons": "^4.0.20",
20
+ "@apia/theme": "^4.0.20",
21
+ "@apia/tree2-controller": "^4.0.20",
22
+ "@apia/util": "^4.0.20",
23
+ "@types/uuid": "^9.0.8",
24
+ "ahooks": "^3.7.10",
25
+ "mobx": "^6.12.3",
26
+ "mobx-react-lite": "^4.0.7",
27
+ "uuid": "^9.0.1"
28
+ },
29
+ "devDependencies": {
30
+ "@types/react": "^18.2.43",
31
+ "@types/react-dom": "^18.2.17",
32
+ "@typescript-eslint/eslint-plugin": "^6.14.0",
33
+ "axios": "^1.3.5",
34
+ "typescript": "5.4.2"
35
+ },
36
+ "peerDependencies": {
37
+ "react": "^18.2.0",
38
+ "react-dom": "^18.2.0"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public",
42
+ "registry": "https://registry.npmjs.org/"
43
+ },
44
+ "gitHead": "dabff9ca7bf9d14298fe7a661d73607a35a4df2a"
45
+ }