@dcloudio/uni-shared
Advanced tools
Comparing version 3.0.0-alpha-3000020210611006 to 3.0.0-alpha-3000020210618002
@@ -370,2 +370,17 @@ 'use strict'; | ||
style: '.s', | ||
onClick: '.e0', | ||
onChange: '.e1', | ||
onInput: '.e2', | ||
onLoad: '.e3', | ||
onError: '.e4', | ||
onTouchstart: '.e5', | ||
onTouchmove: '.e6', | ||
onTouchcancel: '.e7', | ||
onTouchend: '.e8', | ||
onLongpress: '.e9', | ||
onTransitionend: '.ea', | ||
onAnimationstart: '.eb', | ||
onAnimationiteration: '.ec', | ||
onAnimationend: '.ed', | ||
onTouchforcechange: '.ee', | ||
}; | ||
@@ -375,9 +390,2 @@ function encodeAttr(name) { | ||
} | ||
const ATTR_RESTORE_MAP = { | ||
'.c': 'class', | ||
'.s': 'style', | ||
}; | ||
function decodeAttr(name) { | ||
return ATTR_RESTORE_MAP[name] || name; | ||
} | ||
const COMPONENT_MAP = { | ||
@@ -431,51 +439,2 @@ VIEW: 1, | ||
} | ||
const COMPONENT_ARR = [ | ||
'', | ||
'view', | ||
'image', | ||
'text', | ||
'#text', | ||
'#comment', | ||
'navigator', | ||
'form', | ||
'button', | ||
'input', | ||
'label', | ||
'radio', | ||
'checkbox', | ||
'checkbox-group', | ||
'ad', | ||
'audio', | ||
'camera', | ||
'canvas', | ||
'cover-image', | ||
'cover-view', | ||
'editor', | ||
'functional-page-navigator', | ||
'icon', | ||
'radio-group', | ||
'live-player', | ||
'live-pusher', | ||
'map', | ||
'movable-area', | ||
'movable-view', | ||
'official-account', | ||
'open-data', | ||
'picker', | ||
'picker-view', | ||
'picker-view-column', | ||
'progress', | ||
'rich-text', | ||
'scroll-view', | ||
'slider', | ||
'swiper', | ||
'swiper-item', | ||
'switch', | ||
'textarea', | ||
'video', | ||
'web-view', | ||
]; | ||
function decodeTag(tag) { | ||
return COMPONENT_ARR[tag] || tag; | ||
} | ||
@@ -634,3 +593,3 @@ const NODE_TYPE_PAGE = 0; | ||
const normalized = normalizeEventType(type); | ||
if (this.attributes[normalized]) { | ||
if (this.attributes[encodeAttr(normalized)]) { | ||
this.removeAttribute(normalized); | ||
@@ -720,2 +679,24 @@ } | ||
const DECODED_ATTR_MAP = /*#__PURE__*/ Object.keys(ATTR_MAP).reduce((map, name) => { | ||
map[ATTR_MAP[name]] = name; | ||
return map; | ||
}, Object.create(null)); | ||
function decodeAttr(name) { | ||
return DECODED_ATTR_MAP[name] || name; | ||
} | ||
const DECODED_COMPONENT_ARR = /*#__PURE__*/ Object.keys(COMPONENT_MAP).reduce((arr, name) => { | ||
arr.push(name.toLowerCase()); | ||
return arr; | ||
}, ['']); | ||
function decodeTag(tag) { | ||
return DECODED_COMPONENT_ARR[tag] || tag; | ||
} | ||
const cacheStringFunction = (fn) => { | ||
const cache = Object.create(null); | ||
return ((str) => { | ||
const hit = cache[str]; | ||
return hit || (cache[str] = fn(str)); | ||
}); | ||
}; | ||
function getLen(str = '') { | ||
@@ -892,2 +873,5 @@ return ('' + str).replace(/[^\x00-\xff]/g, '**').length; | ||
const UNI_SSR_GLOBAL_DATA = 'globalData'; | ||
const SCHEME_RE = /^([a-z-]+:)?\/\//i; | ||
const DATA_RE = /^data:.*,.*/; | ||
const WEB_INVOKE_APPSERVICE = 'WEB_INVOKE_APPSERVICE'; | ||
@@ -904,2 +888,3 @@ function getEnvLocale() { | ||
exports.COMPONENT_SELECTOR_PREFIX = COMPONENT_SELECTOR_PREFIX; | ||
exports.DATA_RE = DATA_RE; | ||
exports.NAVBAR_HEIGHT = NAVBAR_HEIGHT; | ||
@@ -914,2 +899,3 @@ exports.NODE_TYPE_COMMENT = NODE_TYPE_COMMENT; | ||
exports.RESPONSIVE_MIN_WIDTH = RESPONSIVE_MIN_WIDTH; | ||
exports.SCHEME_RE = SCHEME_RE; | ||
exports.TABBAR_HEIGHT = TABBAR_HEIGHT; | ||
@@ -930,3 +916,5 @@ exports.TAGS = TAGS; | ||
exports.UniTextNode = UniTextNode; | ||
exports.WEB_INVOKE_APPSERVICE = WEB_INVOKE_APPSERVICE; | ||
exports.addFont = addFont; | ||
exports.cacheStringFunction = cacheStringFunction; | ||
exports.callOptions = callOptions; | ||
@@ -933,0 +921,0 @@ exports.createRpx2Unit = createRpx2Unit; |
@@ -7,2 +7,4 @@ import { FontFaceDescriptors } from 'css-font-loading-module'; | ||
export declare const cacheStringFunction: <T extends (str: string) => string>(fn: T) => T; | ||
export declare function callOptions(options: Options, errMsg: string): void; | ||
@@ -23,2 +25,4 @@ | ||
export declare const DATA_RE: RegExp; | ||
export declare function debounce(fn: Function, delay: number): { | ||
@@ -38,3 +42,3 @@ (this: any): void; | ||
export declare function decodeAttr(name: string): string; | ||
export declare function decodeAttr(name: string): any; | ||
@@ -150,2 +154,4 @@ export declare function decodedQuery(query?: Record<string, any>): Record<string, string>; | ||
export declare const SCHEME_RE: RegExp; | ||
declare function scrollTo_2(scrollTop: number | string, duration: number): void; | ||
@@ -317,2 +323,4 @@ export { scrollTo_2 as scrollTo } | ||
export declare const WEB_INVOKE_APPSERVICE = "WEB_INVOKE_APPSERVICE"; | ||
export { } |
@@ -366,2 +366,17 @@ import { camelize, extend, isString, isHTMLTag, isSVGTag, capitalize, isPlainObject, isArray } from '@vue/shared'; | ||
style: '.s', | ||
onClick: '.e0', | ||
onChange: '.e1', | ||
onInput: '.e2', | ||
onLoad: '.e3', | ||
onError: '.e4', | ||
onTouchstart: '.e5', | ||
onTouchmove: '.e6', | ||
onTouchcancel: '.e7', | ||
onTouchend: '.e8', | ||
onLongpress: '.e9', | ||
onTransitionend: '.ea', | ||
onAnimationstart: '.eb', | ||
onAnimationiteration: '.ec', | ||
onAnimationend: '.ed', | ||
onTouchforcechange: '.ee', | ||
}; | ||
@@ -371,9 +386,2 @@ function encodeAttr(name) { | ||
} | ||
const ATTR_RESTORE_MAP = { | ||
'.c': 'class', | ||
'.s': 'style', | ||
}; | ||
function decodeAttr(name) { | ||
return ATTR_RESTORE_MAP[name] || name; | ||
} | ||
const COMPONENT_MAP = { | ||
@@ -427,51 +435,2 @@ VIEW: 1, | ||
} | ||
const COMPONENT_ARR = [ | ||
'', | ||
'view', | ||
'image', | ||
'text', | ||
'#text', | ||
'#comment', | ||
'navigator', | ||
'form', | ||
'button', | ||
'input', | ||
'label', | ||
'radio', | ||
'checkbox', | ||
'checkbox-group', | ||
'ad', | ||
'audio', | ||
'camera', | ||
'canvas', | ||
'cover-image', | ||
'cover-view', | ||
'editor', | ||
'functional-page-navigator', | ||
'icon', | ||
'radio-group', | ||
'live-player', | ||
'live-pusher', | ||
'map', | ||
'movable-area', | ||
'movable-view', | ||
'official-account', | ||
'open-data', | ||
'picker', | ||
'picker-view', | ||
'picker-view-column', | ||
'progress', | ||
'rich-text', | ||
'scroll-view', | ||
'slider', | ||
'swiper', | ||
'swiper-item', | ||
'switch', | ||
'textarea', | ||
'video', | ||
'web-view', | ||
]; | ||
function decodeTag(tag) { | ||
return COMPONENT_ARR[tag] || tag; | ||
} | ||
@@ -630,3 +589,3 @@ const NODE_TYPE_PAGE = 0; | ||
const normalized = normalizeEventType(type); | ||
if (this.attributes[normalized]) { | ||
if (this.attributes[encodeAttr(normalized)]) { | ||
this.removeAttribute(normalized); | ||
@@ -716,2 +675,24 @@ } | ||
const DECODED_ATTR_MAP = /*#__PURE__*/ Object.keys(ATTR_MAP).reduce((map, name) => { | ||
map[ATTR_MAP[name]] = name; | ||
return map; | ||
}, Object.create(null)); | ||
function decodeAttr(name) { | ||
return DECODED_ATTR_MAP[name] || name; | ||
} | ||
const DECODED_COMPONENT_ARR = /*#__PURE__*/ Object.keys(COMPONENT_MAP).reduce((arr, name) => { | ||
arr.push(name.toLowerCase()); | ||
return arr; | ||
}, ['']); | ||
function decodeTag(tag) { | ||
return DECODED_COMPONENT_ARR[tag] || tag; | ||
} | ||
const cacheStringFunction = (fn) => { | ||
const cache = Object.create(null); | ||
return ((str) => { | ||
const hit = cache[str]; | ||
return hit || (cache[str] = fn(str)); | ||
}); | ||
}; | ||
function getLen(str = '') { | ||
@@ -888,2 +869,5 @@ return ('' + str).replace(/[^\x00-\xff]/g, '**').length; | ||
const UNI_SSR_GLOBAL_DATA = 'globalData'; | ||
const SCHEME_RE = /^([a-z-]+:)?\/\//i; | ||
const DATA_RE = /^data:.*,.*/; | ||
const WEB_INVOKE_APPSERVICE = 'WEB_INVOKE_APPSERVICE'; | ||
@@ -896,2 +880,2 @@ function getEnvLocale() { | ||
export { BUILT_IN_TAGS, COMPONENT_NAME_PREFIX, COMPONENT_PREFIX, COMPONENT_SELECTOR_PREFIX, NAVBAR_HEIGHT, NODE_TYPE_COMMENT, NODE_TYPE_ELEMENT, NODE_TYPE_PAGE, NODE_TYPE_TEXT, ON_REACH_BOTTOM_DISTANCE, PLUS_RE, PRIMARY_COLOR, RESPONSIVE_MIN_WIDTH, TABBAR_HEIGHT, TAGS, UNI_SSR, UNI_SSR_DATA, UNI_SSR_GLOBAL_DATA, UNI_SSR_STORE, UNI_SSR_TITLE, UniBaseNode, UniCommentNode, UniElement, UniEvent, UniInputElement, UniNode, UniTextAreaElement, UniTextNode, addFont, callOptions, createRpx2Unit, debounce, decode, decodeAttr, decodeTag, decodedQuery, defaultRpx2Unit, encodeAttr, encodeTag, formatDateTime, getCustomDataset, getEnvLocale, getLen, initCustomDataset, invokeArrayFns, isBuiltInComponent, isCustomElement, isNativeTag, normalizeDataset, normalizeTarget, once, parseQuery, passive, plusReady, removeLeadingSlash, sanitise, scrollTo, stringifyQuery, updateElementStyle }; | ||
export { BUILT_IN_TAGS, COMPONENT_NAME_PREFIX, COMPONENT_PREFIX, COMPONENT_SELECTOR_PREFIX, DATA_RE, NAVBAR_HEIGHT, NODE_TYPE_COMMENT, NODE_TYPE_ELEMENT, NODE_TYPE_PAGE, NODE_TYPE_TEXT, ON_REACH_BOTTOM_DISTANCE, PLUS_RE, PRIMARY_COLOR, RESPONSIVE_MIN_WIDTH, SCHEME_RE, TABBAR_HEIGHT, TAGS, UNI_SSR, UNI_SSR_DATA, UNI_SSR_GLOBAL_DATA, UNI_SSR_STORE, UNI_SSR_TITLE, UniBaseNode, UniCommentNode, UniElement, UniEvent, UniInputElement, UniNode, UniTextAreaElement, UniTextNode, WEB_INVOKE_APPSERVICE, addFont, cacheStringFunction, callOptions, createRpx2Unit, debounce, decode, decodeAttr, decodeTag, decodedQuery, defaultRpx2Unit, encodeAttr, encodeTag, formatDateTime, getCustomDataset, getEnvLocale, getLen, initCustomDataset, invokeArrayFns, isBuiltInComponent, isCustomElement, isNativeTag, normalizeDataset, normalizeTarget, once, parseQuery, passive, plusReady, removeLeadingSlash, sanitise, scrollTo, stringifyQuery, updateElementStyle }; |
{ | ||
"name": "@dcloudio/uni-shared", | ||
"version": "3.0.0-alpha-3000020210611006", | ||
"version": "3.0.0-alpha-3000020210618002", | ||
"description": "@dcloudio/uni-shared", | ||
@@ -21,3 +21,3 @@ "main": "./dist/uni-shared.cjs.js", | ||
}, | ||
"gitHead": "e623d3788093a38275d11abcaa90c2fac6bd8568" | ||
"gitHead": "91d7c6f34134dc2f2ec372b68008db6a58234099" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75350
2020