1 line
5.3 KiB
Plaintext
1 line
5.3 KiB
Plaintext
{"version":3,"file":"accessibilityTarget.mjs","sources":["../../src/accessibility/accessibilityTarget.ts"],"sourcesContent":["import type { Container } from '../scene/container/Container';\n\n/**\n * The type of the pointer event to listen for.\n * Can be any of the following:\n * - `auto`\n * - `none`\n * - `visiblePainted`\n * - `visibleFill`\n * - `visibleStroke`\n * - `visible`\n * - `painted`\n * - `fill`\n * - `stroke`\n * - `all`\n * - `inherit`\n * @memberof accessibility\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events\n */\nexport type PointerEvents = 'auto'\n| 'none'\n| 'visiblePainted'\n| 'visibleFill'\n| 'visibleStroke'\n| 'visible'\n| 'painted'\n| 'fill'\n| 'stroke'\n| 'all'\n| 'inherit';\n\n/**\n * When `accessible` is enabled on any display object, these properties will affect its accessibility.\n * @memberof accessibility\n */\nexport interface AccessibleOptions\n{\n /**\n * Flag for if the object is accessible. If true AccessibilityManager will overlay a\n * shadow div with attributes set\n * @default false\n */\n accessible: boolean;\n /**\n * Sets the title attribute of the shadow div\n * If accessibleTitle AND accessibleHint has not been this will default to 'container [tabIndex]'\n * @member {string}\n */\n accessibleTitle: string | null;\n /** Sets the aria-label attribute of the shadow div */\n accessibleHint: string | null;\n /**\n * @default 0\n */\n tabIndex: number;\n /**\n * Specify the type of div the accessible layer is. Screen readers treat the element differently\n * depending on this type. Defaults to button.\n * @default 'button'\n */\n accessibleType: string;\n /**\n * Specify the pointer-events the accessible div will use\n * Defaults to auto.\n * @default 'auto'\n * @type {accessibility.PointerEvents}\n */\n accessiblePointerEvents: PointerEvents;\n /**\n * Setting to false will prevent any children inside this container to\n * be accessible. Defaults to true.\n * @default true\n */\n accessibleChildren: boolean;\n}\n\n/**\n * The Accessibility object is attached to the {@link Container}.\n * @private\n */\nexport interface AccessibleTarget extends AccessibleOptions\n{\n _accessibleActive: boolean;\n _accessibleDiv: AccessibleHTMLElement | null;\n _renderId: number;\n}\n\nexport interface AccessibleHTMLElement extends HTMLElement\n{\n type?: string;\n container?: Container;\n}\n\n/**\n * Default property values of accessible objects\n * used by {@link AccessibilitySystem}.\n * @private\n * @example\n * import { accessibleTarget } from 'pixi.js';\n *\n * function MyObject() {}\n * Object.assign(MyObject.prototype, accessibleTarget);\n */\nexport const accessibilityTarget: AccessibleTarget = {\n /**\n * Flag for if the object is accessible. If true AccessibilityManager will overlay a\n * shadow div with attributes set\n * @member {boolean}\n * @memberof scene.Container#\n */\n accessible: false,\n\n /**\n * Sets the title attribute of the shadow div\n * If accessibleTitle AND accessibleHint has not been this will default to 'container [tabIndex]'\n * @member {string}\n * @memberof scene.Container#\n */\n accessibleTitle: null,\n\n /**\n * Sets the aria-label attribute of the shadow div\n * @member {string}\n * @memberof scene.Container#\n */\n accessibleHint: null,\n\n /**\n * @member {number}\n * @memberof scene.Container#\n * @todo Needs docs.\n */\n tabIndex: 0,\n\n /**\n * @member {boolean}\n * @memberof scene.Container#\n * @private\n */\n _accessibleActive: false,\n\n /**\n * @memberof scene.Container#\n * @private\n */\n _accessibleDiv: null,\n\n /**\n * Specify the type of div the accessible layer is. Screen readers treat the element differently\n * depending on this type. Defaults to button.\n * @member {string}\n * @memberof scene.Container#\n * @default 'button'\n */\n accessibleType: 'button',\n\n /**\n * Specify the pointer-events the accessible div will use\n * Defaults to auto.\n * @type {PointerEvents}\n * @memberof scene.Container#\n * @default 'auto'\n */\n accessiblePointerEvents: 'auto',\n\n /**\n * Setting to false will prevent any children inside this container to\n * be accessible. Defaults to true.\n * @member {boolean}\n * @memberof scene.Container#\n * @default true\n */\n accessibleChildren: true,\n\n /**\n * @member {number}\n * @memberof scene.Container#\n * @private\n */\n _renderId: -1,\n};\n"],"names":[],"mappings":";AAuGO,MAAM,mBAAwC,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOjD,UAAY,EAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQZ,eAAiB,EAAA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOjB,cAAgB,EAAA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhB,QAAU,EAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOV,iBAAmB,EAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,cAAgB,EAAA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAShB,cAAgB,EAAA,QAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAShB,uBAAyB,EAAA,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASzB,kBAAoB,EAAA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOpB,SAAW,EAAA,CAAA,CAAA;AACf;;;;"} |