Skip to content

Commit 629e76d

Browse files
committed
add an ux-threejs package
1 parent e653f48 commit 629e76d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2220
-0
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@rollup/plugin-node-resolve": "^15.3.0",
2222
"@rollup/plugin-typescript": "^11.1.6",
2323
"@symfony/stimulus-testing": "^2.0.1",
24+
"@types/three": "^0.174.0",
2425
"@vitest/browser": "^2.1.1",
2526
"lightningcss": "^1.28.2",
2627
"playwright": "^1.47.0",

src/Threejs/.gitattributes

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/.git* export-ignore
2+
/.symfony.bundle.yaml export-ignore
3+
/assets/src export-ignore
4+
/assets/test export-ignore
5+
/assets/vitest.config.js export-ignore
6+
/doc export-ignore
7+
/phpunit.xml.dist export-ignore
8+
/tests export-ignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Please do not submit any Pull Requests here. They will be closed.
2+
---
3+
4+
Please submit your PR here instead:
5+
https://github.com/symfony/ux
6+
7+
This repository is what we call a "subtree split": a read-only subset of that main repository.
8+
We're looking forward to your PR there!
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Close Pull Request
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: superbrothers/close-pull-request@v3
12+
with:
13+
comment: |
14+
Thanks for your Pull Request! We love contributions.
15+
16+
However, you should instead open your PR on the main repository:
17+
https://github.com/symfony/ux
18+
19+
This repository is what we call a "subtree split": a read-only subset of that main repository.
20+
We're looking forward to your PR there!

src/Threejs/.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/assets/node_modules/
2+
/vendor/
3+
/composer.lock
4+
/phpunit.xml
5+
/.phpunit.result.cache
6+
/var/

src/Threejs/.symfony.bundle.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
branches: ["2.x"]
2+
maintained_branches: ["2.x"]
3+
doc_dir: "doc"

src/Threejs/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# CHANGELOG
2+
3+
## 2.24.0
4+
5+
Create ux-threejs package

src/Threejs/LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2020-present Fabien Potencier
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 furnished
8+
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
19+
THE SOFTWARE.

src/Threejs/README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Symfony UX Three.js
2+
3+
Symfony UX Three.js is a Symfony bundle integrating the [Three.js](https://threejs.org/)
4+
library in Symfony applications. It is part of [the Symfony UX initiative](https://ux.symfony.com/).
5+
6+
**This repository is a READ-ONLY sub-tree split**. See
7+
https://github.com/symfony/ux to create issues or submit pull requests.
8+
9+
## Sponsor
10+
11+
The Symfony UX packages are [backed][1] by [Mercure.rocks][2].
12+
13+
Create real-time experiences in minutes! Mercure.rocks provides a realtime API service
14+
that is tightly integrated with Symfony: create UIs that update in live with UX Turbo,
15+
send notifications with the Notifier component, expose async APIs with API Platform and
16+
create low level stuffs with the Mercure component. We maintain and scale the complex
17+
infrastructure for you!
18+
19+
Help Symfony by [sponsoring][3] its development!
20+
21+
## Resources
22+
23+
- [Documentation](https://symfony.com/bundles/ux-threejs/current/index.html)
24+
- [Report issues](https://github.com/symfony/ux/issues) and
25+
[send Pull Requests](https://github.com/symfony/ux/pulls)
26+
in the [main Symfony UX repository](https://github.com/symfony/ux)
27+
28+
[1]: https://symfony.com/backers
29+
[2]: https://mercure.rocks
30+
[3]: https://symfony.com/sponsor

src/Threejs/assets/LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2020-present Fabien Potencier
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 furnished
8+
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
19+
THE SOFTWARE.

src/Threejs/assets/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# @symfony/ux-threejs
2+
3+
JavaScript assets of the [symfony/ux-threejs](https://packagist.org/packages/symfony/ux-threejs) PHP package.
4+
5+
## Installation
6+
7+
This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.).
8+
9+
We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-threejs](https://packagist.org/packages/symfony/ux-threejs) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled.
10+
11+
If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-threejs](https://packagist.org/packages/symfony/ux-threejs) PHP package version:
12+
```shell
13+
composer require symfony/ux-threejs:2.23.0
14+
npm add @symfony/[email protected]
15+
```
16+
17+
## Resources
18+
19+
- [Documentation](https://symfony.com/bundles/ux-threejs/current/index.html)
20+
- [Report issues](https://github.com/symfony/ux/issues) and
21+
[send Pull Requests](https://github.com/symfony/ux/pulls)
22+
in the [main Symfony UX repository](https://github.com/symfony/ux)
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { Controller } from '@hotwired/stimulus';
2+
import * as THREE from 'three';
3+
export type Material = {
4+
color: string;
5+
opacity: number;
6+
map: string;
7+
transparent: boolean;
8+
type: string;
9+
doubleSide: boolean;
10+
};
11+
export type Mesh = {
12+
geometry: any;
13+
material: Material;
14+
animation: any;
15+
};
16+
export type Light = {
17+
type: String;
18+
color: THREE.Color;
19+
intensity: number;
20+
position: THREE.Vector3;
21+
target: THREE.Vector3;
22+
};
23+
export type Camera = {
24+
type: String;
25+
position: THREE.Vector3;
26+
near: number;
27+
far: number;
28+
aspect: number;
29+
fov: number;
30+
top: number;
31+
left: number;
32+
right: number;
33+
bottom: number;
34+
};
35+
export default class extends Controller {
36+
threeValue: any;
37+
static values: {
38+
three: ObjectConstructor;
39+
};
40+
connect(): void;
41+
transform(object3D: THREE.Object3D, transformationData: any): any;
42+
createMesh(meshData: Mesh, scene: THREE.Scene): THREE.Mesh;
43+
createGeometry(geometryData: any): THREE.BufferGeometry;
44+
createMaterial(materialData: Material): THREE.Material | undefined;
45+
createLight(lightData: Light, scene: THREE.Scene): void;
46+
createCamera(cameraData: Camera, renderer: THREE.WebGLRenderer): THREE.Camera;
47+
setControls(controlCamera: THREE.Camera, renderer: THREE.WebGLRenderer): void;
48+
createModel(modelData: any, scene: THREE.Scene): any;
49+
private dispatchEvent;
50+
}

0 commit comments

Comments
 (0)