Ver código fonte

Refactor tweakpane and tweakpane editor as plugins.

master
Palash Bansal 2 anos atrás
pai
commit
ad4b064575
Nenhuma conta vinculada ao e-mail do autor do commit
49 arquivos alterados com 599 adições e 132 exclusões
  1. 4
    1
      .eslintrc.cjs
  2. 1
    1
      examples/camera-uiconfig/index.html
  3. 2
    1
      examples/camera-uiconfig/script.ts
  4. 2
    1
      examples/dropzone-plugin/index.html
  5. 2
    1
      examples/dropzone-plugin/script.ts
  6. 1
    1
      examples/fullscreen-plugin/index.html
  7. 2
    1
      examples/fullscreen-plugin/script.ts
  8. 1
    1
      examples/gltf-transmission-test/index.html
  9. 2
    1
      examples/gltf-transmission-test/script.ts
  10. 1
    1
      examples/material-uiconfig/index.html
  11. 2
    1
      examples/material-uiconfig/script.ts
  12. 1
    1
      examples/object-uiconfig/index.html
  13. 2
    1
      examples/object-uiconfig/script.ts
  14. 1
    2
      examples/parallel-asset-import/index.html
  15. 1
    1
      examples/scene-uiconfig/index.html
  16. 2
    1
      examples/scene-uiconfig/script.ts
  17. 1
    1
      examples/tsconfig.build.json
  18. 1
    1
      examples/tsconfig.json
  19. 2
    2
      examples/tweakpane-editor/index.html
  20. 2
    2
      examples/tweakpane-editor/script.ts
  21. 1
    1
      examples/viewer-uiconfig/index.html
  22. 2
    1
      examples/viewer-uiconfig/script.ts
  23. 10
    46
      package-lock.json
  24. 6
    12
      package.json
  25. 0
    0
      plugins/index.ts
  26. 25
    9
      plugins/tweakpane-editor/package-lock.json
  27. 58
    0
      plugins/tweakpane-editor/package.json
  28. 97
    0
      plugins/tweakpane-editor/rollup.config.mjs
  29. 0
    0
      plugins/tweakpane-editor/src/TweakpaneEditorPlugin.css
  30. 1
    1
      plugins/tweakpane-editor/src/TweakpaneEditorPlugin.ts
  31. 0
    0
      plugins/tweakpane-editor/src/global.d.ts
  32. 0
    0
      plugins/tweakpane-editor/src/icons.ts
  33. 0
    0
      plugins/tweakpane-editor/src/index.ts
  34. 0
    0
      plugins/tweakpane-editor/src/logo.ts
  35. 0
    0
      plugins/tweakpane-editor/src/util-buttons.ts
  36. 1
    4
      plugins/tweakpane-editor/tsconfig.json
  37. 178
    0
      plugins/tweakpane/package-lock.json
  38. 66
    0
      plugins/tweakpane/package.json
  39. 8
    3
      plugins/tweakpane/rollup.config.mjs
  40. 17
    5
      plugins/tweakpane/src/TweakpaneUiPlugin.ts
  41. 36
    0
      plugins/tweakpane/src/global.d.ts
  42. 1
    0
      plugins/tweakpane/src/index.ts
  43. 14
    10
      plugins/tweakpane/src/tpImageInputGenerator.ts
  44. 0
    0
      plugins/tweakpane/src/tpTheme.css
  45. 41
    0
      plugins/tweakpane/tsconfig.json
  46. 0
    15
      plugins/ui/tweakpane-editor/package.json
  47. 3
    0
      rollup.config.mjs
  48. 0
    1
      src/plugins/index.ts
  49. 1
    1
      tsconfig.json

+ 4
- 1
.eslintrc.cjs Ver arquivo

'parserOptions': { 'parserOptions': {
'ecmaVersion': 2021, // Allows for the parsing of modern ECMAScript features 'ecmaVersion': 2021, // Allows for the parsing of modern ECMAScript features
'sourceType': 'module', // Allows for the use of imports 'sourceType': 'module', // Allows for the use of imports
'project': ['./tsconfig.json', './examples/tsconfig.json', './plugins/ui/tweakpane-editor/tsconfig.json'],
'project': ['./tsconfig.json', './examples/tsconfig.json',
'./plugins/tweakpane-editor/tsconfig.json',
'./plugins/tweakpane/tsconfig.json',
],
'tsconfigRootDir': './', 'tsconfigRootDir': './',
}, },
'extends': [ 'extends': [

+ 1
- 1
examples/camera-uiconfig/index.html Ver arquivo

{ {
"imports": { "imports": {
"threepipe": "./../../dist/index.mjs", "threepipe": "./../../dist/index.mjs",
"uiconfig-tweakpane": "https://unpkg.com/uiconfig-tweakpane@latest/dist/index.mjs"
"@threepipe/plugin-tweakpane": "./../../plugins/tweakpane/dist/index.mjs"
} }
} }



+ 2
- 1
examples/camera-uiconfig/script.ts Ver arquivo

import {_testFinish, IObject3D, ThreeViewer, TweakpaneUiPlugin} from 'threepipe'
import {_testFinish, IObject3D, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {



+ 2
- 1
examples/dropzone-plugin/index.html Ver arquivo

<script type="importmap"> <script type="importmap">
{ {
"imports": { "imports": {
"threepipe": "./../../dist/index.mjs"
"threepipe": "./../../dist/index.mjs",
"@threepipe/plugin-tweakpane": "./../../plugins/tweakpane/dist/index.mjs"
} }
} }



+ 2
- 1
examples/dropzone-plugin/script.ts Ver arquivo

import {_testFinish, DropzonePlugin, ThreeViewer, TweakpaneUiPlugin} from 'threepipe'
import {_testFinish, DropzonePlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {



+ 1
- 1
examples/fullscreen-plugin/index.html Ver arquivo

{ {
"imports": { "imports": {
"threepipe": "./../../dist/index.mjs", "threepipe": "./../../dist/index.mjs",
"uiconfig-tweakpane": "https://unpkg.com/uiconfig-tweakpane@latest/dist/index.mjs"
"@threepipe/plugin-tweakpane": "./../../plugins/tweakpane/dist/index.mjs"
} }
} }



+ 2
- 1
examples/fullscreen-plugin/script.ts Ver arquivo

import {_testFinish, FullScreenPlugin, IObject3D, ThreeViewer, TweakpaneUiPlugin} from 'threepipe'
import {_testFinish, FullScreenPlugin, IObject3D, ThreeViewer} from 'threepipe'
import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js' import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {



+ 1
- 1
examples/gltf-transmission-test/index.html Ver arquivo

{ {
"imports": { "imports": {
"threepipe": "./../../dist/index.mjs", "threepipe": "./../../dist/index.mjs",
"uiconfig-tweakpane": "https://unpkg.com/uiconfig-tweakpane@latest/dist/index.mjs"
"@threepipe/plugin-tweakpane": "./../../plugins/tweakpane/dist/index.mjs"
} }
} }



+ 2
- 1
examples/gltf-transmission-test/script.ts Ver arquivo

import {_testFinish, IObject3D, RenderTargetPreviewPlugin, ThreeViewer, TweakpaneUiPlugin} from 'threepipe'
import {_testFinish, IObject3D, RenderTargetPreviewPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,

+ 1
- 1
examples/material-uiconfig/index.html Ver arquivo

{ {
"imports": { "imports": {
"threepipe": "./../../dist/index.mjs", "threepipe": "./../../dist/index.mjs",
"uiconfig-tweakpane": "https://unpkg.com/uiconfig-tweakpane@latest/dist/index.mjs"
"@threepipe/plugin-tweakpane": "./../../plugins/tweakpane/dist/index.mjs"
} }
} }



+ 2
- 1
examples/material-uiconfig/script.ts Ver arquivo

import {_testFinish, IObject3D, ThreeViewer, TweakpaneUiPlugin} from 'threepipe'
import {_testFinish, IObject3D, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {



+ 1
- 1
examples/object-uiconfig/index.html Ver arquivo

{ {
"imports": { "imports": {
"threepipe": "./../../dist/index.mjs", "threepipe": "./../../dist/index.mjs",
"uiconfig-tweakpane": "https://unpkg.com/uiconfig-tweakpane@latest/dist/index.mjs"
"@threepipe/plugin-tweakpane": "./../../plugins/tweakpane/dist/index.mjs"
} }
} }



+ 2
- 1
examples/object-uiconfig/script.ts Ver arquivo

import {_testFinish, IObject3D, ThreeViewer, TweakpaneUiPlugin} from 'threepipe'
import {_testFinish, IObject3D, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {



+ 1
- 2
examples/parallel-asset-import/index.html Ver arquivo

<script type="importmap"> <script type="importmap">
{ {
"imports": { "imports": {
"threepipe": "./../../dist/index.mjs",
"uiconfig-tweakpane": "https://unpkg.com/uiconfig-tweakpane@latest/dist/index.mjs"
"threepipe": "./../../dist/index.mjs"
} }
} }



+ 1
- 1
examples/scene-uiconfig/index.html Ver arquivo

{ {
"imports": { "imports": {
"threepipe": "./../../dist/index.mjs", "threepipe": "./../../dist/index.mjs",
"uiconfig-tweakpane": "https://unpkg.com/uiconfig-tweakpane@latest/dist/index.mjs"
"@threepipe/plugin-tweakpane": "./../../plugins/tweakpane/dist/index.mjs"
} }
} }



+ 2
- 1
examples/scene-uiconfig/script.ts Ver arquivo

import {_testFinish, IObject3D, ThreeViewer, TweakpaneUiPlugin} from 'threepipe'
import {_testFinish, IObject3D, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {



+ 1
- 1
examples/tsconfig.build.json Ver arquivo

"compilerOptions": { "compilerOptions": {
"paths": { "paths": {
"threepipe": ["../dist/"], "threepipe": ["../dist/"],
"@threepipe/plugins/*": ["../plugins/*/dist"]
"@threepipe/plugin-*": ["../plugins/*/dist"]
}, },
}, },
} }

+ 1
- 1
examples/tsconfig.json Ver arquivo

"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"sourceMap": false, "sourceMap": false,
"paths": { "paths": {
"@threepipe/plugins/*": ["../plugins/*/src"],
"@threepipe/plugin-*": ["../plugins/*/src"],
"threepipe": ["../src/"] "threepipe": ["../src/"]
}, },
"target": "ES2020", "target": "ES2020",

+ 2
- 2
examples/tweakpane-editor/index.html Ver arquivo

{ {
"imports": { "imports": {
"threepipe": "./../../dist/index.mjs", "threepipe": "./../../dist/index.mjs",
"@threepipe/plugins/ui/tweakpane-editor": "./../../plugins/ui/tweakpane-editor/dist/index.mjs",
"uiconfig-tweakpane": "https://unpkg.com/uiconfig-tweakpane@latest/dist/index.mjs"
"@threepipe/plugin-tweakpane": "./../../plugins/tweakpane/dist/index.mjs",
"@threepipe/plugin-tweakpane-editor": "./../../plugins/tweakpane-editor/dist/index.mjs"
} }
} }



+ 2
- 2
examples/tweakpane-editor/script.ts Ver arquivo

NormalBufferPlugin, NormalBufferPlugin,
RenderTargetPreviewPlugin, RenderTargetPreviewPlugin,
ThreeViewer, ThreeViewer,
TweakpaneUiPlugin,
UnsignedByteType, UnsignedByteType,
} from 'threepipe' } from 'threepipe'
import {TweakpaneEditorPlugin} from '@threepipe/plugins/ui/tweakpane-editor'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'
import {TweakpaneEditorPlugin} from '@threepipe/plugin-tweakpane-editor'


class ViewerUiConfig extends AViewerPluginSync<''> { class ViewerUiConfig extends AViewerPluginSync<''> {
static readonly PluginType = 'ViewerUiConfig' static readonly PluginType = 'ViewerUiConfig'

+ 1
- 1
examples/viewer-uiconfig/index.html Ver arquivo

{ {
"imports": { "imports": {
"threepipe": "./../../dist/index.mjs", "threepipe": "./../../dist/index.mjs",
"uiconfig-tweakpane": "https://unpkg.com/uiconfig-tweakpane@latest/dist/index.mjs"
"@threepipe/plugin-tweakpane": "./../../plugins/tweakpane/dist/index.mjs"
} }
} }



+ 2
- 1
examples/viewer-uiconfig/script.ts Ver arquivo

import {_testFinish, IObject3D, ThreeViewer, TweakpaneUiPlugin} from 'threepipe'
import {_testFinish, IObject3D, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {



+ 10
- 46
package-lock.json Ver arquivo

"@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1011/package.tgz", "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1011/package.tgz",
"@types/webxr": "^0.5.1", "@types/webxr": "^0.5.1",
"@types/wicg-file-system-access": "^2020.9.5", "@types/wicg-file-system-access": "^2020.9.5",
"ts-browser-helpers": "^0.7.0",
"uiconfig-tweakpane": "^0.0.4"
"ts-browser-helpers": "^0.7.0"
}, },
"devDependencies": { "devDependencies": {
"@rollup/plugin-commonjs": "^25.0.0", "@rollup/plugin-commonjs": "^25.0.0",
"three": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2012/package.tgz", "three": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2012/package.tgz",
"tslib": "^2.5.0", "tslib": "^2.5.0",
"tweakpane": "^3.1.9", "tweakpane": "^3.1.9",
"tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz",
"typedoc": "^0.24.7", "typedoc": "^0.24.7",
"typescript": "^5.0.4", "typescript": "^5.0.4",
"typescript-plugin-css-modules": "^5.0.1", "typescript-plugin-css-modules": "^5.0.1",
"uiconfig.js": "^0.0.5"
"uiconfig.js": "^0.0.6"
}, },
"optionalDependencies": { "optionalDependencies": {
"win-node-env": "^0.6.1" "win-node-env": "^0.6.1"
"url": "https://github.com/sponsors/cocopon" "url": "https://github.com/sponsors/cocopon"
} }
}, },
"node_modules/tweakpane-image-plugin": {
"version": "1.1.404",
"resolved": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz",
"integrity": "sha512-CDTSmawGZvvTtGYCy6YKKyR1Rxo96/bVuqJvl2JYMn6n625SI8KTlscdb8VQi09pwz/96RNu9BDzTF3nRTZj1g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@tweakpane/core": "1.1.8"
}
},
"node_modules/type-check": { "node_modules/type-check": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
"node": ">=12.17" "node": ">=12.17"
} }
}, },
"node_modules/uiconfig-tweakpane": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/uiconfig-tweakpane/-/uiconfig-tweakpane-0.0.4.tgz",
"integrity": "sha512-Mo+dVplH4Hlnn5LAjzLH2Ly89/hFWtTtmdq/aIK826IrbSm1qb9MgFAUzSfZhs59kutf/Yo3Y6BKNQ2kagAA1A==",
"dependencies": {
"@types/three": "^0.152.1",
"uiconfig.js": "^0.0.5"
}
},
"node_modules/uiconfig.js": { "node_modules/uiconfig.js": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/uiconfig.js/-/uiconfig.js-0.0.5.tgz",
"integrity": "sha512-GC+WGWROJzIgwC/w22WOlGRa8UqQMU1/iD8W6WslrhTuvhh8O9tsANMaHyihgomfgybzm9ZY/c7bfvADcbuvyA=="
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/uiconfig.js/-/uiconfig.js-0.0.6.tgz",
"integrity": "sha512-cTnYZoR025/01kXStKUEhlBU8y9AZwXdQhG9iwWH6qfZoavxF5DxC9VXc/P2Io3XGKY0uiAC3D0J80rLtNHjEA==",
"dev": true
}, },
"node_modules/unbox-primitive": { "node_modules/unbox-primitive": {
"version": "1.0.2", "version": "1.0.2",
"integrity": "sha512-vMzh3X8uHo9HDY+9S9V0bc+UBScs8VYmMeOEW+BvynczV0aiLHweYv4eKpyoqpcRrQlkLhUsx8Dvv/1/qiCESg==", "integrity": "sha512-vMzh3X8uHo9HDY+9S9V0bc+UBScs8VYmMeOEW+BvynczV0aiLHweYv4eKpyoqpcRrQlkLhUsx8Dvv/1/qiCESg==",
"dev": true "dev": true
}, },
"tweakpane-image-plugin": {
"version": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz",
"integrity": "sha512-CDTSmawGZvvTtGYCy6YKKyR1Rxo96/bVuqJvl2JYMn6n625SI8KTlscdb8VQi09pwz/96RNu9BDzTF3nRTZj1g==",
"dev": true,
"requires": {
"@tweakpane/core": "1.1.8"
}
},
"type-check": { "type-check": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
"integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==", "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==",
"dev": true "dev": true
}, },
"uiconfig-tweakpane": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/uiconfig-tweakpane/-/uiconfig-tweakpane-0.0.4.tgz",
"integrity": "sha512-Mo+dVplH4Hlnn5LAjzLH2Ly89/hFWtTtmdq/aIK826IrbSm1qb9MgFAUzSfZhs59kutf/Yo3Y6BKNQ2kagAA1A==",
"requires": {
"@types/three": "^0.152.1",
"uiconfig.js": "^0.0.5"
}
},
"uiconfig.js": { "uiconfig.js": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/uiconfig.js/-/uiconfig.js-0.0.5.tgz",
"integrity": "sha512-GC+WGWROJzIgwC/w22WOlGRa8UqQMU1/iD8W6WslrhTuvhh8O9tsANMaHyihgomfgybzm9ZY/c7bfvADcbuvyA=="
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/uiconfig.js/-/uiconfig.js-0.0.6.tgz",
"integrity": "sha512-cTnYZoR025/01kXStKUEhlBU8y9AZwXdQhG9iwWH6qfZoavxF5DxC9VXc/P2Io3XGKY0uiAC3D0J80rLtNHjEA==",
"dev": true
}, },
"unbox-primitive": { "unbox-primitive": {
"version": "1.0.2", "version": "1.0.2",

+ 6
- 12
package.json Ver arquivo

"typedoc": "^0.24.7", "typedoc": "^0.24.7",
"typescript": "^5.0.4", "typescript": "^5.0.4",
"typescript-plugin-css-modules": "^5.0.1", "typescript-plugin-css-modules": "^5.0.1",
"uiconfig.js": "^0.0.5",
"rollup-plugin-replace": "^2.2.0",
"tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz"
"uiconfig.js": "^0.0.6",
"rollup-plugin-replace": "^2.2.0"
}, },
"dependencies": { "dependencies": {
"@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1011/package.tgz", "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1011/package.tgz",
"@types/webxr": "^0.5.1", "@types/webxr": "^0.5.1",
"@types/wicg-file-system-access": "^2020.9.5", "@types/wicg-file-system-access": "^2020.9.5",
"ts-browser-helpers": "^0.7.0",
"uiconfig-tweakpane": "^0.0.4"
"ts-browser-helpers": "^0.7.0"
}, },
"//": { "//": {
"dependencies": { "dependencies": {
"uiconfig.js": "^0.0.4",
"uiconfig.js": "^0.0.6",
"ts-browser-helpers": "^0.7.0", "ts-browser-helpers": "^0.7.0",
"uiconfig-tweakpane": "^0.0.4",
"three": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2012/package.tgz", "three": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2012/package.tgz",
"three-f": "https://github.com/repalash/three.js-modded/archive/refs/tags/v0.152.2012.tar.gz", "three-f": "https://github.com/repalash/three.js-modded/archive/refs/tags/v0.152.2012.tar.gz",
"@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1011/package.tgz", "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1011/package.tgz",
"@types/three-f": "https://github.com/repalash/three-ts-types/archive/refs/tags/v0.152.1011.tar.gz", "@types/three-f": "https://github.com/repalash/three-ts-types/archive/refs/tags/v0.152.1011.tar.gz",
"@types/three-pkg": "https://gitpkg.now.sh/repalash/three-ts-types/types/three?modded_three",
"tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz"
"@types/three-pkg": "https://gitpkg.now.sh/repalash/three-ts-types/types/three?modded_three"
}, },
"local_dependencies": { "local_dependencies": {
"uiconfig-tweakpane": "^file:./../uiconfig-tweakpane",
"uiconfig.js": "^file:./../uiconfig", "uiconfig.js": "^file:./../uiconfig",
"ts-browser-helpers": "file:./../ts-browser-helpers", "ts-browser-helpers": "file:./../ts-browser-helpers",
"three": "file:./../three.js", "three": "file:./../three.js",
"@types/three": "file:./../three-ts-types/types/three",
"tweakpane-image-plugin": "file:./../tweakpane-image-plugin"
"@types/three": "file:./../three-ts-types/types/three"
} }
}, },
"optionalDependencies": { "optionalDependencies": {

+ 0
- 0
plugins/index.ts Ver arquivo


plugins/ui/tweakpane-editor/package-lock.json → plugins/tweakpane-editor/package-lock.json Ver arquivo

{ {
"name": "tweakpane-editor",
"version": "1.0.0",
"name": "@threepipe/plugin-tweakpane-editor",
"version": "0.1.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "tweakpane-editor",
"version": "1.0.0",
"name": "@threepipe/plugin-tweakpane-editor",
"version": "0.1.0",
"license": "Apache-2.0",
"dependencies": { "dependencies": {
"threepipe": "./../../../dist/",
"@threepipe/plugin-tweakpane": "file:./../tweakpane/src/",
"threepipe": "file:./../../src/"
},
"devDependencies": {
"tippy.js": "^6.3.7" "tippy.js": "^6.3.7"
} }
}, },
"../../../dist": {},
"../../src": {},
"../tweakpane/src": {},
"node_modules/@popperjs/core": { "node_modules/@popperjs/core": {
"version": "2.11.8", "version": "2.11.8",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
"integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
"dev": true,
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/popperjs" "url": "https://opencollective.com/popperjs"
} }
}, },
"node_modules/@threepipe/plugin-tweakpane": {
"resolved": "../tweakpane/src",
"link": true
},
"node_modules/threepipe": { "node_modules/threepipe": {
"resolved": "../../../dist",
"resolved": "../../src",
"link": true "link": true
}, },
"node_modules/tippy.js": { "node_modules/tippy.js": {
"version": "6.3.7", "version": "6.3.7",
"resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz", "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz",
"integrity": "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==", "integrity": "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==",
"dev": true,
"dependencies": { "dependencies": {
"@popperjs/core": "^2.9.0" "@popperjs/core": "^2.9.0"
} }
"@popperjs/core": { "@popperjs/core": {
"version": "2.11.8", "version": "2.11.8",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
"integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A=="
"integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
"dev": true
},
"@threepipe/plugin-tweakpane": {
"version": "file:../tweakpane/src"
}, },
"threepipe": { "threepipe": {
"version": "file:../../../dist"
"version": "file:../../src"
}, },
"tippy.js": { "tippy.js": {
"version": "6.3.7", "version": "6.3.7",
"resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz", "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz",
"integrity": "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==", "integrity": "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==",
"dev": true,
"requires": { "requires": {
"@popperjs/core": "^2.9.0" "@popperjs/core": "^2.9.0"
} }

+ 58
- 0
plugins/tweakpane-editor/package.json Ver arquivo

{
"name": "@threepipe/plugin-tweakpane-editor",
"description": "Tweakpane Editor Plugin for ThreePipe",
"version": "0.1.0",
"devDependencies": {
"tippy.js": "^6.3.7"
},
"dependencies": {
"threepipe": "file:./../../src/",
"@threepipe/plugin-tweakpane": "file:./../tweakpane/src/"
},
"clean-package": {
"remove": [
"clean-package",
"scripts",
"devDependencies",
"//",
"markdown-to-html"
],
"replace": {
"dependencies": {
"threepipe": "^0.0.8-dev.1",
"@threepipe/plugin-tweakpane": "^0.1.0"
}
}
},
"type": "module",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist",
"src"
],
"scripts": {
"prepare": "npm run build",
"build": "rimraf dist && NODE_ENV=production rollup -c",
"dev": "rollup -c -w"
},
"author": "repalash <palash@shaders.app>",
"license": "Apache-2.0",
"keywords": [
"three",
"three.js",
"threepipe",
"tweakpane",
"editor",
"plugin"
],
"bugs": {
"url": "https://github.com/repalash/threepipe/issues"
},
"homepage": "https://github.com/repalash/threepipe#readme",
"repository": {
"type": "git",
"url": "git://github.com/repalash/threepipe.git"
}
}

+ 97
- 0
plugins/tweakpane-editor/rollup.config.mjs Ver arquivo

// rollup.config.js
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import license from 'rollup-plugin-license'
import packageJson from './package.json' assert {type: 'json'};
import path from 'path'
import {fileURLToPath} from 'url';
import postcss from 'rollup-plugin-postcss'
import replace from 'rollup-plugin-replace'
import terser from "@rollup/plugin-terser";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const {name, version, author} = packageJson
// const {main, module, browser} = packageJson["clean-package"].replace
const isProduction = process.env.NODE_ENV === 'production'

const settings = {
globals: {
"threepipe": "threepipe",
"@threepipe/plugin-tweakpane": "@threepipe/plugin-tweakpane"
},
sourcemap: true
}

export default {
input: './src/index.ts',
output: [
// {
// file: main,
// name: main,
// ...settings,
// format: 'cjs',
// plugins: [
// isProduction && terser()
// ]
// },
{
file: './dist/index.mjs',
...settings,
name: name,
format: 'es',
plugins: [
isProduction && terser()
]
},
{
file: './dist/index.js',
...settings,
name: name,
format: 'umd',
plugins: [
isProduction && terser()
]
}
],
external: Object.keys(settings.globals),
plugins: [
replace({
// If you would like DEV messages, specify 'development'
// Otherwise use 'production'
'process.env.NODE_ENV': JSON.stringify('production') // for tippy.js
}),
postcss({
modules: false,
autoModules: true, // todo; issues with typescript import css, because inject is false
inject: false,
minimize: isProduction,
// Or with custom options for `postcss-modules`
}),
json(),
resolve({}),
typescript({
}),
commonjs({
include: 'node_modules/**',
extensions: ['.js'],
ignoreGlobal: false,
sourceMap: false
}),
license({
banner: `
@license
${name} v${version}
Copyright 2022<%= moment().format('YYYY') > 2022 ? '-' + moment().format('YYYY') : null %> ${author}
${packageJson.license} License
`,
thirdParty: {
output: path.join(__dirname, 'dist', 'dependencies.txt'),
includePrivate: true, // Default is false.
},
})
]
}

plugins/ui/tweakpane-editor/src/TweakpaneEditorPlugin.css → plugins/tweakpane-editor/src/TweakpaneEditorPlugin.css Ver arquivo


plugins/ui/tweakpane-editor/src/TweakpaneEditorPlugin.ts → plugins/tweakpane-editor/src/TweakpaneEditorPlugin.ts Ver arquivo

FullScreenPlugin, FullScreenPlugin,
safeSetProperty, safeSetProperty,
ThreeViewer, ThreeViewer,
TweakpaneUiPlugin,
} from 'threepipe' } from 'threepipe'
import {setupFullscreenButton, setupUtilButtonsBar} from './util-buttons' import {setupFullscreenButton, setupUtilButtonsBar} from './util-buttons'
import {setupWebGiLogo} from './logo' import {setupWebGiLogo} from './logo'
import styles from './TweakpaneEditorPlugin.css' import styles from './TweakpaneEditorPlugin.css'
import tippy from 'tippy.js' import tippy from 'tippy.js'
import tippyStyles from 'tippy.js/dist/tippy.css' import tippyStyles from 'tippy.js/dist/tippy.css'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


export class TweakpaneEditorPlugin extends AViewerPluginSync<string> { export class TweakpaneEditorPlugin extends AViewerPluginSync<string> {
public static readonly PluginType: string = 'TweakpaneEditorPlugin' public static readonly PluginType: string = 'TweakpaneEditorPlugin'

plugins/ui/tweakpane-editor/src/global.d.ts → plugins/tweakpane-editor/src/global.d.ts Ver arquivo


plugins/ui/tweakpane-editor/src/icons.ts → plugins/tweakpane-editor/src/icons.ts Ver arquivo


plugins/ui/tweakpane-editor/src/index.ts → plugins/tweakpane-editor/src/index.ts Ver arquivo


plugins/ui/tweakpane-editor/src/logo.ts → plugins/tweakpane-editor/src/logo.ts Ver arquivo


plugins/ui/tweakpane-editor/src/util-buttons.ts → plugins/tweakpane-editor/src/util-buttons.ts Ver arquivo


plugins/ui/tweakpane-editor/tsconfig.json → plugins/tweakpane-editor/tsconfig.json Ver arquivo

"removeComments": false, "removeComments": false,
"preserveConstEnums": true, "preserveConstEnums": true,
"moduleResolution": "node", "moduleResolution": "node",
"emitDecoratorMetadata": true,
"emitDecoratorMetadata": false,
"sourceMap": true, "sourceMap": true,
"paths": {
"threepipe": ["../../../src/"]
},
"target": "ES2020", "target": "ES2020",
"strictNullChecks": true, "strictNullChecks": true,
"lib": [ "lib": [

+ 178
- 0
plugins/tweakpane/package-lock.json Ver arquivo

{
"name": "@threepipe/plugin-tweakpane",
"version": "0.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@threepipe/plugin-tweakpane",
"version": "0.1.0",
"license": "Apache-2.0",
"dependencies": {
"threepipe": "file:./../../src/"
},
"devDependencies": {
"tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz",
"uiconfig-tweakpane": "^0.0.4"
}
},
"../../src": {},
"node_modules/@tweakpane/core": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/@tweakpane/core/-/core-1.1.8.tgz",
"integrity": "sha512-psvBf6Cbm3YSZOTmDFWkcGzHYMnw7gVZM3jw+TfbzErIC+sMXPQb85h4ayW04w2u7AGg8jD0gHXSCg5wd+rafg==",
"dev": true
},
"node_modules/@tweenjs/tween.js": {
"version": "18.6.4",
"resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-18.6.4.tgz",
"integrity": "sha512-lB9lMjuqjtuJrx7/kOkqQBtllspPIN+96OvTCeJ2j5FEzinoAXTdAMFnDAQT1KVPRlnYfBrqxtqP66vDM40xxQ==",
"dev": true
},
"node_modules/@types/stats.js": {
"version": "0.17.0",
"resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.0.tgz",
"integrity": "sha512-9w+a7bR8PeB0dCT/HBULU2fMqf6BAzvKbxFboYhmDtDkKPiyXYbjoe2auwsXlEFI7CFNMF1dCv3dFH5Poy9R1w==",
"dev": true
},
"node_modules/@types/three": {
"version": "0.152.1",
"resolved": "https://registry.npmjs.org/@types/three/-/three-0.152.1.tgz",
"integrity": "sha512-PMOCQnx9JRmq+2OUGTPoY9h1hTWD2L7/nmuW/SyNq1Vbq3Lwt3MNdl3wYSa4DvLTGv62NmIXD9jYdAOwohwJyw==",
"dev": true,
"dependencies": {
"@tweenjs/tween.js": "~18.6.4",
"@types/stats.js": "*",
"@types/webxr": "*",
"fflate": "~0.6.9",
"lil-gui": "~0.17.0"
}
},
"node_modules/@types/webxr": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.2.tgz",
"integrity": "sha512-szL74BnIcok9m7QwYtVmQ+EdIKwbjPANudfuvDrAF8Cljg9MKUlIoc1w5tjj9PMpeSH3U1Xnx//czQybJ0EfSw==",
"dev": true
},
"node_modules/fflate": {
"version": "0.6.10",
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.6.10.tgz",
"integrity": "sha512-IQrh3lEPM93wVCEczc9SaAOvkmcoQn/G8Bo1e8ZPlY3X3bnAxWaBdvTdvM1hP62iZp0BXWDy4vTAy4fF0+Dlpg==",
"dev": true
},
"node_modules/lil-gui": {
"version": "0.17.0",
"resolved": "https://registry.npmjs.org/lil-gui/-/lil-gui-0.17.0.tgz",
"integrity": "sha512-MVBHmgY+uEbmJNApAaPbtvNh1RCAeMnKym82SBjtp5rODTYKWtM+MXHCifLe2H2Ti1HuBGBtK/5SyG4ShQ3pUQ==",
"dev": true
},
"node_modules/threepipe": {
"resolved": "../../src",
"link": true
},
"node_modules/tweakpane-image-plugin": {
"version": "1.1.404",
"resolved": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz",
"integrity": "sha512-CDTSmawGZvvTtGYCy6YKKyR1Rxo96/bVuqJvl2JYMn6n625SI8KTlscdb8VQi09pwz/96RNu9BDzTF3nRTZj1g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@tweakpane/core": "1.1.8"
}
},
"node_modules/uiconfig-tweakpane": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/uiconfig-tweakpane/-/uiconfig-tweakpane-0.0.4.tgz",
"integrity": "sha512-Mo+dVplH4Hlnn5LAjzLH2Ly89/hFWtTtmdq/aIK826IrbSm1qb9MgFAUzSfZhs59kutf/Yo3Y6BKNQ2kagAA1A==",
"dev": true,
"dependencies": {
"@types/three": "^0.152.1",
"uiconfig.js": "^0.0.5"
}
},
"node_modules/uiconfig.js": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/uiconfig.js/-/uiconfig.js-0.0.5.tgz",
"integrity": "sha512-GC+WGWROJzIgwC/w22WOlGRa8UqQMU1/iD8W6WslrhTuvhh8O9tsANMaHyihgomfgybzm9ZY/c7bfvADcbuvyA==",
"dev": true
}
},
"dependencies": {
"@tweakpane/core": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/@tweakpane/core/-/core-1.1.8.tgz",
"integrity": "sha512-psvBf6Cbm3YSZOTmDFWkcGzHYMnw7gVZM3jw+TfbzErIC+sMXPQb85h4ayW04w2u7AGg8jD0gHXSCg5wd+rafg==",
"dev": true
},
"@tweenjs/tween.js": {
"version": "18.6.4",
"resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-18.6.4.tgz",
"integrity": "sha512-lB9lMjuqjtuJrx7/kOkqQBtllspPIN+96OvTCeJ2j5FEzinoAXTdAMFnDAQT1KVPRlnYfBrqxtqP66vDM40xxQ==",
"dev": true
},
"@types/stats.js": {
"version": "0.17.0",
"resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.0.tgz",
"integrity": "sha512-9w+a7bR8PeB0dCT/HBULU2fMqf6BAzvKbxFboYhmDtDkKPiyXYbjoe2auwsXlEFI7CFNMF1dCv3dFH5Poy9R1w==",
"dev": true
},
"@types/three": {
"version": "0.152.1",
"resolved": "https://registry.npmjs.org/@types/three/-/three-0.152.1.tgz",
"integrity": "sha512-PMOCQnx9JRmq+2OUGTPoY9h1hTWD2L7/nmuW/SyNq1Vbq3Lwt3MNdl3wYSa4DvLTGv62NmIXD9jYdAOwohwJyw==",
"dev": true,
"requires": {
"@tweenjs/tween.js": "~18.6.4",
"@types/stats.js": "*",
"@types/webxr": "*",
"fflate": "~0.6.9",
"lil-gui": "~0.17.0"
}
},
"@types/webxr": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.2.tgz",
"integrity": "sha512-szL74BnIcok9m7QwYtVmQ+EdIKwbjPANudfuvDrAF8Cljg9MKUlIoc1w5tjj9PMpeSH3U1Xnx//czQybJ0EfSw==",
"dev": true
},
"fflate": {
"version": "0.6.10",
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.6.10.tgz",
"integrity": "sha512-IQrh3lEPM93wVCEczc9SaAOvkmcoQn/G8Bo1e8ZPlY3X3bnAxWaBdvTdvM1hP62iZp0BXWDy4vTAy4fF0+Dlpg==",
"dev": true
},
"lil-gui": {
"version": "0.17.0",
"resolved": "https://registry.npmjs.org/lil-gui/-/lil-gui-0.17.0.tgz",
"integrity": "sha512-MVBHmgY+uEbmJNApAaPbtvNh1RCAeMnKym82SBjtp5rODTYKWtM+MXHCifLe2H2Ti1HuBGBtK/5SyG4ShQ3pUQ==",
"dev": true
},
"threepipe": {
"version": "file:../../src"
},
"tweakpane-image-plugin": {
"version": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz",
"integrity": "sha512-CDTSmawGZvvTtGYCy6YKKyR1Rxo96/bVuqJvl2JYMn6n625SI8KTlscdb8VQi09pwz/96RNu9BDzTF3nRTZj1g==",
"dev": true,
"requires": {
"@tweakpane/core": "1.1.8"
}
},
"uiconfig-tweakpane": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/uiconfig-tweakpane/-/uiconfig-tweakpane-0.0.4.tgz",
"integrity": "sha512-Mo+dVplH4Hlnn5LAjzLH2Ly89/hFWtTtmdq/aIK826IrbSm1qb9MgFAUzSfZhs59kutf/Yo3Y6BKNQ2kagAA1A==",
"dev": true,
"requires": {
"@types/three": "^0.152.1",
"uiconfig.js": "^0.0.5"
}
},
"uiconfig.js": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/uiconfig.js/-/uiconfig.js-0.0.5.tgz",
"integrity": "sha512-GC+WGWROJzIgwC/w22WOlGRa8UqQMU1/iD8W6WslrhTuvhh8O9tsANMaHyihgomfgybzm9ZY/c7bfvADcbuvyA==",
"dev": true
}
}
}

+ 66
- 0
plugins/tweakpane/package.json Ver arquivo

{
"name": "@threepipe/plugin-tweakpane",
"description": "Tweakpane UI Plugin for ThreePipe",
"version": "0.1.0",
"devDependencies": {
"tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz",
"uiconfig-tweakpane": "^0.0.4"
},
"dependencies": {
"threepipe": "file:./../../src/"
},
"clean-package": {
"remove": [
"clean-package",
"scripts",
"devDependencies",
"//",
"markdown-to-html"
],
"replace": {
"dependencies": {
"threepipe": "^0.0.8-dev.1"
}
}
},
"type": "module",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist",
"src"
],
"scripts": {
"prepare": "npm run build",
"build": "rimraf dist && NODE_ENV=production rollup -c",
"dev": "rollup -c -w"
},
"//": {
"dependencies": {
"tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz",
"uiconfig-tweakpane": "^0.0.4"
},
"local_dependencies": {
"tweakpane-image-plugin": "file:./../tweakpane-image-plugin",
"uiconfig-tweakpane": "^file:./../uiconfig-tweakpane"
}
},
"author": "repalash <palash@shaders.app>",
"license": "Apache-2.0",
"keywords": [
"three",
"three.js",
"tweakpane",
"threepipe",
"plugin"
],
"bugs": {
"url": "https://github.com/repalash/threepipe/issues"
},
"homepage": "https://github.com/repalash/threepipe#readme",
"repository": {
"type": "git",
"url": "git://github.com/repalash/threepipe.git"
}
}

plugins/ui/tweakpane-editor/rollup.config.mjs → plugins/tweakpane/rollup.config.mjs Ver arquivo

const isProduction = process.env.NODE_ENV === 'production' const isProduction = process.env.NODE_ENV === 'production'


const settings = { const settings = {
globals: {},
globals: {
"threepipe": "threepipe"
},
sourcemap: true sourcemap: true
} }


file: './dist/index.mjs', file: './dist/index.mjs',
...settings, ...settings,
name: name, name: name,
format: 'es'
format: 'es',
plugins: [
isProduction && terser()
]
}, },
{ {
file: './dist/index.js', file: './dist/index.js',
] ]
} }
], ],
external: ["threepipe"],
external: Object.keys(settings.globals),
plugins: [ plugins: [
replace({ replace({
// If you would like DEV messages, specify 'development' // If you would like DEV messages, specify 'development'

src/plugins/ui/tweakpane/TweakpaneUiPlugin.ts → plugins/tweakpane/src/TweakpaneUiPlugin.ts Ver arquivo

import {FolderApi} from 'tweakpane' import {FolderApi} from 'tweakpane'
import * as TweakpaneImagePlugin from 'tweakpane-image-plugin' import * as TweakpaneImagePlugin from 'tweakpane-image-plugin'
import {UiConfigRendererTweakpane} from 'uiconfig-tweakpane' import {UiConfigRendererTweakpane} from 'uiconfig-tweakpane'
import {IViewerPlugin, IViewerPluginSync, ThreeViewer} from '../../../viewer'
import {
Class,
Color,
createDiv,
createStyles,
CustomContextMenu,
downloadBlob,
getOrCall,
IEvent,
IViewerPlugin,
IViewerPluginSync,
ThreeViewer,
uploadFile,
Vector2,
Vector3,
Vector4,
} from 'threepipe'
import styles from './tpTheme.css' import styles from './tpTheme.css'
import {Class, createDiv, createStyles, downloadBlob, getOrCall, IEvent, uploadFile} from 'ts-browser-helpers'
import {UiObjectConfig} from 'uiconfig.js' import {UiObjectConfig} from 'uiconfig.js'
import {CustomContextMenu} from '../../../utils'
import {Color, Vector2, Vector3, Vector4} from 'three'
import {tpImageInputGenerator} from './tpImageInputGenerator' import {tpImageInputGenerator} from './tpImageInputGenerator'


export class TweakpaneUiPlugin extends UiConfigRendererTweakpane implements IViewerPluginSync { export class TweakpaneUiPlugin extends UiConfigRendererTweakpane implements IViewerPluginSync {
}) })
} }



private _preRender = () => this.refreshQueue('preRender') private _preRender = () => this.refreshQueue('preRender')
private _postRender = () => this.refreshQueue('postRender') private _postRender = () => this.refreshQueue('postRender')
private _postFrame = (e: IEvent<'postFrame'>) => { private _postFrame = (e: IEvent<'postFrame'>) => {

+ 36
- 0
plugins/tweakpane/src/global.d.ts Ver arquivo

declare module '*.txt' {
const content: string
export default content
}
declare module '*.glsl' {
const content: string
export default content
}
declare module '*.vert' {
const content: string
export default content
}
declare module '*.frag' {
const content: string
export default content
}
declare module '*.module.scss' {
const content: any
export default content
export const stylesheet: string
}
declare module '*.module.css' {
const content: any
export default content
export const stylesheet: string
}
declare module '*.css' {
const content: string
export default content
}

// export {}

// hack for typedoc
// eslint-disable-next-line @typescript-eslint/naming-convention
// declare type OffscreenCanvas = HTMLCanvasElement

+ 1
- 0
plugins/tweakpane/src/index.ts Ver arquivo

export {TweakpaneUiPlugin} from './TweakpaneUiPlugin'

src/plugins/ui/tweakpane/tpImageInputGenerator.ts → plugins/tweakpane/src/tpImageInputGenerator.ts Ver arquivo

import {ThreeViewer} from '../../../viewer'
import type {FolderApi} from 'tweakpane'
import {UiObjectConfig} from 'uiconfig.js'
import {getOrCall, imageBitmapToBase64, makeTextSvg} from 'ts-browser-helpers'
import {generateUUID, textureToDataUrl} from '../../../three'
import {ITexture, upgradeTexture} from '../../../core'
import { import {
CustomContextMenu,
EXRExporter2,
FloatType, FloatType,
generateUUID,
getOrCall,
HalfFloatType, HalfFloatType,
imageBitmapToBase64,
IRenderTarget,
ITexture,
LinearSRGBColorSpace, LinearSRGBColorSpace,
makeTextSvg,
RepeatWrapping, RepeatWrapping,
SRGBColorSpace, SRGBColorSpace,
Texture, Texture,
textureToDataUrl,
ThreeViewer,
upgradeTexture,
WebGLRenderTarget, WebGLRenderTarget,
} from 'three'
import {CustomContextMenu} from '../../../utils'
} from 'threepipe'
import type {FolderApi} from 'tweakpane'
import type {UiObjectConfig} from 'uiconfig.js'
import {TweakpaneUiPlugin} from './TweakpaneUiPlugin' import {TweakpaneUiPlugin} from './TweakpaneUiPlugin'
import {IRenderTarget} from '../../../rendering'
import {EXRExporter2} from '../../../assetmanager'


const staticData = { const staticData = {
placeholderVal: 'placeholder', placeholderVal: 'placeholder',

src/plugins/ui/tweakpane/tpTheme.css → plugins/tweakpane/src/tpTheme.css Ver arquivo


+ 41
- 0
plugins/tweakpane/tsconfig.json Ver arquivo

{
"compilerOptions": {
"baseUrl": "./src",
"rootDir": "./src",
"allowJs": false,
"checkJs": false,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"isolatedModules": true,
"module": "es2020",
"noImplicitAny": true,
"declaration": true,
"declarationMap": true,
"declarationDir": "dist",
"outDir": "dist",
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"removeComments": false,
"preserveConstEnums": true,
"moduleResolution": "node",
"emitDecoratorMetadata": false,
"sourceMap": true,
"target": "ES2020",
"strictNullChecks": true,
"lib": [
"es2020",
"esnext",
"dom"
]
},
"include": [
"./src/**/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts",
"dist"
]
}

+ 0
- 15
plugins/ui/tweakpane-editor/package.json Ver arquivo

{
"name": "tweakpane-editor",
"version": "1.0.0",
"dependencies": {
"tippy.js": "^6.3.7",
"threepipe": "./../../../dist/"
},
"type": "module",
"scripts": {
"build": "rimraf dist && NODE_ENV=production rollup -c",
"dev": "rollup -c -w"
},
"author": "repalash <palash@shaders.app>",
"license": "Apache-2.0"
}

+ 3
- 0
rollup.config.mjs Ver arquivo

file: module, file: module,
...settings, ...settings,
name: name, name: name,
// dir: 'dist', // indicate not create a single-file
// preserveModules: true, // indicate not create a single-file
// preserveModulesRoot: 'src', // optional but useful to create a more plain folder structure
format: 'es' format: 'es'
}, },
{ {

+ 0
- 1
src/plugins/index.ts Ver arquivo



// ui // ui
export {RenderTargetPreviewPlugin} from './ui/RenderTargetPreviewPlugin' export {RenderTargetPreviewPlugin} from './ui/RenderTargetPreviewPlugin'
export {TweakpaneUiPlugin} from './ui/tweakpane/TweakpaneUiPlugin'


// interaction // interaction
export {DropzonePlugin, type DropzonePluginOptions} from './interaction/DropzonePlugin' export {DropzonePlugin, type DropzonePluginOptions} from './interaction/DropzonePlugin'

+ 1
- 1
tsconfig.json Ver arquivo

"plugins": [{ "name": "typescript-plugin-css-modules" }] "plugins": [{ "name": "typescript-plugin-css-modules" }]
}, },
"include": [ "include": [
"src/**/*",
"./src/**/*",
"node_modules/@types/wicg-file-system-access/index.d.ts" "node_modules/@types/wicg-file-system-access/index.d.ts"
], ],
"exclude": [ "exclude": [

Carregando…
Cancelar
Salvar