@silexlabs/silex 3.5.1-7 → 3.5.1
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.
- package/dist/client/css/admin.css +921 -165
- package/dist/client/index.html +2 -2
- package/dist/client/js/main.js +239 -196
- package/dist/client/js/main.js.LICENSE.txt +1 -7
- package/package.json +12 -12
- package/src/css/_variables.scss +42 -7
- package/src/css/dialog.scss +29 -15
- package/src/css/dialogs.scss +235 -0
- package/src/css/fonts.scss +20 -22
- package/src/css/footer.scss +2 -1
- package/src/css/grapesjs-plugins.scss +40 -21
- package/src/css/grapesjs.scss +69 -21
- package/src/css/index.scss +6 -2
- package/src/css/page-panel.scss +27 -15
- package/src/css/panels.scss +261 -0
- package/src/css/project-bar.scss +59 -47
- package/src/css/silex.scss +85 -58
- package/src/css/theme-base.scss +93 -0
- package/src/css/theme-modern.scss +265 -0
- package/src/css/website-info.scss +2 -2
- package/src/ts/client/grapesjs/cms/page-settings.ts +17 -15
- package/src/ts/client/grapesjs/cms/site-settings.ts +0 -1
- package/src/ts/client/grapesjs/cms/states.ts +2 -2
- package/src/ts/client/grapesjs/sectors.ts +9 -3
- package/src/ts/client/grapesjs/settings-sections.ts +4 -9
- package/src/ts/client/grapesjs/settings.ts +1 -10
- package/src/css/light.scss +0 -7
|
@@ -158,15 +158,13 @@ function renderSettingsSection(settings: Silex11tyPluginWebsiteSettings, editor:
|
|
|
158
158
|
}
|
|
159
159
|
</style>
|
|
160
160
|
<div id="settings-${CMS_SETTINGS_SECTION_ID}" class="silex-hideable silex-hidden">
|
|
161
|
-
<div class="gjs-sm-sector-title">Silex CMS - Page settings</div>
|
|
162
161
|
<div class="silex-help">
|
|
163
162
|
The "Silex CMS" feature integrates <a target="_blank" href="https://www.11ty.dev/">11ty</a> static site generator and your favorite headless CMS with Silex.
|
|
164
|
-
<br>Read
|
|
163
|
+
<br>Read Silex <a target="_blank" href="https://docs.silex.me/en/user/cms">documentation</a> to learn more.
|
|
165
164
|
</div>
|
|
166
165
|
<div class="silex-form__group col2">
|
|
167
166
|
<label class="silex-form__element">
|
|
168
|
-
<
|
|
169
|
-
<p class="silex-help">Pagination allows you to iterate over data and create multiple webiste pages from a single page in Silex. </p>
|
|
167
|
+
<p class="silex-help">Pagination allows you to iterate over data and create multiple website pages from a single page in Silex. This feature is based on <a target="_blank" href="https://www.11ty.dev/docs/pagination/">Eleventy pagination, read more in the docs</a>.</p>
|
|
170
168
|
<state-editor
|
|
171
169
|
${ref(pageDataEditor)}
|
|
172
170
|
id="eleventyPageData"
|
|
@@ -178,14 +176,8 @@ function renderSettingsSection(settings: Silex11tyPluginWebsiteSettings, editor:
|
|
|
178
176
|
no-states
|
|
179
177
|
no-filters
|
|
180
178
|
>
|
|
181
|
-
<label slot="label">Data</label>
|
|
179
|
+
<label slot="label">Pagination Data</label>
|
|
182
180
|
</state-editor>
|
|
183
|
-
<label class="silex-form__element">Size
|
|
184
|
-
<input type="number" name="eleventyPageSize" .value=${settings.eleventyPageSize ?? 1}/>
|
|
185
|
-
</label>
|
|
186
|
-
<label class="silex-form__element">Reverse
|
|
187
|
-
<input type="checkbox" name="eleventyPageReverse" ?checked=${!!settings.eleventyPageReverse}/>
|
|
188
|
-
</label>
|
|
189
181
|
<state-editor
|
|
190
182
|
id="eleventyPermalink"
|
|
191
183
|
name="eleventyPermalink"
|
|
@@ -195,14 +187,20 @@ function renderSettingsSection(settings: Silex11tyPluginWebsiteSettings, editor:
|
|
|
195
187
|
>
|
|
196
188
|
<label slot="label">Permalink</label>
|
|
197
189
|
</state-editor>
|
|
190
|
+
<details class="silex-more"><summary>Advanced params</summary>
|
|
191
|
+
<label class="silex-form__element">Reverse
|
|
192
|
+
<input type="checkbox" name="eleventyPageReverse" ?checked=${!!settings.eleventyPageReverse}/>
|
|
193
|
+
</label>
|
|
194
|
+
<label class="silex-form__element">Size
|
|
195
|
+
<input type="number" name="eleventyPageSize" .value=${settings.eleventyPageSize ?? 1} placeholder="1" />
|
|
196
|
+
</label>
|
|
198
197
|
<label class="silex-form__element">Available languages
|
|
199
|
-
<p class="silex-help">Silex can duplicate this page for each language and generate a different URL for each language.</p>
|
|
200
|
-
<
|
|
201
|
-
<input type="text" name="silexLanguagesList" .value=${settings.silexLanguagesList ?? ''}/>
|
|
198
|
+
<p class="silex-help">Silex can duplicate this page for each language and generate a different URL for each language. Provide a comma separated list of languages. For example: <code>en,fr</code>. An empty value will deactivate this feature.</p>
|
|
199
|
+
<input type="text" name="silexLanguagesList" .value=${settings.silexLanguagesList ?? ''} placeholder="en, fr, es" />
|
|
202
200
|
</label>
|
|
203
201
|
</label>
|
|
204
202
|
<label class="silex-form__element">
|
|
205
|
-
<h3>Navigation Plugin</h3>
|
|
203
|
+
<h3 class="gjs-sm-sector-title">Navigation Plugin</h3>
|
|
206
204
|
<p class="silex-help">This 11ty plugin enables infinite-depth hierarchical navigation in Eleventy projects. Supports breadcrumbs too! <a target="_blank" href="https://www.11ty.dev/docs/plugins/navigation/">Read more about the Navigation Plugin</a>.</p>
|
|
207
205
|
<label class="silex-form__element">Key
|
|
208
206
|
<input type="text" name="eleventyNavigationKey" .value=${settings.eleventyNavigationKey ?? ''}/>
|
|
@@ -220,6 +218,8 @@ function renderSettingsSection(settings: Silex11tyPluginWebsiteSettings, editor:
|
|
|
220
218
|
<input type="text" name="eleventyNavigationUrl" .value=${settings.eleventyNavigationUrl ?? ''}/>
|
|
221
219
|
</label>
|
|
222
220
|
</label>
|
|
221
|
+
</details>
|
|
222
|
+
<details class="silex-more"><summary>Override SEO and social settings</summary>
|
|
223
223
|
<label class="silex-form__element">
|
|
224
224
|
<h3>SEO</h3>
|
|
225
225
|
<state-editor
|
|
@@ -279,6 +279,8 @@ function renderSettingsSection(settings: Silex11tyPluginWebsiteSettings, editor:
|
|
|
279
279
|
>
|
|
280
280
|
<label slot="label">OG Description</label>
|
|
281
281
|
</state-editor>
|
|
282
|
+
</label>
|
|
283
|
+
</details>
|
|
282
284
|
</div>
|
|
283
285
|
</div>
|
|
284
286
|
`
|
|
@@ -25,7 +25,6 @@ export default function(editor: Editor, opts: EleventyPluginOptions): void {
|
|
|
25
25
|
}
|
|
26
26
|
</style>
|
|
27
27
|
<div id="settings-${CMS_SETTINGS_SECTION_ID}" class="silex-hideable silex-hidden">
|
|
28
|
-
<div class="gjs-sm-sector-title">Silex CMS</div>
|
|
29
28
|
<div class="silex-help">
|
|
30
29
|
<p>The <a target="_blank" href="https://github.com/silexlabs/silex-cms">Silex CMS feature</a> integrates with your favorite headless CMS, API or database.</p>
|
|
31
30
|
<p>By adding data sources to your website you activate <a target="_blank" href="https://www.11ty.dev/docs/">11ty static site generator</a> integration. When you wil publish your website, the generated files assume you build the site with 11ty and possibly with Gitlab pages.</p>
|
|
@@ -55,7 +55,7 @@ export function updatePaginationStates(editor: Editor, pageIndex = 0, preventTri
|
|
|
55
55
|
if (!body.attributes.publicStates) body.attributes.publicStates = []
|
|
56
56
|
body.attributes.publicStates.push({
|
|
57
57
|
hidden: true,
|
|
58
|
-
label: '
|
|
58
|
+
label: 'Pagination items',
|
|
59
59
|
expression: itemsExpression,
|
|
60
60
|
})
|
|
61
61
|
} else {
|
|
@@ -87,7 +87,7 @@ export function updatePaginationStates(editor: Editor, pageIndex = 0, preventTri
|
|
|
87
87
|
editor.UndoManager.skip(() => {
|
|
88
88
|
setState(body, 'items', {
|
|
89
89
|
hidden: true,
|
|
90
|
-
label: '
|
|
90
|
+
label: 'Pagination items',
|
|
91
91
|
expression: itemsExpression,
|
|
92
92
|
}, true, 1)
|
|
93
93
|
|
|
@@ -45,12 +45,19 @@ export function registerSector(editor: Editor, config: SectorConfig, at?: number
|
|
|
45
45
|
|
|
46
46
|
// Update visibility depending on selected component
|
|
47
47
|
let showSector = false
|
|
48
|
-
|
|
49
|
-
if (!comp) return // No selection yet
|
|
48
|
+
async function update(comp: Component) {
|
|
50
49
|
const shouldShow = await config.shouldShow(comp)
|
|
51
50
|
showSector = shouldShow
|
|
52
51
|
sector.set('visible', shouldShow)
|
|
53
52
|
sector.getProperties().forEach(p => p.set('visible', shouldShow))
|
|
53
|
+
}
|
|
54
|
+
editor.on('component:selected component:update:selector', (comp) => {
|
|
55
|
+
if (!comp) return // No selection yet
|
|
56
|
+
update(comp)
|
|
57
|
+
// TODO: why is this needed? Is this because of doubleCheck?
|
|
58
|
+
setTimeout(() => update(comp), 100)
|
|
59
|
+
setTimeout(() => update(comp), 500)
|
|
60
|
+
setTimeout(() => update(comp), 1000)
|
|
54
61
|
})
|
|
55
62
|
|
|
56
63
|
// Watch changes made by grapesjs and revert them if needed
|
|
@@ -64,4 +71,3 @@ export function registerSector(editor: Editor, config: SectorConfig, at?: number
|
|
|
64
71
|
}
|
|
65
72
|
sector.on('change:visible', doubleCheck)
|
|
66
73
|
}
|
|
67
|
-
|
|
@@ -25,7 +25,6 @@ export const defaultSections: SettingsSection[] = [{
|
|
|
25
25
|
label: 'General',
|
|
26
26
|
render: (settings, model) => html`
|
|
27
27
|
<div id="settings-general" class="silex-hideable">
|
|
28
|
-
<div class="gjs-sm-sector-title">General</div>
|
|
29
28
|
<div class="silex-form__group col2">
|
|
30
29
|
<label class="silex-form__element">
|
|
31
30
|
<h3>${isSite(model) ? 'Site name' : 'Page name'}</h3>
|
|
@@ -34,7 +33,7 @@ export const defaultSections: SettingsSection[] = [{
|
|
|
34
33
|
</label>
|
|
35
34
|
<label class="silex-form__element">
|
|
36
35
|
<h3>Website language</h3>
|
|
37
|
-
<p class="silex-help">This is the default language code for this website. Example: en, fr, es...</p>
|
|
36
|
+
<p class="silex-help">This is the default language code for this website or page. Example: en, fr, es...</p>
|
|
38
37
|
<input type="text" name="lang" .value=${live(settings.lang || '')}/>
|
|
39
38
|
</label>
|
|
40
39
|
</div>
|
|
@@ -45,7 +44,6 @@ export const defaultSections: SettingsSection[] = [{
|
|
|
45
44
|
label: 'SEO',
|
|
46
45
|
render: (settings, model) => html`
|
|
47
46
|
<div id="settings-seo" class="silex-hideable silex-hidden">
|
|
48
|
-
<div class="gjs-sm-sector-title">SEO</div>
|
|
49
47
|
<div class="silex-form__group col2">
|
|
50
48
|
<label class="silex-form__element">
|
|
51
49
|
<h3>Title</h3>
|
|
@@ -70,7 +68,6 @@ export const defaultSections: SettingsSection[] = [{
|
|
|
70
68
|
label: 'Social',
|
|
71
69
|
render: (settings, model) => html`
|
|
72
70
|
<div id="settings-social" class="silex-hideable silex-hidden">
|
|
73
|
-
<div class="gjs-sm-sector-title">Social</div>
|
|
74
71
|
<div class="silex-help">
|
|
75
72
|
<p>Once your website is live, you can use these tools to test sharing: <a target="_blank" href="https://developers.facebook.com/tools/debug/">Facebook</a>,
|
|
76
73
|
<a target="_blank" href="https://cards-dev.twitter.com/validator">Twitter</a>,
|
|
@@ -79,14 +76,14 @@ export const defaultSections: SettingsSection[] = [{
|
|
|
79
76
|
<div class="silex-form__group col2">
|
|
80
77
|
<label class="silex-form__element">
|
|
81
78
|
<h3>Title</h3>
|
|
82
|
-
<p class="silex-help">The title of your website displayed when a user shares your website on a social network.
|
|
79
|
+
<p class="silex-help">The title of your website or page displayed when a user shares your website on a social network.
|
|
83
80
|
Do not include any branding in this title, just eye-catching phrase, e.g. "Learn everything about fishing".
|
|
84
81
|
Title should be between 60 and 90 characters long.</p>
|
|
85
82
|
<input type="text" name="og:title" .value=${live(settings['og:title'] || '')}/>
|
|
86
83
|
</label>
|
|
87
84
|
<label class="silex-form__element">
|
|
88
85
|
<h3>Description</h3>
|
|
89
|
-
<p class="silex-help">Description displayed when a user shares your website on a social network. Make it catchy, and invite readers to visit your website too, e.g. "Sam's website about fishing, check it out!" Title should be between 60 and 90 characters long.</p>
|
|
86
|
+
<p class="silex-help">Description displayed when a user shares your website or page on a social network. Make it catchy, and invite readers to visit your website too, e.g. "Sam's website about fishing, check it out!" Title should be between 60 and 90 characters long.</p>
|
|
90
87
|
<input type="text" name="og:description" .value=${live(settings['og:description'] || '')}/>
|
|
91
88
|
</label>
|
|
92
89
|
<label class="silex-form__element">
|
|
@@ -105,13 +102,11 @@ export const defaultSections: SettingsSection[] = [{
|
|
|
105
102
|
label: 'Code',
|
|
106
103
|
render: (settings, model) => html`
|
|
107
104
|
<div id="settings-code" class="silex-hideable silex-hidden">
|
|
108
|
-
<div class="gjs-sm-sector-title">Code</div>
|
|
109
105
|
<div class="silex-form__group">
|
|
110
106
|
<label class="silex-form__element" id="${idCodeWrapper}">
|
|
111
|
-
<h3>HTML head</h3>
|
|
112
107
|
<p class="silex-help">HTML code which will be inserted in the HEAD tag.</p>
|
|
113
108
|
</label>
|
|
114
109
|
</div>
|
|
115
110
|
</div>
|
|
116
111
|
`,
|
|
117
|
-
}]
|
|
112
|
+
}]
|
|
@@ -58,7 +58,7 @@ function createCustomSettingsDialog(editor: Editor, opts: Record<string, unknown
|
|
|
58
58
|
const dialog = document.createElement('div')
|
|
59
59
|
dialog.className = 'settings-dialog gjs-two-color'
|
|
60
60
|
dialog.innerHTML = `
|
|
61
|
-
<div class="settings-content" role="dialog" aria-modal="true" aria-labelledby="settings-title">
|
|
61
|
+
<div class="settings-content gjs-mdl-dialog" role="dialog" aria-modal="true" aria-labelledby="settings-title">
|
|
62
62
|
<div class="settings-header">
|
|
63
63
|
<h3 id="settings-title">${page ? 'Page settings' : 'Site Settings'}</h3>
|
|
64
64
|
<button type="button" class="settings-close" title="Close" aria-label="Close settings">×</button>
|
|
@@ -331,15 +331,6 @@ function displaySettings(
|
|
|
331
331
|
})
|
|
332
332
|
render(html`
|
|
333
333
|
<form class="silex-form">
|
|
334
|
-
<div class="silex-help">
|
|
335
|
-
${isSite(model) ? html`
|
|
336
|
-
<p>Here you can set the name of your website, SEO and social networks sharing data.</p>
|
|
337
|
-
<p>These settings are overriden by the page settings, <a href="https://github.com/silexlabs/Silex/wiki/Settings" target="_blank">more info about settings here</a>.</p>
|
|
338
|
-
` : html`
|
|
339
|
-
<p>Here you can set the name of your page, SEO and social networks sharing data.</p>
|
|
340
|
-
<p>These settings override the site settings, <a href="https://github.com/silexlabs/Silex/wiki/Settings" target="_blank">more info about settings here</a>.</p>
|
|
341
|
-
`}
|
|
342
|
-
</div>
|
|
343
334
|
<section class="silex-sidebar-dialog">
|
|
344
335
|
<aside class="silex-bar">
|
|
345
336
|
<ul class="silex-list silex-list--menu" aria-label="Settings sections">
|