@lynx-js/web-constants 0.13.3 → 0.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @lynx-js/web-constants
2
2
 
3
+ ## 0.13.4
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: lynx-view supports `updateGlobalProps` method, which can be used to update lynx.\_\_globalProps ([#918](https://github.com/lynx-family/lynx-stack/pull/918))
8
+
9
+ - feat: supports `lynx.getElementById()` && `animate()`. ([#912](https://github.com/lynx-family/lynx-stack/pull/912))
10
+
11
+ After this commit, you can use `lynx.getElementById()` to get the element by id, and use `element.animate()` to animate the element.
12
+
13
+ - Updated dependencies []:
14
+ - @lynx-js/web-worker-rpc@0.13.4
15
+
3
16
  ## 0.13.3
4
17
 
5
18
  ### Patch Changes
@@ -7,6 +7,7 @@ import type { NapiModulesMap } from './types/NapiModules.js';
7
7
  import type { NativeModulesMap } from './types/NativeModules.js';
8
8
  import type { ElementOperation } from '@lynx-js/offscreen-document';
9
9
  import type { BrowserConfig } from './types/PageConfig.js';
10
+ import type { ElementAnimationOptions } from './types/Element.js';
10
11
  export declare const postExposureEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[{
11
12
  exposures: ExposureWorkerEvent[];
12
13
  disExposures: ExposureWorkerEvent[];
@@ -62,3 +63,5 @@ export declare const dispatchJSContextOnMainThreadEndpoint: import("@lynx-js/web
62
63
  type: string;
63
64
  data: Cloneable;
64
65
  }]>;
66
+ export declare const triggerElementMethodEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[method: string, id: string, options: ElementAnimationOptions]>;
67
+ export declare const updateGlobalPropsEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[Cloneable]>;
package/dist/endpoints.js CHANGED
@@ -31,4 +31,6 @@ export const dispatchLynxViewEventEndpoint = createRpcEndpoint('dispatchLynxView
31
31
  export const dispatchNapiModuleEndpoint = createRpcEndpoint('dispatchNapiModule', false, false);
32
32
  export const dispatchCoreContextOnBackgroundEndpoint = createRpcEndpoint('dispatchCoreContextOnBackground', false, false);
33
33
  export const dispatchJSContextOnMainThreadEndpoint = createRpcEndpoint('dispatchJSContextOnMainThread', false, false);
34
+ export const triggerElementMethodEndpoint = createRpcEndpoint('__triggerElementMethod', false, false);
35
+ export const updateGlobalPropsEndpoint = createRpcEndpoint('updateGlobalProps', false, false);
34
36
  //# sourceMappingURL=endpoints.js.map
@@ -0,0 +1,13 @@
1
+ export declare const enum AnimationOperation {
2
+ START = 0,
3
+ PLAY = 1,
4
+ PAUSE = 2,
5
+ CANCEL = 3,
6
+ FINISH = 4
7
+ }
8
+ export interface ElementAnimationOptions {
9
+ operation: AnimationOperation;
10
+ id: string;
11
+ keyframes?: any;
12
+ timingOptions?: Record<string, any>;
13
+ }
@@ -0,0 +1,12 @@
1
+ // Copyright 2023 The Lynx Authors. All rights reserved.
2
+ // Licensed under the Apache License Version 2.0 that can be found in the
3
+ // LICENSE file in the root directory of this source tree.
4
+ export var AnimationOperation;
5
+ (function (AnimationOperation) {
6
+ AnimationOperation[AnimationOperation["START"] = 0] = "START";
7
+ AnimationOperation[AnimationOperation["PLAY"] = 1] = "PLAY";
8
+ AnimationOperation[AnimationOperation["PAUSE"] = 2] = "PAUSE";
9
+ AnimationOperation[AnimationOperation["CANCEL"] = 3] = "CANCEL";
10
+ AnimationOperation[AnimationOperation["FINISH"] = 4] = "FINISH";
11
+ })(AnimationOperation || (AnimationOperation = {}));
12
+ //# sourceMappingURL=Element.js.map
@@ -43,6 +43,7 @@ export type NativeTTObject = {
43
43
  globalThis?: {
44
44
  tt: NativeTTObject;
45
45
  };
46
+ updateGlobalProps: (newData: Record<string, any>) => void;
46
47
  };
47
48
  export type BundleInitReturnObj = {
48
49
  /**
@@ -4,7 +4,7 @@ export declare const enum NativeUpdateDataType {
4
4
  }
5
5
  export declare const enum UpdateDataType {
6
6
  Unknown = 0,
7
- UpdateExplictByUser = 1,
7
+ UpdateExplicitByUser = 1,
8
8
  UpdateByKernelFromCtor = 2,
9
9
  UpdateByKernelFromRender = 4,
10
10
  UpdateByKernelFromHydrate = 8,
@@ -8,7 +8,7 @@ export var UpdateDataType;
8
8
  // default
9
9
  UpdateDataType[UpdateDataType["Unknown"] = 0] = "Unknown";
10
10
  // update by `setState` or `setData`
11
- UpdateDataType[UpdateDataType["UpdateExplictByUser"] = 1] = "UpdateExplictByUser";
11
+ UpdateDataType[UpdateDataType["UpdateExplicitByUser"] = 1] = "UpdateExplicitByUser";
12
12
  // update by lynx_core from ctor
13
13
  UpdateDataType[UpdateDataType["UpdateByKernelFromCtor"] = 2] = "UpdateByKernelFromCtor";
14
14
  // update by lynx_core from render
@@ -12,3 +12,4 @@ export * from './NativeModules.js';
12
12
  export * from './NapiModules.js';
13
13
  export * from './FlushElementTreeOptions.js';
14
14
  export * from './LynxContextEventTarget.js';
15
+ export * from './Element.js';
@@ -12,4 +12,5 @@ export * from './NativeModules.js';
12
12
  export * from './NapiModules.js';
13
13
  export * from './FlushElementTreeOptions.js';
14
14
  export * from './LynxContextEventTarget.js';
15
+ export * from './Element.js';
15
16
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-constants",
3
- "version": "0.13.3",
3
+ "version": "0.13.4",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [],
@@ -23,9 +23,9 @@
23
23
  "**/*.css"
24
24
  ],
25
25
  "dependencies": {
26
- "@lynx-js/web-worker-rpc": "0.13.3"
26
+ "@lynx-js/web-worker-rpc": "0.13.4"
27
27
  },
28
28
  "devDependencies": {
29
- "@lynx-js/offscreen-document": "0.0.4"
29
+ "@lynx-js/offscreen-document": "0.1.0"
30
30
  }
31
31
  }