@mml-io/mml-web-client 0.0.0-experimental-edf5cd7-20250120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +19 -0
- package/README.md +30 -0
- package/build/index.js +99521 -0
- package/build/index.js.map +7 -0
- package/package.json +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2023 Improbable MV Limited
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# MML Web Client
|
|
2
|
+
|
|
3
|
+
This package contains a basic standalone client as a single JavaScript bundle that can be included in the source of a webpage to render MML documents.
|
|
4
|
+
|
|
5
|
+
### Note
|
|
6
|
+
This bundle is currently quite heavy as it includes both the THREE.js and PlayCanvas renderers.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# Usage
|
|
10
|
+
|
|
11
|
+
The query parameters of the `<script/>` tag that the script is included with can be used to configure a remote address of a document to load into the page; otherwise the client configures the main window as the source of content and any tags on the page are used as the content.
|
|
12
|
+
|
|
13
|
+
## Example Usage for a Remote Document
|
|
14
|
+
E.g.
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<script src="/path/to/this/package/build/index.js?url=https://public.mml.io/rgb-cubes.html"></script>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Example Usage for Inline Content
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<script src="/path/to/this/package/build/index.js"></script>
|
|
24
|
+
<m-group>
|
|
25
|
+
<m-cube x="1" color="red"></m-cube>
|
|
26
|
+
<m-cube x="2" color="green"></m-cube>
|
|
27
|
+
<m-cube x="3" color="blue"></m-cube>
|
|
28
|
+
</m-group>
|
|
29
|
+
```
|
|
30
|
+
|