@konomi-app/ui 2.1.0 → 2.2.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/dist/overlay/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { appendStyle } from './style';
|
|
2
2
|
export class Overlay {
|
|
3
3
|
_root;
|
|
4
4
|
_shown;
|
|
@@ -6,10 +6,10 @@ export class Overlay {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
this._shown = false;
|
|
8
8
|
this._disableBeforeUnload = false;
|
|
9
|
+
appendStyle();
|
|
9
10
|
const root = document.createElement('div');
|
|
10
11
|
this._root = root;
|
|
11
|
-
this._root.
|
|
12
|
-
document.body.classList.add(bodyStyle);
|
|
12
|
+
this._root.dataset.konomiUiOverlay = '';
|
|
13
13
|
document.body.append(root);
|
|
14
14
|
}
|
|
15
15
|
show() {
|
|
@@ -26,10 +26,7 @@ export class Overlay {
|
|
|
26
26
|
window.removeEventListener('beforeunload', this.beforeunload);
|
|
27
27
|
this.render();
|
|
28
28
|
}
|
|
29
|
-
render() {
|
|
30
|
-
this._root.classList.add(rootStyle);
|
|
31
|
-
document.body.classList.add(bodyStyle);
|
|
32
|
-
}
|
|
29
|
+
render() { }
|
|
33
30
|
/** JavaScript中にページを離れようとした場合にアラートを表示します */
|
|
34
31
|
beforeunload(event) {
|
|
35
32
|
event.preventDefault();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/overlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/overlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,OAAO,OAAO;IACC,KAAK,CAAiB;IAC/B,MAAM,CAAU;IAChB,oBAAoB,CAAU;IAExC;QACE,IAAI,CAA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EAAE,CAAC;IACd,CAAC;CACF"}
|
package/dist/overlay/style.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const rootStyle: string;
|
|
1
|
+
export declare const appendStyle: (additionalStyle?: string) => void;
|
package/dist/overlay/style.js
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const
|
|
1
|
+
import { compileString } from 'sass';
|
|
2
|
+
export const appendStyle = (additionalStyle) => {
|
|
3
|
+
const styleElement = document.querySelector('style[data-konomi-ui-overlay]') ?? document.createElement('style');
|
|
4
|
+
styleElement.dataset.konomiUiOverlay = '';
|
|
5
|
+
styleElement.textContent = `
|
|
6
|
+
${bodyStyle}
|
|
7
|
+
${rootStyle}
|
|
8
|
+
${additionalStyle ?? ''}
|
|
9
|
+
`;
|
|
10
|
+
};
|
|
11
|
+
const bodyStyle = compileString(`
|
|
12
|
+
body {
|
|
3
13
|
overflow: visible;
|
|
4
14
|
&[data-konomi-ui-overlay] {
|
|
5
15
|
overflow: hidden;
|
|
6
16
|
}
|
|
7
|
-
|
|
8
|
-
|
|
17
|
+
}
|
|
18
|
+
`);
|
|
19
|
+
const rootStyle = compileString(`
|
|
20
|
+
div[data-konomi-ui-overlay] {
|
|
9
21
|
font-family: 'Yu Gothic Medium', '游ゴシック', YuGothic, 'メイリオ', 'Hiragino Kaku Gothic ProN',
|
|
10
22
|
Meiryo, sans-serif;
|
|
11
23
|
color: #356;
|
|
@@ -39,5 +51,6 @@ export const rootStyle = css `
|
|
|
39
51
|
opacity: 1;
|
|
40
52
|
pointer-events: all;
|
|
41
53
|
}
|
|
42
|
-
|
|
54
|
+
}
|
|
55
|
+
`);
|
|
43
56
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/overlay/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/overlay/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAErC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,eAAwB,EAAE,EAAE;IACtD,MAAM,YAAY,GAChB,QAAQ,CAAC,aAAa,CAAC,+BAA+B,CAAC,IAAI,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC7F,YAAY,CAAC,OAAO,CAAC,eAAe,GAAG,EAAE,CAAC;IAE1C,YAAY,CAAC,WAAW,GAAG;EAC3B,SAAS;EACT,SAAS;EACT,eAAe,IAAI,EAAE;GACpB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,aAAa,CAAC;;;;;;;CAO/B,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC/B,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@konomi-app/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "adachi",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"prepare": "yarn run build"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@emotion/css": "^11.11.2"
|
|
13
|
+
"@emotion/css": "^11.11.2",
|
|
14
|
+
"sass": "^1.69.5"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
17
|
"typescript": "^5.3.3"
|