@muonic/muon 0.0.2-experimental-186-333208e.0 → 0.0.2-experimental-188-d0239e8.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.
package/css/global.css CHANGED
@@ -3,23 +3,33 @@
3
3
  /**
4
4
  * [1] Apply a natural box layout model to all elements
5
5
  */
6
- html {
7
- box-sizing: border-box; /* [1] */
8
- }
6
+ *,
7
+ *::before,
8
+ *::after {
9
+ box-sizing: border-box; /* [1] */
10
+ }
9
11
 
10
- *,
11
- *::before,
12
- *::after {
13
- box-sizing: inherit; /* [1] */
14
- }
12
+ /**
13
+ * [1] Remove the user agent margin
14
+ * [2] Default font family and base size
15
+ * [3] Disallow any content to overflow the width
16
+ * [4] TODO: Tokenise the global line-height
17
+ * [5] TODO: Investigate this property as it may not be necessary
18
+ */
19
+ body {
20
+ margin: 0; /* [1] */
21
+ font-family: $THEME_FONT_FAMILY_DEFAULT; /* [2] */
22
+ font-size: 16px; /* [2] */
23
+ overflow-x: hidden; /* [3] */
24
+ line-height: 1.5; /* [4] */
25
+ min-height: 100vh; /* [5] */
26
+ }
15
27
 
16
- body {
17
- margin: 0;
18
- font-family: $THEME_FONT_FAMILY_DEFAULT;
19
- font-size: 16px;
20
- overflow-x: hidden;
21
- line-height: 1.5;
22
- min-height: 100vh;
23
- }
28
+ /**
29
+ * [1] Reset the user agent margin to 0 for figure
30
+ */
31
+ figure {
32
+ margin: 0; /* [1] */
33
+ }
24
34
 
25
- /* global.css END */
35
+ /* global.css END */
@@ -1,4 +1,7 @@
1
1
  import { AsyncDirective, directive, html, unsafeSVG, until } from '@muonic/muon';
2
+ import {
3
+ SVG_CONFIG_CACHE
4
+ } from '@muon/tokens';
2
5
 
3
6
  export class SVGLoaderDirective extends AsyncDirective {
4
7
  constructor(partInfo) {
@@ -20,7 +23,7 @@ export class SVGLoaderDirective extends AsyncDirective {
20
23
 
21
24
  try {
22
25
  cacheAvailable = 'caches' in self;
23
- cache = cacheAvailable && await caches?.open('muon');
26
+ cache = cacheAvailable && await caches?.open(SVG_CONFIG_CACHE);
24
27
  const cacheData = await cache.match(url);
25
28
 
26
29
  response = cache && cacheData ? cacheData : undefined;
@@ -30,10 +33,9 @@ export class SVGLoaderDirective extends AsyncDirective {
30
33
  }
31
34
 
32
35
  if (!response) {
33
- response = await window.fetch(url);
34
-
35
- response = new Response(response.body, response);
36
- response.headers.append('Cache-Control', 'max-age=100000');
36
+ response = await window.fetch(url, {
37
+ cache: 'no-store'
38
+ });
37
39
 
38
40
  if (cache && response.body) {
39
41
  cache.put(url, response.clone())
@@ -0,0 +1,9 @@
1
+ {
2
+ "svg": {
3
+ "config": {
4
+ "cache": {
5
+ "value": "muon"
6
+ }
7
+ }
8
+ }
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muonic/muon",
3
- "version": "0.0.2-experimental-186-333208e.0",
3
+ "version": "0.0.2-experimental-188-d0239e8.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,7 +9,7 @@ const root = path.join(__filename, '..', '..');
9
9
  const buildPath = path.join(root, 'build', 'tokens');
10
10
 
11
11
  export default {
12
- include: [root + '/tokens/**/*.js', root + '/tokens/**/*.json', root + '/tokens/*.json', root + '/components/**/**/config-tokens.json', root + '/components/**/**/design-tokens.json'],
12
+ include: [root + '/tokens/**/*.js', root + '/tokens/**/*.json', root + '/tokens/*.json', root + '/components/**/**/config-tokens.json', root + '/components/**/**/design-tokens.json', root + '/directives/tokens.json'],
13
13
  platforms: {
14
14
  js: {
15
15
  buildPath: path.join(buildPath, 'es6/'),