From ee67fde8be4c1c0ad372ecd7a055ae111e3f7aa1 Mon Sep 17 00:00:00 2001 From: Javier Pons Date: Thu, 2 Feb 2023 06:51:24 -0300 Subject: [PATCH 1/2] small clarification (#4884) otherwise it may be misinterpretated or make it hard to read --- docs/modules/Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/Components.md b/docs/modules/Components.md index 41c5649f1..76fe0da2f 100644 --- a/docs/modules/Components.md +++ b/docs/modules/Components.md @@ -365,7 +365,7 @@ The `model` is probably the one you'll use the most as is what is used for the d The model defines also what you will see as the resultant HTML (the export code) and you've probably noticed the use of `tagName` (if not specified the `div` will be used) and `attributes` properties on the model. -One another important property (not used because `` doesn't need it) might be `components`, which defines default internal components +One another important property (not used in our input component integration because `` doesn't need it) might be `components`, which defines default internal components ```js defaults: { From a1b54fc40659f00b2a673c10d673934c8067eef8 Mon Sep 17 00:00:00 2001 From: Julia Alberici Date: Thu, 2 Feb 2023 06:55:24 -0300 Subject: [PATCH 2/2] types fix (#4886) type fix Co-authored-by: Julia Alberici Co-authored-by: Artur Arseniev --- index.d.ts | 7 +++++-- src/block_manager/index.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index 1eb21bfc8..919c6edf4 100644 --- a/index.d.ts +++ b/index.d.ts @@ -68,7 +68,7 @@ declare namespace grapesjs { fromElement?: boolean; /** Show an alert before unload the page with unsaved changes */ - noticeOnUnload?: number; + noticeOnUnload?: number | boolean; /** Show paddings and margins */ showOffsets?: boolean; @@ -425,11 +425,13 @@ declare namespace grapesjs { showComputed?: boolean; clearProperties?: boolean; avoidComputed?: Array; + custom?: boolean; } interface BlockManagerConfig { appendTo?: HTMLElement | string; blocks: Array; + custom?: boolean; } interface RichTextEditorConfig { @@ -1309,7 +1311,8 @@ declare namespace grapesjs { | 'block:remove' | 'block:drag:start' | 'block:drag' - | 'block:drag:stop'; + | 'block:drag:stop' + | 'block:custom'; type AssetEvent = | 'asset:add' diff --git a/src/block_manager/index.ts b/src/block_manager/index.ts index c9abd5daa..b0b3266be 100644 --- a/src/block_manager/index.ts +++ b/src/block_manager/index.ts @@ -55,7 +55,7 @@ import { ItemManagerModule } from '../abstract/Module'; import EditorModel from '../editor/model/Editor'; import Component from '../dom_components/model/Component'; -export type BlockEvent = 'block:add' | 'block:remove' | 'block:drag:start' | 'block:drag' | 'block:drag:stop'; +export type BlockEvent = 'block:add' | 'block:remove' | 'block:drag:start' | 'block:drag' | 'block:drag:stop' | 'block:custom'; export const evAll = 'block'; export const evPfx = `${evAll}:`;