@atcute/leaflet 1.0.11 → 1.0.13
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/README.md +2 -10
- package/dist/lexicons/index.d.ts +6 -0
- package/dist/lexicons/index.d.ts.map +1 -1
- package/dist/lexicons/index.js +6 -0
- package/dist/lexicons/index.js.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/blockquote.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/blockquote.js.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/bskyPost.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/bskyPost.js.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/button.d.ts +14 -0
- package/dist/lexicons/types/pub/leaflet/blocks/button.d.ts.map +1 -0
- package/dist/lexicons/types/pub/leaflet/blocks/button.js +8 -0
- package/dist/lexicons/types/pub/leaflet/blocks/button.js.map +1 -0
- package/dist/lexicons/types/pub/leaflet/blocks/code.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/header.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/header.js.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/horizontalRule.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/iframe.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/image.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/image.js.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/math.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/page.d.ts +13 -0
- package/dist/lexicons/types/pub/leaflet/blocks/page.d.ts.map +1 -0
- package/dist/lexicons/types/pub/leaflet/blocks/page.js +7 -0
- package/dist/lexicons/types/pub/leaflet/blocks/page.js.map +1 -0
- package/dist/lexicons/types/pub/leaflet/blocks/poll.d.ts +14 -0
- package/dist/lexicons/types/pub/leaflet/blocks/poll.d.ts.map +1 -0
- package/dist/lexicons/types/pub/leaflet/blocks/poll.js +10 -0
- package/dist/lexicons/types/pub/leaflet/blocks/poll.js.map +1 -0
- package/dist/lexicons/types/pub/leaflet/blocks/text.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/text.js.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/unorderedList.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/unorderedList.js.map +1 -1
- package/dist/lexicons/types/pub/leaflet/blocks/website.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/comment.d.ts +1 -0
- package/dist/lexicons/types/pub/leaflet/comment.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/comment.js +1 -0
- package/dist/lexicons/types/pub/leaflet/comment.js.map +1 -1
- package/dist/lexicons/types/pub/leaflet/document.d.ts +5 -2
- package/dist/lexicons/types/pub/leaflet/document.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/document.js +8 -2
- package/dist/lexicons/types/pub/leaflet/document.js.map +1 -1
- package/dist/lexicons/types/pub/leaflet/graph/subscription.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/pages/canvas.d.ts +86 -0
- package/dist/lexicons/types/pub/leaflet/pages/canvas.d.ts.map +1 -0
- package/dist/lexicons/types/pub/leaflet/pages/canvas.js +76 -0
- package/dist/lexicons/types/pub/leaflet/pages/canvas.js.map +1 -0
- package/dist/lexicons/types/pub/leaflet/pages/linearDocument.d.ts +13 -3
- package/dist/lexicons/types/pub/leaflet/pages/linearDocument.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/pages/linearDocument.js +10 -1
- package/dist/lexicons/types/pub/leaflet/pages/linearDocument.js.map +1 -1
- package/dist/lexicons/types/pub/leaflet/poll/definition.d.ts +38 -0
- package/dist/lexicons/types/pub/leaflet/poll/definition.d.ts.map +1 -0
- package/dist/lexicons/types/pub/leaflet/poll/definition.js +33 -0
- package/dist/lexicons/types/pub/leaflet/poll/definition.js.map +1 -0
- package/dist/lexicons/types/pub/leaflet/poll/vote.d.ts +20 -0
- package/dist/lexicons/types/pub/leaflet/poll/vote.d.ts.map +1 -0
- package/dist/lexicons/types/pub/leaflet/poll/vote.js +13 -0
- package/dist/lexicons/types/pub/leaflet/poll/vote.js.map +1 -0
- package/dist/lexicons/types/pub/leaflet/publication.d.ts +1 -1
- package/dist/lexicons/types/pub/leaflet/publication.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/publication.js +1 -1
- package/dist/lexicons/types/pub/leaflet/publication.js.map +1 -1
- package/dist/lexicons/types/pub/leaflet/richtext/facet.d.ts +22 -2
- package/dist/lexicons/types/pub/leaflet/richtext/facet.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/richtext/facet.js +13 -1
- package/dist/lexicons/types/pub/leaflet/richtext/facet.js.map +1 -1
- package/dist/lexicons/types/pub/leaflet/theme/backgroundImage.d.ts.map +1 -1
- package/dist/lexicons/types/pub/leaflet/theme/color.d.ts.map +1 -1
- package/lib/lexicons/index.ts +6 -0
- package/lib/lexicons/types/pub/leaflet/blocks/button.ts +16 -0
- package/lib/lexicons/types/pub/leaflet/blocks/page.ts +15 -0
- package/lib/lexicons/types/pub/leaflet/blocks/poll.ts +18 -0
- package/lib/lexicons/types/pub/leaflet/comment.ts +1 -0
- package/lib/lexicons/types/pub/leaflet/document.ts +9 -2
- package/lib/lexicons/types/pub/leaflet/pages/canvas.ts +102 -0
- package/lib/lexicons/types/pub/leaflet/pages/linearDocument.ts +13 -1
- package/lib/lexicons/types/pub/leaflet/poll/definition.ts +53 -0
- package/lib/lexicons/types/pub/leaflet/poll/vote.ts +29 -0
- package/lib/lexicons/types/pub/leaflet/publication.ts +1 -1
- package/lib/lexicons/types/pub/leaflet/richtext/facet.ts +19 -1
- package/package.json +7 -8
package/lib/lexicons/index.ts
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
export * as PubLeafletBlocksBlockquote from './types/pub/leaflet/blocks/blockquote.js';
|
|
2
2
|
export * as PubLeafletBlocksBskyPost from './types/pub/leaflet/blocks/bskyPost.js';
|
|
3
|
+
export * as PubLeafletBlocksButton from './types/pub/leaflet/blocks/button.js';
|
|
3
4
|
export * as PubLeafletBlocksCode from './types/pub/leaflet/blocks/code.js';
|
|
4
5
|
export * as PubLeafletBlocksHeader from './types/pub/leaflet/blocks/header.js';
|
|
5
6
|
export * as PubLeafletBlocksHorizontalRule from './types/pub/leaflet/blocks/horizontalRule.js';
|
|
6
7
|
export * as PubLeafletBlocksIframe from './types/pub/leaflet/blocks/iframe.js';
|
|
7
8
|
export * as PubLeafletBlocksImage from './types/pub/leaflet/blocks/image.js';
|
|
8
9
|
export * as PubLeafletBlocksMath from './types/pub/leaflet/blocks/math.js';
|
|
10
|
+
export * as PubLeafletBlocksPage from './types/pub/leaflet/blocks/page.js';
|
|
11
|
+
export * as PubLeafletBlocksPoll from './types/pub/leaflet/blocks/poll.js';
|
|
9
12
|
export * as PubLeafletBlocksText from './types/pub/leaflet/blocks/text.js';
|
|
10
13
|
export * as PubLeafletBlocksUnorderedList from './types/pub/leaflet/blocks/unorderedList.js';
|
|
11
14
|
export * as PubLeafletBlocksWebsite from './types/pub/leaflet/blocks/website.js';
|
|
12
15
|
export * as PubLeafletComment from './types/pub/leaflet/comment.js';
|
|
13
16
|
export * as PubLeafletDocument from './types/pub/leaflet/document.js';
|
|
14
17
|
export * as PubLeafletGraphSubscription from './types/pub/leaflet/graph/subscription.js';
|
|
18
|
+
export * as PubLeafletPagesCanvas from './types/pub/leaflet/pages/canvas.js';
|
|
15
19
|
export * as PubLeafletPagesLinearDocument from './types/pub/leaflet/pages/linearDocument.js';
|
|
20
|
+
export * as PubLeafletPollDefinition from './types/pub/leaflet/poll/definition.js';
|
|
21
|
+
export * as PubLeafletPollVote from './types/pub/leaflet/poll/vote.js';
|
|
16
22
|
export * as PubLeafletPublication from './types/pub/leaflet/publication.js';
|
|
17
23
|
export * as PubLeafletRichtextFacet from './types/pub/leaflet/richtext/facet.js';
|
|
18
24
|
export * as PubLeafletThemeBackgroundImage from './types/pub/leaflet/theme/backgroundImage.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type {} from '@atcute/lexicons';
|
|
2
|
+
import * as v from '@atcute/lexicons/validations';
|
|
3
|
+
|
|
4
|
+
const _mainSchema = /*#__PURE__*/ v.object({
|
|
5
|
+
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.blocks.button')),
|
|
6
|
+
text: /*#__PURE__*/ v.string(),
|
|
7
|
+
url: /*#__PURE__*/ v.genericUriString(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
type main$schematype = typeof _mainSchema;
|
|
11
|
+
|
|
12
|
+
export interface mainSchema extends main$schematype {}
|
|
13
|
+
|
|
14
|
+
export const mainSchema = _mainSchema as mainSchema;
|
|
15
|
+
|
|
16
|
+
export interface Main extends v.InferInput<typeof mainSchema> {}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type {} from '@atcute/lexicons';
|
|
2
|
+
import * as v from '@atcute/lexicons/validations';
|
|
3
|
+
|
|
4
|
+
const _mainSchema = /*#__PURE__*/ v.object({
|
|
5
|
+
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.blocks.page')),
|
|
6
|
+
id: /*#__PURE__*/ v.string(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
type main$schematype = typeof _mainSchema;
|
|
10
|
+
|
|
11
|
+
export interface mainSchema extends main$schematype {}
|
|
12
|
+
|
|
13
|
+
export const mainSchema = _mainSchema as mainSchema;
|
|
14
|
+
|
|
15
|
+
export interface Main extends v.InferInput<typeof mainSchema> {}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type {} from '@atcute/lexicons';
|
|
2
|
+
import * as v from '@atcute/lexicons/validations';
|
|
3
|
+
import * as ComAtprotoRepoStrongRef from '@atcute/atproto/types/repo/strongRef';
|
|
4
|
+
|
|
5
|
+
const _mainSchema = /*#__PURE__*/ v.object({
|
|
6
|
+
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.blocks.poll')),
|
|
7
|
+
get pollRef() {
|
|
8
|
+
return ComAtprotoRepoStrongRef.mainSchema;
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
type main$schematype = typeof _mainSchema;
|
|
13
|
+
|
|
14
|
+
export interface mainSchema extends main$schematype {}
|
|
15
|
+
|
|
16
|
+
export const mainSchema = _mainSchema as mainSchema;
|
|
17
|
+
|
|
18
|
+
export interface Main extends v.InferInput<typeof mainSchema> {}
|
|
@@ -22,6 +22,7 @@ const _mainSchema = /*#__PURE__*/ v.record(
|
|
|
22
22
|
get facets() {
|
|
23
23
|
return /*#__PURE__*/ v.optional(/*#__PURE__*/ v.array(PubLeafletRichtextFacet.mainSchema));
|
|
24
24
|
},
|
|
25
|
+
onPage: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
|
|
25
26
|
plaintext: /*#__PURE__*/ v.string(),
|
|
26
27
|
get reply() {
|
|
27
28
|
return /*#__PURE__*/ v.optional(replyRefSchema);
|
|
@@ -2,7 +2,9 @@ import type {} from '@atcute/lexicons';
|
|
|
2
2
|
import * as v from '@atcute/lexicons/validations';
|
|
3
3
|
import type {} from '@atcute/lexicons/ambient';
|
|
4
4
|
import * as ComAtprotoRepoStrongRef from '@atcute/atproto/types/repo/strongRef';
|
|
5
|
+
import * as PubLeafletPagesCanvas from './pages/canvas.js';
|
|
5
6
|
import * as PubLeafletPagesLinearDocument from './pages/linearDocument.js';
|
|
7
|
+
import * as PubLeafletPublication from './publication.js';
|
|
6
8
|
|
|
7
9
|
const _mainSchema = /*#__PURE__*/ v.record(
|
|
8
10
|
/*#__PURE__*/ v.tidString(),
|
|
@@ -20,13 +22,18 @@ const _mainSchema = /*#__PURE__*/ v.record(
|
|
|
20
22
|
]),
|
|
21
23
|
),
|
|
22
24
|
get pages() {
|
|
23
|
-
return /*#__PURE__*/ v.array(
|
|
25
|
+
return /*#__PURE__*/ v.array(
|
|
26
|
+
/*#__PURE__*/ v.variant([PubLeafletPagesCanvas.mainSchema, PubLeafletPagesLinearDocument.mainSchema]),
|
|
27
|
+
);
|
|
24
28
|
},
|
|
25
29
|
get postRef() {
|
|
26
30
|
return /*#__PURE__*/ v.optional(ComAtprotoRepoStrongRef.mainSchema);
|
|
27
31
|
},
|
|
28
|
-
publication: /*#__PURE__*/ v.resourceUriString(),
|
|
32
|
+
publication: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.resourceUriString()),
|
|
29
33
|
publishedAt: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.datetimeString()),
|
|
34
|
+
get theme() {
|
|
35
|
+
return /*#__PURE__*/ v.optional(PubLeafletPublication.themeSchema);
|
|
36
|
+
},
|
|
30
37
|
/**
|
|
31
38
|
* @maxLength 1280
|
|
32
39
|
* @maxGraphemes 128
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type {} from '@atcute/lexicons';
|
|
2
|
+
import * as v from '@atcute/lexicons/validations';
|
|
3
|
+
import * as PubLeafletBlocksBlockquote from '../blocks/blockquote.js';
|
|
4
|
+
import * as PubLeafletBlocksBskyPost from '../blocks/bskyPost.js';
|
|
5
|
+
import * as PubLeafletBlocksButton from '../blocks/button.js';
|
|
6
|
+
import * as PubLeafletBlocksCode from '../blocks/code.js';
|
|
7
|
+
import * as PubLeafletBlocksHeader from '../blocks/header.js';
|
|
8
|
+
import * as PubLeafletBlocksHorizontalRule from '../blocks/horizontalRule.js';
|
|
9
|
+
import * as PubLeafletBlocksIframe from '../blocks/iframe.js';
|
|
10
|
+
import * as PubLeafletBlocksImage from '../blocks/image.js';
|
|
11
|
+
import * as PubLeafletBlocksMath from '../blocks/math.js';
|
|
12
|
+
import * as PubLeafletBlocksPage from '../blocks/page.js';
|
|
13
|
+
import * as PubLeafletBlocksPoll from '../blocks/poll.js';
|
|
14
|
+
import * as PubLeafletBlocksText from '../blocks/text.js';
|
|
15
|
+
import * as PubLeafletBlocksUnorderedList from '../blocks/unorderedList.js';
|
|
16
|
+
import * as PubLeafletBlocksWebsite from '../blocks/website.js';
|
|
17
|
+
|
|
18
|
+
const _blockSchema = /*#__PURE__*/ v.object({
|
|
19
|
+
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.pages.canvas#block')),
|
|
20
|
+
get block() {
|
|
21
|
+
return /*#__PURE__*/ v.variant([
|
|
22
|
+
PubLeafletBlocksBlockquote.mainSchema,
|
|
23
|
+
PubLeafletBlocksBskyPost.mainSchema,
|
|
24
|
+
PubLeafletBlocksButton.mainSchema,
|
|
25
|
+
PubLeafletBlocksCode.mainSchema,
|
|
26
|
+
PubLeafletBlocksHeader.mainSchema,
|
|
27
|
+
PubLeafletBlocksHorizontalRule.mainSchema,
|
|
28
|
+
PubLeafletBlocksIframe.mainSchema,
|
|
29
|
+
PubLeafletBlocksImage.mainSchema,
|
|
30
|
+
PubLeafletBlocksMath.mainSchema,
|
|
31
|
+
PubLeafletBlocksPage.mainSchema,
|
|
32
|
+
PubLeafletBlocksPoll.mainSchema,
|
|
33
|
+
PubLeafletBlocksText.mainSchema,
|
|
34
|
+
PubLeafletBlocksUnorderedList.mainSchema,
|
|
35
|
+
PubLeafletBlocksWebsite.mainSchema,
|
|
36
|
+
]);
|
|
37
|
+
},
|
|
38
|
+
height: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.integer()),
|
|
39
|
+
/**
|
|
40
|
+
* The rotation of the block in degrees
|
|
41
|
+
*/
|
|
42
|
+
rotation: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.integer()),
|
|
43
|
+
width: /*#__PURE__*/ v.integer(),
|
|
44
|
+
x: /*#__PURE__*/ v.integer(),
|
|
45
|
+
y: /*#__PURE__*/ v.integer(),
|
|
46
|
+
});
|
|
47
|
+
const _mainSchema = /*#__PURE__*/ v.object({
|
|
48
|
+
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.pages.canvas')),
|
|
49
|
+
get blocks() {
|
|
50
|
+
return /*#__PURE__*/ v.array(blockSchema);
|
|
51
|
+
},
|
|
52
|
+
id: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
|
|
53
|
+
});
|
|
54
|
+
const _positionSchema = /*#__PURE__*/ v.object({
|
|
55
|
+
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.pages.canvas#position')),
|
|
56
|
+
block: /*#__PURE__*/ v.array(/*#__PURE__*/ v.integer()),
|
|
57
|
+
offset: /*#__PURE__*/ v.integer(),
|
|
58
|
+
});
|
|
59
|
+
const _quoteSchema = /*#__PURE__*/ v.object({
|
|
60
|
+
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.pages.canvas#quote')),
|
|
61
|
+
get end() {
|
|
62
|
+
return positionSchema;
|
|
63
|
+
},
|
|
64
|
+
get start() {
|
|
65
|
+
return positionSchema;
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
const _textAlignCenterSchema = /*#__PURE__*/ v.literal('pub.leaflet.pages.canvas#textAlignCenter');
|
|
69
|
+
const _textAlignLeftSchema = /*#__PURE__*/ v.literal('pub.leaflet.pages.canvas#textAlignLeft');
|
|
70
|
+
const _textAlignRightSchema = /*#__PURE__*/ v.literal('pub.leaflet.pages.canvas#textAlignRight');
|
|
71
|
+
|
|
72
|
+
type block$schematype = typeof _blockSchema;
|
|
73
|
+
type main$schematype = typeof _mainSchema;
|
|
74
|
+
type position$schematype = typeof _positionSchema;
|
|
75
|
+
type quote$schematype = typeof _quoteSchema;
|
|
76
|
+
type textAlignCenter$schematype = typeof _textAlignCenterSchema;
|
|
77
|
+
type textAlignLeft$schematype = typeof _textAlignLeftSchema;
|
|
78
|
+
type textAlignRight$schematype = typeof _textAlignRightSchema;
|
|
79
|
+
|
|
80
|
+
export interface blockSchema extends block$schematype {}
|
|
81
|
+
export interface mainSchema extends main$schematype {}
|
|
82
|
+
export interface positionSchema extends position$schematype {}
|
|
83
|
+
export interface quoteSchema extends quote$schematype {}
|
|
84
|
+
export interface textAlignCenterSchema extends textAlignCenter$schematype {}
|
|
85
|
+
export interface textAlignLeftSchema extends textAlignLeft$schematype {}
|
|
86
|
+
export interface textAlignRightSchema extends textAlignRight$schematype {}
|
|
87
|
+
|
|
88
|
+
export const blockSchema = _blockSchema as blockSchema;
|
|
89
|
+
export const mainSchema = _mainSchema as mainSchema;
|
|
90
|
+
export const positionSchema = _positionSchema as positionSchema;
|
|
91
|
+
export const quoteSchema = _quoteSchema as quoteSchema;
|
|
92
|
+
export const textAlignCenterSchema = _textAlignCenterSchema as textAlignCenterSchema;
|
|
93
|
+
export const textAlignLeftSchema = _textAlignLeftSchema as textAlignLeftSchema;
|
|
94
|
+
export const textAlignRightSchema = _textAlignRightSchema as textAlignRightSchema;
|
|
95
|
+
|
|
96
|
+
export interface Block extends v.InferInput<typeof blockSchema> {}
|
|
97
|
+
export interface Main extends v.InferInput<typeof mainSchema> {}
|
|
98
|
+
export interface Position extends v.InferInput<typeof positionSchema> {}
|
|
99
|
+
export interface Quote extends v.InferInput<typeof quoteSchema> {}
|
|
100
|
+
export type TextAlignCenter = v.InferInput<typeof textAlignCenterSchema>;
|
|
101
|
+
export type TextAlignLeft = v.InferInput<typeof textAlignLeftSchema>;
|
|
102
|
+
export type TextAlignRight = v.InferInput<typeof textAlignRightSchema>;
|
|
@@ -2,12 +2,15 @@ import type {} from '@atcute/lexicons';
|
|
|
2
2
|
import * as v from '@atcute/lexicons/validations';
|
|
3
3
|
import * as PubLeafletBlocksBlockquote from '../blocks/blockquote.js';
|
|
4
4
|
import * as PubLeafletBlocksBskyPost from '../blocks/bskyPost.js';
|
|
5
|
+
import * as PubLeafletBlocksButton from '../blocks/button.js';
|
|
5
6
|
import * as PubLeafletBlocksCode from '../blocks/code.js';
|
|
6
7
|
import * as PubLeafletBlocksHeader from '../blocks/header.js';
|
|
7
8
|
import * as PubLeafletBlocksHorizontalRule from '../blocks/horizontalRule.js';
|
|
8
9
|
import * as PubLeafletBlocksIframe from '../blocks/iframe.js';
|
|
9
10
|
import * as PubLeafletBlocksImage from '../blocks/image.js';
|
|
10
11
|
import * as PubLeafletBlocksMath from '../blocks/math.js';
|
|
12
|
+
import * as PubLeafletBlocksPage from '../blocks/page.js';
|
|
13
|
+
import * as PubLeafletBlocksPoll from '../blocks/poll.js';
|
|
11
14
|
import * as PubLeafletBlocksText from '../blocks/text.js';
|
|
12
15
|
import * as PubLeafletBlocksUnorderedList from '../blocks/unorderedList.js';
|
|
13
16
|
import * as PubLeafletBlocksWebsite from '../blocks/website.js';
|
|
@@ -23,12 +26,15 @@ const _blockSchema = /*#__PURE__*/ v.object({
|
|
|
23
26
|
return /*#__PURE__*/ v.variant([
|
|
24
27
|
PubLeafletBlocksBlockquote.mainSchema,
|
|
25
28
|
PubLeafletBlocksBskyPost.mainSchema,
|
|
29
|
+
PubLeafletBlocksButton.mainSchema,
|
|
26
30
|
PubLeafletBlocksCode.mainSchema,
|
|
27
31
|
PubLeafletBlocksHeader.mainSchema,
|
|
28
32
|
PubLeafletBlocksHorizontalRule.mainSchema,
|
|
29
33
|
PubLeafletBlocksIframe.mainSchema,
|
|
30
34
|
PubLeafletBlocksImage.mainSchema,
|
|
31
35
|
PubLeafletBlocksMath.mainSchema,
|
|
36
|
+
PubLeafletBlocksPage.mainSchema,
|
|
37
|
+
PubLeafletBlocksPoll.mainSchema,
|
|
32
38
|
PubLeafletBlocksText.mainSchema,
|
|
33
39
|
PubLeafletBlocksUnorderedList.mainSchema,
|
|
34
40
|
PubLeafletBlocksWebsite.mainSchema,
|
|
@@ -38,8 +44,9 @@ const _blockSchema = /*#__PURE__*/ v.object({
|
|
|
38
44
|
const _mainSchema = /*#__PURE__*/ v.object({
|
|
39
45
|
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.pages.linearDocument')),
|
|
40
46
|
get blocks() {
|
|
41
|
-
return /*#__PURE__*/ v.
|
|
47
|
+
return /*#__PURE__*/ v.array(blockSchema);
|
|
42
48
|
},
|
|
49
|
+
id: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
|
|
43
50
|
});
|
|
44
51
|
const _positionSchema = /*#__PURE__*/ v.object({
|
|
45
52
|
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.pages.linearDocument#position')),
|
|
@@ -56,6 +63,7 @@ const _quoteSchema = /*#__PURE__*/ v.object({
|
|
|
56
63
|
},
|
|
57
64
|
});
|
|
58
65
|
const _textAlignCenterSchema = /*#__PURE__*/ v.literal('pub.leaflet.pages.linearDocument#textAlignCenter');
|
|
66
|
+
const _textAlignJustifySchema = /*#__PURE__*/ v.literal('pub.leaflet.pages.linearDocument#textAlignJustify');
|
|
59
67
|
const _textAlignLeftSchema = /*#__PURE__*/ v.literal('pub.leaflet.pages.linearDocument#textAlignLeft');
|
|
60
68
|
const _textAlignRightSchema = /*#__PURE__*/ v.literal('pub.leaflet.pages.linearDocument#textAlignRight');
|
|
61
69
|
|
|
@@ -64,6 +72,7 @@ type main$schematype = typeof _mainSchema;
|
|
|
64
72
|
type position$schematype = typeof _positionSchema;
|
|
65
73
|
type quote$schematype = typeof _quoteSchema;
|
|
66
74
|
type textAlignCenter$schematype = typeof _textAlignCenterSchema;
|
|
75
|
+
type textAlignJustify$schematype = typeof _textAlignJustifySchema;
|
|
67
76
|
type textAlignLeft$schematype = typeof _textAlignLeftSchema;
|
|
68
77
|
type textAlignRight$schematype = typeof _textAlignRightSchema;
|
|
69
78
|
|
|
@@ -72,6 +81,7 @@ export interface mainSchema extends main$schematype {}
|
|
|
72
81
|
export interface positionSchema extends position$schematype {}
|
|
73
82
|
export interface quoteSchema extends quote$schematype {}
|
|
74
83
|
export interface textAlignCenterSchema extends textAlignCenter$schematype {}
|
|
84
|
+
export interface textAlignJustifySchema extends textAlignJustify$schematype {}
|
|
75
85
|
export interface textAlignLeftSchema extends textAlignLeft$schematype {}
|
|
76
86
|
export interface textAlignRightSchema extends textAlignRight$schematype {}
|
|
77
87
|
|
|
@@ -80,6 +90,7 @@ export const mainSchema = _mainSchema as mainSchema;
|
|
|
80
90
|
export const positionSchema = _positionSchema as positionSchema;
|
|
81
91
|
export const quoteSchema = _quoteSchema as quoteSchema;
|
|
82
92
|
export const textAlignCenterSchema = _textAlignCenterSchema as textAlignCenterSchema;
|
|
93
|
+
export const textAlignJustifySchema = _textAlignJustifySchema as textAlignJustifySchema;
|
|
83
94
|
export const textAlignLeftSchema = _textAlignLeftSchema as textAlignLeftSchema;
|
|
84
95
|
export const textAlignRightSchema = _textAlignRightSchema as textAlignRightSchema;
|
|
85
96
|
|
|
@@ -88,5 +99,6 @@ export interface Main extends v.InferInput<typeof mainSchema> {}
|
|
|
88
99
|
export interface Position extends v.InferInput<typeof positionSchema> {}
|
|
89
100
|
export interface Quote extends v.InferInput<typeof quoteSchema> {}
|
|
90
101
|
export type TextAlignCenter = v.InferInput<typeof textAlignCenterSchema>;
|
|
102
|
+
export type TextAlignJustify = v.InferInput<typeof textAlignJustifySchema>;
|
|
91
103
|
export type TextAlignLeft = v.InferInput<typeof textAlignLeftSchema>;
|
|
92
104
|
export type TextAlignRight = v.InferInput<typeof textAlignRightSchema>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type {} from '@atcute/lexicons';
|
|
2
|
+
import * as v from '@atcute/lexicons/validations';
|
|
3
|
+
import type {} from '@atcute/lexicons/ambient';
|
|
4
|
+
|
|
5
|
+
const _mainSchema = /*#__PURE__*/ v.record(
|
|
6
|
+
/*#__PURE__*/ v.tidString(),
|
|
7
|
+
/*#__PURE__*/ v.object({
|
|
8
|
+
$type: /*#__PURE__*/ v.literal('pub.leaflet.poll.definition'),
|
|
9
|
+
endDate: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.datetimeString()),
|
|
10
|
+
/**
|
|
11
|
+
* @maxLength 500
|
|
12
|
+
* @maxGraphemes 100
|
|
13
|
+
*/
|
|
14
|
+
name: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [
|
|
15
|
+
/*#__PURE__*/ v.stringLength(0, 500),
|
|
16
|
+
/*#__PURE__*/ v.stringGraphemes(0, 100),
|
|
17
|
+
]),
|
|
18
|
+
get options() {
|
|
19
|
+
return /*#__PURE__*/ v.array(optionSchema);
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
);
|
|
23
|
+
const _optionSchema = /*#__PURE__*/ v.object({
|
|
24
|
+
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.poll.definition#option')),
|
|
25
|
+
/**
|
|
26
|
+
* @maxLength 500
|
|
27
|
+
* @maxGraphemes 50
|
|
28
|
+
*/
|
|
29
|
+
text: /*#__PURE__*/ v.optional(
|
|
30
|
+
/*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [
|
|
31
|
+
/*#__PURE__*/ v.stringLength(0, 500),
|
|
32
|
+
/*#__PURE__*/ v.stringGraphemes(0, 50),
|
|
33
|
+
]),
|
|
34
|
+
),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
type main$schematype = typeof _mainSchema;
|
|
38
|
+
type option$schematype = typeof _optionSchema;
|
|
39
|
+
|
|
40
|
+
export interface mainSchema extends main$schematype {}
|
|
41
|
+
export interface optionSchema extends option$schematype {}
|
|
42
|
+
|
|
43
|
+
export const mainSchema = _mainSchema as mainSchema;
|
|
44
|
+
export const optionSchema = _optionSchema as optionSchema;
|
|
45
|
+
|
|
46
|
+
export interface Main extends v.InferInput<typeof mainSchema> {}
|
|
47
|
+
export interface Option extends v.InferInput<typeof optionSchema> {}
|
|
48
|
+
|
|
49
|
+
declare module '@atcute/lexicons/ambient' {
|
|
50
|
+
interface Records {
|
|
51
|
+
'pub.leaflet.poll.definition': mainSchema;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type {} from '@atcute/lexicons';
|
|
2
|
+
import * as v from '@atcute/lexicons/validations';
|
|
3
|
+
import type {} from '@atcute/lexicons/ambient';
|
|
4
|
+
import * as ComAtprotoRepoStrongRef from '@atcute/atproto/types/repo/strongRef';
|
|
5
|
+
|
|
6
|
+
const _mainSchema = /*#__PURE__*/ v.record(
|
|
7
|
+
/*#__PURE__*/ v.tidString(),
|
|
8
|
+
/*#__PURE__*/ v.object({
|
|
9
|
+
$type: /*#__PURE__*/ v.literal('pub.leaflet.poll.vote'),
|
|
10
|
+
option: /*#__PURE__*/ v.array(/*#__PURE__*/ v.string()),
|
|
11
|
+
get poll() {
|
|
12
|
+
return ComAtprotoRepoStrongRef.mainSchema;
|
|
13
|
+
},
|
|
14
|
+
}),
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
type main$schematype = typeof _mainSchema;
|
|
18
|
+
|
|
19
|
+
export interface mainSchema extends main$schematype {}
|
|
20
|
+
|
|
21
|
+
export const mainSchema = _mainSchema as mainSchema;
|
|
22
|
+
|
|
23
|
+
export interface Main extends v.InferInput<typeof mainSchema> {}
|
|
24
|
+
|
|
25
|
+
declare module '@atcute/lexicons/ambient' {
|
|
26
|
+
interface Records {
|
|
27
|
+
'pub.leaflet.poll.vote': mainSchema;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -8,7 +8,7 @@ const _mainSchema = /*#__PURE__*/ v.record(
|
|
|
8
8
|
/*#__PURE__*/ v.tidString(),
|
|
9
9
|
/*#__PURE__*/ v.object({
|
|
10
10
|
$type: /*#__PURE__*/ v.literal('pub.leaflet.publication'),
|
|
11
|
-
base_path: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.
|
|
11
|
+
base_path: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
|
|
12
12
|
/**
|
|
13
13
|
* @maxLength 2000
|
|
14
14
|
*/
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type {} from '@atcute/lexicons';
|
|
2
2
|
import * as v from '@atcute/lexicons/validations';
|
|
3
3
|
|
|
4
|
+
const _atMentionSchema = /*#__PURE__*/ v.object({
|
|
5
|
+
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.richtext.facet#atMention')),
|
|
6
|
+
atURI: /*#__PURE__*/ v.genericUriString(),
|
|
7
|
+
});
|
|
4
8
|
const _boldSchema = /*#__PURE__*/ v.object({
|
|
5
9
|
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.richtext.facet#bold')),
|
|
6
10
|
});
|
|
@@ -18,6 +22,10 @@ const _byteSliceSchema = /*#__PURE__*/ v.object({
|
|
|
18
22
|
const _codeSchema = /*#__PURE__*/ v.object({
|
|
19
23
|
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.richtext.facet#code')),
|
|
20
24
|
});
|
|
25
|
+
const _didMentionSchema = /*#__PURE__*/ v.object({
|
|
26
|
+
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.richtext.facet#didMention')),
|
|
27
|
+
did: /*#__PURE__*/ v.didString(),
|
|
28
|
+
});
|
|
21
29
|
const _highlightSchema = /*#__PURE__*/ v.object({
|
|
22
30
|
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.richtext.facet#highlight')),
|
|
23
31
|
});
|
|
@@ -30,15 +38,17 @@ const _italicSchema = /*#__PURE__*/ v.object({
|
|
|
30
38
|
});
|
|
31
39
|
const _linkSchema = /*#__PURE__*/ v.object({
|
|
32
40
|
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.richtext.facet#link')),
|
|
33
|
-
uri: /*#__PURE__*/ v.
|
|
41
|
+
uri: /*#__PURE__*/ v.string(),
|
|
34
42
|
});
|
|
35
43
|
const _mainSchema = /*#__PURE__*/ v.object({
|
|
36
44
|
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.richtext.facet')),
|
|
37
45
|
get features() {
|
|
38
46
|
return /*#__PURE__*/ v.array(
|
|
39
47
|
/*#__PURE__*/ v.variant([
|
|
48
|
+
atMentionSchema,
|
|
40
49
|
boldSchema,
|
|
41
50
|
codeSchema,
|
|
51
|
+
didMentionSchema,
|
|
42
52
|
highlightSchema,
|
|
43
53
|
idSchema,
|
|
44
54
|
italicSchema,
|
|
@@ -59,9 +69,11 @@ const _underlineSchema = /*#__PURE__*/ v.object({
|
|
|
59
69
|
$type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('pub.leaflet.richtext.facet#underline')),
|
|
60
70
|
});
|
|
61
71
|
|
|
72
|
+
type atMention$schematype = typeof _atMentionSchema;
|
|
62
73
|
type bold$schematype = typeof _boldSchema;
|
|
63
74
|
type byteSlice$schematype = typeof _byteSliceSchema;
|
|
64
75
|
type code$schematype = typeof _codeSchema;
|
|
76
|
+
type didMention$schematype = typeof _didMentionSchema;
|
|
65
77
|
type highlight$schematype = typeof _highlightSchema;
|
|
66
78
|
type id$schematype = typeof _idSchema;
|
|
67
79
|
type italic$schematype = typeof _italicSchema;
|
|
@@ -70,9 +82,11 @@ type main$schematype = typeof _mainSchema;
|
|
|
70
82
|
type strikethrough$schematype = typeof _strikethroughSchema;
|
|
71
83
|
type underline$schematype = typeof _underlineSchema;
|
|
72
84
|
|
|
85
|
+
export interface atMentionSchema extends atMention$schematype {}
|
|
73
86
|
export interface boldSchema extends bold$schematype {}
|
|
74
87
|
export interface byteSliceSchema extends byteSlice$schematype {}
|
|
75
88
|
export interface codeSchema extends code$schematype {}
|
|
89
|
+
export interface didMentionSchema extends didMention$schematype {}
|
|
76
90
|
export interface highlightSchema extends highlight$schematype {}
|
|
77
91
|
export interface idSchema extends id$schematype {}
|
|
78
92
|
export interface italicSchema extends italic$schematype {}
|
|
@@ -81,9 +95,11 @@ export interface mainSchema extends main$schematype {}
|
|
|
81
95
|
export interface strikethroughSchema extends strikethrough$schematype {}
|
|
82
96
|
export interface underlineSchema extends underline$schematype {}
|
|
83
97
|
|
|
98
|
+
export const atMentionSchema = _atMentionSchema as atMentionSchema;
|
|
84
99
|
export const boldSchema = _boldSchema as boldSchema;
|
|
85
100
|
export const byteSliceSchema = _byteSliceSchema as byteSliceSchema;
|
|
86
101
|
export const codeSchema = _codeSchema as codeSchema;
|
|
102
|
+
export const didMentionSchema = _didMentionSchema as didMentionSchema;
|
|
87
103
|
export const highlightSchema = _highlightSchema as highlightSchema;
|
|
88
104
|
export const idSchema = _idSchema as idSchema;
|
|
89
105
|
export const italicSchema = _italicSchema as italicSchema;
|
|
@@ -92,9 +108,11 @@ export const mainSchema = _mainSchema as mainSchema;
|
|
|
92
108
|
export const strikethroughSchema = _strikethroughSchema as strikethroughSchema;
|
|
93
109
|
export const underlineSchema = _underlineSchema as underlineSchema;
|
|
94
110
|
|
|
111
|
+
export interface AtMention extends v.InferInput<typeof atMentionSchema> {}
|
|
95
112
|
export interface Bold extends v.InferInput<typeof boldSchema> {}
|
|
96
113
|
export interface ByteSlice extends v.InferInput<typeof byteSliceSchema> {}
|
|
97
114
|
export interface Code extends v.InferInput<typeof codeSchema> {}
|
|
115
|
+
export interface DidMention extends v.InferInput<typeof didMentionSchema> {}
|
|
98
116
|
export interface Highlight extends v.InferInput<typeof highlightSchema> {}
|
|
99
117
|
export interface Id extends v.InferInput<typeof idSchema> {}
|
|
100
118
|
export interface Italic extends v.InferInput<typeof italicSchema> {}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@atcute/leaflet",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.13",
|
|
5
5
|
"description": "Leaflet (pub.leaflet.*) schema definitions",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"atcute",
|
|
@@ -24,13 +24,12 @@
|
|
|
24
24
|
"./types/*": "./dist/lexicons/types/pub/leaflet/*.js"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atcute/atproto": "^3.1.
|
|
28
|
-
"@atcute/lexicons": "^1.2.
|
|
27
|
+
"@atcute/atproto": "^3.1.9",
|
|
28
|
+
"@atcute/lexicons": "^1.2.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@atcute/leaflet": "file:",
|
|
32
|
-
"
|
|
33
|
-
"@atcute/lex-cli": "^2.3.0"
|
|
32
|
+
"@atcute/lex-cli": "^2.5.0"
|
|
34
33
|
},
|
|
35
34
|
"atcute:lexicons": {
|
|
36
35
|
"mappings": {
|
|
@@ -41,9 +40,9 @@
|
|
|
41
40
|
}
|
|
42
41
|
},
|
|
43
42
|
"scripts": {
|
|
44
|
-
"build": "
|
|
45
|
-
"
|
|
46
|
-
"generate": "rm -r ./lib/lexicons/; lex-cli generate
|
|
43
|
+
"build": "tsgo",
|
|
44
|
+
"pull": "lex-cli pull",
|
|
45
|
+
"generate": "rm -r ./lib/lexicons/; lex-cli generate",
|
|
47
46
|
"prepublish": "rm -rf dist; pnpm run build"
|
|
48
47
|
}
|
|
49
48
|
}
|