@platecms/delta-client 1.2.0 → 1.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platecms/delta-client",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Utilities and functions to interact with the Delta CMS.",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
@@ -18,11 +18,9 @@
18
18
  "src/**/*"
19
19
  ],
20
20
  "peerDependencies": {
21
- "@platecms/delta-cast": "1.2.0",
21
+ "@platecms/delta-cast": "1.3.0",
22
22
  "@graphql-typed-document-node/core": "3.2.0",
23
23
  "graphql": "16.11.0",
24
- "slate": "0.118.0",
25
- "slate-react": "0.117.4",
26
24
  "tslib": "2.8.1",
27
25
  "class-transformer": "0.5.1",
28
26
  "reflect-metadata": "0.2.2",
@@ -20,7 +20,7 @@ export type Scalars = {
20
20
  ContentValueType: { input: any; output: any; }
21
21
  /** A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. */
22
22
  DateTime: { input: any; output: any; }
23
- /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
23
+ /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf). */
24
24
  JSON: { input: any; output: any; }
25
25
  /** A string representing the PRN object. Must match '^prn(:[A-Za-z0-9-_]+){5}$'. */
26
26
  PRN: { input: any; output: any; }
@@ -87,6 +87,8 @@ export type AssetProcessedUrlsArgs = {
87
87
  export type Blueprint = {
88
88
  __typename?: 'Blueprint';
89
89
  channel: Channel;
90
+ /** The ID of the Channel this Blueprint belongs to. */
91
+ channelId?: Maybe<Scalars['String']['output']>;
90
92
  createdAt: Scalars['DateTime']['output'];
91
93
  /** The Experience Component which defines this Blueprint. */
92
94
  definedBy: ExperienceComponent;
@@ -115,6 +117,7 @@ export type BlueprintsConnection = {
115
117
  /** The filter input type for 'Blueprints'. Objects/maps are treated as AND, while arrays are treated as OR. */
116
118
  export type BlueprintsFilterInput = {
117
119
  _not?: InputMaybe<Array<BlueprintsFilterInput>>;
120
+ channelId?: InputMaybe<Array<StringFilter>>;
118
121
  createdAt?: InputMaybe<Array<DateFilter>>;
119
122
  isFixed?: InputMaybe<Array<BooleanFilter>>;
120
123
  name?: InputMaybe<Array<StringFilter>>;
@@ -260,15 +263,6 @@ export type BuildingBlocksFilterInput = {
260
263
  updatedAt?: InputMaybe<Array<DateFilter>>;
261
264
  };
262
265
 
263
- export type CasDatabaseTextMatch = {
264
- __typename?: 'CasDatabaseTextMatch';
265
- confidence: Scalars['Float']['output'];
266
- contentValue: ContentValue;
267
- endIndex: Scalars['Int']['output'];
268
- extractionMethod: Scalars['String']['output'];
269
- startIndex: Scalars['Int']['output'];
270
- };
271
-
272
266
  export type CasImageContentValueMatch = {
273
267
  __typename?: 'CasImageContentValueMatch';
274
268
  similarContentValue: ContentValue;
@@ -280,10 +274,20 @@ export type CasRegexSuggestion = {
280
274
  __typename?: 'CasRegexSuggestion';
281
275
  confidence: Scalars['Float']['output'];
282
276
  endIndex: Scalars['Int']['output'];
283
- extractionMethod: Scalars['String']['output'];
277
+ method: Scalars['String']['output'];
284
278
  startIndex: Scalars['Int']['output'];
285
279
  };
286
280
 
281
+ export type CastSuggestion = {
282
+ __typename?: 'CastSuggestion';
283
+ endIndex: Scalars['Int']['output'];
284
+ message: Scalars['String']['output'];
285
+ method: Scalars['String']['output'];
286
+ original: Array<Content>;
287
+ startIndex: Scalars['Int']['output'];
288
+ suggested: InterpolatedContentValue;
289
+ };
290
+
287
291
  export type Channel = {
288
292
  __typename?: 'Channel';
289
293
  apiTokens: Array<ApiToken>;
@@ -335,8 +339,17 @@ export type ConnectContentValueInput = {
335
339
  contentValue: Scalars['PRN']['input'];
336
340
  };
337
341
 
342
+ export type Content = {
343
+ __typename?: 'Content';
344
+ children?: Maybe<Array<Content>>;
345
+ type: Scalars['String']['output'];
346
+ value?: Maybe<Scalars['JSON']['output']>;
347
+ };
348
+
338
349
  export type ContentExperience = {
339
350
  __typename?: 'ContentExperience';
351
+ /** The ID of the Channel this ContentExperience belongs to. */
352
+ channelId?: Maybe<Scalars['String']['output']>;
340
353
  createdAt: Scalars['DateTime']['output'];
341
354
  experienceComponent: ExperienceComponent;
342
355
  /** The issues that this Content Experience is a subject of */
@@ -383,6 +396,7 @@ export type ContentExperiencesConnection = {
383
396
  /** The filter input type for 'ContentExperiences'. Objects/maps are treated as AND, while arrays are treated as OR. */
384
397
  export type ContentExperiencesFilterInput = {
385
398
  _not?: InputMaybe<Array<ContentExperiencesFilterInput>>;
399
+ channelId?: InputMaybe<Array<StringFilter>>;
386
400
  createdAt?: InputMaybe<Array<DateFilter>>;
387
401
  prn?: InputMaybe<Array<PrnFilter>>;
388
402
  seoDescription?: InputMaybe<Array<StringFilter>>;
@@ -653,7 +667,8 @@ export enum ContentValueTypeNames {
653
667
  PathPart = 'PATH_PART',
654
668
  SmartText = 'SMART_TEXT',
655
669
  String = 'STRING',
656
- Tag = 'TAG'
670
+ Tag = 'TAG',
671
+ Unknown = 'UNKNOWN'
657
672
  }
658
673
 
659
674
  export type ContentValuesConnection = {
@@ -761,16 +776,20 @@ export type CreateBuildingBlockFieldForBuildingBlockInput = {
761
776
 
762
777
  export type CreateBuildingBlockFieldFulfillmentForExperienceComponentInput = {
763
778
  buildingBlockField: Scalars['PRN']['input'];
764
- /** The PRNs of the Content Value which this BuildingBlockFieldFulfillment is filled by. */
765
- contentValue: Scalars['PRN']['input'];
779
+ /** The PRN of the Content Value which this BuildingBlockFieldFulfillment is filled by. */
780
+ contentValueToConnect?: InputMaybe<Scalars['PRN']['input']>;
781
+ /** Create a new Content Value for this Building Block Field Fulfillment. Exactly one of contentValue or createContentValue must be provided. */
782
+ contentValueToCreate?: InputMaybe<CreateContentValueInput>;
766
783
  /** The PRN of the BuildingBlockFieldFulfillment that this BuildingBlockFieldFulfillment should manually be sorted after. Null means it should be the last. */
767
784
  next?: InputMaybe<Scalars['PRN']['input']>;
768
785
  };
769
786
 
770
787
  export type CreateBuildingBlockFieldFulfillmentInput = {
771
788
  buildingBlockField: Scalars['PRN']['input'];
772
- /** The PRNs of the Content Value which this BuildingBlockFieldFulfillment is filled by. */
773
- contentValue: Scalars['PRN']['input'];
789
+ /** The PRN of the Content Value which this BuildingBlockFieldFulfillment is filled by. */
790
+ contentValueToConnect?: InputMaybe<Scalars['PRN']['input']>;
791
+ /** Create a new Content Value for this Building Block Field Fulfillment. Exactly one of contentValue or createContentValue must be provided. */
792
+ contentValueToCreate?: InputMaybe<CreateContentValueInput>;
774
793
  /** The PRN of the Experience Component which this Building Block Field Fulfillment fulfills. */
775
794
  experienceComponent: Scalars['PRN']['input'];
776
795
  /** The PRN of the BuildingBlockFieldFulfillment that this BuildingBlockFieldFulfillment should manually be sorted after. Null means it should be the last. */
@@ -936,8 +955,8 @@ export type CreateExperienceComponentInput = {
936
955
  buildingBlockFieldFulfillments: Array<CreateBuildingBlockFieldFulfillmentForExperienceComponentInput>;
937
956
  /** Must be set if the Building Block has a Grid Definition. */
938
957
  grid?: InputMaybe<CreateGridInput>;
939
- gridPlacement?: InputMaybe<CreateGridPlacementInput>;
940
- /** Whether the Experience Component is a draft. Drafts cannot be used in Grid Placements. */
958
+ gridPlacement?: InputMaybe<CreateGridPlacementForExperienceComponentInput>;
959
+ /** Whether the Experience Component is a draft. */
941
960
  isDraft: Scalars['Boolean']['input'];
942
961
  preview?: InputMaybe<Scalars['PRN']['input']>;
943
962
  };
@@ -947,8 +966,8 @@ export type CreateGlobalExperienceComponentInput = {
947
966
  buildingBlockFieldFulfillments: Array<CreateBuildingBlockFieldFulfillmentForExperienceComponentInput>;
948
967
  /** Must be set if the Building Block has a Grid Definition. */
949
968
  grid?: InputMaybe<CreateGridInput>;
950
- gridPlacement?: InputMaybe<CreateGridPlacementInput>;
951
- /** Whether the Experience Component is a draft. Drafts cannot be used in Grid Placements. */
969
+ gridPlacement?: InputMaybe<CreateGridPlacementForExperienceComponentInput>;
970
+ /** Whether the Experience Component is a draft. */
952
971
  isDraft: Scalars['Boolean']['input'];
953
972
  name: Scalars['String']['input'];
954
973
  preview?: InputMaybe<Scalars['PRN']['input']>;
@@ -967,6 +986,11 @@ export type CreateGridInput = {
967
986
  rows: Scalars['Int']['input'];
968
987
  };
969
988
 
989
+ export type CreateGridPlacementForExperienceComponentInput = {
990
+ grid: Scalars['PRN']['input'];
991
+ row: Scalars['Int']['input'];
992
+ };
993
+
970
994
  export type CreateGridPlacementInput = {
971
995
  /** The PRN of the Experience Component to place in this Grid Placement. */
972
996
  experienceComponent: Scalars['PRN']['input'];
@@ -1116,7 +1140,7 @@ export type ExperienceComponent = {
1116
1140
  grid?: Maybe<Grid>;
1117
1141
  /** The Grid Placements this Experience Component is placed in. */
1118
1142
  gridPlacements: Array<GridPlacement>;
1119
- /** Whether the Experience Component is a draft. Drafts cannot be used in Grid Placements. */
1143
+ /** Whether the Experience Component is a draft. */
1120
1144
  isDraft: Scalars['Boolean']['output'];
1121
1145
  isGlobal: Scalars['Boolean']['output'];
1122
1146
  /** The name of the Experience Component. Only applicable for global Experience Components. */
@@ -1320,6 +1344,13 @@ export type IntFilter = {
1320
1344
  _nin?: InputMaybe<Array<Scalars['Int']['input']>>;
1321
1345
  };
1322
1346
 
1347
+ export type InterpolatedContentValue = {
1348
+ __typename?: 'InterpolatedContentValue';
1349
+ prn: Scalars['PRN']['output'];
1350
+ type: Scalars['String']['output'];
1351
+ value: Scalars['CAST']['output'];
1352
+ };
1353
+
1323
1354
  export type Invitation = {
1324
1355
  __typename?: 'Invitation';
1325
1356
  createdAt: Scalars['DateTime']['output'];
@@ -1552,7 +1583,6 @@ export type Mutation = {
1552
1583
  * Removes one or many ContentFields.
1553
1584
  * Throws NotFoundException when no ContentField could be found.
1554
1585
  * Throws UnprocessableContentError when attempting to remove a Content Field outside of the DEVELOPMENT stage.
1555
- * Throws UnprocessableContentError when attempting to remove a Content Field that is being used by Content Values.
1556
1586
  * Throws BadRequestError when attempting to remove a Content Field that is being used in the displayNameTemplate of its Content Type.
1557
1587
  * Throws BadRequestError when attempting to remove a Content Field that is being used in the displayImageField of its Content Type.
1558
1588
  */
@@ -2334,6 +2364,8 @@ export type PathPart = {
2334
2364
  amountOfDescendantsWithContentExperiences: Scalars['Int']['output'];
2335
2365
  /** All Path Parts in a "family" (ancestors and decendents) are connected to the same Channel. This does not make sense semantically, but makes it much easier to access the Channel from any Path Part. */
2336
2366
  channel: Channel;
2367
+ /** The ID of the Channel this PathPart belongs to. */
2368
+ channelId?: Maybe<Scalars['String']['output']>;
2337
2369
  children: Array<PathPart>;
2338
2370
  contentExperience?: Maybe<ContentExperience>;
2339
2371
  createdAt: Scalars['DateTime']['output'];
@@ -2377,6 +2409,7 @@ export type PathPartsFilterInput = {
2377
2409
  amountOfChildrenWithContentExperiences?: InputMaybe<Array<IntFilter>>;
2378
2410
  amountOfDescendants?: InputMaybe<Array<IntFilter>>;
2379
2411
  amountOfDescendantsWithContentExperiences?: InputMaybe<Array<IntFilter>>;
2412
+ channelId?: InputMaybe<Array<StringFilter>>;
2380
2413
  createdAt?: InputMaybe<Array<DateFilter>>;
2381
2414
  hasContentExperience?: InputMaybe<Array<BooleanFilter>>;
2382
2415
  parentId?: InputMaybe<Array<StringFilter>>;
@@ -2443,16 +2476,10 @@ export type Query = {
2443
2476
  buildingBlockFieldFulfillments: BuildingBlockFieldFulfillmentsConnection;
2444
2477
  /** Orders and paginates all BuildingBlockFields. */
2445
2478
  buildingBlockFields: BuildingBlockFieldsConnection;
2446
- /** Detect CAST matches with database reusable entries. Matches are based on plaintext. */
2447
- casCastMatches?: Maybe<Scalars['CAST']['output']>;
2448
- /** Get similar image Content Values within the database. Use similarity score based on image hashes to find potential duplicates. */
2449
- casFindSimilarImageContentValues: Array<CasImageContentValueMatch>;
2450
- /** Get similar image Content Values within the database from an asset PRN input. Use similarity score based on image hashes to find potential duplicates. */
2451
- casFindSimilarImageContentValuesFromAsset: Array<CasImageContentValueMatch>;
2452
- /** Use predefined regex patterns to detect potentially reusable content in a string. */
2453
- casRegexSuggestions: Array<CasRegexSuggestion>;
2454
- /** Detect string matches with database reusable entries. */
2455
- casStringMatches: Array<CasDatabaseTextMatch>;
2479
+ /** Detect CAST matches with database reusable entries and return an array with the suggestions, Ordered by occurrence in the text. Matches are based on plaintext. */
2480
+ castSuggestions: Array<CastSuggestion>;
2481
+ /** Detect CAST matches with database reusable entries and return the CAST with suggestions inserted. Matches are based on plaintext. */
2482
+ castSuggestionsInRoot?: Maybe<Scalars['CAST']['output']>;
2456
2483
  /** Finds one or many Channels by PRN. Throws NotFoundException when no Channel could be found. */
2457
2484
  channel: Array<Channel>;
2458
2485
  /** Orders and paginates all Channels. */
@@ -2484,6 +2511,10 @@ export type Query = {
2484
2511
  experienceComponent: Array<ExperienceComponent>;
2485
2512
  /** Orders and paginates all ExperienceComponents. */
2486
2513
  experienceComponents: ExperienceComponentsConnection;
2514
+ /** Get similar image Content Values within the database. Use similarity score based on image hashes to find potential duplicates. */
2515
+ findSimilarImageContentValues: Array<CasImageContentValueMatch>;
2516
+ /** Get similar image Content Values within the database from an asset PRN input. Use similarity score based on image hashes to find potential duplicates. */
2517
+ findSimilarImageContentValuesFromAsset: Array<CasImageContentValueMatch>;
2487
2518
  /** Finds one or many Grids by PRN. Throws NotFoundException when no Grid could be found. */
2488
2519
  grid: Array<Grid>;
2489
2520
  /** Finds one or many GridDefinitions by PRN. Throws NotFoundException when no GridDefinition could be found. */
@@ -2513,6 +2544,8 @@ export type Query = {
2513
2544
  /** Orders and paginates all Path Parts. */
2514
2545
  pathParts: PathPartsConnection;
2515
2546
  plateMaintainers: Array<User>;
2547
+ /** Use predefined regex patterns to detect potentially reusable content in a string. */
2548
+ regexSuggestions: Array<CasRegexSuggestion>;
2516
2549
  /** Finds all RoleAssignments for the current Subject (e.g. the logged in user or API token) */
2517
2550
  roleAssignmentsForCurrentSubject: Array<RoleAssignment>;
2518
2551
  /** Finds all RoleAssignments for the given Organization */
@@ -2591,37 +2624,17 @@ export type QueryBuildingBlockFieldsArgs = {
2591
2624
  };
2592
2625
 
2593
2626
 
2594
- export type QueryCasCastMatchesArgs = {
2627
+ export type QueryCastSuggestionsArgs = {
2595
2628
  config?: InputMaybe<DatabaseTextMatchConfig>;
2596
2629
  inputCast: Scalars['CAST']['input'];
2597
- };
2598
-
2599
-
2600
- export type QueryCasFindSimilarImageContentValuesArgs = {
2601
- config?: InputMaybe<DuplicateImagesDetectionConfig>;
2602
- contentValuePrnString: Scalars['String']['input'];
2603
2630
  limit?: InputMaybe<Scalars['Int']['input']>;
2604
2631
  };
2605
2632
 
2606
2633
 
2607
- export type QueryCasFindSimilarImageContentValuesFromAssetArgs = {
2608
- assetPrnString: Scalars['String']['input'];
2609
- config?: InputMaybe<DuplicateImagesDetectionConfig>;
2610
- limit?: InputMaybe<Scalars['Int']['input']>;
2611
- };
2612
-
2613
-
2614
- export type QueryCasRegexSuggestionsArgs = {
2615
- config?: InputMaybe<RegexExtractionConfig>;
2616
- inputText: Scalars['String']['input'];
2617
- limit: Scalars['Int']['input'];
2618
- };
2619
-
2620
-
2621
- export type QueryCasStringMatchesArgs = {
2634
+ export type QueryCastSuggestionsInRootArgs = {
2622
2635
  config?: InputMaybe<DatabaseTextMatchConfig>;
2623
- inputText: Scalars['String']['input'];
2624
- limit: Scalars['Int']['input'];
2636
+ inputCast: Scalars['CAST']['input'];
2637
+ limit?: InputMaybe<Scalars['Int']['input']>;
2625
2638
  };
2626
2639
 
2627
2640
 
@@ -2638,6 +2651,7 @@ export type QueryChannelsArgs = {
2638
2651
 
2639
2652
 
2640
2653
  export type QueryContentExperienceArgs = {
2654
+ autoFetchFullContentExperience?: InputMaybe<Scalars['Boolean']['input']>;
2641
2655
  prn: Array<Scalars['PRN']['input']>;
2642
2656
  };
2643
2657
 
@@ -2714,6 +2728,20 @@ export type QueryExperienceComponentsArgs = {
2714
2728
  };
2715
2729
 
2716
2730
 
2731
+ export type QueryFindSimilarImageContentValuesArgs = {
2732
+ config?: InputMaybe<DuplicateImagesDetectionConfig>;
2733
+ contentValuePrnString: Scalars['String']['input'];
2734
+ limit?: InputMaybe<Scalars['Int']['input']>;
2735
+ };
2736
+
2737
+
2738
+ export type QueryFindSimilarImageContentValuesFromAssetArgs = {
2739
+ assetPrnString: Scalars['String']['input'];
2740
+ config?: InputMaybe<DuplicateImagesDetectionConfig>;
2741
+ limit?: InputMaybe<Scalars['Int']['input']>;
2742
+ };
2743
+
2744
+
2717
2745
  export type QueryGridArgs = {
2718
2746
  prn: Array<Scalars['PRN']['input']>;
2719
2747
  };
@@ -2780,6 +2808,13 @@ export type QueryPathPartsArgs = {
2780
2808
  };
2781
2809
 
2782
2810
 
2811
+ export type QueryRegexSuggestionsArgs = {
2812
+ config?: InputMaybe<RegexExtractionConfig>;
2813
+ inputText: Scalars['String']['input'];
2814
+ limit: Scalars['Int']['input'];
2815
+ };
2816
+
2817
+
2783
2818
  export type QueryRoleAssignmentsForOrganizationArgs = {
2784
2819
  subjectType?: InputMaybe<SubjectType>;
2785
2820
  };
@@ -2836,6 +2871,8 @@ export enum RemoveBlueprintInstanceMode {
2836
2871
  export type RemoveBlueprintResponse = {
2837
2872
  __typename?: 'RemoveBlueprintResponse';
2838
2873
  channel: Channel;
2874
+ /** The ID of the Channel this Blueprint belongs to. */
2875
+ channelId?: Maybe<Scalars['String']['output']>;
2839
2876
  createdAt: Scalars['DateTime']['output'];
2840
2877
  /** The Experience Component which defines this Blueprint. */
2841
2878
  definedBy: ExperienceComponent;
@@ -2863,6 +2900,8 @@ export type RemoveBuildingBlockResponse = {
2863
2900
 
2864
2901
  export type RemoveContentExperienceResponse = {
2865
2902
  __typename?: 'RemoveContentExperienceResponse';
2903
+ /** The ID of the Channel this ContentExperience belongs to. */
2904
+ channelId?: Maybe<Scalars['String']['output']>;
2866
2905
  createdAt: Scalars['DateTime']['output'];
2867
2906
  experienceComponent: ExperienceComponent;
2868
2907
  /** The issues that this Content Experience is a subject of */
@@ -2951,7 +2990,7 @@ export type RemoveExperienceComponentResponse = {
2951
2990
  grid?: Maybe<Grid>;
2952
2991
  /** The Grid Placements this Experience Component is placed in. */
2953
2992
  gridPlacements: Array<GridPlacement>;
2954
- /** Whether the Experience Component is a draft. Drafts cannot be used in Grid Placements. */
2993
+ /** Whether the Experience Component is a draft. */
2955
2994
  isDraft: Scalars['Boolean']['output'];
2956
2995
  isGlobal: Scalars['Boolean']['output'];
2957
2996
  /** The name of the Experience Component. Only applicable for global Experience Components. */
@@ -3015,7 +3054,8 @@ export enum SeedType {
3015
3054
  Performance_500 = 'PERFORMANCE_500',
3016
3055
  Performance_1000 = 'PERFORMANCE_1000',
3017
3056
  Performance_2000 = 'PERFORMANCE_2000',
3018
- Performance_5000 = 'PERFORMANCE_5000'
3057
+ Performance_5000 = 'PERFORMANCE_5000',
3058
+ QaContent = 'QA_CONTENT'
3019
3059
  }
3020
3060
 
3021
3061
  export enum SortingDirection {
@@ -3366,7 +3406,9 @@ export type UpdateDecimalCountContentValidationRuleInput = {
3366
3406
  export type UpdateExperienceComponentInput = {
3367
3407
  /** !!!WARNING!!! If you update to a new Building Block, all existing Building Block Field Fulfillments will be removed! Content Values and Grid Placements will remain. */
3368
3408
  buildingBlock?: InputMaybe<Scalars['PRN']['input']>;
3369
- /** Whether the Experience Component is a draft. Drafts cannot be used in Grid Placements. */
3409
+ fulfillmentsToConnect?: InputMaybe<Array<Scalars['PRN']['input']>>;
3410
+ fulfillmentsToCreate?: InputMaybe<Array<CreateBuildingBlockFieldFulfillmentForExperienceComponentInput>>;
3411
+ /** Whether the Experience Component is a draft. */
3370
3412
  isDraft?: InputMaybe<Scalars['Boolean']['input']>;
3371
3413
  /** The name of the Experience Component. Only applicable for global Experience Components. */
3372
3414
  name?: InputMaybe<Scalars['String']['input']>;
@@ -1,18 +1,5 @@
1
- import { BaseEditor } from "slate";
2
- import { ReactEditor } from "slate-react";
3
1
  import { Content, Root } from "@platecms/delta-cast";
4
2
 
5
- declare module "slate" {
6
- interface CustomTypes {
7
- // eslint-disable-next-line @typescript-eslint/naming-convention
8
- Editor: BaseEditor & ReactEditor;
9
- // eslint-disable-next-line @typescript-eslint/naming-convention
10
- Element: DeltaElement;
11
- // eslint-disable-next-line @typescript-eslint/naming-convention
12
- Text: DeltaLeaf;
13
- }
14
- }
15
-
16
3
  export interface DeltaLeafMarkdown {
17
4
  title?: boolean;
18
5
  }
@@ -21,7 +8,6 @@ export type DeltaElement =
21
8
  | BlockquoteElement
22
9
  | CodeElement
23
10
  | ContentValueElement
24
- | ContentValueSuggestionElement
25
11
  | HeadingElement
26
12
  | LinkElement
27
13
  | ListElement
@@ -39,46 +25,51 @@ export type DeltaLeaf = DeltaLeafMarkdown & {
39
25
  highlight?: true;
40
26
  };
41
27
 
28
+ export interface DeltaNode extends Node {
29
+ // eslint-disable-next-line @typescript-eslint/naming-convention
30
+ DeltaElement: DeltaElement;
31
+ // eslint-disable-next-line @typescript-eslint/naming-convention
32
+ DeltaLeaf: DeltaLeaf;
33
+ }
34
+
42
35
  export interface ParagraphElement {
43
36
  type: "paragraph";
44
- children: (ContentValueElement | ContentValueSuggestionElement | DeltaLeaf | LinkElement | Suggestion)[];
37
+ children: (ContentValueElement | DeltaLeaf | LinkElement | Suggestion)[];
45
38
  }
39
+
46
40
  export interface HeadingElement {
47
41
  type: "heading";
48
42
  level: 1 | 2 | 3 | 4 | 5 | 6;
49
43
  children: DeltaLeaf[];
50
44
  }
45
+
51
46
  export interface ListElement {
52
47
  type: "list";
53
48
  ordered: boolean;
54
49
  children: ListItemElement[];
55
50
  }
51
+
56
52
  export interface ListItemElement {
57
53
  type: "listItem";
58
54
  children: DeltaLeaf[];
59
55
  }
56
+
60
57
  export interface BlockquoteElement {
61
58
  type: "blockquote";
62
59
  children: DeltaLeaf[];
63
60
  }
61
+
64
62
  export interface CodeElement {
65
63
  type: "code";
66
64
  children: DeltaLeaf[];
67
65
  }
66
+
68
67
  export interface ContentValueElement {
69
68
  type: "contentValue";
70
69
  prn: string;
71
70
  root: Root | undefined;
72
71
  children: DeltaLeaf[];
73
72
  }
74
-
75
- export interface ContentValueSuggestionElement {
76
- type: "contentValueSuggestion";
77
- prn: string;
78
- root: Root | undefined;
79
- children: DeltaLeaf[];
80
- }
81
-
82
73
  export interface LinkElement {
83
74
  type: "link";
84
75
  url: string;
@@ -88,13 +79,15 @@ export interface LinkElement {
88
79
 
89
80
  internal?: {
90
81
  prn: string;
91
- anchor?: boolean;
82
+ anchor: boolean;
92
83
  };
93
84
  }
94
85
 
95
86
  export interface Suggestion {
96
87
  type: "suggestion";
97
- suggested: Content[];
88
+ startIndex: number;
89
+ endIndex: number;
90
+ suggested: ContentValueElement;
98
91
  original: Content[];
99
92
  message: string;
100
93
  method: string;