@elmethis/core 0.18.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} +14 -6
- package/dist/index.cjs +23 -20
- package/dist/index.d.cts +14 -8
- package/dist/index.d.mts +14 -8
- package/dist/index.mjs +20 -17
- 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,11 +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
|
+
},
|
|
902
|
+
"allowScripts": {
|
|
903
|
+
"type": "boolean",
|
|
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."
|
|
901
909
|
}
|
|
902
910
|
},
|
|
903
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,8 +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.
|
|
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()
|
|
282
284
|
}).strict()
|
|
283
285
|
};
|
|
284
286
|
const CodeBlockApi = {
|
|
@@ -638,26 +640,27 @@ function assembleCatalog(envelope, components) {
|
|
|
638
640
|
};
|
|
639
641
|
}
|
|
640
642
|
//#endregion
|
|
641
|
-
//#region src/a2ui/v0_9/block-catalog-json.ts
|
|
643
|
+
//#region src/a2ui/v0_9/notion-block-catalog-json.ts
|
|
642
644
|
/**
|
|
643
645
|
* Method A — runtime catalog constant.
|
|
644
646
|
*
|
|
645
|
-
* Assembles the block catalog from the `*Api` Zod definitions into a
|
|
647
|
+
* Assembles the Notion block catalog from the `*Api` Zod definitions into a
|
|
646
648
|
* freestanding A2UI v0.9 catalog JSON Schema document. Consumers that want
|
|
647
649
|
* the catalog at runtime (e.g. to feed into an LLM system prompt or to
|
|
648
|
-
* validate an inbound A2UI message) import `
|
|
650
|
+
* validate an inbound A2UI message) import `notionBlockCatalogJson` directly.
|
|
649
651
|
*
|
|
650
652
|
* 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
|
|
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`.
|
|
653
656
|
*/
|
|
654
657
|
/**
|
|
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`.
|
|
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`.
|
|
658
661
|
*/
|
|
659
|
-
const
|
|
660
|
-
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 = [
|
|
661
664
|
RichTextApi,
|
|
662
665
|
LinkTextApi,
|
|
663
666
|
IconApi,
|
|
@@ -689,11 +692,11 @@ const BLOCK_CATALOG_COMPONENTS = [
|
|
|
689
692
|
TableCellApi,
|
|
690
693
|
UnsupportedApi
|
|
691
694
|
];
|
|
692
|
-
const
|
|
693
|
-
id:
|
|
694
|
-
title: "Elmethis Block Catalog",
|
|
695
|
-
description: "
|
|
696
|
-
},
|
|
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);
|
|
697
700
|
//#endregion
|
|
698
701
|
//#region src/icon/languages/registry.ts
|
|
699
702
|
/**
|
|
@@ -1285,7 +1288,6 @@ const normalizeLanguage = (language) => ALIAS_TO_LANGUAGE.get(language) ?? "file
|
|
|
1285
1288
|
const languageIcons = Object.fromEntries(LANGUAGE_REGISTRY.flatMap((e) => e.icon ? [[e.key, e.icon]] : []));
|
|
1286
1289
|
//#endregion
|
|
1287
1290
|
exports.AudioApi = AudioApi;
|
|
1288
|
-
exports.BLOCK_CATALOG_ID = BLOCK_CATALOG_ID;
|
|
1289
1291
|
exports.BlockImageApi = BlockImageApi;
|
|
1290
1292
|
exports.BlockQuoteApi = BlockQuoteApi;
|
|
1291
1293
|
exports.BookmarkApi = BookmarkApi;
|
|
@@ -1306,6 +1308,7 @@ exports.LinkTextApi = LinkTextApi;
|
|
|
1306
1308
|
exports.ListApi = ListApi;
|
|
1307
1309
|
exports.ListItemApi = ListItemApi;
|
|
1308
1310
|
exports.MermaidApi = MermaidApi;
|
|
1311
|
+
exports.NOTION_BLOCK_CATALOG_ID = NOTION_BLOCK_CATALOG_ID;
|
|
1309
1312
|
exports.NotionCalloutApi = NotionCalloutApi;
|
|
1310
1313
|
exports.ParagraphApi = ParagraphApi;
|
|
1311
1314
|
exports.RichTextApi = RichTextApi;
|
|
@@ -1317,6 +1320,6 @@ exports.ToggleApi = ToggleApi;
|
|
|
1317
1320
|
exports.UnsupportedApi = UnsupportedApi;
|
|
1318
1321
|
exports.VideoApi = VideoApi;
|
|
1319
1322
|
exports.assembleCatalog = assembleCatalog;
|
|
1320
|
-
exports.blockCatalogJson = blockCatalogJson;
|
|
1321
1323
|
exports.languageIcons = languageIcons;
|
|
1322
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<{
|
|
@@ -2567,6 +2567,8 @@ declare const HtmlApi: {
|
|
|
2567
2567
|
html: z.ZodOptional<z.ZodString>;
|
|
2568
2568
|
src: z.ZodOptional<z.ZodString>;
|
|
2569
2569
|
autoHeight: z.ZodOptional<z.ZodBoolean>;
|
|
2570
|
+
allowScripts: z.ZodOptional<z.ZodBoolean>;
|
|
2571
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
2570
2572
|
accessibility: z.ZodOptional<z.ZodObject<{
|
|
2571
2573
|
label: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
2572
2574
|
path: z.ZodString;
|
|
@@ -2657,8 +2659,10 @@ declare const HtmlApi: {
|
|
|
2657
2659
|
} | undefined;
|
|
2658
2660
|
weight?: number | undefined;
|
|
2659
2661
|
src?: string | undefined;
|
|
2662
|
+
height?: number | undefined;
|
|
2660
2663
|
html?: string | undefined;
|
|
2661
2664
|
autoHeight?: boolean | undefined;
|
|
2665
|
+
allowScripts?: boolean | undefined;
|
|
2662
2666
|
}, {
|
|
2663
2667
|
accessibility?: {
|
|
2664
2668
|
description?: string | {
|
|
@@ -2678,8 +2682,10 @@ declare const HtmlApi: {
|
|
|
2678
2682
|
} | undefined;
|
|
2679
2683
|
weight?: number | undefined;
|
|
2680
2684
|
src?: string | undefined;
|
|
2685
|
+
height?: number | undefined;
|
|
2681
2686
|
html?: string | undefined;
|
|
2682
2687
|
autoHeight?: boolean | undefined;
|
|
2688
|
+
allowScripts?: boolean | undefined;
|
|
2683
2689
|
}>;
|
|
2684
2690
|
};
|
|
2685
2691
|
declare const CodeBlockApi: {
|
|
@@ -3810,14 +3816,14 @@ interface AssembledCatalog {
|
|
|
3810
3816
|
*/
|
|
3811
3817
|
declare function assembleCatalog(envelope: CatalogEnvelope, components: readonly ComponentApi[]): AssembledCatalog;
|
|
3812
3818
|
//#endregion
|
|
3813
|
-
//#region src/a2ui/v0_9/block-catalog-json.d.ts
|
|
3819
|
+
//#region src/a2ui/v0_9/notion-block-catalog-json.d.ts
|
|
3814
3820
|
/**
|
|
3815
|
-
* Stable URI identifying the block catalog. Lives under the
|
|
3816
|
-
* GitHub Pages site so the JSON Schema is fetchable by
|
|
3817
|
-
* 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`.
|
|
3818
3824
|
*/
|
|
3819
|
-
declare const
|
|
3820
|
-
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;
|
|
3821
3827
|
//#endregion
|
|
3822
3828
|
//#region src/icon/languages/types.d.ts
|
|
3823
3829
|
/**
|
|
@@ -3946,4 +3952,4 @@ declare const normalizeLanguage: (language: string) => Language;
|
|
|
3946
3952
|
/** The authored glyph artwork for every {@link GlyphLanguage}. */
|
|
3947
3953
|
declare const languageIcons: Record<GlyphLanguage, LanguageIcon>;
|
|
3948
3954
|
//#endregion
|
|
3949
|
-
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<{
|
|
@@ -2567,6 +2567,8 @@ declare const HtmlApi: {
|
|
|
2567
2567
|
html: z.ZodOptional<z.ZodString>;
|
|
2568
2568
|
src: z.ZodOptional<z.ZodString>;
|
|
2569
2569
|
autoHeight: z.ZodOptional<z.ZodBoolean>;
|
|
2570
|
+
allowScripts: z.ZodOptional<z.ZodBoolean>;
|
|
2571
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
2570
2572
|
accessibility: z.ZodOptional<z.ZodObject<{
|
|
2571
2573
|
label: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
2572
2574
|
path: z.ZodString;
|
|
@@ -2657,8 +2659,10 @@ declare const HtmlApi: {
|
|
|
2657
2659
|
} | undefined;
|
|
2658
2660
|
weight?: number | undefined;
|
|
2659
2661
|
src?: string | undefined;
|
|
2662
|
+
height?: number | undefined;
|
|
2660
2663
|
html?: string | undefined;
|
|
2661
2664
|
autoHeight?: boolean | undefined;
|
|
2665
|
+
allowScripts?: boolean | undefined;
|
|
2662
2666
|
}, {
|
|
2663
2667
|
accessibility?: {
|
|
2664
2668
|
description?: string | {
|
|
@@ -2678,8 +2682,10 @@ declare const HtmlApi: {
|
|
|
2678
2682
|
} | undefined;
|
|
2679
2683
|
weight?: number | undefined;
|
|
2680
2684
|
src?: string | undefined;
|
|
2685
|
+
height?: number | undefined;
|
|
2681
2686
|
html?: string | undefined;
|
|
2682
2687
|
autoHeight?: boolean | undefined;
|
|
2688
|
+
allowScripts?: boolean | undefined;
|
|
2683
2689
|
}>;
|
|
2684
2690
|
};
|
|
2685
2691
|
declare const CodeBlockApi: {
|
|
@@ -3810,14 +3816,14 @@ interface AssembledCatalog {
|
|
|
3810
3816
|
*/
|
|
3811
3817
|
declare function assembleCatalog(envelope: CatalogEnvelope, components: readonly ComponentApi[]): AssembledCatalog;
|
|
3812
3818
|
//#endregion
|
|
3813
|
-
//#region src/a2ui/v0_9/block-catalog-json.d.ts
|
|
3819
|
+
//#region src/a2ui/v0_9/notion-block-catalog-json.d.ts
|
|
3814
3820
|
/**
|
|
3815
|
-
* Stable URI identifying the block catalog. Lives under the
|
|
3816
|
-
* GitHub Pages site so the JSON Schema is fetchable by
|
|
3817
|
-
* 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`.
|
|
3818
3824
|
*/
|
|
3819
|
-
declare const
|
|
3820
|
-
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;
|
|
3821
3827
|
//#endregion
|
|
3822
3828
|
//#region src/icon/languages/types.d.ts
|
|
3823
3829
|
/**
|
|
@@ -3946,4 +3952,4 @@ declare const normalizeLanguage: (language: string) => Language;
|
|
|
3946
3952
|
/** The authored glyph artwork for every {@link GlyphLanguage}. */
|
|
3947
3953
|
declare const languageIcons: Record<GlyphLanguage, LanguageIcon>;
|
|
3948
3954
|
//#endregion
|
|
3949
|
-
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,8 +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.
|
|
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()
|
|
281
283
|
}).strict()
|
|
282
284
|
};
|
|
283
285
|
const CodeBlockApi = {
|
|
@@ -637,29 +639,30 @@ function assembleCatalog(envelope, components) {
|
|
|
637
639
|
};
|
|
638
640
|
}
|
|
639
641
|
//#endregion
|
|
640
|
-
//#region src/a2ui/v0_9/block-catalog-json.ts
|
|
642
|
+
//#region src/a2ui/v0_9/notion-block-catalog-json.ts
|
|
641
643
|
/**
|
|
642
644
|
* Method A — runtime catalog constant.
|
|
643
645
|
*
|
|
644
|
-
* Assembles the block catalog from the `*Api` Zod definitions into a
|
|
646
|
+
* Assembles the Notion block catalog from the `*Api` Zod definitions into a
|
|
645
647
|
* freestanding A2UI v0.9 catalog JSON Schema document. Consumers that want
|
|
646
648
|
* the catalog at runtime (e.g. to feed into an LLM system prompt or to
|
|
647
|
-
* validate an inbound A2UI message) import `
|
|
649
|
+
* validate an inbound A2UI message) import `notionBlockCatalogJson` directly.
|
|
648
650
|
*
|
|
649
651
|
* Consumers that want the document as a hostable artifact use Method B:
|
|
650
|
-
* `dist/a2ui/
|
|
651
|
-
* 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`.
|
|
652
655
|
*/
|
|
653
656
|
/**
|
|
654
|
-
* Stable URI identifying the block catalog. Lives under the
|
|
655
|
-
* GitHub Pages site so the JSON Schema is fetchable by
|
|
656
|
-
* 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`.
|
|
657
660
|
*/
|
|
658
|
-
const
|
|
659
|
-
const
|
|
660
|
-
id:
|
|
661
|
-
title: "Elmethis Block Catalog",
|
|
662
|
-
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."
|
|
663
666
|
}, [
|
|
664
667
|
RichTextApi,
|
|
665
668
|
LinkTextApi,
|
|
@@ -1282,4 +1285,4 @@ const normalizeLanguage = (language) => ALIAS_TO_LANGUAGE.get(language) ?? "file
|
|
|
1282
1285
|
/** The authored glyph artwork for every {@link GlyphLanguage}. */
|
|
1283
1286
|
const languageIcons = Object.fromEntries(LANGUAGE_REGISTRY.flatMap((e) => e.icon ? [[e.key, e.icon]] : []));
|
|
1284
1287
|
//#endregion
|
|
1285
|
-
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 };
|