Compare changes

Choose any two refs to compare.

Changed files
+83 -11
.changeset
lexicons
pub
leaflet
blocks
lib
lexicons
types
pub
leaflet
blocks
-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
+16
CHANGELOG.md
··· 1 1 # leaflet-loader-astro 2 2 3 + ## 1.3.0 4 + 5 + ### Minor Changes 6 + 7 + - eb3bc4b: Add iframe block 8 + 9 + ## 1.2.0 10 + 11 + ### Minor Changes 12 + 13 + - f920153: Add support for blockquotes 14 + 15 + ### Patch Changes 16 + 17 + - 8922bb1: Add JSDoc comments for available loader options for leafletStaticLoader and leafletLiveLoader 18 + 3 19 ## 1.1.0 4 20 5 21 ### Minor Changes
+14
README.md
··· 197 197 198 198 `reverse`: Whether or not to return the leaflet documents in reverse order. By default this is false. 199 199 200 + ## Supported Leaflet Blocks 201 + 202 + - [ ] Bluesky post 203 + - [x] 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 200 214 201 215 ## License 202 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 3 export * as PubLeafletBlocksCode from "./types/pub/leaflet/blocks/code.js"; 4 4 export * as PubLeafletBlocksHeader from "./types/pub/leaflet/blocks/header.js"; 5 5 export * as PubLeafletBlocksHorizontalRule from "./types/pub/leaflet/blocks/horizontalRule.js"; 6 + export * as PubLeafletBlocksIframe from "./types/pub/leaflet/blocks/iframe.js"; 6 7 export * as PubLeafletBlocksImage from "./types/pub/leaflet/blocks/image.js"; 7 8 export * as PubLeafletBlocksMath from "./types/pub/leaflet/blocks/math.js"; 8 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 8 PubLeafletBlocksCode, 9 9 PubLeafletBlocksHeader, 10 10 PubLeafletBlocksHorizontalRule, 11 + PubLeafletBlocksIframe, 11 12 PubLeafletBlocksImage, 12 13 PubLeafletBlocksMath, 13 14 PubLeafletBlocksText, ··· 162 163 "*": ["class", "style"], 163 164 img: ["src", "height", "width", "alt"], 164 165 a: ["href", "target", "rel"], 166 + iframe: ["height", "allow", "loading", "src"], 165 167 }, 166 168 allowedTags: [ 167 169 "img", ··· 184 186 "div", 185 187 "span", 186 188 "blockquote", 189 + "iframe", 187 190 ], 188 191 selfClosing: ["img"], 189 192 }); ··· 353 356 354 357 if (is(PubLeafletBlocksBlockquote.mainSchema, block.block)) { 355 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>`; 356 364 } 357 365 358 366 return html.trim();
+1 -1
package.json
··· 1 1 { 2 2 "name": "@nulfrost/leaflet-loader-astro", 3 - "version": "1.1.0", 3 + "version": "1.3.0", 4 4 "description": "A leaflet.pub astro collection loader", 5 5 "keywords": [ 6 6 "astro",