pax_global_header00006660000000000000000000000064135651673760014535gustar00rootroot0000000000000052 comment=76d6a7e16d17704b1cc8665d9c786fe91e3b1dc7 prosemirror-schema-basic-1.1.2/000077500000000000000000000000001356516737600164365ustar00rootroot00000000000000prosemirror-schema-basic-1.1.2/.gitignore000066400000000000000000000000731356516737600204260ustar00rootroot00000000000000/node_modules .tern-port /dist /notes.txt webpack.config.jsprosemirror-schema-basic-1.1.2/.npmignore000066400000000000000000000000371356516737600204350ustar00rootroot00000000000000/node_modules .tern-port /test prosemirror-schema-basic-1.1.2/.tern-project000066400000000000000000000001571356516737600210560ustar00rootroot00000000000000{ "libs": ["browser"], "plugins": { "node": {}, "complete_strings": {}, "es_modules": {} } } prosemirror-schema-basic-1.1.2/CHANGELOG.md000066400000000000000000000024371356516737600202550ustar00rootroot00000000000000## 1.1.2 (2019-11-20) ### Bug fixes Rename ES module files to use a .js extension, since Webpack gets confused by .mjs ## 1.1.1 (2019-11-19) ### Bug fixes The file referred to in the package's `module` field now is compiled down to ES5. ## 1.1.0 (2019-11-08) ### New features Add a `module` field to package json file. ## 1.0.1 (2019-04-18) ### Bug fixes Make sure images and links don't render whatever happens to be in `node.attrs` to the DOM. ## 0.19.0 (2017-03-16) ### Breaking changes Link marks are now non-inclusive by default. ## 0.12.0 (2016-10-21) ### Bug fixes Don't treat \ as strong when parsing. (Google Docs puts such ridiculous HTML on the clipboard.) ## 0.11.0 (2016-09-21) ### Breaking changes Moved into a separate module. No longer exports the [specs](http://prosemirror.net/docs/ref/version/0.11.0.html#model.NodeSpec) for the nodes and marks separately, since they are now plain objects, not subclasses. They are still exported through [nodes](http://prosemirror.net/docs/ref/version/0.11.0.html#schema-basic.nodes) and [marks](http://prosemirror.net/docs/ref/version/0.11.0.html#schema-basic.marks) objects. The list-related nodes were moved to the [schema-list](http://prosemirror.net/docs/ref/version/0.11.0.html#schema-list) module. prosemirror-schema-basic-1.1.2/CONTRIBUTING.md000066400000000000000000000072051356516737600206730ustar00rootroot00000000000000# How to contribute - [Getting help](#getting-help) - [Submitting bug reports](#submitting-bug-reports) - [Contributing code](#contributing-code) ## Getting help Community discussion, questions, and informal bug reporting is done on the [discuss.ProseMirror forum](http://discuss.prosemirror.net). ## Submitting bug reports Report bugs on the [GitHub issue tracker](http://github.com/prosemirror/prosemirror/issues). Before reporting a bug, please read these pointers. - The issue tracker is for *bugs*, not requests for help. Questions should be asked on the [forum](http://discuss.prosemirror.net). - Include information about the version of the code that exhibits the problem. For browser-related issues, include the browser and browser version on which the problem occurred. - Mention very precisely what went wrong. "X is broken" is not a good bug report. What did you expect to happen? What happened instead? Describe the exact steps a maintainer has to take to make the problem occur. A screencast can be useful, but is no substitute for a textual description. - A great way to make it easy to reproduce your problem, if it can not be trivially reproduced on the website demos, is to submit a script that triggers the issue. ## Contributing code - Make sure you have a [GitHub Account](https://github.com/signup/free) - Fork the relevant repository ([how to fork a repo](https://help.github.com/articles/fork-a-repo)) - Create a local checkout of the code. You can use the [main repository](https://github.com/prosemirror/prosemirror) to easily check out all core modules. - Make your changes, and commit them - Follow the code style of the rest of the project (see below). Run `npm run lint` (in the main repository checkout) to make sure that the linter is happy. - If your changes are easy to test or likely to regress, add tests in the relevant `test/` directory. Either put them in an existing `test-*.js` file, if they fit there, or add a new file. - Make sure all tests pass. Run `npm run test` to verify tests pass (you will need Node.js v6+). - Submit a pull request ([how to create a pull request](https://help.github.com/articles/fork-a-repo)). Don't put more than one feature/fix in a single pull request. By contributing code to ProseMirror you - Agree to license the contributed code under the project's [MIT license](https://github.com/ProseMirror/prosemirror/blob/master/LICENSE). - Confirm that you have the right to contribute and license the code in question. (Either you hold all rights on the code, or the rights holder has explicitly granted the right to use it like this, through a compatible open source license or through a direct agreement with you.) ### Coding standards - ES6 syntax, targeting an ES5 runtime (i.e. don't use library elements added by ES6, don't use ES7/ES.next syntax). - 2 spaces per indentation level, no tabs. - No semicolons except when necessary. - Follow the surrounding code when it comes to spacing, brace placement, etc. - Brace-less single-statement bodies are encouraged (whenever they don't impact readability). - [getdocs](https://github.com/marijnh/getdocs)-style doc comments above items that are part of the public API. - When documenting non-public items, you can put the type after a single colon, so that getdocs doesn't pick it up and add it to the API reference. - The linter (`npm run lint`) complains about unused variables and functions. Prefix their names with an underscore to muffle it. - ProseMirror does *not* follow JSHint or JSLint prescribed style. Patches that try to 'fix' code to pass one of these linters will not be accepted. prosemirror-schema-basic-1.1.2/LICENSE000066400000000000000000000021131356516737600174400ustar00rootroot00000000000000Copyright (C) 2015-2017 by Marijn Haverbeke and others Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. prosemirror-schema-basic-1.1.2/README.md000066400000000000000000000026451356516737600177240ustar00rootroot00000000000000# prosemirror-schema-basic [ [**WEBSITE**](http://prosemirror.net) | [**ISSUES**](https://github.com/prosemirror/prosemirror/issues) | [**FORUM**](https://discuss.prosemirror.net) | [**GITTER**](https://gitter.im/ProseMirror/prosemirror) | [**CHANGELOG**](https://github.com/ProseMirror/prosemirror/blob/master/CHANGELOG.md) ] This is a [schema module](http://prosemirror.net/docs/ref/#schema-basic) for [ProseMirror](http://prosemirror.net). ProseMirror is a well-behaved rich semantic content editor based on contentEditable, with support for collaborative editing and custom document schemas. This [module](http://prosemirror.net/docs/ref/#schema-basic) defines a basic ProseMirror document schema, whose elements can be reused in other schemas. The [project page](http://prosemirror.net) has more information, a number of [examples](http://prosemirror.net/examples/) and the [documentation](http://prosemirror.net/docs/). This code is released under an [MIT license](https://github.com/prosemirror/prosemirror/tree/master/LICENSE). There's a [forum](http://discuss.prosemirror.net) for general discussion and support requests, and the [Github bug tracker](https://github.com/prosemirror/prosemirror/issues) is the place to report issues. We aim to be an inclusive, welcoming community. To make that explicit, we have a [code of conduct](http://contributor-covenant.org/version/1/1/0/) that applies to communication around the project. prosemirror-schema-basic-1.1.2/package.json000066400000000000000000000013401356516737600207220ustar00rootroot00000000000000{ "name": "prosemirror-schema-basic", "version": "1.1.2", "description": "Basic schema elements for ProseMirror", "main": "dist/index.js", "module": "dist/index.es.js", "license": "MIT", "maintainers": [ { "name": "Marijn Haverbeke", "email": "marijnh@gmail.com", "web": "http://marijnhaverbeke.nl" } ], "repository": { "type": "git", "url": "git://github.com/prosemirror/prosemirror-schema-basic.git" }, "dependencies": { "prosemirror-model": "^1.2.0" }, "devDependencies": { "rollup": "^1.26.3", "@rollup/plugin-buble": "^0.20.0" }, "scripts": { "test": "true", "build": "rollup -c", "watch": "rollup -c -w", "prepare": "npm run build" } } prosemirror-schema-basic-1.1.2/rollup.config.js000066400000000000000000000004651356516737600215620ustar00rootroot00000000000000module.exports = { input: './src/schema-basic.js', output: [{ file: 'dist/index.js', format: 'cjs', sourcemap: true }, { file: 'dist/index.es.js', format: 'es', sourcemap: true }], plugins: [require('@rollup/plugin-buble')()], external(id) { return !/^[\.\/]/.test(id) } } prosemirror-schema-basic-1.1.2/src/000077500000000000000000000000001356516737600172255ustar00rootroot00000000000000prosemirror-schema-basic-1.1.2/src/README.md000066400000000000000000000002451356516737600205050ustar00rootroot00000000000000This module defines a simple schema. You can use it directly, extend it, or just pick out a few node and mark specs to use in a new schema. @schema @nodes @marks prosemirror-schema-basic-1.1.2/src/schema-basic.js000066400000000000000000000113631356516737600221060ustar00rootroot00000000000000import {Schema} from "prosemirror-model" const pDOM = ["p", 0], blockquoteDOM = ["blockquote", 0], hrDOM = ["hr"], preDOM = ["pre", ["code", 0]], brDOM = ["br"] // :: Object // [Specs](#model.NodeSpec) for the nodes defined in this schema. export const nodes = { // :: NodeSpec The top level document node. doc: { content: "block+" }, // :: NodeSpec A plain paragraph textblock. Represented in the DOM // as a `

` element. paragraph: { content: "inline*", group: "block", parseDOM: [{tag: "p"}], toDOM() { return pDOM } }, // :: NodeSpec A blockquote (`

`) wrapping one or more blocks. blockquote: { content: "block+", group: "block", defining: true, parseDOM: [{tag: "blockquote"}], toDOM() { return blockquoteDOM } }, // :: NodeSpec A horizontal rule (`
`). horizontal_rule: { group: "block", parseDOM: [{tag: "hr"}], toDOM() { return hrDOM } }, // :: NodeSpec A heading textblock, with a `level` attribute that // should hold the number 1 to 6. Parsed and serialized as `

` to // `

` elements. heading: { attrs: {level: {default: 1}}, content: "inline*", group: "block", defining: true, parseDOM: [{tag: "h1", attrs: {level: 1}}, {tag: "h2", attrs: {level: 2}}, {tag: "h3", attrs: {level: 3}}, {tag: "h4", attrs: {level: 4}}, {tag: "h5", attrs: {level: 5}}, {tag: "h6", attrs: {level: 6}}], toDOM(node) { return ["h" + node.attrs.level, 0] } }, // :: NodeSpec A code listing. Disallows marks or non-text inline // nodes by default. Represented as a `
` element with a
  // `` element inside of it.
  code_block: {
    content: "text*",
    marks: "",
    group: "block",
    code: true,
    defining: true,
    parseDOM: [{tag: "pre", preserveWhitespace: "full"}],
    toDOM() { return preDOM }
  },

  // :: NodeSpec The text node.
  text: {
    group: "inline"
  },

  // :: NodeSpec An inline image (``) node. Supports `src`,
  // `alt`, and `href` attributes. The latter two default to the empty
  // string.
  image: {
    inline: true,
    attrs: {
      src: {},
      alt: {default: null},
      title: {default: null}
    },
    group: "inline",
    draggable: true,
    parseDOM: [{tag: "img[src]", getAttrs(dom) {
      return {
        src: dom.getAttribute("src"),
        title: dom.getAttribute("title"),
        alt: dom.getAttribute("alt")
      }
    }}],
    toDOM(node) { let {src, alt, title} = node.attrs; return ["img", {src, alt, title}] }
  },

  // :: NodeSpec A hard line break, represented in the DOM as `
`. hard_break: { inline: true, group: "inline", selectable: false, parseDOM: [{tag: "br"}], toDOM() { return brDOM } } } const emDOM = ["em", 0], strongDOM = ["strong", 0], codeDOM = ["code", 0] // :: Object [Specs](#model.MarkSpec) for the marks in the schema. export const marks = { // :: MarkSpec A link. Has `href` and `title` attributes. `title` // defaults to the empty string. Rendered and parsed as an `` // element. link: { attrs: { href: {}, title: {default: null} }, inclusive: false, parseDOM: [{tag: "a[href]", getAttrs(dom) { return {href: dom.getAttribute("href"), title: dom.getAttribute("title")} }}], toDOM(node) { let {href, title} = node.attrs; return ["a", {href, title}, 0] } }, // :: MarkSpec An emphasis mark. Rendered as an `` element. // Has parse rules that also match `` and `font-style: italic`. em: { parseDOM: [{tag: "i"}, {tag: "em"}, {style: "font-style=italic"}], toDOM() { return emDOM } }, // :: MarkSpec A strong mark. Rendered as ``, parse rules // also match `` and `font-weight: bold`. strong: { parseDOM: [{tag: "strong"}, // This works around a Google Docs misbehavior where // pasted content will be inexplicably wrapped in `` // tags with a font-weight normal. {tag: "b", getAttrs: node => node.style.fontWeight != "normal" && null}, {style: "font-weight", getAttrs: value => /^(bold(er)?|[5-9]\d{2,})$/.test(value) && null}], toDOM() { return strongDOM } }, // :: MarkSpec Code font mark. Represented as a `` element. code: { parseDOM: [{tag: "code"}], toDOM() { return codeDOM } } } // :: Schema // This schema roughly corresponds to the document schema used by // [CommonMark](http://commonmark.org/), minus the list elements, // which are defined in the [`prosemirror-schema-list`](#schema-list) // module. // // To reuse elements from this schema, extend or read from its // `spec.nodes` and `spec.marks` [properties](#model.Schema.spec). export const schema = new Schema({nodes, marks})