ag-common 0.0.447 → 0.0.449
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/dist/ui/components/HeadersRaw/index.d.ts +25 -4
- package/dist/ui/components/HeadersRaw/index.js +32 -7
- package/dist/ui/components/Icon/index.js +1 -1
- package/dist/ui/components/TreeChart/base.d.ts +3 -0
- package/dist/ui/components/TreeChart/base.js +105 -0
- package/dist/ui/components/TreeChart/helpers.d.ts +14 -0
- package/dist/ui/components/TreeChart/helpers.js +49 -0
- package/dist/ui/components/TreeChart/index.d.ts +2 -0
- package/dist/ui/components/TreeChart/index.js +18 -0
- package/dist/ui/components/TreeChart/types.d.ts +21 -0
- package/dist/ui/components/TreeChart/types.js +2 -0
- package/dist/ui/components/index.d.ts +1 -0
- package/dist/ui/components/index.js +1 -0
- package/dist/ui/helpers/useInterval.d.ts +7 -4
- package/dist/ui/helpers/useInterval.js +12 -6
- package/dist/ui/styles/common.d.ts +6 -2
- package/dist/ui/styles/common.js +19 -7
- package/package.json +1 -1
|
@@ -3,8 +3,29 @@ export interface IHeadersRaw {
|
|
|
3
3
|
title?: string;
|
|
4
4
|
image?: string;
|
|
5
5
|
description?: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/** eg https://abc.def */
|
|
7
|
+
siteUrl: string;
|
|
8
|
+
/** eg 'a site to remember' */
|
|
9
|
+
tagline: string;
|
|
10
|
+
/** csv or separate keyword strings */
|
|
11
|
+
keywords: string | string[];
|
|
9
12
|
}
|
|
10
|
-
export declare const HeadersRaw: ({ title, image,
|
|
13
|
+
export declare const HeadersRaw: ({ title, image, siteUrl, tagline, keywords, }: IHeadersRaw) => React.JSX.Element[];
|
|
14
|
+
export declare const HeadersRawNext: ({ title, image, siteUrl, tagline, description, keywords, }: IHeadersRaw) => {
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
keywords: string | string[];
|
|
18
|
+
openGraph: {
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
siteName: string;
|
|
22
|
+
url: string;
|
|
23
|
+
images: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
twitter: {
|
|
26
|
+
title: string;
|
|
27
|
+
description: string;
|
|
28
|
+
card: string;
|
|
29
|
+
images: string | undefined;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -3,10 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HeadersRaw = void 0;
|
|
6
|
+
exports.HeadersRawNext = exports.HeadersRaw = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const HeadersRaw = ({ title, image,
|
|
9
|
-
const
|
|
8
|
+
const HeadersRaw = ({ title, image, siteUrl, tagline, keywords, }) => {
|
|
9
|
+
const { origin, hostname } = new URL(siteUrl);
|
|
10
|
+
const fullTitle = `${title ? `${title} | ` : ''}${hostname} | ${tagline}`;
|
|
10
11
|
const titleFallback = title || fullTitle;
|
|
11
12
|
const titleBlock = [
|
|
12
13
|
react_1.default.createElement("title", { key: "1" }, fullTitle),
|
|
@@ -27,14 +28,38 @@ const HeadersRaw = ({ title, image, SiteShort, FullSiteUrl, siteDesc, }) => {
|
|
|
27
28
|
return [
|
|
28
29
|
react_1.default.createElement("meta", { key: "11", charSet: "utf-8" }),
|
|
29
30
|
...titleBlock,
|
|
30
|
-
react_1.default.createElement("meta", { key: "12", property: "og:site_name", content:
|
|
31
|
-
react_1.default.createElement("meta", { key: "13", property: "og:url", content:
|
|
32
|
-
react_1.default.createElement("meta", { key: "14", itemProp: "url", content:
|
|
33
|
-
react_1.default.createElement("meta", { key: "15", name: "twitter:url", content:
|
|
31
|
+
react_1.default.createElement("meta", { key: "12", property: "og:site_name", content: hostname }),
|
|
32
|
+
react_1.default.createElement("meta", { key: "13", property: "og:url", content: origin }),
|
|
33
|
+
react_1.default.createElement("meta", { key: "14", itemProp: "url", content: origin }),
|
|
34
|
+
react_1.default.createElement("meta", { key: "15", name: "twitter:url", content: origin }),
|
|
34
35
|
react_1.default.createElement("meta", { key: "16", property: "og:type", content: "website" }),
|
|
35
36
|
react_1.default.createElement("meta", { key: "17", name: "twitter:card", content: "summary_large_image" }),
|
|
36
37
|
react_1.default.createElement("meta", { key: "18", name: "robots", content: "index, follow" }),
|
|
38
|
+
react_1.default.createElement("meta", { key: "19", name: "keywords", content: Array.isArray(keywords) ? keywords.join(', ') : keywords }),
|
|
37
39
|
...imagearr,
|
|
38
40
|
];
|
|
39
41
|
};
|
|
40
42
|
exports.HeadersRaw = HeadersRaw;
|
|
43
|
+
const HeadersRawNext = ({ title, image, siteUrl, tagline, description, keywords, }) => {
|
|
44
|
+
const { origin, hostname } = new URL(siteUrl);
|
|
45
|
+
const fullTitle = `${title ? `${title} | ` : ''}${hostname} | ${tagline}`;
|
|
46
|
+
return {
|
|
47
|
+
title: fullTitle,
|
|
48
|
+
description: description || fullTitle,
|
|
49
|
+
keywords,
|
|
50
|
+
openGraph: {
|
|
51
|
+
title: fullTitle,
|
|
52
|
+
description: description || fullTitle,
|
|
53
|
+
siteName: hostname,
|
|
54
|
+
url: origin,
|
|
55
|
+
images: image,
|
|
56
|
+
},
|
|
57
|
+
twitter: {
|
|
58
|
+
title: fullTitle,
|
|
59
|
+
description: description || fullTitle,
|
|
60
|
+
card: 'summary_large_image',
|
|
61
|
+
images: image,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
exports.HeadersRawNext = HeadersRawNext;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.TreeChart = void 0;
|
|
30
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
31
|
+
const react_1 = __importStar(require("react"));
|
|
32
|
+
const useResize_1 = require("../../helpers/useResize");
|
|
33
|
+
const styles_1 = require("../../styles");
|
|
34
|
+
const common_1 = require("../../styles/common");
|
|
35
|
+
const helpers_1 = require("./helpers");
|
|
36
|
+
const Base = styled_1.default.div `
|
|
37
|
+
border: solid 1px #ccc;
|
|
38
|
+
margin-top: 0.5rem;
|
|
39
|
+
margin-bottom: 0.5rem;
|
|
40
|
+
`;
|
|
41
|
+
const NodeChildren = styled_1.default.div `
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-flow: row wrap;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
`;
|
|
46
|
+
const Node = styled_1.default.div `
|
|
47
|
+
margin: 1px;
|
|
48
|
+
padding: 2px;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-flow: column;
|
|
51
|
+
height: min-content;
|
|
52
|
+
`;
|
|
53
|
+
const Title = styled_1.default.div `
|
|
54
|
+
color: white;
|
|
55
|
+
word-break: break-all;
|
|
56
|
+
${(0, common_1.HardOutline)('black')};
|
|
57
|
+
${(0, common_1.TextOverflowEllipsis)(1)};
|
|
58
|
+
min-height: 1rem;
|
|
59
|
+
line-height: 1rem;
|
|
60
|
+
`;
|
|
61
|
+
const render = ({ n, depth, head, headDim, tnd, }) => {
|
|
62
|
+
var _a;
|
|
63
|
+
let width = 0;
|
|
64
|
+
let height = 0;
|
|
65
|
+
const leaf = n.children.length === 0;
|
|
66
|
+
const sizeMult = n.size / head.size;
|
|
67
|
+
width = Math.floor(headDim.width * sizeMult) - 6; //6 = padding+margins
|
|
68
|
+
if (n.children.length === 0) {
|
|
69
|
+
height = Math.floor(headDim.height * sizeMult);
|
|
70
|
+
}
|
|
71
|
+
const title = ((_a = tnd.titleFn) === null || _a === void 0 ? void 0 : _a.call(tnd, {
|
|
72
|
+
path: n.name,
|
|
73
|
+
pathCount: n.size,
|
|
74
|
+
fullCount: head.size,
|
|
75
|
+
})) || `${n.name} (${n.size}/${head.size})`;
|
|
76
|
+
return (react_1.default.createElement(Node, { "data-treenode": true, style: Object.assign({ backgroundColor: (0, styles_1.getColourWheel)(depth) }, (leaf && {
|
|
77
|
+
width: width ? width + 'px' : '100%',
|
|
78
|
+
height: height ? height + 'px' : '100%',
|
|
79
|
+
})), key: n.name, "data-ch": n.children.length, "data-size": n.size, title: title },
|
|
80
|
+
n.name && react_1.default.createElement(Title, null, n.name),
|
|
81
|
+
react_1.default.createElement(NodeChildren, { "data-type": "nc" }, n.children.map((c) => render({ n: c, depth: depth + 1, head, headDim, tnd })))));
|
|
82
|
+
};
|
|
83
|
+
const TreeChart = (tnd) => {
|
|
84
|
+
const raw = (0, helpers_1.convertToRaw)({ tnd });
|
|
85
|
+
const head = (0, helpers_1.toArray)('', raw);
|
|
86
|
+
const pd = (0, useResize_1.useResize)();
|
|
87
|
+
const [headDim, setHeadDim] = (0, react_1.useState)();
|
|
88
|
+
const r = (0, react_1.useRef)(null);
|
|
89
|
+
(0, react_1.useEffect)(() => {
|
|
90
|
+
if (!r.current) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const width = r.current.clientWidth;
|
|
94
|
+
const height = r.current.clientHeight || r.current.clientWidth;
|
|
95
|
+
setHeadDim({
|
|
96
|
+
width,
|
|
97
|
+
height,
|
|
98
|
+
});
|
|
99
|
+
}, [pd]);
|
|
100
|
+
if (head.size === 0) {
|
|
101
|
+
return react_1.default.createElement("div", null);
|
|
102
|
+
}
|
|
103
|
+
return (react_1.default.createElement(Base, { ref: r }, headDim && render({ tnd, n: head, depth: 0, head, headDim })));
|
|
104
|
+
};
|
|
105
|
+
exports.TreeChart = TreeChart;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TreeNodeData, TreeNodeOut } from './types';
|
|
2
|
+
interface TreeNodeRaw {
|
|
3
|
+
name: string;
|
|
4
|
+
size: number;
|
|
5
|
+
depth: number;
|
|
6
|
+
children: {
|
|
7
|
+
[P in string]: TreeNodeRaw;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare const convertToRaw: ({ tnd: { data, pathDelimiter }, }: {
|
|
11
|
+
tnd: TreeNodeData;
|
|
12
|
+
}) => TreeNodeRaw;
|
|
13
|
+
export declare const toArray: (name: string, raw: TreeNodeRaw) => TreeNodeOut;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toArray = exports.convertToRaw = void 0;
|
|
4
|
+
const convertToRaw = ({ tnd: { data, pathDelimiter }, }) => {
|
|
5
|
+
if (!data || data.length === 0) {
|
|
6
|
+
return { children: {}, size: 0, name: '', depth: 0 };
|
|
7
|
+
}
|
|
8
|
+
const dm = { size: 0, children: {}, name: '', depth: 0 };
|
|
9
|
+
data.forEach((line) => {
|
|
10
|
+
const names = line.path.split(pathDelimiter || '/');
|
|
11
|
+
let node = dm;
|
|
12
|
+
let a = 0;
|
|
13
|
+
do {
|
|
14
|
+
node.size += line.size;
|
|
15
|
+
if (names[a] === undefined) {
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
if (!node.children[names[a]]) {
|
|
19
|
+
node.children[names[a]] = {
|
|
20
|
+
children: {},
|
|
21
|
+
size: 0,
|
|
22
|
+
name: names[a],
|
|
23
|
+
depth: a,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
node = node.children[names[a]];
|
|
27
|
+
a += 1;
|
|
28
|
+
} while (node);
|
|
29
|
+
});
|
|
30
|
+
return dm;
|
|
31
|
+
};
|
|
32
|
+
exports.convertToRaw = convertToRaw;
|
|
33
|
+
const toArrayAux = (name, n) => ({
|
|
34
|
+
name,
|
|
35
|
+
size: n.size,
|
|
36
|
+
depth: n.depth,
|
|
37
|
+
children: Object.entries(n.children).map(([cn, cv]) => toArrayAux(cn, cv)),
|
|
38
|
+
});
|
|
39
|
+
const toArray = (name, raw) => {
|
|
40
|
+
const arr = toArrayAux(name, {
|
|
41
|
+
children: raw.children,
|
|
42
|
+
size: 0,
|
|
43
|
+
name: '',
|
|
44
|
+
depth: 0,
|
|
45
|
+
});
|
|
46
|
+
arr.size = arr.children.map((d) => d.size).reduce((a, b) => a + b, 0);
|
|
47
|
+
return arr;
|
|
48
|
+
};
|
|
49
|
+
exports.toArray = toArray;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./base"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface TreeNodeOut {
|
|
2
|
+
name: string;
|
|
3
|
+
size: number;
|
|
4
|
+
depth: number;
|
|
5
|
+
children: TreeNodeOut[];
|
|
6
|
+
}
|
|
7
|
+
export interface TreeNodeData {
|
|
8
|
+
data: {
|
|
9
|
+
path: string;
|
|
10
|
+
/** count of this path. default 1 */
|
|
11
|
+
size: number;
|
|
12
|
+
}[];
|
|
13
|
+
/** split paths by this delim. default= / */
|
|
14
|
+
pathDelimiter?: string;
|
|
15
|
+
/** get the hover title for the node. has sensible default */
|
|
16
|
+
titleFn?: (p: {
|
|
17
|
+
path: string;
|
|
18
|
+
pathCount: number;
|
|
19
|
+
fullCount: number;
|
|
20
|
+
}) => string;
|
|
21
|
+
}
|
|
@@ -43,4 +43,5 @@ __exportStar(require("./TextEdit"), exports);
|
|
|
43
43
|
__exportStar(require("./TextWithButton"), exports);
|
|
44
44
|
__exportStar(require("./TimelineChart"), exports);
|
|
45
45
|
__exportStar(require("./Toast"), exports);
|
|
46
|
+
__exportStar(require("./TreeChart"), exports);
|
|
46
47
|
__exportStar(require("./UserImage"), exports);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
export declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
3
3
|
export default useIsomorphicLayoutEffect;
|
|
4
|
-
export declare function useInterval(callback: () =>
|
|
4
|
+
export declare function useInterval<T>(callback: () => T,
|
|
5
5
|
/** ms delay */
|
|
6
|
-
delay: number | null,
|
|
7
|
-
/**
|
|
8
|
-
|
|
6
|
+
delay: number | null, opt?: {
|
|
7
|
+
/** called when cleaning up useEffect */
|
|
8
|
+
onEnd?: () => void;
|
|
9
|
+
/** will be passed result of callback, and can cancel interval if passed */
|
|
10
|
+
determineEnd?: (v: T) => boolean;
|
|
11
|
+
}): void;
|
|
@@ -6,9 +6,7 @@ exports.useIsomorphicLayoutEffect = typeof window !== 'undefined' ? react_1.useL
|
|
|
6
6
|
exports.default = exports.useIsomorphicLayoutEffect;
|
|
7
7
|
function useInterval(callback,
|
|
8
8
|
/** ms delay */
|
|
9
|
-
delay,
|
|
10
|
-
/** optionally called on return of useEffect */
|
|
11
|
-
clear) {
|
|
9
|
+
delay, opt) {
|
|
12
10
|
const savedCallback = (0, react_1.useRef)(callback);
|
|
13
11
|
(0, exports.useIsomorphicLayoutEffect)(() => {
|
|
14
12
|
savedCallback.current = callback;
|
|
@@ -17,11 +15,19 @@ clear) {
|
|
|
17
15
|
if (!delay && delay !== 0) {
|
|
18
16
|
return;
|
|
19
17
|
}
|
|
20
|
-
const id = setInterval(() =>
|
|
18
|
+
const id = setInterval(() => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
const res = savedCallback.current();
|
|
21
|
+
if ((_a = opt === null || opt === void 0 ? void 0 : opt.determineEnd) === null || _a === void 0 ? void 0 : _a.call(opt, res)) {
|
|
22
|
+
clearInterval(id);
|
|
23
|
+
(_b = opt === null || opt === void 0 ? void 0 : opt.onEnd) === null || _b === void 0 ? void 0 : _b.call(opt);
|
|
24
|
+
}
|
|
25
|
+
}, delay);
|
|
21
26
|
return () => {
|
|
27
|
+
var _a;
|
|
22
28
|
clearInterval(id);
|
|
23
|
-
|
|
29
|
+
(_a = opt === null || opt === void 0 ? void 0 : opt.onEnd) === null || _a === void 0 ? void 0 : _a.call(opt);
|
|
24
30
|
};
|
|
25
|
-
}, [
|
|
31
|
+
}, [opt, delay]);
|
|
26
32
|
}
|
|
27
33
|
exports.useInterval = useInterval;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
/** function that returns css that gives a text outline drop shadow.
|
|
3
|
+
* outlinecolour default='white'
|
|
4
|
+
* size default = 1px
|
|
5
|
+
*/
|
|
6
|
+
export declare const HardOutline: (outlineColour?: string, size?: number) => import("@emotion/react").SerializedStyles;
|
|
3
7
|
export declare const NoTextSelect: import("@emotion/react").SerializedStyles;
|
|
4
|
-
export declare const TextOverflowEllipsis: import("@emotion/react").SerializedStyles;
|
|
8
|
+
export declare const TextOverflowEllipsis: (lines: number) => import("@emotion/react").SerializedStyles;
|
|
5
9
|
export declare const CssTransparentBlock: import("@emotion/react").SerializedStyles;
|
|
6
10
|
export declare const FadeBottom: ({ height }: {
|
|
7
11
|
height: string;
|
package/dist/ui/styles/common.js
CHANGED
|
@@ -7,12 +7,20 @@ exports.bounce = exports.FullScreenPage = exports.noDrag = exports.Card = export
|
|
|
7
7
|
const react_1 = require("@emotion/react");
|
|
8
8
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
9
9
|
const colours_1 = require("./colours");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
`;
|
|
10
|
+
/** function that returns css that gives a text outline drop shadow.
|
|
11
|
+
* outlinecolour default='white'
|
|
12
|
+
* size default = 1px
|
|
13
|
+
*/
|
|
14
|
+
const HardOutline = (outlineColour = 'white', size = 1) => {
|
|
15
|
+
const px = `${size}px`;
|
|
16
|
+
return (0, react_1.css) `
|
|
17
|
+
filter: drop-shadow(${px} ${px} 0px ${outlineColour})
|
|
18
|
+
drop-shadow(-${px} ${px} 0px ${outlineColour})
|
|
19
|
+
drop-shadow(${px} -${px} 0px ${outlineColour})
|
|
20
|
+
drop-shadow(-${px} -${px} 0px ${outlineColour});
|
|
21
|
+
`;
|
|
22
|
+
};
|
|
23
|
+
exports.HardOutline = HardOutline;
|
|
16
24
|
exports.NoTextSelect = (0, react_1.css) `
|
|
17
25
|
user-select: none; /* supported by Chrome and Opera */
|
|
18
26
|
-webkit-user-select: none; /* Safari */
|
|
@@ -20,10 +28,14 @@ exports.NoTextSelect = (0, react_1.css) `
|
|
|
20
28
|
-moz-user-select: none; /* Firefox */
|
|
21
29
|
-ms-user-select: none; /* Internet Explorer/Edge */
|
|
22
30
|
`;
|
|
23
|
-
|
|
31
|
+
const TextOverflowEllipsis = (lines) => (0, react_1.css) `
|
|
32
|
+
display: -webkit-box;
|
|
33
|
+
-webkit-line-clamp: ${lines};
|
|
34
|
+
-webkit-box-orient: vertical;
|
|
24
35
|
overflow: hidden;
|
|
25
36
|
text-overflow: ellipsis;
|
|
26
37
|
`;
|
|
38
|
+
exports.TextOverflowEllipsis = TextOverflowEllipsis;
|
|
27
39
|
exports.CssTransparentBlock = (0, react_1.css) `
|
|
28
40
|
background-color: rgba(150, 150, 150, 0.5);
|
|
29
41
|
border-radius: 3px;
|
package/package.json
CHANGED