Skip to content

Releases: MindInitiatives/clipify

v1.2.0

Choose a tag to compare

@MindInitiatives MindInitiatives released this 22 May 10:29

Release Notes: Clipify v1.2.0

Overview

This release makes Clipify safer to run anywhere and smarter about managing
clipboard history — without breaking any existing code. Everything from v1.1.x
continues to work exactly as before. v1.2.0 adds history search, item pinning,
and tagging, makes the library safe to import in Node and server-side rendering
(SSR) environments, and fixes two cases where the code and documentation
disagreed.


New Features

1. Search History

  • Find clipboard items by text, key, or tag — case-insensitive, most-recent-first.
  • New Method: search.
    Example:
  const results = clipboard.search("invoice");

2. Pin Items

  • Pin an item to protect it from expiry, so a TTL won't remove something you
    want to keep.
  • New Methods: pin and unpin.
    Example:
  clipboard.pin("greeting");
  clipboard.unpin("greeting");

3. Tag Items

  • Attach freeform tags to items and retrieve them by tag. Tags are de-duplicated.
  • New Methods: tag and getByTag.
    Example:
  clipboard.tag("greeting", "work", "important");
  const workItems = clipboard.getByTag("work");

4. SSR / Node Safety

  • Clipify can now be imported and used on the server without crashing.
  • Where there is no system clipboard, copy records to history only, paste
    returns the most recent history item, and isClipboardSupported() returns
    false instead of throwing — so the same code runs on server and client.

Improvements

  • Type Exports:
    • The package now exports its public types (ClipboardItem,
      ClipboardOptions, ClipboardEventListener) for consumers.
  • History Item Shape:
    • ClipboardItem now optionally carries pinned and tags fields.
  • Process Hygiene:
    • Expiry timers are now unref'd so they don't keep a Node process alive.
  • Documentation:
    • README updated with the new search, pin, and tag APIs and SSR notes.

Bug Fixes

  • copyFile expiry: copyFile now accepts the optional expiryTime
    argument that the README already documented (copyFile(blob, key, 10000)).
    Existing two-argument calls are unaffected.
  • Resilient copy: copy no longer throws when a system-clipboard write
    fails (e.g. permission or focus errors); the item is still recorded in
    history and the copy event still fires.
  • No more crashes without navigator: previously copy, paste, and
    isClipboardSupported could throw in environments lacking
    navigator.clipboard; these now degrade gracefully.

Breaking Changes

  • None. This is a fully backward-compatible release. All v1.1.x code
    continues to work without modification.

Notes & What's Next

  • clearHistory() is unchanged from v1.1.x: it clears the entire history,
    including pinned items. Pinning currently protects against expiry, not
    against an explicit clearHistory() call.
  • The next major release (v2.0.0) will introduce "real pins" —
    clearHistory() will preserve pinned items by default, with an explicit
    override to wipe them — alongside other deliberate, documented API changes.

How to Upgrade

  1. Update your package via NPM or Yarn:
   npm update clipify
  1. No code changes are required. Explore the new search, pin, and tag
    methods in the documentation.

Feedback

We appreciate your feedback! Please report issues or suggest features via our
GitHub Issues.
Thank you for using Clipify! 🎉

v1.1.0

Choose a tag to compare

@MindInitiatives MindInitiatives released this 18 Nov 20:59

Release Notes: Clipify v1.1.0

Overview

This release introduces major enhancements to the Clipify library, extending its functionality for better clipboard management and usability. These updates include support for handling files, retrieving clipboard items by key, improved expiry management, and more comprehensive event handling.


New Features

1. File Handling

  • Added the ability to store files (e.g., images, documents) in clipboard history.
  • New Method: copyFile to add files to the clipboard history.
    Example:
    const fileBlob = new Blob(["File content"], { type: "text/plain" });
    clipboard.copyFile(fileBlob, "fileKey", 10000);

2. Retrieve Items by Key

  • You can now retrieve specific clipboard items by their associated key.
    Example:
    const item = clipboard.getHistory("noteKey");
    console.log(item);

3. Enhanced Expiry Management

  • Clipboard items (both text and files) can now have an associated expiry time, after which they are automatically removed.
  • Expired items trigger an expire event.

4. Improved Event System

  • Added copy and expire events for both text and files.
  • Listen to clipboard actions in real-time:
    clipboard.on("copy", (data) => console.log("Copied:", data));
    clipboard.on("expire", (data) => console.log("Expired:", data));

Improvements

  • History Management:
    • Improved the handling of clipboard history to differentiate between text and file items.
    • Streamlined methods to access the full clipboard history or specific entries.
  • API Simplification:
    • Unified the handling of text and files with clearer method names.
    • Added optional keys to better identify and retrieve items.
  • Documentation:
    • Updated JSDoc comments for all methods.
    • Enhanced README for easier onboarding.

Bug Fixes

  • Fixed incorrect type checks for clipboard items, ensuring compatibility with diverse content types.
  • Addressed an issue where expiry timers were not cleared for already-expired items.
  • Resolved errors in browsers lacking navigator.clipboard support by providing clear fallback messaging.

Breaking Changes

  • getHistory now requires a key to retrieve specific items. The old index-based retrieval has been deprecated.
    • Migration: Replace clipboard.getHistory(index) with clipboard.getHistory(key).

Deprecations

  • Index-based retrieval for clipboard history is deprecated and will be removed in the next major release. Please migrate to key-based retrieval.

How to Upgrade

  1. Update your package via NPM or Yarn:
    npm update clipify
  2. Review the new API changes in the documentation.

Feedback

We appreciate your feedback! Please report issues or suggest features via our GitHub Issues.

Thank you for using Clipify! 🎉

v1.0.0

Choose a tag to compare

@MindInitiatives MindInitiatives released this 17 Nov 19:43
  • Clipboard History: Store multiple clipboard items and retrieve them later.
  • Sensitive Data Expiry: Automatically expiring sensitive data for security.
  • Event-based Notifications: Listen for clipboard changes in real time.
  • Multiple File Support: Support for storing various file types such as text, images, and documents.
  • Data Access: Retrieve specific or recent clipboard items easily.

Full Changelog: https://github.com/MindInitiatives/clipify/commits/v1.0.0