Browse Source

add params to TweakpaneUiPlugin.setupPluginUi similar to appendChild. Fix util-button in tweakpane editor in safari, move treejs to devDependencies

master
Palash Bansal 2 years ago
parent
commit
973571833b
No account linked to committer's email address

+ 7
- 5
plugins/tweakpane-editor/package-lock.json View File

{ {
"name": "@threepipe/plugin-tweakpane-editor", "name": "@threepipe/plugin-tweakpane-editor",
"version": "0.1.5",
"version": "0.1.6",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@threepipe/plugin-tweakpane-editor", "name": "@threepipe/plugin-tweakpane-editor",
"version": "0.1.5",
"version": "0.1.6",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@threepipe/plugin-tweakpane": "file:./../tweakpane/src/", "@threepipe/plugin-tweakpane": "file:./../tweakpane/src/",
"threepipe": "file:./../../src/",
"treejs": "git://github.com/repalash/treejs.git#d303016bb74e75725d13e97291ac1d4727985918"
"threepipe": "file:./../../src/"
}, },
"devDependencies": { "devDependencies": {
"tippy.js": "^6.3.7"
"tippy.js": "^6.3.7",
"treejs": "git://github.com/repalash/treejs.git#d303016bb74e75725d13e97291ac1d4727985918"
} }
}, },
"../../src": {}, "../../src": {},
"version": "2.0.0", "version": "2.0.0",
"resolved": "git+ssh://git@github.com/repalash/treejs.git#d303016bb74e75725d13e97291ac1d4727985918", "resolved": "git+ssh://git@github.com/repalash/treejs.git#d303016bb74e75725d13e97291ac1d4727985918",
"integrity": "sha512-HqK9Ow4VF50w9tFiRNe8jJ89Tpjkgwxot2h7r6sd+G+Xnq+IgtW5ml9Aq5CjBw1wYesq3sfxO5ZVQhfA0WV8ww==", "integrity": "sha512-HqK9Ow4VF50w9tFiRNe8jJ89Tpjkgwxot2h7r6sd+G+Xnq+IgtW5ml9Aq5CjBw1wYesq3sfxO5ZVQhfA0WV8ww==",
"dev": true,
"license": "MIT" "license": "MIT"
} }
}, },
"treejs": { "treejs": {
"version": "git+ssh://git@github.com/repalash/treejs.git#d303016bb74e75725d13e97291ac1d4727985918", "version": "git+ssh://git@github.com/repalash/treejs.git#d303016bb74e75725d13e97291ac1d4727985918",
"integrity": "sha512-HqK9Ow4VF50w9tFiRNe8jJ89Tpjkgwxot2h7r6sd+G+Xnq+IgtW5ml9Aq5CjBw1wYesq3sfxO5ZVQhfA0WV8ww==", "integrity": "sha512-HqK9Ow4VF50w9tFiRNe8jJ89Tpjkgwxot2h7r6sd+G+Xnq+IgtW5ml9Aq5CjBw1wYesq3sfxO5ZVQhfA0WV8ww==",
"dev": true,
"from": "treejs@git://github.com/repalash/treejs.git#d303016bb74e75725d13e97291ac1d4727985918" "from": "treejs@git://github.com/repalash/treejs.git#d303016bb74e75725d13e97291ac1d4727985918"
} }
} }

+ 4
- 4
plugins/tweakpane-editor/package.json View File

{ {
"name": "@threepipe/plugin-tweakpane-editor", "name": "@threepipe/plugin-tweakpane-editor",
"description": "Tweakpane Editor Plugin for ThreePipe", "description": "Tweakpane Editor Plugin for ThreePipe",
"version": "0.1.5",
"version": "0.1.6",
"devDependencies": { "devDependencies": {
"tippy.js": "^6.3.7"
"tippy.js": "^6.3.7",
"treejs": "git://github.com/repalash/treejs.git#d303016bb74e75725d13e97291ac1d4727985918"
}, },
"dependencies": { "dependencies": {
"threepipe": "file:./../../src/", "threepipe": "file:./../../src/",
"@threepipe/plugin-tweakpane": "file:./../tweakpane/src/",
"treejs": "git://github.com/repalash/treejs.git#d303016bb74e75725d13e97291ac1d4727985918"
"@threepipe/plugin-tweakpane": "file:./../tweakpane/src/"
}, },
"clean-package": { "clean-package": {
"remove": [ "remove": [

+ 1
- 0
plugins/tweakpane-editor/src/TweakpaneEditorPlugin.css View File

position: relative; position: relative;
width: auto; width: auto;
height: 1.2rem; height: 1.2rem;
aspect-ratio: 1;
} }


.mode-buttons-container{ .mode-buttons-container{

+ 4
- 0
plugins/tweakpane-editor/src/global.d.ts View File

const content: string const content: string
export default content export default content
} }
declare module '*.css?inline' {
const content: string
export default content
}


// export {} // export {}



+ 2
- 2
plugins/tweakpane/package-lock.json View File

{ {
"name": "@threepipe/plugin-tweakpane", "name": "@threepipe/plugin-tweakpane",
"version": "0.1.5",
"version": "0.1.6",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@threepipe/plugin-tweakpane", "name": "@threepipe/plugin-tweakpane",
"version": "0.1.5",
"version": "0.1.6",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"threepipe": "file:./../../src/" "threepipe": "file:./../../src/"

+ 1
- 1
plugins/tweakpane/package.json View File

{ {
"name": "@threepipe/plugin-tweakpane", "name": "@threepipe/plugin-tweakpane",
"description": "Tweakpane UI Plugin for ThreePipe", "description": "Tweakpane UI Plugin for ThreePipe",
"version": "0.1.5",
"version": "0.1.6",
"devDependencies": { "devDependencies": {
"tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz", "tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz",
"uiconfig-tweakpane": "^0.0.8" "uiconfig-tweakpane": "^0.0.8"

+ 2
- 2
plugins/tweakpane/src/TweakpaneUiPlugin.ts View File

plugins.forEach(plugin => this.setupPluginUi(plugin)) plugins.forEach(plugin => this.setupPluginUi(plugin))
} }


setupPluginUi<T extends IViewerPlugin>(plugin: T|Class<T>): UiObjectConfig | undefined {
setupPluginUi<T extends IViewerPlugin>(plugin: T|Class<T>, params?: Partial<UiObjectConfig>): UiObjectConfig | undefined {
const p = (<Class<IViewerPlugin>>plugin).prototype ? this._viewer?.getPlugin<T>(<Class<T>>plugin) : <T>plugin const p = (<Class<IViewerPlugin>>plugin).prototype ? this._viewer?.getPlugin<T>(<Class<T>>plugin) : <T>plugin
if (!p) { if (!p) {
console.warn('plugin not found:', plugin) console.warn('plugin not found:', plugin)
this._plugins.push(p) this._plugins.push(p)
if (p.uiConfig && p.uiConfig.hidden === undefined) p.uiConfig.hidden = false // todo; this is a hack for now if (p.uiConfig && p.uiConfig.hidden === undefined) p.uiConfig.hidden = false // todo; this is a hack for now
const ui = p.uiConfig const ui = p.uiConfig
this.appendChild(ui)
this.appendChild(ui, params)
this._setupPluginSerializationContext(ui, p) this._setupPluginSerializationContext(ui, p)
return ui return ui
} }

+ 4
- 0
plugins/tweakpane/src/global.d.ts View File

const content: string const content: string
export default content export default content
} }
declare module '*.css?inline' {
const content: string
export default content
}


// export {} // export {}



Loading…
Cancel
Save