mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-13 23:37:30 +08:00
Replace parsing and test libraries
* WIP * WIP * wip * WIP * Several fixes * Tests wip port to playwright * WIP * Fix more tests * Serialization tests fixed * Several fixes for tests * Input options types * Type adjustments * Fix object reference parser * Tests fixes * More tests fixes
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
import IInput from "../IInput.js"
|
||||
import ObjectSerializer from "../../serialization/ObjectSerializer.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../IInput.js").Options & {
|
||||
* listenOnFocus?: Boolean,
|
||||
* unlistenOnTextEdit?: Boolean,
|
||||
* }} Options
|
||||
*/
|
||||
|
||||
export default class Copy extends IInput {
|
||||
|
||||
static #serializer = new ObjectSerializer()
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import IInput from "../IInput.js"
|
||||
import ObjectSerializer from "../../serialization/ObjectSerializer.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../IInput.js").Options & {
|
||||
* listenOnFocus?: Boolean,
|
||||
* unlistenOnTextEdit?: Boolean,
|
||||
* }} Options
|
||||
*/
|
||||
|
||||
export default class Cut extends IInput {
|
||||
|
||||
static #serializer = new ObjectSerializer()
|
||||
@@ -8,6 +15,11 @@ export default class Cut extends IInput {
|
||||
/** @type {(e: ClipboardEvent) => void} */
|
||||
#cutHandler
|
||||
|
||||
/**
|
||||
* @param {Element} target
|
||||
* @param {Blueprint} blueprint
|
||||
* @param {Options} options
|
||||
*/
|
||||
constructor(target, blueprint, options = {}) {
|
||||
options.listenOnFocus ??= true
|
||||
options.unlistenOnTextEdit ??= true // No nodes copy if inside a text field, just text (default behavior)
|
||||
|
||||
@@ -2,6 +2,13 @@ import ElementFactory from "../../element/ElementFactory.js"
|
||||
import IInput from "../IInput.js"
|
||||
import ObjectSerializer from "../../serialization/ObjectSerializer.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../IInput.js").Options & {
|
||||
* listenOnFocus?: Boolean,
|
||||
* unlistenOnTextEdit?: Boolean,
|
||||
* }} Options
|
||||
*/
|
||||
|
||||
export default class Paste extends IInput {
|
||||
|
||||
static #serializer = new ObjectSerializer()
|
||||
@@ -9,6 +16,11 @@ export default class Paste extends IInput {
|
||||
/** @type {(e: ClipboardEvent) => void} */
|
||||
#pasteHandle
|
||||
|
||||
/**
|
||||
* @param {Element} target
|
||||
* @param {Blueprint} blueprint
|
||||
* @param {Options} options
|
||||
*/
|
||||
constructor(target, blueprint, options = {}) {
|
||||
options.listenOnFocus ??= true
|
||||
options.unlistenOnTextEdit ??= true // No nodes paste if inside a text field, just text (default behavior)
|
||||
|
||||
Reference in New Issue
Block a user