@prismicio/types-internal 2.5.0-alpha.3 → 2.5.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 (39) hide show
  1. package/README.md +13 -41
  2. package/lib/_internal/utils.d.ts +2 -2
  3. package/lib/content/Document.d.ts +2094 -138
  4. package/lib/content/fields/GroupContent.d.ts +1 -1
  5. package/lib/content/fields/GroupContent.js +1 -4
  6. package/lib/content/fields/WidgetContent.d.ts +2094 -138
  7. package/lib/content/fields/nestable/NestableContent.d.ts +155 -3
  8. package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +232 -4
  9. package/lib/content/fields/nestable/RichTextContent/Blocks.js +5 -2
  10. package/lib/content/fields/nestable/RichTextContent/TextBlock.d.ts +727 -0
  11. package/lib/content/fields/nestable/RichTextContent/TextBlock.js +80 -0
  12. package/lib/content/fields/nestable/RichTextContent/index.d.ts +194 -4
  13. package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +314 -10
  14. package/lib/content/fields/slices/Slice/CompositeSliceContent.js +1 -2
  15. package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +2235 -6
  16. package/lib/content/fields/slices/Slice/RepeatableContent.js +148 -6
  17. package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +314 -10
  18. package/lib/content/fields/slices/Slice/SharedSliceContent.js +1 -1
  19. package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +1204 -9
  20. package/lib/content/fields/slices/Slice/SimpleSliceContent.js +10 -7
  21. package/lib/content/fields/slices/Slice/SlicePrimaryContent.d.ts +155 -3
  22. package/lib/content/fields/slices/Slice/index.d.ts +1367 -70
  23. package/lib/content/fields/slices/Slice/index.js +1 -0
  24. package/lib/content/fields/slices/SliceItem.d.ts +1445 -149
  25. package/lib/content/fields/slices/SlicesContent.d.ts +2849 -1045
  26. package/lib/customtypes/widgets/slices/SliceWidget.d.ts +327 -0
  27. package/lib/customtypes/widgets/slices/SliceWidget.js +8 -0
  28. package/lib/validators/function.js +1 -8
  29. package/package.json +1 -1
  30. package/src/_internal/utils.ts +2 -1
  31. package/src/content/fields/GroupContent.ts +1 -4
  32. package/src/content/fields/nestable/RichTextContent/Blocks.ts +6 -3
  33. package/src/content/fields/slices/Slice/CompositeSliceContent.ts +8 -4
  34. package/src/content/fields/slices/Slice/RepeatableContent.ts +242 -11
  35. package/src/content/fields/slices/Slice/SharedSliceContent.ts +7 -7
  36. package/src/content/fields/slices/Slice/SimpleSliceContent.ts +21 -17
  37. package/src/content/fields/slices/Slice/index.ts +1 -0
  38. package/src/content/fields/slices/SlicesContent.ts +2 -2
  39. package/src/validators/function.ts +1 -11
package/README.md CHANGED
@@ -1,15 +1,3 @@
1
- <!--
2
-
3
- TODO: Go through all "TODO" comments in the project
4
-
5
- TODO: Replace all on all files (README.md, CONTRIBUTING.md, bug_report.md, package.json):
6
- - package_name
7
- - package_description
8
- - github_org_slash_github_repo
9
- - github_repo
10
-
11
- -->
12
-
13
1
  # @prismicio/types-internal
14
2
 
15
3
  [![npm version][npm-version-src]][npm-version-href]
@@ -19,21 +7,7 @@ TODO: Replace all on all files (README.md, CONTRIBUTING.md, bug_report.md, packa
19
7
  [![Conventional Commits][conventional-commits-src]][conventional-commits-href]
20
8
  [![License][license-src]][license-href]
21
9
 
22
- <!-- TODO: Replacing link to Prismic with [Prismic][prismic] is useful here -->
23
-
24
- Prismic types for Custom Types and Prismic Data.
25
-
26
- <!--
27
-
28
- TODO: Create a small list of package features:
29
-
30
- - 🤔 &nbsp;A useful feature;
31
- - 🥴 &nbsp;Another useful feature;
32
- - 🙃 &nbsp;A final useful feature.
33
-
34
- Non-breaking space: &nbsp; are here on purpose to fix emoji rendering on certain systems.
35
-
36
- -->
10
+ A library that provides TypeScript types and runtime parsers for Prismic data. It handles models and content in the editor format. It is used in many Prismic TypeScript packages.
37
11
 
38
12
  ## Install
39
13
 
@@ -43,38 +17,36 @@ npm install @prismicio/types-internal
43
17
 
44
18
  ## Documentation
45
19
 
46
- To discover what's new on this package check out [the changelog][changelog]. For full documentation, visit the [official Prismic documentation][prismic-docs].
20
+ To discover what's new on this package check out [the changelog][changelog].
47
21
 
48
22
  ## Contributing
49
23
 
50
24
  Whether you're helping us fix bugs, improve the docs, or spread the word, we'd love to have you as part of the Prismic developer community!
51
25
 
52
- **Asking a question**: [Open a new topic][forum-question] on our community forum explaining what you want to achieve / your question. Our support team will get back to you shortly.
53
-
54
26
  **Reporting a bug**: [Open an issue][repo-bug-report] explaining your application's setup and the bug you're encountering.
55
27
 
56
28
  **Suggesting an improvement**: [Open an issue][repo-feature-request] explaining your improvement or feature so we can discuss and learn more.
57
29
 
58
30
  **Submitting code changes**: For small fixes, feel free to [open a pull request][repo-pull-requests] with a description of your changes. For large changes, please first [open an issue][repo-feature-request] so we can discuss if and how the changes should be implemented.
59
31
 
60
- For more clarity on this project and its structure you can also check out the detailed [CONTRIBUTING.md][contributing] document.
32
+ For more clarity on this project, check out the detailed [CONTRIBUTING.md][contributing] document.
61
33
 
62
34
  ## License
63
35
 
64
36
  ```
65
- Copyright 2013-2021 Prismic <contact@prismic.io> (https://prismic.io)
37
+ Copyright 2013-2024 Prismic <contact@prismic.io> (https://prismic.io)
66
38
 
67
- Licensed under the Apache License, Version 2.0 (the "License");
68
- you may not use this file except in compliance with the License.
69
- You may obtain a copy of the License at
39
+ Licensed under the Apache License, Version 2.0 (the "License");
40
+ you may not use this file except in compliance with the License.
41
+ You may obtain a copy of the License at
70
42
 
71
- http://www.apache.org/licenses/LICENSE-2.0
43
+ http://www.apache.org/licenses/LICENSE-2.0
72
44
 
73
- Unless required by applicable law or agreed to in writing, software
74
- distributed under the License is distributed on an "AS IS" BASIS,
75
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
76
- See the License for the specific language governing permissions and
77
- limitations under the License.
45
+ Unless required by applicable law or agreed to in writing, software
46
+ distributed under the License is distributed on an "AS IS" BASIS,
47
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
48
+ See the License for the specific language governing permissions and
49
+ limitations under the License.
78
50
  ```
79
51
 
80
52
  <!-- Links -->
@@ -1,5 +1,5 @@
1
1
  import type { SharedSliceItemContent, SliceItemContent, WidgetContent } from "../content";
2
- import type { CompositeSlice, Group, NestableWidget, StaticSlices, UID, VariationFields } from "../customtypes";
2
+ import type { CompositeSlice, Group, NestableWidget, NestedGroup, StaticSlices, UID, VariationFields } from "../customtypes";
3
3
  export declare type TraverseSliceContentFn = <S extends SliceItemContent | SharedSliceItemContent, D extends VariationFields | CompositeSlice | Group | NestableWidget>({ path, key, apiId, model, content, }: {
4
4
  path: ContentPath;
5
5
  key: string;
@@ -28,4 +28,4 @@ export declare const ContentPath: {
28
28
  type: ContentPathEntry["type"];
29
29
  }>): ContentPath;
30
30
  };
31
- export declare type SliceModel = VariationFields | NestableWidget | CompositeSlice | Group;
31
+ export declare type SliceModel = VariationFields | NestableWidget | CompositeSlice | NestedGroup;