2026-07-14 09:54:36 +03:00
|
|
|
import '@gromlab/svg-sprites/viewer/element'
|
|
|
|
|
import type { SpriteViewerElement } from '@gromlab/svg-sprites/viewer'
|
2026-07-16 09:14:11 +03:00
|
|
|
import appManifest from './app-icons/.svg-sprite/svg-sprite.manifest.js'
|
|
|
|
|
import { appSpriteUrl, defineAppIconElement } from './app-icons'
|
|
|
|
|
import remoteAppManifest from './remote-app-icons/.svg-sprite/svg-sprite.manifest.js'
|
|
|
|
|
import { defineRemoteAppIconElement, remoteAppSpriteUrl } from './remote-app-icons'
|
2026-07-14 08:34:45 +03:00
|
|
|
import './style.css'
|
|
|
|
|
|
2026-07-16 09:14:11 +03:00
|
|
|
const appCheck = appManifest.icons.find((icon) => icon.name === 'check')
|
|
|
|
|
if (!appCheck || appManifest.spriteUrl !== appSpriteUrl) {
|
2026-07-14 08:34:45 +03:00
|
|
|
throw new Error('Generated Vite facade and manifest disagree.')
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-16 09:14:11 +03:00
|
|
|
const remoteAppCheck = remoteAppManifest.icons.find((icon) => icon.name === 'check')
|
|
|
|
|
if (!remoteAppCheck || remoteAppManifest.spriteUrl !== remoteAppSpriteUrl) {
|
|
|
|
|
throw new Error('Generated remote Vite facade and manifest disagree.')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
defineAppIconElement()
|
|
|
|
|
defineRemoteAppIconElement()
|
2026-07-14 16:11:39 +03:00
|
|
|
|
2026-07-14 08:34:45 +03:00
|
|
|
document.querySelector<HTMLDivElement>('#app')!.innerHTML = `
|
|
|
|
|
<h1>Standalone + Vite</h1>
|
2026-07-16 09:14:11 +03:00
|
|
|
<app-icon
|
2026-07-14 08:34:45 +03:00
|
|
|
data-testid="icon"
|
|
|
|
|
data-app="standalone-vite"
|
2026-07-14 16:11:39 +03:00
|
|
|
icon="check"
|
|
|
|
|
role="img"
|
2026-07-14 08:34:45 +03:00
|
|
|
aria-label="Check icon"
|
2026-07-16 09:14:11 +03:00
|
|
|
></app-icon>
|
|
|
|
|
<remote-app-icon
|
|
|
|
|
data-testid="remote-icon"
|
|
|
|
|
data-app="standalone-vite-remote"
|
|
|
|
|
icon="check"
|
|
|
|
|
role="img"
|
|
|
|
|
aria-label="Remote check icon"
|
|
|
|
|
></remote-app-icon>
|
2026-07-14 09:54:36 +03:00
|
|
|
<gromlab-sprite-viewer></gromlab-sprite-viewer>
|
2026-07-14 08:34:45 +03:00
|
|
|
`
|
2026-07-14 09:54:36 +03:00
|
|
|
|
|
|
|
|
const viewer = document.querySelector<SpriteViewerElement>('gromlab-sprite-viewer')!
|
|
|
|
|
viewer.viewerTitle = 'Standalone Vite Viewer'
|
2026-07-16 09:14:11 +03:00
|
|
|
viewer.sources = [appManifest, remoteAppManifest]
|