@themarioga/grid-editor 8.8.2 → 8.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +18 -0
- package/dist/grideditor.bundle.min.js +3 -3
- package/dist/grideditor.css +51 -0
- package/dist/grideditor.d.ts +28 -1
- package/dist/grideditor.esm.js +311 -20
- package/dist/grideditor.jquery.js +3 -1
- package/dist/grideditor.jquery.min.js +1 -1
- package/dist/grideditor.jquery.min.js.map +2 -2
- package/dist/grideditor.js +311 -20
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/grideditor.min.js +2 -2
- package/dist/grideditor.min.js.map +3 -3
- package/dist/locales/grideditor.es.esm.js +4 -0
- package/dist/locales/grideditor.es.js +4 -0
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +2 -2
- package/docs/events.md +6 -0
- package/docs/locale-keys.md +4 -0
- package/docs/plugins.md +15 -1
- package/example/utilities.html +3 -1
- package/package.json +1 -1
- package/src/js/grideditor.jquery.js +2 -0
- package/src/js/grideditor.js +361 -29
- package/src/js/locales/grideditor.es.js +4 -0
- package/src/less/grideditor.less +59 -0
- package/types/grideditor.d.ts +28 -1
package/types/grideditor.d.ts
CHANGED
|
@@ -121,6 +121,18 @@ export interface InlineStyleOptions {
|
|
|
121
121
|
visibility?: { drawer?: boolean };
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
/** What the sidebar shows while nothing is selected, instead of its message. */
|
|
125
|
+
export interface SidebarContent {
|
|
126
|
+
/** Text, not html. Default the sidebar's own title. */
|
|
127
|
+
title?: string;
|
|
128
|
+
body: Element;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface SidebarSettings {
|
|
132
|
+
/** Called whenever the sidebar is left with nothing selected. Null gives the message. */
|
|
133
|
+
empty?: ((ge: GridEditor) => SidebarContent | null) | null;
|
|
134
|
+
}
|
|
135
|
+
|
|
124
136
|
export type CustomFilter = ((canvas: HTMLElement, isInit: boolean) => void) | string;
|
|
125
137
|
|
|
126
138
|
/** The settings. Every one is optional. */
|
|
@@ -183,7 +195,10 @@ export interface GridEditorOptions {
|
|
|
183
195
|
locale_strings?: Record<string, string>;
|
|
184
196
|
callbacks?: Partial<GridEditorCallbacks>;
|
|
185
197
|
confirm_delete?: boolean;
|
|
186
|
-
|
|
198
|
+
/** Where a node's settings open. 'sidebar' is a panel that stays on the right while editing, showing the selected node's; one editor per page has it. */
|
|
199
|
+
settings_panel?: 'offcanvas' | 'popover' | 'modal' | 'inline' | 'sidebar';
|
|
200
|
+
/** The 'sidebar' panel. */
|
|
201
|
+
sidebar?: SidebarSettings;
|
|
187
202
|
drag?: { delay?: number; touch_delay?: number; threshold?: number; animation?: number; scroll?: boolean };
|
|
188
203
|
tinymce?: { config?: Record<string, unknown> };
|
|
189
204
|
ckeditor?: { config?: Record<string, unknown> };
|
|
@@ -317,6 +332,13 @@ export interface TargetChangePayload {
|
|
|
317
332
|
from: HTMLElement | null;
|
|
318
333
|
}
|
|
319
334
|
|
|
335
|
+
/** The selection changed, with settings_panel 'sidebar': the node whose settings the sidebar shows, or null. */
|
|
336
|
+
export interface SelectionChangePayload {
|
|
337
|
+
canvas: HTMLElement;
|
|
338
|
+
node: HTMLElement | null;
|
|
339
|
+
from: HTMLElement | null;
|
|
340
|
+
}
|
|
341
|
+
|
|
320
342
|
/** The events, by name, with their payloads. Adding fires a specific name and the generic one. */
|
|
321
343
|
export interface GridEditorEventMap {
|
|
322
344
|
'grideditor:before-add': Payload;
|
|
@@ -357,6 +379,7 @@ export interface GridEditorEventMap {
|
|
|
357
379
|
'grideditor:popup-orphan': PopupOrphanPayload;
|
|
358
380
|
'grideditor:view-change': ViewChangePayload;
|
|
359
381
|
'grideditor:target-change': TargetChangePayload;
|
|
382
|
+
'grideditor:selection-change': SelectionChangePayload;
|
|
360
383
|
'grideditor:after-autosave': AutosavePayload;
|
|
361
384
|
'grideditor:after-restore-draft': RestoreDraftPayload;
|
|
362
385
|
'grideditor:autosave-error': AutosaveErrorPayload;
|
|
@@ -468,6 +491,10 @@ export declare class GridEditor {
|
|
|
468
491
|
getActiveTarget(): HTMLElement | null;
|
|
469
492
|
/** Make a column or region, or the first a selector matches, where the toolbar adds; null for none. */
|
|
470
493
|
setActiveTarget(target: HTMLElement | string | null): this;
|
|
494
|
+
/** The node whose settings the sidebar shows, or null. Null unless settings_panel is 'sidebar'. */
|
|
495
|
+
getSelected(): HTMLElement | null;
|
|
496
|
+
/** Select a node with settings, or the first a selector matches, or null for none. Does nothing unless settings_panel is 'sidebar'. */
|
|
497
|
+
setSelected(node: HTMLElement | string | null): this;
|
|
471
498
|
getView(): View;
|
|
472
499
|
setLocale(code: string): this;
|
|
473
500
|
createRow(layout?: RowLayout, options?: Placement): HTMLElement | null;
|