Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zag-js/text-selection

Package Overview
Dependencies
Maintainers
1
Versions
674
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zag-js/text-selection - npm Package Compare versions

Comparing version 0.0.0-dev-20230601120732 to 0.0.0-dev-20230605130234

9

dist/index.d.ts

@@ -1,2 +0,2 @@

type DisableTextSelectionOptions<T = MaybeElement> = {
export type DisableTextSelectionOptions<T = MaybeElement> = {
target?: T;

@@ -6,7 +6,6 @@ doc?: Document;

};
declare function restoreTextSelection(options?: DisableTextSelectionOptions): void;
export declare function restoreTextSelection(options?: DisableTextSelectionOptions): void;
type MaybeElement = HTMLElement | null | undefined;
type NodeOrFn = MaybeElement | (() => MaybeElement);
declare function disableTextSelection(options?: DisableTextSelectionOptions<NodeOrFn>): () => void;
export { DisableTextSelectionOptions, disableTextSelection, restoreTextSelection };
export declare function disableTextSelection(options?: DisableTextSelectionOptions<NodeOrFn>): () => void;
export {};

@@ -1,31 +0,10 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/index.ts
var src_exports = {};
__export(src_exports, {
disableTextSelection: () => disableTextSelection,
restoreTextSelection: () => restoreTextSelection
});
module.exports = __toCommonJS(src_exports);
var import_dom_query = require("@zag-js/dom-query");
var state = "default";
var userSelect = "";
var elementMap = /* @__PURE__ */ new WeakMap();
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const domQuery = require('@zag-js/dom-query');
let state = "default";
let userSelect = "";
const elementMap = /* @__PURE__ */ new WeakMap();
function disableTextSelectionImpl(options = {}) {

@@ -35,3 +14,3 @@ const { target, doc } = options;

const rootEl = docNode.documentElement;
if ((0, import_dom_query.isIos)()) {
if (domQuery.isIos()) {
if (state === "default") {

@@ -52,3 +31,3 @@ userSelect = rootEl.style.webkitUserSelect;

const rootEl = docNode.documentElement;
if ((0, import_dom_query.isIos)()) {
if (domQuery.isIos()) {
if (state !== "disabled")

@@ -58,3 +37,3 @@ return;

setTimeout(() => {
(0, import_dom_query.nextTick)(() => {
domQuery.nextTick(() => {
if (state === "restoring") {

@@ -84,3 +63,3 @@ if (rootEl.style.webkitUserSelect === "none") {

const { defer, target, ...restOptions } = options;
const func = defer ? import_dom_query.raf : (v) => v();
const func = defer ? domQuery.raf : (v) => v();
const cleanups = [];

@@ -97,6 +76,4 @@ cleanups.push(

}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
disableTextSelection,
restoreTextSelection
});
exports.disableTextSelection = disableTextSelection;
exports.restoreTextSelection = restoreTextSelection;
{
"name": "@zag-js/text-selection",
"version": "0.0.0-dev-20230601120732",
"version": "0.0.0-dev-20230605130234",
"description": "",

@@ -31,3 +31,3 @@ "keywords": [

"dependencies": {
"@zag-js/dom-query": "0.0.0-dev-20230601120732"
"@zag-js/dom-query": "0.0.0-dev-20230605130234"
},

@@ -45,11 +45,6 @@ "module": "dist/index.mjs",

"scripts": {
"build-fast": "tsup src",
"start": "pnpm build --watch",
"build": "tsup src --dts",
"test": "jest --config ../../../jest.config.js --rootDir . --passWithNoTests",
"build": "vite build -c ../../../vite.config.ts",
"lint": "eslint src --ext .ts,.tsx",
"test-ci": "pnpm test --ci --runInBand",
"test-watch": "pnpm test --watch -u",
"typecheck": "tsc --noEmit"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc