New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

apache-annotator

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apache-annotator - npm Package Compare versions

Comparing version 0.2.0-dev.184 to 0.2.0-dev.205

10

lib/dom.d.ts

@@ -20,3 +20,13 @@ /**

*/
/**
* This module provides functions for handling annotations in the context of an
* HTML DOM; in other words, a web page.
*
* The module’s main functionality is *matching* (or *‘anchoring’*) a {@link https://www.w3.org/TR/2017/REC-annotation-model-20170223/#selectors
* | Selector} to the DOM, i.e. finding which piece of a web page it refers to;
* and, vice versa, *describing* a selection of the page as a Selector.
*
* @module
*/
export * from '@apache-annotator/dom';
//# sourceMappingURL=dom.d.ts.map

@@ -20,3 +20,14 @@ /**

*/
/**
* This module provides functions for handling annotations in the context of an
* HTML DOM; in other words, a web page.
*
* The module’s main functionality is *matching* (or *‘anchoring’*) a {@link https://www.w3.org/TR/2017/REC-annotation-model-20170223/#selectors
* | Selector} to the DOM, i.e. finding which piece of a web page it refers to;
* and, vice versa, *describing* a selection of the page as a Selector.
*
* @module
*/
export * from '@apache-annotator/dom';
//# sourceMappingURL=dom.js.map

@@ -20,3 +20,14 @@ /**

*/
/**
* This module provides types and generic functions for handling {@link https://www.w3.org/TR/2017/REC-annotation-model-20170223/#selectors
* | Selector}s.
*
* Annotation tool developers should not need most of the functions contained
* in this module, but would instead mainly use the module made for the specific
* context (document type) they are dealing with. See {@link dom}, currently the
* only such module.
*
* @module
*/
export * from '@apache-annotator/selector';
//# sourceMappingURL=selector.d.ts.map

@@ -20,3 +20,15 @@ /**

*/
/**
* This module provides types and generic functions for handling {@link https://www.w3.org/TR/2017/REC-annotation-model-20170223/#selectors
* | Selector}s.
*
* Annotation tool developers should not need most of the functions contained
* in this module, but would instead mainly use the module made for the specific
* context (document type) they are dealing with. See {@link dom}, currently the
* only such module.
*
* @module
*/
export * from '@apache-annotator/selector';
//# sourceMappingURL=selector.js.map

10

package.json
{
"name": "apache-annotator",
"version": "0.2.0-dev.184+5ba4b0a",
"version": "0.2.0-dev.205+d95ab66",
"description": "Apache Annotator provides annotation enabling code for browsers, servers, and humans.",

@@ -18,8 +18,8 @@ "homepage": "https://annotator.apache.org",

"dependencies": {
"@apache-annotator/dom": "0.2.0-dev.184+5ba4b0a",
"@apache-annotator/selector": "0.2.0-dev.184+5ba4b0a",
"@apache-annotator/dom": "0.2.0-dev.205+d95ab66",
"@apache-annotator/selector": "0.2.0-dev.205+d95ab66",
"@babel/runtime-corejs3": "^7.13.10"
},
"engines": {
"node": "^12.20 || ^14.15 || ^15.4"
"node": "^12.20 || ^14.15 || ^15.4 || ^16.0"
},

@@ -29,3 +29,3 @@ "publishConfig": {

},
"gitHead": "5ba4b0ad8cdf9ce1338bebc6f2b24ffe588b6f3e"
"gitHead": "d95ab66750138a4623f20370871bb3cc70c3f347"
}

@@ -7,26 +7,6 @@ # [Apache Annotator](http://annotator.apache.org/) (incubating) [![Build Status](https://travis-ci.com/apache/incubator-annotator.svg?branch=master)](https://travis-ci.com/apache/incubator-annotator)

## Usage
## Installation, usage, API documentation
The Apache Annotator project is written in TypeScript, but the project is
compiled and distributed in CommonJS and ECMAScript Module formats.
See documentation on the website: <https://annotator.apache.org/docs/>
The project is made up of multiple packages. Install the `apache-annotator`
package, which includes all sub-packages, or install individual packages from
the `@apache-annotator` scope.
Import packages from either `apache-annotator/package` or
`@apache-annotator/package`.
Currently, the following sub-packages are part of the project:
### `@apache-annotator/dom`
This package contains functions for creating and resolving Web Annotation
Selectors in DOM environments.
### `@apache-annotator/selector`
This package contains generic utilities for composing functions that create
and resolve Web Annotation Selectors.
## Getting Involved

@@ -39,69 +19,2 @@

### Requirements
We use [Lerna](https://lernajs.io/) to juggle the various Apache Annotator
libraries. If you'd like to contribute, you'll need the following:
- [node](https://nodejs.org) ^12.20 || ^14.15 || ^15.4
- [yarn](https://www.yarnpkg.com/) ^1.5
#### Setup
```sh
$ yarn install
```
#### Test
```sh
$ yarn test
```
#### Start a local test project
```sh
$ yarn start
```
## Selectors
Many Annotations refer to part of a resource, rather than all of it, as the Target. We call that part of the resource a Segment (of Interest). A Selector is used to describe how to determine the Segment from within the Source resource.
The [W3C Web Annotation Data Model](https://www.w3.org/TR/annotation-model) outlines a number of different selectors. See table below for full list and status.
| Selector | Description | Implementation Status |
| ------------------------------------------------------------------------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | --------------------: |
| [Text Quote](https://www.w3.org/TR/annotation-model/#text-quote-selector) | This Selector describes a range of text, including some of the text immediately before (a prefix) and after (a suffix) it to distinguish between multiple copies of the same sequence of characters. | Yes |
| [CSS](https://www.w3.org/TR/annotation-model/#css-selector) | CSS Selectors allow for a wide variety of well supported ways to describe the path to an element in a web page. | Yes |
| [Text Position](https://www.w3.org/TR/annotation-model/#text-position-selector) | This Selector describes a range of text by recording the start and end positions of the selection in the stream. | No |
| [Fragment](https://www.w3.org/TR/annotation-model/#fragment-selector) | Uses the fragment part of an IRI defined by the representation's media type. | No |
| [XPath](https://www.w3.org/TR/annotation-model/#xpath-selector) | Implements an XPath based selection. | No |
| [Data Postion](https://www.w3.org/TR/annotation-model/#data-position-selector) | Similar to the Text Position Selector, the Data Position Selector uses the same properties but works at the byte in bitstream level rather than the character in text level. | No |
| [SVG](https://www.w3.org/TR/annotation-model/#svg-selector) | An SvgSelector defines an area through the use of the Scalable Vector Graphics standard. | No |
| [Range](https://www.w3.org/TR/annotation-model/#range-selector) | A Range Selector can be used to identify the beginning and the end of the selection by using other Selectors. | Yes |
| [Refinement](https://www.w3.org/TR/annotation-model/#refinement-of-selection) | Select a part of a selection, rather than as a selection of the complete resource. | |
## Web Annotation Data Model Validation
If you have any Web Annotation Data Model JSON documents, you can validate them
using the `validate` script:
```sh
$ yarn validate --url https://raw.githubusercontent.com/w3c/web-annotation-tests/master/tools/samples/correct/anno1.json
```
With the `--url` option you can pass in a URL or a local path to a JSON file.
### Examples
Valid:
`https://raw.githubusercontent.com/w3c/web-annotation-tests/master/tools/samples/correct/anno1.json`
Invalid:
`https://raw.githubusercontent.com/w3c/web-annotation-tests/master/tools/samples/incorrect/anno1.json`
[(More)](https://github.com/w3c/web-annotation-tests/tree/master/tools/samples)
# License

@@ -108,0 +21,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc