@neovici/cosmoz-utils 5.37.1 → 5.39.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.
@@ -2,14 +2,14 @@ import { html, svg } from 'lit-html';
2
2
  import { ifDefined } from 'lit-html/directives/if-defined';
3
3
  import { component } from 'haunted';
4
4
  export const arrowDropDown = svg `<path d="M7 10l5 5 5-5z"></path>`, cancel = svg `<path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"></path>`, check = svg `<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"></path>`, clear = svg `<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path>`, warning = svg `<path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" fill="currentColor"></path>`, undo = svg `<path d="M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"></path>`, edit = svg `<path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path>`, rightArrow = svg `<path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" fill="currentColor"></path>`, leftArrow = svg `<path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" fill="currentColor"></path>`, download = svg `<path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z" fill="currentColor"></path>`, print = svg `<path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z" fill="currentColor"></path>`, renderIcon = ({ icon, width = 24, height } = {}) => html `<svg
5
- viewBox="0 0 24 24"
6
- preserveAspectRatio="xMidYMid meet"
7
- focusable="false"
8
- width=${width}
9
- height=${ifDefined(height)}
10
- >
11
- ${icon}
12
- </svg>`;
5
+ viewBox="0 0 24 24"
6
+ preserveAspectRatio="xMidYMid meet"
7
+ focusable="false"
8
+ width=${width}
9
+ height=${ifDefined(height)}
10
+ >
11
+ ${icon}
12
+ </svg>`;
13
13
  customElements.define('cz-icon', component(renderIcon, {
14
14
  observedAttributes: ['width', 'height'],
15
15
  }));
@@ -0,0 +1 @@
1
+ export declare const useAbortSignal: () => AbortSignal;
@@ -0,0 +1,9 @@
1
+ import { useEffect, useMemo } from 'haunted';
2
+ export const useAbortSignal = () => {
3
+ const { controller, signal } = useMemo(() => {
4
+ const controller = new AbortController(), signal = controller.signal;
5
+ return { controller, signal };
6
+ }, []);
7
+ useEffect(() => () => controller.abort(), []);
8
+ return signal;
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-utils",
3
- "version": "5.37.1",
3
+ "version": "5.39.0",
4
4
  "description": "Date, money and template management functions commonly needed in Cosmoz views.",
5
5
  "keywords": [
6
6
  "polymer",
@@ -74,16 +74,17 @@
74
74
  "haunted": "^5.0.0"
75
75
  },
76
76
  "devDependencies": {
77
- "@commitlint/cli": "^17.0.0",
78
- "@commitlint/config-conventional": "^17.0.0",
77
+ "@commitlint/cli": "^18.0.0",
78
+ "@commitlint/config-conventional": "^18.0.0",
79
79
  "@neovici/cfg": "^1.15.1",
80
80
  "@open-wc/testing": "^3.1.0",
81
81
  "@polymer/polymer": "^3.3.1",
82
82
  "@semantic-release/changelog": "^6.0.0",
83
83
  "@semantic-release/git": "^10.0.0",
84
+ "@types/mocha": "^10.0.3",
84
85
  "husky": "^8.0.0",
85
- "lit-html": "^2.0.0",
86
- "semantic-release": "^21.0.0",
87
- "sinon": "^15.0.0"
86
+ "lit-html": "^2.0.0 || ^3.0.0",
87
+ "semantic-release": "^22.0.0",
88
+ "sinon": "^17.0.0"
88
89
  }
89
90
  }