@avocadostudio-ai/shared 0.2.0 → 0.2.1
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/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export type { FieldDiffKind, FieldDiff, BlockDiffStatus, BlockDiff, PageDiffStat
|
|
|
4
4
|
export { isImagePath, toAltPath, setPropAtPath } from "./editable-path.ts";
|
|
5
5
|
export { parseInline, parseRichText, parseRichTextBlocks, normalizeRichTextBody, resolveRichTextHeadingLevel, clampMarkdownHeadings, unescapeMarkdownText, isRichTextDoc, fromMarkdown, toMarkdown, mergeRichTextDoc, NODE, MARK, type InlineToken, type RichTextBlock, type RichTextList, type RichTextListItem, type RichTextDoc, type RichTextNode, type RichTextMark } from "@avocadostudio-ai/richtext";
|
|
6
6
|
export { blockDefinitionSchema, blockManifestSchema, buildBlockManifest, jsonSchemaLikeSchema, validateByJsonSchemaLike, findManifestSchemaIssue, type ManifestSchemaIssue, validateManifestDefaultProps, deriveFieldMetaFromSchema, resolveManifestFieldMeta, isProseMirrorDocSchema, type BlockDefinition, type BlockManifest } from "./block-manifest.ts";
|
|
7
|
+
export { z } from "zod";
|
|
7
8
|
export { type FieldKind, type ImageSpec, type FieldMeta, type ListFieldMeta, type BlockMeta, type BlockType, type BlockInstance, type BlockRegistration, IMAGE_PLACEHOLDER, isImagePlaceholder, registerBlock, getBlockMeta, getAllBlockMeta, getImageFields, getListImageFields, isFieldInlineEditable, getImageSpec, isChrome, getChromeTypes, blockSchemas, allowedBlockTypes, declareBlockCatalogue, getBlockCatalogue, isInBlockCatalogue, catalogueBlockTypes, undeclaredBlockTypes, getPropDisplayName, defaultListItemForBlock, blockInstanceSchema, blockInstanceSchemaLenient, validateBlockProps, getBlockJsonSchema, } from "./blocks/_registry.ts";
|
|
8
9
|
export { defaultPropsForType, declaredDefaultPropsForType, resolveHeadingTag, resolveItemHeadingTag, DEFAULT_HEADING_LEVELS, } from "./blocks/index.ts";
|
|
9
10
|
export { blockTypeToCamel, camelToBlockType, blockTypeToLower, lowerToBlockType, } from "./block-names.ts";
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,24 @@ export { isImagePath, toAltPath, setPropAtPath } from "./editable-path.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export { parseInline, parseRichText, parseRichTextBlocks, normalizeRichTextBody, resolveRichTextHeadingLevel, clampMarkdownHeadings, unescapeMarkdownText, isRichTextDoc, fromMarkdown, toMarkdown, mergeRichTextDoc, NODE, MARK } from "@avocadostudio-ai/richtext";
|
|
13
13
|
export { blockDefinitionSchema, blockManifestSchema, buildBlockManifest, jsonSchemaLikeSchema, validateByJsonSchemaLike, findManifestSchemaIssue, validateManifestDefaultProps, deriveFieldMetaFromSchema, resolveManifestFieldMeta, isProseMirrorDocSchema } from "./block-manifest.js";
|
|
14
|
+
/*
|
|
15
|
+
* The exact `zod` instance every schema in this package was built with.
|
|
16
|
+
*
|
|
17
|
+
* `registerBlock` takes a `z.ZodObject`, and a Zod object is only assignable to
|
|
18
|
+
* one produced by the *same* copy of the library. An integrator's own `import
|
|
19
|
+
* { z } from "zod"` resolves to whatever their tree hoisted, which on any site
|
|
20
|
+
* that also uses Sanity is zod 3.x — and the failure is a wall of structural
|
|
21
|
+
* type errors naming methods nobody has heard of:
|
|
22
|
+
*
|
|
23
|
+
* Type 'ZodObject<…, "passthrough", …>' is missing the following properties
|
|
24
|
+
* from type 'ZodObject<any, $strip>': loose, safeExtend, exactPartial, def,
|
|
25
|
+
* and 21 more
|
|
26
|
+
*
|
|
27
|
+
* Nothing in that message says "you have two copies of zod". Re-exporting ours
|
|
28
|
+
* means `import { z } from "@avocadostudio-ai/shared"` cannot pick the wrong
|
|
29
|
+
* one, and the adopter needs no direct zod dependency at all.
|
|
30
|
+
*/
|
|
31
|
+
export { z } from "zod";
|
|
14
32
|
export {
|
|
15
33
|
// Constants & helpers
|
|
16
34
|
IMAGE_PLACEHOLDER, isImagePlaceholder,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avocadostudio-ai/shared",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"zod": "^4.3.6",
|
|
22
|
-
"@avocadostudio-ai/richtext": "0.2.
|
|
22
|
+
"@avocadostudio-ai/richtext": "0.2.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"tsx": "^4.21.0",
|