@elmethis/core 0.19.0 → 0.21.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.
@@ -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/block_catalog.json",
4
- "catalogId": "https://46ki75.github.io/elmethis/a2ui/v0_9/block_catalog.json",
5
- "title": "Elmethis Block Catalog",
6
- "description": "Block-level A2UI components used by the @elmethis renderers (typography, media, code, math, table, tabs). Extends — does not replace — the A2UI Basic Catalog.",
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` doesn't apply here since cross-origin content can't be measured, and a time-limited URL isn't refreshed automatically — the caller is responsible for keeping it current."
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. Only takes effect for `html`-rendered content."
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 false — script execution is disabled by default. `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."
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` doesn't apply here since cross-origin content can't be measured, 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. Only takes effect for `html`-rendered content.").optional(),
282
- allowScripts: zod.z.boolean().describe("Allow the embedded content to run JavaScript (adds the iframe sandbox's `allow-scripts` token). Defaults to false — script execution is disabled by default. `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()
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 `blockCatalogJson` directly.
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/block_catalog.json` is emitted at build time from this same
653
- * constant and is served at the URL identified by `BLOCK_CATALOG_ID`.
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 `elmethis`
657
- * GitHub Pages site so the JSON Schema is fetchable by third-party agents
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 BLOCK_CATALOG_ID = "https://46ki75.github.io/elmethis/a2ui/v0_9/block_catalog.json";
661
- const BLOCK_CATALOG_COMPONENTS = [
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 blockCatalogJson = assembleCatalog({
694
- id: BLOCK_CATALOG_ID,
695
- title: "Elmethis Block Catalog",
696
- description: "Block-level A2UI components used by the @elmethis renderers (typography, media, code, math, table, tabs). Extends — does not replace — the A2UI Basic Catalog."
697
- }, BLOCK_CATALOG_COMPONENTS);
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 `elmethis`
3819
- * GitHub Pages site so the JSON Schema is fetchable by third-party agents
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 BLOCK_CATALOG_ID = "https://46ki75.github.io/elmethis/a2ui/v0_9/block_catalog.json";
3823
- declare const blockCatalogJson: AssembledCatalog;
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, BLOCK_CATALOG_ID, 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, NotionCalloutApi, ParagraphApi, RichTextApi, RowApi, type SvgNode, TableApi, TableCellApi, TableRowApi, ToggleApi, UnsupportedApi, VideoApi, assembleCatalog, blockCatalogJson, languageIcons, normalizeLanguage };
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 `elmethis`
3819
- * GitHub Pages site so the JSON Schema is fetchable by third-party agents
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 BLOCK_CATALOG_ID = "https://46ki75.github.io/elmethis/a2ui/v0_9/block_catalog.json";
3823
- declare const blockCatalogJson: AssembledCatalog;
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, BLOCK_CATALOG_ID, 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, NotionCalloutApi, ParagraphApi, RichTextApi, RowApi, type SvgNode, TableApi, TableCellApi, TableRowApi, ToggleApi, UnsupportedApi, VideoApi, assembleCatalog, blockCatalogJson, languageIcons, normalizeLanguage };
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` doesn't apply here since cross-origin content can't be measured, 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. Only takes effect for `html`-rendered content.").optional(),
281
- allowScripts: z.boolean().describe("Allow the embedded content to run JavaScript (adds the iframe sandbox's `allow-scripts` token). Defaults to false — script execution is disabled by default. `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()
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 `blockCatalogJson` directly.
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/block_catalog.json` is emitted at build time from this same
652
- * constant and is served at the URL identified by `BLOCK_CATALOG_ID`.
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 `elmethis`
656
- * GitHub Pages site so the JSON Schema is fetchable by third-party agents
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 BLOCK_CATALOG_ID = "https://46ki75.github.io/elmethis/a2ui/v0_9/block_catalog.json";
660
- const blockCatalogJson = assembleCatalog({
661
- id: BLOCK_CATALOG_ID,
662
- title: "Elmethis Block Catalog",
663
- description: "Block-level A2UI components used by the @elmethis renderers (typography, media, code, math, table, tabs). Extends — does not replace — the A2UI Basic Catalog."
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, BLOCK_CATALOG_ID, BlockImageApi, BlockQuoteApi, BookmarkApi, CalloutApi, CodeBlockApi, ColumnApi, ColumnListApi, ContentTabApi, ContentTabsApi, DividerApi, FileApi, HeadingApi, HtmlApi, IconApi, KatexApi, LANGUAGES, LinkTextApi, ListApi, ListItemApi, MermaidApi, NotionCalloutApi, ParagraphApi, RichTextApi, RowApi, TableApi, TableCellApi, TableRowApi, ToggleApi, UnsupportedApi, VideoApi, assembleCatalog, blockCatalogJson, languageIcons, normalizeLanguage };
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 };
package/dist/tokens.css CHANGED
@@ -56,10 +56,18 @@
56
56
  oklch(from #3e434b l c h / 0.25),
57
57
  var(--elmethis-primitive-color-slate-900)
58
58
  );
59
+ --elmethis-color-accent-link-surface: light-dark(
60
+ var(--elmethis-primitive-color-blue-100),
61
+ var(--elmethis-primitive-color-blue-900)
62
+ );
59
63
  --elmethis-color-accent-link: var(--elmethis-primitive-color-blue-500);
60
64
  --elmethis-color-accent-link-visited: var(
61
65
  --elmethis-primitive-color-purple-500
62
66
  );
67
+ --elmethis-color-accent-link-surface-visited: light-dark(
68
+ var(--elmethis-primitive-color-purple-100),
69
+ var(--elmethis-primitive-color-purple-900)
70
+ );
63
71
  --elmethis-color-accent-info: var(--elmethis-primitive-color-blue-500);
64
72
  --elmethis-color-accent-info-surface: light-dark(
65
73
  var(--elmethis-primitive-color-blue-100),
@@ -85,6 +93,11 @@
85
93
  var(--elmethis-primitive-color-red-100),
86
94
  var(--elmethis-primitive-color-red-900)
87
95
  );
96
+ --elmethis-color-divider: light-dark(
97
+ var(--elmethis-primitive-color-gold-300),
98
+ var(--elmethis-primitive-color-slate-800)
99
+ );
100
+ --elmethis-color-modal-backdrop: oklch(from black l c h / 50%);
88
101
  --elmethis-color-surface-sunken: light-dark(
89
102
  var(--elmethis-primitive-color-gold-300),
90
103
  var(--elmethis-primitive-color-slate-800)
@@ -118,6 +131,9 @@
118
131
  --elmethis-color-primary-hover: oklch(
119
132
  from var(--elmethis-color-primary) l c h / 15%
120
133
  );
134
+ --elmethis-color-selection: oklch(
135
+ from var(--elmethis-color-primary) l c h / 25%
136
+ );
121
137
  --elmethis-color-display-red: var(--elmethis-primitive-color-red-500);
122
138
  --elmethis-color-display-red-surface: light-dark(
123
139
  var(--elmethis-primitive-color-red-100),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmethis/core",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "author": {
5
5
  "name": "Ikuma Yamashita",
6
6
  "url": "https://www.ikuma.cloud/"
@@ -43,9 +43,9 @@
43
43
  "zod-to-json-schema": "^3.25.2"
44
44
  },
45
45
  "devDependencies": {
46
- "@a2ui/web_core": "^0.10.0",
46
+ "@a2ui/web_core": "^0.10.5",
47
47
  "@eslint/js": "latest",
48
- "@types/node": "26.1.0",
48
+ "@types/node": "26.1.1",
49
49
  "@vanilla-extract/css": "^1.21.1",
50
50
  "@vanilla-extract/esbuild-plugin": "^2.3.22",
51
51
  "@vitest/coverage-v8": "^4.1.10",
@@ -53,14 +53,14 @@
53
53
  "ajv-formats": "^3.0.1",
54
54
  "concurrently": "^10.0.3",
55
55
  "esbuild": "^0.28.1",
56
- "eslint": "^10.6.0",
57
- "globals": "^17.7.0",
58
- "prettier": "3.9.4",
59
- "tsdown": "^0.22.4",
60
- "tsx": "^4.23.0",
56
+ "eslint": "^10.8.0",
57
+ "globals": "^17.8.0",
58
+ "prettier": "3.9.6",
59
+ "tsdown": "^0.22.14",
60
+ "tsx": "^4.23.1",
61
61
  "typescript": "5.9.3",
62
- "typescript-eslint": "^8.63.0",
63
- "vitest": "^4.1.8",
62
+ "typescript-eslint": "^8.65.0",
63
+ "vitest": "^4.1.10",
64
64
  "zod": "^3"
65
65
  },
66
66
  "scripts": {