Socket
Socket
Sign inDemoInstall

@atlaskit/adf-schema-generator

Package Overview
Dependencies
Maintainers
0
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atlaskit/adf-schema-generator - npm Package Compare versions

Comparing version 1.28.1 to 1.28.2

4

CHANGELOG.md
# @atlaskit/adf-schema-generator
## 1.28.1
## 1.28.2
### Patch Changes
- 32c5913: Remove forwards compatability check in JSOn schema
- ba6e68e: Update adf-schema-generator docs
{
"name": "@atlaskit/adf-schema-generator",
"version": "1.28.1",
"version": "1.28.2",
"description": "Generates ADF and PM schemas",

@@ -5,0 +5,0 @@ "repository": "https://bitbucket.org/atlassian/adf-schema",

@@ -46,2 +46,5 @@ # ADF Schema Generator

Adding new variant to a node definition doesn't, by default, affect the output schemas.
The variant must be explicitly used in the schema definition via `node.use('variant_name')`.
```typescript

@@ -72,2 +75,3 @@ const paragraph = adfNode('paragraph')

content: [$onePlus($or(paragraph, paragraphWithAttrs))],
// ^ Variant is explicitly used here
});

@@ -118,2 +122,44 @@

### Stage 0
Stage 0 schema is an experimental super-set of the full schema.
It is used to test new features and is not guaranteed to be stable.
There are 2 ways to define a stage 0 node.
#### 1. Using inline `stage0` node spec override:
Inline `stage0` spec is a shallow override of the base node spec.
Which will produce, for the following example, 2 PM node specs: `paragraph` and `paragraphStage0`.
```typescript
const paragraph = adfNode('paragraph').define({
content: [$zeroPlus($or(text))],
stage0: {
attrs: {
alignment: {
type: 'enum',
values: ['start', 'end', 'center', 'justify'],
default: 'start',
},
},
},
});
```
Using inline stage0 override is a preferred way to modify/extend the node spec
it simplifies future promotion to the full schema.
#### 2. Marking the whole node as stage 0
Marking node as `stage0: true` will only output the stage 0 node spec. It will not appear in full json schema.
Marking the whole node as stage0 is the preferred way to introduce new nodes to ADF schema.
```typescript
const paragraph = adfNode('paragraph').define({
content: [$zeroPlus($or(text))],
stage0: true,
});
```
### Traverse

@@ -143,18 +189,4 @@

### Transformations
#### ADF JSON Schema
[] TODO
#### ProseMirror Schema
[] TODO
#### Validator Specs
[] TODO
### Terminology
- `@DSLCompatibilityException`: This annotation marks special cases made by transformers during DSL conversion that address temporary compatibility issues with specific target schemas. It serves as a tracking mechanism to identify, prioritize, and eliminate these exceptions as the DSL evolves to encompass these special cases.
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