Compare changes

Choose any two refs to compare.

Changed files
+82 -11
.changeset
lexicons
pub
leaflet
blocks
lib
lexicons
types
pub
leaflet
blocks
+5
.changeset/orange-ads-enjoy.md
···
··· 1 + --- 2 + "@nulfrost/leaflet-loader-astro": minor 3 + --- 4 + 5 + Add iframe block
-5
.changeset/sweet-rockets-fetch.md
··· 1 - --- 2 - "@nulfrost/leaflet-loader-astro": patch 3 - --- 4 - 5 - Add JSDoc comments for available loader options for leafletStaticLoader and leafletLiveLoader
···
-5
.changeset/tired-suits-double.md
··· 1 - --- 2 - "@nulfrost/leaflet-loader-astro": minor 3 - --- 4 - 5 - Add support for blockquotes
···
+10
CHANGELOG.md
··· 1 # leaflet-loader-astro 2 3 ## 1.1.0 4 5 ### Minor Changes
··· 1 # leaflet-loader-astro 2 3 + ## 1.2.0 4 + 5 + ### Minor Changes 6 + 7 + - f920153: Add support for blockquotes 8 + 9 + ### Patch Changes 10 + 11 + - 8922bb1: Add JSDoc comments for available loader options for leafletStaticLoader and leafletLiveLoader 12 + 13 ## 1.1.0 14 15 ### Minor Changes
+14
README.md
··· 197 198 `reverse`: Whether or not to return the leaflet documents in reverse order. By default this is false. 199 200 201 ## License 202
··· 197 198 `reverse`: Whether or not to return the leaflet documents in reverse order. By default this is false. 199 200 + ## Supported Leaflet Blocks 201 + 202 + - [ ] Bluesky post 203 + - [ ] Iframe 204 + - [x] Horizontal Rule 205 + - [x] Unordered List 206 + - [x] Math 207 + - [x] Code 208 + - [ ] Website 209 + - [x] Image 210 + - [x] Blockquote 211 + - [x] Text 212 + - [x] Header 213 + - [x] List Item 214 215 ## License 216
+21
lexicons/pub/leaflet/blocks/iframe.json
···
··· 1 + { 2 + "lexicon": 1, 3 + "id": "pub.leaflet.blocks.iframe", 4 + "defs": { 5 + "main": { 6 + "type": "object", 7 + "required": ["url"], 8 + "properties": { 9 + "url": { 10 + "type": "string", 11 + "format": "uri" 12 + }, 13 + "height": { 14 + "type": "integer", 15 + "minimum": 16, 16 + "maximum": 1600 17 + } 18 + } 19 + } 20 + } 21 + }
+1
lib/lexicons/index.ts
··· 3 export * as PubLeafletBlocksCode from "./types/pub/leaflet/blocks/code.js"; 4 export * as PubLeafletBlocksHeader from "./types/pub/leaflet/blocks/header.js"; 5 export * as PubLeafletBlocksHorizontalRule from "./types/pub/leaflet/blocks/horizontalRule.js"; 6 export * as PubLeafletBlocksImage from "./types/pub/leaflet/blocks/image.js"; 7 export * as PubLeafletBlocksMath from "./types/pub/leaflet/blocks/math.js"; 8 export * as PubLeafletBlocksText from "./types/pub/leaflet/blocks/text.js";
··· 3 export * as PubLeafletBlocksCode from "./types/pub/leaflet/blocks/code.js"; 4 export * as PubLeafletBlocksHeader from "./types/pub/leaflet/blocks/header.js"; 5 export * as PubLeafletBlocksHorizontalRule from "./types/pub/leaflet/blocks/horizontalRule.js"; 6 + export * as PubLeafletBlocksIframe from "./types/pub/leaflet/blocks/iframe.js"; 7 export * as PubLeafletBlocksImage from "./types/pub/leaflet/blocks/image.js"; 8 export * as PubLeafletBlocksMath from "./types/pub/leaflet/blocks/math.js"; 9 export * as PubLeafletBlocksText from "./types/pub/leaflet/blocks/text.js";
+22
lib/lexicons/types/pub/leaflet/blocks/iframe.ts
···
··· 1 + import type {} from "@atcute/lexicons"; 2 + import * as v from "@atcute/lexicons/validations"; 3 + 4 + const _mainSchema = /*#__PURE__*/ v.object({ 5 + $type: /*#__PURE__*/ v.optional( 6 + /*#__PURE__*/ v.literal("pub.leaflet.blocks.iframe"), 7 + ), 8 + height: /*#__PURE__*/ v.optional( 9 + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ 10 + /*#__PURE__*/ v.integerRange(16, 1600), 11 + ]), 12 + ), 13 + url: /*#__PURE__*/ v.genericUriString(), 14 + }); 15 + 16 + type main$schematype = typeof _mainSchema; 17 + 18 + export interface mainSchema extends main$schematype {} 19 + 20 + export const mainSchema = _mainSchema as mainSchema; 21 + 22 + export interface Main extends v.InferInput<typeof mainSchema> {}
+8
lib/utils.ts
··· 8 PubLeafletBlocksCode, 9 PubLeafletBlocksHeader, 10 PubLeafletBlocksHorizontalRule, 11 PubLeafletBlocksImage, 12 PubLeafletBlocksMath, 13 PubLeafletBlocksText, ··· 162 "*": ["class", "style"], 163 img: ["src", "height", "width", "alt"], 164 a: ["href", "target", "rel"], 165 }, 166 allowedTags: [ 167 "img", ··· 184 "div", 185 "span", 186 "blockquote", 187 ], 188 selfClosing: ["img"], 189 }); ··· 353 354 if (is(PubLeafletBlocksBlockquote.mainSchema, block.block)) { 355 html += `<blockquote>${parseTextBlock(block.block)}</blockquote>`; 356 } 357 358 return html.trim();
··· 8 PubLeafletBlocksCode, 9 PubLeafletBlocksHeader, 10 PubLeafletBlocksHorizontalRule, 11 + PubLeafletBlocksIframe, 12 PubLeafletBlocksImage, 13 PubLeafletBlocksMath, 14 PubLeafletBlocksText, ··· 163 "*": ["class", "style"], 164 img: ["src", "height", "width", "alt"], 165 a: ["href", "target", "rel"], 166 + iframe: ["height", "allow", "loading", "src"], 167 }, 168 allowedTags: [ 169 "img", ··· 186 "div", 187 "span", 188 "blockquote", 189 + "iframe", 190 ], 191 selfClosing: ["img"], 192 }); ··· 356 357 if (is(PubLeafletBlocksBlockquote.mainSchema, block.block)) { 358 html += `<blockquote>${parseTextBlock(block.block)}</blockquote>`; 359 + } 360 + 361 + if (is(PubLeafletBlocksIframe.mainSchema, block.block)) { 362 + // @ts-ignore 363 + html += `<iframe height="${block.block.height}" allow="fullscreen" loading="lazy" src="${block.block.url}"></iframe>`; 364 } 365 366 return html.trim();
+1 -1
package.json
··· 1 { 2 "name": "@nulfrost/leaflet-loader-astro", 3 - "version": "1.1.0", 4 "description": "A leaflet.pub astro collection loader", 5 "keywords": [ 6 "astro",
··· 1 { 2 "name": "@nulfrost/leaflet-loader-astro", 3 + "version": "1.2.0", 4 "description": "A leaflet.pub astro collection loader", 5 "keywords": [ 6 "astro",