@elmethis/core 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a2ui/v0_9/{block_catalog.json → notion_block_catalog.json} +11 -7
- package/dist/index.cjs +23 -21
- package/dist/index.d.cts +11 -8
- package/dist/index.d.mts +11 -8
- package/dist/index.mjs +20 -18
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://46ki75.github.io/elmethis/a2ui/v0_9/
|
|
4
|
-
"catalogId": "https://46ki75.github.io/elmethis/a2ui/v0_9/
|
|
5
|
-
"title": "Elmethis Block Catalog",
|
|
6
|
-
"description": "
|
|
3
|
+
"$id": "https://46ki75.github.io/elmethis/a2ui/v0_9/notion_block_catalog.json",
|
|
4
|
+
"catalogId": "https://46ki75.github.io/elmethis/a2ui/v0_9/notion_block_catalog.json",
|
|
5
|
+
"title": "Elmethis Notion Block Catalog",
|
|
6
|
+
"description": "Notion block-level A2UI components used by the @elmethis renderers (typography, media, code, math, table, tabs). Extends — does not replace — the A2UI Basic Catalog.",
|
|
7
7
|
"components": {
|
|
8
8
|
"RichText": {
|
|
9
9
|
"type": "object",
|
|
@@ -893,15 +893,19 @@
|
|
|
893
893
|
},
|
|
894
894
|
"src": {
|
|
895
895
|
"type": "string",
|
|
896
|
-
"description": "URL of a remote document to render inside the iframe instead of inline `html` (e.g. a presigned, time-limited link). Mutually exclusive with `html` — provide exactly one of the two. `autoHeight`
|
|
896
|
+
"description": "URL of a remote document to render inside the iframe instead of inline `html` (e.g. a presigned, time-limited link, or a same-origin asset). Mutually exclusive with `html` — provide exactly one of the two. `autoHeight` can still measure a same-origin `src`, but not a genuinely cross-origin one, and a time-limited URL isn't refreshed automatically — the caller is responsible for keeping it current."
|
|
897
897
|
},
|
|
898
898
|
"autoHeight": {
|
|
899
899
|
"type": "boolean",
|
|
900
|
-
"description": "Stretch the iframe to fit its content height. Defaults to true.
|
|
900
|
+
"description": "Stretch the iframe to fit its content height. Defaults to true. Has no effect on genuinely cross-origin `src` content, or on any content once `allowScripts` is on (measuring requires DOM access the sandbox never grants alongside script execution) — `height` is the fallback size for those cases."
|
|
901
901
|
},
|
|
902
902
|
"allowScripts": {
|
|
903
903
|
"type": "boolean",
|
|
904
|
-
"description": "Allow the embedded content to run JavaScript (adds the iframe sandbox's `allow-scripts` token). Defaults to
|
|
904
|
+
"description": "Allow the embedded content to run JavaScript (adds the iframe sandbox's `allow-scripts` token). Defaults to true when rendered through the Notion block catalog — pass `false` explicitly to disable script execution. (The underlying `ElmHtml` component still defaults to `false` when used directly, outside the A2UI catalog.) `allow-same-origin` is never granted together with this, in `html` or `src` mode, so the embedded document can never escape the sandbox even with scripts enabled."
|
|
905
|
+
},
|
|
906
|
+
"height": {
|
|
907
|
+
"type": "number",
|
|
908
|
+
"description": "Fallback pixel height for the iframe, used whenever `autoHeight` can't measure the actual content (e.g. `allowScripts` content, or a genuinely cross-origin `src`). Defaults to 400 when omitted. Ignored once `autoHeight` successfully measures real content — it only ever applies as a starting/fallback size, never a hard cap."
|
|
905
909
|
}
|
|
906
910
|
},
|
|
907
911
|
"required": [
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ let zod = require("zod");
|
|
|
3
3
|
let _a2ui_web_core_v0_9 = require("@a2ui/web_core/v0_9");
|
|
4
4
|
let _a2ui_web_core_v0_9_basic_catalog = require("@a2ui/web_core/v0_9/basic_catalog");
|
|
5
5
|
let zod_to_json_schema = require("zod-to-json-schema");
|
|
6
|
-
//#region src/a2ui/v0_9/block-catalog.ts
|
|
6
|
+
//#region src/a2ui/v0_9/notion-block-catalog.ts
|
|
7
7
|
const CommonProps = {
|
|
8
8
|
accessibility: _a2ui_web_core_v0_9.AccessibilityAttributesSchema.optional(),
|
|
9
9
|
weight: zod.z.number().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional()
|
|
@@ -277,9 +277,10 @@ const HtmlApi = {
|
|
|
277
277
|
schema: zod.z.object({
|
|
278
278
|
...CommonProps,
|
|
279
279
|
html: zod.z.string().describe("Raw HTML markup to render inside a sandboxed iframe. Mutually exclusive with `src` — provide exactly one of the two.").optional(),
|
|
280
|
-
src: zod.z.string().describe("URL of a remote document to render inside the iframe instead of inline `html` (e.g. a presigned, time-limited link). Mutually exclusive with `html` — provide exactly one of the two. `autoHeight`
|
|
281
|
-
autoHeight: zod.z.boolean().describe("Stretch the iframe to fit its content height. Defaults to true.
|
|
282
|
-
allowScripts: zod.z.boolean().describe("Allow the embedded content to run JavaScript (adds the iframe sandbox's `allow-scripts` token). Defaults to
|
|
280
|
+
src: zod.z.string().describe("URL of a remote document to render inside the iframe instead of inline `html` (e.g. a presigned, time-limited link, or a same-origin asset). Mutually exclusive with `html` — provide exactly one of the two. `autoHeight` can still measure a same-origin `src`, but not a genuinely cross-origin one, and a time-limited URL isn't refreshed automatically — the caller is responsible for keeping it current.").optional(),
|
|
281
|
+
autoHeight: zod.z.boolean().describe("Stretch the iframe to fit its content height. Defaults to true. Has no effect on genuinely cross-origin `src` content, or on any content once `allowScripts` is on (measuring requires DOM access the sandbox never grants alongside script execution) — `height` is the fallback size for those cases.").optional(),
|
|
282
|
+
allowScripts: zod.z.boolean().describe("Allow the embedded content to run JavaScript (adds the iframe sandbox's `allow-scripts` token). Defaults to true when rendered through the Notion block catalog — pass `false` explicitly to disable script execution. (The underlying `ElmHtml` component still defaults to `false` when used directly, outside the A2UI catalog.) `allow-same-origin` is never granted together with this, in `html` or `src` mode, so the embedded document can never escape the sandbox even with scripts enabled.").optional(),
|
|
283
|
+
height: zod.z.number().describe("Fallback pixel height for the iframe, used whenever `autoHeight` can't measure the actual content (e.g. `allowScripts` content, or a genuinely cross-origin `src`). Defaults to 400 when omitted. Ignored once `autoHeight` successfully measures real content — it only ever applies as a starting/fallback size, never a hard cap.").optional()
|
|
283
284
|
}).strict()
|
|
284
285
|
};
|
|
285
286
|
const CodeBlockApi = {
|
|
@@ -639,26 +640,27 @@ function assembleCatalog(envelope, components) {
|
|
|
639
640
|
};
|
|
640
641
|
}
|
|
641
642
|
//#endregion
|
|
642
|
-
//#region src/a2ui/v0_9/block-catalog-json.ts
|
|
643
|
+
//#region src/a2ui/v0_9/notion-block-catalog-json.ts
|
|
643
644
|
/**
|
|
644
645
|
* Method A — runtime catalog constant.
|
|
645
646
|
*
|
|
646
|
-
* Assembles the block catalog from the `*Api` Zod definitions into a
|
|
647
|
+
* Assembles the Notion block catalog from the `*Api` Zod definitions into a
|
|
647
648
|
* freestanding A2UI v0.9 catalog JSON Schema document. Consumers that want
|
|
648
649
|
* the catalog at runtime (e.g. to feed into an LLM system prompt or to
|
|
649
|
-
* validate an inbound A2UI message) import `
|
|
650
|
+
* validate an inbound A2UI message) import `notionBlockCatalogJson` directly.
|
|
650
651
|
*
|
|
651
652
|
* Consumers that want the document as a hostable artifact use Method B:
|
|
652
|
-
* `dist/a2ui/
|
|
653
|
-
* constant and is served at the URL identified by
|
|
653
|
+
* `dist/a2ui/notion_block_catalog.json` is emitted at build time from this
|
|
654
|
+
* same constant and is served at the URL identified by
|
|
655
|
+
* `NOTION_BLOCK_CATALOG_ID`.
|
|
654
656
|
*/
|
|
655
657
|
/**
|
|
656
|
-
* Stable URI identifying the block catalog. Lives under the
|
|
657
|
-
* GitHub Pages site so the JSON Schema is fetchable by
|
|
658
|
-
* and validators that look up `catalogId`.
|
|
658
|
+
* Stable URI identifying the Notion block catalog. Lives under the
|
|
659
|
+
* `elmethis` GitHub Pages site so the JSON Schema is fetchable by
|
|
660
|
+
* third-party agents and validators that look up `catalogId`.
|
|
659
661
|
*/
|
|
660
|
-
const
|
|
661
|
-
const
|
|
662
|
+
const NOTION_BLOCK_CATALOG_ID = "https://46ki75.github.io/elmethis/a2ui/v0_9/notion_block_catalog.json";
|
|
663
|
+
const NOTION_BLOCK_CATALOG_COMPONENTS = [
|
|
662
664
|
RichTextApi,
|
|
663
665
|
LinkTextApi,
|
|
664
666
|
IconApi,
|
|
@@ -690,11 +692,11 @@ const BLOCK_CATALOG_COMPONENTS = [
|
|
|
690
692
|
TableCellApi,
|
|
691
693
|
UnsupportedApi
|
|
692
694
|
];
|
|
693
|
-
const
|
|
694
|
-
id:
|
|
695
|
-
title: "Elmethis Block Catalog",
|
|
696
|
-
description: "
|
|
697
|
-
},
|
|
695
|
+
const notionBlockCatalogJson = assembleCatalog({
|
|
696
|
+
id: NOTION_BLOCK_CATALOG_ID,
|
|
697
|
+
title: "Elmethis Notion Block Catalog",
|
|
698
|
+
description: "Notion block-level A2UI components used by the @elmethis renderers (typography, media, code, math, table, tabs). Extends — does not replace — the A2UI Basic Catalog."
|
|
699
|
+
}, NOTION_BLOCK_CATALOG_COMPONENTS);
|
|
698
700
|
//#endregion
|
|
699
701
|
//#region src/icon/languages/registry.ts
|
|
700
702
|
/**
|
|
@@ -1286,7 +1288,6 @@ const normalizeLanguage = (language) => ALIAS_TO_LANGUAGE.get(language) ?? "file
|
|
|
1286
1288
|
const languageIcons = Object.fromEntries(LANGUAGE_REGISTRY.flatMap((e) => e.icon ? [[e.key, e.icon]] : []));
|
|
1287
1289
|
//#endregion
|
|
1288
1290
|
exports.AudioApi = AudioApi;
|
|
1289
|
-
exports.BLOCK_CATALOG_ID = BLOCK_CATALOG_ID;
|
|
1290
1291
|
exports.BlockImageApi = BlockImageApi;
|
|
1291
1292
|
exports.BlockQuoteApi = BlockQuoteApi;
|
|
1292
1293
|
exports.BookmarkApi = BookmarkApi;
|
|
@@ -1307,6 +1308,7 @@ exports.LinkTextApi = LinkTextApi;
|
|
|
1307
1308
|
exports.ListApi = ListApi;
|
|
1308
1309
|
exports.ListItemApi = ListItemApi;
|
|
1309
1310
|
exports.MermaidApi = MermaidApi;
|
|
1311
|
+
exports.NOTION_BLOCK_CATALOG_ID = NOTION_BLOCK_CATALOG_ID;
|
|
1310
1312
|
exports.NotionCalloutApi = NotionCalloutApi;
|
|
1311
1313
|
exports.ParagraphApi = ParagraphApi;
|
|
1312
1314
|
exports.RichTextApi = RichTextApi;
|
|
@@ -1318,6 +1320,6 @@ exports.ToggleApi = ToggleApi;
|
|
|
1318
1320
|
exports.UnsupportedApi = UnsupportedApi;
|
|
1319
1321
|
exports.VideoApi = VideoApi;
|
|
1320
1322
|
exports.assembleCatalog = assembleCatalog;
|
|
1321
|
-
exports.blockCatalogJson = blockCatalogJson;
|
|
1322
1323
|
exports.languageIcons = languageIcons;
|
|
1323
1324
|
exports.normalizeLanguage = normalizeLanguage;
|
|
1325
|
+
exports.notionBlockCatalogJson = notionBlockCatalogJson;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { RowApi } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
3
3
|
import { ComponentApi } from "@a2ui/web_core/v0_9";
|
|
4
|
-
//#region src/a2ui/v0_9/block-catalog.d.ts
|
|
4
|
+
//#region src/a2ui/v0_9/notion-block-catalog.d.ts
|
|
5
5
|
declare const RichTextApi: {
|
|
6
6
|
name: string;
|
|
7
7
|
schema: z.ZodObject<{
|
|
@@ -2568,6 +2568,7 @@ declare const HtmlApi: {
|
|
|
2568
2568
|
src: z.ZodOptional<z.ZodString>;
|
|
2569
2569
|
autoHeight: z.ZodOptional<z.ZodBoolean>;
|
|
2570
2570
|
allowScripts: z.ZodOptional<z.ZodBoolean>;
|
|
2571
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
2571
2572
|
accessibility: z.ZodOptional<z.ZodObject<{
|
|
2572
2573
|
label: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
2573
2574
|
path: z.ZodString;
|
|
@@ -2658,6 +2659,7 @@ declare const HtmlApi: {
|
|
|
2658
2659
|
} | undefined;
|
|
2659
2660
|
weight?: number | undefined;
|
|
2660
2661
|
src?: string | undefined;
|
|
2662
|
+
height?: number | undefined;
|
|
2661
2663
|
html?: string | undefined;
|
|
2662
2664
|
autoHeight?: boolean | undefined;
|
|
2663
2665
|
allowScripts?: boolean | undefined;
|
|
@@ -2680,6 +2682,7 @@ declare const HtmlApi: {
|
|
|
2680
2682
|
} | undefined;
|
|
2681
2683
|
weight?: number | undefined;
|
|
2682
2684
|
src?: string | undefined;
|
|
2685
|
+
height?: number | undefined;
|
|
2683
2686
|
html?: string | undefined;
|
|
2684
2687
|
autoHeight?: boolean | undefined;
|
|
2685
2688
|
allowScripts?: boolean | undefined;
|
|
@@ -3813,14 +3816,14 @@ interface AssembledCatalog {
|
|
|
3813
3816
|
*/
|
|
3814
3817
|
declare function assembleCatalog(envelope: CatalogEnvelope, components: readonly ComponentApi[]): AssembledCatalog;
|
|
3815
3818
|
//#endregion
|
|
3816
|
-
//#region src/a2ui/v0_9/block-catalog-json.d.ts
|
|
3819
|
+
//#region src/a2ui/v0_9/notion-block-catalog-json.d.ts
|
|
3817
3820
|
/**
|
|
3818
|
-
* Stable URI identifying the block catalog. Lives under the
|
|
3819
|
-
* GitHub Pages site so the JSON Schema is fetchable by
|
|
3820
|
-
* and validators that look up `catalogId`.
|
|
3821
|
+
* Stable URI identifying the Notion block catalog. Lives under the
|
|
3822
|
+
* `elmethis` GitHub Pages site so the JSON Schema is fetchable by
|
|
3823
|
+
* third-party agents and validators that look up `catalogId`.
|
|
3821
3824
|
*/
|
|
3822
|
-
declare const
|
|
3823
|
-
declare const
|
|
3825
|
+
declare const NOTION_BLOCK_CATALOG_ID = "https://46ki75.github.io/elmethis/a2ui/v0_9/notion_block_catalog.json";
|
|
3826
|
+
declare const notionBlockCatalogJson: AssembledCatalog;
|
|
3824
3827
|
//#endregion
|
|
3825
3828
|
//#region src/icon/languages/types.d.ts
|
|
3826
3829
|
/**
|
|
@@ -3949,4 +3952,4 @@ declare const normalizeLanguage: (language: string) => Language;
|
|
|
3949
3952
|
/** The authored glyph artwork for every {@link GlyphLanguage}. */
|
|
3950
3953
|
declare const languageIcons: Record<GlyphLanguage, LanguageIcon>;
|
|
3951
3954
|
//#endregion
|
|
3952
|
-
export { type AssembledCatalog, AudioApi,
|
|
3955
|
+
export { type AssembledCatalog, AudioApi, BlockImageApi, BlockQuoteApi, BookmarkApi, CalloutApi, type CatalogEnvelope, CodeBlockApi, ColumnApi, ColumnListApi, ContentTabApi, ContentTabsApi, DividerApi, FileApi, type GlyphLanguage, HeadingApi, HtmlApi, IconApi, KatexApi, LANGUAGES, type Language, type LanguageIcon, LinkTextApi, ListApi, ListItemApi, MermaidApi, NOTION_BLOCK_CATALOG_ID, NotionCalloutApi, ParagraphApi, RichTextApi, RowApi, type SvgNode, TableApi, TableCellApi, TableRowApi, ToggleApi, UnsupportedApi, VideoApi, assembleCatalog, languageIcons, normalizeLanguage, notionBlockCatalogJson };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ComponentApi } from "@a2ui/web_core/v0_9";
|
|
3
3
|
import { RowApi } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
4
|
-
//#region src/a2ui/v0_9/block-catalog.d.ts
|
|
4
|
+
//#region src/a2ui/v0_9/notion-block-catalog.d.ts
|
|
5
5
|
declare const RichTextApi: {
|
|
6
6
|
name: string;
|
|
7
7
|
schema: z.ZodObject<{
|
|
@@ -2568,6 +2568,7 @@ declare const HtmlApi: {
|
|
|
2568
2568
|
src: z.ZodOptional<z.ZodString>;
|
|
2569
2569
|
autoHeight: z.ZodOptional<z.ZodBoolean>;
|
|
2570
2570
|
allowScripts: z.ZodOptional<z.ZodBoolean>;
|
|
2571
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
2571
2572
|
accessibility: z.ZodOptional<z.ZodObject<{
|
|
2572
2573
|
label: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
2573
2574
|
path: z.ZodString;
|
|
@@ -2658,6 +2659,7 @@ declare const HtmlApi: {
|
|
|
2658
2659
|
} | undefined;
|
|
2659
2660
|
weight?: number | undefined;
|
|
2660
2661
|
src?: string | undefined;
|
|
2662
|
+
height?: number | undefined;
|
|
2661
2663
|
html?: string | undefined;
|
|
2662
2664
|
autoHeight?: boolean | undefined;
|
|
2663
2665
|
allowScripts?: boolean | undefined;
|
|
@@ -2680,6 +2682,7 @@ declare const HtmlApi: {
|
|
|
2680
2682
|
} | undefined;
|
|
2681
2683
|
weight?: number | undefined;
|
|
2682
2684
|
src?: string | undefined;
|
|
2685
|
+
height?: number | undefined;
|
|
2683
2686
|
html?: string | undefined;
|
|
2684
2687
|
autoHeight?: boolean | undefined;
|
|
2685
2688
|
allowScripts?: boolean | undefined;
|
|
@@ -3813,14 +3816,14 @@ interface AssembledCatalog {
|
|
|
3813
3816
|
*/
|
|
3814
3817
|
declare function assembleCatalog(envelope: CatalogEnvelope, components: readonly ComponentApi[]): AssembledCatalog;
|
|
3815
3818
|
//#endregion
|
|
3816
|
-
//#region src/a2ui/v0_9/block-catalog-json.d.ts
|
|
3819
|
+
//#region src/a2ui/v0_9/notion-block-catalog-json.d.ts
|
|
3817
3820
|
/**
|
|
3818
|
-
* Stable URI identifying the block catalog. Lives under the
|
|
3819
|
-
* GitHub Pages site so the JSON Schema is fetchable by
|
|
3820
|
-
* and validators that look up `catalogId`.
|
|
3821
|
+
* Stable URI identifying the Notion block catalog. Lives under the
|
|
3822
|
+
* `elmethis` GitHub Pages site so the JSON Schema is fetchable by
|
|
3823
|
+
* third-party agents and validators that look up `catalogId`.
|
|
3821
3824
|
*/
|
|
3822
|
-
declare const
|
|
3823
|
-
declare const
|
|
3825
|
+
declare const NOTION_BLOCK_CATALOG_ID = "https://46ki75.github.io/elmethis/a2ui/v0_9/notion_block_catalog.json";
|
|
3826
|
+
declare const notionBlockCatalogJson: AssembledCatalog;
|
|
3824
3827
|
//#endregion
|
|
3825
3828
|
//#region src/icon/languages/types.d.ts
|
|
3826
3829
|
/**
|
|
@@ -3949,4 +3952,4 @@ declare const normalizeLanguage: (language: string) => Language;
|
|
|
3949
3952
|
/** The authored glyph artwork for every {@link GlyphLanguage}. */
|
|
3950
3953
|
declare const languageIcons: Record<GlyphLanguage, LanguageIcon>;
|
|
3951
3954
|
//#endregion
|
|
3952
|
-
export { type AssembledCatalog, AudioApi,
|
|
3955
|
+
export { type AssembledCatalog, AudioApi, BlockImageApi, BlockQuoteApi, BookmarkApi, CalloutApi, type CatalogEnvelope, CodeBlockApi, ColumnApi, ColumnListApi, ContentTabApi, ContentTabsApi, DividerApi, FileApi, type GlyphLanguage, HeadingApi, HtmlApi, IconApi, KatexApi, LANGUAGES, type Language, type LanguageIcon, LinkTextApi, ListApi, ListItemApi, MermaidApi, NOTION_BLOCK_CATALOG_ID, NotionCalloutApi, ParagraphApi, RichTextApi, RowApi, type SvgNode, TableApi, TableCellApi, TableRowApi, ToggleApi, UnsupportedApi, VideoApi, assembleCatalog, languageIcons, normalizeLanguage, notionBlockCatalogJson };
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { AccessibilityAttributesSchema, ChildListSchema, DataBindingSchema, DynamicBooleanSchema, DynamicNumberSchema, DynamicStringListSchema, DynamicStringSchema, DynamicValueSchema, FunctionCallSchema } from "@a2ui/web_core/v0_9";
|
|
3
3
|
import { RowApi } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
4
4
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
5
|
-
//#region src/a2ui/v0_9/block-catalog.ts
|
|
5
|
+
//#region src/a2ui/v0_9/notion-block-catalog.ts
|
|
6
6
|
const CommonProps = {
|
|
7
7
|
accessibility: AccessibilityAttributesSchema.optional(),
|
|
8
8
|
weight: z.number().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional()
|
|
@@ -276,9 +276,10 @@ const HtmlApi = {
|
|
|
276
276
|
schema: z.object({
|
|
277
277
|
...CommonProps,
|
|
278
278
|
html: z.string().describe("Raw HTML markup to render inside a sandboxed iframe. Mutually exclusive with `src` — provide exactly one of the two.").optional(),
|
|
279
|
-
src: z.string().describe("URL of a remote document to render inside the iframe instead of inline `html` (e.g. a presigned, time-limited link). Mutually exclusive with `html` — provide exactly one of the two. `autoHeight`
|
|
280
|
-
autoHeight: z.boolean().describe("Stretch the iframe to fit its content height. Defaults to true.
|
|
281
|
-
allowScripts: z.boolean().describe("Allow the embedded content to run JavaScript (adds the iframe sandbox's `allow-scripts` token). Defaults to
|
|
279
|
+
src: z.string().describe("URL of a remote document to render inside the iframe instead of inline `html` (e.g. a presigned, time-limited link, or a same-origin asset). Mutually exclusive with `html` — provide exactly one of the two. `autoHeight` can still measure a same-origin `src`, but not a genuinely cross-origin one, and a time-limited URL isn't refreshed automatically — the caller is responsible for keeping it current.").optional(),
|
|
280
|
+
autoHeight: z.boolean().describe("Stretch the iframe to fit its content height. Defaults to true. Has no effect on genuinely cross-origin `src` content, or on any content once `allowScripts` is on (measuring requires DOM access the sandbox never grants alongside script execution) — `height` is the fallback size for those cases.").optional(),
|
|
281
|
+
allowScripts: z.boolean().describe("Allow the embedded content to run JavaScript (adds the iframe sandbox's `allow-scripts` token). Defaults to true when rendered through the Notion block catalog — pass `false` explicitly to disable script execution. (The underlying `ElmHtml` component still defaults to `false` when used directly, outside the A2UI catalog.) `allow-same-origin` is never granted together with this, in `html` or `src` mode, so the embedded document can never escape the sandbox even with scripts enabled.").optional(),
|
|
282
|
+
height: z.number().describe("Fallback pixel height for the iframe, used whenever `autoHeight` can't measure the actual content (e.g. `allowScripts` content, or a genuinely cross-origin `src`). Defaults to 400 when omitted. Ignored once `autoHeight` successfully measures real content — it only ever applies as a starting/fallback size, never a hard cap.").optional()
|
|
282
283
|
}).strict()
|
|
283
284
|
};
|
|
284
285
|
const CodeBlockApi = {
|
|
@@ -638,29 +639,30 @@ function assembleCatalog(envelope, components) {
|
|
|
638
639
|
};
|
|
639
640
|
}
|
|
640
641
|
//#endregion
|
|
641
|
-
//#region src/a2ui/v0_9/block-catalog-json.ts
|
|
642
|
+
//#region src/a2ui/v0_9/notion-block-catalog-json.ts
|
|
642
643
|
/**
|
|
643
644
|
* Method A — runtime catalog constant.
|
|
644
645
|
*
|
|
645
|
-
* Assembles the block catalog from the `*Api` Zod definitions into a
|
|
646
|
+
* Assembles the Notion block catalog from the `*Api` Zod definitions into a
|
|
646
647
|
* freestanding A2UI v0.9 catalog JSON Schema document. Consumers that want
|
|
647
648
|
* the catalog at runtime (e.g. to feed into an LLM system prompt or to
|
|
648
|
-
* validate an inbound A2UI message) import `
|
|
649
|
+
* validate an inbound A2UI message) import `notionBlockCatalogJson` directly.
|
|
649
650
|
*
|
|
650
651
|
* Consumers that want the document as a hostable artifact use Method B:
|
|
651
|
-
* `dist/a2ui/
|
|
652
|
-
* constant and is served at the URL identified by
|
|
652
|
+
* `dist/a2ui/notion_block_catalog.json` is emitted at build time from this
|
|
653
|
+
* same constant and is served at the URL identified by
|
|
654
|
+
* `NOTION_BLOCK_CATALOG_ID`.
|
|
653
655
|
*/
|
|
654
656
|
/**
|
|
655
|
-
* Stable URI identifying the block catalog. Lives under the
|
|
656
|
-
* GitHub Pages site so the JSON Schema is fetchable by
|
|
657
|
-
* and validators that look up `catalogId`.
|
|
657
|
+
* Stable URI identifying the Notion block catalog. Lives under the
|
|
658
|
+
* `elmethis` GitHub Pages site so the JSON Schema is fetchable by
|
|
659
|
+
* third-party agents and validators that look up `catalogId`.
|
|
658
660
|
*/
|
|
659
|
-
const
|
|
660
|
-
const
|
|
661
|
-
id:
|
|
662
|
-
title: "Elmethis Block Catalog",
|
|
663
|
-
description: "
|
|
661
|
+
const NOTION_BLOCK_CATALOG_ID = "https://46ki75.github.io/elmethis/a2ui/v0_9/notion_block_catalog.json";
|
|
662
|
+
const notionBlockCatalogJson = assembleCatalog({
|
|
663
|
+
id: NOTION_BLOCK_CATALOG_ID,
|
|
664
|
+
title: "Elmethis Notion Block Catalog",
|
|
665
|
+
description: "Notion block-level A2UI components used by the @elmethis renderers (typography, media, code, math, table, tabs). Extends — does not replace — the A2UI Basic Catalog."
|
|
664
666
|
}, [
|
|
665
667
|
RichTextApi,
|
|
666
668
|
LinkTextApi,
|
|
@@ -1283,4 +1285,4 @@ const normalizeLanguage = (language) => ALIAS_TO_LANGUAGE.get(language) ?? "file
|
|
|
1283
1285
|
/** The authored glyph artwork for every {@link GlyphLanguage}. */
|
|
1284
1286
|
const languageIcons = Object.fromEntries(LANGUAGE_REGISTRY.flatMap((e) => e.icon ? [[e.key, e.icon]] : []));
|
|
1285
1287
|
//#endregion
|
|
1286
|
-
export { AudioApi,
|
|
1288
|
+
export { AudioApi, BlockImageApi, BlockQuoteApi, BookmarkApi, CalloutApi, CodeBlockApi, ColumnApi, ColumnListApi, ContentTabApi, ContentTabsApi, DividerApi, FileApi, HeadingApi, HtmlApi, IconApi, KatexApi, LANGUAGES, LinkTextApi, ListApi, ListItemApi, MermaidApi, NOTION_BLOCK_CATALOG_ID, NotionCalloutApi, ParagraphApi, RichTextApi, RowApi, TableApi, TableCellApi, TableRowApi, ToggleApi, UnsupportedApi, VideoApi, assembleCatalog, languageIcons, normalizeLanguage, notionBlockCatalogJson };
|