paginar 0.1.6 → 0.1.7

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.
@@ -1,177 +1,179 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8" />
6
- <link rel="icon" href="/favicon.ico" />
7
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
- <title>Slot - Paginar</title>
9
- </head>
10
-
11
- <body>
12
-
13
- <style>
14
- #app {
15
- height: 100vh;
16
- }
17
-
18
- html {
19
- --bg-light-mode: #fff7e0;
20
- --bg-dark-mode: rgb(45,45,45);
21
- --theme-primary: rgb(45,45,45);
22
- --theme-primary-extralight: rgb(243 244 246);
23
- --theme-secondary: #cd2800;
24
- }
25
-
26
- #pagination-el *::selection {
27
- color: var(--theme-primary-extralight, #690000);
28
- background: var(--theme-secondary, #ffa03c);
29
- }
30
- </style>
31
-
32
- <div id="app">
33
- <paginate-content id="pagination-el" book-title="A Tale of Two Cities">
34
- <div slot="header">
35
- <img src="https://sabia.pub/images/logo-mobile-dark.svg" style="height: 40px">
36
- </div>
37
- <div slot="content">
38
- <h2>
39
- CHAPTER I.<br>The Period
40
- </h2>
41
- <p>
42
- It was the (LUGONES, 1978) best of times, it was the worst of times, it was the age of
43
- wisdom, it was the age of foolishness, it was the epoch of belief, it was
44
- the epoch of incredulity, it was the season of Light, it was the season
45
- of Darkness, it was the spring of hope (GAMA, 2019), it was the winter of despair, we
46
- had everything before us, we had nothing before us, we were all going
47
- direct to Heaven, we were all going direct the other way—in short,
48
- the period was so far like the present period (GAMA, 2019), that some of its noisiest
49
- authorities insisted on its being received, for good or for evil, in the
50
- superlative degree of comparison only.
51
- </p>
52
- <p>
53
- There were a king with a large jaw and a queen with a plain face, on the
54
- throne of England; there were a king with (LEON, 2006) a large jaw and a queen with a
55
- fair face (LEON, 2006), on the throne of France (LUGONES, 1978). In both countries it was clearer than
56
- crystal to the lords of the State preserves of loaves and fishes, that
57
- things in general were settled for ever.
58
- </p>
59
- <p>
60
- It was the year of Our Lord one thousand seven hundred and seventy-five.
61
- Spiritual revelations were conceded to England at that favoured period, as
62
- at this. Mrs. Southcott had recently attained her five-and-twentieth
63
- blessed birthday, of whom a prophetic private in the Life Guards had
64
- heralded the sublime appearance by announcing that arrangements were made
65
- for the swallowing up of London and Westminster. Even the Cock-lane ghost
66
- had been laid only a round dozen of years, after rapping out its messages,
67
- as the spirits of this very year last past (supernaturally deficient in
68
- originality) rapped out theirs. Mere messages in the earthly order of
69
- events had lately come to the English Crown and People, from a congress of
70
- British subjects in America: which, strange to relate, have proved more
71
- important to the human race than any communications yet received through
72
- any of the chickens of the Cock-lane brood.
73
- </p>
74
- <p>
75
- France, less favoured on the whole as to matters spiritual than her sister
76
- of the shield and trident, rolled with exceeding smoothness down hill,
77
- making paper money and spending it. Under the guidance of her Christian
78
- pastors, she entertained herself, besides, with such humane achievements
79
- as sentencing a youth to have his hands cut off, his tongue torn out with
80
- pincers, and his body burned alive, because he had not kneeled down in the
81
- rain to do honour to a dirty procession of monks which passed within his
82
- view, at a distance of some fifty or sixty yards. It is likely enough
83
- that, rooted in the woods of France and Norway, there were growing trees,
84
- when that sufferer was put to death, already marked by the Woodman, Fate,
85
- to come down and be sawn into boards, to make a certain movable framework
86
- with a sack and a knife in it, terrible in history. It is likely enough
87
- that in the rough outhouses of some tillers of the heavy lands adjacent to
88
- Paris, there were sheltered from the weather that very day, rude carts,
89
- bespattered with rustic mire, snuffed about by pigs, and roosted in by
90
- poultry, which the Farmer, Death, had already set apart to be his tumbrils
91
- of the Revolution. But that Woodman and that Farmer, though they work
92
- unceasingly, work silently, and no one heard them as they went about with
93
- muffled tread: the rather, forasmuch as to entertain any suspicion that
94
- they were awake, was to be atheistical and traitorous.
95
- </p>
96
- <p>
97
- In England, there was scarcely an amount of order and protection to
98
- justify much national boasting. Daring burglaries by armed men, and
99
- highway robberies, took place in the capital itself every night; families
100
- were publicly cautioned not to go out of town without removing their
101
- furniture to upholsterers’ warehouses for security; the highwayman in the
102
- dark was a City tradesman in the light, and, being recognised and
103
- challenged by his fellow-tradesman whom he stopped in his character of
104
- “the Captain,” gallantly shot him through the head and rode away; the mail
105
- was waylaid by seven robbers, and the guard shot three dead, and then got
106
- shot dead himself by the other four, “in consequence of the failure of his
107
- ammunition:” after which the mail was robbed in peace; that magnificent
108
- potentate, the Lord Mayor of London, was made to stand and deliver on
109
- Turnham Green, by one highwayman, who despoiled the illustrious creature
110
- in sight of all his retinue; prisoners in London gaols fought battles with
111
- their turnkeys, and the majesty of the law fired blunderbusses in among
112
- them, loaded with rounds of shot and ball; thieves snipped off diamond
113
- crosses from the necks of noble lords at Court drawing-rooms; musketeers
114
- went into St. Giles’s, to search for contraband goods, and the mob fired
115
- on the musketeers, and the musketeers fired on the mob, and nobody thought
116
- any of these occurrences much out of the common way. In the midst of them,
117
- the hangman, ever busy and ever worse than useless, was in constant
118
- requisition; now, stringing up long rows of miscellaneous criminals; now,
119
- hanging a housebreaker on Saturday who had been taken on Tuesday; now,
120
- burning people in the hand at Newgate by the dozen, and now burning
121
- pamphlets at the door of Westminster Hall; to-day, taking the life of an
122
- atrocious murderer, and to-morrow of a wretched pilferer who had robbed a
123
- farmer’s boy of sixpence.
124
- </p>
125
- <p>
126
- All these things, and a thousand like them, came to pass in and close upon
127
- the dear old year one thousand seven hundred and seventy-five. Environed
128
- by them, while the Woodman and the Farmer worked unheeded, those two of
129
- the large jaws, and those other two of the plain and the fair faces, trod
130
- with stir enough, and carried their divine rights with a high hand. Thus
131
- did the year one thousand seven hundred and seventy-five conduct their
132
- Greatnesses, and myriads of small creatures—the creatures of this
133
- chronicle among the rest—along the roads that lay before them.
134
- </p>
135
-
136
- </div>
137
- </paginate-content>
138
- </div>
139
- <script>
140
- const settings = {
141
- baseFont: 'Verdana, sans-serif',
142
- }
143
-
144
- const content = {
145
- summary: [
146
- { title: 'Chapter 1', link: '/demo/slot/slot-chapter1.html' },
147
- { title: 'Chapter 2', link: '/demo/slot/slot-chapter2.html' },
148
- { title: 'Chapter 3', link: '/demo/slot/slot-chapter3.html' }
149
- ],
150
-
151
- references: [
152
- {
153
- "cit": "GAMA, 2019",
154
- "ref": "GAMA, Mara. <strong>As três rotas que trouxeram a centenária Bauhaus ao Brasil</strong>. Folha de São Paulo, São Paulo, 1 abr. 2019. Disponível em: https://www1.folha.uol.com.br/ilustrissima/2019/03/as-tres-rotas-que-trouxeram-a-centenaria-bauhaus-ao-brasil.shtml. Acesso em: 4 abr. 2019"
155
- },
156
- {
157
- "cit": "LEON, 2006",
158
- "ref": "LEON, Ethel. <strong>O Instituto de Arte Contemporânea do Museu de Arte Moderna (MAM) de São Paulo dos anos 1950</strong>. São Paulo, 2006."
159
- },
160
- {
161
- "cit": "LUGONES, 1978",
162
- "ref": "LUGONES, Maria. <strong>Colonialidad y género</strong>. Tábula Rasa, Bogotá, Colômbia, n. 9, p. 73-101, julho-dezembro de 1978."
163
- }
164
- ]
165
- }
166
-
167
- const paginationEl = document.getElementById('pagination-el')
168
- if (paginationEl) {
169
- paginationEl.setAttribute("reader-settings", JSON.stringify(settings))
170
- paginationEl.setAttribute("book-content", JSON.stringify(content))
171
- }
172
- </script>
173
- <script type="module" src="/src/main.js"></script>
174
-
175
- </body>
176
-
177
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <link rel="icon" href="/favicon.ico" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
+ <title>Slot - Paginar</title>
9
+ </head>
10
+
11
+ <body>
12
+
13
+ <style>
14
+ #app {
15
+ height: 100vh;
16
+ }
17
+
18
+ html {
19
+ --bg-light-mode: #fff7e0;
20
+ --bg-dark-mode: rgb(45,45,45);
21
+ --theme-primary: rgb(45,45,45);
22
+ --theme-primary-extralight: rgb(243 244 246);
23
+ --theme-secondary: #cd2800;
24
+ }
25
+
26
+ #pagination-el *::selection {
27
+ color: var(--theme-primary-extralight, #690000);
28
+ background: var(--theme-secondary, #ffa03c);
29
+ }
30
+ </style>
31
+
32
+ <div id="app">
33
+ <paginate-content id="pagination-el" book-title="A Tale of Two Cities"
34
+ css-string="#rootComponent.currentPage-1{background-color: red !important; transition: background-color 200ms linear;}"
35
+ >
36
+ <div slot="header">
37
+ <img src="https://sabia.pub/images/logo-mobile-dark.svg" style="height: 40px">
38
+ </div>
39
+ <div slot="content">
40
+ <h2>
41
+ CHAPTER I.<br>The Period
42
+ </h2>
43
+ <p>
44
+ It was the (LUGONES, 1978) best of times, it was the worst of times, it was the age of
45
+ wisdom, it was the age of foolishness, it was the epoch of belief, it was
46
+ the epoch of incredulity, it was the season of Light, it was the season
47
+ of Darkness, it was the spring of hope (GAMA, 2019), it was the winter of despair, we
48
+ had everything before us, we had nothing before us, we were all going
49
+ direct to Heaven, we were all going direct the other way—in short,
50
+ the period was so far like the present period (GAMA, 2019), that some of its noisiest
51
+ authorities insisted on its being received, for good or for evil, in the
52
+ superlative degree of comparison only.
53
+ </p>
54
+ <p>
55
+ There were a king with a large jaw and a queen with a plain face, on the
56
+ throne of England; there were a king with (LEON, 2006) a large jaw and a queen with a
57
+ fair face (LEON, 2006), on the throne of France (LUGONES, 1978). In both countries it was clearer than
58
+ crystal to the lords of the State preserves of loaves and fishes, that
59
+ things in general were settled for ever.
60
+ </p>
61
+ <p>
62
+ It was the year of Our Lord one thousand seven hundred and seventy-five.
63
+ Spiritual revelations were conceded to England at that favoured period, as
64
+ at this. Mrs. Southcott had recently attained her five-and-twentieth
65
+ blessed birthday, of whom a prophetic private in the Life Guards had
66
+ heralded the sublime appearance by announcing that arrangements were made
67
+ for the swallowing up of London and Westminster. Even the Cock-lane ghost
68
+ had been laid only a round dozen of years, after rapping out its messages,
69
+ as the spirits of this very year last past (supernaturally deficient in
70
+ originality) rapped out theirs. Mere messages in the earthly order of
71
+ events had lately come to the English Crown and People, from a congress of
72
+ British subjects in America: which, strange to relate, have proved more
73
+ important to the human race than any communications yet received through
74
+ any of the chickens of the Cock-lane brood.
75
+ </p>
76
+ <p>
77
+ France, less favoured on the whole as to matters spiritual than her sister
78
+ of the shield and trident, rolled with exceeding smoothness down hill,
79
+ making paper money and spending it. Under the guidance of her Christian
80
+ pastors, she entertained herself, besides, with such humane achievements
81
+ as sentencing a youth to have his hands cut off, his tongue torn out with
82
+ pincers, and his body burned alive, because he had not kneeled down in the
83
+ rain to do honour to a dirty procession of monks which passed within his
84
+ view, at a distance of some fifty or sixty yards. It is likely enough
85
+ that, rooted in the woods of France and Norway, there were growing trees,
86
+ when that sufferer was put to death, already marked by the Woodman, Fate,
87
+ to come down and be sawn into boards, to make a certain movable framework
88
+ with a sack and a knife in it, terrible in history. It is likely enough
89
+ that in the rough outhouses of some tillers of the heavy lands adjacent to
90
+ Paris, there were sheltered from the weather that very day, rude carts,
91
+ bespattered with rustic mire, snuffed about by pigs, and roosted in by
92
+ poultry, which the Farmer, Death, had already set apart to be his tumbrils
93
+ of the Revolution. But that Woodman and that Farmer, though they work
94
+ unceasingly, work silently, and no one heard them as they went about with
95
+ muffled tread: the rather, forasmuch as to entertain any suspicion that
96
+ they were awake, was to be atheistical and traitorous.
97
+ </p>
98
+ <p>
99
+ In England, there was scarcely an amount of order and protection to
100
+ justify much national boasting. Daring burglaries by armed men, and
101
+ highway robberies, took place in the capital itself every night; families
102
+ were publicly cautioned not to go out of town without removing their
103
+ furniture to upholsterers’ warehouses for security; the highwayman in the
104
+ dark was a City tradesman in the light, and, being recognised and
105
+ challenged by his fellow-tradesman whom he stopped in his character of
106
+ “the Captain,” gallantly shot him through the head and rode away; the mail
107
+ was waylaid by seven robbers, and the guard shot three dead, and then got
108
+ shot dead himself by the other four, “in consequence of the failure of his
109
+ ammunition:” after which the mail was robbed in peace; that magnificent
110
+ potentate, the Lord Mayor of London, was made to stand and deliver on
111
+ Turnham Green, by one highwayman, who despoiled the illustrious creature
112
+ in sight of all his retinue; prisoners in London gaols fought battles with
113
+ their turnkeys, and the majesty of the law fired blunderbusses in among
114
+ them, loaded with rounds of shot and ball; thieves snipped off diamond
115
+ crosses from the necks of noble lords at Court drawing-rooms; musketeers
116
+ went into St. Giles’s, to search for contraband goods, and the mob fired
117
+ on the musketeers, and the musketeers fired on the mob, and nobody thought
118
+ any of these occurrences much out of the common way. In the midst of them,
119
+ the hangman, ever busy and ever worse than useless, was in constant
120
+ requisition; now, stringing up long rows of miscellaneous criminals; now,
121
+ hanging a housebreaker on Saturday who had been taken on Tuesday; now,
122
+ burning people in the hand at Newgate by the dozen, and now burning
123
+ pamphlets at the door of Westminster Hall; to-day, taking the life of an
124
+ atrocious murderer, and to-morrow of a wretched pilferer who had robbed a
125
+ farmer’s boy of sixpence.
126
+ </p>
127
+ <p>
128
+ All these things, and a thousand like them, came to pass in and close upon
129
+ the dear old year one thousand seven hundred and seventy-five. Environed
130
+ by them, while the Woodman and the Farmer worked unheeded, those two of
131
+ the large jaws, and those other two of the plain and the fair faces, trod
132
+ with stir enough, and carried their divine rights with a high hand. Thus
133
+ did the year one thousand seven hundred and seventy-five conduct their
134
+ Greatnesses, and myriads of small creatures—the creatures of this
135
+ chronicle among the rest—along the roads that lay before them.
136
+ </p>
137
+
138
+ </div>
139
+ </paginate-content>
140
+ </div>
141
+ <script>
142
+ const settings = {
143
+ baseFont: 'Verdana, sans-serif',
144
+ }
145
+
146
+ const content = {
147
+ summary: [
148
+ { title: 'Chapter 1', link: '/demo/slot/slot-chapter1.html' },
149
+ { title: 'Chapter 2', link: '/demo/slot/slot-chapter2.html' },
150
+ { title: 'Chapter 3', link: '/demo/slot/slot-chapter3.html' }
151
+ ],
152
+
153
+ references: [
154
+ {
155
+ "cit": "GAMA, 2019",
156
+ "ref": "GAMA, Mara. <strong>As três rotas que trouxeram a centenária Bauhaus ao Brasil</strong>. Folha de São Paulo, São Paulo, 1 abr. 2019. Disponível em: https://www1.folha.uol.com.br/ilustrissima/2019/03/as-tres-rotas-que-trouxeram-a-centenaria-bauhaus-ao-brasil.shtml. Acesso em: 4 abr. 2019"
157
+ },
158
+ {
159
+ "cit": "LEON, 2006",
160
+ "ref": "LEON, Ethel. <strong>O Instituto de Arte Contemporânea do Museu de Arte Moderna (MAM) de São Paulo dos anos 1950</strong>. São Paulo, 2006."
161
+ },
162
+ {
163
+ "cit": "LUGONES, 1978",
164
+ "ref": "LUGONES, Maria. <strong>Colonialidad y género</strong>. Tábula Rasa, Bogotá, Colômbia, n. 9, p. 73-101, julho-dezembro de 1978."
165
+ }
166
+ ]
167
+ }
168
+
169
+ const paginationEl = document.getElementById('pagination-el')
170
+ if (paginationEl) {
171
+ paginationEl.setAttribute("reader-settings", JSON.stringify(settings))
172
+ paginationEl.setAttribute("book-content", JSON.stringify(content))
173
+ }
174
+ </script>
175
+ <script type="module" src="/src/main.js"></script>
176
+
177
+ </body>
178
+
179
+ </html>
package/dist/index.es.js CHANGED
@@ -9656,10 +9656,7 @@ async function stylesheetLoader(stylesheet, ref) {
9656
9656
  const dataRef = await fetch(stylesheet);
9657
9657
  const cssText = await dataRef.text();
9658
9658
 
9659
- const style = document.createElement('style');
9660
- ref.value.appendChild(style);
9661
- style.type = 'text/css';
9662
- style.appendChild(document.createTextNode(cssText));
9659
+ applyStylesheet(cssText, ref);
9663
9660
 
9664
9661
  } catch (err) {
9665
9662
  console.log({ err });
@@ -9667,9 +9664,17 @@ async function stylesheetLoader(stylesheet, ref) {
9667
9664
  }
9668
9665
  }
9669
9666
 
9667
+ async function applyStylesheet(stylesheet, ref) {
9668
+ const style = document.createElement('style');
9669
+ ref.value.appendChild(style);
9670
+ style.type = 'text/css';
9671
+ style.appendChild(document.createTextNode(stylesheet));
9672
+ }
9673
+
9670
9674
  const useStyles = {
9671
9675
  fontLoader,
9672
- stylesheetLoader
9676
+ stylesheetLoader,
9677
+ applyStylesheet
9673
9678
  };
9674
9679
 
9675
9680
  const state = reactive({
@@ -10424,7 +10429,8 @@ const _sfc_main = {
10424
10429
  type: String,
10425
10430
  default: ''
10426
10431
  },
10427
- cssFile: String
10432
+ cssFile: String,
10433
+ cssString: String
10428
10434
  },
10429
10435
  setup(__props) {
10430
10436
 
@@ -10449,6 +10455,10 @@ onMounted(async () => {
10449
10455
  if (props.cssFile) {
10450
10456
  useStyles.stylesheetLoader(props.cssFile, rootComponent);
10451
10457
  }
10458
+
10459
+ if (props.cssString) {
10460
+ useStyles.applyStylesheet(props.cssString, rootComponent);
10461
+ }
10452
10462
  });
10453
10463
 
10454
10464
  watchDebounced(