Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@markuplint/ml-spec

Package Overview
Dependencies
Maintainers
1
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@markuplint/ml-spec - npm Package Compare versions

Comparing version 3.0.0-alpha.82 to 3.0.0-rc.0

lib/dom-traverse/get-computed-aria-props.d.ts

38

lib/dom-traverse/get-computed-role.js

@@ -5,3 +5,2 @@ "use strict";

const aria_specs_1 = require("../specs/aria-specs");
const get_selectors_by_content_model_category_1 = require("../specs/get-selectors-by-content-model-category");
const is_presentational_1 = require("../specs/is-presentational");

@@ -13,2 +12,3 @@ const get_attr_specs_1 = require("./get-attr-specs");

const has_required_owned_elements_1 = require("./has-required-owned-elements");
const may_be_focusable_1 = require("./may-be-focusable");
function getComputedRole(specs, el, version) {

@@ -77,34 +77,22 @@ var _a, _b, _c, _d;

/**
* Interactive element
* If interactive element
*
* 1. It may be focusable
*
* THIS CONDITION IS ALMOST MEANINGLESS.
* Because it has already been determined that
* the interactive elements can not specify the presentational role
* in the previous processing that computes the permitted role (`getExplicitRole`).
*/
[
(0, may_be_focusable_1.mayBeFocusable)(el, specs) &&
/**
* Interactive content
*
* THIS CONDITION(SELECTORS) IS ALMOST MEANINGLESS.
* Because it has already been determined that
* the interactive elements can not specify the presentational role
* in the previous processing that computes the permitted role (`getExplicitRole`).
*
* @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content
* 2. No disabled
*/
...(0, get_selectors_by_content_model_category_1.getSelectorsByContentModelCategory)(specs, '#interactive'),
/**
* Interaction
*
* @see https://html.spec.whatwg.org/multipage/interaction.html
*/
'[tabindex]',
'[contenteditable]:not([contenteditable="false" i])',
].some(selector => el.matches(selector)) &&
/**
* No disabled
*/
!someAncestors(el, p => isEnabledAttr(p, specs, 'disabled')) &&
/**
* No inert
* 3. No inert
*/
!someAncestors(el, p => isEnabledAttr(p, specs, 'inert')) &&
/**
* No hidden
* 4. No hidden
*/

@@ -111,0 +99,0 @@ !someAncestors(el, p => isEnabledAttr(p, specs, 'hidden'))) {

@@ -1,2 +0,2 @@

import type { MLMLSpec } from '../types';
export declare function getSpec(el: Element, schema: MLMLSpec): import("../types").ElementSpec | null;
import type { ElementSpec } from '../types';
export declare function getSpec<K extends keyof ElementSpec>(el: Element, specs: Pick<ElementSpec, 'name' | K>[]): Pick<ElementSpec, "name" | K> | null;

@@ -5,5 +5,5 @@ "use strict";

const get_spec_by_tag_name_1 = require("../specs/get-spec-by-tag-name");
function getSpec(el, schema) {
return (0, get_spec_by_tag_name_1.getSpecByTagName)(schema, el.localName, el.namespaceURI);
function getSpec(el, specs) {
return (0, get_spec_by_tag_name_1.getSpecByTagName)(specs, el.localName, el.namespaceURI);
}
exports.getSpec = getSpec;

@@ -9,2 +9,14 @@ "use strict";

function hasRequiredOwnedElement(el, specs, version) {
/**
* The element has aria-owns which means it may have owned elements.
*
* THIS CONDITION IS PARTIAL SUPPORT.
*/
if (el.hasAttribute('aria-owns')) {
// FIXME
return true;
}
/**
* Otherwise, traverses descendants to find owned elements.
*/
const computed = (0, get_computed_role_1.getComputedRole)(specs, el, version);

@@ -11,0 +23,0 @@ if (!computed.role || computed.role.requiredOwnedElements.length === 0) {

export * from './dom-traverse/accname-computation';
export * from './dom-traverse/get-attr-specs';
export * from './dom-traverse/get-computed-aria-props';
export * from './dom-traverse/get-computed-role';
export * from './dom-traverse/get-content-model';
export * from './dom-traverse/get-implicit-role';

@@ -8,2 +10,4 @@ export * from './dom-traverse/get-permitted-roles';

export * from './dom-traverse/has-required-owned-elements';
export * from './dom-traverse/is-exposed';
export * from './dom-traverse/may-be-focusable';
export * from './specs/aria-specs';

@@ -13,2 +17,4 @@ export * from './specs/content-model-category-to-tag-names';

export * from './specs/get-spec-by-tag-name';
export * from './specs/is-palpable-elements';
export * from './specs/is-void-element';
export * from './specs/schema-to-spec';

@@ -18,3 +24,3 @@ export * from './types';

export * from './types/attributes';
export * from './types/permitted-structres';
export * from './types/permitted-structures';
export * from './utils/resolve-namespace';

@@ -6,3 +6,5 @@ "use strict";

tslib_1.__exportStar(require("./dom-traverse/get-attr-specs"), exports);
tslib_1.__exportStar(require("./dom-traverse/get-computed-aria-props"), exports);
tslib_1.__exportStar(require("./dom-traverse/get-computed-role"), exports);
tslib_1.__exportStar(require("./dom-traverse/get-content-model"), exports);
tslib_1.__exportStar(require("./dom-traverse/get-implicit-role"), exports);

@@ -12,2 +14,4 @@ tslib_1.__exportStar(require("./dom-traverse/get-permitted-roles"), exports);

tslib_1.__exportStar(require("./dom-traverse/has-required-owned-elements"), exports);
tslib_1.__exportStar(require("./dom-traverse/is-exposed"), exports);
tslib_1.__exportStar(require("./dom-traverse/may-be-focusable"), exports);
tslib_1.__exportStar(require("./specs/aria-specs"), exports);

@@ -17,2 +21,4 @@ tslib_1.__exportStar(require("./specs/content-model-category-to-tag-names"), exports);

tslib_1.__exportStar(require("./specs/get-spec-by-tag-name"), exports);
tslib_1.__exportStar(require("./specs/is-palpable-elements"), exports);
tslib_1.__exportStar(require("./specs/is-void-element"), exports);
tslib_1.__exportStar(require("./specs/schema-to-spec"), exports);

@@ -22,3 +28,3 @@ tslib_1.__exportStar(require("./types"), exports);

tslib_1.__exportStar(require("./types/attributes"), exports);
tslib_1.__exportStar(require("./types/permitted-structres"), exports);
tslib_1.__exportStar(require("./types/permitted-structures"), exports);
tslib_1.__exportStar(require("./utils/resolve-namespace"), exports);
import type { MLMLSpec } from '../types';
import type { Category } from '../types/permitted-structres';
export declare function contentModelCategoryToTagNames(contentModel: Category, specs: MLMLSpec): ReadonlyArray<string>;
import type { Category } from '../types/permitted-structures';
export declare function contentModelCategoryToTagNames(contentModel: Category, def: MLMLSpec['def']): ReadonlyArray<string>;

@@ -5,3 +5,3 @@ "use strict";

const cache = new Map();
function contentModelCategoryToTagNames(contentModel, specs) {
function contentModelCategoryToTagNames(contentModel, def) {
const cached = cache.get(contentModel);

@@ -11,3 +11,3 @@ if (cached) {

}
const tags = specs.def['#contentModels'][contentModel];
const tags = def['#contentModels'][contentModel];
const sortedTag = Object.freeze(tags && Array.isArray(tags) ? tags.sort() : []);

@@ -14,0 +14,0 @@ cache.set(contentModel, sortedTag);

@@ -17,5 +17,5 @@ "use strict";

}
const conds = Object.keys(conditions);
const conditionKeys = Object.keys(conditions);
let { implicitRole, permittedRoles, implicitProperties, properties, namingProhibited } = aria;
for (const cond of conds) {
for (const cond of conditionKeys) {
if (!matches(cond)) {

@@ -47,3 +47,3 @@ continue;

}
const spec = (_a = (0, get_spec_by_tag_name_1.getSpecByTagName)(specs, localName, namespace)) === null || _a === void 0 ? void 0 : _a.aria;
const spec = (_a = (0, get_spec_by_tag_name_1.getSpecByTagName)(specs.specs, localName, namespace)) === null || _a === void 0 ? void 0 : _a.aria;
if (!spec) {

@@ -50,0 +50,0 @@ cache.set(key, null);

import type { MLMLSpec, Attribute } from '../types';
import type { NamespaceURI } from '@markuplint/ml-ast';
export declare function getAttrSpecs(localName: string, namespace: NamespaceURI | null, schema: MLMLSpec): Attribute[] | null;
declare type HasName = {
type HasName = {
name: string;

@@ -6,0 +6,0 @@ };

import type { MLMLSpec } from '../types';
import type { Category } from '../types/permitted-structres';
import type { Category } from '../types/permitted-structures';
export declare function getSelectorsByContentModelCategory(specs: Readonly<MLMLSpec>, category: Category): ReadonlyArray<string>;

@@ -1,2 +0,2 @@

import type { ElementSpec, MLMLSpec } from '../types';
export declare function getSpecByTagName(specs: Readonly<MLMLSpec>, localName: string, namespace: string | null): ElementSpec | null;
import type { ElementSpec } from '../types';
export declare function getSpecByTagName<K extends keyof ElementSpec = keyof ElementSpec>(specs: Readonly<Pick<ElementSpec, 'name' | K>[]>, localName: string, namespace: string | null): Pick<ElementSpec, "name" | K> | null;

@@ -12,3 +12,3 @@ "use strict";

}
spec = specs.specs.find(spec => spec.name === localNameWithNS) || null;
spec = specs.find(spec => spec.name === localNameWithNS) || null;
cache.set(localNameWithNS, spec);

@@ -15,0 +15,0 @@ return spec;

@@ -5,3 +5,3 @@ import type { ElementSpec, ExtendedSpec, MLMLSpec } from '../types';

*
* Ex: `@markuplint/html-spec` + `{ specs: ["@markuplint/vue-spec"] }` in cofigure files.
* Ex: `@markuplint/html-spec` + `{ specs: ["@markuplint/vue-spec"] }` in configure files.
*

@@ -8,0 +8,0 @@ * @param schemas `MLDocument.schemas`

@@ -8,3 +8,3 @@ "use strict";

*
* Ex: `@markuplint/html-spec` + `{ specs: ["@markuplint/vue-spec"] }` in cofigure files.
* Ex: `@markuplint/html-spec` + `{ specs: ["@markuplint/vue-spec"] }` in configure files.
*

@@ -11,0 +11,0 @@ * @param schemas `MLDocument.schemas`

@@ -9,7 +9,7 @@ /**

*/
export declare type ImplicitRole = false | string;
export type ImplicitRole = false | string;
/**
* If `true`, this mean is "Any". If `false`, this mean is "No".
*/
export declare type PermittedRoles = boolean | (string | {
export type PermittedRoles = boolean | (string | {
name: string;

@@ -26,3 +26,3 @@ deprecated?: true;

*/
export declare type PermittedARIAProperties = false | {
export type PermittedARIAProperties = false | {
global?: true;

@@ -33,2 +33,5 @@ /**

role?: true | string | [string, ...string[]];
/**
* @minItems 1
*/
only?: [

@@ -44,3 +47,6 @@ (string | {

];
whithout?: [
/**
* @minItems 1
*/
without?: [
{

@@ -47,0 +53,0 @@ type: 'not-recommended' | 'should-not' | 'must-not';

@@ -6,41 +6,4 @@ /**

*/
export declare type AttributeType = (("<'--*'>" | "<'-ms-accelerator'>" | "<'-ms-block-progression'>" | "<'-ms-content-zoom-chaining'>" | "<'-ms-content-zooming'>" | "<'-ms-content-zoom-limit'>" | "<'-ms-content-zoom-limit-max'>" | "<'-ms-content-zoom-limit-min'>" | "<'-ms-content-zoom-snap'>" | "<'-ms-content-zoom-snap-points'>" | "<'-ms-content-zoom-snap-type'>" | "<'-ms-filter'>" | "<'-ms-flow-from'>" | "<'-ms-flow-into'>" | "<'-ms-grid-columns'>" | "<'-ms-grid-rows'>" | "<'-ms-high-contrast-adjust'>" | "<'-ms-hyphenate-limit-chars'>" | "<'-ms-hyphenate-limit-lines'>" | "<'-ms-hyphenate-limit-zone'>" | "<'-ms-ime-align'>" | "<'-ms-overflow-style'>" | "<'-ms-scrollbar-3dlight-color'>" | "<'-ms-scrollbar-arrow-color'>" | "<'-ms-scrollbar-base-color'>" | "<'-ms-scrollbar-darkshadow-color'>" | "<'-ms-scrollbar-face-color'>" | "<'-ms-scrollbar-highlight-color'>" | "<'-ms-scrollbar-shadow-color'>" | "<'-ms-scrollbar-track-color'>" | "<'-ms-scroll-chaining'>" | "<'-ms-scroll-limit'>" | "<'-ms-scroll-limit-x-max'>" | "<'-ms-scroll-limit-x-min'>" | "<'-ms-scroll-limit-y-max'>" | "<'-ms-scroll-limit-y-min'>" | "<'-ms-scroll-rails'>" | "<'-ms-scroll-snap-points-x'>" | "<'-ms-scroll-snap-points-y'>" | "<'-ms-scroll-snap-type'>" | "<'-ms-scroll-snap-x'>" | "<'-ms-scroll-snap-y'>" | "<'-ms-scroll-translation'>" | "<'-ms-text-autospace'>" | "<'-ms-touch-select'>" | "<'-ms-user-select'>" | "<'-ms-wrap-flow'>" | "<'-ms-wrap-margin'>" | "<'-ms-wrap-through'>" | "<'-moz-appearance'>" | "<'-moz-binding'>" | "<'-moz-border-bottom-colors'>" | "<'-moz-border-left-colors'>" | "<'-moz-border-right-colors'>" | "<'-moz-border-top-colors'>" | "<'-moz-context-properties'>" | "<'-moz-float-edge'>" | "<'-moz-force-broken-image-icon'>" | "<'-moz-image-region'>" | "<'-moz-orient'>" | "<'-moz-outline-radius'>" | "<'-moz-outline-radius-bottomleft'>" | "<'-moz-outline-radius-bottomright'>" | "<'-moz-outline-radius-topleft'>" | "<'-moz-outline-radius-topright'>" | "<'-moz-stack-sizing'>" | "<'-moz-text-blink'>" | "<'-moz-user-focus'>" | "<'-moz-user-input'>" | "<'-moz-user-modify'>" | "<'-moz-window-dragging'>" | "<'-moz-window-shadow'>" | "<'-webkit-appearance'>" | "<'-webkit-border-before'>" | "<'-webkit-border-before-color'>" | "<'-webkit-border-before-style'>" | "<'-webkit-border-before-width'>" | "<'-webkit-box-reflect'>" | "<'-webkit-line-clamp'>" | "<'-webkit-mask'>" | "<'-webkit-mask-attachment'>" | "<'-webkit-mask-clip'>" | "<'-webkit-mask-composite'>" | "<'-webkit-mask-image'>" | "<'-webkit-mask-origin'>" | "<'-webkit-mask-position'>" | "<'-webkit-mask-position-x'>" | "<'-webkit-mask-position-y'>" | "<'-webkit-mask-repeat'>" | "<'-webkit-mask-repeat-x'>" | "<'-webkit-mask-repeat-y'>" | "<'-webkit-mask-size'>" | "<'-webkit-overflow-scrolling'>" | "<'-webkit-tap-highlight-color'>" | "<'-webkit-text-fill-color'>" | "<'-webkit-text-stroke'>" | "<'-webkit-text-stroke-color'>" | "<'-webkit-text-stroke-width'>" | "<'-webkit-touch-callout'>" | "<'-webkit-user-modify'>" | "<'align-content'>" | "<'align-items'>" | "<'align-self'>" | "<'align-tracks'>" | "<'all'>" | "<'animation'>" | "<'animation-delay'>" | "<'animation-direction'>" | "<'animation-duration'>" | "<'animation-fill-mode'>" | "<'animation-iteration-count'>" | "<'animation-name'>" | "<'animation-play-state'>" | "<'animation-timing-function'>" | "<'appearance'>" | "<'aspect-ratio'>" | "<'azimuth'>" | "<'backdrop-filter'>" | "<'backface-visibility'>" | "<'background'>" | "<'background-attachment'>" | "<'background-blend-mode'>" | "<'background-clip'>" | "<'background-color'>" | "<'background-image'>" | "<'background-origin'>" | "<'background-position'>" | "<'background-position-x'>" | "<'background-position-y'>" | "<'background-repeat'>" | "<'background-size'>" | "<'block-overflow'>" | "<'block-size'>" | "<'border'>" | "<'border-block'>" | "<'border-block-color'>" | "<'border-block-style'>" | "<'border-block-width'>" | "<'border-block-end'>" | "<'border-block-end-color'>" | "<'border-block-end-style'>" | "<'border-block-end-width'>" | "<'border-block-start'>" | "<'border-block-start-color'>" | "<'border-block-start-style'>" | "<'border-block-start-width'>" | "<'border-bottom'>" | "<'border-bottom-color'>" | "<'border-bottom-left-radius'>" | "<'border-bottom-right-radius'>" | "<'border-bottom-style'>" | "<'border-bottom-width'>" | "<'border-collapse'>" | "<'border-color'>" | "<'border-end-end-radius'>" | "<'border-end-start-radius'>" | "<'border-image'>" | "<'border-image-outset'>" | "<'border-image-repeat'>" | "<'border-image-slice'>" | "<'border-image-source'>" | "<'border-image-width'>" | "<'border-inline'>" | "<'border-inline-end'>" | "<'border-inline-color'>" | "<'border-inline-style'>" | "<'border-inline-width'>" | "<'border-inline-end-color'>" | "<'border-inline-end-style'>" | "<'border-inline-end-width'>" | "<'border-inline-start'>" | "<'border-inline-start-color'>" | "<'border-inline-start-style'>" | "<'border-inline-start-width'>" | "<'border-left'>" | "<'border-left-color'>" | "<'border-left-style'>" | "<'border-left-width'>" | "<'border-radius'>" | "<'border-right'>" | "<'border-right-color'>" | "<'border-right-style'>" | "<'border-right-width'>" | "<'border-spacing'>" | "<'border-start-end-radius'>" | "<'border-start-start-radius'>" | "<'border-style'>" | "<'border-top'>" | "<'border-top-color'>" | "<'border-top-left-radius'>" | "<'border-top-right-radius'>" | "<'border-top-style'>" | "<'border-top-width'>" | "<'border-width'>" | "<'bottom'>" | "<'box-align'>" | "<'box-decoration-break'>" | "<'box-direction'>" | "<'box-flex'>" | "<'box-flex-group'>" | "<'box-lines'>" | "<'box-ordinal-group'>" | "<'box-orient'>" | "<'box-pack'>" | "<'box-shadow'>" | "<'box-sizing'>" | "<'break-after'>" | "<'break-before'>" | "<'break-inside'>" | "<'caption-side'>" | "<'caret-color'>" | "<'clear'>" | "<'clip'>" | "<'clip-path'>" | "<'color'>" | "<'color-adjust'>" | "<'column-count'>" | "<'column-fill'>" | "<'column-gap'>" | "<'column-rule'>" | "<'column-rule-color'>" | "<'column-rule-style'>" | "<'column-rule-width'>" | "<'column-span'>" | "<'column-width'>" | "<'columns'>" | "<'contain'>" | "<'content'>" | "<'counter-increment'>" | "<'counter-reset'>" | "<'counter-set'>" | "<'cursor'>" | "<'direction'>" | "<'display'>" | "<'empty-cells'>" | "<'filter'>" | "<'flex'>" | "<'flex-basis'>" | "<'flex-direction'>" | "<'flex-flow'>" | "<'flex-grow'>" | "<'flex-shrink'>" | "<'flex-wrap'>" | "<'float'>" | "<'font'>" | "<'font-family'>" | "<'font-feature-settings'>" | "<'font-kerning'>" | "<'font-language-override'>" | "<'font-optical-sizing'>" | "<'font-variation-settings'>" | "<'font-size'>" | "<'font-size-adjust'>" | "<'font-smooth'>" | "<'font-stretch'>" | "<'font-style'>" | "<'font-synthesis'>" | "<'font-variant'>" | "<'font-variant-alternates'>" | "<'font-variant-caps'>" | "<'font-variant-east-asian'>" | "<'font-variant-ligatures'>" | "<'font-variant-numeric'>" | "<'font-variant-position'>" | "<'font-weight'>" | "<'gap'>" | "<'grid'>" | "<'grid-area'>" | "<'grid-auto-columns'>" | "<'grid-auto-flow'>" | "<'grid-auto-rows'>" | "<'grid-column'>" | "<'grid-column-end'>" | "<'grid-column-gap'>" | "<'grid-column-start'>" | "<'grid-gap'>" | "<'grid-row'>" | "<'grid-row-end'>" | "<'grid-row-gap'>" | "<'grid-row-start'>" | "<'grid-template'>" | "<'grid-template-areas'>" | "<'grid-template-columns'>" | "<'grid-template-rows'>" | "<'hanging-punctuation'>" | "<'height'>" | "<'hyphens'>" | "<'image-orientation'>" | "<'image-rendering'>" | "<'image-resolution'>" | "<'ime-mode'>" | "<'initial-letter'>" | "<'initial-letter-align'>" | "<'inline-size'>" | "<'inset'>" | "<'inset-block'>" | "<'inset-block-end'>" | "<'inset-block-start'>" | "<'inset-inline'>" | "<'inset-inline-end'>" | "<'inset-inline-start'>" | "<'isolation'>" | "<'justify-content'>" | "<'justify-items'>" | "<'justify-self'>" | "<'justify-tracks'>" | "<'left'>" | "<'letter-spacing'>" | "<'line-break'>" | "<'line-clamp'>" | "<'line-height'>" | "<'line-height-step'>" | "<'list-style'>" | "<'list-style-image'>" | "<'list-style-position'>" | "<'list-style-type'>" | "<'margin'>" | "<'margin-block'>" | "<'margin-block-end'>" | "<'margin-block-start'>" | "<'margin-bottom'>" | "<'margin-inline'>" | "<'margin-inline-end'>" | "<'margin-inline-start'>" | "<'margin-left'>" | "<'margin-right'>" | "<'margin-top'>" | "<'margin-trim'>" | "<'mask'>" | "<'mask-border'>" | "<'mask-border-mode'>" | "<'mask-border-outset'>" | "<'mask-border-repeat'>" | "<'mask-border-slice'>" | "<'mask-border-source'>" | "<'mask-border-width'>" | "<'mask-clip'>" | "<'mask-composite'>" | "<'mask-image'>" | "<'mask-mode'>" | "<'mask-origin'>" | "<'mask-position'>" | "<'mask-repeat'>" | "<'mask-size'>" | "<'mask-type'>" | "<'masonry-auto-flow'>" | "<'math-style'>" | "<'max-block-size'>" | "<'max-height'>" | "<'max-inline-size'>" | "<'max-lines'>" | "<'max-width'>" | "<'min-block-size'>" | "<'min-height'>" | "<'min-inline-size'>" | "<'min-width'>" | "<'mix-blend-mode'>" | "<'object-fit'>" | "<'object-position'>" | "<'offset'>" | "<'offset-anchor'>" | "<'offset-distance'>" | "<'offset-path'>" | "<'offset-position'>" | "<'offset-rotate'>" | "<'opacity'>" | "<'order'>" | "<'orphans'>" | "<'outline'>" | "<'outline-color'>" | "<'outline-offset'>" | "<'outline-style'>" | "<'outline-width'>" | "<'overflow'>" | "<'overflow-anchor'>" | "<'overflow-block'>" | "<'overflow-clip-box'>" | "<'overflow-inline'>" | "<'overflow-wrap'>" | "<'overflow-x'>" | "<'overflow-y'>" | "<'overscroll-behavior'>" | "<'overscroll-behavior-block'>" | "<'overscroll-behavior-inline'>" | "<'overscroll-behavior-x'>" | "<'overscroll-behavior-y'>" | "<'padding'>" | "<'padding-block'>" | "<'padding-block-end'>" | "<'padding-block-start'>" | "<'padding-bottom'>" | "<'padding-inline'>" | "<'padding-inline-end'>" | "<'padding-inline-start'>" | "<'padding-left'>" | "<'padding-right'>" | "<'padding-top'>" | "<'page-break-after'>" | "<'page-break-before'>" | "<'page-break-inside'>" | "<'paint-order'>" | "<'perspective'>" | "<'perspective-origin'>" | "<'place-content'>" | "<'place-items'>" | "<'place-self'>" | "<'pointer-events'>" | "<'position'>" | "<'quotes'>" | "<'resize'>" | "<'right'>" | "<'rotate'>" | "<'row-gap'>" | "<'ruby-align'>" | "<'ruby-merge'>" | "<'ruby-position'>" | "<'scale'>" | "<'scrollbar-color'>" | "<'scrollbar-gutter'>" | "<'scrollbar-width'>" | "<'scroll-behavior'>" | "<'scroll-margin'>" | "<'scroll-margin-block'>" | "<'scroll-margin-block-start'>" | "<'scroll-margin-block-end'>" | "<'scroll-margin-bottom'>" | "<'scroll-margin-inline'>" | "<'scroll-margin-inline-start'>" | "<'scroll-margin-inline-end'>" | "<'scroll-margin-left'>" | "<'scroll-margin-right'>" | "<'scroll-margin-top'>" | "<'scroll-padding'>" | "<'scroll-padding-block'>" | "<'scroll-padding-block-start'>" | "<'scroll-padding-block-end'>" | "<'scroll-padding-bottom'>" | "<'scroll-padding-inline'>" | "<'scroll-padding-inline-start'>" | "<'scroll-padding-inline-end'>" | "<'scroll-padding-left'>" | "<'scroll-padding-right'>" | "<'scroll-padding-top'>" | "<'scroll-snap-align'>" | "<'scroll-snap-coordinate'>" | "<'scroll-snap-destination'>" | "<'scroll-snap-points-x'>" | "<'scroll-snap-points-y'>" | "<'scroll-snap-stop'>" | "<'scroll-snap-type'>" | "<'scroll-snap-type-x'>" | "<'scroll-snap-type-y'>" | "<'shape-image-threshold'>" | "<'shape-margin'>" | "<'shape-outside'>" | "<'tab-size'>" | "<'table-layout'>" | "<'text-align'>" | "<'text-align-last'>" | "<'text-combine-upright'>" | "<'text-decoration'>" | "<'text-decoration-color'>" | "<'text-decoration-line'>" | "<'text-decoration-skip'>" | "<'text-decoration-skip-ink'>" | "<'text-decoration-style'>" | "<'text-decoration-thickness'>" | "<'text-emphasis'>" | "<'text-emphasis-color'>" | "<'text-emphasis-position'>" | "<'text-emphasis-style'>" | "<'text-indent'>" | "<'text-justify'>" | "<'text-orientation'>" | "<'text-overflow'>" | "<'text-rendering'>" | "<'text-shadow'>" | "<'text-size-adjust'>" | "<'text-transform'>" | "<'text-underline-offset'>" | "<'text-underline-position'>" | "<'top'>" | "<'touch-action'>" | "<'transform'>" | "<'transform-box'>" | "<'transform-origin'>" | "<'transform-style'>" | "<'transition'>" | "<'transition-delay'>" | "<'transition-duration'>" | "<'transition-property'>" | "<'transition-timing-function'>" | "<'translate'>" | "<'unicode-bidi'>" | "<'user-select'>" | "<'vertical-align'>" | "<'visibility'>" | "<'white-space'>" | "<'widows'>" | "<'width'>" | "<'will-change'>" | "<'word-break'>" | "<'word-spacing'>" | "<'word-wrap'>" | "<'writing-mode'>" | "<'z-index'>" | "<'zoom'>" | "<'-moz-background-clip'>" | "<'-moz-border-radius-bottomleft'>" | "<'-moz-border-radius-bottomright'>" | "<'-moz-border-radius-topleft'>" | "<'-moz-border-radius-topright'>" | "<'-moz-control-character-visibility'>" | "<'-moz-osx-font-smoothing'>" | "<'-moz-user-select'>" | "<'-ms-flex-align'>" | "<'-ms-flex-item-align'>" | "<'-ms-flex-line-pack'>" | "<'-ms-flex-negative'>" | "<'-ms-flex-pack'>" | "<'-ms-flex-order'>" | "<'-ms-flex-positive'>" | "<'-ms-flex-preferred-size'>" | "<'-ms-interpolation-mode'>" | "<'-ms-grid-column-align'>" | "<'-ms-grid-row-align'>" | "<'-ms-hyphenate-limit-last'>" | "<'-webkit-background-clip'>" | "<'-webkit-column-break-after'>" | "<'-webkit-column-break-before'>" | "<'-webkit-column-break-inside'>" | "<'-webkit-font-smoothing'>" | "<'-webkit-mask-box-image'>" | "<'-webkit-print-color-adjust'>" | "<'-webkit-text-security'>" | "<'-webkit-user-drag'>" | "<'-webkit-user-select'>" | "<'alignment-baseline'>" | "<'baseline-shift'>" | "<'behavior'>" | "<'clip-rule'>" | "<'cue'>" | "<'cue-after'>" | "<'cue-before'>" | "<'dominant-baseline'>" | "<'fill'>" | "<'fill-opacity'>" | "<'fill-rule'>" | "<'glyph-orientation-horizontal'>" | "<'glyph-orientation-vertical'>" | "<'kerning'>" | "<'marker'>" | "<'marker-end'>" | "<'marker-mid'>" | "<'marker-start'>" | "<'pause'>" | "<'pause-after'>" | "<'pause-before'>" | "<'rest'>" | "<'rest-after'>" | "<'rest-before'>" | "<'shape-rendering'>" | "<'src'>" | "<'speak'>" | "<'speak-as'>" | "<'stroke'>" | "<'stroke-dasharray'>" | "<'stroke-dashoffset'>" | "<'stroke-linecap'>" | "<'stroke-linejoin'>" | "<'stroke-miterlimit'>" | "<'stroke-opacity'>" | "<'stroke-width'>" | "<'text-anchor'>" | "<'unicode-range'>" | "<'voice-balance'>" | "<'voice-duration'>" | "<'voice-family'>" | "<'voice-pitch'>" | "<'voice-range'>" | "<'voice-rate'>" | "<'voice-stress'>" | "<'voice-volume'>" | '<absolute-size>' | '<alpha-value>' | '<angle-percentage>' | '<angular-color-hint>' | '<angular-color-stop>' | '<angular-color-stop-list>' | '<animateable-feature>' | '<attachment>' | '<attr()>' | '<attr-matcher>' | '<attr-modifier>' | '<attribute-selector>' | '<auto-repeat>' | '<auto-track-list>' | '<baseline-position>' | '<basic-shape>' | '<bg-image>' | '<bg-layer>' | '<bg-position>' | '<bg-size>' | '<blur()>' | '<blend-mode>' | '<box>' | '<brightness()>' | '<calc()>' | '<calc-sum>' | '<calc-product>' | '<calc-value>' | '<cf-final-image>' | '<cf-mixing-image>' | '<circle()>' | '<clamp()>' | '<class-selector>' | '<clip-source>' | '<color>' | '<color-stop>' | '<color-stop-angle>' | '<color-stop-length>' | '<color-stop-list>' | '<combinator>' | '<common-lig-values>' | '<compat-auto>' | '<composite-style>' | '<compositing-operator>' | '<compound-selector>' | '<compound-selector-list>' | '<complex-selector>' | '<complex-selector-list>' | '<conic-gradient()>' | '<contextual-alt-values>' | '<content-distribution>' | '<content-list>' | '<content-position>' | '<content-replacement>' | '<contrast()>' | '<counter()>' | '<counter-style>' | '<counter-style-name>' | '<counters()>' | '<cross-fade()>' | '<cubic-bezier-timing-function>' | '<deprecated-system-color>' | '<discretionary-lig-values>' | '<display-box>' | '<display-inside>' | '<display-internal>' | '<display-legacy>' | '<display-listitem>' | '<display-outside>' | '<drop-shadow()>' | '<east-asian-variant-values>' | '<east-asian-width-values>' | '<element()>' | '<ellipse()>' | '<ending-shape>' | '<env()>' | '<explicit-track-list>' | '<family-name>' | '<feature-tag-value>' | '<feature-type>' | '<feature-value-block>' | '<feature-value-block-list>' | '<feature-value-declaration>' | '<feature-value-declaration-list>' | '<feature-value-name>' | '<fill-rule>' | '<filter-function>' | '<filter-function-list>' | '<final-bg-layer>' | '<fit-content()>' | '<fixed-breadth>' | '<fixed-repeat>' | '<fixed-size>' | '<font-stretch-absolute>' | '<font-variant-css21>' | '<font-weight-absolute>' | '<frequency-percentage>' | '<general-enclosed>' | '<generic-family>' | '<generic-name>' | '<geometry-box>' | '<gradient>' | '<grayscale()>' | '<grid-line>' | '<historical-lig-values>' | '<hsl()>' | '<hsla()>' | '<hue>' | '<hue-rotate()>' | '<id-selector>' | '<image>' | '<image()>' | '<image-set()>' | '<image-set-option>' | '<image-src>' | '<image-tags>' | '<inflexible-breadth>' | '<inset()>' | '<invert()>' | '<keyframes-name>' | '<keyframe-block>' | '<keyframe-block-list>' | '<keyframe-selector>' | '<leader()>' | '<leader-type>' | '<length-percentage>' | '<line-names>' | '<line-name-list>' | '<line-style>' | '<line-width>' | '<linear-color-hint>' | '<linear-color-stop>' | '<linear-gradient()>' | '<mask-layer>' | '<mask-position>' | '<mask-reference>' | '<mask-source>' | '<masking-mode>' | '<matrix()>' | '<matrix3d()>' | '<max()>' | '<media-and>' | '<media-condition>' | '<media-condition-without-or>' | '<media-feature>' | '<media-in-parens>' | '<media-not>' | '<media-or>' | '<media-query>' | '<media-query-list>' | '<media-type>' | '<mf-boolean>' | '<mf-name>' | '<mf-plain>' | '<mf-range>' | '<mf-value>' | '<min()>' | '<minmax()>' | '<named-color>' | '<namespace-prefix>' | '<ns-prefix>' | '<number-percentage>' | '<numeric-figure-values>' | '<numeric-fraction-values>' | '<numeric-spacing-values>' | '<nth>' | '<opacity()>' | '<overflow-position>' | '<outline-radius>' | '<page-body>' | '<page-margin-box>' | '<page-margin-box-type>' | '<page-selector-list>' | '<page-selector>' | '<path()>' | '<paint()>' | '<perspective()>' | '<polygon()>' | '<position>' | '<pseudo-class-selector>' | '<pseudo-element-selector>' | '<pseudo-page>' | '<quote>' | '<radial-gradient()>' | '<relative-selector>' | '<relative-selector-list>' | '<relative-size>' | '<repeat-style>' | '<repeating-linear-gradient()>' | '<repeating-radial-gradient()>' | '<rgb()>' | '<rgba()>' | '<rotate()>' | '<rotate3d()>' | '<rotateX()>' | '<rotateY()>' | '<rotateZ()>' | '<saturate()>' | '<scale()>' | '<scale3d()>' | '<scaleX()>' | '<scaleY()>' | '<scaleZ()>' | '<self-position>' | '<shape-radius>' | '<skew()>' | '<skewX()>' | '<skewY()>' | '<sepia()>' | '<shadow>' | '<shadow-t>' | '<shape>' | '<shape-box>' | '<side-or-corner>' | '<single-animation>' | '<single-animation-direction>' | '<single-animation-fill-mode>' | '<single-animation-iteration-count>' | '<single-animation-play-state>' | '<single-transition>' | '<single-transition-property>' | '<size>' | '<step-position>' | '<step-timing-function>' | '<subclass-selector>' | '<supports-condition>' | '<supports-in-parens>' | '<supports-feature>' | '<supports-decl>' | '<supports-selector-fn>' | '<symbol>' | '<target>' | '<target-counter()>' | '<target-counters()>' | '<target-text()>' | '<time-percentage>' | '<timing-function>' | '<track-breadth>' | '<track-list>' | '<track-repeat>' | '<track-size>' | '<transform-function>' | '<transform-list>' | '<translate()>' | '<translate3d()>' | '<translateX()>' | '<translateY()>' | '<translateZ()>' | '<type-or-unit>' | '<type-selector>' | '<var()>' | '<viewport-length>' | '<wq-name>' | '<-legacy-gradient>' | '<-legacy-linear-gradient>' | '<-legacy-repeating-linear-gradient>' | '<-legacy-linear-gradient-arguments>' | '<-legacy-radial-gradient>' | '<-legacy-repeating-radial-gradient>' | '<-legacy-radial-gradient-arguments>' | '<-legacy-radial-gradient-size>' | '<-legacy-radial-gradient-shape>' | '<-non-standard-font>' | '<-non-standard-color>' | '<-non-standard-image-rendering>' | '<-non-standard-overflow>' | '<-non-standard-width>' | '<-webkit-gradient()>' | '<-webkit-gradient-color-stop>' | '<-webkit-gradient-point>' | '<-webkit-gradient-radius>' | '<-webkit-gradient-type>' | '<-webkit-mask-box-repeat>' | '<-webkit-mask-clip-style>' | '<-ms-filter-function-list>' | '<-ms-filter-function>' | '<-ms-filter-function-progid>' | '<-ms-filter-function-legacy>' | '<-ms-filter>' | '<age>' | '<attr-name>' | '<attr-fallback>' | '<border-radius>' | '<bottom>' | '<generic-voice>' | '<gender>' | '<left>' | '<mask-image>' | '<name-repeat>' | '<paint>' | '<page-size>' | '<ratio>' | '<right>' | '<svg-length>' | '<svg-writing-mode>' | '<top>' | '<track-group>' | '<track-list-v0>' | '<track-minmax>' | '<x>' | '<y>' | '<declaration>' | '<declaration-list>' | '<url>' | '<url-modifier>' | '<number-zero-one>' | '<number-one-or-greater>' | '<positive-integer>' | '<-non-standard-display>' | '<ident-token>' | '<function-token>' | '<at-keyword-token>' | '<hash-token>' | '<string-token>' | '<bad-string-token>' | '<url-token>' | '<bad-url-token>' | '<delim-token>' | '<number-token>' | '<percentage-token>' | '<dimension-token>' | '<whitespace-token>' | '<CDO-token>' | '<CDC-token>' | '<colon-token>' | '<semicolon-token>' | '<comma-token>' | '<[-token>' | '<]-token>' | '<(-token>' | '<)-token>' | '<{-token>' | '<}-token>' | '<string>' | '<ident>' | '<custom-ident>' | '<custom-property-name>' | '<hex-color>' | '<an-plus-b>' | '<urange>' | '<declaration-value>' | '<any-value>' | '<dimension>' | '<angle>' | '<decibel>' | '<frequency>' | '<flex>' | '<length>' | '<resolution>' | '<semitones>' | '<time>' | '<percentage>' | '<zero>' | '<number>' | '<integer>' | '<-ms-legacy-expression>' | '<bcp-47>') | ('Any' | 'NoEmptyAny' | 'OneLineAny' | 'Zero' | 'Number' | 'Int' | 'Uint' | 'XMLName' | 'DOMID' | 'FunctionBody' | 'Pattern' | 'DateTime' | 'TabIndex' | 'BCP47' | 'URL' | 'AbsoluteURL' | 'HashName' | 'OneCodePointChar' | 'CustomElementName' | 'BrowsingContextName' | 'BrowsingContextNameOrKeyword' | 'HTTPSchemaURL' | 'MIMEType' | 'ItemProp' | 'Srcset' | 'SourceSizeList' | 'IconSize' | 'AutoComplete' | 'Accept' | 'SerializedPermissionsPolicy' | '<css-declaration-list>' | '<class-list>' | '<svg-font-size>' | '<svg-font-size-adjust>' | "<'color-profile'>" | "<'color-rendering'>" | "<'enable-background'>" | '<list-of-svg-feature-string>' | '<animatable-value>' | '<begin-value-list>' | '<end-value-list>' | '<list-of-value>' | '<clock-value>' | '<color-matrix>' | '<dasharray>' | '<key-points>' | '<key-splines>' | '<key-times>' | '<system-language>' | '<origin>' | '<svg-path>' | '<points>' | '<preserve-aspect-ratio>' | '<view-box>' | '<rotate>' | '<text-coordinate>' | '<list-of-lengths>' | '<list-of-numbers>' | '<list-of-percentages>' | '<number-optional-number>') | 'Boolean') | {
token: ('Any' | 'NoEmptyAny' | 'OneLineAny' | 'Zero' | 'Number' | 'Int' | 'Uint' | 'XMLName' | 'DOMID' | 'FunctionBody' | 'Pattern' | 'DateTime' | 'TabIndex' | 'BCP47' | 'URL' | 'AbsoluteURL' | 'HashName' | 'OneCodePointChar' | 'CustomElementName' | 'BrowsingContextName' | 'BrowsingContextNameOrKeyword' | 'HTTPSchemaURL' | 'MIMEType' | 'ItemProp' | 'Srcset' | 'SourceSizeList' | 'IconSize' | 'AutoComplete' | 'Accept' | 'SerializedPermissionsPolicy' | '<css-declaration-list>' | '<class-list>' | '<svg-font-size>' | '<svg-font-size-adjust>' | "<'color-profile'>" | "<'color-rendering'>" | "<'enable-background'>" | '<list-of-svg-feature-string>' | '<animatable-value>' | '<begin-value-list>' | '<end-value-list>' | '<list-of-value>' | '<clock-value>' | '<color-matrix>' | '<dasharray>' | '<key-points>' | '<key-splines>' | '<key-times>' | '<system-language>' | '<origin>' | '<svg-path>' | '<points>' | '<preserve-aspect-ratio>' | '<view-box>' | '<rotate>' | '<text-coordinate>' | '<list-of-lengths>' | '<list-of-numbers>' | '<list-of-percentages>' | '<number-optional-number>') | {
enum: [string, ...string[]];
disallowToSurroundBySpaces?: boolean;
caseInsensitive?: boolean;
invalidValueDefault?: string;
missingValueDefault?: string;
sameStates?: {
[k: string]: unknown;
};
};
disallowToSurroundBySpaces?: boolean;
allowEmpty?: boolean;
ordered?: boolean;
unique?: boolean;
caseInsensitive?: boolean;
number?: ('zeroOrMore' | 'oneOrMore') | {
min: number;
max: number;
};
separator: 'space' | 'comma';
} | {
enum: [string, ...string[]];
disallowToSurroundBySpaces?: boolean;
caseInsensitive?: boolean;
invalidValueDefault?: string;
missingValueDefault?: string;
sameStates?: {
[k: string]: unknown;
};
} | {
type: 'float' | 'integer';
gt?: number;
gte?: number;
lt?: number;
lte?: number;
clampable?: boolean;
};
export declare type AttributeCondition = string | [string, string, ...string[]];
export type AttributeType = (("<'--*'>" | "<'-ms-accelerator'>" | "<'-ms-block-progression'>" | "<'-ms-content-zoom-chaining'>" | "<'-ms-content-zooming'>" | "<'-ms-content-zoom-limit'>" | "<'-ms-content-zoom-limit-max'>" | "<'-ms-content-zoom-limit-min'>" | "<'-ms-content-zoom-snap'>" | "<'-ms-content-zoom-snap-points'>" | "<'-ms-content-zoom-snap-type'>" | "<'-ms-filter'>" | "<'-ms-flow-from'>" | "<'-ms-flow-into'>" | "<'-ms-grid-columns'>" | "<'-ms-grid-rows'>" | "<'-ms-high-contrast-adjust'>" | "<'-ms-hyphenate-limit-chars'>" | "<'-ms-hyphenate-limit-lines'>" | "<'-ms-hyphenate-limit-zone'>" | "<'-ms-ime-align'>" | "<'-ms-overflow-style'>" | "<'-ms-scrollbar-3dlight-color'>" | "<'-ms-scrollbar-arrow-color'>" | "<'-ms-scrollbar-base-color'>" | "<'-ms-scrollbar-darkshadow-color'>" | "<'-ms-scrollbar-face-color'>" | "<'-ms-scrollbar-highlight-color'>" | "<'-ms-scrollbar-shadow-color'>" | "<'-ms-scrollbar-track-color'>" | "<'-ms-scroll-chaining'>" | "<'-ms-scroll-limit'>" | "<'-ms-scroll-limit-x-max'>" | "<'-ms-scroll-limit-x-min'>" | "<'-ms-scroll-limit-y-max'>" | "<'-ms-scroll-limit-y-min'>" | "<'-ms-scroll-rails'>" | "<'-ms-scroll-snap-points-x'>" | "<'-ms-scroll-snap-points-y'>" | "<'-ms-scroll-snap-type'>" | "<'-ms-scroll-snap-x'>" | "<'-ms-scroll-snap-y'>" | "<'-ms-scroll-translation'>" | "<'-ms-text-autospace'>" | "<'-ms-touch-select'>" | "<'-ms-user-select'>" | "<'-ms-wrap-flow'>" | "<'-ms-wrap-margin'>" | "<'-ms-wrap-through'>" | "<'-moz-appearance'>" | "<'-moz-binding'>" | "<'-moz-border-bottom-colors'>" | "<'-moz-border-left-colors'>" | "<'-moz-border-right-colors'>" | "<'-moz-border-top-colors'>" | "<'-moz-context-properties'>" | "<'-moz-float-edge'>" | "<'-moz-force-broken-image-icon'>" | "<'-moz-image-region'>" | "<'-moz-orient'>" | "<'-moz-outline-radius'>" | "<'-moz-outline-radius-bottomleft'>" | "<'-moz-outline-radius-bottomright'>" | "<'-moz-outline-radius-topleft'>" | "<'-moz-outline-radius-topright'>" | "<'-moz-stack-sizing'>" | "<'-moz-text-blink'>" | "<'-moz-user-focus'>" | "<'-moz-user-input'>" | "<'-moz-user-modify'>" | "<'-moz-window-dragging'>" | "<'-moz-window-shadow'>" | "<'-webkit-appearance'>" | "<'-webkit-border-before'>" | "<'-webkit-border-before-color'>" | "<'-webkit-border-before-style'>" | "<'-webkit-border-before-width'>" | "<'-webkit-box-reflect'>" | "<'-webkit-line-clamp'>" | "<'-webkit-mask'>" | "<'-webkit-mask-attachment'>" | "<'-webkit-mask-clip'>" | "<'-webkit-mask-composite'>" | "<'-webkit-mask-image'>" | "<'-webkit-mask-origin'>" | "<'-webkit-mask-position'>" | "<'-webkit-mask-position-x'>" | "<'-webkit-mask-position-y'>" | "<'-webkit-mask-repeat'>" | "<'-webkit-mask-repeat-x'>" | "<'-webkit-mask-repeat-y'>" | "<'-webkit-mask-size'>" | "<'-webkit-overflow-scrolling'>" | "<'-webkit-tap-highlight-color'>" | "<'-webkit-text-fill-color'>" | "<'-webkit-text-stroke'>" | "<'-webkit-text-stroke-color'>" | "<'-webkit-text-stroke-width'>" | "<'-webkit-touch-callout'>" | "<'-webkit-user-modify'>" | "<'align-content'>" | "<'align-items'>" | "<'align-self'>" | "<'align-tracks'>" | "<'all'>" | "<'animation'>" | "<'animation-delay'>" | "<'animation-direction'>" | "<'animation-duration'>" | "<'animation-fill-mode'>" | "<'animation-iteration-count'>" | "<'animation-name'>" | "<'animation-play-state'>" | "<'animation-timing-function'>" | "<'appearance'>" | "<'aspect-ratio'>" | "<'azimuth'>" | "<'backdrop-filter'>" | "<'backface-visibility'>" | "<'background'>" | "<'background-attachment'>" | "<'background-blend-mode'>" | "<'background-clip'>" | "<'background-color'>" | "<'background-image'>" | "<'background-origin'>" | "<'background-position'>" | "<'background-position-x'>" | "<'background-position-y'>" | "<'background-repeat'>" | "<'background-size'>" | "<'block-overflow'>" | "<'block-size'>" | "<'border'>" | "<'border-block'>" | "<'border-block-color'>" | "<'border-block-style'>" | "<'border-block-width'>" | "<'border-block-end'>" | "<'border-block-end-color'>" | "<'border-block-end-style'>" | "<'border-block-end-width'>" | "<'border-block-start'>" | "<'border-block-start-color'>" | "<'border-block-start-style'>" | "<'border-block-start-width'>" | "<'border-bottom'>" | "<'border-bottom-color'>" | "<'border-bottom-left-radius'>" | "<'border-bottom-right-radius'>" | "<'border-bottom-style'>" | "<'border-bottom-width'>" | "<'border-collapse'>" | "<'border-color'>" | "<'border-end-end-radius'>" | "<'border-end-start-radius'>" | "<'border-image'>" | "<'border-image-outset'>" | "<'border-image-repeat'>" | "<'border-image-slice'>" | "<'border-image-source'>" | "<'border-image-width'>" | "<'border-inline'>" | "<'border-inline-end'>" | "<'border-inline-color'>" | "<'border-inline-style'>" | "<'border-inline-width'>" | "<'border-inline-end-color'>" | "<'border-inline-end-style'>" | "<'border-inline-end-width'>" | "<'border-inline-start'>" | "<'border-inline-start-color'>" | "<'border-inline-start-style'>" | "<'border-inline-start-width'>" | "<'border-left'>" | "<'border-left-color'>" | "<'border-left-style'>" | "<'border-left-width'>" | "<'border-radius'>" | "<'border-right'>" | "<'border-right-color'>" | "<'border-right-style'>" | "<'border-right-width'>" | "<'border-spacing'>" | "<'border-start-end-radius'>" | "<'border-start-start-radius'>" | "<'border-style'>" | "<'border-top'>" | "<'border-top-color'>" | "<'border-top-left-radius'>" | "<'border-top-right-radius'>" | "<'border-top-style'>" | "<'border-top-width'>" | "<'border-width'>" | "<'bottom'>" | "<'box-align'>" | "<'box-decoration-break'>" | "<'box-direction'>" | "<'box-flex'>" | "<'box-flex-group'>" | "<'box-lines'>" | "<'box-ordinal-group'>" | "<'box-orient'>" | "<'box-pack'>" | "<'box-shadow'>" | "<'box-sizing'>" | "<'break-after'>" | "<'break-before'>" | "<'break-inside'>" | "<'caption-side'>" | "<'caret-color'>" | "<'clear'>" | "<'clip'>" | "<'clip-path'>" | "<'color'>" | "<'color-adjust'>" | "<'column-count'>" | "<'column-fill'>" | "<'column-gap'>" | "<'column-rule'>" | "<'column-rule-color'>" | "<'column-rule-style'>" | "<'column-rule-width'>" | "<'column-span'>" | "<'column-width'>" | "<'columns'>" | "<'contain'>" | "<'content'>" | "<'counter-increment'>" | "<'counter-reset'>" | "<'counter-set'>" | "<'cursor'>" | "<'direction'>" | "<'display'>" | "<'empty-cells'>" | "<'filter'>" | "<'flex'>" | "<'flex-basis'>" | "<'flex-direction'>" | "<'flex-flow'>" | "<'flex-grow'>" | "<'flex-shrink'>" | "<'flex-wrap'>" | "<'float'>" | "<'font'>" | "<'font-family'>" | "<'font-feature-settings'>" | "<'font-kerning'>" | "<'font-language-override'>" | "<'font-optical-sizing'>" | "<'font-variation-settings'>" | "<'font-size'>" | "<'font-size-adjust'>" | "<'font-smooth'>" | "<'font-stretch'>" | "<'font-style'>" | "<'font-synthesis'>" | "<'font-variant'>" | "<'font-variant-alternates'>" | "<'font-variant-caps'>" | "<'font-variant-east-asian'>" | "<'font-variant-ligatures'>" | "<'font-variant-numeric'>" | "<'font-variant-position'>" | "<'font-weight'>" | "<'gap'>" | "<'grid'>" | "<'grid-area'>" | "<'grid-auto-columns'>" | "<'grid-auto-flow'>" | "<'grid-auto-rows'>" | "<'grid-column'>" | "<'grid-column-end'>" | "<'grid-column-gap'>" | "<'grid-column-start'>" | "<'grid-gap'>" | "<'grid-row'>" | "<'grid-row-end'>" | "<'grid-row-gap'>" | "<'grid-row-start'>" | "<'grid-template'>" | "<'grid-template-areas'>" | "<'grid-template-columns'>" | "<'grid-template-rows'>" | "<'hanging-punctuation'>" | "<'height'>" | "<'hyphens'>" | "<'image-orientation'>" | "<'image-rendering'>" | "<'image-resolution'>" | "<'ime-mode'>" | "<'initial-letter'>" | "<'initial-letter-align'>" | "<'inline-size'>" | "<'inset'>" | "<'inset-block'>" | "<'inset-block-end'>" | "<'inset-block-start'>" | "<'inset-inline'>" | "<'inset-inline-end'>" | "<'inset-inline-start'>" | "<'isolation'>" | "<'justify-content'>" | "<'justify-items'>" | "<'justify-self'>" | "<'justify-tracks'>" | "<'left'>" | "<'letter-spacing'>" | "<'line-break'>" | "<'line-clamp'>" | "<'line-height'>" | "<'line-height-step'>" | "<'list-style'>" | "<'list-style-image'>" | "<'list-style-position'>" | "<'list-style-type'>" | "<'margin'>" | "<'margin-block'>" | "<'margin-block-end'>" | "<'margin-block-start'>" | "<'margin-bottom'>" | "<'margin-inline'>" | "<'margin-inline-end'>" | "<'margin-inline-start'>" | "<'margin-left'>" | "<'margin-right'>" | "<'margin-top'>" | "<'margin-trim'>" | "<'mask'>" | "<'mask-border'>" | "<'mask-border-mode'>" | "<'mask-border-outset'>" | "<'mask-border-repeat'>" | "<'mask-border-slice'>" | "<'mask-border-source'>" | "<'mask-border-width'>" | "<'mask-clip'>" | "<'mask-composite'>" | "<'mask-image'>" | "<'mask-mode'>" | "<'mask-origin'>" | "<'mask-position'>" | "<'mask-repeat'>" | "<'mask-size'>" | "<'mask-type'>" | "<'masonry-auto-flow'>" | "<'math-style'>" | "<'max-block-size'>" | "<'max-height'>" | "<'max-inline-size'>" | "<'max-lines'>" | "<'max-width'>" | "<'min-block-size'>" | "<'min-height'>" | "<'min-inline-size'>" | "<'min-width'>" | "<'mix-blend-mode'>" | "<'object-fit'>" | "<'object-position'>" | "<'offset'>" | "<'offset-anchor'>" | "<'offset-distance'>" | "<'offset-path'>" | "<'offset-position'>" | "<'offset-rotate'>" | "<'opacity'>" | "<'order'>" | "<'orphans'>" | "<'outline'>" | "<'outline-color'>" | "<'outline-offset'>" | "<'outline-style'>" | "<'outline-width'>" | "<'overflow'>" | "<'overflow-anchor'>" | "<'overflow-block'>" | "<'overflow-clip-box'>" | "<'overflow-inline'>" | "<'overflow-wrap'>" | "<'overflow-x'>" | "<'overflow-y'>" | "<'overscroll-behavior'>" | "<'overscroll-behavior-block'>" | "<'overscroll-behavior-inline'>" | "<'overscroll-behavior-x'>" | "<'overscroll-behavior-y'>" | "<'padding'>" | "<'padding-block'>" | "<'padding-block-end'>" | "<'padding-block-start'>" | "<'padding-bottom'>" | "<'padding-inline'>" | "<'padding-inline-end'>" | "<'padding-inline-start'>" | "<'padding-left'>" | "<'padding-right'>" | "<'padding-top'>" | "<'page-break-after'>" | "<'page-break-before'>" | "<'page-break-inside'>" | "<'paint-order'>" | "<'perspective'>" | "<'perspective-origin'>" | "<'place-content'>" | "<'place-items'>" | "<'place-self'>" | "<'pointer-events'>" | "<'position'>" | "<'quotes'>" | "<'resize'>" | "<'right'>" | "<'rotate'>" | "<'row-gap'>" | "<'ruby-align'>" | "<'ruby-merge'>" | "<'ruby-position'>" | "<'scale'>" | "<'scrollbar-color'>" | "<'scrollbar-gutter'>" | "<'scrollbar-width'>" | "<'scroll-behavior'>" | "<'scroll-margin'>" | "<'scroll-margin-block'>" | "<'scroll-margin-block-start'>" | "<'scroll-margin-block-end'>" | "<'scroll-margin-bottom'>" | "<'scroll-margin-inline'>" | "<'scroll-margin-inline-start'>" | "<'scroll-margin-inline-end'>" | "<'scroll-margin-left'>" | "<'scroll-margin-right'>" | "<'scroll-margin-top'>" | "<'scroll-padding'>" | "<'scroll-padding-block'>" | "<'scroll-padding-block-start'>" | "<'scroll-padding-block-end'>" | "<'scroll-padding-bottom'>" | "<'scroll-padding-inline'>" | "<'scroll-padding-inline-start'>" | "<'scroll-padding-inline-end'>" | "<'scroll-padding-left'>" | "<'scroll-padding-right'>" | "<'scroll-padding-top'>" | "<'scroll-snap-align'>" | "<'scroll-snap-coordinate'>" | "<'scroll-snap-destination'>" | "<'scroll-snap-points-x'>" | "<'scroll-snap-points-y'>" | "<'scroll-snap-stop'>" | "<'scroll-snap-type'>" | "<'scroll-snap-type-x'>" | "<'scroll-snap-type-y'>" | "<'shape-image-threshold'>" | "<'shape-margin'>" | "<'shape-outside'>" | "<'tab-size'>" | "<'table-layout'>" | "<'text-align'>" | "<'text-align-last'>" | "<'text-combine-upright'>" | "<'text-decoration'>" | "<'text-decoration-color'>" | "<'text-decoration-line'>" | "<'text-decoration-skip'>" | "<'text-decoration-skip-ink'>" | "<'text-decoration-style'>" | "<'text-decoration-thickness'>" | "<'text-emphasis'>" | "<'text-emphasis-color'>" | "<'text-emphasis-position'>" | "<'text-emphasis-style'>" | "<'text-indent'>" | "<'text-justify'>" | "<'text-orientation'>" | "<'text-overflow'>" | "<'text-rendering'>" | "<'text-shadow'>" | "<'text-size-adjust'>" | "<'text-transform'>" | "<'text-underline-offset'>" | "<'text-underline-position'>" | "<'top'>" | "<'touch-action'>" | "<'transform'>" | "<'transform-box'>" | "<'transform-origin'>" | "<'transform-style'>" | "<'transition'>" | "<'transition-delay'>" | "<'transition-duration'>" | "<'transition-property'>" | "<'transition-timing-function'>" | "<'translate'>" | "<'unicode-bidi'>" | "<'user-select'>" | "<'vertical-align'>" | "<'visibility'>" | "<'white-space'>" | "<'widows'>" | "<'width'>" | "<'will-change'>" | "<'word-break'>" | "<'word-spacing'>" | "<'word-wrap'>" | "<'writing-mode'>" | "<'z-index'>" | "<'zoom'>" | "<'-moz-background-clip'>" | "<'-moz-border-radius-bottomleft'>" | "<'-moz-border-radius-bottomright'>" | "<'-moz-border-radius-topleft'>" | "<'-moz-border-radius-topright'>" | "<'-moz-control-character-visibility'>" | "<'-moz-osx-font-smoothing'>" | "<'-moz-user-select'>" | "<'-ms-flex-align'>" | "<'-ms-flex-item-align'>" | "<'-ms-flex-line-pack'>" | "<'-ms-flex-negative'>" | "<'-ms-flex-pack'>" | "<'-ms-flex-order'>" | "<'-ms-flex-positive'>" | "<'-ms-flex-preferred-size'>" | "<'-ms-interpolation-mode'>" | "<'-ms-grid-column-align'>" | "<'-ms-grid-row-align'>" | "<'-ms-hyphenate-limit-last'>" | "<'-webkit-background-clip'>" | "<'-webkit-column-break-after'>" | "<'-webkit-column-break-before'>" | "<'-webkit-column-break-inside'>" | "<'-webkit-font-smoothing'>" | "<'-webkit-mask-box-image'>" | "<'-webkit-print-color-adjust'>" | "<'-webkit-text-security'>" | "<'-webkit-user-drag'>" | "<'-webkit-user-select'>" | "<'alignment-baseline'>" | "<'baseline-shift'>" | "<'behavior'>" | "<'clip-rule'>" | "<'cue'>" | "<'cue-after'>" | "<'cue-before'>" | "<'dominant-baseline'>" | "<'fill'>" | "<'fill-opacity'>" | "<'fill-rule'>" | "<'glyph-orientation-horizontal'>" | "<'glyph-orientation-vertical'>" | "<'kerning'>" | "<'marker'>" | "<'marker-end'>" | "<'marker-mid'>" | "<'marker-start'>" | "<'pause'>" | "<'pause-after'>" | "<'pause-before'>" | "<'rest'>" | "<'rest-after'>" | "<'rest-before'>" | "<'shape-rendering'>" | "<'src'>" | "<'speak'>" | "<'speak-as'>" | "<'stroke'>" | "<'stroke-dasharray'>" | "<'stroke-dashoffset'>" | "<'stroke-linecap'>" | "<'stroke-linejoin'>" | "<'stroke-miterlimit'>" | "<'stroke-opacity'>" | "<'stroke-width'>" | "<'text-anchor'>" | "<'unicode-range'>" | "<'voice-balance'>" | "<'voice-duration'>" | "<'voice-family'>" | "<'voice-pitch'>" | "<'voice-range'>" | "<'voice-rate'>" | "<'voice-stress'>" | "<'voice-volume'>" | '<absolute-size>' | '<alpha-value>' | '<angle-percentage>' | '<angular-color-hint>' | '<angular-color-stop>' | '<angular-color-stop-list>' | '<animateable-feature>' | '<attachment>' | '<attr()>' | '<attr-matcher>' | '<attr-modifier>' | '<attribute-selector>' | '<auto-repeat>' | '<auto-track-list>' | '<baseline-position>' | '<basic-shape>' | '<bg-image>' | '<bg-layer>' | '<bg-position>' | '<bg-size>' | '<blur()>' | '<blend-mode>' | '<box>' | '<brightness()>' | '<calc()>' | '<calc-sum>' | '<calc-product>' | '<calc-value>' | '<cf-final-image>' | '<cf-mixing-image>' | '<circle()>' | '<clamp()>' | '<class-selector>' | '<clip-source>' | '<color>' | '<color-stop>' | '<color-stop-angle>' | '<color-stop-length>' | '<color-stop-list>' | '<combinator>' | '<common-lig-values>' | '<compat-auto>' | '<composite-style>' | '<compositing-operator>' | '<compound-selector>' | '<compound-selector-list>' | '<complex-selector>' | '<complex-selector-list>' | '<conic-gradient()>' | '<contextual-alt-values>' | '<content-distribution>' | '<content-list>' | '<content-position>' | '<content-replacement>' | '<contrast()>' | '<counter()>' | '<counter-style>' | '<counter-style-name>' | '<counters()>' | '<cross-fade()>' | '<cubic-bezier-timing-function>' | '<deprecated-system-color>' | '<discretionary-lig-values>' | '<display-box>' | '<display-inside>' | '<display-internal>' | '<display-legacy>' | '<display-listitem>' | '<display-outside>' | '<drop-shadow()>' | '<east-asian-variant-values>' | '<east-asian-width-values>' | '<element()>' | '<ellipse()>' | '<ending-shape>' | '<env()>' | '<explicit-track-list>' | '<family-name>' | '<feature-tag-value>' | '<feature-type>' | '<feature-value-block>' | '<feature-value-block-list>' | '<feature-value-declaration>' | '<feature-value-declaration-list>' | '<feature-value-name>' | '<fill-rule>' | '<filter-function>' | '<filter-function-list>' | '<final-bg-layer>' | '<fit-content()>' | '<fixed-breadth>' | '<fixed-repeat>' | '<fixed-size>' | '<font-stretch-absolute>' | '<font-variant-css21>' | '<font-weight-absolute>' | '<frequency-percentage>' | '<general-enclosed>' | '<generic-family>' | '<generic-name>' | '<geometry-box>' | '<gradient>' | '<grayscale()>' | '<grid-line>' | '<historical-lig-values>' | '<hsl()>' | '<hsla()>' | '<hue>' | '<hue-rotate()>' | '<id-selector>' | '<image>' | '<image()>' | '<image-set()>' | '<image-set-option>' | '<image-src>' | '<image-tags>' | '<inflexible-breadth>' | '<inset()>' | '<invert()>' | '<keyframes-name>' | '<keyframe-block>' | '<keyframe-block-list>' | '<keyframe-selector>' | '<leader()>' | '<leader-type>' | '<length-percentage>' | '<line-names>' | '<line-name-list>' | '<line-style>' | '<line-width>' | '<linear-color-hint>' | '<linear-color-stop>' | '<linear-gradient()>' | '<mask-layer>' | '<mask-position>' | '<mask-reference>' | '<mask-source>' | '<masking-mode>' | '<matrix()>' | '<matrix3d()>' | '<max()>' | '<media-and>' | '<media-condition>' | '<media-condition-without-or>' | '<media-feature>' | '<media-in-parens>' | '<media-not>' | '<media-or>' | '<media-query>' | '<media-query-list>' | '<media-type>' | '<mf-boolean>' | '<mf-name>' | '<mf-plain>' | '<mf-range>' | '<mf-value>' | '<min()>' | '<minmax()>' | '<named-color>' | '<namespace-prefix>' | '<ns-prefix>' | '<number-percentage>' | '<numeric-figure-values>' | '<numeric-fraction-values>' | '<numeric-spacing-values>' | '<nth>' | '<opacity()>' | '<overflow-position>' | '<outline-radius>' | '<page-body>' | '<page-margin-box>' | '<page-margin-box-type>' | '<page-selector-list>' | '<page-selector>' | '<path()>' | '<paint()>' | '<perspective()>' | '<polygon()>' | '<position>' | '<pseudo-class-selector>' | '<pseudo-element-selector>' | '<pseudo-page>' | '<quote>' | '<radial-gradient()>' | '<relative-selector>' | '<relative-selector-list>' | '<relative-size>' | '<repeat-style>' | '<repeating-linear-gradient()>' | '<repeating-radial-gradient()>' | '<rgb()>' | '<rgba()>' | '<rotate()>' | '<rotate3d()>' | '<rotateX()>' | '<rotateY()>' | '<rotateZ()>' | '<saturate()>' | '<scale()>' | '<scale3d()>' | '<scaleX()>' | '<scaleY()>' | '<scaleZ()>' | '<self-position>' | '<shape-radius>' | '<skew()>' | '<skewX()>' | '<skewY()>' | '<sepia()>' | '<shadow>' | '<shadow-t>' | '<shape>' | '<shape-box>' | '<side-or-corner>' | '<single-animation>' | '<single-animation-direction>' | '<single-animation-fill-mode>' | '<single-animation-iteration-count>' | '<single-animation-play-state>' | '<single-transition>' | '<single-transition-property>' | '<size>' | '<step-position>' | '<step-timing-function>' | '<subclass-selector>' | '<supports-condition>' | '<supports-in-parens>' | '<supports-feature>' | '<supports-decl>' | '<supports-selector-fn>' | '<symbol>' | '<target>' | '<target-counter()>' | '<target-counters()>' | '<target-text()>' | '<time-percentage>' | '<timing-function>' | '<track-breadth>' | '<track-list>' | '<track-repeat>' | '<track-size>' | '<transform-function>' | '<transform-list>' | '<translate()>' | '<translate3d()>' | '<translateX()>' | '<translateY()>' | '<translateZ()>' | '<type-or-unit>' | '<type-selector>' | '<var()>' | '<viewport-length>' | '<wq-name>' | '<-legacy-gradient>' | '<-legacy-linear-gradient>' | '<-legacy-repeating-linear-gradient>' | '<-legacy-linear-gradient-arguments>' | '<-legacy-radial-gradient>' | '<-legacy-repeating-radial-gradient>' | '<-legacy-radial-gradient-arguments>' | '<-legacy-radial-gradient-size>' | '<-legacy-radial-gradient-shape>' | '<-non-standard-font>' | '<-non-standard-color>' | '<-non-standard-image-rendering>' | '<-non-standard-overflow>' | '<-non-standard-width>' | '<-webkit-gradient()>' | '<-webkit-gradient-color-stop>' | '<-webkit-gradient-point>' | '<-webkit-gradient-radius>' | '<-webkit-gradient-type>' | '<-webkit-mask-box-repeat>' | '<-webkit-mask-clip-style>' | '<-ms-filter-function-list>' | '<-ms-filter-function>' | '<-ms-filter-function-progid>' | '<-ms-filter-function-legacy>' | '<-ms-filter>' | '<age>' | '<attr-name>' | '<attr-fallback>' | '<border-radius>' | '<bottom>' | '<generic-voice>' | '<gender>' | '<left>' | '<mask-image>' | '<name-repeat>' | '<paint>' | '<page-size>' | '<ratio>' | '<right>' | '<svg-length>' | '<svg-writing-mode>' | '<top>' | '<track-group>' | '<track-list-v0>' | '<track-minmax>' | '<x>' | '<y>' | '<declaration>' | '<declaration-list>' | '<url>' | '<url-modifier>' | '<number-zero-one>' | '<number-one-or-greater>' | '<positive-integer>' | '<-non-standard-display>' | '<ident-token>' | '<function-token>' | '<at-keyword-token>' | '<hash-token>' | '<string-token>' | '<bad-string-token>' | '<url-token>' | '<bad-url-token>' | '<delim-token>' | '<number-token>' | '<percentage-token>' | '<dimension-token>' | '<whitespace-token>' | '<CDO-token>' | '<CDC-token>' | '<colon-token>' | '<semicolon-token>' | '<comma-token>' | '<[-token>' | '<]-token>' | '<(-token>' | '<)-token>' | '<{-token>' | '<}-token>' | '<string>' | '<ident>' | '<custom-ident>' | '<custom-property-name>' | '<hex-color>' | '<an-plus-b>' | '<urange>' | '<declaration-value>' | '<any-value>' | '<dimension>' | '<angle>' | '<decibel>' | '<frequency>' | '<flex>' | '<length>' | '<resolution>' | '<semitones>' | '<time>' | '<percentage>' | '<zero>' | '<number>' | '<integer>' | '<-ms-legacy-expression>' | '<bcp-47>') | ('Any' | 'NoEmptyAny' | 'OneLineAny' | 'Zero' | 'Number' | 'Int' | 'Uint' | 'XMLName' | 'DOMID' | 'FunctionBody' | 'Pattern' | 'DateTime' | 'TabIndex' | 'BCP47' | 'URL' | 'AbsoluteURL' | 'HashName' | 'OneCodePointChar' | 'CustomElementName' | 'BrowsingContextName' | 'BrowsingContextNameOrKeyword' | 'HTTPSchemaURL' | 'MIMEType' | 'ItemProp' | 'Srcset' | 'SourceSizeList' | 'IconSize' | 'AutoComplete' | 'Accept' | 'SerializedPermissionsPolicy' | '<css-declaration-list>' | '<class-list>' | '<svg-font-size>' | '<svg-font-size-adjust>' | "<'color-profile'>" | "<'color-rendering'>" | "<'enable-background'>" | '<list-of-svg-feature-string>' | '<animatable-value>' | '<begin-value-list>' | '<end-value-list>' | '<list-of-value>' | '<clock-value>' | '<color-matrix>' | '<dasharray>' | '<key-points>' | '<key-splines>' | '<key-times>' | '<system-language>' | '<origin>' | '<svg-path>' | '<points>' | '<preserve-aspect-ratio>' | '<view-box>' | '<rotate>' | '<text-coordinate>' | '<list-of-lengths>' | '<list-of-numbers>' | '<list-of-percentages>' | '<number-optional-number>') | 'Boolean') | List | Enum | Number;
export type AttributeCondition = string | [string, string, ...string[]];
export interface AttributesSchema {

@@ -55,18 +18,66 @@ tag: string;

'#DocumentElementEventAttrs'?: boolean | ('oncopy' | 'oncut' | 'onpaste')[];
/**
* @minItems 0
*/
'#HTMLLinkAndFetchingAttrs'?: ('crossorigin' | 'download' | 'href' | 'hreflang' | 'integrity' | 'loading' | 'media' | 'ping' | 'referrerpolicy' | 'rel' | 'target' | 'type' | 'fetchpriority')[];
/**
* @minItems 0
*/
'#HTMLEmbededAndMediaContentAttrs'?: ('autoplay' | 'controls' | 'height' | 'loop' | 'muted' | 'preload' | 'sizes' | 'src' | 'srcset' | 'width')[];
/**
* @minItems 0
*/
'#HTMLFormControlElementAttrs'?: ('autocomplete' | 'dirname' | 'disabled' | 'form' | 'formaction' | 'formenctype' | 'formmethod' | 'formnovalidate' | 'formtarget' | 'maxlength' | 'minlength' | 'name' | 'readonly' | 'required')[];
/**
* @minItems 0
*/
'#HTMLTableCellElementAttrs'?: ('colspan' | 'headers' | 'rowspan')[];
'#ARIAAttrs'?: boolean;
/**
* @minItems 0
*/
'#SVGAnimationAdditionAttrs'?: ('additive' | 'accumulate')[];
/**
* @minItems 0
*/
'#SVGAnimationAttributeTargetAttrs'?: ('attributeName' | 'attributeType')[];
/**
* @minItems 0
*/
'#SVGAnimationEventAttrs'?: ('onbegin' | 'onend' | 'onrepeat')[];
/**
* @minItems 0
*/
'#SVGAnimationTargetElementAttrs'?: ('href' | 'xlink:href')[];
/**
* @minItems 0
*/
'#SVGAnimationTimingAttrs'?: ('begin' | 'dur' | 'end' | 'min' | 'max' | 'restart' | 'repeatCount' | 'repeatDur' | 'fill')[];
/**
* @minItems 0
*/
'#SVGAnimationValueAttrs'?: ('calcMode' | 'values' | 'keyTimes' | 'keySplines' | 'from' | 'to' | 'by' | 'accelerate' | 'decelerate' | 'autoReverse' | 'speed')[];
/**
* @minItems 0
*/
'#SVGConditionalProcessingAttrs'?: ('requiredExtensions' | 'systemLanguage' | 'requiredFeatures')[];
/**
* @minItems 0
*/
'#SVGCoreAttrs'?: ('id' | 'tabindex' | 'autofocus' | 'lang' | 'xml:space' | 'class' | 'style' | 'xmlns' | 'xml:lang' | 'xml:base')[];
/**
* @minItems 0
*/
'#SVGFilterPrimitiveAttrs'?: ('x' | 'y' | 'width' | 'height' | 'result' | 'in')[];
/**
* @minItems 0
*/
'#SVGPresentationAttrs'?: ('cx' | 'cy' | 'height' | 'width' | 'x' | 'y' | 'r' | 'rx' | 'ry' | 'd' | 'fill' | 'transform' | 'patternTransform' | 'gradientTransform' | 'alignment-baseline' | 'baseline-shift' | 'clip-path' | 'clip-rule' | 'color' | 'color-interpolation' | 'color-interpolation-filters' | 'cursor' | 'direction' | 'display' | 'dominant-baseline' | 'fill-opacity' | 'fill-rule' | 'filter' | 'flood-color' | 'flood-opacity' | 'font' | 'font-family' | 'font-size' | 'font-size-adjust' | 'font-stretch' | 'font-style' | 'font-variant' | 'font-weight' | 'glyph-orientation-horizontal' | 'glyph-orientation-vertical' | 'image-rendering' | 'isolation' | 'letter-spacing' | 'lighting-color' | 'marker' | 'marker-end' | 'marker-mid' | 'marker-start' | 'mask' | 'mask-type' | 'opacity' | 'overflow' | 'paint-order' | 'pointer-events' | 'shape-rendering' | 'stop-color' | 'stop-opacity' | 'stroke' | 'stroke-dasharray' | 'stroke-dashoffset' | 'stroke-linecap' | 'stroke-linejoin' | 'stroke-miterlimit' | 'stroke-opacity' | 'stroke-width' | 'text-anchor' | 'text-decoration' | 'text-overflow' | 'text-rendering' | 'transform-origin' | 'unicode-bidi' | 'vector-effect' | 'visibility' | 'white-space' | 'word-spacing' | 'writing-mode' | 'clip' | 'color-profile' | 'color-rendering' | 'enable-background' | 'kerning')[];
/**
* @minItems 0
*/
'#SVGTransferFunctionAttrs'?: ('type' | 'tableValues' | 'slope' | 'intercept' | 'amplitude' | 'exponent' | 'offset')[];
/**
* @minItems 0
*/
'#XLinkAttrs'?: ('xlink:href' | 'xlink:title' | 'xlink:actuate' | 'xlink:arcrole' | 'xlink:role' | 'xlink:show' | 'xlink:type')[];

@@ -93,1 +104,45 @@ }

}
/**
* - [Space-separated tokens](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#space-separated-tokens)
* - [Comma-separated tokens](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#comma-separated-tokens)
*/
export interface List {
token: ('Any' | 'NoEmptyAny' | 'OneLineAny' | 'Zero' | 'Number' | 'Int' | 'Uint' | 'XMLName' | 'DOMID' | 'FunctionBody' | 'Pattern' | 'DateTime' | 'TabIndex' | 'BCP47' | 'URL' | 'AbsoluteURL' | 'HashName' | 'OneCodePointChar' | 'CustomElementName' | 'BrowsingContextName' | 'BrowsingContextNameOrKeyword' | 'HTTPSchemaURL' | 'MIMEType' | 'ItemProp' | 'Srcset' | 'SourceSizeList' | 'IconSize' | 'AutoComplete' | 'Accept' | 'SerializedPermissionsPolicy' | '<css-declaration-list>' | '<class-list>' | '<svg-font-size>' | '<svg-font-size-adjust>' | "<'color-profile'>" | "<'color-rendering'>" | "<'enable-background'>" | '<list-of-svg-feature-string>' | '<animatable-value>' | '<begin-value-list>' | '<end-value-list>' | '<list-of-value>' | '<clock-value>' | '<color-matrix>' | '<dasharray>' | '<key-points>' | '<key-splines>' | '<key-times>' | '<system-language>' | '<origin>' | '<svg-path>' | '<points>' | '<preserve-aspect-ratio>' | '<view-box>' | '<rotate>' | '<text-coordinate>' | '<list-of-lengths>' | '<list-of-numbers>' | '<list-of-percentages>' | '<number-optional-number>') | Enum;
disallowToSurroundBySpaces?: boolean;
allowEmpty?: boolean;
ordered?: boolean;
unique?: boolean;
caseInsensitive?: boolean;
number?: ('zeroOrMore' | 'oneOrMore') | {
min: number;
max: number;
};
separator: 'space' | 'comma';
}
/**
* [Enumerated attributes](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute)
*/
export interface Enum {
/**
* @minItems 1
*/
enum: [string, ...string[]];
disallowToSurroundBySpaces?: boolean;
caseInsensitive?: boolean;
invalidValueDefault?: string;
missingValueDefault?: string;
sameStates?: {
[k: string]: unknown;
};
}
/**
* [Numbers](https://html.spec.whatwg.org/dev/common-microsyntaxes.html#numbers)
*/
export interface Number {
type: 'float' | 'integer';
gt?: number;
gte?: number;
lt?: number;
lte?: number;
clampable?: boolean;
}
import type { ARIA } from './aria';
import type { AttributeJSON, AttributeType, GlobalAttributes } from './attributes';
import type { ContentModel, Category } from './permitted-structres';
import type { ContentModel, Category } from './permitted-structures';
import type { NamespaceURI } from '@markuplint/ml-ast';
/**
* markuplit Markup-language spec
* markuplint Markup-language spec
*/

@@ -13,7 +13,7 @@ export interface MLMLSpec {

}
export declare type ExtendedElementSpec = Partial<Omit<ElementSpec, 'name' | 'attributes'>> & {
export type ExtendedElementSpec = Partial<Omit<ElementSpec, 'name' | 'attributes'>> & {
name: ElementSpec['name'];
attributes?: Record<string, Partial<Attribute>>;
};
export declare type ExtendedSpec = {
export type ExtendedSpec = {
cites?: Cites;

@@ -26,4 +26,4 @@ def?: Partial<SpecDefs>;

*/
export declare type Cites = string[];
export declare type SpecDefs = {
export type Cites = string[];
export type SpecDefs = {
'#globalAttrs': Partial<{

@@ -42,3 +42,3 @@ '#extends': Record<string, Partial<Attribute>>;

};
declare type ARIASpec = {
type ARIASpec = {
roles: ARIARoleInSchema[];

@@ -51,3 +51,3 @@ graphicsRoles: ARIARoleInSchema[];

*/
export declare type ElementSpec = {
export type ElementSpec = {
/**

@@ -89,3 +89,3 @@ * Tag name

/**
* Element cateogries
* Element categories
*/

@@ -98,5 +98,5 @@ categories: Category[];

/**
* Tag omittion
* Tag omission
*/
omittion: ElementSpecOmittion;
omission: ElementSpecOmission;
/**

@@ -111,3 +111,3 @@ * Global Attributes

/**
* WAI-ARIA role and properies
* WAI-ARIA role and properties
*/

@@ -125,11 +125,11 @@ aria: ARIA;

};
declare type ElementSpecOmittion = false | ElementSpecOmittionTags;
declare type ElementSpecOmittionTags = {
type ElementSpecOmission = false | ElementSpecOmissionTags;
type ElementSpecOmissionTags = {
startTag: boolean | ElementCondition;
endTag: boolean | ElementCondition;
};
declare type ElementCondition = {
type ElementCondition = {
__WIP__: 'WORK_IN_PROGRESS';
};
export declare type Attribute = {
export type Attribute = {
name: string;

@@ -144,4 +144,4 @@ type: AttributeType | AttributeType[];

} & ExtendableAttributeSpec;
declare type ExtendableAttributeSpec = Omit<AttributeJSON, 'type'>;
export declare type ARIARole = {
type ExtendableAttributeSpec = Omit<AttributeJSON, 'type'>;
export type ARIARole = {
name: string;

@@ -159,3 +159,3 @@ isAbstract: boolean;

};
export declare type ARIARoleInSchema = Partial<ARIARole & {
export type ARIARoleInSchema = Partial<ARIARole & {
description: string;

@@ -166,3 +166,3 @@ generalization: string[];

};
export declare type ARIARoleOwnedProperties = {
export type ARIARoleOwnedProperties = {
name: string;

@@ -173,3 +173,3 @@ inherited?: true;

};
export declare type ARIAProperty = {
export type ARIAProperty = {
name: string;

@@ -189,5 +189,5 @@ type: 'property' | 'state';

};
export declare type ARIAAttributeValue = 'true/false' | 'tristate' | 'true/false/undefined' | 'ID reference' | 'ID reference list' | 'integer' | 'number' | 'string' | 'token' | 'token list' | 'URI';
export declare type ARIAVersion = '1.1' | '1.2';
export declare type EquivalentHtmlAttr = {
export type ARIAAttributeValue = 'true/false' | 'tristate' | 'true/false/undefined' | 'ID reference' | 'ID reference list' | 'integer' | 'number' | 'string' | 'token' | 'token list' | 'URI';
export type ARIAVersion = '1.1' | '1.2';
export type EquivalentHtmlAttr = {
htmlAttrName: string;

@@ -197,4 +197,4 @@ isNotStrictEquivalent?: true;

};
export declare type Matches = (selector: string) => boolean;
export declare type ComputedRole = {
export type Matches = (selector: string) => boolean;
export type ComputedRole = {
el: Element;

@@ -207,3 +207,3 @@ role: (ARIARole & {

};
export declare type RoleComputationError = 'ABSTRACT' | 'GLOBAL_PROP_MUST_NOT_BE_PRESENTATIONAL' | 'IMPLICIT_ROLE_NAMESPACE_ERROR' | 'INTERACTIVE_ELEMENT_MUST_NOT_BE_PRESENTATIONAL' | 'INVALID_LANDMARK' | 'INVALID_REQUIRED_CONTEXT_ROLE' | 'NO_EXPLICIT' | 'NO_OWNER' | 'NO_PERMITTED' | 'REQUIRED_OWNED_ELEMENT_MUST_NOT_BE_PRESENTATIONAL' | 'ROLE_NO_EXISTS';
export type RoleComputationError = 'ABSTRACT' | 'GLOBAL_PROP_MUST_NOT_BE_PRESENTATIONAL' | 'IMPLICIT_ROLE_NAMESPACE_ERROR' | 'INTERACTIVE_ELEMENT_MUST_NOT_BE_PRESENTATIONAL' | 'INVALID_LANDMARK' | 'INVALID_REQUIRED_CONTEXT_ROLE' | 'NO_EXPLICIT' | 'NO_OWNER' | 'NO_PERMITTED' | 'REQUIRED_OWNED_ELEMENT_MUST_NOT_BE_PRESENTATIONAL' | 'ROLE_NO_EXISTS';
export {};

@@ -6,7 +6,6 @@ /**

*/
export declare type PermittedContent = PermittedContentRequire | PermittedContentOptional | PermittedContentOneOrMore | PermittedContentZeroOrMore | PermittedContentChoice | PermittedContentInterleave;
export declare type Target = ContentType | ContentType[];
export declare type ContentType = string | Category;
export declare type Category = '#text' | '#phrasing' | '#flow' | '#interactive' | '#heading' | '#sectioning' | '#metadata' | '#transparent' | '#embedded' | '#palpable' | '#script-supporting' | '#SVGAnimation' | '#SVGBasicShapes' | '#SVGContainer' | '#SVGDescriptive' | '#SVGFilterPrimitive' | '#SVGFont' | '#SVGGradient' | '#SVGGraphics' | '#SVGGraphicsReferencing' | '#SVGLightSource' | '#SVGNeverRendered' | '#SVGNone' | '#SVGPaintServer' | '#SVGRenderable' | '#SVGShape' | '#SVGStructural' | '#SVGStructurallyExternal' | '#SVGTextContent' | '#SVGTextContentChild' | '#SVGOtherXMLNamespace';
export declare type PermittedContentSpec = PermittedContent[];
export type PermittedContentPattern = PermittedContentRequire | PermittedContentOptional | PermittedContentOneOrMore | PermittedContentZeroOrMore | PermittedContentChoice | PermittedContentTransparent;
export type Model = ContentType | ContentType[];
export type ContentType = string | Category;
export type Category = '#text' | '#phrasing' | '#flow' | '#interactive' | '#heading' | '#sectioning' | '#metadata' | '#embedded' | '#palpable' | '#script-supporting' | '#SVGAnimation' | '#SVGBasicShapes' | '#SVGContainer' | '#SVGDescriptive' | '#SVGFilterPrimitive' | '#SVGFont' | '#SVGGradient' | '#SVGGraphics' | '#SVGGraphicsReferencing' | '#SVGLightSource' | '#SVGNeverRendered' | '#SVGNone' | '#SVGPaintServer' | '#SVGRenderable' | '#SVGShape' | '#SVGStructural' | '#SVGStructurallyExternal' | '#SVGTextContent' | '#SVGTextContentChild';
export interface ContentModelsSchema {

@@ -16,13 +15,11 @@ __contentModel?: ContentModel;

export interface ContentModel {
contents: PermittedContentSpec | boolean;
contents: PermittedContentPattern[] | boolean;
descendantOf?: string;
conditional?: {
condition: string;
contents: PermittedContentSpec | boolean;
contents: PermittedContentPattern[] | boolean;
}[];
}
export interface PermittedContentRequire {
require: Target;
ignore?: Target;
notAllowedDescendants?: ContentType[];
require: Model;
max?: number;

@@ -33,5 +30,3 @@ min?: number;

export interface PermittedContentOptional {
optional: Target;
ignore?: Target;
notAllowedDescendants?: ContentType[];
optional: Model;
max?: number;

@@ -41,5 +36,3 @@ _TODO_?: string;

export interface PermittedContentOneOrMore {
oneOrMore: Target | PermittedContentSpec;
ignore?: Target;
notAllowedDescendants?: ContentType[];
oneOrMore: Model | PermittedContentPattern[];
max?: number;

@@ -49,5 +42,3 @@ _TODO_?: string;

export interface PermittedContentZeroOrMore {
zeroOrMore: Target | PermittedContentSpec;
ignore?: Target;
notAllowedDescendants?: ContentType[];
zeroOrMore: Model | PermittedContentPattern[];
max?: number;

@@ -57,14 +48,17 @@ _TODO_?: string;

export interface PermittedContentChoice {
choice: [PermittedContentSpec, PermittedContentSpec] | [PermittedContentSpec, PermittedContentSpec, PermittedContentSpec] | [PermittedContentSpec, PermittedContentSpec, PermittedContentSpec, PermittedContentSpec] | [
PermittedContentSpec,
PermittedContentSpec,
PermittedContentSpec,
PermittedContentSpec,
PermittedContentSpec
/**
* @minItems 2
* @maxItems 5
*/
choice: [PermittedContentPattern[], PermittedContentPattern[]] | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]] | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]] | [
PermittedContentPattern[],
PermittedContentPattern[],
PermittedContentPattern[],
PermittedContentPattern[],
PermittedContentPattern[]
];
_TODO_?: string;
}
export interface PermittedContentInterleave {
interleave: [PermittedContentSpec, PermittedContentSpec, ...PermittedContentSpec[]];
_TODO_?: string;
export interface PermittedContentTransparent {
transparent: string;
}

@@ -1,1 +0,2 @@

export declare function getNS(namespaceURI: string | null): "svg" | "mml" | "html";
import type { Namespace } from '@markuplint/ml-ast';
export declare function getNS(namespaceURI: string | null): Namespace;

@@ -12,2 +12,5 @@ "use strict";

}
case 'http://www.w3.org/1999/xlink': {
return 'xlink';
}
default: {

@@ -14,0 +17,0 @@ return 'html';

@@ -1,2 +0,2 @@

declare type NamedDefinition = string | {
type NamedDefinition = string | {
name: string;

@@ -3,0 +3,0 @@ };

@@ -1,9 +0,9 @@

import type { NamespaceURI } from '@markuplint/ml-ast';
declare type NamespacedElementName = {
import type { NamespaceURI, Namespace } from '@markuplint/ml-ast';
type NamespacedElementName = {
localNameWithNS: string;
localName: string;
namespace: 'html' | 'svg' | 'mml';
namespace: Namespace;
namespaceURI: NamespaceURI;
};
export declare function resolveNamespace(localName: string, namespaceURI?: string | null): NamespacedElementName;
export declare function resolveNamespace(name: string, namespaceURI?: string | null): NamespacedElementName;
export {};

@@ -6,22 +6,27 @@ "use strict";

const cache = new Map();
function resolveNamespace(localName, namespaceURI = 'http://www.w3.org/1999/xhtml') {
const cached = cache.get(localName + namespaceURI);
const namespaceURIMap = {
html: 'http://www.w3.org/1999/xhtml',
svg: 'http://www.w3.org/2000/svg',
mml: 'http://www.w3.org/1998/Math/MathML',
xlink: 'http://www.w3.org/1999/xlink',
};
function resolveNamespace(name, namespaceURI = 'http://www.w3.org/1999/xhtml') {
const cached = cache.get(name + namespaceURI);
if (cached) {
return cached;
}
const name = localName.split(':')[1] || localName;
const ns = (0, get_ns_1.getNS)(namespaceURI || null);
const [_explicitNS, _localName] = name.split(':');
const explicitNS = _localName ? _explicitNS : null;
const localName = _localName !== null && _localName !== void 0 ? _localName : _explicitNS;
const namespace = ['html', 'svg', 'mml', 'xlink'].find(_ns => _ns === (explicitNS || (0, get_ns_1.getNS)(namespaceURI || null))) ||
'html';
const result = {
localNameWithNS: `${ns === 'html' ? '' : `${ns}:`}${name}`,
localName: name,
namespace: ns,
namespaceURI: [
'http://www.w3.org/1999/xhtml',
'http://www.w3.org/2000/svg',
'http://www.w3.org/1998/Math/MathML',
].find(ns => ns === namespaceURI) || 'http://www.w3.org/1999/xhtml',
localNameWithNS: `${namespace === 'html' ? '' : `${namespace}:`}${localName}`,
localName,
namespace,
namespaceURI: namespaceURIMap[namespace],
};
cache.set(localName + namespaceURI, result);
cache.set(name + namespaceURI, result);
return result;
}
exports.resolveNamespace = resolveNamespace;
{
"name": "@markuplint/ml-spec",
"version": "3.0.0-alpha.82+6cde1134",
"version": "3.0.0-rc.0",
"description": "Types and schema that specs of the Markup languages for markuplint",

@@ -25,12 +25,12 @@ "repository": "git@github.com:markuplint/markuplint.git",

"dependencies": {
"@markuplint/ml-ast": "^2.0.0",
"@markuplint/ml-ast": "3.0.0-rc.0",
"dom-accessibility-api": "^0.5.14",
"tslib": "^2.3.1"
"tslib": "^2.4.0"
},
"devDependencies": {
"@markuplint/test-tools": "3.0.0-alpha",
"@markuplint/types": "2.1.0",
"json-schema-to-typescript": "^10.1.5"
"@markuplint/test-tools": "3.0.0-rc.0",
"@markuplint/types": "3.0.0-rc.0",
"json-schema-to-typescript": "^11.0.2"
},
"gitHead": "6cde113402758a8fdbd6a0fcf98e78efd2cdb778"
"gitHead": "f2cf8f0da3900539568e2e8345bf201d41196c1f"
}
# @markuplint/ml-spec
[![npm version](https://badge.fury.io/js/%40markuplint%2Fml-spec.svg)](https://www.npmjs.com/package/@markuplint/ml-spec)
[![Build Status](https://travis-ci.org/markuplint/markuplint.svg?branch=main)](https://travis-ci.org/markuplint/markuplint)
[![Coverage Status](https://coveralls.io/repos/github/markuplint/markuplint/badge.svg?branch=main)](https://coveralls.io/github/markuplint/markuplint?branch=main)
## Install
[`markuplint`](https://www.npmjs.com/package/markuplint) package includes this package.
<details>
<summary>If you are installing purposely, how below:</summary>
```sh

@@ -14,1 +17,3 @@ $ npm install @markuplint/ml-spec

```
</details>

@@ -20,3 +20,3 @@ {

},
"AttributeCtegory": {
"AttributeCategory": {
"enum": ["aria", "eventhandler", "form", "global", "particular", "xml"],

@@ -89,3 +89,3 @@ "type": "string"

"category": {
"$ref": "#/definitions/AttributeCtegory"
"$ref": "#/definitions/AttributeCategory"
},

@@ -167,3 +167,3 @@ "deprecated": {

"category": {
"$ref": "#/definitions/AttributeCtegory"
"$ref": "#/definitions/AttributeCategory"
},

@@ -217,3 +217,3 @@ "deprecated": {

"categories": {
"description": "Element cateogries",
"description": "Element categories",
"items": {

@@ -301,3 +301,3 @@ "anyOf": [

},
"omittion": {
"omission": {
"anyOf": [

@@ -346,3 +346,3 @@ {

],
"description": "Tag omittion"
"description": "Tag omission"
},

@@ -349,0 +349,0 @@ "permittedContent": {

@@ -104,3 +104,3 @@ {

},
"whithout": {
"without": {
"type": "array",

@@ -107,0 +107,0 @@ "minItems": 1,

@@ -11,3 +11,4 @@ {

{
"$ref": "#/definitions/PermittedContentSpec"
"type": "array",
"items": { "$ref": "#/definitions/PermittedContentPattern" }
},

@@ -31,3 +32,4 @@ { "type": "boolean" }

{
"$ref": "#/definitions/PermittedContentSpec"
"type": "array",
"items": { "$ref": "#/definitions/PermittedContentPattern" }
},

@@ -62,3 +64,2 @@ { "type": "boolean" }

"#metadata",
"#transparent",
"#embedded",

@@ -85,7 +86,6 @@ "#palpable",

"#SVGTextContent",
"#SVGTextContentChild",
"#SVGOtherXMLNamespace"
"#SVGTextContentChild"
]
},
"Target": {
"Model": {
"oneOf": [

@@ -100,7 +100,3 @@ { "$ref": "#/definitions/ContentType" },

},
"PermittedContentSpec": {
"type": "array",
"items": { "$ref": "#/definitions/PermittedContent" }
},
"PermittedContent": {
"PermittedContentPattern": {
"type": "object",

@@ -113,3 +109,3 @@ "oneOf": [

{ "$ref": "#/definitions/PermittedContentChoice" },
{ "$ref": "#/definitions/PermittedContentInterleave" }
{ "$ref": "#/definitions/PermittedContentTransparent" }
]

@@ -122,9 +118,3 @@ },

"properties": {
"require": { "$ref": "#/definitions/Target" },
"ignore": { "$ref": "#/definitions/Target" },
"notAllowedDescendants": {
"type": "array",
"items": { "$ref": "#/definitions/ContentType" },
"uniqueItems": true
},
"require": { "$ref": "#/definitions/Model" },
"max": { "type": "number" },

@@ -140,9 +130,3 @@ "min": { "type": "number" },

"properties": {
"optional": { "$ref": "#/definitions/Target" },
"ignore": { "$ref": "#/definitions/Target" },
"notAllowedDescendants": {
"type": "array",
"items": { "$ref": "#/definitions/ContentType" },
"uniqueItems": true
},
"optional": { "$ref": "#/definitions/Model" },
"max": { "type": "number" },

@@ -158,10 +142,10 @@ "_TODO_": { "type": "string" }

"oneOrMore": {
"oneOf": [{ "$ref": "#/definitions/Target" }, { "$ref": "#/definitions/PermittedContentSpec" }]
"oneOf": [
{ "$ref": "#/definitions/Model" },
{
"type": "array",
"items": { "$ref": "#/definitions/PermittedContentPattern" }
}
]
},
"ignore": { "$ref": "#/definitions/Target" },
"notAllowedDescendants": {
"type": "array",
"items": { "$ref": "#/definitions/ContentType" },
"uniqueItems": true
},
"max": { "type": "number" },

@@ -177,10 +161,10 @@ "_TODO_": { "type": "string" }

"zeroOrMore": {
"oneOf": [{ "$ref": "#/definitions/Target" }, { "$ref": "#/definitions/PermittedContentSpec" }]
"oneOf": [
{ "$ref": "#/definitions/Model" },
{
"type": "array",
"items": { "$ref": "#/definitions/PermittedContentPattern" }
}
]
},
"ignore": { "$ref": "#/definitions/Target" },
"notAllowedDescendants": {
"type": "array",
"items": { "$ref": "#/definitions/ContentType" },
"uniqueItems": true
},
"max": { "type": "number" },

@@ -197,3 +181,6 @@ "_TODO_": { "type": "string" }

"type": "array",
"items": { "$ref": "#/definitions/PermittedContentSpec" },
"items": {
"type": "array",
"items": { "$ref": "#/definitions/PermittedContentPattern" }
},
"minItems": 2,

@@ -205,13 +192,10 @@ "maxItems": 5

},
"PermittedContentInterleave": {
"PermittedContentTransparent": {
"type": "object",
"additionalProperties": false,
"required": ["interleave"],
"required": ["transparent"],
"properties": {
"interleave": {
"type": "array",
"items": { "$ref": "#/definitions/PermittedContentSpec" },
"minItems": 2
},
"_TODO_": { "type": "string" }
"transparent": {
"type": "string"
}
}

@@ -218,0 +202,0 @@ }

@@ -10,3 +10,3 @@ import { createJSDOMElement as c } from '@markuplint/test-tools';

expect(getAccname(c('<span aria-label="label">text</span>'))).toBe('label');
expect(getAccname(c('<img alt="alterative-text" />'))).toBe('alterative-text');
expect(getAccname(c('<img alt="alternative-text" />'))).toBe('alternative-text');
expect(getAccname(c('<img title="title" />'))).toBe('title');

@@ -27,3 +27,3 @@ expect(getAccname(c('<div><label for="a">label</label><input id="a" /></div>').children[1])).toBe('label');

*/
test('accname-1.1 Expample 1', () => {
test('accname-1.1 Example 1', () => {
const complex = c(`<div>

@@ -42,3 +42,3 @@ <input id="el1" aria-labelledby="el3" />

*/
test('accname-1.1 Expample 2', () => {
test('accname-1.1 Example 2', () => {
const complex = c(`<ul>

@@ -62,3 +62,3 @@ <li>

*/
test('accname-1.1 Expample 3', () => {
test('accname-1.1 Example 3', () => {
const complex = c(

@@ -65,0 +65,0 @@ '<div role="checkbox" aria-checked="false">Flash the screen <span role="textbox" aria-multiline="false"> 5 </span> times</div>',

@@ -96,3 +96,3 @@ import type { ARIAVersion } from '../types';

test('Presentational Roles Conflict Resolution (2-1) Required Owend Elements', () => {
test('Presentational Roles Conflict Resolution (2-1) Required Owned Elements', () => {
expect(c('<table><tr><td>foo</td></tr></table>', '1.2', 'td').role?.name).toBe('cell');

@@ -99,0 +99,0 @@ expect(c('<table><tr><td role="none">foo</td></tr></table>', '1.2', 'td').role?.name).toBe('cell');

import type { ARIAVersion, ComputedRole, MLMLSpec } from '../types';
import { ariaSpecs } from '../specs/aria-specs';
import { getSelectorsByContentModelCategory } from '../specs/get-selectors-by-content-model-category';
import { isPresentational } from '../specs/is-presentational';

@@ -12,2 +11,3 @@

import { isRequiredOwnedElement } from './has-required-owned-elements';
import { mayBeFocusable } from './may-be-focusable';

@@ -80,34 +80,22 @@ export function getComputedRole(specs: Readonly<MLMLSpec>, el: Element, version: ARIAVersion): ComputedRole {

/**
* Interactive element
* If interactive element
*
* 1. It may be focusable
*
* THIS CONDITION IS ALMOST MEANINGLESS.
* Because it has already been determined that
* the interactive elements can not specify the presentational role
* in the previous processing that computes the permitted role (`getExplicitRole`).
*/
[
/**
* Interactive content
*
* THIS CONDITION(SELECTORS) IS ALMOST MEANINGLESS.
* Because it has already been determined that
* the interactive elements can not specify the presentational role
* in the previous processing that computes the permitted role (`getExplicitRole`).
*
* @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content
*/
...getSelectorsByContentModelCategory(specs, '#interactive'),
/**
* Interaction
*
* @see https://html.spec.whatwg.org/multipage/interaction.html
*/
'[tabindex]',
'[contenteditable]:not([contenteditable="false" i])',
].some(selector => el.matches(selector)) &&
mayBeFocusable(el, specs) &&
/**
* No disabled
* 2. No disabled
*/
!someAncestors(el, p => isEnabledAttr(p, specs, 'disabled')) &&
/**
* No inert
* 3. No inert
*/
!someAncestors(el, p => isEnabledAttr(p, specs, 'inert')) &&
/**
* No hidden
* 4. No hidden
*/

@@ -114,0 +102,0 @@ !someAncestors(el, p => isEnabledAttr(p, specs, 'hidden'))

@@ -1,7 +0,7 @@

import type { MLMLSpec } from '../types';
import type { ElementSpec } from '../types';
import { getSpecByTagName } from '../specs/get-spec-by-tag-name';
export function getSpec(el: Element, schema: MLMLSpec) {
return getSpecByTagName(schema, el.localName, el.namespaceURI);
export function getSpec<K extends keyof ElementSpec>(el: Element, specs: Pick<ElementSpec, 'name' | K>[]) {
return getSpecByTagName(specs, el.localName, el.namespaceURI);
}

@@ -10,2 +10,15 @@ import type { ARIAVersion, ComputedRole, MLMLSpec } from '../types';

export function hasRequiredOwnedElement(el: Element, specs: Readonly<MLMLSpec>, version: ARIAVersion): boolean {
/**
* The element has aria-owns which means it may have owned elements.
*
* THIS CONDITION IS PARTIAL SUPPORT.
*/
if (el.hasAttribute('aria-owns')) {
// FIXME
return true;
}
/**
* Otherwise, traverses descendants to find owned elements.
*/
const computed = getComputedRole(specs, el, version);

@@ -12,0 +25,0 @@ if (!computed.role || computed.role.requiredOwnedElements.length === 0) {

export * from './dom-traverse/accname-computation';
export * from './dom-traverse/get-attr-specs';
export * from './dom-traverse/get-computed-aria-props';
export * from './dom-traverse/get-computed-role';
export * from './dom-traverse/get-content-model';
export * from './dom-traverse/get-implicit-role';

@@ -8,2 +10,4 @@ export * from './dom-traverse/get-permitted-roles';

export * from './dom-traverse/has-required-owned-elements';
export * from './dom-traverse/is-exposed';
export * from './dom-traverse/may-be-focusable';
export * from './specs/aria-specs';

@@ -13,2 +17,4 @@ export * from './specs/content-model-category-to-tag-names';

export * from './specs/get-spec-by-tag-name';
export * from './specs/is-palpable-elements';
export * from './specs/is-void-element';
export * from './specs/schema-to-spec';

@@ -18,3 +24,3 @@ export * from './types';

export * from './types/attributes';
export * from './types/permitted-structres';
export * from './types/permitted-structures';
export * from './utils/resolve-namespace';
import type { MLMLSpec } from '../types';
import type { Category } from '../types/permitted-structres';
import type { Category } from '../types/permitted-structures';
const cache = new Map<Category, ReadonlyArray<string>>();
export function contentModelCategoryToTagNames(contentModel: Category, specs: MLMLSpec): ReadonlyArray<string> {
export function contentModelCategoryToTagNames(contentModel: Category, def: MLMLSpec['def']): ReadonlyArray<string> {
const cached = cache.get(contentModel);

@@ -11,3 +11,3 @@ if (cached) {

}
const tags: string[] | undefined = specs.def['#contentModels'][contentModel];
const tags: string[] | undefined = def['#contentModels'][contentModel];
const sortedTag = Object.freeze(tags && Array.isArray(tags) ? tags.sort() : []);

@@ -14,0 +14,0 @@ cache.set(contentModel, sortedTag);

@@ -24,5 +24,5 @@ import type { ARIAVersion, Matches, MLMLSpec } from '../types';

}
const conds = Object.keys(conditions);
const conditionKeys = Object.keys(conditions);
let { implicitRole, permittedRoles, implicitProperties, properties, namingProhibited } = aria;
for (const cond of conds) {
for (const cond of conditionKeys) {
if (!matches(cond)) {

@@ -58,3 +58,3 @@ continue;

}
const spec = getSpecByTagName(specs, localName, namespace)?.aria;
const spec = getSpecByTagName(specs.specs, localName, namespace)?.aria;
if (!spec) {

@@ -61,0 +61,0 @@ cache.set(key, null);

import type { MLMLSpec } from '../types';
import type { Category } from '../types/permitted-structres';
import type { Category } from '../types/permitted-structures';

@@ -4,0 +4,0 @@ export function getSelectorsByContentModelCategory(

@@ -1,2 +0,2 @@

import specs from '@markuplint/html-spec';
import { specs } from '@markuplint/html-spec';

@@ -11,3 +11,3 @@ import { getSpecByTagName } from './get-spec-by-tag-name';

{
zeroOrMore: '#script-supporting',
zeroOrMore: ':model(script-supporting)',
},

@@ -18,3 +18,3 @@ {

{
zeroOrMore: '#script-supporting',
zeroOrMore: ':model(script-supporting)',
},

@@ -25,3 +25,3 @@ {

{
zeroOrMore: '#script-supporting',
zeroOrMore: ':model(script-supporting)',
},

@@ -33,3 +33,3 @@ ],

{
zeroOrMore: '#flow',
oneOrMore: ':model(flow)',
},

@@ -50,7 +50,7 @@ ],

zeroOrMore: [
'#SVGAnimation',
'#SVGDescriptive',
'#SVGPaintServer',
'#SVGShape',
'#SVGStructural',
':model(SVGAnimation)',
':model(SVGDescriptive)',
':model(SVGPaintServer)',
':model(SVGShape)',
':model(SVGStructural)',
'svg|a',

@@ -57,0 +57,0 @@ 'svg|clipPath',

@@ -1,16 +0,20 @@

import type { ElementSpec, MLMLSpec } from '../types';
import type { ElementSpec } from '../types';
import { resolveNamespace } from '../utils/resolve-namespace';
const cache = new Map<string, ElementSpec | null>();
const cache = new Map<string, any>();
export function getSpecByTagName(specs: Readonly<MLMLSpec>, localName: string, namespace: string | null) {
export function getSpecByTagName<K extends keyof ElementSpec = keyof ElementSpec>(
specs: Readonly<Pick<ElementSpec, 'name' | K>[]>,
localName: string,
namespace: string | null,
) {
const { localNameWithNS } = resolveNamespace(localName, namespace || undefined);
let spec = cache.get(localNameWithNS);
let spec: Pick<ElementSpec, 'name' | K> | null | undefined = cache.get(localNameWithNS);
if (spec !== undefined) {
return spec;
}
spec = specs.specs.find(spec => spec.name === localNameWithNS) || null;
spec = specs.find(spec => spec.name === localNameWithNS) || null;
cache.set(localNameWithNS, spec);
return spec;
}

@@ -8,3 +8,3 @@ import type { ElementSpec, ExtendedSpec, MLMLSpec, Attribute } from '../types';

*
* Ex: `@markuplint/html-spec` + `{ specs: ["@markuplint/vue-spec"] }` in cofigure files.
* Ex: `@markuplint/html-spec` + `{ specs: ["@markuplint/vue-spec"] }` in configure files.
*

@@ -11,0 +11,0 @@ * @param schemas `MLDocument.schemas`

@@ -41,2 +41,5 @@ /* tslint:disable */

role?: true | string | [string, ...string[]];
/**
* @minItems 1
*/
only?: [

@@ -58,3 +61,6 @@ (

];
whithout?: [
/**
* @minItems 1
*/
without?: [
{

@@ -61,0 +67,0 @@ type: 'not-recommended' | 'should-not' | 'must-not';

@@ -1016,107 +1016,5 @@ /* tslint:disable */

)
| {
token:
| (
| 'Any'
| 'NoEmptyAny'
| 'OneLineAny'
| 'Zero'
| 'Number'
| 'Int'
| 'Uint'
| 'XMLName'
| 'DOMID'
| 'FunctionBody'
| 'Pattern'
| 'DateTime'
| 'TabIndex'
| 'BCP47'
| 'URL'
| 'AbsoluteURL'
| 'HashName'
| 'OneCodePointChar'
| 'CustomElementName'
| 'BrowsingContextName'
| 'BrowsingContextNameOrKeyword'
| 'HTTPSchemaURL'
| 'MIMEType'
| 'ItemProp'
| 'Srcset'
| 'SourceSizeList'
| 'IconSize'
| 'AutoComplete'
| 'Accept'
| 'SerializedPermissionsPolicy'
| '<css-declaration-list>'
| '<class-list>'
| '<svg-font-size>'
| '<svg-font-size-adjust>'
| "<'color-profile'>"
| "<'color-rendering'>"
| "<'enable-background'>"
| '<list-of-svg-feature-string>'
| '<animatable-value>'
| '<begin-value-list>'
| '<end-value-list>'
| '<list-of-value>'
| '<clock-value>'
| '<color-matrix>'
| '<dasharray>'
| '<key-points>'
| '<key-splines>'
| '<key-times>'
| '<system-language>'
| '<origin>'
| '<svg-path>'
| '<points>'
| '<preserve-aspect-ratio>'
| '<view-box>'
| '<rotate>'
| '<text-coordinate>'
| '<list-of-lengths>'
| '<list-of-numbers>'
| '<list-of-percentages>'
| '<number-optional-number>'
)
| {
enum: [string, ...string[]];
disallowToSurroundBySpaces?: boolean;
caseInsensitive?: boolean;
invalidValueDefault?: string;
missingValueDefault?: string;
sameStates?: {
[k: string]: unknown;
};
};
disallowToSurroundBySpaces?: boolean;
allowEmpty?: boolean;
ordered?: boolean;
unique?: boolean;
caseInsensitive?: boolean;
number?:
| ('zeroOrMore' | 'oneOrMore')
| {
min: number;
max: number;
};
separator: 'space' | 'comma';
}
| {
enum: [string, ...string[]];
disallowToSurroundBySpaces?: boolean;
caseInsensitive?: boolean;
invalidValueDefault?: string;
missingValueDefault?: string;
sameStates?: {
[k: string]: unknown;
};
}
| {
type: 'float' | 'integer';
gt?: number;
gte?: number;
lt?: number;
lte?: number;
clampable?: boolean;
};
| List
| Enum
| Number;
export type AttributeCondition = string | [string, string, ...string[]];

@@ -1212,2 +1110,5 @@

'#DocumentElementEventAttrs'?: boolean | ('oncopy' | 'oncut' | 'onpaste')[];
/**
* @minItems 0
*/
'#HTMLLinkAndFetchingAttrs'?: (

@@ -1228,2 +1129,5 @@ | 'crossorigin'

)[];
/**
* @minItems 0
*/
'#HTMLEmbededAndMediaContentAttrs'?: (

@@ -1241,2 +1145,5 @@ | 'autoplay'

)[];
/**
* @minItems 0
*/
'#HTMLFormControlElementAttrs'?: (

@@ -1258,8 +1165,26 @@ | 'autocomplete'

)[];
/**
* @minItems 0
*/
'#HTMLTableCellElementAttrs'?: ('colspan' | 'headers' | 'rowspan')[];
'#ARIAAttrs'?: boolean;
/**
* @minItems 0
*/
'#SVGAnimationAdditionAttrs'?: ('additive' | 'accumulate')[];
/**
* @minItems 0
*/
'#SVGAnimationAttributeTargetAttrs'?: ('attributeName' | 'attributeType')[];
/**
* @minItems 0
*/
'#SVGAnimationEventAttrs'?: ('onbegin' | 'onend' | 'onrepeat')[];
/**
* @minItems 0
*/
'#SVGAnimationTargetElementAttrs'?: ('href' | 'xlink:href')[];
/**
* @minItems 0
*/
'#SVGAnimationTimingAttrs'?: (

@@ -1276,2 +1201,5 @@ | 'begin'

)[];
/**
* @minItems 0
*/
'#SVGAnimationValueAttrs'?: (

@@ -1290,3 +1218,9 @@ | 'calcMode'

)[];
/**
* @minItems 0
*/
'#SVGConditionalProcessingAttrs'?: ('requiredExtensions' | 'systemLanguage' | 'requiredFeatures')[];
/**
* @minItems 0
*/
'#SVGCoreAttrs'?: (

@@ -1304,3 +1238,9 @@ | 'id'

)[];
/**
* @minItems 0
*/
'#SVGFilterPrimitiveAttrs'?: ('x' | 'y' | 'width' | 'height' | 'result' | 'in')[];
/**
* @minItems 0
*/
'#SVGPresentationAttrs'?: (

@@ -1389,2 +1329,5 @@ | 'cx'

)[];
/**
* @minItems 0
*/
'#SVGTransferFunctionAttrs'?: (

@@ -1399,2 +1342,5 @@ | 'type'

)[];
/**
* @minItems 0
*/
'#XLinkAttrs'?: (

@@ -1429,1 +1375,110 @@ | 'xlink:href'

}
/**
* - [Space-separated tokens](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#space-separated-tokens)
* - [Comma-separated tokens](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#comma-separated-tokens)
*/
export interface List {
token:
| (
| 'Any'
| 'NoEmptyAny'
| 'OneLineAny'
| 'Zero'
| 'Number'
| 'Int'
| 'Uint'
| 'XMLName'
| 'DOMID'
| 'FunctionBody'
| 'Pattern'
| 'DateTime'
| 'TabIndex'
| 'BCP47'
| 'URL'
| 'AbsoluteURL'
| 'HashName'
| 'OneCodePointChar'
| 'CustomElementName'
| 'BrowsingContextName'
| 'BrowsingContextNameOrKeyword'
| 'HTTPSchemaURL'
| 'MIMEType'
| 'ItemProp'
| 'Srcset'
| 'SourceSizeList'
| 'IconSize'
| 'AutoComplete'
| 'Accept'
| 'SerializedPermissionsPolicy'
| '<css-declaration-list>'
| '<class-list>'
| '<svg-font-size>'
| '<svg-font-size-adjust>'
| "<'color-profile'>"
| "<'color-rendering'>"
| "<'enable-background'>"
| '<list-of-svg-feature-string>'
| '<animatable-value>'
| '<begin-value-list>'
| '<end-value-list>'
| '<list-of-value>'
| '<clock-value>'
| '<color-matrix>'
| '<dasharray>'
| '<key-points>'
| '<key-splines>'
| '<key-times>'
| '<system-language>'
| '<origin>'
| '<svg-path>'
| '<points>'
| '<preserve-aspect-ratio>'
| '<view-box>'
| '<rotate>'
| '<text-coordinate>'
| '<list-of-lengths>'
| '<list-of-numbers>'
| '<list-of-percentages>'
| '<number-optional-number>'
)
| Enum;
disallowToSurroundBySpaces?: boolean;
allowEmpty?: boolean;
ordered?: boolean;
unique?: boolean;
caseInsensitive?: boolean;
number?:
| ('zeroOrMore' | 'oneOrMore')
| {
min: number;
max: number;
};
separator: 'space' | 'comma';
}
/**
* [Enumerated attributes](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute)
*/
export interface Enum {
/**
* @minItems 1
*/
enum: [string, ...string[]];
disallowToSurroundBySpaces?: boolean;
caseInsensitive?: boolean;
invalidValueDefault?: string;
missingValueDefault?: string;
sameStates?: {
[k: string]: unknown;
};
}
/**
* [Numbers](https://html.spec.whatwg.org/dev/common-microsyntaxes.html#numbers)
*/
export interface Number {
type: 'float' | 'integer';
gt?: number;
gte?: number;
lt?: number;
lte?: number;
clampable?: boolean;
}
import type { ARIA } from './aria';
import type { AttributeJSON, AttributeType, GlobalAttributes } from './attributes';
import type { ContentModel, Category } from './permitted-structres';
import type { ContentModel, Category } from './permitted-structures';
import type { NamespaceURI } from '@markuplint/ml-ast';
/**
* markuplit Markup-language spec
* markuplint Markup-language spec
*/

@@ -100,3 +100,3 @@ export interface MLMLSpec {

/**
* Element cateogries
* Element categories
*/

@@ -111,5 +111,5 @@ categories: Category[];

/**
* Tag omittion
* Tag omission
*/
omittion: ElementSpecOmittion;
omission: ElementSpecOmission;

@@ -127,3 +127,3 @@ /**

/**
* WAI-ARIA role and properies
* WAI-ARIA role and properties
*/

@@ -143,5 +143,5 @@ aria: ARIA;

type ElementSpecOmittion = false | ElementSpecOmittionTags;
type ElementSpecOmission = false | ElementSpecOmissionTags;
type ElementSpecOmittionTags = {
type ElementSpecOmissionTags = {
startTag: boolean | ElementCondition;

@@ -148,0 +148,0 @@ endTag: boolean | ElementCondition;

@@ -8,3 +8,3 @@ /* tslint:disable */

export type PermittedContent =
export type PermittedContentPattern =
| PermittedContentRequire

@@ -15,4 +15,4 @@ | PermittedContentOptional

| PermittedContentChoice
| PermittedContentInterleave;
export type Target = ContentType | ContentType[];
| PermittedContentTransparent;
export type Model = ContentType | ContentType[];
export type ContentType = string | Category;

@@ -27,3 +27,2 @@ export type Category =

| '#metadata'
| '#transparent'
| '#embedded'

@@ -50,5 +49,3 @@ | '#palpable'

| '#SVGTextContent'
| '#SVGTextContentChild'
| '#SVGOtherXMLNamespace';
export type PermittedContentSpec = PermittedContent[];
| '#SVGTextContentChild';

@@ -59,13 +56,11 @@ export interface ContentModelsSchema {

export interface ContentModel {
contents: PermittedContentSpec | boolean;
contents: PermittedContentPattern[] | boolean;
descendantOf?: string;
conditional?: {
condition: string;
contents: PermittedContentSpec | boolean;
contents: PermittedContentPattern[] | boolean;
}[];
}
export interface PermittedContentRequire {
require: Target;
ignore?: Target;
notAllowedDescendants?: ContentType[];
require: Model;
max?: number;

@@ -76,5 +71,3 @@ min?: number;

export interface PermittedContentOptional {
optional: Target;
ignore?: Target;
notAllowedDescendants?: ContentType[];
optional: Model;
max?: number;

@@ -84,5 +77,3 @@ _TODO_?: string;

export interface PermittedContentOneOrMore {
oneOrMore: Target | PermittedContentSpec;
ignore?: Target;
notAllowedDescendants?: ContentType[];
oneOrMore: Model | PermittedContentPattern[];
max?: number;

@@ -92,5 +83,3 @@ _TODO_?: string;

export interface PermittedContentZeroOrMore {
zeroOrMore: Target | PermittedContentSpec;
ignore?: Target;
notAllowedDescendants?: ContentType[];
zeroOrMore: Model | PermittedContentPattern[];
max?: number;

@@ -100,18 +89,21 @@ _TODO_?: string;

export interface PermittedContentChoice {
/**
* @minItems 2
* @maxItems 5
*/
choice:
| [PermittedContentSpec, PermittedContentSpec]
| [PermittedContentSpec, PermittedContentSpec, PermittedContentSpec]
| [PermittedContentSpec, PermittedContentSpec, PermittedContentSpec, PermittedContentSpec]
| [PermittedContentPattern[], PermittedContentPattern[]]
| [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]]
| [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]]
| [
PermittedContentSpec,
PermittedContentSpec,
PermittedContentSpec,
PermittedContentSpec,
PermittedContentSpec,
PermittedContentPattern[],
PermittedContentPattern[],
PermittedContentPattern[],
PermittedContentPattern[],
PermittedContentPattern[],
];
_TODO_?: string;
}
export interface PermittedContentInterleave {
interleave: [PermittedContentSpec, PermittedContentSpec, ...PermittedContentSpec[]];
_TODO_?: string;
export interface PermittedContentTransparent {
transparent: string;
}

@@ -1,2 +0,4 @@

export function getNS(namespaceURI: string | null) {
import type { Namespace } from '@markuplint/ml-ast';
export function getNS(namespaceURI: string | null): Namespace {
switch (namespaceURI) {

@@ -9,2 +11,5 @@ case 'http://www.w3.org/2000/svg': {

}
case 'http://www.w3.org/1999/xlink': {
return 'xlink';
}
default: {

@@ -11,0 +16,0 @@ return 'html';

@@ -1,2 +0,2 @@

import type { NamespaceURI } from '@markuplint/ml-ast';
import type { NamespaceURI, Namespace } from '@markuplint/ml-ast';

@@ -10,28 +10,32 @@ import { getNS } from './get-ns';

localName: string;
namespace: 'html' | 'svg' | 'mml';
namespace: Namespace;
namespaceURI: NamespaceURI;
};
export function resolveNamespace(localName: string, namespaceURI: string | null = 'http://www.w3.org/1999/xhtml') {
const cached = cache.get(localName + namespaceURI);
const namespaceURIMap: Record<Namespace, NamespaceURI> = {
html: 'http://www.w3.org/1999/xhtml',
svg: 'http://www.w3.org/2000/svg',
mml: 'http://www.w3.org/1998/Math/MathML',
xlink: 'http://www.w3.org/1999/xlink',
};
export function resolveNamespace(name: string, namespaceURI: string | null = 'http://www.w3.org/1999/xhtml') {
const cached = cache.get(name + namespaceURI);
if (cached) {
return cached;
}
const name = localName.split(':')[1] || localName;
const ns = getNS(namespaceURI || null);
const [_explicitNS, _localName] = name.split(':');
const explicitNS = _localName ? _explicitNS : null;
const localName = _localName ?? _explicitNS;
const namespace =
(['html', 'svg', 'mml', 'xlink'] as const).find(_ns => _ns === (explicitNS || getNS(namespaceURI || null))) ||
'html';
const result: NamespacedElementName = {
localNameWithNS: `${ns === 'html' ? '' : `${ns}:`}${name}`,
localName: name,
namespace: ns,
namespaceURI:
(
[
'http://www.w3.org/1999/xhtml',
'http://www.w3.org/2000/svg',
'http://www.w3.org/1998/Math/MathML',
] as const
).find(ns => ns === namespaceURI) || 'http://www.w3.org/1999/xhtml',
localNameWithNS: `${namespace === 'html' ? '' : `${namespace}:`}${localName}`,
localName,
namespace,
namespaceURI: namespaceURIMap[namespace],
};
cache.set(localName + namespaceURI, result);
cache.set(name + namespaceURI, result);
return result;
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc