@nypl/web-reader 1.2.1 → 2.0.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 +20 -8
- package/dist/cjs/index.js +291 -13
- package/dist/cjs/index.js.map +3 -3
- package/dist/esm/index.js +11565 -10480
- package/dist/esm/index.js.map +3 -3
- package/dist/injectable-html-styles/ReadiumCSS-after.css +2 -0
- package/dist/injectable-html-styles/ReadiumCSS-after.css.map +7 -0
- package/dist/injectable-html-styles/ReadiumCSS-before.css +2 -0
- package/dist/injectable-html-styles/ReadiumCSS-before.css.map +7 -0
- package/dist/injectable-html-styles/ReadiumCSS-default.css +2 -0
- package/dist/injectable-html-styles/ReadiumCSS-default.css.map +7 -0
- package/dist/types/ui/menu/use-menu.d.ts +651 -639
- package/dist/types/utils/localstorage.d.ts +2 -2
- package/package.json +17 -17
- package/dist/injectable-html-styles.css +0 -2
- package/dist/injectable-html-styles.css.map +0 -7
package/README.md
CHANGED
|
@@ -131,23 +131,35 @@ The HTML Reader has the ability to inject custom elements into the reader iframe
|
|
|
131
131
|
|
|
132
132
|
In the below example, we show two different ways to do this.
|
|
133
133
|
|
|
134
|
-
1.
|
|
134
|
+
1. We export the Readium CSS stylesheets compiled under `@nypl/web-reader/dist/injectable-html-styles/*.css`. These css files can then be imported via webpack as a url to a static file that is copied to the dist folder. You can then use this url in your injectable config.
|
|
135
135
|
2. The `fontInjectable` uses a plain url to a css file that we host normally on our site. In this case you would be responsible for copying the css file into your source code and making sure it is hosted at some location.
|
|
136
136
|
|
|
137
137
|
```ts
|
|
138
|
-
import
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
138
|
+
import readiumBefore from '!file-loader!extract-loader!css-loader!@nypl/web-reader/dist/injectable-html-styles/ReadiumCSS-before.css';
|
|
139
|
+
import readiumDefault from '!file-loader!extract-loader!css-loader!@nypl/web-reader/dist/injectable-html-styles/ReadiumCSS-default.css';
|
|
140
|
+
import readiumAfter from '!file-loader!extract-loader!css-loader!@nypl/web-reader/dist/injectable-html-styles/ReadiumCSS-after.css';
|
|
141
|
+
|
|
142
|
+
const cssInjectables: Injectable[] = [
|
|
143
|
+
{
|
|
144
|
+
type: 'style',
|
|
145
|
+
url: readiumBefore,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: 'style',
|
|
149
|
+
url: readiumDefault,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
type: 'style',
|
|
153
|
+
url: readiumAfter,
|
|
154
|
+
},
|
|
155
|
+
];
|
|
144
156
|
const fontInjectable: Injectable = {
|
|
145
157
|
type: 'style',
|
|
146
158
|
url: `${origin}/fonts/opendyslexic/opendyslexic.css`,
|
|
147
159
|
fontFamily: 'opendyslexic',
|
|
148
160
|
};
|
|
149
161
|
|
|
150
|
-
const htmlInjectables = [
|
|
162
|
+
const htmlInjectables = [...cssInjectables, fontInjectable];
|
|
151
163
|
|
|
152
164
|
const Reader = () => {
|
|
153
165
|
return (
|