@gorilla-engine-sdk/gorilla-engine-react 1.6.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 (79) hide show
  1. package/LICENSE.md +64 -0
  2. package/README.md +345 -0
  3. package/dist/ComponentFactory.d.ts +180 -0
  4. package/dist/ComponentFactory.js +118 -0
  5. package/dist/GEReact.d.ts +53 -0
  6. package/dist/GEReact.js +237 -0
  7. package/dist/Root.d.ts +15 -0
  8. package/dist/Root.js +52 -0
  9. package/dist/hooks/useInstrument.d.ts +27 -0
  10. package/dist/hooks/useInstrument.js +109 -0
  11. package/dist/hooks/useInstrumentProperty.d.ts +47 -0
  12. package/dist/hooks/useInstrumentProperty.js +113 -0
  13. package/dist/index.d.ts +50 -0
  14. package/dist/index.js +67 -0
  15. package/dist/instance.d.ts +18 -0
  16. package/dist/instance.js +16 -0
  17. package/dist/nativeWrappers/GEAmpEnv.d.ts +9 -0
  18. package/dist/nativeWrappers/GEAmpEnv.js +12 -0
  19. package/dist/nativeWrappers/GEBarStepEditor.d.ts +12 -0
  20. package/dist/nativeWrappers/GEBarStepEditor.js +16 -0
  21. package/dist/nativeWrappers/GEButton.d.ts +17 -0
  22. package/dist/nativeWrappers/GEButton.js +21 -0
  23. package/dist/nativeWrappers/GEComboBox.d.ts +18 -0
  24. package/dist/nativeWrappers/GEComboBox.js +16 -0
  25. package/dist/nativeWrappers/GECurve.d.ts +9 -0
  26. package/dist/nativeWrappers/GECurve.js +12 -0
  27. package/dist/nativeWrappers/GEDragContainer.d.ts +24 -0
  28. package/dist/nativeWrappers/GEDragContainer.js +22 -0
  29. package/dist/nativeWrappers/GEDragTarget.d.ts +20 -0
  30. package/dist/nativeWrappers/GEDragTarget.js +20 -0
  31. package/dist/nativeWrappers/GEDropZone.d.ts +22 -0
  32. package/dist/nativeWrappers/GEDropZone.js +20 -0
  33. package/dist/nativeWrappers/GEKnob.d.ts +18 -0
  34. package/dist/nativeWrappers/GEKnob.js +19 -0
  35. package/dist/nativeWrappers/GELabel.d.ts +16 -0
  36. package/dist/nativeWrappers/GELabel.js +20 -0
  37. package/dist/nativeWrappers/GELevelMeter.d.ts +8 -0
  38. package/dist/nativeWrappers/GELevelMeter.js +12 -0
  39. package/dist/nativeWrappers/GEListBox.d.ts +17 -0
  40. package/dist/nativeWrappers/GEListBox.js +15 -0
  41. package/dist/nativeWrappers/GELottieAnimation.d.ts +16 -0
  42. package/dist/nativeWrappers/GELottieAnimation.js +17 -0
  43. package/dist/nativeWrappers/GEMappingEditor.d.ts +24 -0
  44. package/dist/nativeWrappers/GEMappingEditor.js +22 -0
  45. package/dist/nativeWrappers/GEMidiKeyboard.d.ts +8 -0
  46. package/dist/nativeWrappers/GEMidiKeyboard.js +12 -0
  47. package/dist/nativeWrappers/GEPad.d.ts +15 -0
  48. package/dist/nativeWrappers/GEPad.js +16 -0
  49. package/dist/nativeWrappers/GERubberband.d.ts +16 -0
  50. package/dist/nativeWrappers/GERubberband.js +17 -0
  51. package/dist/nativeWrappers/GEScrollView.d.ts +26 -0
  52. package/dist/nativeWrappers/GEScrollView.js +21 -0
  53. package/dist/nativeWrappers/GESliceEditor.d.ts +30 -0
  54. package/dist/nativeWrappers/GESliceEditor.js +23 -0
  55. package/dist/nativeWrappers/GESlider.d.ts +20 -0
  56. package/dist/nativeWrappers/GESlider.js +20 -0
  57. package/dist/nativeWrappers/GEStepEditor.d.ts +12 -0
  58. package/dist/nativeWrappers/GEStepEditor.js +16 -0
  59. package/dist/nativeWrappers/GETagBrowser.d.ts +15 -0
  60. package/dist/nativeWrappers/GETagBrowser.js +16 -0
  61. package/dist/nativeWrappers/GETagEditor.d.ts +15 -0
  62. package/dist/nativeWrappers/GETagEditor.js +16 -0
  63. package/dist/nativeWrappers/GETextBox.d.ts +22 -0
  64. package/dist/nativeWrappers/GETextBox.js +20 -0
  65. package/dist/nativeWrappers/GEToggle.d.ts +18 -0
  66. package/dist/nativeWrappers/GEToggle.js +16 -0
  67. package/dist/nativeWrappers/GEWaveform.d.ts +17 -0
  68. package/dist/nativeWrappers/GEWaveform.js +17 -0
  69. package/dist/nativeWrappers/GEXYPad.d.ts +16 -0
  70. package/dist/nativeWrappers/GEXYPad.js +17 -0
  71. package/dist/nativeWrappers/common/GEComponent.d.ts +104 -0
  72. package/dist/nativeWrappers/common/GEComponent.js +226 -0
  73. package/dist/nativeWrappers/common/ReactElementProps.d.ts +20 -0
  74. package/dist/nativeWrappers/common/ReactElementProps.js +3 -0
  75. package/dist/nativeWrappers/common/clickableHandlerMappings.d.ts +40 -0
  76. package/dist/nativeWrappers/common/clickableHandlerMappings.js +21 -0
  77. package/dist/nativeWrappers/common/keyableHandlerMappings.d.ts +16 -0
  78. package/dist/nativeWrappers/common/keyableHandlerMappings.js +13 -0
  79. package/package.json +59 -0
package/LICENSE.md ADDED
@@ -0,0 +1,64 @@
1
+ **IMPORTANT NOTICE: PLEASE READ CAREFULLY BEFORE DOWNLOADING, INSTALLING OR USING THE GORILLA ENGINE SDK:**
2
+
3
+ - BY SIGNING THIS AGREEMENT, OR CLICKING ON THE “ACCEPT” BUTTON BELOW (IF AVAILABLE), OR BY DOWNLOADING, INSTALLING, OR USING THE GORILLA ENGINE SDK, YOU AGREE TO THE TERMS OF THIS AGREEMENT, AND ALL INCORPORATED TERMS INCLUDING GORILLA ENGINE’S PRIVACY POLICY, AS APPLICABLE, WHICH WILL BIND YOU.
4
+
5
+ - IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, WE WILL NOT LICENSE THE GORILLA ENGINE SDK TO YOU AND YOU MUST DISCONTINUE THE INSTALLATION OR DOWNLOAD PROCESS OR CEASE USE OF THE UJAM GORILLA ENGINE SDK.
6
+
7
+ **GORILLA ENGINE FREE TIER LICENSE**
8
+
9
+ This Gorilla Engine Free Tier License ("Agreement") is entered between UJAM, Inc., a Delaware corporation (hereinafter "UJAM" or "we") and you (“Licensee” or “you”) and becomes effective once you download, install, or use the GORILLA ENGINE SDK.
10
+
11
+ 1. OBJECT OF AGREEMENT. This Agreement governs UJAM’s GORILLA ENGINE SDK (“SDK”) and all related software and documentation and any update, upgrades or bug fixes (collectively referred to as the "UJAM GORILLA ENGINE SDK SERVICE").
12
+
13
+ 2. GRANT OF LICENSE: Subject to your full compliance with all of the terms and conditions of this Agreement, we grant you a non-exclusive, revocable, nonsublicensable (except as specifically provided herein), non-transferable license to use the UJAM GORILLA ENGINE SDK SERVICE solely to: (i) download, install, and use the UJAM GORILLA ENGINE SDK SERVICE for the sole purpose of building audio plugins such as virtual instruments and effects ("Application") and using such Application for music productions and live performances. **HOWEVER, YOU MUST NOT SHARE OR OTHERWISE EXPLOIT YOUR GORILLA ENGINE BASED APPLICATION WITH ANY THIRD PARTY UNTIL YOU HAVE ACQUIRED ONE OF THE ADD-ON LICENSES AS FURTHER DESCRIBED IN SECTION 8 OF THIS AGREEMENT.** If you have any questions regarding this license and allowed uses of the SDK, please reach out to us via email at support@gorilla-engine.com.
14
+
15
+ 3. LICENSE RESTRICTIONS AND OBLIGATIONS: Except as expressly and unambiguously authorized under this Agreement, you must not
16
+ 1. copy, rent, lease, sell, transfer, assign, sublicense, disassemble, reverse engineer or decompile (except to the limited extent expressly authorized by applicable statutory law), modify, create derivative works from, or alter any part of the UJAM GORILLA ENGINE SDK SERVICE;
17
+ 2. sublicense your Application to end-users until you have acquired a license as further described in Section 8 of this Agreement.
18
+ 3. use any automated means, including, without limitation, agents, robots, scripts or spiders, to access the UJAM GORILLA ENGINE SDK SERVICE or bypass the UJAM GORILLA ENGINE SDK SERVICE or to interfere or attempt to interfere with the proper working of the UJAM GORILLA ENGINE SDK SERVICE;
19
+ 4. use the UJAM GORILLA ENGINE SDK SERVICE as a dynamic-link library (for clarity: the SDK shall solely be used as a statically linked library); (g) use the SDK or any part of the SDK in connection with building or distributing your own or a third-party SDK or framework; or (h) use the Licensed Software to train artificial intelligence, your own or a third-party algorithm, and/or any other kind of machine learning processes.
20
+ 5. use the UJAM GORILLA ENGINE SDK SERVICE for the benefit of a third party, other than end users of your Applications as expressly authorized by this Agreement;
21
+ 6. use the UJAM GORILLA ENGINE SDK SERVICE to implement or enhance a product or service that is competitive with the UJAM GORILLA ENGINE SDK SERVICE;
22
+ 7. modify and/or rename the UJAM binary libraries; or
23
+ 8. otherwise engage in activity that interrupts the proper working of the UJAM GORILLA ENGINE SDK SERVICE or is otherwise fraudulent or illegal.
24
+
25
+ Furthermore, you agree
26
+
27
+ 9. display attribution on all embodiments and uses of the Gorilla Engine SDK by displaying the language “powered by Gorilla Engine” ; and
28
+ 10. to contact UJAM once you intend to Distribute (as defined in Section 8\) your Application to obtain the appropriate license to do so – which you agree is required for such a scenario (as further described in Section 8 below).
29
+
30
+ We reserve the right to discontinue, modify, cease support of, and alter the pricing structure of this Agreement (the Gorilla Engine Free Tier License) of the UJAM GORILLA ENGINE SDK SERVICE.
31
+
32
+ 10. LICENSE TO UJAM: You hereby grant to us the non-exclusive, perpetual, worldwide, royalty-free right and license to any and all content ("Content") provided by you or your end users in connection with your use or your end users' use of the SDK, including but not limited to feedback or other contributions made towards the UJAM GORILLA ENGINE SDK SERVICE (including so-called re-usable components, made available by UJAM via its repositories), in order for us to provide and improve the UJAM GORILLA ENGINE SDK SERVICE. You represent and warrant that all Content provided by you shall not violate any third party rights and shall be free of any and all claims.
33
+
34
+ 11. REPRESENTATIONS AND WARRANTIES: You represent and warrant that you: (i) are fully authorized to enter into this agreement; (ii) shall use the UJAM GORILLA ENGINE SDK SERVICE in compliance with all applicable local, state, national and foreign laws, treaties and regulations, including those related to data privacy, international communications, export laws and the transmission of technical or personal data laws; (iii) shall not (and shall not permit any third party, including a permitted sublicensee to), directly or indirectly, take any action or upload, download, post, submit or otherwise distribute or facilitate distribution of Content or any material on or through the UJAM GORILLA ENGINE SDK SERVICE, that: (a) infringes any patent, trademark, trade secret, copyright, right of publicity/privacy or other right of any third party or induces infringement thereof; (b) breaches any third party contract or obligation; (c) is unlawful, threatening, abusive, harassing, defamatory, deceptive, fraudulent, invasive of another's privacy, tortious, obscene, offensive, or profane.
35
+
36
+ 12. OWNERSHIP AND PROPRIETARY RIGHTS: As between UJAM and Licensee (and any permitted sublicensees), the SDK and all intellectual property rights in and to the UJAM GORILLA ENGINE SDK SERVICE, are and shall at all times remain the sole and exclusive property of UJAM and are protected by applicable intellectual property laws and treaties. You shall not obscure, remove or otherwise alter our copyright or trademark notices or other proprietary rights' notices affixed to or within the SDK or elsewhere.
37
+
38
+ 13. SUPPORT AND UPGRADES: This Agreement does not entitle you to any support for the SDK, unless you enter into a separate agreement with us in writing, either signed by both parties or agreed upon via click-through agreement. Any such support provided by us shall be subject to the terms and disclaimers of this Agreement.
39
+
40
+ 14. ADD-ON LICENSES FOR A PERMITTED DISTRIBUTION OF GORILLA ENGINE BASED APPLICATION:
41
+ 1. **Add-On Licenses (Upgrade to Pro Tier):** You agree to contact UJAM to obtain one of our commercial license (including the so-called “Pro Tier” License, including available optional Add-On upgrades which can be ) (collectively referred to as “Add-On Licenses”), whichever deemed to be appropriate for your intended use of the SDK, to Distribute (as defined below in subsection ii.) your Gorilla Engine based Application to end-users. Such Add-On License shall supersede this Agreement, as agreed to by the parties.
42
+ 2. **Failure to comply with Section 8:** If you fail to comply with Section 8(i) by Distributing the SDK as part of an Application beyond the allowed use under this Agreement, you shall immediately contact UJAM and pay to UJAM a royalty per each Distribution (as defined below) in an amount as solely determined by UJAM. A Distribution refers to either an embedded, pre-bundled, pre-installed platform application or software application that is downloaded, delivered, or served to a user or device by any means of distribution including directly from you or through any platform, including cloud based platforms. In avoidance of doubt, any subscription or rental shall be considered a Distribution.
43
+ 3. **Audit Rights**: Should (i) you fail to obtain an Add-On License and distribute the SDK as part of an Application, or should (ii) UJAM believe that you distribute the Application without having obtained an Add-On License, then UJAM shall have the right, upon reasonable notice, to audit/inspect any premises, computer(s), and networks on or in which the SDK is installed or used to monitor compliance with the terms of this Agreement, including but not limited to confirming the number of Distributions of the Application. If an audit reveals any unauthorized use, in addition to all other remedies available to UJAM, you shall be responsible to UJAM for all reasonable expenses related to the audit.
44
+ 4. **Third Party Libraries:** You acknowledge that certain third-party libraries, including JUCE 6 ([https://juce.com/legal/juce-6-license/](https://juce.com/legal/juce-6-license/)), may be used in connection with the SDK, subject to their respective license agreements as further disclosed by UJAM. It is your sole responsibility to abide to such third-party terms, which may include your obligations, amongst others, to provide certain disclosures accompanying your Gorilla Engine based Software and/or acquiring a JUCE license (if applicable).
45
+
46
+ 15. DATA PROTECTION AND PRIVACY: We may collect and process information about you and your use of the Gorilla Engine SDK, some of which may amount to personal data, subject to Gorilla Engine’s Privacy Policy.
47
+
48
+ 16. TRADE SECRETS AND CONFIDENTIAL INFORMATION: You acknowledges that the SDK contains valuable trade secrets of UJAM and, should you access any such trade secrets in violation of this Agreement, you agree to maintain the confidentiality of the trade secrets of the SDK using at least the same degree of care that you use with your own confidential information.
49
+
50
+ 17. WARRANTY DISCLAIMER: THE UJAM GORILLA ENGINE SDK SERVICE, INCLUDING THE SDK, IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, WE DISCLAIM ALL WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, REGARDING THE UJAM GORILLA ENGINE SDK SERVICE, INCLUDING WITHOUT LIMITATION ANY AND ALL IMPLIED WARRANTIES OF MERCHANTABILITY, ACCURACY, RESULTS OF USE, RELIABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AVAILABILITY, PERFORMANCE, BANDWIDTH, AND NON-INFRINGEMENT OF THIRD-PARTY RIGHTS. FURTHER, WE DISCLAIM ANY WARRANTY THAT LICENSEE'S USE OF THE UJAM GORILLA ENGINE SDK SERVICE WILL BE AVAILABLE, UNINTERRUPTED OR ERROR FREE.
51
+
52
+ 18. LIABILITY LIMITATION: REGARDLESS OF WHETHER ANY REMEDY SET FORTH HEREIN FAILS OF ITS ESSENTIAL PURPOSE OR OTHERWISE, AND EXCEPT FOR BODILY INJURY, IN NO EVENT WILL WE OR OUR CONTRACTORS, EMPLOYEES OR AFFILIATES BE LIABLE TO YOU OR TO ANY THIRD PARTY UNDER ANY TORT, CONTRACT, NEGLIGENCE, STRICT LIABILITY OR OTHER LEGAL OR EQUITABLE THEORY FOR ANY LOST PROFITS, LOST OR CORRUPTED DATA, COMPUTER FAILURE OR MALFUNCTION, INFRINGEMENT, INTERRUPTION OF BUSINESS, OR OTHER SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND ARISING OUT OF THE USE OR INABILITY TO USE THE UJAM GORILLA ENGINE SDK SERVICE, EVEN IF WE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES AND WHETHER OR NOT SUCH LOSS OR DAMAGES ARE FORESEEABLE. IN NO EVENT SHALL OUR TOTAL LIABILITY TO YOU OR ANY THIRD PARTY EXCEED TEN USD DOLLARS. ANY CLAIM ARISING OUT OF OR RELATING TO THIS AGREEMENT MUST BE BROUGHT WITHIN ONE (1) YEAR AFTER THE OCCURRENCE OF THE EVENT GIVING RISE TO SUCH CLAIM.
53
+
54
+ 19. INDEMNITY: You agree that we shall have no liability whatsoever for your or your end users of the UJAM GORILLA ENGINE SDK SERVICE. You shall indemnify, defend and hold us harmless from any and all claims, damages, liabilities, costs, and fees (including reasonable attorneys' fees) arising from your or your end users' use of the UJAM GORILLA ENGINE SDK SERVICE or for any breach of this Agreement, including any breach of the representations and warranties you made herein.
55
+
56
+ 20. TERM AND TERMINATION: This Agreement shall continue until terminated as set forth in this Section. Either party may terminate this Agreement at any time, for any reason, or for no reason including, but not limited to, if you violate any provision of this Agreement. We reserve the right to cancel, amend, or modify the SDK at any time. Any termination of this Agreement shall also terminate the license granted hereunder. Upon termination of this Agreement for any reason, you shall immediately destroy and remove from all computers, hard drives, networks, and other storage media all copies of the SDK, and shall so certify to us that such actions have occurred (including all cached ephemeral copies). Sections 5 (“REPRESENTATIONS AND WARRANTIES”), 6 (“OWNERSHIP AND PROPRIETARY RIGHTS”), 10 (“TRADE SECRETS AND CONFIDENTIAL INFORMATION”), 11 (“WARRANTY DISCLAIMER”), 12 (“LIABILITY LIMITATION”), 13 (“INDEMNITY”), 16 (“GOVERNING LAW”), 18 (“GENERAL PROVISIONS”) shall survive termination of this Agreement.
57
+
58
+ 21. EXPORT CONTROLS: You shall comply with all applicable export laws and restrictions and regulations and you shall not export, or allow the export or re-export of the SDK in violation of any such restrictions, laws, or regulations.
59
+
60
+ 22. GOVERNING LAW: This Agreement shall be governed by New York law, excluding conflict of law provisions. The parties agree to and submit to the exclusive jurisdiction of courts located in New York City, New York. The application of the United Nations Convention of Contracts for the International Sale of Goods is expressly excluded.
61
+
62
+ 23. PREVAILING PARTY. Notwithstanding Section 12 (“LIABILITY LIMITATION”), in the event of any court action relating to enforcement of this Agreement, including injunctive relief, the non-prevailing party shall reimburse the prevailing party for all reasonable attorneys’ fees and costs, including expert witness fees, resulting therefrom.
63
+
64
+ 24. GENERAL PROVISIONS. If any part of this Agreement is found void or unenforceable, it will not affect the validity of the balance of the Agreement, which shall remain valid and enforceable according to its terms. This Agreement may only be modified by written agreement between the Parties. Updates to the UJAM GORILLA ENGINE SDK SERVICE may be licensed to you by UJAM with additional or different terms. UJAM further reserves rights, in its discretion, not to license updates. This is the entire Agreement between UJAM and you relating to the UJAM GORILLA ENGINE SDK SERVICE and it supersedes any prior representations, discussions, undertakings, communications, or advertising relating to the UJAM GORILLA ENGINE SDK SERVICE. This Agreement is not assignable by you.
package/README.md ADDED
@@ -0,0 +1,345 @@
1
+ # gorilla-engine-react
2
+
3
+ A custom [React reconciler](https://github.com/facebook/react/tree/main/packages/react-reconciler) for building native audio plugin UIs with [Gorilla Engine](https://www.gorilla-engine.com/).
4
+
5
+ Write your plugin interface using familiar React patterns — components, hooks, state, JSX — and `gorilla-engine-react` translates it into native Gorilla Engine UI operations under the hood.
6
+
7
+ ---
8
+
9
+ ## Table of Contents
10
+
11
+ - [Features](#features)
12
+ - [Installation](#installation)
13
+ - [Quick Start](#quick-start)
14
+ - [Components](#components)
15
+ - [Hooks](#hooks)
16
+ - [Bindings](#bindings)
17
+ - [Accessing Native Components](#accessing-native-components)
18
+ - [Development](#development)
19
+ - [Testing](#testing)
20
+ - [License](#license)
21
+
22
+ ---
23
+
24
+ ## Features
25
+
26
+ - **Full React API** — functional components, hooks, state, effects, context, fragments, lists with keys
27
+ - **27 native component wrappers** — knobs, sliders, buttons, waveforms, MIDI keyboards, and more
28
+ - **Declarative data binding** — bind UI controls to instrument parameters with a simple `bindings` prop
29
+ - **Instrument hooks** — `useInstrument` and `useInstrumentProperty` for reactive parameter access
30
+ - **TypeScript-first** — full type definitions and JSX IntrinsicElements support
31
+
32
+ > **Note:** The composed components that were previously bundled here (`LabelledKnob`, `LabelledSlider`, `PadKeyboard`, `RadioGroup`, `SkinnableKeyboard`) have been removed. Use the standalone packages instead:
33
+ >
34
+ > | Component | Package |
35
+ > | -------------------------------- | ------------------------------------------- |
36
+ > | `LabelledKnob`, `LabelledSlider` | `@gorilla-engine-sdk/ge-labeled-components` |
37
+
38
+ ---
39
+
40
+ ## Installation
41
+
42
+ ```bash
43
+ npm install @gorilla-engine-sdk/gorilla-engine-react
44
+ ```
45
+
46
+ > **Peer dependency:** Your project must have access to the `GorillaEngine` runtime (provided by the Gorilla Engine host environment).
47
+
48
+ ---
49
+
50
+ ## Quick Start
51
+
52
+ ### Rendering a React app
53
+
54
+ ```tsx
55
+ import * as React from 'react';
56
+ import * as GEReact from 'gorilla-engine-react';
57
+ import App from './App';
58
+
59
+ // If you're using a yaml file for your root layout
60
+ // Optionally provide the path to the yaml file as a second argument.
61
+ // Default convention is [installDir]/[pluginName].yaml
62
+ // The yaml file must exist at the installed path
63
+ GEReact.loadUI(<App />);
64
+
65
+ // Otherwise create the root layout directly, with no need to supply a yaml file
66
+ GEReact.createUI(<App />, { width: 800, height: 600 });
67
+ ```
68
+
69
+ ### Building a UI with native components
70
+
71
+ ```tsx
72
+ import * as React from 'react';
73
+ import { Button, Label, Toggle, TextBox, ScrollView } from 'gorilla-engine-react';
74
+
75
+ const { useState } = React;
76
+
77
+ function Todo({ todo, onRemove, onChange, y }) {
78
+ return (
79
+ <>
80
+ <Toggle
81
+ x={0}
82
+ y={y}
83
+ width={30}
84
+ height={30}
85
+ value={todo.finished}
86
+ onChange={(value) => onChange(todo, { finished: value })}
87
+ />
88
+ <Label
89
+ x={30}
90
+ y={y}
91
+ width={200}
92
+ height={30}
93
+ textAlign="left"
94
+ textColor={todo.finished ? 'green' : 'white'}
95
+ text={todo.text}
96
+ />
97
+ <Button x={300} y={y} width={60} height={30} text="x" onClick={() => onRemove(todo)} />
98
+ </>
99
+ );
100
+ }
101
+
102
+ function App() {
103
+ const [todos, setTodos] = useState([
104
+ { text: 'Cleaning', finished: false, key: '1' },
105
+ { text: 'Mix down track', finished: false, key: '2' },
106
+ ]);
107
+
108
+ const addTodo = (todo) => setTodos([...todos, todo]);
109
+ const removeTodo = (todo) => setTodos(todos.filter((t) => t !== todo));
110
+ const changeTodo = (todo, change) =>
111
+ setTodos(todos.map((t) => (t === todo ? { ...t, ...change } : t)));
112
+
113
+ return (
114
+ <ScrollView x={100} y={100} width={400} height={300}>
115
+ {todos.map((todo, i) => (
116
+ <Todo key={todo.key} todo={todo} y={i * 35} onRemove={removeTodo} onChange={changeTodo} />
117
+ ))}
118
+ </ScrollView>
119
+ );
120
+ }
121
+
122
+ export default App;
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Components
128
+
129
+ ### Native Wrappers
130
+
131
+ Each wrapper maps directly to a Gorilla Engine native UI component. All accept standard positioning props (`x`, `y`, `width`, `height`) plus component-specific props.
132
+
133
+ | Component | Native Type | Key Props |
134
+ | ------------------- | ----------------- | ----------------------------------------------------- |
135
+ | `GEButton` | `Trigger` | `text`, `onClick` |
136
+ | `GEKnob` | `Knob` | `value`, `onChange` |
137
+ | `GESlider` | `Knob (slider)` | `value`, `onChange` |
138
+ | `GEToggle` | `Toggle` | `value`, `onChange` |
139
+ | `GEComboBox` | `ComboBox` | `value`, `onChange` |
140
+ | `GELabel` | `Label` | `text`, `textAlign`, `textColor` |
141
+ | `GETextBox` | `TextBox` | `text`, `onChange`, `onFocusLost` |
142
+ | `GEScrollView` | `ScrollView` | `onScrollPosX`, `onScrollPosY` |
143
+ | `GEPad` | `Pad` | `onClick` |
144
+ | `GEMidiKeyboard` | `MidiKeyboard` | — |
145
+ | `GEWaveform` | `Waveform` | `onDragzonePositionChanged` |
146
+ | `GELevelMeter` | `LevelMeter` | — |
147
+ | `GECurve` | `Curve` | — |
148
+ | `GEAmpEnv` | `AmpEnv` | — |
149
+ | `GEXYPad` | `XYPad` | — |
150
+ | `GELottieAnimation` | `LottieAnimation` | — |
151
+ | `GEListBox` | `ListBox` | `onRowClicked` |
152
+ | `GESliceEditor` | `SliceEditor` | `onSliceAdded`, `onSliceChanged`, … |
153
+ | `GEStepEditor` | `StepEditor` | click handlers |
154
+ | `GEBarStepEditor` | `BarStepEditor` | click handlers |
155
+ | `GEDragContainer` | `DragContainer` | `onDragging`, `onDragStart`, `onDragEnd` |
156
+ | `GEDragTarget` | `DragTarget` | `onItemDropped` |
157
+ | `GEDropZone` | `DropZone` | `onFileDragEnter`, `onFileDragLeave`, `onFileDropped` |
158
+ | `GERubberband` | `Rubberband` | — |
159
+ | `GETagBrowser` | `TagBrowser` | — |
160
+ | `GETagEditor` | `TagEditor` | — |
161
+ | `GEMappingEditor` | `MappingEditor` | `onSelectedZone`, `onDraggedZone`, … |
162
+
163
+ ---
164
+
165
+ ## Hooks
166
+
167
+ ### `useInstrument`
168
+
169
+ Loads the default blob and instrument from the Gorilla Engine runtime. Optionally pass the blobPath as a second argument.
170
+
171
+ Typically, expose the loaded instrument via a Provider so its easy to access throughout your app.
172
+
173
+ ```tsx
174
+ import { useInstrument } from 'gorilla-engine-react';
175
+
176
+ function App() {
177
+ const [instrument] = useInstrument();
178
+ // instrument is a GorillaEngine.Instrument or null while loading
179
+ }
180
+ ```
181
+
182
+ **Parameters:**
183
+
184
+ | Param | Type | Default | Description |
185
+ | ---------------- | -------- | ----------- | ----------------------------------------------------------------- |
186
+ | `blobName` | `string` | `undefined` | Blob file to load (defaults to the runtime's default blob) |
187
+ | `instrumentName` | `string` | `undefined` | Instrument name within the blob (defaults to the first available) |
188
+
189
+ ### `useInstrumentProperty`
190
+
191
+ Reactively subscribes to an instrument parameter, returning its current value and a setter.
192
+ A convenient way to interact with instrument properties via properties and event handlers, as an alternative to declarative binding (see below). Use this method when you need more control over the handling of events and properties.
193
+
194
+ ```tsx
195
+ import { useInstrument, useInstrumentProperty } from 'gorilla-engine-react';
196
+
197
+ function MixControl() {
198
+ const [instrument] = useInstrument();
199
+ const [mix, setMix] = useInstrumentProperty(instrument, 'mix');
200
+
201
+ return (
202
+ <>
203
+ <Label x={0} y={0} width={200} height={40} text={`Mix: ${mix.text}`} />
204
+ <GEKnob
205
+ x={0}
206
+ y={50}
207
+ width={60}
208
+ height={60}
209
+ value={mix.normValue}
210
+ onChange={(v) => setMix(v)}
211
+ />
212
+ <Button x={0} y={120} width={100} height={30} text="Reset" onClick={() => setMix(50)} />
213
+ </>
214
+ );
215
+ }
216
+ ```
217
+
218
+ **Returns:** `[propertyValue, setValue, setNormValue]`
219
+
220
+ | Return | Type | Description |
221
+ | --------------- | ---------------------------- | ------------------------------------------ |
222
+ | `propertyValue` | `{ value, normValue, text }` | Current parameter state |
223
+ | `setValue` | `(value: number) => void` | Set the parameter's absolute value |
224
+ | `setNormValue` | `(value: number) => void` | Set the parameter's normalised value (0–1) |
225
+
226
+ ---
227
+
228
+ ## Bindings
229
+
230
+ Declaratively bind component properties to instrument parameters using the `bindings` prop. This is the most efficient way to bind UI controls to instrument properties. Use this when you want to bind directly to the instrument property.
231
+
232
+ ```tsx
233
+ <GEKnob x={0} y={0} width={60} height={60} bindings={{ value: 'instrument.volume' }} />
234
+ ```
235
+
236
+ This expands internally to the native `&`-prefixed binding syntax (`{ '&value': 'instrument.volume' }`), connecting the knob directly to the `volume` parameter on the instrument. The instrument must have this parameter exposed.
237
+
238
+ ---
239
+
240
+ ## Accessing Native Components
241
+
242
+ It is often necessary to have a reference to the native component API. To establish this, import the component, add a React ref property to the TSX element, and access the native component reference using `.current.nativeHandle`. For example:
243
+
244
+ ```ts
245
+
246
+ import { GEButton } from '@gorilla-engine-sdk/gorilla-engine-react';
247
+ export function MyButton(props) {
248
+
249
+ const buttonRef = React.createRef<GEButton>()
250
+ const nativeComponentRef = buttonRef.current?.nativeHandle
251
+
252
+ return <geButton ref={buttonRef} />
253
+ }
254
+ ```
255
+
256
+ ## Development
257
+
258
+ ### Prerequisites
259
+
260
+ - Node.js and npm
261
+ - A Gorilla Engine plugin project (create one with `create-gorilla-engine-plugin`)
262
+
263
+ ### Build
264
+
265
+ ```bash
266
+ # Build once
267
+ npm run build
268
+
269
+ # Watch for changes
270
+ npm start
271
+ ```
272
+
273
+ ### Local Development Flow
274
+
275
+ 1. Create a plugin project with `create-gorilla-engine-plugin` (or use an existing one)
276
+ 2. Link this package locally:
277
+
278
+ ```bash
279
+ # In this directory
280
+ npm link
281
+
282
+ # In your plugin project
283
+ npm link @gorilla-engine-sdk/gorilla-engine-react
284
+ ```
285
+
286
+ 3. Run both watchers in parallel:
287
+
288
+ ```bash
289
+ # Terminal 1 — this package
290
+ npm start
291
+
292
+ # Terminal 2 — your plugin project
293
+ npm start
294
+ ```
295
+
296
+ 4. Changes to `gorilla-engine-react` will trigger a rebuild and redeploy of the plugin
297
+
298
+ To remove the link:
299
+
300
+ ```bash
301
+ npm unlink --save=false @gorilla-engine-sdk/gorilla-engine-react
302
+ ```
303
+
304
+ ### Generate API Docs
305
+
306
+ ```bash
307
+ npm run docs
308
+ ```
309
+
310
+ Output is written to `./docs` using [TypeDoc](https://typedoc.org/).
311
+
312
+ ---
313
+
314
+ ## Testing
315
+
316
+ Tests use [Jest](https://jestjs.io/) with [ts-jest](https://kulshekhar.github.io/ts-jest/).
317
+
318
+ ```bash
319
+ npm test
320
+ ```
321
+
322
+ Test files are in the `test/` directory with a shared `GorillaEngine` mock in `test/setup.ts`.
323
+
324
+ ### Test Structure
325
+
326
+ ```
327
+ test/
328
+ ├── setup.ts # GorillaEngine mock utilities
329
+ ├── GEComponent.test.ts # Base component class tests
330
+ ├── ComponentFactory.test.ts # Factory + all 27 component types
331
+ ├── nativeWrappers.test.ts # Event handler mapping tests
332
+ ├── InstrumentPropertyChangeEmitter.test.ts
333
+ ├── instance.test.ts
334
+ └── integration/
335
+ ├── reconcilerLifecycle.test.ts # Create → append → update → remove
336
+ └── eventHandlers.test.ts # Handler registration + bindings
337
+ ```
338
+
339
+ ---
340
+
341
+ ## License
342
+
343
+ [Gorilla Engine Free Tier License](./LICENSE.md)
344
+
345
+ Copyright UJAM Music Technology GmbH
@@ -0,0 +1,180 @@
1
+ import { GEComponent } from './nativeWrappers/common/GEComponent';
2
+ import { GELabelProps } from './nativeWrappers/GELabel';
3
+ import { GEButtonProps } from './nativeWrappers/GEButton';
4
+ import { GETextBoxProps } from './nativeWrappers/GETextBox';
5
+ import { GEScrollViewProps } from './nativeWrappers/GEScrollView';
6
+ import { GEToggleProps } from './nativeWrappers/GEToggle';
7
+ import { GEComboBoxProps } from './nativeWrappers/GEComboBox';
8
+ import { GECurveProps } from './nativeWrappers/GECurve';
9
+ import { GEMidiKeyboardProps } from './nativeWrappers/GEMidiKeyboard';
10
+ import { GEKnobProps } from './nativeWrappers/GEKnob';
11
+ import { GEPadProps } from './nativeWrappers/GEPad';
12
+ import { GESliceEditorProps } from './nativeWrappers/GESliceEditor';
13
+ import { GELevelMeterProps } from './nativeWrappers/GELevelMeter';
14
+ import { GEWaveformProps } from './nativeWrappers/GEWaveform';
15
+ import { GEAmpEnvProps } from './nativeWrappers/GEAmpEnv';
16
+ import { GEListBoxProps } from './nativeWrappers/GEListBox';
17
+ import { GEBarStepEditorProps } from './nativeWrappers/GEBarStepEditor';
18
+ import { GEStepEditorProps } from './nativeWrappers/GEStepEditor';
19
+ import { GEDragContainerProps } from './nativeWrappers/GEDragContainer';
20
+ import { GEDropZoneProps } from './nativeWrappers/GEDropZone';
21
+ import { GEDragTargetProps } from './nativeWrappers/GEDragTarget';
22
+ import { GELottieAnimationProps } from './nativeWrappers/GELottieAnimation';
23
+ import { GESliderProps } from './nativeWrappers/GESlider';
24
+ import { GEXYPadProps } from './nativeWrappers/GEXYPad';
25
+ import { GERubberbandProps } from './nativeWrappers/GERubberband';
26
+ import { GETagBrowserProps } from './nativeWrappers/GETagBrowser';
27
+ import { GETagEditorProps } from './nativeWrappers/GETagEditor';
28
+ import { GEMappingEditorProps } from './nativeWrappers/GEMappingEditor';
29
+ export interface GEIntrinsicElements {
30
+ /**
31
+ * Button can be used to *trigger* something. If something should be toggled use Toggle instead
32
+ */
33
+ geButton: Partial<GEButtonProps>;
34
+ /**
35
+ * Lets the user choose from a drop-down list of choices. The user cannot type into the field like the name might suggest
36
+ */
37
+ geComboBox: Partial<GEComboBoxProps>;
38
+ /**
39
+ * Lets the user display curves passing in an array of values
40
+ */
41
+ geCurve: Partial<GECurveProps>;
42
+ /**
43
+ * Circular control for changing a value.
44
+ * Use a filmstrip for custom skinning.
45
+ */
46
+ geKnob: Partial<GEKnobProps>;
47
+ /**
48
+ * Linear control for changing a value.
49
+ * Use a filmstrip for custom skinning.
50
+ */
51
+ geSlider: Partial<GESliderProps>;
52
+ /**
53
+ * Use a label to
54
+ * - create a container for other elements
55
+ * - display an image (use the backgroundImage property)
56
+ * - display text
57
+ */
58
+ geLabel: Partial<GELabelProps>;
59
+ /**
60
+ * A meter that displays the level of a meter property, e.g. general Volume or Gain Reduction of a compressor module.
61
+ * While a meter property in Gorilla Script can handle multiple channels (https://docs.gorilla-engine.com/Gorilla_Script_Reference/Gorilla%20Script%20Reference.html#prop_meter), you would need to have two geLevelMeter controls to achieve e.g. a stereo level meter connected to different channels of the same meter property.
62
+ */
63
+ geLevelMeter: Partial<GELevelMeterProps>;
64
+ /**
65
+ * Lets the user send MIDI notes from the onscreen keyboard. Basic skinning capability.
66
+ * This standard on-screen MIDI keyboard reflects key colours that have been set in Gorilla Script (https://docs.gorilla-engine.com/Gorilla_Script_Reference/Gorilla%20Script%20Reference.html#Keyboard%20display) as well as key switches (https://docs.gorilla-engine.com/Gorilla_Script_Reference/Gorilla%20Script%20Reference.html#KEY_IS_CONTROL).
67
+ */
68
+ geMidiKeyboard: Partial<GEMidiKeyboardProps>;
69
+ /**
70
+ * Triggers a specific MIDI note
71
+ */
72
+ gePad: Partial<GEPadProps>;
73
+ /**
74
+ * Content inside can be scrolled when the content is bigger than the view
75
+ */
76
+ geScrollView: Partial<GEScrollViewProps>;
77
+ /**
78
+ * Lets users control slicing of a samples
79
+ */
80
+ geSliceEditor: Partial<GESliceEditorProps>;
81
+ /**
82
+ * User editable textbox
83
+ */
84
+ geTextBox: Partial<GETextBoxProps>;
85
+ /**
86
+ * A button to toggle between to states
87
+ */
88
+ geToggle: Partial<GEToggleProps>;
89
+ /**
90
+ * Control to show the waveform of a sample
91
+ */
92
+ geWaveform: Partial<GEWaveformProps>;
93
+ /**
94
+ * Lets the user control the envelope of an effect for example
95
+ */
96
+ geAmpEnv: Partial<GEAmpEnvProps>;
97
+ /**
98
+ * Lets the user choose from a list of items
99
+ */
100
+ geListBox: Partial<GEListBoxProps>;
101
+ /**
102
+ * Lets the user control the step value by toggling on and off. Can be used for a step sequencer
103
+ */
104
+ geStepEditor: Partial<GEStepEditorProps>;
105
+ /**
106
+ * Lets the user control the value of a step incrementally by moving the mouse vertically
107
+ */
108
+ geBarStepEditor: Partial<GEBarStepEditorProps>;
109
+ /**
110
+ * Used to wrap data for drag and drop operations.
111
+ */
112
+ geDragContainer: Partial<GEDragContainerProps>;
113
+ /**
114
+ * A region that accepts file drops.
115
+ */
116
+ geDropZone: Partial<GEDropZoneProps>;
117
+ /**
118
+ * Target region for drag and drop operations. Accepts drag containers.
119
+ */
120
+ geDragTarget: Partial<GEDragTargetProps>;
121
+ /**
122
+ * Control to show Lottie animations
123
+ */
124
+ geLottieAnimation: Partial<GELottieAnimationProps>;
125
+ /**
126
+ * A rectangular XY Pad to control two parameters, one per axis.
127
+ * To implement user interaction, set bindings on properties valueX and valueY.
128
+ * It has two modes: One where the user has to grab the thumb image in order to change the parameters and one where the value snaps to mouse position on click.
129
+ * @param thumbImage - image used to draw the current position
130
+ * @param snapsToMousePosition - set this to true to snap the values to the clicked mouse position
131
+ * @param valueX - the binding for the x position
132
+ * @param valueY - the binding for the y position
133
+ */
134
+ geXYPad: Partial<GEXYPadProps>;
135
+ /**
136
+ * A control that enables you to have a mouse drag event span over N child controls. If you want to implement a Graphic EQ for example where the user can set the curve on the faders with a single mouse movement, you need to put the sliders into a Rubberband control.
137
+ */
138
+ geRubberband: Partial<GERubberbandProps>;
139
+ geTagBrowser: Partial<GETagBrowserProps>;
140
+ geTagEditor: Partial<GETagEditorProps>;
141
+ geMappingEditor: Partial<GEMappingEditorProps>;
142
+ }
143
+ declare global {
144
+ namespace JSX {
145
+ interface IntrinsicElements extends GEIntrinsicElements {
146
+ }
147
+ }
148
+ }
149
+ declare module 'react' {
150
+ namespace JSX {
151
+ interface IntrinsicElements extends GEIntrinsicElements {
152
+ }
153
+ }
154
+ }
155
+ /**
156
+ * Union of all recognized Gorilla Engine component type strings.
157
+ * These correspond to the JSX intrinsic element names (e.g., `<geKnob />`).
158
+ */
159
+ export type GEComponentType = 'geLabel' | 'geButton' | 'geTextBox' | 'geScrollView' | 'geToggle' | 'geComboBox' | 'geCurve' | 'geMidiKeyboard' | 'geKnob' | 'geSlider' | 'gePad' | 'geSliceEditor' | 'geLevelMeter' | 'geWaveform' | 'geAmpEnv' | 'geListBox' | 'geStepEditor' | 'geBarStepEditor' | 'geDragContainer' | 'geDropZone' | 'geDragTarget' | 'geLottieAnimation' | 'geXYPad' | 'geRubberband' | 'geTagBrowser' | 'geTagEditor' | 'geMappingEditor';
160
+ /** Union of all Gorilla Engine component prop types. */
161
+ export type GEComponentProps = GELabelProps | GEButtonProps | GETextBoxProps | GEScrollViewProps | GEToggleProps | GEComboBoxProps | GECurveProps | GEMidiKeyboardProps | GEKnobProps | GESliderProps | GEPadProps | GESliceEditorProps | GELevelMeterProps | GEWaveformProps | GEStepEditorProps | GEBarStepEditorProps | GEDragContainerProps | GEDropZoneProps | GEDragTargetProps | GELottieAnimationProps | GEAmpEnvProps | GEListBoxProps | GEXYPadProps | GERubberbandProps | GETagBrowserProps | GETagEditorProps | GEMappingEditorProps;
162
+ /**
163
+ * Factory that instantiates Gorilla Engine native component wrappers
164
+ * from JSX element type strings and props.
165
+ *
166
+ * Used by the reconciler's `createInstance` and `createTextInstance` hooks
167
+ * to translate React elements into native {@link GEComponent} instances.
168
+ */
169
+ declare class ComponentFactory {
170
+ /**
171
+ * Creates a {@link GEComponent} wrapper for the given component type.
172
+ *
173
+ * @param type - The Gorilla Engine component type identifier (e.g., `'geKnob'`).
174
+ * @param newProps - Props to pass to the native component constructor.
175
+ * @returns A new `GEComponent` wrapping the corresponding native component.
176
+ * @throws If `type` is not a recognized {@link GEComponentType}.
177
+ */
178
+ static createComponent(type: GEComponentType, newProps: Partial<GEComponentProps>): GEComponent<any>;
179
+ }
180
+ export default ComponentFactory;