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

@webwriter/widget

Latest version: v1.6.0

Overview

Last scanned
25 Nov 2026
Published
25 Nov 2026
npm package Publisher: salmenf
24 Stars
3 Forks
5 Versions
1.1K Downloads
HTML Repo language

Scan summary

@webwriter/widget was last scanned on 25 Nov 2026 at version 1.6.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 5 versions; the latest 3 were published within 7 days (19–25 Nov 2026).
  • Findings: No rules fired in version 1.6.0.
  • Downloads: 1,139 downloads.

Versions

5 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.6.0 LATEST 25 Nov 2026 No rules fired
1.5.0 24 Nov 2026 No rules fired
1.4.0 19 Nov 2026 No rules fired
1.3.0 17 Nov 2026 Not shown
1.2.0 16 Nov 2026 Not shown

No rules fired in 1.6.0

Findings

Findings for v1.6.0. 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.6.0; other versions have their own rules, not their own score.

README

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

@webwriter/widget

A widget can use a native custom element. The optional @webwriter/widget package adds the shared runtime for observing the authored DOM and participating in live sessions.

withWidgetRuntime(Base)

Apply the mixin to your element class before registration. It adds widgetRuntime and observes the host attributes listed in static widgetAttributes.

import {withWidgetRuntime} from "@webwriter/widget"

class WwLabel extends withWidgetRuntime(HTMLElement) {
  static widgetAttributes = ["label"]

  #label = document.createElement("span")
  #unsubscribe

  constructor() {
    super()
    this.attachShadow({mode: "open"}).append(document.createElement("slot"), this.#label)
  }

  connectedCallback() {
    super.connectedCallback()
    const {getSnapshot, subscribe} = this.widgetRuntime
    const render = () => { this.#label.textContent = getSnapshot().attributes.label ?? "" }
    this.#unsubscribe = subscribe(render)
    render()
  }

  disconnectedCallback() {
    this.#unsubscribe?.()
    super.disconnectedCallback()
  }
}

customElements.define("ww-label", WwLabel)

Modules

For HTML and JavaScript previews, import renderSandbox from @webwriter/widget/sandbox. This helper creates a self-contained iframe document in an opaque script sandbox, without a server or editor runtime dependency. See Run HTML in an isolated preview for CSP authorization, standalone exports, and supported execution behavior.

A module is a class with the suffix Core. Import each module from its own path, such as @webwriter/widget/drag. Create the module for the host. Call connect() and disconnect() in the lifecycle callbacks. Call refresh() after the widget changes its shadow DOM. Read the state with getSnapshot() and follow it with subscribe(), which returns the function that stops following. Pass rendered to a core when the widget renders asynchronously. The function returns a promise that settles after the next render. Pass root when the shadow root is not host.shadowRoot.

Module Import path Core
Permissions @webwriter/widget/permissions PermissionsCore
Settings @webwriter/widget/settings SettingsCore
Shortcuts @webwriter/widget/shortcuts ShortcutsCore
Drag @webwriter/widget/drag DragCore
Viewport @webwriter/widget/viewport ViewportCore
Help @webwriter/widget/help HelpCore
Print note @webwriter/widget/print PrintNoteCore, documentAddress
Scene @webwriter/widget/scene SceneCore, sceneElements
Playback @webwriter/widget/playback PlaybackCore
Data block @webwriter/widget/data JsonDataCore
Localization @webwriter/widget/localize LocalizeCore
Exercise @webwriter/widget/exercise ExerciseCore
Helpers @webwriter/widget/transaction, @webwriter/widget/visible transaction, whileVisible

A core that depends on another takes it as an option. Pass the ViewportCore as viewport to DragCore for a target in world coordinates, and to SceneCore for a scene that is the window of a canvas viewport. The text of static options, static actions, static optionGroups, and static permissions, and their hidden, disabled, and readOnly fields, may be a function of the widget. A plain element answers such texts in its own getter with resolveDeclarations(this, map) from @webwriter/widget.

The examples show the three most used modules. Permissions hides a control and gates an interaction.

import {PermissionsCore} from "@webwriter/widget/permissions"

class WwHintCard extends HTMLElement {
  static permissions = {
    allowHint: {label: {_: "Learners may reveal the hint in this widget"}, attribute: "allow-hint"},
  }

  #permissions = new PermissionsCore(this)

  constructor() {
    super()
    const root = this.attachShadow({mode: "open"})
    root.innerHTML = `
      <slot></slot>
      <div data-ww-can="allowHint">
        <button>Hint</button>
        <div id="hint" hidden><slot name="hint"></slot></div>
      </div>
    `
    const hint = root.getElementById("hint")
    root.querySelector("button").addEventListener("click", () => (hint.hidden = !hint.hidden))
  }

  connectedCallback() {
    this.#permissions.connect()
  }

  disconnectedCallback() {
    this.#permissions.disconnect()
  }
}

customElements.define("ww-hint-card", WwHintCard)

Settings stores each setting as an attribute and binds the controls marked data-ww-setting. defineProperties() gives the host one property per setting.

import {SettingsCore} from "@webwriter/widget/settings"

class WwSimulation extends HTMLElement {
  static settings = {
    population: {type: Number, default: 200, min: 10, max: 2000, step: 10, label: {_: "Population"}},
    showChart: {type: Boolean, default: true, label: {_: "Show chart"}},
  }

  #settings = new SettingsCore(this)
  #unsubscribe

  constructor() {
    super()
    this.attachShadow({mode: "open"}).innerHTML = `
      <p></p>
      <label><span data-ww-setting-label="population"></span> <input type="number" data-ww-setting="population"></label>
      <label><input type="checkbox" data-ww-setting="showChart"> Chart</label>
    `
    this.#settings.defineProperties()
  }

  get options() {
    return this.#settings.editorOptions()
  }

  connectedCallback() {
    this.#settings.connect()
    this.#unsubscribe = this.#settings.subscribe(() => this.#render())
    this.#render()
  }

  disconnectedCallback() {
    this.#unsubscribe?.()
    this.#settings.disconnect()
  }

  #render() {
    const chart = this.#settings.get("showChart") ? ", with chart" : ""
    this.shadowRoot.querySelector("p").textContent = `${this.#settings.get("population")} people${chart}`
  }
}

customElements.define("ww-simulation", WwSimulation)

Drag moves authored children. A move changes the authored DOM, so can decides who may do it.

import {DragCore} from "@webwriter/widget/drag"
import {PermissionsCore} from "@webwriter/widget/permissions"

class WwSortList extends HTMLElement {
  static permissions = {
    allowReordering: {label: {_: "Learners may reorder the items"}, attribute: "allow-reordering"},
  }

  #permissions = new PermissionsCore(this)
  #drag = new DragCore(this, {can: () => this.#permissions.can("allowReordering")})

  constructor() {
    super()
    const root = this.attachShadow({mode: "open"})
    root.innerHTML = `
      <div data-ww-drop="item" data-ww-drop-position="index">
        <slot data-ww-drag="item" data-ww-drag-via="pointer keyboard"></slot>
      </div>
      <output></output>
    `
    let moves = 0
    root.addEventListener("ww-dragcommit", () => (root.querySelector("output").textContent = `${++moves} moves`))
  }

  connectedCallback() {
    this.#permissions.connect()
    this.#drag.connect()
  }

  disconnectedCallback() {
    this.#drag.disconnect()
    this.#permissions.disconnect()
  }
}

customElements.define("ww-sort-list", WwSortList)

Module declarations has an example of each other module.

Shared widget state

The snapshot describes the current DOM. Use attribute names in static widgetAttributes and read their values from attributes. Values are strings or null when an attribute is absent. Set an authored attribute on the host to persist a setting in the document.

Snapshot fields Purpose
editable, lang, standalone The host's editing mode, effective language, and standalone attribute.
attributes The values for the attributes listed in static widgetAttributes.
data, dataType, dataBlock, dataSlot The current inert data block and its text, type, and slot.
dataMode The current scope. One of individual, all, group, or local.
dataReady, dataError Whether the data scope accepts writes, and the latest error if present.

Use host.widgetRuntime.setData(type, text, attrs?) to write to the data block from an interaction. It updates an existing block in place and rejects writes while a managed scope is pending. For live-session data, use a direct JSON or XML script with slot="data" and set sharedData: true in the editing configuration. Standalone documents can use the same block as local data. Data and events

Put static options, static optionGroups, static actions, and their handler methods on the custom element. WebWriter uses these declarations in the Widget drawer. The runtime and adapters export the corresponding TypeScript declaration types. Options and actions

Declare conversions in static convertFrom and static convertTo. A key that starts with a dot or holds a slash names a file format; every other key is the lowercase tag of an HTML element. Type the maps with ConvertFromDeclarations and ConvertToDeclarations from @webwriter/widget, which every library re-exports, as in static convertFrom = {ul: "loadList", ".json": "importJson"} satisfies ConvertFromDeclarations. Conversions

A custom element publishes signals in its signals object and receives them through static effects, and static signals declares the value shape of each published signal. Every library re-exports the shape types and guards of @webwriter/widget, such as isTable. A widget without Lit imports signal, computed and watchSignal from @webwriter/widget/signals. Make data reactive

Module declarations

A module supplies one common widget behavior. A widget bundles only the modules that it imports. Mark elements in the shadow root with data-ww-* attributes and listen for the module's ww-* events. The module handles pointer, touch, and keyboard input. It also handles announcements and cleanup. The sections below name each module's core and declarations. @webwriter/lit describes every module in full, with its options, events, and rules. The rules hold for every library.

A binding of a library has the same name as the module on its own path, such as @webwriter/react/drag. The core is the class of @webwriter/widget, which a widget can also use directly. The examples in this section are plain custom elements on the cores. Each library's Modules section lists its bindings and shows Permissions, Settings, and Drag in that library.

A module option named can is a function. The module calls it before and during an interaction. The module cancels the interaction when the function returns false. A module that changes the document wraps the change and the next render in one undo transaction. Modules show and speak their own text in the widget's language. Each language loads on first use. Pass messages to a module to replace a text.

Permissions

Permissions answers can(name) for each entry of static permissions, true in edit mode and, in read mode, while the author has granted the permission. PermissionsCore is in @webwriter/widget/permissions; the bindings are usePermissions, usePermissions, permissionsStore, and injectPermissions for React, Vue, Svelte, and Angular.

data-ww-can="name" hides a shadow element while can(name) is false, data-ww-can="edit" shows it in edit mode only, and data-ww-can-mode="disable" makes it inert instead. The example is in the Modules section of the library. See Permissions.

A component that sits in the shadow tree of another widget has no editing state of its own. It asks the surrounding widget, and answers when the widget's permissions change. The React, Angular, and Svelte bindings have useWidgetPermissions(host), injectWidgetPermissions(), and widgetPermissions(host) for it. A Vue component renders in the widget's own shadow root, so usePermissions() already answers for the widget.

Settings

Settings turns declarations into reflected attributes, entries of the Widget drawer, and controls bound with data-ww-setting="name". SettingsCore is in @webwriter/widget/settings; the bindings are useSettings, useSettings, settingsStore with withSettings, and injectSettings.

Each setting becomes a reflected attribute and an entry of the Widget drawer. A boolean that defaults to true uses a negative attribute such as no-show-chart. The example is in the Modules section of the library. See Settings.

The label, description, and placeholder of a setting may be functions of the widget, and so may those of a choice of a select. The core asks the function whenever it shows the text, and editorOptions() gives the editor the answer. labelOf(name, choice?) returns the label in the widget's language. Use a function for a text that the widget keeps in its own catalog, and type its parameter by what it reads.

The same holds for the texts of static options, static actions, static optionGroups, and static permissions: label, description, placeholder, confirm, disabledReason, and the label and description of a choice. The editor reads plain maps, so the widget answers them. The classes from createReactWidget(), createVueWidget(), and createAngularWidget() do it on the instance. In Svelte, withDeclarations(Base) in customElement.extend does it, and withSettings and withExercise do it for options and actions. A plain element calls resolveDeclarations(widget, map) from @webwriter/widget in its own getter, and merges editorOptions() for its settings.

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 @webwriter/widget

References

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

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

CVE

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

Microsoft's Official agent framework Hijacked
AI & VibeSec

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

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Frame 2085668439 (1)
Group 1261154229