New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@textbus/core

Package Overview
Dependencies
Maintainers
1
Versions
345
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@textbus/core - npm Package Compare versions

Comparing version 2.0.0-alpha.28 to 2.0.0-alpha.29

4

bundles/foundation/_injection-tokens.d.ts

@@ -43,1 +43,5 @@ import { InjectionToken } from '@tanbo/di';

export declare const FORMATTER_LIST: InjectionToken<Formatter[]>;
/**
* 使用 contentEditable 作为可编辑范围控制
*/
export declare const USE_CONTENT_EDITABLE: InjectionToken<boolean>;

@@ -20,2 +20,6 @@ import { InjectionToken } from '@tanbo/di';

export const FORMATTER_LIST = new InjectionToken('FORMATTER_LIST');
/**
* 使用 contentEditable 作为可编辑范围控制
*/
export const USE_CONTENT_EDITABLE = new InjectionToken('USE_CONTENT_EDITABLE');
//# sourceMappingURL=_injection-tokens.js.map

3

bundles/foundation/renderer.d.ts

@@ -17,2 +17,3 @@ import { Observable } from '@tanbo/stream';

export declare class Renderer {
private useContentEditable;
private rootComponentRef;

@@ -38,3 +39,3 @@ private nativeRenderer;

private slotIdAttrKey;
constructor(rootComponentRef: RootComponentRef, nativeRenderer: NativeRenderer);
constructor(useContentEditable: boolean, rootComponentRef: RootComponentRef, nativeRenderer: NativeRenderer);
/**

@@ -41,0 +42,0 @@ * 以编辑模式渲染当前文档

@@ -10,8 +10,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

};
import { Injectable } from '@tanbo/di';
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
import { Inject, Injectable } from '@tanbo/di';
import { Subject } from '@tanbo/stream';
import { VElement, VTextNode, Slot, } from '../model/_api';
import { invokeListener } from '../define-component';
import { NativeRenderer, RootComponentRef } from './_injection-tokens';
function setEditable(vElement, is) {
import { NativeRenderer, RootComponentRef, USE_CONTENT_EDITABLE } from './_injection-tokens';
function setEditable(vElement, useContentEditable, is) {
if (useContentEditable) {
if (is === null) {
vElement.attrs.delete('contenteditable');
return;
}
vElement.attrs.set('contenteditable', is ? 'true' : 'false');
return;
}
if (is === null) {

@@ -156,3 +167,4 @@ vElement.attrs.delete('textbus-editable');

let Renderer = class Renderer {
constructor(rootComponentRef, nativeRenderer) {
constructor(useContentEditable, rootComponentRef, nativeRenderer) {
this.useContentEditable = useContentEditable;
this.rootComponentRef = rootComponentRef;

@@ -491,6 +503,6 @@ this.nativeRenderer = nativeRenderer;

if (component.slots.length === 1 && slotVNode === node) {
setEditable(node, null);
setEditable(node, this.useContentEditable, this.useContentEditable && !component.parent ? true : null);
}
else {
setEditable(node, false);
setEditable(node, this.useContentEditable, false);
}

@@ -514,6 +526,6 @@ this.componentVNode.set(component, node);

if (component.slots.length === 1) {
setEditable(vNode, null);
setEditable(vNode, this.useContentEditable, this.useContentEditable && !component.parent ? true : null);
}
else {
setEditable(vNode, false);
setEditable(vNode, this.useContentEditable, false);
}

@@ -540,3 +552,3 @@ }

let host = root;
setEditable(host, true);
setEditable(host, this.useContentEditable, true);
const formatTree = slot.createFormatTree();

@@ -735,3 +747,4 @@ if (formatTree.formats) {

Injectable(),
__metadata("design:paramtypes", [RootComponentRef,
__param(0, Inject(USE_CONTENT_EDITABLE)),
__metadata("design:paramtypes", [Boolean, RootComponentRef,
NativeRenderer])

@@ -738,0 +751,0 @@ ], Renderer);

@@ -15,2 +15,4 @@ import { Provider, ReflectiveInjector } from '@tanbo/di';

platformProviders: Provider[];
/** 使用 contentEditable 作为编辑器控制可编辑范围 */
useContentEditable?: boolean;
}

@@ -17,0 +19,0 @@ /**

import { Injector, NullInjector, ReflectiveInjector } from '@tanbo/di';
import { History, RootComponentRef, LifeCycle, Renderer, COMPONENT_LIST, FORMATTER_LIST, Commander, ComponentList, FormatterList, Keyboard, OutputRenderer, Query, Selection, Translator, NativeSelectionBridge, NativeRenderer } from './foundation/_api';
import { History, RootComponentRef, LifeCycle, Renderer, COMPONENT_LIST, FORMATTER_LIST, Commander, ComponentList, FormatterList, Keyboard, OutputRenderer, Query, Selection, Translator, NativeSelectionBridge, NativeRenderer, USE_CONTENT_EDITABLE } from './foundation/_api';
import { makeError } from './_utils/make-error';

@@ -22,2 +22,6 @@ const starterErrorFn = makeError('Starter');

},
{
provide: USE_CONTENT_EDITABLE,
useValue: config.useContentEditable
},
Commander,

@@ -24,0 +28,0 @@ ComponentList,

{
"name": "@textbus/core",
"version": "2.0.0-alpha.28",
"version": "2.0.0-alpha.29",
"description": "TextBus is a rich text editor and framework that is highly customizable and extensible to achieve rich wysiwyg effects.",

@@ -43,3 +43,3 @@ "main": "./bundles/public-api.js",

},
"gitHead": "536327fc2609d3f2bbf3b0720738d3ed918d612c"
"gitHead": "c93c302d74a153a752e6dc39b9c7ec78d4fda3eb"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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