diff --git a/package.json b/package.json index f511870..9f2a5a1 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ }, "dependencies": { "@humanwhocodes/retry": "^0.3.0", - "@silexlabs/grapesjs-data-source": "^0.0.115", + "@silexlabs/grapesjs-data-source": "^0.0.117", "dedent": "^1.5.3", "deepmerge": "^4.3.1" }, diff --git a/src/client.ts b/src/client.ts index ad44cff..c9c2fbc 100644 --- a/src/client.ts +++ b/src/client.ts @@ -122,6 +122,7 @@ export default function (config: ClientConfig, options: Partial<EleventyPluginOp // Merge the initial config with GrapesJs config // Returns the new config config.grapesJsConfig = grapesJsConfig + // Add styles on the editor to override the default colors document.head.insertAdjacentHTML('beforeend', `<style> :root { diff --git a/src/client/DataSource.ts b/src/client/DataSource.ts index cc0c4bf..6f5c99e 100644 --- a/src/client/DataSource.ts +++ b/src/client/DataSource.ts @@ -10,7 +10,9 @@ export default function(config: ClientConfig, opts: EleventyPluginOptions): void throw new Error('No DataSourceManager found, did you forget to add the DataSource plugin?') } if(opts.enable11ty) { - const eleventyDs = dm.add(new EleventyDataSource(), {merge: false}) + // Add the 11ty data source + // Use silent: true to avoid triggering a save + const eleventyDs = dm.add(new EleventyDataSource(), {merge: false, silent: true}) // FIXME: Workaround: the added instance is not a Backbone model eleventyDs.isConnected = eleventyDs.get('isConnected') eleventyDs.getQuery = eleventyDs.get('getQuery') @@ -20,7 +22,8 @@ export default function(config: ClientConfig, opts: EleventyPluginOptions): void eleventyDs.id = eleventyDs.get('id') eleventyDs.cid = eleventyDs.get('cid') eleventyDs.hidden = eleventyDs.get('hidden') - eleventyDs.set('url', '') + eleventyDs.attributes.url = '' + // No, this triggers a save: eleventyDs.set('url', '') } }) }