@silexlabs/silex 3.0.0-alpha.128 → 3.0.0-alpha.130

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
  }
@@ -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
  */
@@ -3864,9 +3864,13 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
3864
3864
  }
3865
3865
 
3866
3866
  .silex-hidden {
3867
+ /* do not really hide, because it breaks the code editor init in the site settings + for animation */
3867
3868
  visibility: hidden;
3868
3869
  position: absolute;
3869
3870
  opacity: 0;
3871
+ height: 10px;
3872
+ width: 10px;
3873
+ overflow: hidden;
3870
3874
  }
3871
3875
 
3872
3876
  .settings-dialog > div {
@@ -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>