@zcomponent/html 1.3.3 → 1.4.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/README.md ADDED
@@ -0,0 +1 @@
1
+ # @zcomponent/html
package/index.js CHANGED
@@ -1,2 +1,4 @@
1
- /* eslint-disable node/no-unsupported-features/es-syntax */
1
+ /* eslint-disable n/no-unsupported-features/es-syntax */
2
+ /* eslint-disable n/no-missing-import */
3
+
2
4
  export * from './lib';
package/lib/CSS.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Component, isDesignTime, registerLoadable } from '@zcomponent/core';
2
+ import { HTMLContext } from './context';
2
3
  const alreadyAdded = new Map();
3
4
  /**
4
5
  * The CSS component will ensure that the CSS file referenced by its `source` constructor prop is added to your page and loaded by the browser.
@@ -20,7 +21,10 @@ export class CSS extends Component {
20
21
  else {
21
22
  this._elm = [1, document.createElement('link')];
22
23
  registerLoadable(contextManager, new Promise((resolve, reject) => {
23
- this._elm[1].addEventListener('load', resolve);
24
+ this._elm[1].addEventListener('load', () => {
25
+ contextManager.get(HTMLContext).onCSSChanged.emit();
26
+ resolve();
27
+ });
24
28
  this._elm[1].addEventListener('error', reject);
25
29
  }));
26
30
  this._elm[1].setAttribute('rel', 'stylesheet');
package/lib/context.d.ts CHANGED
@@ -2,6 +2,7 @@ import { Event, ContextManager, Context } from '@zcomponent/core';
2
2
  export declare class HTMLContext extends Context {
3
3
  onNodeConstructed: Event<[Node]>;
4
4
  onNodeDisposed: Event<[Node]>;
5
+ onCSSChanged: Event<[]>;
5
6
  }
6
7
  export declare function useOnNodeConstructed(mgr: ContextManager): Event<[Node]>;
7
8
  export declare function useOnNodeDisposed(mgr: ContextManager): Event<[Node]>;
package/lib/context.js CHANGED
@@ -4,6 +4,7 @@ export class HTMLContext extends Context {
4
4
  super(...arguments);
5
5
  this.onNodeConstructed = new Event();
6
6
  this.onNodeDisposed = new Event();
7
+ this.onCSSChanged = new Event();
7
8
  }
8
9
  }
9
10
  export function useOnNodeConstructed(mgr) {
package/package.json CHANGED
@@ -1,29 +1,76 @@
1
1
  {
2
2
  "name": "@zcomponent/html",
3
- "version": "1.3.3",
3
+ "version": "1.4.0",
4
4
  "description": "Mattercraft support for HTML",
5
+ "author": "Zappar Limited",
6
+ "license": "Proprietary",
5
7
  "main": "index.js",
6
8
  "types": "index.d.ts",
9
+ "zexports": [
10
+ "./lib/**/*"
11
+ ],
7
12
  "directories": {
8
13
  "lib": "lib"
9
14
  },
10
- "scripts": {
11
- "build": "tsc"
12
- },
13
15
  "files": [
14
16
  "index.js",
15
17
  "index.d.ts",
16
- "lib/**/*"
18
+ "lib/**/*",
19
+ "public/**/*"
17
20
  ],
18
- "author": "Zappar Limited",
19
- "license": "Proprietary",
20
- "dependencies": {
21
- "@zcomponent/core": "^1.4.0"
21
+ "scripts": {
22
+ "build": "rm -rf lib && tsc && tsc-alias",
23
+ "watch": "tsc -w",
24
+ "prepack": "npm run build",
25
+ "docs": "typedoc --out docs"
22
26
  },
27
+ "dependencies": {},
23
28
  "devDependencies": {
24
- "typescript": "^4.9.4"
29
+ "@zcomponent/core": "1.x"
25
30
  },
26
- "zexports": [
27
- "./lib/**/*"
28
- ]
31
+ "peerDependencies": {
32
+ "@zcomponent/core": "1.x"
33
+ },
34
+ "keywords": [],
35
+ "release": {
36
+ "extends": "semantic-release-commit-filter",
37
+ "ci": true,
38
+ "branches": [
39
+ "main",
40
+ {
41
+ "name": "beta",
42
+ "channel": "beta",
43
+ "prerelease": "beta"
44
+ },
45
+ {
46
+ "name": "alpha",
47
+ "channel": "alpha",
48
+ "prerelease": "alpha"
49
+ }
50
+ ],
51
+ "plugins": [
52
+ "@semantic-release/commit-analyzer",
53
+ "@semantic-release/release-notes-generator",
54
+ "@semantic-release/changelog",
55
+ "@semantic-release/npm",
56
+ "@semantic-release/gitlab",
57
+ "@semantic-release/git",
58
+ [
59
+ "@rimac-technology/semantic-release-s3",
60
+ {
61
+ "s3Bucket": {
62
+ "main": "mattercraft-api-docs/prod",
63
+ "beta": "mattercraft-api-docs/beta",
64
+ "alpha": "mattercraft-api-docs/alpha"
65
+ },
66
+ "directoryPath": "../../docs/**/*",
67
+ "objectACL": "",
68
+ "removeDirectoryRoot": true,
69
+ "awsAccessKeyName": "DOCS_AWS_ACCESS_KEY_ID",
70
+ "awsSecretAccessKeyName": "DOCS_AWS_SECRET_ACCESS_KEY"
71
+ }
72
+ ]
73
+ ],
74
+ "tagFormat": "@zcomponent/html@${version}"
75
+ }
29
76
  }