@pageboard/html 0.12.35 → 0.12.37

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.
@@ -23,7 +23,7 @@ exports.consent_form = {
23
23
  <template block-content="content"></template>
24
24
  <div class="view"></div>
25
25
  </form>`,
26
- scripts: ['../ui/storage.js', '../ui/consent.js'],
26
+ scripts: ['../ui/consent.js'],
27
27
  stylesheets: ['../ui/consent.css']
28
28
  };
29
29
 
package/elements/embed.js CHANGED
@@ -30,6 +30,15 @@ exports.embed = {
30
30
  title: 'Additional query parameters',
31
31
  type: 'object',
32
32
  nullable: true
33
+ },
34
+ ratio: {
35
+ title: 'Default height/width',
36
+ description: 'Inverse of ratio in percents',
37
+ type: 'number',
38
+ minimum: 10,
39
+ maximum: 500,
40
+ multipleOf: 0.01,
41
+ nullable: true
33
42
  }
34
43
  },
35
44
  group: "block",
@@ -40,7 +49,7 @@ exports.embed = {
40
49
  };
41
50
  },
42
51
  tag: 'iframe,element-embed',
43
- html: `<element-embed data-src="[url]" data-query="[query|as:query]" id="[id]">
52
+ html: `<element-embed data-src="[url]" data-query="[query|as:query]" id="[id]" style-padding-bottom="[ratio|fail:]%">
44
53
  <a aria-hidden="true" class="linkable" href="[$loc.pathname][$loc.search][id|pre:%23]">[linkable|prune:*]#</a>
45
54
  <iframe loading="lazy" allowfullscreen frameborder="0" scrolling="no"></iframe>
46
55
  </element-embed>`,
@@ -0,0 +1,5 @@
1
+ exports.storage = {
2
+ priority: -1,
3
+ group: "block",
4
+ scripts: ['../ui/storage.js']
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.12.35",
3
+ "version": "0.12.37",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
package/ui/storage.js CHANGED
@@ -4,14 +4,14 @@ class UserStore {
4
4
  return this.#store;
5
5
  }
6
6
  get(key) {
7
- try {
7
+ try {
8
8
  return this.#store.getItem(key);
9
9
  } catch (ex) {
10
10
  console.error(ex);
11
- }
11
+ }
12
12
  }
13
13
  set(key, val) {
14
- try {
14
+ try {
15
15
  if (val == null) return this.del(key);
16
16
  else return this.#store.setItem(key, val);
17
17
  } catch (ex) {
@@ -19,7 +19,7 @@ class UserStore {
19
19
  }
20
20
  }
21
21
  del(key) {
22
- try {
22
+ try {
23
23
  return this.#store.removeItem(key);
24
24
  } catch (ex) {
25
25
  console.error(ex);