@lynx-js/web-core
Version:
This is an internal experimental package, do not use
112 lines • 4.03 kB
JavaScript
/*
* Copyright 2025 The Lynx Authors. All rights reserved.
* Licensed under the Apache License Version 2.0 that can be found in the
* LICENSE file in the root directory of this source tree.
*/
import { uniqueIdSymbol } from '../../constants.js';
export function getUniqueId(element) {
return element[uniqueIdSymbol];
}
export const __ElementIsEqual = (left, right) => {
if (left === right)
return true;
if (!left || !right)
return false;
return getUniqueId(left) === getUniqueId(right);
};
export const __GetElementUniqueID = (element) => {
return getUniqueId(element);
};
// Throwing/Stub Implementations
export const __GetParent = (_element) => {
throw new Error('__GetParent is not implemented in SSR');
};
export const __GetChildren = (_element) => {
throw new Error('__GetChildren is not implemented in SSR');
};
export const __AddEvent = () => {
// Silent return for SSR compatibility
};
export const __GetEvent = () => {
throw new Error('__GetEvent is not implemented in SSR');
};
export const __GetEvents = () => {
throw new Error('__GetEvents is not implemented in SSR');
};
export const __SetEvents = () => {
throw new Error('__SetEvents is not implemented in SSR');
};
export const __UpdateListCallbacks = () => {
// No-op in SSR
};
// __GetConfig uses GetElementConfigPAPI
export const __GetConfig = () => {
throw new Error('__GetConfig is not implemented in SSR');
};
export const __SetConfig = () => {
throw new Error('__SetConfig is not implemented in SSR');
};
export const __GetElementConfig = () => {
throw new Error('__GetElementConfig is not implemented in SSR');
};
export const __GetComponentID = () => {
throw new Error('__GetComponentID is not implemented in SSR');
};
export const __GetDataset = (_element) => {
throw new Error('__GetDataset is not implemented in SSR');
};
export const __SetDataset = (_element, _dataset) => {
throw new Error('__SetDataset is not implemented in SSR');
};
export const __AddDataset = (_element, _key, _value) => {
// No-op in SSR
};
export const __GetDataByKey = (_element, _key) => {
throw new Error('__GetDataByKey is not implemented in SSR');
};
export const __FirstElement = (_element) => {
throw new Error('__FirstElement is not implemented in SSR');
};
export const __LastElement = (_element) => {
throw new Error('__LastElement is not implemented in SSR');
};
export const __NextElement = (_element) => {
throw new Error('__NextElement is not implemented in SSR');
};
export const __RemoveElement = (_parent, _child) => {
throw new Error('__RemoveElement is not implemented in SSR');
};
export const __ReplaceElement = (_newEl, _oldEl) => {
throw new Error('__ReplaceElement is not implemented in SSR');
};
export const __SwapElement = (_a, _b) => {
throw new Error('__SwapElement is not implemented in SSR');
};
export const __AddConfig = () => {
throw new Error('__AddConfig is not implemented in SSR');
};
export const __UpdateComponentInfo = () => {
throw new Error('__UpdateComponentInfo is not implemented in SSR');
};
export const __UpdateComponentID = () => {
throw new Error('__UpdateComponentID is not implemented in SSR');
};
export const __MarkTemplateElement = () => {
throw new Error('__MarkTemplateElement is not implemented in SSR');
};
export const __MarkPartElement = () => {
throw new Error('__MarkPartElement is not implemented in SSR');
};
export const __GetTemplateParts = () => {
throw new Error('__GetTemplateParts is not implemented in SSR');
};
export const __GetPageElement = () => {
throw new Error('__GetPageElement is not implemented in SSR');
};
export const __InsertElementBefore = (_parent, _child, _ref) => {
throw new Error('__InsertElementBefore is not implemented in SSR');
};
export const __ReplaceElements = (_parent, _newChildren, _oldChildren) => {
throw new Error('__ReplaceElements is not implemented in SSR');
};
//# sourceMappingURL=pureElementAPIs.js.map