@bitbindle/prosemirror-view 0.0.0-stage → 1.44.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/.tern-project +8 -0
- package/CHANGELOG.md +2639 -0
- package/CONTRIBUTING.md +104 -0
- package/FORK.md +67 -0
- package/LICENSE +19 -0
- package/README.md +27 -2
- package/dist/index.cjs +5668 -0
- package/dist/index.d.cts +921 -0
- package/dist/index.d.ts +921 -0
- package/dist/index.js +6135 -0
- package/package/bitbindle-prosemirror-view-1.44.1.tgz +0 -0
- package/package.json +53 -4
- package/src/README.md +38 -0
- package/src/browser.ts +18 -0
- package/src/capturekeys.ts +317 -0
- package/src/clipboard.ts +282 -0
- package/src/decoration.ts +834 -0
- package/src/dom.ts +174 -0
- package/src/domchange.ts +363 -0
- package/src/domcoords.ts +557 -0
- package/src/domobserver.ts +279 -0
- package/src/index.ts +800 -0
- package/src/input.ts +1001 -0
- package/src/selection.ts +460 -0
- package/src/viewdesc.ts +1518 -0
- package/style/prosemirror.css +54 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# How to contribute
|
|
2
|
+
|
|
3
|
+
- [Getting help](#getting-help)
|
|
4
|
+
- [Submitting bug reports](#submitting-bug-reports)
|
|
5
|
+
- [Contributing code](#contributing-code)
|
|
6
|
+
|
|
7
|
+
## Getting help
|
|
8
|
+
|
|
9
|
+
Community discussion, questions, and informal bug reporting is done on the
|
|
10
|
+
[discuss.ProseMirror forum](http://discuss.prosemirror.net).
|
|
11
|
+
|
|
12
|
+
## Submitting bug reports
|
|
13
|
+
|
|
14
|
+
Report bugs on the
|
|
15
|
+
[issue tracker](https://code.haverbeke.berlin/prosemirror/prosemirror/issues).
|
|
16
|
+
Before reporting a bug, please read these pointers.
|
|
17
|
+
|
|
18
|
+
- The issue tracker is for *bugs*, not requests for help. Questions
|
|
19
|
+
should be asked on the [forum](http://discuss.prosemirror.net).
|
|
20
|
+
|
|
21
|
+
- Include information about the version of the code that exhibits the
|
|
22
|
+
problem. For browser-related issues, include the browser and browser
|
|
23
|
+
version on which the problem occurred.
|
|
24
|
+
|
|
25
|
+
- Mention very precisely what went wrong. "X is broken" is not a good
|
|
26
|
+
bug report. What did you expect to happen? What happened instead?
|
|
27
|
+
Describe the exact steps a maintainer has to take to make the
|
|
28
|
+
problem occur. A screencast can be useful, but is no substitute for
|
|
29
|
+
a textual description.
|
|
30
|
+
|
|
31
|
+
- A great way to make it easy to reproduce your problem, if it can not
|
|
32
|
+
be trivially reproduced on the website demos, is to submit a script
|
|
33
|
+
that triggers the issue.
|
|
34
|
+
|
|
35
|
+
## Contributing code
|
|
36
|
+
|
|
37
|
+
Code generated by a language model is not welcome in this project.
|
|
38
|
+
Please don't waste my time with it.
|
|
39
|
+
|
|
40
|
+
If you want to make a change that involves a significant overhaul of
|
|
41
|
+
the code or introduces a user-visible new feature, create an
|
|
42
|
+
[issue](https://code.haverbeke.berlin/prosemirror/prosemirror/issues/)
|
|
43
|
+
first with your proposal.
|
|
44
|
+
|
|
45
|
+
- Make sure you have a [Codeberg](https://codeberg.org/user/sign_up)
|
|
46
|
+
or [GitHub](https://github.com/signup/free) account.
|
|
47
|
+
|
|
48
|
+
- Use that to create a [code.haverbeke.berlin
|
|
49
|
+
account](https://code.haverbeke.berlin/user/login).
|
|
50
|
+
|
|
51
|
+
- Fork the relevant repository.
|
|
52
|
+
|
|
53
|
+
- Create a local checkout of the code. You can use the
|
|
54
|
+
[main repository](https://code.haverbeke.berlin/prosemirror/prosemirror) to
|
|
55
|
+
easily check out all core modules.
|
|
56
|
+
|
|
57
|
+
- Make your changes, and commit them
|
|
58
|
+
|
|
59
|
+
- If your changes are easy to test or likely to regress, add tests in
|
|
60
|
+
the relevant `test/` directory. Either put them in an existing
|
|
61
|
+
`test-*.js` file, if they fit there, or add a new file.
|
|
62
|
+
|
|
63
|
+
- Make sure all tests pass. Run `npm run test` to verify tests pass
|
|
64
|
+
(you will need Node.js v6+).
|
|
65
|
+
|
|
66
|
+
- Submit a pull request. Don't put more than one feature/fix in a
|
|
67
|
+
single pull request.
|
|
68
|
+
|
|
69
|
+
By contributing code to ProseMirror you
|
|
70
|
+
|
|
71
|
+
- Agree to license the contributed code under the project's [MIT
|
|
72
|
+
license](https://code.haverbeke.berlin/prosemirror/prosemirror/blob/main/LICENSE).
|
|
73
|
+
|
|
74
|
+
- Confirm that you have the right to contribute and license the code
|
|
75
|
+
in question. (Either you hold all rights on the code, or the rights
|
|
76
|
+
holder has explicitly granted the right to use it like this,
|
|
77
|
+
through a compatible open source license or through a direct
|
|
78
|
+
agreement with you.)
|
|
79
|
+
|
|
80
|
+
### Coding standards
|
|
81
|
+
|
|
82
|
+
- ES6 syntax, targeting an ES5 runtime (i.e. don't use library
|
|
83
|
+
elements added by ES6, don't use ES7/ES.next syntax).
|
|
84
|
+
|
|
85
|
+
- 2 spaces per indentation level, no tabs.
|
|
86
|
+
|
|
87
|
+
- No semicolons except when necessary.
|
|
88
|
+
|
|
89
|
+
- Follow the surrounding code when it comes to spacing, brace
|
|
90
|
+
placement, etc.
|
|
91
|
+
|
|
92
|
+
- Brace-less single-statement bodies are encouraged whenever they
|
|
93
|
+
don't impact readability.
|
|
94
|
+
|
|
95
|
+
- [getdocs-ts](https://code.haverbeke.berlin/marijn/getdocs-ts)-style doc comments
|
|
96
|
+
above items that are part of the public API.
|
|
97
|
+
|
|
98
|
+
- When documenting non-public items, you can put the type after a
|
|
99
|
+
single colon, so that getdocs doesn't pick it up and add it to the
|
|
100
|
+
API reference.
|
|
101
|
+
|
|
102
|
+
- ProseMirror does *not* follow JSHint or JSLint prescribed style.
|
|
103
|
+
Patches that try to 'fix' code to pass one of these linters will not
|
|
104
|
+
be accepted.
|
package/FORK.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @bitbindle/prosemirror-view
|
|
2
|
+
|
|
3
|
+
This repository is a fork of [prosemirror-view](https://code.haverbeke.berlin/prosemirror/prosemirror-view), the view component of ProseMirror.
|
|
4
|
+
BitBindle publishes it to npm as `@bitbindle/prosemirror-view`.
|
|
5
|
+
The license is MIT, as upstream (`LICENSE`).
|
|
6
|
+
|
|
7
|
+
## Branches and tags
|
|
8
|
+
|
|
9
|
+
- `main` holds the upstream history and the commits of the fork on top of it. The fork starts at the upstream tag 1.44.1, commit `ee4ae31` ("Mark version 1.44.1").
|
|
10
|
+
- The `v<version>` tags are the releases of the fork. The workflow `publish.yml` creates them.
|
|
11
|
+
- The repository has no upstream tags. Fetch them from the remote `upstream` (see "Update to a new upstream version").
|
|
12
|
+
|
|
13
|
+
## Changes to upstream
|
|
14
|
+
|
|
15
|
+
| Commit | Change |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| "Publish the fork as @bitbindle/prosemirror-view" | The package name, the repository URL, a lockfile, and a test runner for the Chromium of Playwright. |
|
|
18
|
+
| "Only scan inline decorations in DecorationSet.forChild" | `forChild` reads only the inline decorations of a set. A set with many node decorations on top-level nodes made each redraw cost (top-level nodes) x (node decorations). |
|
|
19
|
+
|
|
20
|
+
## Build and test
|
|
21
|
+
|
|
22
|
+
1. Run `npm ci`. The script `prepare` builds `dist/` and `test/*.js`.
|
|
23
|
+
2. Run `npx playwright install chromium` once.
|
|
24
|
+
3. Run `npm test`.
|
|
25
|
+
|
|
26
|
+
`test/run-browser-tests.cjs` runs the upstream browser tests in the Chromium of Playwright.
|
|
27
|
+
Its list `knownFailures` names upstream tests that also fail on the upstream source. The runner reports them, but they do not fail the run.
|
|
28
|
+
The workflow `ci.yml` runs the tests for each pull request and each push to `main`.
|
|
29
|
+
|
|
30
|
+
## Versions
|
|
31
|
+
|
|
32
|
+
The version in `package.json` is the upstream version that the fork is based on.
|
|
33
|
+
Each release is the next patch version in the same major.minor line.
|
|
34
|
+
It is higher than the upstream version and than each release of the fork in that line.
|
|
35
|
+
For example, the first release on upstream 1.44.1 is 1.44.2, and the next is 1.44.3.
|
|
36
|
+
A release version does not match the upstream release with the same number. The release notes name the upstream base.
|
|
37
|
+
`.github/scripts/next-version.mjs` computes the version from `package.json`, the `v*` tags and the versions on npm.
|
|
38
|
+
|
|
39
|
+
## Release
|
|
40
|
+
|
|
41
|
+
1. Merge the changes into `main`.
|
|
42
|
+
2. In the Actions tab, run the workflow "Publish" on `main`.
|
|
43
|
+
|
|
44
|
+
The workflow has two jobs:
|
|
45
|
+
|
|
46
|
+
1. The job `build` installs the dependencies, runs the tests, computes the version and packs the package. It has no token that can publish or write.
|
|
47
|
+
2. The job `publish` installs nothing. It publishes the packed file to npm with provenance, and it creates the GitHub release `v<version>` for the commit, with release notes that GitHub generates from the merged pull requests.
|
|
48
|
+
|
|
49
|
+
The workflow does not commit the version. The tag of the release marks the commit that the package was built from.
|
|
50
|
+
|
|
51
|
+
## Setup
|
|
52
|
+
|
|
53
|
+
Do these steps once, before the first release:
|
|
54
|
+
|
|
55
|
+
1. Make this repository public. npm provenance needs a public source repository, and the workflow stops if the repository is private.
|
|
56
|
+
2. Give the workflow access to npm in one of these ways:
|
|
57
|
+
- Add the repository secret `NPM_TOKEN`: a granular npm access token that can publish packages of the scope `@bitbindle`.
|
|
58
|
+
- Set up npm trusted publishing for the package, for the repository `BitBindle/prosemirror-view` and the workflow `publish.yml`. npm accepts this only for a package that exists, so the first release needs `NPM_TOKEN`. Then remove the secret.
|
|
59
|
+
|
|
60
|
+
## Update to a new upstream version
|
|
61
|
+
|
|
62
|
+
1. If the clone has no remote `upstream`, run `git remote add upstream https://code.haverbeke.berlin/prosemirror/prosemirror-view`.
|
|
63
|
+
2. Run `git fetch upstream --tags`.
|
|
64
|
+
3. Merge the upstream tag into `main`, for example `git merge 1.45.0`. Do not rebase `main`: the release tags point to its commits.
|
|
65
|
+
4. Fix the conflicts. Keep the upstream version in `package.json`: the next release counts from it.
|
|
66
|
+
5. Run `npm install` and `npm test`.
|
|
67
|
+
6. Open a pull request.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (C) 2015-2017 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# prosemirror-view
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[ [**WEBSITE**](https://prosemirror.net) | [**ISSUES**](https://code.haverbeke.berlin/prosemirror/prosemirror/issues) | [**FORUM**](https://discuss.prosemirror.net) | [**CHANGELOG**](https://code.haverbeke.berlin/prosemirror/prosemirror-view/src/branch/main/CHANGELOG.md) ]
|
|
4
|
+
|
|
5
|
+
This is a [core module](https://prosemirror.net/docs/ref/#view) of [ProseMirror](https://prosemirror.net).
|
|
6
|
+
ProseMirror is a well-behaved rich semantic content editor based on
|
|
7
|
+
contentEditable, with support for collaborative editing and custom
|
|
8
|
+
document schemas.
|
|
9
|
+
|
|
10
|
+
This [module](https://prosemirror.net/docs/ref/#view) exports the editor
|
|
11
|
+
view, which renders the current document in the browser, and handles
|
|
12
|
+
user events.
|
|
13
|
+
|
|
14
|
+
The [project page](https://prosemirror.net) has more information, a
|
|
15
|
+
number of [examples](https://prosemirror.net/examples/) and the
|
|
16
|
+
[documentation](https://prosemirror.net/docs/).
|
|
17
|
+
|
|
18
|
+
This code is released under an
|
|
19
|
+
[MIT license](https://code.haverbeke.berlin/prosemirror/prosemirror/src/branch/main/LICENSE).
|
|
20
|
+
There's a [forum](http://discuss.prosemirror.net) for general
|
|
21
|
+
discussion and support requests, and the
|
|
22
|
+
[bug tracker](https://code.haverbeke.berlin/prosemirror/prosemirror/issues)
|
|
23
|
+
is the place to report issues.
|
|
24
|
+
|
|
25
|
+
We aim to be an inclusive, welcoming community. To make that explicit,
|
|
26
|
+
we have a [code of
|
|
27
|
+
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
|
|
28
|
+
to communication around the project.
|