@prismicio/types-internal 1.0.0-alpha.1 → 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.
@@ -1,11 +1,11 @@
1
- import { SlicesContent } from "./slices/SlicesContent";
1
+ import { SlicesContent } from "./slices";
2
2
  import StaticWidgetContent from "./StaticWidgetContent";
3
3
  export * from "./EmptyContent";
4
4
  export * from "./GroupContent";
5
5
  export * as Nestable from "./nestable";
6
6
  export * from "./SimpleWidgetContent";
7
7
  export * as Slices from "./slices";
8
- export { type NonEmptyStaticWidgetContent, default as StaticWidgetContent, } from "./StaticWidgetContent";
8
+ export { type NonEmptyStaticWidgetContent } from "./StaticWidgetContent";
9
9
  export * from "./UIDContent";
10
10
  export declare const WidgetTypes: {
11
11
  readonly Empty: "EmptyContent";
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Widget = exports.WidgetTypes = exports.StaticWidgetContent = exports.Slices = exports.Nestable = void 0;
3
+ exports.Widget = exports.WidgetTypes = exports.Slices = exports.Nestable = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const EmptyContent_1 = require("./EmptyContent");
6
6
  const GroupContent_1 = require("./GroupContent");
7
7
  const nestable_1 = require("./nestable");
8
- const SlicesContent_1 = require("./slices/SlicesContent");
8
+ const slices_1 = require("./slices");
9
9
  const StaticWidgetContent_1 = (0, tslib_1.__importDefault)(require("./StaticWidgetContent"));
10
10
  const UIDContent_1 = require("./UIDContent");
11
11
  (0, tslib_1.__exportStar)(require("./EmptyContent"), exports);
@@ -14,20 +14,19 @@ exports.Nestable = (0, tslib_1.__importStar)(require("./nestable"));
14
14
  (0, tslib_1.__exportStar)(require("./SimpleWidgetContent"), exports);
15
15
  exports.Slices = (0, tslib_1.__importStar)(require("./slices"));
16
16
  var StaticWidgetContent_2 = require("./StaticWidgetContent");
17
- Object.defineProperty(exports, "StaticWidgetContent", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(StaticWidgetContent_2).default; } });
18
17
  (0, tslib_1.__exportStar)(require("./UIDContent"), exports);
19
18
  exports.WidgetTypes = {
20
19
  ...nestable_1.NestableTypes,
21
20
  Empty: EmptyContent_1.EmptyContentType,
22
21
  UID: UIDContent_1.UIDContentType,
23
22
  Group: GroupContent_1.GroupContentType,
24
- slices: SlicesContent_1.SlicesContentType,
23
+ slices: slices_1.SlicesContentType,
25
24
  };
26
25
  exports.Widget = {
27
26
  fromJson(widgetKey, widgetValue, widgetTypes, widgetPositions) {
28
27
  const fieldType = widgetTypes.get(widgetKey);
29
28
  if (fieldType === "Slices") {
30
- return SlicesContent_1.SlicesContent.fromJson(widgetKey, widgetValue, widgetTypes, widgetPositions);
29
+ return slices_1.SlicesContent.fromJson(widgetKey, widgetValue, widgetTypes, widgetPositions);
31
30
  }
32
31
  else {
33
32
  return StaticWidgetContent_1.default.fromJson([], widgetKey, widgetValue, widgetTypes, widgetPositions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/types-internal",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0",
4
4
  "description": "Prismic types for Custom Types and Prismic Data",
5
5
  "keywords": [
6
6
  "typescript",
@@ -38,7 +38,7 @@ function customTypeReader<T extends StaticSection | DynamicSection>(
38
38
  id: t.string,
39
39
  label: StringOrNull,
40
40
  repeatable: withFallback(t.boolean, true),
41
- json: t.record(t.string, codec),
41
+ json: t.record(t.string, codec), //tab name => tab data
42
42
  status: withFallback(t.boolean, true),
43
43
  }),
44
44
  t.partial({
@@ -1,12 +1,12 @@
1
1
  import * as t from "io-ts"
2
2
 
3
- import type { SharedSlice } from "./widgets/slices/SharedSlice"
3
+ import type { SharedSlice } from "./widgets/slices"
4
4
  import { DynamicWidget, StaticWidget, Widgets } from "./widgets/Widget"
5
5
 
6
6
  export function sectionReader<T extends StaticWidget | DynamicWidget>(
7
7
  codec: t.Type<T, unknown>,
8
8
  ) {
9
- return t.record(t.string, codec)
9
+ return t.record(t.string, codec) // WidgetId -> Widget Data
10
10
  }
11
11
 
12
12
  export const StaticSection = sectionReader(StaticWidget)
@@ -1,7 +1,7 @@
1
1
  import { EmptyContentType } from "./EmptyContent"
2
2
  import { GroupContentType } from "./GroupContent"
3
3
  import { NestableTypes } from "./nestable"
4
- import { SlicesContent, SlicesContentType } from "./slices/SlicesContent"
4
+ import { SlicesContent, SlicesContentType } from "./slices"
5
5
  import StaticWidgetContent from "./StaticWidgetContent"
6
6
  import { UIDContentType } from "./UIDContent"
7
7
 
@@ -10,10 +10,7 @@ export * from "./GroupContent"
10
10
  export * as Nestable from "./nestable"
11
11
  export * from "./SimpleWidgetContent"
12
12
  export * as Slices from "./slices"
13
- export {
14
- type NonEmptyStaticWidgetContent,
15
- default as StaticWidgetContent,
16
- } from "./StaticWidgetContent"
13
+ export { type NonEmptyStaticWidgetContent } from "./StaticWidgetContent"
17
14
  export * from "./UIDContent"
18
15
 
19
16
  export const WidgetTypes = {
@@ -27,6 +24,7 @@ export const WidgetTypes = {
27
24
  export type WidgetTypes = typeof WidgetTypes[keyof typeof WidgetTypes]
28
25
 
29
26
  export type WidgetKey = string
27
+
30
28
  export type WidgetContent = SlicesContent | StaticWidgetContent
31
29
 
32
30
  export const Widget = {