Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@canvas-components/canvas-ui

Latest version: v1.0.11

Overview

Last scanned
30 Nov 2026
Published
30 Nov 2026
npm package Publisher: anycloud666
13 Versions
3.4K Downloads

Scan summary

@canvas-components/canvas-ui was last scanned on 30 Nov 2026 at version 1.0.11. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 13 versions; the latest 5 were published within 7 days (24–30 Nov 2026).
  • Findings: No rules fired in version 1.0.11.
  • Downloads: 3,395 downloads.

Versions

13 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.0.11 LATEST 30 Nov 2026 No rules fired
1.0.10 25 Nov 2026 No rules fired
1.0.9 24 Nov 2026 No rules fired
1.0.8 24 Nov 2026 Not shown
1.0.7 24 Nov 2026 Not shown

No rules fired in 1.0.11

Findings

Findings for v1.0.11. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 1.0.11; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

canvas-ui

使用 JSON 在 Canvas 上绘制独立的 UI 内容。运行时可测量、绘制和返回交互区域,调用方提供 Canvas、绘制尺寸与事件处理。

import {
  createUIContentRuntime,
  validateUILayoutDocument,
} from "@canvas-components/canvas-ui";

const document = validateUILayoutDocument({
  type: "canvas-ui",
  version: 1,
  root: { kind: "text", text: "任务准备就绪" },
});

const context = canvas.getContext("2d")!;
const runtime = createUIContentRuntime(context);
const prepared = runtime.layout(document, {
  width: canvas.width,
  height: canvas.height,
});
runtime.draw(context, prepared.ui, { x: 0, y: 0 });
runtime.destroy();

需要自行提供文本或叶节点测量时,可以使用 layoutUIDocument。需要 JSX 声明时,使用 @canvas-components/react-canvas-ui。

列表与网格

ui.list(props, template) 按主轴尺寸索引定位条目;ui.grid(props, template) 分别索引行列,并通过 itemsAt(rowKey, columnKey) 获取可见格子的业务记录。集合自身或祖先可通过 overflowX、overflowY 设置滚动视口。滚动时只实例化进入窗口的条目。

固定尺寸集合若反复使用同一个 Object.freeze(items) 快照、稳定键选择器和尺寸值,可复用几何索引。普通数组、尺寸回调和显式时间偏移在重新声明节点时重新读取。模板始终属于本次声明。

设置 rowHeight: "content" 后,网格按已测量格子的最高内容和 minRowHeight 确定行高。首次进入此前未显示的列时可能修正高度。已掌握所有工单尺寸的业务可传入行高函数,直接确定窗口外行的几何。宿主更新网格时按首个可见行的稳定键保持纵向位置。

独立挂载与虚拟集合

ui.mount(canvas, root) 管理绘制、节点命中、滚动和资源生命周期。列表使用稳定键和主轴尺寸定位,只在可见窗口内执行模板。下面的队列直接在列表上声明滚动区域。

import { ui } from "@canvas-components/canvas-ui";
import { createUIDebugger } from "@canvas-components/canvas-ui/debug";

const debug = createUIDebugger();
const orders = Array.from({ length: 5000 }, (_, id) => ({
  id,
  title: "工单 " + id,
}));
const root = ui.list(
  {
    items: orders,
    itemKey: "id",
    itemHeight: 36,
    style: { height: 360, overflowY: "auto" },
  },
  (order) => ({ kind: "text", text: order.title }),
);
const host = ui.mount(canvas, root, { debug });
// 完成一帧绘制后读取当前窗口和累计创建次数。
const inspect = () => ({
  visible: debug.snapshot()?.visibleCollectionEntries,
  created: debug.report().counts.collectionTemplates,
});
// 页面卸载时调用 host.destroy()。

横向队列设置 axis: "x" 和 itemWidth。工单有明确开始时刻时,itemOffset 可提供每项在主轴上的像素起点。矩阵使用 ui.grid 声明行键、列键和尺寸,itemsAt(rowId, columnId) 为可见坐标提供条目,空位置可返回空数组。跨行换行时由页面根据宽度选择列数。原生与 JSX 共用这些尺寸和命中规则。

虚线边框

JSX 和 JSON 均支持在 style 中组合 borderStyle: "dashed"、borderWidth 和 borderRadius。虚线段长与间距分别为线宽的 3 倍与 2 倍。默认绘制实线。

外阴影

用 style.boxShadow 为节点的边框盒绘制单层外阴影。JSX 和 JSON 使用相同的对象。必填字段 color 接收 Canvas 颜色字符串。可选的 offsetX、offsetY 和 blur 使用 CSS 像素,默认值为 0。负偏移向左或向上,模糊半径须为非负数。

<UI.Col
  style={{
    padding: 12,
    borderRadius: 8,
    backgroundColor: "#fff",
    boxShadow: { color: "rgba(15, 23, 42, 0.2)", offsetY: 4, blur: 12 },
  }}
>
  <UI.Text>工单详情</UI.Text>
</UI.Col>

阴影跟随 borderRadius,受画布视口和祖先容器裁剪。它不占布局空间,也不扩大滚动范围。

Tooltip

UI.Tooltip 包裹一个 Canvas UI 节点,content 接收字符串或用于展示的 Canvas UI JSX。可选的 placement 支持 top、top-left、top-right、bottom、bottom-left、bottom-right、left 和 right,默认 top。视口空间不足时尝试翻到另一侧。

<UI.Tooltip content="设备 A · 排产中" placement="bottom-left">
  <UI.Text>工卡 GD-241101</UI.Text>
</UI.Tooltip>

编译器将提示记录写入触发节点的 tooltip 字段。纯 JSON 可直接提供该字段,例如 { "content": "进行中", "placement": "top-right" }。富文本提示的 content 也可传入一个 Canvas UI 节点。

独立 Canvas 宿主可用 createUITooltip(canvas) 创建浮层服务。鼠标命中带 ui.tooltip 的热点后调用 hover(hotspot.ui.tooltip, rect),稳定悬停 150 毫秒后显示。键盘聚焦使用 show(hotspot.ui.tooltip, rect) 立即显示。其中 rect 是加上绘制原点并裁切后的宿主局部矩形。离开触发区域、拖动或内部滚动时调用 hide(),卸载时调用 destroy()。提示内容在独立 Canvas 中按需排版并复用绘制结果,提示内的内容用于展示。使用 drag-any 时,画布已接入此服务。

节点审查与性能采样

import { createUIContentRuntime } from "@canvas-components/canvas-ui";
import {
  attachUIDebugPanel,
  createUIDebugger,
} from "@canvas-components/canvas-ui/debug";

const debug = createUIDebugger({ sampleLimit: 240 });
const context = canvas.getContext("2d")!;
const runtime = createUIContentRuntime(context, { debug });
const detach = attachUIDebugPanel({
  debugger: debug,
  canvas,
  container: panel,
});

const prepared = runtime.layout(document, {
  width: canvas.width,
  height: canvas.height,
});
requestAnimationFrame((timestamp) => {
  debug.markFrame(timestamp);
  runtime.draw(context, prepared.ui, { x: 0, y: 0 });
});

// 卸载应用时释放
// detach();
// runtime.destroy();

面板可以从节点树选择节点,也可以开启“点选画布”后点击绘制区域。按住 Shift 点选时,只查找可交互热点。蓝线表示布局盒,绿色虚线表示矩形裁剪后的绘制范围,棕色虚线表示命中范围。详情包括节点路径、输入与归一化样式、可见性、布局诊断和动作顺序。快照对应同一个调试器最近一次绘制的区域,画布中多个区域可分别绑定调试器。

性能记录按阶段统计 JSX 编译、文档校验、布局、热点、文本与绘制耗时,并统计节点、测量、缓存、图片状态及实际提交的绘制项。使用 React 时通过 compileUIJSX(jsx, { instrumentation: debug }) 接入编译采样。图片状态计数来源于实际查询宿主提供的图片缓存。导出包含最近的原始耗时样本、统计摘要、节点快照、视口和 DPR。

一帧开始时调用一次 markFrame(timestamp),用连续的浏览器帧时间戳计算帧间隔与长帧。面板记录目标 Canvas 的普通点击到下一次 draw 完成的间隔。其他输入由应用在事件处理时调用 markInput()。首次绘制表示从创建或重置采样器到第一次 draw 返回;这些指标描述 Canvas 提交,浏览器合成时间另计。百分位基于最近样本,最大值覆盖本轮全部样本。

只测运行时时可跳过面板挂载,从 debug.report() 和 debug.trace() 读取数据。这样浏览器帧指标不会包含节点列表和高亮层的刷新成本。

覆盖层线段

用 UI.Line 声明线段,或用对应的 JSON 节点 { kind: "leaf", leafType: "line", props }。端点 x1、y1、x2、y2 相对绘制区域原点,单位为 CSS 像素。可设置 stroke、strokeWidth 和 dash。

import { compileUIJSX, UI } from "@canvas-components/react-canvas-ui";

const { document } = compileUIJSX(
  <UI.Line x1={80} y1={0} x2={80} y2={260} stroke="#c53030" dash={[4, 4]} />,
);

宿主读取线段属性后,在对应的裁剪区域内调用 drawUILine(context, props, { x, y })。绘制函数从 @canvas-components/canvas-ui/host 导入,{ x, y } 为区域原点。线段用于覆盖区绘制,不占内容布局空间,也不参与命中。

容器滚动

在布局节点的 style 中用 overflowX: "auto"、overflowY: "auto" 按轴开启滚动,也可以写为 "scroll"。用宽度或高度限制视口,内容超出时才显示滚动条。设置 style.scrollbarVisible: false 可隐藏容器的横纵滚动条,仍可使用滚轮或其他宿主滚动输入。横向 Flex 和纵向 Flex 的滚动主轴会保留子项宽度或高度。

<UI.Col style={{ height: 120, overflowY: "auto" }}>
  <UI.div style={{ height: 100 }}>白班工单</UI.div>
  <UI.div style={{ height: 100 }}>夜班工单</UI.div>
</UI.Col>

Canvas 宿主可基于 runtime.layout 的结果创建一个 UIScrollState。将局部坐标和 CSS 像素增量传给 state.scrollBy,返回值为可传给外层的剩余增量。重绘时使用 state.view(prepared.ui) 返回的 ui 和 hotspots,避免重复测量或使用过期命中区域。向 runtime.draw 传入 { scrollbars: true } 绘制滚动条。宿主可在指针按下时调用 state.startScrollbarDrag 并在拖动过程中调用返回的处理函数。

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @canvas-components/canvas-ui

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Frame 2085668439 (1)
Group 1261154229