@croct/plug 0.11.6 → 0.12.1
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 +1 -1
- package/constants.js +1 -1
- package/package.json +3 -3
- package/slot.d.ts +4 -11
- package/src/slot.ts +4 -10
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.
|
|
5
|
+
export declare const PREVIEW_WIDGET_URL = "https://cdn.croct.io/js/v1/lib/plug/widget-0.12.1.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.
|
|
8
|
+
exports.PREVIEW_WIDGET_URL = 'https://cdn.croct.io/js/v1/lib/plug/widget-0.12.1.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.
|
|
3
|
+
"version": "0.12.1",
|
|
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.
|
|
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.
|
|
55
|
+
"typescript": "^4.9.5"
|
|
56
56
|
},
|
|
57
57
|
"browserslist": [
|
|
58
58
|
"last 1 version"
|
package/slot.d.ts
CHANGED
|
@@ -21,27 +21,20 @@ 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
|
|
25
|
-
[K in keyof VersionedSlotMap]: {
|
|
26
|
-
[V in keyof VersionedSlotMap[K]]: Intersection<VersionedSlotMap[K][V], {
|
|
27
|
-
_component: string | null;
|
|
28
|
-
}>;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
type UnionContent = {
|
|
24
|
+
type UnionContent<T = null> = {
|
|
32
25
|
[K in ComponentVersionId]: Intersection<ComponentContent<K>, {
|
|
33
|
-
_component: K;
|
|
26
|
+
_component: K | T;
|
|
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,
|
|
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>;
|
|
43
36
|
export type SlotVersionId<I extends SlotId = SlotId> = CanonicalVersionId<I, VersionedSlotMap>;
|
|
44
37
|
export type VersionedSlotId<I extends SlotId = SlotId> = VersionedId<I, VersionedSlotMap>;
|
|
45
|
-
export type CompatibleSlotContent<T extends ComponentVersionId = ComponentVersionId> = UnionContent[T];
|
|
38
|
+
export type CompatibleSlotContent<T extends ComponentVersionId = ComponentVersionId> = UnionContent<never>[T];
|
|
46
39
|
export type SlotContent<I extends VersionedSlotId = VersionedSlotId, C extends JsonObject = JsonObject> = JsonObject extends C ? (string extends I ? UnknownContent : VersionedContent<I>) : C;
|
|
47
40
|
export {};
|
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
|
|
26
|
-
[K in
|
|
27
|
-
[V in keyof VersionedSlotMap[K]]: Intersection<VersionedSlotMap[K][V], {_component: string | null}>
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
type UnionContent = {
|
|
32
|
-
[K in ComponentVersionId]: Intersection<ComponentContent<K>, {_component: K}>;
|
|
25
|
+
type UnionContent<T = null> = {
|
|
26
|
+
[K in ComponentVersionId]: Intersection<ComponentContent<K>, {_component: K | T}>;
|
|
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,
|
|
33
|
+
type VersionedContent<I extends VersionedSlotId> = Versioned<I, VersionedSlotMap, UnknownContent>;
|
|
40
34
|
|
|
41
35
|
export type DynamicSlotId = any;
|
|
42
36
|
|
|
@@ -48,7 +42,7 @@ export type SlotVersionId<I extends SlotId = SlotId> = CanonicalVersionId<I, Ver
|
|
|
48
42
|
|
|
49
43
|
export type VersionedSlotId<I extends SlotId = SlotId> = VersionedId<I, VersionedSlotMap>;
|
|
50
44
|
|
|
51
|
-
export type CompatibleSlotContent<T extends ComponentVersionId = ComponentVersionId> = UnionContent[T];
|
|
45
|
+
export type CompatibleSlotContent<T extends ComponentVersionId = ComponentVersionId> = UnionContent<never>[T];
|
|
52
46
|
|
|
53
47
|
export type SlotContent<I extends VersionedSlotId = VersionedSlotId, C extends JsonObject = JsonObject> =
|
|
54
48
|
JsonObject extends C ? (string extends I ? UnknownContent : VersionedContent<I>) : C;
|