@lynx-js/web-constants 0.13.2 → 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,32 @@
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
+
16
+ ## 0.13.3
17
+
18
+ ### Patch Changes
19
+
20
+ - refactor: code clean ([#897](https://github.com/lynx-family/lynx-stack/pull/897))
21
+
22
+ rename many internal apis to make logic be clear:
23
+
24
+ multi-thread: startMainWorker -> prepareMainThreadAPIs -> startMainThread -> createMainThreadContext(new MainThreadRuntime)
25
+ all-on-ui: prepareMainThreadAPIs -> startMainThread -> createMainThreadContext(new MainThreadRuntime)
26
+
27
+ - Updated dependencies []:
28
+ - @lynx-js/web-worker-rpc@0.13.3
29
+
3
30
  ## 0.13.2
4
31
 
5
32
  ### Patch Changes
@@ -1,12 +1,13 @@
1
1
  import type { ExposureWorkerEvent, LynxCrossThreadEvent } from './types/EventType.js';
2
2
  import type { Cloneable, CloneableObject } from './types/Cloneable.js';
3
- import type { MainThreadStartConfigs } from './types/MainThreadStartConfigs.js';
3
+ import type { StartMainThreadContextConfig } from './types/MainThreadStartConfigs.js';
4
4
  import type { IdentifierType, InvokeCallbackRes } from './types/NativeApp.js';
5
5
  import type { LynxTemplate } from './types/LynxModule.js';
6
6
  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[];
@@ -19,7 +20,7 @@ export declare const publishEventEndpoint: import("@lynx-js/web-worker-rpc/dist/
19
20
  }>]>;
20
21
  export declare const postOffscreenEventEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[eventType: string, targetUniqueId: number, bubbles: boolean, unknown]>;
21
22
  export declare const switchExposureServiceEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[boolean, boolean]>;
22
- export declare const mainThreadStartEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[MainThreadStartConfigs]>;
23
+ export declare const mainThreadStartEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[StartMainThreadContextConfig]>;
23
24
  export declare const updateDataEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsync<[Cloneable, Record<string, string>], void>;
24
25
  export declare const sendGlobalEventEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[string, Cloneable[] | undefined]>;
25
26
  export declare const disposeEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsync<[], void>;
@@ -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
@@ -3,7 +3,7 @@ import type { LynxTemplate } from './LynxModule.js';
3
3
  import type { NapiModulesMap } from './NapiModules.js';
4
4
  import type { NativeModulesMap } from './NativeModules.js';
5
5
  import type { BrowserConfig } from './PageConfig.js';
6
- export interface MainThreadStartConfigs {
6
+ export interface StartMainThreadContextConfig {
7
7
  template: LynxTemplate;
8
8
  initData: Cloneable;
9
9
  globalProps: Cloneable;
@@ -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.2",
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.2"
26
+ "@lynx-js/web-worker-rpc": "0.13.4"
27
27
  },
28
28
  "devDependencies": {
29
- "@lynx-js/offscreen-document": "0.0.3"
29
+ "@lynx-js/offscreen-document": "0.1.0"
30
30
  }
31
31
  }