@silexlabs/silex 3.0.0-alpha.179 → 3.0.0-alpha.181

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 (62) hide show
  1. package/README.md +1 -2
  2. package/dist/client/Silex/src/ts/client/api.d.ts +90 -0
  3. package/dist/client/Silex/src/ts/client/assetUrl.d.ts +54 -0
  4. package/dist/client/Silex/src/ts/client/config.d.ts +102 -0
  5. package/dist/client/Silex/src/ts/client/events.d.ts +23 -0
  6. package/dist/client/Silex/src/ts/client/expose.d.ts +8 -0
  7. package/dist/client/Silex/src/ts/client/grapesjs/LoginDialog.d.ts +15 -0
  8. package/dist/client/Silex/src/ts/client/grapesjs/PublicationManager.d.ts +73 -0
  9. package/dist/client/Silex/src/ts/client/grapesjs/PublicationUi.d.ts +59 -0
  10. package/dist/client/Silex/src/ts/client/grapesjs/blocks.d.ts +1 -0
  11. package/dist/client/Silex/src/ts/client/grapesjs/breadcrumbs.d.ts +1 -0
  12. package/dist/client/Silex/src/ts/client/grapesjs/css-props.d.ts +6 -0
  13. package/dist/client/Silex/src/ts/client/grapesjs/footer.d.ts +2 -0
  14. package/dist/client/Silex/src/ts/client/grapesjs/img.d.ts +6 -0
  15. package/dist/client/Silex/src/ts/client/grapesjs/index.d.ts +9 -0
  16. package/dist/client/Silex/src/ts/client/grapesjs/internal-links.d.ts +1 -0
  17. package/dist/client/Silex/src/ts/client/grapesjs/keymaps.d.ts +123 -0
  18. package/dist/client/Silex/src/ts/client/grapesjs/new-page-dialog.d.ts +2 -0
  19. package/dist/client/Silex/src/ts/client/grapesjs/openImport.d.ts +9 -0
  20. package/dist/client/Silex/src/ts/client/grapesjs/page-panel.d.ts +9 -0
  21. package/dist/client/Silex/src/ts/client/grapesjs/project-bar.d.ts +21 -0
  22. package/dist/client/Silex/src/ts/client/grapesjs/resize-panel.d.ts +1 -0
  23. package/dist/client/Silex/src/ts/client/grapesjs/rich-text.d.ts +4 -0
  24. package/dist/client/Silex/src/ts/client/grapesjs/semantic.d.ts +1 -0
  25. package/dist/client/Silex/src/ts/client/grapesjs/settings-sections.d.ts +16 -0
  26. package/dist/client/Silex/src/ts/client/grapesjs/settings.d.ts +4 -0
  27. package/dist/client/Silex/src/ts/client/grapesjs/storage.d.ts +2 -0
  28. package/dist/client/Silex/src/ts/client/grapesjs/symbolDialogs.d.ts +3 -0
  29. package/dist/client/Silex/src/ts/client/grapesjs/view-buttons.d.ts +1 -0
  30. package/dist/client/Silex/src/ts/client/index.d.ts +15 -0
  31. package/dist/client/Silex/src/ts/client/publication-transformers.d.ts +42 -0
  32. package/dist/client/Silex/src/ts/client/publish-custom-code-block.d.ts +4 -0
  33. package/dist/client/Silex/src/ts/client/publish-fonts.d.ts +4 -0
  34. package/dist/client/Silex/src/ts/client/utils.d.ts +22 -0
  35. package/dist/client/Silex/src/ts/constants.d.ts +31 -0
  36. package/dist/client/Silex/src/ts/page.d.ts +2 -0
  37. package/dist/client/Silex/src/ts/types.d.ts +339 -0
  38. package/dist/client/client/events.d.ts +7 -4
  39. package/dist/client/client/grapesjs/PublicationManager.d.ts +2 -2
  40. package/dist/client/client/grapesjs/PublicationUi.d.ts +2 -5
  41. package/dist/client/grapesjs-filter-styles/dist/index.d.ts +4 -0
  42. package/dist/client/grapesjs-fonts/dist/index.d.ts +4 -0
  43. package/dist/client/grapesjs-fonts/src/commands.d.ts +3 -0
  44. package/dist/client/grapesjs-fonts/src/fonts.d.ts +4 -0
  45. package/dist/client/grapesjs-storage-rate-limit/dist/index.d.ts +4 -0
  46. package/dist/client/grapesjs-ui-suggest-classes/dist/index.d.ts +4 -0
  47. package/dist/client/js/main.js +100 -98
  48. package/dist/client/js/main.js.LICENSE.txt +6 -0
  49. package/dist/plugins/client/client/events.d.ts +7 -4
  50. package/dist/plugins/client/client/events.js +3 -0
  51. package/dist/plugins/client/client/events.js.map +1 -1
  52. package/dist/plugins/server/plugins/server/GitlabHostingConnector.js +1 -0
  53. package/dist/plugins/server/plugins/server/GitlabHostingConnector.js.map +1 -1
  54. package/dist/server/server/cli.js +0 -0
  55. package/package.json +2 -2
  56. package/src/ts/client/events.ts +7 -4
  57. package/src/ts/client/grapesjs/PublicationManager.ts +27 -8
  58. package/src/ts/client/grapesjs/PublicationUi.ts +61 -59
  59. package/src/ts/client/grapesjs/index.ts +4 -4
  60. package/src/ts/client/grapesjs/storage.ts +1 -1
  61. package/src/ts/client/publish-fonts.ts +1 -1
  62. package/src/ts/plugins/server/GitlabHostingConnector.ts +1 -0
package/README.md CHANGED
@@ -1,4 +1,3 @@
1
- [![status of silex.me instance](https://monitoshi.lexoyo.me/badge/1525963562293-6552)](https://v3.silex.me)
2
1
 
3
2
  ![Silex UI](https://github.com/silexlabs/www.silex.me/raw/gh-pages/assets/silex-ui.gif)
4
3
 
@@ -38,7 +37,7 @@ Here are the main features of Silex website builder:
38
37
 
39
38
  ### Online Version
40
39
 
41
- The easiest way to start using Silex is by using the online version provided by [Silex Labs foundation](https://www.silexlabs.org). Simply visit [editor.silex.me](https://editor.silex.me) and start building your website right away.
40
+ The easiest way to start using Silex is by using the online version provided by [Silex Labs foundation](https://www.silexlabs.org). Simply visit [v3.silex.me](https://v3.silex.me) and start building your website right away.
42
41
 
43
42
  ### Desktop App (beta)
44
43
 
@@ -0,0 +1,90 @@
1
+ import { ConnectorId, JobId, PublicationJobData, WebsiteId, ConnectorData, ConnectorType, WebsiteData, ClientSideFile, PublicationData, ConnectorUser, WebsiteMeta, WebsiteMetaFileContent, ConnectorOptions } from '../types';
2
+ export declare enum ApiRoute {
3
+ PUBLICATION_PUBLISH = "/api/publication/",
4
+ PUBLICATION_STATUS = "/api/publication/publication/status",
5
+ CONNECTOR_USER = "/api/connector/user",
6
+ CONNECTOR_LOGOUT = "/api/connector/logout",
7
+ CONNECTOR_LIST = "/api/connector/",
8
+ WEBSITE_READ = "/api/website/",
9
+ WEBSITE_WRITE = "/api/website/",
10
+ WEBSITE_DELETE = "/api/website/",
11
+ WEBSITE_DUPLICATE = "/api/website/duplicate",
12
+ WEBSITE_CREATE = "/api/website/",
13
+ WEBSITE_LIST = "/api/website/",
14
+ WEBSITE_ASSETS_READ = "/api/website/assets",
15
+ WEBSITE_ASSETS_WRITE = "/api/website/assets",
16
+ WEBSITE_META_READ = "/api/website/meta",
17
+ WEBSITE_META_WRITE = "/api/website/meta"
18
+ }
19
+ export declare function setServerUrl(url: string): void;
20
+ export declare function getServerUrl(): string;
21
+ export declare function getUser({ type, connectorId }: {
22
+ type: ConnectorType;
23
+ connectorId?: ConnectorId;
24
+ }): Promise<ConnectorUser>;
25
+ export declare function logout({ type, connectorId }: {
26
+ type: ConnectorType;
27
+ connectorId?: ConnectorId;
28
+ }): Promise<void>;
29
+ export declare function publish({ websiteId, hostingId, storageId, data, options }: {
30
+ websiteId: WebsiteId;
31
+ hostingId: ConnectorId;
32
+ storageId: ConnectorId;
33
+ data: PublicationData;
34
+ options: ConnectorOptions;
35
+ }): Promise<[url: string, job: PublicationJobData]>;
36
+ export declare function publicationStatus({ jobId }: {
37
+ jobId: JobId;
38
+ }): Promise<PublicationJobData>;
39
+ export declare function connectorList({ type }: {
40
+ type: ConnectorType;
41
+ }): Promise<ConnectorData[]>;
42
+ export declare function websiteList({ connectorId }: {
43
+ connectorId?: ConnectorId;
44
+ }): Promise<WebsiteMeta[]>;
45
+ export declare function websiteLoad({ websiteId, connectorId }: {
46
+ websiteId: WebsiteId;
47
+ connectorId?: ConnectorId;
48
+ }): Promise<WebsiteData>;
49
+ export declare function websiteSave({ websiteId, data, connectorId }: {
50
+ websiteId: WebsiteId;
51
+ data: WebsiteData;
52
+ connectorId?: ConnectorId;
53
+ }): Promise<void>;
54
+ export declare function websiteDelete({ websiteId, connectorId }: {
55
+ websiteId: WebsiteId;
56
+ connectorId?: ConnectorId;
57
+ }): Promise<void>;
58
+ export declare function websiteDuplicate({ websiteId, connectorId }: {
59
+ websiteId: WebsiteId;
60
+ connectorId?: ConnectorId;
61
+ }): Promise<void>;
62
+ export declare function websiteCreate({ websiteId, data, connectorId }: {
63
+ websiteId: WebsiteId;
64
+ data: WebsiteMetaFileContent;
65
+ connectorId?: ConnectorId;
66
+ }): Promise<void>;
67
+ export declare function websiteMetaWrite({ websiteId, data, connectorId }: {
68
+ websiteId: WebsiteId;
69
+ data: WebsiteMetaFileContent;
70
+ connectorId?: ConnectorId;
71
+ }): Promise<void>;
72
+ export declare function websiteMetaRead({ websiteId, connectorId }: {
73
+ websiteId: WebsiteId;
74
+ connectorId?: ConnectorId;
75
+ }): Promise<WebsiteMeta>;
76
+ export declare function websiteAssetsLoad({ path, websiteId, connectorId }: {
77
+ path: string;
78
+ websiteId: WebsiteId;
79
+ connectorId: ConnectorId;
80
+ }): Promise<string>;
81
+ /**
82
+ * Not used directly, grapesjs handles the upload
83
+ * @see assetManager in src/ts/client/grapesjs/index.ts
84
+ */
85
+ export declare function websiteAssetsSave({ websiteId, connectorId, files }: {
86
+ websiteId: WebsiteId;
87
+ connectorId: ConnectorId;
88
+ files: ClientSideFile[];
89
+ }): Promise<string[]>;
90
+ export declare function api<ReqQuery, ReqBody, ResBody>(route: ApiRoute | string, method: string, query?: ReqQuery, payload?: ReqBody): Promise<ResBody>;
@@ -0,0 +1,54 @@
1
+ import { Asset, ClientSideFileType, ConnectorId, Page, Style, WebsiteId } from '../types';
2
+ /**
3
+ * Function to convert a path from it stored version to the displayed version
4
+ * Stored version is like `/assets/image.webp`
5
+ * Grapesjs version is like `/api/website/assets/image.webp?websiteId=47868975&connectorId=gitlab`
6
+ * Exported for unit tests
7
+ */
8
+ export declare function storedToDisplayed(path: string, websiteId: WebsiteId, storageId: ConnectorId): string;
9
+ /**
10
+ * Function to convert a path from the one we give to grapesjs to the stored version
11
+ * Grapesjs version is like `/api/website/assets/image.webp?websiteId=47868975&connectorId=gitlab`
12
+ * Stored version is like `/assets/image.webp`
13
+ * @param path the path to convert
14
+ * @returns the converted path
15
+ * Exported for unit tests
16
+ */
17
+ export declare function displayedToStored(path: string): string;
18
+ /**
19
+ * Publication transformer to convert the asset URL during publication
20
+ */
21
+ export declare const assetsPublicationTransformer: {
22
+ transformPath(path: string, type: ClientSideFileType): string;
23
+ transformPermalink(path: string, type: ClientSideFileType): string;
24
+ };
25
+ /**
26
+ * Update asset URL to use the current storage connector and website ID
27
+ * Assets URLs are stored in the project data in the form `/assets/image.webp`
28
+ * This function adds the API path and the connectorId and websiteId like so: `/api/website/assets/image.webp?websiteId=47868975&connectorId=gitlab`
29
+ */
30
+ export declare function addTempDataToAssetUrl(assets: Asset[], websiteId: WebsiteId, storageId: ConnectorId): Asset[];
31
+ /**
32
+ * Remove the temporary data from the asset URL
33
+ * Remove the API path and the connectorId and websiteId like so: `/assets/image.webp`
34
+ */
35
+ export declare function removeTempDataFromAssetUrl(assets: Asset[]): Asset[];
36
+ /**
37
+ * Add temp data to pages
38
+ */
39
+ export declare function addTempDataToPages(pages: Page[], websiteId: WebsiteId, storageId: ConnectorId): Page[];
40
+ /**
41
+ * Remove temp data from asset URL in the components
42
+ */
43
+ export declare function removeTempDataFromPages(pages: Page[]): Page[];
44
+ /**
45
+ * Add data to stylesheets
46
+ * e.g. linear-gradient(to right, #1fb101 0%, #df1313 67%, rgba(234, 97, 97, 255) 78%, white 100%), url('/assets/qIg7JPRc.webp'), linear-gradient(#0ca311 0%, #0ca311 100%)
47
+ */
48
+ export declare function addTempDataToStyles(styles: Style[], websiteId: WebsiteId, storageId: ConnectorId): Style[];
49
+ /**
50
+ * Remove temp data from stylesheets
51
+ * The property `background-image` contains the URLs of the assets and other values,
52
+ * e.g. `linear-gradient(to right, #1fb101 0%, #df1313 67%, rgba(234, 97, 97, 255) 78%, white 100%), url('/api/website/assets/qIg7JPRc.webp?websiteId=default&connectorId=fs-storage'), linear-gradient(#0ca311 0%, #0ca311 100%)`
53
+ */
54
+ export declare function removeTempDataFromStyles(styles: Style[]): Style[];
@@ -0,0 +1,102 @@
1
+ import { Config } from '@silexlabs/silex-plugins';
2
+ import { ConnectorId, WebsiteId } from '../types';
3
+ import { Editor, EditorConfig } from 'grapesjs';
4
+ import { PublicationTransformer } from './publication-transformers';
5
+ import * as api from './api';
6
+ import { SettingsSection } from './grapesjs/settings-sections';
7
+ /**
8
+ * @fileoverview Silex client side config
9
+ */
10
+ export declare class ClientConfig extends Config {
11
+ api: typeof api;
12
+ /**
13
+ * The website to load
14
+ * This is the id of the website in the storage connector
15
+ */
16
+ websiteId: WebsiteId;
17
+ /**
18
+ * The storage connector to use
19
+ * If not found in the URL and the user is not logged in to any storage, use the first storage
20
+ */
21
+ storageId: ConnectorId;
22
+ /**
23
+ * language for I18n module
24
+ */
25
+ lang: string;
26
+ /**
27
+ * root url of Silex app
28
+ */
29
+ rootUrl: string;
30
+ /**
31
+ * debug mode
32
+ */
33
+ debug: boolean;
34
+ /**
35
+ * Add hash in the file name of CSS at the time of publication
36
+ * If true, CSS files of generated pages will look like `page-name.123456.css` instead of `page-name.css`
37
+ * This is useful to avoid caching issues
38
+ * @default true
39
+ */
40
+ addHashInCssFileName: boolean;
41
+ /**
42
+ * Replaced elements
43
+ * This is a list of elements which support the object-fit and object-position CSS properties
44
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/Replaced_element
45
+ * When selected, Silex will show the object-fit and object-position properties in the style panel
46
+ */
47
+ replacedElements: string[];
48
+ /**
49
+ * Grapesjs config
50
+ */
51
+ grapesJsConfig: EditorConfig;
52
+ /**
53
+ * Client config url
54
+ * This is the url of the config file which is a plugin
55
+ */
56
+ clientConfigUrl: string;
57
+ /**
58
+ * Google fonts API key, see this doc to get an API key: https://developers.google.com/fonts/docs/developer_api#APIKey
59
+ * @default Test key for local dev
60
+ */
61
+ fontsApiKey: string;
62
+ /**
63
+ * Google fonts server or a free privacy-friendly drop-in replacement for Google Fonts or a proxy server to speed up the load and protect privacy
64
+ * @see https://github.com/coollabsio/fonts
65
+ * @see https://fontlay.com/
66
+ * @default Google Fonts
67
+ */
68
+ fontsServerUrl: string;
69
+ fontsApiUrl: string;
70
+ /**
71
+ * Init GrapesJS config which depend on the config file properties
72
+ */
73
+ initGrapesConfig(): void;
74
+ /**
75
+ * Get grapesjs editor
76
+ */
77
+ getEditor(): Editor;
78
+ /**
79
+ * Publication transformers let plugins change files before they are published
80
+ */
81
+ publicationTransformers: Array<PublicationTransformer>;
82
+ /**
83
+ * Reset publication transformers
84
+ */
85
+ resetPublicationTransformers(): void;
86
+ /**
87
+ * Add a publication transformer(s)
88
+ */
89
+ addPublicationTransformers(transformers: PublicationTransformer | PublicationTransformer[]): void;
90
+ /**
91
+ * Add a section to the settings dialog
92
+ */
93
+ addSettings(section: SettingsSection, siteOrPage: 'site' | 'page', position?: 'first' | 'last' | number): void;
94
+ /**
95
+ * Remove a section from the settings dialog
96
+ */
97
+ removeSettings(id: string, siteOrPage: 'site' | 'page'): void;
98
+ /**
99
+ * Add default plugins
100
+ */
101
+ addDefaultPlugins(): Promise<void>;
102
+ }
@@ -0,0 +1,23 @@
1
+ export declare enum ClientEvent {
2
+ STARTUP_START = "silex:startup:start",/* Loading is over and Silex is starting */
3
+ STARTUP_END = "silex:startup:end",/* Silex is ready to be used */
4
+ GRAPESJS_START = "silex:grapesjs:start",/* GrapesJS is about to be initialized, it is time to edit config.grapesJsConfig */
5
+ GRAPESJS_END = "silex:grapesjs:end",/* GrapesJS is ready to be used, `editor` is passed as an argument */
6
+ PUBLICATION_UI_OPEN = "silex:publication-ui:open",/* The publication UI is opened, you can access it with { publicationUi } */
7
+ PUBLICATION_UI_CLOSE = "silex:publication-ui:close",/* The publication UI is closed, you can access it with { publicationUi } */
8
+ PUBLISH_BEFORE = "silex:publish:before",/* Publication is about to start, you can read+write {projectData, siteSettings} */
9
+ PUBLISH_START = "silex:publish:start",/* Publication starts, you can read+write project data/settings, use publication manager/ui, prevent publication {projectData, siteSettings, publicationManager, prenventDefault} */
10
+ PUBLISH_PAGE = "silex:publish:page",/* Publication of a page, read+write settings and page data, use publication manager and prevent publication { siteSettings, pageSettings, page, publicationManager, preventDefault } */
11
+ PUBLISH_DATA = "silex:publish:data",/* Just before we send the published data to the server, read+write all publication data, check PublicationData type in types.ts { data, publicationManager } */
12
+ PUBLISH_END = "silex:publish:end",/* Publication is over, the argument is the publication result with {success: boolean, message: string} */
13
+ PUBLISH_ERROR = "silex:publish:error",/* Publication failed, the argument is the publication result with {success: boolean, message: string} */
14
+ PUBLISH_LOGIN_START = "silex:publish:login:start",/* The user is about to login before publication, you can read+write connector data and use publication manager and prevent publication {connector, publicationManager, preventDefault} */
15
+ PUBLISH_LOGIN_END = "silex:publish:login:end",
16
+ ASSET_WRITE_END = "silex:asset:write:end",
17
+ WRITE_END = "silex:write:end",
18
+ SETTINGS_OPEN = "silex:settings:open",/* The settings dialog is opened */
19
+ SETTINGS_CLOSE = "silex:settings:close",/* The settings dialog is closed */
20
+ SETTINGS_SAVE_START = "silex:settings:save:start",/* The settings dialog is closed and the settings are about to be saved */
21
+ SETTINGS_SAVE_END = "silex:settings:save:end",/* The settings dialog is closed and the settings are saved */
22
+ SETTINGS_SECTION_CHANGE = "silex:settings:section-change"
23
+ }
@@ -0,0 +1,8 @@
1
+ export * from './grapesjs/index';
2
+ export * from './config';
3
+ export * as constants from '../constants';
4
+ export * as utils from './utils';
5
+ export * as api from './api';
6
+ export * as events from './events';
7
+ export * as page from '../page';
8
+ export * as types from '../types';
@@ -0,0 +1,15 @@
1
+ import { Editor } from 'grapesjs';
2
+ import { ConnectorId, ConnectorType, ConnectorUser } from '../../types';
3
+ import { WebsiteId } from '../../types';
4
+ export declare const cmdLogin = "silex:auth:login";
5
+ export declare const cmdLogout = "silex:auth:logout";
6
+ export declare const eventLoggingIn = "silex:auth:logging-in";
7
+ export declare const eventLoggedIn = "silex:auth:logged-in";
8
+ export declare const eventLoginFailed = "silex:auth:login-failed";
9
+ export declare const eventLoggedOut = "silex:auth:logged-out";
10
+ export interface LoginDialogOptions {
11
+ id: WebsiteId;
12
+ }
13
+ export declare function getCurrentUser(editor: Editor): Promise<ConnectorUser>;
14
+ export declare function updateUser(editor: Editor, type: ConnectorType, connectorId?: ConnectorId): Promise<ConnectorUser>;
15
+ export default function loginDialogPlugin(editor: any, opts: any): void;
@@ -0,0 +1,73 @@
1
+ import { ConnectorData, PublicationData, PublicationJobData, PublicationSettings, WebsiteFile, WebsiteId, WebsiteSettings } from '../../types';
2
+ import { Editor } from 'grapesjs';
3
+ import { PublicationUi } from './PublicationUi';
4
+ /**
5
+ * @fileoverview Publication manager for Silex
6
+ * This plugin adds a publication feature to Silex
7
+ * It lets the user publish the website to a hosting service
8
+ * It can optionally display a button and a dialog
9
+ * Useful commands:
10
+ * - publish: starts the publication process and optionally open the dialog
11
+ * - publish-login: open the login dialog
12
+ * - publish-logout: logout from the hosting service and let the user choose a hosting service again
13
+ */
14
+ export declare const cmdPublicationStart = "publish";
15
+ export declare const cmdPublicationLogin = "publish-login";
16
+ export declare const cmdPublicationLogout = "publish-logout";
17
+ export type PublishableEditor = Editor & {
18
+ PublicationManager: PublicationManager;
19
+ };
20
+ export declare enum PublicationStatus {
21
+ STATUS_NONE = "STATUS_NONE",
22
+ STATUS_PENDING = "STATUS_PENDING",
23
+ STATUS_ERROR = "STATUS_ERROR",
24
+ STATUS_SUCCESS = "STATUS_SUCCESS",
25
+ STATUS_LOGGED_OUT = "STATUS_AUTH_ERROR"
26
+ }
27
+ export type PublicationManagerOptions = {
28
+ appendTo?: string;
29
+ websiteId: WebsiteId;
30
+ };
31
+ export default function publishPlugin(editor: any, opts: any): void;
32
+ export declare class PublicationManager {
33
+ private editor;
34
+ /**
35
+ * Publication dialog
36
+ * This class is responsible for the UI
37
+ */
38
+ dialog?: PublicationUi;
39
+ /**
40
+ * Publication settings
41
+ * This is the data which is stored in the website settings
42
+ */
43
+ _settings: PublicationSettings;
44
+ get settings(): PublicationSettings;
45
+ set settings(newSettings: PublicationSettings);
46
+ /**
47
+ * Plugin options
48
+ * This is the data which is passed to the plugin by grapesjs
49
+ */
50
+ options: PublicationManagerOptions;
51
+ /**
52
+ * Publication job during the publication process
53
+ */
54
+ job: PublicationJobData | null;
55
+ /**
56
+ * Publication state
57
+ * This is the state of the publication process
58
+ */
59
+ status: PublicationStatus;
60
+ constructor(editor: PublishableEditor, opts: PublicationManagerOptions);
61
+ goLogin(connector: ConnectorData): Promise<void>;
62
+ goLogout(): Promise<void>;
63
+ getPublicationData(projectData: any, siteSettings: any, preventDefault: () => void): Promise<PublicationData>;
64
+ /**
65
+ * Start the publication process
66
+ * This is the command "publish"
67
+ */
68
+ startPublication(): Promise<void>;
69
+ getHtmlFiles(siteSettings: WebsiteSettings, preventDefault: any): Promise<WebsiteFile[]>;
70
+ trackProgress(): Promise<void>;
71
+ private setPublicationTransformers;
72
+ private resetPublicationTransformers;
73
+ }
@@ -0,0 +1,59 @@
1
+ import { TemplateResult } from 'lit-html';
2
+ import { PublicationStatus, PublishableEditor } from './PublicationManager';
3
+ import { PublicationJobData, PublicationSettings } from '../../types';
4
+ /**
5
+ * @fileoverview define the publication dialog
6
+ * This is the UI of the publication feature
7
+ * It is a dialog which allows the user to login to a connector and publish the website
8
+ * It also displays the publication status and logs during the publication process
9
+ * This class is used by the PublicationManager
10
+ * This is optional, you can use the PublicationManager without this UI
11
+ * @TODO Use publication events instead of calls from the PublicationManager
12
+ */
13
+ export declare const cmdPublish = "publish-open-dialog";
14
+ export type PublicationDialogOptions = {
15
+ appendTo: string;
16
+ };
17
+ /**
18
+ * Class to manage the publication dialog
19
+ */
20
+ export declare class PublicationUi {
21
+ private editor;
22
+ private options;
23
+ /**
24
+ * Dialog state
25
+ */
26
+ isOpen: boolean;
27
+ /**
28
+ * Dialog content
29
+ */
30
+ private errorMessage;
31
+ /**
32
+ * Dialog element
33
+ * This is the DOM element of the dialog
34
+ */
35
+ private el;
36
+ settings: PublicationSettings;
37
+ private sender;
38
+ /**
39
+ * Initialize the dialog and the publish button
40
+ */
41
+ constructor(editor: PublishableEditor, options: PublicationDialogOptions);
42
+ isSuccess(status: PublicationStatus): status is PublicationStatus.STATUS_SUCCESS;
43
+ isPending(status: PublicationStatus): status is PublicationStatus.STATUS_PENDING;
44
+ isError(status: PublicationStatus): status is PublicationStatus.STATUS_ERROR;
45
+ isLoggedOut(status: PublicationStatus): status is PublicationStatus.STATUS_LOGGED_OUT;
46
+ isReady(status: PublicationStatus): status is PublicationStatus.STATUS_NONE;
47
+ userContent: TemplateResult | null;
48
+ setUserContent(content: TemplateResult): void;
49
+ createDialogElements(): HTMLElement;
50
+ move(rect: any): void;
51
+ private renderDialog;
52
+ renderOpenDialog(job: PublicationJobData, status: PublicationStatus): Promise<TemplateResult>;
53
+ renderLoginDialog(status: PublicationStatus): Promise<TemplateResult>;
54
+ displayPending(job: PublicationJobData, status: PublicationStatus): void;
55
+ displayError(message: string, job: PublicationJobData, status: PublicationStatus): void;
56
+ closeDialog(): Promise<void>;
57
+ toggleDialog(): Promise<void>;
58
+ openDialog(): Promise<void>;
59
+ }
@@ -0,0 +1 @@
1
+ export declare const blocksPlugin: (editor: any, opts: any) => void;
@@ -0,0 +1 @@
1
+ export default function (editor: any, options: any): void;
@@ -0,0 +1,6 @@
1
+ import { Editor } from 'grapesjs';
2
+ /**
3
+ * @fileoverview Adds various css properties
4
+ */
5
+ declare const _default: (editor: Editor, opts: any) => void;
6
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export default function (editor: any, options: any): void;
2
+ export declare function onFooter(fn: any): void;
@@ -0,0 +1,6 @@
1
+ import { Editor } from 'grapesjs';
2
+ /**
3
+ * @fileoverview This plugin adds CSS properties object-fit and object-position to the image component.
4
+ */
5
+ declare const _default: (editor: Editor, opts: any) => void;
6
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { Editor, EditorConfig } from 'grapesjs';
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";
7
+ export declare function getEditorConfig(config: ClientConfig): EditorConfig;
8
+ export declare function initEditor(config: EditorConfig): Promise<Editor>;
9
+ export declare function getEditor(): Editor;
@@ -0,0 +1 @@
1
+ export declare const internalLinksPlugin: (editor: any, opts: any) => void;
@@ -0,0 +1,123 @@
1
+ import { Editor, PluginOptions } from 'grapesjs';
2
+ /**
3
+ * Opens the Publish dialog and publishes the website.
4
+ * @param editor The editor.
5
+ */
6
+ declare function publish(editor: Editor): void;
7
+ /**
8
+ * Escapes the current context in this order : modal, Publish dialog, left panel.
9
+ * If none of these are open, it selects the body.
10
+ * @param editor The editor.
11
+ */
12
+ declare function escapeContext(editor: Editor): void;
13
+ export declare const cmdSelectBody = "select-body";
14
+ export declare let prefixKey: string;
15
+ export declare const defaultKms: {
16
+ kmOpenSettings: {
17
+ id: string;
18
+ keys: string;
19
+ handler: (editor: any) => void;
20
+ };
21
+ kmOpenPublish: {
22
+ id: string;
23
+ keys: string;
24
+ handler: (editor: any) => void;
25
+ };
26
+ kmOpenFonts: {
27
+ id: string;
28
+ keys: string;
29
+ handler: (editor: any) => void;
30
+ };
31
+ kmPreviewMode: {
32
+ id: string;
33
+ keys: string;
34
+ handler: (editor: any) => void;
35
+ };
36
+ kmLayers: {
37
+ id: string;
38
+ keys: string;
39
+ handler: (editor: any) => void;
40
+ };
41
+ kmBlocks: {
42
+ id: string;
43
+ keys: string;
44
+ handler: (editor: any) => void;
45
+ };
46
+ kmNotifications: {
47
+ id: string;
48
+ keys: string;
49
+ handler: (editor: any) => void;
50
+ };
51
+ kmPages: {
52
+ id: string;
53
+ keys: string;
54
+ handler: (editor: any) => void;
55
+ };
56
+ kmSymbols: {
57
+ id: string;
58
+ keys: string;
59
+ handler: (editor: any) => void;
60
+ };
61
+ kmStyleManager: {
62
+ id: string;
63
+ keys: string;
64
+ handler: (editor: any) => void;
65
+ };
66
+ kmTraitsManager: {
67
+ id: string;
68
+ keys: string;
69
+ handler: (editor: any) => void;
70
+ };
71
+ kmClosePanel: {
72
+ id: string;
73
+ keys: string;
74
+ handler: typeof escapeContext;
75
+ };
76
+ kmSelectBody: {
77
+ id: string;
78
+ keys: string;
79
+ handler: string;
80
+ };
81
+ kmDuplicateSelection: {
82
+ id: string;
83
+ keys: string;
84
+ handler: string;
85
+ };
86
+ kmPublish: {
87
+ id: string;
88
+ keys: string;
89
+ handler: typeof publish;
90
+ };
91
+ kmAddPage: {
92
+ id: string;
93
+ keys: string;
94
+ handler: string;
95
+ };
96
+ kmRemovePage: {
97
+ id: string;
98
+ keys: string;
99
+ handler: string;
100
+ };
101
+ kmClonePage: {
102
+ id: string;
103
+ keys: string;
104
+ handler: string;
105
+ };
106
+ kmSelectNextPage: {
107
+ id: string;
108
+ keys: string;
109
+ handler: string;
110
+ };
111
+ kmSelectPrevPage: {
112
+ id: string;
113
+ keys: string;
114
+ handler: string;
115
+ };
116
+ kmSelectFirstPage: {
117
+ id: string;
118
+ keys: string;
119
+ handler: string;
120
+ };
121
+ };
122
+ export declare function keymapsPlugin(editor: Editor, opts: PluginOptions): void;
123
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const cmdOpenNewPageDialog = "new-page-dialog";
2
+ export declare const newPageDialog: (editor: any, opts: any) => void;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @fileoverview Import feature
3
+ * Let the user import HTML code when she creates a new page
4
+ *
5
+ */
6
+ export default function openImport(editor: any, config: any): {
7
+ run(_: any): void;
8
+ stop(): void;
9
+ };
@@ -0,0 +1,9 @@
1
+ import { Editor } from 'grapesjs';
2
+ export declare const cmdTogglePages = "pages:open-panel";
3
+ export declare const cmdAddPage = "pages:add";
4
+ export declare const cmdRemovePage = "pages:remove";
5
+ export declare const cmdClonePage = "pages:clone";
6
+ export declare const cmdSelectNextPage = "pages:select-next";
7
+ export declare const cmdSelectPrevPage = "pages:select-prev";
8
+ export declare const cmdSelectFirstPage = "pages:select-first";
9
+ export declare const pagePanelPlugin: (editor: Editor, opts: any) => void;
@@ -0,0 +1,21 @@
1
+ import { Editor } from 'grapesjs';
2
+ export declare const PROJECT_BAR_PANEL_ID = "project-bar-panel";
3
+ export declare const containerPanelId = "project-bar-container";
4
+ export interface PanelObject {
5
+ command: string | ((editor: Editor) => void);
6
+ text: string;
7
+ className: string;
8
+ name?: string;
9
+ attributes: {
10
+ title?: string;
11
+ containerClassName?: string;
12
+ };
13
+ buttons?: {
14
+ command: string;
15
+ text: string;
16
+ className: string;
17
+ }[];
18
+ onClick?: (editor: Editor) => void;
19
+ }
20
+ export declare const projectBarPlugin: (editor: any, opts: any) => void;
21
+ export declare function addButton(editor: Editor, panel: PanelObject): void;
@@ -0,0 +1 @@
1
+ export default function (editor: any): void;
@@ -0,0 +1,4 @@
1
+ import { RichTextEditorAction } from 'grapesjs';
2
+ export declare const orderedList: RichTextEditorAction;
3
+ export declare const unorderedList: RichTextEditorAction;
4
+ export declare const richTextPlugin: (editor: any, opts: any) => void;