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
package/.babelrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "presets": ["@babel/preset-env", ["@babel/preset-react", {"runtime": "automatic"}]]
3
+ }
package/.editorconfig ADDED
@@ -0,0 +1,12 @@
1
+ ; http://editorconfig.org
2
+
3
+ root = true
4
+
5
+ [*]
6
+ indent_style = space
7
+ indent_size = 2
8
+ end_of_line = lf
9
+ charset = utf-8
10
+ trim_trailing_whitespace = true
11
+ insert_final_newline = true
12
+
package/.eslintignore ADDED
@@ -0,0 +1,2 @@
1
+ src/lib/vendor/
2
+ src/components/__tests__/
package/.eslintrc ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "extends": ["eslint:recommended", "plugin:react/recommended", "plugin:react/jsx-runtime", "standard"],
3
+ "rules": {
4
+ "multiline-ternary": "off",
5
+ "no-console": "off",
6
+ "no-lone-blocks": "off",
7
+ "no-var": "off",
8
+ "object-shorthand": "off",
9
+ "no-useless-return": "off",
10
+ "prefer-const": "off",
11
+ "react/jsx-indent-props": [2, 2],
12
+ "semi": [2, "always"],
13
+ "space-before-function-paren": "off"
14
+ },
15
+ "env": {
16
+ "browser": true,
17
+ "es2021": true,
18
+ "node": true
19
+ },
20
+ "globals": {
21
+ "AFRAME": true,
22
+ "THREE": true
23
+ },
24
+ "parser": "@babel/eslint-parser",
25
+ "parserOptions": {
26
+ "ecmaFeatures": {
27
+ "jsx": true
28
+ },
29
+ "ecmaVersion": "latest",
30
+ "sourceType": "module"
31
+ },
32
+ "plugins": [
33
+ "react"
34
+ ],
35
+ "settings": {
36
+ "react": {
37
+ "version": "detect"
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,39 @@
1
+ name: Test Cases
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ pull_request:
7
+ branches:
8
+ - master
9
+ permissions:
10
+ contents: read
11
+ jobs:
12
+ test:
13
+ name: Test Cases
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ node-version: ['20.x']
18
+ steps:
19
+ - name: Checkout Repo
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Use Node.js ${{ matrix['node-version'] }}
23
+ uses: actions/setup-node@v4
24
+ with:
25
+ node-version: ${{ matrix['node-version'] }}
26
+ cache: 'npm'
27
+ cache-dependency-path: 'package-lock.json'
28
+
29
+ - name: Install dependencies
30
+ run: npm install
31
+
32
+ - name: Test Cases
33
+ run: npm run test:ci
34
+
35
+ - name: Check Lint
36
+ run: npm run lint
37
+
38
+ - name: Check Build
39
+ run: npm run dist
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
@@ -0,0 +1 @@
1
+ src/lib/TransformControls.js
@@ -0,0 +1,5 @@
1
+ {
2
+ "printWidth": 80,
3
+ "singleQuote": true,
4
+ "trailingComma": "none"
5
+ }
package/.stylelintrc ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "stylelint-config-standard",
3
+ "plugins": [
4
+ "stylelint-order"
5
+ ],
6
+ "rules": {
7
+ "selector-type-no-unknown": [true,
8
+ "ignoreTypes": ["a-scene", "a-entity"]
9
+ ],
10
+ "order/properties-alphabetical-order": true
11
+ }
12
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright © 2018 A-Frame authors.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # SenangWebs A-Frame Editor / Webverse Editor
2
+ A fork of A-Frame Inspector designed to be use as visual editor used in SenangWebs.
3
+
4
+ ![SenangWebs Preview](https://github.com/a-hakim/senangwebs-aframe-editor/blob/master/senangwebs-webverse-editor.png)
5
+
6
+ # A-Frame Inspector
7
+
8
+ A visual inspector tool for [A-Frame](https://aframe.io) scenes. Just hit
9
+ `<ctrl> + <alt> + i` on any A-Frame scene to open up the Inspector.
10
+
11
+ - [Documentation / Guide](https://aframe.io/docs/master/introduction/visual-inspector-and-dev-tools.html)
12
+ - [Example](https://aframe.io/aframe-inspector/examples/)
13
+
14
+ Also check out:
15
+
16
+ - [A-Frame Watcher](https://github.com/supermedium/aframe-watcher) - Companion server to sync changes to HTML files.
17
+
18
+ ![Inspector Preview](https://user-images.githubusercontent.com/674727/50159991-fa540c80-028c-11e9-87f1-72c54e08d808.png)
19
+
20
+ ## Using the Inspector
21
+
22
+ ### Keyboard Shortcut
23
+
24
+ A-Frame comes with a **keyboard shortcut** to inject the inspector. Just open
25
+ up any A-Frame scene (running at least A-Frame v0.3.0) and press **`<ctrl> +
26
+ <alt> + i`** to inject the inspector, just like you would use a DOM inspector:
27
+
28
+ ### Specifying Inspector Build
29
+
30
+ This is done with the `inspector` component. By default, this is set on the
31
+ scene already. If we want, we can specify a specific build of the Inspector to
32
+ inject by passing a URL. For debugging:
33
+
34
+ ```html
35
+ <a-scene inspector="url: http://localhost:3333/dist/aframe-inspector.js">
36
+ <!-- Scene... -->
37
+ </a-scene>
38
+ ```
39
+
40
+ To use the master branch of the Inspector:
41
+
42
+ ```html
43
+ <a-scene inspector="url: https://cdn.jsdelivr.net/gh/aframevr/aframe-inspector@master/dist/aframe-inspector.min.js">
44
+ </a-scene>
45
+ ```
46
+
47
+ ## Local Development
48
+
49
+ ```bash
50
+ git clone git@github.com:aframevr/aframe-inspector.git
51
+ cd aframe-inspector
52
+ npm install
53
+ npm start
54
+ ```
55
+
56
+ Then navigate to __[http://localhost:3333/examples/](http://localhost:3333/examples/)__
57
+
58
+ ## Self-hosting the sample-assets directory
59
+
60
+ The textures modal is using https://aframe.io/sample-assets/dist/images.json
61
+ to get the available textures.
62
+ The GitHub repository for those assets is https://github.com/aframevr/sample-assets
63
+
64
+ If you want to self-host this directory, do the following:
65
+
66
+ ```bash
67
+ cd examples
68
+ git clone git@github.com:aframevr/sample-assets.git
69
+ ```
70
+
71
+ edit `index.html` and define before any script tag this global variable:
72
+
73
+ ```html
74
+ <script>window.AFRAME_SAMPLE_ASSETS_ROOT = "./sample-assets/";</script>
75
+ ```
@@ -0,0 +1,49 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+ <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="861.95398" height="451.99902" viewBox="0 0 228.05866 119.5914" version="1.1" id="svg1040" inkscape:version="0.92.0 r15299" sodipodi:docname="gitf.svg">
4
+ <defs id="defs1034"/>
5
+ <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.47482464" inkscape:cx="331.90783" inkscape:cy="443.57135" inkscape:document-units="mm" inkscape:current-layer="layer1" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" units="px" inkscape:window-width="1280" inkscape:window-height="744" inkscape:window-x="-4" inkscape:window-y="-4" inkscape:window-maximized="1"/>
6
+ <metadata id="metadata1037">
7
+ <rdf:RDF>
8
+ <cc:Work rdf:about="">
9
+ <dc:format>image/svg+xml</dc:format>
10
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
11
+ <dc:title/>
12
+ </cc:Work>
13
+ </rdf:RDF>
14
+ </metadata>
15
+ <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(-17.18272,-215.76524)">
16
+ <g id="g1327" transform="matrix(0.26458333,0,0,0.26458333,-1.9077621,209.41524)">
17
+ <g id="g1299">
18
+ <g id="g1285">
19
+ <path id="path1281" d="m 419.671,403.727 c 14.757,-16.554 22.561,-40.735 22.561,-73.316 V 148.37 h -31.174 v 28.48 h -0.385 c -5.905,-11.029 -14.113,-19.303 -24.631,-24.823 -10.524,-5.515 -22.069,-8.275 -34.637,-8.275 -17.193,0 -31.691,3.271 -43.49,9.814 -11.804,6.543 -21.299,14.95 -28.479,25.209 -7.187,10.264 -12.315,21.552 -15.395,33.868 -3.079,12.315 -4.618,24.378 -4.618,36.177 0,13.603 1.858,26.496 5.581,38.679 3.716,12.19 9.296,22.9 16.741,32.137 7.439,9.236 16.675,16.548 27.71,21.936 11.035,5.388 23.994,8.082 38.877,8.082 6.158,0 12.376,-0.769 18.665,-2.309 6.291,-1.539 12.19,-3.782 17.71,-6.735 5.514,-2.946 10.452,-6.669 14.817,-11.16 4.36,-4.487 7.95,-9.813 10.776,-15.972 h 0.757 v 13.084 c 0,11.293 -1.094,21.553 -3.272,30.79 -2.182,9.237 -5.712,17.127 -10.583,23.668 -4.877,6.543 -11.035,11.672 -18.474,15.395 -7.445,3.717 -16.549,5.581 -27.325,5.581 -5.389,0 -11.035,-0.579 -16.935,-1.732 -2.13,-0.416 -4.2,-0.928 -6.211,-1.53 -2.188,-0.772 -4.358,-1.557 -6.51,-2.356 -0.2,-0.085 -0.399,-0.172 -0.598,-0.259 v 0.036 C 236.622,364.583 180.992,310.909 180.992,250.003 c 0,-97.147 141.523,-175.899 316.1,-175.899 97.253,0 184.451,22.15 242.436,60.593 C 676.24,70.283 562.757,25.022 433.005,25 234.282,24.965 73.17,125.674 73.153,249.938 c -0.012,84.821 75.042,158.697 185.893,197.058 88.919,3.044 134.048,-13.459 160.625,-43.269 z M 406.248,271.526 c -2.182,9.236 -5.58,17.512 -10.199,24.823 -4.617,7.314 -10.715,13.219 -18.28,17.703 -7.571,4.493 -16.742,6.735 -27.517,6.735 -10.777,0 -19.761,-2.242 -26.941,-6.735 -7.186,-4.484 -12.959,-10.39 -17.319,-17.703 -4.366,-7.311 -7.444,-15.454 -9.237,-24.439 -1.797,-8.978 -2.694,-17.956 -2.694,-26.94 0,-9.489 1.088,-18.6 3.271,-27.326 2.178,-8.719 5.641,-16.417 10.392,-23.092 4.745,-6.669 10.837,-11.991 18.281,-15.972 7.439,-3.975 16.417,-5.965 26.941,-5.965 10.259,0 18.984,2.057 26.17,6.158 7.18,4.107 13.019,9.561 17.511,16.356 4.486,6.801 7.758,14.432 9.814,22.899 2.051,8.467 3.079,17.066 3.079,25.786 0,9.238 -1.095,18.475 -3.272,27.712 z" inkscape:connector-curvature="0" style="fill:#fafafa"/>
20
+
21
+ <path id="path1283" d="m 434.849,422.485 c -18.854,17.113 -52.532,36.647 -98.397,44.316 30.707,5.339 63.065,8.194 96.49,8.198 129.236,0.025 242.425,-45.091 305.881,-109.055 -57.984,38.206 -144.83,59.951 -241.728,59.951 -23.018,0.002 -40.626,-0.809 -62.246,-3.41 z" inkscape:connector-curvature="0" style="fill:#fafafa"/>
22
+
23
+ </g>
24
+
25
+ <g id="g1295">
26
+ <g id="g1289">
27
+ <path id="path1287" d="M 633.84,347.908 H 586.875 V 189.705 h -58.922 v -40.234 h 164.81 v 40.234 H 633.84 Z" inkscape:connector-curvature="0" style="fill:#fafafa"/>
28
+
29
+ </g>
30
+
31
+ <g id="g1293">
32
+ <path id="path1291" d="M 764.173,347.908 H 717.206 V 149.471 h 144.988 v 40.234 h -98.021 v 37.128 h 85.803 v 40.233 h -85.803 z" inkscape:connector-curvature="0" style="fill:#fafafa"/>
33
+
34
+ </g>
35
+
36
+ </g>
37
+
38
+ <path id="path1297" d="m 469.554,100.031 h 32.714 v 247.313 h -32.714 z" inkscape:connector-curvature="0" style="fill:#fafafa"/>
39
+
40
+ </g>
41
+ <g id="g1305">
42
+ <polygon id="polygon1301" points="895.435,155.289 895.435,174.4 889.017,174.4 889.017,155.289 881.67,155.289 881.67,149.769 902.782,149.769 902.782,155.289 902.783,155.289 " style="fill:#fafafa"/>
43
+
44
+ <polygon id="polygon1303" points="919.411,166.19 923.654,149.769 933.107,149.769 933.107,174.4 927.069,174.4 927.069,155.703 927.001,155.703 921.826,174.4 916.929,174.4 911.752,155.703 911.683,155.703 911.683,174.4 905.647,174.4 905.647,149.769 915.1,149.769 919.342,166.19 " style="fill:#fafafa"/>
45
+
46
+ </g>
47
+ </g>
48
+ </g>
49
+ </svg>