@w0s/footnote-reference-popover 7.1.0 → 7.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/README.md +123 -123
- package/dist/FootnoteReferencePopover.d.ts.map +1 -1
- package/dist/FootnoteReferencePopover.js +9 -8
- package/dist/FootnoteReferencePopover.js.map +1 -1
- package/dist/attribute/FootnoteElement.js +2 -5
- package/dist/attribute/FootnoteElement.js.map +1 -1
- package/dist/custom-element/Popover.d.ts.map +1 -1
- package/dist/custom-element/Popover.js +28 -26
- package/dist/custom-element/Popover.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +48 -48
package/README.md
CHANGED
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
# Footnote reference popover
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@w0s/footnote-reference-popover)
|
|
4
|
-
[](https://github.com/SaekiTominaga/js-library-browser/actions/workflows/footnote-reference-popover.yml)
|
|
5
|
-
|
|
6
|
-
## Features
|
|
7
|
-
|
|
8
|
-
- The overall behavior is similar to [Wikipedia footnotes](https://en.wikipedia.org/wiki/Help:Footnotes).
|
|
9
|
-
- Automatically copies the HTML of footnotes on the page and displays them as popovers.
|
|
10
|
-
- Markup such as `<a href>` and `<code>` can be used in popovers.
|
|
11
|
-
- However, `id` attributes inside footnote are removed. This is to prevent duplicate IDs from existing in the document.
|
|
12
|
-
- A popover is displayed on hovering or clicking the trigger element.
|
|
13
|
-
- The popover is generated the first time a request is made to display the popover, not when the web page loads. This minimizes DOM processing at load time when a large number of popovers are embedded in the page.
|
|
14
|
-
- Customizable delay time for showing and hiding for mouse operations.
|
|
15
|
-
|
|
16
|
-
## Demo
|
|
17
|
-
|
|
18
|
-
- [Demo page](https://saekitominaga.github.io/js-library-browser/packages/footnote-reference-popover/demo/)
|
|
19
|
-
|
|
20
|
-
## Examples
|
|
21
|
-
|
|
22
|
-
```HTML
|
|
23
|
-
<script type="importmap">
|
|
24
|
-
{
|
|
25
|
-
"imports": {
|
|
26
|
-
"@w0s/footnote-reference-popover": "...",
|
|
27
|
-
"@w0s/shadow-append-css": "..."
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
</script>
|
|
31
|
-
<script type="module">
|
|
32
|
-
import footnoteReferencePopover from '@w0s/footnote-reference-popover';
|
|
33
|
-
|
|
34
|
-
footnoteReferencePopover(document.querySelectorAll('.js-footnote-reference-popover')); // `getElementById()` or `getElementsByClassName()` or `getElementsByTagName()` or `querySelector()` or `querySelectorAll()`
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<a class="js-footnote-reference-popover"
|
|
38
|
-
href="#footnote-1"
|
|
39
|
-
>[1]</a>
|
|
40
|
-
|
|
41
|
-
<a class="js-footnote-reference-popover"
|
|
42
|
-
href="#footnote-2"
|
|
43
|
-
data-popover-label="Note"
|
|
44
|
-
data-popover-class="my-popover"
|
|
45
|
-
data-popover-hide-text="Close"
|
|
46
|
-
data-popover-hide-image-src="/assets/popover-close.svg"
|
|
47
|
-
data-popover-hide-image-width="16"
|
|
48
|
-
data-popover-hide-image-height="16"
|
|
49
|
-
data-mouseenter-delay="250"
|
|
50
|
-
data-mouseleave-delay="250"
|
|
51
|
-
>[1]</a>
|
|
52
|
-
|
|
53
|
-
<ul class="footnotes">
|
|
54
|
-
<li id="footnote-1">Footnote text. <a href="#">link</a> <code>code</code> <em>emphasis</em></li>
|
|
55
|
-
<li id="footnote-2">Footnote text.</li>
|
|
56
|
-
</ul>
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## HTML attributes
|
|
60
|
-
|
|
61
|
-
<dl>
|
|
62
|
-
<dt><code>href</code> [required]</dt>
|
|
63
|
-
<dd>URL hash value of the element that contains the content to be displayed in the popover. (e.g. <code>#footnote-1</code> )</dd>
|
|
64
|
-
<dt><code>data-popover-label</code> [optional]</dt>
|
|
65
|
-
<dd>Label to be set on popover (<code>aria-label</code> attribute value).</dd>
|
|
66
|
-
<dt><code>data-popover-class</code> [optional]</dt>
|
|
67
|
-
<dd>Set the class name (<code>class</code> attribute value) on the popover element. It is mainly used to customize the appearance with CSS.</dd>
|
|
68
|
-
<dt><code>data-popover-hide-text</code> [optional]</dt>
|
|
69
|
-
<dd>The text of the close button in the popover. If omitted, the default value is 'Close'.</dd>
|
|
70
|
-
<dt><code>data-popover-hide-image-src</code> [optional]</dt>
|
|
71
|
-
<dd>The address of the image resource for the close button in the popover.</dd>
|
|
72
|
-
<dt><code>data-popover-hide-image-width</code> [optional]</dt>
|
|
73
|
-
<dd>The width of the image resource for the close button in the popover.</dd>
|
|
74
|
-
<dt><code>data-popover-hide-image-height</code> [optional]</dt>
|
|
75
|
-
<dd>The height of the image resource for the close button in the popover.</dd>
|
|
76
|
-
<dt><code>data-mouseenter-delay</code> [optional]</dt>
|
|
77
|
-
<dd>Delay time between mouse cursor moved within the trigger element and showing the popover (milliseconds). If omitted, the default value is '250'.</dd>
|
|
78
|
-
<dt><code>data-mouseleave-delay</code> [optional]</dt>
|
|
79
|
-
<dd>Delay time between mouse cursor moved out of the trigger element or popover and closing the popover (milliseconds). If omitted, the default value is '250'.</dd>
|
|
80
|
-
</dl>
|
|
81
|
-
|
|
82
|
-
## Style customization
|
|
83
|
-
|
|
84
|
-
The popover markup looks like this.
|
|
85
|
-
|
|
86
|
-
```html
|
|
87
|
-
<a class="js-footnote-reference-popover" href="#footnote" data-popover-class="my-popover">[1]</a>
|
|
88
|
-
|
|
89
|
-
<x-popover popover="" class="my-popover">
|
|
90
|
-
#shadow-root (open)
|
|
91
|
-
<span id="first-focusable" tabindex="0"></span>
|
|
92
|
-
|
|
93
|
-
<div tabindex="-1" part="content">
|
|
94
|
-
<slot>...</slot>
|
|
95
|
-
|
|
96
|
-
<button type="button" popovertarget="" popovertargetaction="hide" part="hide-button">Close</button>
|
|
97
|
-
or
|
|
98
|
-
<button type="button" popovertarget="" popovertargetaction="hide" part="hide-button">
|
|
99
|
-
<img src="close.svg" alt="Close" part="hide-button-image" />
|
|
100
|
-
</button>
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
<span id="last-focusable" tabindex="0"></span>
|
|
104
|
-
</x-popover>
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Therefore, you can customize the style using [`::part`](https://developer.mozilla.org/en-US/docs/Web/CSS/::part) CSS pseudo-element.
|
|
108
|
-
|
|
109
|
-
```css
|
|
110
|
-
.my-popover::part(content) {
|
|
111
|
-
&::part(content) {
|
|
112
|
-
...
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&::part(hide-button) {
|
|
116
|
-
...
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
&::part(hide-button-image) {
|
|
120
|
-
...
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
```
|
|
1
|
+
# Footnote reference popover
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@w0s/footnote-reference-popover)
|
|
4
|
+
[](https://github.com/SaekiTominaga/js-library-browser/actions/workflows/package-footnote-reference-popover.yml)
|
|
5
|
+
|
|
6
|
+
## Features
|
|
7
|
+
|
|
8
|
+
- The overall behavior is similar to [Wikipedia footnotes](https://en.wikipedia.org/wiki/Help:Footnotes).
|
|
9
|
+
- Automatically copies the HTML of footnotes on the page and displays them as popovers.
|
|
10
|
+
- Markup such as `<a href>` and `<code>` can be used in popovers.
|
|
11
|
+
- However, `id` attributes inside footnote are removed. This is to prevent duplicate IDs from existing in the document.
|
|
12
|
+
- A popover is displayed on hovering or clicking the trigger element.
|
|
13
|
+
- The popover is generated the first time a request is made to display the popover, not when the web page loads. This minimizes DOM processing at load time when a large number of popovers are embedded in the page.
|
|
14
|
+
- Customizable delay time for showing and hiding for mouse operations.
|
|
15
|
+
|
|
16
|
+
## Demo
|
|
17
|
+
|
|
18
|
+
- [Demo page](https://saekitominaga.github.io/js-library-browser/packages/footnote-reference-popover/demo/)
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
```HTML
|
|
23
|
+
<script type="importmap">
|
|
24
|
+
{
|
|
25
|
+
"imports": {
|
|
26
|
+
"@w0s/footnote-reference-popover": "...",
|
|
27
|
+
"@w0s/shadow-append-css": "..."
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
<script type="module">
|
|
32
|
+
import footnoteReferencePopover from '@w0s/footnote-reference-popover';
|
|
33
|
+
|
|
34
|
+
footnoteReferencePopover(document.querySelectorAll('.js-footnote-reference-popover')); // `getElementById()` or `getElementsByClassName()` or `getElementsByTagName()` or `querySelector()` or `querySelectorAll()`
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<a class="js-footnote-reference-popover"
|
|
38
|
+
href="#footnote-1"
|
|
39
|
+
>[1]</a>
|
|
40
|
+
|
|
41
|
+
<a class="js-footnote-reference-popover"
|
|
42
|
+
href="#footnote-2"
|
|
43
|
+
data-popover-label="Note"
|
|
44
|
+
data-popover-class="my-popover"
|
|
45
|
+
data-popover-hide-text="Close"
|
|
46
|
+
data-popover-hide-image-src="/assets/popover-close.svg"
|
|
47
|
+
data-popover-hide-image-width="16"
|
|
48
|
+
data-popover-hide-image-height="16"
|
|
49
|
+
data-mouseenter-delay="250"
|
|
50
|
+
data-mouseleave-delay="250"
|
|
51
|
+
>[1]</a>
|
|
52
|
+
|
|
53
|
+
<ul class="footnotes">
|
|
54
|
+
<li id="footnote-1">Footnote text. <a href="#">link</a> <code>code</code> <em>emphasis</em></li>
|
|
55
|
+
<li id="footnote-2">Footnote text.</li>
|
|
56
|
+
</ul>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## HTML attributes
|
|
60
|
+
|
|
61
|
+
<dl>
|
|
62
|
+
<dt><code>href</code> [required]</dt>
|
|
63
|
+
<dd>URL hash value of the element that contains the content to be displayed in the popover. (e.g. <code>#footnote-1</code> )</dd>
|
|
64
|
+
<dt><code>data-popover-label</code> [optional]</dt>
|
|
65
|
+
<dd>Label to be set on popover (<code>aria-label</code> attribute value).</dd>
|
|
66
|
+
<dt><code>data-popover-class</code> [optional]</dt>
|
|
67
|
+
<dd>Set the class name (<code>class</code> attribute value) on the popover element. It is mainly used to customize the appearance with CSS.</dd>
|
|
68
|
+
<dt><code>data-popover-hide-text</code> [optional]</dt>
|
|
69
|
+
<dd>The text of the close button in the popover. If omitted, the default value is 'Close'.</dd>
|
|
70
|
+
<dt><code>data-popover-hide-image-src</code> [optional]</dt>
|
|
71
|
+
<dd>The address of the image resource for the close button in the popover.</dd>
|
|
72
|
+
<dt><code>data-popover-hide-image-width</code> [optional]</dt>
|
|
73
|
+
<dd>The width of the image resource for the close button in the popover.</dd>
|
|
74
|
+
<dt><code>data-popover-hide-image-height</code> [optional]</dt>
|
|
75
|
+
<dd>The height of the image resource for the close button in the popover.</dd>
|
|
76
|
+
<dt><code>data-mouseenter-delay</code> [optional]</dt>
|
|
77
|
+
<dd>Delay time between mouse cursor moved within the trigger element and showing the popover (milliseconds). If omitted, the default value is '250'.</dd>
|
|
78
|
+
<dt><code>data-mouseleave-delay</code> [optional]</dt>
|
|
79
|
+
<dd>Delay time between mouse cursor moved out of the trigger element or popover and closing the popover (milliseconds). If omitted, the default value is '250'.</dd>
|
|
80
|
+
</dl>
|
|
81
|
+
|
|
82
|
+
## Style customization
|
|
83
|
+
|
|
84
|
+
The popover markup looks like this.
|
|
85
|
+
|
|
86
|
+
```html
|
|
87
|
+
<a class="js-footnote-reference-popover" href="#footnote" data-popover-class="my-popover">[1]</a>
|
|
88
|
+
|
|
89
|
+
<x-popover popover="" class="my-popover">
|
|
90
|
+
#shadow-root (open)
|
|
91
|
+
<span id="first-focusable" tabindex="0"></span>
|
|
92
|
+
|
|
93
|
+
<div tabindex="-1" part="content">
|
|
94
|
+
<slot>...</slot>
|
|
95
|
+
|
|
96
|
+
<button type="button" popovertarget="" popovertargetaction="hide" part="hide-button">Close</button>
|
|
97
|
+
or
|
|
98
|
+
<button type="button" popovertarget="" popovertargetaction="hide" part="hide-button">
|
|
99
|
+
<img src="close.svg" alt="Close" part="hide-button-image" />
|
|
100
|
+
</button>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<span id="last-focusable" tabindex="0"></span>
|
|
104
|
+
</x-popover>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Therefore, you can customize the style using [`::part`](https://developer.mozilla.org/en-US/docs/Web/CSS/::part) CSS pseudo-element.
|
|
108
|
+
|
|
109
|
+
```css
|
|
110
|
+
.my-popover::part(content) {
|
|
111
|
+
&::part(content) {
|
|
112
|
+
...
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&::part(hide-button) {
|
|
116
|
+
...
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&::part(hide-button-image) {
|
|
120
|
+
...
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FootnoteReferencePopover.d.ts","sourceRoot":"","sources":["../src/FootnoteReferencePopover.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,CAAC,OAAO;;IAuBb;;OAEG;gBACS,WAAW,EAAE,iBAAiB;
|
|
1
|
+
{"version":3,"file":"FootnoteReferencePopover.d.ts","sourceRoot":"","sources":["../src/FootnoteReferencePopover.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,CAAC,OAAO;;IAuBb;;OAEG;gBACS,WAAW,EAAE,iBAAiB;CAkO1C"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import FootnoteElement from
|
|
2
|
-
import Mouseenter from
|
|
3
|
-
import Mouseleave from
|
|
4
|
-
import PopoverClass from
|
|
5
|
-
import PopoverHide from
|
|
6
|
-
import PopoverLabel from
|
|
7
|
-
import CustomElementPopover, {} from
|
|
1
|
+
import FootnoteElement from "./attribute/FootnoteElement.js";
|
|
2
|
+
import Mouseenter from "./attribute/Mouseenter.js";
|
|
3
|
+
import Mouseleave from "./attribute/Mouseleave.js";
|
|
4
|
+
import PopoverClass from "./attribute/PopoverClass.js";
|
|
5
|
+
import PopoverHide from "./attribute/PopoverHide.js";
|
|
6
|
+
import PopoverLabel from "./attribute/PopoverLabel.js";
|
|
7
|
+
import CustomElementPopover, {} from "./custom-element/Popover.js";
|
|
8
8
|
customElements.define('x-popover', CustomElementPopover);
|
|
9
9
|
/**
|
|
10
10
|
* Footnote reference popover
|
|
@@ -86,6 +86,7 @@ export default class {
|
|
|
86
86
|
* ポップオーバーを生成する
|
|
87
87
|
*/
|
|
88
88
|
#create() {
|
|
89
|
+
const footnoteElement = this.#footnoteElement.element;
|
|
89
90
|
const popoverElement = this.#popoverElement;
|
|
90
91
|
if (this.#popoverClass.name !== undefined) {
|
|
91
92
|
popoverElement.className = this.#popoverClass.name;
|
|
@@ -95,7 +96,7 @@ export default class {
|
|
|
95
96
|
popoverElement.hideImageSrc = this.#popoverHide.imageSrc ?? null;
|
|
96
97
|
popoverElement.hideImageWidth = this.#popoverHide.imageWidth ?? null;
|
|
97
98
|
popoverElement.hideImageHeight = this.#popoverHide.imageHeight ?? null;
|
|
98
|
-
popoverElement.insertAdjacentHTML('afterbegin',
|
|
99
|
+
popoverElement.insertAdjacentHTML('afterbegin', 'getHTML' in footnoteElement ? footnoteElement.getHTML() : footnoteElement.innerHTML);
|
|
99
100
|
document.body.appendChild(popoverElement);
|
|
100
101
|
popoverElement.addEventListener('mouseenter', (ev) => {
|
|
101
102
|
clearTimeout(this.#mouseleaveTimeoutId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FootnoteReferencePopover.js","sourceRoot":"","sources":["../src/FootnoteReferencePopover.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,gCAAgC,CAAC;AAC7D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,WAAW,MAAM,4BAA4B,CAAC;A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M,CAAC,CAAC;YACvE,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC1C,aAAa,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;YAC3C,CAAC;iBAAM,CAAC;gBACP,CAAC,GAAG,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,qBAAqB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;YACxF,CAAC;QACF,CAAC;IACF,CAAC;CACD"}
|
|
@@ -10,13 +10,10 @@ export default class {
|
|
|
10
10
|
if (value === null || value === undefined || value === '') {
|
|
11
11
|
throw new TypeError('The `href` attribute is not set.');
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
url = new URL(value);
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
13
|
+
if (!URL.canParse(value)) {
|
|
18
14
|
throw new TypeError('The value of the `href` attribute must be a URL.');
|
|
19
15
|
}
|
|
16
|
+
const url = new URL(value);
|
|
20
17
|
if (url.origin !== location.origin || url.pathname !== location.pathname) {
|
|
21
18
|
throw new TypeError('The `href` attribute must be in the same content.');
|
|
22
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FootnoteElement.js","sourceRoot":"","sources":["../../src/attribute/FootnoteElement.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO;IACJ,QAAQ,CAAc;IAE/B;;OAEG;IACH,YAAY,KAAgC;QAC3C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;YAC3D,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC,CAAC;QACzD,CAAC;QAED,IAAI,
|
|
1
|
+
{"version":3,"file":"FootnoteElement.js","sourceRoot":"","sources":["../../src/attribute/FootnoteElement.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO;IACJ,QAAQ,CAA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5D,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;;
|
|
1
|
+
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../src/custom-element/Popover.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,WAAW;;IAa5D,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;;IAiDD,iBAAiB,IAAI,IAAI;IAoBzB,oBAAoB,IAAI,IAAI;IAS5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IA0B/F,IAAI,KAAK,IAAI,MAAM,GAAG,IAAI,CAEzB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAE7B;IAED,IAAI,QAAQ,IAAI,MAAM,GAAG,IAAI,CAE5B;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAUhC;IAED,IAAI,YAAY,IAAI,MAAM,GAAG,IAAI,CAEhC;IAED,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAYpC;IAED,IAAI,cAAc,IAAI,MAAM,GAAG,IAAI,CAElC;IAED,IAAI,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAOtC;IAED,IAAI,eAAe,IAAI,MAAM,GAAG,IAAI,CAEnC;IAED,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAOvC;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,iBAAiB,IAAI,iBAAiB,CAEzC;CA0CD"}
|
|
@@ -14,34 +14,36 @@ export default class CustomElementPopover extends HTMLElement {
|
|
|
14
14
|
}
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<span id="last-focusable" tabindex="0"></span>
|
|
17
|
+
const htmlString = `
|
|
18
|
+
<span id="first-focusable" tabindex="0"></span>
|
|
19
|
+
<div tabindex="-1" part="content">
|
|
20
|
+
<slot></slot>
|
|
21
|
+
<button type="button" popovertargetaction="hide" part="hide-button"></button>
|
|
22
|
+
</div>
|
|
23
|
+
<span id="last-focusable" tabindex="0"></span>
|
|
25
24
|
`;
|
|
26
|
-
const cssString = `
|
|
27
|
-
:host {
|
|
28
|
-
position: absolute;
|
|
29
|
-
contain: layout;
|
|
30
|
-
margin: 0;
|
|
31
|
-
border: none;
|
|
32
|
-
padding: 0;
|
|
33
|
-
overflow: visible;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
:host::part(content) {
|
|
37
|
-
border: solid;
|
|
38
|
-
padding: 0.25em;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
:host::part(hide-button-image) {
|
|
42
|
-
display: block flow;
|
|
43
|
-
}
|
|
25
|
+
const cssString = `
|
|
26
|
+
:host {
|
|
27
|
+
position: absolute;
|
|
28
|
+
contain: layout;
|
|
29
|
+
margin: 0;
|
|
30
|
+
border: none;
|
|
31
|
+
padding: 0;
|
|
32
|
+
overflow: visible;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host::part(content) {
|
|
36
|
+
border: solid;
|
|
37
|
+
padding: 0.25em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host::part(hide-button-image) {
|
|
41
|
+
display: block flow;
|
|
42
|
+
}
|
|
44
43
|
`;
|
|
44
|
+
const shadow = this.attachShadow({ mode: 'open' });
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
46
|
+
'setHTMLUnsafe' in shadow ? shadow.setHTMLUnsafe(htmlString) : (shadow.innerHTML = htmlString);
|
|
45
47
|
shadowAppendCss(shadow, cssString);
|
|
46
48
|
this.#contentElement = shadow.querySelector('[part="content"]');
|
|
47
49
|
this.#hideButtonElement = shadow.querySelector('[part="hide-button"]');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../src/custom-element/Popover.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,wBAAwB,CAAC;AAOrD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,WAAW;IACnD,eAAe,CAAc;IAE7B,sBAAsB,CAAc;IAEpC,qBAAqB,CAAc;IAEnC,kBAAkB,CAAoB;IAEtC,uBAAuB,CAAmB;IAEnD,SAAS,GAAG,OAAO,CAAC;IAEpB,MAAM,KAAK,kBAAkB;QAC5B,OAAO,CAAC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAC1F,CAAC;IAED;QACC,KAAK,EAAE,CAAC;QAER,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../src/custom-element/Popover.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,wBAAwB,CAAC;AAOrD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,WAAW;IACnD,eAAe,CAAc;IAE7B,sBAAsB,CAAc;IAEpC,qBAAqB,CAAc;IAEnC,kBAAkB,CAAoB;IAEtC,uBAAuB,CAAmB;IAEnD,SAAS,GAAG,OAAO,CAAC;IAEpB,MAAM,KAAK,kBAAkB;QAC5B,OAAO,CAAC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAC1F,CAAC;IAED;QAC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AC,CAAC;gBACf,IAAI,CAAC,WAAW,EAAE,CAAC;gBAEnB,MAAM;YACP,CAAC;YACD,QAAQ;QACT,CAAC;IACF,CAAC,CAAC;IAEF;;OAEG;IACH,yBAAyB,GAAG,GAAS,EAAE;QACtC,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC,CAAC;IAEF;;OAEG;IACH,wBAAwB,GAAG,GAAS,EAAE;QACrC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC,CAAC;CACF"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"yBAUgB,mBAAmB,UAAU,CAAC,OAAO,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,KAAG,IAAI;AAA1G,wBAYE"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import FootnoteReferencePopover from
|
|
1
|
+
import FootnoteReferencePopover from "./FootnoteReferencePopover.js";
|
|
2
2
|
const validate = (element) => {
|
|
3
3
|
if (!(element instanceof HTMLAnchorElement)) {
|
|
4
4
|
throw new Error('Element must be a `HTMLAnchorElement`');
|
package/package.json
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@w0s/footnote-reference-popover",
|
|
3
|
-
"version": "7.
|
|
4
|
-
"description": "Footnote reference popover",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"footnote",
|
|
7
|
-
"popover"
|
|
8
|
-
],
|
|
9
|
-
"homepage": "https://github.com/SaekiTominaga/js-library-browser#readme",
|
|
10
|
-
"bugs": {
|
|
11
|
-
"url": "https://github.com/SaekiTominaga/js-library-browser/issues"
|
|
12
|
-
},
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"author": "Saeki Tominaga",
|
|
15
|
-
"files": [
|
|
16
|
-
"dist/**/*.d.ts",
|
|
17
|
-
"!dist/**/*.test.d.ts",
|
|
18
|
-
"dist/**/*.d.ts.map",
|
|
19
|
-
"!dist/**/*.test.d.ts.map",
|
|
20
|
-
"dist/**/*.js",
|
|
21
|
-
"!dist/**/*.test.js",
|
|
22
|
-
"dist/**/*.js.map",
|
|
23
|
-
"!dist/**/*.test.js.map"
|
|
24
|
-
],
|
|
25
|
-
"type": "module",
|
|
26
|
-
"main": "dist/index.js",
|
|
27
|
-
"module": "dist/index.js",
|
|
28
|
-
"types": "dist/index.d.ts",
|
|
29
|
-
"repository": {
|
|
30
|
-
"type": "git",
|
|
31
|
-
"url": "git+https://github.com/SaekiTominaga/js-library-browser.git"
|
|
32
|
-
},
|
|
33
|
-
"scripts": {
|
|
34
|
-
"server": "http-server -o demo -c-1",
|
|
35
|
-
"prebuild": "rimraf dist/* -g",
|
|
36
|
-
"build": "tsc",
|
|
37
|
-
"watch": "tsc -w",
|
|
38
|
-
"lint": "eslint src/**/*.ts
|
|
39
|
-
"pretest": "npm run build",
|
|
40
|
-
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest dist/.+\\.test\\.js -c ../../jest.config.mjs --roots packages/footnote-reference-popover"
|
|
41
|
-
},
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"@w0s/shadow-append-css": "^1.1.0"
|
|
44
|
-
},
|
|
45
|
-
"publishConfig": {
|
|
46
|
-
"access": "public"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@w0s/footnote-reference-popover",
|
|
3
|
+
"version": "7.2.0",
|
|
4
|
+
"description": "Footnote reference popover",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"footnote",
|
|
7
|
+
"popover"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://github.com/SaekiTominaga/js-library-browser#readme",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/SaekiTominaga/js-library-browser/issues"
|
|
12
|
+
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "Saeki Tominaga",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/**/*.d.ts",
|
|
17
|
+
"!dist/**/*.test.d.ts",
|
|
18
|
+
"dist/**/*.d.ts.map",
|
|
19
|
+
"!dist/**/*.test.d.ts.map",
|
|
20
|
+
"dist/**/*.js",
|
|
21
|
+
"!dist/**/*.test.js",
|
|
22
|
+
"dist/**/*.js.map",
|
|
23
|
+
"!dist/**/*.test.js.map"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "dist/index.js",
|
|
27
|
+
"module": "dist/index.js",
|
|
28
|
+
"types": "dist/index.d.ts",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/SaekiTominaga/js-library-browser.git"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"server": "http-server -o demo -c-1",
|
|
35
|
+
"prebuild": "rimraf dist/* -g",
|
|
36
|
+
"build": "tsc",
|
|
37
|
+
"watch": "tsc -w",
|
|
38
|
+
"lint": "eslint src/**/*.ts",
|
|
39
|
+
"pretest": "npm run build",
|
|
40
|
+
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest dist/.+\\.test\\.js -c ../../jest.config.mjs --roots packages/footnote-reference-popover"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@w0s/shadow-append-css": "^1.1.0"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
}
|
|
48
|
+
}
|