@silexlabs/silex 3.0.2 → 3.0.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silexlabs/silex",
3
3
  "description": "Free and easy website builder for everyone.",
4
- "version": "3.0.2",
4
+ "version": "3.0.3",
5
5
  "version:backwardcompat": "3.0.0",
6
6
  "author": {
7
7
  "name": "Alex Hoyau",
@@ -133,7 +133,6 @@
133
133
  "grapesjs": "^0.21.13",
134
134
  "grapesjs-blocks-basic": "1.0.2",
135
135
  "grapesjs-custom-code": "1.0.2",
136
- "grapesjs-navbar": "^1.0.2",
137
136
  "grapesjs-plugin-forms": "2.0.6",
138
137
  "grapesjs-style-bg": "^2.0.2",
139
138
  "grapesjs-style-border": "1.0.4",
@@ -32,7 +32,6 @@ import blocksBasicPlugin from 'grapesjs-blocks-basic'
32
32
  import styleFilterPlugin from 'grapesjs-style-filter'
33
33
  import formPlugin from 'grapesjs-plugin-forms'
34
34
  import codePlugin from 'grapesjs-custom-code'
35
- import navbarPlugin from 'grapesjs-navbar'
36
35
  import uiSuggestClasses from '@silexlabs/grapesjs-ui-suggest-classes'
37
36
  import filterStyles from '@silexlabs/grapesjs-filter-styles'
38
37
  import symbolsPlugin from '@silexlabs/grapesjs-symbols'
@@ -101,7 +100,6 @@ const plugins = [
101
100
  {name: './resize-panel', value: resizePanelPlugin},
102
101
  {name: '@silexlabs/grapesjs-notifications', value: notificationsPlugin},
103
102
  {name: '@silexlabs/grapesjs-keymaps-dialog', value: keymapsDialogPlugin},
104
- {name: 'grapesjs-navbar', value:navbarPlugin}
105
103
  ]
106
104
  // Check that all plugins are loaded correctly
107
105
  plugins
@@ -360,11 +358,6 @@ export function getEditorConfig(config: ClientConfig): EditorConfig {
360
358
  longPressDuration: null,
361
359
  shortcut: 'shift+h',
362
360
  },
363
- [navbarPlugin.toString()]:{
364
- block:{
365
- category: 'Components'
366
- }
367
- }
368
361
  },
369
362
  }
370
363
  }
@@ -139,26 +139,26 @@ describe('publication-transformers', () => {
139
139
  })
140
140
 
141
141
  it('should transform a style rule with background image', () => {
142
- expect(transformBgImage(editor, { 'background-image': 'url(test.png)' })).toEqual({ 'background-image': 'url(test.png)' })
142
+ expect(transformBgImage(editor, { 'background-image': 'url(test.png)' })).toEqual({ 'background-image': 'url("test.png")' })
143
143
  const transformPermalink = transformer.transformPermalink as Mock
144
144
  const transformedSrc = 'transformed.png'
145
145
  const transformedSrc2 = 'transformed2.png'
146
146
  transformPermalink.mockImplementation((url, type) => (url as string).replace('test.png', transformedSrc).replace('test2.png', transformedSrc2))
147
- expect(transformBgImage(editor, { 'background-image': 'url(test.png)' })).toEqual({ 'background-image': `url(${transformedSrc})` })
148
- expect(transformBgImage(editor, { 'background-image': 'url("test.png")' })).toEqual({ 'background-image': `url(${transformedSrc})` })
147
+ expect(transformBgImage(editor, { 'background-image': 'url(test.png)' })).toEqual({ 'background-image': `url("${transformedSrc}")` })
148
+ expect(transformBgImage(editor, { 'background-image': 'url("test.png")' })).toEqual({ 'background-image': `url("${transformedSrc}")` })
149
149
  expect(transformBgImage(editor, {
150
150
  'background-image': 'linear-gradient(to right, rgb(30 75 115 / 100%), url(test.png), linear-gradient(to left, rgb(30 75 115 / 10%), url(test2.png), rgb(255 255 255 / 0%));',
151
151
  })).toEqual({
152
- 'background-image': `linear-gradient(to right, rgb(30 75 115 / 100%), url(${transformedSrc}), linear-gradient(to left, rgb(30 75 115 / 10%), url(${transformedSrc2}), rgb(255 255 255 / 0%));`,
152
+ 'background-image': `linear-gradient(to right, rgb(30 75 115 / 100%), url("${transformedSrc}"), linear-gradient(to left, rgb(30 75 115 / 10%), url("${transformedSrc2}"), rgb(255 255 255 / 0%));`,
153
153
  })
154
154
  })
155
155
 
156
156
  it('should transform permalinks of background images in inline css', () => {
157
157
  const el = document.createElement('div')
158
158
  const [comp] = editor.addComponents(el)
159
- comp.setStyle({ 'background-image': 'url(test.png)' })
159
+ comp.setStyle({ 'background-image': 'url("test.png")' })
160
160
  //editor.addComponents(`
161
- // <div style="color: black; background-image: url(test.png);"></div>
161
+ // <div style="color: black; background-image: url("test.png");"></div>
162
162
  //`)
163
163
  const transformPermalink = transformer.transformPermalink as Mock
164
164
  const transformedSrc = 'transformed.png'
@@ -168,7 +168,7 @@ describe('publication-transformers', () => {
168
168
  expect(transformPermalink).toBeCalledTimes(1)
169
169
  expect(transformPermalink.mock.calls[0][0]).toBe('test.png')
170
170
  expect(transformPermalink.mock.calls[0][1]).toBe('asset')
171
- expect(css).toContain('url(test.png)')
171
+ expect(css).toContain('url("test.png")')
172
172
  })
173
173
  it('should transform permalinks of background images in styles', () => {
174
174
  editor.addComponents(`
@@ -176,7 +176,7 @@ describe('publication-transformers', () => {
176
176
  `)
177
177
  editor.addStyle(`
178
178
  .test {
179
- background-image: url(test.png);
179
+ background-image: url("test.png");
180
180
  }
181
181
  `)
182
182
  const transformPermalink = transformer.transformPermalink as Mock
@@ -187,7 +187,7 @@ describe('publication-transformers', () => {
187
187
  expect(transformPermalink).toBeCalledTimes(1)
188
188
  expect(transformPermalink.mock.calls[0][0]).toBe('test.png')
189
189
  expect(transformPermalink.mock.calls[0][1]).toBe('asset')
190
- expect(css).toContain(`url(${transformedSrc})`)
190
+ expect(css).toContain(`url("${transformedSrc}")`)
191
191
  })
192
192
  it('should transform links to pages to match permalinks ', () => {
193
193
  editor.addComponents(`
@@ -188,7 +188,7 @@ function doTransformPermalink(editor: Editor, cssValue: string): string {
188
188
  // Transform URLs
189
189
  const newUrl = transformPermalink(editor, cleanUrl, ClientSideFileType.ASSET, Initiator.CSS)
190
190
  // Return the new URL with url keyword
191
- return `url(${newUrl})`
191
+ return `url("${newUrl}")`
192
192
  })
193
193
  }
194
194