@knapsack/types 4.70.0--canary.4628.1068e46.0 → 4.70.0--canary.4854.b1d79a8.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +148 -0
- package/dist/acd-test-fixtures/index.js +2 -0
- package/dist/acd-test-fixtures/index.js.map +1 -1
- package/dist/acd-test-fixtures/index.mjs +2 -0
- package/dist/acd-test-fixtures/index.mjs.map +1 -1
- package/dist/acd-test-fixtures/ks-sandbox.d.ts.map +1 -1
- package/dist/app-client-data/blocks.d.ts +2 -0
- package/dist/app-client-data/blocks.d.ts.map +1 -1
- package/dist/app-client-data/meta.d.ts +4 -3
- package/dist/app-client-data/meta.d.ts.map +1 -1
- package/dist/design-src.types.d.ts +1 -0
- package/dist/design-src.types.d.ts.map +1 -1
- package/dist/index.js +3 -77
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -73
- package/dist/index.mjs.map +1 -1
- package/dist/renderer-client-types.d.ts +9 -0
- package/dist/renderer-client-types.d.ts.map +1 -1
- package/dist/renderers.d.ts +19 -101
- package/dist/renderers.d.ts.map +1 -1
- package/package.json +9 -9
@@ -19,6 +19,15 @@ export type KsRendererClientMsg = {
|
|
19
19
|
msg: string;
|
20
20
|
feedbackType?: FeedbackTypes;
|
21
21
|
};
|
22
|
+
/**
|
23
|
+
* The meta data is stored in a script tag with this id
|
24
|
+
* @see {KsRendererClientMeta}
|
25
|
+
*/
|
26
|
+
export declare const ksRendererClientMetaId = "ks-meta";
|
27
|
+
/**
|
28
|
+
* Metadata about the current renderer client demo
|
29
|
+
* @see {ksRendererClientMetaId} for the ID of the script tag
|
30
|
+
*/
|
22
31
|
export interface KsRendererClientMeta {
|
23
32
|
patternId: string;
|
24
33
|
templateId: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderer-client-types.d.ts","sourceRoot":"","sources":["../src/renderer-client-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,oBAAY,sBAAsB;IAChC,KAAK,UAAU;CAChB;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IACE;;OAEG;IACH,IAAI,EAAE,iCAAiC,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,IAAI,EAAE,4BAA4B,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEN,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB"}
|
1
|
+
{"version":3,"file":"renderer-client-types.d.ts","sourceRoot":"","sources":["../src/renderer-client-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,oBAAY,sBAAsB;IAChC,KAAK,UAAU;CAChB;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IACE;;OAEG;IACH,IAAI,EAAE,iCAAiC,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,IAAI,EAAE,4BAA4B,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEN;;;GAGG;AACH,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB"}
|
package/dist/renderers.d.ts
CHANGED
@@ -14,109 +14,18 @@ export declare const rendererIds: {
|
|
14
14
|
*/
|
15
15
|
export type RendererId = keyof typeof rendererIds;
|
16
16
|
/**
|
17
|
-
*
|
18
|
-
* - `import { Foo, Bar } from './foo';`
|
19
|
-
* - `import * as Foo from './foo';`
|
20
|
-
* - `import Foo from './foo';`
|
21
|
-
*
|
22
|
-
* Used in Webpack-based renderers
|
17
|
+
* Results of rendering a pattern
|
23
18
|
*/
|
24
|
-
export type
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
type: 'named';
|
31
|
-
path: string;
|
32
|
-
/** import { name } from 'path'; */
|
33
|
-
name: string;
|
34
|
-
} | {
|
35
|
-
type: 'all';
|
36
|
-
path: string;
|
37
|
-
/** import * as name from 'path'; */
|
38
|
-
name: string;
|
39
|
-
};
|
40
|
-
/** The result of `import`-ing a module */
|
41
|
-
type EsModuleObject<ExportedType = unknown> = {
|
42
|
-
default?: ExportedType;
|
43
|
-
[key: string]: ExportedType;
|
44
|
-
};
|
45
|
-
export type KsJsImport = {
|
46
|
-
type: 'pattern-template';
|
47
|
-
patternId: string;
|
48
|
-
templateId: string;
|
49
|
-
importInfo: KsJsImportInfo;
|
50
|
-
} | {
|
51
|
-
type: 'pattern-template-demo';
|
52
|
-
patternId: string;
|
53
|
-
templateId: string;
|
54
|
-
demoId: string;
|
55
|
-
importInfo: KsJsImportInfo;
|
56
|
-
} | {
|
57
|
-
type: 'extra';
|
58
|
-
importInfo: KsJsImportInfo;
|
19
|
+
export type KsRenderResults = {
|
20
|
+
ok: boolean;
|
21
|
+
html: string;
|
22
|
+
usage?: string;
|
23
|
+
templateLanguage?: string;
|
24
|
+
message?: string;
|
59
25
|
};
|
60
|
-
type
|
61
|
-
|
62
|
-
patternId: string;
|
63
|
-
templateId: string;
|
64
|
-
} | {
|
65
|
-
type: 'pattern-template-demo';
|
66
|
-
patternId: string;
|
67
|
-
templateId: string;
|
68
|
-
demoId: string;
|
69
|
-
} | {
|
70
|
-
type: 'extra';
|
71
|
-
name: string;
|
26
|
+
export type KsRenderApiResults = KsRenderResults & {
|
27
|
+
wrappedHtml: string;
|
72
28
|
};
|
73
|
-
type GetKsJsImportPatternParam = {
|
74
|
-
patternId: string;
|
75
|
-
templateId: string;
|
76
|
-
demoId?: string;
|
77
|
-
};
|
78
|
-
/**
|
79
|
-
* This is `window.knapsack` inside the renderer client: the iframe container for renderer components
|
80
|
-
*/
|
81
|
-
export interface KsRendererClientGlobal<ExportedComponentType = unknown> {
|
82
|
-
typeName: 'KsRendererClientGlobal';
|
83
|
-
importedModules: {
|
84
|
-
[id: string]: () => Promise<EsModuleObject<ExportedComponentType>>;
|
85
|
-
};
|
86
|
-
allAvailableImports: KsJsImport[];
|
87
|
-
getImport: (opt: GetKsJsImportParam) => Promise<{
|
88
|
-
name: string;
|
89
|
-
/** Most likely a component */
|
90
|
-
value: ExportedComponentType;
|
91
|
-
}>;
|
92
|
-
getImports: (imports: GetKsJsImportParam[]) => Promise<{
|
93
|
-
[importName: string]: ExportedComponentType;
|
94
|
-
}>;
|
95
|
-
getPatternImport: (opt: GetKsJsImportPatternParam) => Promise<{
|
96
|
-
name: string;
|
97
|
-
/** Most likely a component */
|
98
|
-
value: ExportedComponentType;
|
99
|
-
}>;
|
100
|
-
getExtraImport: (opt: {
|
101
|
-
name: string;
|
102
|
-
}) => Promise<{
|
103
|
-
name: string;
|
104
|
-
/** Most likely a component */
|
105
|
-
value: ExportedComponentType;
|
106
|
-
}>;
|
107
|
-
getAllImports: (opt: {
|
108
|
-
patterns: GetKsJsImportPatternParam[];
|
109
|
-
extras?: {
|
110
|
-
name: string;
|
111
|
-
}[];
|
112
|
-
}) => Promise<{
|
113
|
-
[importName: string]: ExportedComponentType;
|
114
|
-
}>;
|
115
|
-
}
|
116
|
-
export declare function isKsJsImports(imports: unknown): imports is KsJsImport[];
|
117
|
-
export declare function isKsRendererClientGlobalImportedModules(mods: unknown): mods is KsRendererClientGlobal['importedModules'];
|
118
|
-
export declare function isKsRendererClientGlobal<ExportedComponentType = unknown>(knapsack: unknown): knapsack is KsRendererClientGlobal<ExportedComponentType>;
|
119
|
-
export declare function getKsRendererClientGlobal<ExportedComponentType = unknown>(): KsRendererClientGlobal<ExportedComponentType>;
|
120
29
|
export type TemplateSuggestion = {
|
121
30
|
path: string;
|
122
31
|
alias?: string;
|
@@ -127,5 +36,14 @@ export type TemplateSuggestionsGetFn = (opt: {
|
|
127
36
|
}) => Promise<{
|
128
37
|
suggestions: TemplateSuggestion[];
|
129
38
|
}>;
|
130
|
-
|
39
|
+
/**
|
40
|
+
* Aliases for package paths
|
41
|
+
* Example:
|
42
|
+
* ```js
|
43
|
+
* {
|
44
|
+
* 'my-pkg': '../path/to/my-pkg',
|
45
|
+
* }
|
46
|
+
* ```
|
47
|
+
*/
|
48
|
+
export type PkgPathAliases = Record<string, string>;
|
131
49
|
//# sourceMappingURL=renderers.d.ts.map
|
package/dist/renderers.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderers.d.ts","sourceRoot":"","sources":["../src/renderers.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"renderers.d.ts","sourceRoot":"","sources":["../src/renderers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;;;CAQd,CAAC;AAEX;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,WAAW,CAAC;AAClD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG;IACjD,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,CAAC,GAAG,EAAE;IAC3C,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAK,OAAO,CAAC;IACZ,WAAW,EAAE,kBAAkB,EAAE,CAAC;CACnC,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@knapsack/types",
|
3
3
|
"description": "",
|
4
|
-
"version": "4.70.0--canary.
|
4
|
+
"version": "4.70.0--canary.4854.b1d79a8.0",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"module": "dist/index.mjs",
|
7
7
|
"types": "dist/index.d.ts",
|
@@ -38,19 +38,19 @@
|
|
38
38
|
"test": "ava"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"@knapsack/utils": "4.70.0--canary.
|
41
|
+
"@knapsack/utils": "4.70.0--canary.4854.b1d79a8.0",
|
42
42
|
"color-string": "^1.9.1",
|
43
|
-
"immer": "^10.
|
43
|
+
"immer": "^10.1.1",
|
44
44
|
"superstruct": "^0.16.7"
|
45
45
|
},
|
46
46
|
"devDependencies": {
|
47
|
-
"@knapsack/eslint-config-starter": "4.70.0--canary.
|
48
|
-
"@knapsack/test-ava": "4.70.0--canary.
|
49
|
-
"@knapsack/typescript-config-starter": "4.70.0--canary.
|
50
|
-
"@tiptap/core": "^2.2
|
47
|
+
"@knapsack/eslint-config-starter": "4.70.0--canary.4854.b1d79a8.0",
|
48
|
+
"@knapsack/test-ava": "4.70.0--canary.4854.b1d79a8.0",
|
49
|
+
"@knapsack/typescript-config-starter": "4.70.0--canary.4854.b1d79a8.0",
|
50
|
+
"@tiptap/core": "^2.7.2",
|
51
51
|
"@types/color-string": "^1.5.5",
|
52
52
|
"@types/fs-extra": "^11.0.4",
|
53
|
-
"@types/react": "^18.3.
|
53
|
+
"@types/react": "^18.3.8",
|
54
54
|
"ava": "^6.1.3",
|
55
55
|
"eslint": "^8.57.0",
|
56
56
|
"fs-extra": "^11.2.0",
|
@@ -68,5 +68,5 @@
|
|
68
68
|
"directory": "libs/types",
|
69
69
|
"type": "git"
|
70
70
|
},
|
71
|
-
"gitHead": "
|
71
|
+
"gitHead": "b1d79a8caffe3537b921ff76bae2f2e8bcabbc43"
|
72
72
|
}
|