@puckeditor/field-contentful 0.24.0-canary.fcfd4b94 → 0.24.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) The Puck Contributors.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.mts CHANGED
@@ -182,6 +182,7 @@ interface PuckRichTextOptions {
182
182
  underline: Partial<UnderlineOptions> | false;
183
183
  }
184
184
 
185
+ type FieldGroupVariant = "flush" | "card";
185
186
  type FieldOption = {
186
187
  label: string;
187
188
  value: string | number | boolean | undefined | null | object;
@@ -218,6 +219,10 @@ interface RadioField extends BaseField {
218
219
  type: "radio";
219
220
  options: FieldOptions;
220
221
  }
222
+ interface CheckboxField extends BaseField {
223
+ type: "checkbox";
224
+ options: FieldOptions;
225
+ }
221
226
  interface RichtextField<UserSelector extends RichTextSelector = RichTextSelector> extends BaseField {
222
227
  type: "richtext";
223
228
  contentEditable?: boolean;
@@ -260,6 +265,9 @@ interface ObjectField<Props extends any = {
260
265
  [key: string]: any;
261
266
  }, UserField extends {} = {}> extends BaseField {
262
267
  type: "object";
268
+ collapsible?: boolean;
269
+ defaultExpanded?: boolean;
270
+ variant?: FieldGroupVariant;
263
271
  objectFields: {
264
272
  [SubPropName in keyof Props]: UserField extends {
265
273
  type: PropertyKey;
@@ -324,7 +332,7 @@ interface SlotField extends BaseField {
324
332
  allow?: string[];
325
333
  disallow?: string[];
326
334
  }
327
- type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
335
+ type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | CheckboxField | ArrayField<ValueType extends {
328
336
  [key: string]: any;
329
337
  }[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
330
338
 
@@ -369,10 +377,13 @@ type UiState = {
369
377
  controlsVisible: boolean;
370
378
  options: Viewport[];
371
379
  };
380
+ expandedFieldGroups: Record<string, boolean>;
372
381
  field: {
373
382
  focus?: string | null;
374
383
  metadata?: Record<string, any>;
375
384
  };
385
+ /** The selected field tab. Shows the first available tab when `null`. */
386
+ fieldTab?: string | number | null;
376
387
  plugin: {
377
388
  current: string | null;
378
389
  };
package/dist/index.d.ts CHANGED
@@ -182,6 +182,7 @@ interface PuckRichTextOptions {
182
182
  underline: Partial<UnderlineOptions> | false;
183
183
  }
184
184
 
185
+ type FieldGroupVariant = "flush" | "card";
185
186
  type FieldOption = {
186
187
  label: string;
187
188
  value: string | number | boolean | undefined | null | object;
@@ -218,6 +219,10 @@ interface RadioField extends BaseField {
218
219
  type: "radio";
219
220
  options: FieldOptions;
220
221
  }
222
+ interface CheckboxField extends BaseField {
223
+ type: "checkbox";
224
+ options: FieldOptions;
225
+ }
221
226
  interface RichtextField<UserSelector extends RichTextSelector = RichTextSelector> extends BaseField {
222
227
  type: "richtext";
223
228
  contentEditable?: boolean;
@@ -260,6 +265,9 @@ interface ObjectField<Props extends any = {
260
265
  [key: string]: any;
261
266
  }, UserField extends {} = {}> extends BaseField {
262
267
  type: "object";
268
+ collapsible?: boolean;
269
+ defaultExpanded?: boolean;
270
+ variant?: FieldGroupVariant;
263
271
  objectFields: {
264
272
  [SubPropName in keyof Props]: UserField extends {
265
273
  type: PropertyKey;
@@ -324,7 +332,7 @@ interface SlotField extends BaseField {
324
332
  allow?: string[];
325
333
  disallow?: string[];
326
334
  }
327
- type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
335
+ type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | CheckboxField | ArrayField<ValueType extends {
328
336
  [key: string]: any;
329
337
  }[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
330
338
 
@@ -369,10 +377,13 @@ type UiState = {
369
377
  controlsVisible: boolean;
370
378
  options: Viewport[];
371
379
  };
380
+ expandedFieldGroups: Record<string, boolean>;
372
381
  field: {
373
382
  focus?: string | null;
374
383
  metadata?: Record<string, any>;
375
384
  };
385
+ /** The selected field tab. Shows the first available tab when `null`. */
386
+ fieldTab?: string | number | null;
376
387
  plugin: {
377
388
  current: string | null;
378
389
  };
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@puckeditor/field-contentful",
3
- "version": "0.24.0-canary.fcfd4b94",
3
+ "version": "0.24.0",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
- "repository": "puckeditor/puck",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "puckeditor/puck"
8
+ },
6
9
  "bugs": "https://github.com/puckeditor/puck/issues",
7
10
  "homepage": "https://puckeditor.com",
8
11
  "private": false,
@@ -13,27 +16,27 @@
13
16
  "types": "./dist/index.d.ts"
14
17
  },
15
18
  "license": "MIT",
16
- "scripts": {
17
- "lint": "eslint \"**/*.ts*\"",
18
- "build": "rm -rf dist && tsup index.ts",
19
- "prepare": "yarn build"
20
- },
21
19
  "files": [
22
20
  "dist"
23
21
  ],
24
22
  "devDependencies": {
25
- "@puckeditor/core": "^0.24.0-canary.fcfd4b94",
23
+ "@puckeditor/core": "^0.24.0",
26
24
  "@types/react": "^19.2.7",
27
25
  "@types/react-dom": "^19.2.3",
28
26
  "contentful": "^10.8.6",
29
27
  "eslint": "^9.0.0",
30
- "eslint-config-custom": "*",
31
- "tsconfig": "*",
32
- "tsup-config": "*",
28
+ "eslint-config-custom": "0.0.0",
29
+ "tsconfig": "0.0.0",
30
+ "tsup": "^8.2.4",
31
+ "tsup-config": "0.0.0",
33
32
  "typescript": "^5.5.4"
34
33
  },
35
34
  "peerDependencies": {
36
35
  "contentful": "^10.0.0",
37
36
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0"
37
+ },
38
+ "scripts": {
39
+ "lint": "eslint \"**/*.ts*\"",
40
+ "build": "rm -rf dist && tsup index.ts"
38
41
  }
39
- }
42
+ }