Revert "feat(ivy): support for i18n & ICU expressions (#26275)"
This reverts commit a63fd2d0f5
.
This commit is contained in:
@ -16,32 +16,24 @@
|
||||
*
|
||||
* See: `I18nCreateOpCodes` for example of usage.
|
||||
*/
|
||||
import {SanitizerFn} from './sanitization';
|
||||
|
||||
export const enum I18nMutateOpCode {
|
||||
/// Stores shift amount for bits 17-3 that contain reference index.
|
||||
SHIFT_REF = 3,
|
||||
/// Stores shift amount for bits 17-2 that contain reference index.
|
||||
SHIFT_REF = 2,
|
||||
/// Stores shift amount for bits 31-17 that contain parent index.
|
||||
SHIFT_PARENT = 17,
|
||||
/// Mask for OpCode
|
||||
MASK_OPCODE = 0b111,
|
||||
MASK_OPCODE = 0b11,
|
||||
/// Mask for reference index.
|
||||
MASK_REF = ((2 ^ 16) - 1) << SHIFT_REF,
|
||||
|
||||
/// OpCode to select a node. (next OpCode will contain the operation.)
|
||||
Select = 0b000,
|
||||
Select = 0b00,
|
||||
/// OpCode to append the current node to `PARENT`.
|
||||
AppendChild = 0b001,
|
||||
AppendChild = 0b01,
|
||||
/// OpCode to insert the current node to `PARENT` before `REF`.
|
||||
InsertBefore = 0b010,
|
||||
InsertBefore = 0b10,
|
||||
/// OpCode to remove the `REF` node from `PARENT`.
|
||||
Remove = 0b011,
|
||||
/// OpCode to set the attribute of a node.
|
||||
Attr = 0b100,
|
||||
/// OpCode to simulate elementEnd()
|
||||
ElementEnd = 0b101,
|
||||
/// OpCode to read the remove OpCodes for the nested ICU
|
||||
RemoveNestedIcu = 0b110,
|
||||
Remove = 0b11,
|
||||
}
|
||||
|
||||
/**
|
||||
@ -122,8 +114,8 @@ export interface COMMENT_MARKER { marker: 'comment'; }
|
||||
* // For removing existing nodes
|
||||
* // --------------------------------------------------
|
||||
* // const node = lViewData[1];
|
||||
* // removeChild(tView.data(1), node, lViewData);
|
||||
* 1 << SHIFT_REF | Remove,
|
||||
* // lViewData[2].remove(node);
|
||||
* 2 << SHIFT_PARENT | 1 << SHIFT_REF | Remove,
|
||||
*
|
||||
* // For writing attributes
|
||||
* // --------------------------------------------------
|
||||
@ -186,7 +178,7 @@ export const enum I18nUpdateOpCode {
|
||||
* }
|
||||
* ```
|
||||
* We can assume that each call to `i18nExp` sets an internal `changeMask` bit depending on the
|
||||
* index of `i18nExp`.
|
||||
* index of `i18nExp` index.
|
||||
*
|
||||
* OpCodes
|
||||
* ```
|
||||
@ -230,7 +222,7 @@ export const enum I18nUpdateOpCode {
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
export interface I18nUpdateOpCodes extends Array<string|number|SanitizerFn|null> {}
|
||||
export interface I18nUpdateOpCodes extends Array<string|number|((text: string) => string | null)> {}
|
||||
|
||||
/**
|
||||
* Store information for the i18n translation block.
|
||||
@ -363,6 +355,10 @@ export interface TIcu {
|
||||
update: I18nUpdateOpCodes[];
|
||||
}
|
||||
|
||||
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
||||
// failure based on types.
|
||||
export const unusedValueExportToPlacateAjd = 1;
|
||||
/**
|
||||
* Stores currently selected case in each ICU.
|
||||
*
|
||||
* For each ICU in translation, the `Li18n` stores the currently selected case for the current
|
||||
* `LView`. For perf reasons this array is only created if a translation block has an ICU.
|
||||
*/
|
||||
export interface LI18n extends Array<number> {}
|
||||
|
Reference in New Issue
Block a user