@milaboratories/milaboratories.pool-explorer.model 1.0.126 → 1.1.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/index.cjs CHANGED
@@ -2,8 +2,11 @@
2
2
 
3
3
  var model = require('@platforma-sdk/model');
4
4
 
5
- const platforma = model.BlockModel.create('Heavy')
6
- .withArgs({ titleArg: 'The title' })
5
+ const dataModel = model.DataModel.create(() => ({ titleArgs: 'The title' }));
6
+ const platforma = model.BlockModelV3.create({ dataModel, renderingMode: 'Heavy' })
7
+ .args((data) => {
8
+ return { titleArgs: data.titleArgs };
9
+ })
7
10
  .output('allSpecs', (ctx) => ctx.resultPool.getSpecs())
8
11
  .sections((_ctx) => {
9
12
  return [{ type: 'link', href: '/', label: 'Main' }];
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import { BlockModel, type InferHrefType, type InferOutputsType } from '@platforma-sdk/model';\n\nexport type BlockArgs = {\n titleArg: string;\n};\n\nexport const platforma = BlockModel.create('Heavy')\n\n .withArgs<BlockArgs>({ titleArg: 'The title' })\n\n .output('allSpecs', (ctx) => ctx.resultPool.getSpecs())\n\n .sections((_ctx) => {\n return [{ type: 'link', href: '/', label: 'Main' }];\n })\n\n .title((_ctx) => 'Pool explorer')\n\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof platforma>;\nexport type Href = InferHrefType<typeof platforma>;\n"],"names":["BlockModel"],"mappings":";;;;MAMa,SAAS,GAAGA,gBAAU,CAAC,MAAM,CAAC,OAAO;AAE/C,KAAA,QAAQ,CAAY,EAAE,QAAQ,EAAE,WAAW,EAAE;AAE7C,KAAA,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,UAAU,CAAC,QAAQ,EAAE;AAErD,KAAA,QAAQ,CAAC,CAAC,IAAI,KAAI;AACjB,IAAA,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACrD,CAAC;AAEA,KAAA,KAAK,CAAC,CAAC,IAAI,KAAK,eAAe;AAE/B,KAAA,IAAI;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import { BlockModelV3, DataModel, type InferHrefType, type InferOutputsType } from '@platforma-sdk/model';\n\nexport type BlockData = {\n titleArgs: string;\n};\n\nexport type BlockArgs = BlockData;\n\nconst dataModel = DataModel.create<BlockData>(() => ({ titleArgs: 'The title' }));\n\nexport const platforma = BlockModelV3.create({ dataModel, renderingMode: 'Heavy' })\n\n .args<BlockArgs>((data) => {\n return { titleArgs: data.titleArgs };\n })\n\n .output('allSpecs', (ctx) => ctx.resultPool.getSpecs())\n\n .sections((_ctx) => {\n return [{ type: 'link', href: '/', label: 'Main' }];\n })\n\n .title((_ctx) => 'Pool explorer')\n\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof platforma>;\nexport type Href = InferHrefType<typeof platforma>;\n"],"names":["DataModel","BlockModelV3"],"mappings":";;;;AAQA,MAAM,SAAS,GAAGA,eAAS,CAAC,MAAM,CAAY,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC;AAE1E,MAAM,SAAS,GAAGC,kBAAY,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE;AAE/E,KAAA,IAAI,CAAY,CAAC,IAAI,KAAI;AACxB,IAAA,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE;AACtC,CAAC;AAEA,KAAA,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,UAAU,CAAC,QAAQ,EAAE;AAErD,KAAA,QAAQ,CAAC,CAAC,IAAI,KAAI;AACjB,IAAA,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACrD,CAAC;AAEA,KAAA,KAAK,CAAC,CAAC,IAAI,KAAK,eAAe;AAE/B,KAAA,IAAI;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { type InferHrefType, type InferOutputsType } from '@platforma-sdk/model';
2
- export type BlockArgs = {
3
- titleArg: string;
2
+ export type BlockData = {
3
+ titleArgs: string;
4
4
  };
5
- export declare const platforma: import("@platforma-sdk/model").PlatformaExtended<import("@platforma-sdk/model").PlatformaV1<BlockArgs, {
6
- allSpecs: import("@platforma-sdk/model").OutputWithStatus<{
5
+ export type BlockArgs = BlockData;
6
+ export declare const platforma: import("@platforma-sdk/model").PlatformaExtended<import("@platforma-sdk/model").PlatformaV3<BlockData, import("@platforma-sdk/model").InferOutputsFromLambdas<{
7
+ allSpecs: import("@platforma-sdk/model").ConfigRenderLambda<{
7
8
  readonly entries: {
8
9
  readonly ref: {
9
10
  readonly __isRef: true;
@@ -23,12 +24,8 @@ export declare const platforma: import("@platforma-sdk/model").PlatformaExtended
23
24
  };
24
25
  }[];
25
26
  readonly isComplete: boolean;
26
- }> & {
27
- __unwrap: true;
28
- };
29
- }, {
30
- [x: string]: never;
31
- }, "/">>;
27
+ }>;
28
+ }>, BlockData, "/">>;
32
29
  export type BlockOutputs = InferOutputsType<typeof platforma>;
33
30
  export type Href = InferHrefType<typeof platforma>;
34
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7F,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;QAYb,CAAC;AAEV,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9D,MAAM,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE1G,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC;AAIlC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;oBAcb,CAAC;AAEV,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9D,MAAM,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,SAAS,CAAC,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,10 @@
1
- import { BlockModel } from '@platforma-sdk/model';
1
+ import { DataModel, BlockModelV3 } from '@platforma-sdk/model';
2
2
 
3
- const platforma = BlockModel.create('Heavy')
4
- .withArgs({ titleArg: 'The title' })
3
+ const dataModel = DataModel.create(() => ({ titleArgs: 'The title' }));
4
+ const platforma = BlockModelV3.create({ dataModel, renderingMode: 'Heavy' })
5
+ .args((data) => {
6
+ return { titleArgs: data.titleArgs };
7
+ })
5
8
  .output('allSpecs', (ctx) => ctx.resultPool.getSpecs())
6
9
  .sections((_ctx) => {
7
10
  return [{ type: 'link', href: '/', label: 'Main' }];
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { BlockModel, type InferHrefType, type InferOutputsType } from '@platforma-sdk/model';\n\nexport type BlockArgs = {\n titleArg: string;\n};\n\nexport const platforma = BlockModel.create('Heavy')\n\n .withArgs<BlockArgs>({ titleArg: 'The title' })\n\n .output('allSpecs', (ctx) => ctx.resultPool.getSpecs())\n\n .sections((_ctx) => {\n return [{ type: 'link', href: '/', label: 'Main' }];\n })\n\n .title((_ctx) => 'Pool explorer')\n\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof platforma>;\nexport type Href = InferHrefType<typeof platforma>;\n"],"names":[],"mappings":";;MAMa,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO;AAE/C,KAAA,QAAQ,CAAY,EAAE,QAAQ,EAAE,WAAW,EAAE;AAE7C,KAAA,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,UAAU,CAAC,QAAQ,EAAE;AAErD,KAAA,QAAQ,CAAC,CAAC,IAAI,KAAI;AACjB,IAAA,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACrD,CAAC;AAEA,KAAA,KAAK,CAAC,CAAC,IAAI,KAAK,eAAe;AAE/B,KAAA,IAAI;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { BlockModelV3, DataModel, type InferHrefType, type InferOutputsType } from '@platforma-sdk/model';\n\nexport type BlockData = {\n titleArgs: string;\n};\n\nexport type BlockArgs = BlockData;\n\nconst dataModel = DataModel.create<BlockData>(() => ({ titleArgs: 'The title' }));\n\nexport const platforma = BlockModelV3.create({ dataModel, renderingMode: 'Heavy' })\n\n .args<BlockArgs>((data) => {\n return { titleArgs: data.titleArgs };\n })\n\n .output('allSpecs', (ctx) => ctx.resultPool.getSpecs())\n\n .sections((_ctx) => {\n return [{ type: 'link', href: '/', label: 'Main' }];\n })\n\n .title((_ctx) => 'Pool explorer')\n\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof platforma>;\nexport type Href = InferHrefType<typeof platforma>;\n"],"names":[],"mappings":";;AAQA,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAY,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC;AAE1E,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE;AAE/E,KAAA,IAAI,CAAY,CAAC,IAAI,KAAI;AACxB,IAAA,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE;AACtC,CAAC;AAEA,KAAA,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,UAAU,CAAC,QAAQ,EAAE;AAErD,KAAA,QAAQ,CAAC,CAAC,IAAI,KAAI;AACjB,IAAA,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACrD,CAAC;AAEA,KAAA,KAAK,CAAC,CAAC,IAAI,KAAK,eAAe;AAE/B,KAAA,IAAI;;;;"}