@puckeditor/field-contentful 0.21.2-canary.edc81920 → 0.21.2
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.mts +56 -1
- package/dist/index.d.ts +56 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -17,6 +17,11 @@ import { UnderlineOptions } from '@tiptap/extension-underline';
|
|
|
17
17
|
import { BaseEntry, ContentfulClientApi } from 'contentful';
|
|
18
18
|
export { createClient } from 'contentful';
|
|
19
19
|
|
|
20
|
+
type ItemSelector = {
|
|
21
|
+
index: number;
|
|
22
|
+
zone?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
20
25
|
declare const defaultEditorState: (ctx: EditorStateSnapshot, readOnly: boolean) => {
|
|
21
26
|
isAlignLeft?: undefined;
|
|
22
27
|
canAlignLeft?: undefined;
|
|
@@ -305,7 +310,7 @@ type CustomFieldRender<Value extends any> = (props: {
|
|
|
305
310
|
name: string;
|
|
306
311
|
id: string;
|
|
307
312
|
value: Value;
|
|
308
|
-
onChange: (value: Value) => void;
|
|
313
|
+
onChange: (value: Value, uiState?: Partial<UiState>) => void;
|
|
309
314
|
readOnly?: boolean;
|
|
310
315
|
}) => ReactElement;
|
|
311
316
|
interface CustomField<Value extends any> extends BaseField {
|
|
@@ -329,6 +334,56 @@ type Metadata = {
|
|
|
329
334
|
interface FieldMetadata extends Metadata {
|
|
330
335
|
}
|
|
331
336
|
|
|
337
|
+
type ItemWithId = {
|
|
338
|
+
_arrayId: string;
|
|
339
|
+
_originalIndex: number;
|
|
340
|
+
_currentIndex: number;
|
|
341
|
+
};
|
|
342
|
+
type ArrayState = {
|
|
343
|
+
items: ItemWithId[];
|
|
344
|
+
openId: string;
|
|
345
|
+
};
|
|
346
|
+
type UiState = {
|
|
347
|
+
leftSideBarVisible: boolean;
|
|
348
|
+
rightSideBarVisible: boolean;
|
|
349
|
+
leftSideBarWidth?: number | null;
|
|
350
|
+
rightSideBarWidth?: number | null;
|
|
351
|
+
mobilePanelExpanded?: boolean;
|
|
352
|
+
itemSelector: ItemSelector | null;
|
|
353
|
+
arrayState: Record<string, ArrayState | undefined>;
|
|
354
|
+
previewMode: "interactive" | "edit";
|
|
355
|
+
componentList: Record<string, {
|
|
356
|
+
components?: string[];
|
|
357
|
+
title?: string;
|
|
358
|
+
visible?: boolean;
|
|
359
|
+
expanded?: boolean;
|
|
360
|
+
}>;
|
|
361
|
+
isDragging: boolean;
|
|
362
|
+
viewports: {
|
|
363
|
+
current: {
|
|
364
|
+
width: number | "100%";
|
|
365
|
+
height: number | "auto";
|
|
366
|
+
};
|
|
367
|
+
controlsVisible: boolean;
|
|
368
|
+
options: Viewport[];
|
|
369
|
+
};
|
|
370
|
+
field: {
|
|
371
|
+
focus?: string | null;
|
|
372
|
+
metadata?: Record<string, any>;
|
|
373
|
+
};
|
|
374
|
+
plugin: {
|
|
375
|
+
current: string | null;
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
type iconTypes = "Smartphone" | "Monitor" | "Tablet";
|
|
380
|
+
type Viewport = {
|
|
381
|
+
width: number | "100%";
|
|
382
|
+
height?: number | "auto";
|
|
383
|
+
label?: string;
|
|
384
|
+
icon?: iconTypes | ReactNode;
|
|
385
|
+
};
|
|
386
|
+
|
|
332
387
|
type Entry<Fields extends Record<string, any> = {}> = BaseEntry & {
|
|
333
388
|
fields: Fields;
|
|
334
389
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ import { UnderlineOptions } from '@tiptap/extension-underline';
|
|
|
17
17
|
import { BaseEntry, ContentfulClientApi } from 'contentful';
|
|
18
18
|
export { createClient } from 'contentful';
|
|
19
19
|
|
|
20
|
+
type ItemSelector = {
|
|
21
|
+
index: number;
|
|
22
|
+
zone?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
20
25
|
declare const defaultEditorState: (ctx: EditorStateSnapshot, readOnly: boolean) => {
|
|
21
26
|
isAlignLeft?: undefined;
|
|
22
27
|
canAlignLeft?: undefined;
|
|
@@ -305,7 +310,7 @@ type CustomFieldRender<Value extends any> = (props: {
|
|
|
305
310
|
name: string;
|
|
306
311
|
id: string;
|
|
307
312
|
value: Value;
|
|
308
|
-
onChange: (value: Value) => void;
|
|
313
|
+
onChange: (value: Value, uiState?: Partial<UiState>) => void;
|
|
309
314
|
readOnly?: boolean;
|
|
310
315
|
}) => ReactElement;
|
|
311
316
|
interface CustomField<Value extends any> extends BaseField {
|
|
@@ -329,6 +334,56 @@ type Metadata = {
|
|
|
329
334
|
interface FieldMetadata extends Metadata {
|
|
330
335
|
}
|
|
331
336
|
|
|
337
|
+
type ItemWithId = {
|
|
338
|
+
_arrayId: string;
|
|
339
|
+
_originalIndex: number;
|
|
340
|
+
_currentIndex: number;
|
|
341
|
+
};
|
|
342
|
+
type ArrayState = {
|
|
343
|
+
items: ItemWithId[];
|
|
344
|
+
openId: string;
|
|
345
|
+
};
|
|
346
|
+
type UiState = {
|
|
347
|
+
leftSideBarVisible: boolean;
|
|
348
|
+
rightSideBarVisible: boolean;
|
|
349
|
+
leftSideBarWidth?: number | null;
|
|
350
|
+
rightSideBarWidth?: number | null;
|
|
351
|
+
mobilePanelExpanded?: boolean;
|
|
352
|
+
itemSelector: ItemSelector | null;
|
|
353
|
+
arrayState: Record<string, ArrayState | undefined>;
|
|
354
|
+
previewMode: "interactive" | "edit";
|
|
355
|
+
componentList: Record<string, {
|
|
356
|
+
components?: string[];
|
|
357
|
+
title?: string;
|
|
358
|
+
visible?: boolean;
|
|
359
|
+
expanded?: boolean;
|
|
360
|
+
}>;
|
|
361
|
+
isDragging: boolean;
|
|
362
|
+
viewports: {
|
|
363
|
+
current: {
|
|
364
|
+
width: number | "100%";
|
|
365
|
+
height: number | "auto";
|
|
366
|
+
};
|
|
367
|
+
controlsVisible: boolean;
|
|
368
|
+
options: Viewport[];
|
|
369
|
+
};
|
|
370
|
+
field: {
|
|
371
|
+
focus?: string | null;
|
|
372
|
+
metadata?: Record<string, any>;
|
|
373
|
+
};
|
|
374
|
+
plugin: {
|
|
375
|
+
current: string | null;
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
type iconTypes = "Smartphone" | "Monitor" | "Tablet";
|
|
380
|
+
type Viewport = {
|
|
381
|
+
width: number | "100%";
|
|
382
|
+
height?: number | "auto";
|
|
383
|
+
label?: string;
|
|
384
|
+
icon?: iconTypes | ReactNode;
|
|
385
|
+
};
|
|
386
|
+
|
|
332
387
|
type Entry<Fields extends Record<string, any> = {}> = BaseEntry & {
|
|
333
388
|
fields: Fields;
|
|
334
389
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puckeditor/field-contentful",
|
|
3
|
-
"version": "0.21.2
|
|
3
|
+
"version": "0.21.2",
|
|
4
4
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
5
5
|
"repository": "puckeditor/puck",
|
|
6
6
|
"bugs": "https://github.com/puckeditor/puck/issues",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@puckeditor/core": "^0.21.2
|
|
25
|
+
"@puckeditor/core": "^0.21.2",
|
|
26
26
|
"@types/react": "^19.2.7",
|
|
27
27
|
"@types/react-dom": "^19.2.3",
|
|
28
28
|
"contentful": "^10.8.6",
|