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

@prosekit/lit

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prosekit/lit - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

21

dist/_tsup-dts-rollup.d.ts

@@ -925,2 +925,5 @@ import { AutoUpdateOptions } from '@floating-ui/dom';

/**
* @internal
*/
export declare function useDismissable(host: LitElement, { onEscapeKeyDown, onPointerDownOutside, onDismiss, getReference, }: {

@@ -933,12 +936,30 @@ onEscapeKeyDown: (event: KeyboardEvent) => void;

/**
* @internal
*/
export declare function useEditorExtension(host: WithEditor<ReactiveControllerHost>, extension: Extension): void;
/**
* @internal
*/
export declare function useEditorFocusChangeEvent(host: WithEditor<ReactiveControllerHost>, handler: FocusChangeHandler): void;
/**
* @internal
*/
export declare function useEditorUpdateEvent(host: WithEditor<ReactiveControllerHost>, handler: UpdateHandler): void;
/**
* @internal
*/
export declare function useEffect<T>(host: ReactiveControllerHost, getValue: () => T, onChange: (value: T) => void): void;
/**
* @internal
*/
export declare function useInlinePopover(host: WithEditor<LitElement>, onReferenceChange: (reference: ReferenceElement | undefined) => void): () => ReferenceElement | undefined;
/**
* @internal
*/
export declare function usePointerDownEvent(host: LitElement, handler: (event: PointerEvent) => void): void;

@@ -945,0 +966,0 @@

27

dist/prosekit-lit-inline-popover.js

@@ -61,14 +61,2 @@ import {

// src/controllers/use-pointer-down-event.ts
function usePointerDownEvent(host, handler) {
host.addController({
hostConnected: () => {
host.addEventListener("pointerdown", handler);
},
hostDisconnected: () => {
host.removeEventListener("pointerdown", handler);
}
});
}
// src/components/inline-popover/helpers.ts

@@ -114,16 +102,13 @@ import { isNodeSelection, isTextSelection } from "@prosekit/core";

function useInlinePopover(host, onReferenceChange) {
let interacting = false;
let reference;
usePointerDownEvent(host, () => {
interacting = true;
});
let editorFocused = false;
const isPopoverFocused = () => {
return !editorFocused && host.contains(host.ownerDocument.activeElement);
};
useEditorFocusChangeEvent(host, (focus) => {
if (focus) {
interacting = false;
}
editorFocused = focus;
});
useEditorUpdateEvent(host, (view) => {
if (interacting) {
if (isPopoverFocused())
return;
}
const ref = getVirtualSelectionElement(view);

@@ -130,0 +115,0 @@ if (reference !== ref) {

{
"name": "@prosekit/lit",
"type": "module",
"version": "0.2.0",
"version": "0.2.1",
"private": false,

@@ -98,11 +98,11 @@ "author": {

"dependencies": {
"@floating-ui/dom": "^1.5.3",
"@floating-ui/dom": "^1.5.4",
"@lit/context": "^1.1.0",
"@prosekit/core": "^0.2.4",
"@prosekit/extensions": "^0.2.4",
"@prosekit/core": "^0.2.6",
"@prosekit/extensions": "^0.2.5",
"@prosekit/pm": "^0.1.1",
"@superhuman/command-score": "^0.5.0",
"@zag-js/dismissable": "^0.32.0",
"@zag-js/dom-query": "^0.32.0",
"@zag-js/utils": "^0.32.0",
"@zag-js/dismissable": "^0.32.1",
"@zag-js/dom-query": "^0.32.1",
"@zag-js/utils": "^0.32.1",
"lit": "^3.1.1"

@@ -115,3 +115,3 @@ },

"typescript": "^5.3.3",
"vitest": "^1.2.0"
"vitest": "^1.2.1"
},

@@ -118,0 +118,0 @@ "scripts": {

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