refactor(ivy): move instructions (#29646)
- moves all publicly exported instructions to their own files - refactors namespace instructions to set state in `state.ts` - no longer exports * from `instructions.ts`. - `instructions.ts` renamed to `shared.ts` (old `shared.ts` contents folded in to `instructions.ts`) - updates `all.ts` to re-export from public instruction files. PR Close #29646
This commit is contained in:
@ -365,3 +365,32 @@ export function getSelectedIndex() {
|
||||
export function setSelectedIndex(index: number) {
|
||||
_selectedIndex = index;
|
||||
}
|
||||
|
||||
|
||||
let _currentNamespace: string|null = null;
|
||||
|
||||
/**
|
||||
* Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.
|
||||
*/
|
||||
export function namespaceSVG() {
|
||||
_currentNamespace = 'http://www.w3.org/2000/svg';
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the namespace used to create elements to `'http://www.w3.org/1998/MathML/'` in global state.
|
||||
*/
|
||||
export function namespaceMathML() {
|
||||
_currentNamespace = 'http://www.w3.org/1998/MathML/';
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the namespace used to create elements no `null`, which forces element creation to use
|
||||
* `createElement` rather than `createElementNS`.
|
||||
*/
|
||||
export function namespaceHTML() {
|
||||
_currentNamespace = null;
|
||||
}
|
||||
|
||||
export function getNamespace(): string|null {
|
||||
return _currentNamespace;
|
||||
}
|
||||
|
Reference in New Issue
Block a user