@croct/plug 0.11.6 → 0.12.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/constants.d.ts CHANGED
@@ -2,4 +2,4 @@ export declare const CDN_URL = "https://cdn.croct.io/js/v1/lib/plug.js";
2
2
  export declare const PLAYGROUND_ORIGIN = "https://play.croct.com";
3
3
  export declare const PLAYGROUND_CONNECT_URL = "https://play.croct.com/connect.html";
4
4
  export declare const PREVIEW_WIDGET_ORIGIN = "https://cdn.croct.io";
5
- export declare const PREVIEW_WIDGET_URL = "https://cdn.croct.io/js/v1/lib/plug/widget-0.11.6.html";
5
+ export declare const PREVIEW_WIDGET_URL = "https://cdn.croct.io/js/v1/lib/plug/widget-0.12.0.html";
package/constants.js CHANGED
@@ -5,5 +5,5 @@ exports.CDN_URL = 'https://cdn.croct.io/js/v1/lib/plug.js';
5
5
  exports.PLAYGROUND_ORIGIN = 'https://play.croct.com';
6
6
  exports.PLAYGROUND_CONNECT_URL = 'https://play.croct.com/connect.html';
7
7
  exports.PREVIEW_WIDGET_ORIGIN = 'https://cdn.croct.io';
8
- exports.PREVIEW_WIDGET_URL = 'https://cdn.croct.io/js/v1/lib/plug/widget-0.11.6.html';
8
+ exports.PREVIEW_WIDGET_URL = 'https://cdn.croct.io/js/v1/lib/plug/widget-0.12.0.html';
9
9
  //# sourceMappingURL=constants.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@croct/plug",
3
- "version": "0.11.6",
3
+ "version": "0.12.0",
4
4
  "description": "A fully-featured devkit for building natively personalized applications.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -42,7 +42,7 @@
42
42
  "@rollup/plugin-commonjs": "^24.0.0",
43
43
  "@rollup/plugin-node-resolve": "^15.0.1",
44
44
  "@rollup/plugin-replace": "^5.0.1",
45
- "@rollup/plugin-terser": "^0.3.0",
45
+ "@rollup/plugin-terser": "^0.4.0",
46
46
  "@rollup/plugin-typescript": "^11.0.0",
47
47
  "@types/jest": "^29.2.2",
48
48
  "@typescript-eslint/parser": "^5.30.0",
@@ -52,7 +52,7 @@
52
52
  "rollup": "^3.3.0",
53
53
  "ts-jest": "^29.0.3",
54
54
  "ts-node": "^10.9.1",
55
- "typescript": "^4.9.3"
55
+ "typescript": "^4.9.5"
56
56
  },
57
57
  "browserslist": [
58
58
  "last 1 version"
package/slot.d.ts CHANGED
@@ -21,22 +21,15 @@ export interface VersionedSlotMap extends LatestSlotVersionMap {
21
21
  * which improves type inference when narrowing the type.
22
22
  */
23
23
  type Intersection<T, E> = T extends infer O ? O & E : never;
24
- type DiscriminatedSlotMap = {
25
- [K in keyof VersionedSlotMap]: {
26
- [V in keyof VersionedSlotMap[K]]: Intersection<VersionedSlotMap[K][V], {
27
- _component: string | null;
28
- }>;
29
- };
30
- };
31
24
  type UnionContent = {
32
25
  [K in ComponentVersionId]: Intersection<ComponentContent<K>, {
33
- _component: K;
26
+ _component: K | null;
34
27
  }>;
35
28
  };
36
29
  type UnknownContent = UnionContent[ComponentVersionId] extends never ? (JsonObject & {
37
30
  _component: string | null;
38
31
  }) : UnionContent[ComponentVersionId];
39
- type VersionedContent<I extends VersionedSlotId> = Versioned<I, DiscriminatedSlotMap, UnknownContent>;
32
+ type VersionedContent<I extends VersionedSlotId> = Versioned<I, VersionedSlotMap, UnknownContent>;
40
33
  export type DynamicSlotId = any;
41
34
  export type SlotId = keyof VersionedSlotMap extends never ? string : keyof VersionedSlotMap;
42
35
  export type SlotVersion<I extends SlotId = SlotId> = Version<VersionedSlotMap, I>;
package/src/slot.ts CHANGED
@@ -22,21 +22,15 @@ export interface VersionedSlotMap extends LatestSlotVersionMap {
22
22
  */
23
23
  type Intersection<T, E> = T extends infer O ? O & E : never;
24
24
 
25
- type DiscriminatedSlotMap = {
26
- [K in keyof VersionedSlotMap]: {
27
- [V in keyof VersionedSlotMap[K]]: Intersection<VersionedSlotMap[K][V], {_component: string | null}>
28
- }
29
- };
30
-
31
25
  type UnionContent = {
32
- [K in ComponentVersionId]: Intersection<ComponentContent<K>, {_component: K}>;
26
+ [K in ComponentVersionId]: Intersection<ComponentContent<K>, {_component: K | null}>;
33
27
  };
34
28
 
35
29
  type UnknownContent = UnionContent[ComponentVersionId] extends never
36
30
  ? (JsonObject & {_component: string | null})
37
31
  : UnionContent[ComponentVersionId];
38
32
 
39
- type VersionedContent<I extends VersionedSlotId> = Versioned<I, DiscriminatedSlotMap, UnknownContent>;
33
+ type VersionedContent<I extends VersionedSlotId> = Versioned<I, VersionedSlotMap, UnknownContent>;
40
34
 
41
35
  export type DynamicSlotId = any;
42
36