@ray-js/api 1.4.51 → 1.4.52

Sign up to get free protection for your applications and to get access to all the features.
@@ -60,8 +60,8 @@ interface CreateAnimationProps {
60
60
 
61
61
  interface NodesRef {
62
62
  fields(e: any, t: any): SelectorQuery
63
- boundingClientRect(e: any): SelectorQuery
64
- scrollOffset(e: any): SelectorQuery
63
+ boundingClientRect(e?: any): SelectorQuery
64
+ scrollOffset(e?: any): SelectorQuery
65
65
  }
66
66
  interface SelectorQuery {
67
67
  select: (e: any) => NodesRef
@@ -280,7 +280,7 @@ declare namespace ty {
280
280
  export function createMapContext(mapId: string): MapContext
281
281
  export function createIpcPlayerContext(deviceId: string): IpcContext
282
282
  export function createCameraContext(): CameraContext
283
- export function createWebviewContext(): WebviewContext
283
+ export function createWebviewContext(mapId: string): WebviewContext
284
284
  export type env = {
285
285
  USER_DATA_PATH: string
286
286
  }
@@ -1,3 +1,4 @@
1
+ import { UrlObject } from 'query-string';
1
2
  type Opts = {
2
3
  deprecated?: boolean;
3
4
  namespace?: string;
@@ -7,4 +8,6 @@ export declare function factory(name: string, opts?: Opts): (option: {
7
8
  data?: any;
8
9
  }) => any;
9
10
  export declare function factoryContants(name: string, opts?: Opts): any;
11
+ export declare const parseUrl: (url: string) => import("query-string").ParsedUrl;
12
+ export declare const stringifyUrl: (object: UrlObject) => string;
10
13
  export {};
@@ -1,5 +1,6 @@
1
1
  // @ts-ignore
2
2
  import * as tyWx from '@ray-js/wechat';
3
+ import { stringifyUrl as _stringifyUrl, parseUrl as _parseUrl } from 'query-string';
3
4
  export function factory(name) {
4
5
  let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5
6
  if (/(set|get|remove|clear)+Storage(Sync)?$/.test(name)) {
@@ -38,4 +39,19 @@ export function factoryContants(name) {
38
39
  return;
39
40
  }
40
41
  return inst[name];
41
- }
42
+ }
43
+ export const parseUrl = url => {
44
+ return _parseUrl(url, {
45
+ arrayFormat: 'bracket',
46
+ // WARN: 这里的参数与微信不一致, 但是无法进行修改了, 存量的项目已经在使用
47
+ // 例如 url=encodeURIComponent('https://www.baidu.com?name=1&age=2') 在微信中不会进行 decode
48
+ // 而在涂鸦小程序上会进行 decode, 这里是需要注意的地方
49
+ decode: true
50
+ });
51
+ };
52
+ export const stringifyUrl = object => {
53
+ return _stringifyUrl(object, {
54
+ arrayFormat: 'bracket',
55
+ encode: true
56
+ });
57
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/api",
3
- "version": "1.4.51",
3
+ "version": "1.4.52",
4
4
  "description": "Ray universal api",
5
5
  "keywords": [
6
6
  "ray"
@@ -29,14 +29,14 @@
29
29
  "watch": "ray start --type=component"
30
30
  },
31
31
  "dependencies": {
32
- "@ray-js/framework": "1.4.51",
33
- "@ray-js/router": "1.4.51",
32
+ "@ray-js/framework": "1.4.52",
33
+ "@ray-js/router": "1.4.52",
34
34
  "@ray-js/wechat": "^0.2.8",
35
35
  "base64-browser": "^1.0.1",
36
36
  "query-string": "^7.1.3"
37
37
  },
38
38
  "devDependencies": {
39
- "@ray-js/cli": "1.4.51",
39
+ "@ray-js/cli": "1.4.52",
40
40
  "art-template": "^4.13.2",
41
41
  "fs-extra": "^10.1.0",
42
42
  "miniprogram-api-typings": "^3.12.2",
@@ -46,5 +46,5 @@
46
46
  "access": "public",
47
47
  "registry": "https://registry.npmjs.org"
48
48
  },
49
- "gitHead": "ef52059911e6d19ffadedbcc1cebb2c1b8e843bc"
49
+ "gitHead": "a33185e617507f1a5406e074e3369ce4902dc04a"
50
50
  }