+5
.changeset/sweet-rockets-fetch.md
+5
.changeset/sweet-rockets-fetch.md
+5
.changeset/tired-suits-double.md
+5
.changeset/tired-suits-double.md
-16
CHANGELOG.md
-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
-
19
3
## 1.1.0
20
4
21
5
### Minor Changes
-14
README.md
-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
214
200
215
201
## License
216
202
-21
lexicons/pub/leaflet/blocks/iframe.json
-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
-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";
7
6
export * as PubLeafletBlocksImage from "./types/pub/leaflet/blocks/image.js";
8
7
export * as PubLeafletBlocksMath from "./types/pub/leaflet/blocks/math.js";
9
8
export * as PubLeafletBlocksText from "./types/pub/leaflet/blocks/text.js";
-22
lib/lexicons/types/pub/leaflet/blocks/iframe.ts
-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
lib/utils.ts
···
8
8
PubLeafletBlocksCode,
9
9
PubLeafletBlocksHeader,
10
10
PubLeafletBlocksHorizontalRule,
11
-
PubLeafletBlocksIframe,
12
11
PubLeafletBlocksImage,
13
12
PubLeafletBlocksMath,
14
13
PubLeafletBlocksText,
···
163
162
"*": ["class", "style"],
164
163
img: ["src", "height", "width", "alt"],
165
164
a: ["href", "target", "rel"],
166
-
iframe: ["height", "allow", "loading", "src"],
167
165
},
168
166
allowedTags: [
169
167
"img",
···
186
184
"div",
187
185
"span",
188
186
"blockquote",
189
-
"iframe",
190
187
],
191
188
selfClosing: ["img"],
192
189
});
···
356
353
357
354
if (is(PubLeafletBlocksBlockquote.mainSchema, block.block)) {
358
355
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
356
}
365
357
366
358
return html.trim();