@milaboratories/milaboratories.pool-explorer.model 1.1.5 → 1.1.6

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,7 +2,10 @@
2
2
 
3
3
  var model = require('@platforma-sdk/model');
4
4
 
5
- const dataModel = model.DataModel.create(() => ({ titleArgs: 'The title' }));
5
+ const Version = model.defineDataVersions({ V1: model.DATA_MODEL_DEFAULT_VERSION });
6
+ const dataModel = new model.DataModelBuilder()
7
+ .from(Version.V1)
8
+ .init(() => ({ titleArgs: 'The title' }));
6
9
  const platforma = model.BlockModelV3.create({ dataModel, renderingMode: 'Heavy' })
7
10
  .args((data) => {
8
11
  return { titleArgs: data.titleArgs };
@@ -1 +1 @@
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;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import {\n BlockModelV3,\n DATA_MODEL_DEFAULT_VERSION,\n DataModelBuilder,\n defineDataVersions,\n type InferHrefType,\n type InferOutputsType,\n} from '@platforma-sdk/model';\n\nexport type BlockData = {\n titleArgs: string;\n};\n\nexport type BlockArgs = BlockData;\n\nconst Version = defineDataVersions({ V1: DATA_MODEL_DEFAULT_VERSION });\n\ntype VersionedData = { [Version.V1]: BlockData };\n\nconst dataModel = new DataModelBuilder<VersionedData>()\n .from(Version.V1)\n .init(() => ({ 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":["defineDataVersions","DATA_MODEL_DEFAULT_VERSION","DataModelBuilder","BlockModelV3"],"mappings":";;;;AAeA,MAAM,OAAO,GAAGA,wBAAkB,CAAC,EAAE,EAAE,EAAEC,g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ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC;AAUlC,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,6 +1,9 @@
1
- import { DataModel, BlockModelV3 } from '@platforma-sdk/model';
1
+ import { defineDataVersions, DATA_MODEL_DEFAULT_VERSION, DataModelBuilder, BlockModelV3 } from '@platforma-sdk/model';
2
2
 
3
- const dataModel = DataModel.create(() => ({ titleArgs: 'The title' }));
3
+ const Version = defineDataVersions({ V1: DATA_MODEL_DEFAULT_VERSION });
4
+ const dataModel = new DataModelBuilder()
5
+ .from(Version.V1)
6
+ .init(() => ({ titleArgs: 'The title' }));
4
7
  const platforma = BlockModelV3.create({ dataModel, renderingMode: 'Heavy' })
5
8
  .args((data) => {
6
9
  return { titleArgs: data.titleArgs };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import {\n BlockModelV3,\n DATA_MODEL_DEFAULT_VERSION,\n DataModelBuilder,\n defineDataVersions,\n type InferHrefType,\n type InferOutputsType,\n} from '@platforma-sdk/model';\n\nexport type BlockData = {\n titleArgs: string;\n};\n\nexport type BlockArgs = BlockData;\n\nconst Version = defineDataVersions({ V1: DATA_MODEL_DEFAULT_VERSION });\n\ntype VersionedData = { [Version.V1]: BlockData };\n\nconst dataModel = new DataModelBuilder<VersionedData>()\n .from(Version.V1)\n .init(() => ({ 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":";;AAeA,MAAM,OAAO,GAAG,kBAAkB,CAAC,EAAE,EAAE,EAAE,0BAA0B,EAAE,CAAC;AAItE,MAAM,SAAS,GAAG,IAAI,gBAAgB;AACnC,KAAA,IAAI,CAAC,OAAO,CAAC,EAAE;AACf,KAAA,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC;AAEpC,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;;;;"}