@vuu-ui/vuu-layout 2.1.18 → 2.1.19-beta.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.
Files changed (265) hide show
  1. package/package.json +14 -16
  2. package/types/dock-layout/DockLayout.d.ts +4 -4
  3. package/types/dock-layout/Drawer.d.ts +4 -4
  4. package/types/drag-drop/BoxModel.d.ts +7 -7
  5. package/types/flexbox/FlexboxLayout.d.ts +4 -4
  6. package/types/flexbox/Splitter.d.ts +1 -1
  7. package/types/layout-reducer/layoutUtils.d.ts +1 -1
  8. package/types/layout-reducer/remove-layout-element.d.ts +1 -1
  9. package/types/layout-reducer/replace-layout-element.d.ts +2 -2
  10. package/types/layout-reducer/resize-flex-children.d.ts +2 -2
  11. package/types/layout-view/useView.d.ts +1 -1
  12. package/types/placeholder/Placeholder.d.ts +4 -4
  13. package/types/responsive/overflowUtils.d.ts +2 -2
  14. package/types/stack/StackLayout.d.ts +4 -4
  15. package/types/tools/devtools-box/layout-configurator.d.ts +26 -26
  16. package/types/tools/devtools-tree/layout-tree-viewer.d.ts +2 -2
  17. package/types/utils/pathUtils.d.ts +1 -1
  18. package/cjs/Component.js +0 -14
  19. package/cjs/Component.js.map +0 -1
  20. package/cjs/LayoutContainer.css.js +0 -6
  21. package/cjs/LayoutContainer.css.js.map +0 -1
  22. package/cjs/LayoutContainer.js +0 -33
  23. package/cjs/LayoutContainer.js.map +0 -1
  24. package/cjs/dock-layout/DockLayout.css.js +0 -6
  25. package/cjs/dock-layout/DockLayout.css.js.map +0 -1
  26. package/cjs/dock-layout/DockLayout.js +0 -41
  27. package/cjs/dock-layout/DockLayout.js.map +0 -1
  28. package/cjs/dock-layout/Drawer.css.js +0 -6
  29. package/cjs/dock-layout/Drawer.css.js.map +0 -1
  30. package/cjs/dock-layout/Drawer.js +0 -95
  31. package/cjs/dock-layout/Drawer.js.map +0 -1
  32. package/cjs/drag-drop/BoxModel.js +0 -416
  33. package/cjs/drag-drop/BoxModel.js.map +0 -1
  34. package/cjs/drag-drop/DragState.js +0 -161
  35. package/cjs/drag-drop/DragState.js.map +0 -1
  36. package/cjs/drag-drop/Draggable.js +0 -192
  37. package/cjs/drag-drop/Draggable.js.map +0 -1
  38. package/cjs/drag-drop/DropTarget.js +0 -257
  39. package/cjs/drag-drop/DropTarget.js.map +0 -1
  40. package/cjs/drag-drop/DropTargetRenderer.js +0 -218
  41. package/cjs/drag-drop/DropTargetRenderer.js.map +0 -1
  42. package/cjs/flexbox/Flexbox.css.js +0 -6
  43. package/cjs/flexbox/Flexbox.css.js.map +0 -1
  44. package/cjs/flexbox/Flexbox.js +0 -69
  45. package/cjs/flexbox/Flexbox.js.map +0 -1
  46. package/cjs/flexbox/FlexboxLayout.js +0 -30
  47. package/cjs/flexbox/FlexboxLayout.js.map +0 -1
  48. package/cjs/flexbox/Splitter.css.js +0 -6
  49. package/cjs/flexbox/Splitter.css.js.map +0 -1
  50. package/cjs/flexbox/Splitter.js +0 -122
  51. package/cjs/flexbox/Splitter.js.map +0 -1
  52. package/cjs/flexbox/flexbox-utils.js +0 -95
  53. package/cjs/flexbox/flexbox-utils.js.map +0 -1
  54. package/cjs/flexbox/useSplitterResizing.js +0 -197
  55. package/cjs/flexbox/useSplitterResizing.js.map +0 -1
  56. package/cjs/index.js +0 -122
  57. package/cjs/index.js.map +0 -1
  58. package/cjs/layout-action.js +0 -24
  59. package/cjs/layout-action.js.map +0 -1
  60. package/cjs/layout-header/Header.css.js +0 -6
  61. package/cjs/layout-header/Header.css.js.map +0 -1
  62. package/cjs/layout-header/Header.js +0 -152
  63. package/cjs/layout-header/Header.js.map +0 -1
  64. package/cjs/layout-header/useHeader.js +0 -85
  65. package/cjs/layout-header/useHeader.js.map +0 -1
  66. package/cjs/layout-provider/LayoutProvider.js +0 -304
  67. package/cjs/layout-provider/LayoutProvider.js.map +0 -1
  68. package/cjs/layout-provider/LayoutProviderContext.js +0 -23
  69. package/cjs/layout-provider/LayoutProviderContext.js.map +0 -1
  70. package/cjs/layout-provider/useLayoutDragDrop.js +0 -177
  71. package/cjs/layout-provider/useLayoutDragDrop.js.map +0 -1
  72. package/cjs/layout-reducer/flexUtils.js +0 -227
  73. package/cjs/layout-reducer/flexUtils.js.map +0 -1
  74. package/cjs/layout-reducer/insert-layout-element.js +0 -286
  75. package/cjs/layout-reducer/insert-layout-element.js.map +0 -1
  76. package/cjs/layout-reducer/layout-reducer.js +0 -202
  77. package/cjs/layout-reducer/layout-reducer.js.map +0 -1
  78. package/cjs/layout-reducer/layoutTypes.js +0 -40
  79. package/cjs/layout-reducer/layoutTypes.js.map +0 -1
  80. package/cjs/layout-reducer/layoutUtils.js +0 -237
  81. package/cjs/layout-reducer/layoutUtils.js.map +0 -1
  82. package/cjs/layout-reducer/move-layout-element.js +0 -31
  83. package/cjs/layout-reducer/move-layout-element.js.map +0 -1
  84. package/cjs/layout-reducer/remove-layout-element.js +0 -237
  85. package/cjs/layout-reducer/remove-layout-element.js.map +0 -1
  86. package/cjs/layout-reducer/replace-layout-element.js +0 -96
  87. package/cjs/layout-reducer/replace-layout-element.js.map +0 -1
  88. package/cjs/layout-reducer/resize-flex-children.js +0 -62
  89. package/cjs/layout-reducer/resize-flex-children.js.map +0 -1
  90. package/cjs/layout-reducer/wrap-layout-element.js +0 -211
  91. package/cjs/layout-reducer/wrap-layout-element.js.map +0 -1
  92. package/cjs/layout-view/View.css.js +0 -6
  93. package/cjs/layout-view/View.css.js.map +0 -1
  94. package/cjs/layout-view/View.js +0 -160
  95. package/cjs/layout-view/View.js.map +0 -1
  96. package/cjs/layout-view/useView.js +0 -75
  97. package/cjs/layout-view/useView.js.map +0 -1
  98. package/cjs/layout-view/useViewBroadcastChannel.js +0 -35
  99. package/cjs/layout-view/useViewBroadcastChannel.js.map +0 -1
  100. package/cjs/layout-view/useViewResize.js +0 -42
  101. package/cjs/layout-view/useViewResize.js.map +0 -1
  102. package/cjs/layout-view-actions/ViewContext.js +0 -16
  103. package/cjs/layout-view-actions/ViewContext.js.map +0 -1
  104. package/cjs/layout-view-actions/useViewActionDispatcher.js +0 -112
  105. package/cjs/layout-view-actions/useViewActionDispatcher.js.map +0 -1
  106. package/cjs/layout-view-actions/useViewContributions.js +0 -33
  107. package/cjs/layout-view-actions/useViewContributions.js.map +0 -1
  108. package/cjs/palette/Palette.css.js +0 -6
  109. package/cjs/palette/Palette.css.js.map +0 -1
  110. package/cjs/palette/Palette.js +0 -115
  111. package/cjs/palette/Palette.js.map +0 -1
  112. package/cjs/placeholder/LayoutStartPanel.css.js +0 -6
  113. package/cjs/placeholder/LayoutStartPanel.css.js.map +0 -1
  114. package/cjs/placeholder/LayoutStartPanel.js +0 -56
  115. package/cjs/placeholder/LayoutStartPanel.js.map +0 -1
  116. package/cjs/placeholder/Placeholder.css.js +0 -6
  117. package/cjs/placeholder/Placeholder.css.js.map +0 -1
  118. package/cjs/placeholder/Placeholder.js +0 -34
  119. package/cjs/placeholder/Placeholder.js.map +0 -1
  120. package/cjs/responsive/useResizeObserver.js +0 -118
  121. package/cjs/responsive/useResizeObserver.js.map +0 -1
  122. package/cjs/responsive/utils.js +0 -34
  123. package/cjs/responsive/utils.js.map +0 -1
  124. package/cjs/stack/Stack.css.js +0 -6
  125. package/cjs/stack/Stack.css.js.map +0 -1
  126. package/cjs/stack/Stack.js +0 -150
  127. package/cjs/stack/Stack.js.map +0 -1
  128. package/cjs/stack/StackLayout.js +0 -116
  129. package/cjs/stack/StackLayout.js.map +0 -1
  130. package/cjs/use-persistent-state.js +0 -63
  131. package/cjs/use-persistent-state.js.map +0 -1
  132. package/cjs/utils/pathUtils.js +0 -293
  133. package/cjs/utils/pathUtils.js.map +0 -1
  134. package/cjs/utils/propUtils.js +0 -27
  135. package/cjs/utils/propUtils.js.map +0 -1
  136. package/cjs/utils/refUtils.js +0 -12
  137. package/cjs/utils/refUtils.js.map +0 -1
  138. package/cjs/utils/styleUtils.js +0 -15
  139. package/cjs/utils/styleUtils.js.map +0 -1
  140. package/cjs/utils/typeOf.js +0 -27
  141. package/cjs/utils/typeOf.js.map +0 -1
  142. package/esm/Component.js +0 -12
  143. package/esm/Component.js.map +0 -1
  144. package/esm/LayoutContainer.css.js +0 -4
  145. package/esm/LayoutContainer.css.js.map +0 -1
  146. package/esm/LayoutContainer.js +0 -31
  147. package/esm/LayoutContainer.js.map +0 -1
  148. package/esm/dock-layout/DockLayout.css.js +0 -4
  149. package/esm/dock-layout/DockLayout.css.js.map +0 -1
  150. package/esm/dock-layout/DockLayout.js +0 -39
  151. package/esm/dock-layout/DockLayout.js.map +0 -1
  152. package/esm/dock-layout/Drawer.css.js +0 -4
  153. package/esm/dock-layout/Drawer.css.js.map +0 -1
  154. package/esm/dock-layout/Drawer.js +0 -93
  155. package/esm/dock-layout/Drawer.js.map +0 -1
  156. package/esm/drag-drop/BoxModel.js +0 -409
  157. package/esm/drag-drop/BoxModel.js.map +0 -1
  158. package/esm/drag-drop/DragState.js +0 -159
  159. package/esm/drag-drop/DragState.js.map +0 -1
  160. package/esm/drag-drop/Draggable.js +0 -190
  161. package/esm/drag-drop/Draggable.js.map +0 -1
  162. package/esm/drag-drop/DropTarget.js +0 -253
  163. package/esm/drag-drop/DropTarget.js.map +0 -1
  164. package/esm/drag-drop/DropTargetRenderer.js +0 -216
  165. package/esm/drag-drop/DropTargetRenderer.js.map +0 -1
  166. package/esm/flexbox/Flexbox.css.js +0 -4
  167. package/esm/flexbox/Flexbox.css.js.map +0 -1
  168. package/esm/flexbox/Flexbox.js +0 -67
  169. package/esm/flexbox/Flexbox.js.map +0 -1
  170. package/esm/flexbox/FlexboxLayout.js +0 -28
  171. package/esm/flexbox/FlexboxLayout.js.map +0 -1
  172. package/esm/flexbox/Splitter.css.js +0 -4
  173. package/esm/flexbox/Splitter.css.js.map +0 -1
  174. package/esm/flexbox/Splitter.js +0 -120
  175. package/esm/flexbox/Splitter.js.map +0 -1
  176. package/esm/flexbox/flexbox-utils.js +0 -89
  177. package/esm/flexbox/flexbox-utils.js.map +0 -1
  178. package/esm/flexbox/useSplitterResizing.js +0 -195
  179. package/esm/flexbox/useSplitterResizing.js.map +0 -1
  180. package/esm/index.js +0 -33
  181. package/esm/index.js.map +0 -1
  182. package/esm/layout-action.js +0 -22
  183. package/esm/layout-action.js.map +0 -1
  184. package/esm/layout-header/Header.css.js +0 -4
  185. package/esm/layout-header/Header.css.js.map +0 -1
  186. package/esm/layout-header/Header.js +0 -150
  187. package/esm/layout-header/Header.js.map +0 -1
  188. package/esm/layout-header/useHeader.js +0 -83
  189. package/esm/layout-header/useHeader.js.map +0 -1
  190. package/esm/layout-provider/LayoutProvider.js +0 -297
  191. package/esm/layout-provider/LayoutProvider.js.map +0 -1
  192. package/esm/layout-provider/LayoutProviderContext.js +0 -20
  193. package/esm/layout-provider/LayoutProviderContext.js.map +0 -1
  194. package/esm/layout-provider/useLayoutDragDrop.js +0 -175
  195. package/esm/layout-provider/useLayoutDragDrop.js.map +0 -1
  196. package/esm/layout-reducer/flexUtils.js +0 -218
  197. package/esm/layout-reducer/flexUtils.js.map +0 -1
  198. package/esm/layout-reducer/insert-layout-element.js +0 -282
  199. package/esm/layout-reducer/insert-layout-element.js.map +0 -1
  200. package/esm/layout-reducer/layout-reducer.js +0 -200
  201. package/esm/layout-reducer/layout-reducer.js.map +0 -1
  202. package/esm/layout-reducer/layoutTypes.js +0 -36
  203. package/esm/layout-reducer/layoutTypes.js.map +0 -1
  204. package/esm/layout-reducer/layoutUtils.js +0 -226
  205. package/esm/layout-reducer/layoutUtils.js.map +0 -1
  206. package/esm/layout-reducer/move-layout-element.js +0 -29
  207. package/esm/layout-reducer/move-layout-element.js.map +0 -1
  208. package/esm/layout-reducer/remove-layout-element.js +0 -235
  209. package/esm/layout-reducer/remove-layout-element.js.map +0 -1
  210. package/esm/layout-reducer/replace-layout-element.js +0 -92
  211. package/esm/layout-reducer/replace-layout-element.js.map +0 -1
  212. package/esm/layout-reducer/resize-flex-children.js +0 -59
  213. package/esm/layout-reducer/resize-flex-children.js.map +0 -1
  214. package/esm/layout-reducer/wrap-layout-element.js +0 -209
  215. package/esm/layout-reducer/wrap-layout-element.js.map +0 -1
  216. package/esm/layout-view/View.css.js +0 -4
  217. package/esm/layout-view/View.css.js.map +0 -1
  218. package/esm/layout-view/View.js +0 -158
  219. package/esm/layout-view/View.js.map +0 -1
  220. package/esm/layout-view/useView.js +0 -73
  221. package/esm/layout-view/useView.js.map +0 -1
  222. package/esm/layout-view/useViewBroadcastChannel.js +0 -33
  223. package/esm/layout-view/useViewBroadcastChannel.js.map +0 -1
  224. package/esm/layout-view/useViewResize.js +0 -40
  225. package/esm/layout-view/useViewResize.js.map +0 -1
  226. package/esm/layout-view-actions/ViewContext.js +0 -12
  227. package/esm/layout-view-actions/ViewContext.js.map +0 -1
  228. package/esm/layout-view-actions/useViewActionDispatcher.js +0 -110
  229. package/esm/layout-view-actions/useViewActionDispatcher.js.map +0 -1
  230. package/esm/layout-view-actions/useViewContributions.js +0 -31
  231. package/esm/layout-view-actions/useViewContributions.js.map +0 -1
  232. package/esm/palette/Palette.css.js +0 -4
  233. package/esm/palette/Palette.css.js.map +0 -1
  234. package/esm/palette/Palette.js +0 -112
  235. package/esm/palette/Palette.js.map +0 -1
  236. package/esm/placeholder/LayoutStartPanel.css.js +0 -4
  237. package/esm/placeholder/LayoutStartPanel.css.js.map +0 -1
  238. package/esm/placeholder/LayoutStartPanel.js +0 -54
  239. package/esm/placeholder/LayoutStartPanel.js.map +0 -1
  240. package/esm/placeholder/Placeholder.css.js +0 -4
  241. package/esm/placeholder/Placeholder.css.js.map +0 -1
  242. package/esm/placeholder/Placeholder.js +0 -32
  243. package/esm/placeholder/Placeholder.js.map +0 -1
  244. package/esm/responsive/useResizeObserver.js +0 -112
  245. package/esm/responsive/useResizeObserver.js.map +0 -1
  246. package/esm/responsive/utils.js +0 -31
  247. package/esm/responsive/utils.js.map +0 -1
  248. package/esm/stack/Stack.css.js +0 -4
  249. package/esm/stack/Stack.css.js.map +0 -1
  250. package/esm/stack/Stack.js +0 -148
  251. package/esm/stack/Stack.js.map +0 -1
  252. package/esm/stack/StackLayout.js +0 -114
  253. package/esm/stack/StackLayout.js.map +0 -1
  254. package/esm/use-persistent-state.js +0 -58
  255. package/esm/use-persistent-state.js.map +0 -1
  256. package/esm/utils/pathUtils.js +0 -280
  257. package/esm/utils/pathUtils.js.map +0 -1
  258. package/esm/utils/propUtils.js +0 -23
  259. package/esm/utils/propUtils.js.map +0 -1
  260. package/esm/utils/refUtils.js +0 -10
  261. package/esm/utils/refUtils.js.map +0 -1
  262. package/esm/utils/styleUtils.js +0 -13
  263. package/esm/utils/styleUtils.js.map +0 -1
  264. package/esm/utils/typeOf.js +0 -23
  265. package/esm/utils/typeOf.js.map +0 -1
@@ -1,280 +0,0 @@
1
- import { isContainer } from '@vuu-ui/vuu-utils';
2
- import React, { isValidElement } from 'react';
3
- import { getProps, getProp } from './propUtils.js';
4
- import { typeOf } from './typeOf.js';
5
-
6
- const removeFinalPathSegment = (path) => {
7
- const pos = path.lastIndexOf(".");
8
- if (pos === -1) {
9
- return path;
10
- } else {
11
- return path.slice(0, pos);
12
- }
13
- };
14
- const getChildren = (c) => React.isValidElement(c.props.children) ? [c.props.children] : c.props.children;
15
- const resolvePath = (source, path = "") => {
16
- const [step1, ...steps] = path.split(".");
17
- if (step1?.startsWith("#")) {
18
- const node = findTargetById(source, step1.slice(1), true);
19
- if (node && steps.length) {
20
- return resolvePath(node, steps.join("."));
21
- }
22
- } else if (step1 === "ACTIVE_CHILD") {
23
- const { active } = getProps(source);
24
- const children = getChildren(source);
25
- const { path: path2 } = getProps(children[active]);
26
- return path2;
27
- }
28
- return "";
29
- };
30
- const resolveJSONPath = (source, path = "") => {
31
- const [step1, ...steps] = path.split(".");
32
- if (step1?.startsWith("#")) {
33
- const node = findTargetJSONById(source, step1.slice(1), true);
34
- if (node && steps.length) {
35
- return resolveJSONPath(node, steps.join("."));
36
- }
37
- } else if (step1 === "ACTIVE_CHILD") {
38
- const { children, props } = source;
39
- const { active } = props;
40
- if (typeof active === "number" && children?.[active]) {
41
- return children[active];
42
- }
43
- }
44
- return;
45
- };
46
- function followPathToParent(source, path) {
47
- const { "data-path": dataPath, path: sourcePath = dataPath } = getProps(source);
48
- if (path === "0") return null;
49
- if (path === sourcePath) return null;
50
- return followPath(source, removeFinalPathSegment(path), true);
51
- }
52
- function findTarget(source, test) {
53
- if (source) {
54
- const { children, ...props } = getProps(source);
55
- if (test(props)) {
56
- return source;
57
- }
58
- if (React.Children.count(children) > 0) {
59
- const array = React.isValidElement(children) ? [children] : children;
60
- for (const child of array) {
61
- const target = findTarget(child, test);
62
- if (target) {
63
- return target;
64
- }
65
- }
66
- }
67
- }
68
- }
69
- function containerOf(source, target) {
70
- if (target === source) {
71
- return null;
72
- }
73
- const { path: sourcePath, children } = getProps(source);
74
- const { idx, finalStep } = nextStep(sourcePath, getProp(target, "path"));
75
- if (finalStep) {
76
- return source;
77
- }
78
- if (children === void 0 || children[idx] === void 0) {
79
- return null;
80
- }
81
- return containerOf(children[idx], target);
82
- }
83
- const getChild = (children, idx) => {
84
- if (React.isValidElement(children) && idx == 0) {
85
- return children;
86
- }
87
- if (Array.isArray(children)) {
88
- return children[idx];
89
- }
90
- };
91
- function followPathToComponent(component, path) {
92
- const paths = path.split(".");
93
- let children = [component];
94
- for (let i = 0; i < paths.length; i++) {
95
- const idx = parseInt(paths[i]);
96
- const child = children[idx];
97
- if (i === paths.length - 1) {
98
- return child;
99
- }
100
- children = getChildren(child);
101
- }
102
- }
103
- const findTargetById = (source, id, throwIfNotFound = true) => {
104
- const { children, id: idProp } = source.props;
105
- if (idProp === id) {
106
- return source;
107
- }
108
- if (React.Children.count(children) > 0) {
109
- const childArray = isValidElement(children) ? [children] : children;
110
- for (const child of childArray) {
111
- if (isValidElement(child)) {
112
- const target = findTargetById(child, id, false);
113
- if (target) {
114
- return target;
115
- }
116
- }
117
- }
118
- }
119
- if (throwIfNotFound === true) {
120
- throw Error(`pathUtils.findTargetById id #${id} not found in source`);
121
- }
122
- };
123
- const findTargetJSONById = (source, id, throwIfNotFound = true) => {
124
- const { children, id: idProp } = source;
125
- if (idProp === id) {
126
- return source;
127
- }
128
- if (Array.isArray(children) && children.length > 0) {
129
- for (const child of children) {
130
- if (child !== null && typeof child === "object") {
131
- const target = findTargetJSONById(child, id, false);
132
- if (target) {
133
- return target;
134
- }
135
- }
136
- }
137
- }
138
- if (throwIfNotFound === true) {
139
- throw Error(`pathUtils.findTargetJSONById id #${id} not found in source`);
140
- }
141
- };
142
- function followPath(source, path, throwIfNotFound = false) {
143
- if (path.startsWith("#")) {
144
- return findTargetById(source, path.slice(1), throwIfNotFound);
145
- }
146
- const { "data-path": dataPath, path: sourcePath = dataPath } = getProps(source);
147
- if (path.indexOf(sourcePath) !== 0) {
148
- throw Error(
149
- `pathUtils.followPath path ${path} is not within source path ${sourcePath}`
150
- );
151
- }
152
- const route = path.slice(sourcePath.length + 1);
153
- if (route === "") {
154
- return source;
155
- }
156
- let target = source;
157
- const paths = route.split(".");
158
- for (let i = 0; i < paths.length; i++) {
159
- if (React.Children.count(target.props.children) === 0) {
160
- const message = `element at 0.${paths.slice(0, i).join(".")} has no children, so cannot fulfill rest of path ${paths.slice(i).join(".")}`;
161
- if (throwIfNotFound) {
162
- throw Error(message);
163
- } else {
164
- console.warn(message);
165
- return;
166
- }
167
- }
168
- target = getChild(target.props.children, parseInt(paths[i]));
169
- if (target === void 0) {
170
- const message = `model at 0.${paths.slice(0, i).join(".")} has no children that fulfill next step of path ${paths.slice(i).join(".")}`;
171
- if (throwIfNotFound) {
172
- throw Error(message);
173
- } else {
174
- console.warn(message);
175
- }
176
- }
177
- }
178
- return target;
179
- }
180
- function nextLeaf(root, path) {
181
- const parent = followPathToParent(root, path);
182
- let pathIndices = path.split(".").map((idx) => parseInt(idx, 10));
183
- if (parent) {
184
- const lastIdx = pathIndices.pop();
185
- const { children } = parent.props;
186
- if (children.length - 1 > lastIdx) {
187
- return firstLeaf(children[lastIdx + 1]);
188
- } else {
189
- const parentIdx = pathIndices.pop();
190
- const nextParent = followPathToParent(root, getProp(parent, "path"));
191
- if (nextParent && typeof parentIdx === "number") {
192
- pathIndices = nextParent.props.path.split(".").map((idx) => parseInt(idx, 10));
193
- if (nextParent.props.children.length - 1 > parentIdx) {
194
- const nextStep2 = nextParent.props.children[parentIdx + 1];
195
- if (isContainer(typeOf(nextStep2))) {
196
- return firstLeaf(nextStep2);
197
- } else {
198
- return nextStep2;
199
- }
200
- }
201
- }
202
- }
203
- }
204
- return firstLeaf(root);
205
- }
206
- function previousLeaf(root, path) {
207
- const pathIndices = path.split(".").map((idx) => parseInt(idx, 10));
208
- let lastIdx = pathIndices.pop();
209
- let parent = followPathToParent(root, path);
210
- if (parent != null && typeof lastIdx === "number") {
211
- const { children } = parent.props;
212
- if (lastIdx > 0) {
213
- return lastLeaf(children[lastIdx - 1]);
214
- } else {
215
- while (pathIndices.length > 1) {
216
- lastIdx = pathIndices.pop();
217
- parent = followPathToParent(
218
- root,
219
- getProp(parent, "path")
220
- );
221
- if (lastIdx > 0) {
222
- const nextStep2 = parent.props.children[lastIdx - 1];
223
- if (isContainer(typeOf(nextStep2))) {
224
- return lastLeaf(nextStep2);
225
- }
226
- return nextStep2;
227
- }
228
- }
229
- }
230
- }
231
- return lastLeaf(root);
232
- }
233
- function firstLeaf(layoutRoot) {
234
- if (isContainer(typeOf(layoutRoot))) {
235
- const { children } = layoutRoot.props || layoutRoot;
236
- return firstLeaf(children[0]);
237
- }
238
- return layoutRoot;
239
- }
240
- function lastLeaf(root) {
241
- if (isContainer(typeOf(root))) {
242
- const { children } = root.props || root;
243
- return lastLeaf(children[children.length - 1]);
244
- }
245
- return root;
246
- }
247
- function nextStep(pathSoFar, targetPath, followPathToEnd = false) {
248
- if (pathSoFar === targetPath) {
249
- return { idx: -1, finalStep: true };
250
- }
251
- const pathVisited = `${pathSoFar}.`;
252
- if (!targetPath.startsWith(pathVisited)) {
253
- throw Error("pathUtils nextStep has strayed from the path");
254
- }
255
- const endOfTheLine = followPathToEnd ? 0 : 1;
256
- const paths = targetPath.replace(pathVisited, "").split(".").map((n) => parseInt(n, 10));
257
- return { idx: paths[0], finalStep: paths.length === endOfTheLine };
258
- }
259
- function resetPath(model, path, additionalProps) {
260
- if (getProp(model, "path") === path) {
261
- return model;
262
- }
263
- const children = [];
264
- React.Children.forEach(model.props.children, (child, i) => {
265
- if (!getProp(child, "path")) {
266
- children.push(child);
267
- } else {
268
- children.push(resetPath(child, `${path}.${i}`));
269
- }
270
- });
271
- const pathPropName = model.props["data-path"] ? "data-path" : "path";
272
- return React.cloneElement(
273
- model,
274
- { [pathPropName]: path, ...additionalProps },
275
- children
276
- );
277
- }
278
-
279
- export { containerOf, findTarget, followPath, followPathToComponent, followPathToParent, getChild, nextLeaf, nextStep, previousLeaf, resetPath, resolveJSONPath, resolvePath };
280
- //# sourceMappingURL=pathUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pathUtils.js","sources":["../../../../packages/vuu-layout/src/utils/pathUtils.ts"],"sourcesContent":["import {\n isContainer,\n LayoutJSON,\n LayoutModel,\n WithActive,\n} from \"@vuu-ui/vuu-utils\";\nimport React, { isValidElement, ReactElement } from \"react\";\nimport { getProp, getProps } from \"./propUtils\";\nimport { typeOf } from \"./typeOf\";\n\nconst removeFinalPathSegment = (path: string) => {\n const pos = path.lastIndexOf(\".\");\n if (pos === -1) {\n return path;\n } else {\n return path.slice(0, pos);\n }\n};\n\nconst getChildren = (c: ReactElement) =>\n React.isValidElement((c.props as any).children)\n ? [(c.props as any).children]\n : (c.props as any).children;\n\n/**\n * This is a very specific function at the moment. It resolves a path of the form\n * '#{componentid}.ACTIVE_CHILD'\n * It allows a templated path to be resolved to a concrete path at runtime.\n * The above pattern is used to identify a layout drop target. Further patterns\n * will be added if needed.\n */\nexport const resolvePath = (source: ReactElement, path = \"\"): string => {\n const [step1, ...steps] = path.split(\".\");\n if (step1?.startsWith(\"#\")) {\n const node = findTargetById(source, step1.slice(1), true);\n if (node && steps.length) {\n return resolvePath(node, steps.join(\".\"));\n }\n } else if (step1 === \"ACTIVE_CHILD\") {\n const { active } = getProps(source);\n const children = getChildren(source);\n const { path } = getProps(children[active]);\n return path;\n }\n\n return \"\";\n};\n\n/**\n * Similar to resolvePath but operates on a JSON\n * layout structure and returns the matching JSON node.\n */\nexport const resolveJSONPath = (\n source: LayoutJSON,\n path = \"\",\n): LayoutJSON | undefined => {\n const [step1, ...steps] = path.split(\".\");\n if (step1?.startsWith(\"#\")) {\n const node = findTargetJSONById(source, step1.slice(1), true);\n if (node && steps.length) {\n return resolveJSONPath(node, steps.join(\".\"));\n }\n } else if (step1 === \"ACTIVE_CHILD\") {\n const { children, props } = source;\n const { active } = props as WithActive;\n if (typeof active === \"number\" && children?.[active]) {\n return children[active];\n }\n }\n return;\n};\n\nexport function followPathToParent(\n source: ReactElement,\n path: string,\n): ReactElement | null {\n const { \"data-path\": dataPath, path: sourcePath = dataPath } =\n getProps(source);\n\n if (path === \"0\") return null;\n if (path === sourcePath) return null;\n\n return followPath(source, removeFinalPathSegment(path), true);\n}\n\nexport function findTarget(\n source: LayoutModel | undefined,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n test: (props: any) => boolean,\n): LayoutModel | undefined {\n if (source) {\n const { children, ...props } = getProps(source);\n if (test(props)) {\n return source;\n }\n if (React.Children.count(children) > 0) {\n const array = React.isValidElement(children) ? [children] : children;\n for (const child of array) {\n const target = findTarget(child, test);\n if (target) {\n return target;\n }\n }\n }\n }\n}\n\nexport function containerOf(\n source: LayoutModel,\n target: LayoutModel,\n): LayoutModel | null {\n if (target === source) {\n return null;\n }\n const { path: sourcePath, children } = getProps(source);\n const { idx, finalStep } = nextStep(sourcePath, getProp(target, \"path\"));\n if (finalStep) {\n return source;\n }\n if (children === undefined || children[idx] === undefined) {\n return null;\n }\n return containerOf(children[idx], target);\n}\n\nexport const getChild = (\n children: ReactElement[],\n idx: number,\n): ReactElement | undefined => {\n if (React.isValidElement(children) && idx == 0) {\n return children;\n }\n if (Array.isArray(children)) {\n return children[idx];\n }\n};\n\nexport function followPathToComponent(component: ReactElement, path: string) {\n const paths = path.split(\".\");\n let children = [component];\n\n for (let i = 0; i < paths.length; i++) {\n const idx = parseInt(paths[i]);\n const child = children[idx];\n if (i === paths.length - 1) {\n return child;\n }\n children = getChildren(child);\n }\n}\n\nconst findTargetById = (\n source: ReactElement,\n id: string,\n throwIfNotFound = true,\n): ReactElement | undefined => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const { children, id: idProp } = source.props as any;\n if (idProp === id) {\n return source;\n }\n\n if (React.Children.count(children) > 0) {\n const childArray = isValidElement(children) ? [children] : children;\n for (const child of childArray) {\n if (isValidElement(child)) {\n const target = findTargetById(child, id, false);\n if (target) {\n return target;\n }\n }\n }\n }\n\n if (throwIfNotFound === true) {\n throw Error(`pathUtils.findTargetById id #${id} not found in source`);\n }\n};\n\nconst findTargetJSONById = (\n source: LayoutJSON,\n id: string,\n throwIfNotFound = true,\n): LayoutJSON | undefined => {\n const { children, id: idProp } = source;\n if (idProp === id) {\n return source;\n }\n\n if (Array.isArray(children) && children.length > 0) {\n for (const child of children) {\n if (child !== null && typeof child === \"object\") {\n const target = findTargetJSONById(child, id, false);\n if (target) {\n return target;\n }\n }\n }\n }\n\n if (throwIfNotFound === true) {\n throw Error(`pathUtils.findTargetJSONById id #${id} not found in source`);\n }\n};\n\nexport function followPath(\n source: LayoutModel,\n path: string,\n): LayoutModel | undefined;\nexport function followPath(\n source: ReactElement,\n path: string,\n throwIfNotFound: true,\n): ReactElement;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function followPath(source: any, path: any, throwIfNotFound = false) {\n if (path.startsWith(\"#\")) {\n return findTargetById(source, path.slice(1), throwIfNotFound);\n }\n\n const { \"data-path\": dataPath, path: sourcePath = dataPath } =\n getProps(source);\n if (path.indexOf(sourcePath) !== 0) {\n throw Error(\n `pathUtils.followPath path ${path} is not within source path ${sourcePath}`,\n );\n }\n const route = path.slice(sourcePath.length + 1);\n if (route === \"\") {\n return source;\n }\n\n let target = source;\n const paths = route.split(\".\");\n\n for (let i = 0; i < paths.length; i++) {\n if (React.Children.count(target.props.children) === 0) {\n const message = `element at 0.${paths\n .slice(0, i)\n .join(\".\")} has no children, so cannot fulfill rest of path ${paths\n .slice(i)\n .join(\".\")}`;\n\n if (throwIfNotFound) {\n throw Error(message);\n } else {\n console.warn(message);\n return;\n }\n }\n\n target = getChild(target.props.children, parseInt(paths[i]));\n\n if (target === undefined) {\n const message = `model at 0.${paths\n .slice(0, i)\n .join(\".\")} has no children that fulfill next step of path ${paths\n .slice(i)\n .join(\".\")}`;\n\n if (throwIfNotFound) {\n throw Error(message);\n } else {\n console.warn(message);\n }\n }\n }\n return target;\n}\n\nexport function nextLeaf(root: ReactElement, path: string) {\n const parent = followPathToParent(root, path);\n let pathIndices = path.split(\".\").map((idx) => parseInt(idx, 10));\n if (parent) {\n const lastIdx = pathIndices.pop();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const { children } = parent.props as any;\n if (children.length - 1 > lastIdx!) {\n return firstLeaf(children[lastIdx! + 1]);\n } else {\n const parentIdx = pathIndices.pop();\n const nextParent = followPathToParent(root, getProp(parent, \"path\"));\n if (nextParent && typeof parentIdx === \"number\") {\n pathIndices = (nextParent.props as any).path\n .split(\".\")\n .map((idx: string) => parseInt(idx, 10));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((nextParent.props as any).children.length - 1 > parentIdx) {\n const nextStep = (nextParent.props as any).children[parentIdx + 1];\n if (isContainer(typeOf(nextStep) as string)) {\n return firstLeaf(nextStep);\n } else {\n return nextStep;\n }\n }\n }\n }\n }\n\n return firstLeaf(root);\n}\n\nexport function previousLeaf(root: ReactElement, path: string) {\n const pathIndices = path.split(\".\").map((idx) => parseInt(idx, 10));\n let lastIdx = pathIndices.pop();\n let parent = followPathToParent(root, path);\n if (parent != null && typeof lastIdx === \"number\") {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const { children } = parent.props as any;\n if (lastIdx > 0) {\n return lastLeaf(children[lastIdx - 1]);\n } else {\n while (pathIndices.length > 1) {\n lastIdx = pathIndices.pop() as number;\n parent = followPathToParent(\n root,\n getProp(parent, \"path\"),\n ) as ReactElement;\n if (lastIdx > 0) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const nextStep = (parent.props as any).children[lastIdx - 1];\n if (isContainer(typeOf(nextStep) as string)) {\n return lastLeaf(nextStep);\n }\n return nextStep;\n }\n }\n }\n }\n return lastLeaf(root);\n}\n\nfunction firstLeaf(layoutRoot: ReactElement): ReactElement {\n if (isContainer(typeOf(layoutRoot) as string)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const { children } = (layoutRoot.props || layoutRoot) as any;\n return firstLeaf(children[0]);\n }\n return layoutRoot;\n}\n\nfunction lastLeaf(root: ReactElement): ReactElement {\n if (isContainer(typeOf(root) as string)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const { children } = (root.props || root) as any;\n return lastLeaf(children[children.length - 1]);\n }\n return root;\n}\n\ntype NextStepResult = {\n idx: number;\n finalStep: boolean;\n};\n\nexport function nextStep(\n pathSoFar: string,\n targetPath: string,\n followPathToEnd = false,\n): NextStepResult {\n if (pathSoFar === targetPath) {\n return { idx: -1, finalStep: true };\n }\n\n const pathVisited = `${pathSoFar}.`;\n if (!targetPath.startsWith(pathVisited)) {\n throw Error(\"pathUtils nextStep has strayed from the path\");\n }\n\n const endOfTheLine = followPathToEnd ? 0 : 1;\n const paths = targetPath\n .replace(pathVisited, \"\")\n .split(\".\")\n .map((n) => parseInt(n, 10));\n return { idx: paths[0], finalStep: paths.length === endOfTheLine };\n}\n\nexport function resetPath(\n model: ReactElement,\n path: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalProps?: any,\n): ReactElement {\n if (getProp(model, \"path\") === path) {\n return model;\n }\n const children: ReactElement[] = [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n React.Children.forEach((model.props as any).children, (child, i) => {\n if (!getProp(child, \"path\")) {\n children.push(child);\n } else {\n children.push(resetPath(child, `${path}.${i}`));\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const pathPropName = (model.props as any)[\"data-path\"] ? \"data-path\" : \"path\";\n return React.cloneElement(\n model,\n { [pathPropName]: path, ...additionalProps },\n children,\n );\n}\n"],"names":["path","nextStep"],"mappings":";;;;;AAUA,MAAM,sBAAA,GAAyB,CAAC,IAAiB,KAAA;AAC/C,EAAM,MAAA,GAAA,GAAM,IAAK,CAAA,WAAA,CAAY,GAAG,CAAA;AAChC,EAAA,IAAI,QAAQ,CAAI,CAAA,EAAA;AACd,IAAO,OAAA,IAAA;AAAA,GACF,MAAA;AACL,IAAO,OAAA,IAAA,CAAK,KAAM,CAAA,CAAA,EAAG,GAAG,CAAA;AAAA;AAE5B,CAAA;AAEA,MAAM,WAAc,GAAA,CAAC,CACnB,KAAA,KAAA,CAAM,eAAgB,CAAE,CAAA,KAAA,CAAc,QAAQ,CAAA,GAC1C,CAAE,CAAE,CAAA,KAAA,CAAc,QAAQ,CAAA,GACzB,EAAE,KAAc,CAAA,QAAA;AAShB,MAAM,WAAc,GAAA,CAAC,MAAsB,EAAA,IAAA,GAAO,EAAe,KAAA;AACtE,EAAA,MAAM,CAAC,KAAO,EAAA,GAAG,KAAK,CAAI,GAAA,IAAA,CAAK,MAAM,GAAG,CAAA;AACxC,EAAI,IAAA,KAAA,EAAO,UAAW,CAAA,GAAG,CAAG,EAAA;AAC1B,IAAA,MAAM,OAAO,cAAe,CAAA,MAAA,EAAQ,MAAM,KAAM,CAAA,CAAC,GAAG,IAAI,CAAA;AACxD,IAAI,IAAA,IAAA,IAAQ,MAAM,MAAQ,EAAA;AACxB,MAAA,OAAO,WAAY,CAAA,IAAA,EAAM,KAAM,CAAA,IAAA,CAAK,GAAG,CAAC,CAAA;AAAA;AAC1C,GACF,MAAA,IAAW,UAAU,cAAgB,EAAA;AACn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ACF;AACF;;;;"}
@@ -1,23 +0,0 @@
1
- const NO_PROPS = {};
2
- const getProp = (component, propName) => {
3
- const props = getProps(component);
4
- return props[propName] ?? props[`data-${propName}`];
5
- };
6
- const getProps = (component) => component?.props || component || NO_PROPS;
7
- const getChildProp = (container) => {
8
- const props = getProps(container);
9
- if (props.children) {
10
- const {
11
- children: [target, ...rest]
12
- } = props;
13
- if (rest.length > 0) {
14
- console.warn(
15
- `getChild expected a single child, found ${rest.length + 1}`
16
- );
17
- }
18
- return target;
19
- }
20
- };
21
-
22
- export { getChildProp, getProp, getProps };
23
- //# sourceMappingURL=propUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"propUtils.js","sources":["../../../../packages/vuu-layout/src/utils/propUtils.ts"],"sourcesContent":["import { ReactElement } from \"react\";\nimport { LayoutModel } from \"@vuu-ui/vuu-utils\";\n\nconst NO_PROPS = {};\nexport const getProp = (\n component: LayoutModel | undefined,\n propName: string,\n) => {\n const props = getProps(component);\n return props[propName] ?? props[`data-${propName}`];\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getProps = (component?: LayoutModel): any =>\n component?.props || component || NO_PROPS;\n\nexport const getChildProp = (container: LayoutModel) => {\n const props = getProps(container);\n if (props.children) {\n const {\n children: [target, ...rest],\n } = props;\n if (rest.length > 0) {\n console.warn(\n `getChild expected a single child, found ${rest.length + 1}`,\n );\n }\n return target as ReactElement;\n }\n};\n"],"names":[],"mappings":"AAGA,MAAM,WAAW,EAAC;AACL,MAAA,OAAA,GAAU,CACrB,SAAA,EACA,QACG,KAAA;AACH,EAAM,MAAA,KAAA,GAAQ,SAAS,SAAS,CAAA;AAChC,EAAA,OAAO,MAAM,QAAQ,CAAA,IAAK,KAAM,CAAA,CAAA,KAAA,EAAQ,QAAQ,CAAE,CAAA,CAAA;AACpD;AAGO,MAAM,QAAW,GAAA,CAAC,SACvB,KAAA,SAAA,EAAW,SAAS,SAAa,IAAA;AAEtB,MAAA,YAAA,GAAe,CAAC,SAA2B,KAAA;AACtD,EAAM,MAAA,KAAA,GAAQ,SAAS,SAAS,CAAA;AAChC,EAAA,IAAI,MAAM,QAAU,EAAA;AAClB,IAAM,MAAA;AAAA,MACJ,QAAU,EAAA,CAAC,MAAQ,EAAA,GAAG,IAAI;AAAA,KACxB,GAAA,KAAA;AACJ,IAAI,IAAA,IAAA,CAAK,SAAS,CAAG,EAAA;AACnB,MAAQ,OAAA,CAAA,IAAA;AAAA,QACN,CAAA,wCAAA,EAA2C,IAAK,CAAA,MAAA,GAAS,CAAC,CAAA;AAAA,OAC5D;AAAA;AAEF,IAAO,OAAA,MAAA;AAAA;AAEX;;;;"}
@@ -1,10 +0,0 @@
1
- function setRef(ref, value) {
2
- if (typeof ref === "function") {
3
- ref(value);
4
- } else if (ref) {
5
- ref.current = value;
6
- }
7
- }
8
-
9
- export { setRef };
10
- //# sourceMappingURL=refUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"refUtils.js","sources":["../../../../packages/vuu-layout/src/utils/refUtils.ts"],"sourcesContent":["import { MutableRefObject } from \"react\";\n\nexport function setRef<T>(\n ref:\n | MutableRefObject<T | null>\n | ((instance: T | null) => void)\n | null\n | undefined,\n value: T | null\n): void {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}\n"],"names":[],"mappings":"AAEgB,SAAA,MAAA,CACd,KAKA,KACM,EAAA;AACN,EAAI,IAAA,OAAO,QAAQ,UAAY,EAAA;AAC7B,IAAA,GAAA,CAAI,KAAK,CAAA;AAAA,aACA,GAAK,EAAA;AACd,IAAA,GAAA,CAAI,OAAU,GAAA,KAAA;AAAA;AAElB;;;;"}
@@ -1,13 +0,0 @@
1
- const expandFlex = (flex) => {
2
- if (typeof flex !== "number") {
3
- throw Error(`"no support yet for flex value ${flex}`);
4
- }
5
- return {
6
- flexBasis: 0,
7
- flexGrow: 1,
8
- flexShrink: 1
9
- };
10
- };
11
-
12
- export { expandFlex };
13
- //# sourceMappingURL=styleUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styleUtils.js","sources":["../../../../packages/vuu-layout/src/utils/styleUtils.ts"],"sourcesContent":["import { CSSProperties } from 'react';\nexport type CSSFlexProperties = Pick<CSSProperties, 'flexBasis' | 'flexGrow' | 'flexShrink'>;\n\nexport const expandFlex = (flex: number | CSSFlexProperties): CSSFlexProperties => {\n if (typeof flex !== 'number') {\n throw Error(`\"no support yet for flex value ${flex}`);\n }\n return {\n flexBasis: 0,\n flexGrow: 1,\n flexShrink: 1\n };\n};\n"],"names":[],"mappings":"AAGa,MAAA,UAAA,GAAa,CAAC,IAAwD,KAAA;AACjF,EAAI,IAAA,OAAO,SAAS,QAAU,EAAA;AAC5B,IAAM,MAAA,KAAA,CAAM,CAAkC,+BAAA,EAAA,IAAI,CAAE,CAAA,CAAA;AAAA;AAEtD,EAAO,OAAA;AAAA,IACL,SAAW,EAAA,CAAA;AAAA,IACX,QAAU,EAAA,CAAA;AAAA,IACV,UAAY,EAAA;AAAA,GACd;AACF;;;;"}
@@ -1,23 +0,0 @@
1
- function typeOf(element) {
2
- if (element) {
3
- const type = element.type;
4
- if (typeof type === "function" || typeof type === "object") {
5
- const elementName = type.displayName || type.name || type.type?.name;
6
- if (typeof elementName === "string") {
7
- return elementName;
8
- }
9
- }
10
- if (typeof element.type === "string") {
11
- return element.type;
12
- }
13
- if (element.constructor) {
14
- return element.constructor.displayName;
15
- }
16
- throw Error(`typeOf unable to determine type of element`);
17
- }
18
- }
19
- const isTypeOf = (element, type) => typeOf(element) === type;
20
- const isLayoutJSON = (layout) => layout !== void 0 && "type" in layout;
21
-
22
- export { isLayoutJSON, isTypeOf, typeOf };
23
- //# sourceMappingURL=typeOf.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typeOf.js","sources":["../../../../packages/vuu-layout/src/utils/typeOf.ts"],"sourcesContent":["import { LayoutJSON, LayoutModel, WithType } from \"@vuu-ui/vuu-utils\";\nimport { ReactElement } from \"react\";\n\nexport function typeOf(element?: LayoutModel | WithType): string | undefined {\n if (element) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const type = element.type as any;\n if (typeof type === \"function\" || typeof type === \"object\") {\n const elementName = type.displayName || type.name || type.type?.name;\n if (typeof elementName === \"string\") {\n return elementName;\n }\n }\n if (typeof element.type === \"string\") {\n return element.type;\n }\n if (element.constructor) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (element.constructor as any).displayName as string;\n }\n throw Error(`typeOf unable to determine type of element`);\n }\n}\n\nexport const isTypeOf = (element: ReactElement, type: string) =>\n typeOf(element) === type;\n\nexport const isLayoutJSON = (layout: LayoutJSON): layout is LayoutJSON =>\n layout !== undefined && \"type\" in layout;\n"],"names":[],"mappings":"AAGO,SAAS,OAAO,OAAsD,EAAA;AAC3E,EAAA,IAAI,OAAS,EAAA;AAEX,IAAA,MAAM,OAAO,OAAQ,CAAA,IAAA;AACrB,IAAA,IAAI,OAAO,IAAA,KAAS,UAAc,IAAA,OAAO,SAAS,QAAU,EAAA;AAC1D,MAAA,MAAM,cAAc,IAAK,CAAA,WAAA,IAAe,IAAK,CAAA,IAAA,IAAQ,KAAK,IAAM,EAAA,IAAA;AAChE,MAAI,IAAA,OAAO,gBAAgB,QAAU,EAAA;AACnC,QAAO,OAAA,WAAA;AAAA;AACT;AAEF,IAAI,IAAA,OAAO,OAAQ,CAAA,IAAA,KAAS,QAAU,EAAA;AACpC,MAAA,OAAO,OAAQ,CAAA,IAAA;AAAA;AAEjB,IAAA,IAAI,QAAQ,WAAa,EAAA;AAEvB,MAAA,OAAQ,QAAQ,WAAoB,CAAA,WAAA;AAAA;AAEtC,IAAA,MAAM,MAAM,CAA4C,0CAAA,CAAA,CAAA;AAAA;AAE5D;AAEO,MAAM,WAAW,CAAC,OAAA,EAAuB,IAC9C,KAAA,MAAA,CAAO,OAAO,CAAM,KAAA;AAEf,MAAM,YAAe,GAAA,CAAC,MAC3B,KAAA,MAAA,KAAW,UAAa,MAAU,IAAA;;;;"}