paginar 0.3.4 → 0.3.6

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.
Files changed (60) hide show
  1. package/README.md +288 -236
  2. package/dist/index.es.js +684 -244
  3. package/dist/index.es.js.map +1 -1
  4. package/dist/style.css +63 -0
  5. package/package.json +6 -3
  6. package/.editorconfig +0 -13
  7. package/.env +0 -1
  8. package/.vscode/extensions.json +0 -3
  9. package/demo/slot/slot-chapter1.html +0 -384
  10. package/demo/slot/slot-chapter2.html +0 -366
  11. package/demo/slot/slot-chapter3.html +0 -265
  12. package/demo/summary/_content/1chapter.html +0 -100
  13. package/demo/summary/_content/2chapter.html +0 -311
  14. package/demo/summary/_content/3chapter.html +0 -211
  15. package/demo/summary/index.html +0 -134
  16. package/index.html +0 -18
  17. package/postcss.config.js +0 -7
  18. package/public/favicon.ico +0 -0
  19. package/src/App.ce.vue +0 -166
  20. package/src/assets/main.css +0 -392
  21. package/src/components/BookContent.vue +0 -23
  22. package/src/components/EngineWrapper.vue +0 -15
  23. package/src/components/FooterSlot.vue +0 -32
  24. package/src/components/FootnotesAside.vue +0 -123
  25. package/src/components/HeaderSlot/HeaderSlot.vue +0 -30
  26. package/src/components/HeaderSlot/OptionsButton/OptionsButton.vue +0 -67
  27. package/src/components/HeaderSlot/OptionsButton/OptionsColor.vue +0 -28
  28. package/src/components/HeaderSlot/OptionsButton/OptionsColumns.vue +0 -51
  29. package/src/components/HeaderSlot/OptionsButton/OptionsDropdown.vue +0 -59
  30. package/src/components/HeaderSlot/OptionsButton/OptionsFontFamily.vue +0 -17
  31. package/src/components/HeaderSlot/OptionsButton/OptionsFontSize.vue +0 -17
  32. package/src/components/HeaderSlot/SummaryButton/SummaryButton.vue +0 -74
  33. package/src/components/HeaderSlot/SummaryButton/SummaryDropdown.vue +0 -30
  34. package/src/components/NavigationButton.vue +0 -34
  35. package/src/components/ReaderWrapper.vue +0 -37
  36. package/src/components/ReferencePopup.vue +0 -36
  37. package/src/components/icons/Close.vue +0 -6
  38. package/src/components/icons/DoubleColumn.vue +0 -15
  39. package/src/components/icons/Expand.vue +0 -7
  40. package/src/components/icons/Eye.vue +0 -9
  41. package/src/components/icons/Footnote.vue +0 -5
  42. package/src/components/icons/Home.vue +0 -6
  43. package/src/components/icons/Moon.vue +0 -5
  44. package/src/components/icons/Notes.vue +0 -5
  45. package/src/components/icons/SingleColumn.vue +0 -3
  46. package/src/components/icons/Summary.vue +0 -10
  47. package/src/components/icons/Sun.vue +0 -5
  48. package/src/components/icons/ThreeDots.vue +0 -8
  49. package/src/composables/useBrowser.js +0 -16
  50. package/src/composables/useEstimatePages.js +0 -31
  51. package/src/composables/useFootnotes.js +0 -50
  52. package/src/composables/usePagination.js +0 -125
  53. package/src/composables/useReaderSettings.js +0 -174
  54. package/src/composables/useReferences.js +0 -67
  55. package/src/composables/useStyles.js +0 -60
  56. package/src/composables/useTextContent.js +0 -113
  57. package/src/main.js +0 -19
  58. package/src/tailwind.css +0 -1082
  59. package/tailwind.config.js +0 -16
  60. package/vite.config.js +0 -36
@@ -1,392 +0,0 @@
1
- .border-primary { border-color: var(--theme-primary, #690000); }
2
- .text-primary { color: var(--theme-primary, #690000); }
3
- .bg-primary { background-color: var(--theme-primary, #690000); }
4
-
5
- .border-primary-extralight { border-color: var(--theme-primary-extralight, #f3f4f6); }
6
- .text-primary-extralight { color: var(--theme-primary-extralight, #f3f4f6); }
7
- .bg-primary-extralight { background-color: var(--theme-primary-extralight, #f3f4f6); }
8
-
9
- .border-secondary { border-color: var(--theme-secondary, #ffa03c); }
10
- .text-secondary { color: var(--theme-secondary, #ffa03c); }
11
- .bg-secondary { background-color: var(--theme-secondary, #ffa03c); }
12
-
13
- .rootWrapper {
14
- max-height: 100%;
15
- height: 100%;
16
- }
17
-
18
- main#rootComponent {
19
- height: 100%;
20
- max-height: 100%;
21
-
22
- &.light {
23
- background-color: var(--bg-light-mode, #fff7e0)
24
- }
25
-
26
- &.dark {
27
- background-color: var(--bg-dark-mode, #2d2d2d);
28
-
29
- #content-area {
30
- color: #fff
31
- }
32
- }
33
- }
34
-
35
- header.wrapper {
36
- width: 200px;
37
- margin: 0 auto;
38
- }
39
-
40
- #engine {
41
- height: calc(100% - 8.4rem);
42
- position: relative;
43
- right: 0;
44
- left: 0;
45
- bottom: 0;
46
- width: 100%;
47
- }
48
-
49
- .rootWrapper.safari {
50
- max-height: initial;
51
- height: initial;
52
- }
53
-
54
- .rootWrapper.safari #engine {
55
- height: auto !important;
56
- }
57
-
58
- #reader-component {
59
- width: calc(100% - 5rem);
60
- }
61
-
62
- .typeArea {
63
- width: 100%;
64
- }
65
-
66
- .engineWrapper {
67
- height: 100%;
68
- display: flex;
69
- justify-content: space-between;
70
- position: relative;
71
- right: 0;
72
- left: 0;
73
- bottom: 0;
74
- width: 100%;
75
- }
76
-
77
- .rootWrapper:not(.safari) .columns-double .columnsArea {
78
- -moz-column-count: 2;
79
- column-count: 2;
80
- grid-column-gap: 0;
81
- -moz-column-gap: 0;
82
- column-gap: 0;
83
- height: 100%;
84
- padding: 0;
85
- width: 100%;
86
-
87
- @media only screen and (max-width: 1020px) {
88
- -moz-column-count: 1;
89
- column-count: 1;
90
- }
91
- }
92
-
93
- .rootWrapper:not(.safari) .columns-single .columnsArea {
94
- column-count: 1;
95
- column-gap: 0;
96
- height: 100%;
97
- padding: 0;
98
- width: 100%;
99
-
100
- #content-area {
101
- max-width: 37em;
102
- margin: 0 auto;
103
- }
104
- }
105
-
106
-
107
- .nav-prev {
108
- @apply left-0;
109
- }
110
-
111
- .nav-next {
112
- @apply right-0;
113
- }
114
-
115
- .viewer-nav {
116
- height: 100%;
117
-
118
- @apply relative z-10 inset-y-0 transition duration-500 ease-in-out self-center w-10 cursor-pointer flex-shrink-0;
119
-
120
-
121
- &:focus,
122
- &:active {
123
- border: none !important;
124
- box-shadow: none !important;
125
- outline-color: transparent !important;
126
- }
127
- }
128
-
129
- #content-area *::selection {
130
- color: var(--theme-primary-extralight, #690000);
131
- background: var(--theme-secondary, #ffa03c);
132
- }
133
-
134
- .viewer-nav-icon {
135
- @apply opacity-0 md:opacity-80;
136
- }
137
-
138
- .columnsArea {
139
- @media only screen and (max-width: 600px) {
140
- transition: margin 100ms;
141
- }
142
- }
143
-
144
- #asidebar {
145
- background: var(--sidebar-backgorund, #690000);
146
- color: var(--sidebar-text, #f3f4f6);
147
- }
148
-
149
- /* slider */
150
-
151
- .rootWrapper.safari .slider-target,
152
- .rootWrapper.safari .slider-target *{
153
- display: none !important;
154
- }
155
-
156
- .slider-target,.slider-target *{
157
- -webkit-touch-callout:none;
158
- -webkit-tap-highlight-color:rgba(0,0,0,0);
159
- box-sizing:border-box;
160
- touch-action:none;
161
- -webkit-user-select:none;
162
- -moz-user-select:none;
163
- user-select:none
164
- }
165
- .slider-target{
166
- position:relative
167
- }
168
- .slider-base,.slider-connects{
169
- height:100%;
170
- position:relative;
171
- width:100%;
172
- z-index:1
173
- }
174
- .slider-connects{
175
- overflow:hidden;
176
- z-index:0
177
- }
178
- .slider-connect,.slider-origin{
179
- height:100%;
180
- position:absolute;
181
- right:0;
182
- top:0;
183
- -ms-transform-origin:0 0;
184
- -webkit-transform-origin:0 0;
185
- transform-origin:0 0;
186
- -webkit-transform-style:preserve-3d;
187
- transform-style:flat;
188
- width:100%;
189
- will-change:transform;
190
- z-index:1
191
- }
192
- .slider-txt-dir-rtl.slider-horizontal .slider-origin{
193
- left:0;
194
- right:auto
195
- }
196
- .slider-vertical .slider-origin{
197
- top:-100%;
198
- width:0
199
- }
200
- .slider-horizontal .slider-origin{
201
- height:0
202
- }
203
- .slider-handle{
204
- -webkit-backface-visibility:hidden;
205
- backface-visibility:hidden;
206
- position:absolute
207
- }
208
- .slider-touch-area{
209
- height:100%;
210
- width:100%
211
- }
212
- .slider-state-tap .slider-connect,.slider-state-tap .slider-origin{
213
- transition:transform .3s
214
- }
215
- .slider-state-drag *{
216
- cursor:inherit!important
217
- }
218
- .slider-tooltip-drag .slider-tooltip,.slider-tooltip-focus .slider-tooltip{
219
- display:none!important
220
- }
221
- .slider-tooltip-drag .slider-active .slider-tooltip,.slider-tooltip-drag.slider-state-drag .slider-tooltip:not(.slider-tooltip-hidden),.slider-tooltip-focus.slider-focused .slider-tooltip:not(.slider-tooltip-hidden){
222
- display:block!important
223
- }
224
- .slider-horizontal{
225
- height:var(--slider-height,6px)
226
- }
227
- .slider-horizontal .slider-handle{
228
- height:var(--slider-handle-height,16px);
229
- right:calc(var(--slider-handle-width, 16px)/2*-1);
230
- top:calc((var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2*-1 + -1px);
231
- width:var(--slider-handle-width,16px)
232
- }
233
- .slider-vertical{
234
- height:var(--slider-vertical-height,300px);
235
- width:var(--slider-height,6px)
236
- }
237
- .slider-vertical .slider-handle{
238
- bottom:calc(var(--slider-handle-width, 16px)/2*-1);
239
- height:var(--slider-handle-width,16px);
240
- right:calc((var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2*-1 + -1px);
241
- width:var(--slider-handle-height,16px)
242
- }
243
- .slider-txt-dir-rtl.slider-horizontal .slider-handle{
244
- left:calc(var(--slider-handle-width, 16px)/2*-1);
245
- right:auto
246
- }
247
- .slider-base{
248
- background-color:var(--slider-bg,#d1d5db)
249
- }
250
- .slider-base,.slider-connects{
251
- border-radius:var(--slider-radius,9999px)
252
- }
253
- .slider-connect{
254
- background:var(--theme-secondary, #690000);
255
- cursor:pointer
256
- }
257
- .slider-draggable{
258
- cursor:ew-resize
259
- }
260
- .slider-vertical .slider-draggable{
261
- cursor:ns-resize
262
- }
263
- .slider-handle{
264
- background:var(--slider-handle-bg,#fff);
265
- border:var(--slider-handle-border,0);
266
- border-radius:var(--slider-handle-radius,9999px);
267
- box-shadow:var(--slider-handle-shadow,.5px .5px 2px 1px rgba(0,0,0,.32));
268
- cursor:-webkit-grab;
269
- cursor:grab;
270
- height:var(--slider-handle-height,16px);
271
- width:var(--slider-handle-width,16px)
272
- }
273
- .slider-handle:focus{
274
- box-shadow:0 0 0 var(--slider-handle-ring-width,3px) var(--slider-handle-ring-color,rgba(16,185,129,.188)),var(--slider-handle-shadow,.5px .5px 2px 1px rgba(0,0,0,.32));
275
- outline:none
276
- }
277
- .slider-active{
278
- box-shadow:var(--slider-handle-shadow-active,.5px .5px 2px 1px rgba(0,0,0,.42));
279
- cursor:-webkit-grabbing;
280
- cursor:grabbing
281
- }
282
- [disabled] .slider-connect{
283
- background:var(--slider-connect-bg-disabled,#9ca3af)
284
- }
285
- [disabled] .slider-handle,[disabled].slider-handle,[disabled].slider-target{
286
- cursor:not-allowed
287
- }
288
- [disabled] .slider-tooltip{
289
- background:var(--theme-secondary, #690000);
290
- border-color:var(--theme-secondary, #690000);
291
- opacity: 0.5;
292
- }
293
- .slider-tooltip{
294
- background:var(--theme-secondary, #690000);
295
- border:1px solid var(--theme-secondary, #690000);
296
- border-radius:var(--slider-tooltip-radius,5px);
297
- color:var(--slider-tooltip-color,#fff);
298
- display:block;
299
- font-size:var(--slider-tooltip-font-size,.875rem);
300
- font-weight:var(--slider-tooltip-font-weight,600);
301
- line-height:var(--slider-tooltip-line-height,1.25rem);
302
- min-width:var(--slider-tooltip-min-width,20px);
303
- padding:var(--slider-tooltip-py,2px) var(--slider-tooltip-px,6px);
304
- position:absolute;
305
- text-align:center;
306
- white-space:nowrap
307
- }
308
- .slider-horizontal .slider-tooltip-top{
309
- bottom:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));
310
- left:50%;
311
- transform:translate(-50%)
312
- }
313
- .slider-horizontal .slider-tooltip-top:before{
314
- border:var(--slider-tooltip-arrow-size,5px) solid transparent;
315
- border-top-color:inherit;
316
- bottom:calc(var(--slider-tooltip-arrow-size, 5px)*-2);
317
- content:"";
318
- height:0;
319
- left:50%;
320
- position:absolute;
321
- transform:translate(-50%);
322
- width:0
323
- }
324
- .slider-horizontal .slider-tooltip-bottom{
325
- left:50%;
326
- top:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));
327
- transform:translate(-50%)
328
- }
329
- .slider-horizontal .slider-tooltip-bottom:before{
330
- border:var(--slider-tooltip-arrow-size,5px) solid transparent;
331
- border-bottom-color:inherit;
332
- content:"";
333
- height:0;
334
- left:50%;
335
- position:absolute;
336
- top:calc(var(--slider-tooltip-arrow-size, 5px)*-2);
337
- transform:translate(-50%);
338
- width:0
339
- }
340
- .slider-vertical .slider-tooltip-left{
341
- right:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));
342
- top:50%;
343
- transform:translateY(-50%)
344
- }
345
- .slider-vertical .slider-tooltip-left:before{
346
- border:var(--slider-tooltip-arrow-size,5px) solid transparent;
347
- border-left-color:inherit;
348
- content:"";
349
- height:0;
350
- position:absolute;
351
- right:calc(var(--slider-tooltip-arrow-size, 5px)*-2);
352
- top:50%;
353
- transform:translateY(-50%);
354
- width:0
355
- }
356
- .slider-vertical .slider-tooltip-right{
357
- left:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));
358
- top:50%;
359
- transform:translateY(-50%)
360
- }
361
- .slider-vertical .slider-tooltip-right:before{
362
- border:var(--slider-tooltip-arrow-size,5px) solid transparent;
363
- border-right-color:inherit;
364
- content:"";
365
- height:0;
366
- left:calc(var(--slider-tooltip-arrow-size, 5px)*-2);
367
- position:absolute;
368
- top:50%;
369
- transform:translateY(-50%);
370
- width:0
371
- }
372
- .slider-horizontal .slider-origin>.slider-tooltip{
373
- left:auto;
374
- transform:translate(50%)
375
- }
376
- .slider-horizontal .slider-origin>.slider-tooltip-top{
377
- bottom:calc(var(--slider-tooltip-arrow-size, 5px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) + 1px)
378
- }
379
- .slider-horizontal .slider-origin>.slider-tooltip-bottom{
380
- top:calc(var(--slider-tooltip-arrow-size, 5px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) + var(--slider-height, 6px) - 1px)
381
- }
382
- .slider-vertical .slider-origin>.slider-tooltip{
383
- top:auto;
384
- transform:translateY(calc((var(--slider-tooltip-line-height, 1.25rem) - var(--slider-tooltip-py, 2px))*-1 + 1px))
385
- }
386
- .slider-vertical .slider-origin>.slider-tooltip-left{
387
- right:calc(var(--slider-tooltip-arrow-size, 5px) + var(--slider-height, 6px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) - 1px)
388
- }
389
- .slider-vertical .slider-origin>.slider-tooltip-right{
390
- left:calc(var(--slider-tooltip-arrow-size, 5px) + var(--slider-height, 6px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) - var(--slider-height, 6px) + 1px)
391
- }
392
-
@@ -1,23 +0,0 @@
1
- <script setup>
2
- import { defineProps, onMounted, ref } from 'vue'
3
-
4
- import useTextContent from '../composables/useTextContent'
5
- const { content, initContent } = useTextContent
6
-
7
- const props = defineProps({
8
- bookContent: String
9
- })
10
-
11
- const contentWrapper = ref(null)
12
-
13
- onMounted(() => {
14
- initContent(props.bookContent, contentWrapper)
15
- })
16
- </script>
17
-
18
- <template>
19
- <div ref="contentWrapper">
20
- <div v-if="content" v-html="content"></div>
21
- <slot v-else name="content"></slot>
22
- </div>
23
- </template>
@@ -1,15 +0,0 @@
1
- <script setup>
2
- import NavigationButton from './NavigationButton.vue'
3
- import usePagination from '../composables/usePagination'
4
- const { next, prev } = usePagination
5
- </script>
6
-
7
- <template>
8
- <div id="engine" class="pt-10 transition-colors">
9
- <div class="engineWrapper overflow-hidden">
10
- <NavigationButton target="prev" @clicked="prev()" />
11
- <slot></slot>
12
- <NavigationButton target="next" @clicked="next()" />
13
- </div>
14
- </div>
15
- </template>
@@ -1,32 +0,0 @@
1
- <script setup>
2
- import { ref } from 'vue'
3
- import Slider from '@vueform/slider'
4
-
5
- import usePagination from '../composables/usePagination';
6
- const { totalPages, currentPage, set } = usePagination
7
-
8
- function format() {
9
- return `${currentPage.value} de ${totalPages.value}`
10
- }
11
-
12
- </script>
13
-
14
- <template>
15
- <div class="py-2 px-10 text-gray-700 dark:text-white">
16
- <slot name="footer">
17
- <p>&nbsp;</p>
18
- </slot>
19
-
20
- <Slider
21
- :modelValue="currentPage"
22
- @update:modelValue="set(Math.round($event))"
23
- :min="1"
24
- :max="totalPages"
25
- :step="-1"
26
- showTooltip="drag"
27
- :format="format"
28
- :lazy="false"
29
- class="w-full"
30
- />
31
- </div>
32
- </template>
@@ -1,123 +0,0 @@
1
- <script setup>
2
- import { computed, onMounted, watch, ref } from 'vue'
3
- import { onKeyStroke } from '@vueuse/core'
4
-
5
- import useFootnotes from '../composables/useFootnotes'
6
- import useReaderSettings from '../composables/useReaderSettings'
7
-
8
- import IconClose from '../components/icons/Close.vue'
9
- import IconNotes from '../components/icons/Notes.vue'
10
-
11
- const show = computed(() => useFootnotes.footnote.value)
12
- const footnote = computed(() => useFootnotes.footnote.value)
13
- const showFootnotes = computed(() => useFootnotes.showFootnotes.value)
14
- const footnotes = computed(() => useFootnotes.footnotes.value)
15
-
16
- const oldBlockedValue = ref(null)
17
- const footnoteList = ref(null)
18
-
19
- function hideAside() {
20
- useFootnotes.setHighlightedFootnote(null)
21
- useFootnotes.setShowFootnotes(false)
22
- }
23
-
24
- onKeyStroke('Escape', () => {
25
- if (footnote.value || showFootnotes.value) {
26
- hideAside()
27
- }
28
- })
29
-
30
- watch(
31
- [footnote, showFootnotes],
32
- () => {
33
- if (footnote.value || showFootnotes.value) {
34
- if (useReaderSettings.blocked.value === false) {
35
- oldBlockedValue.value = useReaderSettings.blocked.value
36
- }
37
- useReaderSettings.setBlocked(true)
38
-
39
- } else {
40
- if (oldBlockedValue.value === false) {
41
- useReaderSettings.setBlocked(oldBlockedValue.value)
42
- }
43
- oldBlockedValue.value = null
44
- }
45
-
46
- if (footnote.value) {
47
- setTimeout(() => {
48
- const element = footnoteList.value.querySelector(`#${footnote.value.id}`)
49
- element.scrollIntoView()
50
- element.focus()
51
- }, 50)
52
- }
53
- }
54
- )
55
-
56
- </script>
57
-
58
- <template>
59
- <transition name="width">
60
- <div v-if="show || showFootnotes" id="asidebar"
61
- class="absolute top-0 right-0 w-96 md:w-[40em] flex-shrink-0 h-screen overflow-auto overflow-x-hidden z-20 shadow-2xl"
62
- >
63
- <button @click.prevent="hideAside()" class="fixed top-4 right-8 z-20">
64
- <IconClose class="w-6 h-6 text-white" />
65
- </button>
66
-
67
- <div class="w-full p-4">
68
- <header class="text-areia py-4 pl-4">
69
- <div class="flex items-center mb-6">
70
- <IconNotes class="w-8 h-8" />
71
- <span class="ml-4">
72
-
73
- Notas de rodapé
74
- <span class="ml-10">
75
- {{ footnotes.length }}
76
- </span>
77
- </span>
78
- </div>
79
- </header>
80
-
81
- <section>
82
- <ul ref="footnoteList">
83
- <li v-for="(footnoteItem, index) in footnotes"
84
- :key="footnoteItem.id"
85
- :id="footnoteItem.id"
86
- v-html="`<span class='footnote-index'>${index + 1}.</span> ${footnoteItem.text}`"
87
- class="text-left border-b border-b-white/25 last:border-transparent
88
- p-10 relative
89
- "
90
- :class="footnote && footnote.id !== footnoteItem.id
91
- ? 'opacity-50'
92
- : 'opacity-100'
93
- "></li>
94
- </ul>
95
- </section>
96
- </div>
97
- </div>
98
- </transition>
99
- </template>
100
-
101
-
102
-
103
- <style scoped>
104
- .width-enter-active,
105
- .width-leave-active {
106
- transition: width .5s;
107
- }
108
-
109
- .width-enter-active>* {
110
- transition-property: opacity;
111
- transition-duration: .2s;
112
- transition-delay: .3s;
113
- }
114
-
115
- .width-leave-active>* {
116
- transition: opacity .25s;
117
- }
118
-
119
- .width-enter,
120
- .width-leave-to {
121
- width: 0;
122
- }
123
- </style>
@@ -1,30 +0,0 @@
1
- <script setup>
2
- import SummaryButton from './SummaryButton/SummaryButton.vue';
3
- import OptionsButton from './OptionsButton/OptionsButton.vue';
4
- </script>
5
-
6
- <template>
7
- <header id="component-header" class="bg-primary flex justify-between items-center p-4">
8
- <summary-button>
9
- <template #summaryTop>
10
- <slot name="summaryTop" />
11
- </template>
12
- <template #summaryBottom>
13
- <slot name="summaryBottom" />
14
- </template>
15
- </summary-button>
16
-
17
- <div id="header-titles">
18
- <slot name="header" />
19
- </div>
20
-
21
- <options-button>
22
- <template #optionsTop>
23
- <slot name="optionsTop" />
24
- </template>
25
- <template #optionsBottom>
26
- <slot name="optionsBottom" />
27
- </template>
28
- </options-button>
29
- </header>
30
- </template>
@@ -1,67 +0,0 @@
1
- <script setup>
2
- import { ref } from 'vue'
3
- import { onClickOutside, onKeyStroke, useFullscreen } from '@vueuse/core'
4
-
5
- import useReaderSettings from '../../../composables/useReaderSettings'
6
-
7
- import IconThreeDots from '../../icons/ThreeDots.vue'
8
- import IconClose from '../../icons/Close.vue'
9
- import IconExpand from '../../icons/Expand.vue'
10
- import OptionsDropdown from './OptionsDropdown.vue'
11
-
12
- const show = ref(false)
13
- const button = ref(null)
14
-
15
- const toggleSummary = () => show.value = !show.value
16
- const hide = () => {
17
- if (!useReaderSettings.blocked.value) {
18
- show.value = false
19
- }
20
- }
21
-
22
- onClickOutside(button, () => hide())
23
- onKeyStroke('Escape', () => hide())
24
-
25
- const { toggle: toggleFullScreen } = useFullscreen()
26
- </script>
27
-
28
- <template>
29
- <div id="options-menu" ref="button" class="relative">
30
- <div class="flex">
31
- <button @click.prevent="toggleSummary()"
32
- class="border p-3 shadow flex items-center border-white text-white"
33
- id="options-button" aria-haspopup="true" :aria-expanded="show"
34
- >
35
- <span class="block mr-3">
36
- Opções
37
- </span>
38
-
39
- <IconClose v-if="show" class="w-6 h-6" />
40
- <IconThreeDots v-else class="w-6 h-6" />
41
- </button>
42
-
43
- <button @click.prevent="toggleFullScreen()"
44
- class="hidden md:flex items-center border p-3 shadow ml-3 border-white text-white"
45
- >
46
- <IconExpand class="w-6 h-6" />
47
- </button>
48
- </div>
49
-
50
- <transition enter-active-class="transition ease-out duration-100 transform" enter-class="opacity-0 scale-95"
51
- enter-to-class="opacity-100 scale-100" leave-active-class="transition ease-in duration-75 transform"
52
- leave-class="opacity-100 scale-100" leave-to-class="opacity-0 scale-95"
53
- >
54
- <OptionsDropdown v-show="show">
55
- <template #optionsTop>
56
- <slot name="optionsTop"/>
57
- </template>
58
- <template #optionsBottom>
59
- <slot name="optionsBottom"/>
60
- </template>
61
- </OptionsDropdown>
62
- </transition>
63
- </div>
64
- </template>
65
-
66
- <style>
67
- </style>