yapp 4.0.249 → 5.0.1
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 +8 -8
- package/example.js +41 -39
- package/lib/utilities/plugin.js +10 -6
- package/lib/utilities/properties.js +7 -9
- package/lib/yapp.js +9 -9
- package/package.json +1 -1
- package/src/utilities/plugin.js +10 -8
- package/src/utilities/properties.js +4 -6
- package/src/yapp.js +8 -9
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ import Yapp from "yapp";
|
|
|
83
83
|
import { renderYappStyles } from "yapp";
|
|
84
84
|
|
|
85
85
|
const body = document.querySelector("body"),
|
|
86
|
-
yapp = Yapp.
|
|
86
|
+
yapp = Yapp.fromContentAndOptions(` ... `, {});
|
|
87
87
|
|
|
88
88
|
renderYappStyles();
|
|
89
89
|
|
|
@@ -105,7 +105,7 @@ import { Body } from "easy";
|
|
|
105
105
|
import { renderYappStyles } from "yapp";
|
|
106
106
|
|
|
107
107
|
const body = new Body(),
|
|
108
|
-
yapp = Yapp.
|
|
108
|
+
yapp = Yapp.fromContentAndOptions(` ... `, {});
|
|
109
109
|
|
|
110
110
|
renderYappStyles();
|
|
111
111
|
|
|
@@ -160,15 +160,15 @@ rootDiv.mount(yapp);
|
|
|
160
160
|
|
|
161
161
|
## Configuration
|
|
162
162
|
|
|
163
|
-
Yapp takes some
|
|
163
|
+
Yapp takes some parameters, These can be passed as arguments to the `fromContentAndOptions(...)` factory method or as attributes in the JSX. Intermediate arguments can be left as falsey when passing the latter arguments to the `fromContentAndOptions(...)` factory method:
|
|
164
164
|
|
|
165
165
|
```
|
|
166
|
-
const
|
|
167
|
-
|
|
166
|
+
const options = {
|
|
167
|
+
language: "json",
|
|
168
168
|
editable: true,
|
|
169
169
|
onCustomContentChange: coCustomntentChangeHandler
|
|
170
170
|
},
|
|
171
|
-
yapp = Yapp.
|
|
171
|
+
yapp = Yapp.fromContentAndOptions(` ... `, options);
|
|
172
172
|
```
|
|
173
173
|
When using JSX, the properties of the `options` parameter are in fact passed individually:
|
|
174
174
|
|
|
@@ -194,7 +194,7 @@ The only other option is the `firaCode` option, covered next.
|
|
|
194
194
|
|
|
195
195
|
## Fira Code support
|
|
196
196
|
|
|
197
|
-
Yapp supports [Fira Code](https://github.com/tonsky/FiraCode). To enable it, add the `firaCode` option either to the `options` object if you are using the `
|
|
197
|
+
Yapp supports [Fira Code](https://github.com/tonsky/FiraCode). To enable it, add the `firaCode` option either to the `options` object if you are using the `fromContentAndOptions(...)` factory method or as an attribute if using JSX:
|
|
198
198
|
|
|
199
199
|
```
|
|
200
200
|
<Yapp firaCode ... >{`
|
|
@@ -330,7 +330,7 @@ You can hide the scrollbars and gutter with the `hiddenScrollbars` and `hiddenGu
|
|
|
330
330
|
|
|
331
331
|
## Plugins
|
|
332
332
|
|
|
333
|
-
If you have been supplied with a plugin, or have written your own, it is straightforward to appraise Yapp of it by way of the
|
|
333
|
+
If you have been supplied with a plugin, or have written your own, it is straightforward to appraise Yapp of it by way of a property of the `options` argument of the `fromContentAndOptions(...)` factory method or as a JSX attribute. The remainder of this section covers authoring plugins. It assumes that you are able to build the examples, each of which corresponds to a built-in plugin. See the section on building later on for details.
|
|
334
334
|
|
|
335
335
|
To begin to author your own plugin, follow these steps:
|
|
336
336
|
|