@notionhq/custom-blocks 0.1.13 → 0.1.15
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/protocol/messages/init.js +1 -1
- package/dist/protocol/pages/page.d.ts +0 -15
- package/dist/protocol/pages/page.d.ts.map +1 -1
- package/dist/protocol/pages/page.js +1 -15
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/vite-plugin/index.d.ts +4 -0
- package/vite-plugin/index.js +6 -3
|
@@ -36,7 +36,7 @@ export const initMessageSchema = v.variant("status", [
|
|
|
36
36
|
initializationId: v.string(),
|
|
37
37
|
status: v.literal("success"),
|
|
38
38
|
theme: notionThemeSchema,
|
|
39
|
-
// TODO(custom-blocks): Make this required when
|
|
39
|
+
// TODO(custom-blocks): Make this required when bumping bridge protocol version 4.
|
|
40
40
|
contrastMode: v.optional(notionContrastModeSchema, DEFAULT_CONTRAST_MODE),
|
|
41
41
|
blockId: notionBlockIdSchema,
|
|
42
42
|
parent: notionParentSchema,
|
|
@@ -34,21 +34,6 @@ export declare const customBlockPageSchema: v.ObjectSchema<{
|
|
|
34
34
|
}, undefined>], undefined>;
|
|
35
35
|
}, undefined>;
|
|
36
36
|
export type CustomBlockPage = v.InferOutput<typeof customBlockPageSchema>;
|
|
37
|
-
/**
|
|
38
|
-
* Parent reference accepted by `pages.create` / `pages.update` inputs.
|
|
39
|
-
*
|
|
40
|
-
* Mirrors the parent shape Notion's public `POST /v1/pages` API accepts: `page_id` for a
|
|
41
|
-
* page-parented child, `data_source_id` for a database row. `data_source_id` is the internal
|
|
42
|
-
* collection ID.
|
|
43
|
-
*/
|
|
44
|
-
export declare const notionPageParentInputSchema: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
45
|
-
readonly type: v.LiteralSchema<"page_id", undefined>;
|
|
46
|
-
readonly page_id: v.CustomSchema<import("./page.js").NotionPageId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
47
|
-
}, undefined>, v.ObjectSchema<{
|
|
48
|
-
readonly type: v.LiteralSchema<"data_source_id", undefined>;
|
|
49
|
-
readonly data_source_id: v.CustomSchema<import("../ids.js").NotionDataSourceId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
50
|
-
}, undefined>], undefined>;
|
|
51
|
-
export type NotionPageParentInput = v.InferOutput<typeof notionPageParentInputSchema>;
|
|
52
37
|
export declare const notionEmojiIconSchema: v.ObjectSchema<{
|
|
53
38
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
54
39
|
readonly emoji: v.StringSchema<undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/protocol/src/pages/page.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C;;GAEG;AACH,eAAO,MAAM,qBAAqB;;IAEjC;;;;OAIG;;;;;;;;;;;;;;;;;aAEF,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/protocol/src/pages/page.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C;;GAEG;AACH,eAAO,MAAM,qBAAqB;;IAEjC;;;;OAIG;;;;;;;;;;;;;;;;;aAEF,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE,eAAO,MAAM,qBAAqB;;;aAGhC,CAAA;AACF,eAAO,MAAM,2BAA2B;;;;;;;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3B,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,gBAAgB,CAAC,CAAA"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* shape the host delivers for messages like `createPageResult`.
|
|
6
6
|
*/
|
|
7
7
|
import * as v from "valibot";
|
|
8
|
-
import {
|
|
8
|
+
import { notionPageIdSchema } from "../ids.js";
|
|
9
9
|
import { notionParentSchema } from "../parent.js";
|
|
10
10
|
/**
|
|
11
11
|
* The custom block's nearest enclosing page ancestor, carried in `init.page` and `pageChanged`.
|
|
@@ -19,20 +19,6 @@ export const customBlockPageSchema = v.object({
|
|
|
19
19
|
*/
|
|
20
20
|
parent: notionParentSchema,
|
|
21
21
|
});
|
|
22
|
-
/**
|
|
23
|
-
* Parent reference accepted by `pages.create` / `pages.update` inputs.
|
|
24
|
-
*
|
|
25
|
-
* Mirrors the parent shape Notion's public `POST /v1/pages` API accepts: `page_id` for a
|
|
26
|
-
* page-parented child, `data_source_id` for a database row. `data_source_id` is the internal
|
|
27
|
-
* collection ID.
|
|
28
|
-
*/
|
|
29
|
-
export const notionPageParentInputSchema = v.variant("type", [
|
|
30
|
-
v.object({ type: v.literal("page_id"), page_id: notionPageIdSchema }),
|
|
31
|
-
v.object({
|
|
32
|
-
type: v.literal("data_source_id"),
|
|
33
|
-
data_source_id: notionDataSourceIdSchema,
|
|
34
|
-
}),
|
|
35
|
-
]);
|
|
36
22
|
export const notionEmojiIconSchema = v.object({
|
|
37
23
|
type: v.literal("emoji"),
|
|
38
24
|
emoji: v.string(),
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/vite-plugin/index.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ export type NotionCustomBlockPlugin = {
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Vite plugin for Notion custom blocks.
|
|
7
|
+
*
|
|
6
8
|
* @deprecated This compatibility stub does nothing. Remove it from Vite config when possible.
|
|
9
|
+
*
|
|
10
|
+
* TODO(custom-blocks): Remove this when bumping bridge SDK version to 0.2.0.
|
|
7
11
|
*/
|
|
8
12
|
export function notionCustomBlock(): NotionCustomBlockPlugin
|
package/vite-plugin/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
// Compatibility export for existing blocks.
|
|
2
|
-
// TODO(custom-blocks): Remove the Vite server entirely when bumping bridge protocol version.
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Vite plugin for Notion custom blocks.
|
|
3
|
+
*
|
|
4
|
+
* @deprecated This is just a compatibility stub to ensure existing block code can continue to work
|
|
5
|
+
* with the new SDK.
|
|
6
|
+
*
|
|
7
|
+
* TODO(custom-blocks): Remove this when bumping bridge SDK version to 0.2.0.
|
|
5
8
|
*/
|
|
6
9
|
export function notionCustomBlock() {
|
|
7
10
|
return { name: "custom-blocks:legacy-vite-plugin" }
|