@elmethis/core 0.14.0 → 0.16.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 +97 -0
- package/dist/index.cjs +36 -1
- package/dist/index.d.cts +182 -4
- package/dist/index.d.mts +182 -4
- package/dist/index.mjs +36 -2
- package/dist/tokens.css +8 -2
- package/package.json +10 -10
|
@@ -483,6 +483,103 @@
|
|
|
483
483
|
],
|
|
484
484
|
"unevaluatedProperties": false
|
|
485
485
|
},
|
|
486
|
+
"NotionCallout": {
|
|
487
|
+
"type": "object",
|
|
488
|
+
"allOf": [
|
|
489
|
+
{
|
|
490
|
+
"$ref": "#/$defs/ComponentCommon"
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"$ref": "#/$defs/CatalogComponentCommon"
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"type": "object",
|
|
497
|
+
"properties": {
|
|
498
|
+
"component": {
|
|
499
|
+
"const": "NotionCallout"
|
|
500
|
+
},
|
|
501
|
+
"icon": {
|
|
502
|
+
"anyOf": [
|
|
503
|
+
{
|
|
504
|
+
"type": "object",
|
|
505
|
+
"properties": {
|
|
506
|
+
"kind": {
|
|
507
|
+
"type": "string",
|
|
508
|
+
"const": "emoji"
|
|
509
|
+
},
|
|
510
|
+
"emoji": {
|
|
511
|
+
"type": "string",
|
|
512
|
+
"description": "A single emoji character."
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
"required": [
|
|
516
|
+
"kind",
|
|
517
|
+
"emoji"
|
|
518
|
+
],
|
|
519
|
+
"additionalProperties": false
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"type": "object",
|
|
523
|
+
"properties": {
|
|
524
|
+
"kind": {
|
|
525
|
+
"type": "string",
|
|
526
|
+
"const": "image"
|
|
527
|
+
},
|
|
528
|
+
"src": {
|
|
529
|
+
"type": "string",
|
|
530
|
+
"description": "The source URL of the icon image."
|
|
531
|
+
},
|
|
532
|
+
"alt": {
|
|
533
|
+
"type": "string",
|
|
534
|
+
"description": "Accessible alt text for the icon."
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
"required": [
|
|
538
|
+
"kind",
|
|
539
|
+
"src"
|
|
540
|
+
],
|
|
541
|
+
"additionalProperties": false
|
|
542
|
+
}
|
|
543
|
+
],
|
|
544
|
+
"description": "Icon shown before the content: an emoji or an image."
|
|
545
|
+
},
|
|
546
|
+
"color": {
|
|
547
|
+
"type": "string",
|
|
548
|
+
"enum": [
|
|
549
|
+
"default",
|
|
550
|
+
"gray",
|
|
551
|
+
"red",
|
|
552
|
+
"orange",
|
|
553
|
+
"yellow",
|
|
554
|
+
"green",
|
|
555
|
+
"cyan",
|
|
556
|
+
"blue",
|
|
557
|
+
"purple",
|
|
558
|
+
"magenta"
|
|
559
|
+
],
|
|
560
|
+
"description": "Accent hue for the callout."
|
|
561
|
+
},
|
|
562
|
+
"variant": {
|
|
563
|
+
"type": "string",
|
|
564
|
+
"enum": [
|
|
565
|
+
"filled",
|
|
566
|
+
"outlined"
|
|
567
|
+
],
|
|
568
|
+
"description": "Tinted background ('filled') or transparent with a colored border ('outlined')."
|
|
569
|
+
},
|
|
570
|
+
"children": {
|
|
571
|
+
"$ref": "#/$defs/ChildList",
|
|
572
|
+
"description": "Ordered list of child component IDs that make up the callout body."
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
"required": [
|
|
576
|
+
"component",
|
|
577
|
+
"children"
|
|
578
|
+
]
|
|
579
|
+
}
|
|
580
|
+
],
|
|
581
|
+
"unevaluatedProperties": false
|
|
582
|
+
},
|
|
486
583
|
"Divider": {
|
|
487
584
|
"type": "object",
|
|
488
585
|
"allOf": [
|
package/dist/index.cjs
CHANGED
|
@@ -146,6 +146,39 @@ const CalloutApi = {
|
|
|
146
146
|
children: childrenSchema.describe("Ordered list of child component IDs that make up the callout body.")
|
|
147
147
|
}).strict()
|
|
148
148
|
};
|
|
149
|
+
/**
|
|
150
|
+
* Notion-style callout: an icon (emoji or image) plus a colored, filled or
|
|
151
|
+
* outlined block. Unlike {@link CalloutApi}, it carries no severity/flavor
|
|
152
|
+
* text — the color and icon alone convey meaning.
|
|
153
|
+
*/
|
|
154
|
+
const NotionCalloutApi = {
|
|
155
|
+
name: "NotionCallout",
|
|
156
|
+
schema: zod.z.object({
|
|
157
|
+
...CommonProps,
|
|
158
|
+
icon: zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
159
|
+
kind: zod.z.literal("emoji"),
|
|
160
|
+
emoji: zod.z.string().describe("A single emoji character.")
|
|
161
|
+
}).strict(), zod.z.object({
|
|
162
|
+
kind: zod.z.literal("image"),
|
|
163
|
+
src: zod.z.string().describe("The source URL of the icon image."),
|
|
164
|
+
alt: zod.z.string().describe("Accessible alt text for the icon.").optional()
|
|
165
|
+
}).strict()]).describe("Icon shown before the content: an emoji or an image.").optional(),
|
|
166
|
+
color: zod.z.enum([
|
|
167
|
+
"default",
|
|
168
|
+
"gray",
|
|
169
|
+
"red",
|
|
170
|
+
"orange",
|
|
171
|
+
"yellow",
|
|
172
|
+
"green",
|
|
173
|
+
"cyan",
|
|
174
|
+
"blue",
|
|
175
|
+
"purple",
|
|
176
|
+
"magenta"
|
|
177
|
+
]).describe("Accent hue for the callout.").optional(),
|
|
178
|
+
variant: zod.z.enum(["filled", "outlined"]).describe("Tinted background ('filled') or transparent with a colored border ('outlined').").optional(),
|
|
179
|
+
children: childrenSchema.describe("Ordered list of child component IDs that make up the callout body.")
|
|
180
|
+
}).strict()
|
|
181
|
+
};
|
|
149
182
|
/** Horizontal rule / section separator. Has no configurable properties. */
|
|
150
183
|
const DividerApi = {
|
|
151
184
|
name: "Divider",
|
|
@@ -537,7 +570,7 @@ function collapseCommonRefs(node) {
|
|
|
537
570
|
for (const [k, v] of Object.entries(obj)) out[k] = collapseCommonRefs(v);
|
|
538
571
|
return out;
|
|
539
572
|
}
|
|
540
|
-
const FACTORED_OUT_KEYS = new Set(["accessibility", "weight"]);
|
|
573
|
+
const FACTORED_OUT_KEYS = /* @__PURE__ */ new Set(["accessibility", "weight"]);
|
|
541
574
|
function buildComponentSchema(api) {
|
|
542
575
|
const inner = (0, zod_to_json_schema.zodToJsonSchema)(zod.z.object({ x: api.schema }), {
|
|
543
576
|
$refStrategy: "none",
|
|
@@ -622,6 +655,7 @@ const BLOCK_CATALOG_COMPONENTS = [
|
|
|
622
655
|
ListItemApi,
|
|
623
656
|
BlockQuoteApi,
|
|
624
657
|
CalloutApi,
|
|
658
|
+
NotionCalloutApi,
|
|
625
659
|
DividerApi,
|
|
626
660
|
ToggleApi,
|
|
627
661
|
BookmarkApi,
|
|
@@ -1255,6 +1289,7 @@ exports.LinkTextApi = LinkTextApi;
|
|
|
1255
1289
|
exports.ListApi = ListApi;
|
|
1256
1290
|
exports.ListItemApi = ListItemApi;
|
|
1257
1291
|
exports.MermaidApi = MermaidApi;
|
|
1292
|
+
exports.NotionCalloutApi = NotionCalloutApi;
|
|
1258
1293
|
exports.ParagraphApi = ParagraphApi;
|
|
1259
1294
|
exports.RichTextApi = RichTextApi;
|
|
1260
1295
|
exports.RowApi = _a2ui_web_core_v0_9_basic_catalog.RowApi;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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
|
-
|
|
5
4
|
//#region src/a2ui/v0_9/block-catalog.d.ts
|
|
6
5
|
declare const RichTextApi: {
|
|
7
6
|
name: string;
|
|
@@ -1454,6 +1453,185 @@ declare const CalloutApi: {
|
|
|
1454
1453
|
weight?: number | undefined;
|
|
1455
1454
|
}>;
|
|
1456
1455
|
};
|
|
1456
|
+
/**
|
|
1457
|
+
* Notion-style callout: an icon (emoji or image) plus a colored, filled or
|
|
1458
|
+
* outlined block. Unlike {@link CalloutApi}, it carries no severity/flavor
|
|
1459
|
+
* text — the color and icon alone convey meaning.
|
|
1460
|
+
*/
|
|
1461
|
+
declare const NotionCalloutApi: {
|
|
1462
|
+
name: string;
|
|
1463
|
+
schema: z.ZodObject<{
|
|
1464
|
+
icon: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
1465
|
+
kind: z.ZodLiteral<"emoji">;
|
|
1466
|
+
emoji: z.ZodString;
|
|
1467
|
+
}, "strict", z.ZodTypeAny, {
|
|
1468
|
+
kind: "emoji";
|
|
1469
|
+
emoji: string;
|
|
1470
|
+
}, {
|
|
1471
|
+
kind: "emoji";
|
|
1472
|
+
emoji: string;
|
|
1473
|
+
}>, z.ZodObject<{
|
|
1474
|
+
kind: z.ZodLiteral<"image">;
|
|
1475
|
+
src: z.ZodString;
|
|
1476
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
1477
|
+
}, "strict", z.ZodTypeAny, {
|
|
1478
|
+
src: string;
|
|
1479
|
+
kind: "image";
|
|
1480
|
+
alt?: string | undefined;
|
|
1481
|
+
}, {
|
|
1482
|
+
src: string;
|
|
1483
|
+
kind: "image";
|
|
1484
|
+
alt?: string | undefined;
|
|
1485
|
+
}>]>>;
|
|
1486
|
+
color: z.ZodOptional<z.ZodEnum<["default", "gray", "red", "orange", "yellow", "green", "cyan", "blue", "purple", "magenta"]>>;
|
|
1487
|
+
variant: z.ZodOptional<z.ZodEnum<["filled", "outlined"]>>;
|
|
1488
|
+
children: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
1489
|
+
componentId: z.ZodString;
|
|
1490
|
+
path: z.ZodString;
|
|
1491
|
+
}, "strip", z.ZodTypeAny, {
|
|
1492
|
+
componentId: string;
|
|
1493
|
+
path: string;
|
|
1494
|
+
}, {
|
|
1495
|
+
componentId: string;
|
|
1496
|
+
path: string;
|
|
1497
|
+
}>]>;
|
|
1498
|
+
accessibility: z.ZodOptional<z.ZodObject<{
|
|
1499
|
+
label: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1500
|
+
path: z.ZodString;
|
|
1501
|
+
}, "strip", z.ZodTypeAny, {
|
|
1502
|
+
path: string;
|
|
1503
|
+
}, {
|
|
1504
|
+
path: string;
|
|
1505
|
+
}>, z.ZodObject<{
|
|
1506
|
+
call: z.ZodString;
|
|
1507
|
+
args: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
1508
|
+
returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
|
|
1509
|
+
}, "strip", z.ZodTypeAny, {
|
|
1510
|
+
call: string;
|
|
1511
|
+
args: Record<string, any>;
|
|
1512
|
+
returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
|
|
1513
|
+
}, {
|
|
1514
|
+
call: string;
|
|
1515
|
+
args: Record<string, any>;
|
|
1516
|
+
returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
|
|
1517
|
+
}>]>>;
|
|
1518
|
+
description: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1519
|
+
path: z.ZodString;
|
|
1520
|
+
}, "strip", z.ZodTypeAny, {
|
|
1521
|
+
path: string;
|
|
1522
|
+
}, {
|
|
1523
|
+
path: string;
|
|
1524
|
+
}>, z.ZodObject<{
|
|
1525
|
+
call: z.ZodString;
|
|
1526
|
+
args: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
1527
|
+
returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
|
|
1528
|
+
}, "strip", z.ZodTypeAny, {
|
|
1529
|
+
call: string;
|
|
1530
|
+
args: Record<string, any>;
|
|
1531
|
+
returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
|
|
1532
|
+
}, {
|
|
1533
|
+
call: string;
|
|
1534
|
+
args: Record<string, any>;
|
|
1535
|
+
returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
|
|
1536
|
+
}>]>>;
|
|
1537
|
+
}, "strip", z.ZodTypeAny, {
|
|
1538
|
+
description?: string | {
|
|
1539
|
+
path: string;
|
|
1540
|
+
} | {
|
|
1541
|
+
call: string;
|
|
1542
|
+
args: Record<string, any>;
|
|
1543
|
+
returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
|
|
1544
|
+
} | undefined;
|
|
1545
|
+
label?: string | {
|
|
1546
|
+
path: string;
|
|
1547
|
+
} | {
|
|
1548
|
+
call: string;
|
|
1549
|
+
args: Record<string, any>;
|
|
1550
|
+
returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
|
|
1551
|
+
} | undefined;
|
|
1552
|
+
}, {
|
|
1553
|
+
description?: string | {
|
|
1554
|
+
path: string;
|
|
1555
|
+
} | {
|
|
1556
|
+
call: string;
|
|
1557
|
+
args: Record<string, any>;
|
|
1558
|
+
returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
|
|
1559
|
+
} | undefined;
|
|
1560
|
+
label?: string | {
|
|
1561
|
+
path: string;
|
|
1562
|
+
} | {
|
|
1563
|
+
call: string;
|
|
1564
|
+
args: Record<string, any>;
|
|
1565
|
+
returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
|
|
1566
|
+
} | undefined;
|
|
1567
|
+
}>>;
|
|
1568
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
1569
|
+
}, "strict", z.ZodTypeAny, {
|
|
1570
|
+
children: {
|
|
1571
|
+
componentId: string;
|
|
1572
|
+
path: string;
|
|
1573
|
+
} | string[];
|
|
1574
|
+
color?: "default" | "gray" | "red" | "orange" | "yellow" | "green" | "cyan" | "blue" | "purple" | "magenta" | undefined;
|
|
1575
|
+
accessibility?: {
|
|
1576
|
+
description?: string | {
|
|
1577
|
+
path: string;
|
|
1578
|
+
} | {
|
|
1579
|
+
call: string;
|
|
1580
|
+
args: Record<string, any>;
|
|
1581
|
+
returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
|
|
1582
|
+
} | undefined;
|
|
1583
|
+
label?: string | {
|
|
1584
|
+
path: string;
|
|
1585
|
+
} | {
|
|
1586
|
+
call: string;
|
|
1587
|
+
args: Record<string, any>;
|
|
1588
|
+
returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
|
|
1589
|
+
} | undefined;
|
|
1590
|
+
} | undefined;
|
|
1591
|
+
weight?: number | undefined;
|
|
1592
|
+
icon?: {
|
|
1593
|
+
kind: "emoji";
|
|
1594
|
+
emoji: string;
|
|
1595
|
+
} | {
|
|
1596
|
+
src: string;
|
|
1597
|
+
kind: "image";
|
|
1598
|
+
alt?: string | undefined;
|
|
1599
|
+
} | undefined;
|
|
1600
|
+
variant?: "filled" | "outlined" | undefined;
|
|
1601
|
+
}, {
|
|
1602
|
+
children: {
|
|
1603
|
+
componentId: string;
|
|
1604
|
+
path: string;
|
|
1605
|
+
} | string[];
|
|
1606
|
+
color?: "default" | "gray" | "red" | "orange" | "yellow" | "green" | "cyan" | "blue" | "purple" | "magenta" | undefined;
|
|
1607
|
+
accessibility?: {
|
|
1608
|
+
description?: string | {
|
|
1609
|
+
path: string;
|
|
1610
|
+
} | {
|
|
1611
|
+
call: string;
|
|
1612
|
+
args: Record<string, any>;
|
|
1613
|
+
returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
|
|
1614
|
+
} | undefined;
|
|
1615
|
+
label?: string | {
|
|
1616
|
+
path: string;
|
|
1617
|
+
} | {
|
|
1618
|
+
call: string;
|
|
1619
|
+
args: Record<string, any>;
|
|
1620
|
+
returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
|
|
1621
|
+
} | undefined;
|
|
1622
|
+
} | undefined;
|
|
1623
|
+
weight?: number | undefined;
|
|
1624
|
+
icon?: {
|
|
1625
|
+
kind: "emoji";
|
|
1626
|
+
emoji: string;
|
|
1627
|
+
} | {
|
|
1628
|
+
src: string;
|
|
1629
|
+
kind: "image";
|
|
1630
|
+
alt?: string | undefined;
|
|
1631
|
+
} | undefined;
|
|
1632
|
+
variant?: "filled" | "outlined" | undefined;
|
|
1633
|
+
}>;
|
|
1634
|
+
};
|
|
1457
1635
|
/** Horizontal rule / section separator. Has no configurable properties. */
|
|
1458
1636
|
declare const DividerApi: {
|
|
1459
1637
|
name: string;
|
|
@@ -1814,9 +1992,9 @@ declare const BookmarkApi: {
|
|
|
1814
1992
|
} | undefined;
|
|
1815
1993
|
} | undefined;
|
|
1816
1994
|
weight?: number | undefined;
|
|
1995
|
+
image?: string | undefined;
|
|
1817
1996
|
title?: string | undefined;
|
|
1818
1997
|
description?: string | undefined;
|
|
1819
|
-
image?: string | undefined;
|
|
1820
1998
|
}, {
|
|
1821
1999
|
url: string;
|
|
1822
2000
|
accessibility?: {
|
|
@@ -1836,9 +2014,9 @@ declare const BookmarkApi: {
|
|
|
1836
2014
|
} | undefined;
|
|
1837
2015
|
} | undefined;
|
|
1838
2016
|
weight?: number | undefined;
|
|
2017
|
+
image?: string | undefined;
|
|
1839
2018
|
title?: string | undefined;
|
|
1840
2019
|
description?: string | undefined;
|
|
1841
|
-
image?: string | undefined;
|
|
1842
2020
|
}>;
|
|
1843
2021
|
};
|
|
1844
2022
|
/** Downloadable file attachment widget. */
|
|
@@ -3641,4 +3819,4 @@ declare const normalizeLanguage: (language: string) => Language;
|
|
|
3641
3819
|
/** The authored glyph artwork for every {@link GlyphLanguage}. */
|
|
3642
3820
|
declare const languageIcons: Record<GlyphLanguage, LanguageIcon>;
|
|
3643
3821
|
//#endregion
|
|
3644
|
-
export { type AssembledCatalog, AudioApi, BLOCK_CATALOG_ID, BlockImageApi, BlockQuoteApi, BookmarkApi, CalloutApi, type CatalogEnvelope, CodeBlockApi, ColumnApi, ColumnListApi, ContentTabApi, ContentTabsApi, DividerApi, FileApi, type GlyphLanguage, HeadingApi, IconApi, KatexApi, LANGUAGES, type Language, type LanguageIcon, LinkTextApi, ListApi, ListItemApi, MermaidApi, ParagraphApi, RichTextApi, RowApi, type SvgNode, TableApi, TableCellApi, TableRowApi, ToggleApi, UnsupportedApi, VideoApi, assembleCatalog, blockCatalogJson, languageIcons, normalizeLanguage };
|
|
3822
|
+
export { type AssembledCatalog, AudioApi, BLOCK_CATALOG_ID, BlockImageApi, BlockQuoteApi, BookmarkApi, CalloutApi, type CatalogEnvelope, CodeBlockApi, ColumnApi, ColumnListApi, ContentTabApi, ContentTabsApi, DividerApi, FileApi, type GlyphLanguage, HeadingApi, 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 };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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
|
-
|
|
5
4
|
//#region src/a2ui/v0_9/block-catalog.d.ts
|
|
6
5
|
declare const RichTextApi: {
|
|
7
6
|
name: string;
|
|
@@ -1454,6 +1453,185 @@ declare const CalloutApi: {
|
|
|
1454
1453
|
weight?: number | undefined;
|
|
1455
1454
|
}>;
|
|
1456
1455
|
};
|
|
1456
|
+
/**
|
|
1457
|
+
* Notion-style callout: an icon (emoji or image) plus a colored, filled or
|
|
1458
|
+
* outlined block. Unlike {@link CalloutApi}, it carries no severity/flavor
|
|
1459
|
+
* text — the color and icon alone convey meaning.
|
|
1460
|
+
*/
|
|
1461
|
+
declare const NotionCalloutApi: {
|
|
1462
|
+
name: string;
|
|
1463
|
+
schema: z.ZodObject<{
|
|
1464
|
+
icon: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
1465
|
+
kind: z.ZodLiteral<"emoji">;
|
|
1466
|
+
emoji: z.ZodString;
|
|
1467
|
+
}, "strict", z.ZodTypeAny, {
|
|
1468
|
+
kind: "emoji";
|
|
1469
|
+
emoji: string;
|
|
1470
|
+
}, {
|
|
1471
|
+
kind: "emoji";
|
|
1472
|
+
emoji: string;
|
|
1473
|
+
}>, z.ZodObject<{
|
|
1474
|
+
kind: z.ZodLiteral<"image">;
|
|
1475
|
+
src: z.ZodString;
|
|
1476
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
1477
|
+
}, "strict", z.ZodTypeAny, {
|
|
1478
|
+
src: string;
|
|
1479
|
+
kind: "image";
|
|
1480
|
+
alt?: string | undefined;
|
|
1481
|
+
}, {
|
|
1482
|
+
src: string;
|
|
1483
|
+
kind: "image";
|
|
1484
|
+
alt?: string | undefined;
|
|
1485
|
+
}>]>>;
|
|
1486
|
+
color: z.ZodOptional<z.ZodEnum<["default", "gray", "red", "orange", "yellow", "green", "cyan", "blue", "purple", "magenta"]>>;
|
|
1487
|
+
variant: z.ZodOptional<z.ZodEnum<["filled", "outlined"]>>;
|
|
1488
|
+
children: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
1489
|
+
componentId: z.ZodString;
|
|
1490
|
+
path: z.ZodString;
|
|
1491
|
+
}, "strip", z.ZodTypeAny, {
|
|
1492
|
+
componentId: string;
|
|
1493
|
+
path: string;
|
|
1494
|
+
}, {
|
|
1495
|
+
componentId: string;
|
|
1496
|
+
path: string;
|
|
1497
|
+
}>]>;
|
|
1498
|
+
accessibility: z.ZodOptional<z.ZodObject<{
|
|
1499
|
+
label: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1500
|
+
path: z.ZodString;
|
|
1501
|
+
}, "strip", z.ZodTypeAny, {
|
|
1502
|
+
path: string;
|
|
1503
|
+
}, {
|
|
1504
|
+
path: string;
|
|
1505
|
+
}>, z.ZodObject<{
|
|
1506
|
+
call: z.ZodString;
|
|
1507
|
+
args: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
1508
|
+
returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
|
|
1509
|
+
}, "strip", z.ZodTypeAny, {
|
|
1510
|
+
call: string;
|
|
1511
|
+
args: Record<string, any>;
|
|
1512
|
+
returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
|
|
1513
|
+
}, {
|
|
1514
|
+
call: string;
|
|
1515
|
+
args: Record<string, any>;
|
|
1516
|
+
returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
|
|
1517
|
+
}>]>>;
|
|
1518
|
+
description: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1519
|
+
path: z.ZodString;
|
|
1520
|
+
}, "strip", z.ZodTypeAny, {
|
|
1521
|
+
path: string;
|
|
1522
|
+
}, {
|
|
1523
|
+
path: string;
|
|
1524
|
+
}>, z.ZodObject<{
|
|
1525
|
+
call: z.ZodString;
|
|
1526
|
+
args: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
1527
|
+
returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
|
|
1528
|
+
}, "strip", z.ZodTypeAny, {
|
|
1529
|
+
call: string;
|
|
1530
|
+
args: Record<string, any>;
|
|
1531
|
+
returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
|
|
1532
|
+
}, {
|
|
1533
|
+
call: string;
|
|
1534
|
+
args: Record<string, any>;
|
|
1535
|
+
returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
|
|
1536
|
+
}>]>>;
|
|
1537
|
+
}, "strip", z.ZodTypeAny, {
|
|
1538
|
+
description?: string | {
|
|
1539
|
+
path: string;
|
|
1540
|
+
} | {
|
|
1541
|
+
call: string;
|
|
1542
|
+
args: Record<string, any>;
|
|
1543
|
+
returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
|
|
1544
|
+
} | undefined;
|
|
1545
|
+
label?: string | {
|
|
1546
|
+
path: string;
|
|
1547
|
+
} | {
|
|
1548
|
+
call: string;
|
|
1549
|
+
args: Record<string, any>;
|
|
1550
|
+
returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
|
|
1551
|
+
} | undefined;
|
|
1552
|
+
}, {
|
|
1553
|
+
description?: string | {
|
|
1554
|
+
path: string;
|
|
1555
|
+
} | {
|
|
1556
|
+
call: string;
|
|
1557
|
+
args: Record<string, any>;
|
|
1558
|
+
returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
|
|
1559
|
+
} | undefined;
|
|
1560
|
+
label?: string | {
|
|
1561
|
+
path: string;
|
|
1562
|
+
} | {
|
|
1563
|
+
call: string;
|
|
1564
|
+
args: Record<string, any>;
|
|
1565
|
+
returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
|
|
1566
|
+
} | undefined;
|
|
1567
|
+
}>>;
|
|
1568
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
1569
|
+
}, "strict", z.ZodTypeAny, {
|
|
1570
|
+
children: {
|
|
1571
|
+
componentId: string;
|
|
1572
|
+
path: string;
|
|
1573
|
+
} | string[];
|
|
1574
|
+
color?: "default" | "gray" | "red" | "orange" | "yellow" | "green" | "cyan" | "blue" | "purple" | "magenta" | undefined;
|
|
1575
|
+
accessibility?: {
|
|
1576
|
+
description?: string | {
|
|
1577
|
+
path: string;
|
|
1578
|
+
} | {
|
|
1579
|
+
call: string;
|
|
1580
|
+
args: Record<string, any>;
|
|
1581
|
+
returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
|
|
1582
|
+
} | undefined;
|
|
1583
|
+
label?: string | {
|
|
1584
|
+
path: string;
|
|
1585
|
+
} | {
|
|
1586
|
+
call: string;
|
|
1587
|
+
args: Record<string, any>;
|
|
1588
|
+
returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
|
|
1589
|
+
} | undefined;
|
|
1590
|
+
} | undefined;
|
|
1591
|
+
weight?: number | undefined;
|
|
1592
|
+
icon?: {
|
|
1593
|
+
kind: "emoji";
|
|
1594
|
+
emoji: string;
|
|
1595
|
+
} | {
|
|
1596
|
+
src: string;
|
|
1597
|
+
kind: "image";
|
|
1598
|
+
alt?: string | undefined;
|
|
1599
|
+
} | undefined;
|
|
1600
|
+
variant?: "filled" | "outlined" | undefined;
|
|
1601
|
+
}, {
|
|
1602
|
+
children: {
|
|
1603
|
+
componentId: string;
|
|
1604
|
+
path: string;
|
|
1605
|
+
} | string[];
|
|
1606
|
+
color?: "default" | "gray" | "red" | "orange" | "yellow" | "green" | "cyan" | "blue" | "purple" | "magenta" | undefined;
|
|
1607
|
+
accessibility?: {
|
|
1608
|
+
description?: string | {
|
|
1609
|
+
path: string;
|
|
1610
|
+
} | {
|
|
1611
|
+
call: string;
|
|
1612
|
+
args: Record<string, any>;
|
|
1613
|
+
returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
|
|
1614
|
+
} | undefined;
|
|
1615
|
+
label?: string | {
|
|
1616
|
+
path: string;
|
|
1617
|
+
} | {
|
|
1618
|
+
call: string;
|
|
1619
|
+
args: Record<string, any>;
|
|
1620
|
+
returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
|
|
1621
|
+
} | undefined;
|
|
1622
|
+
} | undefined;
|
|
1623
|
+
weight?: number | undefined;
|
|
1624
|
+
icon?: {
|
|
1625
|
+
kind: "emoji";
|
|
1626
|
+
emoji: string;
|
|
1627
|
+
} | {
|
|
1628
|
+
src: string;
|
|
1629
|
+
kind: "image";
|
|
1630
|
+
alt?: string | undefined;
|
|
1631
|
+
} | undefined;
|
|
1632
|
+
variant?: "filled" | "outlined" | undefined;
|
|
1633
|
+
}>;
|
|
1634
|
+
};
|
|
1457
1635
|
/** Horizontal rule / section separator. Has no configurable properties. */
|
|
1458
1636
|
declare const DividerApi: {
|
|
1459
1637
|
name: string;
|
|
@@ -1814,9 +1992,9 @@ declare const BookmarkApi: {
|
|
|
1814
1992
|
} | undefined;
|
|
1815
1993
|
} | undefined;
|
|
1816
1994
|
weight?: number | undefined;
|
|
1995
|
+
image?: string | undefined;
|
|
1817
1996
|
title?: string | undefined;
|
|
1818
1997
|
description?: string | undefined;
|
|
1819
|
-
image?: string | undefined;
|
|
1820
1998
|
}, {
|
|
1821
1999
|
url: string;
|
|
1822
2000
|
accessibility?: {
|
|
@@ -1836,9 +2014,9 @@ declare const BookmarkApi: {
|
|
|
1836
2014
|
} | undefined;
|
|
1837
2015
|
} | undefined;
|
|
1838
2016
|
weight?: number | undefined;
|
|
2017
|
+
image?: string | undefined;
|
|
1839
2018
|
title?: string | undefined;
|
|
1840
2019
|
description?: string | undefined;
|
|
1841
|
-
image?: string | undefined;
|
|
1842
2020
|
}>;
|
|
1843
2021
|
};
|
|
1844
2022
|
/** Downloadable file attachment widget. */
|
|
@@ -3641,4 +3819,4 @@ declare const normalizeLanguage: (language: string) => Language;
|
|
|
3641
3819
|
/** The authored glyph artwork for every {@link GlyphLanguage}. */
|
|
3642
3820
|
declare const languageIcons: Record<GlyphLanguage, LanguageIcon>;
|
|
3643
3821
|
//#endregion
|
|
3644
|
-
export { type AssembledCatalog, AudioApi, BLOCK_CATALOG_ID, BlockImageApi, BlockQuoteApi, BookmarkApi, CalloutApi, type CatalogEnvelope, CodeBlockApi, ColumnApi, ColumnListApi, ContentTabApi, ContentTabsApi, DividerApi, FileApi, type GlyphLanguage, HeadingApi, IconApi, KatexApi, LANGUAGES, type Language, type LanguageIcon, LinkTextApi, ListApi, ListItemApi, MermaidApi, ParagraphApi, RichTextApi, RowApi, type SvgNode, TableApi, TableCellApi, TableRowApi, ToggleApi, UnsupportedApi, VideoApi, assembleCatalog, blockCatalogJson, languageIcons, normalizeLanguage };
|
|
3822
|
+
export { type AssembledCatalog, AudioApi, BLOCK_CATALOG_ID, BlockImageApi, BlockQuoteApi, BookmarkApi, CalloutApi, type CatalogEnvelope, CodeBlockApi, ColumnApi, ColumnListApi, ContentTabApi, ContentTabsApi, DividerApi, FileApi, type GlyphLanguage, HeadingApi, 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 };
|
package/dist/index.mjs
CHANGED
|
@@ -145,6 +145,39 @@ const CalloutApi = {
|
|
|
145
145
|
children: childrenSchema.describe("Ordered list of child component IDs that make up the callout body.")
|
|
146
146
|
}).strict()
|
|
147
147
|
};
|
|
148
|
+
/**
|
|
149
|
+
* Notion-style callout: an icon (emoji or image) plus a colored, filled or
|
|
150
|
+
* outlined block. Unlike {@link CalloutApi}, it carries no severity/flavor
|
|
151
|
+
* text — the color and icon alone convey meaning.
|
|
152
|
+
*/
|
|
153
|
+
const NotionCalloutApi = {
|
|
154
|
+
name: "NotionCallout",
|
|
155
|
+
schema: z.object({
|
|
156
|
+
...CommonProps,
|
|
157
|
+
icon: z.discriminatedUnion("kind", [z.object({
|
|
158
|
+
kind: z.literal("emoji"),
|
|
159
|
+
emoji: z.string().describe("A single emoji character.")
|
|
160
|
+
}).strict(), z.object({
|
|
161
|
+
kind: z.literal("image"),
|
|
162
|
+
src: z.string().describe("The source URL of the icon image."),
|
|
163
|
+
alt: z.string().describe("Accessible alt text for the icon.").optional()
|
|
164
|
+
}).strict()]).describe("Icon shown before the content: an emoji or an image.").optional(),
|
|
165
|
+
color: z.enum([
|
|
166
|
+
"default",
|
|
167
|
+
"gray",
|
|
168
|
+
"red",
|
|
169
|
+
"orange",
|
|
170
|
+
"yellow",
|
|
171
|
+
"green",
|
|
172
|
+
"cyan",
|
|
173
|
+
"blue",
|
|
174
|
+
"purple",
|
|
175
|
+
"magenta"
|
|
176
|
+
]).describe("Accent hue for the callout.").optional(),
|
|
177
|
+
variant: z.enum(["filled", "outlined"]).describe("Tinted background ('filled') or transparent with a colored border ('outlined').").optional(),
|
|
178
|
+
children: childrenSchema.describe("Ordered list of child component IDs that make up the callout body.")
|
|
179
|
+
}).strict()
|
|
180
|
+
};
|
|
148
181
|
/** Horizontal rule / section separator. Has no configurable properties. */
|
|
149
182
|
const DividerApi = {
|
|
150
183
|
name: "Divider",
|
|
@@ -536,7 +569,7 @@ function collapseCommonRefs(node) {
|
|
|
536
569
|
for (const [k, v] of Object.entries(obj)) out[k] = collapseCommonRefs(v);
|
|
537
570
|
return out;
|
|
538
571
|
}
|
|
539
|
-
const FACTORED_OUT_KEYS = new Set(["accessibility", "weight"]);
|
|
572
|
+
const FACTORED_OUT_KEYS = /* @__PURE__ */ new Set(["accessibility", "weight"]);
|
|
540
573
|
function buildComponentSchema(api) {
|
|
541
574
|
const inner = zodToJsonSchema(z.object({ x: api.schema }), {
|
|
542
575
|
$refStrategy: "none",
|
|
@@ -625,6 +658,7 @@ const blockCatalogJson = assembleCatalog({
|
|
|
625
658
|
ListItemApi,
|
|
626
659
|
BlockQuoteApi,
|
|
627
660
|
CalloutApi,
|
|
661
|
+
NotionCalloutApi,
|
|
628
662
|
DividerApi,
|
|
629
663
|
ToggleApi,
|
|
630
664
|
BookmarkApi,
|
|
@@ -1232,4 +1266,4 @@ const normalizeLanguage = (language) => ALIAS_TO_LANGUAGE.get(language) ?? "file
|
|
|
1232
1266
|
/** The authored glyph artwork for every {@link GlyphLanguage}. */
|
|
1233
1267
|
const languageIcons = Object.fromEntries(LANGUAGE_REGISTRY.flatMap((e) => e.icon ? [[e.key, e.icon]] : []));
|
|
1234
1268
|
//#endregion
|
|
1235
|
-
export { AudioApi, BLOCK_CATALOG_ID, BlockImageApi, BlockQuoteApi, BookmarkApi, CalloutApi, CodeBlockApi, ColumnApi, ColumnListApi, ContentTabApi, ContentTabsApi, DividerApi, FileApi, HeadingApi, IconApi, KatexApi, LANGUAGES, LinkTextApi, ListApi, ListItemApi, MermaidApi, ParagraphApi, RichTextApi, RowApi, TableApi, TableCellApi, TableRowApi, ToggleApi, UnsupportedApi, VideoApi, assembleCatalog, blockCatalogJson, languageIcons, normalizeLanguage };
|
|
1269
|
+
export { AudioApi, BLOCK_CATALOG_ID, BlockImageApi, BlockQuoteApi, BookmarkApi, CalloutApi, CodeBlockApi, ColumnApi, ColumnListApi, ContentTabApi, ContentTabsApi, DividerApi, FileApi, HeadingApi, IconApi, KatexApi, LANGUAGES, LinkTextApi, ListApi, ListItemApi, MermaidApi, NotionCalloutApi, ParagraphApi, RichTextApi, RowApi, TableApi, TableCellApi, TableRowApi, ToggleApi, UnsupportedApi, VideoApi, assembleCatalog, blockCatalogJson, languageIcons, normalizeLanguage };
|
package/dist/tokens.css
CHANGED
|
@@ -41,9 +41,14 @@
|
|
|
41
41
|
--elmethis-primitive-color-gold-700: #a68c70;
|
|
42
42
|
--elmethis-primitive-color-gold-800: #8e7356;
|
|
43
43
|
--elmethis-primitive-color-gold-900: #6e583f;
|
|
44
|
+
--elmethis-primitive-font-family-sans:
|
|
45
|
+
"DM Sans", "Zen Kaku Gothic New", -apple-system, BlinkMacSystemFont,
|
|
46
|
+
"Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
|
|
44
47
|
--elmethis-primitive-font-family-monospace:
|
|
45
|
-
"DM Mono", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono",
|
|
46
|
-
|
|
48
|
+
"DM Mono", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono",
|
|
49
|
+
"Zen Kaku Gothic New", monospace;
|
|
50
|
+
--elmethis-stack-gap: 2rem;
|
|
51
|
+
--elmethis-font-family-sans: var(--elmethis-primitive-font-family-sans);
|
|
47
52
|
--elmethis-font-family-monospace: var(
|
|
48
53
|
--elmethis-primitive-font-family-monospace
|
|
49
54
|
);
|
|
@@ -154,4 +159,5 @@
|
|
|
154
159
|
var(--elmethis-primitive-color-magenta-900)
|
|
155
160
|
);
|
|
156
161
|
color-scheme: light dark;
|
|
162
|
+
font-family: var(--elmethis-font-family-sans);
|
|
157
163
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elmethis/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Ikuma Yamashita",
|
|
6
6
|
"url": "https://www.ikuma.cloud/"
|
|
@@ -45,21 +45,21 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@a2ui/web_core": "^0.10.0",
|
|
47
47
|
"@eslint/js": "latest",
|
|
48
|
-
"@types/node": "
|
|
49
|
-
"@vanilla-extract/css": "^1.
|
|
48
|
+
"@types/node": "26.1.0",
|
|
49
|
+
"@vanilla-extract/css": "^1.21.1",
|
|
50
50
|
"@vanilla-extract/esbuild-plugin": "^2.3.22",
|
|
51
|
-
"@vitest/coverage-v8": "^4.1.
|
|
51
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
52
52
|
"ajv": "^8.17.1",
|
|
53
53
|
"ajv-formats": "^3.0.1",
|
|
54
54
|
"concurrently": "^10.0.3",
|
|
55
55
|
"esbuild": "^0.28.1",
|
|
56
|
-
"eslint": "^10.
|
|
57
|
-
"globals": "^17.
|
|
58
|
-
"prettier": "3.
|
|
59
|
-
"tsdown": "^0.22.
|
|
60
|
-
"tsx": "^4.
|
|
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",
|
|
61
61
|
"typescript": "5.9.3",
|
|
62
|
-
"typescript-eslint": "^8.
|
|
62
|
+
"typescript-eslint": "^8.63.0",
|
|
63
63
|
"vitest": "^4.1.8",
|
|
64
64
|
"zod": "^3"
|
|
65
65
|
},
|