@silexlabs/silex 3.0.0-alpha.151 → 3.0.0-alpha.153

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 (29) hide show
  1. package/dist/client/client/grapesjs/index.d.ts +4 -0
  2. package/dist/client/client/grapesjs/keymaps.d.ts +71 -0
  3. package/dist/client/client/grapesjs/project-bar.d.ts +4 -0
  4. package/dist/client/client/utils.d.ts +7 -0
  5. package/dist/client/css/admin.css +176 -6
  6. package/dist/client/js/main.js +118 -109
  7. package/dist/plugins/server/plugins/server/GitlabConnector.d.ts +40 -9
  8. package/dist/plugins/server/plugins/server/GitlabConnector.js +58 -34
  9. package/dist/plugins/server/plugins/server/GitlabConnector.js.map +1 -1
  10. package/dist/plugins/server/plugins/server/GitlabHostingConnector.d.ts +18 -0
  11. package/dist/plugins/server/plugins/server/GitlabHostingConnector.js +98 -0
  12. package/dist/plugins/server/plugins/server/GitlabHostingConnector.js.map +1 -0
  13. package/package.json +6 -5
  14. package/src/css/grapesjs-plugins.scss +160 -0
  15. package/src/css/grapesjs.scss +31 -0
  16. package/src/css/project-bar.scss +5 -7
  17. package/src/ts/client/api.ts +8 -1
  18. package/src/ts/client/config.ts +1 -1
  19. package/src/ts/client/grapesjs/PublicationManager.ts +5 -0
  20. package/src/ts/client/grapesjs/PublicationUi.ts +45 -27
  21. package/src/ts/client/grapesjs/css-props.ts +608 -257
  22. package/src/ts/client/grapesjs/index.ts +91 -18
  23. package/src/ts/client/grapesjs/internal-links.ts +11 -1
  24. package/src/ts/client/grapesjs/keymaps.ts +155 -0
  25. package/src/ts/client/grapesjs/project-bar.ts +18 -7
  26. package/src/ts/client/grapesjs/settings.ts +44 -20
  27. package/src/ts/client/utils.ts +33 -9
  28. package/src/ts/plugins/server/GitlabConnector.ts +70 -46
  29. package/src/ts/plugins/server/GitlabHostingConnector.ts +102 -0
@@ -1,5 +1,9 @@
1
1
  import { Editor, EditorConfig } from 'grapesjs';
2
2
  import { ClientConfig } from '../config';
3
+ export declare const cmdToggleLayers = "open-layers";
4
+ export declare const cmdToggleBlocks = "open-blocks";
5
+ export declare const cmdToggleSymbols = "open-symbols";
6
+ export declare const cmdToggleNotifications = "open-notifications";
3
7
  export declare function getEditorConfig(config: ClientConfig): EditorConfig;
4
8
  export declare function initEditor(config: EditorConfig): Promise<Editor>;
5
9
  export declare function getEditor(): Editor;
@@ -0,0 +1,71 @@
1
+ import { Editor, PluginOptions } from 'grapesjs';
2
+ /**
3
+ * Escapes the current context in this order : modal, Publish dialog, left panel.
4
+ * If none of these are open, it selects the body.
5
+ * @param editor The editor.
6
+ */
7
+ declare function escapeContext(editor: Editor): void;
8
+ export declare const cmdSelectBody = "select-body";
9
+ export declare let prefixKey: string;
10
+ export declare const defaultKms: {
11
+ kmOpenSettings: {
12
+ id: string;
13
+ keys: string;
14
+ handler: (editor: any) => void;
15
+ };
16
+ kmOpenPublish: {
17
+ id: string;
18
+ keys: string;
19
+ handler: (editor: any) => void;
20
+ };
21
+ kmOpenFonts: {
22
+ id: string;
23
+ keys: string;
24
+ handler: (editor: any) => void;
25
+ };
26
+ kmPreviewMode: {
27
+ id: string;
28
+ keys: string;
29
+ handler: (editor: any) => void;
30
+ options: {
31
+ prevent: boolean;
32
+ };
33
+ };
34
+ kmLayers: {
35
+ id: string;
36
+ keys: string;
37
+ handler: (editor: any) => void;
38
+ };
39
+ kmBlocks: {
40
+ id: string;
41
+ keys: string;
42
+ handler: (editor: any) => void;
43
+ };
44
+ kmNotifications: {
45
+ id: string;
46
+ keys: string;
47
+ handler: (editor: any) => void;
48
+ };
49
+ kmPages: {
50
+ id: string;
51
+ keys: string;
52
+ handler: (editor: any) => void;
53
+ };
54
+ kmSymbols: {
55
+ id: string;
56
+ keys: string;
57
+ handler: (editor: any) => void;
58
+ };
59
+ kmClosePanel: {
60
+ id: string;
61
+ keys: string;
62
+ handler: typeof escapeContext;
63
+ };
64
+ kmSelectBody: {
65
+ id: string;
66
+ keys: string;
67
+ handler: string;
68
+ };
69
+ };
70
+ export declare function keymapsPlugin(editor: Editor, opts: PluginOptions): void;
71
+ export {};
@@ -1,8 +1,11 @@
1
1
  import { Editor } from 'grapesjs';
2
+ export declare const PROJECT_BAR_PANEL_ID = "project-bar-panel";
3
+ export declare const containerPanelId = "project-bar-container";
2
4
  export interface PanelObject {
3
5
  command: string | ((editor: Editor) => void);
4
6
  text: string;
5
7
  className: string;
8
+ name?: string;
6
9
  attributes: {
7
10
  title?: string;
8
11
  containerClassName?: string;
@@ -12,6 +15,7 @@ export interface PanelObject {
12
15
  text: string;
13
16
  className: string;
14
17
  }[];
18
+ onClick?: (editor: Editor) => void;
15
19
  }
16
20
  export declare const projectBarPlugin: (editor: any, opts: any) => void;
17
21
  export declare function addButton(editor: Editor, panel: PanelObject): void;
@@ -4,3 +4,10 @@ export declare function onAll(editor: Editor, cbk: (c: Component) => void): void
4
4
  * SHA256 hash a string
5
5
  */
6
6
  export declare function hashString(str: string): Promise<string>;
7
+ /**
8
+ * Select the <body> element in the editor.
9
+ * @param editor The GrapesJS editor.
10
+ */
11
+ export declare function selectBody(editor: Editor): void;
12
+ export declare function isTextOrInputField(element: HTMLElement): boolean;
13
+ export declare function titleCase(str: string, sep?: string): string;
@@ -4286,6 +4286,10 @@ form.silex-form .silex-form__group.col2 {
4286
4286
  width: 35px;
4287
4287
  box-shadow: none;
4288
4288
  }
4289
+ .gjs-pn-project-bar-panel .gjs-pn-buttons .gjs-pn-btn.project-bar__dirty {
4290
+ background-color: #A291FF;
4291
+ color: white;
4292
+ }
4289
4293
  .gjs-pn-project-bar-panel .logo {
4290
4294
  background-image: url("../assets/logo-silex-small.png");
4291
4295
  background-repeat: no-repeat;
@@ -4338,14 +4342,8 @@ form.silex-form .silex-form__group.col2 {
4338
4342
  }
4339
4343
  .gjs-pn-project-bar-container .project-bar__panel-header .project-bar__panel-header-button {
4340
4344
  cursor: pointer;
4341
- font-size: large;
4342
- font-weight: 400;
4343
4345
  }
4344
4346
  .gjs-pn-project-bar-container .project-bar__panel-header .project-bar__panel-header-button span {
4345
- position: relative;
4346
- left: -2px;
4347
- top: -11px;
4348
- font-weight: bolder;
4349
4347
  background-color: #444;
4350
4348
  border-radius: 100%;
4351
4349
  display: inline-block;
@@ -4551,6 +4549,142 @@ form.silex-form .silex-form__group.col2 {
4551
4549
  border-right-color: #ddd;
4552
4550
  }
4553
4551
 
4552
+ .gjs-editor .gjs-notification {
4553
+ max-height: initial;
4554
+ text-align: left;
4555
+ }
4556
+
4557
+ .gjs-editor .gjs-notification,
4558
+ .gjs-editor .gjs-notification .gjs-sm-header,
4559
+ .gjs-editor .gjs-notification .gjs-notification__item,
4560
+ .gjs-editor .gjs-notification .gjs-notification__group > details,
4561
+ .gjs-editor .gjs-notification .gjs-notification__group > details > ul,
4562
+ .gjs-editor .gjs-notification .gjs-notification__group > details > summary,
4563
+ .gjs-editor .gjs-notification .gjs-notification__group {
4564
+ padding: 0;
4565
+ margin: 0;
4566
+ }
4567
+
4568
+ .gjs-editor .gjs-notification .gjs-notification__group,
4569
+ .gjs-editor .gjs-notification .gjs-notification__item {
4570
+ margin: 10px 0;
4571
+ padding: 10px 0;
4572
+ }
4573
+
4574
+ .gjs-editor .gjs-notification .gjs-notification__group .gjs-notification__item {
4575
+ margin-left: 10px;
4576
+ }
4577
+
4578
+ #publish-dialog header {
4579
+ display: flex;
4580
+ align-items: center;
4581
+ justify-content: space-between;
4582
+ padding-top: 10px;
4583
+ padding-bottom: 10px;
4584
+ font-size: 0.95rem;
4585
+ transition: 200ms;
4586
+ }
4587
+ #publish-dialog header svg {
4588
+ width: 1.4rem;
4589
+ vertical-align: middle;
4590
+ margin-right: 5px;
4591
+ }
4592
+ #publish-dialog header button {
4593
+ border: solid 2px #484848;
4594
+ border-radius: 50px;
4595
+ padding: 4px 9px;
4596
+ background-color: #444;
4597
+ color: #ddd;
4598
+ }
4599
+ #publish-dialog header .connector {
4600
+ color: #A291FF;
4601
+ }
4602
+ #publish-dialog main {
4603
+ max-height: none;
4604
+ }
4605
+ #publish-dialog main .buttons {
4606
+ display: grid;
4607
+ grid-template-columns: 1fr;
4608
+ grid-template-rows: auto;
4609
+ grid-row-gap: 0.5rem;
4610
+ transition: 200ms;
4611
+ }
4612
+ #publish-dialog main svg {
4613
+ height: 0.9rem;
4614
+ margin-left: 5px;
4615
+ }
4616
+ #publish-dialog main h3 {
4617
+ margin: 0;
4618
+ }
4619
+ #publish-dialog main p {
4620
+ margin-top: 0;
4621
+ }
4622
+ #publish-dialog main details {
4623
+ border-radius: 5px;
4624
+ border: solid #222 2px;
4625
+ background-color: #222;
4626
+ margin: 10px 0;
4627
+ padding: 10px;
4628
+ word-break: break-word;
4629
+ overflow-y: auto;
4630
+ max-height: 200px;
4631
+ position: relative;
4632
+ }
4633
+ #publish-dialog main details pre {
4634
+ word-break: break-word;
4635
+ }
4636
+ #publish-dialog main details summary {
4637
+ font-size: 0.95rem;
4638
+ opacity: 0.7;
4639
+ }
4640
+ #publish-dialog main details .logs {
4641
+ font-family: monospace;
4642
+ }
4643
+ #publish-dialog main details .logs * {
4644
+ margin: 0;
4645
+ padding-top: 3px;
4646
+ padding-bottom: 3px;
4647
+ border-radius: 5px;
4648
+ list-style: "-";
4649
+ }
4650
+ #publish-dialog main details .logs *:hover {
4651
+ transition: 200ms;
4652
+ background-color: rgba(255, 255, 255, 0.05);
4653
+ }
4654
+ #publish-dialog main details:hover {
4655
+ transition: 200ms;
4656
+ border-color: #575757;
4657
+ background-color: #292929;
4658
+ }
4659
+ #publish-dialog main details * {
4660
+ transition: 200ms;
4661
+ }
4662
+ #publish-dialog main details[open] summary {
4663
+ margin-bottom: 10px;
4664
+ }
4665
+ #publish-dialog main .silex-button {
4666
+ padding: 10px;
4667
+ width: 100%;
4668
+ transition: 200ms;
4669
+ }
4670
+ #publish-dialog main .silex-button:hover {
4671
+ filter: brightness(1.2);
4672
+ }
4673
+ #publish-dialog main .silex-button:active {
4674
+ filter: brightness(0.8);
4675
+ }
4676
+ #publish-dialog main .silex-button--primary {
4677
+ background-color: #8873FE;
4678
+ }
4679
+
4680
+ .gjs-suggest {
4681
+ max-height: 30vh;
4682
+ overflow-y: scroll;
4683
+ overflow-x: hidden;
4684
+ padding-top: 7px;
4685
+ border-bottom: solid #333333 7px;
4686
+ }
4687
+
4554
4688
  #gjs {
4555
4689
  flex: 1 1 auto;
4556
4690
  }
@@ -4659,6 +4793,42 @@ form.silex-form .silex-form__group.col2 {
4659
4793
  right: var(--viewsPanelWidth);
4660
4794
  }
4661
4795
 
4796
+ .top-style-section {
4797
+ position: sticky;
4798
+ top: -1px; /* Fixes a visual gap on the top */
4799
+ border-bottom: solid #575757 1px;
4800
+ background-color: #333333;
4801
+ box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.3764705882);
4802
+ z-index: 999;
4803
+ }
4804
+
4805
+ .gjs-clm-label-sel {
4806
+ opacity: 0.5;
4807
+ }
4808
+
4809
+ .gjs-clm-sels-info {
4810
+ padding: 7px 0;
4811
+ margin: 0;
4812
+ overflow-x: scroll;
4813
+ }
4814
+
4815
+ .gjs-clm-sel-rule {
4816
+ word-break: break-all;
4817
+ }
4818
+
4819
+ #gjs-clm-tags-field.gjs-field {
4820
+ margin: 0;
4821
+ }
4822
+
4823
+ .gjs-clm-tags {
4824
+ padding-top: 7px;
4825
+ padding-bottom: 0;
4826
+ }
4827
+
4828
+ #gjs-clm-up {
4829
+ margin-top: 0;
4830
+ }
4831
+
4662
4832
  /*
4663
4833
  */
4664
4834
  .gjs-editor-cont .fa {