@themarioga/grid-editor 4.1.0 → 5.1.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +131 -10
  3. package/UPGRADING.md +55 -0
  4. package/dist/grideditor.css +466 -0
  5. package/dist/grideditor.min.css +1 -1
  6. package/dist/grideditor.min.css.map +1 -1
  7. package/dist/jquery.grideditor.bundle.min.js +2 -2
  8. package/dist/jquery.grideditor.js +741 -126
  9. package/dist/jquery.grideditor.min.js +1 -1
  10. package/dist/jquery.grideditor.min.js.map +1 -1
  11. package/dist/locales/grideditor.es.js +30 -0
  12. package/dist/locales/grideditor.es.min.js +1 -1
  13. package/dist/locales/grideditor.es.min.js.map +1 -1
  14. package/dist/plugins/grideditor.clipboard.js +274 -0
  15. package/dist/plugins/grideditor.clipboard.min.js +2 -0
  16. package/dist/plugins/grideditor.clipboard.min.js.map +1 -0
  17. package/dist/plugins/grideditor.float.js +56 -0
  18. package/dist/plugins/grideditor.float.min.js +2 -0
  19. package/dist/plugins/grideditor.float.min.js.map +1 -0
  20. package/dist/plugins/grideditor.sections.js +199 -0
  21. package/dist/plugins/grideditor.sections.min.js +2 -0
  22. package/dist/plugins/grideditor.sections.min.js.map +1 -0
  23. package/dist/plugins/grideditor.textalign.js +60 -0
  24. package/dist/plugins/grideditor.textalign.min.js +2 -0
  25. package/dist/plugins/grideditor.textalign.min.js.map +1 -0
  26. package/docs/events.md +17 -3
  27. package/docs/locale-keys.md +49 -1
  28. package/docs/plugins.md +45 -3
  29. package/example/autocols.html +137 -0
  30. package/example/breakpoints.html +7 -5
  31. package/example/clipboard.html +99 -0
  32. package/example/index.html +24 -2
  33. package/example/utilities.html +22 -1
  34. package/example/wrap_content.html +66 -16
  35. package/package.json +1 -1
  36. package/src/js/jquery.grideditor.js +742 -127
  37. package/src/js/locales/grideditor.es.js +30 -0
  38. package/src/js/plugins/grideditor.clipboard.js +274 -0
  39. package/src/js/plugins/grideditor.float.js +56 -0
  40. package/src/js/plugins/grideditor.sections.js +199 -0
  41. package/src/js/plugins/grideditor.textalign.js +60 -0
  42. package/src/less/grideditor.less +138 -0
@@ -44,6 +44,8 @@
44
44
 
45
45
  .ge-row-icon {
46
46
  width: 48px;
47
+ /* A button shrinks to its content, and an equal column has none */
48
+ flex: 0 0 48px;
47
49
  margin: 0;
48
50
 
49
51
  .column {
@@ -52,6 +54,10 @@
52
54
  padding: 0;
53
55
  border-left: 2px solid #f4f4f4;
54
56
  }
57
+ /* Nothing inside to be as wide as */
58
+ .col-auto {
59
+ min-width: 8px;
60
+ }
55
61
  }
56
62
  }
57
63
 
@@ -167,6 +173,8 @@
167
173
  margin: 0 -@editGutter @editGutter;
168
174
  display: block;
169
175
  width: calc(~"100% +" 2 * @editGutter);
176
+ /* Its node may align text, and the drawer's tools would follow */
177
+ text-align: left;
170
178
 
171
179
  > a {
172
180
  display: inline-block;
@@ -314,6 +322,10 @@
314
322
  position: relative;
315
323
 
316
324
  > .ge-tools-drawer {
325
+ /* The drawer is not content: an auto column is as wide as what
326
+ it holds, and its tools would make it as wide as a drawer */
327
+ contain: inline-size;
328
+
317
329
  a {
318
330
  color: @colTextColor;
319
331
  }
@@ -335,6 +347,12 @@
335
347
  position: relative;
336
348
  }
337
349
 
350
+ /* The copy tool says it copied, for a moment, with the clipboard
351
+ plugin */
352
+ .ge-tools-drawer > a.ge-copied {
353
+ color: #198754;
354
+ }
355
+
338
356
  .ge-size-picker {
339
357
  position: absolute;
340
358
  top: 100%;
@@ -370,6 +388,13 @@
370
388
  color: #fff;
371
389
  }
372
390
 
391
+ /* col and col-auto: a word, not a number */
392
+ &.ge-size-flex {
393
+ width: auto;
394
+ padding-left: 5px;
395
+ padding-right: 5px;
396
+ }
397
+
373
398
  /* Wider than what is left of the row: allowed, but said so */
374
399
  &.ge-size-tight {
375
400
  color: #999;
@@ -644,16 +669,43 @@
644
669
  /* this tier applies at the active one, so it is written by the pass below */
645
670
  }
646
671
  .ge-tier-above-off(@j, @active) when (@j > @active) {
672
+ .ge-flex-columns-off(extract(@ge-col-prefixes, @j));
647
673
  .ge-columns-off(extract(@ge-col-prefixes, @j));
648
674
  .ge-offsets-off(extract(@ge-offset-prefixes, @j));
649
675
  }
650
676
 
651
677
  .ge-tiers-upto-on(@active, @j: 1) when (@j =< @active) {
678
+ .ge-flex-columns-on(extract(@ge-col-prefixes, @j));
652
679
  .ge-columns-on(extract(@ge-col-prefixes, @j));
653
680
  .ge-offsets-on(extract(@ge-offset-prefixes, @j));
654
681
  .ge-tiers-upto-on(@active, @j + 1);
655
682
  }
656
683
 
684
+ /*
685
+ * col and col-auto, in the order Bootstrap writes them: before the numbered
686
+ * sizes, so that of two classes for one tier the number wins, as it does on
687
+ * the real page.
688
+ */
689
+ .ge-flex-columns-on(@prefix) {
690
+ .@{prefix} {
691
+ flex: 1 0 0%;
692
+ max-width: 100%;
693
+ }
694
+ .@{prefix}-auto {
695
+ flex: 0 0 auto;
696
+ width: auto;
697
+ max-width: 100%;
698
+ }
699
+ }
700
+ .ge-flex-columns-off(@prefix) {
701
+ .@{prefix},
702
+ .@{prefix}-auto {
703
+ flex: 0 0 auto;
704
+ width: 100%;
705
+ max-width: 100%;
706
+ }
707
+ }
708
+
657
709
  .ge-columns-on(@prefix, @i: 1) when (@i =< @ge-columns) {
658
710
  .@{prefix}-@{i} {
659
711
  flex: 0 0 auto;
@@ -784,3 +836,89 @@
784
836
  }
785
837
  }
786
838
  }
839
+
840
+ /* A row whose row-cols sizes its columns in this view says how many */
841
+ .ge-canvas.ge-editing .row[data-ge-row-cols] {
842
+ position: relative;
843
+
844
+ &::before {
845
+ content: attr(data-ge-row-cols);
846
+ position: absolute;
847
+ left: 2px;
848
+ bottom: 2px;
849
+ z-index: 1;
850
+ padding: 0 4px;
851
+ border-radius: 3px;
852
+ background: rgba(0, 0, 0, .55);
853
+ color: #fff;
854
+ font-size: 10px;
855
+ line-height: 16px;
856
+ pointer-events: none;
857
+ }
858
+ }
859
+
860
+ /*
861
+ * The sections plugin: Bootstrap's containers on the canvas. A section is
862
+ * framed while editing, and in a breakpoint view each container class gets
863
+ * the max-width it has at that breakpoint - Bootstrap sets it for the
864
+ * window, and the window is not what a breakpoint view narrows.
865
+ */
866
+ @ge-section-color: #8a6d3b;
867
+
868
+ .ge-canvas.ge-editing > .ge-section {
869
+ border: 1px dashed @ge-section-color;
870
+ margin-bottom: @editGutter;
871
+ padding-bottom: @editGutter;
872
+
873
+ > .ge-section-drawer {
874
+ background: fadeout(@ge-section-color, 85%);
875
+ margin-left: 0;
876
+ margin-right: 0;
877
+ width: 100%;
878
+
879
+ > a {
880
+ color: darken(@ge-section-color, 5%);
881
+ }
882
+ }
883
+ }
884
+
885
+ /* The width field, in the section's settings panel beside id and classes */
886
+ .ge-canvas.ge-editing .ge-details .ge-section-width {
887
+ display: inline-flex;
888
+ align-items: center;
889
+ gap: 4px;
890
+ margin: 0;
891
+ font-size: 11px;
892
+
893
+ select {
894
+ border: 1px solid #7F7F7F;
895
+ border-radius: 4px;
896
+ font-size: 11px;
897
+ padding: 1px 2px;
898
+ }
899
+ }
900
+
901
+ @ge-section-classes: container, container-sm, container-md, container-lg, container-xl, container-xxl;
902
+ @ge-section-from: 2, 2, 3, 4, 5, 6;
903
+ @ge-section-widths: 100%, 540px, 720px, 960px, 1140px, 1320px;
904
+
905
+ .ge-section-modes(@i: 1) when (@i =< length(@ge-tiers)) {
906
+ @tier: extract(@ge-tiers, @i);
907
+ .ge-section-classes(@i, @tier);
908
+ .ge-section-modes(@i + 1);
909
+ }
910
+ .ge-section-classes(@i, @tier, @k: 1) when (@k =< length(@ge-section-classes)) {
911
+ .ge-section-width(@i, @tier, extract(@ge-section-classes, @k), extract(@ge-section-from, @k));
912
+ .ge-section-classes(@i, @tier, @k + 1);
913
+ }
914
+ .ge-section-width(@i, @tier, @class, @from) when (@i >= @from) {
915
+ .ge-canvas.ge-layout-@{tier} > .@{class} {
916
+ max-width: extract(@ge-section-widths, @i);
917
+ }
918
+ }
919
+ .ge-section-width(@i, @tier, @class, @from) when (@i < @from) {
920
+ .ge-canvas.ge-layout-@{tier} > .@{class} {
921
+ max-width: 100%;
922
+ }
923
+ }
924
+ .ge-section-modes();