UNPKG

@lynx-js/web-core

Version:

This is an internal experimental package, do not use

115 lines 4.52 kB
// Copyright 2023 The Lynx Authors. All rights reserved. // Licensed under the Apache License Version 2.0 that can be found in the // LICENSE file in the root directory of this source tree. export const lynxUniqueIdAttribute = /*#__PURE__*/ 'l-uid'; export const cssIdAttribute = /*#__PURE__*/ 'l-css-id'; export const lynxEntryNameAttribute = /*#__PURE__*/ 'l-e-name'; export const lynxDisposedAttribute = /*#__PURE__*/ 'l-disposed'; export const lynxElementTemplateMarkerAttribute = /*#__PURE__*/ 'l-template'; export const lynxPartIdAttribute = /*#__PURE__*/ 'dirtyID'; export const lynxDefaultDisplayLinearAttribute = /*#__PURE__*/ 'lynx-default-display-linear'; export const lynxDefaultOverflowVisibleAttribute /*#__PURE__*/ = 'lynx-default-overflow-visible'; export const LYNX_TIMING_FLAG_ATTRIBUTE = /*#__PURE__*/ '__lynx_timing_flag'; export const i18nResourceMissedEventName = 'i18nResourceMissed'; export const uniqueIdSymbol = /*#__PURE__*/ Symbol('uniqueId'); export const systemInfoBase = /*#__PURE__*/ { platform: 'web', lynxSdkVersion: '3.0', }; export const W3cEventNameToLynx = /*#__PURE__*/ { click: 'tap', lynxscroll: 'scroll', lynxscrollend: 'scrollend', overlaytouch: 'touch', lynxfocus: 'focus', lynxblur: 'blur', lynxinput: 'input', }; export const LynxEventNameToW3cCommon = /*#__PURE__*/ Object.fromEntries(Object.entries(W3cEventNameToLynx).map(([k, v]) => [v, k])); export const MagicHeader0 = /*#__PURE__*/ 0x41524453; // 'SDRA' export const MagicHeader1 = /*#__PURE__*/ 0x464F5257; // 'WROF' export const TemplateSectionLabel = /*#__PURE__*/ { Manifest: 1, StyleInfo: 2, LepusCode: 3, CustomSections: 4, ElementTemplates: 5, Configurations: 6, }; /** * const enum will be shakedown in Typescript Compiler */ export var ErrorCode; (function (ErrorCode) { ErrorCode[ErrorCode["SUCCESS"] = 0] = "SUCCESS"; ErrorCode[ErrorCode["UNKNOWN"] = 1] = "UNKNOWN"; ErrorCode[ErrorCode["NODE_NOT_FOUND"] = 2] = "NODE_NOT_FOUND"; ErrorCode[ErrorCode["METHOD_NOT_FOUND"] = 3] = "METHOD_NOT_FOUND"; ErrorCode[ErrorCode["PARAM_INVALID"] = 4] = "PARAM_INVALID"; ErrorCode[ErrorCode["SELECTOR_NOT_SUPPORTED"] = 5] = "SELECTOR_NOT_SUPPORTED"; ErrorCode[ErrorCode["NO_UI_FOR_NODE"] = 6] = "NO_UI_FOR_NODE"; })(ErrorCode || (ErrorCode = {})); export const LYNX_TAG_TO_HTML_TAG_MAP = /*#__PURE__*/ Object.freeze(Object.assign(Object.create(null), { 'view': 'x-view', 'text': 'x-text', 'image': 'x-image', 'raw-text': 'raw-text', 'scroll-view': 'x-scroll-view', 'wrapper': 'lynx-wrapper', 'list': 'x-list', 'page': 'div', 'input': 'x-input', 'x-input-ng': 'x-input', 'svg': 'x-svg', })); export const HTML_TAG_TO_LYNX_TAG_MAP = /*#__PURE__*/ Object.freeze(Object.assign(Object.create(null), Object.fromEntries(Object.entries(LYNX_TAG_TO_HTML_TAG_MAP).map(([k, v]) => [v, k])))); /** * also see packages/web-platform/web-core/src/constants.rs */ export const LYNX_TAG_TO_DYNAMIC_LOAD_TAG_ID = /*#__PURE__*/ Object .freeze(Object.assign(Object.create(null), { 'list': 0, 'x-swiper': 1, 'x-input': 2, 'x-input-ng': 2, 'input': 2, 'x-textarea': 3, 'x-audio-tt': 4, 'x-foldview-ng': 5, 'x-foldview-header-ng': 5, 'x-foldview-slot-drag-ng': 5, 'x-foldview-slot-ng': 5, 'x-foldview-toolbar-ng': 5, 'x-refresh-view': 6, 'x-refresh-header': 6, 'x-refresh-footer': 6, 'x-overlay-ng': 7, 'x-viewpager-ng': 8, 'x-viewpager-item-ng': 8, })); export const scrollContainerDom = Symbol.for('lynx-scroll-container-dom'); export const loadUnknownElementEventName = 'loadUnknownElement'; export var IdentifierType; (function (IdentifierType) { IdentifierType[IdentifierType["ID_SELECTOR"] = 0] = "ID_SELECTOR"; /** * @deprecated */ IdentifierType[IdentifierType["REF_ID"] = 1] = "REF_ID"; IdentifierType[IdentifierType["UNIQUE_ID"] = 2] = "UNIQUE_ID"; })(IdentifierType || (IdentifierType = {})); export var AnimationOperation; (function (AnimationOperation) { AnimationOperation[AnimationOperation["START"] = 0] = "START"; AnimationOperation[AnimationOperation["PLAY"] = 1] = "PLAY"; AnimationOperation[AnimationOperation["PAUSE"] = 2] = "PAUSE"; AnimationOperation[AnimationOperation["CANCEL"] = 3] = "CANCEL"; AnimationOperation[AnimationOperation["FINISH"] = 4] = "FINISH"; })(AnimationOperation || (AnimationOperation = {})); //# sourceMappingURL=constants.js.map