@milaboratories/pl-model-middle-layer 1.9.1 → 1.10.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/dist/block_meta/content_conversion.cjs +1 -1
- package/dist/block_meta/content_conversion.cjs.map +1 -1
- package/dist/block_meta/content_conversion.d.ts +1 -1
- package/dist/block_meta/content_conversion.js +1 -1
- package/dist/block_meta/content_conversion.js.map +1 -1
- package/dist/block_settings.cjs.map +1 -1
- package/dist/block_settings.d.ts +1 -1
- package/dist/block_settings.d.ts.map +1 -1
- package/dist/block_settings.js.map +1 -1
- package/dist/block_state.d.ts +10 -1
- package/dist/block_state.d.ts.map +1 -1
- package/dist/project_overview.d.ts +6 -0
- package/dist/project_overview.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/block_meta/content_conversion.ts +1 -1
- package/src/block_settings.ts +1 -1
- package/src/block_state.ts +19 -1
- package/src/project_overview.ts +7 -0
|
@@ -11,7 +11,7 @@ function mapRemoteToAbsolute(rootUrl) {
|
|
|
11
11
|
*
|
|
12
12
|
* If prefix = "nested-path/", paths like "somefile.txt" will be transformed to "nested-path/somefile.txt".
|
|
13
13
|
*
|
|
14
|
-
* @param prefix prefix to add to the
|
|
14
|
+
* @param prefix prefix to add to the relative path, slash at the end will be added automatically if missed
|
|
15
15
|
*/
|
|
16
16
|
function addPrefixToRelative(prefix) {
|
|
17
17
|
const prefixWithSlash = prefix.endsWith('/') ? prefix : `${prefix}/`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content_conversion.cjs","sources":["../../src/block_meta/content_conversion.ts"],"sourcesContent":["import type {\n ContentAbsoluteUrl,\n ContentAnyLocal,\n ContentExplicitOrRelative,\n ContentRelative,\n} from './content_types';\n\nexport function mapRemoteToAbsolute(\n rootUrl: string,\n): <T extends ContentAnyLocal>(value: T) => Exclude<T, ContentRelative> | ContentAbsoluteUrl {\n const rootWithSlash = rootUrl.endsWith('/') ? rootUrl : `${rootUrl}/`;\n return <T extends ContentAnyLocal>(value: T) =>\n value.type === 'relative'\n ? { type: 'absolute-url', url: rootWithSlash + value.path }\n : (value as Exclude<T, ContentRelative>);\n}\n\n/**\n * Creates transformer of relative content paths, that adds a specific prefix to the relative path.\n *\n * If prefix = \"nested-path/\", paths like \"somefile.txt\" will be transformed to \"nested-path/somefile.txt\".\n *\n * @param prefix prefix to add to the
|
|
1
|
+
{"version":3,"file":"content_conversion.cjs","sources":["../../src/block_meta/content_conversion.ts"],"sourcesContent":["import type {\n ContentAbsoluteUrl,\n ContentAnyLocal,\n ContentExplicitOrRelative,\n ContentRelative,\n} from './content_types';\n\nexport function mapRemoteToAbsolute(\n rootUrl: string,\n): <T extends ContentAnyLocal>(value: T) => Exclude<T, ContentRelative> | ContentAbsoluteUrl {\n const rootWithSlash = rootUrl.endsWith('/') ? rootUrl : `${rootUrl}/`;\n return <T extends ContentAnyLocal>(value: T) =>\n value.type === 'relative'\n ? { type: 'absolute-url', url: rootWithSlash + value.path }\n : (value as Exclude<T, ContentRelative>);\n}\n\n/**\n * Creates transformer of relative content paths, that adds a specific prefix to the relative path.\n *\n * If prefix = \"nested-path/\", paths like \"somefile.txt\" will be transformed to \"nested-path/somefile.txt\".\n *\n * @param prefix prefix to add to the relative path, slash at the end will be added automatically if missed\n */\nexport function addPrefixToRelative(\n prefix: string,\n): <T extends ContentExplicitOrRelative>(value: T) => T {\n const prefixWithSlash = prefix.endsWith('/') ? prefix : `${prefix}/`;\n return <T extends ContentExplicitOrRelative>(value: T) =>\n (value.type === 'relative'\n ? { type: 'relative', path: prefixWithSlash + value.path }\n : value) as T;\n}\n"],"names":[],"mappings":";;AAOM,SAAU,mBAAmB,CACjC,OAAe,EAAA;AAEf,IAAA,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,OAAO,GAAG,CAAA,EAAG,OAAO,GAAG;IACrE,OAAO,CAA4B,KAAQ,KACzC,KAAK,CAAC,IAAI,KAAK;AACb,UAAE,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,KAAK,CAAC,IAAI;UACtD,KAAqC;AAC9C;AAEA;;;;;;AAMG;AACG,SAAU,mBAAmB,CACjC,MAAc,EAAA;AAEd,IAAA,MAAM,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,CAAA,EAAG,MAAM,GAAG;IACpE,OAAO,CAAsC,KAAQ,MAClD,KAAK,CAAC,IAAI,KAAK;AACd,UAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,GAAG,KAAK,CAAC,IAAI;UACtD,KAAK,CAAM;AACnB;;;;;"}
|
|
@@ -5,7 +5,7 @@ export declare function mapRemoteToAbsolute(rootUrl: string): <T extends Content
|
|
|
5
5
|
*
|
|
6
6
|
* If prefix = "nested-path/", paths like "somefile.txt" will be transformed to "nested-path/somefile.txt".
|
|
7
7
|
*
|
|
8
|
-
* @param prefix prefix to add to the
|
|
8
|
+
* @param prefix prefix to add to the relative path, slash at the end will be added automatically if missed
|
|
9
9
|
*/
|
|
10
10
|
export declare function addPrefixToRelative(prefix: string): <T extends ContentExplicitOrRelative>(value: T) => T;
|
|
11
11
|
//# sourceMappingURL=content_conversion.d.ts.map
|
|
@@ -9,7 +9,7 @@ function mapRemoteToAbsolute(rootUrl) {
|
|
|
9
9
|
*
|
|
10
10
|
* If prefix = "nested-path/", paths like "somefile.txt" will be transformed to "nested-path/somefile.txt".
|
|
11
11
|
*
|
|
12
|
-
* @param prefix prefix to add to the
|
|
12
|
+
* @param prefix prefix to add to the relative path, slash at the end will be added automatically if missed
|
|
13
13
|
*/
|
|
14
14
|
function addPrefixToRelative(prefix) {
|
|
15
15
|
const prefixWithSlash = prefix.endsWith('/') ? prefix : `${prefix}/`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content_conversion.js","sources":["../../src/block_meta/content_conversion.ts"],"sourcesContent":["import type {\n ContentAbsoluteUrl,\n ContentAnyLocal,\n ContentExplicitOrRelative,\n ContentRelative,\n} from './content_types';\n\nexport function mapRemoteToAbsolute(\n rootUrl: string,\n): <T extends ContentAnyLocal>(value: T) => Exclude<T, ContentRelative> | ContentAbsoluteUrl {\n const rootWithSlash = rootUrl.endsWith('/') ? rootUrl : `${rootUrl}/`;\n return <T extends ContentAnyLocal>(value: T) =>\n value.type === 'relative'\n ? { type: 'absolute-url', url: rootWithSlash + value.path }\n : (value as Exclude<T, ContentRelative>);\n}\n\n/**\n * Creates transformer of relative content paths, that adds a specific prefix to the relative path.\n *\n * If prefix = \"nested-path/\", paths like \"somefile.txt\" will be transformed to \"nested-path/somefile.txt\".\n *\n * @param prefix prefix to add to the
|
|
1
|
+
{"version":3,"file":"content_conversion.js","sources":["../../src/block_meta/content_conversion.ts"],"sourcesContent":["import type {\n ContentAbsoluteUrl,\n ContentAnyLocal,\n ContentExplicitOrRelative,\n ContentRelative,\n} from './content_types';\n\nexport function mapRemoteToAbsolute(\n rootUrl: string,\n): <T extends ContentAnyLocal>(value: T) => Exclude<T, ContentRelative> | ContentAbsoluteUrl {\n const rootWithSlash = rootUrl.endsWith('/') ? rootUrl : `${rootUrl}/`;\n return <T extends ContentAnyLocal>(value: T) =>\n value.type === 'relative'\n ? { type: 'absolute-url', url: rootWithSlash + value.path }\n : (value as Exclude<T, ContentRelative>);\n}\n\n/**\n * Creates transformer of relative content paths, that adds a specific prefix to the relative path.\n *\n * If prefix = \"nested-path/\", paths like \"somefile.txt\" will be transformed to \"nested-path/somefile.txt\".\n *\n * @param prefix prefix to add to the relative path, slash at the end will be added automatically if missed\n */\nexport function addPrefixToRelative(\n prefix: string,\n): <T extends ContentExplicitOrRelative>(value: T) => T {\n const prefixWithSlash = prefix.endsWith('/') ? prefix : `${prefix}/`;\n return <T extends ContentExplicitOrRelative>(value: T) =>\n (value.type === 'relative'\n ? { type: 'relative', path: prefixWithSlash + value.path }\n : value) as T;\n}\n"],"names":[],"mappings":"AAOM,SAAU,mBAAmB,CACjC,OAAe,EAAA;AAEf,IAAA,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,OAAO,GAAG,CAAA,EAAG,OAAO,GAAG;IACrE,OAAO,CAA4B,KAAQ,KACzC,KAAK,CAAC,IAAI,KAAK;AACb,UAAE,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,KAAK,CAAC,IAAI;UACtD,KAAqC;AAC9C;AAEA;;;;;;AAMG;AACG,SAAU,mBAAmB,CACjC,MAAc,EAAA;AAEd,IAAA,MAAM,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,CAAA,EAAG,MAAM,GAAG;IACpE,OAAO,CAAsC,KAAQ,MAClD,KAAK,CAAC,IAAI,KAAK;AACd,UAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,GAAG,KAAK,CAAC,IAAI;UACtD,KAAK,CAAM;AACnB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_settings.cjs","sources":["../src/block_settings.ts"],"sourcesContent":["/**\n * What part of block version should be locked against updates.\n *\n * - `major` - 1.2.3 can be updated to 1.4.7\n * - `minor` - 1.2.3 can be updated to 1.2.5\n * - `patch` - version of the block is completely locked\n *\n * */\nexport type VersionLock = 'major' | 'minor' | 'patch';\n\n/**\n * Block settings, persisted on the backend.\n *\n * Settings modulate different aspects of block behaviour,\n * currently only updates.\n * */\nexport type BlockSettings = {\n /** Only version
|
|
1
|
+
{"version":3,"file":"block_settings.cjs","sources":["../src/block_settings.ts"],"sourcesContent":["/**\n * What part of block version should be locked against updates.\n *\n * - `major` - 1.2.3 can be updated to 1.4.7\n * - `minor` - 1.2.3 can be updated to 1.2.5\n * - `patch` - version of the block is completely locked\n *\n * */\nexport type VersionLock = 'major' | 'minor' | 'patch';\n\n/**\n * Block settings, persisted on the backend.\n *\n * Settings modulate different aspects of block behaviour,\n * currently only updates.\n * */\nexport type BlockSettings = {\n /** Only version strictly greater that this one will be suggested for auto-update. */\n skipVersion?: string;\n /**\n * If certain version locking policy is set, auto-updates will only be suggested,\n * if there is an update within the specified release line.\n * */\n versionLock?: VersionLock;\n};\n\nexport const InitialBlockSettings: BlockSettings = {};\n"],"names":[],"mappings":";;AA0BO,MAAM,oBAAoB,GAAkB;;;;"}
|
package/dist/block_settings.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type VersionLock = 'major' | 'minor' | 'patch';
|
|
|
14
14
|
* currently only updates.
|
|
15
15
|
* */
|
|
16
16
|
export type BlockSettings = {
|
|
17
|
-
/** Only version
|
|
17
|
+
/** Only version strictly greater that this one will be suggested for auto-update. */
|
|
18
18
|
skipVersion?: string;
|
|
19
19
|
/**
|
|
20
20
|
* If certain version locking policy is set, auto-updates will only be suggested,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_settings.d.ts","sourceRoot":"","sources":["../src/block_settings.ts"],"names":[],"mappings":"AAAA;;;;;;;KAOK;AACL,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEtD;;;;;KAKK;AACL,MAAM,MAAM,aAAa,GAAG;IAC1B,
|
|
1
|
+
{"version":3,"file":"block_settings.d.ts","sourceRoot":"","sources":["../src/block_settings.ts"],"names":[],"mappings":"AAAA;;;;;;;KAOK;AACL,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEtD;;;;;KAKK;AACL,MAAM,MAAM,aAAa,GAAG;IAC1B,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;SAGK;IACL,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,aAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_settings.js","sources":["../src/block_settings.ts"],"sourcesContent":["/**\n * What part of block version should be locked against updates.\n *\n * - `major` - 1.2.3 can be updated to 1.4.7\n * - `minor` - 1.2.3 can be updated to 1.2.5\n * - `patch` - version of the block is completely locked\n *\n * */\nexport type VersionLock = 'major' | 'minor' | 'patch';\n\n/**\n * Block settings, persisted on the backend.\n *\n * Settings modulate different aspects of block behaviour,\n * currently only updates.\n * */\nexport type BlockSettings = {\n /** Only version
|
|
1
|
+
{"version":3,"file":"block_settings.js","sources":["../src/block_settings.ts"],"sourcesContent":["/**\n * What part of block version should be locked against updates.\n *\n * - `major` - 1.2.3 can be updated to 1.4.7\n * - `minor` - 1.2.3 can be updated to 1.2.5\n * - `patch` - version of the block is completely locked\n *\n * */\nexport type VersionLock = 'major' | 'minor' | 'patch';\n\n/**\n * Block settings, persisted on the backend.\n *\n * Settings modulate different aspects of block behaviour,\n * currently only updates.\n * */\nexport type BlockSettings = {\n /** Only version strictly greater that this one will be suggested for auto-update. */\n skipVersion?: string;\n /**\n * If certain version locking policy is set, auto-updates will only be suggested,\n * if there is an update within the specified release line.\n * */\n versionLock?: VersionLock;\n};\n\nexport const InitialBlockSettings: BlockSettings = {};\n"],"names":[],"mappings":"AA0BO,MAAM,oBAAoB,GAAkB;;;;"}
|
package/dist/block_state.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import type { BlockOutputsBase, BlockState } from '@milaboratories/pl-model-common';
|
|
1
|
+
import type { AuthorMarker, BlockOutputsBase, BlockState, NavigationState } from '@milaboratories/pl-model-common';
|
|
2
2
|
import type { Optional } from 'utility-types';
|
|
3
3
|
export type BlockStateInternal<Args = unknown, Outputs extends BlockOutputsBase = BlockOutputsBase, UiState = unknown, Href extends `/${string}` = `/${string}`> = Optional<Readonly<BlockState<Args, Outputs, UiState, Href>>, 'outputs'>;
|
|
4
|
+
export type BlockStateInternalV3<Outputs extends BlockOutputsBase = BlockOutputsBase, Href extends `/${string}` = `/${string}`> = {
|
|
5
|
+
/** Raw block storage - UI derives data using sdk/model */
|
|
6
|
+
readonly blockStorage: unknown;
|
|
7
|
+
/** Outputs rendered with block config */
|
|
8
|
+
outputs?: Outputs;
|
|
9
|
+
/** Current navigation state */
|
|
10
|
+
readonly navigationState: NavigationState<Href>;
|
|
11
|
+
readonly author: AuthorMarker | undefined;
|
|
12
|
+
};
|
|
4
13
|
//# sourceMappingURL=block_state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_state.d.ts","sourceRoot":"","sources":["../src/block_state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"block_state.d.ts","sourceRoot":"","sources":["../src/block_state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACnH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,MAAM,MAAM,kBAAkB,CAC5B,IAAI,GAAG,OAAO,EACd,OAAO,SAAS,gBAAgB,GAAG,gBAAgB,EACnD,OAAO,GAAG,OAAO,EACjB,IAAI,SAAS,IAAI,MAAM,EAAE,GAAG,IAAI,MAAM,EAAE,IACtC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;AAG5E,MAAM,MAAM,oBAAoB,CAC9B,OAAO,SAAS,gBAAgB,GAAG,gBAAgB,EACnD,IAAI,SAAS,IAAI,MAAM,EAAE,GAAG,IAAI,MAAM,EAAE,IACtC;IACF,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAE/B,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,+BAA+B;IAC/B,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAEhD,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,CAAC;CAC3C,CAAC"}
|
|
@@ -138,5 +138,11 @@ export type BlockStateOverview = {
|
|
|
138
138
|
updateSuggestions: UpdateSuggestions;
|
|
139
139
|
/** Current navigation state of the block */
|
|
140
140
|
navigationState: NavigationState;
|
|
141
|
+
/**
|
|
142
|
+
* Block storage info as JSON string (e.g., '{"stateVersion": 1}').
|
|
143
|
+
* Resolved by calling a function from the model.
|
|
144
|
+
* Undefined when block-pack for this block is not yet materialized.
|
|
145
|
+
*/
|
|
146
|
+
blockStorageInfo: string | undefined;
|
|
141
147
|
};
|
|
142
148
|
//# sourceMappingURL=project_overview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project_overview.d.ts","sourceRoot":"","sources":["../src/project_overview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC9I,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,oEAAoE;AACpE,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpF,4EAA4E;AAC5E,MAAM,MAAM,eAAe,GAAG;IAC5B,+DAA+D;IAC/D,IAAI,EAAE,WAAW,CAAC;IAElB,0BAA0B;IAC1B,OAAO,EAAE,IAAI,CAAC;IAEd,mCAAmC;IACnC,YAAY,EAAE,IAAI,CAAC;IAEnB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,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C;IAC5C,eAAe,EAAE,eAAe,CAAC;IAEjC;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-model-middle-layer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Common model between middle layer and non-block UI code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"remeda": "^2.28.0",
|
|
21
21
|
"zod": "~3.23.8",
|
|
22
22
|
"utility-types": "^3.11.0",
|
|
23
|
-
"@milaboratories/pl-model-common": "1.
|
|
23
|
+
"@milaboratories/pl-model-common": "1.24.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"eslint": "^9.25.1",
|
|
27
27
|
"typescript": "~5.6.3",
|
|
28
28
|
"@types/node": "~24.5.2",
|
|
29
|
+
"@milaboratories/build-configs": "1.2.2",
|
|
29
30
|
"@platforma-sdk/eslint-config": "1.2.0",
|
|
30
|
-
"@milaboratories/ts-builder": "1.2.1",
|
|
31
31
|
"@milaboratories/ts-configs": "1.2.0",
|
|
32
|
-
"@milaboratories/
|
|
32
|
+
"@milaboratories/ts-builder": "1.2.2"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"type-check": "ts-builder types --target node",
|
|
@@ -20,7 +20,7 @@ export function mapRemoteToAbsolute(
|
|
|
20
20
|
*
|
|
21
21
|
* If prefix = "nested-path/", paths like "somefile.txt" will be transformed to "nested-path/somefile.txt".
|
|
22
22
|
*
|
|
23
|
-
* @param prefix prefix to add to the
|
|
23
|
+
* @param prefix prefix to add to the relative path, slash at the end will be added automatically if missed
|
|
24
24
|
*/
|
|
25
25
|
export function addPrefixToRelative(
|
|
26
26
|
prefix: string,
|
package/src/block_settings.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type VersionLock = 'major' | 'minor' | 'patch';
|
|
|
15
15
|
* currently only updates.
|
|
16
16
|
* */
|
|
17
17
|
export type BlockSettings = {
|
|
18
|
-
/** Only version
|
|
18
|
+
/** Only version strictly greater that this one will be suggested for auto-update. */
|
|
19
19
|
skipVersion?: string;
|
|
20
20
|
/**
|
|
21
21
|
* If certain version locking policy is set, auto-updates will only be suggested,
|
package/src/block_state.ts
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
|
-
import type { BlockOutputsBase, BlockState } from '@milaboratories/pl-model-common';
|
|
1
|
+
import type { AuthorMarker, BlockOutputsBase, BlockState, NavigationState } from '@milaboratories/pl-model-common';
|
|
2
2
|
import type { Optional } from 'utility-types';
|
|
3
3
|
|
|
4
|
+
// @deprecated TODO v3: keep this name, or rename to BlockStateInternalLegacy?
|
|
4
5
|
export type BlockStateInternal<
|
|
5
6
|
Args = unknown,
|
|
6
7
|
Outputs extends BlockOutputsBase = BlockOutputsBase,
|
|
7
8
|
UiState = unknown,
|
|
8
9
|
Href extends `/${string}` = `/${string}`,
|
|
9
10
|
> = Optional<Readonly<BlockState<Args, Outputs, UiState, Href>>, 'outputs'>;
|
|
11
|
+
|
|
12
|
+
// TODO: we should move this abstract convert for middle layer to the model
|
|
13
|
+
export type BlockStateInternalV3<
|
|
14
|
+
Outputs extends BlockOutputsBase = BlockOutputsBase,
|
|
15
|
+
Href extends `/${string}` = `/${string}`,
|
|
16
|
+
> = {
|
|
17
|
+
/** Raw block storage - UI derives data using sdk/model */
|
|
18
|
+
readonly blockStorage: unknown;
|
|
19
|
+
|
|
20
|
+
/** Outputs rendered with block config */
|
|
21
|
+
outputs?: Outputs;
|
|
22
|
+
|
|
23
|
+
/** Current navigation state */
|
|
24
|
+
readonly navigationState: NavigationState<Href>;
|
|
25
|
+
|
|
26
|
+
readonly author: AuthorMarker | undefined;
|
|
27
|
+
};
|
package/src/project_overview.ts
CHANGED
|
@@ -170,4 +170,11 @@ export type BlockStateOverview = {
|
|
|
170
170
|
|
|
171
171
|
/** Current navigation state of the block */
|
|
172
172
|
navigationState: NavigationState;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Block storage info as JSON string (e.g., '{"stateVersion": 1}').
|
|
176
|
+
* Resolved by calling a function from the model.
|
|
177
|
+
* Undefined when block-pack for this block is not yet materialized.
|
|
178
|
+
*/
|
|
179
|
+
blockStorageInfo: string | undefined;
|
|
173
180
|
};
|