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

@brightspace-ui/htmleditor

Package Overview
Dependencies
Maintainers
3
Versions
767
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brightspace-ui/htmleditor - npm Package Compare versions

Comparing version 2.102.7 to 2.102.8

41

components/api-wrapper.js

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

import { EditorNode, EditorSelection } from './selection.js';
import { EditorNode, EditorRange, EditorSelection } from './selection.js';
import { requestInstance } from '@brightspace-ui/core/mixins/provider-mixin.js';

@@ -60,3 +60,3 @@

applyLinkFormatting(href, title) {
applyLinkFormatting(href, title, text, target) {
if (!this.#editor.selection) return;

@@ -70,3 +70,34 @@

this.#editor.formatter.apply('link', { href: href, title: title }, anchor);
const linkAttributes = { href: href };
if (title) linkAttributes.title = title;
if (target) linkAttributes.target = target;
this.#editor.formatter.apply('link', linkAttributes, anchor);
if (!text) return;
const nodeHasNonTextElements = node => {
const inlineTextElements = this.getEditorInlineTextElements();
return node.nodeType === Node.ELEMENT_NODE && !Object.keys(inlineTextElements).includes(node.tagName);
};
if (anchor) {
const wrappedAnchor = new EditorNode(anchor, this.#editor.selection);
if (!wrappedAnchor.searchDescendants(nodeHasNonTextElements) && anchor.innerText !== text) anchor.innerText = text;
return;
}
const range = this.#editor.selection.getRng();
if (range.collapsed) {
range.insertNode(document.createTextNode(text));
return;
}
const wrappedRange = new EditorRange(range, this.#editor.selection);
if (!wrappedRange.searchContainedNodes(nodeHasNonTextElements) && range.toString() !== text) {
range.deleteContents();
range.insertNode(document.createTextNode(text));
}
}

@@ -148,2 +179,6 @@

getEditorInlineTextElements() {
return this.#editor.schema.getTextInlineElements();
}
getFileUploadProperties() {

@@ -150,0 +185,0 @@ return {

2

package.json
{
"name": "@brightspace-ui/htmleditor",
"description": "An HTML editor that integrates with Brightspace",
"version": "2.102.7",
"version": "2.102.8",
"type": "module",

@@ -6,0 +6,0 @@ "repository": "https://github.com/BrightspaceUI/htmleditor.git",

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