cloudcannon-jekyll-bookshop 2.0.10.pre.editorlinks.3 → 2.0.10.pre.hugobeta.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c3bbe8dbf6837d605f47be6d9e81347ab25347821bc5abd402d764d68b96b19
4
- data.tar.gz: a5d5229b1d4cd0dd02765ff19ec9453adab66a7fe65ab9176802609bb7b9d917
3
+ metadata.gz: 64d472430da625172e55306c97a5cdfae05f84ba06f0129cbc92dd6ed2ee8a6e
4
+ data.tar.gz: dc333b15d089a43714ce47d190f455545235c43f348c056beeaf04c7757f78be
5
5
  SHA512:
6
- metadata.gz: d5813d76f314d14f0d0cb4d803df6a1369edb059e09f4eca8bba50a026ce5b3578f88eb85df67a0f40f4bf391dd2728afac3c20598d53577b8efbbd6b5fb8c9d
7
- data.tar.gz: d0002b02576eeef4e44dbf84b9361ac35d6ab349be4c3193b2b531a5fa4b5a2dacf67061120a3b05e024ea2d09023e9b0bc5dc591ed0bd9b482adb9e0c33e60d
6
+ metadata.gz: b2fa29f3aac6f2bb778e82c538b6e8ab48332f36eddca682bba06fb35c5b5ba0f7c1724ffbebe9b80701fec2b499bf2411de8fef743fcc8be57ae5b3dbc55d63
7
+ data.tar.gz: 9481e60d77ea4865f439678a761afc7690cff034a206c56a6c8c75351d1433944b844f4a85cfeb4ee7ee898b8005b2f43fd9f34404a559bdb55f76a973ac3f8c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cloudcannon-jekyll-bookshop (2.0.10.pre.editorlinks.3)
4
+ cloudcannon-jekyll-bookshop (2.0.10.pre.hugobeta.0)
5
5
  dry-inflector (>= 0.1, < 1.0)
6
6
  jekyll (>= 3.7, < 5.0)
7
7
  node-runner-temp-fix-windows (>= 1.0, < 2.0)
@@ -11,10 +11,8 @@ module CloudCannonJekyllBookshop
11
11
  site = context.registers[:site]
12
12
 
13
13
  "<script>
14
- (function(){
15
- const bookshopLiveSetup = (CloudCannon) => {
16
- CloudCannon.enableEvents();
17
-
14
+ window.addEventListener('load', function() {
15
+ if (window.inEditorMode) {
18
16
  const head = document.querySelector('head');
19
17
  const script = document.createElement('script');
20
18
  script.src = `/#{@script}`;
@@ -22,22 +20,16 @@ module CloudCannonJekyllBookshop
22
20
  window.bookshopLive = new window.BookshopLive({
23
21
  remoteGlobals: ['/_cloudcannon/bookshop-site-data.json']
24
22
  });
25
- const updateBookshopLive = async () => {
26
- const frontMatter = await CloudCannon.value();
27
- const options = window.bookshopLiveOptions || {};
28
- await window.bookshopLive.update({page: frontMatter}, options);
29
- CloudCannon?.refreshInterface();
23
+ window.CloudCannon = {
24
+ trigger: function (eventName, frontMatter) {
25
+ if (typeof frontMatter === 'string') frontMatter = JSON.parse(frontMatter);
26
+ window.bookshopLive.update({page: frontMatter});
27
+ }
30
28
  }
31
- document.addEventListener('cloudcannon:update', updateBookshopLive);
32
- updateBookshopLive();
33
29
  }
34
30
  head.appendChild(script);
35
31
  }
36
-
37
- document.addEventListener('cloudcannon:load', function (e) {
38
- bookshopLiveSetup(e.detail.CloudCannon);
39
- });
40
- })();
32
+ });
41
33
  </script>"
42
34
  end
43
35
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudCannonJekyllBookshop
4
- VERSION = "2.0.10.pre.editorlinks.3"
4
+ VERSION = "2.0.10.pre.hugobeta.0"
5
5
  end
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bookshop/cloudcannon-structures",
3
3
  "packageManager": "yarn@3.0.0",
4
- "version": "2.0.10-editorlinks.3",
4
+ "version": "2.0.10-hugobeta.0",
5
5
  "description": "Convert a Bookshop object into a CloudCannon structure",
6
6
  "main": "main.js",
7
7
  "scripts": {
@@ -17,7 +17,7 @@
17
17
  "access": "public"
18
18
  },
19
19
  "devDependencies": {
20
- "@bookshop/toml-narrator": "2.0.10-editorlinks.3",
20
+ "@bookshop/toml-narrator": "2.0.10-hugobeta.0",
21
21
  "@ltd/j-toml": "^1.17.0",
22
22
  "ava": "^3.15.0",
23
23
  "nyc": "^15.1.0",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bookshop/toml-narrator",
3
3
  "packageManager": "yarn@3.0.0",
4
- "version": "2.0.10-editorlinks.3",
4
+ "version": "2.0.10-hugobeta.0",
5
5
  "description": "Rewrite Bookshop TOML files to preserve comments",
6
6
  "main": "main.js",
7
7
  "scripts": {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudcannon-jekyll-bookshop
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.10.pre.editorlinks.3
4
+ version: 2.0.10.pre.hugobeta.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liam Bigelow
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-04 00:00:00.000000000 Z
11
+ date: 2021-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll