12345678910111213141516171819202122232425262728293031323334353637 |
- import { initialSDK as initialSDKRaw, sdk } from './sdk'
- import { setupAssociation } from './association'
- //import * as GaussianSplats3D from '@/assets//lib/gaussian/gaussian-splats-3d.module.js'
- const presetViewElement = (layout: HTMLDivElement) => {
- const style = getComputedStyle(layout)
- const allows = ['relative', 'absolute', 'fixed']
- if (!allows.includes(style.position)) {
- layout.style.position = 'relative'
- }
- const el = document.createElement('div')
- el.style.cssText = `
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- pointer-events: none;
- z-index:101
- `
- layout.appendChild(el)
- return el
- }
- export const initialSDK: typeof initialSDKRaw = async (props) => {
- const sdk = await initialSDKRaw(props, GaussianSplats3D)
- setupAssociation(presetViewElement(props.layout), sdk)
- return sdk
- }
- export * from './association'
- export * from './sdk'
- export default sdk
|