mirror of
https://github.com/gromlab-ru/svg-sprites.git
synced 2026-07-22 04:40:17 +03:00
feat: добавить серверную генерацию спрайтов
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
<script setup>
|
||||
import { IconsIcon } from '../src/sprite/index.js'
|
||||
import { AppIcon } from '../src/app-icons/index.js'
|
||||
import { RemoteAppIcon } from '../src/remote-app-icons/index.js'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main>
|
||||
<h1>Nuxt + Webpack</h1>
|
||||
<IconsIcon
|
||||
<AppIcon
|
||||
data-testid="icon"
|
||||
data-app="nuxt-webpack"
|
||||
icon="check"
|
||||
@@ -14,6 +15,15 @@ import { IconsIcon } from '../src/sprite/index.js'
|
||||
height="64"
|
||||
style="--icon-color-1: #16a34a"
|
||||
/>
|
||||
<RemoteAppIcon
|
||||
data-testid="remote-icon"
|
||||
data-app="nuxt-webpack-remote"
|
||||
icon="check"
|
||||
aria-label="Remote check icon"
|
||||
width="64"
|
||||
height="64"
|
||||
style="--icon-color-1: #16a34a"
|
||||
/>
|
||||
<SpriteViewer />
|
||||
</main>
|
||||
</template>
|
||||
|
||||
@@ -4,7 +4,8 @@ import { defineSpriteViewerElement } from '@gromlab/svg-sprites/viewer'
|
||||
defineSpriteViewerElement()
|
||||
|
||||
const viewerSources = [
|
||||
() => import('../../src/sprite/.svg-sprite/svg-sprite.manifest.js'),
|
||||
() => import('../../src/app-icons/.svg-sprite/svg-sprite.manifest.js'),
|
||||
() => import('../../src/remote-app-icons/.svg-sprite/svg-sprite.manifest.js'),
|
||||
]
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,15 +1,30 @@
|
||||
import { IconsIcon } from '../src/sprite/.svg-sprite/index.js'
|
||||
import type { IconsIconName, IconsIconProps } from '../src/sprite/.svg-sprite/index.js'
|
||||
import { AppIcon } from '../src/app-icons/.svg-sprite/index.js'
|
||||
import type { AppIconName, AppIconProps } from '../src/app-icons/.svg-sprite/index.js'
|
||||
import { RemoteAppIcon } from '../src/remote-app-icons/.svg-sprite/index.js'
|
||||
import type {
|
||||
RemoteAppIconName,
|
||||
RemoteAppIconProps,
|
||||
} from '../src/remote-app-icons/.svg-sprite/index.js'
|
||||
|
||||
const iconName: IconsIconName = 'check'
|
||||
const iconProps: IconsIconProps = {
|
||||
const iconName: AppIconName = 'check'
|
||||
const iconProps: AppIconProps = {
|
||||
icon: iconName,
|
||||
width: 64,
|
||||
style: { '--icon-color-1': '#16a34a' },
|
||||
}
|
||||
const remoteIconName: RemoteAppIconName = 'check'
|
||||
const remoteIconProps: RemoteAppIconProps = {
|
||||
icon: remoteIconName,
|
||||
width: 64,
|
||||
style: { '--icon-color-1': '#16a34a' },
|
||||
}
|
||||
|
||||
void [IconsIcon, iconProps]
|
||||
void [AppIcon, RemoteAppIcon, iconProps, remoteIconProps]
|
||||
|
||||
// @ts-expect-error Generated icon names form a literal union.
|
||||
const missingIcon: IconsIconName = 'missing'
|
||||
const missingIcon: AppIconName = 'missing'
|
||||
void missingIcon
|
||||
|
||||
// @ts-expect-error Generated remote icon names form a literal union.
|
||||
const missingRemoteIcon: RemoteAppIconName = 'missing'
|
||||
void missingRemoteIcon
|
||||
|
||||
Reference in New Issue
Block a user