lkb-fields-document 1.0.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.
Files changed (112) hide show
  1. package/component-blocks/dist/lkb-fields-document-component-blocks.cjs.d.ts +2 -0
  2. package/component-blocks/dist/lkb-fields-document-component-blocks.cjs.js +306 -0
  3. package/component-blocks/dist/lkb-fields-document-component-blocks.esm.js +300 -0
  4. package/component-blocks/dist/lkb-fields-document-component-blocks.node.cjs.js +306 -0
  5. package/component-blocks/dist/lkb-fields-document-component-blocks.node.esm.js +300 -0
  6. package/component-blocks/package.json +4 -0
  7. package/dist/Cell-0ac0ac66.node.cjs.js +21 -0
  8. package/dist/Cell-242f7404.esm.js +17 -0
  9. package/dist/Cell-3103f73d.node.esm.js +17 -0
  10. package/dist/Cell-bfb56d74.cjs.js +21 -0
  11. package/dist/Field-0e0f75ed.node.cjs.js +1628 -0
  12. package/dist/Field-28177061.cjs.js +1628 -0
  13. package/dist/Field-35b79e6b.node.esm.js +1619 -0
  14. package/dist/Field-92d13205.esm.js +1619 -0
  15. package/dist/api-2f524611.esm.js +502 -0
  16. package/dist/api-73636987.cjs.js +506 -0
  17. package/dist/api-8e2b20b8.node.cjs.js +506 -0
  18. package/dist/api-c32e360e.node.esm.js +502 -0
  19. package/dist/callout-ui-2aded278.cjs.js +131 -0
  20. package/dist/callout-ui-3e5ca544.node.esm.js +126 -0
  21. package/dist/callout-ui-8b5f2376.esm.js +126 -0
  22. package/dist/callout-ui-ad50f301.node.cjs.js +131 -0
  23. package/dist/declarations/src/component-blocks.d.ts +4 -0
  24. package/dist/declarations/src/component-blocks.d.ts.map +1 -0
  25. package/dist/declarations/src/document-editor/component-blocks/api.d.ts +120 -0
  26. package/dist/declarations/src/document-editor/component-blocks/api.d.ts.map +1 -0
  27. package/dist/declarations/src/document-editor/component-blocks/types.d.ts +241 -0
  28. package/dist/declarations/src/document-editor/component-blocks/types.d.ts.map +1 -0
  29. package/dist/declarations/src/document-editor/toolset/relationship/relationship-shared.d.ts +10 -0
  30. package/dist/declarations/src/document-editor/toolset/relationship/relationship-shared.d.ts.map +1 -0
  31. package/dist/declarations/src/index.d.ts +7 -0
  32. package/dist/declarations/src/index.d.ts.map +1 -0
  33. package/dist/declarations/src/my-component-blocks/index.d.ts +46 -0
  34. package/dist/declarations/src/my-component-blocks/index.d.ts.map +1 -0
  35. package/dist/declarations/src/structure/Cell.d.ts +5 -0
  36. package/dist/declarations/src/structure/Cell.d.ts.map +1 -0
  37. package/dist/declarations/src/structure/Field.d.ts +5 -0
  38. package/dist/declarations/src/structure/Field.d.ts.map +1 -0
  39. package/dist/declarations/src/structure/controller.d.ts +10 -0
  40. package/dist/declarations/src/structure/controller.d.ts.map +1 -0
  41. package/dist/declarations/src/structure/structure.d.ts +4 -0
  42. package/dist/declarations/src/structure/structure.d.ts.map +1 -0
  43. package/dist/declarations/src/structure-views.d.ts +5 -0
  44. package/dist/declarations/src/structure-views.d.ts.map +1 -0
  45. package/dist/declarations/src/types/DocumentFeatures.d.ts +33 -0
  46. package/dist/declarations/src/types/DocumentFeatures.d.ts.map +1 -0
  47. package/dist/declarations/src/types/DocumentFieldConfig.d.ts +18 -0
  48. package/dist/declarations/src/types/DocumentFieldConfig.d.ts.map +1 -0
  49. package/dist/declarations/src/types/FormattingConfig.d.ts +28 -0
  50. package/dist/declarations/src/types/FormattingConfig.d.ts.map +1 -0
  51. package/dist/declarations/src/types/RelationshipsConfig.d.ts +9 -0
  52. package/dist/declarations/src/types/RelationshipsConfig.d.ts.map +1 -0
  53. package/dist/declarations/src/types/StructureFieldConfig.d.ts +10 -0
  54. package/dist/declarations/src/types/StructureFieldConfig.d.ts.map +1 -0
  55. package/dist/declarations/src/validation/structure-validation.d.ts +218 -0
  56. package/dist/declarations/src/validation/structure-validation.d.ts.map +1 -0
  57. package/dist/declarations/src/views/Cell.d.ts +5 -0
  58. package/dist/declarations/src/views/Cell.d.ts.map +1 -0
  59. package/dist/declarations/src/views/Field.d.ts +5 -0
  60. package/dist/declarations/src/views/Field.d.ts.map +1 -0
  61. package/dist/declarations/src/views/controller.d.ts +15 -0
  62. package/dist/declarations/src/views/controller.d.ts.map +1 -0
  63. package/dist/declarations/src/views/document.d.ts +4 -0
  64. package/dist/declarations/src/views/document.d.ts.map +1 -0
  65. package/dist/declarations/src/views.d.ts +7 -0
  66. package/dist/declarations/src/views.d.ts.map +1 -0
  67. package/dist/editor-shared-a6e340e6.node.esm.js +1993 -0
  68. package/dist/editor-shared-a997ae98.node.cjs.js +2007 -0
  69. package/dist/editor-shared-cc1293ed.cjs.js +2007 -0
  70. package/dist/editor-shared-da518ba3.esm.js +1993 -0
  71. package/dist/form-from-preview-2042b9ef.cjs.js +512 -0
  72. package/dist/form-from-preview-5df6e492.node.esm.js +508 -0
  73. package/dist/form-from-preview-9e501058.node.cjs.js +512 -0
  74. package/dist/form-from-preview-b3a66f37.esm.js +508 -0
  75. package/dist/index-06c36775.cjs.js +14 -0
  76. package/dist/index-586adb8f.node.esm.js +11 -0
  77. package/dist/index-67d52357.esm.js +11 -0
  78. package/dist/index-c3223fdc.node.cjs.js +14 -0
  79. package/dist/layouts-6412fa2a.esm.js +189 -0
  80. package/dist/layouts-a4a3cf0b.node.cjs.js +196 -0
  81. package/dist/layouts-ba9a558b.cjs.js +196 -0
  82. package/dist/layouts-e653b908.node.esm.js +189 -0
  83. package/dist/lkb-fields-document.cjs.d.ts +2 -0
  84. package/dist/lkb-fields-document.cjs.js +1167 -0
  85. package/dist/lkb-fields-document.esm.js +1162 -0
  86. package/dist/lkb-fields-document.node.cjs.js +1167 -0
  87. package/dist/lkb-fields-document.node.esm.js +1162 -0
  88. package/dist/shared-0533009e.cjs.js +594 -0
  89. package/dist/shared-4684cc24.node.cjs.js +594 -0
  90. package/dist/shared-5e864055.node.esm.js +579 -0
  91. package/dist/shared-aaba5901.esm.js +579 -0
  92. package/dist/toolbar-state-3359e2f3.cjs.js +994 -0
  93. package/dist/toolbar-state-945823b8.node.esm.js +971 -0
  94. package/dist/toolbar-state-9611743f.node.cjs.js +994 -0
  95. package/dist/toolbar-state-bc8fe661.esm.js +971 -0
  96. package/dist/utils-06bcddc4.node.cjs.js +747 -0
  97. package/dist/utils-200ff260.node.esm.js +722 -0
  98. package/dist/utils-6409f730.cjs.js +747 -0
  99. package/dist/utils-bc6a0b82.esm.js +722 -0
  100. package/package.json +118 -0
  101. package/structure-views/dist/lkb-fields-document-structure-views.cjs.d.ts +2 -0
  102. package/structure-views/dist/lkb-fields-document-structure-views.cjs.js +138 -0
  103. package/structure-views/dist/lkb-fields-document-structure-views.esm.js +131 -0
  104. package/structure-views/dist/lkb-fields-document-structure-views.node.cjs.js +138 -0
  105. package/structure-views/dist/lkb-fields-document-structure-views.node.esm.js +131 -0
  106. package/structure-views/package.json +4 -0
  107. package/views/dist/lkb-fields-document-views.cjs.d.ts +2 -0
  108. package/views/dist/lkb-fields-document-views.cjs.js +114 -0
  109. package/views/dist/lkb-fields-document-views.esm.js +95 -0
  110. package/views/dist/lkb-fields-document-views.node.cjs.js +114 -0
  111. package/views/dist/lkb-fields-document-views.node.esm.js +95 -0
  112. package/views/package.json +4 -0
@@ -0,0 +1,241 @@
1
+ import type { GField, GArg, GInputType, GOutputType, GNullableInputType } from 'lkb-core/graphql-ts';
2
+ import type { KeystoneContext } from 'lkb-core/types';
3
+ import type { ReactElement, ReactNode } from 'react';
4
+ /**
5
+ * 描述了一个表单字段可能具有的各种值类型。
6
+ * 这是一个递归类型定义,允许嵌套结构。
7
+ */
8
+ export type FormFieldValue = string | number | boolean | null | readonly FormFieldValue[] | {
9
+ [key: string]: FormFieldValue | undefined;
10
+ };
11
+ /**
12
+ * 一个复杂的泛型类型定义,用于描述一个表单字段的完整结构。
13
+ * 它定义了一个包含表单输入组件、验证逻辑和GraphQL配置的对象类型。
14
+ */
15
+ export type FormField<Value extends FormFieldValue, Options> = {
16
+ kind: 'form';
17
+ Input(props: {
18
+ value: Value;
19
+ onChange(value: Value): void;
20
+ autoFocus: boolean;
21
+ /**
22
+ * This will be true when validate has returned false and the user has attempted to close the form
23
+ * or when the form is open and they attempt to save the item
24
+ */
25
+ forceValidation: boolean;
26
+ }): ReactElement | null;
27
+ /**
28
+ * The options are config about the field that are available on the
29
+ * preview props when rendering the toolbar and preview component
30
+ */
31
+ options: Options;
32
+ defaultValue: Value;
33
+ /**
34
+ * validate will be called in two cases:
35
+ * - on the client in the editor when a user is changing the value.
36
+ * Returning `false` will block closing the form
37
+ * and saving the item.
38
+ * - on the server when a change is received before allowing it to be saved
39
+ * if `true` is returned
40
+ * @param value The value of the form field. You should NOT trust
41
+ * this value to be of the correct type because it could come from
42
+ * a potentially malicious client
43
+ */
44
+ validate(value: unknown): boolean;
45
+ graphql?: {
46
+ input: GNullableInputType;
47
+ output: GField<{
48
+ value: Value;
49
+ }, Record<string, GArg<GInputType, boolean>>, GOutputType<KeystoneContext>, Value, KeystoneContext>;
50
+ };
51
+ };
52
+ export type InlineMarksConfig = 'inherit' | {
53
+ bold?: 'inherit';
54
+ code?: 'inherit';
55
+ italic?: 'inherit';
56
+ strikethrough?: 'inherit';
57
+ underline?: 'inherit';
58
+ keyboard?: 'inherit';
59
+ subscript?: 'inherit';
60
+ superscript?: 'inherit';
61
+ };
62
+ export type BlockFormattingConfig = {
63
+ alignment?: 'inherit';
64
+ blockTypes?: 'inherit';
65
+ headingLevels?: 'inherit' | (1 | 2 | 3 | 4 | 5 | 6)[];
66
+ inlineMarks?: InlineMarksConfig;
67
+ listTypes?: 'inherit';
68
+ softBreaks?: 'inherit';
69
+ };
70
+ export type ChildField = {
71
+ kind: 'child';
72
+ options: {
73
+ kind: 'block';
74
+ placeholder: string;
75
+ formatting?: BlockFormattingConfig;
76
+ dividers?: 'inherit';
77
+ links?: 'inherit';
78
+ relationships?: 'inherit';
79
+ componentBlocks?: 'inherit';
80
+ } | {
81
+ kind: 'inline';
82
+ placeholder: string;
83
+ formatting?: {
84
+ inlineMarks?: InlineMarksConfig;
85
+ softBreaks?: 'inherit';
86
+ };
87
+ links?: 'inherit';
88
+ relationships?: 'inherit';
89
+ };
90
+ };
91
+ export interface ObjectField<Fields extends Record<string, ComponentSchema> = Record<string, ComponentSchema>> {
92
+ kind: 'object';
93
+ fields: Fields;
94
+ }
95
+ export type ArrayField<ElementField extends ComponentSchema> = {
96
+ kind: 'array';
97
+ element: ElementField;
98
+ itemLabel?(props: unknown): string;
99
+ label?: string;
100
+ };
101
+ export type RelationshipField<Many extends boolean> = {
102
+ kind: 'relationship';
103
+ listKey: string;
104
+ label: string;
105
+ labelField: string | null;
106
+ selection: string | null;
107
+ many: Many;
108
+ };
109
+ export type ConditionalField<DiscriminantField extends {
110
+ defaultValue: any;
111
+ }, ConditionalValues extends {
112
+ [Key in `${DiscriminantField['defaultValue']}`]: ComponentSchema;
113
+ } = {
114
+ [Key in `${DiscriminantField['defaultValue']}`]: ComponentSchema;
115
+ }> = {
116
+ kind: 'conditional';
117
+ discriminant: DiscriminantField;
118
+ values: ConditionalValues;
119
+ };
120
+ type ArrayFieldInComponentSchema = {
121
+ kind: 'array';
122
+ element: ComponentSchema;
123
+ itemLabel?(props: unknown): string;
124
+ label?: string;
125
+ };
126
+ export type ComponentSchema = ChildField | FormField<any, any> | ObjectField | ArrayFieldInComponentSchema | RelationshipField<boolean> | ConditionalField<any, {
127
+ [key: string]: ComponentSchema;
128
+ }>;
129
+ type ChildFieldPreviewProps<Schema extends ChildField, ChildFieldElement> = {
130
+ readonly element: ChildFieldElement;
131
+ readonly schema: Schema;
132
+ };
133
+ type FormFieldPreviewProps<Schema extends FormField<any, any>> = {
134
+ readonly value: Schema['defaultValue'];
135
+ onChange(value: Schema['defaultValue']): void;
136
+ readonly options: Schema['options'];
137
+ readonly schema: Schema;
138
+ };
139
+ type ObjectFieldPreviewProps<Schema extends ObjectField<any>, ChildFieldElement> = {
140
+ readonly fields: {
141
+ readonly [Key in keyof Schema['fields']]: GenericPreviewProps<Schema['fields'][Key], ChildFieldElement>;
142
+ };
143
+ onChange(value: {
144
+ readonly [Key in keyof Schema['fields']]?: InitialOrUpdateValueFromComponentPropField<Schema['fields'][Key]>;
145
+ }): void;
146
+ readonly schema: Schema;
147
+ };
148
+ export type GenericPreviewProps<Schema extends ComponentSchema, ChildFieldElement> = Schema extends ChildField ? ChildFieldPreviewProps<Schema, ChildFieldElement> : Schema extends FormField<infer Value, infer Options> ? FormFieldPreviewProps<Schema> : Schema extends ObjectField<infer Value> ? ObjectFieldPreviewProps<Schema, ChildFieldElement> : Schema extends ConditionalField<infer DiscriminantField, infer Values> ? ConditionalFieldPreviewProps<Schema, ChildFieldElement> : Schema extends RelationshipField<infer Many> ? RelationshipFieldPreviewProps<Schema> : Schema extends ArrayField<infer ElementField> ? ArrayFieldPreviewProps<Schema, ChildFieldElement> : never;
149
+ export type InitialOrUpdateValueFromComponentPropField<Schema extends ComponentSchema> = Schema extends ChildField ? undefined : Schema extends FormField<infer Value, any> ? Value | undefined : Schema extends ObjectField<infer Value> ? {
150
+ readonly [Key in keyof Value]?: InitialOrUpdateValueFromComponentPropField<Value[Key]>;
151
+ } : Schema extends ConditionalField<infer DiscriminantField, infer Values> ? {
152
+ readonly [Key in keyof Values]: {
153
+ readonly discriminant: DiscriminantStringToDiscriminantValue<DiscriminantField, Key>;
154
+ readonly value?: InitialOrUpdateValueFromComponentPropField<Values[Key]>;
155
+ };
156
+ }[keyof Values] : Schema extends RelationshipField<infer Many> ? Many extends true ? readonly HydratedRelationshipData[] : HydratedRelationshipData | null : Schema extends ArrayField<infer ElementField> ? readonly {
157
+ key: string | undefined;
158
+ value?: InitialOrUpdateValueFromComponentPropField<ElementField>;
159
+ }[] : never;
160
+ type ConditionalFieldPreviewProps<Schema extends ConditionalField<any, any>, ChildFieldElement> = {
161
+ readonly [Key in keyof Schema['values']]: {
162
+ readonly discriminant: DiscriminantStringToDiscriminantValue<Schema['discriminant'], Key>;
163
+ onChange<Discriminant extends Schema['discriminant']['defaultValue']>(discriminant: Discriminant, value?: InitialOrUpdateValueFromComponentPropField<Schema['values'][`${Discriminant}`]>): void;
164
+ readonly options: Schema['discriminant']['options'];
165
+ readonly value: GenericPreviewProps<Schema['values'][Key], ChildFieldElement>;
166
+ readonly schema: Schema;
167
+ };
168
+ }[keyof Schema['values']];
169
+ type RelationshipDataType<Many extends boolean> = Many extends true ? readonly HydratedRelationshipData[] : HydratedRelationshipData | null;
170
+ type RelationshipFieldPreviewProps<Schema extends RelationshipField<boolean>> = {
171
+ readonly value: RelationshipDataType<Schema['many']>;
172
+ onChange(relationshipData: RelationshipDataType<Schema['many']>): void;
173
+ readonly schema: Schema;
174
+ };
175
+ type ArrayFieldPreviewProps<Schema extends ArrayField<ComponentSchema>, ChildFieldElement> = {
176
+ readonly elements: readonly (GenericPreviewProps<Schema['element'], ChildFieldElement> & {
177
+ readonly key: string;
178
+ })[];
179
+ readonly onChange: (value: readonly {
180
+ key: string | undefined;
181
+ value?: InitialOrUpdateValueFromComponentPropField<Schema['element']>;
182
+ }[]) => void;
183
+ readonly schema: Schema;
184
+ };
185
+ type DiscriminantStringToDiscriminantValue<DiscriminantField extends {
186
+ defaultValue: any;
187
+ }, DiscriminantString extends PropertyKey> = DiscriminantField['defaultValue'] extends boolean ? 'true' extends DiscriminantString ? true : 'false' extends DiscriminantString ? false : never : DiscriminantString;
188
+ export type HydratedRelationshipData = {
189
+ id: string;
190
+ label: string | null;
191
+ data?: Record<string, unknown>;
192
+ };
193
+ export type RelationshipData = {
194
+ id: string;
195
+ label: string | null | undefined;
196
+ data?: Record<string, unknown>;
197
+ };
198
+ type ValueForRenderingFromComponentPropField<Schema extends ComponentSchema> = Schema extends ChildField ? ReactNode : Schema extends FormField<infer Value, any> ? Value : Schema extends ObjectField<infer Value> ? {
199
+ readonly [Key in keyof Value]: ValueForRenderingFromComponentPropField<Value[Key]>;
200
+ } : Schema extends ConditionalField<infer DiscriminantField, infer Values> ? {
201
+ readonly [Key in keyof Values]: {
202
+ readonly discriminant: DiscriminantStringToDiscriminantValue<DiscriminantField, Key>;
203
+ readonly value: ValueForRenderingFromComponentPropField<Values[Key]>;
204
+ };
205
+ }[keyof Values] : Schema extends RelationshipField<infer Many> ? Many extends true ? readonly HydratedRelationshipData[] : HydratedRelationshipData | null : Schema extends ArrayField<infer ElementField> ? readonly ValueForRenderingFromComponentPropField<ElementField>[] : never;
206
+ export type ValueForComponentSchema<Schema extends ComponentSchema> = Schema extends ChildField ? null : Schema extends FormField<infer Value, any> ? Value : Schema extends ObjectField<infer Value> ? {
207
+ readonly [Key in keyof Value]: ValueForRenderingFromComponentPropField<Value[Key]>;
208
+ } : Schema extends ConditionalField<infer DiscriminantField, infer Values> ? {
209
+ readonly [Key in keyof Values]: {
210
+ readonly discriminant: DiscriminantStringToDiscriminantValue<DiscriminantField, Key>;
211
+ readonly value: ValueForRenderingFromComponentPropField<Values[Key]>;
212
+ };
213
+ }[keyof Values] : Schema extends RelationshipField<infer Many> ? Many extends true ? readonly HydratedRelationshipData[] : HydratedRelationshipData | null : Schema extends ArrayField<infer ElementField> ? readonly ValueForRenderingFromComponentPropField<ElementField>[] : never;
214
+ type Comp<Props> = (props: Props) => ReactNode;
215
+ type ExtractPropsForPropsForRendering<Props extends Record<string, ComponentSchema>> = {
216
+ readonly [Key in keyof Props]: ValueForRenderingFromComponentPropField<Props[Key]>;
217
+ };
218
+ export type InferRenderersForComponentBlocks<ComponentBlocks extends Record<string, ComponentBlock<any>>> = {
219
+ [Key in keyof ComponentBlocks]: Comp<ExtractPropsForPropsForRendering<ComponentBlocks[Key]['schema']>>;
220
+ };
221
+ export type ComponentBlock<Fields extends Record<string, ComponentSchema> = Record<string, ComponentSchema>> = {
222
+ preview: (props: any) => ReactElement | null;
223
+ schema: Fields;
224
+ label: string;
225
+ } & ({
226
+ chromeless: true;
227
+ toolbar?: (props: {
228
+ props: Record<string, any>;
229
+ onRemove(): void;
230
+ }) => ReactElement;
231
+ } | {
232
+ chromeless?: false;
233
+ toolbar?: (props: {
234
+ props: Record<string, any>;
235
+ onShowEditMode(): void;
236
+ onRemove(): void;
237
+ isValid: boolean;
238
+ }) => ReactElement;
239
+ });
240
+ export {};
241
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"../../../../../src/document-editor/component-blocks","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEpD;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,cAAc,EAAE,GACzB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAA;CAAE,CAAA;AAEjD;;;GAGG;AACH,MAAM,MAAM,SAAS,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,IAAI;IAC7D,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,KAAK,EAAE;QACX,KAAK,EAAE,KAAK,CAAA;QACZ,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;QAC5B,SAAS,EAAE,OAAO,CAAA;QAClB;;;WAGG;QACH,eAAe,EAAE,OAAO,CAAA;KACzB,GAAG,YAAY,GAAG,IAAI,CAAA;IACvB;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,KAAK,CAAA;IACnB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAA;IACjC,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,kBAAkB,CAAA;QACzB,MAAM,EAAE,MAAM,CACZ;YAAE,KAAK,EAAE,KAAK,CAAA;SAAE,EAChB,MA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,KAAK,GAAG,uCAAuC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;CACnF,CAAA;AAED,MAAM,MAAM,gCAAgC,CAC1C,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,IACzD;KACD,GAAG,IAAI,MAAM,eAAe,GAAG,IAAI,CAClC,gCAAgC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CACjE;CACF,CAAA;AAED,MAAM,MAAM,cAAc,CACxB,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,IAC9E;IACF,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,YAAY,GAAG,IAAI,CAAA;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,CACA;IACE,UAAU,EAAE,IAAI,CAAA;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAAC,QAAQ,IAAI,IAAI,CAAA;KAAE,KAAK,YAAY,CAAA;CACpF,GACD;IACE,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAC1B,cAAc,IAAI,IAAI,CAAA;QACtB,QAAQ,IAAI,IAAI,CAAA;QAChB,OAAO,EAAE,OAAO,CAAA;KACjB,KAAK,YAAY,CAAA;CACnB,CACJ,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { Editor } from 'slate';
2
+ export type Relationships = Record<string, {
3
+ listKey: string;
4
+ label: string;
5
+ labelField: string | null;
6
+ /** GraphQL fields to select when querying the field */
7
+ selection: string | null;
8
+ }>;
9
+ export declare function withRelationship(editor: Editor): Editor;
10
+ //# sourceMappingURL=relationship-shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationship-shared.d.ts","sourceRoot":"../../../../../../src/document-editor/toolset/relationship","sources":["relationship-shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEnC,MAAM,MAAM,aAAa,GAAG,MAAM,CAChC,MAAM,EACN;IACE,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,uDAAuD;IACvD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB,CACF,CAAA;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKvD"}
@@ -0,0 +1,7 @@
1
+ import document from "./views/document.js";
2
+ import type DocumentFieldConfig from "./types/DocumentFieldConfig.js";
3
+ export { document };
4
+ export type { DocumentFieldConfig };
5
+ export type { Node } from "./validation/structure-validation.js";
6
+ export { structure } from "./structure/structure.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"../../../src","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,4BAAwB;AACvC,OAAO,KAAK,mBAAmB,uCAAmC;AAElE,OAAO,EAAE,QAAQ,EAAE,CAAA;AACnB,YAAY,EAAE,mBAAmB,EAAE,CAAA;AACnC,YAAY,EAAE,IAAI,EAAE,6CAAyC;AAC7D,OAAO,EAAE,SAAS,EAAE,iCAA6B"}
@@ -0,0 +1,46 @@
1
+ export declare const componentBlocks: {
2
+ quoteBlock: import("../component-blocks.js").ComponentBlock<{
3
+ content: import("../component-blocks.js").ChildField;
4
+ attribution: import("../component-blocks.js").ChildField;
5
+ }>;
6
+ carousel: import("../component-blocks.js").ComponentBlock<{
7
+ items: import("../component-blocks.js").ArrayField<{
8
+ kind: "object";
9
+ fields: {
10
+ title: import("../component-blocks.js").FormField<string, undefined>;
11
+ imageSrc: import("../component-blocks.js").FormField<string, undefined>;
12
+ };
13
+ }>;
14
+ }>;
15
+ callout: import("../component-blocks.js").ComponentBlock<{
16
+ tone: import("../component-blocks.js").FormField<"critical" | "positive" | "caution" | "info", readonly ({
17
+ readonly value: "info";
18
+ readonly label: "消息";
19
+ } | {
20
+ readonly value: "caution";
21
+ readonly label: "警告";
22
+ } | {
23
+ readonly value: "positive";
24
+ readonly label: "成功";
25
+ } | {
26
+ readonly value: "critical";
27
+ readonly label: "错误";
28
+ })[]>;
29
+ content: import("../component-blocks.js").ChildField;
30
+ }>;
31
+ Image: import("../component-blocks.js").ComponentBlock<{
32
+ webImageUrl: import("../component-blocks.js").FormField<string, undefined>;
33
+ uploadedImageUrl: import("../component-blocks.js").FormField<string, undefined>;
34
+ caption: import("../component-blocks.js").ConditionalField<import("../component-blocks.js").FormField<boolean, undefined>, {
35
+ false: {
36
+ kind: "form";
37
+ Input(): null;
38
+ options: undefined;
39
+ defaultValue: null;
40
+ validate(value: unknown): value is null | undefined;
41
+ };
42
+ true: import("../component-blocks.js").ChildField;
43
+ }>;
44
+ }>;
45
+ };
46
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"../../../../src/my-component-blocks","sources":["index.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAK3B,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { CellComponent } from 'lkb-core/types';
2
+ import type controller from "./controller.js";
3
+ declare const Cell: CellComponent<typeof controller>;
4
+ export default Cell;
5
+ //# sourceMappingURL=Cell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cell.d.ts","sourceRoot":"../../../../src/structure","sources":["Cell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,UAAU,wBAAoB;AAI1C,QAAA,MAAM,IAAI,EAAE,aAAa,CAAC,OAAO,UAAU,CAE1C,CAAA;AAED,eAAe,IAAI,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { FieldProps } from 'lkb-core/types';
2
+ import type controller from "./controller.js";
3
+ declare function Field({ field, value, onChange, autoFocus, forceValidation, }: FieldProps<typeof controller>): import("react/jsx-runtime").JSX.Element;
4
+ export default Field;
5
+ //# sourceMappingURL=Field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"../../../../src/structure","sources":["Field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAKhD,OAAO,KAAK,UAAU,wBAAoB;AAE1C,iBAAS,KAAK,CAAC,EACb,KAAK,EACL,KAAK,EACL,QAAQ,EACR,SAAS,EACT,eAAe,GAChB,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,2CA4B/B;AAED,eAAe,KAAK,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { FieldController, FieldControllerConfig } from 'lkb-core/types';
2
+ import type { ComponentSchema } from "../document-editor/component-blocks/api.js";
3
+ declare function controller(config: FieldControllerConfig): FieldController<{
4
+ kind: 'create' | 'update';
5
+ value: unknown;
6
+ }> & {
7
+ schema: ComponentSchema;
8
+ };
9
+ export default controller;
10
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"../../../../src/structure","sources":["controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAE5E,OAAO,KAAK,EAAE,eAAe,EAAE,mDAA+C;AAI9E,iBAAS,UAAU,CAAC,MAAM,EAAE,qBAAqB,GAAG,eAAe,CAAC;IAClE,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAA;IACzB,KAAK,EAAE,OAAO,CAAA;CACf,CAAC,GAAG;IACH,MAAM,EAAE,eAAe,CAAA;CACxB,CAyBA;AAED,eAAe,UAAU,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { type BaseListTypeInfo, type FieldTypeFunc } from 'lkb-core/types';
2
+ import type { StructureFieldConfig } from "../types/StructureFieldConfig.js";
3
+ export declare function structure<ListTypeInfo extends BaseListTypeInfo>({ schema, ...config }: StructureFieldConfig<ListTypeInfo>): FieldTypeFunc<ListTypeInfo>;
4
+ //# sourceMappingURL=structure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structure.d.ts","sourceRoot":"../../../../src/structure","sources":["structure.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAGnB,MAAM,gBAAgB,CAAA;AAavB,OAAO,KAAK,EAAE,oBAAoB,EAAE,yCAAqC;AAEzE,wBAAgB,SAAS,CAAC,YAAY,SAAS,gBAAgB,EAAE,EAC/D,MAAM,EACN,GAAG,MAAM,EACV,EAAE,oBAAoB,CAAC,YAAY,CAAC,GAAG,aAAa,CAAC,YAAY,CAAC,CA+GlE"}
@@ -0,0 +1,5 @@
1
+ export { default as controller } from "./structure/controller.js";
2
+ export { default as Field } from "./structure/Field.js";
3
+ export { default as Cell } from "./structure/Cell.js";
4
+ export declare const allowedExportsOnCustomViews: string[];
5
+ //# sourceMappingURL=structure-views.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structure-views.d.ts","sourceRoot":"../../../src","sources":["structure-views.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,kCAA8B;AAE9D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,6BAAyB;AACpD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,4BAAwB;AAElD,eAAO,MAAM,2BAA2B,UAAa,CAAA"}
@@ -0,0 +1,33 @@
1
+ type DocumentFeatures = {
2
+ formatting: {
3
+ inlineMarks: {
4
+ bold: boolean;
5
+ italic: boolean;
6
+ underline: boolean;
7
+ strikethrough: boolean;
8
+ code: boolean;
9
+ superscript: boolean;
10
+ subscript: boolean;
11
+ keyboard: boolean;
12
+ };
13
+ listTypes: {
14
+ ordered: boolean;
15
+ unordered: boolean;
16
+ };
17
+ alignment: {
18
+ center: boolean;
19
+ end: boolean;
20
+ };
21
+ headingLevels: (1 | 2 | 3 | 4 | 5 | 6)[];
22
+ blockTypes: {
23
+ blockquote: boolean;
24
+ code: boolean;
25
+ };
26
+ softBreaks: boolean;
27
+ };
28
+ links: boolean;
29
+ dividers: boolean;
30
+ layouts: [number, ...number[]][];
31
+ };
32
+ export default DocumentFeatures;
33
+ //# sourceMappingURL=DocumentFeatures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentFeatures.d.ts","sourceRoot":"../../../../src/types","sources":["DocumentFeatures.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE;QACV,WAAW,EAAE;YACX,IAAI,EAAE,OAAO,CAAA;YACb,MAAM,EAAE,OAAO,CAAA;YACf,SAAS,EAAE,OAAO,CAAA;YAClB,aAAa,EAAE,OAAO,CAAA;YACtB,IAAI,EAAE,OAAO,CAAA;YACb,WAAW,EAAE,OAAO,CAAA;YACpB,SAAS,EAAE,OAAO,CAAA;YAClB,QAAQ,EAAE,OAAO,CAAA;SAClB,CAAA;QACD,SAAS,EAAE;YACT,OAAO,EAAE,OAAO,CAAA;YAChB,SAAS,EAAE,OAAO,CAAA;SACnB,CAAA;QACD,SAAS,EAAE;YACT,MAAM,EAAE,OAAO,CAAA;YACf,GAAG,EAAE,OAAO,CAAA;SACb,CAAA;QACD,aAAa,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAA;QACxC,UAAU,EAAE;YACV,UAAU,EAAE,OAAO,CAAA;YACnB,IAAI,EAAE,OAAO,CAAA;SACd,CAAA;QACD,UAAU,EAAE,OAAO,CAAA;KACpB,CAAA;IACD,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,CAAA;CACjC,CAAA;AAED,eAAe,gBAAgB,CAAA"}
@@ -0,0 +1,18 @@
1
+ import type { BaseFieldTypeInfo, BaseListTypeInfo, CommonFieldConfig } from 'lkb-core/types';
2
+ import type { ComponentBlock } from "../document-editor/component-blocks/types.js";
3
+ import type RelationshipsConfig from "./RelationshipsConfig.js";
4
+ import type FormattingConfig from "./FormattingConfig.js";
5
+ type DocumentFieldConfig<ListTypeInfo extends BaseListTypeInfo> = CommonFieldConfig<ListTypeInfo, BaseFieldTypeInfo> & {
6
+ relationships?: RelationshipsConfig;
7
+ componentBlocks?: Record<string, ComponentBlock>;
8
+ formatting?: boolean | FormattingConfig;
9
+ links?: boolean;
10
+ dividers?: boolean;
11
+ layouts?: readonly (readonly [number, ...number[]])[];
12
+ db?: {
13
+ map?: string;
14
+ extendPrismaSchema?: (field: string) => string;
15
+ };
16
+ };
17
+ export default DocumentFieldConfig;
18
+ //# sourceMappingURL=DocumentFieldConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentFieldConfig.d.ts","sourceRoot":"../../../../src/types","sources":["DocumentFieldConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAC5F,OAAO,KAAK,EAAE,cAAc,EAAE,qDAAiD;AAC/E,OAAO,KAAK,mBAAmB,iCAA6B;AAC5D,OAAO,KAAK,gBAAgB,8BAA0B;AAEtD,KAAK,mBAAmB,CAAC,YAAY,SAAS,gBAAgB,IAAI,iBAAiB,CACjF,YAAY,EACZ,iBAAiB,CAClB,GAAG;IACF,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAChD,UAAU,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAA;IACvC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC,EAAE,CAAA;IACrD,EAAE,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;KAAE,CAAA;CACtE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -0,0 +1,28 @@
1
+ type FormattingConfig = {
2
+ inlineMarks?: boolean | {
3
+ bold?: boolean;
4
+ italic?: boolean;
5
+ underline?: boolean;
6
+ strikethrough?: boolean;
7
+ code?: boolean;
8
+ superscript?: boolean;
9
+ subscript?: boolean;
10
+ keyboard?: boolean;
11
+ };
12
+ listTypes?: boolean | {
13
+ ordered?: boolean;
14
+ unordered?: boolean;
15
+ };
16
+ alignment?: boolean | {
17
+ center?: boolean;
18
+ end?: boolean;
19
+ };
20
+ headingLevels?: boolean | readonly (1 | 2 | 3 | 4 | 5 | 6)[];
21
+ blockTypes?: boolean | {
22
+ blockquote?: boolean;
23
+ code?: boolean;
24
+ };
25
+ softBreaks?: boolean;
26
+ };
27
+ export default FormattingConfig;
28
+ //# sourceMappingURL=FormattingConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormattingConfig.d.ts","sourceRoot":"../../../../src/types","sources":["FormattingConfig.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GAAG;IACtB,WAAW,CAAC,EACR,OAAO,GACP;QACE,IAAI,CAAC,EAAE,OAAO,CAAA;QACd,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,aAAa,CAAC,EAAE,OAAO,CAAA;QACvB,IAAI,CAAC,EAAE,OAAO,CAAA;QACd,WAAW,CAAC,EAAE,OAAO,CAAA;QACrB,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,CAAA;IACL,SAAS,CAAC,EACN,OAAO,GACP;QACE,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB,CAAA;IACL,SAAS,CAAC,EACN,OAAO,GACP;QACE,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,GAAG,CAAC,EAAE,OAAO,CAAA;KACd,CAAA;IACL,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAA;IAC5D,UAAU,CAAC,EACP,OAAO,GACP;QACE,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,IAAI,CAAC,EAAE,OAAO,CAAA;KACf,CAAA;IACL,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,eAAe,gBAAgB,CAAA"}
@@ -0,0 +1,9 @@
1
+ type RelationshipsConfig = Record<string, {
2
+ listKey: string;
3
+ label: string;
4
+ labelField?: string;
5
+ /** GraphQL fields to select when querying the field */
6
+ selection?: string;
7
+ }>;
8
+ export default RelationshipsConfig;
9
+ //# sourceMappingURL=RelationshipsConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelationshipsConfig.d.ts","sourceRoot":"../../../../src/types","sources":["RelationshipsConfig.ts"],"names":[],"mappings":"AAAA,KAAK,mBAAmB,GAAG,MAAM,CAC/B,MAAM,EACN;IACE,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CACF,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { BaseFieldTypeInfo } from 'lkb-core/types';
2
+ import { type BaseListTypeInfo, type CommonFieldConfig } from 'lkb-core/types';
3
+ import type { ComponentSchema } from "../document-editor/component-blocks/api.js";
4
+ export type StructureFieldConfig<ListTypeInfo extends BaseListTypeInfo> = CommonFieldConfig<ListTypeInfo, BaseFieldTypeInfo> & {
5
+ db?: {
6
+ map?: string;
7
+ };
8
+ schema: ComponentSchema;
9
+ };
10
+ //# sourceMappingURL=StructureFieldConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StructureFieldConfig.d.ts","sourceRoot":"../../../../src/types","sources":["StructureFieldConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,mDAA+C;AAE9E,MAAM,MAAM,oBAAoB,CAAC,YAAY,SAAS,gBAAgB,IAAI,iBAAiB,CACzF,YAAY,EACZ,iBAAiB,CAClB,GAAG;IACF,EAAE,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACrB,MAAM,EAAE,eAAe,CAAA;CACxB,CAAA"}