@silexlabs/silex 3.0.0-alpha.129 → 3.0.0-alpha.131

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.
@@ -3,6 +3,7 @@ import { ConnectorId, WebsiteId } from '../types';
3
3
  import { Editor, EditorConfig } from 'grapesjs';
4
4
  import { PublicationTransformer } from './publication-transformers';
5
5
  import * as api from './api';
6
+ import { SettingsSection } from './grapesjs/settings-sections';
6
7
  /**
7
8
  * @fileoverview Silex client side config
8
9
  */
@@ -59,4 +60,12 @@ export declare class ClientConfig extends Config {
59
60
  * Add a publication transformer(s)
60
61
  */
61
62
  addPublicationTransformers(transformers: PublicationTransformer | PublicationTransformer[]): void;
63
+ /**
64
+ * Add a section to the settings dialog
65
+ */
66
+ addSettings(section: SettingsSection, siteOrPage: 'site' | 'page', position?: 'first' | 'last' | number): void;
67
+ /**
68
+ * Remove a section from the settings dialog
69
+ */
70
+ removeSettings(id: string, siteOrPage: 'site' | 'page'): void;
62
71
  }
@@ -10,5 +10,9 @@ export declare enum ClientEvent {
10
10
  PUBLISH_LOGIN_START = "silex:publish:login:start",
11
11
  PUBLISH_LOGIN_END = "silex:publish:login:end",
12
12
  ASSET_WRITE_END = "silex:asset:write:end",
13
- WRITE_END = "silex:write:end"
13
+ WRITE_END = "silex:write:end",
14
+ SETTINGS_OPEN = "silex:settings:open",
15
+ SETTINGS_CLOSE = "silex:settings:close",
16
+ SETTINGS_SAVE_START = "silex:settings:save:start",
17
+ SETTINGS_SAVE_END = "silex:settings:save:end"
14
18
  }
@@ -0,0 +1,15 @@
1
+ import { WebsiteSettings } from '../../types';
2
+ export declare const idCodeWrapper = "settings-head-wrapper";
3
+ export declare function isSite(model: any): boolean;
4
+ export interface SettingsSection {
5
+ id: string;
6
+ label: string;
7
+ render: (settings: WebsiteSettings, model: any) => any;
8
+ }
9
+ /**
10
+ * This is the settings dialog default sections
11
+ * Each section has an entry in the sidebar
12
+ * Each section render as part of the settings form
13
+ * The form is submitted to save the settings with all FormData
14
+ */
15
+ export declare const defaultSections: SettingsSection[];
@@ -1,2 +1,4 @@
1
1
  export declare const cmdOpenSettings = "open-settings";
2
2
  export declare const settingsDialog: (editor: any, opts: any) => void;
3
+ export declare function addSection(section: any, siteOrPage: 'site' | 'page', position: 'first' | 'last' | number): void;
4
+ export declare function removeSection(id: any, siteOrPage: 'site' | 'page'): void;
@@ -1,4 +1,14 @@
1
+ /**
2
+ * @fileoverview
3
+ * Defines the entry point of Silex client side application
4
+ *
5
+ */
6
+ import { ClientConfig } from './config';
1
7
  export * from './expose';
8
+ /**
9
+ * Expose the config object
10
+ */
11
+ export declare let config: ClientConfig;
2
12
  /**
3
13
  * Start Silex, called from host HTML page with window.silex.start()
4
14
  */
@@ -4579,6 +4579,10 @@ iframe.enable-squeeze.silex-squeeze-left {
4579
4579
  outline: 1px solid #8873FE;
4580
4580
  }
4581
4581
 
4582
+ .gjs-pn-buttons {
4583
+ justify-content: unset;
4584
+ }
4585
+
4582
4586
  /*
4583
4587
  */
4584
4588
  .gjs-editor-cont .fa {
@@ -6,4 +6,5 @@
6
6
  display: none;
7
7
  }
8
8
  </style></head><body class="silex-loading"><div class="silex-loader silex-dialog">Loading...
9
- </div><link rel="stylesheet" type="text/css" href="css/admin.css"><main class="silex-workspace"><div class="silex-main silex-dialog-hide silex-ui-full" id="gjs"></div></main><script src="js/main.js"></script><!-- Here you can use silex.config to hook into silex options before silex starts--><script>window.silex.start()</script></body></html>
9
+ </div><link rel="stylesheet" type="text/css" href="css/admin.css"><main class="silex-workspace"><div class="silex-main silex-dialog-hide silex-ui-full" id="gjs"></div></main><script src="js/main.js"></script><script>silex.start()
10
+ // From here silex.config is available and Silex is getting started</script></body></html>