-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add pub.leaflet lexicons #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d0953ef
feat: add leaflet and richtext lexicons
Kzoeps 8657f1d
fix: enable runtime validation for external lexicon refs
aspiers 137a044
fix: wrap MIME types in backticks in SCHEMAS.md
aspiers dd532d9
test: exercise pub.leaflet.richtext.facet in test fixture
aspiers 238f8a1
fix: avoid double blank line for empty property tables in SCHEMAS.md
aspiers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@hypercerts-org/lexicon": minor | ||
| --- | ||
|
|
||
| Vendor pub.leaflet and app.bsky.richtext.facet lexicon JSONs to enable runtime validation of records with description and facet fields. Previously, these external schemas were only shimmed at the TypeScript type level via @atcute packages, causing LexiconDefNotFoundError at runtime when validating records that populated optional description or facet fields. Removes the now-unnecessary create-shims.sh script and @atcute/leaflet + @atcute/bluesky dependencies. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "app.bsky.richtext.facet", | ||
| "defs": { | ||
| "main": { | ||
| "type": "object", | ||
| "description": "Annotation of a sub-string within rich text.", | ||
| "required": ["index", "features"], | ||
| "properties": { | ||
| "index": { "type": "ref", "ref": "#byteSlice" }, | ||
| "features": { | ||
| "type": "array", | ||
| "items": { "type": "union", "refs": ["#mention", "#link", "#tag"] } | ||
| } | ||
| } | ||
| }, | ||
| "mention": { | ||
| "type": "object", | ||
| "description": "Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.", | ||
| "required": ["did"], | ||
| "properties": { | ||
| "did": { "type": "string", "format": "did" } | ||
| } | ||
| }, | ||
| "link": { | ||
| "type": "object", | ||
| "description": "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.", | ||
| "required": ["uri"], | ||
| "properties": { | ||
| "uri": { "type": "string", "format": "uri" } | ||
| } | ||
| }, | ||
| "tag": { | ||
| "type": "object", | ||
| "description": "Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').", | ||
| "required": ["tag"], | ||
| "properties": { | ||
| "tag": { "type": "string", "maxLength": 640, "maxGraphemes": 64 } | ||
| } | ||
| }, | ||
| "byteSlice": { | ||
| "type": "object", | ||
| "description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.", | ||
| "required": ["byteStart", "byteEnd"], | ||
| "properties": { | ||
| "byteStart": { "type": "integer", "minimum": 0 }, | ||
| "byteEnd": { "type": "integer", "minimum": 0 } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "pub.leaflet.blocks.blockquote", | ||
| "defs": { | ||
| "main": { | ||
| "type": "object", | ||
| "required": ["plaintext"], | ||
| "properties": { | ||
| "plaintext": { | ||
| "type": "string" | ||
| }, | ||
| "facets": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "ref", | ||
| "ref": "pub.leaflet.richtext.facet" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "pub.leaflet.blocks.bskyPost", | ||
| "defs": { | ||
| "main": { | ||
| "type": "object", | ||
| "required": ["postRef"], | ||
| "properties": { | ||
| "postRef": { | ||
| "type": "ref", | ||
| "ref": "com.atproto.repo.strongRef" | ||
| }, | ||
| "clientHost": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "pub.leaflet.blocks.button", | ||
| "defs": { | ||
| "main": { | ||
| "type": "object", | ||
| "required": ["text", "url"], | ||
| "properties": { | ||
| "text": { | ||
| "type": "string" | ||
| }, | ||
| "url": { | ||
| "type": "string", | ||
| "format": "uri" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "pub.leaflet.blocks.code", | ||
| "defs": { | ||
| "main": { | ||
| "type": "object", | ||
| "required": ["plaintext"], | ||
| "properties": { | ||
| "plaintext": { | ||
| "type": "string" | ||
| }, | ||
| "language": { | ||
| "type": "string" | ||
| }, | ||
| "syntaxHighlightingTheme": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "pub.leaflet.blocks.header", | ||
| "defs": { | ||
| "main": { | ||
| "type": "object", | ||
| "required": ["plaintext"], | ||
| "properties": { | ||
| "level": { | ||
| "type": "integer", | ||
| "minimum": 1, | ||
| "maximum": 6 | ||
| }, | ||
| "plaintext": { | ||
| "type": "string" | ||
| }, | ||
| "facets": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "ref", | ||
| "ref": "pub.leaflet.richtext.facet" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "pub.leaflet.blocks.horizontalRule", | ||
| "defs": { | ||
| "main": { | ||
| "type": "object", | ||
| "required": [], | ||
| "properties": {} | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "pub.leaflet.blocks.iframe", | ||
| "defs": { | ||
| "main": { | ||
| "type": "object", | ||
| "required": ["url"], | ||
| "properties": { | ||
| "url": { | ||
| "type": "string", | ||
| "format": "uri" | ||
| }, | ||
| "height": { | ||
| "type": "integer", | ||
| "minimum": 16, | ||
| "maximum": 1600 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "pub.leaflet.blocks.image", | ||
| "defs": { | ||
| "main": { | ||
| "type": "object", | ||
| "required": ["image", "aspectRatio"], | ||
| "properties": { | ||
| "image": { | ||
| "type": "blob", | ||
| "accept": ["image/*"], | ||
| "maxSize": 1000000 | ||
| }, | ||
| "alt": { | ||
| "type": "string", | ||
| "description": "Alt text description of the image, for accessibility." | ||
| }, | ||
| "aspectRatio": { | ||
| "type": "ref", | ||
| "ref": "#aspectRatio" | ||
| } | ||
| } | ||
| }, | ||
| "aspectRatio": { | ||
| "type": "object", | ||
| "required": ["width", "height"], | ||
| "properties": { | ||
| "width": { | ||
| "type": "integer" | ||
| }, | ||
| "height": { | ||
| "type": "integer" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "pub.leaflet.blocks.math", | ||
| "defs": { | ||
| "main": { | ||
| "type": "object", | ||
| "required": ["tex"], | ||
| "properties": { | ||
| "tex": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "pub.leaflet.blocks.orderedList", | ||
| "defs": { | ||
| "main": { | ||
| "type": "object", | ||
| "required": ["children"], | ||
| "properties": { | ||
| "startIndex": { | ||
| "type": "integer", | ||
| "description": "The starting number for this ordered list. Defaults to 1 if not specified." | ||
| }, | ||
| "children": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "ref", | ||
| "ref": "#listItem" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "listItem": { | ||
| "type": "object", | ||
| "required": ["content"], | ||
| "properties": { | ||
| "checked": { | ||
| "type": "boolean", | ||
| "description": "If present, this item is a checklist item. true = checked, false = unchecked. If absent, this is a normal list item." | ||
| }, | ||
| "content": { | ||
| "type": "union", | ||
| "refs": [ | ||
| "pub.leaflet.blocks.text", | ||
| "pub.leaflet.blocks.header", | ||
| "pub.leaflet.blocks.image" | ||
| ] | ||
| }, | ||
| "children": { | ||
| "type": "array", | ||
| "description": "Nested ordered list items. Mutually exclusive with unorderedListChildren; if both are present, children takes precedence.", | ||
| "items": { | ||
| "type": "ref", | ||
| "ref": "#listItem" | ||
| } | ||
| }, | ||
| "unorderedListChildren": { | ||
| "type": "ref", | ||
| "description": "A nested unordered list. Mutually exclusive with children; if both are present, children takes precedence.", | ||
| "ref": "pub.leaflet.blocks.unorderedList" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "pub.leaflet.blocks.page", | ||
| "defs": { | ||
| "main": { | ||
| "type": "object", | ||
| "required": ["id"], | ||
| "properties": { | ||
| "id": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "pub.leaflet.blocks.poll", | ||
| "defs": { | ||
| "main": { | ||
| "type": "object", | ||
| "required": ["pollRef"], | ||
| "properties": { | ||
| "pollRef": { | ||
| "type": "ref", | ||
| "ref": "com.atproto.repo.strongRef" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.