@themarioga/grid-editor 8.7.1 → 8.8.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 +21 -0
- package/README.md +23 -6
- package/dist/grideditor.bundle.min.js +2 -2
- package/dist/grideditor.css +32 -0
- package/dist/grideditor.d.ts +44 -1
- package/dist/grideditor.esm.js +43 -5
- package/dist/grideditor.js +43 -5
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/grideditor.min.js +1 -1
- package/dist/grideditor.min.js.map +3 -3
- package/dist/locales/grideditor.es.esm.js +27 -0
- package/dist/locales/grideditor.es.js +27 -0
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +2 -2
- package/dist/plugins/grideditor.carousel.esm.js +775 -0
- package/dist/plugins/grideditor.carousel.js +780 -0
- package/dist/plugins/grideditor.carousel.min.js +1 -0
- package/dist/plugins/grideditor.carousel.min.js.map +7 -0
- package/docs/events.md +6 -3
- package/docs/locale-keys.md +29 -2
- package/docs/plugins.md +17 -14
- package/example/containers.html +44 -4
- package/package.json +1 -1
- package/src/js/grideditor.js +58 -17
- package/src/js/locales/grideditor.es.js +27 -0
- package/src/js/plugins/grideditor.carousel.js +780 -0
- package/src/less/grideditor.less +35 -0
- package/types/grideditor.d.ts +44 -1
package/src/less/grideditor.less
CHANGED
|
@@ -908,6 +908,41 @@
|
|
|
908
908
|
padding: 2px 0;
|
|
909
909
|
}
|
|
910
910
|
|
|
911
|
+
/* A carousel shows one slide, the one Bootstrap's .active says, and the
|
|
912
|
+
container's drawer moves between them. Bootstrap's arrows and
|
|
913
|
+
indicators are drawn but the editor's javascript answers, not theirs:
|
|
914
|
+
a click goes through them to what is under, and a slide is changed
|
|
915
|
+
with no transition */
|
|
916
|
+
.ge-container-carousel {
|
|
917
|
+
.carousel-inner {
|
|
918
|
+
overflow: visible;
|
|
919
|
+
}
|
|
920
|
+
.carousel-item {
|
|
921
|
+
transition: none;
|
|
922
|
+
}
|
|
923
|
+
.carousel-control-prev,
|
|
924
|
+
.carousel-control-next,
|
|
925
|
+
.carousel-indicators {
|
|
926
|
+
pointer-events: none;
|
|
927
|
+
}
|
|
928
|
+
.carousel-indicators {
|
|
929
|
+
z-index: 1;
|
|
930
|
+
}
|
|
931
|
+
.ge-carousel-counter {
|
|
932
|
+
min-width: 3em;
|
|
933
|
+
text-align: center;
|
|
934
|
+
text-decoration: none;
|
|
935
|
+
cursor: default;
|
|
936
|
+
}
|
|
937
|
+
.ge-carousel-item > .ge-pane-drawer {
|
|
938
|
+
padding: 2px 0;
|
|
939
|
+
}
|
|
940
|
+
.ge-tools-drawer .disabled {
|
|
941
|
+
opacity: .35;
|
|
942
|
+
pointer-events: none;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
|
|
911
946
|
/* A popup is rendered unfolded and in place: a plain block with its
|
|
912
947
|
body as an ordinary region. Bootstrap's modal JS is never asked to
|
|
913
948
|
open it, so there is no backdrop, no focus trap and no scroll lock */
|
package/types/grideditor.d.ts
CHANGED
|
@@ -77,6 +77,40 @@ export interface CreateTabsOptions extends Placement, TabsOptions {
|
|
|
77
77
|
labels?: string[];
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* A carousel's options, which are Bootstrap's classes and attributes: arrows,
|
|
82
|
+
* indicators, fade, dark theme, autoplay and its interval, and the pause,
|
|
83
|
+
* wrap, keyboard and touch behaviours. All on or off unless said, as
|
|
84
|
+
* Bootstrap has them.
|
|
85
|
+
*/
|
|
86
|
+
export interface CarouselOptions {
|
|
87
|
+
/** Previous and next arrows. Default true. */
|
|
88
|
+
controls?: boolean;
|
|
89
|
+
/** One indicator a slide. Default true. */
|
|
90
|
+
indicators?: boolean;
|
|
91
|
+
/** Slides fade into each other instead of sliding. Default false. */
|
|
92
|
+
fade?: boolean;
|
|
93
|
+
/** `data-bs-theme="dark"`. Default false. */
|
|
94
|
+
dark?: boolean;
|
|
95
|
+
/** Autoplay: false, `'carousel'` on load, `'true'` after the first interaction. Default false. */
|
|
96
|
+
ride?: false | 'carousel' | 'true';
|
|
97
|
+
/** Milliseconds, 1000 or more, between slides; null is Bootstrap's own. Default null. */
|
|
98
|
+
interval?: number | null;
|
|
99
|
+
/** Pauses while the pointer is over it. Default true. */
|
|
100
|
+
pause?: boolean;
|
|
101
|
+
/** Goes from the last slide to the first. Default true. */
|
|
102
|
+
wrap?: boolean;
|
|
103
|
+
/** Answers the arrow keys. Default true. */
|
|
104
|
+
keyboard?: boolean;
|
|
105
|
+
/** Answers a swipe. Default true. */
|
|
106
|
+
touch?: boolean;
|
|
107
|
+
/** How many slides a new one has, 1 or more. Default 2. */
|
|
108
|
+
slides?: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** createContainer('carousel', …): the options, and how many slides. */
|
|
112
|
+
export interface CreateCarouselOptions extends Placement, CarouselOptions {}
|
|
113
|
+
|
|
80
114
|
/** The inline-style plugin's settings. */
|
|
81
115
|
export interface InlineStyleOptions {
|
|
82
116
|
/** Every section is on unless it is turned off here. */
|
|
@@ -104,6 +138,8 @@ export interface GridEditorOptions {
|
|
|
104
138
|
container_tools?: HostTool[];
|
|
105
139
|
tab_tools?: HostTool[];
|
|
106
140
|
accordion_tools?: HostTool[];
|
|
141
|
+
/** Host tools on carousel slide drawers. */
|
|
142
|
+
carousel_tools?: HostTool[];
|
|
107
143
|
text_tools?: HostTool[];
|
|
108
144
|
drag_handle?: 'tool' | 'drawer';
|
|
109
145
|
toolbar_drag?: 'auto' | boolean;
|
|
@@ -125,6 +161,8 @@ export interface GridEditorOptions {
|
|
|
125
161
|
inline_style?: InlineStyleOptions;
|
|
126
162
|
/** The tabs plugin: the variant of the tabs containers made new. */
|
|
127
163
|
tabs?: TabsOptions;
|
|
164
|
+
/** The carousel plugin: the options of the carousels made new. */
|
|
165
|
+
carousel?: CarouselOptions;
|
|
128
166
|
elements?: { enabled?: boolean | 'auto'; selector?: string; auto?: boolean; types?: ElementType[] };
|
|
129
167
|
/** The autosave plugin: what is edited, kept in the browser's storage as it changes. */
|
|
130
168
|
autosave?: AutosaveOptions;
|
|
@@ -211,7 +249,7 @@ export interface Cleared {
|
|
|
211
249
|
|
|
212
250
|
/** What every notification carries. */
|
|
213
251
|
export interface Payload {
|
|
214
|
-
/** What the node is: row, column, text, plain, element, tab, accordion-item, a container's type… */
|
|
252
|
+
/** What the node is: row, column, text, plain, element, tab, accordion-item, carousel-item, a container's type… */
|
|
215
253
|
kind: string;
|
|
216
254
|
node: HTMLElement;
|
|
217
255
|
/** Where the node is going, or coming from on a delete; null while it is detached. */
|
|
@@ -297,6 +335,8 @@ export interface GridEditorEventMap {
|
|
|
297
335
|
'grideditor:after-add-tab': Payload;
|
|
298
336
|
'grideditor:before-add-accordion-item': Payload;
|
|
299
337
|
'grideditor:after-add-accordion-item': Payload;
|
|
338
|
+
'grideditor:before-add-carousel-item': Payload;
|
|
339
|
+
'grideditor:after-add-carousel-item': Payload;
|
|
300
340
|
'grideditor:before-add-section': Payload;
|
|
301
341
|
'grideditor:after-add-section': Payload;
|
|
302
342
|
'grideditor:before-delete': Payload;
|
|
@@ -437,9 +477,12 @@ export declare class GridEditor {
|
|
|
437
477
|
createElement(content: string | Node | ArrayLike<Node>, options?: CreateElementOptions): HTMLElement | null;
|
|
438
478
|
createSection(options?: CreateSectionOptions): HTMLElement | null;
|
|
439
479
|
createContainer(type: 'tabs', options?: CreateTabsOptions): HTMLElement | null;
|
|
480
|
+
createContainer(type: 'carousel', options?: CreateCarouselOptions): HTMLElement | null;
|
|
440
481
|
createContainer(type: string, options?: Placement & Record<string, unknown>): HTMLElement | null;
|
|
441
482
|
addTab(container: Target, options?: PaneOptions): HTMLElement | null;
|
|
442
483
|
addAccordionItem(container: Target, options?: PaneOptions): HTMLElement | null;
|
|
484
|
+
/** A pane added to a container of any type that has panes; a carousel's takes `interval`. Null for one that has none. */
|
|
485
|
+
addPane(container: Target, options?: PaneOptions & { interval?: number }): HTMLElement | null;
|
|
443
486
|
/** A utility's value on a node in a view (the current one by default), or null. */
|
|
444
487
|
getUtility(node: Target, family: string, view?: View): string | null;
|
|
445
488
|
/** Write one through the events; null is inherit. False when canceled or nothing changed. */
|