Skip to content

pantoken-root / web-components

web-components ​

Compatibility ​

Target: Web Components. Current format: Custom-element registration and button shadow output. Tested environment: Node 26.10.0 with happy-dom 20.14.5. Real-browser rendering and interaction behavior are not verified.

Full compatibility matrix

Alpha(內測)

@pantoken/web-components — 適用於 Instructure UI 的框架無關自訂元素。

register(在瀏覽器中自動呼叫)將完整的 <instui-*> 元素集定義到任何自訂元素註冊表中。每個元素會將對應的 @pantoken/components CSS 呈現在其 shadow root;tokens 是穿透 shadow 邊界的繼承型自訂屬性 — 載入 @pantoken/css 以提供它們。

對於本地化的 UI 字串(行事曆導航標籤、日期輸入的佔位文字、鑽取式的「返回」文字),將 locale、strings 或 dir 選項傳給 register。完整的 Canvas 等效套件與 registerLocalized 幫助器也由此套件匯出。

此模組為 Node 安全:元素類別定義於 register 內,當沒有 DOM 時為 no-op,因此在 SSR 或建置時匯入不會觸及 HTMLElement。

註冊和 shadow 輸出已透過 Happy DOM 在該環境驗證;真實瀏覽器的行為 不包含在該檢查中。

介面 ​

變數 ​

函式 ​