mathbox-react 0.0.10 → 0.0.12

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 (61) hide show
  1. package/build/cjs/{types/components → components}/ContainedMathbox.d.ts +0 -0
  2. package/build/cjs/{types/components → components}/Mathbox.d.ts +0 -0
  3. package/build/cjs/components/MathboxNodeContext.d.ts +4 -0
  4. package/build/cjs/{types/components → components}/components.d.ts +6 -1
  5. package/build/cjs/{types/components → components}/index.d.ts +0 -0
  6. package/build/{esm/types → cjs}/components/types.d.ts +2 -2
  7. package/build/cjs/{types/components → components}/util.d.ts +1 -1
  8. package/build/cjs/{types/index.d.ts → index.d.ts} +0 -0
  9. package/build/cjs/index.js +1 -24
  10. package/build/cjs/index.js.map +1 -1
  11. package/build/cjs/{types/testSetup.d.ts → testSetup.d.ts} +0 -0
  12. package/build/cjs/{types/testUtils.d.ts → testUtils.d.ts} +0 -0
  13. package/build/esm/{types/components → components}/ContainedMathbox.d.ts +0 -0
  14. package/build/esm/{types/components → components}/Mathbox.d.ts +0 -0
  15. package/build/esm/components/MathboxNodeContext.d.ts +4 -0
  16. package/build/esm/{types/components → components}/components.d.ts +6 -1
  17. package/build/esm/{types/components → components}/index.d.ts +0 -0
  18. package/build/{cjs/types → esm}/components/types.d.ts +2 -2
  19. package/build/esm/{types/components → components}/util.d.ts +1 -1
  20. package/build/esm/{types/index.d.ts → index.d.ts} +0 -0
  21. package/build/esm/index.js +1 -24
  22. package/build/esm/index.js.map +1 -1
  23. package/build/esm/{types/testSetup.d.ts → testSetup.d.ts} +0 -0
  24. package/build/esm/{types/testUtils.d.ts → testUtils.d.ts} +0 -0
  25. package/build/index.d.ts +8 -3
  26. package/package.json +40 -45
  27. package/.eslintrc.js +0 -72
  28. package/.github/workflows/lint.yaml +0 -20
  29. package/.prettierrc +0 -1
  30. package/.storybook/main.js +0 -9
  31. package/.storybook/preview.js +0 -11
  32. package/LICENSE +0 -29
  33. package/README.md +0 -6
  34. package/babel.config.js +0 -3
  35. package/build/cjs/types/components/MathboxNodeContext.d.ts +0 -4
  36. package/build/cjs/types/components/components.spec.d.ts +0 -1
  37. package/build/cjs/types/stories/utils.d.ts +0 -5
  38. package/build/esm/types/components/MathboxNodeContext.d.ts +0 -4
  39. package/build/esm/types/components/components.spec.d.ts +0 -1
  40. package/build/esm/types/stories/utils.d.ts +0 -5
  41. package/jest.config.js +0 -12
  42. package/rollup.config.js +0 -38
  43. package/scratch.js +0 -149
  44. package/src/components/ContainedMathbox.tsx +0 -38
  45. package/src/components/Mathbox.tsx +0 -63
  46. package/src/components/MathboxNodeContext.ts +0 -6
  47. package/src/components/components.spec.tsx +0 -276
  48. package/src/components/components.tsx +0 -419
  49. package/src/components/index.ts +0 -3
  50. package/src/components/types.ts +0 -9
  51. package/src/components/util.ts +0 -106
  52. package/src/index.ts +0 -1
  53. package/src/stories/Cartesian.stories.tsx +0 -36
  54. package/src/stories/Grid.stories.tsx +0 -38
  55. package/src/stories/Mathbox.stories.tsx +0 -16
  56. package/src/stories/Point.stories.tsx +0 -68
  57. package/src/stories/utils.tsx +0 -33
  58. package/src/testSetup.ts +0 -3
  59. package/src/testUtils.ts +0 -46
  60. package/tsconfig.base.json +0 -17
  61. package/tsconfig.json +0 -5
@@ -1,276 +0,0 @@
1
- import React, { useState } from "react"
2
- import { render, act } from "@testing-library/react"
3
- import { MathboxSelection } from "mathbox"
4
- import ContainedMathbox from "./ContainedMathbox"
5
- import Mathbox from "./Mathbox"
6
- import { Cartesian, Grid, Voxel } from "./components"
7
- import { MathboxRef } from "./types"
8
-
9
- function assertNotNil<T>(value: T): asserts value is NonNullable<T> {
10
- if (value === undefined) {
11
- throw new Error("Unexpected undefined value")
12
- }
13
- if (value === null) {
14
- throw new Error("Unexpected null value")
15
- }
16
- }
17
-
18
- /**
19
- * Assert that two mathbox selections have the same nodes in the same order.
20
- */
21
- const assertSelectionsEqual = (s1: MathboxSelection, s2: MathboxSelection) => {
22
- expect(s1.length).toBe(s2.length)
23
- Array(s1.length)
24
- .fill(null)
25
- .forEach((_, i) => {
26
- expect(s1[i]).toBe(s2[i])
27
- })
28
- }
29
-
30
- describe("ContainedMathbox", () => {
31
- it("makes a new mathbox instance only if the options have changed", () => {
32
- const mbRef: MathboxRef<"root"> = { current: null }
33
- const { rerender } = render(<ContainedMathbox options={{}} ref={mbRef} />)
34
-
35
- const mb0 = mbRef.current
36
- assertNotNil(mb0)
37
- rerender(<ContainedMathbox options={{}} ref={mbRef} />)
38
- const mb1 = mbRef.current
39
- expect(mb1).toBe(mb0)
40
- assertNotNil(mb1)
41
- rerender(<ContainedMathbox options={{ plugins: ["core"] }} ref={mbRef} />)
42
- const mb2 = mbRef.current
43
- assertNotNil(mb2)
44
- expect(mb2).not.toBe(mb1)
45
- })
46
- })
47
-
48
- describe("Cartesian", () => {
49
- it("exposes Mathbox instance via ref", () => {
50
- const mbRef: MathboxRef<"root"> = { current: null }
51
- const cartesianRef: MathboxRef<"cartesian"> = { current: null }
52
- render(
53
- <ContainedMathbox ref={mbRef}>
54
- <Cartesian ref={cartesianRef} />
55
- </ContainedMathbox>
56
- )
57
-
58
- expect(mbRef.current?.[0].type).toBe("root")
59
- expect(cartesianRef.current?.[0].type).toBe("cartesian")
60
- })
61
-
62
- it("creates a cartesian instance as child of root", () => {
63
- const mbRef: MathboxRef<"root"> = { current: null }
64
- render(
65
- <ContainedMathbox ref={mbRef}>
66
- <Cartesian />
67
- </ContainedMathbox>
68
- )
69
- expect(mbRef.current?.select("cartesian").length).toBe(1)
70
- })
71
-
72
- it("creates mathbox children as children of itself", () => {
73
- const mbRef: MathboxRef<"root"> = { current: null }
74
- render(
75
- <ContainedMathbox ref={mbRef}>
76
- <Cartesian>
77
- <Grid />
78
- <Grid />
79
- </Cartesian>
80
- </ContainedMathbox>
81
- )
82
- mbRef.current?.print()
83
- expect(mbRef.current?.select("cartesian").length).toBe(1)
84
- expect(mbRef.current?.select("cartesian grid").length).toBe(2)
85
- })
86
-
87
- it("removes its mathbox instance when unmounted", () => {
88
- const mbRef: MathboxRef<"root"> = { current: null }
89
- const { rerender } = render(
90
- <ContainedMathbox ref={mbRef}>
91
- <Cartesian />
92
- </ContainedMathbox>
93
- )
94
- expect(mbRef.current?.select("cartesian").length).toBe(1)
95
- rerender(<ContainedMathbox ref={mbRef} />)
96
- expect(mbRef.current?.select("cartesian").length).toBe(0)
97
- })
98
-
99
- it.each([
100
- { props: { visible: true, scale: [3, 2, 1] } },
101
- { props: { visible: false, scale: [1, 2, 3] } },
102
- ])("passes appropriate props to its mathbox instance", ({ props }) => {
103
- const mbRef: MathboxRef<"root"> = { current: null }
104
- render(
105
- <ContainedMathbox ref={mbRef}>
106
- <Cartesian {...props} />
107
- </ContainedMathbox>
108
- )
109
- const cartesian = mbRef.current?.select<"cartesian">("cartesian")
110
-
111
- assertNotNil(cartesian)
112
-
113
- expect(cartesian.get("visible")).toBe(props.visible)
114
- // Mathbox converts scale to a ThreeJS Vec3
115
- expect(cartesian.get("scale").toArray()).toStrictEqual(props.scale)
116
- })
117
-
118
- it("updates props on its mathbox instance when rerendered", () => {
119
- const mbRef: MathboxRef<"root"> = { current: null }
120
- const { rerender } = render(
121
- <ContainedMathbox ref={mbRef}>
122
- <Cartesian />
123
- </ContainedMathbox>
124
- )
125
- const cartesian = mbRef.current?.select<"cartesian">("cartesian")
126
- assertNotNil(cartesian)
127
-
128
- expect(cartesian.get("visible")).toBe(true)
129
- rerender(
130
- <ContainedMathbox ref={mbRef}>
131
- <Cartesian visible={false} />
132
- </ContainedMathbox>
133
- )
134
- expect(cartesian.get("visible")).toBe(false)
135
- })
136
-
137
- it("re-renders inside new instance when root changes", () => {
138
- const mbRef: MathboxRef<"root"> = { current: null }
139
- const cartesianRef: MathboxRef<"cartesian"> = { current: null }
140
- const gridRef: MathboxRef<"grid"> = { current: null }
141
- const options1 = {}
142
- const { rerender } = render(
143
- <ContainedMathbox ref={mbRef} options={options1}>
144
- <Cartesian ref={cartesianRef}>
145
- <Grid ref={gridRef} />
146
- </Cartesian>
147
- </ContainedMathbox>
148
- )
149
-
150
- const mb1 = mbRef.current
151
- const cartesian1 = cartesianRef.current
152
- const grid1 = gridRef.current
153
- assertNotNil(mb1)
154
- assertNotNil(cartesian1)
155
- assertNotNil(grid1)
156
-
157
- expect(cartesian1).toHaveLength(1)
158
- assertSelectionsEqual(mb1.select("cartesian"), cartesian1)
159
- expect(grid1).toHaveLength(1)
160
- assertSelectionsEqual(mb1.select("grid"), grid1)
161
-
162
- /**
163
- * When re-rendered, this will create a new mathBox since the options
164
- * object prop will have changed.
165
- */
166
- const options2 = { plugins: ["core"] }
167
- expect(options1).not.toBe(options2)
168
-
169
- rerender(
170
- <ContainedMathbox ref={mbRef} options={options2}>
171
- <Cartesian ref={cartesianRef}>
172
- <Grid ref={gridRef} />
173
- </Cartesian>
174
- </ContainedMathbox>
175
- )
176
-
177
- const mb2 = mbRef.current
178
- const cartesian2 = cartesianRef.current
179
- const grid2 = gridRef.current
180
- assertNotNil(mb2)
181
- assertNotNil(cartesian2)
182
- assertNotNil(grid2)
183
-
184
- // The options have changed (via deep equal) so a new instance is created
185
- expect(mb1).not.toBe(mb2)
186
-
187
- expect(cartesian2).toHaveLength(1)
188
- assertSelectionsEqual(mb2.select("cartesian"), cartesian2)
189
- expect(grid2).toHaveLength(1)
190
- assertSelectionsEqual(mb2.select("grid"), grid2)
191
- })
192
-
193
- it("Can render a new instance without error", async () => {
194
- const mbRef: MathboxRef<"root"> = { current: null }
195
- let containerDiv: HTMLDivElement | null = null
196
- let setKey: (key: string) => void
197
- const KeyedMathbox = () => {
198
- const [container, setContainer] = useState<HTMLDivElement | null>(null)
199
- const [key, setKeyState] = useState("key-0")
200
- setKey = setKeyState
201
- containerDiv = container
202
- return (
203
- <div ref={setContainer} key={key}>
204
- {container && (
205
- <Mathbox ref={mbRef} container={container}>
206
- <Cartesian />
207
- </Mathbox>
208
- )}
209
- </div>
210
- )
211
- }
212
- render(<KeyedMathbox />)
213
-
214
- assertNotNil(mbRef.current)
215
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
216
- act(() => setKey!("key-2"))
217
-
218
- assertNotNil(containerDiv)
219
- expect(mbRef.current.three.element).toBe(containerDiv)
220
- expect(mbRef.current.select("cartesian").length).toBe(1)
221
- })
222
-
223
- it("Can add and remove children without error", async () => {
224
- const mbRef: MathboxRef<"root"> = { current: null }
225
-
226
- const { rerender } = render(
227
- <ContainedMathbox ref={mbRef} options={{}}>
228
- <Cartesian>
229
- <Grid />
230
- </Cartesian>
231
- </ContainedMathbox>
232
- )
233
-
234
- assertNotNil(mbRef.current)
235
- expect(mbRef.current.select("grid").length).toBe(1)
236
-
237
- rerender(
238
- <ContainedMathbox ref={mbRef} options={{}}>
239
- <Cartesian>
240
- <Grid />
241
- <Grid />
242
- </Cartesian>
243
- </ContainedMathbox>
244
- )
245
-
246
- assertNotNil(mbRef.current)
247
- expect(mbRef.current.select("grid").length).toBe(2)
248
-
249
- rerender(
250
- <ContainedMathbox ref={mbRef} options={{}}>
251
- <Cartesian />
252
- </ContainedMathbox>
253
- )
254
-
255
- assertNotNil(mbRef.current)
256
- expect(mbRef.current.select("grid").length).toBe(0)
257
- })
258
- })
259
-
260
- describe("<Voxel />", () => {
261
- it("throws a runtime error if it has children", () => {
262
- const willThrow = () =>
263
- render(
264
- <ContainedMathbox>
265
- <Cartesian>
266
- {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
267
- {/* @ts-ignore */}
268
- <Voxel>
269
- <Grid />
270
- </Voxel>
271
- </Cartesian>
272
- </ContainedMathbox>
273
- )
274
- expect(willThrow).toThrow("Component <Voxel /> cannot have children.")
275
- })
276
- })
@@ -1,419 +0,0 @@
1
- import React, {
2
- forwardRef,
3
- useRef,
4
- useContext,
5
- useEffect,
6
- useReducer,
7
- useImperativeHandle,
8
- } from "react"
9
- import { Props, NodeType, MathboxSelection } from "mathbox"
10
- import MathboxAPIContext from "./MathboxNodeContext"
11
- import { WithChildren } from "./types"
12
- import {
13
- isRootDestroyed,
14
- isSelectionParent,
15
- canNodeHaveChildren,
16
- ParentNodeTypes,
17
- capitalize,
18
- } from "./util"
19
-
20
- type MathboxComponent<T extends NodeType> = React.ForwardRefExoticComponent<
21
- (T extends ParentNodeTypes ? WithChildren<Props[T]> : Props[T]) &
22
- React.RefAttributes<MathboxSelection<T>>
23
- >
24
-
25
- const mathboxComponentFactory = <T extends NodeType>(
26
- type: T
27
- ): MathboxComponent<T> => {
28
- const canHaveChildren = canNodeHaveChildren(type)
29
- const componentName = capitalize(type)
30
- const Comp = (
31
- props: WithChildren<Props[T]>,
32
- ref: React.Ref<MathboxSelection<T> | null>
33
- ) => {
34
- const [_ignored, forceUpdate] = useReducer((x) => x + 1, 0)
35
- const parent = useContext(MathboxAPIContext)
36
- const selection = useRef<MathboxSelection<T> | null>(null)
37
- useEffect(
38
- () => () => {
39
- if (selection.current) {
40
- selection.current.remove()
41
- selection.current = null
42
- }
43
- },
44
- []
45
- )
46
- useImperativeHandle(ref, () => selection.current)
47
-
48
- const { children, ...others } = props
49
- useEffect(() => {
50
- if (!parent) return
51
- if (isRootDestroyed(parent)) {
52
- forceUpdate()
53
- return
54
- }
55
- if (selection.current) {
56
- if (!isSelectionParent(selection.current, parent)) {
57
- selection.current.remove()
58
- selection.current = null
59
- forceUpdate()
60
- }
61
- }
62
- if (!selection.current) {
63
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
64
- // @ts-ignore
65
- selection.current = parent[type](others)
66
- forceUpdate()
67
- } else {
68
- selection.current.set(others)
69
- }
70
- }, [parent, others])
71
- if (!canHaveChildren) {
72
- if (props.children) {
73
- throw new Error(`Component <${componentName} /> cannot have children.`)
74
- }
75
- return null
76
- }
77
- return (
78
- <MathboxAPIContext.Provider value={selection.current}>
79
- {props.children}
80
- </MathboxAPIContext.Provider>
81
- )
82
- }
83
- /**
84
- * The line below gives a TS error without explicit any.
85
- * But if you replace each generic T above with a specific instance, e.g.,
86
- * 'cartesian', there is no error.
87
- *
88
- * So an alternative without "any" would be be to copy the definition of Comp
89
- * with all ~64 different node types.
90
- *
91
- * I'm not 100% sure why there's a ts error here, but the above indicates to
92
- * me that this is actually type-safe. And I do not want that much copy pasta.
93
- * So instead, use the any and put explicit return type on the factory.
94
- */
95
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
96
- return forwardRef(Comp) as any
97
- }
98
-
99
- /**
100
- * Component wrapper for mathbox [`area`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#dataarea).
101
- */
102
- export const Area = mathboxComponentFactory("area")
103
-
104
- /**
105
- * Component wrapper for mathbox [`array`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#dataarray).
106
- */
107
- const MBArray = mathboxComponentFactory("array")
108
-
109
- export { MBArray as Array }
110
-
111
- /**
112
- * Component wrapper for mathbox [`axis`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#drawaxis).
113
- */
114
- export const Axis = mathboxComponentFactory("axis")
115
-
116
- /**
117
- * Component wrapper for mathbox [`camera`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#cameracamera).
118
- */
119
- export const Camera = mathboxComponentFactory("camera")
120
-
121
- /**
122
- * Component wrapper for mathbox [`cartesian`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#viewcartesian).
123
- */
124
- export const Cartesian = mathboxComponentFactory("cartesian")
125
-
126
- /**
127
- * Component wrapper for mathbox [`cartesian4`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#viewcartesian4).
128
- */
129
- export const Cartesian4 = mathboxComponentFactory("cartesian4")
130
-
131
- /**
132
- * Component wrapper for mathbox [`clamp`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatorclamp).
133
- */
134
- export const Clamp = mathboxComponentFactory("clamp")
135
-
136
- /**
137
- * Component wrapper for mathbox [`clock`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#timeclock).
138
- */
139
- export const Clock = mathboxComponentFactory("clock")
140
-
141
- /**
142
- * Component wrapper for mathbox [`compose`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#rttcompose).
143
- */
144
- export const Compose = mathboxComponentFactory("compose")
145
-
146
- /**
147
- * Component wrapper for mathbox [`dom`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#overlaydom).
148
- */
149
- export const Dom = mathboxComponentFactory("dom")
150
-
151
- /**
152
- * Component wrapper for mathbox [`face`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#drawface).
153
- */
154
- export const Face = mathboxComponentFactory("face")
155
-
156
- /**
157
- * Component wrapper for mathbox [`format`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#textformat).
158
- */
159
- export const Format = mathboxComponentFactory("format")
160
-
161
- /**
162
- * Component wrapper for mathbox [`fragment`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#transformfragment).
163
- */
164
- export const Fragment = mathboxComponentFactory("fragment")
165
-
166
- /**
167
- * Component wrapper for mathbox [`grid`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#drawgrid).
168
- */
169
- export const Grid = mathboxComponentFactory("grid")
170
-
171
- /**
172
- * Component wrapper for mathbox [`group`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#basegroup).
173
- */
174
- export const Group = mathboxComponentFactory("group")
175
-
176
- /**
177
- * Component wrapper for mathbox [`grow`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatorgrow).
178
- */
179
- export const Grow = mathboxComponentFactory("grow")
180
-
181
- /**
182
- * Component wrapper for mathbox [`html`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#overlayhtml).
183
- */
184
- export const Html = mathboxComponentFactory("html")
185
-
186
- /**
187
- * Component wrapper for mathbox [`inherit`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#baseinherit).
188
- */
189
- export const Inherit = mathboxComponentFactory("inherit")
190
-
191
- /**
192
- * Component wrapper for mathbox [`interval`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#datainterval).
193
- */
194
- export const Interval = mathboxComponentFactory("interval")
195
-
196
- /**
197
- * Component wrapper for mathbox [`join`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatorjoin).
198
- */
199
- export const Join = mathboxComponentFactory("join")
200
-
201
- /**
202
- * Component wrapper for mathbox [`label`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#textlabel).
203
- */
204
- export const Label = mathboxComponentFactory("label")
205
-
206
- /**
207
- * Component wrapper for mathbox [`layer`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#transformlayer).
208
- */
209
- export const Layer = mathboxComponentFactory("layer")
210
-
211
- /**
212
- * Component wrapper for mathbox [`lerp`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatorlerp).
213
- */
214
- export const Lerp = mathboxComponentFactory("lerp")
215
-
216
- /**
217
- * Component wrapper for mathbox [`line`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#drawline).
218
- */
219
- export const Line = mathboxComponentFactory("line")
220
-
221
- /**
222
- * Component wrapper for mathbox [`mask`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#transformmask).
223
- */
224
- export const Mask = mathboxComponentFactory("mask")
225
-
226
- /**
227
- * Component wrapper for mathbox [`matrix`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#datamatrix).
228
- */
229
- export const Matrix = mathboxComponentFactory("matrix")
230
-
231
- /**
232
- * Component wrapper for mathbox [`memo`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatormemo).
233
- */
234
- export const Memo = mathboxComponentFactory("memo")
235
-
236
- /**
237
- * Component wrapper for mathbox [`move`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#presentmove).
238
- */
239
- export const Move = mathboxComponentFactory("move")
240
-
241
- /**
242
- * Component wrapper for mathbox [`now`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#timenow).
243
- */
244
- export const Now = mathboxComponentFactory("now")
245
-
246
- /**
247
- * Component wrapper for mathbox [`play`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#presentplay).
248
- */
249
- export const Play = mathboxComponentFactory("play")
250
-
251
- /**
252
- * Component wrapper for mathbox [`point`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#drawpoint).
253
- */
254
- export const Point = mathboxComponentFactory("point")
255
-
256
- /**
257
- * Component wrapper for mathbox [`polar`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#viewpolar).
258
- */
259
- export const Polar = mathboxComponentFactory("polar")
260
-
261
- /**
262
- * Component wrapper for mathbox [`present`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#presentpresent).
263
- */
264
- export const Present = mathboxComponentFactory("present")
265
-
266
- /**
267
- * Component wrapper for mathbox [`readback`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatorreadback).
268
- */
269
- export const Readback = mathboxComponentFactory("readback")
270
-
271
- /**
272
- * Component wrapper for mathbox [`repeat`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatorrepeat).
273
- */
274
- export const Repeat = mathboxComponentFactory("repeat")
275
-
276
- /**
277
- * Component wrapper for mathbox [`resample`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatorresample).
278
- */
279
- export const Resample = mathboxComponentFactory("resample")
280
-
281
- /**
282
- * Component wrapper for mathbox [`retext`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#textretext).
283
- */
284
- export const Retext = mathboxComponentFactory("retext")
285
-
286
- /**
287
- * Component wrapper for mathbox [`reveal`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#presentreveal).
288
- */
289
- export const Reveal = mathboxComponentFactory("reveal")
290
-
291
- /**
292
- * Component wrapper for mathbox [`rtt`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#rttrtt).
293
- */
294
- export const Rtt = mathboxComponentFactory("rtt")
295
-
296
- /**
297
- * Component wrapper for mathbox [`scale`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#datascale).
298
- */
299
- export const Scale = mathboxComponentFactory("scale")
300
-
301
- /**
302
- * Component wrapper for mathbox [`shader`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#shadershader).
303
- */
304
- export const Shader = mathboxComponentFactory("shader")
305
-
306
- /**
307
- * Component wrapper for mathbox [`slice`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatorslice).
308
- */
309
- export const Slice = mathboxComponentFactory("slice")
310
-
311
- /**
312
- * Component wrapper for mathbox [`slide`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#presentslide).
313
- */
314
- export const Slide = mathboxComponentFactory("slide")
315
-
316
- /**
317
- * Component wrapper for mathbox [`spherical`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#viewspherical).
318
- */
319
- export const Spherical = mathboxComponentFactory("spherical")
320
-
321
- /**
322
- * Component wrapper for mathbox [`split`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatorsplit).
323
- */
324
- export const Split = mathboxComponentFactory("split")
325
-
326
- /**
327
- * Component wrapper for mathbox [`spread`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatorspread).
328
- */
329
- export const Spread = mathboxComponentFactory("spread")
330
-
331
- /**
332
- * Component wrapper for mathbox [`step`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#presentstep).
333
- */
334
- export const Step = mathboxComponentFactory("step")
335
-
336
- /**
337
- * Component wrapper for mathbox [`stereographic`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#viewstereographic).
338
- */
339
- export const Stereographic = mathboxComponentFactory("stereographic")
340
-
341
- /**
342
- * Component wrapper for mathbox [`stereographic4`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#viewstereographic4).
343
- */
344
- export const Stereographic4 = mathboxComponentFactory("stereographic4")
345
-
346
- /**
347
- * Component wrapper for mathbox [`strip`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#drawstrip).
348
- */
349
- export const Strip = mathboxComponentFactory("strip")
350
-
351
- /**
352
- * Component wrapper for mathbox [`subdivide`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatorsubdivide).
353
- */
354
- export const Subdivide = mathboxComponentFactory("subdivide")
355
-
356
- /**
357
- * Component wrapper for mathbox [`surface`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#drawsurface).
358
- */
359
- export const Surface = mathboxComponentFactory("surface")
360
-
361
- /**
362
- * Component wrapper for mathbox [`swizzle`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatorswizzle).
363
- */
364
- export const Swizzle = mathboxComponentFactory("swizzle")
365
-
366
- /**
367
- * Component wrapper for mathbox [`text`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#texttext).
368
- */
369
- export const Text = mathboxComponentFactory("text")
370
-
371
- /**
372
- * Component wrapper for mathbox [`ticks`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#drawticks).
373
- */
374
- export const Ticks = mathboxComponentFactory("ticks")
375
-
376
- /**
377
- * Component wrapper for mathbox [`transform`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#transformtransform).
378
- */
379
- export const Transform = mathboxComponentFactory("transform")
380
-
381
- /**
382
- * Component wrapper for mathbox [`transform4`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#transformtransform4).
383
- */
384
- export const Transform4 = mathboxComponentFactory("transform4")
385
-
386
- /**
387
- * Component wrapper for mathbox [`transpose`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#operatortranspose).
388
- */
389
- export const Transpose = mathboxComponentFactory("transpose")
390
-
391
- /**
392
- * Component wrapper for mathbox [`unit`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#baseunit).
393
- */
394
- export const Unit = mathboxComponentFactory("unit")
395
-
396
- /**
397
- * Component wrapper for mathbox [`vector`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#drawvector).
398
- */
399
- export const Vector = mathboxComponentFactory("vector")
400
-
401
- /**
402
- * Component wrapper for mathbox [`vertex`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#transformvertex).
403
- */
404
- export const Vertex = mathboxComponentFactory("vertex")
405
-
406
- /**
407
- * Component wrapper for mathbox [`view`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#viewview).
408
- */
409
- export const View = mathboxComponentFactory("view")
410
-
411
- /**
412
- * Component wrapper for mathbox [`volume`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#datavolume).
413
- */
414
- export const Volume = mathboxComponentFactory("volume")
415
-
416
- /**
417
- * Component wrapper for mathbox [`voxel`](https://gitgud.io/unconed/mathbox/-/blob/master/docs/primitives.md#datavoxel).
418
- */
419
- export const Voxel = mathboxComponentFactory("voxel")
@@ -1,3 +0,0 @@
1
- export * from "./components"
2
- export { default as Mathbox } from "./Mathbox"
3
- export { default as ContainedMathbox } from "./ContainedMathbox"