@lynx-js/web-constants-canary 0.18.4-canary-20251119-30b9d548 → 0.18.4-canary-20251120-12f6fb3a

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,11 +1,11 @@
1
1
  # @lynx-js/web-constants
2
2
 
3
- ## 0.18.4-canary-20251119064753-30b9d5488411da5342d87085427f0804906d2898
3
+ ## 0.18.4-canary-20251120073021-12f6fb3af05b3c942c5224d1601f295aba1e5c63
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Updated dependencies []:
8
- - @lynx-js/web-worker-rpc@0.18.4-canary-20251119064753-30b9d5488411da5342d87085427f0804906d2898
8
+ - @lynx-js/web-worker-rpc@0.18.4-canary-20251120073021-12f6fb3af05b3c942c5224d1601f295aba1e5c63
9
9
 
10
10
  ## 0.18.3
11
11
 
@@ -19,8 +19,8 @@ export interface LynxRuntimeInfo {
19
19
  componentAtIndex?: ComponentAtIndexCallback;
20
20
  enqueueComponent?: EnqueueComponentCallback;
21
21
  }
22
- export type ComponentAtIndexCallback = (list: WebFiberElementImpl, listID: number, cellIndex: number, operationID: number, enableReuseNotification: boolean) => void;
23
- export type EnqueueComponentCallback = (list: WebFiberElementImpl, listID: number, sign: number) => void;
22
+ export type ComponentAtIndexCallback = (list: HTMLElement, listID: number, cellIndex: number, operationID: number, enableReuseNotification: boolean) => void;
23
+ export type EnqueueComponentCallback = (list: HTMLElement, listID: number, sign: number) => void;
24
24
  export declare const enum AnimationOperation {
25
25
  START = 0,
26
26
  PLAY = 1,
@@ -34,34 +34,3 @@ export interface ElementAnimationOptions {
34
34
  keyframes?: any;
35
35
  timingOptions?: Record<string, any>;
36
36
  }
37
- export interface WebFiberElementImpl {
38
- querySelectorAll?: (selectors: string) => WebFiberElementImpl[];
39
- getAttributeNames: () => string[];
40
- getAttribute: (name: string) => string | null;
41
- setAttribute: (name: string, value: string) => void;
42
- removeAttribute: (name: string) => void;
43
- append: (...children: WebFiberElementImpl[]) => void;
44
- appendChild: (child: WebFiberElementImpl) => void;
45
- removeChild: (child: WebFiberElementImpl) => WebFiberElementImpl;
46
- insertBefore: (child: WebFiberElementImpl, ref?: WebFiberElementImpl | null) => WebFiberElementImpl;
47
- replaceWith: (...newElement: WebFiberElementImpl[]) => void;
48
- addEventListener: (type: string, handler: (ev: Event) => void, options: {
49
- capture?: boolean;
50
- passive?: boolean;
51
- }) => void;
52
- removeEventListener: (type: string, handler: (ev: Event) => void, options?: {
53
- capture?: boolean;
54
- }) => void;
55
- textContent: string;
56
- readonly tagName: string;
57
- readonly firstElementChild: WebFiberElementImpl | null;
58
- readonly children: WebFiberElementImpl[];
59
- readonly parentElement: WebFiberElementImpl | null;
60
- readonly parentNode: WebFiberElementImpl | null;
61
- readonly lastElementChild: WebFiberElementImpl | null;
62
- readonly nextElementSibling: WebFiberElementImpl | null;
63
- readonly style: {
64
- removeProperty(name: string): void;
65
- setProperty(name: string, value: string, priority?: 'important' | '' | null): void;
66
- };
67
- }
@@ -1,5 +1,4 @@
1
1
  import type { Cloneable } from './Cloneable.js';
2
- import type { WebFiberElementImpl } from './Element.js';
3
2
  export type LynxEventType = 'bindEvent' | 'catchEvent' | 'capture-bind' | 'capture-catch';
4
3
  export interface LynxCrossThreadEventTarget {
5
4
  dataset: {
@@ -41,8 +40,8 @@ export type ExposureEvent = {
41
40
  export type ExposureWorkerEvent = LynxCrossThreadEvent<ExposureEventDetail> & ExposureEventDetail;
42
41
  export type MinimalRawEventObject = {
43
42
  type: string;
44
- target: Pick<WebFiberElementImpl, 'getAttribute'> | null;
45
- currentTarget: Pick<WebFiberElementImpl, 'getAttribute'> | null;
43
+ target: Pick<HTMLElement, 'getAttribute'> | null;
44
+ currentTarget: Pick<HTMLElement, 'getAttribute'> | null;
46
45
  detail?: Cloneable;
47
46
  isTrusted: boolean;
48
47
  timeStamp: number;
@@ -1,6 +1,6 @@
1
1
  import type { systemInfo } from '../constants.js';
2
2
  import type { Cloneable } from './Cloneable.js';
3
- import type { ComponentAtIndexCallback, EnqueueComponentCallback, WebFiberElementImpl } from './Element.js';
3
+ import type { ComponentAtIndexCallback, EnqueueComponentCallback } from './Element.js';
4
4
  import type { LynxEventType } from './EventType.js';
5
5
  import type { FlushElementTreeOptions } from './FlushElementTreeOptions.js';
6
6
  import type { I18nResourceTranslationOptions } from './index.js';
@@ -11,53 +11,53 @@ type ElementPAPIEventHandler = string | {
11
11
  type: 'worklet';
12
12
  value: unknown;
13
13
  } | undefined;
14
- export type AddEventPAPI = (element: WebFiberElementImpl, eventType: LynxEventType, eventName: string, newEventHandler: ElementPAPIEventHandler) => void;
15
- export type GetEventPAPI = (element: WebFiberElementImpl, eventName: string, eventType: LynxEventType) => ElementPAPIEventHandler;
16
- export type GetEventsPAPI = (element: WebFiberElementImpl) => {
14
+ export type AddEventPAPI = (element: HTMLElement, eventType: LynxEventType, eventName: string, newEventHandler: ElementPAPIEventHandler) => void;
15
+ export type GetEventPAPI = (element: HTMLElement, eventName: string, eventType: LynxEventType) => ElementPAPIEventHandler;
16
+ export type GetEventsPAPI = (element: HTMLElement) => {
17
17
  type: LynxEventType;
18
18
  name: string;
19
19
  function: ElementPAPIEventHandler;
20
20
  }[];
21
- export type SetEventsPAPI = (element: WebFiberElementImpl, listeners: {
21
+ export type SetEventsPAPI = (element: HTMLElement, listeners: {
22
22
  type: LynxEventType;
23
23
  name: string;
24
24
  function: ElementPAPIEventHandler;
25
25
  }[]) => void;
26
- export type AppendElementPAPI = (parent: WebFiberElementImpl, child: WebFiberElementImpl) => void;
27
- export type ElementIsEqualPAPI = (left: WebFiberElementImpl, right: WebFiberElementImpl) => boolean;
28
- export type FirstElementPAPI = (element: WebFiberElementImpl) => WebFiberElementImpl | null;
29
- export type GetChildrenPAPI = (element: WebFiberElementImpl) => WebFiberElementImpl[] | null;
30
- export type GetParentPAPI = (element: WebFiberElementImpl) => WebFiberElementImpl | null;
31
- export type InsertElementBeforePAPI = (parent: WebFiberElementImpl, child: WebFiberElementImpl, ref?: WebFiberElementImpl | null) => WebFiberElementImpl;
32
- export type LastElementPAPI = (element: WebFiberElementImpl) => WebFiberElementImpl | null;
33
- export type NextElementPAPI = (element: WebFiberElementImpl) => WebFiberElementImpl | null;
34
- export type RemoveElementPAPI = (parent: WebFiberElementImpl, child: WebFiberElementImpl) => WebFiberElementImpl;
35
- export type ReplaceElementPAPI = (newElement: WebFiberElementImpl, oldElement: WebFiberElementImpl) => void;
36
- export type ReplaceElementsPAPI = (parent: WebFiberElementImpl, newChildren: WebFiberElementImpl[] | WebFiberElementImpl, oldChildren?: WebFiberElementImpl[] | WebFiberElementImpl | null | undefined) => void;
37
- export type AddConfigPAPI = (element: WebFiberElementImpl, type: string, value: Cloneable) => void;
38
- export type AddDatasetPAPI = (element: WebFiberElementImpl, key: string, value: Cloneable) => void;
39
- export type GetDatasetPAPI = (element: WebFiberElementImpl) => Record<string, Cloneable>;
40
- export type GetDataByKeyPAPI = (element: WebFiberElementImpl, key: string) => Cloneable | undefined;
41
- export type GetAttributesPAPI = (element: WebFiberElementImpl) => Record<string, string>;
42
- export type GetComponentIdPAPI = (element: WebFiberElementImpl) => string | null;
43
- export type GetElementConfigPAPI = (element: WebFiberElementImpl) => Record<string, Cloneable>;
44
- export type GetElementUniqueIDPAPI = (element: WebFiberElementImpl) => number;
45
- export type GetIDPAPI = (element: WebFiberElementImpl) => string | null;
46
- export type GetTagPAPI = (element: WebFiberElementImpl) => string;
47
- export type SetConfigPAPI = (element: WebFiberElementImpl, config: Record<string, Cloneable>) => void;
48
- export type SetDatasetPAPI = (element: WebFiberElementImpl, dataset: Record<string, Cloneable>) => void;
49
- export type SetIDPAPI = (element: WebFiberElementImpl, id: string | null) => void;
50
- export type UpdateComponentIDPAPI = (element: WebFiberElementImpl, componentID: string) => void;
51
- export type UpdateComponentInfoPAPI = (element: WebFiberElementImpl, params: {
26
+ export type AppendElementPAPI = (parent: HTMLElement, child: HTMLElement) => void;
27
+ export type ElementIsEqualPAPI = (left: HTMLElement | null, right: HTMLElement | null) => boolean;
28
+ export type FirstElementPAPI = (element: HTMLElement) => HTMLElement | null;
29
+ export type GetChildrenPAPI = (element: HTMLElement) => HTMLElement[] | null;
30
+ export type GetParentPAPI = (element: HTMLElement) => HTMLElement | null;
31
+ export type InsertElementBeforePAPI = (parent: HTMLElement, child: HTMLElement, ref?: HTMLElement | null) => HTMLElement;
32
+ export type LastElementPAPI = (element: HTMLElement) => HTMLElement | null;
33
+ export type NextElementPAPI = (element: HTMLElement) => HTMLElement | null;
34
+ export type RemoveElementPAPI = (parent: HTMLElement, child: HTMLElement) => HTMLElement;
35
+ export type ReplaceElementPAPI = (newElement: HTMLElement, oldElement: HTMLElement) => void;
36
+ export type ReplaceElementsPAPI = (parent: HTMLElement, newChildren: HTMLElement[] | HTMLElement, oldChildren?: HTMLElement[] | HTMLElement | null | undefined) => void;
37
+ export type AddConfigPAPI = (element: HTMLElement, type: string, value: Cloneable) => void;
38
+ export type AddDatasetPAPI = (element: HTMLElement, key: string, value: Cloneable) => void;
39
+ export type GetDatasetPAPI = (element: HTMLElement) => Record<string, Cloneable>;
40
+ export type GetDataByKeyPAPI = (element: HTMLElement, key: string) => Cloneable | undefined;
41
+ export type GetAttributesPAPI = (element: HTMLElement) => Record<string, string>;
42
+ export type GetComponentIdPAPI = (element: HTMLElement) => string | null | undefined;
43
+ export type GetElementConfigPAPI = (element: HTMLElement) => Record<string, Cloneable>;
44
+ export type GetElementUniqueIDPAPI = (element: HTMLElement) => number;
45
+ export type GetIDPAPI = (element: HTMLElement) => string | null;
46
+ export type GetTagPAPI = (element: HTMLElement) => string;
47
+ export type SetConfigPAPI = (element: HTMLElement, config: Record<string, Cloneable>) => void;
48
+ export type SetDatasetPAPI = (element: HTMLElement, dataset: Record<string, Cloneable>) => void;
49
+ export type SetIDPAPI = (element: HTMLElement, id: string | null) => void;
50
+ export type UpdateComponentIDPAPI = (element: HTMLElement, componentID: string) => void;
51
+ export type UpdateComponentInfoPAPI = (element: HTMLElement, params: {
52
52
  componentID?: string;
53
53
  name?: string;
54
54
  path?: string;
55
55
  entry?: string;
56
56
  cssID?: number;
57
57
  }) => void;
58
- export type GetClassesPAPI = (element: WebFiberElementImpl) => string[];
59
- export type CreateViewPAPI = (parentComponentUniqueID: number) => WebFiberElementImpl;
60
- export type SwapElementPAPI = (childA: WebFiberElementImpl, childB: WebFiberElementImpl) => void;
58
+ export type GetClassesPAPI = (element: HTMLElement) => string[];
59
+ export type CreateViewPAPI = (parentComponentUniqueID: number) => HTMLElement;
60
+ export type SwapElementPAPI = (childA: HTMLElement, childB: HTMLElement) => void;
61
61
  export type UpdateListInfoAttributeValue = {
62
62
  insertAction: {
63
63
  position: number;
@@ -66,31 +66,32 @@ export type UpdateListInfoAttributeValue = {
66
66
  position: number;
67
67
  }[];
68
68
  };
69
- export type SetAttributePAPI = (element: WebFiberElementImpl, key: string, value: string | null | undefined | UpdateListInfoAttributeValue) => void;
70
- export type UpdateListCallbacksPAPI = (element: WebFiberElementImpl, componentAtIndex: ComponentAtIndexCallback, enqueueComponent: EnqueueComponentCallback) => void;
69
+ export type SetAttributePAPI = (element: HTMLElement, key: Exclude<string, 'update-list-info'>, value: string | null | undefined | boolean) => void;
70
+ export type SetAttributePAPIUpdateListInfo = (element: HTMLElement, key: 'update-list-info', value: UpdateListInfoAttributeValue | null) => void;
71
+ export type UpdateListCallbacksPAPI = (element: HTMLElement, componentAtIndex: ComponentAtIndexCallback, enqueueComponent: EnqueueComponentCallback) => void;
71
72
  export type CreateTextPAPI = CreateViewPAPI;
72
- export type CreateRawTextPAPI = (text: string) => WebFiberElementImpl;
73
+ export type CreateRawTextPAPI = (text: string) => HTMLElement;
73
74
  export type CreateImagePAPI = CreateViewPAPI;
74
75
  export type CreateScrollViewPAPI = CreateViewPAPI;
75
76
  export type CreateWrapperElementPAPI = CreateViewPAPI;
76
- export type CreateComponentPAPI = (componentParentUniqueID: number, componentID: string, cssID: number, entryName: string, name: string, path: string, config: Record<string, Cloneable> | null | undefined, info: Record<string, Cloneable> | null | undefined) => WebFiberElementImpl;
77
- export type CreateElementPAPI = (tagName: string, parentComponentUniqueId: number, info?: Record<string, Cloneable> | null | undefined) => WebFiberElementImpl;
78
- export type CreatePagePAPI = (componentID: string, cssID: number, info: Record<string, Cloneable> | null | undefined) => WebFiberElementImpl;
79
- export type CreateListPAPI = (parentComponentUniqueId: number, componentAtIndex: ComponentAtIndexCallback, enqueueComponent: EnqueueComponentCallback) => WebFiberElementImpl;
80
- export type AddClassPAPI = (element: WebFiberElementImpl, className: string) => void;
81
- export type SetClassesPAPI = (element: WebFiberElementImpl, classNames: string | null) => void;
82
- export type AddInlineStylePAPI = (element: WebFiberElementImpl, key: number | string, value: string | number | null | undefined) => void;
83
- export type SetInlineStylesPAPI = (element: WebFiberElementImpl, value: string | Record<string, string> | undefined) => void;
84
- export type SetCSSIdPAPI = (elements: WebFiberElementImpl[], cssId: number | null, entryName: string | undefined) => void;
85
- export type GetPageElementPAPI = () => WebFiberElementImpl | undefined;
86
- export type MarkTemplateElementPAPI = (element: WebFiberElementImpl) => void;
87
- export type MarkPartElementPAPI = (element: WebFiberElementImpl, partId: string) => void;
88
- export type GetTemplatePartsPAPI = (templateElement: WebFiberElementImpl) => Record<string, WebFiberElementImpl>;
77
+ export type CreateComponentPAPI = (componentParentUniqueID: number, componentID: string, cssID: number, entryName: string, name: string, path: string, config: Record<string, Cloneable> | null | undefined, info: Record<string, Cloneable> | null | undefined) => HTMLElement;
78
+ export type CreateElementPAPI = (tagName: string, parentComponentUniqueId: number, info?: Record<string, Cloneable> | null | undefined) => HTMLElement;
79
+ export type CreatePagePAPI = (componentID: string, cssID: number, info?: Record<string, Cloneable> | null | undefined) => HTMLElement;
80
+ export type CreateListPAPI = (parentComponentUniqueId: number, componentAtIndex: ComponentAtIndexCallback, enqueueComponent: EnqueueComponentCallback) => HTMLElement;
81
+ export type AddClassPAPI = (element: HTMLElement, className: string) => void;
82
+ export type SetClassesPAPI = (element: HTMLElement, classNames: string | null) => void;
83
+ export type AddInlineStylePAPI = (element: HTMLElement, key: number | string, value: string | number | null | undefined) => void;
84
+ export type SetInlineStylesPAPI = (element: HTMLElement, value: string | Record<string, string> | undefined) => void;
85
+ export type SetCSSIdPAPI = (elements: HTMLElement[], cssId: number | null, entryName: string | undefined) => void;
86
+ export type GetPageElementPAPI = () => HTMLElement | undefined;
87
+ export type MarkTemplateElementPAPI = (element: HTMLElement) => void;
88
+ export type MarkPartElementPAPI = (element: HTMLElement, partId: string) => void;
89
+ export type GetTemplatePartsPAPI = (templateElement: HTMLElement) => Record<string, HTMLElement>;
89
90
  interface JSErrorInfo {
90
91
  release: string;
91
92
  }
92
- export type ElementFromBinaryPAPI = (templateId: string, parentComponentUniId: number) => WebFiberElementImpl[];
93
- export type GetAttributeByNamePAPI = (element: WebFiberElementImpl, name: string) => string | null;
93
+ export type ElementFromBinaryPAPI = (templateId: string, parentComponentUniId: number) => HTMLElement[];
94
+ export type GetAttributeByNamePAPI = (element: HTMLElement, name: string) => string | null;
94
95
  export type QueryComponentPAPI = (source: string, resultCallback?: (result: {
95
96
  code: number;
96
97
  data?: {
@@ -98,7 +99,7 @@ export type QueryComponentPAPI = (source: string, resultCallback?: (result: {
98
99
  evalResult: unknown;
99
100
  };
100
101
  }) => void) => null;
101
- export interface MainThreadGlobalThis {
102
+ export interface ElementPAPIs {
102
103
  __ElementFromBinary: ElementFromBinaryPAPI;
103
104
  __GetTemplateParts?: GetTemplatePartsPAPI;
104
105
  __MarkPartElement: MarkPartElementPAPI;
@@ -146,7 +147,7 @@ export interface MainThreadGlobalThis {
146
147
  __CreateElement: CreateElementPAPI;
147
148
  __CreatePage: CreatePagePAPI;
148
149
  __CreateList: CreateListPAPI;
149
- __SetAttribute: SetAttributePAPI;
150
+ __SetAttribute: SetAttributePAPI & SetAttributePAPIUpdateListInfo;
150
151
  __UpdateListCallbacks: UpdateListCallbacksPAPI;
151
152
  __AddClass: AddClassPAPI;
152
153
  __SetClasses: SetClassesPAPI;
@@ -155,6 +156,9 @@ export interface MainThreadGlobalThis {
155
156
  __SetCSSId: SetCSSIdPAPI;
156
157
  __GetPageElement: GetPageElementPAPI;
157
158
  __GetAttributeByName: GetAttributeByNamePAPI;
159
+ __FlushElementTree: (_subTree?: unknown, options?: FlushElementTreeOptions) => void;
160
+ }
161
+ export interface MainThreadGlobalThis extends ElementPAPIs {
158
162
  __globalProps: unknown;
159
163
  SystemInfo: typeof systemInfo;
160
164
  globalThis?: MainThreadGlobalThis;
@@ -166,7 +170,6 @@ export interface MainThreadGlobalThis {
166
170
  _SetSourceMapRelease: (errInfo: JSErrorInfo) => void;
167
171
  __OnLifecycleEvent: (lifeCycleEvent: Cloneable) => void;
168
172
  __LoadLepusChunk: (path: string) => boolean;
169
- __FlushElementTree: (_subTree: unknown, options: FlushElementTreeOptions) => void;
170
173
  _I18nResourceTranslation: (options: I18nResourceTranslationOptions) => unknown | undefined;
171
174
  _AddEventListener: (...args: unknown[]) => void;
172
175
  __QueryComponent: QueryComponentPAPI;
@@ -1,4 +1,3 @@
1
- import type { WebFiberElementImpl } from './Element.js';
2
1
  import type { AddEventPAPI } from './MainThreadGlobalThis.js';
3
2
  export type SSREventReplayInfo = [
4
3
  number,
@@ -12,7 +11,7 @@ export type SSRDumpInfo = {
12
11
  };
13
12
  export interface SSRHydrateInfo extends SSRDumpInfo {
14
13
  /** WeakRef<Element> */
15
- lynxUniqueIdToElement: WeakRef<WebFiberElementImpl>[];
14
+ lynxUniqueIdToElement: WeakRef<HTMLElement>[];
16
15
  /** for cssog */
17
16
  lynxUniqueIdToStyleRulesIndex: number[];
18
17
  cardStyleElement: HTMLStyleElement | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-constants-canary",
3
- "version": "0.18.4-canary-20251119-30b9d548",
3
+ "version": "0.18.4-canary-20251120-12f6fb3a",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [],
@@ -23,7 +23,7 @@
23
23
  "**/*.css"
24
24
  ],
25
25
  "dependencies": {
26
- "@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.18.4-canary-20251119-30b9d548"
26
+ "@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.18.4-canary-20251120-12f6fb3a"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@lynx-js/offscreen-document": "npm:@lynx-js/offscreen-document-canary@0.1.4"