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

@wcstack/share

Latest version: v4.30.0

Overview

Last scanned
25 Nov 2026
Published
25 Nov 2026
npm package Publisher: mogera551
7 Stars
0 Forks
72 Versions
5.2K Downloads
TypeScript Repo language

Scan summary

@wcstack/share was last scanned on 25 Nov 2026 at version 4.30.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 72 versions; the latest 4 were published within 3 days (23–25 Nov 2026).
  • Findings: No rules fired in version 4.30.0.
  • Downloads: 5,157 downloads.

Versions

72 versions published
Versions and the rules that fired in each
VersionPublishedStatus
4.30.0 LATEST 25 Nov 2026 No rules fired
4.29.0 24 Nov 2026 No rules fired
4.28.0 23 Nov 2026 No rules fired
4.27.0 23 Nov 2026 Not shown
4.26.0 18 Nov 2026 Not shown

No rules fired in 4.30.0

Findings

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

README

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

@wcstack/share

🤖 AI coding agents: This README is a package-level reference, not the primary entry point for building a wcstack application. If you have not already done so, first read the repository README and AGENTS.md, then use the wcstack-app skill.

@wcstack/share is a headless Web Share component for the wcstack ecosystem.

It is not a visual UI widget. It is a command-only async primitive node that turns navigator.share(data) — click, native share sheet, resolve/reject — into a single declarative command, the same way @wcstack/notification turns Notification into reactive state plus a notify command.

With @wcstack/state, <wcs-share> can be bound directly through path contracts:

  • command surface: share(data) — a single async command, invoked as command.share: $command.doShare
  • output state surface: value, loading, error, cancelled, and — since 4.25 — supported

This means a "Share this article" button can be expressed declaratively in HTML — success, failure, and the user simply dismissing the native share sheet are three distinct, bindable outcomes — without writing navigator.share() / try/catch glue in your UI layer.

@wcstack/share follows the wcstack Core/Shell architecture:

  • Core (ShareCore) runs each navigator.share(data) call through the shared io-core operation lane (exhaust: one share sheet at a time, a call made while one is open is a no-op; dispose() invalidates a call in flight, so a late completion writes nothing), with same-value-guarded loading/error/cancelled setters (value is exempt — a completion signal that fires on every success) and a never-throw try/catch
  • Shell (<wcs-share>) connects that command to DOM lifecycle and exposes canShare(data) as a plain synchronous method
  • Binding Contract (static wcBindable) declares observable properties and a single share command (deliberately no inputs, no abort command)

Why this exists — a command-only node, and cancellation is not an error

Every other wcstack IO node either monitors a continuous state (network, permission) or configures something ahead of time and observes it change (fetch's url, geolocation's enableHighAccuracy). navigator.share() is different: it is a one-shot "call → native share sheet → resolve/reject" action with no continuous state to configure or watch, and (unlike fetch) no way to abort an in-flight call — there is no AbortSignal option, and the platform allows only one modal share sheet at a time, so the "a new call supersedes the previous one" plumbing fetch needs has no counterpart here.

The other defining decision is separating cancelled from error. When a user simply closes the native share sheet, navigator.share() rejects with an AbortError — exactly like closing a <dialog>. Folding that into error would make a binding gated on error (e.g. showing a "sharing failed" banner only when it is set) also fire on routine, harmless user cancellation, which is a UX bug waiting to happen. <wcs-share> keeps cancelled as its own boolean/event, so error reflects only genuine platform failures (NotAllowedError, TypeError, etc.).

See docs/web-share-tag-design.md for the full design rationale.

Install

npm install @wcstack/share

Quick Start

1. Share an article, with cancellation handled separately from failure
<script type="module" src="https://esm.run/@wcstack/share/auto"></script>
<script type="module" src="https://esm.run/@wcstack/state/auto"></script>

<wcs-state>
  <script type="module">
    export default {
      $commandTokens: ["doShare"],
      loading: false,
      error: null,
      cancelled: false,
      onShareClick() {
        this.$command.doShare.emit({
          title: document.title,
          url: location.href,
        });
      },
    };
  </script>
</wcs-state>

<wcs-share
  data-wcs="command.share: $command.doShare; loading: loading; error: error; cancelled: cancelled"
></wcs-share>

<button data-wcs="onclick: onShareClick; disabled: loading">Share</button>
<template data-wcs="if: error">
  <p>Sharing failed: <span data-wcs="textContent: error.message"></span></p>
</template>

Because share() must run from within a real user gesture (a click handler), the button's click handler calls $command.doShare.emit(...) directly — <wcs-share> has no autoTrigger shortcut of its own (see Notes & limitations).

2. Offer the button only where sharing works

Since 4.25, the supported output says whether this page can use the Web Share API at all. Bind it and hide the button where it cannot:

<wcs-state>
  <script type="module">
    export default {
      $commandTokens: ["doShare"],
      shareSupported: false,
      onShareClick() {
        this.$command.doShare.emit({ title: document.title, url: location.href });
      },
    };
  </script>
</wcs-state>

<wcs-share data-wcs="command.share: $command.doShare; supported: shareSupported"></wcs-share>

<button data-wcs="hidden: shareSupported|not; onclick: onShareClick">Share</button>
3. canShare(data) — asking about this data

supported is about the page. Whether a particular payload can be shared — files above all — is still a question for canShare(data):

<script type="module">
  const shareEl = document.querySelector("wcs-share");
  // photo: a File the page holds (from an <input type="file">, a canvas, ...)
  if (shareEl.canShare({ files: [photo] })) {
    // offer "Share the photo"
  }
</script>

Observable Properties (outputs)

Property Event Description
value wcs-share:complete An echo of the data object passed to the share() call that just completed successfully, signalling "this share succeeded" (navigator.share() itself resolves Promise<void> with no payload). null before any successful share.
loading wcs-share:loading-changed true while a share() call is in flight.
error wcs-share:error A genuine platform failure (anything other than the user cancelling the share sheet). null when there has been no failure yet, or after the next share() call resets it.
cancelled wcs-share:cancelled-changed true when the user dismissed the native share sheet (AbortError). Kept independent of error so bindings gated on error do not react to routine cancellation.
errorInfo wcs-share:error-info-changed Serializable failure taxonomy (stable code / phase / recoverable), or null. Additive — the error shape is unchanged; code is capability-missing when unsupported or share-failed on a genuine failure.
supported wcs-share:supported-changed Since 4.25. true when this page can use the Web Share API. See below.

supported (since 4.25) is true when navigator.share is a function and the page is not forbidden to use it: a Permissions-Policy that turns web-share off (the server's header, or an <iframe> without allow="web-share") and an insecure context both make it false. (A browser whose policy does not know the web-share feature — desktop Chromium — is not asked about it: there the API's presence decides.) It is read from the browser each time it is asked for, so a binding gets the right value when it attaches; the element also dispatches wcs-share:supported-changed (the boolean as detail) when it is connected, if the value differs from the last one it dispatched (it starts at false).

It does not say that a particular payload can be shared — canShare(data) stays the way to ask about this data (files) — and it does not say the user will pick a target. Where a Permissions-Policy is the reason, share() is still passed to the browser, which rejects it (error, errorInfo.code: "share-failed"); where navigator.share is missing, share() ends as capability-missing without calling anything.

Concurrency. A share sheet is a single system-modal surface, so <wcs-share> runs its calls through the shared io-core lane with the exhaust policy: while one share() is in flight, a second call is an idempotent no-op (it returns null without opening a second sheet), leaving the in-flight call's result untouched.

cancelled and error are both reset (false / null) at the start of a share() call that goes on to actually invoke navigator.share(), so a stale outcome from a previous call never lingers into that call's result. The one exception is the unsupported early-return (navigator.share missing, see below): it returns before that reset runs, so a cancelled left over from an earlier call can still read true alongside the freshly-set unsupported error. This is a narrow edge case in practice — a page losing navigator.share mid-session is not a realistic scenario.

Commands

Command Async Description
share yes Invokes navigator.share(data) with a single options object ({ title?, text?, url?, files? }) passed as one positional argument.

There is no abort command — the Web Share API offers no mechanism to cancel an in-flight share() call from the caller's side.

Wire share through a state method, not straight to a button. <button data-wcs="onclick: $command.doShare"> emits the token with the DOM event as its first argument, so the element is called as share(event) — and the browser rejects an Event as share data with a TypeError (error, share-failed). The command takes data: emit it from a method, as onShareClick() does in the Quick Start (this.$command.doShare.emit({ url })).

canShare(data) — a plain synchronous method, not part of wcBindable

navigator.canShare(data) is a synchronous, side-effect-free predicate. It does not fit the wc-bindable properties shape (an observable with no arguments) or the commands shape (fire-and-observe-via-event); it is exposed directly as a plain instance method:

const canShare: boolean = shareEl.canShare({ url: "https://example.com" });

It returns false (rather than throwing) when navigator.canShare is absent.

Attributes / Inputs

None. share(data)'s data varies on every call — it is a command argument, not a value to park on the element ahead of time as an attribute.

CSS styling with :state()

<wcs-share> reflects three boolean output states onto its ElementInternals CustomStateSet, so you can style it directly from CSS with the :state() pseudo-class — no data-wcs binding or extra class toggling required.

State On when
loading wcs-share:loading-changed fires with true (cleared on false)
cancelled wcs-share:cancelled-changed fires with true (cleared on false)
error wcs-share:error fires with a non-null detail (cleared on null)
wcs-share:state(loading) ~ .spinner { display: block; }
wcs-share:state(loading) ~ .spinner { display: none; } /* default */

wcs-share:state(cancelled) ~ .hint { display: block; }
form:has(wcs-share:state(error)) .banner { display: block; }

Unlike attributes or classes, :state() cannot be written from outside the element, so there is no risk of confusing this output state with an input.

Browser support (:state(x) syntax): Chrome/Edge 125+, Safari 17.4+, Firefox 126+. In older browsers the states are simply never set — :state() selectors never match, but <wcs-share> itself keeps working normally (graceful degradation, never-throw).

SSR: :state() cannot be serialized into HTML, so server-rendered markup never carries these states on first paint (@wcstack/server is unaffected). If you need to style the pre-hydration gap, pair your rule with wcs-share:not(:defined) instead.

Debugging

Custom states are invisible in DevTools' Elements panel and attachInternals() cannot be called twice, so there is no console way to inspect them directly. Two debug-only aids are provided for that:

  • el.debugStates — a snapshot array of the currently-on state names (e.g. ["loading"]). It is not part of wc-bindable (not a bind target) and its shape is not a guaranteed contract — use it for debugging only.

  • The debug-states attribute (opt-in, default off) mirrors state changes onto data-wcs-state-loading / data-wcs-state-cancelled / data-wcs-state-error attributes on the element, so the Elements panel highlights them as they toggle:

    <wcs-share debug-states></wcs-share>

*Write your CSS against :state(), not `data-wcs-state-`.** The mirrored attributes exist purely to make state changes visible while debugging with DevTools open; they are not a supported styling hook.

Notes & limitations

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 @wcstack/share

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

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

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