|
|
|
|
@ -14,6 +14,57 @@ import { compileMorfo } from '../src/uix/morfo/compile'
|
|
|
|
|
import { lintEidosCss } from '../src/uix/eidos/lint'
|
|
|
|
|
import type { Morfo } from '../src/uix/morfo/types'
|
|
|
|
|
|
|
|
|
|
const EIDOS_ONLY_ATTRS = new Set([
|
|
|
|
|
'data-archetype',
|
|
|
|
|
'data-block',
|
|
|
|
|
'data-collapsed',
|
|
|
|
|
'data-color',
|
|
|
|
|
'data-columns',
|
|
|
|
|
'data-dragging',
|
|
|
|
|
'data-event',
|
|
|
|
|
'data-event-family',
|
|
|
|
|
'data-event-id',
|
|
|
|
|
'data-event-intent',
|
|
|
|
|
'data-event-phase',
|
|
|
|
|
'data-fitted',
|
|
|
|
|
'data-icon-only',
|
|
|
|
|
'data-indicator-placement',
|
|
|
|
|
'data-motion',
|
|
|
|
|
'data-motion-disabled',
|
|
|
|
|
'data-position',
|
|
|
|
|
'data-ready',
|
|
|
|
|
'data-scrollable',
|
|
|
|
|
'data-sheet',
|
|
|
|
|
'data-size',
|
|
|
|
|
'data-soma-floating-wrapper',
|
|
|
|
|
'data-svg',
|
|
|
|
|
'data-svg-direction',
|
|
|
|
|
'data-variant'
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
const RUNTIME_SIGNAL_ATTRS = new Set([
|
|
|
|
|
'data-disabled',
|
|
|
|
|
'data-invalid',
|
|
|
|
|
'data-last-action',
|
|
|
|
|
'data-orientation',
|
|
|
|
|
'data-readonly',
|
|
|
|
|
'data-side',
|
|
|
|
|
'data-state'
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
const EIDOS_ONLY_PART_SUFFIXES = [
|
|
|
|
|
'flat',
|
|
|
|
|
'footer',
|
|
|
|
|
'handle',
|
|
|
|
|
'header',
|
|
|
|
|
'indicator',
|
|
|
|
|
'label',
|
|
|
|
|
'main',
|
|
|
|
|
'row',
|
|
|
|
|
'row-label',
|
|
|
|
|
'status'
|
|
|
|
|
] as const
|
|
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
|
const eidosDir = resolve('src/uix/eidos/components')
|
|
|
|
|
const cssFiles = readdirSync(eidosDir, { withFileTypes: true }).flatMap((entry) => {
|
|
|
|
|
@ -96,24 +147,18 @@ async function main() {
|
|
|
|
|
for (const r of h.invalid) console.log(` ✗ ${r}`)
|
|
|
|
|
for (const r of h.eidosOnly) console.log(` · ${r}`)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
console.log('\nNo drift hotspots beyond documented Eidos-only attrs/parts.')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (totalInvalid > 0) process.exit(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function isAllowedEidosOnlyAttr(attr: string): boolean {
|
|
|
|
|
return (
|
|
|
|
|
attr === 'data-event' ||
|
|
|
|
|
attr === 'data-event-id' ||
|
|
|
|
|
attr === 'data-event-phase' ||
|
|
|
|
|
attr === 'data-event-family' ||
|
|
|
|
|
attr === 'data-event-intent' ||
|
|
|
|
|
attr === 'data-archetype' ||
|
|
|
|
|
attr.endsWith('-color') ||
|
|
|
|
|
attr.endsWith('-size') ||
|
|
|
|
|
attr.endsWith('-variant') ||
|
|
|
|
|
attr.endsWith('-position') ||
|
|
|
|
|
attr.endsWith('-block') ||
|
|
|
|
|
attr.endsWith('-icon-only')
|
|
|
|
|
)
|
|
|
|
|
if (EIDOS_ONLY_ATTRS.has(attr)) return true
|
|
|
|
|
if (RUNTIME_SIGNAL_ATTRS.has(attr)) return true
|
|
|
|
|
|
|
|
|
|
return EIDOS_ONLY_PART_SUFFIXES.some((suffix) => attr.endsWith(`-${suffix}`))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
main().catch((err) => {
|
|
|
|
|
|