senangwebs-aframe-editor 1.6.5

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 (104) hide show
  1. package/.babelrc +3 -0
  2. package/.editorconfig +12 -0
  3. package/.eslintignore +2 -0
  4. package/.eslintrc +40 -0
  5. package/.github/workflows/ci.yml +39 -0
  6. package/.husky/pre-commit +4 -0
  7. package/.prettierignore +1 -0
  8. package/.prettierrc.json +5 -0
  9. package/.stylelintrc +12 -0
  10. package/LICENSE +21 -0
  11. package/README.md +75 -0
  12. package/assets/gltf.svg +49 -0
  13. package/dist/aframe-inspector.js +106250 -0
  14. package/dist/aframe-inspector.js.map +1 -0
  15. package/dist/aframe-inspector.min.js +29040 -0
  16. package/dist/aframe-inspector.min.js.LICENSE.txt +56 -0
  17. package/dist/aframe-inspector.min.js.map +1 -0
  18. package/examples/360video.html +48 -0
  19. package/examples/colors.html +18 -0
  20. package/examples/controllers.html +60 -0
  21. package/examples/embedded-zoom.html +78 -0
  22. package/examples/embedded.html +79 -0
  23. package/examples/empty.html +13 -0
  24. package/examples/index-aframe.html +66 -0
  25. package/examples/index.html +71 -0
  26. package/examples/supercraft.html +6 -0
  27. package/index.html +8 -0
  28. package/package.json +84 -0
  29. package/senangwebs-webverse-editor.png +0 -0
  30. package/src/components/AwesomeIcon.js +53 -0
  31. package/src/components/Collapsible.js +57 -0
  32. package/src/components/EntityRepresentation.js +83 -0
  33. package/src/components/Main.js +222 -0
  34. package/src/components/__tests__/Collapsible.test.js +30 -0
  35. package/src/components/components/AddComponent.js +104 -0
  36. package/src/components/components/CommonComponents.js +160 -0
  37. package/src/components/components/Component.js +151 -0
  38. package/src/components/components/ComponentsContainer.js +52 -0
  39. package/src/components/components/DefaultComponents.js +1 -0
  40. package/src/components/components/Mixins.js +83 -0
  41. package/src/components/components/PropertyRow.js +145 -0
  42. package/src/components/components/Sidebar.js +51 -0
  43. package/src/components/icons/BackViewIcon.js +27 -0
  44. package/src/components/icons/BottomViewIcon.js +26 -0
  45. package/src/components/icons/FrontViewIcon.js +23 -0
  46. package/src/components/icons/LeftViewIcon.js +24 -0
  47. package/src/components/icons/PerspectiveIcon.js +23 -0
  48. package/src/components/icons/PrimitiveBoxIcon.js +143 -0
  49. package/src/components/icons/PrimitiveConeIcon.js +44 -0
  50. package/src/components/icons/PrimitiveCylinderIcon.js +51 -0
  51. package/src/components/icons/PrimitiveEmptyEntityIcon.js +78 -0
  52. package/src/components/icons/PrimitiveImageIcon.js +86 -0
  53. package/src/components/icons/PrimitiveLightIcon.js +107 -0
  54. package/src/components/icons/PrimitivePlaneIcon.js +87 -0
  55. package/src/components/icons/PrimitiveSphereIcon.js +39 -0
  56. package/src/components/icons/PrimitiveTextIcon.js +89 -0
  57. package/src/components/icons/PrimitiveTorusIcon.js +31 -0
  58. package/src/components/icons/RightViewIcon.js +24 -0
  59. package/src/components/icons/TopViewIcon.js +24 -0
  60. package/src/components/modals/Modal.js +107 -0
  61. package/src/components/modals/ModalHelp.js +97 -0
  62. package/src/components/modals/ModalPrimitive.js +114 -0
  63. package/src/components/modals/ModalTextures.js +430 -0
  64. package/src/components/scenegraph/Entity.js +142 -0
  65. package/src/components/scenegraph/SceneGraph.js +337 -0
  66. package/src/components/scenegraph/Toolbar.js +147 -0
  67. package/src/components/viewport/CameraToolbar.js +122 -0
  68. package/src/components/viewport/TransformToolbar.js +102 -0
  69. package/src/components/viewport/ViewportHUD.js +33 -0
  70. package/src/components/widgets/BooleanWidget.js +49 -0
  71. package/src/components/widgets/ColorWidget.js +89 -0
  72. package/src/components/widgets/InputWidget.js +42 -0
  73. package/src/components/widgets/NumberWidget.js +179 -0
  74. package/src/components/widgets/SelectWidget.js +58 -0
  75. package/src/components/widgets/TextureWidget.js +252 -0
  76. package/src/components/widgets/Vec2Widget.js +55 -0
  77. package/src/components/widgets/Vec3Widget.js +58 -0
  78. package/src/components/widgets/Vec4Widget.js +61 -0
  79. package/src/components/widgets/index.js +9 -0
  80. package/src/index.js +301 -0
  81. package/src/lib/EditorControls.js +336 -0
  82. package/src/lib/Events.js +6 -0
  83. package/src/lib/TransformControls.js +1365 -0
  84. package/src/lib/assetsLoader.js +43 -0
  85. package/src/lib/assetsUtils.js +30 -0
  86. package/src/lib/cameras.js +121 -0
  87. package/src/lib/entity.js +556 -0
  88. package/src/lib/history.js +30 -0
  89. package/src/lib/raycaster.js +129 -0
  90. package/src/lib/shortcuts.js +211 -0
  91. package/src/lib/utils.js +118 -0
  92. package/src/lib/viewport.js +268 -0
  93. package/src/style/components.styl +275 -0
  94. package/src/style/entity.styl +22 -0
  95. package/src/style/help.styl +40 -0
  96. package/src/style/index.styl +358 -0
  97. package/src/style/lib.styl +41 -0
  98. package/src/style/primitiveModal.styl +90 -0
  99. package/src/style/scenegraph.styl +173 -0
  100. package/src/style/select.styl +71 -0
  101. package/src/style/textureModal.styl +220 -0
  102. package/src/style/viewport.styl +168 -0
  103. package/src/style/widgets.styl +71 -0
  104. package/webpack.config.js +65 -0
@@ -0,0 +1,48 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>360 Video</title>
6
+ <meta name="description" content="360 Video — A-Frame">
7
+ <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@master/dist/aframe-master.min.js"></script>
8
+ <!--
9
+ <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@master/examples/js/play-on-click.js"></script>
10
+ <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@master/examples/js/hide-on-play.js"></script>
11
+ -->
12
+ </head>
13
+ <body>
14
+ <a-scene>
15
+ <a-assets>
16
+ <!--
17
+ SOURCE
18
+ Author: Bitmovin
19
+ URL: https://bitmovin.com/demos/vr-360
20
+ -->
21
+ <video id="video"
22
+ loop
23
+ crossorigin="anonymous"
24
+ playsinline webkit-playsinline
25
+ src="https://bitmovin-a.akamaihd.net/content/playhouse-vr/progressive.mp4">
26
+ </video>
27
+ </a-assets>
28
+ <a-videosphere
29
+ rotation="0 -90 0" src="#video"
30
+ play-on-click>
31
+ </a-videosphere>
32
+
33
+ <a-camera>
34
+ <a-entity
35
+ position="0 0 -1.5"
36
+ text="align:center;
37
+ width:6;
38
+ wrapCount:100;
39
+ color: white;
40
+ value: Click or tap to start video"
41
+ hide-on-play="#video">
42
+ </a-entity>
43
+ </a-camera>
44
+ </a-scene>
45
+
46
+ <script src="../dist/aframe-inspector.js"></script>
47
+ </body>
48
+ </html>
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Example Scene</title>
6
+ <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe/dist/aframe-master.min.js"></script>
7
+ </head>
8
+ <body>
9
+ <a-scene debug="true">
10
+ <a-entity id="hsl-green" geometry="primitive: box" material="color:hsl(120, 100%, 75%)" position="-4 1 0"></a-entity>
11
+ <a-entity id="rgb-yellow" geometry="primitive: box" material="color:rgb(255, 255, 0)" position="-2 1 0"></a-entity>
12
+ <a-entity id="hex3-red" geometry="primitive: box" material="color:#f00" position="0 1 0"></a-entity>
13
+ <a-entity id="hex6-red" geometry="primitive: box" material="color:#ff0000" position="2 1 0"></a-entity>
14
+ <a-entity id="string-blue" geometry="primitive: box" material="color:blue" position="4 1 0"></a-entity>
15
+ </a-scene>
16
+ <script src="../dist/aframe-inspector.js"></script>
17
+ </body>
18
+ </html>
@@ -0,0 +1,60 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Controllers</title>
6
+ <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe/dist/aframe-master.min.js"></script>
7
+ <script src="https://unpkg.com/aframe-environment-component@1.3.7/dist/aframe-environment-component.min.js"></script>
8
+ <script src="https://unpkg.com/aframe-teleport-controls@0.2.0/dist/aframe-teleport-controls.min.js"></script>
9
+ <script src="https://unpkg.com/aframe-event-set-component@3.0.3/dist/aframe-event-set-component.min.js"></script>
10
+ </head>
11
+ <body>
12
+ <a-scene>
13
+ <a-assets>
14
+ <a-mixin id="blue" material="color: #4CC3D9"></a-mixin>
15
+ <a-mixin id="box" geometry="primitive: box; depth: 1; height: 1; width: 1"></a-mixin>
16
+ <a-mixin id="cylinder" geometry="primitive: cylinder; height: 0.3; radius: 0.75; segmentsRadial: 6"></a-mixin>
17
+ <a-mixin id="green" material="color: #7BC8A4"></a-mixin>
18
+ <a-mixin id="orange" material="color: #F16745"></a-mixin>
19
+ <a-mixin id="purple" material="color: #93648D"></a-mixin>
20
+ <a-mixin id="short" scale="1 0.5 1"></a-mixin>
21
+ <a-mixin id="yellow" material="color: #FFC65D"></a-mixin>
22
+ <a-mixin id="interactable"
23
+ event-set__mouseenter="_event: mouseenter; material.opacity: 0.75"
24
+ event-set__mouseleave="_event: mouseleave; material.opacity: 1"
25
+ event-set__click="_event: click; scale: 1.1 1.1 1.1"></a-mixin>
26
+ <img id="crateImg" src="https://aframe.io/sample-assets/assets/images/wood/crate.gif" crossOrigin="true">
27
+ <img id="floorImg" src="https://aframe.io/sample-assets/assets/images/terrain/grasslight-big.jpg" crossOrigin="true">
28
+ </a-assets>
29
+
30
+ <a-entity id="environment" environment="preset: forest; fog: 0"></a-entity>
31
+
32
+ <!-- Meshes. -->
33
+ <a-entity position="0 0 -8">
34
+ <a-entity id="blueBox" mixin="interactable" geometry="primitive: box; depth: 2; height: 5; width: 1" material="color: #4CC3D9" position="0 8 0"></a-entity>
35
+ <a-entity id="shortOrangeBox" mixin="interactable short orange box" position="-5 2 0"></a-entity>
36
+ <a-entity id="shortYellowBox" mixin="interactable short yellow box" position="5 2 0"></a-entity>
37
+ <a-entity id="redBox" mixin="interactable" geometry="primitive: box" material="color: #F00" position="-4 1 0">
38
+ <a-animation attribute="rotation" to="0 360 0" repeat="indefinite" easing="linear" dur="9600"></a-animation>
39
+ </a-entity>
40
+ <a-entity id="yellowSphere" mixin="interactable" geometry="primitive: sphere" material="color:#ff0; metalness:0.0; roughness:1.0" position="-2 2 -2"></a-entity>
41
+ <a-box id="brickBox" mixin="interactable" src="https://aframe.io/sample-assets/assets/images/bricks/brick_bump.jpg" position="-5 5 -2" width="1" color="#F16745"></a-box>
42
+ <a-box id="box" mixin="interactable" position="0 2 0" height="2" color="#FFC65D"></a-box>
43
+
44
+ <!-- Models. -->
45
+ <a-entity mixin="interactable" class="boxClass" geometry="primitive: box" material="src: #crateImg" position="3 4 0"></a-entity>
46
+ <a-entity mixin="interactable" class="boxClass" geometry="primitive: box" material="color: #0f0" position="4 2 4"></a-entity>
47
+
48
+ </a-entity>
49
+
50
+ <!-- Lights. -->
51
+ <a-entity id="pointLight" light="type: point; intensity: 0.25" position="0 3 3"></a-entity>
52
+
53
+ <!-- Hands. -->
54
+ <a-entity id="rightHand" laser-controls="hand: right"></a-entity>
55
+ <a-entity id="leftHand" hand-controls="left" teleport-controls></a-entity>
56
+ </a-scene>
57
+
58
+ <script src="../dist/aframe-inspector.js"></script>
59
+ </body>
60
+ </html>
@@ -0,0 +1,78 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Inspector Test - Embedded (Bad)</title>
6
+ <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe/dist/aframe-master.min.js"></script>
7
+ <style>
8
+ html,
9
+ body {
10
+ background: #111;
11
+ height: 100%;
12
+ width: 100%;
13
+ }
14
+ body {
15
+ align-items: center;
16
+ display: flex;
17
+ justify-content: center;
18
+ }
19
+ </style>
20
+ </head>
21
+ <body>
22
+ <div style="bottom: 0; left: 0; margin: 0 auto; right: 0; position: absolute; top: 0; width: 960px; zoom: 1.1">
23
+ <div style="height: 480px; width: 640px">
24
+ <a-scene embedded inspector="url: ../dist/aframe-inspector.js">
25
+ <a-assets>
26
+ <a-mixin id="blue" material="color: #4CC3D9"></a-mixin>
27
+ <a-mixin id="blueBox" geometry="primitive: box; depth: 2; height: 5; width: 1" material="color: #4CC3D9"></a-mixin>
28
+ <a-mixin id="box" geometry="primitive: box; depth: 1; height: 1; width: 1"></a-mixin>
29
+ <a-mixin id="cylinder" geometry="primitive: cylinder; height: 0.3; radius: 0.75; segmentsRadial: 6"></a-mixin>
30
+ <a-mixin id="green" material="color: #7BC8A4"></a-mixin>
31
+ <a-mixin id="orange" material="color: #F16745"></a-mixin>
32
+ <a-mixin id="purple" material="color: #93648D"></a-mixin>
33
+ <a-mixin id="short" scale="1 0.5 1"></a-mixin>
34
+ <a-mixin id="yellow" material="color: #FFC65D"></a-mixin>
35
+ <img id="crateImg" src="assets/textures/crate.gif">
36
+ <img id="floorImg" src="assets/textures/grasslight-big.jpg">
37
+ </a-assets>
38
+
39
+ <!-- Meshes. -->
40
+ <a-entity id="blueBox" mixin="blueBox" position="0 8 0"></a-entity>
41
+ <a-entity id="shortOrangeBox" mixin="short orange box" position="-5 2 0"></a-entity>
42
+ <a-entity id="shortYellowBox" mixin="short yellow box" position="5 2 0"></a-entity>
43
+ <a-entity id="redBox" geometry="primitive: box" material="color:#f00" position="-4 1 0">
44
+ <a-animation attribute="rotation" to="0 360 0" repeat="indefinite" easing="linear" dur="9600"></a-animation>
45
+ </a-entity>
46
+ <a-entity id="yellowSphere" geometry="primitive: sphere" material="color:#ff0; metalness:0.0; roughness:1.0" position="-2 2 -2"></a-entity>
47
+ <a-box src="assets/textures/brick_bump.jpg" position="-5 5 -2" width="1" color="#F16745"></a-box>
48
+ <a-box id="box" position="0 2 0" height="2" color="#FFC65D"></a-box>
49
+
50
+ <!-- Models. -->
51
+ <a-entity id="crate" geometry="primitive: box" material="src: #crateImg" position="3 4 0"></a-entity>
52
+ <a-entity id="greenBox" geometry="primitive: box" material="color: #0f0" position="4 2 4"></a-entity>
53
+
54
+ <!-- Floor. -->
55
+ <a-entity id="floor" geometry="primitive: cylinder; height: .2; radius: 12"
56
+ material="src: #floorImg; color: #fafafa; metalness: .2; repeat: 50 20; roughness: .1"></a-entity>
57
+
58
+ <!-- Lights. -->
59
+ <a-entity id="pointLight" light="type: point" position="0 3 3"></a-entity>
60
+
61
+ <!-- Camera. -->
62
+ <a-entity id="cameraWrapper" position="0 1 8">
63
+ <a-entity id="camera" camera look-controls wasd-controls>
64
+ <!-- Cursor. -->
65
+ <a-entity id="cursor" position="0 0 -2"
66
+ geometry="primitive: ring; radiusOuter: 0.016; radiusInner: 0.01"
67
+ material="color: #ff9; shader: flat; transparent: true; opacity: 0.5"
68
+ scale="2 2 2" raycaster>
69
+ </a-entity>
70
+ </a-entity>
71
+ </a-entity>
72
+
73
+ <a-sky color="#333"></a-sky>
74
+ </a-scene>
75
+ </div>
76
+ </div>
77
+ </body>
78
+ </html>
@@ -0,0 +1,79 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Inspector Test - Embedded</title>
6
+ <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe/dist/aframe-master.min.js"></script>
7
+ <style>
8
+ html,
9
+ body {
10
+ background: #111;
11
+ height: 100%;
12
+ width: 100%;
13
+ }
14
+ body {
15
+ align-items: center;
16
+ display: flex;
17
+ justify-content: center;
18
+ }
19
+ a-scene {
20
+ display: block;
21
+ height: 480px;
22
+ width: 640px;
23
+ }
24
+ </style>
25
+ </head>
26
+ <body>
27
+ <a-scene embedded inspector="url: ../dist/aframe-inspector.js">
28
+ <a-assets>
29
+ <a-mixin id="blue" material="color: #4CC3D9"></a-mixin>
30
+ <a-mixin id="blueBox" geometry="primitive: box; depth: 2; height: 5; width: 1" material="color: #4CC3D9"></a-mixin>
31
+ <a-mixin id="box" geometry="primitive: box; depth: 1; height: 1; width: 1"></a-mixin>
32
+ <a-mixin id="cylinder" geometry="primitive: cylinder; height: 0.3; radius: 0.75; segmentsRadial: 6"></a-mixin>
33
+ <a-mixin id="green" material="color: #7BC8A4"></a-mixin>
34
+ <a-mixin id="orange" material="color: #F16745"></a-mixin>
35
+ <a-mixin id="purple" material="color: #93648D"></a-mixin>
36
+ <a-mixin id="short" scale="1 0.5 1"></a-mixin>
37
+ <a-mixin id="yellow" material="color: #FFC65D"></a-mixin>
38
+ <img id="crateImg" src="assets/textures/crate.gif">
39
+ <img id="floorImg" src="assets/textures/grasslight-big.jpg">
40
+ </a-assets>
41
+
42
+ <!-- Meshes. -->
43
+ <a-entity id="blueBox" mixin="blueBox" position="0 8 0"></a-entity>
44
+ <a-entity id="shortOrangeBox" mixin="short orange box" position="-5 2 0"></a-entity>
45
+ <a-entity id="shortYellowBox" mixin="short yellow box" position="5 2 0"></a-entity>
46
+ <a-entity id="redBox" geometry="primitive: box" material="color:#f00" position="-4 1 0">
47
+ <a-animation attribute="rotation" to="0 360 0" repeat="indefinite" easing="linear" dur="9600"></a-animation>
48
+ </a-entity>
49
+ <a-entity id="yellowSphere" geometry="primitive: sphere" material="color:#ff0; metalness:0.0; roughness:1.0" position="-2 2 -2"></a-entity>
50
+ <a-box src="assets/textures/brick_bump.jpg" position="-5 5 -2" width="1" color="#F16745"></a-box>
51
+ <a-box id="box" position="0 2 0" height="2" color="#FFC65D"></a-box>
52
+
53
+ <!-- Models. -->
54
+ <a-entity id="crate" geometry="primitive: box" material="src: #crateImg" position="3 4 0"></a-entity>
55
+ <a-entity id="greenBox" geometry="primitive: box" material="color: #0f0" position="4 2 4"></a-entity>
56
+
57
+ <!-- Floor. -->
58
+ <a-entity id="floor" geometry="primitive: cylinder; height: .2; radius: 12"
59
+ material="src: #floorImg; color: #fafafa; metalness: .2; repeat: 50 20; roughness: .1"></a-entity>
60
+
61
+ <!-- Lights. -->
62
+ <a-entity id="pointLight" light="type: point" position="0 3 3"></a-entity>
63
+
64
+ <!-- Camera. -->
65
+ <a-entity id="cameraWrapper" position="0 1 8">
66
+ <a-entity id="camera" camera look-controls wasd-controls>
67
+ <!-- Cursor. -->
68
+ <a-entity id="cursor" position="0 0 -2"
69
+ geometry="primitive: ring; radiusOuter: 0.016; radiusInner: 0.01"
70
+ material="color: #ff9; shader: flat; transparent: true; opacity: 0.5"
71
+ scale="2 2 2" raycaster>
72
+ </a-entity>
73
+ </a-entity>
74
+ </a-entity>
75
+
76
+ <a-sky color="#333"></a-sky>
77
+ </a-scene>
78
+ </body>
79
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Example Scene</title>
6
+ <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe/dist/aframe-master.min.js"></script>
7
+ </head>
8
+ <body>
9
+ <a-scene stats>
10
+ </a-scene>
11
+ <script src="http://localhost:3333/dist/aframe-inspector.js"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Example Scene</title>
6
+ <!--<script>window.AFRAME_SAMPLE_ASSETS_ROOT = "./sample-assets/";</script>-->
7
+ <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1.7.0/dist/aframe-master.min.js"></script>
8
+ <script src="https://unpkg.com/aframe-environment-component@1.3.7/dist/aframe-environment-component.min.js"></script>
9
+ </head>
10
+ <body>
11
+ <a-scene debug="true">
12
+ <a-assets>
13
+ <a-mixin id="blue" material="color: #4CC3D9"></a-mixin>
14
+ <a-mixin id="blueBox" geometry="primitive: box; depth: 2; height: 5; width: 1" material="color: #4CC3D9"></a-mixin>
15
+ <a-mixin id="box" geometry="primitive: box; depth: 1; height: 1; width: 1"></a-mixin>
16
+ <a-mixin id="cylinder" geometry="primitive: cylinder; height: 0.3; radius: 0.75; segmentsRadial: 6"></a-mixin>
17
+ <a-mixin id="green" material="color: #7BC8A4"></a-mixin>
18
+ <a-mixin id="orange" material="color: #F16745"></a-mixin>
19
+ <a-mixin id="purple" material="color: #93648D"></a-mixin>
20
+ <a-mixin id="short" scale="1 0.5 1"></a-mixin>
21
+ <a-mixin id="yellow" material="color: #FFC65D"></a-mixin>
22
+ <img id="crateImg" src="https://aframe.io/sample-assets/assets/images/wood/crate.gif" crossOrigin="true">
23
+ <img id="floorImg" src="https://aframe.io/sample-assets/assets/images/terrain/grasslight-big.jpg" crossOrigin="true">
24
+ </a-assets>
25
+
26
+ <a-entity id="environment" environment="preset: forest; fog: 0"></a-entity>
27
+
28
+ <!-- Meshes. -->
29
+ <a-entity id="blueBox" mixin="blueBox" position="0 8 0"></a-entity>
30
+ <a-entity id="shortOrangeBox" mixin="short orange box" position="-5 2 0"></a-entity>
31
+ <a-entity id="shortYellowBox" mixin="short yellow box" position="5 2 0"></a-entity>
32
+ <a-entity id="redBox" geometry="primitive: box" material="color:#f00" position="-4 1 0" animation="property: object3D.rotation.y; to: 360; loop: true; easing: linear; dur: 9600"></a-entity>
33
+ <a-entity id="yellowSphere" geometry="primitive: sphere" material="color:#ff0; metalness:0.0; roughness:1.0" position="-2 2 -2"></a-entity>
34
+ <a-box src="https://aframe.io/sample-assets/assets/images/bricks/brick_bump.jpg" position="-5 5 -2" width="1" color="#F16745"></a-box>
35
+ <a-box id="box" position="0 2 0" height="2" color="#FFC65D"></a-box>
36
+
37
+ <!-- Models. -->
38
+ <a-entity class="boxClass" geometry="primitive: box" material="src: #crateImg" position="3 4 0"></a-entity>
39
+ <a-entity class="boxClass" geometry="primitive: box" material="color: #0f0" position="4 2 4"></a-entity>
40
+
41
+ <!-- Floor. -->
42
+ <a-entity id="floor" geometry="primitive: box; height: .2; depth: 24; width: 24"
43
+ material="src: #floorImg; color: #fafafa; metalness: .1; repeat: 50 20; roughness: 1"></a-entity>
44
+
45
+ <!-- Lights. -->
46
+ <a-entity id="pointLight" light="type: point; intensity: 0.25" position="0 3 3"></a-entity>
47
+
48
+ <!-- Camera. -->
49
+ <a-entity id="cameraWrapper" position="0 1.6 8">
50
+ <a-entity id="camera" camera look-controls wasd-controls>
51
+ <!-- Cursor. -->
52
+ <a-entity id="cursor" position="0 0 -2"
53
+ geometry="primitive: ring; radiusOuter: 0.016; radiusInner: 0.01"
54
+ material="color: #ff9; shader: flat; transparent: true; opacity: 0.5"
55
+ scale="2 2 2" raycaster>
56
+ </a-entity>
57
+ </a-entity>
58
+ </a-entity>
59
+
60
+ <a-entity id="leftHand" laser-controls="hand: left"></a-entity>
61
+ <a-entity id="rightHand" laser-controls="hand: right"></a-entity>
62
+ </a-scene>
63
+
64
+ <script src="../dist/aframe-inspector.js"></script>
65
+ </body>
66
+ </html>
@@ -0,0 +1,71 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>Example Scene</title>
6
+ <!--<script>window.AFRAME_SAMPLE_ASSETS_ROOT = "./sample-assets/";</script>-->
7
+ <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1.7.0/dist/aframe-master.min.js"></script>
8
+ <script src="https://unpkg.com/aframe-environment-component@1.3.7/dist/aframe-environment-component.min.js"></script>
9
+ </head>
10
+ <body>
11
+ <a-scene debug="true">
12
+ <a-text
13
+ position="0 3 -3"
14
+ value="Hello, XR World!"
15
+ align="center"
16
+ text=""
17
+ ></a-text>
18
+ <a-image
19
+ width="2"
20
+ height="2"
21
+ position="0 2 -4"
22
+ src="https://cdn.glitch.global/a9a8a483-3c49-449a-89e6-870645a2773a/product-logo.png?v=1729405883005"
23
+ material=""
24
+ geometry=""
25
+ ></a-image>
26
+ <a-cone
27
+ position="0 .5 -2.5"
28
+ color="green"
29
+ radius-bottom=".5"
30
+ radius-top="0"
31
+ material=""
32
+ geometry=""
33
+ ></a-cone>
34
+ <a-box
35
+ position="1 .5 -3"
36
+ rotation="0 45 0"
37
+ color="blue"
38
+ material=""
39
+ geometry=""
40
+ ></a-box>
41
+ <a-sphere
42
+ position="-1 .5 -3"
43
+ color="yellow"
44
+ radius=".6"
45
+ material=""
46
+ geometry=""
47
+ ></a-sphere>
48
+ <a-plane
49
+ position="0 0 0"
50
+ rotation="-90 0 0"
51
+ width="100"
52
+ height="100"
53
+ repeat="50 50"
54
+ transparent="true"
55
+ src="https://cdn.glitch.global/a9a8a483-3c49-449a-89e6-870645a2773a/wireframe.png?v=1725555289564"
56
+ material=""
57
+ geometry=""
58
+ ></a-plane>
59
+ <a-sky
60
+ color="#18181B"
61
+ repeat="20 10"
62
+ src="https://cdn.glitch.global/a9a8a483-3c49-449a-89e6-870645a2773a/wireframe.png?v=1725555289564"
63
+ material=""
64
+ geometry=""
65
+ scale=""
66
+ ></a-sky>
67
+ </a-scene>
68
+
69
+ <script src="../dist/aframe-inspector.js"></script>
70
+ </body>
71
+ </html>
@@ -0,0 +1,6 @@
1
+ <script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script>
2
+ <script src="https://unpkg.com/aframe-supercraft-loader@3.0.0/dist/aframe-supercraft-loader.min.js"></script>
3
+ <a-scene>
4
+ <a-entity id="aframe" supercraft-loader="name: clear-bead"></a-entity>
5
+ </a-scene>
6
+ <script src="../dist/aframe-inspector.js"></script>
package/index.html ADDED
@@ -0,0 +1,8 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="refresh" content="0; url=examples/">
6
+ </head>
7
+ <body></body>
8
+ </html>
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "senangwebs-aframe-editor",
3
+ "version": "1.6.5",
4
+ "description": "A fork of A-Frame Inspector designed to be use as visual editor used in SenangWebs.",
5
+ "main": "dist/aframe-inspector.min.js",
6
+ "scripts": {
7
+ "build": "webpack --progress",
8
+ "deploy": "npm run ghpages",
9
+ "dist": "npm run dist:max && npm run dist:min",
10
+ "dist:max": "npm run build",
11
+ "dist:min": "cross-env MINIFY=true npm run build",
12
+ "ghpages": "npm run preghpages && ghpages -p gh-pages",
13
+ "lint": "npm run lintfile src/",
14
+ "lint:css": "stylelint src/css/main.css",
15
+ "lintfile": "eslint",
16
+ "preghpages": "npm run dist && shx rm -rf gh-pages && shx mkdir gh-pages && shx cp -r assets dist examples index.html gh-pages && shx sed -i http://localhost:3333 .. gh-pages/examples/index.html",
17
+ "prepare": "husky install",
18
+ "prepublish": "npm run dist",
19
+ "prettier": "prettier --write 'src/**/*.js'",
20
+ "start": "webpack serve --progress -d eval-source-map",
21
+ "test": "jest --watch",
22
+ "test:ci": "jest"
23
+ },
24
+ "repository": "aframevr/aframe-inspector",
25
+ "license": "MIT",
26
+ "dependencies": {
27
+ "@fortawesome/free-solid-svg-icons": "^6.5.1",
28
+ "clipboard-copy": "^4.0.1",
29
+ "clsx": "^2.1.0",
30
+ "lodash.debounce": "^4.0.8",
31
+ "prop-types": "^15.8.1",
32
+ "react": "^18.2.0",
33
+ "react-dom": "^18.2.0",
34
+ "react-select": "^5.8.0",
35
+ "three": "0.168.0"
36
+ },
37
+ "devDependencies": {
38
+ "@babel/core": "^7.24.0",
39
+ "@babel/eslint-parser": "^7.23.10",
40
+ "@babel/preset-env": "^7.24.0",
41
+ "@babel/preset-react": "^7.23.3",
42
+ "autoprefixer": "^10.4.17",
43
+ "babel-jest": "^29.7.0",
44
+ "babel-loader": "^9.1.3",
45
+ "cross-env": "^7.0.3",
46
+ "css-loader": "^6.10.0",
47
+ "eslint": "^8.57.0",
48
+ "eslint-config-standard": "^17.1.0",
49
+ "eslint-plugin-react": "^7.33.2",
50
+ "ghpages": "0.0.10",
51
+ "husky": "^8.0.1",
52
+ "jest": "^29.7.0",
53
+ "lint-staged": "^13.0.3",
54
+ "postcss-loader": "^8.1.1",
55
+ "prettier": "^3.2.5",
56
+ "react-test-renderer": "^18.2.0",
57
+ "shx": "^0.3.4",
58
+ "style-loader": "^3.3.4",
59
+ "stylelint": "^16.2.1",
60
+ "stylelint-config-standard": "^36.0.0",
61
+ "stylelint-order": "^6.0.4",
62
+ "stylus": "^0.62.0",
63
+ "stylus-loader": "^8.1.0",
64
+ "webpack": "^5.91.0",
65
+ "webpack-cli": "^5.1.4",
66
+ "webpack-dev-server": "^5.0.4"
67
+ },
68
+ "keywords": [
69
+ "3d",
70
+ "aframe",
71
+ "editor",
72
+ "inspector",
73
+ "three.js",
74
+ "tool",
75
+ "unity",
76
+ "vr",
77
+ "virtualreality",
78
+ "webvr",
79
+ "wysiwyg"
80
+ ],
81
+ "lint-staged": {
82
+ "*.js": "prettier --write"
83
+ }
84
+ }
Binary file
@@ -0,0 +1,53 @@
1
+ /*
2
+ Use <AwesomeIcon icon={faEye} /> instead of <FontAwesomeIcon icon={faEye} /> from @fortawesome/react-fontawesome
3
+ Using FontAwesomeIcon component adds 66 kB minified to the bundle.
4
+ Our AwesomeIcon does the same but less than 2 kB minified.
5
+ svg-inline--fa class has been added to lib.styl
6
+ */
7
+ import React from 'react';
8
+ import PropTypes from 'prop-types';
9
+
10
+ function asIcon(icon) {
11
+ const width = icon[0];
12
+ const height = icon[1];
13
+ const vectorData = icon[4];
14
+ let element;
15
+
16
+ if (Array.isArray(vectorData)) {
17
+ element = (
18
+ <g>
19
+ {vectorData.map((pathData, index) => (
20
+ <path key={index} fill="currentColor" d={pathData} />
21
+ ))}
22
+ </g>
23
+ );
24
+ } else {
25
+ element = <path fill="currentColor" d={vectorData} />;
26
+ }
27
+
28
+ return {
29
+ width: width,
30
+ height: height,
31
+ icon: element
32
+ };
33
+ }
34
+
35
+ export class AwesomeIcon extends React.Component {
36
+ static propTypes = {
37
+ icon: PropTypes.object.isRequired
38
+ };
39
+
40
+ render() {
41
+ const { width, height, icon } = asIcon(this.props.icon.icon);
42
+ return (
43
+ <svg
44
+ role="img"
45
+ className={`svg-inline--fa fa-${this.props.icon.iconName}`}
46
+ xmlns="http://www.w3.org/2000/svg"
47
+ viewBox={`0 0 ${width} ${height}`}
48
+ >
49
+ {icon}
50
+ </svg>
51
+ );
52
+ }
53
+ }
@@ -0,0 +1,57 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import clsx from 'clsx';
4
+
5
+ export default class Collapsible extends React.Component {
6
+ static propTypes = {
7
+ className: PropTypes.string,
8
+ collapsed: PropTypes.bool,
9
+ children: PropTypes.oneOfType([PropTypes.array, PropTypes.element])
10
+ .isRequired,
11
+ id: PropTypes.string
12
+ };
13
+
14
+ static defaultProps = {
15
+ collapsed: false
16
+ };
17
+
18
+ constructor(props) {
19
+ super(props);
20
+ this.state = {
21
+ collapsed: this.props.collapsed
22
+ };
23
+ }
24
+
25
+ toggleVisibility = (event) => {
26
+ // Don't collapse if we click on actions like clipboard
27
+ if (event.target.nodeName === 'A') return;
28
+ this.setState({ collapsed: !this.state.collapsed });
29
+ };
30
+
31
+ render() {
32
+ const rootClassNames = {
33
+ collapsible: true,
34
+ component: true,
35
+ collapsed: this.state.collapsed
36
+ };
37
+ if (this.props.className) {
38
+ rootClassNames[this.props.className] = true;
39
+ }
40
+ const rootClasses = clsx(rootClassNames);
41
+
42
+ const contentClasses = clsx({
43
+ content: true,
44
+ hide: this.state.collapsed
45
+ });
46
+
47
+ return (
48
+ <div id={this.props.id} className={rootClasses}>
49
+ <div className="static" onClick={this.toggleVisibility}>
50
+ <div className="collapse-button" />
51
+ {this.props.children[0]}
52
+ </div>
53
+ <div className={contentClasses}>{this.props.children[1]}</div>
54
+ </div>
55
+ );
56
+ }
57
+ }